forked from ros-controls/ros2_control_demos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Example 15] Using multiple controller managers under different names…
…paces (ros-controls#423) * Add example15 to workflows+packages * Initial commit from old PR Co-authored-by: Denis Štogl <[email protected]> * Convert md to rst syntax * Apply suggestions from code review Co-authored-by: Sai Kishor Kothakota <[email protected]> --------- Co-authored-by: Denis Štogl <[email protected]> Co-authored-by: Sai Kishor Kothakota <[email protected]>
- Loading branch information
1 parent
6a847e6
commit a97760f
Showing
27 changed files
with
1,838 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
project(ros2_control_demo_example_15 LANGUAGES CXX) | ||
|
||
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") | ||
add_compile_options(-Wall -Wextra) | ||
endif() | ||
|
||
# find dependencies | ||
set(THIS_PACKAGE_INCLUDE_DEPENDS | ||
) | ||
|
||
# find dependencies | ||
find_package(ament_cmake REQUIRED) | ||
foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS}) | ||
find_package(${Dependency} REQUIRED) | ||
endforeach() | ||
|
||
# INSTALL | ||
install( | ||
DIRECTORY description/rviz | ||
DESTINATION share/ros2_control_demo_example_15 | ||
) | ||
install( | ||
DIRECTORY bringup/launch bringup/config | ||
DESTINATION share/ros2_control_demo_example_15 | ||
) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_cmake_gtest REQUIRED) | ||
find_package(ament_cmake_pytest REQUIRED) | ||
|
||
ament_add_pytest_test(test_rrbot_namespace_launch test/test_rrbot_namespace_launch.py) | ||
ament_add_pytest_test(test_multi_controller_manager_launch test/test_multi_controller_manager_launch.py) | ||
|
||
endif() | ||
|
||
## EXPORTS | ||
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS}) | ||
ament_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# ros2_control_demo_example_15 | ||
|
||
This example shows how to integrate multiple robots under different controller manager instances. | ||
|
||
Find the documentation in [doc/userdoc.rst](doc/userdoc.rst) or on [control.ros.org](https://control.ros.org/master/doc/ros2_control_demos/example_15/doc/userdoc.html). |
25 changes: 25 additions & 0 deletions
25
example_15/bringup/config/multi_controller_manager_forward_position_publisher.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/rrbot_1/publisher_forward_position_controller: | ||
ros__parameters: | ||
|
||
|
||
publish_topic: "forward_position_controller/commands" | ||
wait_sec_between_publish: 5 | ||
|
||
goal_names: ["pos1", "pos2", "pos3", "pos4"] | ||
pos1: [0.785, 0.785] | ||
pos2: [0.0, 0.0] | ||
pos3: [-0.785, -0.785] | ||
pos4: [0.0, 0.0] | ||
|
||
|
||
/rrbot_2/publisher_forward_position_controller: | ||
ros__parameters: | ||
|
||
publish_topic: "forward_position_controller/commands" | ||
wait_sec_between_publish: 5 | ||
|
||
goal_names: ["pos1", "pos2", "pos3", "pos4"] | ||
pos1: [-0.785, 0.0] | ||
pos2: [0.0, -0.785] | ||
pos3: [+0.785, -1.57] | ||
pos4: [+1.57, -0.785] |
50 changes: 50 additions & 0 deletions
50
example_15/bringup/config/multi_controller_manager_joint_trajectory_publisher.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/rrbot_1/publisher_joint_trajectory_controller: | ||
ros__parameters: | ||
|
||
controller_name: "rrbot_1/position_trajectory_controller" | ||
wait_sec_between_publish: 6 | ||
|
||
goal_names: ["pos1", "pos2", "pos3", "pos4"] | ||
pos1: | ||
positions: [0.785, 0.785] | ||
pos2: | ||
positions: [0.0, 0.0] | ||
pos3: | ||
positions: [-0.785, -0.785] | ||
pos4: | ||
positions: [0.0, 0.0] | ||
|
||
joints: | ||
- rrbot_1_joint1 | ||
- rrbot_1_joint2 | ||
|
||
check_starting_point: false | ||
starting_point_limits: | ||
joint1: [-0.1,0.1] | ||
joint2: [-0.1,0.1] | ||
|
||
|
||
/rrbot_2/publisher_joint_trajectory_controller: | ||
ros__parameters: | ||
|
||
controller_name: "rrbot_2/position_trajectory_controller" | ||
wait_sec_between_publish: 6 | ||
|
||
goal_names: ["pos1", "pos2", "pos3", "pos4"] | ||
pos1: | ||
positions: [-0.785, 0.0] | ||
pos2: | ||
positions: [0.0, -0.785] | ||
pos3: | ||
positions: [+0.785, -1.57] | ||
pos4: | ||
positions: [+1.57, -0.785] | ||
|
||
joints: | ||
- rrbot_2_joint1 | ||
- rrbot_2_joint2 | ||
|
||
check_starting_point: false | ||
starting_point_limits: | ||
joint1: [-0.1,0.1] | ||
joint2: [-0.1,0.1] |
43 changes: 43 additions & 0 deletions
43
example_15/bringup/config/multi_controller_manager_rrbot_1_controllers.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/rrbot_1/controller_manager: | ||
ros__parameters: | ||
update_rate: 10 # Hz | ||
|
||
joint_state_broadcaster: | ||
type: joint_state_broadcaster/JointStateBroadcaster | ||
|
||
forward_position_controller: | ||
type: forward_command_controller/ForwardCommandController | ||
|
||
position_trajectory_controller: | ||
type: joint_trajectory_controller/JointTrajectoryController | ||
|
||
|
||
/rrbot_1/forward_position_controller: | ||
ros__parameters: | ||
joints: | ||
- rrbot_1_joint1 | ||
- rrbot_1_joint2 | ||
interface_name: position | ||
|
||
|
||
/rrbot_1/position_trajectory_controller: | ||
ros__parameters: | ||
joints: | ||
- rrbot_1_joint1 | ||
- rrbot_1_joint2 | ||
|
||
command_interfaces: | ||
- position | ||
|
||
state_interfaces: | ||
- position | ||
|
||
state_publish_rate: 200.0 # Defaults to 50 | ||
action_monitor_rate: 20.0 # Defaults to 20 | ||
|
||
allow_partial_joints_goal: false # Defaults to false | ||
open_loop_control: true | ||
allow_integration_in_goal_trajectories: true | ||
constraints: | ||
stopped_velocity_tolerance: 0.01 # Defaults to 0.01 | ||
goal_time: 0.0 # Defaults to 0.0 (start immediately) |
43 changes: 43 additions & 0 deletions
43
example_15/bringup/config/multi_controller_manager_rrbot_2_controllers.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/rrbot_2/controller_manager: | ||
ros__parameters: | ||
update_rate: 10 # Hz | ||
|
||
joint_state_broadcaster: | ||
type: joint_state_broadcaster/JointStateBroadcaster | ||
|
||
forward_position_controller: | ||
type: forward_command_controller/ForwardCommandController | ||
|
||
position_trajectory_controller: | ||
type: joint_trajectory_controller/JointTrajectoryController | ||
|
||
|
||
/rrbot_2/forward_position_controller: | ||
ros__parameters: | ||
joints: | ||
- rrbot_2_joint1 | ||
- rrbot_2_joint2 | ||
interface_name: position | ||
|
||
|
||
/rrbot_2/position_trajectory_controller: | ||
ros__parameters: | ||
joints: | ||
- rrbot_2_joint1 | ||
- rrbot_2_joint2 | ||
|
||
command_interfaces: | ||
- position | ||
|
||
state_interfaces: | ||
- position | ||
|
||
state_publish_rate: 200.0 # Defaults to 50 | ||
action_monitor_rate: 20.0 # Defaults to 20 | ||
|
||
allow_partial_joints_goal: false # Defaults to false | ||
open_loop_control: true | ||
allow_integration_in_goal_trajectories: true | ||
constraints: | ||
stopped_velocity_tolerance: 0.01 # Defaults to 0.01 | ||
goal_time: 0.0 # Defaults to 0.0 (start immediately) |
43 changes: 43 additions & 0 deletions
43
example_15/bringup/config/rrbot_namespace_controllers.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/rrbot/controller_manager: | ||
ros__parameters: | ||
update_rate: 10 # Hz | ||
|
||
joint_state_broadcaster: | ||
type: joint_state_broadcaster/JointStateBroadcaster | ||
|
||
forward_position_controller: | ||
type: forward_command_controller/ForwardCommandController | ||
|
||
position_trajectory_controller: | ||
type: joint_trajectory_controller/JointTrajectoryController | ||
|
||
|
||
/rrbot/forward_position_controller: | ||
ros__parameters: | ||
joints: | ||
- joint1 | ||
- joint2 | ||
interface_name: position | ||
|
||
|
||
/rrbot/position_trajectory_controller: | ||
ros__parameters: | ||
joints: | ||
- joint1 | ||
- joint2 | ||
|
||
command_interfaces: | ||
- position | ||
|
||
state_interfaces: | ||
- position | ||
|
||
state_publish_rate: 200.0 # Defaults to 50 | ||
action_monitor_rate: 20.0 # Defaults to 20 | ||
|
||
allow_partial_joints_goal: false # Defaults to false | ||
open_loop_control: true | ||
allow_integration_in_goal_trajectories: true | ||
constraints: | ||
stopped_velocity_tolerance: 0.01 # Defaults to 0.01 | ||
goal_time: 0.0 # Defaults to 0.0 (start immediately) |
12 changes: 12 additions & 0 deletions
12
example_15/bringup/config/rrbot_namespace_forward_position_publisher.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
publisher_forward_position_controller: | ||
ros__parameters: | ||
|
||
wait_sec_between_publish: 5 | ||
|
||
publish_topic: /rrbot/forward_position_controller/commands | ||
|
||
goal_names: ["pos1", "pos2", "pos3", "pos4"] | ||
pos1: [0.785, 0.785] | ||
pos2: [0, 0] | ||
pos3: [-0.785, -0.785] | ||
pos4: [0, 0] |
24 changes: 24 additions & 0 deletions
24
example_15/bringup/config/rrbot_namespace_joint_trajectory_publisher.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
publisher_joint_trajectory_controller: | ||
ros__parameters: | ||
|
||
controller_name: "rrbot/position_trajectory_controller" | ||
wait_sec_between_publish: 6 | ||
|
||
goal_names: ["pos1", "pos2", "pos3", "pos4"] | ||
pos1: | ||
positions: [0.785, 0.785] | ||
pos2: | ||
positions: [0.0, 0.0] | ||
pos3: | ||
positions: [-0.785, -0.785] | ||
pos4: | ||
positions: [0.0, 0.0] | ||
|
||
joints: | ||
- joint1 | ||
- joint2 | ||
|
||
check_starting_point: false | ||
starting_point_limits: | ||
joint1: [-0.1,0.1] | ||
joint2: [-0.1,0.1] |
Oops, something went wrong.