From b24165640d8a33806eddc46624f90e5dce549240 Mon Sep 17 00:00:00 2001 From: YikaiFu-cart Date: Tue, 4 Aug 2026 14:36:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=98=BB=E6=AD=A2=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E9=81=A5=E6=93=8D=E4=BD=9C=E8=8A=82=E7=82=B9=E7=BB=A7=E7=BB=AD?= =?UTF-8?q?=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xr_rm_bringup/launch/arm_debug.launch.py | 5 ++++- xr_rm_bringup/test/test_arm_debug_launch.py | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/xr_rm_bringup/launch/arm_debug.launch.py b/xr_rm_bringup/launch/arm_debug.launch.py index 3e47bf4..663f871 100644 --- a/xr_rm_bringup/launch/arm_debug.launch.py +++ b/xr_rm_bringup/launch/arm_debug.launch.py @@ -8,7 +8,7 @@ from pathlib import Path from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument, OpaqueFunction +from launch.actions import DeclareLaunchArgument, OpaqueFunction, Shutdown from launch.substitutions import LaunchConfiguration, PathJoinSubstitution from launch_ros.actions import Node from launch_ros.substitutions import FindPackageShare @@ -47,6 +47,9 @@ def _udp_receiver_node() -> Node: executable="udp_controller_receiver", name="udp_controller_receiver", output="screen", + on_exit=Shutdown( + reason="XR UDP receiver exited; stopping arm_debug launch" + ), parameters=[{ "udp_host": LaunchConfiguration("udp_host"), "udp_port": LaunchConfiguration("udp_port"), diff --git a/xr_rm_bringup/test/test_arm_debug_launch.py b/xr_rm_bringup/test/test_arm_debug_launch.py index cf2046b..a5f3e1e 100644 --- a/xr_rm_bringup/test/test_arm_debug_launch.py +++ b/xr_rm_bringup/test/test_arm_debug_launch.py @@ -3,7 +3,7 @@ from pathlib import Path import pytest from launch import LaunchContext -from launch.actions import DeclareLaunchArgument +from launch.actions import DeclareLaunchArgument, Shutdown from launch.utilities import perform_substitutions @@ -35,3 +35,9 @@ def test_mujoco_mode_requires_both_arms() -> None: with pytest.raises(ValueError, match="arm:=both"): arm_debug_launch._validate_mujoco_mode("left", True) + + +def test_udp_receiver_exit_shuts_down_launch() -> None: + receiver = arm_debug_launch._udp_receiver_node() + + assert isinstance(receiver._ExecuteLocal__on_exit, Shutdown)