jmagnuson / ahrs-rs

A Rust port of Madgwick's AHRS algorithm
MIT License
33 stars 19 forks source link

Add Mahony algorithm #2

Closed jmagnuson closed 7 years ago

jmagnuson commented 7 years ago

As with other AHRS implementations, Mahony could be offered alongside Madgwick as an option. Conveniently, they share a similar API which allows for Ahrs to become a trait that the two respective algorithms would implement--

pub trait Ahrs {
    fn update(...);
    fn update_imu(...);
}

impl Ahrs for Madgwick {
    ...
}

impl Ahrs for Mahony {
    ....
}