Class WelfordCovarianceProvider
Defined in File welford_covariance_provider.h
Inheritance Relationships
Base Type
public adi_imu::ImuCovarianceInterface(Class ImuCovarianceInterface)
Class Documentation
-
class WelfordCovarianceProvider : public adi_imu::ImuCovarianceInterface
Computes covariance online using Welford’s algorithm.
This provider collects samples during the calibration phrase (IMU should be stationary) and computes variance using Welford’s numerically stable online algorithm. After calibration_samples are collected, the covariance is frozen and returned for all subsequent queries.
Reference: Welford, B. P. (1962). “Note on method for calculating
corrected sum of squares and products”
Public Functions
-
explicit WelfordCovarianceProvider(size_t calibration_samples = DEFAULT_CALIBRATION_SAMPLES, double min_variance = DEFAULT_MIN_VARIANCE)
-
virtual void addSample(const Vec3 &accel, const Vec3 &gyro) override
Process a new IMU sample for covariance estimation.
- Parameters:
accel – Linear acceleration sample (m/s^2)
gyro – Angular velocity sample (rad/s)
-
virtual bool isReady() const override
Check if covariance estimation is ready (calibration complete).
- Returns:
true if covariance values are valid and ready to use.
-
virtual CovarianceMatrix getAccelCovariance() const override
Get the linear acceleration covariance matrix.
- Returns:
3x3 covariance matrix row-major order.
-
virtual CovarianceMatrix getGyroCovariance() const override
Get the angular velocity covariance matrix.
- Returns:
3x3 covariance matrix row-major order.
-
explicit WelfordCovarianceProvider(size_t calibration_samples = DEFAULT_CALIBRATION_SAMPLES, double min_variance = DEFAULT_MIN_VARIANCE)