Complementary filter for 6-DOF IMUs, implemented as a BB.Estimator.
Integrates the gyroscope (high-pass) and blends in an accelerometer- derived tilt estimate (low-pass) using a fixed weight or a time constant.
Usage
sensor :imu, BB.Sensor.SomeImu, ... do
estimator :orientation, {BB.Estimator.Ahrs.Complementary, alpha: 0.98}
endOptions
:alpha— fixed gyro weight,0.0..1.0. Default0.98(98% gyro, 2% accel per update).:time_constant— optional time constant τ in seconds. When set, overrides:alphawithτ / (τ + dt), making the filter frequency-independent.:accel_threshold— accepted deviation of|accel| / gfrom1.0before the correction is suppressed. Default0.1.
Ported from gworkman/ahrs'
Ahrs.Complementary.
Summary
Functions
Runs one Complementary filter step.
Types
@type t() :: %BB.Estimator.Ahrs.Complementary{ accel_threshold: float(), alpha: float(), last_monotonic_time: integer() | nil, q: BB.Estimator.Ahrs.Quaternion.t(), time_constant: nil | float() }