Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No QGC location with external GPS #10271

Closed
Vigasto opened this issue Apr 28, 2022 · 4 comments
Closed

No QGC location with external GPS #10271

Vigasto opened this issue Apr 28, 2022 · 4 comments

Comments

@Vigasto
Copy link

Vigasto commented Apr 28, 2022

Expected Behavior

Using external GPS device should provide GCS position and is shown on map

Current Behavior

GCS position is not available even though the device is being read

Steps to Reproduce:

  1. Set NMEA GPS device to the correct source
  2. (optional) if GPS is USB based, reconnect device
  3. Restart QGC

System Information

When posting bug reports, include the following information

  • Operating System: Windows 10, Ubuntu 20.04
  • QGC Version: 4.2.0, 4.1.x
  • QGC build: stable, self-built (4.1.x)
  • Flight Controller: N/A
  • Autopilot (with version): N/A

Detailed Description

The issue is currently only experienced with v4.2.0 with v4.1.x still providing GCS location. File changes suggested that this is due to incorrect handling of stricter requirements in #9483 which enforces QGeoPositionInfo::HorizontalAccuracy or HDOP availability. Reverting these commits solves the issue.

Also note that this requirements are also set only in follow me mode which is aimed at mobile device which has internal gps; maybe they need different handlings?

Log Files and Screenshots

  • Console Log
  • GPS device is checked to have GNGSA messages as shown.
    gngsa
@booo
Copy link
Collaborator

booo commented Aug 22, 2022

I found this gem in the Qt documentation:

QNmeaPositionInfoSource supports reporting the accuracy of the horizontal and vertical position. To enable position accuracy reporting an estimate of the User Equivalent Range Error associated with the NMEA source must be set with setUserEquivalentRangeError().

Additional documentation on the setUserEquivalentRangeError Qt function: https://doc.qt.io/qt-6/qnmeapositioninfosource.html#setUserEquivalentRangeError

I added this little change to the current master code and the position update starts working again:

diff --git a/src/PositionManager/PositionManager.cpp b/src/PositionManager/PositionManager.cpp
index 10d26c3bb..53392b615 100644
--- a/src/PositionManager/PositionManager.cpp
+++ b/src/PositionManager/PositionManager.cpp
@@ -101,6 +101,7 @@ void QGCPositionManager::setNmeaSourceDevice(QIODevice* device)
     }
     _nmeaSource = new QNmeaPositionInfoSource(QNmeaPositionInfoSource::RealTimeMode, this);
     _nmeaSource->setDevice(device);
+    _nmeaSource->setUserEquivalentRangeError(5.1);
     setPositionSource(QGCPositionManager::NmeaGPS);
 }

booo added a commit to booo/qgroundcontrol that referenced this issue Aug 22, 2022
"QNmeaPositionInfoSource supports reporting the accuracy of the
horizontal and vertical position. To enable position accuracy reporting
an estimate of the User Equivalent Range Error associated with the NMEA
source must be set with setUserEquivalentRangeError."

Source: https://doc.qt.io/qt-6/qnmeapositioninfosource.html#details

Commit 2a9ecab introduced new behaviour
that broke use of external GPS. This change fixes the problem reported
in mavlink#10271.
bkueng pushed a commit that referenced this issue Aug 23, 2022
"QNmeaPositionInfoSource supports reporting the accuracy of the
horizontal and vertical position. To enable position accuracy reporting
an estimate of the User Equivalent Range Error associated with the NMEA
source must be set with setUserEquivalentRangeError."

Source: https://doc.qt.io/qt-6/qnmeapositioninfosource.html#details

Commit 2a9ecab introduced new behaviour
that broke use of external GPS. This change fixes the problem reported
in #10271.
@booo
Copy link
Collaborator

booo commented Aug 23, 2022

Fixed in master.

@booo booo closed this as completed Aug 23, 2022
patrickelectric pushed a commit to Jaeyoung-Lim/qgroundcontrol that referenced this issue Sep 2, 2022
"QNmeaPositionInfoSource supports reporting the accuracy of the
horizontal and vertical position. To enable position accuracy reporting
an estimate of the User Equivalent Range Error associated with the NMEA
source must be set with setUserEquivalentRangeError."

Source: https://doc.qt.io/qt-6/qnmeapositioninfosource.html#details

Commit 2a9ecab introduced new behaviour
that broke use of external GPS. This change fixes the problem reported
in mavlink#10271.
@Vigasto
Copy link
Author

Vigasto commented Sep 5, 2022

I see, no wonder the accuracy estimate weren't there. Thanks for the fix!

Williangalvani pushed a commit to Williangalvani/qgroundcontrol that referenced this issue Nov 11, 2022
"QNmeaPositionInfoSource supports reporting the accuracy of the
horizontal and vertical position. To enable position accuracy reporting
an estimate of the User Equivalent Range Error associated with the NMEA
source must be set with setUserEquivalentRangeError."

Source: https://doc.qt.io/qt-6/qnmeapositioninfosource.html#details

Commit 2a9ecab introduced new behaviour
that broke use of external GPS. This change fixes the problem reported
in mavlink#10271.
Williangalvani pushed a commit to Williangalvani/qgroundcontrol that referenced this issue Nov 15, 2022
"QNmeaPositionInfoSource supports reporting the accuracy of the
horizontal and vertical position. To enable position accuracy reporting
an estimate of the User Equivalent Range Error associated with the NMEA
source must be set with setUserEquivalentRangeError."

Source: https://doc.qt.io/qt-6/qnmeapositioninfosource.html#details

Commit 2a9ecab introduced new behaviour
that broke use of external GPS. This change fixes the problem reported
in mavlink#10271.
patrickelectric pushed a commit that referenced this issue Nov 16, 2022
"QNmeaPositionInfoSource supports reporting the accuracy of the
horizontal and vertical position. To enable position accuracy reporting
an estimate of the User Equivalent Range Error associated with the NMEA
source must be set with setUserEquivalentRangeError."

Source: https://doc.qt.io/qt-6/qnmeapositioninfosource.html#details

Commit 2a9ecab introduced new behaviour
that broke use of external GPS. This change fixes the problem reported
in #10271.
@kevinjhur
Copy link

Thank you for solution.
I can see QGCicon on the flight view, but the icon move quickly to random location like flight.
It's like gps drifting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants