修改realsense包里的rs_camera.launch文件
第一处,修改unite_imu_method如下,让IMU的角速度和加速度作为一个topic输出:
<arg name="unite_imu_method" default="copy"/>
第二处,修改enable_sync参数为true,相机和IMU的同步
<arg name="enable_gyro" default="true"/>
第三处,修改enable_gyro,enable_accel为true;默认不发布:
<arg name="enable_accel" default="true"/>
<arg name="enable_sync" default="true"/>
修改VINS-Mono包里的realsense_color_config.yaml文件
第一处,修改订阅的topic:
imu_topic: "/camera/imu"
image_topic: "/camera/color/image_raw"
第二处,修改 图像尺寸
camera_name: camera
image_width: 1280
image_height: 720
第三处:修改相机内参,imu-cam外参,imu噪声,这里用的是标定后的数据:
distortion_parameters:
k1: 9.530938271933347e-02
k2: -1.408835578762015e-01
p1: -2.1877351086189574e-04
p2: -1.0309968246681133e-03
projection_parameters:
fx: 8.218858048162418e+02
fy: 8.205403783068573e+02
cx: 6.508064672479792e+02
cy: 3.58140096415742e+02
data: [ 0.9985712754288698, 0.041249507671610904, 0.03396889761545744,
-0.0422788669625035, 0.998650416777958, 0.030163595236266032,
-0.032678820308062635, -0.03155666626974519, 0.9989676028366549]
data: [-4.5153440801757305e-05, 1.1429835584744432e-04, 9.000564662081057e-06]
acc_n: 1.7839688093436522e-02
gyr_n: 2.1609922825311357e-03
acc_w: 7.3351109232322161e-04
gyr_w: 2.5399759434665062e-05
第四处,IMU到相机的变换矩阵,这里根据注释的提示修改成2
# Extrinsic parameter between IMU and Camera.
estimate_extrinsic: 2
第五处,是否需要在线估计同步时差,这里选择不需要
#unsynchronization parameters
estimate_td: 0
td: 0.000
第六处,相机曝光改成全局曝光
#rolling shutter parameters
rolling_shutter: 0
rolling_shutter_tr: 0