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

mrpt::hwdrivers::CSickLaserUSB Class Reference


Detailed Description

This "software driver" implements the communication protocol for interfacing a SICK LMS2XX laser scanners through a custom USB RS-422 interface board.

NOTE that this class is for a custom hardware built at our lab (MAPIR, University of Malaga). For a generic serial interface, see the class CSickLaserSerial.

This class does not need to be bind, i.e. you do not need to call C2DRangeFinderAbstract::bindIO. However, calling it will have not effect. In this class the "bind" is ignored since it is designed for USB connections only, thus it internally generate the required object for simplicity of use. The serial number of the USB device is used to open it on the first call to "doProcess", thus you must call "loadConfig" before this, or manually call "setDeviceSerialNumber". The default serial number is "LASER001"

Warning: Avoid defining an object of this class in a global scope if you want to catch all potential exceptions during the constructors (like USB interface DLL not found, etc...)

  PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
 -------------------------------------------------------
   [supplied_section_name]
   SICKUSB_serialNumber=LASER001
   pose_x=0.21  ; Laser range scaner 3D position in the robot (meters)
   pose_y=0
   pose_z=0.34
   pose_yaw=0   ; Angles in degrees
   pose_pitch=0
   pose_roll=0

Definition at line 66 of file CSickLaserUSB.h.

#include <mrpt/hwdrivers/CSickLaserUSB.h>

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

List of all members.

Public Member Functions

 CSickLaserUSB ()
 Constructor.
virtual ~CSickLaserUSB ()
 Destructor.
void setDeviceSerialNumber (const std::string &deviceSerialNumber)
 Changes the serial number of the device to open (call prior to 'doProcess')
void doProcessSimple (bool &outThereIsObservation, mrpt::slam::CObservation2DRangeScan &outObservation, bool &hardwareError)
 Specific laser scanner "software drivers" must process here new data from the I/O stream, and, if a whole scan has arrived, return it.
bool turnOn ()
 Enables the scanning mode (in this class this has no effect).
bool turnOff ()
 Disables the scanning mode (in this class this has no effect).

Protected Member Functions

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::CSickLaserUSB for the possible parameters.

Private Member Functions

bool checkControllerIsConnected ()
bool waitContinuousSampleFrame (std::vector< float > &ranges, unsigned char &LMS_status, uint32_t &out_board_timestamp, bool &is_mm_mode)

Private Attributes

CInterfaceFTDIm_usbConnection
std::string m_serialNumber
uint32_t m_timeStartUI
 Time of the first data packet, for synchronization purposes.
mrpt::system::TTimeStamp m_timeStartTT
poses::CPose3D m_sensorPose
 The sensor 6D pose:

Constructor & Destructor Documentation

mrpt::hwdrivers::CSickLaserUSB::CSickLaserUSB ( )

Constructor.

virtual mrpt::hwdrivers::CSickLaserUSB::~CSickLaserUSB ( ) [virtual]

Destructor.


Member Function Documentation

bool mrpt::hwdrivers::CSickLaserUSB::checkControllerIsConnected ( ) [private]
void mrpt::hwdrivers::CSickLaserUSB::doProcessSimple ( bool &  outThereIsObservation,
mrpt::slam::CObservation2DRangeScan outObservation,
bool &  hardwareError 
) [virtual]

Specific laser scanner "software drivers" must process here new data from the I/O stream, and, if a whole scan has arrived, return it.

This method will be typically called in a different thread than other methods, and will be called in a timely fashion.

Implements mrpt::hwdrivers::C2DRangeFinderAbstract.

void mrpt::hwdrivers::CSickLaserUSB::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::CSickLaserUSB for the possible parameters.

Implements mrpt::hwdrivers::CGenericSensor.

void mrpt::hwdrivers::CSickLaserUSB::setDeviceSerialNumber ( const std::string &  deviceSerialNumber) [inline]

Changes the serial number of the device to open (call prior to 'doProcess')

Definition at line 103 of file CSickLaserUSB.h.

bool mrpt::hwdrivers::CSickLaserUSB::turnOff ( ) [virtual]

Disables the scanning mode (in this class this has no effect).

Returns:
If everything works "true", or "false" if there is any error.

Implements mrpt::hwdrivers::C2DRangeFinderAbstract.

bool mrpt::hwdrivers::CSickLaserUSB::turnOn ( ) [virtual]

Enables the scanning mode (in this class this has no effect).

Returns:
If everything works "true", or "false" if there is any error.

Implements mrpt::hwdrivers::C2DRangeFinderAbstract.

bool mrpt::hwdrivers::CSickLaserUSB::waitContinuousSampleFrame ( std::vector< float > &  ranges,
unsigned char &  LMS_status,
uint32_t &  out_board_timestamp,
bool &  is_mm_mode 
) [private]

Member Data Documentation

The sensor 6D pose:

Definition at line 79 of file CSickLaserUSB.h.

Definition at line 72 of file CSickLaserUSB.h.

Definition at line 75 of file CSickLaserUSB.h.

Time of the first data packet, for synchronization purposes.

Definition at line 74 of file CSickLaserUSB.h.

Definition at line 71 of file CSickLaserUSB.h.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011