pub struct VisualInertialInitializer { /* private fields */ }Expand description
Stateful accumulator that ingests IMU samples one at a time and reports the recovered bootstrap as soon as the buffer satisfies every stationary-window predicate.
Implementations§
Source§impl VisualInertialInitializer
impl VisualInertialInitializer
Sourcepub const fn new(
config: VisualInertialInitializerConfig,
) -> VisualInertialInitializer
pub const fn new( config: VisualInertialInitializerConfig, ) -> VisualInertialInitializer
Create a fresh initialiser with the given configuration. The
returned instance owns no samples; feed it the IMU stream via
Self::push_sample until Self::try_initialize reports
success.
Sourcepub fn push_sample(
&mut self,
gyro: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
accel: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
dt: f64,
)
pub fn push_sample( &mut self, gyro: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, accel: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, dt: f64, )
Append one body-frame IMU sample to the accumulator. Non-
positive dt is silently dropped to keep raw replays robust
against duplicated / out-of-order timestamps (the same
convention used by crate::ImuPreintegrator::integrate_sample).
Sourcepub fn samples_seen(&self) -> usize
pub fn samples_seen(&self) -> usize
Number of IMU samples currently buffered.
Sourcepub fn buffered_duration_seconds(&self) -> f64
pub fn buffered_duration_seconds(&self) -> f64
Aggregate duration (seconds) of currently buffered samples.
Sourcepub const fn config(&self) -> &VisualInertialInitializerConfig
pub const fn config(&self) -> &VisualInertialInitializerConfig
Borrow the active configuration.
Sourcepub fn try_initialize(
&self,
) -> Result<VisualInertialInitializationResult, StationaryRejectionReason>
pub fn try_initialize( &self, ) -> Result<VisualInertialInitializationResult, StationaryRejectionReason>
Attempt to recover the visual-inertial bootstrap from the
currently buffered samples. Returns Ok(result) when every
stationary-window predicate passes, otherwise returns
Err(reason) describing the first failed predicate so callers
can log a diagnostic and keep collecting samples.
When config.detector_window_seconds is finite, predicates and
statistics are evaluated only on the trailing slice whose
cumulative dt first reaches that bound — early non-stationary
samples no longer prevent a later stationary tail from passing.
Trait Implementations§
Source§impl Clone for VisualInertialInitializer
impl Clone for VisualInertialInitializer
Source§fn clone(&self) -> VisualInertialInitializer
fn clone(&self) -> VisualInertialInitializer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VisualInertialInitializer
impl Debug for VisualInertialInitializer
impl StructuralPartialEq for VisualInertialInitializer
Auto Trait Implementations§
impl Forget for VisualInertialInitializer
impl Freeze for VisualInertialInitializer
impl Move for VisualInertialInitializer
impl RefUnwindSafe for VisualInertialInitializer
impl Send for VisualInertialInitializer
impl Sync for VisualInertialInitializer
impl Unpin for VisualInertialInitializer
impl UnsafeUnpin for VisualInertialInitializer
impl UnwindSafe for VisualInertialInitializer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.