How to use composition instead of nodelets?
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:
https://github.com/introlab/rtabmap_ros/blob/master/src/CoreNode.cpp
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?
Asked by EdwardNur on 2019-08-08 14:03:07 UTC
Answers
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
Asked by mjcarroll on 2019-08-29 10:00:10 UTC
Comments