From a8f390e984a8acd4a48e4280409cb2caf50632a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Thu, 7 Sep 2023 12:14:17 +0200 Subject: [PATCH] Cleanup controller config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- .../config/cartpole_controller_effort.yaml | 10 ++-------- .../config/cartpole_controller_velocity.yaml | 5 ----- gz_ros2_control_demos/examples/example_effort.cpp | 2 +- .../launch/cart_example_effort.launch.py | 2 +- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/gz_ros2_control_demos/config/cartpole_controller_effort.yaml b/gz_ros2_control_demos/config/cartpole_controller_effort.yaml index 54b0be31..920e4651 100644 --- a/gz_ros2_control_demos/config/cartpole_controller_effort.yaml +++ b/gz_ros2_control_demos/config/cartpole_controller_effort.yaml @@ -2,19 +2,13 @@ controller_manager: ros__parameters: update_rate: 1000 # Hz - effort_controllers: + effort_controller: type: effort_controllers/JointGroupEffortController joint_state_broadcaster: type: joint_state_broadcaster/JointStateBroadcaster -effort_controllers: +effort_controller: ros__parameters: joints: - slider_to_cart - command_interfaces: - - effort - state_interfaces: - - position - - velocity - - effort diff --git a/gz_ros2_control_demos/config/cartpole_controller_velocity.yaml b/gz_ros2_control_demos/config/cartpole_controller_velocity.yaml index 8d6b6ab0..7215d760 100644 --- a/gz_ros2_control_demos/config/cartpole_controller_velocity.yaml +++ b/gz_ros2_control_demos/config/cartpole_controller_velocity.yaml @@ -15,11 +15,6 @@ velocity_controller: ros__parameters: joints: - slider_to_cart - command_interfaces: - - velocity - state_interfaces: - - position - - velocity imu_sensor_broadcaster: ros__parameters: diff --git a/gz_ros2_control_demos/examples/example_effort.cpp b/gz_ros2_control_demos/examples/example_effort.cpp index 0c2dcf1b..d6fbaa9e 100644 --- a/gz_ros2_control_demos/examples/example_effort.cpp +++ b/gz_ros2_control_demos/examples/example_effort.cpp @@ -26,7 +26,7 @@ int main(int argc, char * argv[]) std::make_shared("effort_test_node"); auto publisher = node->create_publisher( - "/effort_controllers/commands", 10); + "/effort_controller/commands", 10); RCLCPP_INFO(node->get_logger(), "node created"); diff --git a/gz_ros2_control_demos/launch/cart_example_effort.launch.py b/gz_ros2_control_demos/launch/cart_example_effort.launch.py index 780975f8..da7e1e10 100644 --- a/gz_ros2_control_demos/launch/cart_example_effort.launch.py +++ b/gz_ros2_control_demos/launch/cart_example_effort.launch.py @@ -67,7 +67,7 @@ def generate_launch_description(): ) load_joint_effort_controller = ExecuteProcess( - cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'effort_controllers'], + cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'effort_controller'], output='screen' )