Skip to content

Commit a237215

Browse files
NTRIP Implementation (#13634)
* Add NTRIP support for GPS corrections During the rebase(NTRIP Implementation from @KnightHawk06), the upstream contributor introduced changes that broke the previous design of NTRIPTCPLink inheriting from QThread. The class no longer implemented valid QThread behavior, which caused build errors such as: illegal member initialization: 'QThread' is not a base or member QObject::connect: no matching signal/slot overload Missing methods (isRunning(), wait(), quit(), run(), exec()) and at runtime triggered Qt warnings about QSocketNotifier and thread affinity. This patch converts NTRIPTCPLink from a QThread subclass into a proper QObject worker and runs it inside a dedicated QThread created and owned by NTRIPManager. This follows the recommended Qt threading pattern and fixes the build-time and runtime issues. Key changes: Replace NTRIPTCPLink : QThread with NTRIPTCPLink : QObject Move socket and parser lifetime fully into the worker thread Add a start() slot instead of overriding run() Use requestStop() + finished signal to cleanly shut down the worker Update NTRIPManager to own the QThread and manage start/stop correctly Remove invalid QThread API calls from NTRIPTCPLink Eliminate race conditions and invalid cross-thread socket access Testing: Build-only verification on Windows (VS2022 + Qt 6.10). Connected to rtk2go with a nearby base station in SITL/simulator; verified NTRIP connection and RTCM data flow. No real vehicle available at the moment, so end-to-end RTK injection into an actual autopilot is not re-tested. Previously used successfully with the Turkish NTRIP caster TUSAGA-Aktif; current changes are expected to preserve functionality once a real vehicle + caster are available. Co-Authored-By: KnightHawk06 <[email protected]> * remove unrelated file Co-Authored-By: KnightHawk06 <[email protected]> --------- Co-authored-by: KnightHawk06 <[email protected]>
1 parent 1dee7b6 commit a237215

File tree

14 files changed

+1833
-2
lines changed

14 files changed

+1833
-2
lines changed

qgcresources.qrc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,11 @@
115115
<file alias="gcscontrol_gcs.svg">resources/gcscontrolIndicator/gcscontrol_gcs.svg</file>
116116
<file alias="gcscontrol_line.svg">resources/gcscontrolIndicator/gcscontrol_line.svg</file>
117117
</qresource>
118-
</RCC>
118+
<qresource prefix="/qml">
119+
<file alias="QGroundControl/AppSettings/NTRIPSettings.qml">src/UI/AppSettings/NTRIPSettings.qml</file>
120+
<file alias="NTRIPSettings.qml">src/UI/AppSettings/NTRIPSettings.qml</file>
121+
</qresource>
122+
<qresource prefix="/json">
123+
<file alias="NTRIP.SettingsGroup.json">src/Settings/NTRIP.SettingsGroup.json</file>
124+
</qresource>
125+
</RCC>

src/GPS/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ target_sources(${CMAKE_PROJECT_NAME}
1818
GPSRtk.h
1919
GPSRTKFactGroup.cc
2020
GPSRTKFactGroup.h
21+
NTRIP.cc
22+
NTRIP.h
2123
RTCMMavlink.cc
2224
RTCMMavlink.h
2325
satellite_info.h

0 commit comments

Comments
 (0)