RTI Connext DDS与ROS2之间的通信

Communication between RTI Connext DDS and ROS2

在 ROS2 中,使用 qos_profile = rmw_qos_profile_system_default 将使用 DDS 供应商安装目录中的默认 xml 配置,在本例中为 RTI CONNEXT。

查看来自 RTI 的 this 文档,这意味着文件 NDDS_QOS_PROFILES.xml 已加载。但是这个文件没有任何 QoS 设置。这只是参与者的发现。

此外,是否有可能通过某些 RTI 实用程序了解 QoS,例如管理控制台?

用例: 比方说,一些其他应用程序,例如ROS2 正在使用我不知道的 QoS 设置发布主题。现在,我需要使用 Python 的 RTI 连接器使用 XML 应用程序创建来为此主题创建订阅者。为此,我需要知道 ROS2 应用程序使用的 QoS 设置,然后使用 XML 创建类似的 QoS。

如果 default.xml 不包含所有参数,您可能正在使用内置默认值 https://community.rti.com/examples/built-qos-profiles

使用 RTI 管理控制台,您可以查看当前 publisher/subscriber 的 QoS。您还可以更轻松地更新 QoS 的 .xml(https://www.rti.com/blog/2012/09/24/introducing-rti-administration-console/ 请参阅编辑 QoS)。

我正在使用 ROS2 eloquent 和 RTI COnnext DDS 5.3.1,我遇到了类似的问题。

我创建了一个 geometry_msgs::msg::dds_::TransformStamped_ 发布者和订阅者。当我没有任何 USER_QOS_PROFILES.xml 存在时,发布者和订阅者匹配(在 rtiadminconsole 中看到)并且订阅者接收消息。然后,我用命令

创建了一个 USER_QOS_PROFILES.xml
/opt/rti_connext_dds-5.3.1/bin/rtiddsgen -create examplefiles -update typefiles -language C++11 -I idl idl/geometry_msgs/msg/TransformStamped.idl

现在,当我启动发布者时,出现以下错误:

PRESParticipant_checkTransportInfoMatching:Warning: discovered remote participant 'RTI Administration Console' using the 'shmem' transport with class ID 16777216. This class ID does not match the class ID 2 of the same transport in the local participant 'minimal_publisher'. These two participants will not communicate over the 'shmem' transport. Check the value of the property 'dds.transport.use_510_compatible_locator_kinds' in the local participant. See https://community.rti.com/kb/what-causes-error-discovered-remote-participant for additional info. COMMENDBeWriterService_assertRemoteReader:Discovered remote reader with GUID 0X101B8B9,0XF38BCC9E,0XB4C09B41,0X200C7 using a non-addressable locator. This can occur if the transport is not installed and/or enabled in the local participant. See https://community.rti.com/kb/what-does-cant-reach-locator-error-message-mean for additional info. can't reach: locator: shmem://508B:2F0F:1EDD:2470:D06A:ACC9:0000:0000:7410 COMMENDSrWriterService_assertRemoteReader:Discovered remote reader with GUID 0X101B8B9,0XF38BCC9E,0XB4C09B41,0X20087 using a non-addressable locator. This can occur if the transport is not installed and/or enabled in the local participant. See https://community.rti.com/kb/what-does-cant-reach-locator-error-message-mean for additional info. can't reach: locator: shmem://508B:2F0F:1EDD:2470:D06A:ACC9:0000:0000:7410 COMMENDSrWriterService_assertRemoteReader:Discovered remote reader with GUID 0X101B8B9,0XF38BCC9E,0XB4C09B41,0X4C7 using a non-addressable locator. This can occur if the transport is not installed and/or enabled in the local participant. See https://community.rti.com/kb/what-does-cant-reach-locator-error-message-mean for additional info. can't reach: locator: shmem://508B:2F0F:1EDD:2470:D06A:ACC9:0000:0000:7410 COMMENDSrWriterService_assertRemoteReader:Discovered remote reader with GUID 0X101B8B9,0XF38BCC9E,0XB4C09B41,0X3C7 using a non-addressable locator. This can occur if the transport is not installed and/or enabled in the local participant. See https://community.rti.com/kb/what-does-cant-reach-locator-error-message-mean for additional info. can't reach: locator: shmem://508B:2F0F:1EDD:2470:D06A:ACC9:0000:0000:7410 DDS_ResourceLimitsQosPolicy_is_consistent_w_historyI:inconsistent QoS policies: history.depth and resource_limits.max_samples (max_samples_per_instance is unlimited) DDS_Subscriber_create_datareader_disabledI:ERROR: Inconsistent QoS DDSDataReader_impl::create_disabledI:!create reader DDSDataReader_impl::createI:!create reader initialize:!create DataReader connext::details::EntityUntypedImpl::initialize:!failed (see previous errors) >>> [rcutils|error_handling.c:107] rcutils_set_error_state() This error state is being overwritten: 'C++ exception during construction of Requester, at /tmp/binarydeb/ros-eloquent-rcl-interfaces-0.8.0/obj-x86_64-linux-gnu/rosidl_typesupport_connext_cpp/rcl_interfaces/srv/dds_connext/get_parameters__type_support.cpp:704' with this new error message: 'failed to create replier, at /tmp/binarydeb/ros-eloquent-rmw-connext-cpp-0.8.1/src/rmw_service.cpp:138' rcutils_reset_error() should be called after error handling to avoid this. <<< terminate called after throwing an instance of 'rclcpp::exceptions::RCLError' what(): could not create service: failed to create replier, at /tmp/binarydeb/ros-eloquent-rmw-connext-cpp-0.8.1/src/rmw_service.cpp:138, at /tmp/binarydeb/ros-eloquent-rcl-0.8.4/src/rcl/service.c:179

我想第一部分是因为我打开了 rtiadminconsole 但按钮上的错误似乎是一些 rti DDS / ROS2 问题。您可以在下面找到USER_QOS_PROFILES.xml

<?xml version="1.0"?>
<!-- 
Description
XML QoS Profile for TransformStamped

The QoS configuration of the DDS entities in the generated example is loaded 
from this file.

This file is used only when it is in the current working directory or when the
environment variable NDDS_QOS_PROFILES is defined and points to this file.

The profile in this file inherits from the builtin QoS profile 
BuiltinQosLib::Generic.StrictReliable. That profile, along with all of the 
other built-in QoS profiles can be found in the 
BuiltinProfiles.documentationONLY.xml file located in the 
$NDDSHOME/resource/xml/ directory.

You may use any of these QoS configurations in your application simply by 
referring to them by the name shown in the 
BuiltinProfiles.documentationONLY.xml file and listed below: 

* In library "BuiltinQosLib":
** Baseline
** Baseline.5.0.0
** Baseline.5.1.0
** Baseline.5.2.0
** Generic.Common
** Generic.510TransportCompatibility
** Generic.Monitoring.Common
** Generic.ConnextMicroCompatibility
** Generic.OtherDDSVendorCompatibility

* In library "BuiltinQosLibExp":
** Generic.StrictReliable
** Generic.KeepLastReliable
** Generic.BestEffort
** Generic.StrictReliable.HighThroughput
** Generic.StrictReliable.LowLatency
** Generic.Participant.LargeData
** Generic.Participant.LargeData.Monitoring
** Generic.StrictReliable.LargeData
** Generic.KeepLastReliable.LargeData
** Generic.StrictReliable.LargeData.FastFlow
** Generic.StrictReliable.LargeData.MediumFlow
** Generic.StrictReliable.LargeData.SlowFlow
** Generic.KeepLastReliable.LargeData.FastFlow
** Generic.KeepLastReliable.LargeData.MediumFlow
** Generic.KeepLastReliable.LargeData.SlowFlow
** Generic.KeepLastReliable.TransientLocal
** Generic.KeepLastReliable.Transient
** Generic.KeepLastReliable.Persistent
** Generic.AutoTuning
** Pattern.PeriodicData
** Pattern.Streaming
** Pattern.ReliableStreaming
** Pattern.Event
** Pattern.AlarmEvent
** Pattern.Status
** Pattern.AlarmStatus
** Pattern.LastValueCache

You should not edit the file BuiltinProfiles.documentationONLY.xml directly.
However, if you wish to modify any of the values in a built-in profile, the
recommendation is to create a profile of your own and inherit from the built-in
profile you wish to modify. The NDDS_QOS_PROFILES.example.xml file (contained in 
the same directory as the BuiltinProfiles.documentationONLY.xml file) shows how
to inherit from the built-in profiles. 

For more information about XML QoS Profiles see Chapter 17 in the 
RTI Connext user manual.
-->
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="/opt/rti_connext_dds-5.3.1/resource/schema/rti_dds_qos_profiles.xsd"
     version="5.3.1">
    <!-- QoS Library containing the QoS profile used in the generated example.

        A QoS library is a named set of QoS profiles.
    -->
    <qos_library name="TransformStamped_Library">

        <!-- QoS profile used to configure reliable communication between the DataWriter 
             and DataReader created in the example code.

             A QoS profile groups a set of related QoS.
        -->
        <qos_profile name="TransformStamped_Profile" base_name="BuiltinQosLibExp::Generic.StrictReliable" is_default_qos="true">
            <!-- QoS used to configure the data writer created in the example code -->                
            <datawriter_qos>
                <publication_name>
                    <name>TransformStampedDataWriter</name>
                </publication_name>
            </datawriter_qos>

            <!-- QoS used to configure the data reader created in the example code -->                
            <datareader_qos>
                <subscription_name>
                    <name>TransformStampedDataReader</name>
                </subscription_name>
            </datareader_qos>
            <participant_qos>
                <!--
                The participant name, if it is set, will be displayed in the
                RTI tools, making it easier for you to tell one
                application from another when you're debugging.
                -->
                <participant_name>
                    <name>TransformStampedParticipant</name>
                    <role_name>TransformStampedParticipantRole</role_name>
                </participant_name>

            </participant_qos>
        </qos_profile>

    </qos_library>
</dds>

更新: 感谢 rti 社区论坛的 neil-rti,我能够解决我的问题。在我 "activated" rti DDS 5.3.1 作为中间件层之后,我不得不干净地重建 ROS2 eloquent 节点。