Skip to content

Commit

Permalink
Update 2021-09-28-IAC-experiences-from-the-trenches.md
Browse files Browse the repository at this point in the history
  • Loading branch information
roncapat authored and JEnoch committed Jul 7, 2023
1 parent f513bf9 commit bf54894
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion content/blog/2021-09-28-IAC-experiences-from-the-trenches.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ All the cars’ software is based on [Autoware](https://www.autoware.org/) + [RO
## Lesson 1: Avoid DDS traffic over constrained transport
As seen in a [previous blog](../2021-03-23-discovery), the amount of discovery traffic generated by DDS in a ROS2 context with a lot of nodes/publishers/subscribers can be extremely problematic on wireless transports such as WiFi or CURWB. In these deployments, you really want to constrain the DDS traffic to be bound to wired networks or even better not to leave the host. Then, you can transparently rely on **Eclipse zenoh** for communication over the wireless network through the [zenoh/DDS bridge](https://github.com/eclipse-zenoh/zenoh-plugin-dds).

In IAC’s race cars, ROS2 nodes are deployed on a single host -- either in the car or in the base station. Thus, we can instruct CycloneDDS to only use the loopback interface by adding to the configuration file the two lines marked below.
In IAC’s race cars, ROS2 nodes are deployed on a single host -- either in the car or in the base station. Thus, we can instruct CycloneDDS to only use the loopback interface by adding to the configuration file the two lines marked below (CycloneDDS < 0.10).

```XML
<CycloneDDS xmlns="https://cdds.io/config"
Expand All @@ -40,6 +40,26 @@ In IAC’s race cars, ROS2 nodes are deployed on a single host -- either in the
</CycloneDDS>
```

**Update**: for CycloneDDS >=0.10 use this file instead:
```XML
<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>
<NetworkInterface address="127.0.0.1" multicast="true"/> <!-- This line -->
<MaxMessageSize>65500B</MaxMessageSize>
<FragmentSize>4000B</FragmentSize>
</General>
<Internal>
<Watermarks>
<WhcHigh>500kB</WhcHigh>
</Watermarks>
</Internal>
</Domain>
</CycloneDDS>
```

The [`<AssumeMulticastCapable>`](https://github.com/eclipse-cyclonedds/cyclonedds/blob/master/docs/manual/options.md#cycloneddsdomaininternalassumemulticastcapable) option is necessary to workaround some OS (typically Linux) erroneously declaring the loopback interface as not capable of doing UDP multicast.

You can also explicitly activate multicast on loopback on Unix systems doing:
Expand All @@ -48,6 +68,8 @@ sudo route add -net 224.0.0.0 netmask 240.0.0.0 dev lo
sudo ifconfig lo multicast
````

**Update**: from `zenoh-bridge-dds` v0.6.0 onwards, there is support for [ROS_LOCALHOST_ONLY environment variable](https://github.com/eclipse-zenoh/zenoh-plugin-dds/pull/93). This means that you can skip manual CycloneDDS XML configuration if you only need to restrict CycloneDDS to `localhost` only, as in this blog post.

------
## Lesson 2: Use the Right Transport for your Data

Expand Down

0 comments on commit bf54894

Please sign in to comment.