gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: altitude validity


From: Gary E. Miller
Subject: Re: altitude validity
Date: Mon, 3 Feb 2020 16:00:29 -0800

Yo Greg!

On Mon, 03 Feb 2020 18:44:16 -0500
Greg Troxel <address@hidden> wrote:

> (I'm helping someone with a Free Software program that uses libgps,
> but my question stands on its own.)

Care to share the name?  Nice to know any FOSS that uses gpsd.
 
> in gps.h, I see

Yup.

> 1) It looks like altitude is there still but it will be uninitialized.

No, it is set to NAN by default in liggps_json.c

> This means people with code that doesn't cope will be able to compile
> but then hit Undefined Behavior. 

No.

> 2) altHAE is set to be valid in mode 3, and there is no comment about
> altMSL.   And, presumably both are valid if ALTITUDE_SET is on, and if
> not on, neither are.

No.  Check for the NAN.  Any combination may be NAN, or valid.

> 2A) This means therefore that if a receiver provides one of altHAE or
> altMSL, but not the other, gpsd will use its own geoid model to
> compute the other, and thus the user gets both or none.

Usually.  Or maybe libgps connected to an old gpsd and only got
altitude.

> 3) Someone who wants normal-people-altitude, sort of "WGS84 height
> above geoid" or (NA only) "NAVD88, ish" would want to say
>     if API >= 9
>        read altMSL
>     else
>       read altitude
>     endif

Or maybe:

     if altMSL != NAN
        read altMSL
     else if altitude != NAN
        read altitude
     else
        NAN
     endif

Except altitude may be MSL, may be HAT, or may be garbage.  I deprecated it
because it was random.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin

Attachment: pgpAtX0leQHMN.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]