0
$\begingroup$

Rosanswers logo

Hello, I'm starting to port a node from ROS1 to ROS2 (ardent). One of the novelty that seems more promising in ROS2 is the lifecycle of the nodes, but I cannot find a complete examples if not the lifecycle demo.

All the ROS drivers that I found on Github do not use the "managed node" interface, but they are simply created as ROS1 nodes with the only difference that they are derived from rclcpp::Node.

What really concerns me is how to manage a "managed node"... is there a node to control the status of it?

Thank you Walter


Originally posted by Myzhar on ROS Answers with karma: 541 on 2018-08-28

Post score: 1


Original comments

Comment by Geoff on 2018-08-28:
Any particular reason for using ardent instead of bouncy?

Comment by Myzhar on 2018-08-29:
Because it is not yet available as debian installer under Ubuntu 16.04. I'm not migrating to Ubuntu 18.04 since I'm using also the Jetson TX2 and the latest Jetpack is still based on 16.04

Comment by Myzhar on 2018-08-29:
However today I tried to manage the NODE using CLI service calls and I can correctly change state. One thing I expected was that after calling a Shutdown the node closed, instead it remains in "finalized" state and the only way to kill it is the standard Ctrl+C

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The lifecycle demo is a fairly complete example. You should also look at the managed nodes wiki page, which talks about the example and what is going on.

Managed nodes can be controlled using the ros2 lifecycle command. Run ros2 lifecycle -h to get its help. It's still a little rudimentary - you have to specify a transition as text, rather than being able to say "activate node X", for example. But it does work. But the big thing for managed nodes is that the new launch system uses them. You will be able to do things like launch all the nodes and only activate them when all nodes are actually ready to run, ensuring you don't get a half-started system.


Originally posted by Geoff with karma: 4203 on 2018-08-28

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Myzhar on 2018-08-29:
Thank you for the answer. ros2 lifecycle is not available with Ardent, but you gave me the reply I was searching for: the launch system.

Comment by Karsten on 2018-08-29:
you should be able to easily compile the ros2 lifecycle package on top of your ardent workspace.

Comment by Myzhar on 2018-08-29:
You are right. I'm going to try it 👍

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.