Installation

Omer Kirbiyik edited this page Oct 19, 2018 · 138 revisions

Latest releases here! Analytics

This page shows how to install RTAB-Map on different systems. For previous releases, visit here.

ROS Ubuntu Mac OS X Windows Google Tango Raspberry Pi Docker


ROS version ROS

Visit rtabmap_ros for installation instructions.

Standalone version

Ubuntu Ubuntu

If ROS is already installed

  • If ROS is installed, dependencies should already be satisfied. You can follow instructions on rtabmap_ros.
    1. For the standalone, execute the application ($ rtabmap).
    2. See Tutorials for a simple example of usage.

If ROS is not installed

  1. System dependencies

    1. Ubuntu 16.04

      $ sudo apt-get update
      $ sudo apt-get install libsqlite3-dev libpcl-dev libopencv-dev git cmake libproj-dev libqt5svg5-dev
    2. Ubuntu 14.04

      $ sudo apt-get install libsqlite3-dev libpcl-1.7-all libopencv-dev
      • To install libpcl-1.7-all, you may need to add ROS repositories by doing steps 1.2, 1.3 and 1.4 of this page (on step 1.3, use trusty instead of raring if you are on Ubuntu 14.04):
      $ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'
      $ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
      $ sudo apt-get update
      • Alternatively ( without ROS Repository ). If pcl-1.7-all errors with not found simply add the PCL repository for access to the binaries:
      $ sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
      $ sudo apt-get update
    3. Ubuntu 12.04

      $ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
      $ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
      $ sudo apt-get update
  2. Other dependencies:

    • (Optional) OpenCV with SIFT/SURF: If you want SURF/SIFT features enabled in RTAB-Map, you will also have to build OpenCV from source to have access to nonfree module (build with opencv_contrib for OpenCV3):
      $ cd opencv
      $ mkdir build
      $ cd build
      $ cmake -DCMAKE_BUILD_TYPE=Release ..
      $ make -j4
      $ sudo make install
    • (Recommended) g2o:
      $ git clone https://github.com/RainerKuemmerle/g2o.git 
      $ cd g2o
      $ mkdir build
      $ cd build
      $ cmake -DBUILD_WITH_MARCH_NATIVE=OFF -DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DG2O_USE_OPENGL=OFF ..
      $ make -j4
      $ sudo make install
    • (Recommended) GTSAM:
      $ git clone --branch 4.0.0-alpha2 https://github.com/borglab/gtsam.git gtsam-4.0.0-alpha2
      $ cd gtsam-4.0.0-alpha2
      $ mkdir build
      $ cd build
      $ cmake -DGTSAM_USE_SYSTEM_EIGEN=ON -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_UNSTABLE=OFF ..
      $ make -j4
      $ sudo make install
    • (Optional) cvsba: Follow installation instructions from here. Their installation is not standard CMake, you need these extra steps so RTAB-Map can find it:
      $ mkdir /usr/local/lib/cmake/cvsba 
      $ mv /usr/local/lib/cmake/Findcvsba.cmake /usr/local/lib/cmake/cvsba/cvsbaConfig.cmake
  3. Download RTAB-Map source: get latest release or current source

    $ git clone https://github.com/introlab/rtabmap.git rtabmap
    $ cd rtabmap/build
    $ cmake ..
    $ make -j4
    $ sudo make install
    
  4. Execute the application (named "rtabmap").

    • If you receive error while loading shared libraries: librtabmap_core.so.0.10 remember to run ldconfig!
  5. See Tutorials for a simple example of usage.

Update code

If you want the latest changes after the git clone is done, you can update the code like this:

$ cd rtabmap
$ git pull origin master
$ cd build
$ cmake ..
$ make -j4
$ sudo make install

Docker Docker

RTAB-Map Desktop (ubuntu 16.04)

$ docker pull introlab3it/rtabmap:latest
  • To be able to run rtabmap, we should install opengl support in the image. To do so, visit this tutorial for details. Replace FROM ubuntu by FROM introlab3it/rtabmap.
  1. Create a Dockerfile (example on Ubuntu host machine, choose GPU driver used on host machine):
    • NVIDIA driver:
      1. Download on nvidia website the same driver (e.g., NVIDIA-Linux-x86_64-375.39.run) than the one installed on the host computer
      2. Rename it to NVIDIA-DRIVER.run
      FROM introlab3it/rtabmap
      
      RUN apt-get update
      RUN apt-get install -y mesa-utils
      
      # install nvidia driver
      RUN apt-get install -y binutils kmod
      ADD NVIDIA-DRIVER.run /tmp/NVIDIA-DRIVER.run
      RUN sh /tmp/NVIDIA-DRIVER.run -a -N --ui=none --no-kernel-module
      RUN rm /tmp/NVIDIA-DRIVER.run
      
      1. To fix error error while loading shared libraries: libvdpau.so.1: cannot open shared object file: No such file or directory when starting rtabmap below, add the following to above Dockerfile and rebuild the image:
      RUN ln -s /usr/lib/vdpau/libvdpau_nvidia.so.1 /usr/lib/libvdpau.so.1
      
    • Open Source driver:
      FROM introlab3it/rtabmap
      
      RUN apt-get update
      RUN apt-get install -y mesa-utils
      RUN apt-get install -y xserver-xorg-video-all
      
  2. Build image:
    $ docker build -t rtabmap3d .
  3. Allow connections to X server
     $ xhost +
  4. Run rtabmap!
     $ docker run --privileged -e "DISPLAY=unix$DISPLAY" -v="/tmp/.X11-unix:/tmp/.X11-unix:rw"  -i -t --rm rtabmap3d rtabmap

