#[derive(Copy, Clone, Debug, PartialEq)]
pub struct TiltEstimatorConfig<const SAMPLES: usize> {
pub correction_alpha: f32,
pub integration_alpha: f32,
pub use_gyro_integration: bool,
}
impl<const SAMPLES: usize> TiltEstimatorConfig<SAMPLES> {
pub fn new() -> TiltEstimatorConfig<SAMPLES> {
TiltEstimatorConfig::<SAMPLES>::default()
}
}
impl<const N: usize> Default for TiltEstimatorConfig<N> {
fn default() -> Self {
Self {
correction_alpha: 0.25,
integration_alpha: 0.7,
use_gyro_integration: true,
}
}
}