...
PM will check if the drone is under manual control by receiving a WaypointType
. If it is not under manual control, it will enter FlightStageSelectorMode
, the main part of the state machine. Within this mode, PM will change flight states if triggered to do so. While flying, PM may enter any of the following flight states: Disarmed
, Takeoff
, Cruising
, Landing
, and Landed
. Note: a Preflight
state may be added. If we are in the Disarmed
state or Landed
state PM will go back to the start. However, if we are in Takeoff
, Cruising
, or Landing
, PM will execute their respective stages.
To facilitate SM FatalFailure mode, the FatalFailure waypoint enum is added. When received, it will be passed directly to AM. Once AM shuts off actuators and sends an ack to SM, SM will stop PM and AM.
...
Important Structs
Note: These All messages to Path Manager will all be coming from System Manager in a single packet:
SM → PM
Code Block |
---|
typedef struct CommandsFromSM{ WaypointType waypoint_type; // not necessary TelemWaypointData telemetry_waypoint; CommandsFromTM telemetry_commands; LosSFData sf_data; } CommandsFromSM; |
where WaypointType is defined as
Code Block |
---|
enum WaypointType {PATH_FOLLOW = 0, ORBIT_FOLLOW, HOVER_WAYPOINT, TAKEOFF_WAYPOINT, LANDING_WAYPOINT, TRANSITION_WAYPOINT, MANUAL_WAYPOINT}; |
PM → AM Struct:
Code Block |
---|
typedef struct CommandsForAM_t{
2 WaypointType waypoint_type; // not necessary
3
4 // heading unit vector and magnitude
5 float dist_x;
6 float dist_y;
7 float dist_z;
8 float magnitude; // Magnitude distance to waypoint target
9 float heading; // heading at target waypoint
10 double speed_target; // Target velocity of drone approaching target
11} CommandsForAM; |
AM → PM Struct:
AM will send to PM an armed
flag to signal that we are ready to fly. Additional information TBD
Code Block |
---|
typedef struct CommandsFromAM{
bool armed;
} CommandsFromAM; |
TM → PM Struct:
, FATAL_FAILURE}; |
and CV will be sending a list of waypoints during Cruise and Search (sent through TM and SM) where a single waypoint is defined in the TelemWaypointData
struct below. The start_landing
flag will be signaled when a landing pad is found.
Code Block |
---|
struct TelemWaypointData {
double longitude; //
double lattiude;
uint8_t waypoint_id;
};
typedef struct CommandsFromTM{
bool start_landing;
uint8_t num_waypoints; // number of waypoints in the list
TelemWaypointData waypoints[num_waypoints];
} CommandsFromTM; |
PM → AM Struct:
Code Block |
---|
typedef struct CommandsForAM_t{
2 WaypointType waypoint_type; // not necessary
3
4 // heading unit vector and magnitude
5 float dist_x;
6 float dist_y;
7 float dist_z;
8 float magnitude; // Magnitude distance to waypoint target
9 float heading; // heading at target waypoint
10 double speed_target; // Target velocity of drone approaching target
11} CommandsForAM; |