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