Ubuntu14.04+ROS Indigo+SVO(Semi-direct Visual Odometry)

来源:互联网 发布:mysql emoji 截断 编辑:程序博客网 时间:2024/06/08 07:19
安装与运行的所有文档:https://github.com/uzh-rpg/rpg_svo/wiki 

有两种安装方式:
有ros:https://github.com/uzh-rpg/rpg_svo/wiki/Installation:-ROS 
没ros:https://github.com/uzh-rpg/rpg_svo/wiki/Installation:-Plain-CMake-(No-ROS) 
没ros的似乎比较麻烦,这里介绍有ros的安装方法,安装步骤如下:
SVO需要建立两个工作空间,一个工作空间(SVO)用来放cmake工程,包括Sopuhus(一个李群库,懵逼),Fast(特征检测),还有可选的库g2o(图优化),另一个工作空间(SVO_catkin_ws)放ROS-Catkin工程rpg_vikit(vision kit)和rpg_svo(svo工程文件)。保证clone到正确的目录里。
1.安装Sophus
cd SVO
git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout a621ff
mkdir build
cd build
cmake ..
make
在~/.cmake/packages/中可以看到Sophus

2.安装libCVD中的fast角点检测部分(本来我已经装了libCVD,不知道还有没有必要装这个,但这个似乎没有install,只是make,装一下好了)
cd SVO 
git clone https://github.com/uzh-rpg/fast.git 
cd fast 
mkdir build 
cd build 
cmake .. 
make
同样,在~/.cmake/packages/中也可以看到fast
3.安装g2o(可选)这里安装在用户主目录下,比如我将g2o安装在/home/zhuquan/目录中
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
mkdir build
cd build
cmake ..
make
sudo make install
[转载]安装SVO

4.创建ros工作空间(SVO_catkin_ws)
$ mkdir -p ~/SVO_catkin_ws/src$ cd lsdslam_catkin_ws/src$ catkin_init_workspace$ cd ..$ catkin_make$ source devel/setup.bash$ echo $ROS_PACKAGE_PATH

然后安装vikit:
$ cd src$ git clone https://github.com/uzh-rpg/rpg_vikit.git

5.安装ros cmake modules
$ sudo apt-get install ros-indigo-cmake-modules

6.安装SVO
$ cd SVO_catkin_ws/src
$ git clone https://github.com/uzh-rpg/rpg_svo.git

我已经安装了g2o,因此把svo/CMakeLists.txt中的HAVE_G2O设为TRUE

7.然后运行catkin_make,结果如下图所示:


8.运行SVO
有ROS:https://github.com/uzh-rpg/rpg_svo/wiki/Run-SVO-with-ROS 
无ROS:https://github.com/uzh-rpg/rpg_svo/wiki/Run-SVO-without-ROS 
有ROS时:

8.1 使用数据集运行SVO
从这个网址https://github.com/uzh-rpg/rpg_svo/wiki/Run-SVO-with-ROS 上下载一个数据集airground_rig_s3_2013-03-18_21-38-48.bag
1.首先运行roscore
2.然后运行roslaunch svo_ros test_rig3.launch
3.打开rviz:rosrun rviz rviz -d /home/zhuquan/SVO_catkin_ws/src/rpg_svo/svo_ros/rviz_config.rviz
4.运行数据: rosbag play airground_rig_s3_2013-03-18_21-38-48.bag
运行结果如下所示:


8.2通过运行UVC camera运行SVO:
运行:
roscore
roslaunch uvc_camera camera_node.launch
rosrun rviz rviz -d /home/zhuquan/SVO_catkin_ws/src/rpg_svo/svo_ros/rviz_config.rviz
rosrun rqt_svo rqt_svo
roslaunch svo_ros live.launch
最终运行结果如下:
[转载]安装SVO

[转载]安装SVO