Skip to content

Commit 6b76ca0

Browse files
mergify[bot]haider8645christophfroehlich
authored
Rename position_trajectory_controller to joint_trajectory_controller (backport #190) (#198)
* Rename position_trajectory_controller to joint_trajectory_position_controller (#190) (cherry picked from commit f43fa8a) # Conflicts: # README.md # ros2_control_demo_bringup/launch/rrbot.launch.py # ros2_control_demo_bringup/launch/rrbot_base.launch.py * Revert "Rename position_trajectory_controller to joint_trajectory_position_controller (#190)" This reverts commit 4225581. * Use full "--controller-manager" as script argument * Remove JTC from example_8 * Rename position_trajectory_controller to joint_trajectory_position_controller --------- Co-authored-by: Haider Lodhi <[email protected]> Co-authored-by: Christoph Froehlich <[email protected]>
1 parent d4c2323 commit 6b76ca0

File tree

11 files changed

+21
-47
lines changed

11 files changed

+21
-47
lines changed

example_1/bringup/config/rrbot_controllers.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ controller_manager:
88
forward_position_controller:
99
type: forward_command_controller/ForwardCommandController
1010

11-
position_trajectory_controller:
11+
joint_trajectory_position_controller:
1212
type: joint_trajectory_controller/JointTrajectoryController
1313

1414

@@ -20,7 +20,7 @@ forward_position_controller:
2020
interface_name: position
2121

2222

23-
position_trajectory_controller:
23+
joint_trajectory_position_controller:
2424
ros__parameters:
2525
joints:
2626
- joint1

example_1/bringup/config/rrbot_joint_trajectory_publisher.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
publisher_joint_trajectory_controller:
22
ros__parameters:
33

4-
controller_name: "position_trajectory_controller"
4+
controller_name: "joint_trajectory_position_controller"
55
wait_sec_between_publish: 6
66

77
goal_names: ["pos1", "pos2", "pos3", "pos4"]

example_1/bringup/launch/rrbot.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def generate_launch_description():
7979
robot_controller_spawner = Node(
8080
package="controller_manager",
8181
executable="spawner",
82-
arguments=["forward_position_controller", "-c", "/controller_manager"],
82+
arguments=["forward_position_controller", "--controller-manager", "/controller_manager"],
8383
)
8484

8585
# Delay rviz start after `joint_state_broadcaster`

example_1/doc/userdoc.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ The *RRBot* URDF files can be found in the ``description/urdf`` folder.
112112

113113
.. code-block:: shell
114114
115-
ros2 control load_controller position_trajectory_controller
115+
ros2 control load_controller joint_trajectory_position_controller
116116
117-
what should return ``Successfully loaded controller position_trajectory_controller``. Check the status
117+
what should return ``Successfully loaded controller joint_trajectory_position_controller``. Check the status
118118

119119
.. code-block:: shell
120120
@@ -126,15 +126,15 @@ The *RRBot* URDF files can be found in the ``description/urdf`` folder.
126126
127127
joint_state_broadcaster[joint_state_broadcaster/JointStateBroadcaster] active
128128
forward_position_controller[forward_command_controller/ForwardCommandController] active
129-
position_trajectory_controller[joint_trajectory_controller/JointTrajectoryController] unconfigured
129+
joint_trajectory_position_controller[joint_trajectory_controller/JointTrajectoryController] unconfigured
130130
131131
Configure the controller by setting it ``inactive`` by
132132

133133
.. code-block:: shell
134134
135-
ros2 control set_controller_state position_trajectory_controller inactive
135+
ros2 control set_controller_state joint_trajectory_position_controller inactive
136136
137-
what should give ``Successfully configured position_trajectory_controller``.
137+
what should give ``Successfully configured joint_trajectory_position_controller``.
138138

139139
.. note::
140140

@@ -145,9 +145,9 @@ The *RRBot* URDF files can be found in the ``description/urdf`` folder.
145145

146146
.. code-block:: shell
147147
148-
ros2 control load_controller position_trajectory_controller --set-state inactive
148+
ros2 control load_controller joint_trajectory_position_controller --set-state inactive
149149
150-
You should get the result ``Successfully loaded controller position_trajectory_controller into state inactive``.
150+
You should get the result ``Successfully loaded controller joint_trajectory_position_controller into state inactive``.
151151

152152
See if it loaded properly with
153153

@@ -161,20 +161,20 @@ The *RRBot* URDF files can be found in the ``description/urdf`` folder.
161161
162162
joint_state_broadcaster[joint_state_broadcaster/JointStateBroadcaster] active
163163
forward_position_controller[forward_command_controller/ForwardCommandController] active
164-
position_trajectory_controller[joint_trajectory_controller/JointTrajectoryController] inactive
164+
joint_trajectory_position_controller[joint_trajectory_controller/JointTrajectoryController] inactive
165165
166166
Note that the controller is loaded but still ``inactive``. Now you can switch the controller by
167167

168168
.. code-block:: shell
169169
170170
ros2 control set_controller_state forward_position_controller inactive
171-
ros2 control set_controller_state position_trajectory_controller active
171+
ros2 control set_controller_state joint_trajectory_position_controller active
172172
173173
or simply via this one-line command
174174

175175
.. code-block:: shell
176176
177-
ros2 control switch_controllers --activate position_trajectory_controller --deactivate forward_position_controller
177+
ros2 control switch_controllers --activate joint_trajectory_position_controller --deactivate forward_position_controller
178178
179179
Again, check via
180180

@@ -188,7 +188,7 @@ The *RRBot* URDF files can be found in the ``description/urdf`` folder.
188188
189189
joint_state_broadcaster[joint_state_broadcaster/JointStateBroadcaster] active
190190
forward_position_controller[forward_command_controller/ForwardCommandController] inactive
191-
position_trajectory_controller[joint_trajectory_controller/JointTrajectoryController] active
191+
joint_trajectory_position_controller[joint_trajectory_controller/JointTrajectoryController] active
192192
193193
Send a command to the controller using demo node, which sends four goals every 6 seconds in a loop:
194194

example_2/bringup/launch/diffbot.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def generate_launch_description():
7777
robot_controller_spawner = Node(
7878
package="controller_manager",
7979
executable="spawner",
80-
arguments=["diffbot_base_controller", "-c", "/controller_manager"],
80+
arguments=["diffbot_base_controller", "--controller-manager", "/controller_manager"],
8181
)
8282

8383
# Delay rviz start after `joint_state_broadcaster`

example_3/bringup/launch/rrbot_base.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def generate_launch_description():
175175
robot_controller_spawner = Node(
176176
package="controller_manager",
177177
executable="spawner",
178-
arguments=[robot_controller, "-c", "/controller_manager"],
178+
arguments=[robot_controller, "--controller-manager", "/controller_manager"],
179179
)
180180

181181
# Delay rviz start after `joint_state_broadcaster`

example_4/bringup/launch/rrbot_base.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def generate_launch_description():
175175
robot_controller_spawner = Node(
176176
package="controller_manager",
177177
executable="spawner",
178-
arguments=[robot_controller, "-c", "/controller_manager"],
178+
arguments=[robot_controller, "--controller-manager", "/controller_manager"],
179179
)
180180

181181
# Delay rviz start after `joint_state_broadcaster`

example_5/bringup/launch/rrbot_base.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def generate_launch_description():
175175
robot_controller_spawner = Node(
176176
package="controller_manager",
177177
executable="spawner",
178-
arguments=[robot_controller, "-c", "/controller_manager"],
178+
arguments=[robot_controller, "--controller-manager", "/controller_manager"],
179179
)
180180

181181
# Delay rviz start after `joint_state_broadcaster`

example_6/bringup/launch/rrbot_base.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def generate_launch_description():
175175
robot_controller_spawner = Node(
176176
package="controller_manager",
177177
executable="spawner",
178-
arguments=[robot_controller, "-c", "/controller_manager"],
178+
arguments=[robot_controller, "--controller-manager", "/controller_manager"],
179179
)
180180

181181
# Delay rviz start after `joint_state_broadcaster`

example_8/bringup/config/rrbot_controllers.yaml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,10 @@ controller_manager:
88
forward_position_controller:
99
type: forward_command_controller/ForwardCommandController
1010

11-
position_trajectory_controller:
12-
type: joint_trajectory_controller/JointTrajectoryController
13-
1411

1512
forward_position_controller:
1613
ros__parameters:
1714
joints:
1815
- joint1
1916
- joint2
2017
interface_name: position
21-
22-
23-
position_trajectory_controller:
24-
ros__parameters:
25-
joints:
26-
- joint1
27-
- joint2
28-
29-
command_interfaces:
30-
- position
31-
32-
state_interfaces:
33-
- position
34-
35-
state_publish_rate: 200.0 # Defaults to 50
36-
action_monitor_rate: 20.0 # Defaults to 20
37-
38-
allow_partial_joints_goal: false # Defaults to false
39-
open_loop_control: true
40-
allow_integration_in_goal_trajectories: true
41-
constraints:
42-
stopped_velocity_tolerance: 0.01 # Defaults to 0.01
43-
goal_time: 0.0 # Defaults to 0.0 (start immediately)

0 commit comments

Comments
 (0)