Ask Your Question

master slave and changing IP addresses

asked 2014-02-24 22:11:40 -0500

Garrick gravatar image

i'm on the university network and they can't offer static ip addresses. the main problem is when driving the robot through different wifi networks and getting a new IP.

i have the robot set up as the master (or i could make it slave if i have to) and i came up with a work around sort of like DynDNS, where once i get a new ip i send it to my google drive and can access it.

problem is dynamically changing the ROS_MASTER_URI and ROS_IP variables. I'm pretty sure as soon as u start a node they're locked to that node. is there no way to change it while the node is running?

otherwise it's essentially required that the computers running ROS and communicating together have static IPs.

if i can't dynamically change the IP addresses of running nodes i guess the best solution then, for a mobile computer running nodes is to have an 4G/LTE modem attached to it? am i right in assuming that this should provide me with the same IP address throughout its lifetime?

or maybe i'll have to make some "communication" nodes on both the robot and the controller.

thank you for your time.

edit retag flag offensive close merge delete


I am not a network expert at all, but if you disconnect and reconnect to another network won't all connections be broken and would need to be reestablished anyways?

dornhege gravatar image dornhege  ( 2014-02-25 00:51:06 -0500 )edit

i sort of tested this today. i had the master running on the robot computer (the one i expect to move through the wifi networks) and hit the wifi on/off button to shut down the wifi. the uni network is a bit weird because it gave me the same ip address. but anyways. once i reconnected the internet..

Garrick gravatar image Garrick  ( 2014-02-25 02:00:56 -0500 )edit

.. (sorry, not internet, network) the control pc (which was running a joy node) was still able to communicate with the master/robot and drive it round. also when the master was dced i couldn't view any topics on the control, but when it was connected again i could see all the topics that were...

Garrick gravatar image Garrick  ( 2014-02-25 02:04:18 -0500 )edit

running. and this is all without restarting any nodes... did the same with the control pc (disconnecting). once it reconnected was still able to drive the robot around. but like said. i'm scared the ip will be locked when nodes are created. one thing that might fix this is hosts and a DNS server?

Garrick gravatar image Garrick  ( 2014-02-25 02:06:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-02-25 02:09:11 -0500

Garrick gravatar image

does anyone think that by using hostnames and setting that up. then changing the table where IPs are mapped to hostnames when the IP changes this will solve it? or will it only resolve the hostname once when nodes are created?

thanks for all help and comments

edit flag offensive delete link more


Try setting up network such that the machines are reachable via hostnames, i.e. do not use ROS_IP (see Now what happens when the IP address changes I am not sure. Don't know how robust the ROS transport. New connections and requests should be ok,

demmeln gravatar image demmeln  ( 2014-02-25 04:17:27 -0500 )edit

but not sure what happens to established connections between nodes (i.e. subscribed topics).

demmeln gravatar image demmeln  ( 2014-02-25 04:18:03 -0500 )edit

I'm not sure what you mean by "table where IPs are mapped to hostnames".

demmeln gravatar image demmeln  ( 2014-02-25 04:19:10 -0500 )edit

And lastly, try to edit your question rather than posting follow-ups are answers ;)

demmeln gravatar image demmeln  ( 2014-02-25 04:19:35 -0500 )edit

thanks for the reply. will try mucking around with hostname. with the "table" thing, i was thinking that that's how hostnames work. like there is some server that stores (hostname, ip address) pairs and if a hosts ip address changes it updates the pair. and other computers look up this "table"...

Garrick gravatar image Garrick  ( 2014-02-25 12:29:09 -0500 )edit

to get names. ROS could be smart about this and i guess check the server for changes in IP addresses. and change them accordingly. but i don't know. i'll try it out today. sorry about posting in the wrong places. thanks

Garrick gravatar image Garrick  ( 2014-02-25 12:30:12 -0500 )edit

Yes, this table is called DNS and proper setup of networking should include some form of DNS serivce, possibly locally.

demmeln gravatar image demmeln  ( 2014-02-25 14:40:20 -0500 )edit

P.S.: Not sure if you can use some form of VPN tunnel between the machines that is robust to network changes such that from the ros perspective IPs don't change.

demmeln gravatar image demmeln  ( 2014-02-25 14:43:22 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-02-24 22:11:40 -0500

Seen: 3,887 times

Last updated: Feb 25 '14