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

ROS Node shuts down after WiFi connection has been lost

asked 2022-05-27 21:36:49 -0500

aikhs gravatar image

Several of the ROS node for some reason just exit/shut down whenever the WiFi interface loses connection to the WiFi.

So when WiFi interface is connected, the device has some IP address and also a private address:

10.0.1.10 and 172.17.0.1

Then, when the device goes to some dead zone with no WiFi connectivity and the IP address for that network disappears and only private IP address is shown (172.17.0.1) then some of the ROS nodes just shutdown.

I tried to set up the ROS_HOSTNAME to localhost and it works (ros nodes do not shutdown) but it means I won't be able to echo rostopics from that device from another machine which is required.

I am running ROS in Docker container with network mode being a host.

What could be the reason for such stange behaviour?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-05-28 07:08:48 -0500

Mike Scheutzow gravatar image

A ros1 node assumes that the network device continues to exist, and that the IP address never changes. Of course, this applies to the ros master node as well. I don't know if ros2 has a similar design assumption. If this is your only networking option, then all your ros nodes need to run on the robot.

I could find surprisingly few questions about this subject on this site, only #q215036. But beware: that user's suggestion to create a VPN is a fairly advanced networking topic.

edit flag offensive delete link more

Comments

That is the thing, all nodes to run on the robot but why would some of them shutdown if network disappears? Shouldn't they use the localhost for communication?

aikhs gravatar image aikhs  ( 2022-05-28 07:23:55 -0500 )edit

For the case we're discussing here, the linux stack does not "migrate" an existing connection from one IP to another (e.g. from 192.168.1.10 to 127.0.0.1). If you told a ros node to use a particular IP address for its connections, then that IP must not disappear; if it does then bad things happen.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-05-28 10:22:51 -0500 )edit

I am not telling the exact IP address. I do not think this is correct, this is internal communication that does not really use real ports as in normal TCP/IP communication and internal communication is rather loopback device. So my default, nodes in one device with localhost being a ros master it should not matter if public IP address disappeared or not and it is confirmed on my laptop that nothing really happens but on the robot the same setting causes nodes to shutdown. I guess this is something to do with nodes not using a loopback

aikhs gravatar image aikhs  ( 2022-05-28 17:52:53 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-05-27 21:36:49 -0500

Seen: 103 times

Last updated: May 28 '22