feat(rtps): Improve implementation to talk to FastRTPS and implement reliable QoS (HEARTBEAT/ACKNACK)#660
Merged
Conversation
…HEARTBEAT/ACKNACK
|
✅Static analysis result - no issues found! ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Takes the RTPS participant from best-effort-only to a fully interoperable
reliable RTPS endpoint, validated on hardware against Fast DDS/RTPS (ESP32-P4
over Ethernet publishing to a Fast RTPS subscriber on another machine).
Reliable QoS — full HEARTBEAT / ACKNACK / GAP, both directions:
HEARTBEAT,ACKNACK,GAP,INFO_DST, and aSequenceNumberSet(bitmapBase + up to 256-bit bitmap), all endian-aware.WriterConfig.history_depth, KEEP_LAST); sample cached onpublish();HEARTBEAT emitted after publish and periodically (
Config.heartbeat_period);on ACKNACK, resends the NACKed samples still in history to the requesting
reader, and emits a GAP for samples already evicted so the reader stops
re-NACKing them.
suppression and in-order delivery via a bounded reorder buffer
(
Config.reliable_reorder_depth); replies to HEARTBEATs with anACKNACK(missing-SN bitmap or positive ack); honors incoming GAP by advancing its
frontier past irrelevant SNs (and releasing anything buffered behind them).
build_directed_data_message(INFO_DST + DATA addressed to thetarget reader) drives all retransmission.
Builtin discovery (SEDP) reliability:
writers, so Fast DDS (re)sends us the endpoint data we need to match it (fixes
the original "No send destinations").
local endpoint = SN = its 1-based index) and emit SEDP HEARTBEATs, so a
reliable peer ACKNACKs and we retransmit a missed announcement — discovery
is now recoverable on a lossy link, not just via periodic re-announce.
Interoperability fixes:
DATAnow carries the matched reader'sreaderId(multicast staysENTITYID_UNKNOWN). Fast RTPS reliable readers require this.Discovery storage refactor (
DiscoveryDb):DiscoveryDb(own mutex)instead of vectors scanned with
find_if.existing record, so a later/trimmed announce no longer erases learned
locators/QoS/names.
ParticipantProxystores the full metatraffic/default unicast+multicastlocators.
Diagnostics: DEBUG logging across discovery and the reliable paths
(advertised address/ports, parsed SPDP/SEDP locators, retransmit/GAP
destinations, unknown-writer DATA).
See
components/rtps/RELIABLE_RTPS_PLAN.mdfor the phase-by-phase design.Motivation and Context
The participant could discover peers and send best-effort data but could not
interoperate with reliable DDS/ROS 2 endpoints: it never ACKNACK'd discovery or
data HEARTBEATs (so reliable peers withheld discovery data → "No send
destinations"), sent DATA with an unknown
readerId, never retransmitted onNACK, lost locators on re-announcement, and steered multicast out the wrong
interface on multi-homed hosts. This change makes the ESP32 a reliable RTPS
publisher/subscriber that Fast RTPS accepts and that recovers from packet loss.
How has this been tested?
rtpsexample builds clean (esp32 family); socket changes build via thertpsdependency.
separate machine — confirmed SPDP/SEDP discovery, the builtin + user
HEARTBEAT/ACKNACK exchange (Wireshark + new DEBUG logs), and reliable sample
delivery. SEDP HEARTBEAT/ACKNACK confirmed working on hardware.
multi-homed macOS host without OS interface-priority changes.
the plan doc, Phase 5).
Screenshots (if appropriate):
N/A
Types of changes
Checklist:
RELIABLE_RTPS_PLAN.md).Software
.github/workflows/build.ymlto add my new test to the cloud build.