Main MRPT website > C++ reference for MRPT 1.9.9
CSickLaserUSB.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef CSickLaserUSB_H
10 #define CSickLaserUSB_H
11 
14 
15 namespace mrpt
16 {
17 namespace hwdrivers
18 {
19 /** This "software driver" implements the communication protocol for interfacing
20  * a SICK LMS2XX laser scanners through a custom USB RS-422 interface board.
21  *
22  * NOTE that this class is for a custom hardware built at our lab (MAPIR,
23  * University of Malaga).
24  * For a generic serial interface, see the class CSickLaserSerial.
25  *
26  * This class does not need to be bind, i.e. you do not need to call
27  * C2DRangeFinderAbstract::bindIO. However, calling it will have not effect.
28  * In this class the "bind" is ignored since it is designed for USB
29  * connections only, thus it internally generate the required object for
30  * simplicity of use.
31  * The serial number of the USB device is used to open it on the first call
32  * to "doProcess", thus you must call "loadConfig" before this, or manually
33  * call "setDeviceSerialNumber". The default serial number is "LASER001"
34  *
35  * Warning: Avoid defining an object of this class in a global scope if you
36  * want to catch all potential
37  * exceptions during the constructors (like USB interface DLL not found,
38  * etc...)
39  *
40  *
41  * \code
42  * PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
43  * -------------------------------------------------------
44  * [supplied_section_name]
45  * SICKUSB_serialNumber=LASER001
46  * pose_x=0.21 ; Laser range scaner 3D position in the robot (meters)
47  * pose_y=0
48  * pose_z=0.34
49  * pose_yaw=0 ; Angles in degrees
50  * pose_pitch=0
51  * pose_roll=0
52  * //preview = true // Enable GUI visualization of captured data
53  *
54  * // Optional: Exclusion zones to avoid the robot seeing itself:
55  * //exclusionZone1_x = 0.20 0.30 0.30 0.20
56  * //exclusionZone1_y = 0.20 0.30 0.30 0.20
57  *
58  * // Optional: Exclusion zones to avoid the robot seeing itself:
59  * //exclusionAngles1_ini = 20 // Deg
60  * //exclusionAngles1_end = 25 // Deg
61  * \endcode
62  * \ingroup mrpt_hwdrivers_grp
63  *
64  */
66 {
68 
69  private:
72 
73  /** Time of the first data packet, for synchronization purposes. */
76 
77  /** The sensor 6D pose:
78  */
80 
83  std::vector<float>& ranges, unsigned char& LMS_status,
84  uint32_t& out_board_timestamp, bool& is_mm_mode);
85 
86  protected:
87  /** See the class documentation at the top for expected parameters */
89  const mrpt::utils::CConfigFileBase& configSource,
90  const std::string& iniSection);
91 
92  public:
93  /** Constructor
94  */
95  CSickLaserUSB();
96 
97  /** Destructor
98  */
99  virtual ~CSickLaserUSB();
100 
101  /** Changes the serial number of the device to open (call prior to
102  * 'doProcess')
103  */
104  void setDeviceSerialNumber(const std::string& deviceSerialNumber)
105  {
106  m_serialNumber = deviceSerialNumber;
107  }
108 
109  /** Specific laser scanner "software drivers" must process here new data
110  * from the I/O stream, and, if a whole scan has arrived, return it.
111  * This method will be typically called in a different thread than other
112  * methods, and will be called in a timely fashion.
113  */
114  void doProcessSimple(
115  bool& outThereIsObservation,
116  mrpt::obs::CObservation2DRangeScan& outObservation,
117  bool& hardwareError);
118 
119  /** Enables the scanning mode (in this class this has no effect).
120  * \return If everything works "true", or "false" if there is any error.
121  */
122  bool turnOn();
123 
124  /** Disables the scanning mode (in this class this has no effect).
125  * \return If everything works "true", or "false" if there is any error.
126  */
127  bool turnOff();
128 
129 }; // End of class
130 
131 } // End of namespace
132 } // End of namespace
133 
134 #endif
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
Definition: datetime.h:32
void doProcessSimple(bool &outThereIsObservation, mrpt::obs::CObservation2DRangeScan &outObservation, bool &hardwareError)
Specific laser scanner "software drivers" must process here new data from the I/O stream...
virtual ~CSickLaserUSB()
Destructor.
void setDeviceSerialNumber(const std::string &deviceSerialNumber)
Changes the serial number of the device to open (call prior to &#39;doProcess&#39;)
uint32_t m_timeStartUI
Time of the first data packet, for synchronization purposes.
Definition: CSickLaserUSB.h:74
This "software driver" implements the communication protocol for interfacing a SICK LMS2XX laser scan...
Definition: CSickLaserUSB.h:65
bool turnOn()
Enables the scanning mode (in this class this has no effect).
This class allows loading and storing values and vectors of different types from a configuration text...
mrpt::comms::CInterfaceFTDI * m_usbConnection
Definition: CSickLaserUSB.h:70
GLsizei const GLchar ** string
Definition: glext.h:4101
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
This is the base, abstract class for "software drivers" interfaces to 2D scanners (laser range finder...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
A definition of a CStream actually representing a USB connection to a FTDI chip.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
bool turnOff()
Disables the scanning mode (in this class this has no effect).
poses::CPose3D m_sensorPose
The sensor 6D pose:
Definition: CSickLaserUSB.h:79
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
bool waitContinuousSampleFrame(std::vector< float > &ranges, unsigned char &LMS_status, uint32_t &out_board_timestamp, bool &is_mm_mode)
unsigned __int32 uint32_t
Definition: rptypes.h:47
mrpt::system::TTimeStamp m_timeStartTT
Definition: CSickLaserUSB.h:75



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019