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 Matrix;
26 class SerialPort;
27 class Mutex;
28 }
29 namespace gui {
30 class Tab;
31 class TabWidget;
32 class RangeFinderPlot;
33 }
34 }
35 
36 namespace flair {
37 namespace sensor {
43 public:
54  HokuyoUTM30Lx(std::string name,
55  core::SerialPort *serialport, uint8_t priority);
56  void getMesure(int startStep, int endStep, int clusterCount, int interval,
57  int scanNumber = 0);
58  core::Matrix *getDatas(void);
59 
64  void UseDefaultPlot(void);
70 
71 private:
72  core::SerialPort *serialport;
73  core::Mutex *bufRetMut;
74  core::Mutex *sendingCmdMut;
75  gui::Tab *main_tab;
76  gui::TabWidget *tab;
78 
79  // matrix
80  core::Matrix *output;
81 
82  std::queue<std::string> bufRet;
83 
90  void Run(void);
97  std::string sendCommand(std::string command);
102  void startLaser(void);
107  void stopLaser(void);
112  void resetConfig(void);
119  void decodeDatas(std::vector<std::string> datas, int startStep);
126  static std::vector<std::string> explode(const std::string str,
127  char delimiter);
134  static int encodeSum(const char *code, int byte);
139  static bool checkSum(std::string data);
145  static float decode2car(const char *data);
151  static float decode3car(const char *data);
157  static float decode4car(const char *data);
158 
166  void UpdateFrom(const core::io_data *data){};
167 };
168 } // end namespace sensor
169 } // end namespace flair
170 #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 mutex.
Definition: Mutex.h:29
Classe intégrant le telemetre laser Hokuyo UTM 30lx.
Definition: HokuyoUTM30Lx.h:42
Base class for serial port.
Definition: SerialPort.h:25
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(std::string name, core::SerialPort *serialport, uint8_t priority)
Constructor.
Class defining a matrix.
Definition: Matrix.h:31
Class displaying a QTab on the ground station.
Definition: Tab.h:29