Fast DDS之Qos与Profiles

2024-04-23 23:44
文章标签 qos dds fast profiles

本文主要是介绍Fast DDS之Qos与Profiles,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

目录

  • XML profiles
    • 加载
    • 创建
    • 修改
    • 可配置内容
  • Qos
    • DeadlineQosPolicy
    • DestinationOrderQosPolicy
    • DurabilityQosPolicy
    • DurabilityServiceQosPolicy
    • EntityFactoryQosPolicy
    • GroupDataQosPolicy
    • HistoryQosPolicy
    • LatencyBudgetQosPolicy
    • LivelinessQosPolicy
    • OwnershipQosPolicy
    • OwnershipStrengthQosPolicy
    • PartitionQosPolicy
    • PresentationQosPolicy
    • ReaderDataLifecycleQosPolicy
    • ReliabilityQosPolicy
    • ResourceLimitsQosPolicy
    • TimeBasedFilterQosPolicy
    • TopicDataQosPolicy
    • TransportPriorityQosPolicy
    • UserDataQosPolicy
    • WriterDataLifecycleQosPolicy

Qos (Quality of Service)用于指定服务的行为,允许用户指定每个实体怎样表现或运行。通过XML文件(Profiles)来配置或者在代码中直接指定。

XML profiles

xml配置文件可以有多个。

加载

Fast DDS在初始化阶段自动加载XML:

  • 在当前可执行文件的路径下加载 DEFAULT_FASTRTPS_PROFILES.xml
  • 加载环境变量FASTRTPS_DEFAULT_PROFILES_FILE指定的xml
  • 加载配置参数指定的xml文件
  • 直接加载xml格式的字符串

创建

<?xml version="1.0" encoding="UTF-8" ?>
<dds xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles"><profiles><domainparticipant_factory profile_name="domainparticipant_factory_profile"><!-- ... --></domainparticipant_factory><participant profile_name="participant_profile"><!-- ... --></participant><data_writer profile_name="datawriter_profile"><!-- ... --></data_writer><data_reader profile_name="datareader_profile"><!-- ... --></data_reader><topic profile_name="topic_profile"><!-- ... --></topic><transport_descriptors><!-- ... --></transport_descriptors></profiles><library_settings><!-- ... --></library_settings><log><!-- ... --></log><types><!-- ... --></types>
</dds>
  1. <dds>, <profiles>, <library_settings>, <types>, and <log> 这些标签可以独立定义。
  2. <participant>, <data_reader>, <data_writer>, <topic>, and <transport_descriptors> 这些标签必须作为<profiles>的子元素

修改

if (ReturnCode_t::RETCODE_OK ==DomainParticipantFactory::get_instance()->load_XML_profiles_file("my_profiles.xml"))
{DomainParticipantQos participant_qos;DomainParticipantFactory::get_instance()->get_participant_qos_from_profile("participant_xml_profile",participant_qos);// Name obtained in another section of the codeparticipant_qos.name() = custom_name;// Modify number of preallocations (this overrides the one set in the XML profile)participant_qos.allocation().send_buffers.preallocated_number = 10;// Create participant using the modified XML QosDomainParticipant* participant =DomainParticipantFactory::get_instance()->create_participant(0, participant_qos);
}

可配置内容

  • DomainParticipantFactory profiles
  • DomainParticipant profiles
  • DataWriter profiles
  • DataReader profiles
  • Topic profiles
  • transport_descriptor
  • Intra-process delivery profiles
  • Log profiles
  • Dynamic Types profiles

Qos

每个Qos都有一个唯一的ID(定义在枚举QosPolicyId_t中),这个ID值用于一些Status中,以识别状态所引用的特定Qos策略。
Fast DDS中支持的Policies在这里

DeadlineQosPolicy

当新的数据样本的频率低于设定的阈值时,此QoS策略会发出警报。它对于预期定期更新数据的情况非常有用。

Data Member NameTypeDefault Value
periodDuration_tc_TimeInfinite

DestinationOrderQosPolicy

DurabilityQosPolicy

DurabilityServiceQosPolicy

EntityFactoryQosPolicy

GroupDataQosPolicy

HistoryQosPolicy

LatencyBudgetQosPolicy

LivelinessQosPolicy

OwnershipQosPolicy

