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>
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 | |
CInterfaceFTDI * | m_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: |
mrpt::hwdrivers::CSickLaserUSB::CSickLaserUSB | ( | ) |
Constructor.
virtual mrpt::hwdrivers::CSickLaserUSB::~CSickLaserUSB | ( | ) | [virtual] |
Destructor.
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).
Implements mrpt::hwdrivers::C2DRangeFinderAbstract.
bool mrpt::hwdrivers::CSickLaserUSB::turnOn | ( | ) | [virtual] |
Enables the scanning mode (in this class this has no effect).
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] |
The sensor 6D pose:
Definition at line 79 of file CSickLaserUSB.h.
std::string mrpt::hwdrivers::CSickLaserUSB::m_serialNumber [private] |
Definition at line 72 of file CSickLaserUSB.h.
Definition at line 75 of file CSickLaserUSB.h.
uint32_t mrpt::hwdrivers::CSickLaserUSB::m_timeStartUI [private] |
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.1 for MRPT 0.9.4 SVN: at Mon Jan 10 23:33:19 UTC 2011 |