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

Announce ROS master by zeroconf

asked 2014-03-05 08:21:03 -0500

Hendrik Wiese gravatar image

Hi folks,

I've got a robot that's supposed to be deployed and used in a very dynamic network. Thus it gets a different IP address everytime it is (re-)started. This robot however is also supposed to be controlled remotely. Part of its ROS stack is running on a different system. This system reliably needs to find the ROS master in the network and for this purpose, I assume, zeroconf is the best approach.

But I need to know how to configure everything. I couldn't find any tutorial, yet, and I suppose that some of you guys have already done something like this. I know there's a bunch of ros-hydro-zeroconf... packages. I've installed them and run a few of the examples. They work but I don't know how I integrate this stuff into my configuration.

Hence, I'd be really grateful if you could point me to the right direction, maybe a tutorial or something, or give me detailed advice on what I've got to do to set this up.

Thanks a lot!

Cheers, Hendrik

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
5

answered 2014-12-22 04:16:38 -0500

epascual gravatar image

Hello,

If your target is Linux based, you can use avahi-daemon on it to advertise it on the network as <hostname>.local by default (this can be modified by configuring the daemon). On the client side, you can then identify the target by its host name.

If you need the IP, the command avahi-browse -artp | grep <hostname>.local will output records providing details about the Avahi services published by the target, including one containing the IP. It is pretty easy to select and parse it thanks to cut and alike.

An alternative to the grep approach is to publish a service on the target side using avahi-publish. On the client side you can then use avahi-browse -t <servicename> -p which will limit the output records to the relevant ones.

This solution is independent from ROS and can be exploited in startup scripts, both on target an client sides. I've used it with success in a lot of various situations involving headless Linux based black boxes, including Raspberry ones.

Hope this helps

Regards, Eric

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2014-03-05 08:21:03 -0500

Seen: 340 times

Last updated: Dec 22 '14