eclipse-cyclonedds / cyclonedds

Eclipse Cyclone DDS project
https://projects.eclipse.org/projects/iot.cyclonedds
Other
888 stars 363 forks source link

CycloneDDS ROS networking setup with failure-resistant network interface on host system #2117

Open KevS272 opened 4 weeks ago

KevS272 commented 4 weeks ago

Hi everyone!

I am relatively new to using ROS2 and CycloneDDS so my understanding of verything around CycloneDDS as RMW are not super clear to me.

My problem is quite straightforward, and maybe you have an idea on how to solve this:

I set up ROS2 Humble within a Docker container. Additionally, I use an IMU from Olive, which also runs ROS2 Humble and CycloneDDS and publishes ROS2 messages. To receive the data from the IMU on my host system, I need to set the NetworkInterface within the cyclonedds.xml to the interface appearing on my host when plugging in the IMU like this (Assuming the IP of the interface to which the IMU is sending its data is 192.168.40.100):

<?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/iceoryx/etc/cyclonedds.xsd">
    <Domain id="any">
        <General>
            <Interfaces>
                <NetworkInterface address="192.168.40.100"/>
            </Interfaces>
        </General>
        <SharedMemory>
            <Enable>true</Enable>
        </SharedMemory>
        <Internal>
            <HeartbeatInterval>50 ms</HeartbeatInterval>
        </Internal>
    </Domain>
</CycloneDDS>

At least, that's what Olive says in their documentation: https://olive-robotics.com/?page_id=592

However, I want to avoid that my ROS networking crashes if e.g. the IMU is unplugged, resulting in a disappearance of the network interface with the IP 192.168.40.100.

My plan was to create a virtual tap interface that I set as the address within my cyclonedds.xml instead and then somehow add my IMU as a peer, but nothing seemed to work until now.

What would you recommend when it comes to setting up the networking for this setup? Also, do I only need to make changes to the cyclonedds.xml file on my host or also on the IMU itself?

Thanks in advance! BR Kevin