Skip to main content

MotionBasedViInitializerConfig

Struct MotionBasedViInitializerConfig 

Source
pub struct MotionBasedViInitializerConfig {
Show 18 fields pub min_keyframes: usize, pub min_translation_meters: f64, pub max_solve_keyframes: Option<usize>, pub gravity_world: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, pub body_to_camera: SE3, pub ba_config: BaConfig, pub viba2: Option<Viba2Config>, pub max_velocity_magnitude_mps: Option<f64>, pub max_gyro_bias_magnitude_rad_s: Option<f64>, pub max_accel_bias_magnitude_mps2: Option<f64>, pub max_final_imu_nis_per_dof: Option<f64>, pub max_final_imu_rotation_residual_rms_rad: Option<f64>, pub max_final_imu_velocity_residual_rms_mps: Option<f64>, pub max_final_imu_position_residual_rms_meters: Option<f64>, pub bias_release: Option<BiasReleaseSchedule>, pub estimate_gravity: bool, pub max_gravity_norm_deviation_ratio: f64, pub estimate_gyro_bias: bool,
}
Expand description

Configuration for MotionBasedViInitializer.

Fields§

§min_keyframes: usize

Minimum number of keyframes (registered after the static seed) before the VIBA1 trigger is allowed to fire. Default 10.

§min_translation_meters: f64

Minimum cumulative camera-centre translation in metres before VIBA1 fires. Default 2.0. Set to 0.0 to disable the translation gate.

§max_solve_keyframes: Option<usize>

When Some(n), the inertial solve uses only the earliest n registered keyframes (after the min-keyframe / min-translation gates pass). None uses the full registered set. Early keyframes are the least contaminated by later VO scale drift; gyro-bias recovery still searches 3–5 keyframe subwindows over the full registered history.

§gravity_world: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>

World-frame gravity vector. Echoed onto the BA result for downstream diagnostics; the IMU factors fed into the solve carry their own gravity already.

§body_to_camera: SE3

Rigid transform from the tracked camera/sensor frame into the IMU body frame (EuRoC T_BS for cam0). The visual map stores world-to-camera poses while preintegration residuals operate on world-to-body poses. Identity preserves the co-located body/camera convention.

§ba_config: BaConfig

Inner LM solver config. Default mirrors crate::OnlineSlamLocalBaConfig::default (sparse linear solver, 10 LM iterations).

§viba2: Option<Viba2Config>

Optional VIBA2 hand-off. When Some, the initialiser runs an outer scale-recovery loop on top of the VIBA1 inertial-only solve. Stereo / RGB-D / known-scale paths should leave this None or set recover_scale = false; monocular paths set recover_scale = true. See crate::Viba2Config for the outer-loop knobs. Default None.

§max_velocity_magnitude_mps: Option<f64>

Post-solve sanity gate on the recovered per-keyframe velocity_world magnitudes. When Some(v), the initialiser rejects the inner LM result if any keyframe’s ||velocity_world|| > v and parks itself in the Waiting state with MotionBasedViRejectionReason::VelocityOutOfRange. None (default) preserves the legacy behaviour of accepting any LM-converged result. Indoor V1-class EuRoC sequences run safely at Some(10.0) (~36 km/h ceiling); set higher for outdoor driving datasets.

§max_gyro_bias_magnitude_rad_s: Option<f64>

Optional post-solve upper bound on every recovered gyro-bias vector magnitude (rad/s). None preserves legacy behavior.

§max_accel_bias_magnitude_mps2: Option<f64>

Optional post-solve upper bound on every recovered accelerometer-bias vector magnitude (m/s²). None preserves legacy behavior.

§max_final_imu_nis_per_dof: Option<f64>

Optional statistical consistency gate on the final whitened IMU residual. The value is NIS divided by 9 residual DoF per factor; a well-modelled solve is expected near one. None preserves the historical behavior.

§max_final_imu_rotation_residual_rms_rad: Option<f64>

