From 8c615bccb6c8d1e632825a0030093325b303d962 Mon Sep 17 00:00:00 2001 From: Erik Holum Date: Tue, 5 Nov 2024 15:25:37 -0500 Subject: [PATCH] Add launch argument to optionally launch the controller_stopper --- ur_robot_driver/launch/ur_control.launch.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ur_robot_driver/launch/ur_control.launch.py b/ur_robot_driver/launch/ur_control.launch.py index 6af726a0..d3e0608b 100644 --- a/ur_robot_driver/launch/ur_control.launch.py +++ b/ur_robot_driver/launch/ur_control.launch.py @@ -66,6 +66,7 @@ def launch_setup(context): use_tool_communication = LaunchConfiguration("use_tool_communication") tool_device_name = LaunchConfiguration("tool_device_name") tool_tcp_port = LaunchConfiguration("tool_tcp_port") + use_controller_stopper = LaunchConfiguration("use_controller_stopper") control_node = Node( package="controller_manager", @@ -120,7 +121,9 @@ def launch_setup(context): name="controller_stopper", output="screen", emulate_tty=True, - condition=UnlessCondition(use_mock_hardware), + condition=IfCondition( + AndSubstitution(use_controller_stopper, NotSubstitution(use_mock_hardware)) + ), parameters=[ {"headless_mode": headless_mode}, {"joint_controller_active": activate_joint_controller}, @@ -470,4 +473,12 @@ def generate_launch_description(): ], ) ) + declared_arguments.append( + DeclareLaunchArgument( + "use_controller_stopper", + default_value="true", + description="Use the controller stopper node to start and stop ROS 2 controllers " + "based on the robot's running state topic." + ) + ) return LaunchDescription(declared_arguments + [OpaqueFunction(function=launch_setup)])