Main MRPT website > C++ reference for MRPT 1.5.7
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 "rawlog-grabber" for a ready-to-use application to gather data from the 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  CRoboPeakLidar(); //!< Constructor
56  virtual ~CRoboPeakLidar(); //!< Destructor: turns the laser off.
57 
58  virtual void initialize(); //!< Attempts to connect and turns the laser on. Raises an exception on error.
59 
60  // See base class docs
61  virtual void doProcessSimple(
62  bool &outThereIsObservation,
63  mrpt::obs::CObservation2DRangeScan &outObservation,
64  bool &hardwareError );
65 
66  /** If set to non-empty, the serial port will be attempted to be opened automatically when this class is first used to request data from the laser. */
67  void setSerialPort(const std::string &port_name);
68  const std::string getSerialPort() { return m_com_port; } //!< Returns the currently set serial port \sa setSerialPort
69 
70  virtual bool turnOn(); //!< See base class docs
71  virtual bool turnOff(); //!< See base class docs
72 
73  /** Returns true if the device is connected & operative */
74  bool getDeviceHealth() const;
75 
76  void disconnect(); //!< Closes the comms with the laser. Shouldn't have to be directly needed by the user
77 
78  protected:
79  poses::CPose3D m_sensorPose; //!< The sensor 6D pose:
82  void * m_rplidar_drv; // Opaque "RPlidarDriver*"
83 
84  /** Returns true if communication has been established with the device. If it's not,
85  * try to create a comms channel.
86  * \return false on error.
87  */
88  bool checkCOMMs();
89 
90 
91  /** See the class documentation at the top for expected parameters */
92  void loadConfig_sensorSpecific(
93  const mrpt::utils::CConfigFileBase &configSource,
94  const std::string &iniSection );
95 
96  }; // End of class
97 
98  } // End of namespace
99 
100 } // End of namespace
101 
102 #endif
This class allows loading and storing values and vectors of different types from a configuration text...
Interfaces a Robo Peak LIDAR laser scanner.
GLsizei const GLchar ** string
Definition: glext.h:3919
const std::string getSerialPort()
Returns the currently set serial port.
#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...
poses::CPose3D m_sensorPose
The sensor 6D pose:
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72



Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 8277875f6 Mon Jun 11 02:47:32 2018 +0200 at lun oct 28 01:50:49 CET 2019