Skip to content

Commit 2462370

Browse files
authored
Merge pull request #95 from JustinShih0918/feat/rtabmap-docker
Convert `rtabmap-ws` to docker module
2 parents ed6a45a + f6c2af1 commit 2462370

51 files changed

Lines changed: 140 additions & 489 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

aloha_ws/docker/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ COPY --chown=$USERNAME:$USERNAME \
154154
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
155155
/tmp/install_cartographer.sh && rm /tmp/install_cartographer.sh
156156

157+
# rtabmap configuration
158+
ARG RTABMAP=""
159+
COPY --chown=$USERNAME:$USERNAME \
160+
modules/install_rtabmap.sh /tmp/install_rtabmap.sh
161+
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
162+
/tmp/install_rtabmap.sh && rm /tmp/install_rtabmap.sh
163+
157164
# TODO: Add more commands here
158165

159166
# Install udevadm for later use

aloha_ws/docker/compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ services:
4444
# ISAAC_ROS: ""
4545
# TODO: Set to "YES" if using Cartographer or set to "" if not using Cartographer
4646
# CARTOGRAPHER: ""
47+
# TODO: Set to "YES" if using RTAB-Map or set to "" if not using RTAB-Map
48+
# RTABMAP: ""
4749
cache_from:
4850
- j3soon/ros2-aloha-ws:buildcache-amd64
4951
- j3soon/ros2-aloha-ws:buildcache-arm64

delto_gripper_ws/docker/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ COPY --chown=$USERNAME:$USERNAME \
154154
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
155155
/tmp/install_cartographer.sh && rm /tmp/install_cartographer.sh
156156

157+
# rtabmap configuration
158+
ARG RTABMAP=""
159+
COPY --chown=$USERNAME:$USERNAME \
160+
modules/install_rtabmap.sh /tmp/install_rtabmap.sh
161+
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
162+
/tmp/install_rtabmap.sh && rm /tmp/install_rtabmap.sh
163+
157164
# TODO: Add more commands here
158165

159166
# Install delto gripper dependencies

delto_gripper_ws/docker/compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ services:
4444
# ISAAC_ROS: ""
4545
# TODO: Set to "YES" if using Cartographer or set to "" if not using Cartographer
4646
# CARTOGRAPHER: ""
47+
# TODO: Set to "YES" if using RTAB-Map or set to "" if not using RTAB-Map
48+
# RTABMAP: ""
4749
cache_from:
4850
- j3soon/ros2-delto-gripper-ws:buildcache-amd64
4951
- j3soon/ros2-delto-gripper-ws:buildcache-arm64

