Since communication over ROS2 across WSL2 border doesn't work out of the box, here's my notes for getting it to work.
Make sure to select cyclonedds RMW on both ends:
(Linux)
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
(Windows)
set RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
If it complains that RMW implementation is not installed, install it with sudo apt install ros-humble-cyclonedds ros-humble-rmw-cyclonedds-cpp
.
Additionally, on Windows, due to the presence of many (virtual) network interface, we have to tell CycloneDDS to use the correct one:
<?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>
<Interfaces>
<NetworkInterface name="vEthernet (WSL)" />
</Interfaces>
</General>
</Domain>
</CycloneDDS>
Save the above to a file, and point it to the CYCLONEDDS_URI
variable, e.g.:
set CYCLONEDDS_URI=c:/CycloneDDS/wsl2.xml