Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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:
80  std::string m_com_port;
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
mrpt::obs::CObservation2DRangeScan
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
Definition: obs/CObservation2DRangeScan.h:40
mrpt::hwdrivers::CRoboPeakLidar::m_com_port
std::string m_com_port
Definition: CRoboPeakLidar.h:80
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CParticleFilter.h:16
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:251
mrpt::hwdrivers::C2DRangeFinderAbstract
This is the base, abstract class for "software drivers" interfaces to 2D scanners (laser range finder...
Definition: C2DRangeFinderAbstract.h:38
mrpt::utils::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: CConfigFileBase.h:30
circular_buffer.h
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:72
CPose3D.h
mrpt::hwdrivers::CRoboPeakLidar
Interfaces a Robo Peak LIDAR laser scanner.
Definition: CRoboPeakLidar.h:51
mrpt::hwdrivers::CRoboPeakLidar::m_sensorPose
poses::CPose3D m_sensorPose
The sensor 6D pose:
Definition: CRoboPeakLidar.h:79
mrpt::hwdrivers::CRoboPeakLidar::m_rplidar_drv
void * m_rplidar_drv
Definition: CRoboPeakLidar.h:82
mrpt::hwdrivers::CRoboPeakLidar::m_com_port_baudrate
int m_com_port_baudrate
Definition: CRoboPeakLidar.h:81
HWDRIVERS_IMPEXP
#define HWDRIVERS_IMPEXP
Definition: hwdrivers_impexp.h:82
C2DRangeFinderAbstract.h



Page generated by Doxygen 1.8.17 for MRPT 1.4.0 SVN: at Tue Mar 3 09:15:16 UTC 2020