inav icon indicating copy to clipboard operation
inav copied to clipboard

v2.0.0 RC2 shows GPS altitude -17m before GPS fix

Open teckel12 opened this issue 8 years ago • 10 comments

Just started with v2.0.0 RC2. Before GPS fix, the altitude shows as -17 meters. Once there's a GPS lock, it appears to be correct (but I guess could still be 17 meters off).

timestamp,gpsFix,gpsNumSat,gpsLat,gpsLon,gpsAlt,gpsSpeed,gpsGroundCourse
1531075178170,0,0,0,0,-17,0,0
1531075178271,0,0,0,0,-17,0,0
1531075178369,0,0,0,0,-17,0,0
1531075178472,0,0,0,0,-17,0,0
1531075178571,0,0,0,0,-17,0,0
1531075178671,0,0,0,0,-17,0,0
1531075178771,0,0,0,0,-17,0,0
1531075178870,0,0,0,0,-17,0,0
1531075178971,0,0,0,0,-17,0,0

It shows as -17m in the configurator and via telemetry. Flashed 1.9.1 and it shows 0m before GPS fix.

teckel12 avatar Jul 08 '18 18:07 teckel12

https://github.com/iNavFlight/inav/pull/3501

stronnag avatar Jul 08 '18 18:07 stronnag

I merged in #3501 and it still shows -17m. This issue isn't for BB recording, it's showing -17m in the configurator and telemetry. OSD shows GPS altitude of 0. Didn't confirm if the BB is correct as I'm not skilled with BB recordings and I believe their binary so not easy to quickly review.

teckel12 avatar Jul 08 '18 20:07 teckel12

Post #3501, BB is correct (is was not in rc2). That PR does not affect anything other than BB.

stronnag avatar Jul 08 '18 20:07 stronnag

I guess that's what I was clarifying, that #3501 doesn't address this problem.

teckel12 avatar Jul 08 '18 20:07 teckel12

@teckel12 I can't reproduce this. The only way I see a -17 would get in there would be if the GPS was sending -17m as its altitude. Note that telemetry and the configurator show the altitude as reported by the GPS, while the OSD shows the estimated altitude (which stays at zero while disarmed).

fiam avatar Jul 11 '18 11:07 fiam

I have 2 quads with the BN-880 GPS. Running 1.9.1 they both showed 0m for the GPS altitude. But when I upgraded to 2.0.0 both show - 17m. On one I even rolled back to 1.9.1 and it showed 0m again.

teckel12 avatar Jul 11 '18 14:07 teckel12

can confirm on my BN-180

vavisimo avatar Jul 11 '18 17:07 vavisimo

In gpspassthrough I see 0N,0E -17m until a position is determined (without a fix)

POSLLH: lat: 0.000000 lon: 0.000000 elev: -17.00 acc(h/v): 4294967.3/3750000.4
sats: 0, fix 0

then as it started to get a position:

POSLLH: lat: 26.415727 lon: 6.939176 elev: 4174.57 acc(h/v): 4294967.3/3750001.9
sats: 0, fix 0

This is an old bench test Neo6M, doesn't get a fix very often, today is its lucky day.

POSLLH: lat: 50.915381 lon: -1.530285 elev: 12.00 acc(h/v): 17.1/20.3
sats: 5, fix 3

Noted that gps_ublox.c has not changed since 1.9.0 ...

But so what, if your GPS has no fix, it doesn't really matter what the altitude is. Let me find a 1.9 hex.

stronnag avatar Jul 11 '18 17:07 stronnag

I've just realised why you don't see that in INAV 1.9.1. It's because the GPS wasn't sent until there was a GPS fix. Now it's sent either if you haven't armed or if it has a fix. This way you can discover the sensors without having to get a fix first, but if the GPS stops working in flight you will notice.

fiam avatar Jul 11 '18 17:07 fiam

@fiam That makes sense! Doesn't make much sense that GPS receivers are outputting a value of -17m before there's a GPS lock, but not INAV's fault.

teckel12 avatar Jul 11 '18 20:07 teckel12