Ask Your Question

How to use composition instead of nodelets?

asked 2019-08-08 14:03:07 -0500

EdwardNur gravatar image

updated 2019-08-22 11:52:10 -0500

mjcarroll gravatar image

I have read the theory behind the compositions but in practice, I find it confusing on how to replace the nodelets in ROS1 to compositions in ROS2. More specifically, consider this code:

As you can see, the nodelets are being created and it has a main function wheres compositions do not have any main functions. Can someone advice?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-08-29 10:00:10 -0500

mjcarroll gravatar image

updated 2019-08-29 10:00:17 -0500

The code linked is an example of how to load given nodelets in a runtime executable. The code that is probably most directly applicable to port is located in the nodelets directory. Each of those objects would have to be ported to take advantage of the new component interface.

As far as the loading section of the code, one could either use the tooling that is described in the Composition tutorial, which are forms of runtime compositions. In the tutorial, loading components via the ROS2 API as well as loading components via a launch file are detailed.

To reproduce the behavior in the referenced source code, you may want to use a manual composition approach. An example of how to perform manual composition at link-time is outlined in the ROS2 Demos Package

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-08-08 14:03:07 -0500

Seen: 377 times

Last updated: Aug 29 '19