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§
sourcefn update(
&mut self,
gyroscope: &Vector3<N>,
accelerometer: &Vector3<N>,
magnetometer: &Vector3<N>,
) -> Result<&UnitQuaternion<N>, AhrsError>
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.
sourcefn update_imu(
&mut self,
gyroscope: &Vector3<N>,
accelerometer: &Vector3<N>,
) -> Result<&UnitQuaternion<N>, AhrsError>
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.
sourcefn update_gyro(&mut self, gyroscope: &Vector3<N>) -> &UnitQuaternion<N>
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.