pub struct ComplementaryFilter { /* private fields */ }Expand description
A first-order Complementary Filter for attitude estimation.
The internal state represents the filtered angle, blending integrated angular rates with an absolute reference.
Implementations§
Trait Implementations§
Source§impl Filter for ComplementaryFilter
impl Filter for ComplementaryFilter
Source§fn update(&mut self, input: Self::Input, dt: f32) -> Self::Output
fn update(&mut self, input: Self::Input, dt: f32) -> Self::Output
Processes a new sensor sample to update the attitude estimate.
This method implements the discrete-time fusion equation:
θ = α * (θ + ω * dt) + (1 - α) * a
§Mathematical Steps
- Prediction: Integrate the angular rate (gyro) into the current state.
- Correction: Apply the reference angle (accel) to cancel integration drift.
Source§fn reset(&mut self)
fn reset(&mut self)
Resets the filter’s internal state to zero.
Should be called during the ‘Disarm’ phase to ensure the next takeoff sequence starts from a clean level-reference.
Source§type Input = InertialInput
type Input = InertialInput
The raw sensor data or multi-sensor packet to be processed.
Auto Trait Implementations§
impl Freeze for ComplementaryFilter
impl RefUnwindSafe for ComplementaryFilter
impl Send for ComplementaryFilter
impl Sync for ComplementaryFilter
impl Unpin for ComplementaryFilter
impl UnsafeUnpin for ComplementaryFilter
impl UnwindSafe for ComplementaryFilter
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