Note: This tutorial assumes that you have completed the previous tutorials: Understanding Service Types, Debugging with Avahi Command Line Tools. |
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. |
Publishing a Ros Master with Avahi
Description: Illustrates how to publish a zeroconf service for your ros master with avahi.Keywords: zeroconf ros master avahi
Tutorial Level: BEGINNER
Next Tutorial: Discovering Ros Masters with Avahi
Launching
Zero-Conf'ing With Zero Configuration
There is a little bit of magic in the ros node for zeroconf_avahi that auto-generates a unique name based on your host and also auto-detects the port that your ros master is running on.
If your ros master is already running:
> roslaunch zeroconf_avahi ros_master.launch
Alternatively, to add it to a launcher of your own:
<include file="$(find zeroconf_avahi)/resources/launch/ros_master.launch"/>
Zeroconf'ing with Unique Configuration
To zeroconf the ros master with a specific service name, simply recreate ros-master.roslaunch with a substituted name and use that, e.g.:
1 <launch>
2 <node ns="zeroconf" pkg="zeroconf_avahi" type="zeroconf" name="zeroconf" output="screen">
3 <rosparam param="services">
4 [ { name: "Concert Master", type: _ros-master._tcp, port: 11311, domain: local } ]
5 </rosparam>
6 </node>
7 </launch>
Testing
You can test to make sure you can see it with the avahi command line tools:
> avahi-browse -r _ros-master._tcp