Skip to content

Dynamic QoS Matching for Router Endpoints Based on Subscriber Requirements #503

@Tuntenfisch

Description

@Tuntenfisch

Problem Description:

Currently, the Fast DDS Router, when forwarding topics between different ROS_DOMAIN_IDs (or more generally, DDS domains), creates its internal DDS DataReaders and DataWriters with a default QoS profile that often uses BEST_EFFORT reliability. This occurs regardless of the QoS settings of the original publisher or the ultimate subscriber in the ROS 2 ecosystem.

This default behavior leads to issues when a ROS 2 publisher is publishing with RELIABLE reliability and a ROS 2 subscriber on the other side of the router is also expecting RELIABLE reliability. The router's internal BEST_EFFORT endpoints break the chain of reliability, preventing the ROS 2 subscriber from connecting to the router's BEST_EFFORT publisher.

Example Scenario:

  1. ROS_DOMAIN_ID=1: A ROS 2 node publishes topic /my_topic with RELIABLE reliability.
  2. Fast DDS Router: Configured to bridge ROS_DOMAIN_ID=1 and ROS_DOMAIN_ID=2.
    • The router creates an internal DDS DataReader on domain 1 for /my_topic. ros2 topic info -v reveals this reader uses BEST_EFFORT.
    • The router creates an internal DDS DataWriter on domain 2 for /my_topic. ros2 topic info -v reveals this writer uses BEST_EFFORT.
  3. ROS_DOMAIN_ID=2: A ROS 2 node subscribes to /my_topic with RELIABLE reliability.

Outcome: The subscriber on Domain 2 cannot connect to the router's DataWriter on domain 2 because of the QoS mismatch (RELIABLE subscriber vs. BEST_EFFORT publisher).

Current Workaround:

The current workaround is to manually specify the QoS settings (e.g., RELIABLE reliability) for each affected topic in the Fast DDS Router's YAML configuration file.

While this works, it has limitations:

  • It requires manual configuration for every topic that needs a specific QoS other than the router's default.
  • It's not dynamic. If subscribers with different QoS profiles for the same topic exist, the static configuration might not satisfy all of them optimally (though a RELIABLE router publisher can serve both RELIABLE and BEST_EFFORT subscribers).

Proposed Feature:

A new mechanism or an enhancement to the existing behavior where the Fast DDS Router can dynamically adjust the QoS of its internal DataReader and DataWriter endpoints to better match the requirements of the actual discovered subscribers.

Desired Behavior:

  1. When the router discovers a publisher for a topic it intends to forward (e.g., /my_topic from domain 1, published with RELIABLE reliability).
  2. When the router discovers a subscriber for the same topic on a different domain (e.g., /my_topic on domain 2, subscribing with RELIABLE reliability).
  3. The router should:
    • Create its internal DataReader (on domain 1) with a QoS profile that is compatible with both the original publisher's QoS and the requirements of the downstream subscriber(s). Ideally, if the subscriber needs RELIABLE, the router's reader should also attempt to be RELIABLE (assuming the original publisher supports it).
    • Create its internal DataWriter (on domain 2) with a QoS profile that matches or is compatible with the discovered subscriber's QoS. If the subscriber requests RELIABLE, the router's writer for that path should also be RELIABLE.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions