Struct ahrs::Mahony [] [src]

pub struct Mahony<N: Real> {
    pub quat: Quaternion<N>,
    // some fields omitted
}

Mahony AHRS implementation.

Fields

Filter state quaternion.

Methods

impl<N: Real> Mahony<N>
[src]

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);
}

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]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<N: Clone + Real> Clone for Mahony<N>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<N: Debug + Real> Debug for Mahony<N>
[src]

Formats the value using the given formatter.

impl<N: Hash + Real> Hash for Mahony<N>
[src]

Feeds this value into the given [Hasher]. Read more

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]

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]

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

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