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.0.zip ln -s gtest-1.7.0 gtest mkdir build cd build cmake .. -DBUILD_TEST=true make