Skip to content

fix(GPS): correct GPS_RTCM_DATA fragmentation for MAVLink reassembly (5.1 backport) - #14779

Merged
DonLakeFlyer merged 4 commits into
mavlink:Stable_V5.1from
DonLakeFlyer:rtcm-fragmentation-5.1
Aug 8, 2026
Merged

fix(GPS): correct GPS_RTCM_DATA fragmentation for MAVLink reassembly (5.1 backport)#14779
DonLakeFlyer merged 4 commits into
mavlink:Stable_V5.1from
DonLakeFlyer:rtcm-fragmentation-5.1

Conversation

@DonLakeFlyer

Copy link
Copy Markdown
Contributor

Backport of #14772 to Stable_V5.1.

Also includes its dependency 9faca48 (fix(GPS): send RTCM once per link to avoid duplicate sends on shared links), which #14772 builds on and was not yet in 5.1.

All four commits cherry-picked cleanly; RTCMParserTest, RTCMMavlinkTest, and RTCMUdpInputTest pass locally.

DonLakeFlyer and others added 4 commits August 8, 2026 09:01
…links

RTCM corrections were sent once per vehicle over each vehicle's primary
link. When multiple vehicles share a single UDP link, each write is
also fanned out to every connected endpoint on the link, resulting in
N^2 duplicate GPS_RTCM_DATA packets for N vehicles.

Deduplicate by link: send each RTCM message exactly once per unique
primary link, directly on the link, so the send is not tied to
whichever vehicle happens to be first on a shared link.

Fixes mavlink#14765
Match MAVLink/ArduPilot/PX4 rules: unfragmented packets up to 180 bytes,
zero-length terminator for exact 180 multiples under 4 fragments, and
stream oversized (>720) payloads as unfragmented chunks instead of
overflowing the 2-bit fragment ID. Emit one UDP-validated RTCM frame per
sequence.
RTCMUdpInput now emits one CRC-valid frame per signal instead of
concatenating frames, which left extractValidFrames without callers.
Concatenated multi-frame output is exactly the shape that broke
GPS_RTCM_DATA sequencing, so drop it rather than leave it around.
Add RTCMUdpInputTest: raw passthrough with validation off, one signal
per CRC-valid frame, bad-CRC frames dropped mid-stream, and parser
state carried across split datagrams. RTCMUdpInput now resolves port 0
to the actual bound port so tests can bind ephemerally without racing
for a fixed port.

Also cover the 541..719 pack() range (four fragments with a non-full
tail, no terminator).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Backports the GPS RTCM fragmentation and shared-link delivery fixes to Stable_V5.1.

Changes:

  • Corrects MAVLink fragmentation, terminators, sequence IDs, and oversized payload handling.
  • Emits validated UDP RTCM frames individually and removes concatenation.
  • Deduplicates RTCM transmission per link and adds boundary-focused tests.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/GPS/RTCM/RTCMMavlink.cc Implements corrected packing and per-link sending.
src/GPS/RTCM/RTCMMavlink.h Defines packet and packing interfaces.
src/GPS/RTCM/RTCMParser.cc Removes obsolete frame concatenation.
src/GPS/RTCM/RTCMParser.h Removes the obsolete parser API.
src/GPS/RTCM/RTCMUdpInput.cc Emits each validated frame separately.
src/GPS/RTCM/RTCMUdpInput.h Documents updated UDP behavior.
test/GPS/CMakeLists.txt Registers new GPS tests.
test/GPS/RTCMMavlinkTest.cc Tests fragmentation boundaries and flags.
test/GPS/RTCMMavlinkTest.h Declares MAVLink packing tests.
test/GPS/RTCMParserTest.cc Removes obsolete API tests.
test/GPS/RTCMParserTest.h Removes obsolete test declarations.
test/GPS/RTCMUdpInputTest.cc Tests UDP validation and frame emission.
test/GPS/RTCMUdpInputTest.h Declares UDP input tests.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 48.35165% with 47 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (Stable_V5.1@cb8e822). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/GPS/RTCM/RTCMMavlink.cc 47.36% 28 Missing and 12 partials ⚠️
src/GPS/RTCM/RTCMUdpInput.cc 53.33% 1 Missing and 6 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff               @@
##             Stable_V5.1   #14779   +/-   ##
==============================================
  Coverage               ?   32.71%           
==============================================
  Files                  ?      784           
  Lines                  ?    67602           
  Branches               ?    31311           
==============================================
  Hits                   ?    22119           
  Misses                 ?    30595           
  Partials               ?    14888           
Flag Coverage Δ
unittests 32.71% <48.35%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/GPS/RTCM/RTCMMavlink.h 0.00% <ø> (ø)
src/GPS/RTCM/RTCMParser.cc 85.29% <ø> (ø)
src/GPS/RTCM/RTCMParser.h 66.66% <ø> (ø)
src/GPS/RTCM/RTCMUdpInput.h 100.00% <ø> (ø)
src/GPS/RTCM/RTCMUdpInput.cc 48.68% <53.33%> (ø)
src/GPS/RTCM/RTCMMavlink.cc 36.89% <47.36%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb8e822...e334abc. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Build Results

Platform Status

Platform Status Details
Linux Passed View
Windows Passed View
MacOS Passed View
Android Passed View

All builds passed.

Pre-commit

Check Status Details
pre-commit Failed (non-blocking) View

Pre-commit hooks: 0 passed, 0 failed, 0 skipped.

Test Results

linux-coverage-integration: 37 passed, 0 skipped
linux-coverage-unit: 119 passed, 0 skipped
linux-sanitizers-integration: 20 passed, 0 skipped
linux-sanitizers-unit: 119 passed, 0 skipped
Total: 295 passed, 0 skipped

Code Coverage

Coverage Baseline Change
69.5% 69.4% +0.1%

Artifact Sizes

Artifact Size Δ from master
QGroundControl 221.79 MB -4.40 MB (decrease)
QGroundControl-aarch64 179.35 MB +0.00 MB (increase)
QGroundControl-installer-AMD64 137.85 MB -0.47 MB (decrease)
QGroundControl-installer-AMD64-ARM64 80.37 MB -0.21 MB (decrease)
QGroundControl-installer-ARM64 109.12 MB -0.02 MB (decrease)
QGroundControl-linux 87.04 MB -78.73 MB (decrease)
QGroundControl-mac 87.04 MB +0.00 MB (increase)
QGroundControl-x86_64 191.59 MB +0.01 MB (increase)
Total size decreased by 83.82 MB

Updated: 2026-08-08 16:44:28 UTC • Commit: e334abc • Triggered by: Android

@DonLakeFlyer
DonLakeFlyer merged commit 427f882 into mavlink:Stable_V5.1 Aug 8, 2026
46 checks passed
@DonLakeFlyer
DonLakeFlyer deleted the rtcm-fragmentation-5.1 branch August 8, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants