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

[ros2cli] Cannot get the lifecycle state of lifecycle demo nodes?

asked 2018-07-12 12:41:25 -0500

thinwybk gravatar image

I tried to get the lifecycle of the lifecycle demo node lifecycle_listener but got Node not found.

In terminal A:

$ ros2 daemon start
The daemon has been started
$ ros2 run lifecycle lifecycle_listener

In terminal B:

$ ros2 lifecycle get lifecycle_listener
Node not found

Even if I try to get the lifecycle from the node launched with the launch file with $ ros2 launch lifecycle lifecycle_demo.launch.py I get Node not found.

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
1

answered 2018-07-12 12:52:44 -0500

Dirk Thomas gravatar image

Please run ros2 node list in the terminal B to see the names of running nodes. You will see that the node name is actually lc_listener. You could also use tab completion in a shell like bash to provide the available name: ros2 lifecycle get <tab>.

Anyway the result is still Node not found. If you call ros2 service list you will see that the listener node only has parameter related services (not sure why that is the case). Please try to run the lifecycle_talker instead. That one shows the lifecycle related service and will also report the lifecycle state correctly.

PS: You don't have to start the daemon manually. That happens automatically when needed.

edit flag offensive delete link more

Comments

Ah, makes total sense then...

thinwybk gravatar image thinwybk  ( 2018-07-12 12:55:13 -0500 )edit
1

answered 2018-07-12 12:51:19 -0500

Karsten gravatar image

I believe this is to be expected.

It might be misleading, but the lifecycle_listener is actually a regular node, and not a lifecylcle node. https://github.com/ros2/demos/blob/ma...

The listener node here is only showcasing the events getting published when a lifecycle node is changing state. The functionality you're looking for should work for the lifecycle talker ( https://github.com/ros2/demos/blob/ma... ).

Terminal A:

 ➭ ros2 run lifecycle lifecycle_talker

Terminal B:

 ➭ ros2 lifecycle get lc_talker
unconfigured [1]
edit flag offensive delete link more
0

answered 2018-07-12 12:51:49 -0500

thinwybk gravatar image

The lifecycle of demo node lc_talker can be checked.

$ ros2 lifecycle get lc_talker
inactive [2]

The lifecycle state of lc_listener cannot be checked due to [ERROR] [lc_client]: Service /lc_talker/change_state is not available..

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-07-12 12:41:25 -0500

Seen: 1,161 times

Last updated: Jul 12 '18