Package Summary
Tags | No category tags. |
Version | 0.20.5 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | humble |
Last Updated | 2025-05-08 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Audrow Nash
- Michael Jeronimo
Authors
- Dirk Thomas
- Mabel Zhang
What Is This?
This demo provides examples of three different ways to use the rclcpp_components API to compose multiple nodes in a single process.
This ROS 2 package consists of the following demo applications:
dlopen_composition
linktime_composition
manual_composition
Build
Run the commands below to build the ROS 2 package:
colcon build --packages-up-to composition
Run
Manual Composition
Running manual_composition
compiles an executable that runs the following 4 components:
- Talker: A ROS 2 component that publishes a string
- Listener: A ROS 2 component that prints the received string from Talker
- Server: A ROS 2 component that adds two integers and outputs its result to Client
- Client: A ROS 2 component that sends two integers to Server and prints the received result from Server
ros2 run composition manual_composition
DlOpen Composition
This runs dlopen_composition
which is an alternative to run-time composition by creating a generic container process and explicitly passing the libraries to load without using ROS interfaces.
The process will open each library and create one instance of each “rclcpp::Node” class in the library.
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
Linktime Composition
Similar to previous, this runs linktime_composition
which links all classes from libraries that are registered under the library_path with the linker.
ros2 run composition linktime_composition
Composition Using Launch Actions
Rather than using the command line tool to run each composition, we can automate this action with ros2 launch
functionality:
ros2 launch composition composition_demo.launch.py
Verify
Manual Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
[INFO] [1674528188.026468320] [talker]: Publishing: 'Hello World: 1'
[INFO] [1674528188.027043857] [listener]: I heard: [Hello World: 1]
[INFO] [1674528189.026414368] [talker]: Publishing: 'Hello World: 2'
[INFO] [1674528189.026742015] [listener]: I heard: [Hello World: 2]
[INFO] [1674528189.032512995] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528189.032815843] [Client]: Got result: [5]
[INFO] [1674528190.026455807] [talker]: Publishing: 'Hello World: 3'
[INFO] [1674528190.026795770] [listener]: I heard: [Hello World: 3]
[INFO] [1674528191.026457639] [talker]: Publishing: 'Hello World: 4'
[INFO] [1674528191.026801926] [listener]: I heard: [Hello World: 4]
[INFO] [1674528191.032377264] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528191.032604427] [Client]: Got result: [5]
[INFO] [1674528192.026428269] [talker]: Publishing: 'Hello World: 5'
[INFO] [1674528192.026537974] [listener]: I heard: [Hello World: 5]
[INFO] [1674528193.026437034] [talker]: Publishing: 'Hello World: 6'
[INFO] [1674528193.026767708] [listener]: I heard: [Hello World: 6]
[INFO] [1674528193.032377748] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528193.032603036] [Client]: Got result: [5]
#...
:warning:
Note that manually-composed components will not be reflected in the
ros2 component list
command line tool output.
DlOpen Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
```bash INFO] [1674529118.496557668] [dlopen_composition]: Load library /opt/ros/humble/lib/libtalker_component.so [INFO] [1674529118.496774575] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Talker> [INFO] [1674529118.503388909] [dlopen_composition]: Load library /opt/ros/humble/lib/liblistener_component.so [INFO] [1674529118.503739855] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Listener> [INFO] [1674529119.503505873] [talker]: Publishing: ‘Hello World: 1’
File truncated at 100 lines see the full file
Changelog for package composition
0.20.5 (2024-07-26)
0.20.4 (2024-05-15)
- [composition] add launch action console output in the verify section (#677) (#682)
- Contributors: mergify[bot]
0.20.3 (2023-01-10)
0.20.2 (2022-05-10)
0.20.1 (2022-04-08)
0.20.0 (2022-03-01)
0.19.0 (2022-01-14)
0.18.0 (2021-12-17)
- Update maintainers to Audrow Nash and Michael Jeronimo (#543)
- Additional fixes for documentation in demos. (#538)
- Contributors: Audrow Nash, Chris Lalancette
0.17.0 (2021-10-18)
- Fixing deprecated subscriber callback warnings (#532)
- Contributors: Abrar Rahman Protyasha
0.16.0 (2021-08-11)
0.15.0 (2021-05-14)
0.14.2 (2021-04-26)
0.14.1 (2021-04-19)
0.14.0 (2021-04-06)
0.13.0 (2021-03-25)
0.12.1 (2021-03-18)
0.12.0 (2021-01-25)
0.11.0 (2020-12-10)
- Update the package.xml files with the latest Open Robotics maintainers (#466)
- Contributors: Michael Jeronimo
0.10.1 (2020-09-21)
0.10.0 (2020-06-17)
0.9.3 (2020-06-01)
0.9.2 (2020-05-26)
0.9.1 (2020-05-12)
0.9.0 (2020-04-30)
- Replace deprecated launch_ros usage (#437)
- Update launch_ros action usage (#431)
- code style only: wrap after open parenthesis if not in one line (#429)
- Contributors: Dirk Thomas, Jacob Perron
0.8.4 (2019-11-19)
0.8.3 (2019-11-11)
0.8.2 (2019-11-08)
0.8.1 (2019-10-23)
- Replace ready_fn with ReadyToTest action (#404)
- Contributors: Peter Baughman
0.8.0 (2019-09-26)
- Add an demo component not inherited from rclcpp::Node (#393)
- Contributors: Michael Carroll
0.7.6 (2019-05-30)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.33.5 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | jazzy |
Last Updated | 2025-05-08 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Aditya Pande
- Audrow Nash
Authors
- Dirk Thomas
- Mabel Zhang
What Is This?
This demo provides examples of three different ways to use the rclcpp_components API to compose multiple nodes in a single process.
This ROS 2 package consists of the following demo applications:
dlopen_composition
linktime_composition
manual_composition
Build
Run the commands below to build the ROS 2 package:
colcon build --packages-up-to composition
Run
Manual Composition
Running manual_composition
compiles an executable that runs the following 4 components:
- Talker: A ROS 2 component that publishes a string
- Listener: A ROS 2 component that prints the received string from Talker
- Server: A ROS 2 component that adds two integers and outputs its result to Client
- Client: A ROS 2 component that sends two integers to Server and prints the received result from Server
ros2 run composition manual_composition
DlOpen Composition
This runs dlopen_composition
which is an alternative to run-time composition by creating a generic container process and explicitly passing the libraries to load without using ROS interfaces.
The process will open each library and create one instance of each “rclcpp::Node” class in the library.
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
Linktime Composition
Similar to previous, this runs linktime_composition
which links all classes from libraries that are registered under the library_path with the linker.
ros2 run composition linktime_composition
Composition Using Launch Actions
Rather than using the command line tool to run each composition, we can automate this action with ros2 launch
functionality:
ros2 launch composition composition_demo_launch.py
Verify
Manual Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
[INFO] [1674528188.026468320] [talker]: Publishing: 'Hello World: 1'
[INFO] [1674528188.027043857] [listener]: I heard: [Hello World: 1]
[INFO] [1674528189.026414368] [talker]: Publishing: 'Hello World: 2'
[INFO] [1674528189.026742015] [listener]: I heard: [Hello World: 2]
[INFO] [1674528189.032512995] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528189.032815843] [Client]: Got result: [5]
[INFO] [1674528190.026455807] [talker]: Publishing: 'Hello World: 3'
[INFO] [1674528190.026795770] [listener]: I heard: [Hello World: 3]
[INFO] [1674528191.026457639] [talker]: Publishing: 'Hello World: 4'
[INFO] [1674528191.026801926] [listener]: I heard: [Hello World: 4]
[INFO] [1674528191.032377264] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528191.032604427] [Client]: Got result: [5]
[INFO] [1674528192.026428269] [talker]: Publishing: 'Hello World: 5'
[INFO] [1674528192.026537974] [listener]: I heard: [Hello World: 5]
[INFO] [1674528193.026437034] [talker]: Publishing: 'Hello World: 6'
[INFO] [1674528193.026767708] [listener]: I heard: [Hello World: 6]
[INFO] [1674528193.032377748] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528193.032603036] [Client]: Got result: [5]
#...
:warning:
Note that manually-composed components will not be reflected in the
ros2 component list
command line tool output.
DlOpen Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
```bash INFO] [1674529118.496557668] [dlopen_composition]: Load library /opt/ros/rolling/lib/libtalker_component.so [INFO] [1674529118.496774575] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Talker> [INFO] [1674529118.503388909] [dlopen_composition]: Load library /opt/ros/rolling/lib/liblistener_component.so [INFO] [1674529118.503739855] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Listener> [INFO] [1674529119.503505873] [talker]: Publishing: ‘Hello World: 1’
File truncated at 100 lines see the full file
Changelog for package composition
0.33.5 (2024-09-06)
0.33.4 (2024-06-27)
0.33.3 (2024-05-13)
- [composition] add launch action console output in the verify section (#677) (#681) (cherry picked from commit 34d29db73e78a84a174ad8699a2d646b0eeb1cdf) Co-authored-by: Mikael Arguedas <<mikael.arguedas@gmail.com>>
- Contributors: mergify[bot]
0.33.2 (2024-03-28)
- Update maintainer list in package.xml files (#665)
- Contributors: Michael Jeronimo
0.33.1 (2024-02-07)
0.33.0 (2024-01-24)
- Migrate std::bind calls to lambda expressions (#659)
- Contributors: Felipe Gomes de Melo
0.32.1 (2023-12-26)
0.32.0 (2023-11-06)
0.31.1 (2023-09-07)
0.31.0 (2023-08-21)
0.30.1 (2023-07-11)
0.30.0 (2023-06-12)
0.29.0 (2023-06-07)
0.28.1 (2023-05-11)
0.28.0 (2023-04-27)
0.27.0 (2023-04-13)
- Change all ROS2 -> ROS 2. (#610)
- Contributors: Chris Lalancette
0.26.0 (2023-04-11)
- update launch file name format to match documentation (#588)
- Contributors: Patrick Wspanialy
0.25.0 (2023-03-01)
0.24.1 (2023-02-24)
0.24.0 (2023-02-14)
- Added README.md for composition (#598)
- Update the demos to C++17. (#594)
- [rolling] Update maintainers - 2022-11-07 (#589)
- Contributors: Audrow Nash, Chris Lalancette, Gary Bey
0.23.0 (2022-11-02)
- fix memory leak (#585)
- Contributors: Chen Lihui
0.22.0 (2022-09-13)
0.21.0 (2022-04-29)
0.20.1 (2022-04-08)
0.20.0 (2022-03-01)
0.19.0 (2022-01-14)
0.18.0 (2021-12-17)
- Update maintainers to Audrow Nash and Michael Jeronimo (#543)
- Additional fixes for documentation in demos. (#538)
- Contributors: Audrow Nash, Chris Lalancette
0.17.0 (2021-10-18)
- Fixing deprecated subscriber callback warnings (#532)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.36.1 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | kilted |
Last Updated | 2025-06-23 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Aditya Pande
- Audrow Nash
Authors
- Dirk Thomas
- Mabel Zhang
What Is This?
This demo provides examples of three different ways to use the rclcpp_components API to compose multiple nodes in a single process.
This ROS 2 package consists of the following demo applications:
dlopen_composition
linktime_composition
manual_composition
Build
Run the commands below to build the ROS 2 package:
colcon build --packages-up-to composition
Run
Manual Composition
Running manual_composition
compiles an executable that runs the following 4 components:
- Talker: A ROS 2 component that publishes a string
- Listener: A ROS 2 component that prints the received string from Talker
- Server: A ROS 2 component that adds two integers and outputs its result to Client
- Client: A ROS 2 component that sends two integers to Server and prints the received result from Server
ros2 run composition manual_composition
DlOpen Composition
This runs dlopen_composition
which is an alternative to run-time composition by creating a generic container process and explicitly passing the libraries to load without using ROS interfaces.
First run the command to find the libraries prefix path.
ros2 pkg prefix composition
Then you can find the prefix path of the required shared libraries to load.
The process will open each library and create one instance of each “rclcpp::Node” class in the library.
ros2 run composition dlopen_composition <path_to_talker_component_shared_library> <path_to_listener_component_shared_library>
Linux
The libraries will be present in <prefix_path>/lib/
as lib*.so
files.
Run the following command to load the libraries.
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
Windows
On Windows, we will need the *.dll
files.
Since command substitution will not work on Windows, you have to give the absolute path of the libraries.
The libraries will be in <path_to_your_ros2_installation>\bin\
, so we have to run.
ros2 run composition dlopen_composition <prefix_path>\bin\talker_component.dll <prefix_path>\bin\listener_component.dll
To get the prefix_path
run
ros2 pkg prefix composition
For example if our prefix_path
comes out to be C:\pixi_ws\ros2-windows\
we will run
ros2 run composition dlopen_composition C:\pixi_ws\ros2-windows\bin\talker_component.dll C:\pixi_ws\ros2-windows\bin\listener_component.dll
Linktime Composition
Similar to previous, this runs linktime_composition
which links all classes from libraries that are registered under the library_path with the linker.
ros2 run composition linktime_composition
Composition Using Launch Actions
Rather than using the command line tool to run each composition, we can automate this action with ros2 launch
functionality:
ros2 launch composition composition_demo_launch.py
File truncated at 100 lines see the full file
Changelog for package composition
0.36.1 (2025-06-23)
- Use EnableRmwIsolation in launch tests (#724) (#725)
- correct name of shared libraries and their location (#722)
- Contributors: Aniket Kumar Roy, mergify[bot]
0.36.0 (2025-04-25)
- Uniform CMAKE min VERSION (#714)
- Set envars to run tests with rmw_zenoh_cpp with multicast discovery (#711)
- Use target_link_libraries instead of ament_target_dependencies (#707)
- Contributors: Alejandro Hernández Cordero, Shane Loretz, mosfet80
0.35.1 (2024-11-20)
0.35.0 (2024-10-03)
- Fix typo in composition comment (#703)
- Contributors: Christophe Bedard
0.34.2 (2024-07-29)
0.34.1 (2024-06-17)
- Change references from "jazzy" to "rolling" on the rolling branch. (#687)
- [composition] add launch action console output in the verify section (#677)
- Contributors: Chris Lalancette, Mikael Arguedas
0.34.0 (2024-04-26)
0.33.2 (2024-03-28)
- Update maintainer list in package.xml files (#665)
- Contributors: Michael Jeronimo
0.33.1 (2024-02-07)
0.33.0 (2024-01-24)
- Migrate std::bind calls to lambda expressions (#659)
- Contributors: Felipe Gomes de Melo
0.32.1 (2023-12-26)
0.32.0 (2023-11-06)
0.31.1 (2023-09-07)
0.31.0 (2023-08-21)
0.30.1 (2023-07-11)
0.30.0 (2023-06-12)
0.29.0 (2023-06-07)
0.28.1 (2023-05-11)
0.28.0 (2023-04-27)
0.27.0 (2023-04-13)
- Change all ROS2 -> ROS 2. (#610)
- Contributors: Chris Lalancette
0.26.0 (2023-04-11)
- update launch file name format to match documentation (#588)
- Contributors: Patrick Wspanialy
0.25.0 (2023-03-01)
0.24.1 (2023-02-24)
0.24.0 (2023-02-14)
- Added README.md for composition (#598)
- Update the demos to C++17. (#594)
- [rolling] Update maintainers - 2022-11-07 (#589)
- Contributors: Audrow Nash, Chris Lalancette, Gary Bey
0.23.0 (2022-11-02)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.37.1 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | rolling |
Last Updated | 2025-06-23 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Aditya Pande
- Audrow Nash
Authors
- Dirk Thomas
- Mabel Zhang
What Is This?
This demo provides examples of three different ways to use the rclcpp_components API to compose multiple nodes in a single process.
This ROS 2 package consists of the following demo applications:
dlopen_composition
linktime_composition
manual_composition
Build
Run the commands below to build the ROS 2 package:
colcon build --packages-up-to composition
Run
Manual Composition
Running manual_composition
compiles an executable that runs the following 4 components:
- Talker: A ROS 2 component that publishes a string
- Listener: A ROS 2 component that prints the received string from Talker
- Server: A ROS 2 component that adds two integers and outputs its result to Client
- Client: A ROS 2 component that sends two integers to Server and prints the received result from Server
ros2 run composition manual_composition
DlOpen Composition
This runs dlopen_composition
which is an alternative to run-time composition by creating a generic container process and explicitly passing the libraries to load without using ROS interfaces.
First run the command to find the libraries prefix path.
ros2 pkg prefix composition
Then you can find the prefix path of the required shared libraries to load.
The process will open each library and create one instance of each “rclcpp::Node” class in the library.
ros2 run composition dlopen_composition <path_to_talker_component_shared_library> <path_to_listener_component_shared_library>
Linux
The libraries will be present in <prefix_path>/lib/
as lib*.so
files.
Run the following command to load the libraries.
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
Windows
On Windows, we will need the *.dll
files.
Since command substitution will not work on Windows, you have to give the absolute path of the libraries.
The libraries will be in <path_to_your_ros2_installation>\bin\
, so we have to run.
ros2 run composition dlopen_composition <prefix_path>\bin\talker_component.dll <prefix_path>\bin\listener_component.dll
To get the prefix_path
run
ros2 pkg prefix composition
For example if our prefix_path
comes out to be C:\pixi_ws\ros2-windows\
we will run
ros2 run composition dlopen_composition C:\pixi_ws\ros2-windows\bin\talker_component.dll C:\pixi_ws\ros2-windows\bin\listener_component.dll
Linktime Composition
Similar to previous, this runs linktime_composition
which links all classes from libraries that are registered under the library_path with the linker.
ros2 run composition linktime_composition
Composition Using Launch Actions
Rather than using the command line tool to run each composition, we can automate this action with ros2 launch
functionality:
ros2 launch composition composition_demo_launch.py
File truncated at 100 lines see the full file
Changelog for package composition
0.37.1 (2025-06-23)
- correct name of shared libraries and their location (#722) (#726)
- Use EnableRmwIsolation in launch tests (#724)
- Contributors: Scott K Logan, mergify[bot]
0.37.0 (2025-04-25)
0.36.0 (2025-04-25)
- Uniform CMAKE min VERSION (#714)
- Set envars to run tests with rmw_zenoh_cpp with multicast discovery (#711)
- Use target_link_libraries instead of ament_target_dependencies (#707)
- Contributors: Alejandro Hernández Cordero, Shane Loretz, mosfet80
0.35.1 (2024-11-20)
0.35.0 (2024-10-03)
- Fix typo in composition comment (#703)
- Contributors: Christophe Bedard
0.34.2 (2024-07-29)
0.34.1 (2024-06-17)
- Change references from "jazzy" to "rolling" on the rolling branch. (#687)
- [composition] add launch action console output in the verify section (#677)
- Contributors: Chris Lalancette, Mikael Arguedas
0.34.0 (2024-04-26)
0.33.2 (2024-03-28)
- Update maintainer list in package.xml files (#665)
- Contributors: Michael Jeronimo
0.33.1 (2024-02-07)
0.33.0 (2024-01-24)
- Migrate std::bind calls to lambda expressions (#659)
- Contributors: Felipe Gomes de Melo
0.32.1 (2023-12-26)
0.32.0 (2023-11-06)
0.31.1 (2023-09-07)
0.31.0 (2023-08-21)
0.30.1 (2023-07-11)
0.30.0 (2023-06-12)
0.29.0 (2023-06-07)
0.28.1 (2023-05-11)
0.28.0 (2023-04-27)
0.27.0 (2023-04-13)
- Change all ROS2 -> ROS 2. (#610)
- Contributors: Chris Lalancette
0.26.0 (2023-04-11)
- update launch file name format to match documentation (#588)
- Contributors: Patrick Wspanialy
0.25.0 (2023-03-01)
0.24.1 (2023-02-24)
0.24.0 (2023-02-14)
- Added README.md for composition (#598)
- Update the demos to C++17. (#594)
- [rolling] Update maintainers - 2022-11-07 (#589)
- Contributors: Audrow Nash, Chris Lalancette, Gary Bey
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
![]() |
composition package from demos repocomposition demo_nodes_cpp demo_nodes_cpp_native demo_nodes_py dummy_map_server dummy_robot_bringup dummy_sensors image_tools intra_process_demo lifecycle logging_demo pendulum_control pendulum_msgs topic_monitor |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.4.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | ardent |
Last Updated | 2017-12-09 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Dirk Thomas
Authors
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
![]() |
composition package from demos repocomposition demo_nodes_cpp demo_nodes_cpp_native demo_nodes_py dummy_map_server dummy_robot_bringup dummy_sensors image_tools intra_process_demo lifecycle logging_demo pendulum_control pendulum_msgs topic_monitor |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.5.1 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | bouncy |
Last Updated | 2018-10-30 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Dirk Thomas
Authors
Changelog for package composition
0.5.1 (2018-06-28)
0.5.0 (2018-06-27)
- Updated launch files to account for the "old launch" getting
renamespaced as
launch
->launch.legacy
. (#239) - Updated to avoid newly deprecated class loader headers. (#229)
- Added a periodic log message while waiting for a service response.
- Contributors: Dirk Thomas, Michael Carroll, Mikael Arguedas, William Woodall
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
![]() |
composition package from demos repocomposition demo_nodes_cpp demo_nodes_cpp_native demo_nodes_py dummy_map_server dummy_robot_bringup dummy_sensors image_tools intra_process_demo lifecycle logging_demo pendulum_control pendulum_msgs topic_monitor |
ROS Distro
|
Package Summary
Tags | No category tags. |
Version | 0.6.2 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | crystal |
Last Updated | 2019-01-15 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Dirk Thomas
Authors
Changelog for package composition
0.6.2 (2019-01-15)
0.6.1 (2018-12-13)
0.6.0 (2018-12-07)
- Added semicolons to all RCLCPP and RCUTILS macros. (#278)
- Contributors: Chris Lalancette
0.5.1 (2018-06-28)
0.5.0 (2018-06-27)
- Updated launch files to account for the "old launch" getting
renamespaced as
launch
->launch.legacy
. (#239) - Updated to avoid newly deprecated class loader headers. (#229)
- Added a periodic log message while waiting for a service response.
- Contributors: Dirk Thomas, Michael Carroll, Mikael Arguedas, William Woodall
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.8.4 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | eloquent |
Last Updated | 2020-11-04 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Mabel Zhang
- Michael Jeronimo
Authors
- Dirk Thomas
Changelog for package composition
0.8.4 (2019-11-19)
0.8.3 (2019-11-11)
0.8.2 (2019-11-08)
0.8.1 (2019-10-23)
- Replace ready_fn with ReadyToTest action (#404)
- Contributors: Peter Baughman
0.8.0 (2019-09-26)
- Add an demo component not inherited from rclcpp::Node (#393)
- Contributors: Michael Carroll
0.7.6 (2019-05-30)
0.7.5 (2019-05-29)
0.7.4 (2019-05-20)
0.7.3 (2019-05-10)
0.7.2 (2019-05-08)
- changes to avoid deprecated API's (#332)
- Corrected publish calls with shared_ptr signature (#327)
- Migrate launch tests to new launch_testing features & API (#318)
- Contributors: Michel Hidalgo, William Woodall, ivanpauno
0.7.1 (2019-04-26)
- Renamed launch file, updated to avoid redundant default actions, and set output to screen. (#326)
- Updated constructor to const ref to NodeOptions. (#323)
- Added basic composition launch demo. (#324)
- Contributors: Michael Carroll, William Woodall
0.7.0 (2019-04-14)
- Updated for new rclcpp_components package. (#319)
- Added launch along with launch_testing as test dependencies. (#313)
- Dropped legacy launch API usage. (#311)
- Contributors: Michael Carroll, Michel Hidalgo
0.6.2 (2019-01-15)
0.6.1 (2018-12-13)
0.6.0 (2018-12-07)
- Added semicolons to all RCLCPP and RCUTILS macros. (#278)
- Contributors: Chris Lalancette
0.5.1 (2018-06-28)
0.5.0 (2018-06-27)
- Updated launch files to account for the "old launch" getting
renamespaced as
launch
->launch.legacy
. (#239) - Updated to avoid newly deprecated class loader headers. (#229)
- Added a periodic log message while waiting for a service response.
- Contributors: Dirk Thomas, Michael Carroll, Mikael Arguedas, William Woodall
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.7.9 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | dashing |
Last Updated | 2020-10-28 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Mabel Zhang
- Michael Jeronimo
Authors
- Dirk Thomas
Changelog for package composition
0.7.6 (2019-05-30)
0.7.5 (2019-05-29)
0.7.4 (2019-05-20)
0.7.3 (2019-05-10)
0.7.2 (2019-05-08)
- changes to avoid deprecated API's (#332)
- Corrected publish calls with shared_ptr signature (#327)
- Migrate launch tests to new launch_testing features & API (#318)
- Contributors: Michel Hidalgo, William Woodall, ivanpauno
0.7.1 (2019-04-26)
- Renamed launch file, updated to avoid redundant default actions, and set output to screen. (#326)
- Updated constructor to const ref to NodeOptions. (#323)
- Added basic composition launch demo. (#324)
- Contributors: Michael Carroll, William Woodall
0.7.0 (2019-04-14)
- Updated for new rclcpp_components package. (#319)
- Added launch along with launch_testing as test dependencies. (#313)
- Dropped legacy launch API usage. (#311)
- Contributors: Michael Carroll, Michel Hidalgo
0.6.2 (2019-01-15)
0.6.1 (2018-12-13)
0.6.0 (2018-12-07)
- Added semicolons to all RCLCPP and RCUTILS macros. (#278)
- Contributors: Chris Lalancette
0.5.1 (2018-06-28)
0.5.0 (2018-06-27)
- Updated launch files to account for the "old launch" getting
renamespaced as
launch
->launch.legacy
. (#239) - Updated to avoid newly deprecated class loader headers. (#229)
- Added a periodic log message while waiting for a service response.
- Contributors: Dirk Thomas, Michael Carroll, Mikael Arguedas, William Woodall
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.14.4 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | galactic |
Last Updated | 2022-12-07 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Mabel Zhang
- Michael Jeronimo
Authors
- Dirk Thomas
Changelog for package composition
0.14.4 (2022-12-06)
0.14.3 (2021-05-10)
0.14.2 (2021-04-26)
0.14.1 (2021-04-19)
0.14.0 (2021-04-06)
0.13.0 (2021-03-25)
0.12.1 (2021-03-18)
0.12.0 (2021-01-25)
0.11.0 (2020-12-10)
- Update the package.xml files with the latest Open Robotics maintainers (#466)
- Contributors: Michael Jeronimo
0.10.1 (2020-09-21)
0.10.0 (2020-06-17)
0.9.3 (2020-06-01)
0.9.2 (2020-05-26)
0.9.1 (2020-05-12)
0.9.0 (2020-04-30)
- Replace deprecated launch_ros usage (#437)
- Update launch_ros action usage (#431)
- code style only: wrap after open parenthesis if not in one line (#429)
- Contributors: Dirk Thomas, Jacob Perron
0.8.4 (2019-11-19)
0.8.3 (2019-11-11)
0.8.2 (2019-11-08)
0.8.1 (2019-10-23)
- Replace ready_fn with ReadyToTest action (#404)
- Contributors: Peter Baughman
0.8.0 (2019-09-26)
- Add an demo component not inherited from rclcpp::Node (#393)
- Contributors: Michael Carroll
0.7.6 (2019-05-30)
0.7.5 (2019-05-29)
0.7.4 (2019-05-20)
0.7.3 (2019-05-10)
0.7.2 (2019-05-08)
- changes to avoid deprecated API's (#332)
- Corrected publish calls with shared_ptr signature (#327)
- Migrate launch tests to new launch_testing features & API (#318)
- Contributors: Michel Hidalgo, William Woodall, ivanpauno
0.7.1 (2019-04-26)
- Renamed launch file, updated to avoid redundant default actions, and set output to screen. (#326)
- Updated constructor to const ref to NodeOptions. (#323)
- Added basic composition launch demo. (#324)
- Contributors: Michael Carroll, William Woodall
0.7.0 (2019-04-14)
- Updated for new rclcpp_components package. (#319)
- Added launch along with launch_testing as test dependencies.
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.9.4 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | foxy |
Last Updated | 2022-07-25 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Mabel Zhang
- Michael Jeronimo
Authors
- Dirk Thomas
Changelog for package composition
0.9.4 (2022-07-25)
- Update maintainer list for Foxy (#471)
- Contributors: Michael Jeronimo
0.9.3 (2020-06-01)
0.9.2 (2020-05-26)
0.9.1 (2020-05-12)
0.9.0 (2020-04-30)
- Replace deprecated launch_ros usage (#437)
- Update launch_ros action usage (#431)
- code style only: wrap after open parenthesis if not in one line (#429)
- Contributors: Dirk Thomas, Jacob Perron
0.8.4 (2019-11-19)
0.8.3 (2019-11-11)
0.8.2 (2019-11-08)
0.8.1 (2019-10-23)
- Replace ready_fn with ReadyToTest action (#404)
- Contributors: Peter Baughman
0.8.0 (2019-09-26)
- Add an demo component not inherited from rclcpp::Node (#393)
- Contributors: Michael Carroll
0.7.6 (2019-05-30)
0.7.5 (2019-05-29)
0.7.4 (2019-05-20)
0.7.3 (2019-05-10)
0.7.2 (2019-05-08)
- changes to avoid deprecated API's (#332)
- Corrected publish calls with shared_ptr signature (#327)
- Migrate launch tests to new launch_testing features & API (#318)
- Contributors: Michel Hidalgo, William Woodall, ivanpauno
0.7.1 (2019-04-26)
- Renamed launch file, updated to avoid redundant default actions, and set output to screen. (#326)
- Updated constructor to const ref to NodeOptions. (#323)
- Added basic composition launch demo. (#324)
- Contributors: Michael Carroll, William Woodall
0.7.0 (2019-04-14)
- Updated for new rclcpp_components package. (#319)
- Added launch along with launch_testing as test dependencies. (#313)
- Dropped legacy launch API usage. (#311)
- Contributors: Michael Carroll, Michel Hidalgo
0.6.2 (2019-01-15)
0.6.1 (2018-12-13)
0.6.0 (2018-12-07)
- Added semicolons to all RCLCPP and RCUTILS macros. (#278)
- Contributors: Chris Lalancette
0.5.1 (2018-06-28)
0.5.0 (2018-06-27)
- Updated launch files to account for the "old launch" getting
renamespaced as
launch
->launch.legacy
. (#239) - Updated to avoid newly deprecated class loader headers. (#229)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
depthai_ros_driver | |
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.27.2 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | iron |
Last Updated | 2024-07-11 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Aditya Pande
- Audrow Nash
- Michael Jeronimo
Authors
- Dirk Thomas
- Mabel Zhang
What Is This?
This demo provides examples of three different ways to use the rclcpp_components API to compose multiple nodes in a single process.
This ROS 2 package consists of the following demo applications:
dlopen_composition
linktime_composition
manual_composition
Build
Run the commands below to build the ROS 2 package:
colcon build --packages-up-to composition
Run
Manual Composition
Running manual_composition
compiles an executable that runs the following 4 components:
- Talker: A ROS 2 component that publishes a string
- Listener: A ROS 2 component that prints the received string from Talker
- Server: A ROS 2 component that adds two integers and outputs its result to Client
- Client: A ROS 2 component that sends two integers to Server and prints the received result from Server
ros2 run composition manual_composition
DlOpen Composition
This runs dlopen_composition
which is an alternative to run-time composition by creating a generic container process and explicitly passing the libraries to load without using ROS interfaces.
The process will open each library and create one instance of each “rclcpp::Node” class in the library.
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
Linktime Composition
Similar to previous, this runs linktime_composition
which links all classes from libraries that are registered under the library_path with the linker.
ros2 run composition linktime_composition
Composition Using Launch Actions
Rather than using the command line tool to run each composition, we can automate this action with ros2 launch
functionality:
ros2 launch composition composition_demo_launch.py
Verify
Manual Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
[INFO] [1674528188.026468320] [talker]: Publishing: 'Hello World: 1'
[INFO] [1674528188.027043857] [listener]: I heard: [Hello World: 1]
[INFO] [1674528189.026414368] [talker]: Publishing: 'Hello World: 2'
[INFO] [1674528189.026742015] [listener]: I heard: [Hello World: 2]
[INFO] [1674528189.032512995] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528189.032815843] [Client]: Got result: [5]
[INFO] [1674528190.026455807] [talker]: Publishing: 'Hello World: 3'
[INFO] [1674528190.026795770] [listener]: I heard: [Hello World: 3]
[INFO] [1674528191.026457639] [talker]: Publishing: 'Hello World: 4'
[INFO] [1674528191.026801926] [listener]: I heard: [Hello World: 4]
[INFO] [1674528191.032377264] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528191.032604427] [Client]: Got result: [5]
[INFO] [1674528192.026428269] [talker]: Publishing: 'Hello World: 5'
[INFO] [1674528192.026537974] [listener]: I heard: [Hello World: 5]
[INFO] [1674528193.026437034] [talker]: Publishing: 'Hello World: 6'
[INFO] [1674528193.026767708] [listener]: I heard: [Hello World: 6]
[INFO] [1674528193.032377748] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528193.032603036] [Client]: Got result: [5]
#...
:warning:
Note that manually-composed components will not be reflected in the
ros2 component list
command line tool output.
DlOpen Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
```bash INFO] [1674529118.496557668] [dlopen_composition]: Load library /opt/ros/rolling/lib/libtalker_component.so [INFO] [1674529118.496774575] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Talker> [INFO] [1674529118.503388909] [dlopen_composition]: Load library /opt/ros/rolling/lib/liblistener_component.so [INFO] [1674529118.503739855] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Listener> [INFO] [1674529119.503505873] [talker]: Publishing: ‘Hello World: 1’
File truncated at 100 lines see the full file
Changelog for package composition
0.27.2 (2024-07-10)
- Add launch action console output in the verify section (#683)
- Contributors: Mikael Arguedas
0.27.1 (2023-05-11)
0.27.0 (2023-04-13)
- Change all ROS2 -> ROS 2. (#610)
- Contributors: Chris Lalancette
0.26.0 (2023-04-11)
- update launch file name format to match documentation (#588)
- Contributors: Patrick Wspanialy
0.25.0 (2023-03-01)
0.24.1 (2023-02-24)
0.24.0 (2023-02-14)
- Added README.md for composition (#598)
- Update the demos to C++17. (#594)
- [rolling] Update maintainers - 2022-11-07 (#589)
- Contributors: Audrow Nash, Chris Lalancette, Gary Bey
0.23.0 (2022-11-02)
- fix memory leak (#585)
- Contributors: Chen Lihui
0.22.0 (2022-09-13)
0.21.0 (2022-04-29)
0.20.1 (2022-04-08)
0.20.0 (2022-03-01)
0.19.0 (2022-01-14)
0.18.0 (2021-12-17)
- Update maintainers to Audrow Nash and Michael Jeronimo (#543)
- Additional fixes for documentation in demos. (#538)
- Contributors: Audrow Nash, Chris Lalancette
0.17.0 (2021-10-18)
- Fixing deprecated subscriber callback warnings (#532)
- Contributors: Abrar Rahman Protyasha
0.16.0 (2021-08-11)
0.15.0 (2021-05-14)
0.14.2 (2021-04-26)
0.14.1 (2021-04-19)
0.14.0 (2021-04-06)
0.13.0 (2021-03-25)
0.12.1 (2021-03-18)
0.12.0 (2021-01-25)
0.11.0 (2020-12-10)
- Update the package.xml files with the latest Open Robotics maintainers (#466)
- Contributors: Michael Jeronimo
0.10.1 (2020-09-21)
0.10.0 (2020-06-17)
0.9.3 (2020-06-01)
0.9.2 (2020-05-26)
0.9.1 (2020-05-12)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.20.5 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | humble |
Last Updated | 2025-05-08 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Audrow Nash
- Michael Jeronimo
Authors
- Dirk Thomas
- Mabel Zhang
What Is This?
This demo provides examples of three different ways to use the rclcpp_components API to compose multiple nodes in a single process.
This ROS 2 package consists of the following demo applications:
dlopen_composition
linktime_composition
manual_composition
Build
Run the commands below to build the ROS 2 package:
colcon build --packages-up-to composition
Run
Manual Composition
Running manual_composition
compiles an executable that runs the following 4 components:
- Talker: A ROS 2 component that publishes a string
- Listener: A ROS 2 component that prints the received string from Talker
- Server: A ROS 2 component that adds two integers and outputs its result to Client
- Client: A ROS 2 component that sends two integers to Server and prints the received result from Server
ros2 run composition manual_composition
DlOpen Composition
This runs dlopen_composition
which is an alternative to run-time composition by creating a generic container process and explicitly passing the libraries to load without using ROS interfaces.
The process will open each library and create one instance of each “rclcpp::Node” class in the library.
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
Linktime Composition
Similar to previous, this runs linktime_composition
which links all classes from libraries that are registered under the library_path with the linker.
ros2 run composition linktime_composition
Composition Using Launch Actions
Rather than using the command line tool to run each composition, we can automate this action with ros2 launch
functionality:
ros2 launch composition composition_demo.launch.py
Verify
Manual Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
[INFO] [1674528188.026468320] [talker]: Publishing: 'Hello World: 1'
[INFO] [1674528188.027043857] [listener]: I heard: [Hello World: 1]
[INFO] [1674528189.026414368] [talker]: Publishing: 'Hello World: 2'
[INFO] [1674528189.026742015] [listener]: I heard: [Hello World: 2]
[INFO] [1674528189.032512995] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528189.032815843] [Client]: Got result: [5]
[INFO] [1674528190.026455807] [talker]: Publishing: 'Hello World: 3'
[INFO] [1674528190.026795770] [listener]: I heard: [Hello World: 3]
[INFO] [1674528191.026457639] [talker]: Publishing: 'Hello World: 4'
[INFO] [1674528191.026801926] [listener]: I heard: [Hello World: 4]
[INFO] [1674528191.032377264] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528191.032604427] [Client]: Got result: [5]
[INFO] [1674528192.026428269] [talker]: Publishing: 'Hello World: 5'
[INFO] [1674528192.026537974] [listener]: I heard: [Hello World: 5]
[INFO] [1674528193.026437034] [talker]: Publishing: 'Hello World: 6'
[INFO] [1674528193.026767708] [listener]: I heard: [Hello World: 6]
[INFO] [1674528193.032377748] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528193.032603036] [Client]: Got result: [5]
#...
:warning:
Note that manually-composed components will not be reflected in the
ros2 component list
command line tool output.
DlOpen Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
```bash INFO] [1674529118.496557668] [dlopen_composition]: Load library /opt/ros/humble/lib/libtalker_component.so [INFO] [1674529118.496774575] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Talker> [INFO] [1674529118.503388909] [dlopen_composition]: Load library /opt/ros/humble/lib/liblistener_component.so [INFO] [1674529118.503739855] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Listener> [INFO] [1674529119.503505873] [talker]: Publishing: ‘Hello World: 1’
File truncated at 100 lines see the full file
Changelog for package composition
0.20.5 (2024-07-26)
0.20.4 (2024-05-15)
- [composition] add launch action console output in the verify section (#677) (#682)
- Contributors: mergify[bot]
0.20.3 (2023-01-10)
0.20.2 (2022-05-10)
0.20.1 (2022-04-08)
0.20.0 (2022-03-01)
0.19.0 (2022-01-14)
0.18.0 (2021-12-17)
- Update maintainers to Audrow Nash and Michael Jeronimo (#543)
- Additional fixes for documentation in demos. (#538)
- Contributors: Audrow Nash, Chris Lalancette
0.17.0 (2021-10-18)
- Fixing deprecated subscriber callback warnings (#532)
- Contributors: Abrar Rahman Protyasha
0.16.0 (2021-08-11)
0.15.0 (2021-05-14)
0.14.2 (2021-04-26)
0.14.1 (2021-04-19)
0.14.0 (2021-04-06)
0.13.0 (2021-03-25)
0.12.1 (2021-03-18)
0.12.0 (2021-01-25)
0.11.0 (2020-12-10)
- Update the package.xml files with the latest Open Robotics maintainers (#466)
- Contributors: Michael Jeronimo
0.10.1 (2020-09-21)
0.10.0 (2020-06-17)
0.9.3 (2020-06-01)
0.9.2 (2020-05-26)
0.9.1 (2020-05-12)
0.9.0 (2020-04-30)
- Replace deprecated launch_ros usage (#437)
- Update launch_ros action usage (#431)
- code style only: wrap after open parenthesis if not in one line (#429)
- Contributors: Dirk Thomas, Jacob Perron
0.8.4 (2019-11-19)
0.8.3 (2019-11-11)
0.8.2 (2019-11-08)
0.8.1 (2019-10-23)
- Replace ready_fn with ReadyToTest action (#404)
- Contributors: Peter Baughman
0.8.0 (2019-09-26)
- Add an demo component not inherited from rclcpp::Node (#393)
- Contributors: Michael Carroll
0.7.6 (2019-05-30)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.20.5 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | humble |
Last Updated | 2025-05-08 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Audrow Nash
- Michael Jeronimo
Authors
- Dirk Thomas
- Mabel Zhang
What Is This?
This demo provides examples of three different ways to use the rclcpp_components API to compose multiple nodes in a single process.
This ROS 2 package consists of the following demo applications:
dlopen_composition
linktime_composition
manual_composition
Build
Run the commands below to build the ROS 2 package:
colcon build --packages-up-to composition
Run
Manual Composition
Running manual_composition
compiles an executable that runs the following 4 components:
- Talker: A ROS 2 component that publishes a string
- Listener: A ROS 2 component that prints the received string from Talker
- Server: A ROS 2 component that adds two integers and outputs its result to Client
- Client: A ROS 2 component that sends two integers to Server and prints the received result from Server
ros2 run composition manual_composition
DlOpen Composition
This runs dlopen_composition
which is an alternative to run-time composition by creating a generic container process and explicitly passing the libraries to load without using ROS interfaces.
The process will open each library and create one instance of each “rclcpp::Node” class in the library.
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
Linktime Composition
Similar to previous, this runs linktime_composition
which links all classes from libraries that are registered under the library_path with the linker.
ros2 run composition linktime_composition
Composition Using Launch Actions
Rather than using the command line tool to run each composition, we can automate this action with ros2 launch
functionality:
ros2 launch composition composition_demo.launch.py
Verify
Manual Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
[INFO] [1674528188.026468320] [talker]: Publishing: 'Hello World: 1'
[INFO] [1674528188.027043857] [listener]: I heard: [Hello World: 1]
[INFO] [1674528189.026414368] [talker]: Publishing: 'Hello World: 2'
[INFO] [1674528189.026742015] [listener]: I heard: [Hello World: 2]
[INFO] [1674528189.032512995] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528189.032815843] [Client]: Got result: [5]
[INFO] [1674528190.026455807] [talker]: Publishing: 'Hello World: 3'
[INFO] [1674528190.026795770] [listener]: I heard: [Hello World: 3]
[INFO] [1674528191.026457639] [talker]: Publishing: 'Hello World: 4'
[INFO] [1674528191.026801926] [listener]: I heard: [Hello World: 4]
[INFO] [1674528191.032377264] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528191.032604427] [Client]: Got result: [5]
[INFO] [1674528192.026428269] [talker]: Publishing: 'Hello World: 5'
[INFO] [1674528192.026537974] [listener]: I heard: [Hello World: 5]
[INFO] [1674528193.026437034] [talker]: Publishing: 'Hello World: 6'
[INFO] [1674528193.026767708] [listener]: I heard: [Hello World: 6]
[INFO] [1674528193.032377748] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528193.032603036] [Client]: Got result: [5]
#...
:warning:
Note that manually-composed components will not be reflected in the
ros2 component list
command line tool output.
DlOpen Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
```bash INFO] [1674529118.496557668] [dlopen_composition]: Load library /opt/ros/humble/lib/libtalker_component.so [INFO] [1674529118.496774575] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Talker> [INFO] [1674529118.503388909] [dlopen_composition]: Load library /opt/ros/humble/lib/liblistener_component.so [INFO] [1674529118.503739855] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Listener> [INFO] [1674529119.503505873] [talker]: Publishing: ‘Hello World: 1’
File truncated at 100 lines see the full file
Changelog for package composition
0.20.5 (2024-07-26)
0.20.4 (2024-05-15)
- [composition] add launch action console output in the verify section (#677) (#682)
- Contributors: mergify[bot]
0.20.3 (2023-01-10)
0.20.2 (2022-05-10)
0.20.1 (2022-04-08)
0.20.0 (2022-03-01)
0.19.0 (2022-01-14)
0.18.0 (2021-12-17)
- Update maintainers to Audrow Nash and Michael Jeronimo (#543)
- Additional fixes for documentation in demos. (#538)
- Contributors: Audrow Nash, Chris Lalancette
0.17.0 (2021-10-18)
- Fixing deprecated subscriber callback warnings (#532)
- Contributors: Abrar Rahman Protyasha
0.16.0 (2021-08-11)
0.15.0 (2021-05-14)
0.14.2 (2021-04-26)
0.14.1 (2021-04-19)
0.14.0 (2021-04-06)
0.13.0 (2021-03-25)
0.12.1 (2021-03-18)
0.12.0 (2021-01-25)
0.11.0 (2020-12-10)
- Update the package.xml files with the latest Open Robotics maintainers (#466)
- Contributors: Michael Jeronimo
0.10.1 (2020-09-21)
0.10.0 (2020-06-17)
0.9.3 (2020-06-01)
0.9.2 (2020-05-26)
0.9.1 (2020-05-12)
0.9.0 (2020-04-30)
- Replace deprecated launch_ros usage (#437)
- Update launch_ros action usage (#431)
- code style only: wrap after open parenthesis if not in one line (#429)
- Contributors: Dirk Thomas, Jacob Perron
0.8.4 (2019-11-19)
0.8.3 (2019-11-11)
0.8.2 (2019-11-08)
0.8.1 (2019-10-23)
- Replace ready_fn with ReadyToTest action (#404)
- Contributors: Peter Baughman
0.8.0 (2019-09-26)
- Add an demo component not inherited from rclcpp::Node (#393)
- Contributors: Michael Carroll
0.7.6 (2019-05-30)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.20.5 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | humble |
Last Updated | 2025-05-08 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Audrow Nash
- Michael Jeronimo
Authors
- Dirk Thomas
- Mabel Zhang
What Is This?
This demo provides examples of three different ways to use the rclcpp_components API to compose multiple nodes in a single process.
This ROS 2 package consists of the following demo applications:
dlopen_composition
linktime_composition
manual_composition
Build
Run the commands below to build the ROS 2 package:
colcon build --packages-up-to composition
Run
Manual Composition
Running manual_composition
compiles an executable that runs the following 4 components:
- Talker: A ROS 2 component that publishes a string
- Listener: A ROS 2 component that prints the received string from Talker
- Server: A ROS 2 component that adds two integers and outputs its result to Client
- Client: A ROS 2 component that sends two integers to Server and prints the received result from Server
ros2 run composition manual_composition
DlOpen Composition
This runs dlopen_composition
which is an alternative to run-time composition by creating a generic container process and explicitly passing the libraries to load without using ROS interfaces.
The process will open each library and create one instance of each “rclcpp::Node” class in the library.
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
Linktime Composition
Similar to previous, this runs linktime_composition
which links all classes from libraries that are registered under the library_path with the linker.
ros2 run composition linktime_composition
Composition Using Launch Actions
Rather than using the command line tool to run each composition, we can automate this action with ros2 launch
functionality:
ros2 launch composition composition_demo.launch.py
Verify
Manual Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
[INFO] [1674528188.026468320] [talker]: Publishing: 'Hello World: 1'
[INFO] [1674528188.027043857] [listener]: I heard: [Hello World: 1]
[INFO] [1674528189.026414368] [talker]: Publishing: 'Hello World: 2'
[INFO] [1674528189.026742015] [listener]: I heard: [Hello World: 2]
[INFO] [1674528189.032512995] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528189.032815843] [Client]: Got result: [5]
[INFO] [1674528190.026455807] [talker]: Publishing: 'Hello World: 3'
[INFO] [1674528190.026795770] [listener]: I heard: [Hello World: 3]
[INFO] [1674528191.026457639] [talker]: Publishing: 'Hello World: 4'
[INFO] [1674528191.026801926] [listener]: I heard: [Hello World: 4]
[INFO] [1674528191.032377264] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528191.032604427] [Client]: Got result: [5]
[INFO] [1674528192.026428269] [talker]: Publishing: 'Hello World: 5'
[INFO] [1674528192.026537974] [listener]: I heard: [Hello World: 5]
[INFO] [1674528193.026437034] [talker]: Publishing: 'Hello World: 6'
[INFO] [1674528193.026767708] [listener]: I heard: [Hello World: 6]
[INFO] [1674528193.032377748] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528193.032603036] [Client]: Got result: [5]
#...
:warning:
Note that manually-composed components will not be reflected in the
ros2 component list
command line tool output.
DlOpen Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
```bash INFO] [1674529118.496557668] [dlopen_composition]: Load library /opt/ros/humble/lib/libtalker_component.so [INFO] [1674529118.496774575] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Talker> [INFO] [1674529118.503388909] [dlopen_composition]: Load library /opt/ros/humble/lib/liblistener_component.so [INFO] [1674529118.503739855] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Listener> [INFO] [1674529119.503505873] [talker]: Publishing: ‘Hello World: 1’
File truncated at 100 lines see the full file
Changelog for package composition
0.20.5 (2024-07-26)
0.20.4 (2024-05-15)
- [composition] add launch action console output in the verify section (#677) (#682)
- Contributors: mergify[bot]
0.20.3 (2023-01-10)
0.20.2 (2022-05-10)
0.20.1 (2022-04-08)
0.20.0 (2022-03-01)
0.19.0 (2022-01-14)
0.18.0 (2021-12-17)
- Update maintainers to Audrow Nash and Michael Jeronimo (#543)
- Additional fixes for documentation in demos. (#538)
- Contributors: Audrow Nash, Chris Lalancette
0.17.0 (2021-10-18)
- Fixing deprecated subscriber callback warnings (#532)
- Contributors: Abrar Rahman Protyasha
0.16.0 (2021-08-11)
0.15.0 (2021-05-14)
0.14.2 (2021-04-26)
0.14.1 (2021-04-19)
0.14.0 (2021-04-06)
0.13.0 (2021-03-25)
0.12.1 (2021-03-18)
0.12.0 (2021-01-25)
0.11.0 (2020-12-10)
- Update the package.xml files with the latest Open Robotics maintainers (#466)
- Contributors: Michael Jeronimo
0.10.1 (2020-09-21)
0.10.0 (2020-06-17)
0.9.3 (2020-06-01)
0.9.2 (2020-05-26)
0.9.1 (2020-05-12)
0.9.0 (2020-04-30)
- Replace deprecated launch_ros usage (#437)
- Update launch_ros action usage (#431)
- code style only: wrap after open parenthesis if not in one line (#429)
- Contributors: Dirk Thomas, Jacob Perron
0.8.4 (2019-11-19)
0.8.3 (2019-11-11)
0.8.2 (2019-11-08)
0.8.1 (2019-10-23)
- Replace ready_fn with ReadyToTest action (#404)
- Contributors: Peter Baughman
0.8.0 (2019-09-26)
- Add an demo component not inherited from rclcpp::Node (#393)
- Contributors: Michael Carroll
0.7.6 (2019-05-30)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.20.5 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | humble |
Last Updated | 2025-05-08 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Audrow Nash
- Michael Jeronimo
Authors
- Dirk Thomas
- Mabel Zhang
What Is This?
This demo provides examples of three different ways to use the rclcpp_components API to compose multiple nodes in a single process.
This ROS 2 package consists of the following demo applications:
dlopen_composition
linktime_composition
manual_composition
Build
Run the commands below to build the ROS 2 package:
colcon build --packages-up-to composition
Run
Manual Composition
Running manual_composition
compiles an executable that runs the following 4 components:
- Talker: A ROS 2 component that publishes a string
- Listener: A ROS 2 component that prints the received string from Talker
- Server: A ROS 2 component that adds two integers and outputs its result to Client
- Client: A ROS 2 component that sends two integers to Server and prints the received result from Server
ros2 run composition manual_composition
DlOpen Composition
This runs dlopen_composition
which is an alternative to run-time composition by creating a generic container process and explicitly passing the libraries to load without using ROS interfaces.
The process will open each library and create one instance of each “rclcpp::Node” class in the library.
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
Linktime Composition
Similar to previous, this runs linktime_composition
which links all classes from libraries that are registered under the library_path with the linker.
ros2 run composition linktime_composition
Composition Using Launch Actions
Rather than using the command line tool to run each composition, we can automate this action with ros2 launch
functionality:
ros2 launch composition composition_demo.launch.py
Verify
Manual Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
[INFO] [1674528188.026468320] [talker]: Publishing: 'Hello World: 1'
[INFO] [1674528188.027043857] [listener]: I heard: [Hello World: 1]
[INFO] [1674528189.026414368] [talker]: Publishing: 'Hello World: 2'
[INFO] [1674528189.026742015] [listener]: I heard: [Hello World: 2]
[INFO] [1674528189.032512995] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528189.032815843] [Client]: Got result: [5]
[INFO] [1674528190.026455807] [talker]: Publishing: 'Hello World: 3'
[INFO] [1674528190.026795770] [listener]: I heard: [Hello World: 3]
[INFO] [1674528191.026457639] [talker]: Publishing: 'Hello World: 4'
[INFO] [1674528191.026801926] [listener]: I heard: [Hello World: 4]
[INFO] [1674528191.032377264] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528191.032604427] [Client]: Got result: [5]
[INFO] [1674528192.026428269] [talker]: Publishing: 'Hello World: 5'
[INFO] [1674528192.026537974] [listener]: I heard: [Hello World: 5]
[INFO] [1674528193.026437034] [talker]: Publishing: 'Hello World: 6'
[INFO] [1674528193.026767708] [listener]: I heard: [Hello World: 6]
[INFO] [1674528193.032377748] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528193.032603036] [Client]: Got result: [5]
#...
:warning:
Note that manually-composed components will not be reflected in the
ros2 component list
command line tool output.
DlOpen Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
```bash INFO] [1674529118.496557668] [dlopen_composition]: Load library /opt/ros/humble/lib/libtalker_component.so [INFO] [1674529118.496774575] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Talker> [INFO] [1674529118.503388909] [dlopen_composition]: Load library /opt/ros/humble/lib/liblistener_component.so [INFO] [1674529118.503739855] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Listener> [INFO] [1674529119.503505873] [talker]: Publishing: ‘Hello World: 1’
File truncated at 100 lines see the full file
Changelog for package composition
0.20.5 (2024-07-26)
0.20.4 (2024-05-15)
- [composition] add launch action console output in the verify section (#677) (#682)
- Contributors: mergify[bot]
0.20.3 (2023-01-10)
0.20.2 (2022-05-10)
0.20.1 (2022-04-08)
0.20.0 (2022-03-01)
0.19.0 (2022-01-14)
0.18.0 (2021-12-17)
- Update maintainers to Audrow Nash and Michael Jeronimo (#543)
- Additional fixes for documentation in demos. (#538)
- Contributors: Audrow Nash, Chris Lalancette
0.17.0 (2021-10-18)
- Fixing deprecated subscriber callback warnings (#532)
- Contributors: Abrar Rahman Protyasha
0.16.0 (2021-08-11)
0.15.0 (2021-05-14)
0.14.2 (2021-04-26)
0.14.1 (2021-04-19)
0.14.0 (2021-04-06)
0.13.0 (2021-03-25)
0.12.1 (2021-03-18)
0.12.0 (2021-01-25)
0.11.0 (2020-12-10)
- Update the package.xml files with the latest Open Robotics maintainers (#466)
- Contributors: Michael Jeronimo
0.10.1 (2020-09-21)
0.10.0 (2020-06-17)
0.9.3 (2020-06-01)
0.9.2 (2020-05-26)
0.9.1 (2020-05-12)
0.9.0 (2020-04-30)
- Replace deprecated launch_ros usage (#437)
- Update launch_ros action usage (#431)
- code style only: wrap after open parenthesis if not in one line (#429)
- Contributors: Dirk Thomas, Jacob Perron
0.8.4 (2019-11-19)
0.8.3 (2019-11-11)
0.8.2 (2019-11-08)
0.8.1 (2019-10-23)
- Replace ready_fn with ReadyToTest action (#404)
- Contributors: Peter Baughman
0.8.0 (2019-09-26)
- Add an demo component not inherited from rclcpp::Node (#393)
- Contributors: Michael Carroll
0.7.6 (2019-05-30)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.20.5 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | humble |
Last Updated | 2025-05-08 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Audrow Nash
- Michael Jeronimo
Authors
- Dirk Thomas
- Mabel Zhang
What Is This?
This demo provides examples of three different ways to use the rclcpp_components API to compose multiple nodes in a single process.
This ROS 2 package consists of the following demo applications:
dlopen_composition
linktime_composition
manual_composition
Build
Run the commands below to build the ROS 2 package:
colcon build --packages-up-to composition
Run
Manual Composition
Running manual_composition
compiles an executable that runs the following 4 components:
- Talker: A ROS 2 component that publishes a string
- Listener: A ROS 2 component that prints the received string from Talker
- Server: A ROS 2 component that adds two integers and outputs its result to Client
- Client: A ROS 2 component that sends two integers to Server and prints the received result from Server
ros2 run composition manual_composition
DlOpen Composition
This runs dlopen_composition
which is an alternative to run-time composition by creating a generic container process and explicitly passing the libraries to load without using ROS interfaces.
The process will open each library and create one instance of each “rclcpp::Node” class in the library.
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
Linktime Composition
Similar to previous, this runs linktime_composition
which links all classes from libraries that are registered under the library_path with the linker.
ros2 run composition linktime_composition
Composition Using Launch Actions
Rather than using the command line tool to run each composition, we can automate this action with ros2 launch
functionality:
ros2 launch composition composition_demo.launch.py
Verify
Manual Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
[INFO] [1674528188.026468320] [talker]: Publishing: 'Hello World: 1'
[INFO] [1674528188.027043857] [listener]: I heard: [Hello World: 1]
[INFO] [1674528189.026414368] [talker]: Publishing: 'Hello World: 2'
[INFO] [1674528189.026742015] [listener]: I heard: [Hello World: 2]
[INFO] [1674528189.032512995] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528189.032815843] [Client]: Got result: [5]
[INFO] [1674528190.026455807] [talker]: Publishing: 'Hello World: 3'
[INFO] [1674528190.026795770] [listener]: I heard: [Hello World: 3]
[INFO] [1674528191.026457639] [talker]: Publishing: 'Hello World: 4'
[INFO] [1674528191.026801926] [listener]: I heard: [Hello World: 4]
[INFO] [1674528191.032377264] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528191.032604427] [Client]: Got result: [5]
[INFO] [1674528192.026428269] [talker]: Publishing: 'Hello World: 5'
[INFO] [1674528192.026537974] [listener]: I heard: [Hello World: 5]
[INFO] [1674528193.026437034] [talker]: Publishing: 'Hello World: 6'
[INFO] [1674528193.026767708] [listener]: I heard: [Hello World: 6]
[INFO] [1674528193.032377748] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528193.032603036] [Client]: Got result: [5]
#...
:warning:
Note that manually-composed components will not be reflected in the
ros2 component list
command line tool output.
DlOpen Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
```bash INFO] [1674529118.496557668] [dlopen_composition]: Load library /opt/ros/humble/lib/libtalker_component.so [INFO] [1674529118.496774575] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Talker> [INFO] [1674529118.503388909] [dlopen_composition]: Load library /opt/ros/humble/lib/liblistener_component.so [INFO] [1674529118.503739855] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Listener> [INFO] [1674529119.503505873] [talker]: Publishing: ‘Hello World: 1’
File truncated at 100 lines see the full file
Changelog for package composition
0.20.5 (2024-07-26)
0.20.4 (2024-05-15)
- [composition] add launch action console output in the verify section (#677) (#682)
- Contributors: mergify[bot]
0.20.3 (2023-01-10)
0.20.2 (2022-05-10)
0.20.1 (2022-04-08)
0.20.0 (2022-03-01)
0.19.0 (2022-01-14)
0.18.0 (2021-12-17)
- Update maintainers to Audrow Nash and Michael Jeronimo (#543)
- Additional fixes for documentation in demos. (#538)
- Contributors: Audrow Nash, Chris Lalancette
0.17.0 (2021-10-18)
- Fixing deprecated subscriber callback warnings (#532)
- Contributors: Abrar Rahman Protyasha
0.16.0 (2021-08-11)
0.15.0 (2021-05-14)
0.14.2 (2021-04-26)
0.14.1 (2021-04-19)
0.14.0 (2021-04-06)
0.13.0 (2021-03-25)
0.12.1 (2021-03-18)
0.12.0 (2021-01-25)
0.11.0 (2020-12-10)
- Update the package.xml files with the latest Open Robotics maintainers (#466)
- Contributors: Michael Jeronimo
0.10.1 (2020-09-21)
0.10.0 (2020-06-17)
0.9.3 (2020-06-01)
0.9.2 (2020-05-26)
0.9.1 (2020-05-12)
0.9.0 (2020-04-30)
- Replace deprecated launch_ros usage (#437)
- Update launch_ros action usage (#431)
- code style only: wrap after open parenthesis if not in one line (#429)
- Contributors: Dirk Thomas, Jacob Perron
0.8.4 (2019-11-19)
0.8.3 (2019-11-11)
0.8.2 (2019-11-08)
0.8.1 (2019-10-23)
- Replace ready_fn with ReadyToTest action (#404)
- Contributors: Peter Baughman
0.8.0 (2019-09-26)
- Add an demo component not inherited from rclcpp::Node (#393)
- Contributors: Michael Carroll
0.7.6 (2019-05-30)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.20.5 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | humble |
Last Updated | 2025-05-08 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Audrow Nash
- Michael Jeronimo
Authors
- Dirk Thomas
- Mabel Zhang
What Is This?
This demo provides examples of three different ways to use the rclcpp_components API to compose multiple nodes in a single process.
This ROS 2 package consists of the following demo applications:
dlopen_composition
linktime_composition
manual_composition
Build
Run the commands below to build the ROS 2 package:
colcon build --packages-up-to composition
Run
Manual Composition
Running manual_composition
compiles an executable that runs the following 4 components:
- Talker: A ROS 2 component that publishes a string
- Listener: A ROS 2 component that prints the received string from Talker
- Server: A ROS 2 component that adds two integers and outputs its result to Client
- Client: A ROS 2 component that sends two integers to Server and prints the received result from Server
ros2 run composition manual_composition
DlOpen Composition
This runs dlopen_composition
which is an alternative to run-time composition by creating a generic container process and explicitly passing the libraries to load without using ROS interfaces.
The process will open each library and create one instance of each “rclcpp::Node” class in the library.
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
Linktime Composition
Similar to previous, this runs linktime_composition
which links all classes from libraries that are registered under the library_path with the linker.
ros2 run composition linktime_composition
Composition Using Launch Actions
Rather than using the command line tool to run each composition, we can automate this action with ros2 launch
functionality:
ros2 launch composition composition_demo.launch.py
Verify
Manual Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
[INFO] [1674528188.026468320] [talker]: Publishing: 'Hello World: 1'
[INFO] [1674528188.027043857] [listener]: I heard: [Hello World: 1]
[INFO] [1674528189.026414368] [talker]: Publishing: 'Hello World: 2'
[INFO] [1674528189.026742015] [listener]: I heard: [Hello World: 2]
[INFO] [1674528189.032512995] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528189.032815843] [Client]: Got result: [5]
[INFO] [1674528190.026455807] [talker]: Publishing: 'Hello World: 3'
[INFO] [1674528190.026795770] [listener]: I heard: [Hello World: 3]
[INFO] [1674528191.026457639] [talker]: Publishing: 'Hello World: 4'
[INFO] [1674528191.026801926] [listener]: I heard: [Hello World: 4]
[INFO] [1674528191.032377264] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528191.032604427] [Client]: Got result: [5]
[INFO] [1674528192.026428269] [talker]: Publishing: 'Hello World: 5'
[INFO] [1674528192.026537974] [listener]: I heard: [Hello World: 5]
[INFO] [1674528193.026437034] [talker]: Publishing: 'Hello World: 6'
[INFO] [1674528193.026767708] [listener]: I heard: [Hello World: 6]
[INFO] [1674528193.032377748] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528193.032603036] [Client]: Got result: [5]
#...
:warning:
Note that manually-composed components will not be reflected in the
ros2 component list
command line tool output.
DlOpen Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
```bash INFO] [1674529118.496557668] [dlopen_composition]: Load library /opt/ros/humble/lib/libtalker_component.so [INFO] [1674529118.496774575] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Talker> [INFO] [1674529118.503388909] [dlopen_composition]: Load library /opt/ros/humble/lib/liblistener_component.so [INFO] [1674529118.503739855] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Listener> [INFO] [1674529119.503505873] [talker]: Publishing: ‘Hello World: 1’
File truncated at 100 lines see the full file
Changelog for package composition
0.20.5 (2024-07-26)
0.20.4 (2024-05-15)
- [composition] add launch action console output in the verify section (#677) (#682)
- Contributors: mergify[bot]
0.20.3 (2023-01-10)
0.20.2 (2022-05-10)
0.20.1 (2022-04-08)
0.20.0 (2022-03-01)
0.19.0 (2022-01-14)
0.18.0 (2021-12-17)
- Update maintainers to Audrow Nash and Michael Jeronimo (#543)
- Additional fixes for documentation in demos. (#538)
- Contributors: Audrow Nash, Chris Lalancette
0.17.0 (2021-10-18)
- Fixing deprecated subscriber callback warnings (#532)
- Contributors: Abrar Rahman Protyasha
0.16.0 (2021-08-11)
0.15.0 (2021-05-14)
0.14.2 (2021-04-26)
0.14.1 (2021-04-19)
0.14.0 (2021-04-06)
0.13.0 (2021-03-25)
0.12.1 (2021-03-18)
0.12.0 (2021-01-25)
0.11.0 (2020-12-10)
- Update the package.xml files with the latest Open Robotics maintainers (#466)
- Contributors: Michael Jeronimo
0.10.1 (2020-09-21)
0.10.0 (2020-06-17)
0.9.3 (2020-06-01)
0.9.2 (2020-05-26)
0.9.1 (2020-05-12)
0.9.0 (2020-04-30)
- Replace deprecated launch_ros usage (#437)
- Update launch_ros action usage (#431)
- code style only: wrap after open parenthesis if not in one line (#429)
- Contributors: Dirk Thomas, Jacob Perron
0.8.4 (2019-11-19)
0.8.3 (2019-11-11)
0.8.2 (2019-11-08)
0.8.1 (2019-10-23)
- Replace ready_fn with ReadyToTest action (#404)
- Contributors: Peter Baughman
0.8.0 (2019-09-26)
- Add an demo component not inherited from rclcpp::Node (#393)
- Contributors: Michael Carroll
0.7.6 (2019-05-30)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |
Launch files
Messages
Services
Plugins
Recent questions tagged composition at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 0.20.5 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/ros2/demos.git |
VCS Type | git |
VCS Version | humble |
Last Updated | 2025-05-08 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | RELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Audrow Nash
- Michael Jeronimo
Authors
- Dirk Thomas
- Mabel Zhang
What Is This?
This demo provides examples of three different ways to use the rclcpp_components API to compose multiple nodes in a single process.
This ROS 2 package consists of the following demo applications:
dlopen_composition
linktime_composition
manual_composition
Build
Run the commands below to build the ROS 2 package:
colcon build --packages-up-to composition
Run
Manual Composition
Running manual_composition
compiles an executable that runs the following 4 components:
- Talker: A ROS 2 component that publishes a string
- Listener: A ROS 2 component that prints the received string from Talker
- Server: A ROS 2 component that adds two integers and outputs its result to Client
- Client: A ROS 2 component that sends two integers to Server and prints the received result from Server
ros2 run composition manual_composition
DlOpen Composition
This runs dlopen_composition
which is an alternative to run-time composition by creating a generic container process and explicitly passing the libraries to load without using ROS interfaces.
The process will open each library and create one instance of each “rclcpp::Node” class in the library.
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
Linktime Composition
Similar to previous, this runs linktime_composition
which links all classes from libraries that are registered under the library_path with the linker.
ros2 run composition linktime_composition
Composition Using Launch Actions
Rather than using the command line tool to run each composition, we can automate this action with ros2 launch
functionality:
ros2 launch composition composition_demo.launch.py
Verify
Manual Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
[INFO] [1674528188.026468320] [talker]: Publishing: 'Hello World: 1'
[INFO] [1674528188.027043857] [listener]: I heard: [Hello World: 1]
[INFO] [1674528189.026414368] [talker]: Publishing: 'Hello World: 2'
[INFO] [1674528189.026742015] [listener]: I heard: [Hello World: 2]
[INFO] [1674528189.032512995] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528189.032815843] [Client]: Got result: [5]
[INFO] [1674528190.026455807] [talker]: Publishing: 'Hello World: 3'
[INFO] [1674528190.026795770] [listener]: I heard: [Hello World: 3]
[INFO] [1674528191.026457639] [talker]: Publishing: 'Hello World: 4'
[INFO] [1674528191.026801926] [listener]: I heard: [Hello World: 4]
[INFO] [1674528191.032377264] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528191.032604427] [Client]: Got result: [5]
[INFO] [1674528192.026428269] [talker]: Publishing: 'Hello World: 5'
[INFO] [1674528192.026537974] [listener]: I heard: [Hello World: 5]
[INFO] [1674528193.026437034] [talker]: Publishing: 'Hello World: 6'
[INFO] [1674528193.026767708] [listener]: I heard: [Hello World: 6]
[INFO] [1674528193.032377748] [Server]: Incoming request: [a: 2, b: 3]
[INFO] [1674528193.032603036] [Client]: Got result: [5]
#...
:warning:
Note that manually-composed components will not be reflected in the
ros2 component list
command line tool output.
DlOpen Composition
When executed correctly, strings should be printed to terminal similar to what is shown below:
```bash INFO] [1674529118.496557668] [dlopen_composition]: Load library /opt/ros/humble/lib/libtalker_component.so [INFO] [1674529118.496774575] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Talker> [INFO] [1674529118.503388909] [dlopen_composition]: Load library /opt/ros/humble/lib/liblistener_component.so [INFO] [1674529118.503739855] [dlopen_composition]: Instantiate class rclcpp_components::NodeFactoryTemplate<composition::Listener> [INFO] [1674529119.503505873] [talker]: Publishing: ‘Hello World: 1’
File truncated at 100 lines see the full file
Changelog for package composition
0.20.5 (2024-07-26)
0.20.4 (2024-05-15)
- [composition] add launch action console output in the verify section (#677) (#682)
- Contributors: mergify[bot]
0.20.3 (2023-01-10)
0.20.2 (2022-05-10)
0.20.1 (2022-04-08)
0.20.0 (2022-03-01)
0.19.0 (2022-01-14)
0.18.0 (2021-12-17)
- Update maintainers to Audrow Nash and Michael Jeronimo (#543)
- Additional fixes for documentation in demos. (#538)
- Contributors: Audrow Nash, Chris Lalancette
0.17.0 (2021-10-18)
- Fixing deprecated subscriber callback warnings (#532)
- Contributors: Abrar Rahman Protyasha
0.16.0 (2021-08-11)
0.15.0 (2021-05-14)
0.14.2 (2021-04-26)
0.14.1 (2021-04-19)
0.14.0 (2021-04-06)
0.13.0 (2021-03-25)
0.12.1 (2021-03-18)
0.12.0 (2021-01-25)
0.11.0 (2020-12-10)
- Update the package.xml files with the latest Open Robotics maintainers (#466)
- Contributors: Michael Jeronimo
0.10.1 (2020-09-21)
0.10.0 (2020-06-17)
0.9.3 (2020-06-01)
0.9.2 (2020-05-26)
0.9.1 (2020-05-12)
0.9.0 (2020-04-30)
- Replace deprecated launch_ros usage (#437)
- Update launch_ros action usage (#431)
- code style only: wrap after open parenthesis if not in one line (#429)
- Contributors: Dirk Thomas, Jacob Perron
0.8.4 (2019-11-19)
0.8.3 (2019-11-11)
0.8.2 (2019-11-08)
0.8.1 (2019-10-23)
- Replace ready_fn with ReadyToTest action (#404)
- Contributors: Peter Baughman
0.8.0 (2019-09-26)
- Add an demo component not inherited from rclcpp::Node (#393)
- Contributors: Michael Carroll
0.7.6 (2019-05-30)
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Name | Deps |
---|---|
test_launch_ros | |
desktop |