[][src]Struct ahrs::Mahony

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

Mahony AHRS implementation.

Example

let mut ahrs = Mahony::new(0.002390625f64, 0.5, 0.0);
println!("mahony filter: {:?}", ahrs);

// Can now process IMU data using `Ahrs::update_imu`, etc.

Fields

quat: Quaternion<N>

Filter state quaternion.

Implementations

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

pub fn new(sample_period: N, kp: N, ki: N) -> Self[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.

pub fn new_with_quat(
    sample_period: N,
    kp: N,
    ki: N,
    quat: Quaternion<N>
) -> Self
[src]

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.

Trait Implementations

impl<N: RealField> Ahrs<N> for Mahony<N>[src]

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

impl<N: Scalar + Copy + SimdValue> Copy for Mahony<N>[src]

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

impl Default for Mahony<f64>[src]

fn default() -> Mahony<f64>[src]

Creates a default Mahony AHRS instance with default filter parameters.

dbg!(Mahony::default());

// prints (roughly):
//
// Madgwick {
//     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: SimdRealField + Eq> Eq for Mahony<N> where
    N::Element: SimdRealField
[src]

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

impl<N: SimdRealField> PartialEq<Mahony<N>> for Mahony<N> where
    N::Element: SimdRealField
[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for Mahony<N> where
    N: RefUnwindSafe

impl<N> Send for Mahony<N> where
    N: Send

impl<N> Sync for Mahony<N> where
    N: Sync

impl<N> Unpin for Mahony<N> where
    N: Unpin

impl<N> UnwindSafe for Mahony<N> where
    N: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,