From 2d3c0a43f09ab7d1058a73b43325b653b879ae15 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 22:04:39 +0200 Subject: [PATCH] Reduce number of controller_spawners to 3 (#928) Since the controller_spawner supports a list of controllers since a while we can use this to reduce the number of total controllers. (cherry picked from commit 31993abdd5a22284adde08378668457c484e86eb) Co-authored-by: Felix Exner --- ur_robot_driver/launch/ur_control.launch.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ur_robot_driver/launch/ur_control.launch.py b/ur_robot_driver/launch/ur_control.launch.py index 8f85553e..465823f7 100644 --- a/ur_robot_driver/launch/ur_control.launch.py +++ b/ur_robot_driver/launch/ur_control.launch.py @@ -308,31 +308,31 @@ def launch_setup(context, *args, **kwargs): ) # Spawn controllers - def controller_spawner(name, active=True): + def controller_spawner(controllers, active=True): inactive_flags = ["--inactive"] if not active else [] return Node( package="controller_manager", executable="spawner", arguments=[ - name, "--controller-manager", "/controller_manager", "--controller-manager-timeout", controller_spawner_timeout, ] - + inactive_flags, + + inactive_flags + + controllers, ) - controller_spawner_names = [ + controllers_active = [ "joint_state_broadcaster", "io_and_status_controller", "speed_scaling_state_broadcaster", "force_torque_sensor_broadcaster", ] - controller_spawner_inactive_names = ["forward_position_controller"] + controllers_inactive = ["forward_position_controller"] - controller_spawners = [controller_spawner(name) for name in controller_spawner_names] + [ - controller_spawner(name, active=False) for name in controller_spawner_inactive_names + controller_spawners = [controller_spawner(controllers_active)] + [ + controller_spawner(controllers_inactive, active=False) ] # There may be other controllers of the joints, but this is the initially-started one