From e5b5b7c23ea4a2afccc781085ac2abd3242c94e2 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 21:31:35 +0100 Subject: [PATCH] Rename cartpole (#252) (#254) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alejandro Hernández Cordero (cherry picked from commit b39074a4a1adf8a9319a6d4378ac26e2aa9e298a) Co-authored-by: Christoph Fröhlich --- doc/index.rst | 28 +++++-------------- ...e_controller.yaml => cart_controller.yaml} | 0 ...ffort.yaml => cart_controller_effort.yaml} | 0 ...ity.yaml => cart_controller_velocity.yaml} | 0 .../launch/cart_example_effort.launch.py | 8 +++--- .../launch/cart_example_position.launch.py | 8 +++--- .../launch/cart_example_velocity.launch.py | 8 +++--- .../launch/diff_drive.launch.py | 6 ++-- .../gripper_mimic_joint_example.launch.py | 6 ++-- .../launch/tricycle_drive.launch.py | 6 ++-- .../urdf/test_cart_effort.xacro.urdf | 8 ++---- .../urdf/test_cart_position.xacro.urdf | 8 ++---- .../urdf/test_cart_velocity.xacro.urdf | 8 ++---- 13 files changed, 34 insertions(+), 60 deletions(-) rename gazebo_ros2_control_demos/config/{cartpole_controller.yaml => cart_controller.yaml} (100%) rename gazebo_ros2_control_demos/config/{cartpole_controller_effort.yaml => cart_controller_effort.yaml} (100%) rename gazebo_ros2_control_demos/config/{cartpole_controller_velocity.yaml => cart_controller_velocity.yaml} (100%) diff --git a/doc/index.rst b/doc/index.rst index 829f71da..e24a2308 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -146,7 +146,7 @@ robot hardware interfaces between *ros2_control* and Gazebo Classic. robot_description robot_state_publisher - $(find gazebo_ros2_control_demos)/config/cartpole_controller.yaml + $(find gazebo_ros2_control_demos)/config/cart_controller.yaml @@ -202,32 +202,18 @@ Use the tag ```` inside ```` to set the YAML file with the c - $(find gazebo_ros2_control_demos)/config/cartpole_controller.yaml + $(find gazebo_ros2_control_demos)/config/cart_controller.yaml -This controller publishes the state of all resources registered to a -``hardware_interface::StateInterface`` to a topic of type ``sensor_msgs/msg/JointState``. -The following is a basic configuration of the controller. +The following is a basic configuration of the controllers: -.. code-block:: yaml +- ``joint_state_broadcaster``: This controller publishes the state of all resources registered to a ``hardware_interface::StateInterface`` to a topic of type ``sensor_msgs/msg/JointState``. - joint_state_controller: - ros__parameters: - type: joint_state_controller/JointStateController +- ``joint_trajectory_controller``: This controller creates an action called ``/joint_trajectory_controller/follow_joint_trajectory`` of type ``control_msgs::action::FollowJointTrajectory``. - -This controller creates an action called ``/cart_pole_controller/follow_joint_trajectory`` of type ``control_msgs::action::FollowJointTrajectory``. - -.. code-block:: yaml - - cart_pole_controller: - ros__parameters: - type: joint_trajectory_controller/JointTrajectoryController - joints: - - slider_to_cart - write_op_modes: - - slider_to_cart +.. literalinclude:: ../gazebo_ros2_control_demos/config/cart_controller.yaml + :language: yaml gazebo_ros2_control_demos ========================================== diff --git a/gazebo_ros2_control_demos/config/cartpole_controller.yaml b/gazebo_ros2_control_demos/config/cart_controller.yaml similarity index 100% rename from gazebo_ros2_control_demos/config/cartpole_controller.yaml rename to gazebo_ros2_control_demos/config/cart_controller.yaml diff --git a/gazebo_ros2_control_demos/config/cartpole_controller_effort.yaml b/gazebo_ros2_control_demos/config/cart_controller_effort.yaml similarity index 100% rename from gazebo_ros2_control_demos/config/cartpole_controller_effort.yaml rename to gazebo_ros2_control_demos/config/cart_controller_effort.yaml diff --git a/gazebo_ros2_control_demos/config/cartpole_controller_velocity.yaml b/gazebo_ros2_control_demos/config/cart_controller_velocity.yaml similarity index 100% rename from gazebo_ros2_control_demos/config/cartpole_controller_velocity.yaml rename to gazebo_ros2_control_demos/config/cart_controller_velocity.yaml diff --git a/gazebo_ros2_control_demos/launch/cart_example_effort.launch.py b/gazebo_ros2_control_demos/launch/cart_example_effort.launch.py index 95caf297..7b0c5036 100644 --- a/gazebo_ros2_control_demos/launch/cart_example_effort.launch.py +++ b/gazebo_ros2_control_demos/launch/cart_example_effort.launch.py @@ -53,10 +53,10 @@ def generate_launch_description(): spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py', arguments=['-topic', 'robot_description', - '-entity', 'cartpole'], + '-entity', 'cart'], output='screen') - load_joint_state_controller = ExecuteProcess( + load_joint_state_broadcaster = ExecuteProcess( cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'joint_state_broadcaster'], output='screen' @@ -71,12 +71,12 @@ def generate_launch_description(): RegisterEventHandler( event_handler=OnProcessExit( target_action=spawn_entity, - on_exit=[load_joint_state_controller], + on_exit=[load_joint_state_broadcaster], ) ), RegisterEventHandler( event_handler=OnProcessExit( - target_action=load_joint_state_controller, + target_action=load_joint_state_broadcaster, on_exit=[load_joint_trajectory_controller], ) ), diff --git a/gazebo_ros2_control_demos/launch/cart_example_position.launch.py b/gazebo_ros2_control_demos/launch/cart_example_position.launch.py index d5aae851..b741e849 100644 --- a/gazebo_ros2_control_demos/launch/cart_example_position.launch.py +++ b/gazebo_ros2_control_demos/launch/cart_example_position.launch.py @@ -53,10 +53,10 @@ def generate_launch_description(): spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py', arguments=['-topic', 'robot_description', - '-entity', 'cartpole'], + '-entity', 'cart'], output='screen') - load_joint_state_controller = ExecuteProcess( + load_joint_state_broadcaster = ExecuteProcess( cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'joint_state_broadcaster'], output='screen' @@ -72,12 +72,12 @@ def generate_launch_description(): RegisterEventHandler( event_handler=OnProcessExit( target_action=spawn_entity, - on_exit=[load_joint_state_controller], + on_exit=[load_joint_state_broadcaster], ) ), RegisterEventHandler( event_handler=OnProcessExit( - target_action=load_joint_state_controller, + target_action=load_joint_state_broadcaster, on_exit=[load_joint_trajectory_controller], ) ), diff --git a/gazebo_ros2_control_demos/launch/cart_example_velocity.launch.py b/gazebo_ros2_control_demos/launch/cart_example_velocity.launch.py index c155e34a..ea853dee 100644 --- a/gazebo_ros2_control_demos/launch/cart_example_velocity.launch.py +++ b/gazebo_ros2_control_demos/launch/cart_example_velocity.launch.py @@ -52,10 +52,10 @@ def generate_launch_description(): spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py', arguments=['-topic', 'robot_description', - '-entity', 'cartpole'], + '-entity', 'cart'], output='screen') - load_joint_state_controller = ExecuteProcess( + load_joint_state_broadcaster = ExecuteProcess( cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'joint_state_broadcaster'], output='screen' @@ -75,12 +75,12 @@ def generate_launch_description(): RegisterEventHandler( event_handler=OnProcessExit( target_action=spawn_entity, - on_exit=[load_joint_state_controller], + on_exit=[load_joint_state_broadcaster], ) ), RegisterEventHandler( event_handler=OnProcessExit( - target_action=load_joint_state_controller, + target_action=load_joint_state_broadcaster, on_exit=[load_joint_trajectory_controller], ) ), diff --git a/gazebo_ros2_control_demos/launch/diff_drive.launch.py b/gazebo_ros2_control_demos/launch/diff_drive.launch.py index 97913bde..faa476db 100644 --- a/gazebo_ros2_control_demos/launch/diff_drive.launch.py +++ b/gazebo_ros2_control_demos/launch/diff_drive.launch.py @@ -56,7 +56,7 @@ def generate_launch_description(): '-entity', 'diffbot'], output='screen') - load_joint_state_controller = ExecuteProcess( + load_joint_state_broadcaster = ExecuteProcess( cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'joint_state_broadcaster'], output='screen' @@ -72,12 +72,12 @@ def generate_launch_description(): RegisterEventHandler( event_handler=OnProcessExit( target_action=spawn_entity, - on_exit=[load_joint_state_controller], + on_exit=[load_joint_state_broadcaster], ) ), RegisterEventHandler( event_handler=OnProcessExit( - target_action=load_joint_state_controller, + target_action=load_joint_state_broadcaster, on_exit=[load_diff_drive_base_controller], ) ), diff --git a/gazebo_ros2_control_demos/launch/gripper_mimic_joint_example.launch.py b/gazebo_ros2_control_demos/launch/gripper_mimic_joint_example.launch.py index ef3a7f75..85b65398 100644 --- a/gazebo_ros2_control_demos/launch/gripper_mimic_joint_example.launch.py +++ b/gazebo_ros2_control_demos/launch/gripper_mimic_joint_example.launch.py @@ -57,7 +57,7 @@ def generate_launch_description(): '-entity', 'gripper'], output='screen') - load_joint_state_controller = ExecuteProcess( + load_joint_state_broadcaster = ExecuteProcess( cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'joint_state_broadcaster'], output='screen' @@ -73,12 +73,12 @@ def generate_launch_description(): RegisterEventHandler( event_handler=OnProcessExit( target_action=spawn_entity, - on_exit=[load_joint_state_controller], + on_exit=[load_joint_state_broadcaster], ) ), RegisterEventHandler( event_handler=OnProcessExit( - target_action=load_joint_state_controller, + target_action=load_joint_state_broadcaster, on_exit=[load_gripper_controller], ) ), diff --git a/gazebo_ros2_control_demos/launch/tricycle_drive.launch.py b/gazebo_ros2_control_demos/launch/tricycle_drive.launch.py index 1a3cf07c..a857248a 100644 --- a/gazebo_ros2_control_demos/launch/tricycle_drive.launch.py +++ b/gazebo_ros2_control_demos/launch/tricycle_drive.launch.py @@ -56,7 +56,7 @@ def generate_launch_description(): '-entity', 'tricycle'], output='screen') - load_joint_state_controller = ExecuteProcess( + load_joint_state_broadcaster = ExecuteProcess( cmd=['ros2', 'control', 'load_controller', '--set-state', 'active', 'joint_state_broadcaster'], output='screen' @@ -82,12 +82,12 @@ def generate_launch_description(): RegisterEventHandler( event_handler=OnProcessExit( target_action=spawn_entity, - on_exit=[load_joint_state_controller], + on_exit=[load_joint_state_broadcaster], ) ), RegisterEventHandler( event_handler=OnProcessExit( - target_action=load_joint_state_controller, + target_action=load_joint_state_broadcaster, on_exit=[load_tricycle_controller], ) ), diff --git a/gazebo_ros2_control_demos/urdf/test_cart_effort.xacro.urdf b/gazebo_ros2_control_demos/urdf/test_cart_effort.xacro.urdf index 523bca36..35d13c12 100644 --- a/gazebo_ros2_control_demos/urdf/test_cart_effort.xacro.urdf +++ b/gazebo_ros2_control_demos/urdf/test_cart_effort.xacro.urdf @@ -1,9 +1,5 @@ - - - - - + @@ -68,7 +64,7 @@ - $(find gazebo_ros2_control_demos)/config/cartpole_controller_effort.yaml + $(find gazebo_ros2_control_demos)/config/cart_controller_effort.yaml diff --git a/gazebo_ros2_control_demos/urdf/test_cart_position.xacro.urdf b/gazebo_ros2_control_demos/urdf/test_cart_position.xacro.urdf index be1829d0..8ab12f82 100644 --- a/gazebo_ros2_control_demos/urdf/test_cart_position.xacro.urdf +++ b/gazebo_ros2_control_demos/urdf/test_cart_position.xacro.urdf @@ -1,9 +1,5 @@ - - - - - + @@ -67,7 +63,7 @@ - $(find gazebo_ros2_control_demos)/config/cartpole_controller.yaml + $(find gazebo_ros2_control_demos)/config/cart_controller.yaml diff --git a/gazebo_ros2_control_demos/urdf/test_cart_velocity.xacro.urdf b/gazebo_ros2_control_demos/urdf/test_cart_velocity.xacro.urdf index 08e28d1b..09939e8d 100644 --- a/gazebo_ros2_control_demos/urdf/test_cart_velocity.xacro.urdf +++ b/gazebo_ros2_control_demos/urdf/test_cart_velocity.xacro.urdf @@ -1,9 +1,5 @@ - - - - - + @@ -97,7 +93,7 @@ - $(find gazebo_ros2_control_demos)/config/cartpole_controller_velocity.yaml + $(find gazebo_ros2_control_demos)/config/cart_controller_velocity.yaml