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

How am I supposed to make a LifecycleNode in rclcpp?

asked 2022-12-12 05:36:59 -0500

Per Edwardsson gravatar image

The implementation of my next node fits well with the LifecycleNode pattern, so I thought I would implement one using it. I go to the rclcpp GitHub page and ask myself, what do I need to inherit from the LifecycleNode and perform all transitions properly? The GitHub page refers me to the API page ( It looks a lot like an API page, not a tutorial page. Maybe I am not good enough at reading API's, but I sure could not figure out how to make a LifecycleNode based on looking around the API.

I am also referred to the design documents, which do give an idea of what the rclcpp implementation needs, but not necessarily what I as a user need.

I am also referred to the quality declaration, where rclcpp_lifecycle intends to be a Quality Level 1 category, which includes all _kinds_ of documentation.

Is there a decent guide or example available that I just missed?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-12-12 08:24:11 -0500

gvdhoorn gravatar image

Searching for lifecycle on leads to Managing nodes with managed lifecycles, which points to ros2/demos/humble/lifecycle.

edit flag offensive delete link more


That's a good place to end, thanks for providing the link. For the record, when I searched for lifecycle on I mainly got links to change logs and release posts. It's there, but I hope you agree that this is not particularly ergonomic. A link from the GitHub readme would not be too much, I think.

Per Edwardsson gravatar image Per Edwardsson  ( 2022-12-12 08:36:23 -0500 )edit


I would suggest you post this as an issue on the rclcpp repository's tracker.

It's not going to have good visibility as a comment / question on ROS Answers.

gvdhoorn gravatar image gvdhoorn  ( 2022-12-12 12:35:44 -0500 )edit

Looks like you did that: ros2/rclcpp#2064.

gvdhoorn gravatar image gvdhoorn  ( 2022-12-13 04:39:06 -0500 )edit

Yep! Thanks for guidance. ๐Ÿ‘

Per Edwardsson gravatar image Per Edwardsson  ( 2022-12-13 05:11:48 -0500 )edit

Question Tools

1 follower


Asked: 2022-12-12 05:36:59 -0500

Seen: 239 times

Last updated: Dec 12 '22