summaryrefslogtreecommitdiff
path: root/driver_italk.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-09-30 22:03:11 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-09-30 22:03:11 +0000
commit97b9548cff261e13a5b592d31add94631ff4dbc9 (patch)
treef46a1c984d841d3d2d8d83836d01db57d3e8ccf9 /driver_italk.c
parentb9f18fea09961f5e7476130a67e4e89379e12571 (diff)
downloadgpsd-97b9548cff261e13a5b592d31add94631ff4dbc9.tar.gz
Fix computation of epx and epy from eph.
Factor of 1/sqrt(2) has to be applied (on the assumption that epx and epy are equal).
Diffstat (limited to 'driver_italk.c')
-rw-r--r--driver_italk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/driver_italk.c b/driver_italk.c
index 0bf4f574..47630e79 100644
--- a/driver_italk.c
+++ b/driver_italk.c
@@ -32,7 +32,7 @@ static gps_mask_t decode_itk_navfix(struct gps_device_t *session, unsigned char
unsigned int tow;
unsigned short gps_week, flags, cflags, pflags;
gps_mask_t mask = 0;
- double epx, epy, epz, evx, evy, evz;
+ double epx, epy, epz, evx, evy, evz, eph;
double t;
if (len != 296){
@@ -69,7 +69,9 @@ static gps_mask_t decode_itk_navfix(struct gps_device_t *session, unsigned char
evz = (double)(getlesl(buf, 7 + 194)/1000.0);
ecef_to_wgs84fix(&session->gpsdata, epx, epy, epz, evx, evy, evz);
mask |= LATLON_SET | ALTITUDE_SET | SPEED_SET | TRACK_SET | CLIMB_SET ;
- session->gpsdata.fix.epx = session->gpsdata.fix.epy = (double)(getlesl(buf, 7 + 252)/100.0);
+ eph = (double)(getlesl(buf, 7 + 252)/100.0);
+ /* eph is a circular error, sqrt(epx**2 + epy**2) */
+ session->gpsdata.fix.epx = session->gpsdata.fix.epy = eph/sqrt(2);
session->gpsdata.fix.eps = (double)(getlesl(buf, 7 + 254)/100.0);
#define MAX(a,b) (((a) > (b)) ? (a) : (b))