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

Wrap rclcpp::Node with basic Lifecycle behavior?

asked 2021-11-12 08:21:07 -0500

msmcconnell gravatar image

updated 2021-11-12 12:31:41 -0500

I have a system built leveraging multiple rclcpp::Lifecycle nodes for managing system lifecycle. I would like to include an external non-lifecycle node in this system, but ideally allow it to be controlled through the same management mechanisms. Is there any ROS2 tool out there which can wrap an existing rclcpp::Node with a basic lifecycle behavior. For example maybe the node doesn't actually launch at all until the active state is hit? I think as it stands now having a non-lifecycle node in your system seems to immediately degrade the system to a non-lifecycle compliant state.

Edit: My current plan is to write my own ComponentManager (based of the rclcpp implementation) which is a lifecycle node and will defer node loading until activate is called. When deactivate is called it would unload the nodes. While obviously not very efficient I think this will enforce the minimal portion of the lifecycle behavior (preventing interactions with other nodes when not ACTIVE) as well as supporting shutdown behavior. I will post here if this works, unless someone shares a better solution first.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-11-17 17:41:14 -0500

msmcconnell gravatar image

Seems the approach I described in my "Edit:" does work. I think I will probably try to upstream this for others and I have posted as such on ROS Discourse. https://discourse.ros.org/t/launch-wr...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-11-12 08:21:07 -0500

Seen: 184 times

Last updated: Nov 17 '21