d455双目相机联合IMU标定

感谢这两位博主的优秀文章:

RealSense D455的标定并运行VINS-FUSION_Z_Jin16的博客-CSDN博客_d455 标定

Realsense D435I标定_小岛_神酱的博客-CSDN博客_d435i参数

主要目的是测试标定好的相机在vins和orb3上的效果。

  • IMU标定

建立工作空间,下载code_utils imu_utils;得先编译code组件。

git clone git@github.com:gaowenliang/imu_utils.git
git clone git@github.com:gaowenliang/code_utils.git
 

修改参数rs_camera

<arg name="unite_imu_method"          default="linear_interpolation"/>

编写启动文件,打开../imu_utils/launch ,打开终端运行

gedit d455_imu_calibration.launch

输入:

<launch>

    <node pkg="imu_utils" type="imu_an" name="imu_an" output="screen">
    	<!--TOPIC名称和上面一致-->
        <param name="imu_topic" type="string" value= "/camera/imu"/>
        <!--imu_name 无所谓-->
        <param name="imu_name" type="string" value= "d455"/>
        <!--标定结果存放路径-->
        <param name="data_save_path" type="string" value= "$(find imu_utils)/data/"/>
        <!--数据录制时间-min-->
        <param name="max_time_min" type="int" value= "50"/>
        <!--采样频率,即是IMU频率,采样频率可以使用rostopic hz /camera/imu查看,设置为200,为后面的rosbag play播放频率-->
        <param name="max_cluster" type="int" value= "200"/>
    </node>
    
</launch>

记录IMU数据,本人2小时;

rosbag record -O imu_calibration /camera/imu

运行刚刚写的launch;注意source;

roslaunch imu_utils d455_imu_calibration.launch

然后播放录制的包:也可以实时,自己改;

cd 存放imu_calibration.bag的路径
rosbag play -r 200 imu_calibration.bag

标定结束后在/src/imu_utils/data中生成许多文件,其中d455_imu_param.yaml就是我们想要的结果。

  • 多相机标定

使用的自己的棋盘格标定板。

官网下载编译kalibar:https://github.com/ethz-asl/kalibr/wiki/installation

棋盘格参数设置:

target_type: 'checkerboard' #gridtype
targetCols: 8               #number of internal chessboard corners 注意是内角点数目
targetRows: 11               #number of internal chessboard corners 注意是内角点数目
rowSpacingMeters: 0.045      #size of one chessboard square [m]
colSpacingMeters: 0.045      #size of one chessboard square [m]

ros录制和回放数据子集教程参考官网或链接https://blog.csdn.net/u010510350/article/details/72457758。

rosrun kalibr kalibr_calibrate_cameras --target src/kalibr/checkerboard.yaml --bag ~/project/calibration_ws/bag/d455_915/multicameras_calibration.bag --models pinhole-radtan pinhole-radtan --topics /camera/infra1/image_rect_raw /camera/infra2/image_rect_raw

其中–target / ...yaml是标定板的配置文件,注意如果选择棋格盘,注意targetCols和targetRows表示的是内侧角点的数量,不是格子数量。–bag ....bag 是录制的数据包,models pinhole-radtan pinhole-radtan pinhole-radtan表示摄像头的相机模型和畸变模型(解释参考https://github.com/ethz-asl/kalibr/wiki/supported-models,根据需要选取,其中VINS使用的畸变模型是radtan), --topics /camera1 /camera2 /cameran表示摄像头对应的拍摄的数据话题,–bag-from-to 3 202表示处理bag中3-202秒的数据。–show-extraction表示显示检测特征点的过程,这些参数可以相应的调整。
可以使用rosbag info 来参看录制的包的信息

结束后有三个文件

看一下results-cam-homezjmulticameras_calibration.txt中的误差reprojection error在0.1-0.2标定结果是好的,用打印的纸很难标到这么低的误差。

  • IMU+双目相机标定

写imu和双目配置文件:示例:

imu.yaml

#Accelerometers
accelerometer_noise_density: 1.9880997991281971e-02  #Noise density (continuous-time)
accelerometer_random_walk:   4.0490731441383501e-04  #Bias random walk

#Gyroscopes
gyroscope_noise_density:     2.0419394959506850e-03   #Noise density (continuous-time)
gyroscope_random_walk:       1.4730980784156999e-05  #Bias random walk

rostopic:                    /camera/imu     #the IMU ROS topic
update_rate:                 200.0      #Hz (for discretization of the values above)

chain.yaml格式参考Kalibr官方教程https://github.com/ethz-asl/kalibr/wiki/yaml-formats中的chain.yaml,具体的参数参考上面得到的yaml文件,没有的参数可以删除,最终结果示例如下:

cam0: 
  camera_model: pinhole
  distortion_coeffs: [0.00422382476865408, -0.007054135809324035, -0.0002644424623023447, -0.0005760298576609872]
  distortion_model: radtan
  intrinsics: [385.97860717844003, 386.2571493245202, 316.8739581897098, 239.24969368480154]
  resolution: [640, 480]
  rostopic: /camera/infra1/image_rect_raw
cam1:
  T_cn_cnm1:
  - [0.9999979820943965, 1.986357968399704e-05, 0.002008833635563198, -0.09510360205596391]
  - [-2.045914753445403e-05, 0.9999999558481248, 0.00029645433663592707, -7.479825700268832e-05]
  - [-0.0020088276582250855, -0.0002964948374427818, 0.9999979383490013, 0.000352390591339898]
  - [0.0, 0.0, 0.0, 1.0] 
  camera_model: pinhole
  distortion_coeffs: [0.004823082443302526, -0.006446052821538248, -0.000172048480870964, -0.0013969375809827992]
  distortion_model: radtan
  intrinsics: [385.99858040160655, 386.4362381008456, 316.56843505915964, 239.25358539372698]
  resolution: [640, 480]
  rostopic: /camera/infra2/image_rect_raw

imu和双目数据时间对齐

<arg name="enable_sync"               default="true"/>

调整imu和双目topic的发布频率 ,其中双目图像的发布频率改为20Hz,imu发布频率改为200Hz

记录包:

rosbag record -O imu_stereo.bag /camera/infra1/image_rect_raw /camera/infra2/image_rect_raw /camera/imu

开始标定

kalibr_calibrate_imu_camera --bag ~/project/calibration_ws/bag/d455_915/imu_stereo.bag --cam ~/project/calibration_ws/bag/d455_915/chain.yaml --imu ~/project/calibration_ws/bag/d455_915/imu.yaml --target /home/b/project/kalibar_ws/src/kalibr/d455/chain.yaml /home/b/project/kalibar_ws/src/kalibr/d455/imu.yaml/checkboard.yaml --bag-from-to 2 110 --show-extraction

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值