Skip to content

Commit b1b0545

Browse files
committed
Add description of built-in ROS QoS profiles
Signed-off-by: Andrea Sorbini <[email protected]>
1 parent 20271ee commit b1b0545

File tree

2 files changed

+209
-30
lines changed

2 files changed

+209
-30
lines changed

README.md

Lines changed: 192 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ For any questions or feedback, feel free to reach out to [email protected].
3838
- [Customize DomainParticipant QoS](#customize-domainparticipant-qos)
3939
- [Customize Endpoint QoS](#customize-endpoint-qos)
4040
- [Built-in ROS 2 QoS Profiles](#built-in-ros-2-qos-profiles)
41-
- [Built-in Connext QoS Profiles](#built-in-connext-qos-profiles)
4241
- [DDS Entities Created by the RMW Layer](#dds-entities-created-by-the-rmw-layer)
4342
- [DomainParticipantFactory](#domainparticipantfactory)
4443
- [DomainParticipant](#domainparticipant)
@@ -870,9 +869,9 @@ You might also be interested in learning more about [topic filters](https://comm
870869
will be shared by all Nodes associated with that context (typically all Nodes created
871870
by a process).
872871
873-
Since only one DomainParticipant will be typically be created by each ROS 2 process,
874-
users may rely on Connext's default QoS configuration to customize the QoS
875-
of the DomainParticipant from an external XML file:
872+
Since only one DomainParticipant will be typically created by each ROS 2 process,
873+
users may rely on Connext's [default QoS configuration](https://community.rti.com/static/documentation/connext-dds/6.0.1/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/index.htm#UsersManual/Overwriting_Default_QoS_Values.htm?Highlight=is_default_qos)
874+
to customize the QoS of the DomainParticipant from an external XML file:
876875
877876
```xml
878877
<dds>
@@ -901,7 +900,7 @@ and how to use them.
901900
### Customize Endpoint QoS
902901
903902
`rmw_connextdds` will include the topic name when querying for the default QoS values
904-
to use for a new DDS endpoint. This allows users to take advantage of [topic filters](https://community.rti.com/static/documentation/connext-dds/6.0.1/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/index.htm#UsersManual/Topic_Filters.htm)
903+
used by a new DDS endpoint. This allows users to take advantage of [topic filters](https://community.rti.com/static/documentation/connext-dds/6.0.1/doc/manuals/connext_dds/html_files/RTI_ConnextDDS_CoreLibraries_UsersManual/index.htm#UsersManual/Topic_Filters.htm)
905904
in QoS XML files to set different defaults for different topics.
906905
907906
The only caveat is that filters must be expressed using the mangled version of the
@@ -953,10 +952,10 @@ You can disable this behavior altogether or selectively for specific topics by
953952
selecting one of the alternative "QoS override" policies available via
954953
environment variable [RMW_CONNEXT_ENDPOINT_QOS_OVERRIDE_POLICY](#rmw-connext-endpoint-qos-override-policy).
955954
956-
For example, using the XML file above with a `demo_nodes_cpp/talker` instance,
957-
it is possible to completely disable all ROS QoS settings for the customized
958-
topics even if the application was not designed to use the `SYSTEM_DEFAULT` special
959-
value:
955+
For example, after saving the XML file presented earlier as `./USER_QOS_PROFILES.xml`,
956+
it would be possible to run a `demo_nodes_cpp/talker` instance, and completely disable
957+
all ROS QoS settings for the selected topics, even though the application was not built
958+
to use the `SYSTEM_DEFAULT` ROS QoS policy values:
960959
961960
```sh
962961
RMW_IMPLEMENTATION=rmw_connextdds \
@@ -966,19 +965,197 @@ ros2 run demo_nodes_cpp talker
966965
967966
A similar result can also be achieved using the `never` "QoS override" policy,
968967
but the XML QoS profile would require some modifications, for example by making it
969-
extend profile `ros2::rmw_connextdds.base_application`, for all the application
970-
to remain compatible with other applications using the default ROS 2 QoS profiles.
968+
extend profile `ros2::rmw_connextdds.base_application`. Otherwise, the application
969+
would not be able to communicatedd with other applications using the default
970+
ROS 2 QoS profiles over the "built-in" endpoints created by the RMW and `rcl`
971+
layers.
971972
972973
See [Built-in ROS 2 QoS Profiles](#built-in-ros-2-qos-profiles) for more information
973-
about this and other useful QoS profiles contained in file [ros2_qos_profiles.xml](rmw_connextdds/resource/xml/ros2_qos_profiles.xml).
974+
about some useful QoS profiles contained in file [ros2_qos_profiles.xml](rmw_connextdds/resource/xml/ros2_qos_profiles.xml) that can be used to automatically configure "built-in"
975+
endpoints and to replicate several of the QoS optimizations applied by
976+
`rmw_connextdds`.
974977
975978
### Built-in ROS 2 QoS Profiles
976979
977-
TODO
980+
#### ros2_qos_profiles.xml
978981
979-
### Built-in Connext QoS Profiles
982+
File [ros2_qos_profiles.xml](rmw_connextdds/resource/xml/ros2_qos_profiles.xml)
983+
contains various QoS profiles that model the default configuration applied
984+
by `rmw_connextdds` and other ROS 2 core packages, such as `rcl`.
980985
981-
TODO
986+
Users of `rmw_connextdds` on a shell (ie. not on Windows) may refer to any of the
987+
included profiles in their own QoS configuration files without any further configuration,
988+
because the file is automatically loaded into their shell environment by hooks installed
989+
by `rmw_connextdds` using variable `NDDS_QOS_PROFILES`.
990+
991+
On other platforms, or for use with any non-ROS 2 Connext application, you should
992+
manually export the file's path using variable `NDDS_QOS_PROFILES`:
993+
994+
```sh
995+
export NDDS_QOS_PROFILES="file:///path/to/ros2_qos_profiles.xml"
996+
```
997+
998+
When `rmw_connextdds` is built from source, the file will be automatically installed
999+
under `<install-prefix>/rmw_connextdds/share/rmw_connextdds/xml/ros2_qos_profiles.xml`.
1000+
1001+
You could also make these profiles available to any application sharing the same
1002+
Connext installation by copying the file (or its contents) to
1003+
`${NDDSHOME}/resource/xml/NDDS_QOS_PROFILES.xml`.
1004+
1005+
`ros2_qos_profiles.xml` contains a single QoS library named `ros2`, and containing
1006+
the following QoS profiles:
1007+
1008+
- [`ros2::rmw.ros_discovery_info`](#ros2--rmwros-discovery-info)
1009+
- [`ros2::rcl.node_parameters`](#ros2--rclnode-parameters)
1010+
- [`ros2::rcl.log`](#ros2--rcllog)
1011+
- [`ros2::rcl.builtin_endpoints`](#ros2--rclbuiltin-endpoints)
1012+
- [`ros2::rmw_connextdds.base_participant`](#ros2--rmw-connextddsbase-participant)
1013+
- [`ros2::rmw_connextdds.base_application`](#ros2--rmw-connextddsbase-application)
1014+
- [`ros2::rmw_connextdds.opt.large_data`](#ros2--rmw-connextddsoptlarge-data)
1015+
- [`ros2::rmw_connextdds.opt.unbounded_data`](#ros2--rmw-connextddsoptunbounded-data)
1016+
- [`ros2::rmw_connextdds.opt.content_filtered_topic_property`](#ros2--rmw-connextddsoptcontent-filtered-topic-property)
1017+
- [`ros2::rmw_connextdds.opt.localhost_only`](#ros2--rmw-connextddsoptlocalhost-only)
1018+
- [`ros2::rmw_connextdds.opt.fast_endpoint_discovery`](#ros2--rmw-connextddsoptfast-endpoint-discovery)
1019+
1020+
Most users should consider using profile [`ros2::rmw_connextdds.base_application`](#ros2--rmw-connextddsbase-application) as the base profile to begin
1021+
customization of the DDS QoS used by their applications.
1022+
1023+
This profile will provide the same QoS settings used by default by `rmw_connextdds`
1024+
(i.e. when no custom [runtime configuration](#rmw-runtime-configuration) is specified).
1025+
1026+
Alternatively, profiles [`ros2::rcl.builtin_endpoints`](#ros2--rclbuiltin-endpoints)
1027+
and [`ros2::rmw_connextdds.base_participant`](#ros2--rmw-connextddsbase-participant),
1028+
which are both already included in the inheritance chain of [`ros2::rmw_connextdds.base_application`](#ros2--rmw-connextddsbase-application), may be used directly
1029+
to, respectively, configure the QoS of all "built-in" endpoints created by the
1030+
RMW and `rcl` layers, and to configure the QoS of the DomainParticipant created
1031+
by `rmw_connextdds`.
1032+
1033+
QoS profiles in the `ros2::rmw_connextdds.opt.*` namespace describe various
1034+
configurations that are applied optionally by `rmw_connextdds`.
1035+
1036+
These profiles include:
1037+
1038+
- configurations that are applied automatically based on the characteristics
1039+
of a topic's data type (e.g. maximum serialized size, or "unbounded-ness").
1040+
1041+
- configurations that are applied based on ROS 2 options (e.g. "localhost only").
1042+
1043+
- configurations that can be disabled via environment variables (e.g.
1044+
"fast endpoints discovery").
1045+
1046+
Other QoS profiles, like the ones in the `ros2::rmw.*` `ros2::rmw.*` namespaces,
1047+
should only be used as reference.
1048+
1049+
#### ros2::rmw.ros_discovery_info
1050+
1051+
Profile `ros2::rmw.ros_discovery_info` can be used to customize the QoS for
1052+
endpoints on the internal RMW topic `"ros_discovery_info"`.
1053+
1054+
For the equivalent RMW code, see `rmw_connextdds_graph_initialize()`
1055+
in [rmw_graph.cpp](rmw_connextdds_common/src/common/rmw_graph.cpp).
1056+
1057+
#### ros2::rcl.node_parameters
1058+
1059+
Profile `ros2::rcl.node_parameters` defines the QoS used by endpoints on
1060+
various topics used for management of node parameters.
1061+
1062+
See `rmw_qos_profile_parameters` from [rmw/include/rmw/qos_profiles.h](https://github.com/ros2/rmw/blob/master/rmw/include/rmw/qos_profiles.h)
1063+
for the equivalent code implementation.
1064+
1065+
#### ros2::rcl.log
1066+
1067+
Profile `ros2::rcl.log` defines the QoS used by endpoints on the ROS logging topic
1068+
`"rosout"`.
1069+
1070+
See `rcl_qos_profile_rosout_default` from [rcl/include/rcl/logging_rosout.h](https://github.com/ros2/rcl/blob/master/rcl/include/rcl/logging_rosout.h)
1071+
for the equivalent code implementation.
1072+
1073+
#### ros2::rcl.builtin_endpoints
1074+
1075+
Profile `rcl.builtin_endpoints` provides QoS settings for all "built-in"
1076+
endpoints created by the RMW and `rcl` layers for every ROS 2 Node.
1077+
1078+
These "built-in" endpoints include:
1079+
1080+
- Endpoints on topic `"ros_discovery_info"` (configured using profile [`ros2::rmw.ros_discovery_info`](#ros2--rmwros-discovery-info)).
1081+
- Endpoints on topics used for node parameters (configured using profile [`ros2::rcl.node_parameters`](#ros2--rclnode-parameters)).
1082+
- Endpoints on the ROS logging topic `"rosout"` (configured using profile [`ros2::rcl.log`](#ros2--rcllog)).
1083+
1084+
The parent profiles are applied using "topic filters" that select all required topics.
1085+
1086+
#### ros2::rmw_connextdds.base_participant
1087+
1088+
Profile `ros2::rmw_connextdds.base_participant` models the DomainParticipan QoS
1089+
settings used by `rmw_connextdds` to change some of Connext's "out of the box"
1090+
QoS, and make it more amenable to use with ROS 2 applications.
1091+
1092+
These settings are only applied by `rmw_connextdds` when [`RMW_CONNEXT_PARTICIPANT_QOS_OVERRIDE_POLICY`](#rmw-connext-participant-qos-override-policy)
1093+
is either not set, or set to `all`.
1094+
1095+
#### ros2::rmw_connextdds.base_application
1096+
1097+
Use profile `ros2::rmw_connextdds.base_application` as the base profile when
1098+
[`RMW_CONNEXT_ENDPOINT_QOS_OVERRIDE_POLICY`](#rmw-connext-endpoint-qos-override-policy)
1099+
is set to `never` and/or [`RMW_CONNEXT_PARTICIPANT_QOS_OVERRIDE_POLICY`](#rmw-connext-participant-qos-override-policy) is set to a value other than `all`.
1100+
1101+
This profile will configure the DomainParticipant and all "built-in" endpoints with
1102+
the same settings normally used by `rmw_connextdds`.
1103+
1104+
Note that contrary to the code, the profile does not set the default value for
1105+
`DataWriterQos::publish_mode::kind` to `ASYNCHRONOUS_PUBLISH_MODE`, leaving it up
1106+
to the user to configure this policy as needed in their own profiles.
1107+
1108+
The asynchronous publish mode is still used for all "built-in" writers to allow them
1109+
to continue to operate like "out of the box", even when writing large messages.
1110+
1111+
You might also consider inheriting directly from profile [`ros2::rcl.builtin_endpoints`](#ros2--rclbuiltin-endpoints),
1112+
if you only want to configure the built-in endpoints but not the DomainParticipant QoS.
1113+
1114+
#### ros2::rmw_connextdds.opt.large_data
1115+
1116+
Profile `ros2::rmw_connextdds.opt.large_data` describes the "large data" optimizations
1117+
that `rmw_connextdds` applies to endpoints whose type is detected to have a static
1118+
maximum serialized size of at least 1MB.
1119+
1120+
The configuration is derived from Connext's built-in profile `Generic.KeepLastReliable.LargeData`.
1121+
1122+
These optimizations are always applied by `rmw_connextdds` to all "qualified" endpoints,
1123+
unless variable [`RMW_CONNEXT_DISABLE_LARGE_DATA_OPTIMIZATIONS`](#rmw-connext-disable-large-data-optimizations) is used to disabled them.
1124+
1125+
#### ros2::rmw_connextdds.opt.unbounded_data
1126+
1127+
The settings from profile `ros2::rmw_connextdds.opt.unbounded_data` are used by
1128+
`rmw_connextdds` to disable preallocation of samples for endpoints whose
1129+
data type is "unbounded". This includes any data type containing a string or a
1130+
sequence with an unlimited maximum length.
1131+
1132+
The properties set by this profile *must* be set to `0` on any of these type of
1133+
endpoints for things to work properly, and `rmw_connextdds` will try to
1134+
automatically assert them upon endpoint creation.
1135+
1136+
The profile is provide only documentation purposes, since there is no way to
1137+
disable this behavior in `rmw_connextdds`.
1138+
1139+
#### ros2::rmw_connextdds.opt.content_filtered_topic_property
1140+
1141+
Profile `ros2::rmw_connextdds.opt.content_filtered_topic_property` is applied by
1142+
`rmw_connextdds` when policy [`DomainParticipantQos::resource_limits::contentfilter_property_max_length`](https://community.rti.com/static/documentation/connext-dds/6.0.1/doc/api/connext_dds/api_c/structDDS__DomainParticipantResourceLimitsQosPolicy.html#aef1ff851202f5777d31528a52d528e4f)
1143+
is detected to be less than `1024`.
1144+
1145+
#### ros2::rmw_connextdds.opt.localhost_only
1146+
1147+
Profile `ros2::rmw_connextdds.opt.localhost_only` describes the configuration
1148+
applied by `rmw_connextdds` to the DomainParticipant QoS when "localhost only"
1149+
communication is requested by the user.
1150+
1151+
#### ros2::rmw_connextdds.opt.fast_endpoint_discovery
1152+
1153+
Profile `ros2::rmw_connextdds.opt.fast_endpoint_discovery` models the QoS
1154+
configuration applied by `rmw_connextdds` to speed up the process of endpoint
1155+
discovery.
1156+
1157+
This is achieved by increasing the period at which Heartbeats are sent by the
1158+
built-in DDS discovery writers.
9821159
9831160
## DDS Entities Created by the RMW Layer
9841161

rmw_connextdds/resource/xml/ros2_qos_profiles.xml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This file contains various QoS profiles that model the default configuration applied
44
by `rmw_connextdds` and other ROS 2 core packages.
55
6-
Users of `rmw_connextdds` on shell (ie. not on Windows) may refer to any of the
6+
Users of `rmw_connextdds` on a shell (ie. not on Windows) may refer to any of the
77
included profiles in their own QoS configuration files without any further configuration,
88
because the file is automatically loaded into their shell environment by hooks installed
99
by `rmw_connextdds` using variable NDDS_QOS_PROFILES.
@@ -15,7 +15,7 @@
1515
export NDDS_QOS_PROFILES="file:///path/to/ros2_qos_profiles.xml"
1616
```
1717
18-
You can also aake these profiles available to any application using a certain
18+
You could also make these profiles available to any application sharing the same
1919
Connext installation by copying the file (or its contents) to
2020
`${NDDSHOME}/resource/xml/NDDS_QOS_PROFILES.xml`.
2121
@@ -79,10 +79,12 @@
7979
</datawriter_qos>
8080
</qos_profile>
8181

82-
<!-- Profile `rcl.node_parameters` defines the QoS used by endpoints on topics
83-
related to node parameters.
84-
See `rmw_qos_profile_parameters` from `rmw/include/rmw/qos_profiles.h` for
85-
the equivalent code implementation. -->
82+
<!--
83+
Profile `rcl.node_parameters` defines the QoS used by endpoints on topics
84+
related to node parameters.
85+
See `rmw_qos_profile_parameters` from `rmw/include/rmw/qos_profiles.h` for
86+
the equivalent code implementation.
87+
-->
8688
<qos_profile name="rcl.node_parameters">
8789
<datareader_qos>
8890
<reliability>
@@ -104,9 +106,11 @@
104106
</datawriter_qos>
105107
</qos_profile>
106108

107-
<!-- Profile `rcl.log` defines the QoS used by endpoints on topic "rt/rosout".
108-
See `rcl_qos_profile_rosout_default` from `rcl/include/rcl/logging_rosout.h`
109-
for the equivalent code implementation. -->
109+
<!--
110+
Profile `rcl.log` defines the QoS used by endpoints on topic "rt/rosout".
111+
See `rcl_qos_profile_rosout_default` from `rcl/include/rcl/logging_rosout.h`
112+
for the equivalent code implementation.
113+
-->
110114
<qos_profile name="rcl.log">
111115
<datareader_qos>
112116
<durability>
@@ -370,12 +374,10 @@
370374
unlimited maximum length).
371375
372376
These properties MUST be set to 0 on any of these endpoints for things
373-
to work properly, and rmw_connextdds will try to automatically assert them,
374-
but not overwrite if they are already set. For this reason, it is important
375-
that you make sure to either not set them or set them to 0 for any endpoint
376-
that uses an unbounded data type. This includes all built-in endpoints,
377-
for which the property is not set by profile `rmw_connextdds::builtin_endpoints`
378-
so that they may be configured automatically by `rmw_connextdds`.
377+
to work properly, and rmw_connextdds will always assert them to this value.
378+
379+
The profile is provide only documentation purposes, since there is no way
380+
to disable this behavior in `rmw_connextdds`.
379381
-->
380382
<qos_profile name="rmw_connextdds.opt.unbounded_data">
381383
<datareader_qos>

0 commit comments

Comments
 (0)