#include <mrpt/hwdrivers/CGPSInterface.h>
Public Member Functions | |
CGPSInterface (int BUFFER_LENGTH=500) | |
Constructor. | |
virtual | ~CGPSInterface () |
Destructor. | |
void | doProcess () |
This method should be called periodically (at least at 1Hz to capture ALL the real-time data) It is thread safe, i.e. | |
void | loadConfig (const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection) |
Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes) See hwdrivers::CGPSInterface for the possible parameters. | |
bool | isGPS_connected () |
Returns true if communications work. | |
bool | isGPS_signalAcquired () |
Returns true if the last message from the GPS indicates that the signal from sats has been acquired. | |
Protected Member Functions | |
bool | OnConnectionEstablished () |
Implements custom messages to be sent to the GPS unit just after connection and before normal use. | |
Protected Attributes | |
CSerialPort * | m_COM |
poses::CPoint3D | m_sensorPose |
std::string | m_sensorLabel |
std::string | m_customInit |
Private Member Functions | |
bool | tryToOpenTheCOM () |
Returns true if the COM port is already open, or try to open it in other case. | |
void | processBuffer () |
Process data in "m_buffer" to extract GPS messages, and remove them from the buffer. | |
void | processGPSstring (const std::string &s) |
Process a complete string from the GPS:. | |
void | getNextToken (const std::string &str, std::string &token, unsigned int &parserPos) |
Tokenize a string "str" into commas separated tokens. | |
Private Attributes | |
std::string | m_COMname |
int | m_COMbauds |
bool | m_GPS_comsWork |
bool | m_GPS_signalAcquired |
int | m_BUFFER_LENGTH |
char * | m_buffer |
size_t | m_bufferLength |
size_t | m_bufferWritePos |
mrpt::slam::CObservationGPS | m_latestGPS_data |
PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
-------------------------------------------------------
[supplied_section_name]
COM_port_WIN = COM3
COM_port_LIN = ttyS0
baudRate = 4800 ; The baudrate of the communications (typ. 4800 bauds)
pose_x = 0 ; 3D position of the sensed point relative to the robot (meters)
pose_y = 0
pose_z = 0
customInit =
VERSIONS HISTORY: -9/JUN/2006: First version (JLBC) -4/JUN/2008: Added virtual methods for device-specific initialization commands. -10/JUN/2008: Converted into CGenericSensor class (there are no inhirited classes anymore).
Definition at line 70 of file CGPSInterface.h.
mrpt::hwdrivers::CGPSInterface::CGPSInterface | ( | int | BUFFER_LENGTH = 500 |
) |
Constructor.
BUFFER_LENGTH | The size of the communications buffer (default value should be fine always) |
virtual mrpt::hwdrivers::CGPSInterface::~CGPSInterface | ( | ) | [virtual] |
Destructor.
void mrpt::hwdrivers::CGPSInterface::doProcess | ( | ) | [virtual] |
This method should be called periodically (at least at 1Hz to capture ALL the real-time data) It is thread safe, i.e.
you can call this from one thread, then to other methods from other threads. This method processes data from the GPS and update the object state accordingly.
Implements mrpt::hwdrivers::CGenericSensor.
void mrpt::hwdrivers::CGPSInterface::getNextToken | ( | const std::string & | str, | |
std::string & | token, | |||
unsigned int & | parserPos | |||
) | [private] |
Tokenize a string "str" into commas separated tokens.
bool mrpt::hwdrivers::CGPSInterface::isGPS_connected | ( | ) |
Returns true if communications work.
bool mrpt::hwdrivers::CGPSInterface::isGPS_signalAcquired | ( | ) |
Returns true if the last message from the GPS indicates that the signal from sats has been acquired.
void mrpt::hwdrivers::CGPSInterface::loadConfig | ( | const mrpt::utils::CConfigFileBase & | configSource, | |
const std::string & | iniSection | |||
) | [virtual] |
Loads specific configuration for the device from a given source of configuration parameters, for example, an ".ini" file, loading from the section "[iniSection]" (see utils::CConfigFileBase and derived classes) See hwdrivers::CGPSInterface for the possible parameters.
Implements mrpt::hwdrivers::CGenericSensor.
bool mrpt::hwdrivers::CGPSInterface::OnConnectionEstablished | ( | ) | [protected] |
Implements custom messages to be sent to the GPS unit just after connection and before normal use.
Returns false or raise an exception if something goes wrong.
void mrpt::hwdrivers::CGPSInterface::processBuffer | ( | ) | [private] |
Process data in "m_buffer" to extract GPS messages, and remove them from the buffer.
void mrpt::hwdrivers::CGPSInterface::processGPSstring | ( | const std::string & | s | ) | [private] |
Process a complete string from the GPS:.
bool mrpt::hwdrivers::CGPSInterface::tryToOpenTheCOM | ( | ) | [private] |
Returns true if the COM port is already open, or try to open it in other case.
char* mrpt::hwdrivers::CGPSInterface::m_buffer [private] |
Definition at line 127 of file CGPSInterface.h.
int mrpt::hwdrivers::CGPSInterface::m_BUFFER_LENGTH [private] |
Definition at line 125 of file CGPSInterface.h.
size_t mrpt::hwdrivers::CGPSInterface::m_bufferLength [private] |
Definition at line 128 of file CGPSInterface.h.
size_t mrpt::hwdrivers::CGPSInterface::m_bufferWritePos [private] |
Definition at line 129 of file CGPSInterface.h.
CSerialPort* mrpt::hwdrivers::CGPSInterface::m_COM [protected] |
Definition at line 113 of file CGPSInterface.h.
int mrpt::hwdrivers::CGPSInterface::m_COMbauds [private] |
Definition at line 122 of file CGPSInterface.h.
std::string mrpt::hwdrivers::CGPSInterface::m_COMname [private] |
Definition at line 121 of file CGPSInterface.h.
std::string mrpt::hwdrivers::CGPSInterface::m_customInit [protected] |
Definition at line 118 of file CGPSInterface.h.
bool mrpt::hwdrivers::CGPSInterface::m_GPS_comsWork [private] |
Definition at line 123 of file CGPSInterface.h.
bool mrpt::hwdrivers::CGPSInterface::m_GPS_signalAcquired [private] |
Definition at line 124 of file CGPSInterface.h.
Definition at line 153 of file CGPSInterface.h.
std::string mrpt::hwdrivers::CGPSInterface::m_sensorLabel [protected] |
Definition at line 117 of file CGPSInterface.h.
Definition at line 115 of file CGPSInterface.h.
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN: at Thu Feb 26 02:14:51 EST 2009 |