This tutorial will help you in setting up the ORB SLAM2 on SBC. We will start with the installation procedure for the stereo mode and then we will discuss the changes required in the stereo camera’s yaml configuration file. Since the ORB SLAM2 code doesn’t publish pose output, we have added a separate section which explains how to add the ROS publisher support for the stereo mode.
Introduction
ORB-SLAM2 algorithm running in the stereo mode. The history of the research on SLAM has been over 30 years, and the models for solving the SLAM prob-lem can be divided into two main categories: filtering based methods and graph optimization based meth-ods. The filtering based methods usually use the Ex. 本文总结了特征点法slam中目前效果最好的方法:orb-slam2 / orb-slam3 相关改进代码汇总,包括加速、多传感器融合、稠密建图、线特征、点线融合、导航、动态环境、多平台移植等。.
ORB-SLAM2 is a SLAM library for Monocular and Stereo cameras that computes the camera trajectory and a sparse 3D reconstruction. It is a feature-based SLAM method which has three major components: tracking, local mapping and loop closing. This link nicely explains all the components of ORB SLAM2 technique in detail. Also, it briefly discusses the different part of ORB SLAM2 code and explains how changing the different parameters in different modules like local mapping, loop-closure, ORBextractor, etc. will affect the performance of ORB SLAM2.
Installation for stereo mode
ORB-SLAM2 has multiple dependencies on other ROS libraries which includes Pangolin, OpenCV, Eigen3, DBoW2, and g2o. Pangolin library is used for the visualization and user interface.OpenCV is used for image manipulation and feature extraction. Eigen3 library is used for performing mathematical operations on the Matrices. Finally, DBoW2 is an improved version of the DBow library, for indexing and converting images into a bag-of-word representation. It implements a hierarchical tree for approximating nearest neighbors in the image feature space and creates a visual vocabulary. It also implements an image database with inverted and direct files to index images and enables quick queries and feature comparisons. G2o is C++ library for optimizing graph-based nonlinear error functions. This helps in solving the global BA problem in ORB-SLAM2.
Now we will discuss the installation steps, First, clone the below repository:
Then execute following set of commands to build the library:
Even after installing above dependencies, if you face compilation error related to boost system, you need to install boost libraries and set the path to where you installed it in the makefile. This path should have the include/ and lib/ folders with header files and compiled .so binaries.
To build the stereo node, add the path including Examples/ROS/ORB_SLAM2 to the ROS_PACKAGE_PATH environment variable. Replace PATH by the folder where you cloned ORB_SLAM2 and then execute the build_ros script.
For a stereo input from topic /camera/left/image_raw and /camera/right/image_raw, we need to remap the left and right camera frame output to the ORB-SLAM2 input ROS topic. A sample roslaunch doing the ROS topic remapping is shown below.
Above launch file also runs the ORB_SLAM2/Stereo node. You will need to provide the vocabulary file and a yaml settings file to run the Stereo node. Just use the same Vocabulary file because it’s taken from a huge set of data and works pretty good. All the popular stereo cameras like ZED, Intel Realsense, Asus Xtion Pro provides the pre-rectified images. So, if you are using one of those cameras, you don’t need to provide rectification matrices else you need to add rectification matrices in the yaml configuration file (sample matrices are shown in next section).
Setting up yaml configuration file
As mentioned in the previous section that the Stereo node command takes a yaml configuration file as input. This yaml configuration file includes the stereo camera calibration parameters, ORB parameters, rectification matrices if the images are not pre-rectified.
Below is a sample yaml file settings for our calibrated stereo camera (ZED). Camera calibration and distortion parameters can be found from the intrinsic calibration matrix. Other parameters like width, height, fps depend on the resolution of your camera.
When number of features in the environment is less, the keyframes will not get initialized and system will not go in SLAM/Localization mode. So, tweak below parameters to improve the performance of the ORB SLAM2.
Below is the sample of rectification matrices.
Adding ROS publisher support for the stereo mode
ROS interface for the ORB SLAM2 is present in the below folder. So, all the changes discussed here will be done in the ros_stereo.cc file.
Firstly, we need to add below header files for using geometric ROS messages (PoseStamped, Point) and the TransformBroadcaster. Two boolean variables are added in the ImageGrabber class for publishing pose and broadcasting transform.
Below advertise() function returns a ros::Publisher object, which contains a publish() method that lets you publish geometric messages onto the “orb_pose” ROS topic and the function below initializes the ORB publisher.
Now, Rotation and Translation matrices (R_,t_) are initialized for storing the output pose. T_ stores the output pose from the ORB SLAM2.
Now you can use ROS tf library to get the quaternion and position information from the transformation matrix. Then, these position elements and the rotation elements are set in the tf (transform).
Below piece of code sends the transform with a TransformBroadcaster. In the first argument, we pass in the transform itself.In second argument, we need to give the transform being published a timestamp, we will just use the timestamp when the camera image is published. Then, we need to pass the name of the parent frame of the link we’re creating, in this case “world”. Finally, we need to pass the name of the child frame of the link we’re creating, in this case we have defined it as “ORB_SLAM2_STEREO”.
Below piece of code publishes the pose output. Here also we will use the timestamp when the camera image is published. We will define this frame as “ORB_SLAM2_STEREO”. Finally, we need to convert the pose transform to ROS pose message before publishing.
Orb Slam2 Tutorial
References
This is the official github repository of the ORB SLAM2.
Abstract: This paper presents ORB-SLAM, a feature-based monocular SLAM system thatoperates in real time, in small and large, indoor and outdoor environments. Thesystem is robust to severe motion clutter, allows wide baseline loop closingand relocalization, and includes full automatic initialization. Building onexcellent algorithms of recent years, we designed from scratch a novel systemthat uses the same features for all SLAM tasks: tracking, mapping,relocalization, and loop closing. A survival of the fittest strategy thatselects the points and keyframes of the reconstruction leads to excellentrobustness and generates a compact and trackable map that only grows if thescene content changes, allowing lifelong operation. We present an exhaustiveevaluation in 27 sequences from the most popular datasets. ORB-SLAM achievesunprecedented performance with respect to other state-of-the-art monocular SLAMapproaches. For the benefit of the community, we make the source code public.
Submission history
From: Raul Mur-Artal [view email][v1] Tue, 3 Feb 2015 18:52:23 UTC (3,614 KB)
[v2]Fri, 18 Sep 2015 09:50:11 UTC (3,827 KB)
Full-text links:
Download:
Current browse context:References & Citations
DBLP - CS Bibliography
J. M. M. Montiel
Juan D. Tardós
Orb Slam3 Github
Orb Slam2 Pdf
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Orb Slam 2 Pdf
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs and how to get involved.
Comments are closed.