参考资料:
[1]https://blog.csdn.net/q1370992706/article/details/79950542
这篇博客主要讲使用RealSense ZR300运行Vins Mono,主要包括:(1)ROS上RealSense ZR300驱动的安装;(2)Vins Mono的安装。
ROS上RealSense ZR300驱动的安装
这里使用的ROS上RealSense的驱动是eth-asl的maplab_realsense,这个程序对IMU的陀螺仪、加速度计、图像的时间戳做了对齐处理。通过实验发现,RealSense ZR300的加速度计和陀螺仪的时间戳不是完全相同的(这个博客里面的RealSense ZR300的简单采集程序输出信息反应了这一现象),这主要是由于RealSense ZR300的加速度计的频率为250Hz而陀螺仪的频率为200Hz(参考librealsense的Issue,戳这里),但是由于RealSense ZR300的时间戳是在硬件上打的,不是操作系统接收到到图像和IMU的时间戳,所以可以通过插值的方式使它们的时间戳对齐。下面介绍maplab_realsense的配置。
- 安装
maplab_realsense
cd path_to_catkin_ws_src
git clone https://github.com/catkin/catkin_simple
git clone https://github.com/ethz-asl/glog_catkin
git clone https://github.com/ethz-asl/gflags_catkin
git clone https://github.com/ethz-asl/eigen_catkin
git clone https://github.com/ethz-asl/cuckoo_time_translator.git
git clone https://github.com/ethz-asl/maplab_realsense.git
sudo apt-get install autoconf
sudo apt install ros-kinetic-librealsense
sudo apt-get install python-catkin-tools # 安装catkin编译工具
cd ..
catkin build
-
运行
maplab_realsense编译之后,使用下面的命令运行
maplab-realsensesource devel/setup.bash roslaunch maplab_realsense maplab_realsense.launch运行正常会出现下面的结果:
[图片上传失败...(image-287cea-1536803891581)]如果出现错误信息,可以多尝试运行几次。
ROS上安装Vins-Mono
下面介绍Vins-Mono的安装,参考Vins-Mono的Readme。
-
依赖项安装
Vins-Mono需要安装的依赖项为ceres-solver,安装ceres-solver的命令为:sudo apt-get install libgoogle-glog-dev sudo apt-get install libatlas-base-dev sudo apt-get install libeigen3-dev git clone https://github.com/ceres-solver/ceres-solver cd ceres-solver mkdir build cd build cmake .. make -j4 sudo make install Vins-Mono编译
在catkin_ws的顶层目录上,输入catkin build编译Vins-Mono。如果电脑的内存只有4G,可以使用catkin build -j1编译,否则很容易报编译错。-
运行
Vins-Mono
需要修改Vins-Mono的config/realsense/realsense_fisheye_config.yaml文件中IMU和Image的topic为/zr300_node/imu和/zr300_node/fisheye/image_raw,然后修改estimate_extrinsic为1(也可以使用官方给出的结果,然后设置为0),标定参数可以不需要修改(当然为了更高的精度,可以使用camodocal进行标定),然后运行Vins-Mono的estimator和rvizcd path_to_catkin_ws source devel/setup.bash roslaunch vins_estimator realsense_fisheye.launch cd path_to_catkin_ws # on new terimal source devel/setup.bash roslaunch vins_estimator vins_rviz.launch这是实验结果,精度看起来还不错,后续会尝试提高精度和对
Vins-Mono的代码进行分析、改进。