From 53645580a96235a2417e1bfb4108f48856b4bd4b Mon Sep 17 00:00:00 2001 From: Philipp Caspers <117186241+philipp-caspers@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:24:02 +0200 Subject: [PATCH 1/3] feat: Set network=host in the compose file We assume that the typical user will either have ROS installed on the host or uses multiple containers connected via the hosts network. --- compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/compose.yaml b/compose.yaml index 1c567f2..01af6a8 100644 --- a/compose.yaml +++ b/compose.yaml @@ -2,6 +2,7 @@ services: voraus_ros_bridge: image: ghcr.io/vorausrobotik/voraus-ros-bridge:main command: ros2 launch voraus-ros-bridge voraus-ros-bridge.launch.py + network_mode: host environment: - AMENT_PREFIX_PATH=/root/voraus-ros-bridge/install/voraus-ros-bridge:/opt/ros/humble - ROS_NAMESPACE=robot1 From 803fbf9ccd922377bcf5927c4a5afe9d2e0e08ef Mon Sep 17 00:00:00 2001 From: Philipp Caspers <117186241+philipp-caspers@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:26:02 +0200 Subject: [PATCH 2/3] feat: Add voraus core endpoint env var to compose file This should act as a living documentation. --- compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/compose.yaml b/compose.yaml index 01af6a8..41b849a 100644 --- a/compose.yaml +++ b/compose.yaml @@ -6,3 +6,4 @@ services: environment: - AMENT_PREFIX_PATH=/root/voraus-ros-bridge/install/voraus-ros-bridge:/opt/ros/humble - ROS_NAMESPACE=robot1 + - VORAUS_CORE_OPC_UA_ENDPOINT=opc.tcp://127.0.0.1:48401 From 040ecff86c3b3aea58a4553f270c13203e27f618 Mon Sep 17 00:00:00 2001 From: Philipp Caspers <117186241+philipp-caspers@users.noreply.github.com> Date: Fri, 18 Oct 2024 09:40:27 +0200 Subject: [PATCH 3/3] fix: Stop the container via SIGINT This is a workaround for the `special` signal handling of ros2 launch. To stop a process docker sends a SIGTERM on default. The ros2 launch wrapper however ignores SIGTERM (only SIGINT is considered). Docker then sends a SIGKILL after a timeout. As a result, the shutdown times of the container are at least as long as the timeout. This change makes docker send SIGINT instead of SIGTERM, resulting in proper fast shutdown. See https://github.com/ros2/launch/issues/666 for details. --- compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/compose.yaml b/compose.yaml index 41b849a..bf384ad 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,6 +3,7 @@ services: image: ghcr.io/vorausrobotik/voraus-ros-bridge:main command: ros2 launch voraus-ros-bridge voraus-ros-bridge.launch.py network_mode: host + stop_signal: SIGINT environment: - AMENT_PREFIX_PATH=/root/voraus-ros-bridge/install/voraus-ros-bridge:/opt/ros/humble - ROS_NAMESPACE=robot1