feat(gps): Comprehensive GPS/RTK/NTRIP subsystem improvements#14112
feat(gps): Comprehensive GPS/RTK/NTRIP subsystem improvements#14112HTRamsey wants to merge 1 commit intomavlink:masterfrom
Conversation
bd106e6 to
ace132e
Compare
Build ResultsPlatform Status
All builds passed. Pre-commit
Pre-commit hooks: 4 passed, 32 failed, 7 skipped. Test Resultslinux-sanitizers: 88 passed, 0 skipped Artifact Sizes
|
10839e3 to
3c34872
Compare
There was a problem hiding this comment.
Pull request overview
This PR substantially refactors and expands QGroundControl’s GPS subsystem, splitting responsibilities into RTK and NTRIP components, adding new abstractions for transports and routing, and integrating new status/controls into the UI and QML globals.
Changes:
- Introduces new RTK/NTRIP architecture components (RTCM routing, MAVLink RTCM fragmentation + stats, reconnect policy, connection stats, UDP forwarder) and adds extensive unit/integration/E2E test coverage.
- Extends vehicle GPS FactGroups and metadata (altitudes, accuracies, speeds, and GNSS integrity enums) and updates toolbar indicator behavior/badges.
- Adds/updates QML settings pages and supporting reusable QML controls, plus new RTK base station map overlay.
Reviewed changes
Copilot reviewed 149 out of 152 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/QmlControls/QGroundControlQmlGlobal.h |
Exposes new GPS-related objects to QML (gpsManager, gpsRtk fact group, models). |
src/QmlControls/QGroundControlQmlGlobal.cc |
Wires QML globals to GPSManager singletons and models in ctor. |
src/GPS/GPSManager.h/.cc |
Implements multi-device RTK management, RTCM router/mavlink, and event log plumbing. |
src/GPS/NTRIP/NTRIPReconnectPolicy.cc |
Adds exponential-backoff reconnect logic for NTRIP. |
test/GPS/NTRIP/NTRIPHttpTransportTest.cc |
Updates whitelist tests and adds transport config validation tests. |
src/GPS/RTK/RTKBaseStationMapItem.qml |
Adds map overlay for RTK base station marker/line. |
src/UI/toolbar/GPSIndicator.qml |
Enhances GPS indicator coloring, badges, and click handling. |
Comments suppressed due to low confidence (1)
test/GPS/NTRIP/NTRIPHttpTransportTest.cc:78
- This assertion is logically equivalent to
QVERIFY(t._rtcmParser.isWhitelisted(9999));but the current!x == falseform is hard to read and easy to misinterpret. Simplifying it will make the intent (empty whitelist accepts all IDs) clearer.
You can also share your feedback on Copilot code review. Take the survey.
| QGCLabel { | ||
| anchors.centerIn: parent | ||
| text: "!" | ||
| color: "white" | ||
| font.bold: true | ||
| font.pixelSize: parent.height * 0.7 | ||
| } |
There was a problem hiding this comment.
The interference badge label uses a hardcoded "white" text color. To keep theming consistent (light/dark palettes, custom themes), prefer using QGCPalette colors instead of literal color strings.
| Q_PROPERTY(GPSManager* gpsManager READ gpsManager CONSTANT) | ||
| Q_PROPERTY(FactGroup* gpsRtk READ gpsRtkFactGroup CONSTANT) | ||
| #endif | ||
| Q_PROPERTY(RTKSatelliteModel* rtkSatelliteModel READ rtkSatelliteModel CONSTANT) | ||
| Q_PROPERTY(GPSEventModel* gpsEventModel READ gpsEventModel CONSTANT) |
There was a problem hiding this comment.
gpsRtk, rtkSatelliteModel, and gpsEventModel are declared as CONSTANT, but their underlying pointers depend on runtime GPS device connections. If no RTK device is connected at startup, these will be nullptr and QML bindings won’t update when a device later connects. Consider making these Q_PROPERTY values non-constant with NOTIFY signals (emitted on device connect/disconnect/primary-device change), or expose them via GPSManager properties that notify changes.
| if (_deviceMap.isEmpty()) { | ||
| return nullptr; | ||
| } | ||
| return _deviceMap.cbegin().value(); |
There was a problem hiding this comment.
_primaryDevice() selects the primary RTK device via QHash::cbegin(), but QHash iteration order is not deterministic. With multiple RTK devices connected, the chosen primary (and thus the fact group / satellite model / position source exposed to UI) can change unpredictably. Consider explicitly tracking a primary device (first-connected, user-selected, etc.) or using an ordered container.
| return _deviceMap.cbegin().value(); | |
| // Select primary device deterministically by choosing the device with the | |
| // lexicographically smallest key, instead of relying on QHash iteration order. | |
| auto bestIt = _deviceMap.cbegin(); | |
| for (auto it = _deviceMap.cbegin(); it != _deviceMap.cend(); ++it) { | |
| if (it.key() < bestIt.key()) { | |
| bestIt = it; | |
| } | |
| } | |
| return bestIt.value(); |
| int NTRIPReconnectPolicy::nextBackoffMs() const | ||
| { | ||
| return qMin(kMinReconnectMs * (1 << qMin(_attempts, 4)), kMaxReconnectMs); | ||
| } |
There was a problem hiding this comment.
nextBackoffMs() caps the exponent with qMin(_attempts, 4), so the backoff tops out at 16s (1s * 2^4) and will never reach kMaxReconnectMs (30s). If the intended max is 30s, allow attempts to grow until the computed backoff exceeds kMaxReconnectMs (then clamp), or adjust the cap accordingly.
be8e7f1 to
8492da8
Compare
8490048 to
6b29db1
Compare
71625a2 to
6b8ff2c
Compare
- Rewrite NTRIP subsystem with transport abstraction, reconnect policy, connection stats, and GGA provider - Add RTK satellite model with per-satellite SNR/constellation tracking - Extract QML components: RTKBaseStationStatus, RTKBaseStationMapItem, NTRIPConnectionStatus into GPS QML modules - Move settings into domain modules: RTKSettings → GPS.RTK, NTRIPSettings → GPS.NTRIP, GCSPositionSettings → PositionManager - Add 3-tab settings UI separating RTK, NTRIP, and GCS Position concerns - Add connect/disconnect controls for RTK base station and NMEA GPS - Add GPS event model and logging infrastructure - Fix clang -Wunused-lambda-capture in GPSRtk - Comprehensive null guards in RTKBaseStationStatus QML
6b8ff2c to
869093f
Compare
Summary
Restructures and enhances the GPS subsystem with improved architecture, testability, and UI integration.
Architecture
src/GPS/intoNTRIP/andRTK/subdirectories with clean separation of concernsNTRIPTransportabstract base class with factory injection pattern for testabilityRTCMRouterfor multi-device RTCM distribution (vehicles via MAVLink + base stations via serial)GPSTransportabstraction decoupling GPS provider from serial implementationGPSEventModelfor structured, queryable event loggingNTRIP
NTRIPReconnectPolicy)NTRIPConnectionStats)NTRIPGgaProvider)NTRIPUdpForwarder)NTRIPError::SslError)NTRIPTransportConfig::isValid())stopNTRIP()canceled pending reconnect timerstopNTRIP()not canceling reconnect when called while idle with pending timerRTK
RTCMMavlinkMAVLink fragmentation with bandwidth trackingRTKSatelliteModelfor per-satellite signal strength displayGPSRTKFactGroupwith survey-in progress, baseline, and heading factsVehicle Integration
UI
QGCListView)RepeaterCleanup
_MSC_VER < 1900compatibility code_WIN32toQ_OS_WINfor Qt convention consistencyqCCriticalreplacingQ_ASSERT_X)Tests
NTRIPEndToEndTest)MockNTRIPTransport,MockGPSRtkNTRIPIntegrationTest,RTKIntegrationTest,SettingsLifecycleTestRTCMTestHelperfor building valid RTCM3 frames with correct CRCTest plan
-Werror)