Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr 190 merge resolved #207

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -618,20 +618,20 @@ 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:
```
ros2 control list_controllers
```
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:
```
Expand All @@ -643,9 +643,9 @@ Now you should also see the *RRbot* represented correctly in `RViz`.
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:
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_controller.launch.py
ros2 launch ros2_control_demo_bringup test_joint_trajectory_position_controller.launch.py
```
You can adjust the goals in [rrbot_joint_trajectory_publisher.yaml](ros2_control_demo_bringup/config/rrbot_joint_trajectory_publisher.yaml).

Expand Down
4 changes: 2 additions & 2 deletions ros2_control_demo_bringup/config/rrbot_controllers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -20,7 +20,7 @@ forward_position_controller:
interface_name: position


position_trajectory_controller:
joint_trajectory_position_controller:
ros__parameters:
joints:
- joint1
Expand Down
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions ros2_control_demo_bringup/launch/rrbot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def generate_launch_description():

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["forward_position_controller", "-c", "/controller_manager"],
executable="spawner.py",
arguments=["forward_position_controller", "--controller-manager", "/controller_manager"],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
4 changes: 2 additions & 2 deletions ros2_control_demo_bringup/launch/rrbot_base.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ def generate_launch_description():

robot_controller_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=[robot_controller, "-c", "/controller_manager"],
executable="spawner.py",
arguments=[robot_controller, "--controller-manager", "/controller_manager"],
)

# Delay rviz start after `joint_state_broadcaster`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should here switch to ros2_controllers_test_nodes from ros2_controllers repository. Can you do that, please?

name="publisher_joint_trajectory_position_controller",
parameters=[position_goals],
output="both",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions ros2_control_test_nodes/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
},
)