uf-ahrs
uf-ahrs rust no_std library for orientation estimation using gyroscope, accelerometer and magnetometer.
Demo
Features
no_stdand allocator-free for embedded systems.- IO and MCU agnostic.
- Implements
Mahony,MadgwickandVQFfilters. - Filters evaluated using
BROADdataset.
Note
Library is under active development and testing, API might change at any time.
Installation
Add uf-ahrs to your Cargo.toml:
[]
= "*" # replace * by the latest version of the crate.
Or use the command line:
Usage
Here is a simple example showing how to initialize and use Mahony, Madgwick, and VQF filters.
use Duration;
use Vector3;
use ;
Benchmark Scores (BROAD)
The results below are from evaluations on the Berlin Robust Orientation Estimation Assessment Dataset (BROAD). For context, BROAD contains 39 trials with synchronized IMU and optical ground-truth orientation: 23 undisturbed trials (rotation, translation, and combined motion at slow/fast speeds) and 16 disturbed trials (e.g., tapping, vibration, stationary/attached magnets, office environment, and mixed conditions). Dataset publication: https://www.mdpi.com/2306-5729/6/7/72.
Reported metrics are dataset-averaged orientation errors in degrees:
AVG Total RMSE, AVG Heading RMSE, and AVG Inclination RMSE.
License
This project is licensed under the Apache 2.0. See the LICENSE file for details.
References
This library incorporates ideas and data from the following projects and publications.
Publications
-
BROAD - A benchmark for robust inertial orientation estimation D. Laidig, M. Caruso, A. Cereatti, and T. Seel, Data, vol. 6, no. 7, p. 72, 2021.
-
Nonlinear complementary filters on the special orthogonal group R. Mahony, T. Hamel, and J.-M. Pflimlin, IEEE Transactions on Automatic Control, vol. 53, no. 5, pp. 1203–1218, 2008.
-
An efficient orientation filter for inertial and inertial/magnetic sensor arrays S. O. H. Madgwick et al., 2010.
-
VQF: Highly accurate IMU orientation estimation with bias estimation and magnetic disturbance rejection D. Laidig and T. Seel, Information Fusion, vol. 91, pp. 187–204, 2023.
Related Projects
-
ahrs-rs: alternative Mahony and Madgwick filter implementation in Rust. https://github.com/jmagnuson/ahrs-rs
-
vqf-rs: alternative VQF filter implementation in Rust. https://github.com/vgskye/vqf-rs
-
vqf: another VQF filter implementation in Rust. https://github.com/oxkitsune/vqf
-
broad: Berlin Robust Orientation Estimation Assessment Dataset (BROAD). https://github.com/dlaidig/broad