700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 标定(二)----------双目相机与IMU联合标定(工具箱使用方法——Kalibr)

标定(二)----------双目相机与IMU联合标定(工具箱使用方法——Kalibr)

时间:2021-07-25 10:30:59

相关推荐

标定(二)----------双目相机与IMU联合标定(工具箱使用方法——Kalibr)

16个相机参数:

Overview

ethz-asl/kalibr is a toolbox that solves the following calibration problems:

Multiple camera calibration: intrinsic and extrinsic calibration of a camera-systems with non-globally shared overlapping fields of view

Camera-IMU calibration: spatial and temporal calibration of an IMU w.r.t a camera-system

Rolling Shutter Camera calibration: full intrinsic calibration (projection, distortion and shutter parameters) of rolling shutter cameras

kalibr website:

/ethz-asl/kalibr/wiki/multiple-camera-calibration

/ethz-asl/kalibr

1.安装

Kalibr 提供两种使用方式。第一种为CDE下直接使用,作者将所需的库文件打包好,省去了配置dependency的步骤,可以直接从

/ethz-asl/kalibr/wiki/downloads

下载, 注意需要科学浏览。

下载之后直接用

./cde-exec+命令 即可使用对应的工具。

例如如果我们想使用kalibr内的kalibr_calibrate_cameras功能,

使用

./ced-exec kalibr_calibrate_cameras --target april_6x6.yaml --bag static.bag --models pinhole-equi pinhole-equi omni-radtan omni-radtan --topics /cam0/image_raw /cam1/image_raw /cam2/image_raw /cam3/image_raw

单目+IMU双目+IMU为例,讲解使用Kalibr工具标定Camera-IMU,其中使用的摄像头分别为Realsense ZR300MYNT-EYE S系列摄像头

2.开始标定

Kalibr不仅提供了IMU以及camera的联合标定工具箱,也提供了camera标定工具箱。

在此我们先使用camera标定工具对相机进行标定。

首先我们需要制作标定板,在此推荐使用april tag,可以使用kalibr自带工具自定义生成不同大小的标定板,命令如下

kalibr_create_target_pdf --type apriltag --nx [NUM_COLS] --ny [NUM_ROWS] --tsize [TAG_WIDTH_M] --tspace [TAG_SPACING_PERCENT]

roscorerosrun uvc_camera uvc_camera_noderosrun image_view image_view image:=/image_rawrostipic listrqt_image_viewrosbag record -o test /image_rawrosbag play test_-08-14-14-22-35.bag

将生成的pdf打印出来,置于平稳,光照充足的地方,注意要保持平整。

Kalibr作者推荐将camera固定,然后移动标定板,这样可以提高标定的稳定性,但是鉴于我使用场景受限,我使用的是晃动camera方法。

之后就可以开始录制bag了,使用

rosbag record /cam0/image_raw /cam1/image_raw /imu0

若对相机标定结果满意我们可以继续进行camera以及imu的联合标定步骤,此步使用了如下信息:

1. 标定板yaml

2. 相机标定结果yaml

3. imu内参yaml

4. 前面使用的对应bag

有了如上材料即可进行联合标定,具体如下

kalibr_calibrate_imu_camera --target aprilgrid6x4.yaml --cam camchain--06-14-09-13-29.yaml --imu imu.yaml --bag -06-14-09-13-29.bag --bag-from-to 5 45

最后的--bag_from_to是选取地5-45s的bag数据,去除了拾取防止设备产生的抖动部分影响。我们建议进行多组标定之后将标定结果进行最佳无偏估计,不建议对R部分直接取平均值,可以将多组数据的R部分转换成四元数。之后进行处理。

3.标定板文件:target.yaml

Kalibr支持三种标定板,分别是Aprilgrid、Checkerboard和Circlegrid。

4.帮助小陶的标定记录

april.yaml

target_type: 'aprilgrid' #gridtype

tagCols: 6 #number of apriltags

tagRows: 6 #number of apriltags

tagSize: 0.025#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[-]

imu_adis16448.yaml

