-
Notifications
You must be signed in to change notification settings - Fork 788
Installation
This page shows how to install RTAB-Map on different systems. For previous releases, visit here.
Visit rtabmap_ros for installation instructions.
- If ROS is installed, dependencies should already be satisfied. You can follow instructions on rtabmap_ros.
- For the standalone, execute the application (
$ rtabmap
). - See Tutorials for a simple example of usage.
- For the standalone, execute the application (
-
System dependencies
-
Ubuntu 16.04
$ sudo apt-get update $ sudo apt-get install libsqlite3-dev libpcl-dev libopencv-dev git cmake libproj-dev libqt5svg5-dev
-
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
- To install
-
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
-
-
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 and OpenCV4):
$ 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:
- Install via PPA to avoid building from source. If you install from source (version>=4), make sure to build with
cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON
.
- Install via PPA to avoid building from source. If you install from source (version>=4), make sure to build with
- (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
- (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 and OpenCV4):
-
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
-
Execute the application (named "rtabmap").
- If you receive
error while loading shared libraries: librtabmap_core.so.0.10
remember to runldconfig
!
- If you receive
-
See Tutorials for a simple example of usage.
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 repository: intolab3it/rtabmap
- Docker files: https://github.com/introlab/rtabmap/tree/master/docker
- Images available from
introlab3it/rtabmap
:-
focal
,20.04
,latest
(amd64, arm64, armv7) -
jammy
,22.04
(amd64, arm64) -
noble
,24.04
(amd64, arm64) -
android24
,android26
,android30
(amd64) -
tango
(android23
),tango-api19
(amd64) -
jfr2018
(amd64)- Image used to reproduce results of the following paper:
M. Labbé and F. Michaud, “RTAB-Map as an Open-Source Lidar and Visual SLAM Library for Large-Scale and Long-Term Online Operation,” in Journal of Field Robotics, vol. 36, no. 2, pp. 416–446, 2019. (pdf) (Wiley)
-
$ docker pull introlab3it/rtabmap:noble
or
$ docker pull introlab3it/rtabmap:jammy
or
$ docker pull introlab3it/rtabmap:focal
-
To be able to run rtabmap, we should install opengl support in the image. To do so, visit this tutorial for details if you have a nvidia GPU (if you don't have a nvidia GPU, see if the open source approach explained in 16.04 below is working for you or see intel/AMD instructions on this page):
- Install
nvidia-docker2
:sudo apt install -y nvidia-docker2 sudo systemctl daemon-reload sudo systemctl restart docker
- Install
-
Run image:
# those following 3 lines would need to be done only one time export XAUTH=/tmp/.docker.xauth touch $XAUTH xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge - docker run -it --rm \ --privileged \ --env="DISPLAY=$DISPLAY" \ --env="QT_X11_NO_MITSHM=1" \ --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \ --env="XAUTHORITY=$XAUTH" \ --volume="$XAUTH:$XAUTH" \ -e NVIDIA_VISIBLE_DEVICES=all \ -e NVIDIA_DRIVER_CAPABILITIES=all \ -e OMP_WAIT_POLICY=passive \ --runtime=nvidia \ --network host \ -v ~/Documents/RTAB-Map:/root/Documents/RTAB-Map \ introlab3it/rtabmap:focal \ rtabmap
All docker files can be found under docker directory. You should launch docker build
from the root of this repository. Example:
cd rtabmap
docker build -t rtabmap_focal -f docker/focal/Dockerfile .
- For examples how to use RTAB-Map console tools with docker, see https://github.com/introlab/rtabmap/wiki/Multi-Session-Mapping-with-RTAB-Map-Tango#example-with-docker
$ docker pull introlab3it/rtabmap:android26
To install the APK, we should uninstall the version of RTAB-Map ARCore from the phone (installed by Play Store), drag and drop app to uninstall, or do:
adb uninstall com.introlab.rtabmap
-
For API <= 26, 2 choices:
- Copy file on host computer then install it with
adb
from there:docker run --name=rtabmap-android introlab3it/rtabmap:android26 docker cp rtabmap-android:/root/rtabmap-tango/build/arm64-v8a/app/android/bin/RTABMap-debug.apk . docker rm rtabmap-android # cleanup container adb install -r RTABMap-debug.apk
- Call
adb
from container:docker run --privileged --network=host -i -t --rm introlab3it/rtabmap:android26 adb install -r rtabmap-tango/build/arm64-v8a/app/android/bin/RTABMap-debug.apk
- Copy file on host computer then install it with
-
For API >= 30, the apk should be signed with a debug key (the keystore password is
android
):docker run --privileged --network=host -i -t --rm introlab3it/rtabmap:android30 # from inside the container: /opt/android-sdk/build-tools/30.0.3/apksigner sign --ks ~/.android/debug.keystore rtabmap-tango/build/arm64-v8a/app/android/bin/RTABMap-debug.apk adb install -r rtabmap-tango/build/arm64-v8a/app/android/bin/RTABMap-debug.apk
$ docker pull introlab3it/rtabmap:tango
To install the APK, we should uninstall the version of RTAB-Map tango from the phone (installed by Play Store), drag and drop app to uninstall, or do:
$ adb uninstall com.introlab.rtabmap
- Install APK, 2 choices (Asus Zenfone AR, Lenovo Phab2Pro):
- 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
- Call
adb
from container:$ docker run --privileged --network=host -i -t --rm introlab3it/rtabmap:tango adb install -r rtabmap-tango/build/arm64-v8a/app/android/bin/RTABMap-debug.apk
- Copy file on host computer then install it with
Note that arm64-v8a
APK contains both armeabi-v7a
and arm64-v8a
binaries.
-
For Google Project Tango tablet, use
introlab3it/rtabmap:tango-api19
image and replacearm64-v8a
byarmeabi-v7a
:$ docker run --name=rtabmap-tango introlab3it/rtabmap:tango-api19 $ docker cp rtabmap-tango:/root/rtabmap-tango/build/armeabi-v7a/app/android/bin/RTABMap-debug.apk . $ docker rm rtabmap-tango # cleanup container $ adb install -r RTABMap-debug.apk
This walkthrough should be updated for Raspberry Pi 4. (the link to OpenCV source does not work and should be updated)
The installation steps are similar to Ubuntu:
-
System dependencies
$ sudo apt-get install libpcl-dev libopencv-dev cmake libfreenect-dev libopenni2-dev libsqlite3-dev libvtk6-qt-dev
-
Kinect for Xbox 360: Freenect binaries may not work out-of-the-box on RPI3B+ (see this issue), we should build it from source before building rtabmap:
$ sudo apt-get remove libfreenect* $ git clone https://github.com/OpenKinect/libfreenect.git $ cd libfreenect $ mkdir build $ cd build $ cmake .. $ make $ sudo make install
-
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
-
-
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 $ sudo ldconfig $ rtabmap
- 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
.
- Note that RPi default swap size (100 MB) may be too small for compilation. You can increase the size by setting
-
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. Without ROS, load the following settings rpi3.ini (see Preferences dialog) to get smoother mapping on RPI3. The Odometry panel can be closed if the GUI is lagging too much.
-
Latest releases here!
- Kinect Xbox 360:
- Install libusb: libusb-1.0.18.pkg or
sudo port install libusb +universal
- Install OpenNI: OpenNI-Bin-Dev-MacOSX-v1.5.7.10.zip
sudo ./install.sh
- Install Kinect Sensor: Sensor-Bin-MacOSX-v5.1.2.1.zip.
sudo ./install.sh
- Install libusb: libusb-1.0.18.pkg or
- XtionPRO Live:
- Install OpenNI2 OpenNI-MacOSX-x64-2.2.0.33 or download this file 557-primesense-usb.rules and execute:
$ sudo copy 557-primesense-usb.rules /etc/udev/rules.d/557-primesense-usb.rules
- Kinect Xbox 360:
- Also available with Homebrew:
brew install rtabmap
- Tutorials
Updated March 2023
For packages built from source, normally they should build from their latest version, otherwise you can see the git version I used for each of them at the time I tested it.
-
brew install pcl opencv cmake octomap g2o pdal # For issue cmake not finding Qt5 correctly (when PCL is not able to find VTK, for visualization module): export PATH=/opt/homebrew/opt/qt@5/bin:$PATH # or (depending how homebrew is configured) export PATH=/usr/local/Cellar/qt@5/5.15.8_2/bin:$PATH
-
Optional but recommended: Build/install gtsam.
git clone https://github.com/borglab/gtsam.git cd gtsam git checkout ab92779b25b04b376fbbd1846bbbd21904c50e7a mkdir build cd build cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF -DGTSAM_WITH_TBB=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_UNSTABLE=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON .. make -j$(sysctl -n hw.logicalcpu) sudo make install
-
Optional but recommended if you use ICP: Build/install libpointmatcher.
git clone https://github.com/ethz-asl/libnabo.git cd libnabo git checkout 3cab7eed92bd5d4aed997347b8c8a2692a83a532 mkdir build cd build cmake .. make -j$(sysctl -n hw.logicalcpu) sudo make install git clone https://github.com/ethz-asl/libpointmatcher.git cd libpointmatcher git checkout 76f99fce0fe69e6384102a0343fdf8d262626e1f mkdir build cd build cmake .. make -j$(sysctl -n hw.logicalcpu) sudo make install
-
Install SDK of the camera you want to use.
- Download RTAB-Map source: get latest release or current source
git clone https://github.com/introlab/rtabmap.git rtabmap cd rtabmap/build cmake .. make -j$(sysctl -n hw.logicalcpu) sudo make install
- Execute the application (named "rtabmap" in
rtabmap/build/bin
directory). - See Tutorials for a simple example of usage.
-
Call
package
target:cmake -DBUILD_AS_BUNDLE=ON .. make package # Packaging will be finished but the resulting App # cannot be started because signature issue (killed on start). # Find a valid xcode certificate in "keychain Access" app, # then use full common name. Example: cd _CPack_Packages/Darwin/DragNDrop/RTABMap-0.21.0-Darwin/ALL_IN_ONE codesign --deep --force -s "Apple Development: FIRSTNAME LASTNAME (XXXXXXXXXX)" RTABMap.app # Create image manually: cd .. hdiutil create -volname RTABMap-0.21.0 -srcfolder ALL_IN_ONE -ov -format UDZO RTABMap-0.21.0-Darwin.dmg
-
Packaging issues:
- If the RTABMap.app is built with pdal, there was a crash because it could not find
libpdal_util.15.dylib
:
cd RTABMap.app/Contents/Frameworks otool -L libpdalcpp.15.2.0.dylib libpdalcpp.15.2.0.dylib: ... @rpath/libpdal_util.15.dylib (compatibility version 15.0.0, current version 15.2.0, reexport) ...
Change @rpath to @executable_path inside the package:
install_name_tool -change @rpath/libpdal_util.15.dylib @executable_path/../Frameworks/libpdal_util.15.dylib libpdalcpp.15.2.0.dylib
-
If cpack cannot resolve an item with
@loader_path
prefix like@loader_path/libcom_err.3.0.dylib
, the file may be local in one of the subdirectory dependencies under/opt/homebrew
. Find the file and copy/symlink it inside/opt/homebrew/lib
directory so thatfixup_bundle
can find it. -
With Qt6, we can ignore errors like
ERROR: Cannot resolve rpath "@rpath/QtGui.framework/Versions/A/QtGui"
on qt deploy step.
- If the RTABMap.app is built with pdal, there was a crash because it could not find
https://apps.apple.com/ca/app/rtab-map-3d-lidar-scanner/id1564774365
For iOS build, no need to build MacOS version above. Begin by building all dependencies for iOS (curl
, cmake
, git
and XCode should be manually installed):
$ git clone https://github.com/introlab/rtabmap.git rtabmap
$ cd rtabmap/app/ios/RTABMapApp
$ ./install_deps.sh
Note that the installation script has been tested on Apple Silicon only. Then open XCode project located in rtabmap/app/ios. Connect your iPhone/iPad with LiDAR, select it in XCode then press "Play" button. It should build, install and launch the App on your device.
-
Latest official releases here! (with most camera drivers and CUDA option)
-
Latest buildfarm releases here! (version automatically built from latest commit on master, it doesn't have all camera drivers and CUDA version is not available)
-
Driver for Kinect XBOX 360 / Kinect for Windows:
- A (Recommended for binaries): Install Kinect for Windows SDK 1.6, then select "OpenNI2" driver in RTAB-Map.
- B (Required if you compile from source): Install OpenNI-Win64-1.5.4-Dev.msi and Sensor-Win-OpenSource64-5.1.0.msi, then select "OpenNI-PCL" driver in RTAB-Map.
-
Driver for XtionPRO Live:
-
Driver for the Kinect v2 / Kinect XBOX One:
- Install UsbDK version listed in the release you downloaded. See libfreenect2 page for more info.
- Kinect for Windows SDK 2.0 + Kinect for Windows Runtime 2.0
-
Installation errors:
-
Update OpenCL if you have "
The procedure entry point clReleaseDevice cound not be located in the dynamic link library OpenCL.dll
"
-
Update OpenCL if you have "
-
Issues:
- High CPU Usage (100% all cores/threads): Most of the cases, this is related to OpenMP, try setting environment variable
OMP_WAIT_POLICY
to passive.
- High CPU Usage (100% all cores/threads): Most of the cases, this is related to OpenMP, try setting environment variable
Updated March 2023
You can download and install rtabmap using the vcpkg dependency manager (use this pull request: https://github.com/microsoft/vcpkg/pull/30254 till it is merged). Set environment variable VCPKG_DEFAULT_TRIPLET=x64-windows
for convenience. Instructions below will assume you are using x64-windows
triplet by default. From a "x64 visual studio command prompt" (Administrator mode):
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
vcpkg integrate install
vcpkg install rtabmap --clean-after-build
The rtabmap port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.
To build rtabmap with camera drivers or other dependencies not available in vcpkg, you may use vcpkg just for those dependencies:
vcpkg install ceres g2o octomap zlib sqlite3 opencv[contrib,nonfree] pcl[qt,vtk] yaml-cpp --clean-after-build
Then build rtabmap manually (with a Visual Studio solution):
git clone https://github.com/introlab/rtabmap.git
cd rtabmap/build
cmake -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake ..
cmake --build . --config Release
Execute the application (named "RTABMap.exe").
See Tutorials for a simple example of usage.
-
GTSAM: download 4.0.0-alpha2 version from https://github.com/borglab/gtsam/releases and this patch gtsam-4.0.0-alpha2-MSVC.patch.
vcpkg install boost-format --clean-after-build git clone --branch 4.0.0-alpha2 https://github.com/borglab/gtsam.git cd gtsam git apply gtsam-4.0.0-alpha2-MSVC.patch mkdir build cd build cmake -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -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 .. cmake --build . --config Release --target install
-
libpointmatcher (download this patch pointmatcher_windows_dll.patch)
vcpkg install boost-assign boost-program-options boost-timer --clean-after-build git clone https://github.com/ethz-asl/libnabo.git git clone https://github.com/ethz-asl/libpointmatcher.git cd libnabo git checkout c925c47 mkdir build cmake .. cmake --build . --config Release --target install cd libpointmatcher git checkout 7dc58e5 git apply pointmatcher_windows_dll.patch mkdir build cmake -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake .. cmake --build . --config Release --target install # Delete libpointmatcher config files in installed CMake directory, we will use only the ones in installed share\libpointmatcher\cmake folder.
-
depthai: make sure to use
-DBUILD_SHARED_LIBS=ON
on the first cmake so that all hunter's dependencies are built as shared libraries. -
realsense2: you can use the binaries, but for this T265 issue, you can add this patch to vcpkg realsense2 port (
vcpkg install realsense2[core,tm2]
). -
CCCoreLib: make nanoflann interface PRIVATE instead of PUBLIC.
cmake -DBUILD_AS_BUNDLE=ON ..
cmake --build . --config Release --target package
-
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>
- From version 0.8.5, you can check option "Mirroring" under the Source panel in the Preferences dialog.
-
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 inbin/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
.
- If built from source, from the build directory, you can do
make uninstall
. - Remove the RTAB-Map's source directory.
- Remove RTAB-Map's working directory in "~/Documents/RTAB-Map".
- Remove RTAB-Map's configuration file in "~/.rtabmap/rtabmap.ini".
- If built from source, from the build directory, you can do
make uninstall
. - Drag-and-drop the application in the trash.
- Remove RTAB-Map's working directory in "~/Documents/RTAB-Map".
- Remove RTAB-Map's configuration file in "~/.rtabmap/rtabmap.ini".
- Use the uninstaller provided.
- Remove RTAB-Map's working directory in "User's directory/Documents/RTAB-Map".
- Remove RTAB-Map's configuration file in "User's directory/.rtabmap/rtabmap.ini".