RTAB-Map Tango (APK)

$ docker pull introlab3it/rtabmap:tango

Note that arm64-v8a APK contains both armeabi-v7a and arm64-v8a binaries.

  • Install APK, 2 choices:
    1. Copy file on host computer then install it with adb from there:
      $ docker run --name=rtabmap-tango introlab3it/rtabmap:tango
      $ docker cp rtabmap-tango:/root/rtabmap-tango/build/arm64-v8a/app/android/bin/RTABMap-debug.apk .
      $ docker rm rtabmap-tango # cleanup container
      $ adb install -r RTABMap-debug.apk
    2. Call adb from container:
      $ docker run --privileged -i -t --rm -v /dev/bus/usb:/dev/bus/usb introlab3it/rtabmap:tango adb install -r rtabmap-tango/build/arm64-v8a/app/android/bin/RTABMap-debug.apk
Tango Android Development (Eclipse)

Example from an Ubuntu 16.04 host computer:

$ docker pull introlab3it/rtabmap:tango-dev
$ xhost +
$ docker run --privileged -e "DISPLAY=unix$DISPLAY" -v="/tmp/.X11-unix:/tmp/.X11-unix:rw" -v /dev/bus/usb:/dev/bus/usb  -i -t introlab3it/rtabmap:tango-dev

# Inside the docker image:
$ cd rtabmap-tango
$ git pull
$ eclipse
  • Build from rtabmap c++ project. rtabmap-android project is here for convenience to edit Java files. To install on the phone:
    $ adb install -r ~/rtabmap-tango/build/arm64-v8a/app/android/bin/RTABMap-debug.apk

Raspberry Pi Raspberry Pi

The installation steps are similar to Ubuntu:

  1. System dependencies

    $ sudo apt-get install libpcl-dev libopencv-dev cmake libfreenect-dev libopenni2-dev libsqlite3-dev libqt4-dev
    • If you want SURF/SIFT features enabled in RTAB-Map, you will also have to build OpenCV from source to have access to nonfree module:
    $ cd opencv
    $ mkdir build
    $ cd build
    $ cmake -DCMAKE_BUILD_TYPE=Release ..
    $ make 
    $ sudo make install
  2. Download RTAB-Map source: get latest release or current source

    $ git clone https://github.com/introlab/rtabmap.git rtabmap
    $ cd rtabmap/build
    $ cmake ..
    $ make 
    $ sudo make install
    • Note that RPi default swap size (100 MB) may be too small for compilation. You can increase the size by setting CONF_SWAPFILE=1000 of this file /etc/dphys-swapfile.
  3. See Tutorials for a simple example of usage.

    • Do not expect high frame rate on Raspberry Pi, you may have to move slowly the camera. For example on RPi3, we can have around 5-6 Hz odometry frame rate by tuning some parameters.

Mac OS X Mac OS X

Binaries

Source

Dependencies

  • MacPorts:

    $ sudo port install libpcl +qt4_mac
  • Manually:

    1. Install CMake
    2. Install Qt4 libraries
    3. Install OpenCV2.4+
    4. Install PCL 1.7 dependencies for Mac OS X:
      • boost,
      • Eigen,
      • FLANN,
      • VTK with Qt support,
      • QHull,
      • OpenNI
    5. Download PCL 1.7 source:
    $ cd pcl-1.7.X-src
    $ mkdir build
    $ cd build
    $ cmake -DCMAKE_BUILD_TYPE=Release ..
    $ make -j4
    $ sudo make install

Build RTAB-Map

  1. Download RTAB-Map source: get latest release or current source
    $ git clone https://github.com/introlab/rtabmap.git rtabmap
    $ cd rtabmap/build
    $ cmake ..
    $ make
    $ make install
  2. Execute the application (named "rtabmap").
  3. See Tutorials for a simple example of usage.

Windows Windows

Win64 Binaries

Source

