DDS:FastDDS
Contents
本文采用知识共享署名 4.0 国际许可协议进行许可,转载时请注明原文链接,图片在使用时请保留全部内容,可适当缩放并在引用处附上图片所在的文章链接。
[TOC]
FastDDS
Fast DCPS
Data-Centric Publish-Subscribe : 以数据为中心的发布-订阅模式
SPDP(Simple Participant Discovery Protocol)
发现其他进程中运行的 DomainParticipant。
-
每个 Participant 会周期性地广播一个
SPDP message。 -
广播内容包括 Participant 的 GUID、QoS 信息、Vendor ID、ParticipantBuiltinTopicData 等。
-
其他节点收到后,会缓存这个新 Participant 的信息,并回应自己的 SPDP 消息
| 参数 | 描述 |
|---|---|
| Multicast 地址 | 239.255.0.1(默认) |
| UDP 端口 | 7400 + (domain_id * 250) + 0(SPDP port) |
| 频率 | 默认每 30 秒,或某些事件触发时立即发送 |
SEDP(Simple Endpoint Discovery Protocol)
发现每个 Participant 中注册了哪些 DataWriter 和 DataReader。
- 一旦发现了 Participant(通过 SPDP),Fast DDS 会向其发送 SEDP 请求,询问其包含的 Endpoint。
包括两种内建 Topic:
DCPSPublication(表示 DataWriter)
DCPSSubscription(表示 DataReader)
- 每个节点会将自己的 Endpoint 信息发送给其他节点,广播这些内建 Topic 的数据。
传输通道
| 协议 | 全称 | 主要作用 | 发现对象 | 通信机制 |
|---|---|---|---|---|
| SPDP | Simple Participant Discovery Protocol | 发现其他参与者(DomainParticipant) | 远程 Participant | 通常基于 UDP 多播 |
| SEDP | Simple Endpoint Discovery Protocol | 发现远程 Participant 内部的通信端点(DataWriter / DataReader) | DataWriter、DataReader(Endpoint) | 支持 UDP/SHM |
| 协议/功能 | 支持 SHM | 说明 |
|---|---|---|
| SPDP(参与者发现) | ❌ 不支持 | 只能使用 UDPv4/v6(通常是组播) |
| SEDP(端点发现) | ✅ 可支持 | 可配置走共享内存 |
| 用户数据传输 | ✅ 支持 | 支持 SHM、高速、低延迟 |