Once the IMU has propagated the state forward to a new camera timestamp, OpenVINS performs a visual measurement update using all features whose tracks are sufficiently long or whose frames are about to leave the sliding window. The update framework is built on the Minimum Mean Square Error (MMSE) estimator — more commonly known as the Kalman filter update — and extends it with three key operations that make it tractable for visual-inertial odometry: nullspace projection to marginalize feature position uncertainty, QR-based measurement compression to bound computational cost, and delayed initialization to safely add new SLAM features to the state vector.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rpng/open_vins/llms.txt
Use this file to discover all available pages before exploring further.
MMSE Estimation Fundamentals
Given a Gaussian prior and a new measurement with , the MMSE update minimizes the expected squared error of the posterior. For a linear measurement model , the optimal posterior mean and covariance are: where is the Kalman gain. These are the fundamental equations behind all update steps in OpenVINS.MSCKF Sliding-Window Updates
OpenVINS maintains a sliding window of past camera poses (clones of the IMU state at each camera timestamp). Each 2D feature observation from camera frame contributes a bearing measurement that depends jointly on the current IMU pose, the relevant clone poses, and the 3D feature position. When a tracked feature leaves the window (i.e., it is no longer observed and at least two views exist), its accumulated observations across all clones are stacked into a single linearized measurement system. The residual for a single observation at camera is: where relates the residual to the filter state (IMU + clones), relates it to the feature position error , and is the pixel noise. MSCKF features are marginalized rather than tracked in the state — their position uncertainty is never held in the covariance matrix. This means the cross-correlations and self-correlations are unavailable, and a direct Kalman update is not possible. The solution is nullspace projection.MSCKF Update: Nullspace Projection
MSCKF Update: Nullspace Projection
The linearized residual for a single feature observed times is:Because the feature covariance and its cross-correlation with the state are unknown, we cannot form the residual innovation covariance directly. Instead, we compute the left nullspace of via thin QR decomposition:Left-multiplying the residual equation by eliminates the feature term (since ):The projected system has dimension , reducing from the original measurements by 3 (the rank of for a 3D point feature). The standard EKF update is then applied to with the modified noise covariance .Implementation (Eigen):
Measurement Compression: QR Decomposition
Measurement Compression: QR Decomposition
After nullspace projection, a single feature tracked through clones produces a Jacobian . With many features, the stacked system can have far more rows than state dimensions, making the matrix inversion in the Kalman gain expensive.OpenVINS applies a second thin QR decomposition to compress all measurements to at most rows:The compressed system is square (or smaller) in the state dimension, so the subsequent EKF update involves only an matrix inversion:This compression step — sometimes called the Givens rotation trick — is critical for real-time performance when many features are tracked simultaneously.
SLAM Update: Delayed Initialization
SLAM Update: Delayed Initialization
Unlike MSCKF features, SLAM features are kept in the state vector and updated sequentially as new observations arrive. Before a feature can enter the state, it must be initialized with a reliable 3D position estimate and a corresponding covariance block.OpenVINS uses delayed initialization: the feature is triangulated from multiple views first (see the Feature Initialization page), and then formally added to the augmented state using the following procedure.Given stacked residuals , Givens rotations transform this into a block-triangular form:The top block yields the new feature’s covariance and cross-correlation with the existing state:The augmented covariance is formed by appending and to the existing matrix. The bottom block then provides a standard MSCKF-style update that constrains the navigation state given the newly initialized feature.
Zero-Velocity Update (ZUPT)
Zero-Velocity Update (ZUPT)
When the platform is stationary, visual features cannot be triangulated (in a monocular system) and dynamic objects in the scene may corrupt feature tracks. OpenVINS handles this with a zero-velocity update: a synthetic measurement asserting that the true acceleration and angular velocity are zero.The measurement residual is formed directly from the raw IMU readings:with Jacobians:A statistical test with an inflated noise matrix (typically the nominal IMU noise) decides whether a ZUPT update should be applied. See the Zero-Velocity Update page for full details.
SLAM vs. MSCKF Features
OpenVINS maintains two distinct categories of visual features, each treated differently in the update step:| Property | MSCKF Features | SLAM Features |
|---|---|---|
| Held in state vector? | No | Yes |
| Covariance block | None | , maintained |
| Marginalization method | Left-nullspace projection () | Standard EKF update with full cross-correlations |
| Typical lifetime | Until they leave the sliding window | Persistent across many camera frames |
| Computational cost | features, compressed via QR | due to growing state dimension |
| Primary purpose | Constrain navigation state | Provide long-term loop-closure capability |
The UpdaterMSCKF Class
UpdaterMSCKF (ov_msckf/src/update/UpdaterMSCKF.h) encapsulates the full MSCKF update pipeline.
update() executes this pipeline for each feature:
- Triangulate the feature using
FeatureInitializer(see Feature Initialization). - Build the stacked Jacobian across all observing clones.
- Chi-squared test: reject features whose residual is inconsistent ().
- Nullspace project via
Q2.T * H_xto eliminate feature dependence. - Stack all projected feature systems.
- Compress via thin QR to bound update cost.
- Apply the standard EKF update equations.
UpdaterMSCKF holds a precomputed chi_squared_table mapping residual dimension to the 95th-percentile value. Features that fail this test are discarded rather than used for update, preventing outlier observations from corrupting the state.