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



Page generated by Doxygen 1.9.1 for MRPT 1.9.9 Git: 814d80880 Fri Aug 24 01:51:28 2018 +0200 at mar 26 may 2026 12:30:59 CEST