diff options
author | Gary E. Miller <gem@rellim.com> | 2019-03-26 15:11:18 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2019-03-26 15:11:18 -0700 |
commit | 89df5f06e0383ff2cabae01125e260598549a3d3 (patch) | |
tree | 34f42eb4ad62c73ca332d80824ea28f84d6b1a94 | |
parent | d664929ab4f527a0bda7fbf263d0337d7fffc743 (diff) | |
download | gpsd-89df5f06e0383ff2cabae01125e260598549a3d3.tar.gz |
driver_navcom: Move error math to gpsd_error_model()
The numbers look better now.
-rw-r--r-- | driver_navcom.c | 21 | ||||
-rw-r--r-- | test/daemon/navcom.log.chk | 23 |
2 files changed, 16 insertions, 28 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; diff --git a/test/daemon/navcom.log.chk b/test/daemon/navcom.log.chk index 2ae040eb..6d5b6e09 100644 --- a/test/daemon/navcom.log.chk +++ b/test/daemon/navcom.log.chk @@ -2,8 +2,7 @@ $GPZDA,102005.00,15,01,2007,00,00*60 $GPGGA,102005.00,3020.5010,N,01213.7241,E,2,00,1.00,627.59,M,31.479,M,,*6B
$GPRMC,102005.00,A,3020.5010,N,01213.7241,E,0.0019,90.000,150107,,*32
$GPGSA,A,3,,,,,,,,,,,,,2.0,1.0,1.8*38
-$GPGBS,102005.00,0.222,0.222,10.350,,,,*70
-{"class":"TPV","status":2,"mode":3,"time":"2007-01-15T10:20:05.000Z","ept":3.920,"lat":30.341683155,"lon":12.228735775,"alt":627.588,"epx":0.222,"epy":0.222,"epv":10.350,"track":90.0000,"speed":0.001,"climb":0.006,"eph":4.750,"sep":9.500}
+{"class":"TPV","status":2,"mode":3,"time":"2007-01-15T10:20:05.000Z","ept":0.005,"lat":30.341683155,"lon":12.228735775,"alt":627.588,"epv":10.350,"track":90.0000,"speed":0.001,"climb":0.006,"eph":4.750,"sep":9.500}
$GPGSV,3,1,10,21,78,040,46,31,39,230,44,06,36,062,43,25,36,245,43*7F
$GPGSV,3,2,10,30,26,132,38,16,40,321,42,18,31,140,39,03,10,284,34*7F
$GPGSV,3,3,10,07,43,056,43,22,13,173,34*7C
@@ -12,8 +11,8 @@ $GPZDA,102006.00,15,01,2007,00,00*63 $GPGGA,102006.00,3020.5010,N,01213.7241,E,2,09,1.00,627.58,M,31.479,M,,*60
$GPRMC,102006.00,A,3020.5010,N,01213.7241,E,0.0135,0.000,150107,,*07
$GPGSA,A,3,21,31,6,25,30,16,18,3,7,,,,2.0,1.0,1.8*01
-$GPGBS,102006.00,0.222,0.222,10.350,,,,*73
-{"class":"TPV","status":2,"mode":3,"time":"2007-01-15T10:20:06.000Z","ept":3.920,"lat":30.341683205,"lon":12.228735818,"alt":627.577,"epx":0.222,"epy":0.222,"epv":10.350,"track":0.0000,"speed":0.007,"climb":0.008,"eps":0.44,"epc":20.70,"eph":4.750,"sep":9.500}
+$GPGBS,102006.00,2.047,2.792,10.350,,,,*7C
+{"class":"TPV","status":2,"mode":3,"time":"2007-01-15T10:20:06.000Z","ept":0.005,"lat":30.341683205,"lon":12.228735818,"alt":627.577,"epx":2.047,"epy":2.792,"epv":10.350,"track":0.0000,"speed":0.007,"climb":0.008,"eps":5.58,"epc":20.70,"eph":4.750,"sep":9.500}
$GPGSV,3,1,10,21,78,040,46,31,39,230,44,06,36,062,43,25,36,245,43*7F
$GPGSV,3,2,10,30,26,132,38,16,40,321,42,18,31,140,39,03,10,284,34*7F
$GPGSV,3,3,10,07,43,056,43,22,13,173,32*7A
@@ -22,8 +21,8 @@ $GPZDA,102007.00,15,01,2007,00,00*62 $GPGGA,102007.00,3020.5010,N,01213.7242,E,2,09,1.00,627.56,M,31.479,M,,*6C
$GPRMC,102007.00,A,3020.5010,N,01213.7242,E,0.0019,90.000,150107,,*33
$GPGSA,A,3,21,31,6,25,30,16,18,3,7,,,,2.0,1.0,1.8*01
-$GPGBS,102007.00,0.222,0.222,10.350,,,,*72
-{"class":"TPV","status":2,"mode":3,"time":"2007-01-15T10:20:07.000Z","ept":3.920,"lat":30.341683095,"lon":12.228735894,"alt":627.558,"epx":0.222,"epy":0.222,"epv":10.350,"track":90.0000,"speed":0.001,"climb":-0.019,"eps":0.44,"epc":20.70,"eph":4.750,"sep":9.500}
+$GPGBS,102007.00,2.047,2.792,10.350,,,,*7D
+{"class":"TPV","status":2,"mode":3,"time":"2007-01-15T10:20:07.000Z","ept":0.005,"lat":30.341683095,"lon":12.228735894,"alt":627.558,"epx":2.047,"epy":2.792,"epv":10.350,"track":90.0000,"speed":0.001,"climb":-0.019,"eps":5.58,"epc":20.70,"eph":4.750,"sep":9.500}
$GPGSV,3,1,10,21,78,040,46,31,39,230,44,06,36,062,43,25,36,245,43*7F
$GPGSV,3,2,10,30,26,132,38,16,40,321,42,18,31,140,39,03,10,284,34*7F
$GPGSV,3,3,10,07,43,056,43,22,13,173,44*7B
@@ -32,8 +31,8 @@ $GPZDA,102008.00,15,01,2007,00,00*6D $GPGGA,102008.00,3020.5010,N,01213.7242,E,2,09,1.00,627.55,M,31.479,M,,*60
$GPRMC,102008.00,A,3020.5010,N,01213.7242,E,0.0019,90.000,150107,,*3C
$GPGSA,A,3,21,31,6,25,30,16,18,3,7,,,,2.0,1.0,1.8*01
-$GPGBS,102008.00,0.222,0.222,10.350,,,,*7D
-{"class":"TPV","status":2,"mode":3,"time":"2007-01-15T10:20:08.000Z","ept":3.920,"lat":30.341683146,"lon":12.228735886,"alt":627.552,"epx":0.222,"epy":0.222,"epv":10.350,"track":90.0000,"speed":0.001,"climb":0.001,"eps":0.44,"epc":20.70,"eph":4.750,"sep":9.500}
+$GPGBS,102008.00,2.047,2.792,10.350,,,,*72
+{"class":"TPV","status":2,"mode":3,"time":"2007-01-15T10:20:08.000Z","ept":0.005,"lat":30.341683146,"lon":12.228735886,"alt":627.552,"epx":2.047,"epy":2.792,"epv":10.350,"track":90.0000,"speed":0.001,"climb":0.001,"eps":5.58,"epc":20.70,"eph":4.750,"sep":9.500}
$GPGSV,3,1,10,21,78,040,46,31,39,230,44,06,36,062,43,25,36,245,43*7F
$GPGSV,3,2,10,30,26,132,38,16,40,321,42,18,31,140,39,03,10,284,34*7F
$GPGSV,3,3,10,07,43,056,43,22,13,173,44*7B
@@ -42,8 +41,8 @@ $GPZDA,102009.00,15,01,2007,00,00*6C $GPGGA,102009.00,3020.5010,N,01213.7242,E,2,09,1.00,627.55,M,31.480,M,,*67
$GPRMC,102009.00,A,3020.5010,N,01213.7242,E,0.0019,0.000,150107,,*04
$GPGSA,A,3,21,31,6,25,30,16,18,3,7,,,,2.0,1.0,1.8*01
-$GPGBS,102009.00,0.222,0.222,10.350,,,,*7C
-{"class":"TPV","status":2,"mode":3,"time":"2007-01-15T10:20:09.000Z","ept":3.920,"lat":30.341683214,"lon":12.228735860,"alt":627.552,"epx":0.222,"epy":0.222,"epv":10.350,"track":0.0000,"speed":0.001,"climb":0.000,"eps":0.44,"epc":20.70,"eph":4.750,"sep":9.500}
+$GPGBS,102009.00,2.047,2.792,10.350,,,,*73
+{"class":"TPV","status":2,"mode":3,"time":"2007-01-15T10:20:09.000Z","ept":0.005,"lat":30.341683214,"lon":12.228735860,"alt":627.552,"epx":2.047,"epy":2.792,"epv":10.350,"track":0.0000,"speed":0.001,"climb":0.000,"eps":5.58,"epc":20.70,"eph":4.750,"sep":9.500}
$GPGSV,3,1,10,21,78,040,46,31,39,230,44,06,36,062,43,25,36,245,43*7F
$GPGSV,3,2,10,30,26,132,38,16,40,321,42,18,31,140,38,03,10,284,34*7E
$GPGSV,3,3,10,07,43,056,43,22,13,173,44*7B
@@ -52,8 +51,8 @@ $GPZDA,102010.00,15,01,2007,00,00*64 $GPGGA,102010.00,3020.5010,N,01213.7242,E,2,09,1.00,627.54,M,31.479,M,,*68
$GPRMC,102010.00,A,3020.5010,N,01213.7242,E,0.0019,0.000,150107,,*0C
$GPGSA,A,3,21,31,6,25,30,16,18,3,7,,,,2.0,1.0,1.8*01
-$GPGBS,102010.00,0.222,0.222,10.350,,,,*74
-{"class":"TPV","status":2,"mode":3,"time":"2007-01-15T10:20:10.000Z","ept":3.920,"lat":30.341683205,"lon":12.228735860,"alt":627.538,"epx":0.222,"epy":0.222,"epv":10.350,"track":0.0000,"speed":0.001,"climb":0.001,"eps":0.44,"epc":20.70,"eph":4.750,"sep":9.500}
+$GPGBS,102010.00,2.047,2.792,10.350,,,,*7B
+{"class":"TPV","status":2,"mode":3,"time":"2007-01-15T10:20:10.000Z","ept":0.005,"lat":30.341683205,"lon":12.228735860,"alt":627.538,"epx":2.047,"epy":2.792,"epv":10.350,"track":0.0000,"speed":0.001,"climb":0.001,"eps":5.58,"epc":20.70,"eph":4.750,"sep":9.500}
$GPGSV,3,1,10,21,78,040,46,31,39,230,44,06,36,062,43,25,36,245,43*7F
$GPGSV,3,2,10,30,26,132,38,16,40,321,42,18,31,140,38,03,10,284,34*7E
$GPGSV,3,3,10,07,43,056,43,22,13,173,35*7D
|