Coarse physical-unit gate for fixed-pose initialization. Unlike NIS, these bounds do not assume the visual keyframe poses are already statistically consistent with the IMU covariance.

§max_final_imu_velocity_residual_rms_mps: Option<f64>§max_final_imu_position_residual_rms_meters: Option<f64>§bias_release: Option<BiasReleaseSchedule>

Optional staged bias-release schedule. None (default) preserves the legacy behaviour: bias is free from the first solve that clears min_keyframes / min_translation_meters. Some(schedule) inserts a bias-fixed “velocity stage” before bias is released — see BiasReleaseSchedule for the full contract and the divergence this guards against.

§estimate_gravity: bool

Estimate the world-frame gravity DIRECTION from this window’s IMU preintegration factors plus the fixed visual poses, instead of trusting gravity_world as ground truth. See estimate_gravity_and_velocities and docs/motion_based_vi_alignment.md’s “Gravity-direction recovery” section for the motivating diagnosis: on moving-start sequences where the static crate::VisualInertialInitializer never fires, each identity-seeded (sub)map’s world frame has gravity pointing in an ARBITRARY direction — the legacy behaviour (trusting gravity_world from config as truth) then makes every IMU residual dominated by that misalignment rather than by real inconsistency, and every promotion is rejected by the raw-residual gates. When true, MotionBasedViInitializer::try_initialize_with_bias_seed runs the linear alignment first, feeds the solver factors carrying the ESTIMATED gravity (rather than the configured one), and seeds velocities from the same alignment instead of finite differences. Default false preserves the legacy behaviour.

§max_gravity_norm_deviation_ratio: f64

Observability gate for estimate_gravity: the UNCONSTRAINED linear solve’s raw gravity norm (see GravityVelocityAlignment::raw_gravity_norm) must fall within this fraction of gravity_world.norm() before the estimate is trusted — a well-conditioned window recovers a norm near the true magnitude on its own, with no norm constraint imposed, so a large deviation signals the window’s IMU excitation does not yet make gravity direction reliably observable. 0.3 (30%) is a conservative default; tighten once per-dataset noise floors are characterised. Ignored when estimate_gravity is false.

§estimate_gyro_bias: bool

Estimate the shared gyro bias from ROTATION-ONLY alignment against this window’s fixed visual poses, BEFORE gravity/velocity alignment and before the staged solve. See estimate_gyro_bias and docs/motion_based_vi_alignment.md’s “Gyro-bias recovery” section for the motivating diagnosis: on a moving-start EuRoC fixture the final fitted IMU rotation residual RMS sat at 0.014-0.022 rad against a 0.01 gate, bit-identical with/without gravity estimation (the rotation residual is gravity-independent) — consistent with EuRoC’s typical gyro bias (~0.08 rad/s norm) accumulating over each factor’s delta_time, with the bias seed fixed at the configured zero the whole time. When true, MotionBasedViInitializer::try_initialize_with_bias_seed runs this alignment first (right after the body-pose conversion, before gravity recovery) and, on success, substitutes the recovered bias for bias_gyro_seed everywhere downstream of that point in the same attempt: the gravity/velocity alignment’s own bias-corrected deltas, the per-keyframe initial_states seeding, and (when a BiasReleaseSchedule Stage A fires) the fixed-bias solve, which then fixes gyro bias at the ESTIMATE rather than the raw seed (accelerometer bias stays fixed at the seed either way — this stage has no accelerometer evidence). Default false preserves the legacy behaviour of trusting bias_gyro_seed verbatim.

Trait Implementations§

Source§

impl Clone for MotionBasedViInitializerConfig

Source§

fn clone(&self) -> MotionBasedViInitializerConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MotionBasedViInitializerConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for MotionBasedViInitializerConfig

Source§

fn default() -> MotionBasedViInitializerConfig

Returns the “default value” for a type. Read more
Source§

impl PartialEq for MotionBasedViInitializerConfig

Source§

fn eq(&self, other: &MotionBasedViInitializerConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MotionBasedViInitializerConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V