Robotics StackExchange | Archived questions

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

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 192.168.8.100. Furthermore, I've got a VPN set up which routes any traffic targeted at 192.168.8.100 directly to the robot, so if I set ROSMASTERURI to http://192.168.8.100:11311 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 ROSMASTERURI 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?

Asked by Simon Harst on 2015-05-29 04:08:38 UTC

Comments

Answers

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 10.15.13.2 and machine B has the IP 10.15.13.3:

On machine B:

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

unset ROS_HOSTNAME

export ROS_IP=10.15.13.3

export ROS_MASTER_URI=http://10.15.13.2:11311/

Asked by Simon Harst on 2015-06-02 03:44:07 UTC

Comments