Main MRPT website > C++ reference for MRPT 1.9.9
CRoboPeakLidar.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 CRoboPeakLidar_H
10 #define CRoboPeakLidar_H
11 
12 #include <mrpt/poses/CPose3D.h>
15 
16 namespace mrpt
17 {
18 namespace hwdrivers
19 {
20 /** Interfaces a Robo Peak LIDAR laser scanner.
21  *
22  * See the example "samples/RoboPeakLidar_laser_test" and the application
23  * "rawlog-grabber" for a ready-to-use application to gather data from the
24  * scanner.
25  *
26  * \code
27  * PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
28  * -------------------------------------------------------
29  * [supplied_section_name]
30  * COM_port_WIN = COM3
31  * COM_port_LIN = ttyS0
32  * pose_x=0 // Laser range scaner 3D position in the robot (meters)
33  * pose_y=0
34  * pose_z=0
35  * pose_yaw=0 // Angles in degrees
36  * pose_pitch=0
37  * pose_roll=0
38  *
39  * //preview = true // Enable GUI visualization of captured data
40  *
41  * // Optional: Exclusion zones to avoid the robot seeing itself:
42  * //exclusionZone1_x = 0.20 0.30 0.30 0.20
43  * //exclusionZone1_y = 0.20 0.30 0.30 0.20
44  *
45  * // Optional: Exclusion zones to avoid the robot seeing itself:
46  * //exclusionAngles1_ini = 20 // Deg
47  * //exclusionAngles1_end = 25 // Deg
48  *
49  * \endcode
50  * \note Class introduced in MRPT 1.2.2
51  * \ingroup mrpt_hwdrivers_grp
52  */
54 {
56  public:
57  /** Constructor */
59  /** Destructor: turns the laser off. */
60  virtual ~CRoboPeakLidar();
61 
62  /** Attempts to connect and turns the laser on. Raises an exception on
63  * error. */
64  virtual void initialize();
65 
66  // See base class docs
67  virtual void doProcessSimple(
68  bool& outThereIsObservation,
69  mrpt::obs::CObservation2DRangeScan& outObservation,
70  bool& hardwareError);
71 
72  /** If set to non-empty, the serial port will be attempted to be opened
73  * automatically when this class is first used to request data from the
74  * laser. */
75  void setSerialPort(const std::string& port_name);
76  /** Returns the currently set serial port \sa setSerialPort */
77  const std::string getSerialPort() { return m_com_port; }
78  /** See base class docs */
79  virtual bool turnOn();
80  /** See base class docs */
81  virtual bool turnOff();
82 
83  /** Returns true if the device is connected & operative */
84  bool getDeviceHealth() const;
85 
86  /** Closes the comms with the laser. Shouldn't have to be directly needed by
87  * the user */
88  void disconnect();
89 
90  protected:
91  /** The sensor 6D pose: */
95  void* m_rplidar_drv; // Opaque "RPlidarDriver*"
96 
97  /** Returns true if communication has been established with the device. If
98  * it's not,
99  * try to create a comms channel.
100  * \return false on error.
101  */
102  bool checkCOMMs();
103 
104  /** See the class documentation at the top for expected parameters */
106  const mrpt::utils::CConfigFileBase& configSource,
107  const std::string& iniSection);
108 
109 }; // End of class
110 
111 } // End of namespace
112 
113 } // End of namespace
114 
115 #endif
#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...
Interfaces a Robo Peak LIDAR laser scanner.
void setSerialPort(const std::string &port_name)
If set to non-empty, the serial port will be attempted to be opened automatically when this class is ...
bool getDeviceHealth() const
Returns true if the device is connected & operative.
bool checkCOMMs()
Returns true if communication has been established with the device.
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
virtual ~CRoboPeakLidar()
Destructor: turns the laser off.
virtual 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 bool turnOff()
See base class docs.
virtual bool turnOn()
See base class docs.
poses::CPose3D m_sensorPose
The sensor 6D pose:
virtual void initialize()
Attempts to connect and turns the laser on.
const std::string getSerialPort()
Returns the currently set serial port.
void disconnect()
Closes the comms with the laser.
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:89
This class allows loading and storing values and vectors of different types from a configuration text...
GLsizei const GLchar ** string
Definition: glext.h:4101
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.



Page generated by Doxygen 1.9.1 for MRPT 1.9.9 Git: 63ea9d1f1 Thu Nov 23 00:06:53 2017 +0100 at mar 26 may 2026 12:19:29 CEST