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



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020