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  // returns the FPGA version
105  std::string getFPGAVersion();
106 
107  // returns the sensor temperature in degree celsius
108  double getTemperature();
109 
110  // Function will be called if the scanner loses its tcp connection.
111  static void disconnectFunctionS(void* obj);
112 
113  // Function callback to be invoked when a scan was received.
114  static void onScanReceivedS(void* obj);
115 
116  // Write a field to the sensor.
117  bool writeField(UINT16 fieldNum, const FieldParameter& para);
118 
119  // Write the EvalCases to the sensor.
120  bool writeEvalCases(const EvalCases& evalCases);
121 
122  // Stores the SOPAS config data (fields and eval cases) permanently.
123  bool flashSopasConfig();
124 };
125 
126 } // namespace devices
127 
128 #endif // LDMRS_HPP
UINT16
uint16_t UINT16
Definition: BasicDatatypes.hpp:27
devices::LDMRS::m_offsetX
double m_offsetX
Definition: LD_MRS.hpp:51
datatypes::EvalCases
Definition: EvalCases.hpp:21
devices
Definition: BasicDevice.cpp:8
devices::LDMRS::m_rollAngle
double m_rollAngle
Definition: LD_MRS.hpp:56
devices::LDMRS::m_SopasPortNumber
UINT16 m_SopasPortNumber
Definition: LD_MRS.hpp:44
devices::LDMRS::m_beVerbose
bool m_beVerbose
Definition: LD_MRS.hpp:32
devices::LDMRS::m_pitchAngle
double m_pitchAngle
Definition: LD_MRS.hpp:55
devices::LDMRS::m_readOnlyMode
bool m_readOnlyMode
Definition: LD_MRS.hpp:41
devices::LDMRS::m_yawAngle
double m_yawAngle
Definition: LD_MRS.hpp:54
devices::LDMRS::m_isRunning
bool m_isRunning
Definition: LD_MRS.hpp:33
devices::LDMRS::m_weWantFieldData
bool m_weWantFieldData
Definition: LD_MRS.hpp:37
devices::LDMRS::m_scanEndAngle
double m_scanEndAngle
Definition: LD_MRS.hpp:50
LuxBase.hpp
datatypes::FieldParameter
Definition: FieldParameter.hpp:24
BasicDevice.hpp
devices::MrsParameterId
MrsParameterId
Definition: LuxBase.hpp:51
devices::LDMRS::m_manager
Manager * m_manager
Definition: LD_MRS.hpp:28
devices::LDMRS::m_lux
LuxBase * m_lux
Definition: LD_MRS.hpp:30
Manager
Definition: manager.hpp:18
devices::LDMRS::m_scanFrequency
double m_scanFrequency
Definition: LD_MRS.hpp:48
devices::BasicDevice
Definition: BasicDevice.hpp:16
devices::LDMRS::m_weWantObjectData
bool m_weWantObjectData
Definition: LD_MRS.hpp:38
devices::LuxBase
Definition: LuxBase.hpp:129
devices::LDMRS::m_offsetY
double m_offsetY
Definition: LD_MRS.hpp:52
devices::LDMRS::m_weWantScanDataFromSopas
bool m_weWantScanDataFromSopas
Definition: LD_MRS.hpp:39
devices::LDMRS
Definition: LD_MRS.hpp:24
devices::LDMRS::m_luxPortNumber
UINT16 m_luxPortNumber
Definition: LD_MRS.hpp:43
devices::LDMRS::m_weWantScanData
bool m_weWantScanData
Definition: LD_MRS.hpp:36
UINT32
uint32_t UINT32
Definition: BasicDatatypes.hpp:26
devices::LDMRS::m_sopas
LdmrsSopasLayer * m_sopas
Definition: LD_MRS.hpp:29
devices::LDMRS::m_offsetZ
double m_offsetZ
Definition: LD_MRS.hpp:53
devices::LdmrsSopasLayer
Definition: LdmrsSopasLayer.hpp:27
devices::LDMRS::m_ipAddress
std::string m_ipAddress
Definition: LD_MRS.hpp:42
devices::LDMRS::m_inputFileName
std::string m_inputFileName
Definition: LD_MRS.hpp:45
devices::LDMRS::m_scanStartAngle
double m_scanStartAngle
Definition: LD_MRS.hpp:49
datatypes
Definition: BasicDatatypes.hpp:91


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Wed Oct 26 2022 02:11:57