GPS / remote ID improvements#64
Merged
Merged
Conversation
julianoes
commented
Jul 2, 2026
Collaborator
- Properly support disabling NMEA link to switch back to integrated Android GPS.
- Show live GCS position in remote ID tab.
CraigElder
requested changes
Jul 3, 2026
CraigElder
left a comment
Collaborator
There was a problem hiding this comment.
Tested and does not work. Still flapping
Selecting Disabled (or otherwise switching off NMEA) in the Comm Links NMEA GPS section closed the UDP socket but left QGCPositionManager stuck on the now-dead NMEA source, so the GCS position froze and there was no way back to the device's own GPS. Add QGCPositionManager::resetNmeaSourceDevice() which tears down the NMEA source and, if it was active, reverts to the default/internal position source (e.g. the integrated Android GPS). Call it from LinkManager when NMEA is no longer configured, and also tear down a lingering serial NMEA port in that case.
In the GroundStation Location group the fixed lat/lon/alt fields were always shown, so in Live GNSS mode they displayed a greyed-out 0/0/0 even though a valid integrated-GPS position was actually being sent - which was confusing. Only show the fixed fields in Fixed mode, and add a live read-only readout of the current lat/lon/alt (from QGCPositionManager, the same source RemoteIDManager broadcasts in OPEN_DRONE_ID_SYSTEM) for the non-fixed modes, with a 'Waiting for GPS...' placeholder until a valid fix arrives.
The freshness check in _sendSystem() compared update.timestamp() (the position source's own clock) against the local wall clock. On Android that timestamp is offset from the system clock, and when the offset sat near the 5s ALLOWED_GPS_DELAY threshold the computed age swept across it every send cycle, flapping gcsGPSGood green/red at 1 Hz despite a healthy 1 Hz fix. Record the local arrival time instead, so the check measures the true time since the last valid fix and is immune to GPS-vs-system clock skew.
Altitude was dropped whenever the fix's vertical accuracy exceeded a strict 10m gate (or wasn't reported), which the Android position source almost never meets, leaving gcsPosition.altitude() as NaN. Remote ID in FAA regions mandates an operator altitude, so this made Live GNSS unusable there. Accept the altitude on any 3D fix when the vertical accuracy is within threshold or not reported at all, and raise the vertical threshold to 100m to match the horizontal one.
The gcsGPSGood checks flipped the flag relative to its previous value across separate conditionals (and early-returned in the FAA no-altitude case), so it oscillated green/red at the send rate whenever a condition sat near its boundary - e.g. in FAA when the altitude was momentarily missing. Compute the health from the current fix each cycle (valid, altitude-if-FAA, fresh) and emit only on change. Also keep sending the SYSTEM message with an UNKNOWN location instead of going silent when the fix isn't usable.
julianoes
force-pushed
the
pr-gps-improvements
branch
from
July 5, 2026 23:31
7a6ab1e to
f90cd0a
Compare
CraigElder
self-requested a review
July 6, 2026 00:39
CraigElder
approved these changes
Jul 6, 2026
CraigElder
left a comment
Collaborator
There was a problem hiding this comment.
Working now. Thank you!
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.