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

ros2cli lifecycle: shutdown transition?

asked 2018-09-04 17:09:47 -0600

Myzhar gravatar image

updated 2018-09-05 02:19:59 -0600

I noticed using the console command "ros2 lifecycle set node" I cannot force a "shutdown (5)" transition since it is not available in the transition list. I can force the transition using the "service", why not using "lifecycle"?

Thank you Walter

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-09-04 19:28:46 -0600

Karsten gravatar image

Thanks for reporting this. This is indeed a wrong in the way we currently call the lifecycle API from the command line interface.

So what's happening? The command line interface currently calls get_available_transitions and returns a list of all possible transitions of the state machine. However, all these transitions are actually the unique id's of each individual transition which describes the complete graph of the state machine. That's why you see transitions such as configure_error. This is for example the unique (internal) id of the transition from the transition state configurING to error_processing, which you are not able to trigger from the outside. It just happens to have configure, cleanup, activate and deactivate (as the internal ID and the transitions you can trigger) as they are uniquely defined for one action to take. In the case of shutdown, there are - as you've figured out - multiple occasions where you could call it. That's why you have unique IDs for shutdown from each of these states: unconfigured_shutdown, inactive_shutdown, active_shutdown.

This service is nice because it lets you introspect the complete state machine, but I agree it's in fact not the list of transitions you really want. What you want is to have a list of transitions you can currently trigger on a specific state. For this we need another service which returns that list.

I ticketed the issue here:

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-09-04 17:09:47 -0600

Seen: 482 times

Last updated: Sep 05 '18