This article mainly uses the kalibr tool to calibrate the ZED2 binocular camera + IMU and run VINS-Fusion.
The selection method of calibration plate and matters needing attention in calibration are explained.
ZED2 binocular camera + IMU joint calibration
Reference blog:
ZED2 camera calibration and running VINS-mono
Ubuntu16.04 uses kalibr tool to calibrate ZED2 camera
1 Install calibration tools
1. Use the kalibr tool to calibrate the ZED2 binocular camera and install the kalibr tool according to the above blog. The eigen version I first used was 3.3.9. I found that this version always reported errors when compiling kalibr. After switching to eigen3.3.7, there was no problem.
2. Use imu_utils to calibrate the IMU, install and compile code_utils and imu_utils in sequence.
The download address of imu_utils is: https://github.com/gaowenliang/imu_utils
The download address of code_utils is: https://github.com/gaowenliang/code_utils
Note, do not put imu_utils and code_utils together under src for compilation.
Since imu_utils depends on code_utils, first put code_utils under src in the workspace and compile it. Then put imu_utils under src and compile again.
2 Select calibration plate
Regarding the selection of calibration boards, checkerboard and AprilGrid are the more commonly used ones. The camera needs to be 1-2m away from the calibration plate, which occupies more than 60% of the field of view.
**Note:** During the calibration process, the calibration plate should not leave the camera's field of view. The start and end should be smooth, and try to make the calibration plate appear in all corners of the field of view.
Checkerboard:
Note that targetCols and targetRows count the number of interior corner points.
target_type: 'checkerboard' #gridtype
targetCols: 6 #number of internal chessboard corners
targetRows: 8 #number of internal chessboard corners
rowSpacingMeters: 0.17 #size of one chessboard square [m]
colSpacingMeters: 0.17 #size of one chessboard square [m]
aprilgrid:
tagSpacing=Small grid side length/Large grid side length
target_type: 'aprilgrid' #gridtype
tagCols: 6 #number of apriltags
tagRows: 6 #number of apriltags
tagSize: 0.088 #size of apriltag, edge to edge [m]
tagSpacing: 0.3 #ratio of space between tags to tagSize
Calibration board download: https://github.com/ethz-asl/kalibr/wiki/downloads#calibration-targets
You can also use the command to generate PDF files:
kalibr_create_target_pdf --type checkerboard --nx 6 --ny 6 --csx 0.03 --csy 0.03
kalibr_create_target_pdf --type apriltag --nx 6 --ny 6 --tsize 0.08 --tspace 0.03
3 ZED2 calibration data recording
First, start the ZED2 ROS node:
roscore
roslaunch zed_wrapper zed2.launch
View the topic, turn on the visualization image, and ensure that the calibration plate is in the left and right eye images:
rostopic list
rosrun image_view image_view image:=/zed2/zed_node/left/image_rect_gray
rosrun image_view image_view image:=/zed2/zed_node/right/image_rect_gray
Reduce the image frequency and view the current frequency:
rosrun topic_tools throttle messages /zed2/zed_node/imu/data 280 /imu/data
rosrun topic_tools throttle messages /zed2/zed_node/left/image_rect_gray 4.0 /left/gray
rosrun topic_tools throttle messages /zed2/zed_node/right/image_rect_gray 4.0 /right/gray
rostopic hz /left/gray
rostopic hz /right/gray
Start recording a bag file:
rosbag record -O Kalib_data_vga.bag /imu/data /left/gray /right/gray
Calibrate camera parameters:
kalibr_calibrate_cameras --bag Kalibr_data.bag \
--topics /left/gray /right/gray \
--models pinhole-radtan pinhole-radtan
--target april_6x6_80x80cm.yaml
4 Calibrate IMU
Place the camera still, record two hours of imu data, and modify the launch file.
rosbag record -O imu_calibration /imu/data
<launch>
<node pkg="imu_utils" type="imu_an" name="imu_an" output="screen">
<param name="imu_topic" type="string" value= "/zed2/zed_node/imu/data_raw"/>
<param name="imu_name" type="string" value= "ZED2"/>
<param name="data_save_path" type="string" value= "$(find imu_utils)/data/"/>
<param name="max_time_min" type="int" value= "120"/>
<param name="max_cluster" type="int" value= "200"/>
</node>
</launch>
roslaunch imu_utils ZED2_calibration.launch
rosbag play -r 200 imu_calibration.bag
5 Camera IMU joint calibration
Joint calibration is mainly to obtain the conversion relationship between the camera and IMU axis system
kalibr_calibrate_imu_camera --bag Kalibr_data.bag \
--cam camchain-Kalibr_data.yaml \
--imu imu-params.yaml \
--target target april_6x6_80x80cm.yaml
You’re done here!