Ask Your Question

Composable LifeCycle Node

asked 2019-09-20 06:13:06 -0500

eric1221bday gravatar image

updated 2019-09-20 12:56:30 -0500

Reading the demos and examples as well as the rclcpp source, it seems that currently the LifeCycleNode interface is a completely independent interface from the normal Node class, with the normal node embedded inside it. In principle it seems there should be nothing stopping us from making lifecycle nodes which are also composable and be able to load multiple managed nodes in one executable.

However, as it stands I think neither the launch system not the composable container interface can support this use case? Trying to register and load a life cycle node as a component on run time unsurprisingly yields a Poco exception.

undefined symbol: _ZN16rclcpp_lifecycle15node_interfaces22LifecycleNodeInterface10on_cleanupERKNS_5StateE)

In addition in the launch_ros interface currently the lifecycle and component launch interface are entirely separate and seems to have nothing to do with each other. Even if I compose at compile time and launch a single executable using the lifecycle interface of launch_ros, I'm not sure if it is able to correctly emit and receive the correct events.

Has anyone tried this before? It would be quite cool to have both working together since lifecycles and a unified node API were IMO one of the two most impactful features in ROS 2.

EDIT: Just as a bit of an update, I eventually tried to run a lifecycle node with manual composition, it does work since the lifecycle transitions are just service calls, but I had to use the CLI to invoke the transitions. Still not sure if launch_ros can handle this situation correctly

edit retag flag offensive close merge delete


I'd like to see some feedback on this too. I have found the same shortcoming in the launch_ros architecture. @William - any comment?

Josh Whitley gravatar image Josh Whitley  ( 2020-02-19 00:44:51 -0500 )edit

Hi, is there any update on this? All I could find is this issue:

relffok gravatar image relffok  ( 2020-03-24 18:27:37 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-04-02 17:21:22 -0500

Josh Whitley gravatar image

It is possible to develop a node which inherits from rclcpp::LifecycleNode and also is registered as a component. You can find an example that I did a while back for Dashing here. However, I believe that the shortcoming in launch_ros still exists, even in Eloquent. I've created an issue on the launch_ros Github repo to get visibility.

edit flag offensive delete link more


I believe this issue covers the same functionality:

rasmusan- gravatar image rasmusan-  ( 2020-04-03 03:42:52 -0500 )edit

Thanks, I think you're right. I closed it as a duplicate.

Josh Whitley gravatar image Josh Whitley  ( 2020-04-06 12:57:34 -0500 )edit

Your Answer

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

Add Answer

Question Tools



Asked: 2019-09-20 06:13:06 -0500

Seen: 297 times

Last updated: Apr 02 '20