Sign inSign up

tommyhannan/visual_slam

By tommyhannan

•Updated about 7 years ago

Real-time monocular and RGB-D orb_slam2 with loop-closure, map save/load, and localization

Image
1

10K+

tommyhannan/visual_slam repository overview

⁠Rollo_SLAM

Rollo_SLAM is a real-time SLAM library for Monocular and RGB-D cameras that computes the camera trajectory and a sparse 3D reconstruction (in the RGB-D case with true scale). It is able to detect loops and relocalize the camera in real time.

⁠1. License

SD-SLAM is released under a GPLv3 license⁠.

⁠2. Prerequisites

We have tested the library in Ubuntu 16.04, but it should be easy to compile in other platforms.

⁠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

We use Eigen3⁠ to perform matrices operations. Download and install instructions can be found at: http://eigen.tuxfamily.org⁠. Required at least 3.1.0.

⁠g2o (Included in extra folder)

We use modified versions of the g2o⁠ library to perform non-linear optimizations. This library (which is BSD) is included in the extra folder.

⁠ZED SDK (Optional)

We use ZED⁠ for grabbing rgb and depth images. Dowload and install instructions can be found at: https://www.stereolabs.com/developers/release/#sdkdownloads_anchor⁠.

⁠3. Building Rollo_SLAM library and examples

Clone the repository:

git clone https://github.com/rollo/rollo_slam

We provide a script build.sh to build Rollo_SLAM. Please make sure you have installed all required dependencies (see section 2). Execute:

cd rollo_slam
chmod +x build.sh
./build.sh

⁠4. Monocular Examples

Inside PATH_TO_SEQUENCE_FOLDER there must be a file named files.txt with each image filename.

./Examples/Monocular/monocular Examples/Monocular/X.yaml PATH_TO_SEQUENCE_FOLDER

⁠Live Camera

You can use a USB camera to run Rollo-SLAM with live images. Change N to the proper /dev/videoN value where your camera is connected.

./Examples/Monocular/monocular Examples/Monocular/X.yaml N

⁠5. RGB-D Example

You must provide an associations file which can be created using the python script associate.py located inside Examples/RGB-D folder and executing:

python Examples/RGB-D/associate.py PATH_TO_SEQUENCE/rgb.txt PATH_TO_SEQUENCE/depth.txt > associations.txt
./Examples/RGB-D/rgbd Examples/RGB-D/X.yaml PATH_TO_SEQUENCE_FOLDER ASSOCIATIONS FILE

⁠6. ZED Example

Run Rollo_SLAM directly on .SVO file to avoid creating large sequence folders:

./Examples/ZED/rollo_zed Examples/ZED/X.yaml PATH_TO_SVO_FILE [0|1](Save Map?)

To set up the settings file for a ZED Camera, go to /usr/local/zed/settings/X.conf and use the calibration parameters to replace the ones in Examples/ZED/ZED-720p.yaml.

⁠7. Monocular and IMU Fusion Example

Inside PATH_TO_SEQUENCE_FOLDER there must be a file named ''files.txt'' with each image filename. IMU data has to be stored in a csv file where each line has a timestamp and 6 measurements (3 from gyroscope and 3 from accelerometer).

./Examples/Fusion/monocular_imu Examples/Monocular/X.yaml PATH_TO_SEQUENCE_FOLDER IMU_DATA_FILE.csv

⁠8. Processing your own sequences

You will need to create a settings file with the calibration of your camera. See the settings file provided for the TUM dataset for monocular or 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 Rollo-SLAM library and how to pass images to the SLAM system. RGB-D input must be synchronized and depth registered.

⁠Camera Calibration

We provide a tool to calibrate your camera using the calibration model of OpenCV. You need to print the pattern found inside Examples/Calibration folder and take several pictures of this pattern from different points of view. Then store these pictures in a folder and execute the calibration tool.

./Examples/Calibration/calibration PATH_TO_IMAGES_FOLDER

Inside PATH_TO_IMAGES_FOLDER there must be a file named ''files.txt'' with each image filename.

You can check if the intrinsic parameters calculated are accurate checking the rectified images stored in PATH_TO_IMAGES_FOLDER.

⁠9. MAP Save/Load

Mapping data can be stored in a YAML file, located in the Map folder. You can save the current map at any moment pressing the Stop and Save button, or it will be created automatically when a sequence is completed.

Saved data can be loaded afterwards by adding PATH_TO_SAVED_MAP_YAML as an extra parameter when running

⁠10. Localization Mode

You can change between the Default Mode and Localization mode using the GUI of the map viewer.

⁠Default Mode

The system runs in parallal three threads: Tracking, Local Mapping and Loop Closing. The system localizes the camera, builds a 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.

⁠TODO

When loading existing map, begin in localization mode and switch to default mode as soon as tracking is lost, but continue to relocalize in existing map using estimated pose.

⁠11. Docker

Dockerfiles are provided under the /docker directory and the image is available in DockerHub. You can, of course, modify the Dockerfiles and build your own images.

⁠Pull Docker Image

Rollo_SLAM is built under /opt/rollo_slam inside the Docker container.

docker pull tommyhannan/visual_slam:latest
⁠Run Docker Image

You have to use "-v" to mount your local data directory into the container. Check Docker doc for more detailed information.

docker run -it --rm -v "path_to_local_data":/mounted-data  tommyhannan/visual_slam:latest
⁠Build Docker Image (ignore this step)
docker build -t "username"/visual_slam:latest ./docker/
docker build -t "username"/visual_slam_jetson:latest ./docker/Jetson

Tag summary

Content type

Image

Digest

Size

483.4 MB

Last updated

about 7 years ago

docker pull tommyhannan/visual_slam