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

Predicts time‑to‑apogee and altitude‑at‑apogee from real‑time kinematics. More...

#include <ApogeePredictor.h>

Collaboration diagram for ApogeePredictor:
Collaboration graph

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

Detailed Description

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.

Note
When to use: provide early apogee timing/altitude estimates for telemetry or adaptive control while still ascending.

Definition at line 26 of file ApogeePredictor.h.

Constructor & Destructor Documentation

◆ ApogeePredictor()

ApogeePredictor::ApogeePredictor ( const VerticalVelocityEstimator & velocityEstimator,
float accelFilterAlpha = 0.2F,
float minimumClimbVelocity_ms = 1.0F )
explicit
Parameters
velocityEstimatorReference to the velocity estimator
accelFilterAlphaEMA weight for smoothing deceleration [0–1]
minimumClimbVelocity_msMinimum upward velocity (m/s) for a valid prediction

Definition at line 25 of file ApogeePredictor.cpp.

Member Function Documentation

◆ getFilteredDeceleration()

float ApogeePredictor::getFilteredDeceleration ( ) const
nodiscard

Definition at line 190 of file ApogeePredictor.cpp.

◆ getPredictedApogeeAltitude_m()

float ApogeePredictor::getPredictedApogeeAltitude_m ( ) const
nodiscard

Definition at line 186 of file ApogeePredictor.cpp.

◆ getPredictedApogeeTimestamp_ms()

uint32_t ApogeePredictor::getPredictedApogeeTimestamp_ms ( ) const
nodiscard

Definition at line 182 of file ApogeePredictor.cpp.

◆ getTimeToApogee_s()

float ApogeePredictor::getTimeToApogee_s ( ) const
nodiscard

Definition at line 178 of file ApogeePredictor.cpp.

◆ isPredictionValid()

bool ApogeePredictor::isPredictionValid ( ) const
nodiscard

Definition at line 176 of file ApogeePredictor.cpp.

◆ poly_update()

void ApogeePredictor::poly_update ( )

Definition at line 105 of file ApogeePredictor.cpp.

◆ quad_update()

void ApogeePredictor::quad_update ( )

Optional: Update using a quadratic-drag model (more accurate under drag)

Definition at line 75 of file ApogeePredictor.cpp.

◆ update()

void ApogeePredictor::update ( )

Call after every estimator refresh to update prediction

Definition at line 40 of file ApogeePredictor.cpp.


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