This guide walks you through a complete first calibration using Kalibr. You will generate an AprilGrid calibration target, record a ROS bag with your camera, runDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ethz-asl/kalibr/llms.txt
Use this file to discover all available pages before exploring further.
kalibr_calibrate_cameras, and interpret the output. All commands assume you are working inside the Docker container or a sourced ROS workspace — see the installation guide if you have not set that up yet.
If you are using Docker, start the container and source the workspace before running any Kalibr commands:
Before you begin
You need:- Kalibr installed (Docker or source build)
- A camera publishing images on a ROS topic
- A printer capable of printing at the correct physical scale
Generate a calibration target PDF
Kalibr provides
This produces a PDF file (
kalibr_create_target_pdf to generate print-ready calibration targets. The AprilGrid is the recommended target type — it is robust to partial occlusions because each tag has a unique ID.| Flag | Meaning |
|---|---|
--type apriltag | AprilTag-based grid target |
--nx 6 | Number of tags along the x axis |
--ny 6 | Number of tags along the y axis |
--tsize 0.08 | Physical tag size in metres (here 8 cm) |
--tspace 0.3 | Tag spacing as a fraction of tag size (30%) |
target.pdf) in the current directory.The calibration target configuration used in subsequent steps must match what you passed to kalibr_create_target_pdf. Save an aprilgrid.yaml file:Record a ROS bag with camera data
Mount the printed target rigidly (on a flat wall or clipboard) and move the camera in front of it — or hold the target and move it in front of a static camera. You need to cover the full field of view with many different viewing angles.Record camera images to a ROS bag:Replace
/cam0/image_raw with the actual topic name your camera publishes on.Tips for a good calibration bag:- Record at least 60–80 frames where the full target is visible.
- Tilt and rotate the camera (or target) significantly — pure planar motion does not constrain all intrinsics.
- Include close and far distances to the target.
- Keep movements slow and steady to avoid motion blur.
- Aim for good, consistent lighting with no glare on the target.
Run camera calibration
Run For a two-camera rig, specify one model and one topic per camera:Choosing a camera model:
kalibr_calibrate_cameras with your bag file, target configuration, camera model, and image topic:| Model string | When to use |
|---|---|
pinhole-radtan | Standard lens, moderate field of view |
pinhole-equi | Wide-angle or fisheye lens |
pinhole-fov | Fisheye lens with field-of-view model |
omni-radtan | Omnidirectional camera |
ds-none | Double Sphere model (fisheye) |
Kalibr selects which images to include based on a mutual-information criterion. It is normal for many frames to be skipped — the tool prints progress and reports how many views were used.
Review the output files
When calibration completes, Kalibr writes three output files named after your bag file (for example,
calibration-camchain.yaml, calibration-results-cam.txt, and calibration-report-cam.pdf).calibration-camchain.yaml — the primary result file. It contains the intrinsic parameters for each camera and, for multi-camera rigs, the extrinsic transforms between cameras:calibration-results-cam.txt — a detailed text report with reprojection error statistics and optimizer output.calibration-report-cam.pdf — a visual report with reprojection error plots, detected corners, and camera geometry diagrams.What to do next
Camera-IMU calibration
Use the
camchain.yaml output from this step as input to calibrate an IMU against your camera system.Multi-camera calibration guide
Learn advanced options for calibrating rigs with more than two cameras or non-overlapping fields of view.
AprilGrid target reference
Full reference for AprilGrid configuration options and printing guidance.
Camera models
Understand the projection and distortion model options available in Kalibr.