Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ COPY src/ros2_medkit_gateway/ ${COLCON_WS}/src/ros2_medkit_gateway/
COPY src/ros2_medkit_fault_manager/ ${COLCON_WS}/src/ros2_medkit_fault_manager/
COPY src/ros2_medkit_fault_reporter/ ${COLCON_WS}/src/ros2_medkit_fault_reporter/
COPY src/ros2_medkit_diagnostic_bridge/ ${COLCON_WS}/src/ros2_medkit_diagnostic_bridge/
COPY src/ros2_medkit_log_bridge/ ${COLCON_WS}/src/ros2_medkit_log_bridge/
COPY src/ros2_medkit_action_status_bridge/ ${COLCON_WS}/src/ros2_medkit_action_status_bridge/
Comment thread
mfaferek93 marked this conversation as resolved.

# Copy open-core plugins
COPY src/ros2_medkit_discovery_plugins/ ${COLCON_WS}/src/ros2_medkit_discovery_plugins/
Expand Down Expand Up @@ -123,10 +125,12 @@ COPY docker/gateway_docker_params.yaml /etc/ros2_medkit/params.yaml
# their full paths in your custom params file.
RUN mkdir -p /opt/ros2_medkit/plugins

# Non-root user for production safety
# Non-root user for production safety. /var/lib/ros2_medkit is the default
# fault_manager database_path parent; create and chown it so the fault manager
# can persist faults.db without running as root.
RUN groupadd -r medkit && useradd -r -g medkit -d /home/medkit -s /bin/bash medkit && \
mkdir -p /home/medkit && chown medkit:medkit /home/medkit && \
chown -R medkit:medkit ${COLCON_WS}/install /etc/ros2_medkit /opt/ros2_medkit
mkdir -p /home/medkit /var/lib/ros2_medkit && chown medkit:medkit /home/medkit && \
chown -R medkit:medkit ${COLCON_WS}/install /etc/ros2_medkit /opt/ros2_medkit /var/lib/ros2_medkit

# Entrypoint that sources ROS and starts the gateway
COPY docker/entrypoint.sh /entrypoint.sh
Expand Down
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,27 @@ touch the node's code.

## Run it in 5 minutes

**Two commands. No code changes, no config.** Install from the ROS 2 distribution, then launch
it next to your already-running robot:
**One command. No code changes, no config.** Point a container at your already-running robot - it
ships the gateway, the fault manager and the drop-in bridges, and speaks whatever DDS your stack
Comment thread
mfaferek93 marked this conversation as resolved.
speaks (Fast DDS and CycloneDDS are both baked in):

```bash
# 1. Install (the gateway package pulls in the fault manager + the drop-in bridges)
sudo apt install ros-jazzy-ros2-medkit-gateway # or ros-humble-ros2-medkit-gateway
docker run --rm --network host --ipc host \
-e ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-0}" \
-e RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}" \
ghcr.io/selfpatch/ros2_medkit-jazzy:latest \
ros2 launch ros2_medkit_gateway bringup.launch.py
Comment thread
Copilot marked this conversation as resolved.
# → REST API live at http://localhost:8080/api/v1/
```

Swap `jazzy` for `humble`/`lyrical`; the two `-e` flags forward your shell's `ROS_DOMAIN_ID` and
`RMW_IMPLEMENTATION` (falling back to domain `0` / Fast DDS if unset) so the container joins the
same DDS graph as your robot. The packages are heading into the ROS index, so once your distro
picks them up it is a plain apt install too:

# 2. Attach to your running ROS 2 graph - same ROS_DOMAIN_ID / RMW, nothing to configure
```bash
sudo apt install ros-jazzy-ros2-medkit-gateway # or ros-humble- / ros-lyrical-
ros2 launch ros2_medkit_gateway bringup.launch.py
# → REST API live at http://localhost:8080/api/v1/
```

> [!TIP]
Expand Down
14 changes: 10 additions & 4 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ source "${COLCON_WS}/install/setup.bash"
# Default to FastDDS (can be overridden via RMW_IMPLEMENTATION env var)
export RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-rmw_fastrtps_cpp}"

# Pass all arguments directly to the gateway node.
# Default CMD: --ros-args --params-file /etc/ros2_medkit/params.yaml
# Override: docker run ros2_medkit --ros-args --params-file /my/config.yaml -p server.port:=9090
exec ros2 run ros2_medkit_gateway gateway_node "$@"
# Dispatch on the first argument:
# - empty, or starts with "-" (the default CMD "--ros-args --params-file ..."
# or an override like --ros-args -p server.port:=9090): run the gateway node
# directly, so `docker run <img>` and arg-only overrides keep working.
# - a full command (e.g. `ros2 launch ros2_medkit_gateway bringup.launch.py`
# or `bash`): exec it as-is, so the image can launch the whole bringup stack.
if [ -z "$1" ] || [ "${1#-}" != "$1" ]; then
exec ros2 run ros2_medkit_gateway gateway_node "$@"
fi
exec "$@"
Loading