Example for Visual Studio (here 2015 is used as example)

  1. To compile, you should open a Visual Studio command prompt (you may need to open with "Execute as Administrator"). This command prompt set all variables and paths to build over Visual Studio, and required for CMake to find windows dependencies like psapi library.

    • x64: "Start ->VS2015 x64 Native Tools Command Prompt"
  2. Install CMake 3+, cmake or cmake-gui should be executed from a Visual Studio command prompt.

  3. Install OpenCV 2.4+ or 3+

  4. Install TortoiseGit or GitHub for Windows for a Git interface

  5. Install zlib

    • On x64, you can download only this: zlib-1.2.8-vc2010-x64 (extract to "c:\Program Files\zlib" and add the bin directory to the PATH)
    • Note if you build zlib from source:
      $ cd zlib-1.2.8
      $ mkdir build
      $ cd build
      
      $ cmake -G"Visual Studio 14 2015 Win64" ..
      $ cmake --build . --config Release --target install
  6. Install Qt 5 OpenSource : https://www.qt.io/download

  7. Install Point Cloud Library (PCL)

  8. Install GTSAM (optional)

    • Binaries: GTSAM-4_0_0_alpha2-msvc140.exe
    • Source: download 4.0.0-alpha2 version from https://github.com/borglab/gtsam/releases and this patch.
      $ git clone --branch 4.0.0-alpha2 https://github.com/borglab/gtsam.git gtsam-4.0.0-alpha2
      $ cd gtsam-4.0.0-alpha2
      $ git apply gtsam-4.0.0-alpha2-VS2015.patch
      $ mkdir build
      $ cd build
      
      $ cmake -G"Visual Studio 14 2015 Win64" -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_STATIC_LIBRARY=ON -DGTSAM_BUILD_UNSTABLE=OFF -DGTSAM_INSTALL_CPPUNILITE=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON -DEIGEN3_INCLUDE_DIR="C:/Program Files/PCL 1.8.1/3rdParty/Eigen/eigen3" ..
      $ cmake --build . --config Release --target install
  9. Install g2o (optional)

    • Binaries: g2o.exe
    • Source: download 20170730_git version from https://github.com/RainerKuemmerle/g2o/releases.
      $ git clone --branch 20170730_git https://github.com/RainerKuemmerle/g2o.git g2o-20170730_git 
      $ cd g2o-20170730_git 
      $ mkdir build
      $ cd build
      
      $ cmake -G"Visual Studio 14 2015 Win64" -DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DG2O_USE_OPENGL=OFF .. 
      $ cmake --build . --config Release --target install
  10. Get RTAB-Map source and build :

    $ cd rtabmap/build
    
    $ cmake -G"Visual Studio 14 2015 Win64" ..
    $ cmake --build . --config Release --target install
  11. Execute the application (named "RTABMap.exe").

  12. See Tutorials for a simple example of usage.

Issues

Depth not registered to RGB

  • If you see a misalignment between the depth and the RGB or the point cloud is mirrored when using source from OpenNI-PCL, see this page on PCL project.

  • On my machine, the SamplesConfig.xml is located here /etc/openni/SamplesConfig.xml, it should look like this (note GlobalMirror=False, RegistrationType and Registration are set) after modifications:

    <OpenNI>
    <Licenses>
    </Licenses>
    <Log writeToConsole="false" writeToFile="false">
    	<LogLevel value="3"/>
    	<Masks>
    		<Mask name="ALL" on="true"/>
    	</Masks>
    	<Dumps>
    	</Dumps>
    </Log>
    <ProductionNodes>
    	<GlobalMirror on="false"/> <!-- Disable mirror -->
    	<Node type="Depth" name="MyDepth">
    		<Configuration>
    			<!-- Kinect works only with RegistrationType 2. Asus works only with RegistrationType 1. -->
                		<Property type="int" name="RegistrationType" value="2"/>
                		<Property type="int" name="Registration" value="1"/>
    		</Configuration>
    	</Node>
    	<Node type="Image" stopOnError="false" />
    </ProductionNodes>
    </OpenNI>
    

Image is mirrored

  • From version 0.8.5, you can check option "Mirroring" under the Source panel in the Preferences dialog.

Low performance of ASUS Xtion with OpenNI2 on USB3

  • If the Xtion is not detected on USB3: try updating the firmware of the Xtion.

  • If the Xtion is connected on an USB3 and there is a very low acquisition performance, try this by editing the PS1080.ini file located in OpenNI2 installation folder (if RTAB-Map is installed with binaries, the file is in bin/OpenNI2/Drivers/PS1080.ini). Uncomment lines:

    USB interface=2 (line 28)
    Input format=1 (line 50)
    Input format=5 (line 117)
    

    On Windows, you can also just uncomment Input format=1.

Uninstall

Ubuntu (or built from source)

  1. Remove the RTAB-Map's source directory.
  2. Remove RTAB-Map's working directory in "~/Documents/RTAB-Map".
  3. Remove RTAB-Map's configuration file in "~/.rtabmap/rtabmap.ini".

Mac OS X (standalone)

  1. Drag-and-drop the application in the trash.
  2. Remove RTAB-Map's working directory in "~/Documents/RTAB-Map".
  3. Remove RTAB-Map's configuration file in "~/.rtabmap/rtabmap.ini".

Windows (standalone)

  1. Use the uninstaller provided.
  2. Remove RTAB-Map's working directory in "User's directory/Documents/RTAB-Map".
  3. Remove RTAB-Map's configuration file in "User's directory/.rtabmap/rtabmap.ini".
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.