The project has two DDS backends: ROS2 (ros2/) and RTI Connext (rti/). We want to add a third backend using eProsima Fast DDS 3.4.0 (acquired via Conan), and stop compiling the RTI backend (without deleting it). FastDDS produces OMG IDL schemas and CDR-encoded messages, same as RTI — so the core app/ layer and PlotJuggler client need no changes.
Architecture: Flattened (2 classes + main)
Unlike RTI's 4-class two-level design, we flatten into 2 classes that directly implement the abstract interfaces:
FastDdsTopicSource — implements TopicSourceInterface, manages DomainParticipants, discovers topics via on_data_writer_discovery(), resolves DynamicType from TypeObjectRegistry, generates IDL via idl_serialize()
FastDdsSubscriptionManager — implements SubscriptionManagerInterface, creates DataReaders with DynamicPubSubType, ref-counted subscriptions, extracts CDR via deserialize+re-serialize
I'll start by checking for relevant skills and recovering past context, then begin implementing the plan.
Assistant
Now let me read the key RTI implementation files and the abstract interfaces to understand the exact patterns.
Assistant
Now let me read the adapter wrappers and the abstract interfaces.
Assistant
Now let me research the FastDDS 3.4 API to verify the exact API signatures.
Assistant
Excellent — I now have a thorough understanding of both the RTI patterns and the FastDDS 3.4 API. Let me set up task tracking and start implementing.
Assistant
Now let me start implementing. Task 1: directory structure and conanfile.
Assistant
Now Task 2: Update CMakeLists.txt.
Assistant
Now Task 3: Implement FastDdsTopicSource.
Assistant
Those diagnostics are just clangd not having the FastDDS headers available (no Conan install yet). That's expected. Let me continue with Task 3 complete, and move to Task 4.
Assistant
Now Task 5: main.cpp for FastDDS backend.
Assistant
Now Task 6: Documentation. Let me read the existing docs first.
Assistant
Now let me update the documentation files.
Assistant
Now update CLAUDE.md with FastDDS sections.
Assistant
Now add FastDDS to the External Dependencies section.
Assistant
Now update the architecture diagram in CLAUDE.md.
Assistant
Now update the Key Components section in CLAUDE.md.
Assistant
Now update the project structure and CMake targets table.
Assistant
Now update the Dependencies section to add FastDDS.
Assistant
Now update the Configuration section and the event loop description.
Assistant
Update the event loop description.
Assistant
Update the last section of CLAUDE.md.
Assistant
Now Task 7: Build and verify. First let me verify the ROS2 core tests still pass (since we only commented out the RTI block, the ROS2 build should be unaffected), then try the FastDDS build.
Assistant
All 317 tests pass. Now let me try the Conan + FastDDS build.
Assistant
While that's running, let me also update the memory file with the FastDDS backend info.
Assistant
Conan install completed. Let me check the output and proceed with the CMake build.
Assistant
Conan install succeeded. Now let's run CMake + make.
Assistant
CMake configured successfully. Now let's build.
Assistant
Three compile errors to fix. Let me investigate the correct API.
Assistant
seconds() and nanosec() are methods, not fields. Now let me fix both issues.
Assistant
Now fix the timestamp access in the subscription manager.
Assistant
Now let me rebuild.
Assistant
Build succeeds. The binary is at build_fastdds/pj_bridge_fastdds. Now let me also check the latest commit to see the RTI code simplifications, then apply the same to FastDDS.
Assistant
I see the RTI simplification removed the adapter layer, extracted a close_reader() helper to deduplicate cleanup code, and removed redundant type_name from DiscoveredTopic. My FastDDS code already has the flattened design (no adapter layer), but I should apply the same kind of simplifications. Let me apply them now.
Assistant
Now I'll apply the same simplifications from the RTI commit:
Remove type_name from DiscoveredTopic — derive from dynamic_type->get_name()
Extract close_subscription() helper to deduplicate cleanup in unsubscribe() and unsubscribe_all()
Simplify on_topic_discovered signature — drop type_name parameter
Assistant
Now update the .cpp to match — remove type_name from discovery callback, on_topic_discovered, and get_topics().
Assistant
Now update get_topics() to derive type_name from dynamic_type->get_name().
Assistant
Now extract the close_subscription() helper in the subscription manager.
Assistant
Now update the .cpp to use close_subscription().
Assistant
Now rebuild to verify everything still compiles.
Assistant
Clean build with no warnings. Let me also verify the ROS2 tests still pass after all changes.
Assistant
All tasks complete. Here's a summary of what was implemented:
I want you to compare the three backwends, ros2 / rti /fastdds and to make sure that they are consistent in terms of patterns and architecture. check if there is any code repetition or redundancy that can be avoided
Assistant
I'll explore all three backends in parallel to compare their patterns and architecture.
Assistant
Now let me read the main.cpp files side-by-side and a few key files to do a precise diff comparison.
Assistant
Now let me read the RTI subscription manager and topic discovery implementation to compare with FastDDS.
Assistant
Now let me read the ROS2 subscription manager files to complete my comparison.
Assistant
Now I have a thorough understanding of all three backends. Let me write the plan with my findings.
User
[Request interrupted by user for tool use]
Disable RTI: Comment out the if(ENABLE_RTI ...) block (lines 168-205) with a note
Add after the disabled RTI block (before "Install common"):
Topic discovery: FastDdsTopicSource with participants + discovery + IDL
Subscriptions: FastDdsSubscriptionManager with DataReaders + CDR
Event loop: main.cpp with CLI + BridgeServer wiring
Integration test against a real FastDDS publisher
Known Risks
Conan target names — fastdds vs fastdds::fastdds, verify from generated configs
TypeObject timing — discovery callback may fire before TypeObject is in registry; may need retry or register_remote_type() fallback
CDR encoding — FastDDS defaults to XCDR2; PlotJuggler's deserializer must handle the encapsulation header
on_data_writer_discovery signature — exact info struct fields need verification against 3.4.0 headers
Verification
bash
# FastDDS standalone build
cd ~/ws_plotjuggler/src/pj_ros_bridge
conan install . --output-folder=build_fastdds --build=missing -s build_type=Release
cd build_fastdds
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_FASTDDS=ON \
-DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake
make -j$(nproc)
# Core tests still pass (RTI disabled, ROS2 unaffected)
cd ~/ws_plotjuggler && source /opt/ros/humble/setup.bash
colcon build --packages-select pj_bridge --cmake-args -DCMAKE_BUILD_TYPE=Release
colcon test --packages-select pj_bridge && colcon test-result --verbose
# Integration test
./build_fastdds/pj_bridge_fastdds --domains 0 --port 8080 --publish-rate 50
If you need specific details from before exiting plan mode (like exact code snippets, error messages, or content you generated), read the full transcript at: /home/davide/.REDACTED.jsonl
fastdds/src/fastdds_topic_source.cpp — Discovery via on_data_writer_discovery(), TypeObject → DynamicType → IDL
fastdds/src/fastdds_subscription_manager.cpp — DataReaders with DynamicPubSubType, CDR extraction via re-serialize
docs/ARCHITECTURE.md — FastDDS backend added to diagrams and component descriptions
Design: Flattened 2-class architecture
Unlike RTI's 4-class two-level design (discovery + subscription manager + 2 thin adapters), the FastDDS backend directly implements the abstract interfaces in 2 classes. The same simplification was applied to RTI in commit cd3c60b.
Simplifications applied (matching RTI commit)
Removed redundant type_name from DiscoveredTopic — derived from dynamic_type->get_name()
Extracted close_subscription() helper to deduplicate cleanup in unsubscribe() and unsubscribe_all()