Skip to content

Instantly share code, notes, and snippets.

@fferri
Created January 16, 2023 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fferri/637558ca6eff7d67c22c2f80954c32c5 to your computer and use it in GitHub Desktop.
Save fferri/637558ca6eff7d67c22c2f80954c32c5 to your computer and use it in GitHub Desktop.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment