Note: This tutorial assumes that you have completed the previous tutorials: Understanding Service Types, Publishing a Ros Master with Avahi. |
Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Discover Ros Masters with Avahi
Description: Illustrates how to discover ros master services with avahi.Keywords: zeroconf ros master avahi
Tutorial Level: BEGINNER
Next Tutorial: Zeroconf Using Ros Api with Avahi
Launching
> roslaunch zeroconf_avahi ros_browser.launch
Alternatively, if you want to include it in an already existing launcher:
<include file="$(find zeroconf_avahi)/resources/launch/ros_browser.launch"/>
Topics & Services
This will set up a few topics and services that will be useful for resolving the available ros masters.
new_connections, lost_connections : topics that provide up-down status of services in (almost) real time.
list_discovered_services : service that returns a list of the currently discovered services.
Testing
You can test to make sure you can see ros master services with the avahi command line tools:
> avahi-publish -s "Concert Master" _ros-master._tcp 8888
You should see the discovery node start feeding you with information about your newly published service.
Refer to the notes on service types for an explanation of the cryptic _ros-master._tcp specification.