-
Notifications
You must be signed in to change notification settings - Fork 1.4k
ROS2 Calibration Using Kalibr
Kalibr requires ROS1 to run. If you are on a ROS2 system and do not want to corrupt your environmental variables, we recommend using the docker container to run all Kalibr commands. Either using a ROS1 system or the docker will require getting your camera and IMU data into the ROS1 rosbag format. This guide will have you install a helper toolbox called rosbags to handle this conversion. The ROS2 bag must only have ROS2 standard types in it (such as Image and IMU standard messages). Please checkout the official documentation and project:
- Documentation: https://ternaris.gitlab.io/rosbags/
- Source Code: https://gitlab.com/ternaris/rosbags
First convert the ROS2 folder (contains the database and metadata file) into the ROS1 bag file.
If you recorded other non-image IMU topics (or non-standard message types) use --exclude-topic
to not convert them.
See the official documentation for what limitations there are.
pip3 install rosbags>=0.9.12 # might need -U
rosbags-convert <ros2_bag_folder> --dst calib_01.bag --exclude-topic <non_img_and_imu_topics>
From here you can enter your docker (this assumes you have clone and build the docker already):
FOLDER=$(pwd)
xhost +local:root
docker run -it -e "DISPLAY" -e "QT_X11_NO_MITSHM=1" \
-v "/tmp/.X11-unix:/tmp/.X11-unix:rw" \
-v "$FOLDER:/data" kalibr
and then run your calibration commands:
source devel/setup.bash
rosrun kalibr kalibr_calibrate_cameras \
--bag /data/calib_01.bag --target /data/april_6x6.yaml \
--models pinhole-radtan pinhole-radtan \
--topics /cam0/image_raw /cam1/image_raw
To go the opposite way from bagcreater, we can do the following:
pip3 install rosbags>=0.9.11
rosbags-convert calib_01.bag --dst <ros2_bag_folder>
Multiple camera calibration
Camera-IMU calibration
Multi-IMU and IMU intrinsic calibration
Rolling Shutter camera calibration
(only ROS):
Camera focus
Calibration validator
ROS2 support
Supported camera models
Calibration targets
Bag format
YAML formats
IMU Noise Model
Example: Calibrating a VI-Sensor
Example: Calibrating RealSense Cameras