Skip to content

GPS / remote ID improvements#64

Merged
julianoes merged 5 commits into
Stable_V5.0-Herelinkfrom
pr-gps-improvements
Jul 6, 2026
Merged

GPS / remote ID improvements#64
julianoes merged 5 commits into
Stable_V5.0-Herelinkfrom
pr-gps-improvements

Conversation

@julianoes

Copy link
Copy Markdown
Collaborator
  • Properly support disabling NMEA link to switch back to integrated Android GPS.
  • Show live GCS position in remote ID tab.

@CraigElder CraigElder left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tested and works.

@CraigElder CraigElder left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tested and works

@CraigElder CraigElder left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tested and does not work. Still flapping

julianoes added 5 commits July 6, 2026 10:10
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
julianoes force-pushed the pr-gps-improvements branch from 7a6ab1e to f90cd0a Compare July 5, 2026 23:31
@CraigElder
CraigElder self-requested a review July 6, 2026 00:39

@CraigElder CraigElder left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Working now. Thank you!

@julianoes
julianoes merged commit eff16bd into Stable_V5.0-Herelink Jul 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants