jmagnuson / ahrs-rs

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

Add Mahony algorithm #2

Closed jmagnuson closed 8 years ago

jmagnuson commented 8 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 {
    ....
}