Struct ahrs::Madgwick
[−]
[src]
pub struct Madgwick<N: Real> { pub quat: Quaternion<N>, // some fields omitted }
Madgwick AHRS implementation.
Fields
quat: Quaternion<N>
Filter state quaternion.
Methods
impl<N: Real> Madgwick<N>
[src]
fn new(sample_period: N, beta: N) -> Self
Creates a new Madgwick
AHRS instance with identity quaternion.
Arguments
sample_period
- The expected sensor sampling period in seconds.beta
- Filter gain.
Example
extern crate ahrs; use ahrs::Madgwick; fn main() { let ahrs = Madgwick::new(0.002390625f64, 0.1); }
fn new_with_quat(sample_period: N, beta: N, quat: Quaternion<N>) -> Self
Creates a new Madgwick
AHRS instance with given quaternion.
Arguments
sample_period
- The expected sensor sampling period in seconds.beta
- Filter gain.quat
- Existing filter state quaternion.
Example
extern crate nalgebra as na; extern crate ahrs; use na::Quaternion; use ahrs::Madgwick; fn main() { let ahrs = Madgwick::new_with_quat( 0.002390625f64, 0.1, Quaternion::new(1.0, 0.0, 0.0, 0.0)); }
Trait Implementations
impl<N: Eq + Real> Eq for Madgwick<N>
[src]
impl<N: PartialEq + Real> PartialEq for Madgwick<N>
[src]
fn eq(&self, __arg_0: &Madgwick<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Madgwick<N>) -> bool
This method tests for !=
.
impl<N: Clone + Real> Clone for Madgwick<N>
[src]
fn clone(&self) -> Madgwick<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<N: Debug + Real> Debug for Madgwick<N>
[src]
impl<N: Hash + Real> Hash for Madgwick<N>
[src]
fn hash<__HN: Hasher>(&self, __arg_0: &mut __HN)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<N: Copy + Real> Copy for Madgwick<N>
[src]
impl Default for Madgwick<f64>
[src]
fn default() -> Madgwick<f64>
Creates a new Madgwick
instance with default filter parameters:
Madgwick { sample_period: 1.0f64/256.0, beta: 0.1f64, quat: Quaternion { w: 1.0f64, i: 0.0, j: 0.0, k: 0.0 } }
impl<N: Real> Ahrs<N> for Madgwick<N>
[src]
fn update(
&mut self,
gyroscope: &Vector3<N>,
accelerometer: &Vector3<N>,
magnetometer: &Vector3<N>
) -> Result<&Quaternion<N>, &str>
&mut self,
gyroscope: &Vector3<N>,
accelerometer: &Vector3<N>,
magnetometer: &Vector3<N>
) -> Result<&Quaternion<N>, &str>
Attempts to update the current state quaternion using 9dof IMU values, made up by gyroscope
, accelerometer
, and magnetometer
. Read more
fn update_imu(
&mut self,
gyroscope: &Vector3<N>,
accelerometer: &Vector3<N>
) -> Result<&Quaternion<N>, &str>
&mut self,
gyroscope: &Vector3<N>,
accelerometer: &Vector3<N>
) -> Result<&Quaternion<N>, &str>
Attempts to update the current state quaternion using 6dof IMU values, made up by gyroscope
& accelerometer
. Read more