6: apogeeThreshold_m(apogeeThreshold_m)
23 if (estimated_altitude_meters > maxAltitude) {
24 maxAltitude = estimated_altitude_meters;
25 maxAltitudeTimestamp = verticalVelocityEstimator->
getTimestamp();
30 if (!apogee_flag && ((maxAltitude - estimated_altitude_meters) >= apogeeThreshold_m) && (verticalVelocityEstimator->
getEstimatedVelocity() < 0)) {
45 return {maxAltitudeTimestamp, maxAltitude};
bool isApogeeDetected() const
Checks if apogee has been detected.
DataPoint getApogee() const
Retrieves the detected apogee.
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.
Timestamped float measurement container.
1D Kalman filter fusing altimeter and accelerometer data.
virtual float getEstimatedVelocity() const
virtual float getEstimatedAltitude() const
virtual uint32_t getTimestamp() const
Represents the initial state for initializing the ApogeeDetector.
float initialAltitude
Initial altitude in meters.
uint32_t initialTimestamp
Initial timestamp in milliseconds.