Which is the correct way to build nodes able to act both as a "normal" node and as a composable node?

asked 2023-02-13 04:39:24 -0500

fjiriarte gravatar image

updated 2023-02-14 02:14:02 -0500

Hi! I'm a ROS 1 user trying to get into ROS2. I have some conceptual questions about how ROS2 works.

I'm researching on composable nodes and intra-process communications to optimize our ROS 1 pipelines. We have never used nodelets and considered that, before learning nodelets on ROS 1, it may be better to migrate to ROS 2 since we have to eventually.

I understand that one of the better features of ROS 2 is having a unified API for what used to be nodes and nodelets. Now, the nodes that use zero-copy transport are the composable nodes, which need to be declared as components. If you don't use these composable nodes, ROS2 would act essentially like ROS 1, copying messages between nodes.

I understood that these components could be launched as either "normal" nodes or as composable nodes inside a container. However, packages such as image_publisher create the component and a separate script with a main body, which is added as an executable and used to launch the process as a normal node.

Is this the correct way to build nodes that act both as normal and as composable nodes? Is there a way to directly launch a component as a normal node using roslaunch?

Thank you.

edit retag flag offensive close merge delete