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

ROS2: node vs managed node

asked 2018-08-28 10:34:22 -0500

Myzhar gravatar image

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

edit retag flag offensive close merge delete

Comments

Any particular reason for using ardent instead of bouncy?

Geoff gravatar image Geoff  ( 2018-08-28 19:39:53 -0500 )edit

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

Myzhar gravatar image Myzhar  ( 2018-08-29 13:50:34 -0500 )edit

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

Myzhar gravatar image Myzhar  ( 2018-08-29 13:53:40 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-08-28 19:47:01 -0500

Geoff gravatar image

updated 2018-12-03 10:15:51 -0500

lucasw gravatar image

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.

edit flag offensive delete link more

Comments

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.

Myzhar gravatar image Myzhar  ( 2018-08-29 02:26:47 -0500 )edit

you should be able to easily compile the ros2 lifecycle package on top of your ardent workspace.

Karsten gravatar image Karsten  ( 2018-08-29 14:41:45 -0500 )edit

You are right. I'm going to try it ๐Ÿ‘

Myzhar gravatar image Myzhar  ( 2018-08-29 14:44:46 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-08-28 10:34:22 -0500

Seen: 1,940 times

Last updated: Dec 03 '18