rostopic: /imu/data

update_rate: 200.0 #Hz

#accelerometer_noise_density: 2.0000e-3 #continous

#accelerometer_random_walk: 1.9393e-05

#gyroscope_noise_density: 1.6968e-04 #continous

#gyroscope_random_walk: 1.9393e-05

accelerometer_noise_density: 1.2e-2 #continous

accelerometer_random_walk: 3.0e-05

gyroscope_noise_density: 1.0e-02 #continous

gyroscope_random_walk: 3.0e-05

results-imucam--11-12-11-40-05.txt

Calibration results

===================

Normalized Residuals

----------------------------

Reprojection error (cam0): mean 0.233871733163, median 0.206334845347, std: 0.148605727319

Gyroscope error (imu0): mean 0.0943654955325, median 0.0867912466407, std: 0.0496732486016

Accelerometer error (imu0): mean 0.119169698923, median 0.107462875286, std: 0.0668447618807

Residuals

----------------------------

Reprojection error (cam0) [px]: mean 0.233871733163, median 0.206334845347, std: 0.148605727319

Gyroscope error (imu0) [rad/s]: mean 0.0133452963602, median 0.0122741358095, std: 0.00702485818595

Accelerometer error (imu0) [m/s^2]: mean 0.03768533, median 0.0182370546818, std: 0.011343932259

Transformation (cam0):

-----------------------

T_ci: (imu0 to cam0):

[[ 0.01032731 -0.99994666 -0.00016158 0.01401135]

[ 0.03105076 0.0004822 -0.99951769 0.07414391]

[ 0.99946446 0.01031731 0.03105408 -0.04191072]

[ 0.0.0.1. ]]

T_ic: (cam0 to imu0):

[[ 0.01032731 0.03105076 0.99946446 0.03944135]

[-0.99994666 0.0004822 0.01031731 0.01440725]

[-0.00016158 -0.99951769 0.03105408 0.07541191]

[ 0.0.0.1. ]]

timeshift cam0 to imu0: [s] (t_imu = t_cam + shift)

0.00165763516901

Gravity vector in target coords: [m/s^2]

[-0.00215999 -9.7244984 -1.26591825]

Calibration configuration

=========================

cam0

-----

Camera model: omni

Focal length: [3657.3894212462615, 3636.5284554729647]

Principal point: [638.9568695670013, 503.393652719486]

Omni xi: 5.80194283441

Distortion model: radtan

Distortion coefficients: [1.5274292230602973, -6.475270653629076, 0.0004049030197607094, 0.0019115670188138707]

Type: aprilgrid

Tags:

Rows: 6

Cols: 6

Size: 0.025 [m]

Spacing 0.0075 [m]

IMU configuration

=================

IMU0:

----------------------------

Model: calibrated

Update rate: 200.0

Accelerometer:

Noise density: 0.012

Noise density (discrete): 0.169705627485

Random walk: 3e-05

Gyroscope:

Noise density: 0.01

Noise density (discrete): 0.141421356237

Random walk: 3e-05

T_i_b

[[ 1. 0. 0. 0.]

[ 0. 1. 0. 0.]

[ 0. 0. 1. 0.]

[ 0. 0. 0. 1.]]

time offset with respect to IMU0: 0.0 [s]

Q1:I imu topics修改:如果标定相机zed leadsensor mynt 等相机录制IMU节点topics可能为xxx/imu/data 需要修改imu.yaml文件进行适配。

Q2:一个是利用rosbag节点运行的时候, 将发布的主题进行修改(remap )。另一个则是这roslaunch文件中进行修改.

下面利用两种不同的方式将/image_raw‘映射到/camera/image_raw.

1. rosbag remap

rosbag play ros.bag /image_raw:=/camera/image_raw

2. roslaunch remap

<remap from="/image_raw" to="/camera/image_raw"/>

/ethz-asl/kalibr/wiki/calibration-targets/wongyi/p/11152062.html/yangdashi888/article/details/51356385/ethz-asl/kalibr/wiki/camera-imu-calibration

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。