Skyward boardcore
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Boardcore::Follower Class Reference

Follower class to output the yaw ad pitch necessary to track from the GPS origin the rocket. Computes the angle to follow the rocket using its NAS origin, NED position and velocity. More...

#include <Follower.h>

Inheritance diagram for Boardcore::Follower:
Collaboration diagram for Boardcore::Follower:

Public Member Functions

 Follower (std::chrono::milliseconds updatePeriod)
 Constructor of the follower class.
 
bool init () override
 Check that both the antenna and rocket coordinates have been set.
 
void setAntennaCoordinates (const GPSData &gpsData)
 Setter for the GPS coordinates of the antenna.
 
void setRocketNASOrigin (const GPSData &gpsData)
 Setter for the GPS coordinates of the rocket's NAS origin reference.
 
void setLastRocketNasState (const NASState &nasState)
 Setter for the NAS state of the rocket.
 
void setLastAntennaAttitude (const VN300Data &attitudeData)
 Setter for the attitude of the antenna.
 
bool setMaxGain (float yawGainNew, float pitchGainNew)
 Set the maximum gain for the yaw and pitch.
 
FollowerState getState ()
 Synchronized getter for the State of the follower algorithm.
 
AntennaAngles getTargetAngles ()
 Getter for the target antenna position computed by the algorithm.
 
- Public Member Functions inherited from Boardcore::Algorithm
void begin ()
 Starts the execution of the algorithm and set the running flag to true.
 
void end ()
 Terminates the algorithm's execution and sets the running flag to false.
 
void update ()
 Checks wether the algorithm is in a running state or not, and eventually calls the.
 
bool isRunning ()
 

Additional Inherited Members

- Protected Attributes inherited from Boardcore::Algorithm
std::atomic< bool > running {false}
 

Detailed Description

Follower class to output the yaw ad pitch necessary to track from the GPS origin the rocket. Computes the angle to follow the rocket using its NAS origin, NED position and velocity.

Definition at line 52 of file Follower.h.

Constructor & Destructor Documentation

◆ Follower()

Boardcore::Follower::Follower ( std::chrono::milliseconds updatePeriod)
explicit

Constructor of the follower class.

Parameters
updatePeriodThe period of update of the follower algorithm [ms].

Definition at line 53 of file Follower.cpp.

Member Function Documentation

◆ getState()

FollowerState Boardcore::Follower::getState ( )

Synchronized getter for the State of the follower algorithm.

Returns
The state of the follower algorithm.

Definition at line 100 of file Follower.cpp.

◆ getTargetAngles()

AntennaAngles Boardcore::Follower::getTargetAngles ( )

Getter for the target antenna position computed by the algorithm.

Returns
The target antenna positions.

Definition at line 112 of file Follower.cpp.

◆ init()

bool Boardcore::Follower::init ( )
overridevirtual

Check that both the antenna and rocket coordinates have been set.

Returns
true if initial rocket-antenna distance has been set, false otherwise.

Implements Boardcore::Algorithm.

Definition at line 132 of file Follower.cpp.

◆ setAntennaCoordinates()

void Boardcore::Follower::setAntennaCoordinates ( const GPSData & gpsData)

Setter for the GPS coordinates of the antenna.

Note
No checks for the GPS fix are done

Definition at line 58 of file Follower.cpp.

◆ setLastAntennaAttitude()

void Boardcore::Follower::setLastAntennaAttitude ( const VN300Data & attitudeData)

Setter for the attitude of the antenna.

Parameters
attitudeDataThe VN300 data containing the attitude of the antenna (yaw, pitch)

Definition at line 74 of file Follower.cpp.

◆ setLastRocketNasState()

void Boardcore::Follower::setLastRocketNasState ( const NASState & nasState)

Setter for the NAS state of the rocket.

Definition at line 87 of file Follower.cpp.

◆ setMaxGain()

bool Boardcore::Follower::setMaxGain ( float yawGainNew,
float pitchGainNew )

Set the maximum gain for the yaw and pitch.

Parameters
yawGainNewthe gain for the yaw
pitchGainNewthe gain for the pitch
Returns
true if set correctly
false if negative or over the maximum limits

Definition at line 118 of file Follower.cpp.

◆ setRocketNASOrigin()

void Boardcore::Follower::setRocketNASOrigin ( const GPSData & gpsData)

Setter for the GPS coordinates of the rocket's NAS origin reference.

Note
No checks for the GPS fix are done

Definition at line 66 of file Follower.cpp.


The documentation for this class was generated from the following files: