GPS Tether - Wrong elevation at first point

Issue #441 closed
wthaemelt created an issue

In my NMEA data the order of lines is

$GPRMC, ...
$GPGGA, ...

When handling the first pair of these lines and creating the first (track)point from them, the point is already written after parsing/handling the RMC part. At this moment the elevation is not yet properly initialised (still NOFLOAT). The correct elevation is obtained only after handling the GGA part of the pair and it doesn't reach the already saved first point.

The following pairs of NMEA lines are handled differently. The point is created only after handling the GGA part.

It seems to me that something goes wrong with the last if statement in CRtGpsTetherInfo::slotReadyRead().

Adding `"ele != NOFLOAT"`` to the statement

if(toolRecord->isChecked() && _record != nullptr && lon != NOFLOAT && lat != NOFLOAT )

might avoid this early saving of data, but I'm not sure what happens if the GGA part is without a valid elevation (I don't know what happens in

gga.altAboveSeaLevel = tokens[9].toDouble();

if the tokens field is empty or wrong).

Comments (3)

  1. kiozen

    The problem is indeed that NMEA sentences have no order. RMC (RMC - Recommended Minimum Navigation Information) can be found in most cases. GGA might miss. And a sentence can miss any number of parameters, too. I do not see a generic solution for that. Only workarounds for special devices. And that's not an option for such an implementation.

  2. wthaemelt reporter

    In the last couple of days I've indeed seen many different NMEA data (files). Me to, I don't believe that there could be a universal solution to the problem. What was new to me is that even the order (RMC vs. GGA) may change. I'll try to formulate a few warnings/restrictions in the Wiki about using NMEA data.

    Please, close the issue.

  3. Log in to comment