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

ROS2 nodes stay alive and keep publishing after shutting down

asked 2021-09-28 10:07:58 -0500

Brulf gravatar image

Hi,

I am currently working with ROS2 Galactic on Ubuntu 20.04.3 LTS (Focal Fossa) on a project of mine.

The problem:

After stopping my launch file and shutting down my computer, the next time I open my computer, the topics are still being published on the respective topics. As far as my understanding of ROS2 goes, topics should only go up after registering the topics in a node and nodes are killed whenever the process in stopped. I never start up the nodes myself, however, when I type ros2 topic list the nodes already exist. Inspecting one tof he topics using ros2 topic echo /pointcloud show me the messages being published, so a process is running it.

Question

How do I kill these 'magic' nodes? Or at least prevent them from appearing at startup of my laptop?

What I already tried to do:

  • I tried looking up how to manually force kill nodes, which led me to this post which guided me to node lifecycles. There it states that using the ros2 lifecycle command to manage states for each node. However, nothing is showing up with ros2 lifecycle nodes and the question was also asked for Ubuntu 18.04 LTS on ROS2 Crystal

  • I tried to start the launch file again but then I get duplicate nodes: 1 'magic nodes' and 1 node that I am able to stop. The magic nodes stay alive even after forcefully shutting down my laptop.

  • I also tried to kill all the processes on my laptop using suggestions from superuser.com

However, none of these things have worked, so any help is very much appreciated!

edit retag flag offensive close merge delete

Comments

There are DDS tools for this, but a quick check with Wireshark should show you where the DDS traffic is coming from. If that's not an IP associated with your machine, it would be a host on your network, as @jeremya suggests.

Unless you've setup something like a systemd job, have added something to the auto-start programs, or have a Docker container that was started with --restart always, ROS 2 nodes do not start up by themselves.

And just to make sure: "shutting down" does actually mean: shutting down and powering off, right? Wouldn't be the first time someone describes putting their laptop to sleep / standby or hibernate/suspend as "shutting down my pc".

gvdhoorn gravatar image gvdhoorn  ( 2021-09-28 12:14:48 -0500 )edit

A quick update: The problem seems to have fixed itself. However, I was not in time to try out @gvdhoorn or @jeremya 's suggestions, since I just left it alone since I was really frustrated about it. I am working together with multiple people on this project and we are testing all the time and are sharing the same network. So it could very well be the case that it is another host on the network. If I encounter the problem again tomorrow I will keep you updated. So far thank you for all the suggestions

Brulf gravatar image Brulf  ( 2021-09-28 14:11:25 -0500 )edit

I only have one machine on my network. I have just discovered that after I kill all my nodes some of them are still alive. Logging out and back in does not clear everything. Had to reboot.

Alexander gravatar image Alexander  ( 2022-07-12 06:46:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-09-28 11:58:51 -0500

jeremya gravatar image

updated 2021-09-28 12:00:42 -0500

Is another machine running ROS2 on your network? You might want to try disconnecting your computer from the network and seeing if you still have traffic.

If it is other ROS2 nodes on your network, you can use export ROS_DOMAIN_ID=1 or some other domain ID other than the default of zero.

edit flag offensive delete link more

Comments

This was indeed the case. Someone else was publishing the exact same topics hence the 'magic' topics. Thank you for helping @gvdhoorn and @jeremya

Brulf gravatar image Brulf  ( 2021-09-29 05:20:04 -0500 )edit

Not sure whether it helps avoid discovery traffic, but you could try to set ROS_LOCALHOST_ONLY (#q333687). Alternatively, some RMWs support whitelisting of specific interfaces.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-29 05:39:28 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2021-09-28 10:07:58 -0500

Seen: 1,787 times

Last updated: Sep 28 '21