Trait ahrs::Ahrs

source ·
pub trait Ahrs<N: Scalar + SimdValue> {
    // Required methods
    fn update(
        &mut self,
        gyroscope: &Vector3<N>,
        accelerometer: &Vector3<N>,
        magnetometer: &Vector3<N>,
    ) -> Result<&UnitQuaternion<N>, AhrsError>;
    fn update_imu(
        &mut self,
        gyroscope: &Vector3<N>,
        accelerometer: &Vector3<N>,
    ) -> Result<&UnitQuaternion<N>, AhrsError>;
    fn update_gyro(&mut self, gyroscope: &Vector3<N>) -> &UnitQuaternion<N>;
}
Expand description

Trait for implementing an AHRS filter.

Required Methods§

source

fn update( &mut self, gyroscope: &Vector3<N>, accelerometer: &Vector3<N>, magnetometer: &Vector3<N>, ) -> Result<&UnitQuaternion<N>, AhrsError>

Attempts to update the current state quaternion using 9dof IMU values, made up by gyroscope, accelerometer, and magnetometer.

Returns a reference to the updated quaternion on success, or in the case of failure, an AhrsError enum, which describes the reason.

source

fn update_imu( &mut self, gyroscope: &Vector3<N>, accelerometer: &Vector3<N>, ) -> Result<&UnitQuaternion<N>, AhrsError>

Attempts to update the current state quaternion using 6dof IMU values, made up by gyroscope & accelerometer.

Returns a reference to the updated quaternion on success, or in the case of failure, an AhrsError enum, which describes the reason.

source

fn update_gyro(&mut self, gyroscope: &Vector3<N>) -> &UnitQuaternion<N>

Updates the current state quaternion using only 3dof IMU values, made up by gyroscope.

Returns a reference to the updated quaternion.

Implementors§

source§

impl<N: RealField + Copy> Ahrs<N> for Madgwick<N>

source§

impl<N: RealField + Copy> Ahrs<N> for Mahony<N>