Avionics
Core avionics package for CURE flight computers
Loading...
Searching...
No Matches
BurnoutStateMachine Class Reference

State machine variant that explicitly models motor burnout before coast. More...

#include <BurnoutStateMachine.h>

Inheritance diagram for BurnoutStateMachine:
Inheritance graph
Collaboration diagram for BurnoutStateMachine:
Collaboration graph

Public Member Functions

 BurnoutStateMachine (IDataSaver *dataSaver, LaunchDetector *launchDetector, ApogeeDetector *apogeeDetector, VerticalVelocityEstimator *verticalVelocityEstimator)
 Construct with logging and detector dependencies.
int update (const AccelerationTriplet &accel, const DataPoint &alt) override
 Update machine with new sensor inputs and transition on burnout cues.
Public Member Functions inherited from BaseStateMachine
 BaseStateMachine (FlightState initialState=STATE_UNARMED)
virtual ~BaseStateMachine ()=default
virtual uint8_t getState () const
 Current discrete state identifier.
bool registerOnStateEntry (FlightState targetState, StateEntryCallback functionPtr)
 Register a callback to invoke each time a target state is entered.

Additional Inherited Members

Public Types inherited from BaseStateMachine
using StateEntryCallback = void (*)()
Static Public Member Functions inherited from BaseStateMachine
static constexpr std::size_t getMaxStateEntryCallbacks ()
Static Public Attributes inherited from BaseStateMachine
static constexpr std::size_t kMaxStateEntryCallbacks = 32
Protected Member Functions inherited from BaseStateMachine
bool changeState (FlightState newState)
 Transition to a new state and trigger registered on-entry callbacks.
FlightState getFlightState () const
 Current state as FlightState enum.

Detailed Description

State machine variant that explicitly models motor burnout before coast.

Note
When to use: flights requiring a distinct burnout phase separate from powered ascent and coast, originally designed for aerobrake testing.

Definition at line 18 of file BurnoutStateMachine.h.

Constructor & Destructor Documentation

◆ BurnoutStateMachine()

BurnoutStateMachine::BurnoutStateMachine ( IDataSaver * dataSaver,
LaunchDetector * launchDetector,
ApogeeDetector * apogeeDetector,
VerticalVelocityEstimator * verticalVelocityEstimator )

Construct with logging and detector dependencies.

Parameters
dataSaverLogger used to persist transitions.
launchDetectorLaunch detector instance.
apogeeDetectorApogee detector instance.
verticalVelocityEstimatorVertical velocity estimator instance.
Note
When to use: setup time wiring of components prior to loop.

Definition at line 8 of file BurnoutStateMachine.cpp.

Member Function Documentation

◆ update()

int BurnoutStateMachine::update ( const AccelerationTriplet & accel,
const DataPoint & alt )
overridevirtual

Update machine with new sensor inputs and transition on burnout cues.

Parameters
accelLatest acceleration readings.
altLatest altitude sample.
Note
When to use: call each sensor update; return value can reflect transition outcomes.

Implements BaseStateMachine.

Definition at line 21 of file BurnoutStateMachine.cpp.


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