#filter #versatile #gyroscope #accelerometer #update #described #quaternion-based

vqf

Implementation of the Versatile Quaternion-based Filter (VQF) algorithm for sensor fusion

7 unstable releases (3 breaking)

new 0.4.0 Nov 12, 2024
0.3.0 Nov 6, 2024
0.2.3 Nov 5, 2024
0.1.0 Nov 3, 2024

#354 in Hardware support

Download history 49/week @ 2024-10-28 479/week @ 2024-11-04

528 downloads per month

MIT/Apache

40KB
453 lines

vqf 🧭

License Crates.io Downloads Docs

demo

A Rust implementation of the Versatile Quaternion-based Filter (VQF) algorithm, as described in this paper.

[!NOTE] Currently this crate does not implement the magnometer update.

Example

use nalgebra::Vector3;
use std::time::Duration;
use vqf::{Vqf, VqfParameters};

let gyro_rate = Duration::from_secs_f32(0.01); // 100Hz
let accel_rate = Duration::from_secs_f32(0.01);

let params = VqfParameters::default();
let mut vqf = Vqf::new(gyro_rate, accel_rate, params);

let gyro_data = Vector3::new(0.01, 0.02, -0.01); // rad/s
let accel_data = Vector3::new(0.0, 0.0, 9.81); // m/s^2

vqf.update(gyro_data, accel_data);

let orientation = vqf.orientation();
println!("Current orientation: {:?}", orientation);

Dependencies

~3MB
~60K SLoC