Avionics
Core avionics package for CURE flight computers
Loading...
Searching...
No Matches
FastLaunchDetector.h
Go to the documentation of this file.
1#ifndef FAST_LAUNCH_DETECTOR_H
2#define FAST_LAUNCH_DETECTOR_H
3 // need to figure out how to impliment checking for launch from LaunchDetector
7
8// Potential returns from the update function
9// Positive values are errors
10// Negative values are warnings
14 FLD_ACL_TOO_LOW = -2, // The acceleration is too low for launch
16};
17
18
20{
21public:
27 FastLaunchDetector(float accelerationThreshold, uint32_t confirmationWindow_ms = 500);
28
29 int update(AccelerationTriplet accel);
30
31 bool hasLaunched() const { return launched; }
32 uint32_t getLaunchedTime() const { return launchedTime_ms; }
33 uint32_t getConfirmationWindow() const { return confirmationWindow_ms; }
34 void reset();
35
36private:
37 float accelerationThresholdSq_ms2;
38
39 bool launched;
40 uint32_t launchedTime_ms;
41 uint32_t confirmationWindow_ms;
42};
43
44
45#endif
FastLaunchDetectorStatus
@ FLD_ACL_TOO_LOW
@ FLD_LAUNCH_DETECTED
@ FLD_ALREADY_LAUNCHED
@ FLD_DEFAULT_FAIL
int update(AccelerationTriplet accel)
uint32_t getLaunchedTime() const
uint32_t getConfirmationWindow() const
FastLaunchDetector(float accelerationThreshold, uint32_t confirmationWindow_ms=500)