kornia-slam
Visual-inertial SLAM in Rust. Point it at a camera, a stereo pair or a stereo pair with an IMU, and it tracks where the camera is and maps the space around it. Built on kornia-rs.
v0.1, early release. Expect the API to change between minor versions.
Features
- Tracks the camera from ORB features: monocular, stereo, or either with an IMU.
- Refines the map with local bundle adjustment, and with a visual-inertial BA when an IMU is present.
- Closes loops. DBoW2 place recognition spots revisited places, and pose-graph optimisation corrects the drift.
- Reads EuRoC and Hilti datasets, MCAP recordings, and live OAK-D or UVC cameras.
- Shows its work in a terminal UI or in Rerun, and scores a run against ground truth with ATE and RPE.
Quick start
Clone the repository and download a EuRoC sequence in ASL format. MH_01_easy is a good first run.
git clone https://github.com/kornia/kornia-slam && cd kornia-slam
# monocular
cargo run --release -p kornia-slam-app -- euroc --data /path/to/MH_01_easy
# stereo + IMU, scored against ground truth
cargo run --release -p kornia-slam-app -- euroc --data /path/to/MH_01_easy --stereo --imu --evaluate
The other sources, the stereo calibration format and every flag are in the app README.
Use it in Copper
Copper is a Rust runtime that builds, runs and replays a whole robot deterministically. cu-kornia-vio packages kornia-slam's stereo visual-inertial odometry as Copper tasks.
Add both crates from the same git source:
[dependencies]
cu-kornia-vio = { git = "https://github.com/kornia/cu-kornia-vio", branch = "main" }
cu-stereo-payloads = { git = "https://github.com/kornia/cu-kornia-vio", branch = "main" }
Get the timestamps right. Stamp each image and IMU sample with its capture time, on one clock. In the drone simulator, a 16 ms image-stamp error made stereo + IMU worse than stereo alone. Fixing it cut the trajectory error over a 440 m flight from 9.7 m to 2.1 m; stereo alone gave 5.7 m.
The Copper guide covers the revisions to pin, the task graph, and the runtime settings for simulation and logging.
SLAM integration for your robot
- Drifting or losing tracking?
- Too slow on your Jetson, Pi or x86 board?
- A camera or IMU it doesn't support?
- Need it in Copper, ROS 2 or your own stack?
- Low light, fast motion or little texture?
We start with a fixed-scope assessment. On recordings we agree with you, we find out whether kornia-slam can track reliably on your platform, where and why it fails, and what the next milestone should be. If something breaks it on your setup, we can fix it in a follow-on engagement.
Ask about an assessment
Tell us about your robot, its sensors and what it needs to track.
Roadmap, contributing and questions: GitHub ยท Discord.
kornia-slam is Apache-2.0 licensed.