|
Instrument Neutral Distributed Interface INDI 2.2.5
|
Mahony AHRS filter (9-DOF and 6-DOF). More...
#include <imusensorfusion.h>
Public Member Functions | |
| MahonyFilter (double kp=2.0, double ki=0.005) | |
| virtual | ~MahonyFilter ()=default |
| void | update (double gx, double gy, double gz, double ax, double ay, double az, double mx, double my, double mz, double dt, bool useMag=true) override |
| Perform one filter update step. | |
| void | getQuaternion (double &w, double &i, double &j, double &k) const override |
| Return the current orientation quaternion. | |
| void | reset () override |
| Reset the filter to the identity quaternion. | |
| void | setKp (double kp) |
| Set proportional gain Kp. | |
| double | getKp () const |
| void | setKi (double ki) |
| Set integral gain Ki. | |
| double | getKi () const |
Public Member Functions inherited from INDI::IMUSensorFusion | |
| virtual | ~IMUSensorFusion ()=default |
Mahony AHRS filter (9-DOF and 6-DOF).
A complementary filter based on a Proportional-Integral (PI) controller on the SO(3) Lie group. Two tuning parameters:
Kp — Proportional gain: how strongly the accelerometer/magnetometer corrects the gyroscope integration. Higher → faster convergence. Ki — Integral gain: compensates for systematic gyroscope bias drift. Set to 0 to disable integral correction.
Recommended starting values: Kp = 2.0, Ki = 0.005.
Reference: Mahony, R. et al. (2008) "Nonlinear Complementary Filters on the Special Orthogonal Group"
Definition at line 162 of file imusensorfusion.h.
|
explicit |
| kp | Proportional gain. Default 2.0. |
| ki | Integral gain. Default 0.005. |
Definition at line 235 of file imusensorfusion.cpp.
|
virtualdefault |
|
inline |
Definition at line 196 of file imusensorfusion.h.
|
inline |
Definition at line 186 of file imusensorfusion.h.
|
overridevirtual |
Return the current orientation quaternion.
Implements INDI::IMUSensorFusion.
Definition at line 253 of file imusensorfusion.cpp.
|
overridevirtual |
Reset the filter to the identity quaternion.
Implements INDI::IMUSensorFusion.
Definition at line 242 of file imusensorfusion.cpp.
|
inline |
Set integral gain Ki.
Definition at line 192 of file imusensorfusion.h.
|
inline |
Set proportional gain Kp.
Definition at line 182 of file imusensorfusion.h.
|
overridevirtual |
Perform one filter update step.
| gx | Gyroscope X-axis angular rate (rad/s) |
| gy | Gyroscope Y-axis angular rate (rad/s) |
| gz | Gyroscope Z-axis angular rate (rad/s) |
| ax | Accelerometer X-axis (m/s² or any unit — only direction used) |
| ay | Accelerometer Y-axis |
| az | Accelerometer Z-axis |
| mx | Magnetometer X-axis (µT or any consistent unit) |
| my | Magnetometer Y-axis |
| mz | Magnetometer Z-axis |
| dt | Time step in seconds since last update |
| useMag | If false the magnetometer data is ignored (6-DOF mode) |
Implements INDI::IMUSensorFusion.
Definition at line 261 of file imusensorfusion.cpp.