This "software driver" implements the communication protocol for interfacing a SICK LMS100 laser scanners through an ethernet controller. More...
#include <mrpt/hwdrivers/CLMS100eth.h>


Public Member Functions | |
| CLMS100Eth (string _ip=string("192.168.0.1"), unsigned int _port=2111) | |
| Constructor. | |
| virtual | ~CLMS100Eth () |
| Destructor. | |
| void | doProcessSimple (bool &outThereIsObservation, CObservation2DRangeScan &outObservation, bool &hardwareError) |
| This function acquire a laser scan from the device. | |
| bool | turnOn () |
| This method must be called before trying to get a laser scan. | |
| bool | turnOff () |
| This method could be called manually to stop communication with the device. | |
| void | setSensorPose (CPose3D &_pose) |
| A method to set the sensor pose on the robot. | |
Protected Member Functions | |
| void | loadConfig_sensorSpecific (const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection) |
| Load sensor pose on the robot, or keep the default sensor pose. | |
Private Member Functions | |
| void | generateCmd (const char *cmd) |
| bool | checkIsConnected () |
| bool | decodeLogIn (char *msg) |
| bool | decodeScanCfg (istringstream &stream) |
| bool | decodeScanDataCfg (istringstream &stream) |
| bool | decodeScan (char *buf, CObservation2DRangeScan &outObservation) |
| void | sendCommand (const char *cmd) |
| void | roughPrint (char *msg) |
Private Attributes | |
| string | m_ip |
| unsigned int | m_port |
| CClientTCPSocket | m_client |
| bool | m_turnedOn |
| string | m_cmd |
| bool | m_connected |
| unsigned int | m_scanFrequency |
| double | m_angleResolution |
| double | m_startAngle |
| double | m_stopAngle |
| CPose3D | m_sensorPose |
| double | m_maxRange |
| double | m_beamApperture |
This "software driver" implements the communication protocol for interfacing a SICK LMS100 laser scanners through an ethernet controller.
This class does not need to be bind, i.e. you do not need to call C2DRangeFinderAbstract::bindIO. Connection is established when user call the turnOn() method. You can pass to the class's constructor the LMS100 's ip address and port. Device will be configured with the following parameters :
To get a laser scan you must proceed like that :
CLMS200Eth laser(string("192.168.0.10"), 1234); laser.turnOn(); bool isOutObs, hardwareError; CObservation2DRangeScan outObs; laser.doProcessSimple(isOutObs, outObs, hardwareError);
The sensor pose on the vehicle could be loaded from an ini configuration file with :
PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
-------------------------------------------------------
[supplied_section_name]
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 79 of file CLMS100eth.h.
| mrpt::hwdrivers::CLMS100Eth::CLMS100Eth | ( | string | _ip = string("192.168.0.1"), |
|
| unsigned int | _port = 2111 | |||
| ) |
Constructor.
Note that there is default arguments, here you can customize IP Adress and TCP Port of your device.
| virtual mrpt::hwdrivers::CLMS100Eth::~CLMS100Eth | ( | ) | [virtual] |
Destructor.
Close communcation with the device, and free memory.
| bool mrpt::hwdrivers::CLMS100Eth::checkIsConnected | ( | ) | [private] |
| bool mrpt::hwdrivers::CLMS100Eth::decodeLogIn | ( | char * | msg | ) | [private] |
| bool mrpt::hwdrivers::CLMS100Eth::decodeScan | ( | char * | buf, | |
| CObservation2DRangeScan & | outObservation | |||
| ) | [private] |
| bool mrpt::hwdrivers::CLMS100Eth::decodeScanCfg | ( | istringstream & | stream | ) | [private] |
| bool mrpt::hwdrivers::CLMS100Eth::decodeScanDataCfg | ( | istringstream & | stream | ) | [private] |
| void mrpt::hwdrivers::CLMS100Eth::doProcessSimple | ( | bool & | outThereIsObservation, | |
| CObservation2DRangeScan & | outObservation, | |||
| bool & | hardwareError | |||
| ) | [virtual] |
This function acquire a laser scan from the device.
If an error occured, hardwareError will be set to true. The new laser scan will be stored in the outObservation argument.
| This | method throw exception if the frame received from the LMS 100 contain the following bad parameters : * Status is not OK * Data in the scan aren't DIST1 (may be RSSIx or DIST2). |
Implements mrpt::hwdrivers::C2DRangeFinderAbstract.
| void mrpt::hwdrivers::CLMS100Eth::generateCmd | ( | const char * | cmd | ) | [private] |
| void mrpt::hwdrivers::CLMS100Eth::loadConfig_sensorSpecific | ( | const mrpt::utils::CConfigFileBase & | configSource, | |
| const std::string & | iniSection | |||
| ) | [protected, virtual] |
Load sensor pose on the robot, or keep the default sensor pose.
Implements mrpt::hwdrivers::CGenericSensor.
| void mrpt::hwdrivers::CLMS100Eth::roughPrint | ( | char * | msg | ) | [private] |
| void mrpt::hwdrivers::CLMS100Eth::sendCommand | ( | const char * | cmd | ) | [private] |
| void mrpt::hwdrivers::CLMS100Eth::setSensorPose | ( | CPose3D & | _pose | ) |
A method to set the sensor pose on the robot.
| bool mrpt::hwdrivers::CLMS100Eth::turnOff | ( | ) | [virtual] |
This method could be called manually to stop communication with the device.
Method is also called by destructor.
Implements mrpt::hwdrivers::C2DRangeFinderAbstract.
| bool mrpt::hwdrivers::CLMS100Eth::turnOn | ( | ) | [virtual] |
This method must be called before trying to get a laser scan.
Implements mrpt::hwdrivers::C2DRangeFinderAbstract.
double mrpt::hwdrivers::CLMS100Eth::m_angleResolution [private] |
Definition at line 118 of file CLMS100eth.h.
double mrpt::hwdrivers::CLMS100Eth::m_beamApperture [private] |
Definition at line 123 of file CLMS100eth.h.
Definition at line 113 of file CLMS100eth.h.
string mrpt::hwdrivers::CLMS100Eth::m_cmd [private] |
Definition at line 115 of file CLMS100eth.h.
bool mrpt::hwdrivers::CLMS100Eth::m_connected [private] |
Definition at line 116 of file CLMS100eth.h.
string mrpt::hwdrivers::CLMS100Eth::m_ip [private] |
Definition at line 111 of file CLMS100eth.h.
double mrpt::hwdrivers::CLMS100Eth::m_maxRange [private] |
Definition at line 122 of file CLMS100eth.h.
unsigned int mrpt::hwdrivers::CLMS100Eth::m_port [private] |
Definition at line 112 of file CLMS100eth.h.
unsigned int mrpt::hwdrivers::CLMS100Eth::m_scanFrequency [private] |
Definition at line 117 of file CLMS100eth.h.
Definition at line 121 of file CLMS100eth.h.
double mrpt::hwdrivers::CLMS100Eth::m_startAngle [private] |
Definition at line 119 of file CLMS100eth.h.
double mrpt::hwdrivers::CLMS100Eth::m_stopAngle [private] |
Definition at line 120 of file CLMS100eth.h.
bool mrpt::hwdrivers::CLMS100Eth::m_turnedOn [private] |
Definition at line 114 of file CLMS100eth.h.
| Page generated by Doxygen 1.6.1 for MRPT 0.9.0 SVN: at Mon Jun 7 06:47:58 UTC 2010 |