mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-09-15 07:40:20 +08:00
Docker
-
Available images on introlab3it/rtabmap_ros:
foxy, foxy-latest humble, humble-latest- The
-latestimages are automatically built from latest version ofrtabmapandrtabmap_rosfrom source (including GTSAM and libpointmatcher dependencies that are not available with ROS binaries). The other images have the same version than the binaries released on ROS.
- The
-
Launch
rtabmapfrom inside the container (no gui), saving the database on host~/.ros/rtabmap.db:$ docker run -it --rm \ --network=host \ -v ~/.ros:/root \ introlab3it/rtabmap_ros:humble-latest \ ros2 launch rtabmap_ros rtabmap.launch.py rtabmapviz:=false database_path:=/root/rtabmap.db rtabmap_args:="--delete_db_on_start" -
Launch
rtabmapfrom inside the container (with gui, if you have a nvidia GPU, follow those instructions with nvidia-docker2 using one of the images above instead of the ros image example, or for other GPUs try the intel/AMD instructions to build artabmap_ros3dimage with your GPU driver), saving the database on host~/.ros/rtabmap.db:- With nvidia-docker2 approach, we would have this Dockerfile:
Building the image and run it:
FROM introlab3it/rtabmap_ros:humble-latest # nvidia-container-runtime ENV NVIDIA_VISIBLE_DEVICES \ ${NVIDIA_VISIBLE_DEVICES:-all} ENV NVIDIA_DRIVER_CAPABILITIES \ ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics$ docker build -t rtabmap_ros3d . # those following 3 lines would need to be done only one time $ 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" \ --runtime=nvidia \ --network=host \ -v ~/.ros:/root \ rtabmap_ros3d \ ros2 launch rtabmap_ros rtabmap.launch.py database_path:=/root/rtabmap.db rtabmap_args:="--delete_db_on_start"
- With nvidia-docker2 approach, we would have this Dockerfile: