Struct ahrs::Mahony
[−]
[src]
pub struct Mahony<N: Real> { pub quat: Quaternion<N>, // some fields omitted }
Mahony AHRS implementation.
Fields
quat: Quaternion<N>
Filter state quaternion.
Methods
impl<N: Real> Mahony<N>
[src]
fn new(sample_period: N, kp: N, ki: N) -> Self
Creates a new Mahony AHRS instance with identity quaternion.
Arguments
sample_period
- The expected sensor sampling period in seconds.kp
- Proportional filter gain constant.ki
- Integral filter gain constant.
Example
extern crate ahrs; use ahrs::Mahony; fn main() { let ahrs = Mahony::new(0.002390625f64, 0.5, 0.0); }
fn new_with_quat(sample_period: N, kp: N, ki: N, quat: Quaternion<N>) -> Self
Creates a new Mahony AHRS instance with given quaternion.
Arguments
sample_period
- The expected sensor sampling period in seconds.kp
- Proportional filter gain constant.ki
- Integral filter gain constant.quat
- Existing filter state quaternion.
Example
extern crate nalgebra as na; extern crate ahrs; use na::Quaternion; use ahrs::Mahony; fn main() { let ahrs = Mahony::new_with_quat( 0.002390625f64, 0.5, 0.0, Quaternion::new(1.0, 0.0, 0.0, 0.0)); }
Trait Implementations
impl<N: Eq + Real> Eq for Mahony<N>
[src]
impl<N: PartialEq + Real> PartialEq for Mahony<N>
[src]
fn eq(&self, __arg_0: &Mahony<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Mahony<N>) -> bool
This method tests for !=
.
impl<N: Clone + Real> Clone for Mahony<N>
[src]
fn clone(&self) -> Mahony<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 Mahony<N>
[src]
impl<N: Hash + Real> Hash for Mahony<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 Mahony<N>
[src]
impl Default for Mahony<f64>
[src]
fn default() -> Mahony<f64>
Creates a default Mahony
AHRS instance with default filter parameters:
Mahony { sample_period: 1.0f64/256.0, kp: 0.5f64, ki: 0.0f64, e_int: Vector3 { x: 0.0f64, y: 0.0, z: 0.0 }, quat: Quaternion { w: 1.0f64, i: 0.0, j: 0.0, k: 0.0 } }
impl<N: Real> Ahrs<N> for Mahony<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