Main MRPT website > C++ reference for MRPT 1.9.9
CSICKTim561Eth_2050101.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 
10 #ifndef _CSICKTIM561ETH_2050101_H__
11 #define _CSICKTIM561ETH_2050101_H__
12 
15 
16 namespace mrpt
17 {
18 namespace hwdrivers
19 {
21 {
23  public:
24  /** Constructor.
25  * Note that there is default arguments, here you can customize IP Adress
26  * and TCP Port of your device
27  */
29  std::string _ip = std::string("192.168.0.1"),
30  unsigned int _port = 2111);
31  /** Deconstructor.
32  * Close communication with the device, and free memory.
33  */
34  virtual ~CSICKTim561Eth();
35 
36  /** This function acquire a laser scan from the device. If an error occured,
37  * hardwareError will be set to true.
38  * The new laser scan will be stored in the outObservation argument.
39  *
40  * \exception This method throw exception if the frame received from the
41  * TIM 561 contain the following bad parameters:
42  * * Status is not OK
43  * * Data in the scan aren't DIST1(may be RSSIx or DIST2).
44  */
45  void doProcessSimple(
46  bool& outThereIsObservation,
47  mrpt::obs::CObservation2DRangeScan& outObservation,
48  bool& hardwareError);
49 
50  /**
51  * This method must be called before trying to get a laser scan.
52  */
53  bool turnOn();
54 
55  /**
56  * This method could be called manually to stop communication with the
57  * device. Method is also called by destructor.
58  */
59  bool turnOff();
60 
61  /**
62  * This method could be called manually to reboot the device.
63  */
64  bool rebootDev();
65 
66  /**
67  * A method to set the sensor pose on the robot.
68  * Equivalent to setting the sensor pose via loading it from a config file.
69  */
70  void setSensorPose(const mrpt::poses::CPose3D& _pose);
71 
72  /**
73  * This method must be called periodically. Period depend on the
74  * process_rate in the configuration file.
75  */
76  void doProcess();
77 
78  /** Initialize the sensor according to the parameters previously read
79  * in the configuration file.
80  */
81  void initialize();
82 
83  private:
85  unsigned int m_port;
87  bool m_turnedOn;
90  unsigned int m_scanFrequency; // Scanning Hertz
91  double m_angleResolution; // Degrees [0.0001, 1]
92  double m_startAngle; // the minimum startAngle is -45 degree
93  double m_stopAngle; // the maximum stopAngle is 225 degree
95  double m_maxRange; // 10 meter is the range official suggested
96  double m_beamApperture; // the range bewteen m_startAngle to m_stopAngle
97 
98  void generateCmd(const char* cmd); // According to communication protocol
99  bool checkIsConnected(); // Check the status about Lidar connection
100  bool decodeLogIn(char* msg);
101  bool decodeScanCfg(std::istringstream& stream);
102  bool decodeScan(
103  char* buf, mrpt::obs::CObservation2DRangeScan& outObservation);
104  void sendCommand(const char* cmd);
105  void roughPrint(char* msg);
106 
107  protected:
108  /** Load sensor pose on the robot, or keep the default sensor pose.
109  */
111  const mrpt::config::CConfigFileBase& configSource,
112  const std::string& iniSection);
113 };
114 } // namespace hwdrivers
115 } // namespace mrpt
116 
117 #endif // _CSICKTIM561ETH_2050101_H__
CClientTCPSocket.h
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::CSICKTim561Eth::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: CSICKTim561Eth_2050101.cpp:70
mrpt::hwdrivers::CSICKTim561Eth::m_beamApperture
double m_beamApperture
Definition: CSICKTim561Eth_2050101.h:96
mrpt::hwdrivers::CSICKTim561Eth::m_cmd
std::string m_cmd
Definition: CSICKTim561Eth_2050101.h:88
mrpt::hwdrivers::CSICKTim561Eth::doProcess
void doProcess()
This method must be called periodically.
Definition: CSICKTim561Eth_2050101.cpp:513
mrpt::hwdrivers::CSICKTim561Eth::CSICKTim561Eth
CSICKTim561Eth(std::string _ip=std::string("192.168.0.1"), unsigned int _port=2111)
Constructor.
Definition: CSICKTim561Eth_2050101.cpp:37
mrpt::obs::CObservation2DRangeScan
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
Definition: CObservation2DRangeScan.h:56
mrpt::hwdrivers::CSICKTim561Eth::m_sensorPose
mrpt::poses::CPose3D m_sensorPose
Definition: CSICKTim561Eth_2050101.h:94
mrpt::hwdrivers::CSICKTim561Eth::roughPrint
void roughPrint(char *msg)
mrpt::hwdrivers::CSICKTim561Eth::~CSICKTim561Eth
virtual ~CSICKTim561Eth()
Deconstructor.
Definition: CSICKTim561Eth_2050101.cpp:51
mrpt::hwdrivers::CSICKTim561Eth::initialize
void initialize()
Initialize the sensor according to the parameters previously read in the configuration file.
Definition: CSICKTim561Eth_2050101.cpp:58
mrpt::hwdrivers::CSICKTim561Eth::setSensorPose
void setSensorPose(const mrpt::poses::CPose3D &_pose)
A method to set the sensor pose on the robot.
Definition: CSICKTim561Eth_2050101.cpp:546
mrpt::hwdrivers::CSICKTim561Eth::m_maxRange
double m_maxRange
Definition: CSICKTim561Eth_2050101.h:95
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
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::CSICKTim561Eth::m_port
unsigned int m_port
Definition: CSICKTim561Eth_2050101.h:85
mrpt::hwdrivers::CSICKTim561Eth::turnOn
bool turnOn()
This method must be called before trying to get a laser scan.
Definition: CSICKTim561Eth_2050101.cpp:168
mrpt::hwdrivers::CSICKTim561Eth::m_startAngle
double m_startAngle
Definition: CSICKTim561Eth_2050101.h:92
mrpt::hwdrivers::CSICKTim561Eth::generateCmd
void generateCmd(const char *cmd)
Definition: CSICKTim561Eth_2050101.cpp:382
mrpt::hwdrivers::C2DRangeFinderAbstract
This is the base, abstract class for "software drivers" interfaces to 2D scanners (laser range finder...
Definition: C2DRangeFinderAbstract.h:43
mrpt::hwdrivers::CSICKTim561Eth::doProcessSimple
void doProcessSimple(bool &outThereIsObservation, mrpt::obs::CObservation2DRangeScan &outObservation, bool &hardwareError)
This function acquire a laser scan from the device.
Definition: CSICKTim561Eth_2050101.cpp:475
mrpt::hwdrivers::CSICKTim561Eth::checkIsConnected
bool checkIsConnected()
Definition: CSICKTim561Eth_2050101.cpp:95
mrpt::hwdrivers::CSICKTim561Eth::m_client
mrpt::comms::CClientTCPSocket m_client
Definition: CSICKTim561Eth_2050101.h:86
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::CSICKTim561Eth::m_turnedOn
bool m_turnedOn
Definition: CSICKTim561Eth_2050101.h:87
mrpt::hwdrivers::CSICKTim561Eth::sendCommand
void sendCommand(const char *cmd)
Definition: CSICKTim561Eth_2050101.cpp:373
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
mrpt::hwdrivers::CSICKTim561Eth::m_connected
bool m_connected
Definition: CSICKTim561Eth_2050101.h:89
mrpt::hwdrivers::CSICKTim561Eth
Definition: CSICKTim561Eth_2050101.h:20
mrpt::hwdrivers::CSICKTim561Eth::decodeLogIn
bool decodeLogIn(char *msg)
mrpt::hwdrivers::CSICKTim561Eth::decodeScan
bool decodeScan(char *buf, mrpt::obs::CObservation2DRangeScan &outObservation)
Definition: CSICKTim561Eth_2050101.cpp:393
mrpt::hwdrivers::CSICKTim561Eth::turnOff
bool turnOff()
This method could be called manually to stop communication with the device.
Definition: CSICKTim561Eth_2050101.cpp:160
mrpt::hwdrivers::CSICKTim561Eth::m_stopAngle
double m_stopAngle
Definition: CSICKTim561Eth_2050101.h:93
mrpt::hwdrivers::CSICKTim561Eth::m_scanFrequency
unsigned int m_scanFrequency
Definition: CSICKTim561Eth_2050101.h:90
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::hwdrivers::CSICKTim561Eth::m_angleResolution
double m_angleResolution
Definition: CSICKTim561Eth_2050101.h:91
mrpt::hwdrivers::CSICKTim561Eth::rebootDev
bool rebootDev()
This method could be called manually to reboot the device.
Definition: CSICKTim561Eth_2050101.cpp:119
mrpt::hwdrivers::CSICKTim561Eth::decodeScanCfg
bool decodeScanCfg(std::istringstream &stream)
mrpt::hwdrivers::CSICKTim561Eth::m_ip
std::string m_ip
Definition: CSICKTim561Eth_2050101.h:84
C2DRangeFinderAbstract.h



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