summaryrefslogtreecommitdiff
path: root/driver_navcom.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-03-26 15:11:18 -0700
committerGary E. Miller <gem@rellim.com>2019-03-26 15:11:18 -0700
commit89df5f06e0383ff2cabae01125e260598549a3d3 (patch)
tree34f42eb4ad62c73ca332d80824ea28f84d6b1a94 /driver_navcom.c
parentd664929ab4f527a0bda7fbf263d0337d7fffc743 (diff)
downloadgpsd-89df5f06e0383ff2cabae01125e260598549a3d3.tar.gz
driver_navcom: Move error math to gpsd_error_model()
The numbers look better now.
Diffstat (limited to 'driver_navcom.c')
-rw-r--r--driver_navcom.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/driver_navcom.c b/driver_navcom.c
index e35e8011..63c37475 100644
--- a/driver_navcom.c
+++ b/driver_navcom.c
@@ -370,8 +370,7 @@ static gps_mask_t handle_0xb1(struct gps_device_t *session)
/* Resolution of velocity values (2.0^-10) */
#define VEL_RES (0.0009765625)
double track;
- uint8_t fom, gdop, pdop, hdop, vdop, tdop, tfom;
- double eph;
+ uint8_t gdop, pdop, hdop, vdop, tdop;
/* This value means "undefined" */
#define DOP_UNDEFINED (255)
@@ -447,20 +446,15 @@ static gps_mask_t handle_0xb1(struct gps_device_t *session)
session->newdata.climb = vel_up * VEL_RES;
/* Quality indicators */
- fom = getub(buf, 40);
+ /* UNUSED fom = getub(buf, 40); * FOM is DRMS */
gdop = getub(buf, 41);
pdop = getub(buf, 42);
hdop = getub(buf, 43);
vdop = getub(buf, 44);
tdop = getub(buf, 45);
- tfom = getub(buf, 46); /* tfom == 10 * TDOP */
+ /* UNUSED tfom = getub(buf, 46); * tfom == 10 * TDOP */
- /* Get two-sigma horizontal circular error estimate */
- eph = fom / 100.0 * 1.96;
- /* approximate epx and epy errors from it */
- session->newdata.epx = session->newdata.epy = eph / sqrt(2);
- /* this next does not seem a correct way to get to seconds */
- session->newdata.ept = tfom * 1.96; /* Two sigma */
+ /* let gpsd_error_model() do the error estimates */
if (gdop != DOP_UNDEFINED)
session->gpsdata.dop.gdop = gdop / 10.0;
@@ -502,7 +496,6 @@ static gps_mask_t handle_0xb1(struct gps_device_t *session)
gpsd_log(&session->context->errout, LOG_DATA,
"PVT 0xb1: time=%.2f, lat=%.2f lon=%.2f alt=%.f "
"speed=%.2f track=%.2f climb=%.2f mode=%d status=%d "
- "epx=%.2f epy=%.2f epv=%.2f "
"gdop=%.2f pdop=%.2f hdop=%.2f vdop=%.2f tdop=%.2f "
"mask={LATLON|ALTITUDE|CLIMB|SPEED|TRACK|TIME|STATUS|MODE|"
"USED|HERR|VERR|TIMERR|DOP}\n",
@@ -515,9 +508,6 @@ static gps_mask_t handle_0xb1(struct gps_device_t *session)
session->newdata.climb,
session->newdata.mode,
session->gpsdata.status,
- session->newdata.epx,
- session->newdata.epy,
- session->newdata.epv,
session->gpsdata.dop.gdop,
session->gpsdata.dop.pdop,
session->gpsdata.dop.hdop,
@@ -890,6 +880,7 @@ static gps_mask_t handle_0xb5(struct gps_device_t *session)
* with those obtained from the PVT report (handle_0xb1).
* The figures from 0xb1 do agree with the values reported
* by Navcom's PC utility */
+ /* let gpsd_error_model() handle this */
//double ellips_maj = getled64(buf, 17);
//double ellips_min = getled64(buf, 25);
//double ellips_azm = getled64(buf, 33);
@@ -897,10 +888,8 @@ static gps_mask_t handle_0xb5(struct gps_device_t *session)
double lon_sd = getled64(buf, 49);
double alt_sd = getled64(buf, 57);
double hrms = sqrt(pow(lat_sd, 2) + pow(lon_sd, 2));
-#endif /* __UNUSED__ */
/* Navcom doc unclear, this is likely sep? */
session->newdata.sep = rms * 1.96;
-#ifdef __UNUSED__
session->newdata.eph = hrms * 1.96;
session->newdata.epv = alt_sd * 1.96;
mask |= HERR_SET;