|
Avionics
Core avionics package for CURE flight computers
|
Predicts time‑to‑apogee and altitude‑at‑apogee from real‑time kinematics. More...
#include <ApogeePredictor.h>

Public Member Functions | |
| ApogeePredictor (const VerticalVelocityEstimator &velocityEstimator, float accelFilterAlpha=0.2F, float minimumClimbVelocity_ms=1.0F) | |
| void | update () |
| void | quad_update () |
| void | poly_update () |
| bool | isPredictionValid () const |
| float | getTimeToApogee_s () const |
| uint32_t | getPredictedApogeeTimestamp_ms () const |
| float | getPredictedApogeeAltitude_m () const |
| float | getFilteredDeceleration () const |
Predicts time‑to‑apogee and altitude‑at‑apogee from real‑time kinematics.
The predictor treats the current deceleration (loss of vertical velocity) as constant and analytically projects forward:
t_apogee = v / |a| (time until v → 0) h_apogee = h + v·t − ½|a|t²
where v and a are the filtered estimates of vertical velocity and net vertical acceleration supplied by the VerticalVelocityEstimator.
To damp sensor noise, we run a single‑pole low‑pass filter on the measured deceleration magnitude. Call update() after each estimator refresh.
Definition at line 26 of file ApogeePredictor.h.
|
explicit |
| velocityEstimator | Reference to the velocity estimator |
| accelFilterAlpha | EMA weight for smoothing deceleration [0–1] |
| minimumClimbVelocity_ms | Minimum upward velocity (m/s) for a valid prediction |
Definition at line 25 of file ApogeePredictor.cpp.
|
nodiscard |
Definition at line 190 of file ApogeePredictor.cpp.
|
nodiscard |
Definition at line 186 of file ApogeePredictor.cpp.
|
nodiscard |
Definition at line 182 of file ApogeePredictor.cpp.
|
nodiscard |
Definition at line 178 of file ApogeePredictor.cpp.
|
nodiscard |
Definition at line 176 of file ApogeePredictor.cpp.
| void ApogeePredictor::poly_update | ( | ) |
Definition at line 105 of file ApogeePredictor.cpp.
| void ApogeePredictor::quad_update | ( | ) |
Optional: Update using a quadratic-drag model (more accurate under drag)
Definition at line 75 of file ApogeePredictor.cpp.
| void ApogeePredictor::update | ( | ) |
Call after every estimator refresh to update prediction
Definition at line 40 of file ApogeePredictor.cpp.