Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

GPS Class Reference

Short Description. More...

#include <GPS.h>

List of all members.

Public Types

enum  {
  Static = 1, Quasi_Static = 2, Walking = 3, Ship = 4,
  Automobile = 5, Aircraft = 6
}

Public Member Functions

 GPS (const char *serial, int noWait=1)
 Short Description.
 GPS (void)
 Short Description.
int init (float period=5.0, int dynamicMode=Quasi_Static)
 Short Description.
int Read (void)
 Short Description.
int hasPositions (void)
double xPos (void)
double yPos (void)
double zPos (void)
int hasVelocities (void)
double xVel (void)
double yVel (void)
double zVel (void)
double pDOP (void)
double hDOP (void)
double vDOP (void)
double tDOP (void)
int getNumSat (void)
double getLatitude (void)
double getLongitude (void)
const char * getMsg (void)
int getFD (void)
int dispatchMsg (const char *msg)
 Short Description.
int parsePOS (const char *msg)
 Short Description.
int parseUTM (const char *msg)
 Short Description.
void printData (void)
 Short Description.
 ~GPS ()
 Short Description.

Protected Member Functions

int readLine (void)
 Short Description.
int writeLine (const char *msg)
 Short Description.
int checkAck (void)
 Short Description.
float cos (float f)
double cos (double f)
float sin (float f)
double sin (double f)

Protected Attributes

char msgbuf [200]
int msglen
int gps_fd
int reading
int using_file
int numsat
char NorS
char EorW
double latitude
double longitude
double altitude
double x
double y
double z
double hVelocity
double vVelocity
double direction
double xvel
double yvel
double zvel
double pdop
double hdop
double vdop
double tdop
int is_corrected
int has_positions
int has_velocities
int nowait

Static Protected Attributes

static const double minutes2radians = (M_PI / 180.0 / 60.0)
static const double degrees2radians = (M_PI / 180.0f)
static const double knots2mps = 0.5144444
static double invalid
static const double earthRadius = 6378137.0f
static const double zeroLatitude = 0.700076f
static const double zeroLongitude = 1.53984f

Private Member Functions

void initVars (void)
 Short Description.


Detailed Description

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 16 of file GPS.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
Static 
Quasi_Static 
Walking 
Ship 
Automobile 
Aircraft 

Definition at line 18 of file GPS.h.


Constructor & Destructor Documentation

GPS::GPS const char *  serial_dev,
int  nowait = 1
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 47 of file GPS.cpp.

References gps_fd, and initVars().

GPS::GPS void   ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 33 of file GPS.cpp.

References initVars().

GPS::~GPS void   ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 234 of file GPS.cpp.

References gps_fd.


Member Function Documentation

int GPS::checkAck void   )  [protected]
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 352 of file GPS.cpp.

References msgbuf, and readLine().

Referenced by init().

double GPS::cos double  f  )  [inline, protected]
 

Definition at line 134 of file GPS.h.

float GPS::cos float  f  )  [inline, protected]
 

Definition at line 133 of file GPS.h.

Referenced by parsePOS(), and parseUTM().

int GPS::dispatchMsg const char *  msg  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 456 of file GPS.cpp.

References msgbuf, parsePOS(), and parseUTM().

Referenced by main(), and Read().

int GPS::getFD void   )  [inline]
 

Definition at line 79 of file GPS.h.

References gps_fd.

Referenced by Daemon::run().

double GPS::getLatitude void   )  [inline]
 

Definition at line 73 of file GPS.h.

References latitude.

Referenced by main().

double GPS::getLongitude void   )  [inline]
 

Definition at line 74 of file GPS.h.

References longitude.

Referenced by main().

const char* GPS::getMsg void   )  [inline]
 

Definition at line 78 of file GPS.h.

References msgbuf.

Referenced by main().

int GPS::getNumSat void   )  [inline]
 

Definition at line 71 of file GPS.h.

References numsat.

Referenced by main(), and recvData().

int GPS::hasPositions void   )  [inline]
 

Definition at line 53 of file GPS.h.

References has_positions.

Referenced by main(), and Daemon::processGPS().

int GPS::hasVelocities void   )  [inline]
 

Definition at line 60 of file GPS.h.

References has_velocities.

Referenced by main().

double GPS::hDOP void   )  [inline]
 

Definition at line 66 of file GPS.h.

References hdop.

Referenced by main().

int GPS::init float  period = 5.0,
int  dynamicMode = Quasi_Static
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 109 of file GPS.cpp.

References checkAck(), gps_fd, msgbuf, and writeLine().

Referenced by Daemon::Daemon(), and main().

void GPS::initVars void   )  [private]
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 206 of file GPS.cpp.

References altitude, direction, gps_fd, has_positions, has_velocities, hdop, hVelocity, invalid, latitude, longitude, msgbuf, msglen, pdop, tdop, using_file, vdop, vVelocity, x, xvel, y, yvel, z, and zvel.

Referenced by GPS().

int GPS::parsePOS const char *  msg  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 507 of file GPS.cpp.

References altitude, cos(), degrees2radians, direction, earthRadius, EorW, has_positions, has_velocities, hdop, hVelocity, i, invalid, is_corrected, knots2mps, latitude, longitude, minutes2radians, NorS, numsat, pdop, sin(), tdop, vdop, vVelocity, x, xvel, y, yvel, z, zeroLatitude, and zeroLongitude.

Referenced by dispatchMsg().

int GPS::parseUTM const char *  msg  ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 671 of file GPS.cpp.

References altitude, cos(), degrees2radians, direction, earthRadius, EorW, has_positions, has_velocities, hdop, hVelocity, i, invalid, is_corrected, knots2mps, latitude, longitude, minutes2radians, NorS, numsat, pdop, tdop, vdop, vVelocity, x, y, z, zeroLatitude, and zeroLongitude.

Referenced by dispatchMsg().

double GPS::pDOP void   )  [inline]
 

Definition at line 65 of file GPS.h.

References pdop.

Referenced by main().

void GPS::printData void   ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 827 of file GPS.cpp.

References direction, EorW, has_positions, has_velocities, hdop, hVelocity, latitude, longitude, NorS, numsat, pdop, tdop, vdop, vVelocity, x, xvel, y, yvel, z, and zvel.

Referenced by recvData().

int GPS::Read void   ) 
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 393 of file GPS.cpp.

References dispatchMsg(), gps_fd, msgbuf, and msglen.

Referenced by main(), Daemon::processGPS(), and recvData().

int GPS::readLine void   )  [protected]
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 258 of file GPS.cpp.

References gps_fd, i, msgbuf, and msglen.

Referenced by checkAck().

double GPS::sin double  f  )  [inline, protected]
 

Definition at line 136 of file GPS.h.

float GPS::sin float  f  )  [inline, protected]
 

Definition at line 135 of file GPS.h.

Referenced by parsePOS().

double GPS::tDOP void   )  [inline]
 

Definition at line 68 of file GPS.h.

References tdop.

Referenced by main().

double GPS::vDOP void   )  [inline]
 

Definition at line 67 of file GPS.h.

References vdop.

Referenced by main().

int GPS::writeLine const char *  msg  )  [protected]
 

Short Description.

Long Description if necessary.

Parameters:
<parameter_name> <parameter_descreption>
Returns:
<information on="" what="" is="" being="" returned>="">
Author:
<author name>="">

Definition at line 312 of file GPS.cpp.

References gps_fd, and len.

Referenced by init().

double GPS::xPos void   )  [inline]
 

Definition at line 54 of file GPS.h.

References x.

Referenced by main(), and Daemon::processGPS().

double GPS::xVel void   )  [inline]
 

Definition at line 61 of file GPS.h.

References xvel.

Referenced by main().

double GPS::yPos void   )  [inline]
 

Definition at line 55 of file GPS.h.

References y.

Referenced by main(), and Daemon::processGPS().

double GPS::yVel void   )  [inline]
 

Definition at line 62 of file GPS.h.

References yvel.

Referenced by main().

double GPS::zPos void   )  [inline]
 

Definition at line 56 of file GPS.h.

References z.

double GPS::zVel void   )  [inline]
 

Definition at line 63 of file GPS.h.

References zvel.


Member Data Documentation

double GPS::altitude [protected]
 

Definition at line 108 of file GPS.h.

Referenced by initVars(), parsePOS(), and parseUTM().

const double GPS::degrees2radians = (M_PI / 180.0f) [static, protected]
 

Definition at line 120 of file GPS.h.

Referenced by parsePOS(), and parseUTM().

double GPS::direction [protected]
 

Definition at line 110 of file GPS.h.

Referenced by initVars(), parsePOS(), parseUTM(), and printData().

const double GPS::earthRadius = 6378137.0f [static, protected]
 

Definition at line 123 of file GPS.h.

Referenced by parsePOS(), and parseUTM().

char GPS::EorW [protected]
 

Definition at line 107 of file GPS.h.

Referenced by parsePOS(), parseUTM(), and printData().

int GPS::gps_fd [protected]
 

Definition at line 101 of file GPS.h.

Referenced by getFD(), GPS(), init(), initVars(), Read(), readLine(), writeLine(), and ~GPS().

int GPS::has_positions [protected]
 

Definition at line 116 of file GPS.h.

Referenced by hasPositions(), initVars(), parsePOS(), parseUTM(), and printData().

int GPS::has_velocities [protected]
 

Definition at line 116 of file GPS.h.

Referenced by hasVelocities(), initVars(), parsePOS(), parseUTM(), and printData().

double GPS::hdop [protected]
 

Definition at line 112 of file GPS.h.

Referenced by hDOP(), initVars(), parsePOS(), parseUTM(), and printData().

double GPS::hVelocity [protected]
 

Definition at line 110 of file GPS.h.

Referenced by initVars(), parsePOS(), parseUTM(), and printData().

double GPS::invalid [static, protected]
 

Definition at line 122 of file GPS.h.

Referenced by initVars(), parsePOS(), and parseUTM().

int GPS::is_corrected [protected]
 

Definition at line 115 of file GPS.h.

Referenced by parsePOS(), and parseUTM().

const double GPS::knots2mps = 0.5144444 [static, protected]
 

Definition at line 121 of file GPS.h.

Referenced by parsePOS(), and parseUTM().

double GPS::latitude [protected]
 

Definition at line 108 of file GPS.h.

Referenced by getLatitude(), initVars(), parsePOS(), parseUTM(), and printData().

double GPS::longitude [protected]
 

Definition at line 108 of file GPS.h.

Referenced by getLongitude(), initVars(), parsePOS(), parseUTM(), and printData().

const double GPS::minutes2radians = (M_PI / 180.0 / 60.0) [static, protected]
 

Definition at line 119 of file GPS.h.

Referenced by parsePOS(), and parseUTM().

char GPS::msgbuf[200] [protected]
 

Definition at line 99 of file GPS.h.

Referenced by checkAck(), dispatchMsg(), getMsg(), init(), initVars(), Read(), and readLine().

int GPS::msglen [protected]
 

Definition at line 100 of file GPS.h.

Referenced by initVars(), Read(), and readLine().

char GPS::NorS [protected]
 

Definition at line 107 of file GPS.h.

Referenced by parsePOS(), parseUTM(), and printData().

int GPS::nowait [protected]
 

Definition at line 117 of file GPS.h.

int GPS::numsat [protected]
 

Definition at line 106 of file GPS.h.

Referenced by getNumSat(), parsePOS(), parseUTM(), and printData().

double GPS::pdop [protected]
 

Definition at line 112 of file GPS.h.

Referenced by initVars(), parsePOS(), parseUTM(), pDOP(), and printData().

int GPS::reading [protected]
 

Definition at line 102 of file GPS.h.

double GPS::tdop [protected]
 

Definition at line 112 of file GPS.h.

Referenced by initVars(), parsePOS(), parseUTM(), printData(), and tDOP().

int GPS::using_file [protected]
 

Definition at line 103 of file GPS.h.

Referenced by initVars().

double GPS::vdop [protected]
 

Definition at line 112 of file GPS.h.

Referenced by initVars(), parsePOS(), parseUTM(), printData(), and vDOP().

double GPS::vVelocity [protected]
 

Definition at line 110 of file GPS.h.

Referenced by initVars(), parsePOS(), parseUTM(), and printData().

double GPS::x [protected]
 

Definition at line 109 of file GPS.h.

Referenced by initVars(), parsePOS(), parseUTM(), printData(), and xPos().

double GPS::xvel [protected]
 

Definition at line 111 of file GPS.h.

Referenced by initVars(), parsePOS(), printData(), and xVel().

double GPS::y [protected]
 

Definition at line 109 of file GPS.h.

Referenced by initVars(), parsePOS(), parseUTM(), printData(), and yPos().

double GPS::yvel [protected]
 

Definition at line 111 of file GPS.h.

Referenced by initVars(), parsePOS(), printData(), and yVel().

double GPS::z [protected]
 

Definition at line 109 of file GPS.h.

Referenced by initVars(), parsePOS(), parseUTM(), printData(), and zPos().

const double GPS::zeroLatitude = 0.700076f [static, protected]
 

Definition at line 125 of file GPS.h.

Referenced by parsePOS(), and parseUTM().

const double GPS::zeroLongitude = 1.53984f [static, protected]
 

Definition at line 126 of file GPS.h.

Referenced by parsePOS(), and parseUTM().

double GPS::zvel [protected]
 

Definition at line 111 of file GPS.h.

Referenced by initVars(), printData(), and zVel().


The documentation for this class was generated from the following files:
Generated on Fri Sep 1 14:26:00 2006 for Raptor by  doxygen 1.4.4