Mahony AHRS filter, 6-DOF IMU variant, implemented as a BB.Estimator.
Uses a Proportional-Integral controller to fuse gyroscope and accelerometer measurements. Computationally cheaper than Madgwick and particularly robust under sustained drift.
Usage
sensor :imu, BB.Sensor.SomeImu, ... do
estimator :orientation, {BB.Estimator.Ahrs.Mahony, kp: 2.0, ki: 0.005}
endOptions
:kp— proportional gain on the accel/mag error vector. Default2.0.:ki— integral gain (gyro bias estimation). Default0.0(P-only).:accel_threshold— accepted deviation of|accel| / gfrom1.0before the correction is suppressed. Default0.1.:e_int_limit— anti-windup clamp on the integral term. Default100.0.
Ported from gworkman/ahrs' Ahrs.Mahony.
Summary
Functions
Runs one Mahony step. gyro is rad/s, accel is m/s², dt is
seconds. Returns the updated state.