[−][src]Struct ahrs::Mahony
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]
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.
Trait Implementations
impl<N: RealField> Ahrs<N> for Mahony<N>
[src]
fn update(
&mut self,
gyroscope: &Vector3<N>,
accelerometer: &Vector3<N>,
magnetometer: &Vector3<N>
) -> Result<&Quaternion<N>, &str>
[src]
&mut self,
gyroscope: &Vector3<N>,
accelerometer: &Vector3<N>,
magnetometer: &Vector3<N>
) -> Result<&Quaternion<N>, &str>
fn update_imu(
&mut self,
gyroscope: &Vector3<N>,
accelerometer: &Vector3<N>
) -> Result<&Quaternion<N>, &str>
[src]
&mut self,
gyroscope: &Vector3<N>,
accelerometer: &Vector3<N>
) -> Result<&Quaternion<N>, &str>
impl<N: Scalar + SimdValue> Clone for Mahony<N>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
N::Element: SimdRealField,
impl<N: SimdRealField + Hash> Hash for Mahony<N>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<N: SimdRealField> PartialEq<Mahony<N>> for Mahony<N> where
N::Element: SimdRealField,
[src]
N::Element: SimdRealField,
Auto Trait Implementations
impl<N> RefUnwindSafe for Mahony<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for Mahony<N> where
N: Send,
N: Send,
impl<N> Sync for Mahony<N> where
N: Sync,
N: Sync,
impl<N> Unpin for Mahony<N> where
N: Unpin,
N: Unpin,
impl<N> UnwindSafe for Mahony<N> where
N: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,