Fast-DDS v3.x 源码学习七日攻坚计划
> 目标:理清Fast-DDS v3.x代码框架和DDS协议的对应关系,掌握共享内存、循环buffer、线程池、pubsub等核心实现,最终能够基于Fast-DDS做二次开发实现工业级项目。
>
> 平台:Win10 + WSL Ubuntu 22.04/24.04
> 周期:7天核心学习 + 持续深化
📋 目录
- Day 1: 环境搭建与宏观架构
- Day 2: DDS标准与RTPS协议核心
- Day 3: 共享内存与零拷贝机制
- Day 4: 循环Buffer与无锁队列
- Day 5: 线程模型与异步处理
- Day 6: Discovery发现机制与QoS实现
- Day 7: 整合与二次开发实战
- 调试工具速查
- 关键文件索引
Day 1: 环境搭建与宏观架构
上午 - 环境准备
# WSL2 Ubuntu 22.04/24.04 推荐
sudo apt update && sudo apt install -y cmake g++ python3-pip wget git
# 安装依赖
sudo apt install -y libasio-dev libtinyxml2-dev libssl-dev
# 下载 Fast-DDS v3.x 源码
mkdir -p ~/fastdds_ws/src && cd ~/fastdds_ws/src
git clone --recursive https://github.com/eProsima/Fast-DDS.git -b 3.1.x
cd Fast-DDS && mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/fastdds_ws/install -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build . --parallel $(nproc)
cmake --install .
核心目录结构
mindmap
root((Fast-DDS 源码结构))
include/fastdds/
dds/ DDS标准API实现
DomainParticipant
Publisher/Subscriber
DataWriter/DataReader
rtps/ RTPS协议核心
Writer/Reader
History
Resources
xmlparser/ XML配置解析
src/cpp/
fastdds/ DDS层实现
rtps/ RTPS层实现
utils/ 工具库
shared_memory/
thread_pool/
lock_free/