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

Orientation estimator using Madgwick's algorithm for sensor fusion. More...

#include <OrientationEstimator.h>

Collaboration diagram for OrientationEstimator:
Collaboration graph

Public Member Functions

 OrientationEstimator (float gainPad=0.05f, float gainFlight=0.005f)
void update (AccelerationTriplet accel, GyroTriplet gyro, MagTriplet mag, uint32_t currentTime)
 Update the orientation estimator with new sensor data. This method should be called whenever new accelerometer, gyroscope, or magnetometer data is available. Calls updateFullAHRS or updateIMU when on pad, directly updates orientation estimate from gyro data only when in flight.
Quaternion getQuaternion () const
void launchDetected ()
float getRoll () const
float getPitch () const
float getYaw () const

Detailed Description

Orientation estimator using Madgwick's algorithm for sensor fusion.

This class estimates the orientation of the rocket in 3D space using data from the accelerometer, gyroscope, and magnetometer. When not in flight, it uses the full AHRS algorithm to fuse all three sensors. Once launch is detected, it relies on gyro data only for orientation updates to avoid accelerometer and magnetometer disturbances during flight.

Definition at line 16 of file OrientationEstimator.h.

Constructor & Destructor Documentation

◆ OrientationEstimator()

OrientationEstimator::OrientationEstimator ( float gainPad = 0.05f,
float gainFlight = 0.005f )
inline

Definition at line 18 of file OrientationEstimator.h.

Member Function Documentation

◆ getPitch()

float OrientationEstimator::getPitch ( ) const
inline

Definition at line 41 of file OrientationEstimator.h.

◆ getQuaternion()

Quaternion OrientationEstimator::getQuaternion ( ) const
inline

Definition at line 35 of file OrientationEstimator.h.

◆ getRoll()

float OrientationEstimator::getRoll ( ) const
inline

Definition at line 40 of file OrientationEstimator.h.

◆ getYaw()

float OrientationEstimator::getYaw ( ) const
inline

Definition at line 42 of file OrientationEstimator.h.

◆ launchDetected()

void OrientationEstimator::launchDetected ( )
inline

Definition at line 39 of file OrientationEstimator.h.

◆ update()

void OrientationEstimator::update ( AccelerationTriplet accel,
GyroTriplet gyro,
MagTriplet mag,
uint32_t currentTime )

Update the orientation estimator with new sensor data. This method should be called whenever new accelerometer, gyroscope, or magnetometer data is available. Calls updateFullAHRS or updateIMU when on pad, directly updates orientation estimate from gyro data only when in flight.

Parameters
accelAcceleration triplet (x, y, z) in m/s^2
gyroGyroscope triplet (x, y, z) in degrees/s
magMagnetometer triplet (x, y, z) in microteslas
currentTimeCurrent timestamp in milliseconds

Definition at line 15 of file OrientationEstimator.cpp.


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