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-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
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::config::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
mrpt::obs::CObservation2DRangeScan
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
Definition: CObservation2DRangeScan.h:56
mrpt::hwdrivers::CRoboPeakLidar::m_com_port
std::string m_com_port
Definition: CRoboPeakLidar.h:93
mrpt::hwdrivers::CRoboPeakLidar::getDeviceHealth
bool getDeviceHealth() const
Returns true if the device is connected & operative.
Definition: CRoboPeakLidar.cpp:225
mrpt::hwdrivers::CRoboPeakLidar::~CRoboPeakLidar
virtual ~CRoboPeakLidar()
Destructor: turns the laser off.
Definition: CRoboPeakLidar.cpp:43
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::hwdrivers::CRoboPeakLidar::getSerialPort
const std::string getSerialPort()
Returns the currently set serial port.
Definition: CRoboPeakLidar.h:77
DEFINE_GENERIC_SENSOR
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
Definition: CGenericSensor.h:314
mrpt::hwdrivers::CRoboPeakLidar::checkCOMMs
bool checkCOMMs()
Returns true if communication has been established with the device.
Definition: CRoboPeakLidar.cpp:264
mrpt::hwdrivers::CRoboPeakLidar::turnOn
virtual bool turnOn()
See base class docs.
Definition: CRoboPeakLidar.cpp:196
mrpt::hwdrivers::C2DRangeFinderAbstract
This is the base, abstract class for "software drivers" interfaces to 2D scanners (laser range finder...
Definition: C2DRangeFinderAbstract.h:43
mrpt::hwdrivers::CRoboPeakLidar::loadConfig_sensorSpecific
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
Definition: CRoboPeakLidar.cpp:169
mrpt::hwdrivers::CRoboPeakLidar::setSerialPort
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 ...
Definition: CRoboPeakLidar.cpp:354
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:44
circular_buffer.h
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
CPose3D.h
mrpt::hwdrivers::CRoboPeakLidar
Interfaces a Robo Peak LIDAR laser scanner.
Definition: CRoboPeakLidar.h:53
mrpt::hwdrivers::CRoboPeakLidar::m_sensorPose
poses::CPose3D m_sensorPose
The sensor 6D pose:
Definition: CRoboPeakLidar.h:92
mrpt::hwdrivers::CRoboPeakLidar::m_rplidar_drv
void * m_rplidar_drv
Definition: CRoboPeakLidar.h:95
mrpt::hwdrivers::CRoboPeakLidar::disconnect
void disconnect()
Closes the comms with the laser.
Definition: CRoboPeakLidar.cpp:49
mrpt::hwdrivers::CRoboPeakLidar::m_com_port_baudrate
int m_com_port_baudrate
Definition: CRoboPeakLidar.h:94
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::hwdrivers::CRoboPeakLidar::CRoboPeakLidar
CRoboPeakLidar()
Constructor.
Definition: CRoboPeakLidar.cpp:34
mrpt::hwdrivers::CRoboPeakLidar::initialize
virtual void initialize()
Attempts to connect and turns the laser on.
Definition: CRoboPeakLidar.cpp:344
mrpt::hwdrivers::CRoboPeakLidar::turnOff
virtual bool turnOff()
See base class docs.
Definition: CRoboPeakLidar.cpp:210
mrpt::hwdrivers::CRoboPeakLidar::doProcessSimple
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,...
Definition: CRoboPeakLidar.cpp:60
C2DRangeFinderAbstract.h



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST