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

[Example 13] Multi-robot system with lifecycle management #417

Merged
merged 28 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2a7d273
Add description for r3bot
christophfroehlich Aug 1, 2024
50b0633
Remove camera links etc
christophfroehlich Aug 1, 2024
091d4c8
Initial commit for example_13 from old PRs
christophfroehlich Aug 1, 2024
b540670
Change MD to rst syntax
christophfroehlich Aug 1, 2024
eb7b6b8
Update test node syntax
christophfroehlich Aug 1, 2024
0b1f5d4
Fix test nodes launch file
christophfroehlich Aug 1, 2024
9785fd6
Enhance docs
christophfroehlich Aug 1, 2024
62c16ec
Fix wrench config
christophfroehlich Aug 1, 2024
bfc4f7d
Use global joint_state_broadcaster
christophfroehlich Aug 1, 2024
4e58940
Add tests
christophfroehlich Aug 1, 2024
5364a63
FIx links to files
christophfroehlich Aug 1, 2024
99fba03
Add some text
christophfroehlich Aug 1, 2024
e12c239
Fix dependencies
christophfroehlich Aug 1, 2024
3cda15b
Add example13 to workflows+packages
christophfroehlich Aug 1, 2024
c2da0d6
Apply suggestions from code review
christophfroehlich Aug 1, 2024
b0163ea
Update example_13/doc/userdoc.rst
christophfroehlich Aug 1, 2024
10d2a52
Fix rst syntax
christophfroehlich Aug 1, 2024
6af32f2
Use new ros2controlcli verb
christophfroehlich Aug 1, 2024
a949871
Add initial version for launch_test
christophfroehlich Aug 1, 2024
fe2d9b7
Add a more complete test
christophfroehlich Aug 2, 2024
c5f20f6
Fix whitespaces
christophfroehlich Aug 2, 2024
a92a398
Merge branch 'master' into 133_pr_rebase_again
saikishor Sep 2, 2024
964fe4e
Merge branch 'master' into 133_pr_rebase_again
christophfroehlich Sep 18, 2024
de06b12
Merge branch 'master' into 133_pr_rebase_again
christophfroehlich Oct 13, 2024
5ea70f9
Merge branch 'master' into 133_pr_rebase_again
christophfroehlich Oct 14, 2024
8db4f9a
Merge branch 'master' into 133_pr_rebase_again
saikishor Oct 30, 2024
015bd31
Fix decimal numbers
christophfroehlich Oct 31, 2024
18f39a5
Fix more decimal numbers
christophfroehlich Oct 31, 2024
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ The following examples are part of this demo repository:

The example shows a simple chainable controller and its integration to form a controller chain to control the joints of *RRBot*.

* Example 13: "Multi-robot example (tba.)"
* Example 13: ["Multi-robot system with hardware lifecycle management"](example_13)

This example shows how to handle multiple robots in a single controller manager instance.

* Example 14: ["Modular robots with actuators not providing states and with additional sensors"](example_14)

Expand Down
4 changes: 3 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ Example 11: "CarlikeBot"
Example 12: "Controller chaining"
The example shows a simple chainable controller and its integration to form a controller chain to control the joints of *RRBot*.

Example 13: "Multi-robot example (tba.)"
Example 13: "Multi-robot system with hardware lifecycle management"
This example shows how to handle multiple robots in a single controller manager instance.

Example 14: "Modular robots with actuators not providing states and with additional sensors"
The example shows how to implement robot hardware with actuators not providing states and with additional sensors.
Expand Down Expand Up @@ -276,5 +277,6 @@ Examples
Example 10: Industrial robot with GPIO interfaces <../example_10/doc/userdoc.rst>
Example 11: CarlikeBot <../example_11/doc/userdoc.rst>
Example 12: Controller chaining <../example_12/doc/userdoc.rst>
Example 13: Multiple robots <../example_13/doc/userdoc.rst>
Example 14: Modular robots with actuators not providing states <../example_14/doc/userdoc.rst>
Example 15: Using multiple controller managers <../example_15/doc/userdoc.rst>
38 changes: 38 additions & 0 deletions example_13/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.16)
project(ros2_control_demo_example_13 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/ros2_control description/urdf description/rviz
DESTINATION share/ros2_control_demo_example_13
)
install(
DIRECTORY bringup/launch bringup/config
DESTINATION share/ros2_control_demo_example_13
)

if(BUILD_TESTING)
find_package(ament_cmake_pytest REQUIRED)

ament_add_pytest_test(example_13_urdf_xacro test/test_urdf_xacro.py)
ament_add_pytest_test(view_example_13_launch test/test_view_robot_launch.py)
ament_add_pytest_test(run_example_13_launch test/test_three_robots_launch.py)
endif()

## EXPORTS
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()
5 changes: 5 additions & 0 deletions example_13/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ros2_control_demo_example_13

This example shows how to handle multiple robots in a single controller manager instance.

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_13/doc/userdoc.html).
125 changes: 125 additions & 0 deletions example_13/bringup/config/three_robots_controllers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
controller_manager:
ros__parameters:
update_rate: 100 # Hz

hardware_components_initial_state:
unconfigured:
# Decide which hardware component will be only loaded
- FakeThreeDofBot
inactive:
# Decide which hardware component will start configured
- RRBotSystemWithSensor
# not listed hardware component should be started immediately

# Global controllers
joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

# RRBot controllers
rrbot_joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

rrbot_position_controller:
type: forward_command_controller/ForwardCommandController

rrbot_external_fts_broadcaster:
type: force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster

# RRBot with sensor controllers
rrbot_with_sensor_joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

rrbot_with_sensor_position_controller:
type: forward_command_controller/ForwardCommandController

rrbot_with_sensor_fts_broadcaster:
type: force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster

# ThreeDofBot controllers
threedofbot_joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

threedofbot_position_controller:
type: forward_command_controller/ForwardCommandController

threedofbot_pid_gain_controller:
type: forward_command_controller/ForwardCommandController

# global joint_state_broadcaster
# joint_state_broadcaster:
# ros__parameters:
# nothing to configure
saikishor marked this conversation as resolved.
Show resolved Hide resolved

# RRBot controllers
rrbot_joint_state_broadcaster:
ros__parameters:
use_local_topics: True
joints:
- rrbot_joint1
- rrbot_joint2
interfaces:
- position

rrbot_position_controller:
ros__parameters:
joints:
- rrbot_joint1
- rrbot_joint2
interface_name: position

rrbot_external_fts_broadcaster:
ros__parameters:
sensor_name: rrbot_tcp_fts_sensor
frame_id: rrbot_tool_link


# RRBot with sensor controllers
rrbot_with_sensor_joint_state_broadcaster:
ros__parameters:
use_local_topics: True
joints:
- rrbot_with_sensor_joint1
- rrbot_with_sensor_joint2
interfaces:
- position

rrbot_with_sensor_position_controller:
ros__parameters:
joints:
- rrbot_with_sensor_joint1
- rrbot_with_sensor_joint2
interface_name: position

rrbot_with_sensor_fts_broadcaster:
ros__parameters:
interface_names.force.x: rrbot_with_sensor_tcp_fts_sensor/force.x
interface_names.torque.z: rrbot_with_sensor_tcp_fts_sensor/torque.z
frame_id: rrbot_with_sensor_tool_link

# ThreeDofBot controllers
threedofbot_joint_state_broadcaster:
ros__parameters:
use_local_topics: True
joints:
- threedofbot_joint1
- threedofbot_joint2
- threedofbot_joint3
interfaces:
- position
- pid_gain

threedofbot_position_controller:
ros__parameters:
joints:
- threedofbot_joint1
- threedofbot_joint2
- threedofbot_joint3
interface_name: position

threedofbot_pid_gain_controller:
ros__parameters:
joints:
- threedofbot_joint1
- threedofbot_joint2
- threedofbot_joint3
interface_name: pid_gain
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
rrbot_position_command_publisher:
ros__parameters:

publish_topic: "/rrbot_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_with_sensor_position_command_publisher:
ros__parameters:

publish_topic: "/rrbot_with_sensor_position_controller/commands"
wait_sec_between_publish: 4

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]


threedofbot_position_command_publisher:
ros__parameters:

publish_topic: "/threedofbot_position_controller/commands"
wait_sec_between_publish: 3

goal_names: ["pos1", "pos2", "pos3", "pos4"]
pos1: [0.785, 0.785, 0.785]
pos2: [0.0, 0.0, 0.0]
pos3: [-0.785, -0.785, -0.785]
pos4: [0.0, 0.0, 0.0]
Loading
Loading