[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gpsd-commit-watch
Subject:    [Gpsd-commit-watch] r1838 - in trunk: . www
From:       esr () sheep ! berlios ! de (Eric S !  Raymond at BerliOS)
Date:       2005-02-26 15:01:28
Message-ID: 200502261501.j1QF1SHG012702 () sheep ! berlios ! de
[Download RAW message or body]

Author: esr
Date: 2005-02-26 16:01:26 +0100 (Sat, 26 Feb 2005)
New Revision: 1838

Modified:
   trunk/garmin.c
   trunk/gps.h
   trunk/gps.py
   trunk/gpsd.c
   trunk/gpsd.spec.in
   trunk/gpsd.xml
   trunk/libgps.c
   trunk/nmea_parse.c
   trunk/www/NMEA.txt
Log:
Support for Garmin PGMRE sentence.  Next step is to compute this from 
SirF-II tracking information.


Modified: trunk/garmin.c
===================================================================
--- trunk/garmin.c	2005-02-26 07:45:37 UTC (rev 1837)
+++ trunk/garmin.c	2005-02-26 15:01:26 UTC (rev 1838)
@@ -283,6 +283,12 @@
 	    session->separation = pvt->msl_hght;
 	    REFRESH(session->gNMEAdata.altitude_stamp);
 
+	    // esrtimated position error in meters (two sigmas)
+	    session->gNMEAdata.epe = pvt->epe;
+	    session->gNMEAdata.eph = pvt->eph;
+	    session->gNMEAdata.epv = pvt->epv;
+	    REFRESH(session->gNMEAdata.fix_quality_stamp);
+
 	    // convert lat/lon in meters/sec to speed in knots
 	    session->gNMEAdata.speed
 		= hypot(pvt->lon_vel, pvt->lat_vel) * 1.9438445;

Modified: trunk/gps.h
===================================================================
--- trunk/gps.h	2005-02-26 07:45:37 UTC (rev 1837)
+++ trunk/gps.h	2005-02-26 15:01:26 UTC (rev 1838)
@@ -85,6 +85,12 @@
     double pdop, hdop, vdop;	/* Dilution of precision */
     struct life_t fix_quality_stamp;
 
+    /* precision of fix in real units */
+    double epe;  /* estimated position error, 2 sigma (meters)  */
+    double eph;  /* epe, but horizontal only (meters) */
+    double epv;  /* epe but vertical only (meters) */
+    struct life_t epe_quality_stamp;
+
     /* satellite status */
     int satellites;	/* # of satellites in view */
     int PRN[MAXCHANNELS];	/* PRNs of satellite */
@@ -124,6 +130,7 @@
 #define GPVTG	0x08
 #define GPGSA	0x10
 #define GPGSV	0x20
+#define PGRME	0x40
 };
 
 struct map_t {

Modified: trunk/gps.py
===================================================================
--- trunk/gps.py	2005-02-26 07:45:37 UTC (rev 1837)
+++ trunk/gps.py	2005-02-26 15:01:26 UTC (rev 1838)
@@ -68,6 +68,9 @@
 	self.pdop = self.hdop = self.vdop = 0.0
 	self.fix_quality_stamp = gps.timestamp(0)
 
+	self.epe = self.eph = self.epv = 0.0
+	self.epe_quality_stamp = gps.timestamp(0)
+
 	self.satellites = []			# satellite objects in view
 	self.satellite_stamp = gps.timestamp(0)
         self.await = self.parts = 0
@@ -214,6 +217,14 @@
 	      self.cycle = int(data)
 	    elif cmd in ('D', 'd'):
 	      self.utc = data
+	    elif cmd in ('E', 'e'):
+	      parts = data.split()
+	      (f1, f2, f3) = map(float, parts)
+	      self.epe_quality_stamp.changed = (self.epe != f1 or self.eph != f2 or self.epv != f3)
+	      self.epe = f1
+	      self.eph = f2
+	      self.epv = f3
+	      self.epe_quality_stamp.refresh()
 	    elif cmd in ('I', 'i'):
 	      self.gps_id = data
 	    elif cmd in ('M', 'm'):

Modified: trunk/gpsd.c
===================================================================
--- trunk/gpsd.c	2005-02-26 07:45:37 UTC (rev 1837)
+++ trunk/gpsd.c	2005-02-26 15:01:26 UTC (rev 1838)
@@ -236,6 +236,12 @@
 	    } else
 		strcpy(phrase, ",D=?");
 	    break;
+	case 'E':
+	    if (!validate())
+		strcpy(phrase, ",E=?");
+	    else
+		sprintf(phrase, ",E=%f %f %f", ud->epe, ud->eph, ud->epv);
+	    break;
 	case 'I':
 	    sprintf(phrase, ",I=%s", session->device_type->typename);
 	    break;

Modified: trunk/gpsd.spec.in
===================================================================
--- trunk/gpsd.spec.in	2005-02-26 07:45:37 UTC (rev 1837)
+++ trunk/gpsd.spec.in	2005-02-26 15:01:26 UTC (rev 1838)
@@ -127,7 +127,11 @@
 * Fri Feb 25 2005 Eric S. Raymond <esr@snark.thyrsus.com> - @VERSION@-1
 - A new packet engine autobauds much more quickly, and now iterates
   over both 1 and 2 stopbits.  The daemon now recognizes GPSes in SiRF
