Overview
This module determines the desired heading and altitude of the aircraft and manages the waypoints (also called “path nodes”) of the plane’s flight path. The module takes in GPS coordinates and altitude measurements and calculates the heading and altitude the plane needs to stay on course. Additionally, the module takes instructions from the state machine to modify the waypoints in the plane’s flight path.
...
Figuring out where the tangent will touch requires some basic trigonometry. [WILL TOUCH ON LATER]. The coordinates at which this occurs can be calculated using:
...
Code Block | ||
---|---|---|
| ||
/* * Public Function!! * @param _Gps_Data currentPosition -> contains the current coordinates, altitude, and heading */ void get_next_directions(_Gps_Data currentPosition); //Updates the _WaypointManager_Data structure with new values |
...
/*
* Public Function!!
* @param _WaypointManager_Data &Data -> Memory address for a structure that holds the data for the state machine
*/
_WaypointManager_Data GetResult(_WaypointManager_Data &Data); |
State machine calls the
get_next_directions()
and passes in appropriate parameters.Algorithm stuff [ADD LATER]
State machine calls
GetResult
and passes in a reference address for a_WaypointManager_Data
structure.The function sets the members of the structure using the newly calculated values.
Modifying waypointBuffer Array:
...