1、D435i ----- Ubuntu18.04使用D435i运行VINS-Mono
2、RealSenseD435i (一):Ubuntu18.04 下的安装、使用和bag录制 ,且解决 undefined symbol 问题(最简单的方法)
3、ROS melodic kernel 4.18安装使用realsense D435i
4、RealSense D435i在Ubuntu18下配置过程
5、REALSENSE D435I数据录制 VINS离线运行
6、Ubuntu16.04使用D435i摄像头测试VINS-Mono上(基于ROS)
给相机刷固件
使用SDK和ros wapper的版本如下
两个版本要对应,不然出大问题
2.2.20 ros wapper 和 LibRealSense v2.40.0
在home路径下创建D435i的文件夹存储SDK 然后用Git下载到此文件
cd ~
mkdir D435i
cd D435i
git clone -b v2.40.0 https://github.com/IntelRealSense/librealsense.git
sudo apt-get install libudev-dev pkg-config libgtk-3-dev
sudo apt-get install libusb-1.0-0-dev pkg-config
sudo apt-get install libglfw3-dev
sudo apt-get install libssl-dev
sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && udevadm trigger
cd librealsense
mkdir build
cd build
cmake ../ -DBUILD_EXAMPLES=true
make -j8
sudo make install
进入/librealsense/build/examples/capture,试一下效果,或者另外打开一个窗口,输入realsense -reviewer
cd examples/capture
./rs-capture
ros wapper for D435i 是一个基于ros的功能包,所以需要先配置一下 ros环境
cd ~
mkdir -p realsense_ws/src
catkin init
这里除了下载realsense_ros还需要下载一个DDynamic_reconfigure,因为缺少这个包的东西
cd realsense_ws/src
git clone -b v2.2.20 https://github.com/IntelRealSense/realsense-ros.git
git clone https://github.com/pal-robotics/ddynamic_reconfigure.git
cd ..
catkin_make
不出意外这里应该没有坑,编译会成功
roslaunch realsense2_camera rs_camera.launch
在另外一个窗口查看其话题输出
rostopic list
打开后,ROS将会接收到以下话题:
/camera/color/camera_info
/camera/color/image_raw
/camera/depth/camera_info
/camera/depth/image_rect_raw
/camera/extrinsics/depth_to_color
/camera/extrinsics/depth_to_infra1
/camera/extrinsics/depth_to_infra2
/camera/infra1/camera_info
/camera/infra1/image_rect_raw
/camera/infra2/camera_info
/camera/infra2/image_rect_raw
/camera/gyro/imu_info
/camera/gyro/sample
/camera/accel/imu_info
/camera/accel/sample
/diagnostics
说明安装成功~
因为是D435i,不仅能采集RGB-D图像,而且内置了IMU,采集角速度和线加速度。所以我们使用rosbag来捕获其输出的rgb和IMU信息。
<arg name="unite_imu_method" default="copy"/>
<arg name="enable_gyro" default="true"/>
<arg name="enable_accel" default="true"/>
<arg name="enable_sync" default="true"/>
检验输出话题是否含有/camera/imu
roslaunch realsense2_camera rs_camera.launch
rostopic list
话题如下:
/camera/accel/imu_info
/camera/color/camera_info
/camera/color/image_raw
/camera/depth/camera_info
/camera/depth/image_rect_raw
/camera/extrinsics/depth_to_color
/camera/gyro/imu_info
/camera/imu
/camera/motion_module/parameter_descriptions
/camera/motion_module/parameter_updates
/camera/realsense2_camera_manager/bond
/camera/rgb_camera/auto_exposure_roi/parameter_descriptions
/camera/rgb_camera/auto_exposure_roi/parameter_updates
/camera/rgb_camera/parameter_descriptions
/camera/rgb_camera/parameter_updates
/camera/stereo_module/auto_exposure_roi/parameter_descriptions
/camera/stereo_module/auto_exposure_roi/parameter_updates
/camera/stereo_module/parameter_descriptions
/camera/stereo_module/parameter_updates
/diagnostics
/rosout
/rosout_agg
/tf
/tf_static
一方面连接相机、发布数据:
roslaunch realsense2_camera rs_camera.launch
另一方面录制想要的topic,正好还可以将不需要的数据剔除:
rosbag record /camera/imu /camera/color/image_raw -o ~/camImu.bag
停止录制 按ctrl c,文件会保存在home目录下,使用 rosbag info ~/camImu.bag可以解析bag文件信息
在realsense_color_config.yaml基础上修改订阅的topic:
#common parameters
imu_topic: “/camera/imu”
image_topic: “/camera/color/image_raw”
修改相机内参,IMU到相机的外参标定选择2,让程序自己在线标定吧:
# Extrinsic parameter between IMU and Camera.
estimate_extrinsic: 0 # 0 Have an accurate extrinsic parameters. We will trust the following imu^R_cam, imu^T_cam, don't change it.
# 1 Have an initial guess about extrinsic parameters. We will optimize around your initial guess.
# 2 Don't know anything about extrinsic parameters. You don't need to give R,T. We will try to calibrate it. Do some rotation movement at beginning.
#If you choose 0 or 1, you should write down the following matrix.
IMU参数,这里全都使用默认值
#imu parameters The more accurate parameters you provide, the better performance
acc_n: 0.2 # accelerometer measurement noise standard deviation. #0.2
gyr_n: 0.05 # gyroscope measurement noise standard deviation. #0.05
acc_w: 0.02 # accelerometer bias random work noise standard deviation. #0.02
gyr_w: 4.0e-5 # gyroscope bias random work noise standard deviation. #4.0e-5
g_norm: 9.81 # gravity magnitude
realsense d435i说是已经做好了硬件同步所以不需要在线估计同步时差(但是用kalibr标定出来和在线估计出来都存在大概-0.06的时间差):
#unsynchronization parameters
estimate_td: 0 # online estimate time offset between camera and imu
td: 0.000 # initial value of time offset. unit: s. readed image clock + td = real image clock (IMU clock)
相机曝光方式应为全局曝光:
#rolling shutter parameters
rolling_shutter: 0 # 0: global shutter camera, 1: rolling shutter camera
rolling_shutter_tr: 0 # unit: s. rolling shutter read out time per frame (from data sheet).
然后就可以运行了:
roslaunch realsense2_camera rs_camera.launch
roslaunch vins_estimator realsense_color.launch
roslaunch vins_estimator vins_rviz.launch
来一张效果图:
由于在3中录制了rosbag,其中包含imu和image信息,所以可以直接拿来用
直接运行了:
roslaunch vins_estimator realsense_color.launch
roslaunch vins_estimator vins_rviz.launch
rosbag play ~/camImu.bag
over