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

1D Kalman filter fusing altimeter and accelerometer data. More...

#include <VerticalVelocityEstimator.h>

Collaboration diagram for VerticalVelocityEstimator:
Collaboration graph

Public Member Functions

 VerticalVelocityEstimator (NoiseVariances noise={1.0f, 0.1f})
void init (InitialState initialState)
void update (const AccelerationTriplet &accel, const DataPoint &altimeter)
virtual float getEstimatedAltitude () const
virtual float getEstimatedVelocity () const
virtual uint32_t getTimestamp () const
virtual float getInertialVerticalAcceleration () const
virtual int8_t getVerticalAxis () const
virtual int8_t getVerticalDirection () const

Detailed Description

1D Kalman filter fusing altimeter and accelerometer data.

Maintains altitude and vertical velocity by treating vertical acceleration as the control input. Gravity is subtracted from raw accelerometer readings to obtain inertial acceleration. Call update() with new IMU + baro samples and query the latest estimates via getters.

Note
Use when downstream logic (detectors, control, telemetry) needs filtered altitude/velocity without embedding apogee-specific behavior.

Definition at line 37 of file VerticalVelocityEstimator.h.

Constructor & Destructor Documentation

◆ VerticalVelocityEstimator()

VerticalVelocityEstimator::VerticalVelocityEstimator ( NoiseVariances noise = {1.0f, 0.1f})

Constructor.

Parameters
noiseStruct containing process and measurement noise variances.
  • accelNoiseVar: process noise variance due to unknown acceleration changes (e.g. (0.5 m/s²)² = 0.25).
  • altimeterNoiseVar: measurement noise variance of the altimeter (e.g. 1.0 for 1m²).

Definition at line 8 of file VerticalVelocityEstimator.cpp.

Member Function Documentation

◆ getEstimatedAltitude()

float VerticalVelocityEstimator::getEstimatedAltitude ( ) const
virtual
Returns
Current estimated altitude (meters).

Definition at line 151 of file VerticalVelocityEstimator.cpp.

◆ getEstimatedVelocity()

float VerticalVelocityEstimator::getEstimatedVelocity ( ) const
virtual
Returns
Current estimated vertical velocity (m/s).

Definition at line 155 of file VerticalVelocityEstimator.cpp.

◆ getInertialVerticalAcceleration()

float VerticalVelocityEstimator::getInertialVerticalAcceleration ( ) const
virtual
Returns
Computed inertial vertical acceleration (m/s²), i.e., raw_accel - g.

Definition at line 159 of file VerticalVelocityEstimator.cpp.

◆ getTimestamp()

uint32_t VerticalVelocityEstimator::getTimestamp ( ) const
virtual
Returns
The timestamp of the last update (milliseconds).

Definition at line 171 of file VerticalVelocityEstimator.cpp.

◆ getVerticalAxis()

int8_t VerticalVelocityEstimator::getVerticalAxis ( ) const
virtual
Returns
The index of the axis determined to be vertical (0 = x, 1 = y, 2 = z).

Definition at line 163 of file VerticalVelocityEstimator.cpp.

◆ getVerticalDirection()

int8_t VerticalVelocityEstimator::getVerticalDirection ( ) const
virtual
Returns
The direction along that axis (+1 if positive direction is “up,” -1 if negative).

Definition at line 167 of file VerticalVelocityEstimator.cpp.

◆ init()

void VerticalVelocityEstimator::init ( InitialState initialState)

Initialize the filter with an initial altitude and timestamp.

Parameters
initialStateStruct containing:
  • initialAltitude in meters.
  • initialTimestamp in milliseconds.

Definition at line 25 of file VerticalVelocityEstimator.cpp.

◆ update()

void VerticalVelocityEstimator::update ( const AccelerationTriplet & accel,
const DataPoint & altimeter )

Update the estimator with new sensor data.

The three acceleration DataPoints correspond to x, y, and z (vertical) axes. The altimeter DataPoint contains the altitude measurement.

Parameters
accelAccelerometer readings for x, y, and z (vertical) axes.
altimeterAltimeter reading.

Definition at line 59 of file VerticalVelocityEstimator.cpp.


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