Aria  2.8.0
ArTrimbleGPS Class Reference

GPS subclass to support the Trimble AgGPS and other Trimble GPS devices. More...

#include <ArTrimbleGPS.h>

Inherits ArGPS.

Public Member Functions

bool sendTSIPCommand (char command, const char *data, size_t dataLen)
 Send a TSIP command to the Trimble GPS. More...
 
- Public Member Functions inherited from ArGPS
bool blockingConnect (unsigned long connectTimeout=20000)
 Same as connect(). More...
 
virtual bool connect (unsigned long connectTimeout=20000)
 Check that the device connection (e.g. More...
 
ArDeviceConnectiongetDeviceConnection () const
 Return device connection in use (or NULL if none)
 
void lock ()
 Locks a mutex object contained by this class. More...
 
void logData () const
 Log last received data using ArLog. More...
 
void printData (bool labels=true) const
 Print basic navigation data on one line to standard output, with no newline at end. More...
 
void printDataLabelsHeader () const
 
virtual int read (unsigned long maxTime=0)
 Read some data from the device connection, and update stored data as complete messages are received. More...
 
int readWithLock (unsigned int maxTime)
 Calls lock(), calls read(maxTime), then calls unlock(). More...
 
void setDeviceConnection (ArDeviceConnection *deviceConn)
 Set device connection to use.
 
void setIgnoreChecksum (bool ignore)
 Set whether checksum sent with NMEA messages is ignored.
 
void unlock ()
 Unlocks a mutex object contained by this class. More...
 
const ArGPS::Data & getCurrentDataRef () const
 Access all of the internally stored data directly. More...
 
FixType getFixType () const
 (from NMEA GPGGA)
 
const char * getFixTypeName () const
 (from NMEA GPGGA)
 
bool havePosition () const
 (from NMEA GPRMC)
 
bool haveLatitude () const
 (from NMEA GPRMC)
 
bool haveLongitude () const
 (from NMEA GPRMC)
 
double getLatitude () const
 
double getLongitude () const
 
ArTime getTimeReceivedPosition () const
 
bool haveSpeed () const
 (from NMEA GPRMC)
 
double getSpeed () const
 
ArTime getGPSPositionTimestamp () const
 Timestamp provided by GPS device along with position. More...
 
int getNumSatellitesTracked () const
 
bool haveDGPSStation () const
 (from NMEA GPGGA)
 
unsigned short getDGPSStationID () const
 (from NMEA GPGGA)
 
bool haveGarminPositionError () const
 
double getGarminPositionError () const
 GPS device's error estimation in meters (from a Garmin-specific message PGRME, most GPS receivers will not provide this)
 
bool haveGarminVerticalPositionError () const
 
double getGarminVerticalPositionError () const
 
bool haveCompassHeadingMag () const
 Have a compass heading value relative to magnetic north. More...
 
bool haveCompassHeadingTrue () const
 Have a compass heading value relative to true north (using GPS/compass device's configured declination). More...
 
double getCompassHeadingMag () const
 Heading from magnetic north. More...
 
double getCompassHeadingTrue () const
 Heading from true north. More...
 
void setCompassHeadingMag (double val)
 Manually set compass value. More...
 
void setCompassHeadingTrue (double val)
 Manually set compass value. More...
 
void setCompassHeadingMagWithLock (double val)
 Manually set compass value. More...
 
void setCompassHeadingTrueWithLock (double val)
 Manually set compass value. More...
 
bool haveAltitude () const
 Altitude above sea level calculated from satellite positions (see also haveAltimiter()) (from NMEA GPGGA, if provided)
 
double getAltitude () const
 Altitude above sea level (meters), calculated from satellite positions (see also getAltimiter()) (from NMEA GPGGA, if provided)
 
bool haveAltimeter () const
 Some receivers may have an additional altitude from an altimiter (meters above sea level) (from PGRMZ, if receiver provides it)
 
double getAltimeter () const
 Some receivers may have an additional altitude from an altimiter (meters above sea level) (from PGRMZ, if receiver provides it)
 
bool haveHDOP () const
 (from NMEA GPGGA)
 
double getHDOP () const
 (from NMEA GPGGA)
 
bool haveVDOP () const
 (from NMEA GPGGA)
 
double getVDOP () const
 (from NMEA GPGGA)
 
bool havePDOP () const
 (from NMEA GPGGA)
 
double getPDOP () const
 (from NMEA GPGGA)
 
bool haveSNR () const
 (from NMEA GPGSV)
 
double getMeanSNR () const
 dB (from NMEA GPGSV)
 
bool haveBeaconInfo () const
 Whether we have any DGPS stationary beacon info (from NMEA GPMSS)
 
double getBeaconSignalStrength () const
 DGPS stationary beacon signal strength (dB) (from NMEA GPMSS)
 
double getBeaconSNR () const
 DGPS stationary beacon signal to noise (dB) (from NMEA GPMSS)
 
double getBeaconFreq () const
 DGPS stationary beacon frequency (kHz) (from NMEA GPMSS)
 
unsigned short getBecaonBPS () const
 DGPS stationary beacon bitrate (bits per second) (from NMEA GPMSS)
 
unsigned short getBeaconChannel () const
 DGPS stationary beacon channel (from NMEA GPMSS)
 
bool haveErrorEllipse () const
 Whether we have a position error estimate (as standard deviations in latitude and longitude) (from NMEA GPGST)
 
ArPose getErrorEllipse () const
 Standard deviation of position error (latitude and longitude), meters. More...
 
bool haveLatLonError () const
 Whether we have latitude or longitude error estimates (from NMEA GPGST)
 
ArPose getLatLonError () const
 Standard deviation of latitude and longitude error, meters. More...
 
double getLatitudeError () const
 Standard deviation of latitude and longitude error, meters. More...
 
double getLongitudeError () const
 Standard deviation of latitude and longitude error, meters. More...
 
bool haveAltitudeError () const
 
double getAltitudeError () const
 Standard deviation of altitude error, meters. (from NMEA GPGST, if provided)
 
bool haveInputsRMS () const
 (from NMEA GPGST)
 
double getInputsRMS () const
 (from NMEA GPGST)
 
void addNMEAHandler (const char *message, ArNMEAParser::Handler *handler)
 Set a handler for an NMEA message. More...
 
void removeNMEAHandler (const char *message)
 
void replaceNMEAHandler (const char *message, ArNMEAParser::Handler *handler)
 

Protected Member Functions

virtual bool initDevice ()
 
- Protected Member Functions inherited from ArGPS
bool waitForData (unsigned long timeout)
 Block until data is read from GPS. More...
 
bool readFloatFromString (const std::string &str, double *target, double(*convf)(double)=NULL) const
 
bool readUShortFromString (const std::string &str, unsigned short *target, unsigned short(*convf)(unsigned short)=NULL) const
 
bool readFloatFromStringVec (const std::vector< std::string > *vec, size_t i, double *target, double(*convf)(double)=NULL) const
 
bool readUShortFromStringVec (const std::vector< std::string > *vec, size_t i, unsigned short *target, unsigned short(*convf)(unsigned short)=NULL) const
 
void handleGPRMC (ArNMEAParser::Message msg)
 
void handleGPGGA (ArNMEAParser::Message msg)
 
void handlePGRME (ArNMEAParser::Message msg)
 
void handlePGRMZ (ArNMEAParser::Message msg)
 
void handleHCHDx (ArNMEAParser::Message msg)
 
void handleGPGSA (ArNMEAParser::Message msg)
 
void handleGPGSV (ArNMEAParser::Message msg)
 
void handleGPMSS (ArNMEAParser::Message msg)
 
void handleGPGST (ArNMEAParser::Message msg)
 
bool readTimeFromString (const std::string &s, ArTime *time) const
 
void parseGPRMC (const ArNMEAParser::Message &msg, double &latitudeResult, double &longitudeResult, bool &qualityFlagResult, bool &gotPosition, ArTime &timeGotPositionResult, ArTime &gpsTimestampResult, bool &gotSpeedResult, double &speedResult)
 Parse a GPRMC message (in msg) and place results in provided variables. More...
 

Additional Inherited Members

- Public Types inherited from ArGPS
enum  { ReadFinished = ArNMEAParser::ParseFinished, ReadError = ArNMEAParser::ParseError, ReadData = ArNMEAParser::ParseData, ReadUpdated = ArNMEAParser::ParseUpdated }
 Flags to indicates what the read() method did. More...
 
enum  FixType {
  NoFix, BadFix, GPSFix, DGPSFix,
  PPSFix, RTKinFix, FloatRTKinFix, DeadReckFix,
  ManualFix, SimulatedFix, UnknownFixType, OmnistarConverging = FloatRTKinFix,
  OmnistarConverged = RTKinFix
}
 Data accessors. More...
 
- Static Public Member Functions inherited from ArGPS
static const char * getFixTypeName (FixType type)
 
- Public Attributes inherited from ArGPS
enum ArGPS:: { ... }  ReadFlags
 Flags to indicates what the read() method did. More...
 
- Static Protected Member Functions inherited from ArGPS
static double gpsDegminToDegrees (double degmin)
 
static double knotsToMPS (double knots)
 
static double mpsToMph (const double mps)
 Convert meters per second to miles per hour.
 
static double metersToFeet (double m)
 
static double feetToMeters (double f)
 
- Protected Attributes inherited from ArGPS
Data myData
 
ArMutex myMutex
 
ArDeviceConnectionmyDevice
 
bool myCreatedOwnDeviceCon
 
ArRetFunctorC< bool, ArGPSmyParseArgsCallback
 
ArArgumentParsermyArgParser
 
ArNMEAParser myNMEAParser
 
ArFunctor1C< ArGPS, ArNMEAParser::MessagemyGPRMCHandler
 
ArFunctor1C< ArGPS, ArNMEAParser::MessagemyGPGGAHandler
 
ArFunctor1C< ArGPS, ArNMEAParser::MessagemyPGRMEHandler
 
ArFunctor1C< ArGPS, ArNMEAParser::MessagemyPGRMZHandler
 
ArFunctor1C< ArGPS, ArNMEAParser::MessagemyHCHDxHandler
 
ArFunctor1C< ArGPS, ArNMEAParser::MessagemyGPGSAHandler
 
ArFunctor1C< ArGPS, ArNMEAParser::MessagemyGPGSVHandler
 
unsigned int mySNRSum
 
unsigned short mySNRNum
 
ArFunctor1C< ArGPS, ArNMEAParser::MessagemyGPMSSHandler
 
ArFunctor1C< ArGPS, ArNMEAParser::MessagemyGPGSTHandler
 

Detailed Description

GPS subclass to support the Trimble AgGPS and other Trimble GPS devices.

This subclass extends ArGPS to send initialization commands specific to Trimble GPS devices, and to handle the PTNLAG001 message which is specific to the Trimble GPS (this message contains data received from an auxilliary device connected to the GPS; ArTrimbleGPS simply parses its contents as a new NMEA message; i.e. data received by the Trimble is assumed to be NMEA messages that it forwards via the PTNLAG001 message.)

Note
You must also configure the ports using the Trimble AgRemote program (http://www.trimble.com/support_trl.asp?pt=AgRemote&Nav=Collection-1545). Enable the following messages on whichever GPS port the computer is connected to: GPRMC, GPGGA, GPGSA, GPGSV, GPGST, GPMSS, and set input (I) protocol to TSIP 38k baud, and output protocol (O) to NMEA 38k baud. This configuration is done by MobileRobots when shipping a Trimble AgGPS but you may need to do this if the GPS loses its configuration or after changing any other settings (Note that AgRemote resets the port settings each time it connects, so you must reset them each time before exiting AgRemote!)
Since
2.6.0

Member Function Documentation

◆ sendTSIPCommand()

bool ArTrimbleGPS::sendTSIPCommand ( char  command,
const char *  data,
size_t  dataLen 
)

Send a TSIP command to the Trimble GPS.

See the TSIP Reference guide for details. Note, the data must be 66 characters or less.


The documentation for this class was generated from the following files: