LD_MRS.hpp
Go to the documentation of this file.
1 //
2 // LD_MRS.hpp
3 // Device class of the LD-MRS class Laserscanners.
4 //
5 #ifndef LDMRS_HPP
6 #define LDMRS_HPP
7 
8 #include "../BasicDatatypes.hpp"
9 #include "BasicDevice.hpp"
10 #include "../manager.hpp"
11 
12 //#include "../sopas/SopasBase.hpp"
13 #include "../sopas/LdmrsSopasLayer.hpp"
14 #include "LuxBase.hpp"
15 
16 #include "../interfaces/tcp.hpp"
17 
18 namespace devices
19 {
20 
21 using namespace datatypes;
22 
23 
24 class LDMRS: public BasicDevice
25 {
26 
27 private:
31 
34 
35  // Config data for LDMRS
40 
42  std::string m_ipAddress;
45  std::string m_inputFileName;
46 
47  // Config data for LuxBase
51  double m_offsetX;
52  double m_offsetY;
53  double m_offsetZ;
54  double m_yawAngle;
55  double m_pitchAngle;
56  double m_rollAngle;
57 
58 protected:
59  void disconnectFunction();
60  void onScanReceived();
61 
62 public:
63  LDMRS(Manager* manager);
64  ~LDMRS();
65 
66  // Inherited from device
67  virtual bool init();
68  virtual void shutdown();
69  virtual bool run();
70  virtual bool stop();
71  virtual bool isRunning();
72 
73  // returns true if command succeeded.
74  bool getParameter(MrsParameterId id, UINT32* value);
75 
76  // returns true if command succeeded.
77  bool setParameter(MrsParameterId id, UINT32 value);
78 
79  // Sets the MRS-internal clock to the given time.
80  bool setNtpTime(UINT32 seconds, UINT32 fractionalSec);
81 
82  // Sets scan start and end angles.
83  bool setScanAngles(double startAngle, double endAngle);
84 
85  // Sets sync angle offset.
86  bool setSyncAngleOffset(double syncAngle);
87 
88  // Sets scan frequency.
89  // valid values are 12.5, 25.0 and 50.0 [Hz].
90  bool setScanFrequency(double scanFreq);
91 
92  std::string getIpAddress();
93 
94  void setIpAddress(std::string ipAddress);
95 
96  void setWeWantObjectData(bool weWantObjectData);
97 
98  // returns the serial number
99  std::string getSerialNumber();
100 
101  // returns the firmware version
102  std::string getFirmwareVersion();
103 
104  // Function will be called if the scanner loses its tcp connection.
105  static void disconnectFunctionS(void* obj);
106 
107  // Function callback to be invoked when a scan was received.
108  static void onScanReceivedS(void* obj);
109 
110  // Write a field to the sensor.
111  bool writeField(UINT16 fieldNum, const FieldParameter& para);
112 
113  // Write the EvalCases to the sensor.
114  bool writeEvalCases(const EvalCases& evalCases);
115 
116  // Stores the SOPAS config data (fields and eval cases) permanently.
117  bool flashSopasConfig();
118 };
119 
120 } // namespace devices
121 
122 #endif // LDMRS_HPP
Manager * m_manager
Definition: LD_MRS.hpp:28
uint16_t UINT16
double m_scanFrequency
Definition: LD_MRS.hpp:48
bool m_weWantScanDataFromSopas
Definition: LD_MRS.hpp:39
bool m_weWantScanData
Definition: LD_MRS.hpp:36
LuxBase * m_lux
Definition: LD_MRS.hpp:30
uint32_t UINT32
double m_offsetY
Definition: LD_MRS.hpp:52
LdmrsSopasLayer * m_sopas
Definition: LD_MRS.hpp:29
MrsParameterId
Definition: LuxBase.hpp:51
bool m_weWantObjectData
Definition: LD_MRS.hpp:38
double m_scanStartAngle
Definition: LD_MRS.hpp:49
std::string m_inputFileName
Definition: LD_MRS.hpp:45
UINT16 m_luxPortNumber
Definition: LD_MRS.hpp:43
double m_offsetZ
Definition: LD_MRS.hpp:53
std::string m_ipAddress
Definition: LD_MRS.hpp:42
double m_offsetX
Definition: LD_MRS.hpp:51
double m_yawAngle
Definition: LD_MRS.hpp:54
double m_rollAngle
Definition: LD_MRS.hpp:56
UINT16 m_SopasPortNumber
Definition: LD_MRS.hpp:44
bool m_weWantFieldData
Definition: LD_MRS.hpp:37
bool m_beVerbose
Definition: LD_MRS.hpp:32
bool m_readOnlyMode
Definition: LD_MRS.hpp:41
bool m_isRunning
Definition: LD_MRS.hpp:33
double m_pitchAngle
Definition: LD_MRS.hpp:55
double m_scanEndAngle
Definition: LD_MRS.hpp:50


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Sat Jun 8 2019 17:57:33