A ROS multiple machine protocol is a common system in ROS to have multiple machines communicate with each other. In a multiple machine protocol the purpose of the computers can be put into two types.
MASTER NODE
The first type is the master node. The purpose is to act as a nucleus for a machine network. Code sent in packets is first sent to the master node to either do an action itself or to cause another node to do an action. If ROS MMP was a baseball game the master node would be the batter. The ball (representing packets) is sent to it and it'll respond accordingly. Just like in the game there can only be one batter at a time.
SLAVE/SERVANT NODE
The second type is the slave node, otherwise called the servant node. Back in the baseball game analogy, servant nodes are the pitcher and all the other players on the field. They do a specific task that creates a packet which is sent to the master node. This can include pretty much anything; motors, cameras, and sensors mostly come to mind.
PUBLISHERS AND SUBSCRIBERS
Within the servant and master nodes, there are publisher and subscriber files. These are the way to send information between machines. The Publisher file sends packets of information through a data stream between the two nodes. The Subscriber file catches a specific packet it's specified to and uses the data to do its defined task. Example publisher and subscribers are linked below within the ROS Wiki (Your new best friend).
WRITING PUBLISHER AND SUBSCRIBER (Python)
WRITING PUBLISHER AND SUBSCRIBER (C++)
Packets (MSG and SRV files)
Information about packets and their types can be seen in this link below.
SETTING UP THE MULTIPLE MACHINE PROTOCOL (WIP)
NOTE: Multiple Machine Protocol is more networking than coding. The only real coding you'll do is the publisher and subscriber from above.
Multiple Machine Protocol requires a unique static IP for each node in the system. More information about IPs will be below, but at this point I expect you to know what an IP is.
First you'll need to modify your ROS bashrc file by adding two commands to the end of the file.
Commands will be these:
Further Information for Environment Variables can be looked at [HERE]
Once this is completed you can launch ROS with the roslaunch command. A Publisher should be run on the ROS servant node, and a Subscriber on the ROS master node. This can still work reversed though.
With this, you've completed the basics for a ROS multiple machine protocol! Congrats.
-Maz