1、官方教程:https://github.com/ethz-asl/kalibr/wiki/camera-imu-calibration
1、源码地址:https://github.com/ethz-asl/kalibr.git
2、将源码克隆下来,放在ROS工作空间编译
3、此处报错libv412.h没有那个文件:此文件是专门用来处理视频图像的
sudo apt-get install libv41-dev
1、样例下载地址:https://github.com/ethz-asl/kalibr/wiki/downloads
2、运行命令:
kalibr_calibrate_imu_camera --target /home/cjn/kalibr/src/kalibr/dynamic/april_6x6.yaml --cam /home/cjn/kalibr/src/kalibr/dynamic/camchain.yaml --imu /home/cjn/kalibr/src/kalibr/dynamic/imu_adis16448.yaml --bag /home/cjn/kalibr/src/kalibr/dynamic/dynamic.bag --bag-from-to 5 45
3、备注:
1、--bag-from-to 5 45 表示选取数据集5-45s
2、运行报错:ImportError: cannot import name NavigationToolbar2Wx
"/home/cjn/kalibr/src/kalibr/Schweizer-Messer/sm_python/python/sm/PlotCollection.py"
解决:将 PlotCollection.py 中的NavigationToolbar2Wx 改为 NavigationToolbar2WxAgg
采集包含原始图像和IMU数据的bag包,采集数据的最佳频率为图像20Hz, IMU 200 Hz (当然其他频率也没问题)。重要的是确保标定目标的良好和均匀照明,并保持相机快门时间低以避免过度的运动模糊。
rosbag record -O stereo_imu_calibra.bag /left/image_raw /right/image_raw /imu/data_raw
注:
1)采集数据的起始和结束阶段注意别晃动太大,如从桌子上拿起或者放下。如果有这样的动作,在标定阶段应该跳过bag数据集的首尾的数据。
2)采集数据的时候应该给imu各个轴足够的激励,如先依次绕各个轴运动,运动完后来个在空中画8字之类的操作,当然也要注意别运动太剧烈,图像都模糊了。
3)ROS 提供了改变 topic 发布频率的节点throttle, 指令如下 :
rosrun topic_tools throttle messages /left/image_raw 4.0 /left
rosrun topic_tools throttle messages /right/image_raw 4.0 /right
kalibr_calibrate_imu_camera --target /home/cjn/kalibr/src/kalibr/dynamic/april_6x6.yaml --cam /home/cjn/kalibr/src/kalibr/dynamic/camchain.yaml --imu /home/cjn/kalibr/src/kalibr/dynamic/imu_adis16448.yaml --bag /home/cjn/kalibr/src/kalibr/dynamic/dynamic.bag --bag-from-to 5 45
cam0:
cam_overlaps: [1, 3]
camera_model: pinhole
distortion_coeffs: [-0.0016509958435871643, 0.02437222940989351, -0.03582816956989852,
0.019860839087717054] #畸变参数
distortion_model: equidistant #畸变模型
intrinsics: [461.487246372674, 460.1113992557959, 356.39105303227853, 231.15719697054647] #相机内参
resolution: [752, 480]
rostopic: /cam0/image_raw
cam1:
T_cn_cnm1: #左右摄像头的相对位姿
- [0.9999987703316401, 0.0011891090293591699, -0.0010224259962834177, -0.11016759824092018]
- [-0.0011883808160330711, 0.9999990400088897, 0.0007125533866886033, -0.0003216647632433766]
- [0.0010232723184295653, -0.0007113374790444545, 0.9999992234560721, 0.00012078907255410462]
- [0.0, 0.0, 0.0, 1.0]
cam_overlaps: [0, 3]
camera_model: pinhole
distortion_coeffs: [-0.0009362378060020789, 0.018833308358932984, -0.030558453797100132,
0.01955083559432553]
distortion_model: equidistant
intrinsics: [462.4318044040118, 461.1780497604126, 377.0119530476368, 226.49966248854923]
resolution: [752, 480]
rostopic: /cam1/image_raw
rostopic: /imu0
update_rate: 200.0 #Hz
accelerometer_noise_density: 0.01 #continous
accelerometer_random_walk: 0.0002
gyroscope_noise_density: 0.005 #continous
gyroscope_random_walk: 4.0e-06
noise_density: 高斯白噪声,测量噪声是AD转换器件引起的外部噪声,波动激烈的测量白噪声
random_walk: 随机游走噪声,是传感器内部机械、温度等各种物理因素产生的传感器内部误差的综合参数,是变化缓慢的bias
#example for aprilgrid
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
#example: tagSize=2m, spacing=0.5m --> tagSpacing=0.25[-]