https://github.com/ethz-asl/rovio下载代码,该存储库包含ROVIO(Robust Visual Inertial Odometry)框架。
https://github.com/ethz-asl/kindr
视频: https : //youtu.be/ZMAISVy-6ao
论文: http : //dx.doi.org/10.3929/ethz-a-010566547
两种安装方法:
[1]Install without opengl scene
Dependencies:
- ros
- kindr (https://github.com/ethz-asl/kindr)
- lightweight_filtering (as submodule, use "git submodule update --init --recursive")
#!command catkin build rovio --cmake-args -DCMAKE_BUILD_TYPE=Release
[2]Install with opengl scene
Additional dependencies: opengl, glut, glew
(sudo apt-get install freeglut3-dev, sudo apt-get install libglew-dev)
安装opengl过程:http://www.cnblogs.com/Jessica-jie/p/6607590.html
在安装opengl过程中已经执行了此命令(sudo apt-get install freeglut3-dev),
只需安装此依赖:sudo apt-get install libglew-dev
#!command catkin build rovio --cmake-args -DCMAKE_BUILD_TYPE=Release -DMAKE_SCENE=ON
具体步骤:
1.创建catkin workspace
mkdir -p ~/workspace_rovio/src
cd ~/workspace_rovio
catkin_make
2.安装kindr(路径/opt/kindr)
[1]安装依赖项
sudo add-apt-repository ppa:ethz-asl/common #通过发布将项目PPA添加到您的APT来源
sudo apt-get update #重新同步您的包索引文件,更新
sudo apt-get install ros-indigo-kindr-* #安装所有项目包及其依赖关系
[2]Building with cmake编译(sudo -s)
mkdir build
cd build
cmake ..
sudo make install
[3]Build the documentation with Doxygen:建立文档利用Doxygen
进入到/opt/kindr/build中,
make doc
The doxygen documentation can be found here:
/opt/kindr/doc/html/index.html (待检验,和安装步骤结果有出入)
3.安装rovio
进入新建的workspace_rovio/src下
git clone https://github.com/ethz-asl/rovio.git
进入rovio目录下,下载子模块(关于git submodule详细知识http://www.cnblogs.com/Jessica-jie/p/6700134.html)
git submodule update --init --recursive
退出到workspace_rovio下,运行
catkin_make rovio --cmake-args -DCMAKE_BUILD_TYPE=Release -DMAKE_SCENE=ON
catkin_make
出现错误,修改:http://www.cnblogs.com/Jessica-jie/p/6959309.html
4.运行欧元数据集 Euroc Datasets
rovio_node.launch文件加载参数,使得ROVIO在Euroc Datasets上正常运行。 数据集可从以下网址获得: http : //projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
修改rovio/launch/rovio_rosbag_node.launch中的filename参数,将其改为实际rosbag的目录
<param name="rosbag_filename" value="/home/rovio_workspace/catkin/src/rovio/MH_01_easy.bag"/>
打开命令窗口:
roscore
打开新窗口,进入workspace_rovio工作空间:
$ source devel/setup.bash
$ roslaunch rovio rovio_node.launch
等同于 rosrun rovio rovio_node
打开新窗口:
$ rosbag play /home/wj/Downloads/dataset/EuRoC/ROS_bag/MH_01_easy.bag
结果:
5.将其运动路径在rviz中显示
打开一个终端,运行rviz,它的默认保存路径 /home/wj/.rviz/default.rviz
在一个控制台中运行 $ roscore
在另一个控制台中运行 $ rosrun rviz rviz
你可以通过添加---“add”,来添加你想要的显示,http://blog.csdn.net/bluewhalerobot/article/details/73658344
并且设置topic,当前节点的话题可用以下命令查看。
你可以将default.rviz剪切出来放到你的工作空间中,并给它重命名rovio_rviz_config.rviz
如果一个程序的运动过程未在rviz中显示出来,可以通过[1]书写.launch文件设置节点在在rviz中显示
<node name="rvizvisualisation" pkg="rviz" type="rviz" args="-d $(find rovio)/launch/rovio_rviz_config.rviz" />
[2]等同于---rosrun rviz rviz -d /home/wj/Downloads/rovio_workspace/src/rovio/launch/rovio_rviz_config.rviz
总体来说,不如上一种省事,直接运行.launch即可启动rviz。
由于其发布的消息并没有路径path,只有/rovio/odometry位姿,所以这一部分需要自己书写---path_publisher
结果图:
补充:安装kindr (https://github.com/ethz-asl/kindr)
[1]Installing from packages (recommended for Ubuntu LTS users)
sudo add-apt-repository ppa:ethz-asl/common #通过发布将项目PPA添加到您的APT来源
sudo apt-get update #重新同步您的包索引文件,更新
sudo apt-get install ros-indigo-kindr-* #安装所有项目包及其依赖关系
[2]Building with cmake
Install the library with CMake:(使用CMake编译)
mkdir build
cd build
cmake ..
sudo make install
Uninstall the library with:(对库进行卸载)
cd build
sudo sudo make uninstall
Kindr can be included in your cmake project. Add the following to your CmakeLists.txt:
find_package(kindr)
include_directories(${kindr_INCLUDE_DIRS})
[2]Building with catkin(使用catkin进行编译)
cd ~/catkin_ws/src
git clone git@github.com:ethz-asl/kindr.git
catkin_make_isolated -C ~/catkin_ws
或用catkin命令行工具 :
cd ~/catkin_ws/src
git clone git@github.com:ethz-asl/kindr.git
catkin build -w ~/catkin_ws kindr
Kindr can be included in your catkin project with: Add the following to your CMakeLists.txt:
find_package(catkin COMPONENTS kindr)
include_directories(${catkin_INCLUDE_DIRS})
And to your package.xml:
<package>
<build_depend>kindr</build_depend>
</package>
[3]Building the documentation构建文档
Build the documentation with Doxygen:
cd kindr/doc/doxygen
mkdir build
cd build
cmake ..
make doc
The doxygen documentation can be found here:
doc/doxygen/doc/html/index.html
[4]Building unit tests with gtest构建单元测试
GTests are only built if the folder gtest exists in the root folder.
仅当文件夹“ gtest”存在于根文件夹中时,才会构建GTests 。
Download and use GTest:
wget http://googletest.googlecode.com/files/gtest-1.7.0.zip
unzip gtest-1.7..zip
ln -s gtest-1.7. gtest
mkdir build
cd build
cmake .. -DBUILD_TEST=true
make