Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

mrpt::hwdrivers::CBoardIR Class Reference


Detailed Description

A parser of NMEA commands, for connecting to a GPS by a serial port.

This class also supports more advanced GPS equipped with RTK corrections. See the JAVAD/TopCon extra initialization parameters.

  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   =       // See below for possible values

           // The next parameters are optional and will be used only
    // if customInit=="JAVAD" to enable/configure the usage of RTK corrections:
    //JAVAD_rtk_src_port=/dev/ser/b
    //JAVAD_rtk_src_baud=9600
    //JAVAD_rtk_format=cmr

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 77 of file CBoardIR.h.

#include <mrpt/hwdrivers/CBoardIR.h>

Inheritance diagram for mrpt::hwdrivers::CBoardIR:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CBoardIR (int BUFFER_LENGTH=13)
 Constructor.
virtual ~CBoardIR ()
 Destructor.
void getObservation (bool &outThereIsObservation, mrpt::slam::CObservationRange &outObservation, bool &hardwareError)
 This method tries to get a set of range measurements from the IR sensors.
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 setSerialPortName (const std::string &COM_port)
 Set the serial port to use (COM1, ttyUSB0, etc).
std::string getSerialPortName () const
 Get the serial port to use (COM1, ttyUSB0, etc).

Protected Member Functions

bool OnConnectionEstablished ()
void loadConfig_sensorSpecific (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.

Protected Attributes

CSerialPort m_COM
poses::CPoint3D m_sensorPose
std::string m_customInit
float m_minRange
 The minimum range in meters (10cm).
float m_maxRange
 The maximum range in meters (80cm).
std::map< uint16_t,
mrpt::math::TPose3D
m_IRPoses
 The poses of the IR: x[m] y[m] z[m] yaw[deg] pitch[deg] roll[deg] Up to 6 devices, but you can put any number of devices (from 1 to 6).

Private Member Functions

bool tryToOpenTheCOM ()
 Returns true if the COM port is already open, or try to open it in other case.

Private Attributes

std::string m_COMname
int m_COMbauds

Constructor & Destructor Documentation

mrpt::hwdrivers::CBoardIR::CBoardIR ( int  BUFFER_LENGTH = 13)

Constructor.

Parameters:
BUFFER_LENGTHThe size of the communications buffer (default value should be fine always)
virtual mrpt::hwdrivers::CBoardIR::~CBoardIR ( ) [virtual]

Destructor.


Member Function Documentation

void mrpt::hwdrivers::CBoardIR::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::CBoardIR::getObservation ( bool &  outThereIsObservation,
mrpt::slam::CObservationRange outObservation,
bool &  hardwareError 
)

This method tries to get a set of range measurements from the IR sensors.

Parameters:
outObservationThe output observation
outThereIsObservationWill be true if an observation was sucessfully received.
hardwareErrorWill be true if there's some important error, e.g. serial port can't be open.
std::string mrpt::hwdrivers::CBoardIR::getSerialPortName ( ) const

Get the serial port to use (COM1, ttyUSB0, etc).

void mrpt::hwdrivers::CBoardIR::loadConfig_sensorSpecific ( const mrpt::utils::CConfigFileBase configSource,
const std::string &  iniSection 
) [protected, 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::CBoardIR::OnConnectionEstablished ( ) [protected]
void mrpt::hwdrivers::CBoardIR::setSerialPortName ( const std::string &  COM_port)

Set the serial port to use (COM1, ttyUSB0, etc).

bool mrpt::hwdrivers::CBoardIR::tryToOpenTheCOM ( ) [private]

Returns true if the COM port is already open, or try to open it in other case.

Returns:
true if everything goes OK, or false if there are problems opening the port.

Member Data Documentation

Definition at line 113 of file CBoardIR.h.

Definition at line 141 of file CBoardIR.h.

std::string mrpt::hwdrivers::CBoardIR::m_COMname [private]

Definition at line 140 of file CBoardIR.h.

std::string mrpt::hwdrivers::CBoardIR::m_customInit [protected]

Definition at line 117 of file CBoardIR.h.

The poses of the IR: x[m] y[m] z[m] yaw[deg] pitch[deg] roll[deg] Up to 6 devices, but you can put any number of devices (from 1 to 6).

Definition at line 130 of file CBoardIR.h.

The maximum range in meters (80cm).

Definition at line 125 of file CBoardIR.h.

The minimum range in meters (10cm).

Definition at line 121 of file CBoardIR.h.

Definition at line 115 of file CBoardIR.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011