ROS remote setup and node coordination
Hi everyone,
Perhaps such a situation is quite rare but my problem is here:
I have my robot running with a RasPi acting as ROS master, which mainly is responsible for sensor data collection and actuation with commands from a remote laptop. My laptop runs a bunch of nodes and they are able to listen to the messages from RasPi side but the messages from nodes of the laptop side. However, the nodes on RasPi can normally listen to the messages published from the laptop side. Why such things happened and how can I solve it?
Asked by bennywan on 2020-07-05 07:29:32 UTC
Comments
No, it's actually quite common in multi-machine setups.
Can you tell us which previous posts you've read about this problem, what you've tried and what did and did not work?
Asked by gvdhoorn on 2020-07-05 08:28:14 UTC
@gvdhoorn, I found no other posts telling similar situations. I set both side ROS_MASTER_URI to same address, and tried to set the Laptop ROS_IP/ROS_HOSTNAME to either local IP or RasPi IP but not fixing the problem
Asked by bennywan on 2020-07-05 08:56:13 UTC
Using Google to search (and appending
site:answers.ros.org
) with this query: two computers messages only one way site:answers.ros.org returns quite a few results for me.Asked by gvdhoorn on 2020-07-05 08:59:06 UTC
Set
ROS_IP
to the IP of the host. Do not set it to IPs of other computers. That would make no sense.Set
ROS_MASTER_URI
tohttp://ip.of.rasb.pi:11311
on both machines.Make sure to do this in every new terminal, or add it to your
.bashrc
.Do not set
ROS_HOSTNAME
to IPs. Only use it if you have a working DNS which resolves both your laptop's hostname and the Pi's. Do not set bothROS_IP
andROS_HOSTNAME
.Asked by gvdhoorn on 2020-07-05 09:01:13 UTC