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

Which interface should I bind to on a robot with mobile internet?

asked 2015-05-29 04:08:38 -0600

Simon Harst gravatar image

I've currently got a robot running in the wild with a stick for mobile UTMS installed which creates a network interface usb0 with IP Furthermore, I've got a VPN set up which routes any traffic targeted at directly to the robot, so if I set ROS_MASTER_URI to on my desktop PC, I can see the topics on the robot. So far, so good.

I have however had problems where the stick might spontaneously drop its interface and consequently the ROS system breaks down. While I should of course get to the bottom of why the interface simply drops, it got me thinking that I'd like to have the robot running independently from the stick altogether. Since the robot is not dependent on the internet to run and I'd just like to once and again check on a topic, it would be nice if the stick can just be removed and reinstalled without the system caring much.

Is there any way in which I can have the ROS_MASTER_URI set to a static interface (e.g., localhost), and just extract or insert a message here and there using the VPN connection? Or am I looking at this from the wrong angle?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2015-06-02 03:44:07 -0600

Simon Harst gravatar image

Bummer. I was thinking in the wrong direction entirely. The ROS core is accessible on a port of a system and not "bound" to any interface.

On machine A:

export ROS_HOSTNAME=machine-a

export ROS_MASTER_URI=http://machine-a:11311/

On machine B:

export ROS_HOSTNAME=machine-b

export ROS_MASTER_URI=http://machine-a:11311/

Bam! As soon as the hostname "machine-a" is known on machine B, a connection will be established. If for any reason the hostname isn't known, one can of course also spell out the IP (if it's known):

Say machine A has the VPN-IP and machine B has the IP

On machine B:

Make sure ROS_HOSTNAME isn't set, because it overrides ROS_IP:


export ROS_IP=


edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-05-29 04:08:38 -0600

Seen: 219 times

Last updated: Jun 02 '15