ZBLOG

The DataWriter configuration is performed through the XML elements listed in the following table. Name Description Values Default TopicType configuration of the DataWriter. TopicType DataWriter QoS configuration. QoS

DataWriter 配置说明

DataWriter 的配置通过下表中列出的 XML 元素进行。以下是每个元素的名称、描述、允许的值以及默认值。

1. <topic>

  • 描述:配置 DataWriter 的主题类型(TopicType)。
  • :TopicType
  • 默认值:无

2. <qos>

  • 描述:配置 DataWriter 的 QoS(服务质量)。
  • :QoS
  • 默认值:无

3. <times>

  • 描述:配置与 DataWriter 相关的一些时间参数。
  • :WriterTimes
  • 默认值:无

4. <unicastLocatorList>

  • 描述:输入单播定位器的列表。期待 LocatorListType 类型。
  • 默认值:无

5. <multicastLocatorList>

  • 描述:输入组播定位器的列表。期待 LocatorListType 类型。
  • 默认值:无

6. <external_unicast_locators>

  • 描述:要为与此 DataWriter 通信而声明的外部定位器列表。
  • :ExternalLocatorListType
  • 默认值:无

7. <ignore_non_matching_locators>

  • 描述:是否忽略从其他实体收到的公告中的定位器,当这些定位器不匹配此 DataWriter 宣布的任何定位器时。
  • : bool
  • 默认值: false(不忽略)

8. <historyMemoryPolicy>

  • 描述: 为 DataWriter 的历史记录分配内存种类。参见 HistoryQosPolicyKind。
  • 值: HistoryMemoryPolicy
  • 默认值: PREALLOCATED(预分配)

9. <propertiesPolicy>

  • 描述: 附加配置属性。
  • 值: PropertiesPolicyType
  • 默认值:

10. <userDefinedID>

  • 描述: 用于 EDPStatic 的标识符。
  • 值得: int16_t
  • 【 默认】: -1

11. <entityID>

  • 描述: 设置 RTPSEndpointQos 类的 entity_id。
  • 【 值】: int16_t
  • 【 默认】: -1

12. <matchedSubscribersAllocation>

  • 【 描述】: 设置已匹配 DataReaders 集合的限制。参见 ParticipantResourceLimitsQos.
  • 【 值】: Allocation Configuration

示例 XML 配置

以下是一个示例 XML 配置,演示了如何定义一个名为 datawriter_profile_name 的 DataWriter 配置文件:

<?xml version="1.0" encoding="UTF-8" ?>
<dds xmlns="http://www.eprosima.com">
    <profiles>
        <data_writer profile_name="datawriter_profile_name">
            <topic>
                <historyQos>
                    <kind>KEEP_LAST</kind>
                </historyQos>
            </topic>

            <qos>
                <!-- QOS -->
            </qos>

            <times> <!-- writerTimesType -->
                <initial_heartbeat_delay>
                    <nanosec>12</nanosec>
                </initial_heartbeat_delay>

                <heartbeat_period>
                    <sec>3</sec>
                </heartbeat_period>

                <nack_response_delay>
                    <nanosec>5</nanosec>
                </nack_response_delay>

                <nack_supression_duration>
                    <sec>0</sec>
                </nack_supression_duration>
            </times>

            <unicastLocatorList>
                <!-- LOCATOR_LIST -->
                <locator>
                    <udpv4>
                        <address>192.168.0.1</address>
                    </udpv4>
                </locator>
            </unicastLocatorList>

            <multicastLocatorList>
                <!-- LOCATOR_LIST -->
                <locator>
                    <udpv4 >
                        <<address>>192.168.0.1</address>>
                    </udpv4 >
                </locator >
            </multicastLocatorList >

           ... (其他元素)

        </data_writer >
    </profiles >
</dds >

注意事项

  1. LOCATOR_LIST 表示期望一个 LocatorListType 类型的数据结构。
  2. EXTERNAL_LOCATOR_LIST 表示期望一个 ExternalLocatorListType 类型的数据结构。
  3. PROPERTIES_POLICY 表示该标签是一个 PropertiesPolicyType 块。

有关 QoS 和 TopicType 的详细信息,请参考相关文档或章节。


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:http://sdn.0voice.com/?id=7347

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?