summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-03-15 11:50:36 -0700
committerGary E. Miller <gem@rellim.com>2019-03-15 11:50:36 -0700
commitaf1104274a405f97095caa0897b236d6c913f171 (patch)
tree4b7c8214f4a2cc58ea2b1baaca8e510106e1ee77
parent31c60376876a5a2317a4a1db9dcc03a93d234134 (diff)
downloadgpsd-af1104274a405f97095caa0897b236d6c913f171.tar.gz
Move epe from gps_data_t to be near its friends in gps_fix_t.
No functional changes. Looks like epe never went anywhere...
-rw-r--r--NEWS1
-rw-r--r--driver_garmin.c4
-rw-r--r--driver_navcom.c4
-rw-r--r--driver_nmea0183.c10
-rw-r--r--gps.h5
-rw-r--r--gpsutils.c4
-rw-r--r--libgpsd_core.c6
7 files changed, 17 insertions, 17 deletions
diff --git a/NEWS b/NEWS
index 0d9877c1..927eb265 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@
Improve error modeling.
Update pseudo NMEA to v3.0, with fractional time.
Improve cycle detection, mostly for NMEA.
+ Move epe from gps_data_t to be near its friends in gps_fix_t.
3.18.1: 2018-10-19 (Gary E. Miller <gem@rellim.com>)
Fix some installation issues.
diff --git a/driver_garmin.c b/driver_garmin.c
index 48073fd8..418ff574 100644
--- a/driver_garmin.c
+++ b/driver_garmin.c
@@ -180,7 +180,7 @@ typedef struct __attribute__((__packed__))
typedef struct __attribute__((__packed__))
{
float alt; /* altitude above WGS 84 (meters) */
- float epe; /* estimated position error, 2 sigma (meters) */
+ float epe; /* estimated position error, 2 sigma (meters) */
float eph; /* epe, but horizontal only (meters) */
float epv; /* epe but vertical only (meters ) */
int16_t fix; /* 0 - failed integrity check
@@ -419,7 +419,7 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
// We follow the advice at <http://gpsinformation.net/main/errors.htm>.
// If this assumption changes here, it should also change in
// nmea_parse.c where we analyze PGRME.
- session->gpsdata.epe = pvt->epe * (GPSD_CONFIDENCE / CEP50_SIGMA);
+ session->newdata.epe = pvt->epe * (GPSD_CONFIDENCE / CEP50_SIGMA);
/* eph is a circular error, sqrt(epx**2 + epy**2) */
session->newdata.epx = session->newdata.epy =
pvt->eph * (1 / sqrt(2)) * (GPSD_CONFIDENCE / CEP50_SIGMA);
diff --git a/driver_navcom.c b/driver_navcom.c
index c0809019..8706acc8 100644
--- a/driver_navcom.c
+++ b/driver_navcom.c
@@ -898,7 +898,7 @@ static gps_mask_t handle_0xb5(struct gps_device_t *session)
double alt_sd = getled64(buf, 57);
double hrms = sqrt(pow(lat_sd, 2) + pow(lon_sd, 2));
#endif /* __UNUSED__ */
- session->gpsdata.epe = rms * 1.96;
+ session->newdata.epe = rms * 1.96;
mask |= PERR_IS;
#ifdef __UNUSED__
session->newdata.eph = hrms * 1.96;
@@ -911,7 +911,7 @@ static gps_mask_t handle_0xb5(struct gps_device_t *session)
gpsd_log(&session->context->errout, LOG_PROG,
"Navcom: received packet type 0xb5 (Pseudorange Noise Statistics)\n");
gpsd_log(&session->context->errout, LOG_DATA,
- "Navcom: epe = %f\n", session->gpsdata.epe);
+ "Navcom: epe = %f\n", session->newdata.epe);
return mask;
} else {
/* Ignore this message block */
diff --git a/driver_nmea0183.c b/driver_nmea0183.c
index 73758139..62c12288 100644
--- a/driver_nmea0183.c
+++ b/driver_nmea0183.c
@@ -1350,11 +1350,9 @@ static gps_mask_t processPGRME(int c UNUSED, char *field[],
*/
gps_mask_t mask = ONLINE_SET;
- if ((strcmp(field[2], "M") != 0) ||
- (strcmp(field[4], "M") != 0) || (strcmp(field[6], "M") != 0)) {
- session->newdata.epx =
- session->newdata.epy =
- session->newdata.epv = session->gpsdata.epe = 100;
+ if ('M' != field[2][0] ||
+ 'M' != field[4][0] ||
+ 'M' != field[6][0]) {
mask = ONLINE_SET;
} else {
session->newdata.epx = session->newdata.epy =
@@ -1362,7 +1360,7 @@ static gps_mask_t processPGRME(int c UNUSED, char *field[],
* (GPSD_CONFIDENCE / CEP50_SIGMA);
session->newdata.epv =
safe_atof(field[3]) * (GPSD_CONFIDENCE / CEP50_SIGMA);
- session->gpsdata.epe =
+ session->newdata.epe =
safe_atof(field[5]) * (GPSD_CONFIDENCE / CEP50_SIGMA);
mask = HERR_SET | VERR_SET | PERR_IS;
}
diff --git a/gps.h b/gps.h
index 86eb5015..35404615 100644
--- a/gps.h
+++ b/gps.h
@@ -44,6 +44,7 @@ extern "C" {
* changed MAXCHANNELS
* 8.0 - Change shape of rawdata_t.
* Added values for gps_data_t->status
+ * Move epe from gps_data_t to be near its friends in gps_fix_t.
*/
#define GPSD_API_MAJOR_VERSION 8 /* bump on incompatible changes */
#define GPSD_API_MINOR_VERSION 0 /* bump on compatible changes */
@@ -105,6 +106,7 @@ struct gps_fix_t {
double eps; /* Speed uncertainty, meters/sec */
double climb; /* Vertical speed, meters/sec */
double epc; /* Vertical speed uncertainty */
+ double epe; /* spherical position error, 95% confidence (meters) */
double magnetic_track; /* Course (relative to Magnetic North) */
@@ -2136,9 +2138,6 @@ struct gps_data_t {
int satellites_used; /* Number of satellites used in solution */
struct dop_t dop;
- /* redundant with the estimate elements in the fix structure */
- double epe; /* spherical position error, 95% confidence (meters) */
-
/* satellite status -- valid when satellites_visible > 0 */
timestamp_t skyview_time; /* skyview timestamp */
int satellites_visible; /* # of satellites in view */
diff --git a/gpsutils.c b/gpsutils.c
index 77b060fa..3ae49e4d 100644
--- a/gpsutils.c
+++ b/gpsutils.c
@@ -262,6 +262,7 @@ void gps_clear_fix(struct gps_fix_t *fixp)
fixp->epd = NAN;
fixp->eps = NAN;
fixp->epc = NAN;
+ fixp->epe = NAN;
/* clear ECEF too */
fixp->ecef.x = NAN;
fixp->ecef.y = NAN;
@@ -338,6 +339,9 @@ void gps_merge_fix(struct gps_fix_t *to,
if (0 != isfinite(from->epd)) {
to->epd = from->epd;
}
+ if (0 != isfinite(from->epe)) {
+ to->epe = from->epe;
+ }
if ((transfer & VERR_SET) != 0)
to->epv = from->epv;
if ((transfer & SPEEDERR_SET) != 0)
diff --git a/libgpsd_core.c b/libgpsd_core.c
index ee52bec5..22e2fc77 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -340,7 +340,6 @@ void gpsd_init(struct gps_device_t *session, struct gps_context_t *context,
session->gpsdata.set = 0;
gps_clear_att(&session->gpsdata.attitude);
gps_clear_dop(&session->gpsdata.dop);
- session->gpsdata.epe = NAN;
session->mag_var = NAN;
session->gpsdata.dev.cycle = session->gpsdata.dev.mincycle = 1;
#ifdef TIMING_ENABLE
@@ -1025,9 +1024,9 @@ static void gpsd_error_model(struct gps_device_t *session)
fix->epv = session->gpsdata.dop.vdop * v_uere;
}
- if (0 == isfinite(session->gpsdata.epe) &&
+ if (0 == isfinite(fix->epe) &&
0 != isfinite(session->gpsdata.dop.pdop)) {
- session->gpsdata.epe = session->gpsdata.dop.pdop * p_uere;
+ fix->epe = session->gpsdata.dop.pdop * p_uere;
}
/*
@@ -1492,7 +1491,6 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
session->gpsdata.set |= fill_dop(&session->context->errout,
&session->gpsdata,
&session->gpsdata.dop);
- session->gpsdata.epe = NAN;
}
#endif /* NOFLOATS_ENABLE */