ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

[ROS2] rclcpp::Node vs rclcpp_lifecycle::LifecycleNode

asked 2020-09-02 11:27:59 -0500

Myzhar gravatar image

Hi all, a philosophical question that tends to technical.

ROS2 has reached the 6th release and lifecycle nodes are not yet fully supported by all the ROS2 modules (e.g. image_transport).

Now my question:is it really worth continuing to work with lifecycle or is it better to move to standard nodes? Will ever lifecycle nodes get all the support that standard nodes receive?

Thank you Walter

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-09-02 14:13:49 -0500

Yes, it is worth using lifecycle nodes. Certain things though where component nodes might be better suited, those should take priority for the time being. Currently the launch system and components don't play well with lifecycle nodes so its a "one or the other" for the time being. Hopefully that will change soon.

Things like image_pipeline, for instance, we want to use components for the 0-copy low latency aspects of loading multiple nodes into the same process. This is especially important for image and pointcloud processing pipelines because we have large data flying around whose transport would be non-trivial.

But if components aren't as critical, like when passing around typical or smaller messages, then I would recommend lifecycle so that you can control the bringup and shutdown of your system in ways you never could in ROS1. Lifecycle will eventually get full support because it kind of has to and all the major projects like Navigation2 and Moveit2 either have all of their servers as lifecycle nodes now (or have it in their roadmap to complete very shortly).

I would not recommend using, in any situation, the standard node. There's so much benefit to be gained from either a component or lifecycle node, you should make use of at least one or the other since you have access to them.

edit flag offensive delete link more


I explain my situation. I'm updating the ROS2 wrapper for the Stereolabs ZED cameras. I started it with Bouncy and we decided to use the lifecycle model for all the reasons you cited. At that time TF broadcaster support was missing and Image Transport too, two fundamental features for the wrapper of a sensor like the ZED. So we decided to wait before improving the wrapper. Now we are back on developing, hoping that something changed, but the situation is yet the same both with Eloquent and Foxy. That's why I have the doubt that lifecycle will be always in late respect to standard components.

Myzhar gravatar image Myzhar  ( 2020-09-03 02:08:50 -0500 )edit

To solve this problem I'm using composition, I have two Node components: one subscribes to image and camera_info topics and republish them using image transport, the other subscribes to odom and pose topics and published the relative TFs. But you can understand that this is awful.

Myzhar gravatar image Myzhar  ( 2020-09-03 02:26:36 -0500 )edit

Question Tools



Asked: 2020-09-02 11:27:59 -0500

Seen: 1,195 times

Last updated: Sep 02 '20