Flair
Framework Libre Air
HokuyoUTM30Lx.h
Go to the documentation of this file.
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
13 #ifndef HOKUYOUTM30LX_H
14 #define HOKUYOUTM30LX_H
15 
16 #include <Thread.h>
17 #include <LaserRangeFinder.h>
18 #include <Mutex.h>
19 
20 #include <queue>
21 #include <vector>
22 
23 namespace flair {
24 namespace core {
25 class cvmatrix;
26 class FrameworkManager;
27 class SerialPort;
28 class Mutex;
29 }
30 namespace gui {
31 class Tab;
32 class TabWidget;
33 class RangeFinderPlot;
34 }
35 }
36 
37 namespace flair {
38 namespace sensor {
44 public:
55  HokuyoUTM30Lx(const core::FrameworkManager *parent, std::string name,
56  core::SerialPort *serialport, uint8_t priority);
57  void getMesure(int startStep, int endStep, int clusterCount, int interval,
58  int scanNumber = 0);
59  core::cvmatrix *getDatas(void);
60 
65  void UseDefaultPlot(void);
71 
72 private:
73  core::SerialPort *serialport;
74  core::Mutex *bufRetMut;
75  core::Mutex *sendingCmdMut;
76  gui::Tab *main_tab;
77  gui::TabWidget *tab;
79 
80  // matrix
81  core::cvmatrix *output;
82 
83  std::queue<std::string> bufRet;
84 
91  void Run(void);
98  std::string sendCommand(std::string command);
103  void startLaser(void);
108  void stopLaser(void);
113  void resetConfig(void);
120  void decodeDatas(std::vector<std::string> datas, int startStep);
127  static std::vector<std::string> explode(const std::string str,
128  char delimiter);
135  static int encodeSum(const char *code, int byte);
140  static bool checkSum(std::string data);
146  static float decode2car(const char *data);
152  static float decode3car(const char *data);
158  static float decode4car(const char *data);
159 
167  void UpdateFrom(const core::io_data *data){};
168 };
169 } // end namespace sensor
170 } // end namespace framewor
171 #endif // HOKUYOUTM30LX_H
Abstract class for data types.
Definition: io_data.h:94
Classe generique intégrant les telemetres laser.
Definition: LaserRangeFinder.h:38
namespace of the flair Framework
Definition: Ahrs.h:19
Class defining a matrix of kind CvMat.
Definition: cvmatrix.h:33
Class defining a mutex.
Definition: Mutex.h:29
Classe intégrant le telemetre laser Hokuyo UTM 30lx.
Definition: HokuyoUTM30Lx.h:43
Base class for serial port.
Definition: SerialPort.h:25
Main class of the Framework library.
Definition: FrameworkManager.h:45
Class displaying a QTabWidget on the ground station.
Definition: TabWidget.h:29
Abstract class for a thread.
void UseDefaultPlot(void)
Use default plot.
Abstract class for a thread.
Definition: Thread.h:38
Classe generique des telemetres laser.
Class displaying a 2D plot on the ground station for laser range finder like Hokuyo.
Definition: RangeFinderPlot.h:37
Class defining a mutex.
HokuyoUTM30Lx(const core::FrameworkManager *parent, std::string name, core::SerialPort *serialport, uint8_t priority)
Constructor.
Class displaying a QTab on the ground station.
Definition: Tab.h:29