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

Running ROS Network on Non-Loopback Network Interface

asked 2020-08-03 15:46:37 -0500

luna gravatar image

updated 2020-08-05 14:52:14 -0500

Hello! I'm currently running a very simple ROS network based on the publisher/subscriber Python tutorials using ROS Melodic on Ubuntu 18.04.

I want for this network to be visible to machines outside of the network. However this doesn't seem to be possible and i believe it's because when I run the ROS network, it runs on the loopback network interface. This is very clear from the fact that if I run tshark -i lo, the HTTP/XML messages characteristic of ROS topic communication show up, as well as the default master node port (11311). This does not occur if I run tshark on any of the other network interfaces available from the server.

I've tried configuring the environmental variables (i.e. setting the ROS_MASTER_URI, ROS_HOSTNAME, and ROS_IP variables on the respective master/slave instances). Specifically, I've followed instructions from the following tutorials/forums, with no luck:

http://wiki.ros.org/ROS/Tutorials/Mul...

https://forums.balena.io/t/accessing-...

https://answers.ros.org/question/2101...

I've also tried suppressing the loopback interface in hopes of forcing the ROS network to use some other interface (eth0, eno1, etc.), but ROS just doesn't seem to run at all when I do that (and it also does not show up on tshark).

I think what I want to accomplish is something similar to the section "Alternate Network Interface" in this Turtlebot tutorial:

http://wiki.ros.org/Robots/TurtleBot/....

I just don't know how to configure the instructions to work more generally. (i.e. I don't know where the install.sh/install.bash files that I need to change are located).

Thank you so much in advance for any tips, suggestions, pointers, etc.!

UPDATE: I have gotten the ROS network to run on a non-loopback network interface, with the condition that one of the nodes I'm running is on a different machine. However, I'd still like to know if there's a way to move the ROS network onto a different interface when the network is contained on one machine.

edit retag flag offensive close merge delete

Comments

I want for this network to be visible to machines outside of the network

Can you please more clearly describe what you mean by this?

Are you trying to make it possible for ROS nodes on other machines (and/or other networks) to be able to subscribe to topics published to by nodes on your "very simple ROS network"?

The things you describe you did seem rather convoluted and should not at all be necessary.

Please also show any errors or warnings you've observed, as right now your post basically comes down to "I've tried A, B and C and it doesn't work", which is not something we can do anything with.

gvdhoorn gravatar image gvdhoorn  ( 2020-08-04 03:05:02 -0500 )edit

Thank you for your response!

In terms of clarifying my question, I want to run the ROS network on a non-loopback interface, like eth0 or eno2. It is my assumption that if the ROS network is not running on the loopback interface, which is completely internal on a single machine, that it will then be "visible" outside the network (i.e. another node from a different machine can connect to the master node and thus publish to those topics).

I haven't observed any errors or warnings. The issue lies more in the fact that no matter how I configure the environment, the ROS network only shows up on the loopback interface (when I run tshark).

luna gravatar image luna  ( 2020-08-05 14:42:40 -0500 )edit
1

I want to run the ROS network on a non-loopback interface

this is not really an answer to my question.

You've reiterated why you want to use your chosen solution, not why you believe what you chose is necessary.

It is my assumption that if the ROS network is not running on the loopback interface, which is completely internal on a single machine, that it will then be "visible" outside the network (i.e. another node from a different machine can connect to the master node and thus publish to those topics).

No, that's not really how it works.

There is no need to "disable lo" or any difficult reconfigurations of anything.

From your description it doesn't sound like there is anything special about your system/network.

Setting ROS_IP on each host to a reachable IP address and then setting ROS_MASTER_URI to http://<IP_OF_THE_HOST_RUNNING_THE_MASTER>:11311 should be ...(more)

gvdhoorn gravatar image gvdhoorn  ( 2020-08-06 03:47:59 -0500 )edit
1

Without more information on why using the regular approach didn't work -- or: what you observed which made you conclude it wasn't working -- it's going to be difficult to help.

If you still want us to help you: please provide more information on your network configuration:

  1. involved hosts
  2. their IP addresses, netmasks, etc
  3. what runs where (ie: ROS Master on PC1, PC2 runs other nodes)
gvdhoorn gravatar image gvdhoorn  ( 2020-08-06 03:50:20 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-06-22 05:20:31 -0500

Drader gravatar image

Hi,

I completely understand the original post. It's counterintuitive for ROS to publish to its loopback interface despite the routing tables correct determination of the network. I can recreate the error in my lab on Ubuntu 20.04.4 LTS running noetic.

The idea here would be that a self contained autonomous ROS implementation publish a topic over a network where a second self contained ROS implementation would subscribe to it.

The original post's idea of disabling the Loopback would have been to force it to publish over another (useful) interface. It seems perfectly logical, what am I missing?

edit flag offensive delete link more
0

answered 2020-08-06 19:38:31 -0500

tfoote gravatar image

There is no "ROS" network. ROS doesn't explicitly associate with a specific network, but leverages the IP routing on your host system. If you're setting things up in a container. You just need to make sure that the addresses that you're using are routable on all the systems in both directions and then it should work.

If you're using multiple networks you may need to setup appropriate routing rules to connect the networks appropriately. There are built in linux tools as well as most container infrastructure provide network configuration tools that you can use to make sure that the addresses are routeable.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-08-03 15:46:37 -0500

Seen: 578 times

Last updated: Aug 06 '20