Ros:ubuntukylin17.04-ros using OrbSLAM2

Source: Internet
Author: User
Tags chmod uncompress python script git clone

Busy with image processing and dcnn, not using Ros for a long time, reinstalling the system again using ORB-SLAM2 (ROS) for three-dimensional reconstruction and real-time tracking demonstrations.

Refer to Previous article: Ros:ubuntu-ros using Orbslam

GitHub links for Orb-slam2 (ROS):

Raulmur's homepage: https://github.com/raulmur/

ORB-SLAM2 uses the Rgb_d camera, which can be demonstrated on the data set that Kinect collects.


ORB-SLAM2 's Tutorial

I. ORB-SLAM2 installation

Authors: Raul Mur-artal, Juan D. Tardos, J. M. M. Montiel and Dorian Galvez-lopez (DBoW2)

Jan: OpenCV 3 and Eigen 3.3 is now supported.

Dec: Added AR Demo (see section 7).

ORB-SLAM2 is a real-time SLAM library for monocular, Stereo and rgb-d cameras that computes th e camera trajectory and a sparse 3D reconstruction (in the stereo and rgb-d case with true scale). It's able to detect loops and relocalize the camera in real time. We provide examples to run the SLAM system in the Kitti datasets as stereo or monocular, in the TUM dataset as rgb-d or Mon Ocular, 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 the This document.

# # #Related Publications:

[Monocular] Raúl mur-artal, J. M. Montiel and Juan D. Tardós. orb-slam:a Versatile and accurate monocular SLAM System. IEEE Transactions on Robotics, Vol. 5, pp. 1147-1163, 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. 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 a 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},
  Numbe R={5},
  pages={1147--1163},
  doi = {10.1109/tro.2015.2463671},
  year={2015}
 }

If you use the ORB-SLAM2 (Stereo or rgb-d) in a 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={ }
 }

#2. Prerequisiteswe has tested the library in Ubuntu 12.04, 14.04 and 16.04, but it should is EAS Y to compile on other platforms. A powerful computer (e.g i7) would 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 the pangolin for visualization and user interface. Dowload and install instructions can be found At:https://github.com/stevenlovegrove/pangolin.


OpenCV

We use the 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 Optimizat Ions. Both modified libraries (which is BSD) is 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 the case you want to the use of 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-installed all required dependencies (see section 2). Execute:

CD orb_slam2
chmod +x build.sh
./build.sh

Caveats : Installing additional dependent libraries ...


Error and workaround :

In

./build.sh
The last of the process

sudo make-j

usleep undefined issue appears


Workaround:

Find all the source code that contains this function

In the header add:

#include <unistd.h>

You can compile the success Q.


This would 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

two. Routines and datasets

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.

./examples/monocular/mono_tum Vocabulary/orbvoc.txt Examples/monocular/tumx.yaml PATH_TO_SEQUENCE_FOLDER

Note: The TUM data set of the Munich University of Technology gives the corresponding software toolset: Http://vision.in.tum.de/data/software.

Data set (3D scene) Download address: 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 respectively. Changepath_to_dataset_folder to the uncompressed DATASET FOLDER. Changesequence_number to XX,,.., 11.

./examples/monocular/mono_kitti Vocabulary/orbvoc.txt Examples/monocular/kittix.yaml PATH_TO_DATASET_FOLDER/ Dataset/sequences/sequence_number

Mileage Data Set : Large Outdoor data collection


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.

./examples/monocular/mono_euroc Vocabulary/orbvoc.txt Examples/monocular/euroc.yaml PATH_TO_SEQUENCE_FOLDER/mav0/ Cam0/data Examples/monocular/euroc_timestamps/sequence.txt 
./examples/monocular/mono_euroc Vocabulary/orbvoc.txt Examples/monocular/euroc.yaml PATH_TO_SEQUENCE/cam0/data Examples/monocular/euroc_timestamps/sequence.txt 

#5. Stereo Examples

Micro Aerial Vehicle : Data set for indoor UAV scene modeling


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 respectively. Changepath_to_dataset_folder to the uncompressed DATASET FOLDER. Changesequence_number to XX,,.., 11.

./examples/stereo/stereo_kitti Vocabulary/orbvoc.txt Examples/stereo/kittix.yaml PATH_TO_DATASET_FOLDER/dataset/ Sequences/sequence_number
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.

./examples/stereo/stereo_euroc Vocabulary/orbvoc.txt Examples/stereo/euroc.yaml PATH_TO_SEQUENCE/mav0/cam0/data Path_to_sequence/mav0/cam1/data Examples/stereo/euroc_timestamps/sequence.txt
./examples/stereo/stereo_euroc vocabulary/orbvoc.txt Examples/stereo/euroc.yaml PATH_TO_SEQUENCE/cam0/data PATH_TO _sequence/cam1/data Examples/stereo/euroc_timestamps/sequence.txt

#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:

Python associate.py path_to_sequence/rgb.txt path_to_sequence/depth.txt > Associations.txt
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. Changeassociations_file to the path to the corresponding associations FILE.
./examples/rgb-d/rgbd_tum vocabulary/orbvoc.txt Examples/rgb-d/tumx.yaml Path_to_sequence_folder ASSOCIATIONS_FILE

#7. ROS Examples Building The nodes for Mono, Monoar, stereo and rgb-d Add the path including examples/ros/orb_slam2 To the ROS_PACKAGE_PATH environment variable. Open. bashrc file and add at the end of the following line. Replace PATH by the folder where you cloned orb_slam2:

Export Ros_package_path=${ros_package_path}:P Ath/orb_slam2/examples/ros
Execute build_ros.sh Script:
chmod +x build_ros.sh
./build_ros.sh
Running monocular Node

For a monocular input from Topic/camera/image_raw run node Orb_slam2/mono. You'll 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_file
Running monocular augmented Reality Demo

This is a demo of augmented reality where can use a interface to inserts 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_file
Running Stereo Node

For a stereo input from Topic/camera/left/image_raw and/camera/right/image_raw run node Orb_slam2/stereo. You'll need to provide the vocabulary file and a settings file. If youprovide rectification matrices (see examples/stereo/euroc.yaml example), the node would recitify the images Online,otherwise images must be pre-rectified.

Rosrun orb_slam2 Stereo path_to_vocabulary path_to_settings_file online_rectification

Example: 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_raw

Once Orb-slam2 has loaded the vocabulary and 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 a rgb-d input from Topics/camera/rgb/image_raw And/camera/depth_registered/image_raw, run node orb_slam2/rgbd. You'll 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 would 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 this makes use of the ORB-SLAM2 library and how to pass images to the SL AM 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 if you had a good map of your working area. In this mode the Local Mapping and Loop Closing is deactivated. The system localizes the camera in the map (which is no longer updated), using relocalization if needed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.