引用自网址Kalibr-zed,稍有修改
1.Preliminar operations
install kalibr following the installation guide
create folder to keep all the data:
$ mkdir ~/zed-kalibr
start the ZED node:
$ roslaunch zed_wrapper zedm.launch
enable left and right camera visualization to be sure to keep the target in sight. Open a new terminal and enter
//record unrectied raw image
$ rosrun image_view image_view image:=/zed/zed_node/left_raw/image_raw_color
$ rosrun image_view image_view image:=/zed/zed_node/right_raw/image_raw_color
2.Data recording
record the rosbag to be used as Kalibr input:
$ rosbag record -O Kalibr_data.bag /imu/data_lpms /zed/zed_node/left_raw/image_raw_color /zed/zed_node/right_raw/image_raw_color
For a correct calibration you should provide the following movements:
Pitch rotation
Yaw rotation
Roll rotation
Up/Down translation
Left/Right translation
Forward/Backward translation
A series of random movement
3 get the camera parameters
You can generate the camera parameters file using the following command:
//record unrectied raw image
$ kalibr_calibrate_cameras --bag Kalibr_data.bag --topics /zed/zed_node/left_raw/image_raw_color /zed/zed_node/right_raw/image_raw_color --models pinhole-radtan pinhole-radtan --target april_grid.yaml
When the elaboration is complete (it takes many minutes according to the number of image acquired) you will get the file camchain-Kalibr_data.yaml and a full PDF report of the result of the calibration.
4 set IMU parameters
Create a file named imu-params.yaml
$ gedit imu-params.yaml
and fill it with the following content:
#Accelerometers
accelerometer_noise_density: 1.4e-03 #Noise density (continuous-time)
accelerometer_random_walk: 8.0e-05 #Bias random walk
#Gyroscopes
gyroscope_noise_density: 8.6e-05 #Noise density (continuous-time)
gyroscope_random_walk: 2.2e-06 #Bias random walk
rostopic: /zed/zed_node/imu/data_raw #the IMU ROS topic
update_rate: 800.0 #Hz (for discretization of the values above)
Note: the update_rate value must match the value of the parameter imu_pub_rate in the file params/zedm.yaml.
5.Camera/IMU calibration
You can get the final camera/IMU calibration executing the following command:
$ kalibr_calibrate_imu_camera --bag Kalibr_data.bag --cam camchain-Kalibr_data.yaml --imu imu-params.yaml --target april_grid.yaml