This example demonstrates how to use the cuVSLAM C++ API for visual-inertial odometry (VIO) and SLAM on the EuRoC MAV dataset.
This is a single-file C++ project that closely mirrors the functionality of examples/euroc/track_euroc.py but uses the C++ API directly.
It also expands to add SLAM results visualization.
The example is integrated into the workspace CMake build and produces the track_euroc executable in the bin/ directory alongside other tools.
- CMake 3.19 or higher
- C++17 compatible compiler
- CUDA 12 or 13
All dependencies (libpng, yaml-cpp) are managed via FetchContent in the workspace build — no system packages needed.
All build commands must be run from the repository root (the top-level directory containing the root CMakeLists.txt), not from examples/euroc/cpp/.
The example is built as part of the main workspace:
# From the repository root
cmake -S . -B build
cmake --build build --target track_eurocTo re-build after code changes, run:
cmake --build build --target track_eurocTo use Rerun Viewer for live visualization, see Rerun C++ Installation.
Enable Rerun visualization with the workspace-level USE_RERUN option, the Rerun C++ SDK will be fetched automatically:
# From the repository root
cmake -S . -B build -DUSE_RERUN=ON
cmake --build build --target track_eurocWith Rerun enabled the C++ example loads euroc_blueprint.rbl (shipped alongside the executable) to customize the visualization layout. To regenerate it:
# Uncomment blueprint.save(blueprint_path) in track_euroc.py, then run from examples/euroc/:
cd examples/euroc
python3 track_euroc.pyThe example requires the EuRoC dataset (see Python tutorial for downloading instructions):
./build/bin/track_euroc /path/to/euroc/dataset/mav0