Skyward boardcore
|
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>
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. | |
![]() | |
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 | |
![]() | |
std::atomic< bool > | running {false} |
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.
|
explicit |
Constructor of the follower class.
updatePeriod | The period of update of the follower algorithm [ms]. |
Definition at line 53 of file Follower.cpp.
FollowerState Boardcore::Follower::getState | ( | ) |
Synchronized getter for the State of the follower algorithm.
Definition at line 100 of file Follower.cpp.
AntennaAngles Boardcore::Follower::getTargetAngles | ( | ) |
Getter for the target antenna position computed by the algorithm.
Definition at line 112 of file Follower.cpp.
|
overridevirtual |
Check that both the antenna and rocket coordinates have been set.
true
if initial rocket-antenna distance has been set, false
otherwise. Implements Boardcore::Algorithm.
Definition at line 132 of file Follower.cpp.
void Boardcore::Follower::setAntennaCoordinates | ( | const GPSData & | gpsData | ) |
Setter for the GPS coordinates of the antenna.
Definition at line 58 of file Follower.cpp.
void Boardcore::Follower::setLastAntennaAttitude | ( | const VN300Data & | attitudeData | ) |
Setter for the attitude of the antenna.
attitudeData | The VN300 data containing the attitude of the antenna (yaw, pitch) |
Definition at line 74 of file Follower.cpp.
void Boardcore::Follower::setLastRocketNasState | ( | const NASState & | nasState | ) |
Setter for the NAS state of the rocket.
Definition at line 87 of file Follower.cpp.
bool Boardcore::Follower::setMaxGain | ( | float | yawGainNew, |
float | pitchGainNew ) |
Set the maximum gain for the yaw and pitch.
yawGainNew | the gain for the yaw |
pitchGainNew | the gain for the pitch |
Definition at line 118 of file Follower.cpp.
void Boardcore::Follower::setRocketNASOrigin | ( | const GPSData & | gpsData | ) |
Setter for the GPS coordinates of the rocket's NAS origin reference.
Definition at line 66 of file Follower.cpp.