ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Node communication across machines

asked 2019-05-12 16:34:23 -0500

anvoice2 gravatar image

Hello, I have 2 nodes (publisher and listener) I want to run across 2 machines. One, a robot with a raspberry pi configured as a wireless access point running ROS melodic, has my laptop connected to it via wifi. The laptop also runs melodic. I am running roscore on the laptop, and following all the steps in the guide here. For some reason my laptop's name is not resolved by the pi, and so using export ROS_MASTER_URI=http://laptop-name:11311/ on the pi doesn't let me connect to the master, I instead do export ROS_MASTER_URI=http://laptop-IP:11311/. At that point the listener process on the pi can be launched without complaining about not being able to connect to master, but launching the publisher node does not do anything in the listener, which is verbose and prints data as it receives it. Launching both nodes on the laptop for example results in 2 communicating nodes as expected. So I seem to have 2 machines which can communicate, have roscore running, but get no communication between the nodes. I'd really appreciate any help with troubleshooting this issue. Thanks in advance.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2019-05-13 03:38:42 -0500

Veera Ragav gravatar image
rosrun rqt_graph rqt_graph

Run the above command in either RPI or laptop. Check if the publisher and subscriber are connected. This might look like this. image description

Note that you need to execute export ROS_MASTER_URI=http://laptop-IP:11311/ and export ROS_IP=RPI-IP in every terminal that you open in RPI. And on the laptop side(where master node runs) you need to execute export ROS_IP=laptop-IP for every terminal you open. You can add those in your ~/.bashrc so that you need not execute it every time you open the terminal. You can find the IP by executing hostname -I in terminal. A youtube video for your referenceYoutube Video

edit flag offensive delete link more

Comments

Thanks, that was it! The error was that I did not execue export ROS_IP=laptop-IP in the laptop terminal where I was running the publisher node, I thought executing it in any terminal would be enough. Before, rqt_graph showed 2 disconnected nodes, now it shows 2 nodes connected through a command velocity topic.

anvoice2 gravatar image anvoice2  ( 2019-05-13 13:41:07 -0500 )edit
1

answered 2019-05-13 01:18:10 -0500

gvdhoorn gravatar image

Provided you have a regular network setup (ie: not using a virtual machine, no custom firewalls, no filtering proxies): if you don't have a working DNS for all involved hosts, use ROS_IP and don't use hostnames anywhere.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-05-12 16:34:09 -0500

Seen: 477 times

Last updated: May 13 '19