From 8abf87bedb7a8ac549a6a548b33fb7254a79f8d1 Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Thu, 3 Sep 2026 22:41:43 +0800 Subject: [PATCH 01/14] :heavy_plus_sign: Added verified docker compose for both e2e monolithic and headless test environments. Signed-off-by: Gary Bey --- docker/docker-compose.headless.override.yml | 11 ++++ docker/docker-compose.yml | 59 +++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 docker/docker-compose.headless.override.yml create mode 100644 docker/docker-compose.yml diff --git a/docker/docker-compose.headless.override.yml b/docker/docker-compose.headless.override.yml new file mode 100644 index 0000000..eb1a268 --- /dev/null +++ b/docker/docker-compose.headless.override.yml @@ -0,0 +1,11 @@ +services: + robot0_nav2_sim: + command: + - bash + - -c + - "source /nav2_traffic_ws/install/setup.bash && ros2 launch sp_demo_nav2_bringup cloned_multi_tb3_simulation_launch.py robots:='robot0={x: 0.0, y: 5.0, yaw: 0.0};' use_rviz:=False" + robot1_nav2_sim: + command: + - bash + - -c + - "source /nav2_traffic_ws/install/setup.bash && ros2 launch sp_demo_nav2_bringup cloned_multi_tb3_simulation_launch.py robots:='robot1={x: 3.0, y: 5.0, yaw: 0.0};' use_rviz:=False" \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..2e18fba --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,59 @@ +services: + robot0_nav2_sim: + container_name: robot0_nav2_sim + restart: no + network_mode: host + environment: + RMW_IMPLEMENTATION: rmw_cyclonedds_cpp + # X11 + DISPLAY: ${DISPLAY:-} + # Wayland + WAYLAND_DISPLAY: ${WAYLAND_DISPLAY:-} + XDG_RUNTIME_DIR: ${XDG_RUNTIME_DIR:-/tmp/runtime-root} + # Qt display selection + QT_X11_NO_MITSHM: "1" + volumes: + # X11 + - /tmp/.X11-unix:/tmp/.X11-unix:rw + # Wayland + - ${XDG_RUNTIME_DIR:-/tmp}:/tmp/host-runtime:rw + image: ros2_rust_base:jazzy + command: + - bash + - -c + - "source /nav2_traffic_ws/install/setup.bash && ros2 launch sp_demo_nav2_bringup cloned_multi_tb3_simulation_launch.py robots:='robot0={x: 0.0, y: 5.0, yaw: 0.0};' use_rviz:=True" + robot1_nav2_sim: + container_name: robot1_nav2_sim + restart: no + network_mode: host + environment: + RMW_IMPLEMENTATION: rmw_cyclonedds_cpp + # X11 + DISPLAY: ${DISPLAY:-} + # Wayland + WAYLAND_DISPLAY: ${WAYLAND_DISPLAY:-} + XDG_RUNTIME_DIR: ${XDG_RUNTIME_DIR:-/tmp/runtime-root} + # Qt display selection + QT_X11_NO_MITSHM: "1" + volumes: + # X11 + - /tmp/.X11-unix:/tmp/.X11-unix:rw + # Wayland + - ${XDG_RUNTIME_DIR:-/tmp}:/tmp/host-runtime:rw + image: ros2_rust_base:jazzy + command: + - bash + - -c + - "source /nav2_traffic_ws/install/setup.bash && ros2 launch sp_demo_nav2_bringup cloned_multi_tb3_simulation_launch.py robots:='robot1={x: 3.0, y: 5.0, yaw: 0.0};' use_rviz:=True" + next_gen_prototype: + container_name: next_gen_prototype + restart: no + network_mode: host + environment: + RMW_IMPLEMENTATION: rmw_cyclonedds_cpp + image: ros2_rust_base:jazzy + command: + - bash + - -c + - "source /nav2_traffic_ws/install/setup.bash && ros2 launch rmf_path_server_demo demo_nav2.launch.py robots:='robot0 robot1'" + \ No newline at end of file From f65bf334e4fbcb8d1ecbb3093901fe58edd44273 Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Fri, 4 Sep 2026 01:32:54 +0800 Subject: [PATCH 02/14] :hammer: Optimised Dockerfile.base build along with localised dependency of Dockerfile in docker compose to guarantee sync with localised codebase. Signed-off-by: Gary Bey --- docker/Dockerfile.base | 29 ++++++++++++------- docker/docker-compose.yml | 59 ++++++++++++++++++++++++++++----------- 2 files changed, 61 insertions(+), 27 deletions(-) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 122af87..0979f62 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -17,7 +17,8 @@ RUN apt-get update && apt-get upgrade -y && \ python3-colcon-cargo\ libssl-dev \ pkg-config \ - && rm -rf /var/lib/apt/lists/* + ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \ + ros-${ROS_DISTRO}-rmw-zenoh-cpp # Install colcon extensions for Rust RUN pip3 install --no-cache-dir --break-system-packages colcon-ros-cargo @@ -30,7 +31,6 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no cargo install cargo-ament-build && \ chmod -R a+rwX /usr/local/cargo /usr/local/rustup - # Initialize Underlay Workspace WORKDIR /opt/ros2_rust_ws @@ -38,19 +38,28 @@ WORKDIR /opt/ros2_rust_ws COPY . /tmp/next_gen_prototype # Install ROS 2 dependencies via rosdep for both underlay and prototype branch -RUN apt-get update && \ - rosdep init || true && \ +RUN rosdep init || true && \ rosdep update && \ rosdep install --from-paths /tmp/next_gen_prototype --ignore-src -yr --skip-keys="rclrs ament_cargo ament_python" && \ - rm -rf /var/lib/apt/lists/* && \ - rm -rf /tmp/next_gen_prototype + rm -rf /var/lib/apt/lists/* + +WORKDIR /nav2_traffic_ws # Build the Underlay Workspace -#RUN /bin/bash -c "source /opt/ros/jazzy/setup.bash && \ -# colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release" +RUN mkdir src && mv /tmp/next_gen_prototype /nav2_traffic_ws/src/next_gen_prototype +RUN ls /nav2_traffic_ws/src/next_gen_prototype +RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash && \ + colcon build \ + --packages-up-to \ + sp_demo_nav2_bringup \ + rmf_nav2_traffic \ + rmf_path_server_demo \ + rmf_path_server_test \ + --cmake-args -DCMAKE_BUILD_TYPE=Release" +RUN rm -rf build/ log/ src/ # Provide automatic sourcing entrypoint configuration inside ~/.bashrc -RUN echo "source /opt/ros/jazzy/setup.bash" >> /root/.bashrc -#echo "source /opt/ros2_rust_ws/install/setup.bash" >> /root/.bashrc +RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /root/.bashrc +RUN echo "source /nav2_traffic_ws/install/setup.bash" >> /root/.bashrc CMD ["/bin/bash"] diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 2e18fba..cc064cc 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,59 +1,84 @@ +x-ros2-base: &ros2-base + image: ros2_rust_base:jazzy + build: + context: .. + dockerfile: docker/Dockerfile.base + services: + robot0_nav2_sim: + <<: *ros2-base + container_name: robot0_nav2_sim restart: no network_mode: host + environment: RMW_IMPLEMENTATION: rmw_cyclonedds_cpp - # X11 DISPLAY: ${DISPLAY:-} - # Wayland WAYLAND_DISPLAY: ${WAYLAND_DISPLAY:-} XDG_RUNTIME_DIR: ${XDG_RUNTIME_DIR:-/tmp/runtime-root} - # Qt display selection QT_X11_NO_MITSHM: "1" + volumes: - # X11 - /tmp/.X11-unix:/tmp/.X11-unix:rw - # Wayland - ${XDG_RUNTIME_DIR:-/tmp}:/tmp/host-runtime:rw - image: ros2_rust_base:jazzy + command: - bash - -c - - "source /nav2_traffic_ws/install/setup.bash && ros2 launch sp_demo_nav2_bringup cloned_multi_tb3_simulation_launch.py robots:='robot0={x: 0.0, y: 5.0, yaw: 0.0};' use_rviz:=True" + - > + source /nav2_traffic_ws/install/setup.bash && + ros2 launch sp_demo_nav2_bringup + cloned_multi_tb3_simulation_launch.py + robots:='robot0={x: 0.0, y: 5.0, yaw: 0.0};' + use_rviz:=True + + robot1_nav2_sim: + <<: *ros2-base + container_name: robot1_nav2_sim restart: no network_mode: host + environment: RMW_IMPLEMENTATION: rmw_cyclonedds_cpp - # X11 DISPLAY: ${DISPLAY:-} - # Wayland WAYLAND_DISPLAY: ${WAYLAND_DISPLAY:-} XDG_RUNTIME_DIR: ${XDG_RUNTIME_DIR:-/tmp/runtime-root} - # Qt display selection QT_X11_NO_MITSHM: "1" + volumes: - # X11 - /tmp/.X11-unix:/tmp/.X11-unix:rw - # Wayland - ${XDG_RUNTIME_DIR:-/tmp}:/tmp/host-runtime:rw - image: ros2_rust_base:jazzy + command: - bash - -c - - "source /nav2_traffic_ws/install/setup.bash && ros2 launch sp_demo_nav2_bringup cloned_multi_tb3_simulation_launch.py robots:='robot1={x: 3.0, y: 5.0, yaw: 0.0};' use_rviz:=True" + - > + source /nav2_traffic_ws/install/setup.bash && + ros2 launch sp_demo_nav2_bringup + cloned_multi_tb3_simulation_launch.py + robots:='robot1={x: 3.0, y: 5.0, yaw: 0.0};' + use_rviz:=True + + next_gen_prototype: + <<: *ros2-base + container_name: next_gen_prototype restart: no network_mode: host + environment: RMW_IMPLEMENTATION: rmw_cyclonedds_cpp - image: ros2_rust_base:jazzy + command: - bash - -c - - "source /nav2_traffic_ws/install/setup.bash && ros2 launch rmf_path_server_demo demo_nav2.launch.py robots:='robot0 robot1'" - \ No newline at end of file + - > + source /nav2_traffic_ws/install/setup.bash && + ros2 launch rmf_path_server_demo + demo_nav2.launch.py + robots:='robot0 robot1' \ No newline at end of file From 4092d38c37244c61d84dd81c6eb95dd4d144e97c Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Fri, 4 Sep 2026 09:59:56 +0800 Subject: [PATCH 03/14] :hammer: Included newline in docker-compose.headless.override.yml. Signed-off-by: Gary Bey --- docker/docker-compose.headless.override.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker-compose.headless.override.yml b/docker/docker-compose.headless.override.yml index eb1a268..48a407c 100644 --- a/docker/docker-compose.headless.override.yml +++ b/docker/docker-compose.headless.override.yml @@ -8,4 +8,4 @@ services: command: - bash - -c - - "source /nav2_traffic_ws/install/setup.bash && ros2 launch sp_demo_nav2_bringup cloned_multi_tb3_simulation_launch.py robots:='robot1={x: 3.0, y: 5.0, yaw: 0.0};' use_rviz:=False" \ No newline at end of file + - "source /nav2_traffic_ws/install/setup.bash && ros2 launch sp_demo_nav2_bringup cloned_multi_tb3_simulation_launch.py robots:='robot1={x: 3.0, y: 5.0, yaw: 0.0};' use_rviz:=False" From 0c6bbd684da48cf3b6a1d74a56581ab8ce545cee Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Fri, 4 Sep 2026 10:04:57 +0800 Subject: [PATCH 04/14] :hammer: Re-instated apt-get update in Dockerfile.base just before rosdep RUN line. Signed-off-by: Gary Bey --- docker/Dockerfile.base | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 0979f62..6048def 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -38,7 +38,8 @@ WORKDIR /opt/ros2_rust_ws COPY . /tmp/next_gen_prototype # Install ROS 2 dependencies via rosdep for both underlay and prototype branch -RUN rosdep init || true && \ +RUN apt-get update && \ + rosdep init || true && \ rosdep update && \ rosdep install --from-paths /tmp/next_gen_prototype --ignore-src -yr --skip-keys="rclrs ament_cargo ament_python" && \ rm -rf /var/lib/apt/lists/* From a91555f0b8d8f48606316494ebfb860f9176aa3d Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Fri, 4 Sep 2026 10:08:08 +0800 Subject: [PATCH 05/14] :fire: Removed dependency installation of rmw cyclone and zenoh to keep base image minimal. Signed-off-by: Gary Bey --- docker/Dockerfile.base | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 6048def..7ff90ac 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -16,9 +16,7 @@ RUN apt-get update && apt-get upgrade -y && \ python3-colcon-common-extensions \ python3-colcon-cargo\ libssl-dev \ - pkg-config \ - ros-${ROS_DISTRO}-rmw-cyclonedds-cpp \ - ros-${ROS_DISTRO}-rmw-zenoh-cpp + pkg-config # Install colcon extensions for Rust RUN pip3 install --no-cache-dir --break-system-packages colcon-ros-cargo From 884caa1bc6b1a6bb67c3748b85c1ef74c26b7f29 Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Mon, 7 Sep 2026 00:30:12 +0800 Subject: [PATCH 06/14] :hammer: Modified cloned_multi_tb3_simulation_launch.py to allow for verified default FastDDS-based execution of nav2 integration demo that allows per-container nav2 robot simulation. Signed-off-by: Gary Bey --- docker/docker-compose.headless.override.yml | 2 +- docker/docker-compose.yml | 30 ++++++--- .../cloned_multi_tb3_simulation_launch.py | 63 +++++++++++++++---- 3 files changed, 74 insertions(+), 21 deletions(-) diff --git a/docker/docker-compose.headless.override.yml b/docker/docker-compose.headless.override.yml index 48a407c..bda0545 100644 --- a/docker/docker-compose.headless.override.yml +++ b/docker/docker-compose.headless.override.yml @@ -8,4 +8,4 @@ services: command: - bash - -c - - "source /nav2_traffic_ws/install/setup.bash && ros2 launch sp_demo_nav2_bringup cloned_multi_tb3_simulation_launch.py robots:='robot1={x: 3.0, y: 5.0, yaw: 0.0};' use_rviz:=False" + - "source /nav2_traffic_ws/install/setup.bash && ros2 launch sp_demo_nav2_bringup cloned_multi_tb3_simulation_launch.py robots:='robot1={x: 3.0, y: 5.0, yaw: 0.0};' use_rviz:=False use_simulator:=False" diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index cc064cc..534ff3f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -11,14 +11,17 @@ services: container_name: robot0_nav2_sim restart: no - network_mode: host + + networks: + - ros2_net environment: - RMW_IMPLEMENTATION: rmw_cyclonedds_cpp + # RMW_IMPLEMENTATION: rmw_zenoh_cpp DISPLAY: ${DISPLAY:-} WAYLAND_DISPLAY: ${WAYLAND_DISPLAY:-} XDG_RUNTIME_DIR: ${XDG_RUNTIME_DIR:-/tmp/runtime-root} QT_X11_NO_MITSHM: "1" + GZ_PARTITION: sim volumes: - /tmp/.X11-unix:/tmp/.X11-unix:rw @@ -40,14 +43,17 @@ services: container_name: robot1_nav2_sim restart: no - network_mode: host + + networks: + - ros2_net environment: - RMW_IMPLEMENTATION: rmw_cyclonedds_cpp + # RMW_IMPLEMENTATION: rmw_zenoh_cpp DISPLAY: ${DISPLAY:-} WAYLAND_DISPLAY: ${WAYLAND_DISPLAY:-} XDG_RUNTIME_DIR: ${XDG_RUNTIME_DIR:-/tmp/runtime-root} QT_X11_NO_MITSHM: "1" + GZ_PARTITION: sim volumes: - /tmp/.X11-unix:/tmp/.X11-unix:rw @@ -62,6 +68,7 @@ services: cloned_multi_tb3_simulation_launch.py robots:='robot1={x: 3.0, y: 5.0, yaw: 0.0};' use_rviz:=True + use_simulator:=False next_gen_prototype: @@ -69,10 +76,12 @@ services: container_name: next_gen_prototype restart: no - network_mode: host - environment: - RMW_IMPLEMENTATION: rmw_cyclonedds_cpp + networks: + - ros2_net + + # environment: + # RMW_IMPLEMENTATION: rmw_zenoh_cpp command: - bash @@ -81,4 +90,9 @@ services: source /nav2_traffic_ws/install/setup.bash && ros2 launch rmf_path_server_demo demo_nav2.launch.py - robots:='robot0 robot1' \ No newline at end of file + robots:='robot0 robot1' + + +networks: + ros2_net: + driver: bridge \ No newline at end of file diff --git a/nav2_integration/sp_demo_nav2_bringup/launch/cloned_multi_tb3_simulation_launch.py b/nav2_integration/sp_demo_nav2_bringup/launch/cloned_multi_tb3_simulation_launch.py index 65a7598..c037789 100644 --- a/nav2_integration/sp_demo_nav2_bringup/launch/cloned_multi_tb3_simulation_launch.py +++ b/nav2_integration/sp_demo_nav2_bringup/launch/cloned_multi_tb3_simulation_launch.py @@ -29,11 +29,12 @@ LogInfo, OpaqueFunction, RegisterEventHandler, + SetEnvironmentVariable, ) from launch.conditions import IfCondition, UnlessCondition from launch.event_handlers import OnShutdown from launch.launch_description_sources import PythonLaunchDescriptionSource -from launch.substitutions import LaunchConfiguration, TextSubstitution +from launch.substitutions import LaunchConfiguration, PythonExpression, TextSubstitution from launch_ros.actions import Node from nav2_common.launch import ParseMultiRobotPose @@ -122,19 +123,53 @@ def generate_launch_description(): description='Start each robot stack after its transforms are ready.', ) + declare_use_simulator_cmd = DeclareLaunchArgument( + 'use_simulator', + default_value='True', + description='Whether to start the Gazebo simulation server', + ) + + declare_start_gazebo_cmd = DeclareLaunchArgument( + 'start_gazebo', + default_value=LaunchConfiguration('use_simulator'), + description='Alias for use_simulator: whether to start the Gazebo simulation server', + ) + + start_sim = PythonExpression([ + "str('", LaunchConfiguration('use_simulator'), "').lower() in ('true', '1') and ", + "str('", LaunchConfiguration('start_gazebo'), "').lower() in ('true', '1')" + ]) + + has_clock = LaunchConfiguration('has_clock') + declare_has_clock_cmd = DeclareLaunchArgument( + 'has_clock', + default_value=start_sim, + description='Whether to bridge the simulation clock to /clock (defaults to true if starting simulator)', + ) + + declare_gz_partition_cmd = DeclareLaunchArgument( + 'gz_partition', + default_value=os.environ.get('GZ_PARTITION', 'sim'), + description='Gazebo Transport partition name', + ) + # Start Gazebo with plugin providing the robot spawning service world_sdf = tempfile.mktemp(prefix='nav2_', suffix='.sdf') world_sdf_xacro = ExecuteProcess( + condition=IfCondition(start_sim), cmd=['xacro', '-o', world_sdf, ['headless:=', 'False'], world]) start_gazebo_cmd = ExecuteProcess( + condition=IfCondition(start_sim), cmd=['gz', 'sim', '-r', '-s', world_sdf], output='screen', ) - remove_temp_sdf_file = RegisterEventHandler(event_handler=OnShutdown( - on_shutdown=[ - OpaqueFunction(function=lambda _: os.remove(world_sdf)) - ])) + remove_temp_sdf_file = RegisterEventHandler( + condition=IfCondition(start_sim), + event_handler=OnShutdown( + on_shutdown=[ + OpaqueFunction(function=lambda _: os.path.exists(world_sdf) and os.remove(world_sdf)) + ])) robots_list = ParseMultiRobotPose('robots').value() @@ -183,13 +218,12 @@ def make_group(robot_autostart, condition, ready_node=None): 'headless': 'False', 'use_robot_state_pub': use_robot_state_pub, 'use_navigation': use_navigation, - 'clock_topic': TextSubstitution( - text=( - '/clock' - if robot_index == 0 - else f'/{namespace}/clock' - ) - ), + 'clock_topic': PythonExpression([ + "'/clock' if (str('", + has_clock, + "').lower() in ('true', '1') and ", + f"{robot_index} == 0) else '/{namespace}/clock'", + ]), 'x_pose': TextSubstitution(text=str(init_pose['x'])), 'y_pose': TextSubstitution(text=str(init_pose['y'])), 'z_pose': TextSubstitution(text=str(init_pose['z'])), @@ -244,6 +278,11 @@ def make_group(robot_autostart, condition, ready_node=None): ld.add_action(declare_use_robot_state_pub_cmd) ld.add_action(declare_use_navigation_cmd) ld.add_action(declare_staged_startup_cmd) + ld.add_action(declare_use_simulator_cmd) + ld.add_action(declare_start_gazebo_cmd) + ld.add_action(declare_has_clock_cmd) + ld.add_action(declare_gz_partition_cmd) + ld.add_action(SetEnvironmentVariable('GZ_PARTITION', LaunchConfiguration('gz_partition'))) # initial localization node for robot_name in robots_list: From c6e264ec20d06ed7975cbf5a31c63f65c4c6d0f0 Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Tue, 8 Sep 2026 20:16:32 +0800 Subject: [PATCH 07/14] :hammer: Added .dockerignore in project root for docker build optimization. Signed-off-by: Gary Bey --- .dockerignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a0b90dd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +*.md +.github/* +discourse/* +docker/* +scripts/* +LICENSE \ No newline at end of file From 528b6c88c80af15a8674fc8ba34136a14b565517 Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Tue, 8 Sep 2026 20:27:13 +0800 Subject: [PATCH 08/14] :heavy_plus_sign: Re-added rmw-zenoh-cpp depedency within Dockerfile.base. Signed-off-by: Gary Bey --- docker/Dockerfile.base | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 7ff90ac..9e47c1e 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -13,6 +13,7 @@ RUN apt-get update && apt-get upgrade -y && \ clang \ libclang-dev \ build-essential \ + ros-${ROS_DISTRO}-rmw-zenoh-cpp \ python3-colcon-common-extensions \ python3-colcon-cargo\ libssl-dev \ From f8e0a9a80def07c31f43fcb00b5dbb870b6d1760 Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Tue, 8 Sep 2026 20:28:59 +0800 Subject: [PATCH 09/14] :hammer: Abstracted Gazebo simulation into its own docker containe/service as defined in docker-compose.yml. Signed-off-by: Gary Bey --- docker/docker-compose.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 534ff3f..1d3601b 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -6,6 +6,28 @@ x-ros2-base: &ros2-base services: + gazebo_server: + <<: *ros2-base + + container_name: gazebo_server + restart: no + + networks: + - ros2_net + + environment: + # RMW_IMPLEMENTATION: rmw_zenoh_cpp + GZ_PARTITION: sim + + command: + - bash + - -c + - > + source /nav2_traffic_ws/install/setup.bash && + ros2 launch sp_demo_nav2_bringup + cloned_multi_tb3_simulation_launch.py + use_simulator:=True + robot0_nav2_sim: <<: *ros2-base @@ -36,6 +58,7 @@ services: cloned_multi_tb3_simulation_launch.py robots:='robot0={x: 0.0, y: 5.0, yaw: 0.0};' use_rviz:=True + use_simulator:=False robot1_nav2_sim: From 74706fb382fc271a7d94b785f7c28f7a0aaa07a9 Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Tue, 8 Sep 2026 20:30:42 +0800 Subject: [PATCH 10/14] :hammer: Updated headless override .yml file to be coherent with main docker-compose.yml. Signed-off-by: Gary Bey --- docker/docker-compose.headless.override.yml | 16 ++++++++++++++-- scripts/1_build_docker_compose.bash | 3 +++ scripts/2_run_docker_compose.bash | 5 +++++ scripts/3_run_docker_compose_headless.bash | 3 +++ scripts/4_stop_docker_compose.bash | 3 +++ 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 scripts/1_build_docker_compose.bash create mode 100644 scripts/2_run_docker_compose.bash create mode 100644 scripts/3_run_docker_compose_headless.bash create mode 100644 scripts/4_stop_docker_compose.bash diff --git a/docker/docker-compose.headless.override.yml b/docker/docker-compose.headless.override.yml index bda0545..1ed888b 100644 --- a/docker/docker-compose.headless.override.yml +++ b/docker/docker-compose.headless.override.yml @@ -3,9 +3,21 @@ services: command: - bash - -c - - "source /nav2_traffic_ws/install/setup.bash && ros2 launch sp_demo_nav2_bringup cloned_multi_tb3_simulation_launch.py robots:='robot0={x: 0.0, y: 5.0, yaw: 0.0};' use_rviz:=False" + - > + source /nav2_traffic_ws/install/setup.bash && + ros2 launch sp_demo_nav2_bringup + cloned_multi_tb3_simulation_launch.py + robots:='robot0={x: 0.0, y: 5.0, yaw: 0.0};' + use_rviz:=False + use_simulator:=False robot1_nav2_sim: command: - bash - -c - - "source /nav2_traffic_ws/install/setup.bash && ros2 launch sp_demo_nav2_bringup cloned_multi_tb3_simulation_launch.py robots:='robot1={x: 3.0, y: 5.0, yaw: 0.0};' use_rviz:=False use_simulator:=False" + - > + source /nav2_traffic_ws/install/setup.bash && + ros2 launch sp_demo_nav2_bringup + cloned_multi_tb3_simulation_launch.py + robots:='robot1={x: 3.0, y: 5.0, yaw: 0.0};' + use_rviz:=False + use_simulator:=False diff --git a/scripts/1_build_docker_compose.bash b/scripts/1_build_docker_compose.bash new file mode 100644 index 0000000..4e4fb81 --- /dev/null +++ b/scripts/1_build_docker_compose.bash @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +BUILDKIT_PROGRESS=plain docker compose -f docker/docker-compose.yml build diff --git a/scripts/2_run_docker_compose.bash b/scripts/2_run_docker_compose.bash new file mode 100644 index 0000000..6ae75c7 --- /dev/null +++ b/scripts/2_run_docker_compose.bash @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +xhost +local:docker + +docker compose -f docker/docker-compose.yml up -d --force-recreate diff --git a/scripts/3_run_docker_compose_headless.bash b/scripts/3_run_docker_compose_headless.bash new file mode 100644 index 0000000..ef3d703 --- /dev/null +++ b/scripts/3_run_docker_compose_headless.bash @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker compose -f docker/docker-compose.yml -f docker/docker-compose.headless.override.yml up -d --force-recreate diff --git a/scripts/4_stop_docker_compose.bash b/scripts/4_stop_docker_compose.bash new file mode 100644 index 0000000..a00b8a8 --- /dev/null +++ b/scripts/4_stop_docker_compose.bash @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker compose -f docker/docker-compose.yml down --remove-orphans From fe7b0d187846eab800e10fe4731455a5e5ad85f4 Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Tue, 8 Sep 2026 21:21:23 +0800 Subject: [PATCH 11/14] :fire: Removed accidental additions of dev script files. Signed-off-by: Gary Bey --- scripts/1_build_docker_compose.bash | 3 --- scripts/2_run_docker_compose.bash | 5 ----- scripts/3_run_docker_compose_headless.bash | 3 --- scripts/4_stop_docker_compose.bash | 3 --- 4 files changed, 14 deletions(-) delete mode 100644 scripts/1_build_docker_compose.bash delete mode 100644 scripts/2_run_docker_compose.bash delete mode 100644 scripts/3_run_docker_compose_headless.bash delete mode 100644 scripts/4_stop_docker_compose.bash diff --git a/scripts/1_build_docker_compose.bash b/scripts/1_build_docker_compose.bash deleted file mode 100644 index 4e4fb81..0000000 --- a/scripts/1_build_docker_compose.bash +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -BUILDKIT_PROGRESS=plain docker compose -f docker/docker-compose.yml build diff --git a/scripts/2_run_docker_compose.bash b/scripts/2_run_docker_compose.bash deleted file mode 100644 index 6ae75c7..0000000 --- a/scripts/2_run_docker_compose.bash +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -xhost +local:docker - -docker compose -f docker/docker-compose.yml up -d --force-recreate diff --git a/scripts/3_run_docker_compose_headless.bash b/scripts/3_run_docker_compose_headless.bash deleted file mode 100644 index ef3d703..0000000 --- a/scripts/3_run_docker_compose_headless.bash +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -docker compose -f docker/docker-compose.yml -f docker/docker-compose.headless.override.yml up -d --force-recreate diff --git a/scripts/4_stop_docker_compose.bash b/scripts/4_stop_docker_compose.bash deleted file mode 100644 index a00b8a8..0000000 --- a/scripts/4_stop_docker_compose.bash +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -docker compose -f docker/docker-compose.yml down --remove-orphans From 7dbef247b0a5456615515255ad18cafd2b9fd439 Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Tue, 8 Sep 2026 21:22:50 +0800 Subject: [PATCH 12/14] :hammer: Added verified zenoh-based docker compose override under docker directory. Signed-off-by: Gary Bey --- docker/docker-compose.yml | 6 ---- docker/docker-compose.zenoh.override.yml | 46 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 docker/docker-compose.zenoh.override.yml diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 1d3601b..1bcaae3 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -16,7 +16,6 @@ services: - ros2_net environment: - # RMW_IMPLEMENTATION: rmw_zenoh_cpp GZ_PARTITION: sim command: @@ -38,7 +37,6 @@ services: - ros2_net environment: - # RMW_IMPLEMENTATION: rmw_zenoh_cpp DISPLAY: ${DISPLAY:-} WAYLAND_DISPLAY: ${WAYLAND_DISPLAY:-} XDG_RUNTIME_DIR: ${XDG_RUNTIME_DIR:-/tmp/runtime-root} @@ -71,7 +69,6 @@ services: - ros2_net environment: - # RMW_IMPLEMENTATION: rmw_zenoh_cpp DISPLAY: ${DISPLAY:-} WAYLAND_DISPLAY: ${WAYLAND_DISPLAY:-} XDG_RUNTIME_DIR: ${XDG_RUNTIME_DIR:-/tmp/runtime-root} @@ -103,9 +100,6 @@ services: networks: - ros2_net - # environment: - # RMW_IMPLEMENTATION: rmw_zenoh_cpp - command: - bash - -c diff --git a/docker/docker-compose.zenoh.override.yml b/docker/docker-compose.zenoh.override.yml new file mode 100644 index 0000000..60b6276 --- /dev/null +++ b/docker/docker-compose.zenoh.override.yml @@ -0,0 +1,46 @@ +services: + + gazebo_server: + environment: + RMW_IMPLEMENTATION: rmw_zenoh_cpp + ZENOH_CONFIG_OVERRIDE: 'mode="client";connect/endpoints=["tcp/zenoh_router:7447"]' + depends_on: + - zenoh_router + + robot0_nav2_sim: + environment: + RMW_IMPLEMENTATION: rmw_zenoh_cpp + ZENOH_CONFIG_OVERRIDE: 'mode="client";connect/endpoints=["tcp/zenoh_router:7447"]' + depends_on: + - gazebo_server + - zenoh_router + + robot1_nav2_sim: + environment: + RMW_IMPLEMENTATION: rmw_zenoh_cpp + ZENOH_CONFIG_OVERRIDE: 'mode="client";connect/endpoints=["tcp/zenoh_router:7447"]' + depends_on: + - gazebo_server + - zenoh_router + + next_gen_prototype: + environment: + RMW_IMPLEMENTATION: rmw_zenoh_cpp + ZENOH_CONFIG_OVERRIDE: 'mode="client";connect/endpoints=["tcp/zenoh_router:7447"]' + depends_on: + - robot0_nav2_sim + - robot1_nav2_sim + - zenoh_router + + zenoh_router: + image: eclipse/zenoh:latest + container_name: zenoh_router + restart: no + + networks: + - ros2_net + + command: + - --listen + - tcp/0.0.0.0:7447 + From ded0762982261bbb5632437df126efda76986b10 Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Sun, 20 Sep 2026 14:31:37 +0800 Subject: [PATCH 13/14] :blue_book: Add documentation header to Dockerfile.base Signed-off-by: Gary Bey --- docker/Dockerfile.base | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 9e47c1e..295df25 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -1,3 +1,13 @@ +# Base image for next_gen_prototype docker compose +# Purpose: reproducible ROS 2 Jazzy + Rust dev/test with prebuilt underlay workspace +# Components built in underlay /nav2_traffic_ws: +# sp_demo_nav2_bringup, rmf_nav2_traffic, rmf_path_server_demo, +# rmf_path_server_test +# Used by docker/docker-compose.yml services: gazebo_server, robot0_nav2_sim, +# robot1_nav2_sim, next_gen_prototype +# Overrides: +# docker-compose.headless.override.yml → no RViz +# docker-compose.zenoh.override.yml → RMW Zenoh FROM ros:jazzy-ros-base # Disable interactive prompts during package installation From 82d233a934d38d0106333d1c5e5a8ba5ec5c18e7 Mon Sep 17 00:00:00 2001 From: Gary Bey Date: Sun, 20 Sep 2026 19:19:07 +0800 Subject: [PATCH 14/14] :hammer: Allow building of all next_gen_prototypes, rather than a select few. Signed-off-by: Gary Bey --- docker/Dockerfile.base | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 295df25..2f80689 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -60,12 +60,9 @@ RUN mkdir src && mv /tmp/next_gen_prototype /nav2_traffic_ws/src/next_gen_protot RUN ls /nav2_traffic_ws/src/next_gen_prototype RUN /bin/bash -c "source /opt/ros/${ROS_DISTRO}/setup.bash && \ colcon build \ - --packages-up-to \ - sp_demo_nav2_bringup \ - rmf_nav2_traffic \ - rmf_path_server_demo \ - rmf_path_server_test \ - --cmake-args -DCMAKE_BUILD_TYPE=Release" + --cmake-args -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS=\"-w\" \ + -DCMAKE_C_FLAGS=\"-w\"" RUN rm -rf build/ log/ src/ # Provide automatic sourcing entrypoint configuration inside ~/.bashrc