WSL ROS master cannot subscribe client topics

asked 2019-03-14 12:11:07 -0500

tburger gravatar image

Hello everybody,

Problem: My WSL ROS master cannot subscribe client topics. Every topic is listed in "rostopic list" and "rostopic info" shows the right subcribers and publisher. On WSL i can echo my client topics but the Callback function from my WSL node gets never triggered.

Setup: I want to use a WSL machine as a ROS master and a Raspberry Pi as a ROS client. The Pi creates a WLAN connection and the WSL connects to it through a WLAN-stick. My WSL can create a ssh access to my Pi.

Windows 10 - WSL

  • Name:DESKTOP
  • Ubuntu 18.04.1
  • ROS melodic 1.14.3
  • Wifi0 IP 10.0.0.2

Raspberry Pi 3b+

  • Name: piRobot
  • Raspbian Stretch
  • ROS kinetic
  • Wlan0 10.0.0.1

Config WSL in bashrc: "export ROS_MASTER_URI=http://10.0.0.2:11311" and "export ROS_IP=10.0.0.2" Config WSL in/etc/hosts: "10.0.0.1 piRobot" and "10.0.0.2 DESKTOP"

Config Pi in bashrc: "export ROS_MASTER_URI=http://10.0.0.2:11311" and "export ROS_IP=10.0.0.1" Config Pi in/etc/hosts: "10.0.0.1 piRobot" and "10.0.0.2 DESKTOP"

Pi uses the roscore from WSL: WORKS

Pi subscribes Pi topics: WORKS

Pi subscribes WSL topics: WORKS

WSL subscribes WSL topics: WORKS

WSL subscribes Pi topics: FAIL

WSL echo Pi topics: WORKS

I used the tutorial listener and talker nodes.

Thanks for the help!

edit retag flag offensive close merge delete

Comments

I exactly the same problem. I used the tutorial that you did and I copied the same code to 2 other machines where it works as expected. I have gone through all of the network testing that ROS suggests ROS Networking Setup and they all pass. The subscriber works with a publisher on wsl but not with the publisher on another system. Subscribers on other systems do get the wsl publisher messages.

So if you have found a solution, I would really appreciate hearing it.

starnovice gravatar image starnovice  ( 2019-08-06 10:48:00 -0500 )edit

Hello,

I could not fixed this problem. I have not tried it with the Windows Update 1903. With every Windows update they are improving the WSL, maybe try it with 1903 or the new coming update 1908.

Have a nice day!

tburger gravatar image tburger  ( 2019-08-07 05:22:45 -0500 )edit

Tried with 1903 and did an apt-get update, still no joy. I just wish I could find out where the messages are going. They are being sent and recieved by other machines. I just don't know if the network stack is throwing them away or if the callback is not getting invoked. Thanks for your feedback.

starnovice gravatar image starnovice  ( 2019-08-07 15:54:28 -0500 )edit

I have almost the same problem. I'm running roscore on the Raspberry Pi:

  • On WSL I can subscribe to topics that are published on the Pi
  • On the Pi I cannot subscribe to topics that are published on WSL.
  • On WSL I cannot subscribe to topics published on WSL

Basically, things published on WSL do not go anywhere.

ROS_MASTER_URI set to Pi ROS_IP set to WSL IP address on WSL, and set to Pi IP address on Pi

I suppose it has something to do with WSL IP addressing.

Morris gravatar image Morris  ( 2020-12-15 22:51:42 -0500 )edit

Could you please do a roswtf form on both ends? I solved this before but can't remember how. I was about to say it looks like WSL can't ping Pi, but you are able to echo. One thing is, I would unset ROS_HOSTNAME if you are using ROS_IP. You can also just use IP addresses for ROS_HOSTNAME

OzzieTheHead gravatar image OzzieTheHead  ( 2021-04-30 10:58:18 -0500 )edit