Setup.
Windows 10 with all recent updates.
Ubuntu 20.04 inside WSL2 on that Windows. Also, all recent updates.
ROS2 rolling release, installed in Windows 10. The release uses CycloneDDS. For some reason I cannot run neither Foxy, nor Galactic installation. Here is the description of the bug: https://github.com/ros2/ros2/issues/1164
ROS2 Galactic, installed on Ubuntu inside WSL2 from Debian packages, recently updated.
Problem
Limited communication between ROS2 nodes, running on Windows and on Ubuntu/WSL2.
Default interface
ROS2 node on windows always tries to use Ethernet instead of WSL2 virtual network. This was solved by setting following CycloneDDS config:
<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd">
<Domain id="any">
<General>
<NetworkInterfaceAddress>172.30.224.1</NetworkInterfaceAddress>
<AllowMulticast>true</AllowMulticast>
<MaxMessageSize>65500B</MaxMessageSize>
<FragmentSize>4000B</FragmentSize>
<Transport>udp</Transport>
</General>
<!-- <Discovery>-->
<!--<Peers>-->
<!--<Peer address="172.30.227.89"/>-->
<!--<Peer address="172.30.224.1"/>-->
<!--</Peers>-->
<!--<ParticipantIndex>auto</ParticipantIndex>-->
<!--</Discovery>-->
<Tracing>
<Verbosity>fine</Verbosity>
<OutputFile>c:/work/cyclonedds/cdds-win.${CYCLONEDDS_PID}.log</OutputFile>
</Tracing>
</Domain>
</CycloneDDS>
set CYCLONEDDS_URI=c:/work/cyclonedds/cdds_wsl2_win.xml
Similar config has been set for ros2 on Ubuntu/WSL
I've tried commenting and uncommenting "Discovery" tag, the situation doesn't change.
Multicast
Commands
ros2 multicast send
ros2 multicast receive
don't show any output, if one of them is run on Windows and another - on Ubuntu/WSL, no matter, what OS runs receive.
Talker/listener from demo nodes
I've got the following table, showing when the listener listens "Hellos" from the talker. Only two combinations out of 8. Any version of talker on Linux (Python or C++) and C++ listener on Windows.
Windows Linux
cpp talker cpp listener -> no connection
cpp listener cpp talker -> connected!
py talker py listener -> no connection
py listener py talker -> no connection
py talker cpp listener -> no connection
cpp talker py listener -> no connection
py listener cpp talker -> no connection
cpp listener py talker -> connected!
Question
How can I debug and resolve it?
Originally posted by wl on ROS Answers with karma: 127 on 2021-09-01
Post score: 1