Zeroconf is a set of network protocols that provide automatic discovery of network resources. This package provides tools to announce the availability of the ROS Master and to locate ROS Master nodes on the local network. This package uses Avahi to implement Zeroconf. Avahi is installed by default on many Linux distributions. Compatibility with MacOS may be possible in the future, and patches are greatly appreciated.
Any feedback on this package would be useful, as automatic discovery of robots connected to the local network will be a needed for some applications in the near future.
Install the ihr_tools stack.
For the lazy or reckless, the following should update all the config files correctly on Ubuntu 10.04. There is currently no guarantee this will work and it might delete your computer.
1 make install
Avahi does not currently support ROS service types and the build script isn't installed by default.
The following commands will install updated files if you have not modified them, if you have previously modified these files you should know what to do. In the future a patch needs to be sent to the Avahi maintainers.
Additional translations or corrections are welcome.
While not required, this is a useful GUI tool for using zeroconf. It can be installed on Ubuntu 10.04 by running the following and right clicking the top panel and selecting add to panel.
1 sudo aptitude install service-discovery-applet
The service-discovery-applet does not support ROS service types by default, however the following command will add support.
1 gconftool --load `rospack find zeroconf`/config/service-discovery-applet.xml
At this point there are three primary methods for using zeroconf at this point. In the future, it may be worth looking at integrating this functionality into rosmaster.
The easiest option is to add a zeroconf node to the launch file of the master. The obvious downside to this approach is that each launch file will need to be modified to include zeroconf. The upside is that it is simple and free of unintended consequences.
1 roslaunch zeroconf zeroconf.launch
Avahi supports system-wide service configuration files. This will announce the availability of the ROS Master service without running a separate node. The downside of this approach is that the service will be announced to the local network regardless of that state of rosmaster.
1 cp `rospack find zeroconf`/config/ros-master.service /etc/avahi/services/.
The provided launch file can be modified so that the zeroconf node only provide discovery of network resources without announcing the availability of the master.
Another approach is to add zeroconf directly to roscore startup via this patch. This has the advantage that the services will only be announce when rosmaster is running, and that individual launch files do not need to be modified. The downside is that it modifies roslaunch and that might be bad.
Think before patching...
The following command will call the discover_masters service and return a list of Masters and its associated MASTER_URI.
1 rosservice call /zeroconf/discover_masters
$ rosservice call /zeroconf/discover_masters masters: - master_name: Winston X. Robot master_uri: http://foo.local:11311 - master_name: Rob D. Robot master_uri: http://bar.local:11311
zeroconfPublishes service announcements of ROS Master URI via Zeroconf using Avahi, This node also provices a client server interface for polling a list of currently known ROS Masters found on the local network
- Discover a list of ROS Master URIs on the local network
Parameters~publish_master (bool, default: true)
- Publish the availability of the ROS Master
- This will often be the name of the robot if ROS is configure so that each robot runs ROS Master locally. It should be unique within the context of the local network, if it is not unique the name will be changed to something like "Unknown #3".
- This may or may not need to be changed for UDP
- The hostname defaults to whatever python thinks your hostname is, if this value is wrong it may cause timeout error during service resolution.
- One of the best features of zeroconf is every machine on the lan can be contacted through the local domain. Zeroconf resolves the IP addresses automatically so that the machine foo can be pinged by running ping foo.local.
- This is the port that the ROS Master listens on.
Newly proposed, mistyped, or obsolete package. Could not find package "zeroconf" in rosdoc: /home/rosbot/docs/en/api/zeroconf/manifest.yaml
- Service types probably need some sort of official approval
- Patches need to be sent to Avahi maintainers
- ROS Launch URIs are not currently announced, is this useful?