Avionics
Core avionics package for CURE flight computers
Loading...
Searching...
No Matches
States.h
Go to the documentation of this file.
1
#ifndef FLIGHT_STATES_H
2
#define FLIGHT_STATES_H
3
4
#include <cstdint>
// For uint8_t
5
6
// Not all states are used by all state machines
7
// Order matters, systems rely on comparisons like `current_state` > STATE_ASCENT to know if the
8
// flight has passed the ascent state and is now falling. So states are ordered from earliest to latest.
9
// The literal value of these states should never be used because a new state can be added
10
// in between existing states, shifting their values. B/c we tag the version of Avionics used for each flight,
11
// we can come back here to see the numerical values of each state when decoding the logs. The ground station
12
// keeps YAMLs of these state definitions every time they are changed. To avoid having a bunch of YAMLs we try
13
// to keep these values semi-stable, which is why it includes states that aren't currently used to be forward-compatible.
14
// Keep in mind that there is a difference between states and events. For example,
15
// apogee is an event that causes a transition from STATE_ASCENT to STATE_DESCENT, but it is not a state itself.
16
// The state machines are in charge of detecting these transitions and updating the states.
17
enum
FlightState
: uint8_t {
18
STATE_UNARMED
= 0,
// 0 This may not necessarily always be the 0th state, or the first state. A state could be added before it.
19
STATE_ARMED
,
// 1
20
STATE_SOFT_ASCENT
,
// 2
21
STATE_ASCENT
,
// 3 Don't use the ascent state if you are already using powered ascent and coast ascent
22
STATE_POWERED_ASCENT
,
// 4
23
STATE_COAST_ASCENT
,
// 5
24
STATE_DESCENT
,
// 6
25
STATE_DROGUE_DEPLOYED
,
// 7
26
STATE_MAIN_DEPLOYED
,
// 8
27
STATE_LANDED
,
// 9
28
};
29
30
#endif
FlightState
FlightState
Definition
States.h:17
STATE_MAIN_DEPLOYED
@ STATE_MAIN_DEPLOYED
Definition
States.h:26
STATE_ARMED
@ STATE_ARMED
Definition
States.h:19
STATE_LANDED
@ STATE_LANDED
Definition
States.h:27
STATE_ASCENT
@ STATE_ASCENT
Definition
States.h:21
STATE_DROGUE_DEPLOYED
@ STATE_DROGUE_DEPLOYED
Definition
States.h:25
STATE_SOFT_ASCENT
@ STATE_SOFT_ASCENT
Definition
States.h:20
STATE_UNARMED
@ STATE_UNARMED
Definition
States.h:18
STATE_COAST_ASCENT
@ STATE_COAST_ASCENT
Definition
States.h:23
STATE_DESCENT
@ STATE_DESCENT
Definition
States.h:24
STATE_POWERED_ASCENT
@ STATE_POWERED_ASCENT
Definition
States.h:22
include
state_estimation
States.h
Generated by
1.16.1