OwnershipStrengthQosPolicy

PartitionQosPolicy

PresentationQosPolicy

ReaderDataLifecycleQosPolicy

ReliabilityQosPolicy

ResourceLimitsQosPolicy

TimeBasedFilterQosPolicy

TopicDataQosPolicy

TransportPriorityQosPolicy

UserDataQosPolicy

WriterDataLifecycleQosPolicy

eProsima扩展的Qos

这篇关于Fast DDS之Qos与Profiles的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/930211

相关文章

DDS信号的发生器(验证篇)——FPGA学习笔记8

前言:第一部分详细讲解DDS核心框图,还请读者深入阅读第一部分,以便理解DDS核心思想 三刷小梅哥视频总结! 小梅哥https://www.corecourse.com/lander 一、DDS简介         DDS(Direct Digital Synthesizer)即数字合成器,是一种新型的频率合成技术,具有低成本、低功耗、高分辨率、频率转换时间短、相位连续性好等优点,对数字信

[vivado][IP核]DDS

刘东华的IP核详解: 1、 这里的是指IP核配置中的相位数据的宽度。 2、 实际使用此IP核时并没有“频率分辨率”可以配,是靠改变来变的。 3、 4、 5、 数据输出的ready在数据正式输出时才会有。 自己仿真: 使用SIN/COS LUT only的模式,使用一个累加器作为相位输入,不知怎么,输出为X。

5.How Fast Should You Be When Learning?(你应该用多快的速度学习? (一))

Normally when I talk about learing quickly, I’m using speed as a synonym for efficiency.Use more effective methods and you’ll learn more in less time.All else being equal, that means you’re learing fa

【GNU笔记】内联函数与宏一样快 An Inline Function is As Fast As a Macro

内联函数与宏一样快 An Inline Function is As Fast As a Macro 通过声明内联函数,你可以指示 GCC 更快地调用该函数。GCC 可以实现这一点的一种方法是将该函数的代码集成到其调用者的代码中。这通过消除函数调用开销使执行速度更快;此外,如果任何实际参数值是常量,则它们的已知值可能允许在编译时进行简化,因此不需要包含所有内联函数的代码。对代码大小的影响是难以预

fast DFS 单机使用实例

fast DFS 单机使用实例 我在一台服务器上简单测试了fastdfs。client, tracker, storage server都是同一个物理服务器。   1. 编译fastdfs:   sles207:/opt/mars/FastDFS # ./make.sh   storage_service.o: In function `storage_service_init':/opt/ma

ch/qos/logback/core/joran/spi/JoranException解决方案

错误提示: Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.joran.spi.JoranException 原因:版本冲突 解决方案一: pom.xml文件中引入依赖指定版本 <dependency><groupId>ch.qos.logback</groupId><artifactId>logback-

[rejected]master -> master (non-fast-forward)的解决方法

☆ 问题描述 [rejected]master -> master (non-fast-forward)的解决方法 本地已经创建了一个项目,想要把远程库的代码合并到本地库上,报错… ★ 解决方案 git pull <远程服务器> <远程分支> --allow-unrelated-histories 先使用这个代码合并两个分支 –allow-unrelated-historie

5.How Fast Should You Be When Learning?(你应该用多快的速度学习?)

Normally when I talk about learing quickly, I’m using speed as a synonym for efficiency.Use more effective methods and you’ll learn more in less time.All else being equal, that means you’re learing fa

【自动驾驶】8. MDC通信架构 + DDS + SOME/IP

对于AP框架,感知融合模块中,由于PreFusion通信数据量大,所以采用带宽较大的DDS(Data Distribution Service)通信协议,其余节点传入数据量较小,采用SOME/IP(Scalable Service-Oriented Middleware over IP)通信协议。融合模块与规控模块之间通信为DDS通信协议。规划控制模块内各节点之间均采用能够处理

【自动驾驶】7. MDC常用术语、DDS、SOME/IP

常用术语: MDC: Mobile Data Center;移动数据中心 AP: AUTOSAR Adaptive Platform; 自适应AUTOSAR平台 APP: Appliction; 提供服务所需功能的软件 CM: Communication Management; 通信管理 GMSL: Gigabit Multimedia Serial Link; 吉比特多媒体串行链接 MCU: