|
From: <rus...@us...> - 2008-06-04 01:32:01
|
Revision: 152
http://gearbox.svn.sourceforge.net/gearbox/?rev=152&view=rev
Author: russo2503v
Date: 2008-06-03 18:32:03 -0700 (Tue, 03 Jun 2008)
Log Message:
-----------
tested with no fix
Modified Paths:
--------------
gearbox/trunk/submitted/gbxgarminacfr/doc.dox
gearbox/trunk/submitted/gbxgarminacfr/driver.cpp
gearbox/trunk/submitted/gbxgarminacfr/driver.h
Modified: gearbox/trunk/submitted/gbxgarminacfr/doc.dox
===================================================================
--- gearbox/trunk/submitted/gbxgarminacfr/doc.dox 2008-06-04 00:20:19 UTC (rev 151)
+++ gearbox/trunk/submitted/gbxgarminacfr/doc.dox 2008-06-04 01:32:03 UTC (rev 152)
@@ -37,25 +37,15 @@
Duncan Mercer, Alex Brooks, Alexei Makarenko, Tobias Kaupp
@par Responsible Developer
- Alex Brooks
+ Alex Makarenko
@par License
LGPL
@par Dependencies
-- libIceUtil (for timing), v.3.2 or newer (latest tested 3.3).
- @ref gbx_library_gbxserialacfr
-@par Installation
-
-- Finding libIceUtil
- - IceUtil will be found automatically if installed in one of several standard locations.
- - You can specify it's installation point with @c ICEUTIL_HOME CMake variable (or an environment variable with the same name). For example:
-@verbatim
-$ cmake -DICEUTIL_HOME=/home/myuser/install .
-@endverbatim
-
@section gbx_library_gbxgarminacfr What is EPE?
Bits of information assembled by Duncan Mercer.
Modified: gearbox/trunk/submitted/gbxgarminacfr/driver.cpp
===================================================================
--- gearbox/trunk/submitted/gbxgarminacfr/driver.cpp 2008-06-04 00:20:19 UTC (rev 151)
+++ gearbox/trunk/submitted/gbxgarminacfr/driver.cpp 2008-06-04 01:32:03 UTC (rev 152)
@@ -38,12 +38,22 @@
enum GgaTokens{MsgType=0,UTC,Lat,LatDir,Lon,LonDir,FixType,
NSatsUsed,HDOP,Hgt,M1,GeoidHgt,M2,DiffAge,DiffId};
+ //UTC time
+ sscanf(msg.getDataToken(UTC).c_str(),"%02d%02d%lf",
+ &data->utcTimeHrs, &data->utcTimeMin, &data->utcTimeSec );
+
// fix type
switch ( msg.getDataToken(FixType)[0] )
{
case '0':
data->fixType = Invalid;
// NOTE: not processing the rest!
+ data->latitude = 0.0;
+ data->longitude = 0.0;
+ data->altitude = 0.0;
+ data->satellites = 0;
+ data->geoidalSeparation = 0.0;
+cout<<"DEBUG: invalid fix, lat="<<data->latitude<<endl;
return data;
case '1':
data->fixType = Autonomous;
@@ -53,9 +63,6 @@
break;
}
- //UTC time
- sscanf(msg.getDataToken(UTC).c_str(),"%02d%02d%lf",
- &data->utcTimeHrs, &data->utcTimeMin, &data->utcTimeSec );
//position
int deg;
double min;
@@ -346,36 +353,39 @@
string MsgType = nmeaMessage.getDataToken(0);
if ( MsgType == "$GPGGA" ) {
- tracer_.debug("got GGA message",4);
- if ( !config_.readGga )
- continue;
+ if ( config_.readGga )
+ tracer_.debug("got GPGGA message",4);
+ else
+ throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO, "got unexpected GPGGA message" );
genericData.reset( extractGgaData( nmeaMessage, now.tv_sec, now.tv_usec ) );
break;
}
else if ( MsgType == "$GPVTG" ) {
- tracer_.debug("got VTG message",4);
- if ( !config_.readVtg )
- continue;
+ if ( config_.readVtg )
+ tracer_.debug("got GPVTG message",4);
+ else
+ throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO, "got unexpected GPVTG message" );
genericData.reset( extractVtgData( nmeaMessage, now.tv_sec, now.tv_usec ) );
break;
}
else if ( MsgType == "$PGRME" ) {
- tracer_.debug("got RME message",4);
- if ( !config_.readRme )
- continue;
+ if ( config_.readRme )
+ tracer_.debug("got PGRME message",4);
+ else
+ throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO, "got unexpected PGRME message" );
genericData.reset( extractRmeData( nmeaMessage, now.tv_sec, now.tv_usec ) );
break;
}
else if ( MsgType == "$PGRMO" ) {
//This message is sent by us to control msg transmission and then echoed by GPS
- //So we can just ignore it
+ //So we can just ignore it and wait for the next one.
continue;
}
else {
// if we get here the msg is unknown
stringstream ErrMsg;
ErrMsg << "Message type unknown " << MsgType <<endl;
- throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO,ErrMsg.str());
+ throw gbxsickacfr::gbxutilacfr::Exception( ERROR_INFO, ErrMsg.str() );
}
}
Modified: gearbox/trunk/submitted/gbxgarminacfr/driver.h
===================================================================
--- gearbox/trunk/submitted/gbxgarminacfr/driver.h 2008-06-04 00:20:19 UTC (rev 151)
+++ gearbox/trunk/submitted/gbxgarminacfr/driver.h 2008-06-04 01:32:03 UTC (rev 152)
@@ -38,11 +38,11 @@
//! Serial device. e.g. "/dev/ttyS0"
std::string device;
- //! Read PGGGA sentence
+ //! Read GPGGA sentence
bool readGga;
- //! Read PGVTG sentence
+ //! Read GPVTG sentence
bool readVtg;
- //! Read GPRME sentence
+ //! Read PGRME sentence
bool readRme;
};
@@ -80,7 +80,8 @@
Differential
};
-//! Fix data structure
+//! Fix data structure. Note that when fixType is Invalid, all other data except the time stamps
+//! are meaningless.
struct GgaData : public GenericData
{
public:
@@ -110,7 +111,8 @@
//! Altitude [metres above ellipsoid]
double altitude;
- //! Fix type.
+ //! Fix type. When fixType is Invalid, all other data except the time stamps
+ //! are meaningless.
FixType fixType;
//! Number of satellites
@@ -168,9 +170,8 @@
};
/*!
+Garmin GPS driver.
-Garmin GPS driver
-
All Garmin receivers understand the latest NMEA standard which is called: 0183 version 2.0.
This standard dictates a transfer rate of 4800 baud.
@@ -182,6 +183,9 @@
Processing of individual messages can be disabled in the Config structure.
+Note that when fixType contained in the GPGGA is Invalid, all other data in all messages
+except the time stamps are meaningless.
+
Referennces:
- http://en.wikipedia.org/wiki/NMEA
- http://www.gpsinformation.org/dale/interface.htm
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|