Real-time performance is a first-class requirement for any VIO system intended for robotic deployment.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.
ov_eval includes a set of timing tools that let you measure how long each processing stage takes, visualise the distribution of execution times, compare mono vs. stereo configurations, and monitor CPU and memory load over a full run — all without modifying the core estimator code.
How timing data is recorded
Timing information is written directly byov_msckf::VioManager. The output is a comma-separated (CSV) file where:
- The first column is the wall-clock timestamp (seconds).
- The middle columns contain per-component durations (seconds), with component names taken from the CSV header row.
- The last column is the total processing time for that frame.
| Component | What it covers |
|---|---|
tracking | Feature detection and optical-flow tracking |
propagation | IMU pre-integration between camera frames |
msckf update | MSCKF feature measurement update |
slam update | SLAM-feature EKF update (if SLAM features enabled) |
slam delayed | Delayed initialisation of new SLAM features |
marginalization | Sliding-window marginalization step |
total | Sum of all components for the frame |
Timing output is enabled via the
record_timing_information option in VioManagerOptions. Set it to true in your parameter YAML before launching to start generating a timing file.Recording CPU and memory usage
Execution time alone does not capture the full computational load. To measure percent CPU usage, percent memory, and thread count in real time, use thepid_ros.py Python script with the psutil library.
Installing psutil
Adding the recorder to your launch file
Analyzing timing output
timing_flamegraph
The flame-graph script produces a stacked breakdown of per-component times that makes it immediately obvious which component dominates.99th percentile column is especially useful for real-time analysis: it shows the worst-case time that occurs in 1% of frames, which is the relevant bound for a robot running at a fixed camera rate.
An optional second argument subsamples the data before plotting (default: every 10th frame):
timing_histogram
The histogram script bins execution times for each component to reveal the shape of the distribution — whether times are tightly clustered or have a heavy tail.timing_comparison
Use this script to compare timing files side-by-side — for example, to quantify the overhead of stereo tracking vs. monocular:timing_percentages
Processespsutil log folders to summarise CPU and memory usage across multiple runs:
Performance expectations and bottlenecks
Based on the timing data from a standard EuRoC run on a modern laptop:Feature tracking is usually the dominant cost
Feature tracking is usually the dominant cost
Optical-flow tracking over a full image is in the number of features and patch width . For 200 features with a 15×15 patch, tracking typically takes 3–8 ms per frame. Stereo roughly doubles this. Reducing the maximum feature count or enabling image downsampling are the most effective ways to cut tracking time.
MSCKF update scales with the number of features
MSCKF update scales with the number of features
The MSCKF update cost scales with the number of features that are marginalized at each step and the size of the sliding window. With a window of 10 poses and 50 features, the update is typically 3–8 ms. Reducing the window size or the number of SLAM features directly reduces this cost.
Propagation is almost free
Propagation is almost free
IMU propagation is a fixed-cost operation per IMU measurement and typically takes under 0.5 ms regardless of state size. It is rarely a bottleneck.
Marginalization can spike on difficult datasets
Marginalization can spike on difficult datasets
Marginalization involves Schur-complement operations whose cost grows with the number of features and clone states. On datasets with long corridors or slow motion (many features per frame), marginalization times can spike to 5–10 ms in the worst case.
Tips for improving real-time performance
Profile first
Run
timing_flamegraph to identify which component accounts for the majority of the total time. Only optimise the bottleneck — improving a component that takes 0.4 ms will have negligible effect on a 12 ms total budget.Reduce the feature count
Lower
max_cameras tracked features or enable the klt_win_size / num_pts parameters to reduce optical-flow cost. Fewer features also speeds up the MSCKF update.Shorten the clone window
A shorter sliding window reduces both the MSCKF update dimension and the marginalization cost, at the expense of slightly reduced accuracy on fast-motion sequences.
Disable inline plotting
In production deployments, set
DISABLE_MATPLOTLIB=ON at build time to avoid any overhead from the matplotlib-cpp bridge (even when not actively plotting).