Skip to content

feat(dds): add end-to-end native CDR support#10

Merged
thun-res merged 29 commits into
masterfrom
dev
Jul 23, 2026
Merged

feat(dds): add end-to-end native CDR support#10
thun-res merged 29 commits into
masterfrom
dev

Conversation

@thun-res

@thun-res thun-res commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary / 概述

为 VLink 增加端到端的原生 DDS CDR 支持,使 Fast DDS IDL、ROS 2 消息及原生 DDS 类型可以直接接入 VLink,并支持发现、监控、录制和回放。

主要改动:

  • 新增 SchemaType::kCdr,同步支持 C++、C API、Python API 和相关构建宏。
  • 将 CDR 统一为包含 DDS encapsulation header 的字节负载,并让 Publisher、Subscriber、Setter、Getter、Client 和 Server 使用统一的数据路径。
  • 新增 byte-backed Fast DDS Topic 类型,支持通过原生类型名创建 Topic。
  • 改进 Fast DDS 2.x/3.x、CycloneDDS 和 DDSR 的类型兼容性、无效 Sample 处理及 payload 生命周期。
  • 支持 CDR 节点的发现上报、CLI 展示、Bag 录制与回放,以及运行时类型变化后的订阅重建。
  • 更新 DDS CDR、ROS 2、录制相关文档、示例及 v2.1.0 Changelog。
  • 同时包含连接等待锁反转、Bag 元数据、Iceoryx、MQTT 热路径、MessageLoop、LZAV 和 Conan 配置等稳定性与性能改进。

该改动使 VLink 能够直接与原生 DDS/ROS 2 数据类型互操作,并在工具链中完整保留 CDR 类型及序列化信息。

Type of change / 变更类型

  • Bug fix / 缺陷修复
  • New feature / 新功能
  • Performance / 性能优化
  • Refactor / 重构(行为不变)
  • Build · CI · packaging / 构建·CI·打包
  • Docs only / 仅文档

Related issues / 关联 Issue

N/A

How was this tested? / 如何测试

本分支补充或更新了以下测试覆盖:

  • C API 与 Python API 的 CDR Schema 类型映射。
  • Bag 未知丢包元数据处理。
  • Client 与 Publisher 连接等待的锁行为。
  • TriggerRecorder 异步任务完成与调度失败路径。
  • DDS CDR 相关示例及 API 使用路径。

实际执行结果(提交前请替换为真实结果):

  • tools/format.sh
  • tools/check.sh
  • C++ unit tests
  • Python API tests
  • Fast DDS 2.x/3.x build and interoperability tests
  • ROS 2 message communication test

Checklist / 检查项

  • tools/format.sh and tools/check.sh pass / 通过格式化与检查门禁
  • clang-tidy is clean for changed files / 改动文件 clang-tidy 无告警
  • Builds and tests pass on the affected platforms (Linux / Windows / macOS) / 受影响平台编译与测试通过
  • No new compiler warnings (ENABLE_TEST_WARN=ON) / 无新增编译告警
  • Docs updated and kept in sync across 中文 + English when behavior changed / 行为变更时已同步更新中英文文档
  • Public API / ABI changes are intentional and documented / 公共 API/ABI 变更是有意为之并已说明

@github-actions

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67d8314954

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread modules/dds/dds_topic.cc
return false;
}

bytes = Bytes::shallow_copy(payload.data, payload.length);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Own incoming CDR bytes before deserialize returns

When receiving any native CDR sample, this stores a non-owning view of SerializedPayload_t::data in the loaned Bytes sample. The serialized payload is owned by Fast DDS and its lifetime is only guaranteed during TopicDataType::deserialize; returning the application-data loan later does not retain that payload. Fast DDS can therefore recycle or overwrite the buffer before process_message() invokes the subscriber/client/server callback, causing corrupted data or use-after-free behavior. Deep-copy the payload here or retain an owning payload object for the complete sample lifetime.

Useful? React with 👍 / 👎.

@thun-res
thun-res merged commit cb82065 into master Jul 23, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant