rmw_connextdds icon indicating copy to clipboard operation
rmw_connextdds copied to clipboard

Add XML files to describe built-in QoS configuration

Open asorbini opened this issue 3 years ago • 1 comments

This PR introduces some example XML QoS profiles that users can derive from in their own configuration files to replicate the settings applied by default by rmw_connextdds.

These profiles will help applications to remain compatible with other applications when ENDPOINT_QOS_OVERRIDE_POLICY is set to never (or PARTICIPANT_QOS_OVERRIDE_POLICY, when/if #41 is merged).

The profiles are all stored in file rmw_connextdds/resource/xml/ros2_qos_profiles.xml, which contains the following profiles:

  • ros2::rmw.ros_discovery_info
  • ros2::rcl.node_parameters
  • ros2::rcl.log
  • ros2::rcl.builtin_endpoints
  • ros2::rmw_connextdds.base_participant
  • ros2::rmw_connextdds.base_application
  • ros2::rmw_connextdds.opt.large_data
  • ros2::rmw_connextdds.opt.unbounded_data
  • ros2::rmw_connextdds.opt.content_filtered_topic_property
  • ros2::rmw_connextdds.opt.localhost_only
  • ros2::rmw_connextdds.opt.fast_endpoint_discovery

Refer to the comments in the file for details about each profile.

Users should have their profiles include ros2::rmw_connextdds.base_application in their parent hierarchy to replicate the configuration used by rmw_connextdds out of the box, and use profiles ros2::rmw_connextdds.opt.* to introduce additional configurations that the RMW only applies optionally.

An example file (USER_QOS_PROFILES.example.xml) provides a template for what users should place in an application's runtime directory. The file contains a single profile which inherits from ros2::rmw_connextdds.base_application and adds rules to configure the QoS of topic "rt/chatter".

File ros2_qos_profiles.xml is now exported by rmw_connextdds and a new environment hook (only for non-Windows users at the moment) will automatically append it to NDDS_QOS_PROFILES, so that the profiles will be available to users without any further configuration.

For example, to use the profiles with the hello world examples and verify that they are compatible with the default settings, after building rmw_connextdds:

# In a terminal, run a talker with default settings
RMW_IMPLEMENTATION=rmw_connextdds \
ros2 run demo_nodes_cpp talker

# In another terminal (and directory, to make sure the talker doesn't pick up the configuration),
# run a listener with "never" policy and the custom XML configuration.
# Load profiles using variable NDDS_QOS_PROFILES.
RMW_IMPLEMENTATION=rmw_connextdds \
RMW_CONNEXT_PARTICIPANT_QOS_OVERRIDE_POLICY=never \
RMW_CONNEXT_ENDPOINT_QOS_OVERRIDE_POLICY=never \
NDDS_QOS_PROFILES="file://install/rmw_connextdds/share/rmw_connextdds/xml/USER_QOS_PROFILES.example.xml" \
ros2 run demo_nodes_cpp talker

asorbini avatar Apr 23 '21 04:04 asorbini

I have updated and extended the README quite a bit:

  • Revised the descriptions of various environment variable to make them more consistent with each other. All variables now have a brief explanations of their purposes, followed by a few usage examples, and then a more detailed description of their purpose.
  • Added a section about QoS configuration via XML, which includes a brief introduction to Connext's XML QoS configuration, and an overview of how users may customize the default QoS used by DomainParticipants and various endpoints. The section also includes a brief description of the "built-in" QoS profiles contained in file ros2_qos_profiles.xml.
  • Added a section about the DDS entities created by the RMW layer. This section goes into quite some detail to describe when the RMW implementation will create DDS entities, when they will delete these entities, and how the QoS configuration used by these entities is ultimately computed.

asorbini avatar Apr 29 '21 07:04 asorbini