UAV Simulator
|
Guidance, Navigation, and Control system for the aircraft. More...
#include <gnc.h>
Classes | |
struct | TrimData |
Public Member Functions | |
GNC () | |
void | setWaypoints (const WaypointList &waypoints) |
Set the waypoints for the navigation system. | |
void | update (const Aircraft &aircraft, float dt) |
Update the GNC system state. | |
bool | computeTrim (Aircraft &aircraft, double Va, double gamma, double R) |
bool | linearizeAtTrim (Aircraft &drone) |
void | computeLinearModel (Aircraft &aircraft, const Eigen::VectorXd &Xtrim, const Eigen::VectorXd &Utrim, Eigen::MatrixXd &A_full, Eigen::MatrixXd &B_full, Eigen::MatrixXd &A_lat, Eigen::MatrixXd &B_lat, Eigen::MatrixXd &A_lon, Eigen::MatrixXd &B_lon) |
const TrimData & | getTrimData () const |
const Eigen::MatrixXd & | getA () const |
const Eigen::MatrixXd & | getB () const |
const Eigen::MatrixXd & | getA_lat () const |
const Eigen::MatrixXd & | getB_lat () const |
const Eigen::MatrixXd & | getA_lon () const |
const Eigen::MatrixXd & | getB_lon () const |
Static Public Member Functions | |
static double | trimObjective (const std::vector< double > &angles, std::vector< double > &grad, void *data) |
static Eigen::VectorXd | computeXdot (Aircraft &ac) |
Private Attributes | |
WaypointList | waypoints_ |
Current list of waypoints for navigation. | |
TrimData | trimData |
Eigen::MatrixXd | A |
Eigen::MatrixXd | B |
Eigen::MatrixXd | A_lat |
Eigen::MatrixXd | B_lat |
Eigen::MatrixXd | A_lon |
Eigen::MatrixXd | B_lon |
Friends | |
class | Simviewer |
Guidance, Navigation, and Control system for the aircraft.
This class manages the navigation through a list of waypoints and updates control commands based on the current state of the aircraft.
GNC::GNC | ( | ) |
void GNC::computeLinearModel | ( | Aircraft & | aircraft, |
const Eigen::VectorXd & | Xtrim, | ||
const Eigen::VectorXd & | Utrim, | ||
Eigen::MatrixXd & | A_full, | ||
Eigen::MatrixXd & | B_full, | ||
Eigen::MatrixXd & | A_lat, | ||
Eigen::MatrixXd & | B_lat, | ||
Eigen::MatrixXd & | A_lon, | ||
Eigen::MatrixXd & | B_lon | ||
) |
bool GNC::computeTrim | ( | Aircraft & | aircraft, |
double | Va, | ||
double | gamma, | ||
double | R | ||
) |
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool GNC::linearizeAtTrim | ( | Aircraft & | drone | ) |
void GNC::setWaypoints | ( | const WaypointList & | waypoints | ) |
Set the waypoints for the navigation system.
Set the waypoints for the GNC system.
waypoints | The list of waypoints to follow. |
waypoints | The list of waypoints to navigate. |
|
static |
void GNC::update | ( | const Aircraft & | aircraft, |
float | dt | ||
) |
Update the GNC system state.
Update the GNC system with the current aircraft state.
This function should be called every simulation step and will process the aircraft state to produce new control commands.
aircraft | The current state of the aircraft. |
dt | Time step in seconds. |
This function processes the aircraft's current position and determines navigation commands based on the active waypoint. If the aircraft is close enough to the current waypoint, it automatically advances to the next.
aircraft | Current aircraft state. |
dt | Time step duration in seconds. |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Current list of waypoints for navigation.