WSL: Subscribing & Publishing from ROS nodes does not work
The current state of WSL makes working with ROS nodes on WSL impossible.
What works
- ros kinetic can be installed using the standard installation procedure.
- The
roscorestarts without displaying errors (since build 14965)
What doesn’t work
- Already something simple as
rostopic echo /rosoutfails with the message
[WARN] [1479567965.827686]: Inbound TCP/IP connection failed: connection from sender terminated before handshake header received. 0 bytes were received. Please check sender for additional details.
It seems that the implementation of network sockets on WSL is still incomplete.
I tested this on builds 14965 and 14971.
More information
- http://answers.ros.org/question/238646/installing-ros-on-ubuntu-bash-in-windows-10/
- http://wiki.ros.org/ROS/TCPROS
To help prioritize this issue, I created a post on User Voice
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 2
- Comments: 38 (3 by maintainers)
Commits related to this issue
- libros: Win10 WSL compat fix (wip). Debugged by @bxwllzz. Ref: https://github.com/Microsoft/BashOnWindows/issues/1391#issuecomment-300091788. — committed to gavanderhoorn/ros_comm by gavanderhoorn 10 years ago
Just tested this and it seems to work. I’m not entirely sure about commenting that
ROS_ASSERT(..)though.See gavanderhoorn/ros_comm@c83508d for the diff.
Nice work @bxwllzz 👍.
Would be nice if you could submit a PR against
ros_commto get this merged into mainline.I have determined the problem. The problem lies in the ROS. Line 316 in ros_comm/roscpp/src/libros/transport/transport_tcp.cpp
It assumes that the
connectmethod of non-blocking scoket should return -1 andlast_socket_error()should returnROS_SOCKETS_ASYNCHRONOUS_CONNECT_RETURN(=EINPROGRESS). But a non-blockingconnectcan return 0 when TCP connection to 127.0.0.1 (localhost). http://stackoverflow.com/questions/14027326/can-connect-return-0-with-non-blocing-socketHi there! I have just apt-installed ros kinetic on WSL Ubuntu 16.04. The python talker/listener example only works as long as I start both from the same bash. Is that still the issue here? Wasn’t it fixed in October 2017?
A bit more on the symptoms: I can run a roscore in one bash window, then in another I execute
or
and everything works as expected. When I run
rostopic listfrom another bash window, it also shows the /chatter topic but neitherlistener.pynorrostopic echoreceive anything.Any help appreciated!
FYI : As of today, ROS kinetic (ros_comm 1.12.7) work out of box on WSL 16299.19, without changing source tree.
https://answers.ros.org/question/238646/installing-ros-on-ubuntu-bash-in-windows-10/
I have submit a PR to
ros_commhttps://github.com/ros/ros_comm/pull/1050Replace
in
ros_comm/roscpp/src/libros/transport/transport_tcp.cppwithTOPIC of ROS works. Test success in ROS/Tutorials/WritingPublisherSubscriber(python), ROS/Tutorials/ExaminingPublisherSubscriber and turtlesim
Easiest is probably to use an overlay workspace with just
ros_commchecked out and built from sources.The issue persists in 15048