#accelerometer #gyroscope #duration #vector3 #compass #signal-processing #vqf-parameters

vqf

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

8 unstable releases (3 breaking)

0.4.1 Nov 30, 2024
0.4.0 Nov 12, 2024
0.3.0 Nov 6, 2024
0.2.3 Nov 5, 2024
0.1.0 Nov 3, 2024

#86 in Robotics

Download history 137/week @ 2024-11-27 21/week @ 2024-12-04 4/week @ 2024-12-11 1/week @ 2024-12-18 5/week @ 2024-12-25 16/week @ 2025-01-08 3/week @ 2025-01-29 22/week @ 2025-02-05 37/week @ 2025-02-12 59/week @ 2025-02-19 24/week @ 2025-02-26 51/week @ 2025-03-05 166/week @ 2025-03-12

306 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
~67K SLoC