ROS remote setup and node coordination

asked 2020-07-05 07:32:22 -0500

bennywan gravatar image

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?

edit retag flag offensive close merge delete

Comments

Perhaps such a situation is quite rare [..]

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?

gvdhoorn gravatar image gvdhoorn  ( 2020-07-05 08:28:14 -0500 )edit

@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

bennywan gravatar image bennywan  ( 2020-07-05 08:56:13 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2020-07-05 08:59:06 -0500 )edit

tried to set the Laptop ROS_IP/ROS_HOSTNAME to either local IP or RasPi IP but not fixing the problem

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 to http://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 both ROS_IP and ROS_HOSTNAME.

gvdhoorn gravatar image gvdhoorn  ( 2020-07-05 09:01:13 -0500 )edit