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-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 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::config::CConfigFileBase& configSource,
108  const std::string& iniSection);
109 };
110 }
111 }
112 
113 #endif
mrpt::hwdrivers::CIbeoLuxETH::m_stopAngle
double m_stopAngle
Definition: CIbeoLuxETH.h:85
CClientTCPSocket.h
mrpt::hwdrivers::CIbeoLuxETH::m_vAngle
float m_vAngle
Definition: CIbeoLuxETH.h:99
mrpt::comms::CClientTCPSocket
A TCP socket that can be connected to a TCP server, implementing MRPT's CStream interface for passing...
Definition: CClientTCPSocket.h:34
mrpt::hwdrivers::CIbeoLuxETH::m_run
bool m_run
Definition: CIbeoLuxETH.h:89
mrpt::hwdrivers::CIbeoLuxETH::lastScanNumber
unsigned int lastScanNumber
Definition: CIbeoLuxETH.h:100
mrpt::hwdrivers::CIbeoLuxETH::~CIbeoLuxETH
virtual ~CIbeoLuxETH()
Destructor.
Definition: CIbeoLuxETH.cpp:46
mrpt::hwdrivers::CIbeoLuxETH::dataCollectionThread
std::thread dataCollectionThread
Definition: CIbeoLuxETH.h:91
mrpt::hwdrivers::CIbeoLuxETH::m_startAngle
double m_startAngle
Definition: CIbeoLuxETH.h:84
mrpt::hwdrivers::CIbeoLuxETH
This "software driver" implements the communication protocol for interfacing a Ibeo Lux laser scanner...
Definition: CIbeoLuxETH.h:45
mrpt::hwdrivers::CIbeoLuxETH::m_angleResolution
double m_angleResolution
Definition: CIbeoLuxETH.h:83
mrpt::hwdrivers::CIbeoLuxETH::initialize
void initialize()
This method can or cannot be implemented in the derived class, depending on the need for it.
Definition: CIbeoLuxETH.cpp:362
mrpt::hwdrivers::CIbeoLuxETH::loadConfig_sensorSpecific
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection)
Load sensor pose on the robot, or keep the default sensor pose.
Definition: CIbeoLuxETH.cpp:270
mrpt::hwdrivers::CIbeoLuxETH::m_observations
std::vector< mrpt::obs::CObservation3DRangeScan > m_observations
Definition: CIbeoLuxETH.h:97
mrpt::hwdrivers::CIbeoLuxETH::dataCollection
void dataCollection()
Definition: CIbeoLuxETH.cpp:56
CObservation3DRangeScan.h
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::math::distance
double distance(const TPoint2D &p1, const TPoint2D &p2)
Gets the distance between two points in a 2D space.
Definition: geometry.cpp:1891
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::CIbeoLuxETH::convertLayerToRad
double convertLayerToRad(int scanlayer)
Definition: CIbeoLuxETH.cpp:242
mrpt::hwdrivers::CIbeoLuxETH::makeCommandHeader
void makeCommandHeader(unsigned char *buffer)
Definition: CIbeoLuxETH.cpp:291
mrpt::hwdrivers::CIbeoLuxETH::m_beamApperture
double m_beamApperture
Definition: CIbeoLuxETH.h:88
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:44
mrpt::hwdrivers::CIbeoLuxETH::convertToCartesian
mrpt::poses::CPoint3D convertToCartesian(float vrad, float hrad, float distance)
Definition: CIbeoLuxETH.cpp:219
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
CGenericSensor.h
mrpt::hwdrivers::CGenericSensor
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
Definition: CGenericSensor.h:70
mrpt::hwdrivers::CIbeoLuxETH::makeStopCommand
void makeStopCommand(unsigned char *buffer)
Definition: CIbeoLuxETH.cpp:331
mrpt::hwdrivers::CIbeoLuxETH::m_maxRange
double m_maxRange
Definition: CIbeoLuxETH.h:87
mrpt::hwdrivers::CIbeoLuxETH::convertTicksToHRad
double convertTicksToHRad(int hticks, int hticksPerRotation)
Definition: CIbeoLuxETH.cpp:237
mrpt::hwdrivers::CIbeoLuxETH::m_port
unsigned int m_port
Definition: CIbeoLuxETH.h:80
buffer
GLuint buffer
Definition: glext.h:3917
mrpt::hwdrivers::CIbeoLuxETH::m_ip
std::string m_ip
Definition: CIbeoLuxETH.h:79
CPoint3D.h
CPose3D.h
mrpt::hwdrivers::CIbeoLuxETH::m_client
mrpt::comms::CClientTCPSocket m_client
Definition: CIbeoLuxETH.h:81
mrpt::hwdrivers::CIbeoLuxETH::CIbeoLuxETH
CIbeoLuxETH(std::string _ip=std::string("10.152.36.93"), unsigned int _port=12002)
Constructor.
Definition: CIbeoLuxETH.cpp:36
mrpt::hwdrivers::CIbeoLuxETH::start
void start()
mrpt::hwdrivers::CIbeoLuxETH::curScanNumber
unsigned int curScanNumber
Definition: CIbeoLuxETH.h:101
mrpt::hwdrivers::CIbeoLuxETH::vwinkel
float vwinkel
Definition: CIbeoLuxETH.h:96
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::hwdrivers::CIbeoLuxETH::m_scanFrequency
unsigned int m_scanFrequency
Definition: CIbeoLuxETH.h:82
mrpt::hwdrivers::CIbeoLuxETH::m_sensorPose
mrpt::poses::CPose3D m_sensorPose
Definition: CIbeoLuxETH.h:86
mrpt::hwdrivers::CIbeoLuxETH::doProcess
void doProcess()
This function acquire a laser scan from the device.
Definition: CIbeoLuxETH.cpp:376
mrpt::poses::CPoint3D
A class used to store a 3D point.
Definition: CPoint3D.h:33
mrpt::hwdrivers::CIbeoLuxETH::m_newObs
bool m_newObs
Definition: CIbeoLuxETH.h:98
mrpt::hwdrivers::CIbeoLuxETH::makeTypeCommand
void makeTypeCommand(unsigned char *buffer)
Definition: CIbeoLuxETH.cpp:342
mrpt::hwdrivers::CIbeoLuxETH::makeStartCommand
void makeStartCommand(unsigned char *buffer)
Definition: CIbeoLuxETH.cpp:320



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