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: usizeMinimum number of keyframes (registered after the static seed)
before the VIBA1 trigger is allowed to fire. Default 10.
min_translation_meters: f64Minimum 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: SE3Rigid 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: BaConfigInner 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: boolEstimate 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: f64Observability 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: boolEstimate 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
impl Clone for MotionBasedViInitializerConfig
Source§fn clone(&self) -> MotionBasedViInitializerConfig
fn clone(&self) -> MotionBasedViInitializerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for MotionBasedViInitializerConfig
impl Default for MotionBasedViInitializerConfig
Source§fn default() -> MotionBasedViInitializerConfig
fn default() -> MotionBasedViInitializerConfig
impl StructuralPartialEq for MotionBasedViInitializerConfig
Auto Trait Implementations§
impl Forget for MotionBasedViInitializerConfig
impl Freeze for MotionBasedViInitializerConfig
impl Move for MotionBasedViInitializerConfig
impl RefUnwindSafe for MotionBasedViInitializerConfig
impl Send for MotionBasedViInitializerConfig
impl Sync for MotionBasedViInitializerConfig
impl Unpin for MotionBasedViInitializerConfig
impl UnsafeUnpin for MotionBasedViInitializerConfig
impl UnwindSafe for MotionBasedViInitializerConfig
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.