IRVLab / direct_stereo_slam

Fast Direct Stereo Visual SLAM
GNU General Public License v3.0
99 stars 16 forks source link
direct-method lidar-place-recognition scale-optimization slam

Fast Direct Stereo Visual SLAM

Related Publications

Note

This implementation is tested in Ubuntu 20.04 with ROS Noetic.

Dependencies

ROS, PCL, g2o, and DSO (OpenCV, Pangolin)

For g2o, DSO, and Pangolin, we strongly recommend the (old) versions in the provided dependencies.zip for smooth install and reasonable results.

  1. Install Pangolin
    sudo apt install libgl1-mesa-dev libglew-dev cmake 
    sudo apt install libegl1-mesa-dev libwayland-dev libxkbcommon-dev wayland-protocols
    cd Pangolin
    mkdir build && cd build
    cmake ..
    make -j4
    sudo make install # or set LD_LIBRARY_PATH locally
  2. Install DSO
    sudo apt install libsuitesparse-dev libeigen3-dev libboost-all-dev libopencv-dev
    cd dso
    mkdir build && cd build
    cmake ..
    make -j4
  3. Install g2o
    cd g2o
    mkdir build && cd build
    cmake -DBUILD_WITH_MARCH_NATIVE=ON .. # use the flag to avoid possible double-free error
    make -j4
    sudo make install # or set LD_LIBRARY_PATH locally

Install

  1. Link to the external DSO library:

    export DSO_PATH=[PATH_TO_DSO] (e.g., export DSO_PATH=~/Workspace/dso)

    or set the DSO_PATH in CMakeLists.txt.

  2. Install direct_stereo_slam using ros/catkin

    cd catkin_ws/src
    git clone https://github.com/IRVLab/direct_stereo_slam.git
    cd ..
    catkin_make

Usage

Preparation

roslaunch direct_stereo_slam [YOUR_LAUNCH_FILE]

Ctrl-C to terminate the program, the final trajectory (dslam.txt) will be written to ~/.ros folder.

Output file (in ~/.ros folder)