The ROS Master provides naming and registration services to the rest of the nodes in the ROS system. It tracks publishers and subscribers to topics as well as services. The role of the Master is to enable individual ROS nodes to locate one another. Once these nodes have located each other they communicate with each other peer-to-peer.
The Master also provides the Parameter Server.
The Master is most commonly run using the roscore command, which loads the ROS Master along with other essential components.
Advanced Users Only
The ROS Master provides an XMLRPC-based API, which ROS client libraries, such as roscpp and rospy, call to store and retrieve information. For a detailed API listing, please see the Master API page. Most ROS users will not need to interact with this API directly.
Master Name Service Example
For instance, let's say we have two Nodes; a Camera node and an Image_viewer node. A typical sequence of events would start with Camera notifying the master that it wants to publish images on the topic "images":
Now, Camera publishes images to the "images" topic, but nobody is subscribing to that topic yet so no data is actually sent. Now, Image_viewer wants to subscribe to the topic "images" to see if there's maybe some images there:
Now that the topic "images" has both a publisher and a subscriber, the master node notifies Camera and Image_viewer about eachothers existence so that they can start transferring images to one another: