Main MRPT website > C++ reference for MRPT 1.4.0
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-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 CIbeoLuxETH_H
10#define CIbeoLuxETH_H
11
13#include <mrpt/poses/CPose3D.h>
14#include <mrpt/poses/CPoint3D.h>
17
18namespace 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 :
69 std::string m_ip;
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;
82 float convertLayerToRad(int scanlayer);
83 float 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;
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
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
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:41
void makeStopCommand(unsigned char *buffer)
mrpt::poses::CPoint3D convertToCartesian(float vrad, float hrad, float distance)
float convertLayerToRad(int scanlayer)
void initialize()
This method can or cannot be implemented in the derived class, depending on the need for it.
CIbeoLuxETH(std::string _ip=std::string("10.152.36.93"), unsigned int _port=12002)
Constructor.
mrpt::system::TThreadHandle dataCollectionThread
Definition CIbeoLuxETH.h:81
float convertTicksToHRad(int hticks, int hticksPerRotation)
void doProcess()
This function acquire a laser scan from the device.
void makeStartCommand(unsigned char *buffer)
void makeCommandHeader(unsigned char *buffer)
void makeTypeCommand(unsigned char *buffer)
std::vector< mrpt::obs::CObservation3DRangeScan > m_observations
Definition CIbeoLuxETH.h:86
mrpt::poses::CPose3D m_sensorPose
Definition CIbeoLuxETH.h:76
virtual ~CIbeoLuxETH()
Destructor.
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
Load sensor pose on the robot, or keep the default sensor pose.
mrpt::utils::CClientTCPSocket m_client
Definition CIbeoLuxETH.h:71
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:73
A TCP socket that can be connected to a TCP server, implementing MRPT's CStream interface for passing...
This class allows loading and storing values and vectors of different types from a configuration text...
#define HWDRIVERS_IMPEXP
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
This structure contains the information needed to interface the threads API on each platform:
Definition threads.h:26



Page generated by Doxygen 1.9.7 for MRPT 1.4.0 SVN: at Tue Jun 13 14:10:35 UTC 2023