docker_modules/install_rtabmap.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ -z "$RTABMAP" ]; then
5+
echo "Skipping RTAB-Map installation as RTABMAP is not set"
6+
exit 0
7+
fi
8+
9+
# Install RTAB-Map, TurtleBot3 and rqt steering
10+
# This script is intended to be run inside the Dockerfile during build.
11+
if [ "$RTABMAP" = "YES" ]; then
12+
echo "Installing RTAB-Map and turtlebot3 packages for ROS distro: ${ROS_DISTRO:-humble}"
13+
14+
sudo apt-get update && sudo apt-get install -y \
15+
ros-${ROS_DISTRO}-rtabmap-ros \
16+
ros-${ROS_DISTRO}-turtlebot3* \
17+
ros-${ROS_DISTRO}-rqt-robot-steering \
18+
&& sudo rm -rf /var/lib/apt/lists/*
19+
fi
20+
21+
echo "RTAB-Map installation completed successfully!"
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
# RTAB-Map
22

3-
[![GitHub code](https://img.shields.io/badge/code-blue?logo=github&label=github)](https://github.com/j3soon/ros2-essentials/tree/main/rtabmap_ws)
4-
[![build](https://img.shields.io/github/actions/workflow/status/j3soon/ros2-essentials/build-rtabmap-ws.yaml?label=build)](https://github.com/j3soon/ros2-essentials/actions/workflows/build-rtabmap-ws.yaml)
5-
[![GitHub last commit](https://img.shields.io/github/last-commit/j3soon/ros2-essentials?path=rtabmap_ws)](https://github.com/j3soon/ros2-essentials/commits/main/rtabmap_ws)
6-
7-
[![DockerHub image](https://img.shields.io/badge/dockerhub-j3soon/ros2--rtabmap--ws-important.svg?logo=docker)](https://hub.docker.com/r/j3soon/ros2-rtabmap-ws/tags)
8-
![Docker image arch](https://img.shields.io/badge/arch-amd64-blueviolet)
9-
![Docker image version](https://img.shields.io/docker/v/j3soon/ros2-rtabmap-ws)
10-
![Docker image size](https://img.shields.io/docker/image-size/j3soon/ros2-rtabmap-ws)
3+
[![GitHub code](https://img.shields.io/badge/code-blue?logo=github&label=github)](https://github.com/j3soon/ros2-essentials/blob/main/docker_modules/install_rtabmap.sh)
114

125
## 🐳 Start Container
136

@@ -16,7 +9,7 @@
169
Run the following commands in a Ubuntu desktop environment. If you are using a remote server, make sure you're using a terminal within a remote desktop session (e.g., VNC) instead of SSH (i.e., don't use `ssh -X` or `ssh -Y`).
1710

1811
```sh
19-
cd ~/ros2-essentials/rtabmap_ws/docker
12+
cd ~/ros2-essentials/template_ws/docker
2013
docker compose build
2114
xhost +local:docker
2215
docker compose up -d
@@ -29,7 +22,7 @@ The commands in the following sections assume that you are inside the Docker con
2922

3023
```sh
3124
# in a new terminal
32-
docker exec -it ros2-rtabmap-ws bash
25+
docker exec -it ros2-template-ws bash
3326
```
3427

3528
If the initial build somehow failed, run:
@@ -82,7 +75,7 @@ docker compose down
8275

8376
- Running in a new `tmux` window
8477
```bash
85-
rqt_robot_steering
78+
ros2 run rqt_robot_steering rqt_robot_steering
8679
```
8780

8881
## Result
@@ -91,15 +84,17 @@ docker compose down
9184

9285
1. LiDAR test
9386
<center>
94-
<img src="./assets/lidar_test.png" width="75%"/>
87+
<img src="assets/rtabmap_lidar_test.png" width="75%"/>
9588
</center>
89+
9690
2. RGBD test
9791
<center>
98-
<img src="./assets/rgbd_test.png" width="75%"/>
92+
<img src="assets/rtabmap_rgbd_test.png" width="75%"/>
9993
</center>
94+
10095
3. Dual sensor test
10196
<center>
102-
<img src="./assets/dual_test.png" width="75%"/>
97+
<img src="assets/rtabmap_dual_test.png" width="75%"/>
10398
</center>
10499

105100
## Reference
@@ -115,5 +110,5 @@ docker compose down
115110
```
116111
- It seems that the warning isn't a big deal. But it will interrupt debugging in the future.
117112
- Possible solution : set `VTK_LEGACY_REMOVE`, but it required to build from source.
118-
- Still not tested yet.
113+
- Still not tested yet.
119114
- [Issue Reference](https://discourse.vtk.org/t/vtk-9-0-rc1/2916)

docs/mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ nav:
206206
- docker-modules/index.md
207207
- docker-modules/ros2.md
208208
- docker-modules/cartographer.md
209+
- docker-modules/rtabmap.md
209210
- docker-modules/cuda-toolkit.md
210211
- docker-modules/isaac-sim.md
211212
- docker-modules/isaac-lab.md
@@ -214,7 +215,6 @@ nav:
214215
- workspaces/index.md
215216
- template-ws/index.md
216217
- orbslam3-ws/index.md
217-
- rtabmap-ws/index.md
218218
- ros1-bridge-ws/index.md
219219
- husky-ws/index.md
220220
- kobuki-ws/index.md

0 commit comments

Comments
 (0)