Avionics
Core avionics package for CURE flight computers
Loading...
Searching...
No Matches
ApogeeDetector.h
Go to the documentation of this file.
1#ifndef APOGEE_DETECTOR_H
2#define APOGEE_DETECTOR_H
3
4#include <cstdint>
5
8
16
34public:
39 explicit ApogeeDetector(float apogeeThreshold_m);
40
45
50 void init(ApogeeDetectorInitialState initialState);
51
56 void update(VerticalVelocityEstimator* verticalVelocityEstimator);
57
62 bool isApogeeDetected() const;
63
69 DataPoint getApogee() const;
70
75 float getEstimatedAltitude() const;
76
81 float getEstimatedVelocity() const;
82
88
93 int8_t getVerticalAxis() const;
94
99 int8_t getVerticalDirection() const;
100
101private:
102 bool apogee_flag = false;
103 float apogeeThreshold_m = 1.0F;
104
105 float maxAltitude = 0.0F;
106 uint32_t maxAltitudeTimestamp = 0;
107};
108
109#endif // APOGEE_DETECTOR_H
ApogeeDetector(float apogeeThreshold_m)
Constructs an ApogeeDetector with a custom drop threshold.
bool isApogeeDetected() const
Checks if apogee has been detected.
DataPoint getApogee() const
Retrieves the detected apogee.
float getEstimatedVelocity() const
Gets the current estimated vertical velocity.
int8_t getVerticalDirection() const
Gets the configured vertical direction (+1 or -1).
float getInertialVerticalAcceleration() const
Gets the current inertial vertical acceleration.
int8_t getVerticalAxis() const
Gets the configured vertical axis.
void update(VerticalVelocityEstimator *verticalVelocityEstimator)
Updates the detector using the latest estimated altitude and vertical velocity.
void init(ApogeeDetectorInitialState initialState)
Initializes the detector with the starting altitude and timestamp.
ApogeeDetector()
Constructs an ApogeeDetector with the default threshold of 1.0 meter.
float getEstimatedAltitude() const
Gets the current estimated altitude.
Timestamped float measurement container.
Definition DataPoint.h:11
1D Kalman filter fusing altimeter and accelerometer data.
Represents the initial state for initializing the ApogeeDetector.
float initialAltitude
Initial altitude in meters.
uint32_t initialTimestamp
Initial timestamp in milliseconds.