14#ifndef FLIGHTCONTROL_H
15#define FLIGHTCONTROL_H
76 uint32_t memory_bis[3];
Defines mission-critical constants and tunable parameters for the flight software.
void check_Main_phase(flight_fsm_t *fsm_state, estimation_output_t MotionData)
Handler for the MAIN state (descent under main parachute).
void check_Drogue_phase(flight_fsm_t *fsm_state, estimation_output_t MotionData)
Handler for the DROGUE state (descent under drogue parachute).
void check_Calibrating_phase(flight_fsm_t *fsm_state, estimation_output_t MotionData, linear_acceleration_t acc_data)
Handler for the CALIBRATING state.
void check_AbcsDeployed_phase(flight_fsm_t *fsm_state, estimation_output_t MotionData)
Handler for the ABCSDEPLOYED state (apogee control).
void check_flight_phase(flight_fsm_t *fsm_state, estimation_output_t MotionData, linear_acceleration_t acc_data)
Main FSM router function that delegates to the current state's handler.
void check_Liftoff_phase(flight_fsm_t *fsm_state, estimation_output_t MotionData)
Handler for the LIFTOFF state.
void check_Touchdown_phase(flight_fsm_t *fsm_state, estimation_output_t MotionData, linear_acceleration_t acc_data)
Handler for the TOUCHDOWN state.
void check_Burning_phase(flight_fsm_t *fsm_state, estimation_output_t MotionData)
Handler for the BURNING state (powered ascent).
void change_state_to(flight_fsm_t *fsm_state, flight_phase_t new_state)
Handles the mechanics of a state transition.
flight_phase_t
Enumeration of all possible flight phases (states) in the FSM.
@ CALIBRATING
On the launchpad, calibrating sensors.
@ MAIN
Main parachute has been deployed.
@ LIFTOFF
Rocket has cleared the launch rail.
@ ABCSDEPLOYED
Airbrakes are deployed for apogee control.
@ DROGUE
Drogue parachute has been deployed.
@ BURNING
Engine is burning; under powered ascent.
@ INVALID
An undefined or error state.
@ TOUCHDOWN
Rocket has landed.
: Header for main.c file. This file contains the common defines of the application.
Holds the primary outputs of the state estimation filter (e.g., Kalman filter).
float_t velocity
Vertical velocity in meters per second (m/s).
float_t height
Vertical altitude above ground level in meters (m).
float_t acceleration
Vertical acceleration in meters per second squared (m/s^2).
Main data structure for the Flight State Machine.
uint32_t thrust_trigger_time
Timestamp when initial thrust was detected.
linear_acceleration_t old_acc_data
Raw acceleration data from the previous cycle.
uint32_t clock_memory
Timestamp of the last state transition.
flight_phase_t flight_state
The current state of the FSM.
bool state_changed
Flag set to true for one cycle after a state change.
linear_acceleration_t old_gyro_data
Raw gyroscope data from the previous cycle.
Represents a 3-axis linear acceleration vector from an IMU.
float_t accZ
Acceleration along the Z-axis in m/s^2.
float_t accX
Acceleration along the X-axis in m/s^2.
float_t accY
Acceleration along the Y-axis in m/s^2.
Provides low-level hardware drivers, sensor initialization routines, and various utility functions fo...