From 50476f96a56e232a21a8842aa7fdeccfa327f453 Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Fri, 20 Dec 2024 14:37:32 +0100 Subject: [PATCH] Update ros2_control_demos to use --controller-ros-args --- example_11/bringup/launch/carlikebot.launch.py | 12 +++++++----- .../bringup/launch/rrbot_namespace.launch.py | 15 +++++++-------- example_2/bringup/launch/diffbot.launch.py | 11 +++++++---- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/example_11/bringup/launch/carlikebot.launch.py b/example_11/bringup/launch/carlikebot.launch.py index 47c3c3327..d2ab3122f 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( @@ -87,7 +84,6 @@ def generate_launch_description(): executable="ros2_control_node", parameters=[robot_controllers], output="both", - remappings=[], condition=UnlessCondition(remap_odometry_tf), ) robot_state_pub_bicycle_node = Node( @@ -114,7 +110,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", + "'--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 537bdb208..bc81e4380 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,13 @@ 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, + "--controller-ros-args", + "'--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..cd934add9 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", @@ -103,7 +100,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", + "'--ros-args -r /diffbot_base_controller/cmd_vel:=/cmd_vel'", + ], ) # Delay rviz start after `joint_state_broadcaster`