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

Issue with getting nodes to publish/subscribe to topics between computers.

asked 2020-05-29 19:19:54 -0500

jbattistini gravatar image

updated 2020-05-31 04:17:25 -0500

gvdhoorn gravatar image

I seem to be having an issue with getting two nodes to publish/subscribe to a topic when going through a master. I have a raspberry Pi that I am trying to run teleop_twist_keyboard to publish a \cmd_vel to a topic that will be read by a PWM board. If I run all 3 nodes on the raspberry Pi while still connecting to my laptop it works, however if I try and run the teleop_twist_keyboard from my laptop it no longer works.

I have attached two pictures of the node layout. The first is with them running on the same Pi and the second is with the node running separately on my laptop. I'm sorry if this is something simple I'm just not sure where I'm going wrong.

Actually it seems I cannot upload pictures as I do not have enough points! Either way, the Pi version shows the two nodes connected by the topic /cmd_vel while the Laptop does not even though they are the same files. I'm pretty new to this so I'm sorry if my question is not very clear

Here is the pi picture

Here is the laptop picture

edit retag flag offensive close merge delete

Comments

Please attach your rqt_graph screenshots. I've given you sufficient karma.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-30 04:47:26 -0500 )edit

I have attached them, thank you!

jbattistini gravatar image jbattistini  ( 2020-05-30 17:01:07 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-05-30 09:58:31 -0500

Dragonslayer gravatar image

link text

If your setup, described in the link is OK, I would suggest switching of the firewall. Should work fine. I dont have my ros pc available but in the end it was putting the lines (with your real network data) in to the .bashrc

  • ROS_HOSTNAME=XXX
  • ROS_MASTER_URI=XXX
edit flag offensive delete link more

Comments

I'm a little confused from this link. I've been using the master URI given by roscore when I start it up and that doesn't use the IP address. It uses the computers hostname so "jarrett-xps ..." If I try to connect to the main computer using the IP address instead it doesn't seem to work. Does it matter if I use the local IP?

Going through this way, though I am having a similar problem. If I run the listener on the Pi and the talker on the laptop it works, but if I switch the two it does not.

jbattistini gravatar image jbattistini  ( 2020-05-30 17:28:28 -0500 )edit

link text I would suggest reading up on Name Resolution here. It doesnt have to be an IP. Name and Port works as well.

You say talker on pc --> listener on PI works now, wasnt that what your question was asking for? Teleop on PC publishing to PI? Your master runs on the PI? Did you switch off the firewalls?

Dragonslayer gravatar image Dragonslayer  ( 2020-05-31 10:11:45 -0500 )edit

Thank you, I'll read up on name resolution.

I am trying to learn ROS and logically that doesn't make sense to me. Why would it matter where the publisher/subscriber to a topic is? If they are connected to the same master, shouldn't they be able to find each other? I did try switching off my firewall and it didn't seem to help. I'm really struggling with network communication and I figured whatever I'm missing here could be why.

jbattistini gravatar image jbattistini  ( 2020-05-31 12:42:23 -0500 )edit

They are connected by the mentioned entries. If that works, it should work yes. I assume you switched off the firewall on both computers?

Dragonslayer gravatar image Dragonslayer  ( 2020-05-31 13:08:32 -0500 )edit

Yes I did, there must be some mistake in what I'm doing then. I don't see a reason why publishing/subscribing should only work one way. I'll keep looking to try and find my error.

jbattistini gravatar image jbattistini  ( 2020-05-31 13:12:04 -0500 )edit

Lets get more systematic. Everything except teleop runs on the Pi? Rostopic list on both machines show what? rostopic info cmd_vel shows what? Your receiving node listens to what topic(rosnode info)? Try "roswtf --all" (link text)

Dragonslayer gravatar image Dragonslayer  ( 2020-05-31 13:51:25 -0500 )edit

With the changes that have been made I can't even seem to use the launch file created to run the nodes anymore. I can run the nodes individually and they seem to work OK, but using the roslaunch command I get this error

Unable to contact my own server at [http://192.168.1.127:39573/].
This usually means that the network is not configured properly.

A common cause is that the machine cannot ping itself.  Please check
for errors by running:

ping 192.168.1.127

For more tips, please see

http://www.ros.org/wiki/ROS/NetworkSetup

The traceback for the exception was written to the log file

I can ping the machine so that's not the issue and I would assume its something in my network setup. I guess I just don't understand how this could be an issue when it can communicate with ...(more)

jbattistini gravatar image jbattistini  ( 2020-05-31 14:21:20 -0500 )edit

What changes have been made? launchfile where, what launchfile? Why dont reverse the "changes"? Whats in your .bashrc? Whithout the data and files nobody can help you.

Dragonslayer gravatar image Dragonslayer  ( 2020-05-31 14:34:24 -0500 )edit

Question Tools

Stats

Asked: 2020-05-29 19:18:09 -0500

Seen: 449 times

Last updated: May 31 '20