From d8ec082746c489690b29e7e12dbedb78ae19d7d2 Mon Sep 17 00:00:00 2001 From: Sai Kishor Kothakota Date: Thu, 10 Oct 2024 11:04:29 +0200 Subject: [PATCH] added generic rrbot configuration file to use with controller spawning --- ...ontroller_manager_rrbot_2_controllers.yaml | 39 ------------------- ...er_manager_rrbot_generic_controllers.yaml} | 26 +++++++++++-- ...oller_manager_example_two_rrbots.launch.py | 8 ++-- example_15/doc/userdoc.rst | 3 +- 4 files changed, 28 insertions(+), 48 deletions(-) delete mode 100644 example_15/bringup/config/multi_controller_manager_rrbot_2_controllers.yaml rename example_15/bringup/config/{multi_controller_manager_rrbot_1_controllers.yaml => multi_controller_manager_rrbot_generic_controllers.yaml} (69%) diff --git a/example_15/bringup/config/multi_controller_manager_rrbot_2_controllers.yaml b/example_15/bringup/config/multi_controller_manager_rrbot_2_controllers.yaml deleted file mode 100644 index 9738c6ae2..000000000 --- a/example_15/bringup/config/multi_controller_manager_rrbot_2_controllers.yaml +++ /dev/null @@ -1,39 +0,0 @@ -/rrbot_2/controller_manager: - ros__parameters: - update_rate: 10 # Hz - - joint_state_broadcaster: - type: joint_state_broadcaster/JointStateBroadcaster - - -/rrbot_2/forward_position_controller: - ros__parameters: - type: forward_command_controller/ForwardCommandController - joints: - - rrbot_2_joint1 - - rrbot_2_joint2 - interface_name: position - - -/rrbot_2/position_trajectory_controller: - ros__parameters: - type: joint_trajectory_controller/JointTrajectoryController - joints: - - rrbot_2_joint1 - - rrbot_2_joint2 - - command_interfaces: - - position - - state_interfaces: - - position - - state_publish_rate: 200.0 # Defaults to 50 - action_monitor_rate: 20.0 # Defaults to 20 - - allow_partial_joints_goal: false # Defaults to false - open_loop_control: true - allow_integration_in_goal_trajectories: true - constraints: - stopped_velocity_tolerance: 0.01 # Defaults to 0.01 - goal_time: 0.0 # Defaults to 0.0 (start immediately) diff --git a/example_15/bringup/config/multi_controller_manager_rrbot_1_controllers.yaml b/example_15/bringup/config/multi_controller_manager_rrbot_generic_controllers.yaml similarity index 69% rename from example_15/bringup/config/multi_controller_manager_rrbot_1_controllers.yaml rename to example_15/bringup/config/multi_controller_manager_rrbot_generic_controllers.yaml index 973035d93..f5ff616a9 100644 --- a/example_15/bringup/config/multi_controller_manager_rrbot_1_controllers.yaml +++ b/example_15/bringup/config/multi_controller_manager_rrbot_generic_controllers.yaml @@ -1,4 +1,4 @@ -/rrbot_1/controller_manager: +/**/controller_manager: ros__parameters: update_rate: 10 # Hz @@ -6,16 +6,36 @@ type: joint_state_broadcaster/JointStateBroadcaster -/rrbot_1/forward_position_controller: +/**/forward_position_controller: ros__parameters: type: forward_command_controller/ForwardCommandController + interface_name: position + +/rrbot_1/forward_position_controller: + ros__parameters: joints: - rrbot_1_joint1 - rrbot_1_joint2 - interface_name: position +/rrbot_2/forward_position_controller: + ros__parameters: + joints: + - rrbot_2_joint1 + - rrbot_2_joint2 /rrbot_1/position_trajectory_controller: + ros__parameters: + joints: + - rrbot_1_joint1 + - rrbot_1_joint2 + +/rrbot_2/position_trajectory_controller: + ros__parameters: + joints: + - rrbot_2_joint1 + - rrbot_2_joint2 + +/**/position_trajectory_controller: ros__parameters: type: joint_trajectory_controller/JointTrajectoryController joints: diff --git a/example_15/bringup/launch/multi_controller_manager_example_two_rrbots.launch.py b/example_15/bringup/launch/multi_controller_manager_example_two_rrbots.launch.py index 7e5b99cc2..82c26ca24 100644 --- a/example_15/bringup/launch/multi_controller_manager_example_two_rrbots.launch.py +++ b/example_15/bringup/launch/multi_controller_manager_example_two_rrbots.launch.py @@ -76,7 +76,7 @@ def generate_launch_description(): "description_package": "ros2_control_demo_example_1", "description_file": "rrbot.urdf.xacro", "runtime_config_package": "ros2_control_demo_example_15", - "controllers_file": "multi_controller_manager_rrbot_1_controllers.yaml", + "controllers_file": "multi_controller_manager_rrbot_generic_controllers.yaml", "prefix": "rrbot_1_", "use_mock_hardware": use_mock_hardware, "mock_sensor_commands": mock_sensor_commands, @@ -99,7 +99,7 @@ def generate_launch_description(): [ FindPackageShare("ros2_control_demo_example_15"), "config", - "multi_controller_manager_rrbot_1_controllers.yaml", + "multi_controller_manager_rrbot_generic_controllers.yaml", ] ), ], @@ -112,7 +112,7 @@ def generate_launch_description(): "description_package": "ros2_control_demo_example_5", "description_file": "rrbot_system_with_external_sensor.urdf.xacro", "runtime_config_package": "ros2_control_demo_example_15", - "controllers_file": "multi_controller_manager_rrbot_2_controllers.yaml", + "controllers_file": "multi_controller_manager_rrbot_generic_controllers.yaml", "prefix": "rrbot_2_", "use_mock_hardware": use_mock_hardware, "mock_sensor_commands": mock_sensor_commands, @@ -135,7 +135,7 @@ def generate_launch_description(): [ FindPackageShare("ros2_control_demo_example_15"), "config", - "multi_controller_manager_rrbot_2_controllers.yaml", + "multi_controller_manager_rrbot_generic_controllers.yaml", ] ), ], diff --git a/example_15/doc/userdoc.rst b/example_15/doc/userdoc.rst index 8b2b65cab..55a9ae207 100644 --- a/example_15/doc/userdoc.rst +++ b/example_15/doc/userdoc.rst @@ -80,8 +80,7 @@ Scenario: Using multiple controller managers on the same machine * Launch file: `multi_controller_manager_example_two_rrbots.launch.py `__ * Controllers yaml: - - `multi_controller_manager_rrbot_1_controllers.yaml `__ - - `multi_controller_manager_rrbot_2_controllers.yaml `__ + - `multi_controller_manager_generic_controllers.yaml `__ * URDF file: `rrbot.urdf.xacro `__ * Description: `rrbot_description.urdf.xacro `__