Main MRPT website > C++ reference for MRPT 1.9.9
CIbeoLuxETH.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 CIbeoLuxETH_H
10 #define CIbeoLuxETH_H
11 
13 #include <mrpt/poses/CPose3D.h>
14 #include <mrpt/poses/CPoint3D.h>
17 
18 #include <thread>
19 
20 namespace mrpt
21 {
22 namespace hwdrivers
23 {
24 /** This "software driver" implements the communication protocol for interfacing
25 * a Ibeo Lux laser scanners through an ethernet controller.
26  * This class does not need to be bind, i.e. you do not need to call
27 * C2DRangeFinderAbstract::bindIO.
28  * Connection is established when user call the turnOn() method. You can
29 * pass to the class's constructor the Lux's ip address and port.
30  * Device will NOT be configured. Configuration has to be done seperately.
31  *
32  * To get a laser scan you must proceed like that :
33  * \code
34  * CIbeoLuxETH laser(string("192.168.0.10"), 1234);
35  * laser.turnOn();
36  * bool isOutObs, hardwareError;
37  * CObservation2DRangeScan outObs;
38  * laser.doProcessSimple(isOutObs, outObs, hardwareError);
39  * \endcode
40  *
41  * \note This class was contributed by Adrien Barral - Robopec (France)
42  * \note And modified by Jan Girlich - University of Hamburg
43 * \ingroup mrpt_hwdrivers_grp
44  */
46 {
48 
49  public:
50  /** Constructor.
51  * Note that there is default arguments, here you can customize IP Adress
52  * and TCP Port of your device.
53  */
55  std::string _ip = std::string("10.152.36.93"),
56  unsigned int _port = 12002);
57  /** Destructor.
58  * Close communcation with the device, and free memory.
59  */
60  virtual ~CIbeoLuxETH();
61  /** This function acquire a laser scan from the device. If an error occured,
62  * hardwareError will be set to true.
63  * The new laser scan will be stored in the outObservation argument.
64  *
65  * \exception This method throw exception if the frame received from the
66  * LMS 100 contain the following bad parameters :
67  * * Status is not OK
68  * * Data in the scan aren't DIST1 (may be RSSIx or DIST2).
69  */
70  void doProcess();
71  void initialize();
72  void start();
73  void makeCommandHeader(unsigned char* buffer);
74  void makeStartCommand(unsigned char* buffer);
75  void makeStopCommand(unsigned char* buffer);
76  void makeTypeCommand(unsigned char* buffer);
77 
78  private:
80  unsigned int m_port;
82  unsigned int m_scanFrequency; // in hertz
83  double m_angleResolution; // in degrees
84  double m_startAngle; // degrees
85  double m_stopAngle; // degrees
87  double m_maxRange;
89  bool m_run;
90  void dataCollection();
91  std::thread dataCollectionThread;
92  double convertLayerToRad(int scanlayer);
93  double convertTicksToHRad(int hticks, int hticksPerRotation);
95  float vrad, float hrad, float distance);
96  float vwinkel;
97  std::vector<mrpt::obs::CObservation3DRangeScan> m_observations;
98  bool m_newObs;
99  float m_vAngle;
100  unsigned int lastScanNumber;
101  unsigned int curScanNumber;
102 
103  protected:
104  /** Load sensor pose on the robot, or keep the default sensor pose.
105  */
107  const mrpt::utils::CConfigFileBase& configSource,
108  const std::string& iniSection);
109 };
110 }
111 }
112 
113 #endif
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
A TCP socket that can be connected to a TCP server, implementing MRPT's CStream interface for passing...
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
This "software driver" implements the communication protocol for interfacing a Ibeo Lux laser scanner...
Definition: CIbeoLuxETH.h:46
void makeStopCommand(unsigned char *buffer)
virtual ~CIbeoLuxETH()
Destructor.
Definition: CIbeoLuxETH.cpp:47
void doProcess()
This function acquire a laser scan from the device.
CIbeoLuxETH(std::string _ip=std::string("10.152.36.93"), unsigned int _port=12002)
Constructor.
Definition: CIbeoLuxETH.cpp:37
mrpt::poses::CPoint3D convertToCartesian(float vrad, float hrad, float distance)
void initialize()
This method can or cannot be implemented in the derived class, depending on the need for it.
double convertTicksToHRad(int hticks, int hticksPerRotation)
std::vector< mrpt::obs::CObservation3DRangeScan > m_observations
Definition: CIbeoLuxETH.h:97
double convertLayerToRad(int scanlayer)
std::thread dataCollectionThread
Definition: CIbeoLuxETH.h:91
mrpt::poses::CPose3D m_sensorPose
Definition: CIbeoLuxETH.h:86
mrpt::comms::CClientTCPSocket m_client
Definition: CIbeoLuxETH.h:81
void makeCommandHeader(unsigned char *buffer)
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
Load sensor pose on the robot, or keep the default sensor pose.
void makeStartCommand(unsigned char *buffer)
void makeTypeCommand(unsigned char *buffer)
A class used to store a 3D point.
Definition: CPoint3D.h:33
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...
GLuint buffer
Definition: glext.h:3917
GLsizei const GLchar ** string
Definition: glext.h:4101
double distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space.
Definition: geometry.cpp:1885
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