From 4225581364f9049bfcb5fa96a4141cc3737967bf Mon Sep 17 00:00:00 2001 From: Haider Lodhi Date: Fri, 15 Jul 2022 14:24:33 +0200 Subject: [PATCH 1/3] Rename position_trajectory_controller to joint_trajectory_position_controller (#190) (cherry picked from commit f43fa8ae6029f089d0fb2ff619730a5a08eaf55b) # Conflicts: # README.md # ros2_control_demo_bringup/launch/rrbot.launch.py # ros2_control_demo_bringup/launch/rrbot_base.launch.py --- README.md | 16 +++++++++++++--- .../config/rrbot_controllers.yaml | 4 ++-- .../config/rrbot_joint_trajectory_publisher.yaml | 4 ++-- ros2_control_demo_bringup/launch/rrbot.launch.py | 5 +++++ .../launch/rrbot_base.launch.py | 5 +++++ ...int_trajectory_position_controller.launch.py} | 4 ++-- ...sher_joint_trajectory_position_controller.py} | 4 ++-- ros2_control_test_nodes/setup.py | 4 ++-- 8 files changed, 33 insertions(+), 13 deletions(-) rename ros2_control_demo_bringup/launch/{test_joint_trajectory_controller.launch.py => test_joint_trajectory_position_controller.launch.py} (89%) rename ros2_control_test_nodes/ros2_control_test_nodes/{publisher_joint_trajectory_controller.py => publisher_joint_trajectory_position_controller.py} (97%) diff --git a/README.md b/README.md index 0147b1c33..e26018284 100644 --- a/README.md +++ b/README.md @@ -618,7 +618,7 @@ Now you should also see the *RRbot* represented correctly in `RViz`. 1. If you want to test hardware with `JointTrajectoryController` first load and configure a controller (not always needed): ``` - ros2 control load_controller position_trajectory_controller --set-state configure + ros2 control load_controller joint_trajectory_position_controller --set-state configure ``` Check if the controller is loaded and configured properly: ``` @@ -626,12 +626,12 @@ Now you should also see the *RRbot* represented correctly in `RViz`. ``` You should get the response: ``` - position_trajectory_controller[joint_trajectory_controller/JointTrajectoryController] inactive + joint_trajectory_position_controller[joint_trajectory_controller/JointTrajectoryController] inactive ``` 2. Now start the controller (and stop other running contorller): ``` - ros2 control switch_controllers --stop forward_position_controller --start position_trajectory_controller + ros2 control switch_controllers --stop forward_position_controller --start joint_trajectory_position_controller ``` Check if controllers are activated: ``` @@ -639,6 +639,7 @@ Now you should also see the *RRbot* represented correctly in `RViz`. ``` You should get `active` in the response: ``` +<<<<<<< HEAD joint_state_broadcaster[joint_state_broadcaster/JointStateBroadcaster] active position_trajectory_controller[joint_trajectory_controller/JointTrajectoryController] active ``` @@ -646,6 +647,15 @@ Now you should also see the *RRbot* represented correctly in `RViz`. 3. Send a command to the controller using demo node which sends four goals every 6 seconds in a loop: ``` ros2 launch ros2_control_demo_bringup test_joint_trajectory_controller.launch.py +======= + joint_state_controller[joint_state_controller/JointStateController] active + joint_trajectory_position_controller[joint_trajectory_controller/JointTrajectoryController] active + ``` + +3. Send a command to the controller using demo node which sends two goals every 6 seconds in a loop: + ``` + ros2 launch ros2_control_demo_bringup test_joint_trajectory_position_controller.launch.py +>>>>>>> f43fa8a (Rename position_trajectory_controller to joint_trajectory_position_controller (#190)) ``` You can adjust the goals in [rrbot_joint_trajectory_publisher.yaml](ros2_control_demo_bringup/config/rrbot_joint_trajectory_publisher.yaml). diff --git a/ros2_control_demo_bringup/config/rrbot_controllers.yaml b/ros2_control_demo_bringup/config/rrbot_controllers.yaml index 8a775985b..7a5bedc96 100644 --- a/ros2_control_demo_bringup/config/rrbot_controllers.yaml +++ b/ros2_control_demo_bringup/config/rrbot_controllers.yaml @@ -8,7 +8,7 @@ controller_manager: forward_position_controller: type: forward_command_controller/ForwardCommandController - position_trajectory_controller: + joint_trajectory_position_controller: type: joint_trajectory_controller/JointTrajectoryController @@ -20,7 +20,7 @@ forward_position_controller: interface_name: position -position_trajectory_controller: +joint_trajectory_position_controller: ros__parameters: joints: - joint1 diff --git a/ros2_control_demo_bringup/config/rrbot_joint_trajectory_publisher.yaml b/ros2_control_demo_bringup/config/rrbot_joint_trajectory_publisher.yaml index 6b09cc8aa..c311b2414 100644 --- a/ros2_control_demo_bringup/config/rrbot_joint_trajectory_publisher.yaml +++ b/ros2_control_demo_bringup/config/rrbot_joint_trajectory_publisher.yaml @@ -1,7 +1,7 @@ -publisher_joint_trajectory_controller: +publisher_joint_trajectory_position_controller: ros__parameters: - controller_name: "position_trajectory_controller" + controller_name: "joint_trajectory_position_controller" wait_sec_between_publish: 6 goal_names: ["pos1", "pos2", "pos3", "pos4"] diff --git a/ros2_control_demo_bringup/launch/rrbot.launch.py b/ros2_control_demo_bringup/launch/rrbot.launch.py index 3ce2b90d8..7171490e2 100644 --- a/ros2_control_demo_bringup/launch/rrbot.launch.py +++ b/ros2_control_demo_bringup/launch/rrbot.launch.py @@ -84,8 +84,13 @@ def generate_launch_description(): robot_controller_spawner = Node( package="controller_manager", +<<<<<<< HEAD executable="spawner", arguments=["forward_position_controller", "-c", "/controller_manager"], +======= + executable="spawner.py", + arguments=["forward_position_controller", "--controller-manager", "/controller_manager"], +>>>>>>> f43fa8a (Rename position_trajectory_controller to joint_trajectory_position_controller (#190)) ) # Delay rviz start after `joint_state_broadcaster` diff --git a/ros2_control_demo_bringup/launch/rrbot_base.launch.py b/ros2_control_demo_bringup/launch/rrbot_base.launch.py index 877db94a1..b2ba994e8 100644 --- a/ros2_control_demo_bringup/launch/rrbot_base.launch.py +++ b/ros2_control_demo_bringup/launch/rrbot_base.launch.py @@ -185,8 +185,13 @@ def generate_launch_description(): robot_controller_spawner = Node( package="controller_manager", +<<<<<<< HEAD executable="spawner", arguments=[robot_controller, "-c", "/controller_manager"], +======= + executable="spawner.py", + arguments=[robot_controller, "--controller-manager", "/controller_manager"], +>>>>>>> f43fa8a (Rename position_trajectory_controller to joint_trajectory_position_controller (#190)) ) # Delay rviz start after `joint_state_broadcaster` diff --git a/ros2_control_demo_bringup/launch/test_joint_trajectory_controller.launch.py b/ros2_control_demo_bringup/launch/test_joint_trajectory_position_controller.launch.py similarity index 89% rename from ros2_control_demo_bringup/launch/test_joint_trajectory_controller.launch.py rename to ros2_control_demo_bringup/launch/test_joint_trajectory_position_controller.launch.py index 3e6f2fe8a..7f5cc7a1d 100644 --- a/ros2_control_demo_bringup/launch/test_joint_trajectory_controller.launch.py +++ b/ros2_control_demo_bringup/launch/test_joint_trajectory_position_controller.launch.py @@ -32,8 +32,8 @@ def generate_launch_description(): [ Node( package="ros2_control_test_nodes", - executable="publisher_joint_trajectory_controller", - name="publisher_joint_trajectory_controller", + executable="publisher_joint_trajectory_position_controller", + name="publisher_joint_trajectory_position_controller", parameters=[position_goals], output="both", ) diff --git a/ros2_control_test_nodes/ros2_control_test_nodes/publisher_joint_trajectory_controller.py b/ros2_control_test_nodes/ros2_control_test_nodes/publisher_joint_trajectory_position_controller.py similarity index 97% rename from ros2_control_test_nodes/ros2_control_test_nodes/publisher_joint_trajectory_controller.py rename to ros2_control_test_nodes/ros2_control_test_nodes/publisher_joint_trajectory_position_controller.py index 11ca714d4..df7e58dc7 100644 --- a/ros2_control_test_nodes/ros2_control_test_nodes/publisher_joint_trajectory_controller.py +++ b/ros2_control_test_nodes/ros2_control_test_nodes/publisher_joint_trajectory_position_controller.py @@ -22,9 +22,9 @@ class PublisherJointTrajectory(Node): def __init__(self): - super().__init__("publisher_position_trajectory_controller") + super().__init__("publisher_joint_trajectory_position_controller") # Declare all parameters - self.declare_parameter("controller_name", "position_trajectory_controller") + self.declare_parameter("controller_name", "joint_trajectory_position_controller") self.declare_parameter("wait_sec_between_publish", 6) self.declare_parameter("goal_names", ["pos1", "pos2"]) self.declare_parameter("joints") diff --git a/ros2_control_test_nodes/setup.py b/ros2_control_test_nodes/setup.py index 98f47ba19..5ca84d1d2 100644 --- a/ros2_control_test_nodes/setup.py +++ b/ros2_control_test_nodes/setup.py @@ -50,8 +50,8 @@ "console_scripts": [ "publisher_forward_position_controller = \ ros2_control_test_nodes.publisher_forward_position_controller:main", - "publisher_joint_trajectory_controller = \ - ros2_control_test_nodes.publisher_joint_trajectory_controller:main", + "publisher_joint_trajectory_position_controller = \ + ros2_control_test_nodes.publisher_joint_trajectory_position_controller:main", ], }, ) From 4ce3e9660fc5be011064eaba7234648b7f44074d Mon Sep 17 00:00:00 2001 From: haider8645 Date: Fri, 26 Aug 2022 13:14:53 +0000 Subject: [PATCH 2/3] Clear merge conflicts --- README.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/README.md b/README.md index 2344666e5..01839b76e 100644 --- a/README.md +++ b/README.md @@ -639,23 +639,13 @@ Now you should also see the *RRbot* represented correctly in `RViz`. ``` You should get `active` in the response: ``` -<<<<<<< HEAD joint_state_broadcaster[joint_state_broadcaster/JointStateBroadcaster] active position_trajectory_controller[joint_trajectory_controller/JointTrajectoryController] active ``` -3. Send a command to the controller using demo node which sends four goals every 6 seconds in a loop: - ``` - ros2 launch ros2_control_demo_bringup test_joint_trajectory_controller.launch.py -======= - joint_state_controller[joint_state_controller/JointStateController] active - joint_trajectory_position_controller[joint_trajectory_controller/JointTrajectoryController] active - ``` - 3. Send a command to the controller using demo node which sends two goals every 6 seconds in a loop: ``` ros2 launch ros2_control_demo_bringup test_joint_trajectory_position_controller.launch.py ->>>>>>> f43fa8a (Rename position_trajectory_controller to joint_trajectory_position_controller (#190)) ``` You can adjust the goals in [rrbot_joint_trajectory_publisher.yaml](ros2_control_demo_bringup/config/rrbot_joint_trajectory_publisher.yaml). From 0a10ef781dac9eca0285cf850a1bbccdbf8374a5 Mon Sep 17 00:00:00 2001 From: haider8645 Date: Fri, 26 Aug 2022 13:17:56 +0000 Subject: [PATCH 3/3] cleanup --- ros2_control_demo_bringup/launch/rrbot.launch.py | 5 ----- ros2_control_demo_bringup/launch/rrbot_base.launch.py | 5 ----- 2 files changed, 10 deletions(-) diff --git a/ros2_control_demo_bringup/launch/rrbot.launch.py b/ros2_control_demo_bringup/launch/rrbot.launch.py index 7171490e2..b9bcf497f 100644 --- a/ros2_control_demo_bringup/launch/rrbot.launch.py +++ b/ros2_control_demo_bringup/launch/rrbot.launch.py @@ -84,13 +84,8 @@ def generate_launch_description(): robot_controller_spawner = Node( package="controller_manager", -<<<<<<< HEAD - executable="spawner", - arguments=["forward_position_controller", "-c", "/controller_manager"], -======= executable="spawner.py", arguments=["forward_position_controller", "--controller-manager", "/controller_manager"], ->>>>>>> f43fa8a (Rename position_trajectory_controller to joint_trajectory_position_controller (#190)) ) # Delay rviz start after `joint_state_broadcaster` diff --git a/ros2_control_demo_bringup/launch/rrbot_base.launch.py b/ros2_control_demo_bringup/launch/rrbot_base.launch.py index b2ba994e8..f48ac3490 100644 --- a/ros2_control_demo_bringup/launch/rrbot_base.launch.py +++ b/ros2_control_demo_bringup/launch/rrbot_base.launch.py @@ -185,13 +185,8 @@ def generate_launch_description(): robot_controller_spawner = Node( package="controller_manager", -<<<<<<< HEAD - executable="spawner", - arguments=[robot_controller, "-c", "/controller_manager"], -======= executable="spawner.py", arguments=[robot_controller, "--controller-manager", "/controller_manager"], ->>>>>>> f43fa8a (Rename position_trajectory_controller to joint_trajectory_position_controller (#190)) ) # Delay rviz start after `joint_state_broadcaster`