Running ROS across multiple machines [closed]
I am attempting to run ROS across multiple machines. To test if everything is working, I'm trying to run a publisher on one machine, and subscribe to the published messages on the other machine. My setup is as follows:
Machine1 has the IP 192.168.1.101 (machine_1_ip)
Machine2 has the IP 192.168.1.111 (machine_2_ip)
I have edited the /etc/hosts file on each machine to reflect this:
Machine1 /etc/hosts has the entry: 192.168.1.111 Machine2
Machine2 /etc/hosts has the entry: 192.168.1.101 Machine1
I can ping between the machines just fine.
I set up the ROS_MASTER_URI and ROS_MASTER_IP on 1 and 2:
Machine1:
export ROS_MASTER_URI=http://Machine1:11311
export ROS_IP=machine_1_ip
Machine2:
export ROS_MASTER_URI=http://machine_1_ip:11311
export ROS_IP=machine_2_ip
Then, I run the following launch file:
<launch>
<machine name="Machine1" address="machine_1_ip" ros-root="$(env ROS_ROOT)"
ros-package-path="$(env ROS_PACKAGE_PATH)" user="mach1user" default="true" />
<machine name="Machine2" address="machine_2_ip" ros-root="$(env ROS_ROOT)"
ros-package-path="$(env ROS_PACKAGE_PATH)" user="mach2user" />
<node name="master_node" pkg="master_node" type="Master.py" />
<env name="ROS_MASTER_URI" value="http://Machine1:11311" />
</launch>
master_node is running a simple publisher that I want to subscribe to from Machine2. The publisher publishes a series of strings.
From Machine2, I can run rosnode/rostopic/rosservice list and see everything that's running on Machine1 (including the topic I want to subscribe to). However, when I run a subscriber on Machine2, it stops at the line that is supposed to subscribe. It doesn't give an error, it just sits there until I kill it (and it doesn't give an error after I kill it either).
I am fairly new to ROS, but I've read up on all the multiple machines and network setup stuff. I'm really not sure what's going wrong. Any help would be much appreciated! Thanks!
Where did the cinemaster ros master line come from?
Sorry about that. I was changing the names to make them more "universal" but I forgot that one. It should be Machine1 (our master machine).
What exactly do you see when you run "rostopic info" on the topic (from each machine) when all the nodes are running?