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

Sliding-window launch detector based on acceleration magnitude. More...

#include <LaunchDetector.h>

Collaboration diagram for LaunchDetector:
Collaboration graph

Public Member Functions

 LaunchDetector (float accelerationThreshold_ms2, uint16_t windowSize_ms, uint16_t windowInterval_ms)
int update (AccelerationTriplet accel)
bool isLaunched ()
uint32_t getLaunchedTime ()
float getMedianAccelerationSquared ()
void reset ()
CircularArray< DataPoint > * getWindowPtr ()
float getThreshold ()
uint16_t getWindowInterval ()
uint16_t getAcceptableTimeDifference ()

Detailed Description

Sliding-window launch detector based on acceleration magnitude.

Predicts launch by looking for a sustained acceleration above a threshold It takes the median acceleration magnitude over a window of time and compares it to the threshold. Because of the size of the window, short spikes are ignored.

The window is a circular array / rolling window of acceleration magnitudes squared

The delay in launch detection will equal half the window size because the median will only be high once half the window is high

Note
When to use: detect liftoff robustly against spikes by requiring a sustained acceleration median over a configurable window.

Definition at line 48 of file LaunchDetector.h.

Constructor & Destructor Documentation

◆ LaunchDetector()

LaunchDetector::LaunchDetector ( float accelerationThreshold_ms2,
uint16_t windowSize_ms,
uint16_t windowInterval_ms )

Constructor

Parameters
accelerationThreshold_ms2The threshold for acceleration to be considered a launch
windowSize_msThe size of the window to calculate the median acceleration. The delay in launch detection will equal half the window size A window too small will cause false positives.
windowInterval_msThe interval between acceleration value in the window You must be able to update the detector faster than this interval The detector will reject data that comes in faster than this interval to maintain this interval or slower

Definition at line 9 of file LaunchDetector.cpp.

Member Function Documentation

◆ getAcceptableTimeDifference()

uint16_t LaunchDetector::getAcceptableTimeDifference ( )
inline

Definition at line 85 of file LaunchDetector.h.

◆ getLaunchedTime()

uint32_t LaunchDetector::getLaunchedTime ( )
inline

Definition at line 72 of file LaunchDetector.h.

◆ getMedianAccelerationSquared()

float LaunchDetector::getMedianAccelerationSquared ( )
inline

Definition at line 73 of file LaunchDetector.h.

◆ getThreshold()

float LaunchDetector::getThreshold ( )
inline

Definition at line 82 of file LaunchDetector.h.

◆ getWindowInterval()

uint16_t LaunchDetector::getWindowInterval ( )
inline

Definition at line 84 of file LaunchDetector.h.

◆ getWindowPtr()

CircularArray< DataPoint > * LaunchDetector::getWindowPtr ( )
inline

Definition at line 80 of file LaunchDetector.h.

◆ isLaunched()

bool LaunchDetector::isLaunched ( )
inline

Definition at line 71 of file LaunchDetector.h.

◆ reset()

void LaunchDetector::reset ( )

Definition at line 174 of file LaunchDetector.cpp.

◆ update()

int LaunchDetector::update ( AccelerationTriplet accel)

Updates the detector with new acceleration data

Parameters
accelThe newest acceleration data (triplet of x, y, and z acceleration data points)
Returns
: False if the data is ignored, true if the data is accepted

Definition at line 28 of file LaunchDetector.cpp.


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