how can i set up rtabmap ros2 humble docker container with realsense d455

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how can i set up rtabmap ros2 humble docker container with realsense d455

sid leesa
Hi, I’m trying to use RTAB-Map in a ROS 2 Humble Docker container with RealSense D455.

I cloned the RTAB-Map repository using the ros2 branch:
git clone --branch ros2 https://github.com/introlab/rtabmap_ros.git

I built it with colcon build in my workspace before entering the container.

After I entered the container, there is no RTAB-Map-related directory.
Because of this, I cannot run colcon build inside the container.
Why does this happen? Did I miss something in the Docker setup?

Thanks in advance!

Reply | Threaded
Open this post in threaded view
|

Re: how can i set up rtabmap ros2 humble docker container with realsense d455

matlabbe
Administrator
If you are using ROS2 Humble container, you would need to build/install rtabmap_ros inside the container, not outside.

For a fast test you can try rtabmap_ros docker image to launch any examples from here:
```
docker run -it --rm --privileged  --user $UID  \
   -e ROS_HOME=/tmp/.ros  \
   -e OMP_WAIT_POLICY=passive  \
   --network=host  \
   --ipc=host  \
   -v ~/.ros:/tmp/.ros  \
   introlab3it/rtabmap_ros:humble-latest \
   ros2 launch rtabmap_examples  realsense_d435i_infra.launch.py
```

If you have Nvidia GPU, you launch like this to get UI working:
```
XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -

docker run -it --rm --privileged  --user $UID  \
   -e DISPLAY=$DISPLAY \
   -e QT_X11_NO_MITSHM=1 \
   -e NVIDIA_VISIBLE_DEVICES=all \
   -e NVIDIA_DRIVER_CAPABILITIES=all \
   -e XAUTHORITY=$XAUTH \
   -e ROS_HOME=/tmp/.ros  \
   -e OMP_WAIT_POLICY=passive  \
   --runtime=nvidia \
   --network=host  \
   --ipc=host  \
   -v ~/.ros:/tmp/.ros  \
   -v $XAUTH:$XAUTH \
   -v /tmp/.X11-unix:/tmp/.X11-unix \
   introlab3it/rtabmap_ros:humble-latest \
   ros2 launch rtabmap_examples  realsense_d435i_infra.launch.py
```

Reference: https://github.com/introlab/rtabmap_ros/tree/ros2/docker

EDIT
To rebuild docker image with latest rtabmap version or if you modify some files, you can do:
git clone --branch ros2 https://github.com/introlab/rtabmap_ros.git
cd rtabmap_ros
docker build . -t rtabmap_ros -f docker/humble/latest/Dockerfile

It is also possible to open rtabmap_ros folder in VSCode and re-open in a dev container.