Main MRPT website > C++ reference
MRPT logo
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-2014, 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  using namespace std;
23  using namespace mrpt::hwdrivers;
24  using namespace mrpt::utils;
25  using namespace mrpt::slam;
26 
27  /** This "software driver" implements the communication protocol for interfacing a Ibeo Lux laser scanners through an ethernet controller.
28  * This class does not need to be bind, i.e. you do not need to call C2DRangeFinderAbstract::bindIO.
29  * Connection is established when user call the turnOn() method. You can 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 and TCP Port of your device.
52  */
53  CIbeoLuxETH(string _ip=string("10.152.36.93"), unsigned int _port=12002);
54  /** Destructor.
55  * Close communcation with the device, and free memory.
56  */
57  virtual ~CIbeoLuxETH();
58  /** This function acquire a laser scan from the device. If an error occured, hardwareError will be set to true.
59  * The new laser scan will be stored in the outObservation argument.
60  *
61  * \exception This method throw exception if the frame received from the LMS 100 contain the following bad parameters :
62  * * Status is not OK
63  * * Data in the scan aren't DIST1 (may be RSSIx or DIST2).
64  */
65  void doProcess();
66  void initialize();
67  void start();
68  void makeCommandHeader(unsigned char* buffer);
69  void makeStartCommand(unsigned char* buffer);
70  void makeStopCommand(unsigned char* buffer);
71  void makeTypeCommand(unsigned char* buffer);
72 
73  private :
74  string m_ip;
75  unsigned int m_port;
77  unsigned int m_scanFrequency; // in hertz
78  double m_angleResolution; // in degrees
79  double m_startAngle; // degrees
80  double m_stopAngle; // degrees
82  double m_maxRange;
84  bool m_run;
85  void dataCollection();
87  float convertLayerToRad(int scanlayer);
88  float convertTicksToHRad(int hticks, int hticksPerRotation);
89  CPoint3D convertToCartesian(float vrad, float hrad, float distance);
90  float vwinkel;
91  vector<CObservation3DRangeScan> m_observations;
92  bool m_newObs;
93  float m_vAngle;
94  unsigned int lastScanNumber;
95  unsigned int curScanNumber;
96 
97  protected:
98  /** Load sensor pose on the robot, or keep the default sensor pose.
99  */
100  void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource,
101  const std::string &iniSection );
102 
103  };
104  }
105 }
106 
107 #endif
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
vector< CObservation3DRangeScan > m_observations
Definition: CIbeoLuxETH.h:91
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
Contains classes for various device interfaces.
STL namespace.
This namespace contains algorithms for SLAM, localization, map building, representation of robot's ac...
This "software driver" implements the communication protocol for interfacing a Ibeo Lux laser scanner...
Definition: CIbeoLuxETH.h:45
CClientTCPSocket m_client
Definition: CIbeoLuxETH.h:76
This class allows loading and storing values and vectors of different types from a configuration text...
mrpt::system::TThreadHandle dataCollectionThread
Definition: CIbeoLuxETH.h:86
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:69
This structure contains the information needed to interface the threads API on each platform: ...
Definition: threads.h:25
#define HWDRIVERS_IMPEXP
A TCP socket that can be connected to a TCP server, implementing MRPT's CStream interface for passing...
double BASE_IMPEXP distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space.



Page generated by Doxygen 1.8.8 for MRPT 1.2.2 SVN:Unversioned directory at Tue Oct 14 02:14:08 UTC 2014