Skip to main content

Documentation 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_bagcreater converts a dataset directory containing timestamped camera images and IMU measurements into a ROS bag file. This is the recommended way to prepare data collected outside of ROS — for example, from a custom sensor driver or a dataset that was recorded in a non-ROS format — for use with all Kalibr calibration tools.

Synopsis

kalibr_bagcreater --folder <dataset_dir> --output-bag <output.bag>

Example

kalibr_bagcreater --folder /data/my_dataset --output-bag /data/my_dataset.bag

Dataset directory structure

The tool expects the following directory layout inside --folder:
dataset/
├── cam0/
│   ├── 1385030880.100000000.png
│   ├── 1385030880.133333333.png
│   └── ...
├── cam1/
│   ├── 1385030880.100000000.png
│   └── ...
├── imu0.csv
└── imu1.csv   # optional, for multi-IMU setups
Camera folders must be named with the prefix cam (e.g., cam0, cam1). Each image file must be named with its timestamp in nanoseconds: <seconds><nanoseconds>.png (zero-padded to 9 nanosecond digits). IMU CSV files must start with the prefix imu and use the .csv extension (e.g., imu0.csv, imu1.csv). Each row contains:
timestamp_ns, omega_x, omega_y, omega_z, alpha_x, alpha_y, alpha_z
where omega is angular velocity in rad/s and alpha is linear acceleration in m/s².

Flags

--folder
string
Path to the dataset directory. The tool scans this directory recursively for cam* subdirectories and imu*.csv files.
--output-bag
string
Path and filename for the output ROS bag. Default: output.bag.

Output topics

The tool publishes the following ROS topics into the bag:
SourceROS topicMessage type
cam0/ images/cam0/image_rawsensor_msgs/Image
cam1/ images/cam1/image_rawsensor_msgs/Image
imu0.csv/imu0sensor_msgs/Imu
imu1.csv/imu1sensor_msgs/Imu
Images are published as mono8 (grayscale). The topic name is derived from the folder or file name: cam0/cam0/image_raw, imu0/imu0.
Images are read as grayscale with OpenCV. Color images are converted to single-channel mono8 automatically.

Supported image formats

The tool accepts images with the following extensions: .bmp, .png, .jpg. All images within a camera folder are sorted by timestamp (derived from filename) before being written to the bag.

Build docs developers (and LLMs) love