Ask Your Question
1

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

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

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 -0600

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 -0600 )edit
1

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

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 -0600

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 371 times

Last updated: Jul 12 '18