pub struct FusionAhrs { /* private fields */ }
Expand description
AHRS algorithm structure.
Implementations§
Source§impl FusionAhrs
impl FusionAhrs
Sourcepub fn set_settings(&mut self, settings: Settings)
pub fn set_settings(&mut self, settings: Settings)
Sets the AHRS algorithm settings.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Resets the AHRS algorithm. This is equivalent to reinitialising the algorithm while maintaining the current settings.
Sourcepub fn update(
&mut self,
gyroscope: Vector,
accelerometer: Vector,
magnetometer: Vector,
delta_time: f32,
)
pub fn update( &mut self, gyroscope: Vector, accelerometer: Vector, magnetometer: Vector, delta_time: f32, )
Updates the AHRS algorithm using the gyroscope, accelerometer, and magnetometer measurements.
Arguments:
gyroscope
: Gyroscope measurement in degrees per second.accelerometer
: Accelerometer measurement in g.magnetometer
: Magnetometer measurement in arbitrary units.delta_time
: Delta time in seconds.
Sourcepub fn update_no_magnetometer(
&mut self,
gyroscope: Vector,
accelerometer: Vector,
delta_time: f32,
)
pub fn update_no_magnetometer( &mut self, gyroscope: Vector, accelerometer: Vector, delta_time: f32, )
Updates the AHRS algorithm using the gyroscope and accelerometer measurements only.
Arguments:
gyroscope
: Gyroscope measurement in degrees per second.accelerometer
: Accelerometer measurement in g.delta_time
: Delta time in seconds.
Sourcepub fn update_external_heading(
&mut self,
gyroscope: Vector,
accelerometer: Vector,
heading: f32,
delta_time: f32,
)
pub fn update_external_heading( &mut self, gyroscope: Vector, accelerometer: Vector, heading: f32, delta_time: f32, )
Updates the AHRS algorithm using the gyroscope, accelerometer, and heading measurements.
Arguments:
gyroscope
: Gyroscope measurement in degrees per second.accelerometer
: Accelerometer measurement in g.heading
: Heading measurement in degrees.delta_time
: Delta time in seconds.
Sourcepub fn set_heading(&mut self, heading: f32)
pub fn set_heading(&mut self, heading: f32)
Sets the heading of the orientation measurement provided by the AHRS algorithm.
This function can be used to reset drift in heading when the AHRS algorithm is being used without a magnetometer.
Sourcepub fn get_quaternion(&self) -> Quaternion
pub fn get_quaternion(&self) -> Quaternion
Returns the quaternion describing the sensor relative to the Earth.
Sourcepub fn set_quaternion(&mut self, quaternion: Quaternion)
pub fn set_quaternion(&mut self, quaternion: Quaternion)
Sets the quaternion describing the sensor relative to the Earth.
Sourcepub fn get_linear_acceleration(&self) -> Vector
pub fn get_linear_acceleration(&self) -> Vector
Returns the linear acceleration measurement equal to the accelerometer measurement with the 1g of gravity removed.
Sourcepub fn get_earth_acceleration(&self) -> Vector
pub fn get_earth_acceleration(&self) -> Vector
Returns the Earth acceleration measurement equal to the accelerometer measurement in the Earth coordinate frame with the 1g of gravity removed.
Sourcepub fn get_internal_states(&self) -> InternalStates
pub fn get_internal_states(&self) -> InternalStates
Returns the AHRS algorithm internal states.