pub struct VisualInertialInitializationResult {
pub gravity_world: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
pub initial_rotation_body_to_world: Unit<Quaternion<f64>>,
pub initial_velocity_world: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
pub bias_gyro: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
pub bias_acc: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
pub samples_consumed: usize,
pub duration_seconds: f64,
pub gyro_std: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
pub accel_std: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
pub mean_accel_magnitude: f64,
}Expand description
Outcome of a successful stationary-window initialisation. All fields are in SI units; angles are encoded as a unit quaternion.
Fields§
§gravity_world: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>World-frame gravity, echoed from the config so downstream
callers (e.g. OnlineSlamImuConfig) can wire it through
without re-importing the config struct.
initial_rotation_body_to_world: Unit<Quaternion<f64>>Body-to-world rotation recovered from the mean specific-force direction. Yaw is set to zero (gravity does not pin yaw).
initial_velocity_world: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>Initial world-frame velocity. Always exactly zero — the initialiser only fires when the window is stationary.
bias_gyro: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>Recovered gyro bias = mean(gyro readings) in body frame.
bias_acc: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>Recovered accel bias. When the measured specific-force
magnitude exactly matches ‖gravity_world‖ this is zero;
otherwise it captures the magnitude residual along the
measured gravity direction.
samples_consumed: usizeNumber of IMU samples consumed by the recovery.
duration_seconds: f64Duration of the stationary window (seconds).
gyro_std: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>Per-axis gyro standard deviation observed in the window (rad / s). Surface for diagnostics / logging.
accel_std: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>Per-axis accel standard deviation observed in the window (m / s²).
mean_accel_magnitude: f64Magnitude of the mean specific-force measurement (m / s²).
Implementations§
Source§impl VisualInertialInitializationResult
impl VisualInertialInitializationResult
Sourcepub fn gravity_alignment_residual_deg(
&self,
ground_truth_rotation_body_to_world: &Unit<Quaternion<f64>>,
) -> f64
pub fn gravity_alignment_residual_deg( &self, ground_truth_rotation_body_to_world: &Unit<Quaternion<f64>>, ) -> f64
Angle (degrees) between the body-frame “up” direction implied
by the recovered rotation and the same direction implied by a
caller-supplied ground-truth body→world rotation. This is the
yaw-gauge-aware rotation residual: gravity-only stationary
initialisation fundamentally cannot observe yaw, so the full
quaternion residual rotation_to(gt).angle() unfairly penalises
a yaw mismatch that the initialiser had no signal to fix. This
metric isolates the roll / pitch component (the only part the
gravity-only bootstrap can actually recover) by projecting the
world “up” direction into body frame under both rotations and
reporting the angle between the resulting body-frame vectors.
Reads gravity_world from the result, so callers do not need
to thread the gravity vector through separately. Returns 0.0
if gravity_world is the zero vector (degenerate config).
Trait Implementations§
Source§impl Clone for VisualInertialInitializationResult
impl Clone for VisualInertialInitializationResult
Source§fn clone(&self) -> VisualInertialInitializationResult
fn clone(&self) -> VisualInertialInitializationResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl StructuralPartialEq for VisualInertialInitializationResult
Auto Trait Implementations§
impl Forget for VisualInertialInitializationResult
impl Freeze for VisualInertialInitializationResult
impl Move for VisualInertialInitializationResult
impl RefUnwindSafe for VisualInertialInitializationResult
impl Send for VisualInertialInitializationResult
impl Sync for VisualInertialInitializationResult
impl Unpin for VisualInertialInitializationResult
impl UnsafeUnpin for VisualInertialInitializationResult
impl UnwindSafe for VisualInertialInitializationResult
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.