UAV Simulator
Loading...
Searching...
No Matches
GNC Class Reference

Guidance, Navigation, and Control system for the aircraft. More...

#include <gnc.h>

Collaboration diagram for GNC:

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 TrimDatagetTrimData () 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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GNC()

GNC::GNC ( )

Member Function Documentation

◆ computeLinearModel()

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 
)

◆ computeTrim()

bool GNC::computeTrim ( Aircraft aircraft,
double  Va,
double  gamma,
double  R 
)

◆ computeXdot()

Eigen::VectorXd GNC::computeXdot ( Aircraft ac)
static

◆ getA()

const Eigen::MatrixXd & GNC::getA ( ) const
inline

◆ getA_lat()

const Eigen::MatrixXd & GNC::getA_lat ( ) const
inline

◆ getA_lon()

const Eigen::MatrixXd & GNC::getA_lon ( ) const
inline

◆ getB()

const Eigen::MatrixXd & GNC::getB ( ) const
inline

◆ getB_lat()

const Eigen::MatrixXd & GNC::getB_lat ( ) const
inline

◆ getB_lon()

const Eigen::MatrixXd & GNC::getB_lon ( ) const
inline

◆ getTrimData()

const TrimData & GNC::getTrimData ( ) const
inline

◆ linearizeAtTrim()

bool GNC::linearizeAtTrim ( Aircraft drone)

◆ setWaypoints()

void GNC::setWaypoints ( const WaypointList waypoints)

Set the waypoints for the navigation system.

Set the waypoints for the GNC system.

Parameters
waypointsThe list of waypoints to follow.
waypointsThe list of waypoints to navigate.

◆ trimObjective()

double GNC::trimObjective ( const std::vector< double > &  angles,
std::vector< double > &  grad,
void *  data 
)
static

◆ update()

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.

Parameters
aircraftThe current state of the aircraft.
dtTime 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.

Parameters
aircraftCurrent aircraft state.
dtTime step duration in seconds.

Friends And Related Symbol Documentation

◆ Simviewer

friend class Simviewer
friend

Member Data Documentation

◆ A

Eigen::MatrixXd GNC::A
private

◆ A_lat

Eigen::MatrixXd GNC::A_lat
private

◆ A_lon

Eigen::MatrixXd GNC::A_lon
private

◆ B

Eigen::MatrixXd GNC::B
private

◆ B_lat

Eigen::MatrixXd GNC::B_lat
private

◆ B_lon

Eigen::MatrixXd GNC::B_lon
private

◆ trimData

TrimData GNC::trimData
private

◆ waypoints_

WaypointList GNC::waypoints_
private

Current list of waypoints for navigation.


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