ROS:ubuntuKylin17.04-Ros使用OrbSLAM2
??????? 忙于圖像處理和DCNN,很長時間不使用ROS,重新安裝系統(tǒng)后,再次使用ORB-SLAM2(ROS)進行三維重建和實時追蹤的演示。
??????? 參考以前的文章:ROS:ubuntu-Ros使用OrbSLAM
ORB-SLAM2(ROS)的GitHub鏈接:
??? ? ? raulmur的主頁:https://github.com/raulmur/
ORB-SLAM2使用了RGB_D相機,可以在Kinect收集得到的數(shù)據(jù)集上進行演示。
?
轉(zhuǎn)述一下ORB-SLAM2的教程
?
一.ORB-SLAM2 安裝
?
Authors: Raul Mur-Artal, Juan D. Tardos, J. M. M. Montiel and Dorian Galvez-Lopez (DBoW2)
13 Jan 2017: OpenCV 3 and Eigen 3.3 are now supported.
22 Dec 2016: Added AR demo (see section 7).
ORB-SLAM2 is a real-time SLAM library for Monocular, Stereo and RGB-D cameras that computes the camera trajectory and a sparse 3D reconstruction (in the stereo and RGB-D case with true scale). It is able to detect loops and relocalize the camera in real time. We provide examples to run the SLAM system in the KITTI dataset as stereo or monocular, in the TUM dataset as RGB-D or monocular, and in the EuRoC dataset as stereo or monocular. We also provide a ROS node to process live monocular, stereo or RGB-D streams.The library can be compiled without ROS. ORB-SLAM2 provides a GUI to change between aSLAM Mode andLocalization Mode, see section 9 of this document.
###Related Publications:
[Monocular] Raúl Mur-Artal, J. M. M. Montiel and Juan D. Tardós. ORB-SLAM: A Versatile and Accurate Monocular SLAM System.IEEE Transactions on Robotics, vol. 31, no. 5, pp. 1147-1163, 2015. (2015 IEEE Transactions on Robotics Best Paper Award).PDF.
[Stereo and RGB-D] Raúl Mur-Artal and Juan D. Tardós. ORB-SLAM2: an Open-Source SLAM System for Monocular, Stereo and RGB-D Cameras.ArXiv preprint arXiv:1610.06475PDF.
[DBoW2 Place Recognizer] Dorian Gálvez-López and Juan D. Tardós. Bags of Binary Words for Fast Place Recognition in Image Sequences.IEEE Transactions on Robotics, vol. 28, no. 5, pp. 1188-1197, 2012.PDF
#1. License
ORB-SLAM2 is released under a GPLv3 license. For a list of all code/library dependencies (and associated licenses), please seeDependencies.md.
For a closed-source version of ORB-SLAM2 for commercial purposes, please contact the authors: orbslam (at) unizar (dot) es.
If you use ORB-SLAM2 (Monocular) in an academic work, please cite:
@article{murTRO2015,title={{ORB-SLAM}: a Versatile and Accurate Monocular {SLAM} System},author={Mur-Artal, Ra\'ul, Montiel, J. M. M. and Tard\'os, Juan D.},journal={IEEE Transactions on Robotics},volume={31},number={5},pages={1147--1163},doi = {10.1109/TRO.2015.2463671},year={2015}}if you use ORB-SLAM2 (Stereo or RGB-D) in an academic work, please cite:
@article{murORB2,title={{ORB-SLAM2}: an Open-Source {SLAM} System for Monocular, Stereo and {RGB-D} Cameras},author={Mur-Artal, Ra\'ul and Tard\'os, Juan D.},journal={arXiv preprint arXiv:1610.06475},year={2016}}#2. PrerequisitesWe have tested the library in Ubuntu 12.04, 14.04 and 16.04, but it should be easy to compile in other platforms. A powerful computer (e.g. i7) will ensure real-time performance and provide more stable and accurate results.
?
C++11 or C++0x Compiler
We use the new thread and chrono functionalities of C++11.
?
Pangolin
We use Pangolin for visualization and user interface. Dowload and install instructions can be found at:https://github.com/stevenlovegrove/Pangolin.
?
OpenCV
We use OpenCV to manipulate images and features. Dowload and install instructions can be found at:http://opencv.org.Required at leat 2.4.3. Tested with OpenCV 2.4.11 and OpenCV 3.2.
?
Eigen3
Required by g2o (see below). Download and install instructions can be found at:http://eigen.tuxfamily.org.Required at least 3.1.0.
?
DBoW2 and g2o (Included in Thirdparty folder)
We use modified versions of the DBoW2 library to perform place recognition and g2o library to perform non-linear optimizations. Both modified libraries (which are BSD) are included in theThirdparty folder.
?
ROS (optional)
We provide some examples to process the live input of a monocular, stereo or RGB-D camera usingROS. Building these examples is optional. In case you want to use ROS, a version Hydro or newer is needed.
#3. Building ORB-SLAM2 library and TUM/KITTI examples
Clone the repository:
?
git clone https://github.com/raulmur/ORB_SLAM2.git ORB_SLAM2?
?
?
We provide a script build.sh to build the Thirdparty libraries andORB-SLAM2. Please make sure you have installed all required dependencies (see section 2). Execute:
?
cd ORB_SLAM2 chmod +x build.sh ./build.sh?
注意事項:安裝附加依賴庫...
?
出錯及解決方法:
在
./build.sh過程的最后
?
sudo make -j
出現(xiàn) usleep 未定義問題
?
解決方法:
找到所有包含這個函數(shù)的源代碼
在 頭部添加:
#include <unistd.h>
則可以編譯成功Q!
?
This will create libORB_SLAM2.so at lib folder and the executablesmono_tum,mono_kitti,rgbd_tum,stereo_kitti,mono_euroc andstereo_euroc inExamples folder.
?
?
#4. Monocular Examples
?
二.例程和數(shù)據(jù)集
?
TUM Dataset
Download a sequence from http://vision.in.tum.de/data/datasets/rgbd-dataset/download and uncompress it.
Execute the following command. Change TUMX.yaml to TUM1.yaml,TUM2.yaml or TUM3.yaml for freiburg1, freiburg2 and freiburg3 sequences respectively. ChangePATH_TO_SEQUENCE_FOLDERto the uncompressed sequence folder.
注釋:慕尼黑工業(yè)大學(xué) TUM數(shù)據(jù)集給出了相應(yīng)的軟件工具集:http://vision.in.tum.de/data/software 。
?????????? 數(shù)據(jù)集(3D場景)下載地址:http://vision.in.tum.de/data/datasets/omni-lsdslam#dataset
?
KITTI Dataset
Download the dataset (grayscale images) from http://www.cvlibs.net/datasets/kitti/eval_odometry.php
Execute the following command. Change KITTIX.yamlby KITTI00-02.yaml, KITTI03.yaml or KITTI04-12.yaml for sequence 0 to 2, 3, and 4 to 12 respectively. ChangePATH_TO_DATASET_FOLDER to the uncompressed dataset folder. ChangeSEQUENCE_NUMBER to 00, 01, 02,.., 11.
???????? 里程數(shù)據(jù)集:大型戶外數(shù)據(jù)集合
?
EuRoC Dataset
Download a sequence (ASL format) from http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
Execute the following first command for V1 and V2 sequences, or the second command for MH sequences. Change PATH_TO_SEQUENCE_FOLDER and SEQUENCE according to the sequence you want to run.
#5. Stereo Examples
??????? Micro Aerial Vehicle :用于室內(nèi)無人機進行場景建模的數(shù)據(jù)集合
?
KITTI Dataset
Download the dataset (grayscale images) from http://www.cvlibs.net/datasets/kitti/eval_odometry.php
Execute the following command. Change KITTIX.yamlto KITTI00-02.yaml, KITTI03.yaml or KITTI04-12.yaml for sequence 0 to 2, 3, and 4 to 12 respectively. ChangePATH_TO_DATASET_FOLDER to the uncompressed dataset folder. ChangeSEQUENCE_NUMBER to 00, 01, 02,.., 11.
EuRoC Dataset
Download a sequence (ASL format) from http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
Execute the following first command for V1 and V2 sequences, or the second command for MH sequences. Change PATH_TO_SEQUENCE_FOLDER and SEQUENCE according to the sequence you want to run.
#6. RGB-D Example
TUM Dataset
Download a sequence from http://vision.in.tum.de/data/datasets/rgbd-dataset/download and uncompress it.
Associate RGB images and depth images using the python script associate.py. We already provide associations for some of the sequences in Examples/RGB-D/associations/. You can generate your own associations file executing:
#7. ROS Examples
Building the nodes for mono, monoAR, stereo and RGB-D
Running Monocular Node
For a monocular input from topic /camera/image_raw run node ORB_SLAM2/Mono. You will need to provide the vocabulary file and a settings file. See the monocular examples above.
rosrun ORB_SLAM2 Mono PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILERunning Monocular Augmented Reality Demo
This is a demo of augmented reality where you can use an interface to insert virtual cubes in planar regions of the scene.The node reads images from topic/camera/image_raw.
rosrun ORB_SLAM2 MonoAR PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILERunning Stereo Node
For a stereo input from topic /camera/left/image_raw and /camera/right/image_raw run node ORB_SLAM2/Stereo. You will need to provide the vocabulary file and a settings file. If youprovide rectification matrices (see Examples/Stereo/EuRoC.yaml example), the node will recitify the images online,otherwise images must be pre-rectified.
rosrun ORB_SLAM2 Stereo PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE ONLINE_RECTIFICATIONExample: Download a rosbag (e.g. V1_01_easy.bag) from the EuRoC dataset (http://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets). Open 3 tabs on the terminal and run the following command at each tab:
roscore rosrun ORB_SLAM2 Stereo Vocabulary/ORBvoc.txt Examples/Stereo/EuRoC.yaml true rosbag play --pause V1_01_easy.bag /cam0/image_raw:=/camera/left/image_raw /cam1/image_raw:=/camera/right/image_rawOnce ORB-SLAM2 has loaded the vocabulary, press space in the rosbag tab. Enjoy!. Note: a powerful computer is required to run the most exigent sequences of this dataset.
Running RGB_D Node
For an RGB-D input from topics /camera/rgb/image_raw and /camera/depth_registered/image_raw, run node ORB_SLAM2/RGBD. You will need to provide the vocabulary file and a settings file. See the RGB-D example above.
rosrun ORB_SLAM2 RGBD PATH_TO_VOCABULARY PATH_TO_SETTINGS_FILE#8. Processing your own sequencesYou will need to create a settings file with the calibration of your camera. See the settings file provided for the TUM and KITTI datasets for monocular, stereo and RGB-D cameras. We use the calibration model of OpenCV. See the examples to learn how to create a program that makes use of the ORB-SLAM2 library and how to pass images to the SLAM system. Stereo input must be synchronized and rectified. RGB-D input must be synchronized and depth registered.
#9. SLAM and Localization ModesYou can change between the SLAM and Localization mode using the GUI of the map viewer.
SLAM Mode
This is the default mode. The system runs in parallal three threads: Tracking, Local Mapping and Loop Closing. The system localizes the camera, builds new map and tries to close loops.
Localization Mode
This mode can be used when you have a good map of your working area. In this mode the Local Mapping and Loop Closing are deactivated. The system localizes the camera in the map (which is no longer updated), using relocalization if needed.
?
?
?
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的ROS:ubuntuKylin17.04-Ros使用OrbSLAM2的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 皮皮虾app怎么查找微信好友
- 下一篇: 起点读书怎么注销账号(起点全部小说大全)