利用KALIBR工具进行ZED2相机的标定

1.KALIBR安装

参考:https://github.com/ethz-asl/kalibr/wiki/installation

1.安装依赖项

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.创建工作区

1
2
3
4
5
6
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.下载源码

1
2
cd ~/kalibr_workspace/src
git clone https://github.com/ethz-asl/Kalibr.git

4.编译

1
2
cd ~/kalibr_workspace
catkin build -DCMAKE_BUILD_TYPE=Release -j4

2.标定ZED2

参考:https://support.stereolabs.com/hc/en-us/articles/360012749113-How-can-I-use-Kalibr-with-the-ZED-Mini-camera-in-ROS-

1.创建文件夹保留所有数据

1
2
mkdir ~/zed-kalibr
cd ~/zed-kalibr

2.打印标定板https://github.com/ethz-asl/kalibr/wiki/downloads#calibration-targets

 

 

 在april_6x6_80x80cm.yaml文件中更新实际的方块尺寸。

1
2
3
4
5
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相机

1
roslaunch zed_wrapper zed2.launch

启用左右摄像头可视化功能,以确保将标定板保持在相机范围内。参考Youtube视频:https://youtu.be/puNXsnrYWTY?t=57

1
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

1
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

查看记录的数据:

1
rosbag info Kalibr_data.bag

3.获取相机参数

使用以下命令生成相机参数文件

1
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文件并填写如下内容

1
2
3
4
5
6
7
8
9
10
#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标定

1
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报告。

 


__EOF__

本文作者noticeable
本文链接https://www.cnblogs.com/noticeable/p/16489341.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。您的鼓励是博主的最大动力!
posted @   noticeable  阅读(1170)  评论(1编辑  收藏  举报
相关博文:
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
历史上的今天:
2017-07-18 状态机的设计实例
2017-07-18 用一个例子来学习阻塞赋值和非阻塞赋值
2017-07-18 设计一个BCD码计数器。
点击右上角即可分享
微信分享提示