pub struct TiltEstimatorConfig<const SAMPLES: usize> {
pub correction_alpha: f32,
pub integration_alpha: f32,
pub use_gyro_integration: bool,
}Expand description
Configuration for a crate::TiltEstimator; the SAMPLES constant will determine
how big a buffer of accelerometer readings to keep in order to compute
the accelerometer’s average over time.
Fields§
§correction_alpha: f32Value in [0..1] where 0 is purely accelerometer and 1 purely integrated gyro
integration_alpha: f32Used to scale the gyro force strenght when integrating gyro values
use_gyro_integration: boolWhether to integrate gyro values or only use accelerometer averages
Implementations§
Source§impl<const SAMPLES: usize> TiltEstimatorConfig<SAMPLES>
impl<const SAMPLES: usize> TiltEstimatorConfig<SAMPLES>
pub fn new() -> TiltEstimatorConfig<SAMPLES>
Trait Implementations§
Source§impl<const SAMPLES: usize> Clone for TiltEstimatorConfig<SAMPLES>
impl<const SAMPLES: usize> Clone for TiltEstimatorConfig<SAMPLES>
Source§fn clone(&self) -> TiltEstimatorConfig<SAMPLES>
fn clone(&self) -> TiltEstimatorConfig<SAMPLES>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<const SAMPLES: usize> Copy for TiltEstimatorConfig<SAMPLES>
Source§impl<const SAMPLES: usize> Debug for TiltEstimatorConfig<SAMPLES>
impl<const SAMPLES: usize> Debug for TiltEstimatorConfig<SAMPLES>
Source§impl<const N: usize> Default for TiltEstimatorConfig<N>
impl<const N: usize> Default for TiltEstimatorConfig<N>
Source§impl<const SAMPLES: usize> PartialEq for TiltEstimatorConfig<SAMPLES>
impl<const SAMPLES: usize> PartialEq for TiltEstimatorConfig<SAMPLES>
Source§fn eq(&self, other: &TiltEstimatorConfig<SAMPLES>) -> bool
fn eq(&self, other: &TiltEstimatorConfig<SAMPLES>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<const SAMPLES: usize> StructuralPartialEq for TiltEstimatorConfig<SAMPLES>
Auto Trait Implementations§
impl<const SAMPLES: usize> Freeze for TiltEstimatorConfig<SAMPLES>
impl<const SAMPLES: usize> RefUnwindSafe for TiltEstimatorConfig<SAMPLES>
impl<const SAMPLES: usize> Send for TiltEstimatorConfig<SAMPLES>
impl<const SAMPLES: usize> Sync for TiltEstimatorConfig<SAMPLES>
impl<const SAMPLES: usize> Unpin for TiltEstimatorConfig<SAMPLES>
impl<const SAMPLES: usize> UnsafeUnpin for TiltEstimatorConfig<SAMPLES>
impl<const SAMPLES: usize> UnwindSafe for TiltEstimatorConfig<SAMPLES>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more