MRPT logo

mrpt::hwdrivers::CSickLaserUSB Class Reference

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

#include <mrpt/hwdrivers/CSickLaserUSB.h>

Inheritance diagram for mrpt::hwdrivers::CSickLaserUSB:

mrpt::hwdrivers::C2DRangeFinderAbstract mrpt::utils::CDebugOutputCapable mrpt::hwdrivers::CGenericSensor mrpt::utils::CUncopiable

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

Private Member Functions

bool checkControllerIsConnected ()
bool waitContinuousSampleFrame (vector_float &ranges, unsigned char &LMS_status, uint32_t &out_board_timestamp, bool &is_mm_mode)
uint16_t computeCRC (unsigned char *data, unsigned long len)

Private Attributes

CInterfaceFTDIm_usbConnection
std::string m_serialNumber
std::string m_sensorLabel
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:.

Static Private Attributes

static int CRC16_GEN_POL


Detailed Description

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

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 62 of file CSickLaserUSB.h.


Constructor & Destructor Documentation

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

Constructor.

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

Destructor.


Member Function Documentation

bool mrpt::hwdrivers::CSickLaserUSB::checkControllerIsConnected (  )  [private]

uint16_t mrpt::hwdrivers::CSickLaserUSB::computeCRC ( unsigned char *  data,
unsigned long  len 
) [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 ( 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::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 96 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 ( vector_float ranges,
unsigned char &  LMS_status,
uint32_t &  out_board_timestamp,
bool &  is_mm_mode 
) [private]


Member Data Documentation

Definition at line 78 of file CSickLaserUSB.h.

Definition at line 69 of file CSickLaserUSB.h.

The sensor 6D pose:.

Definition at line 76 of file CSickLaserUSB.h.

Definition at line 68 of file CSickLaserUSB.h.

Definition at line 72 of file CSickLaserUSB.h.

Time of the first data packet, for synchronization purposes.

Definition at line 71 of file CSickLaserUSB.h.

Definition at line 67 of file CSickLaserUSB.h.




Page generated by Doxygen 1.5.7.1 for MRPT 0.6.5 SVN: at Mon Feb 23 13:24:51 EST 2009