From 8a61ccdb506c6320fcff8627fcdbd5e2bf0cdac8 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Fri, 23 Aug 2024 19:02:35 +0000 Subject: [PATCH 1/2] Use new spawner option for ros args --- example_11/bringup/launch/carlikebot.launch.py | 11 +++++++---- .../bringup/launch/rrbot_namespace.launch.py | 16 ++++++++-------- example_2/bringup/launch/diffbot.launch.py | 10 ++++++++-- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/example_11/bringup/launch/carlikebot.launch.py b/example_11/bringup/launch/carlikebot.launch.py index 47c3c3327..13054a298 100644 --- a/example_11/bringup/launch/carlikebot.launch.py +++ b/example_11/bringup/launch/carlikebot.launch.py @@ -77,9 +77,6 @@ def generate_launch_description(): executable="ros2_control_node", parameters=[robot_controllers], output="both", - remappings=[ - ("/bicycle_steering_controller/tf_odometry", "/tf"), - ], condition=IfCondition(remap_odometry_tf), ) control_node = Node( @@ -114,7 +111,13 @@ def generate_launch_description(): robot_bicycle_controller_spawner = Node( package="controller_manager", executable="spawner", - arguments=["bicycle_steering_controller", "--param-file", robot_controllers], + arguments=[ + "bicycle_steering_controller", + "--param-file", + robot_controllers, + "--controller-ros-args", + "-r /bicycle_steering_controller/tf_odometry:=/tf", + ], ) # Delay rviz start after `joint_state_broadcaster` diff --git a/example_15/bringup/launch/rrbot_namespace.launch.py b/example_15/bringup/launch/rrbot_namespace.launch.py index d63a0b040..6d9e51d7b 100644 --- a/example_15/bringup/launch/rrbot_namespace.launch.py +++ b/example_15/bringup/launch/rrbot_namespace.launch.py @@ -69,13 +69,6 @@ def generate_launch_description(): executable="ros2_control_node", namespace="/rrbot", parameters=[robot_description, robot_controllers], - remappings=[ - ( - # we use the remapping from a relative name to FQN /position_commands - "forward_position_controller/commands", - "/position_commands", - ), - ], output={ "stdout": "screen", "stderr": "screen", @@ -108,7 +101,14 @@ def generate_launch_description(): package="controller_manager", executable="spawner", namespace="rrbot", - arguments=["forward_position_controller", "--param-file", robot_controllers], + arguments=[ + "forward_position_controller", + "--param-file", + robot_controllers, + # we use the remapping from a relative name to FQN /position_commands + "--controller-ros-args", + "-r forward_position_controller/commands:=/position_commands", + ], ) robot_position_trajectory_controller_spawner = Node( diff --git a/example_2/bringup/launch/diffbot.launch.py b/example_2/bringup/launch/diffbot.launch.py index 1c345464f..7573d2860 100644 --- a/example_2/bringup/launch/diffbot.launch.py +++ b/example_2/bringup/launch/diffbot.launch.py @@ -76,7 +76,7 @@ def generate_launch_description(): parameters=[robot_controllers], output="both", remappings=[ - ("/diffbot_base_controller/cmd_vel", "/cmd_vel"), + # ("/diffbot_base_controller/cmd_vel", "/cmd_vel"), ], ) robot_state_pub_node = Node( @@ -103,7 +103,13 @@ def generate_launch_description(): robot_controller_spawner = Node( package="controller_manager", executable="spawner", - arguments=["diffbot_base_controller", "--param-file", robot_controllers], + arguments=[ + "diffbot_base_controller", + "--param-file", + robot_controllers, + "--controller-ros-args", + "-r /diffbot_base_controller/cmd_vel:=/cmd_vel", + ], ) # Delay rviz start after `joint_state_broadcaster` From 130539e1b934b915abdb48661d5633dcd2410591 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Fri, 23 Aug 2024 19:04:06 +0000 Subject: [PATCH 2/2] Remove old code --- example_2/bringup/launch/diffbot.launch.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/example_2/bringup/launch/diffbot.launch.py b/example_2/bringup/launch/diffbot.launch.py index 7573d2860..797ea5fd8 100644 --- a/example_2/bringup/launch/diffbot.launch.py +++ b/example_2/bringup/launch/diffbot.launch.py @@ -75,9 +75,6 @@ def generate_launch_description(): executable="ros2_control_node", parameters=[robot_controllers], output="both", - remappings=[ - # ("/diffbot_base_controller/cmd_vel", "/cmd_vel"), - ], ) robot_state_pub_node = Node( package="robot_state_publisher",