diff options
author | Pavel Kirienko <pavel.kirienko.list@gmail.com> | 2013-11-26 11:51:55 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-11-26 11:51:55 -0500 |
commit | 94f5efb20408b88c45f36a7b90ce790eea118001 (patch) | |
tree | e6239370c8e959771dd94a13c02f686dcd85937d /driver_ubx.c | |
parent | c66cbb26fcbf2bc075f09222cdb3bb905b07a328 (diff) | |
download | gpsd-94f5efb20408b88c45f36a7b90ce790eea118001.tar.gz |
Get vertical error position and speed estimates from the u-blox driver.
That is, rather than having to interpolate them. This required two
regression-test rebuilds in obvious places.
Diffstat (limited to 'driver_ubx.c')
-rw-r--r-- | driver_ubx.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/driver_ubx.c b/driver_ubx.c index 9b8b5d69..7b4ee1ea 100644 --- a/driver_ubx.c +++ b/driver_ubx.c @@ -105,10 +105,22 @@ ubx_msg_nav_sol(struct gps_device_t *session, unsigned char *buf, ecef_to_wgs84fix(&session->newdata, &session->gpsdata.separation, epx, epy, epz, evx, evy, evz); mask |= LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | CLIMB_SET; - session->newdata.epx = session->newdata.epy = - (double)(getles32(buf, 24) / 100.0) / sqrt(2); + + if (session->driver.ubx.last_herr > 0.0) { + session->newdata.epx = session->newdata.epy = session->driver.ubx.last_herr; + mask |= HERR_SET; + session->driver.ubx.last_herr = 0.0; + } + + if (session->driver.ubx.last_verr > 0.0) { + session->newdata.epv = session->driver.ubx.last_verr; + mask |= VERR_SET; + session->driver.ubx.last_verr = 0.0; + } + session->newdata.eps = (double)(getles32(buf, 40) / 100.0); - mask |= HERR_SET | SPEEDERR_SET; + mask |= SPEEDERR_SET; + /* Better to have a single point of truth about DOPs */ //session->gpsdata.dop.pdop = (double)(getleu16(buf, 44)/100.0); session->gpsdata.satellites_used = (int)getub(buf, 47); @@ -149,6 +161,18 @@ ubx_msg_nav_sol(struct gps_device_t *session, unsigned char *buf, return mask; } + /** + * Geodetic position solution message + */ +static gps_mask_t +ubx_msg_nav_posllh(struct gps_device_t *session, unsigned char *buf, + size_t data_len) +{ + session->driver.ubx.last_herr = (double)(getleu32(buf, 20) / 1000.0); + session->driver.ubx.last_verr = (double)(getleu32(buf, 24) / 1000.0); + return 0; +} + /** * Dilution of precision message */ @@ -362,6 +386,7 @@ gps_mask_t ubx_parse(struct gps_device_t * session, unsigned char *buf, break; case UBX_NAV_POSLLH: gpsd_report(session->context->debug, LOG_DATA, "UBX_NAV_POSLLH\n"); + mask = ubx_msg_nav_posllh(session, &buf[UBX_PREFIX_LEN], data_len); break; case UBX_NAV_STATUS: gpsd_report(session->context->debug, LOG_DATA, "UBX_NAV_STATUS\n"); |