|
Avionics
Core avionics package for CURE flight computers
|
Orientation estimator using Madgwick's algorithm for sensor fusion. More...
#include <OrientationEstimator.h>

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 |
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.
|
inline |
Definition at line 18 of file OrientationEstimator.h.
|
inline |
Definition at line 41 of file OrientationEstimator.h.
|
inline |
Definition at line 35 of file OrientationEstimator.h.
|
inline |
Definition at line 40 of file OrientationEstimator.h.
|
inline |
Definition at line 42 of file OrientationEstimator.h.
|
inline |
Definition at line 39 of file OrientationEstimator.h.
| 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.
| accel | Acceleration triplet (x, y, z) in m/s^2 |
| gyro | Gyroscope triplet (x, y, z) in degrees/s |
| mag | Magnetometer triplet (x, y, z) in microteslas |
| currentTime | Current timestamp in milliseconds |
Definition at line 15 of file OrientationEstimator.cpp.