Skip to content

Commit c718d2b

Browse files
mergify[bot]Felix Exner
andauthored
Reduce number of controller_spawners to 3 (backport #919) (#929)
* Reduce number of controller_spawners to 3 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 31993ab) * Reverted unrelated changes --------- Co-authored-by: Felix Exner <[email protected]>
1 parent c2ea8b6 commit c718d2b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ur_robot_driver/launch/ur_control.launch.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,31 +308,31 @@ def launch_setup(context, *args, **kwargs):
308308
)
309309

310310
# Spawn controllers
311-
def controller_spawner(name, active=True):
311+
def controller_spawner(controllers, active=True):
312312
inactive_flags = ["--inactive"] if not active else []
313313
return Node(
314314
package="controller_manager",
315315
executable="spawner",
316316
arguments=[
317-
name,
318317
"--controller-manager",
319318
"/controller_manager",
320319
"--controller-manager-timeout",
321320
controller_spawner_timeout,
322321
]
323-
+ inactive_flags,
322+
+ inactive_flags
323+
+ controllers,
324324
)
325325

326-
controller_spawner_names = [
326+
controllers_active = [
327327
"joint_state_broadcaster",
328328
"io_and_status_controller",
329329
"speed_scaling_state_broadcaster",
330330
"force_torque_sensor_broadcaster",
331331
]
332-
controller_spawner_inactive_names = ["forward_position_controller"]
332+
controllers_inactive = ["forward_position_controller"]
333333

334-
controller_spawners = [controller_spawner(name) for name in controller_spawner_names] + [
335-
controller_spawner(name, active=False) for name in controller_spawner_inactive_names
334+
controller_spawners = [controller_spawner(controllers_active)] + [
335+
controller_spawner(controllers_inactive, active=False)
336336
]
337337

338338
# There may be other controllers of the joints, but this is the initially-started one

0 commit comments

Comments
 (0)