利用KALIBR工具进行ZED2相机的标定
作者:互联网
1.KALIBR安装
参考:https://github.com/ethz-asl/kalibr/wiki/installation
1.安装依赖项
sudo apt-get install python-setuptools python-rosinstall ipython libeigen3-dev libboost-all-dev doxygen libopencv-dev ros-kinetic-vision-opencv ros-kinetic-image-transport-plugins ros-kinetic-cmake-modules python-software-properties software-properties-common libpoco-dev python-matplotlib python-scipy python-git python-pip ipython libtbb-dev libblas-dev liblapack-dev python-catkin-tools libv4l-dev
2.创建工作区
mkdir -p ~/kalibr_workspace/src cd ~/kalibr_workspace source /opt/ros/kinetic/setup.bash catkin init catkin config --extend /opt/ros/indigo catkin config --merge-devel # Necessary for catkin_tools >= 0.4. catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
3.下载源码
cd ~/kalibr_workspace/src git clone https://github.com/ethz-asl/Kalibr.git
4.编译
cd ~/kalibr_workspace catkin build -DCMAKE_BUILD_TYPE=Release -j4
2.标定ZED2
1.创建文件夹保留所有数据
mkdir ~/zed-kalibr cd ~/zed-kalibr
2.打印标定板https://github.com/ethz-asl/kalibr/wiki/downloads#calibration-targets
在april_6x6_80x80cm.yaml文件中更新实际的方块尺寸。
target_type: 'aprilgrid' #gridtype tagCols: 6 #number of apriltags tagRows: 6 #number of apriltags tagSize: 0.022 #size of apriltag, edge to edge [m] tagSpacing: 0.3 #ratio of space between tags to tagSize
3.数据记录
启动zed2相机
roslaunch zed_wrapper zed2.launch
启用左右摄像头可视化功能,以确保将标定板保持在相机范围内。参考Youtube视频:https://youtu.be/puNXsnrYWTY?t=57
rosrun image_view image_view image:=/zed2/zed_node/left/image_rect_color & rosrun image_view image_view image:=/zed2/zed_node/right/image_rect_color
record
rosbag record -O Kalibr_data.bag /zed2/zed_node/imu/data_raw /zed2/zed_node/left/image_rect_color /zed2/zed_node/right/image_rect_color
查看记录的数据:
rosbag info Kalibr_data.bag
3.获取相机参数
使用以下命令生成相机参数文件
kalibr_calibrate_cameras --bag Kalibr_data.bag --topics /zed2/zed_node/left/image_rect_color /zed2/zed_node/right/image_rect_color --models pinhole-radtan pinhole-radtan --target april_6x6_80x80cm.yaml
将会得到camchain-Kalibr_data.yaml和校准结果的完整PDF报告
4.设置IMU参数
创建一个imu-params.yaml文件并填写如下内容
#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: /zed2/zed_node/imu/data_raw #the IMU ROS topic update_rate: 400.0 #Hz (for discretization of the values above)
5.相机/IMU标定
kalibr_calibrate_imu_camera --bag Kalibr_data.bag --cam camchain-Kalibr_data.yaml --imu imu-params.yaml --target april_6x6_80x80cm.yaml
结束后将得到camchain-imucam-Kalibr_data.yaml文件和完整的PDF报告。
标签:kalibr,zed,--,image,Kalibr,标定,zed2,ZED2,KALIBR 来源: https://www.cnblogs.com/noticeable/p/16489341.html