Aria: ArGPSConnector Class Reference

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ArGPSConnector Class Reference

`#include <ArGPSConnector.h>`

List of all members.

## Detailed Description

Factory for creating ArGPS objects based on command-line parameters.

Use createGPS() to create a GPS object.

Note:
  The device connection object created by ArGPSConnector is destroyed when ArGPSConnector is destroyed. Therefore, you must not destroy an ArGPSConnector while its associated ArGPS is in use.

The following command-line arguments are checked:

## Public Types
enum | GPSType { Standard, Novatel, Trimble, Invalid }
| Device type identifiers. More...
## Public Member Functions
| ArGPSConnector (ArArgumentParser *argParser)
ArGPS * | create (ArRobot *robot=NULL)
ArGPS * | createGPS (ArRobot *robot=NULL)
GPSType | getGPSType () const
bool | parseArgs ()
## Protected Member Functions
GPSType | deviceTypeFromString (const char *str)
void | logOptions ()
## Protected Attributes
ArArgumentParser * | myArgParser
int | myBaud
ArDeviceConnection * | myDeviceCon
GPSType | myDeviceType
ArFunctorC< ArGPSConnector > | myLogArgsCallback
ArRetFunctorC< bool, ArGPSConnector > | myParseArgsCallback
const char * | myPort
const char * | myTCPHost
int | myTCPPort

## Member Enumeration Documentation

enum ArGPSConnector::GPSType

Device type identifiers.

Enumerator:

  Standard | For a standard NMEA GPS device (no extra initialization or interpretation needed) accessible using ArGPS.
  Novatel | For a Novatel device accessible using ArNovatelGPS.
  Trimble | For a Trimble device accessible using ArTrimbleGPS.
  Invalid | Not set or invalid.

## Member Function Documentation

ArGPS* ArGPSConnector::create | ( | ArRobot * | robot = `NULL` | ) | `[inline]`

Create a new GPS object (may be an ArGPS subclass based on device type) and a device connection for that GPS. Use ArGPS::blockingConnect() to open the connection.

Parameters:

  | robot | If not NULL, obtain default values for GPS type, port and baud from this robot's parameters (given in parameter file), for any of these not set from command-line arguments in parseArgs().

Returns:
  NULL if there was an error creating a GPS object or an error creating and opening its device connection. Otherwise, return the new GPS object.

ArGPS* ArGPSConnector::createGPS | ( | ArRobot * | robot = `NULL` | ) |

Create a new GPS object (may be an ArGPS subclass based on device type) and a device connection for that GPS. Use ArGPS::blockingConnect() to open the connection.

Parameters:

  | robot | If not NULL, obtain default values for GPS type, port and baud from this robot's parameters (given in parameter file), for any of these not set from command-line arguments in parseArgs().

Returns:
  NULL if there was an error creating a GPS object or an error creating and opening its device connection. Otherwise, return the new GPS object.

void ArGPSConnector::logOptions | ( |  | ) | `[protected]`

Log argument option information

bool ArGPSConnector::parseArgs | ( |  | ) |

Gets command line arguments

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

- ArGPSConnector.h