Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 88

connection between ros2_foxy node on Ubuntu (wsl) and python script on Win10

Previous: Answer by scott.nortman@gmail.com for I have the ros2_foxy set-up on Ubuntu 20.04 LTS via wsl. I created talker and listener as per tutorial: https://index.ros.org/doc/ros2/Tutori... and they work perfectly. I can easily see sent and received messages.Now, I need my already created (as per tutorial above) talker to send messages through some port that I could listen to, with the subscriber written in python, on Windows, without using ros. In other words, let say, my ros node on Ubuntu sends message "hello" and my running script on Windows receives it.I would also like to do talker on Windows and listener on Ubuntu. The next step would be communicating between different machines through network, but I'd settle on one machine for now.I've checked the ports on Ubuntu and these are additional ones that open after running talker and listener (I used sudo lsof -i -P -n):COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEtalker 882 root 8u IPv4 360947 0t0 UDP *:7400talker 882 root 9u IPv4 360950 0t0 UDP *:7412talker 882 root 11u IPv4 360956 0t0 UDP *:7413talker 882 root 13u IPv4 360964 0t0 UDP *:42399talker 882 root 14u IPv4 360965 0t0 UDP 127.0.0.1:44588listener 893 root 8u IPv4 350949 0t0 UDP *:7400listener 893 root 9u IPv4 350953 0t0 UDP *:7414listener 893 root 11u IPv4 350962 0t0 UDP *:7415listener 893 root 13u IPv4 350972 0t0 UDP *:36302listener 893 root 14u IPv4 350973 0t0 UDP 1xx.0.0.1:3xxxxI've check the open ports in command prompt on windows and none of above match any of the ports on windows. I used netstat -a -b command.Is there any way to create maybe a socket on both systems that could communicate? Which port should I use and how to establish that on both ends? Would that be in the code or maybe some env var? Please bare in mind, I'm not not well acquainted with neither ros nor linux, so any more elaborate explanation of the problem would be much appreciated.If anyone has done something similar in C++ that would be a big help, too. Thanks!update: I found out some of the ports change randomly and these would be last 2 of each, listener and talker. Maybe there's a way to define, in ros, the port they would be using?
$
0
0
I have the ros2_foxy set-up on Ubuntu 20.04 LTS via wsl. I created talker and listener as per tutorial: https://index.ros.org/doc/ros2/Tutorials/Writing-A-Simple-Py-Publisher-And-Subscriber/#pypubsub and they work perfectly. I can easily see sent and received messages. Now, I need my already created (as per tutorial above) talker to send messages through some port that I could listen to, with the subscriber written in python, on Windows, without using ros. In other words, let say, my ros node on Ubuntu sends message "hello" and my running script on Windows receives it. I would also like to do talker on Windows and listener on Ubuntu. The next step would be communicating between different machines through network, but I'd settle on one machine for now. I've checked the ports on Ubuntu and these are additional ones that open after running talker and listener (I used sudo lsof -i -P -n): COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME talker 882 root 8u IPv4 360947 0t0 UDP *:7400 talker 882 root 9u IPv4 360950 0t0 UDP *:7412 talker 882 root 11u IPv4 360956 0t0 UDP *:7413 talker 882 root 13u IPv4 360964 0t0 UDP *:42399 talker 882 root 14u IPv4 360965 0t0 UDP 127.0.0.1:44588 listener 893 root 8u IPv4 350949 0t0 UDP *:7400 listener 893 root 9u IPv4 350953 0t0 UDP *:7414 listener 893 root 11u IPv4 350962 0t0 UDP *:7415 listener 893 root 13u IPv4 350972 0t0 UDP *:36302 listener 893 root 14u IPv4 350973 0t0 UDP 1xx.0.0.1:3xxxx I've check the open ports in command prompt on windows and none of above match any of the ports on windows. I used netstat -a -b command. Is there any way to create maybe a socket on both systems that could communicate? Which port should I use and how to establish that on both ends? Would that be in the code or maybe some env var? Please bare in mind, I'm not not well acquainted with neither ros nor linux, so any more elaborate explanation of the problem would be much appreciated. If anyone has done something similar in C++ that would be a big help, too. Thanks! update: I found out some of the ports change randomly and these would be last 2 of each, listener and talker. Maybe there's a way to define, in ros, the port they would be using?

Viewing all articles
Browse latest Browse all 88

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>