-  binary mode and switches them to NMEA.
+  binary mode and switches them to NMEA.  Explicit support for FV18 
+  (the -T f option) is gone; instead, gpsd syncs with any 7N2 device
+  and always ships a suitable init string.  New E command, supporting the
+  Garmin position-error sentence -- next step is to compute this from 
+  SiRF-II data.
 
 * Fri Feb 25 2005 Eric S. Raymond <esr@snark.thyrsus.com> - 2.14-1
 - Pass zero magnetic variation in generated NMEA from binary GPSes

Modified: trunk/gpsd.xml
===================================================================
--- trunk/gpsd.xml	2005-02-26 07:45:37 UTC (rev 1837)
+++ trunk/gpsd.xml	2005-02-26 15:01:26 UTC (rev 1838)
@@ -208,6 +208,15 @@
 </varlistentry>
 
 <varlistentry>
+<term>e</term>
+<listitem>
+<para>Returns "E=%f %f %f": three estimated position errors in meters 
+&mdash; total, horizontal, and vertical.  Note: many GPSses do not
+supply these numbers.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
 <term>i</term>
 <listitem><para>Returns a text string identifying the GPS.  The string
 may contain spaces and is terminated by CR-LF.</para></listitem>
@@ -235,7 +244,7 @@
 <term>q</term>
 <listitem>
 <para>Returns "Q=%d %f %f %f": a count of satellites used in the last
-fix, and three estimated position errors in meters &mdash; position, 
+fix, and three dimensionless dilution-of-precision (DOP) &mdash; total, 
 horizontal, and vertical.</para>
 </listitem>
 </varlistentry>

Modified: trunk/libgps.c
===================================================================
--- trunk/libgps.c	2005-02-26 07:45:37 UTC (rev 1837)
+++ trunk/libgps.c	2005-02-26 15:01:26 UTC (rev 1838)
@@ -80,6 +80,13 @@
 	    case 'D':
 		strcpy(gpsdata->utc, sp+2);
 		break;
+	    case 'E':
+		sscanf(sp, "E=%lf %lf %lf", &d1, &d2, &d3);
+		gpsdata->fix_quality_stamp.changed = \
+		    (gpsdata->epe != d1) || (gpsdata->eph != d2) || (gpsdata->epv != d3);
+		gpsdata->epe = d1; gpsdata->eph = d2; gpsdata->epv = d3;
+		REFRESH(gpsdata->epe_quality_stamp);
+		break;
 	    case 'I':
 		if (gpsdata->gps_id)
 		    free(gpsdata->gps_id);

Modified: trunk/nmea_parse.c
===================================================================
--- trunk/nmea_parse.c	2005-02-26 07:45:37 UTC (rev 1837)
+++ trunk/nmea_parse.c	2005-02-26 15:01:26 UTC (rev 1838)
@@ -476,6 +476,27 @@
     }
 }
 
+static void processPGRME(int c UNUSED, char *field[], struct gps_data_t *out)
+/* Garmin Estimated Position Error */
+{
+    /*
+       $PGRME,15.0,M,45.0,M,25.0,M*22
+	1    = HDOP
+        2    = units
+	3    = VDOP
+        4    = units
+	5    = PDOP
+        6    = units
+     */
+    int changed = 0;
+    
+    changed |= update_field_f(field[1], &out->hdop);
+    changed |= update_field_f(field[3], &out->vdop);
+    changed |= update_field_f(field[5], &out->pdop);
+    out->epe_quality_stamp.changed = changed;
+    REFRESH(out->epe_quality_stamp);
+}
+
 static short nmea_checksum(char *sentence, unsigned char *correct_sum)
 /* is the checksum on the specified sentence good? */
 {
@@ -531,6 +552,7 @@
 	{"GPVTG", GPVTG,	processGPVTG},
 	{"GPGSA", GPGSA,	processGPGSA},
 	{"GPGSV", GPGSV,	processGPGSV},
+	{"PGRME", PGRME,	processPGRME},
 	{"PRWIZCH", 0,  	NULL},
     };
 

Modified: trunk/www/NMEA.txt
===================================================================
--- trunk/www/NMEA.txt	2005-02-26 07:45:37 UTC (rev 1837)
+++ trunk/www/NMEA.txt	2005-02-26 15:01:26 UTC (rev 1838)
@@ -1457,11 +1457,30 @@
 
 Vendor extensions (this list is very incomplete):
 
+Garmin Estimated Error
+
+        1  2  3  4  5  6  7
+        |  |  |  |  |  |  |
+$PGRME,hhh,M,vvv,M,ttt,M*hh<CR><LF>
+
+ Field Number: 
+   1) Estimated horizontal position error (HPE), 
+   2) M=meters
+   3) Estimated vertical position error (VPE)
+   4) M=meters
+   5) Overall spherical equivalent position error
+   6) M=meters
+   7) Checksum
+
+Example: $PGRME,15.0,M,45.0,M,25.0,M*22
+
 ------------------------------------------------------------------------------
 
+Magellan Status
+
           1   2 3  4    5    6  7    8
           |   | |  |    |    |  |    |
-$PMGNST,xx.xx,m,t,nnn,xx.xx,nnn,nn,c*hh<CR><LF>
+$PMGNST,xx.xx,m,t,nnn,xx.xx,nnn,nn,c
 
  Field Number: 
   1) Firmware version number?


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic