TactigonDoc  1.3 - 2018-28-12
Documentation of Tactigon libraries exposed in Arduino IDE
tactigon_BGDM.h
1 
2 
3 #ifndef TACTIGON_BGDM_H_
4 #define TACTIGON_BGDM_H_
5 
6 
7 extern void printToArduino(char *p);
8 
9 
10 /****************************************************************************/
17 typedef void (*BGDM_evt_cb)(uint8_t *pData, uint8_t dataLen);
18 
19 
20 
21 
23 class Gesture_params
24 {
25 
26 };
29 /************************************************/
32 class ROLL_ROT_params : public Gesture_params
33 {
34  public:
35  int threshold;
36  int stillTime;
37 };
38 
39 /************************************************/
42 class PITCH_ROT_params : public Gesture_params
43 {
44  public:
45  int threshold;
46  int stillTime;
47 };
48 
49 /************************************************/
52 class YAW_ROT_params : public Gesture_params
53 {
54  public:
55  int threshold;
56  int stillTime;
57 };
58 
59 
60 /************************************************/
63 class GenMov_X_params : public Gesture_params
64 {
65  public:
66  float threshold;
67  unsigned int stillTime;
68  unsigned int angleNormalized;
69 };
70 
71 /************************************************/
74 class GenMov_Y_params : public Gesture_params
75 {
76  public:
77  float threshold;
78  unsigned int stillTime;
79  unsigned int angleNormalized;
80 };
81 
82 
83 /************************************************/
86 class GenMov_Z_params : public Gesture_params
87 {
88  public:
89  float threshold;
90  unsigned int stillTime;
91  unsigned int angleNormalized;
92 };
93 
94 
95 /************************************************/
98 class GenRot_X_params : public Gesture_params
99 {
100  public:
101  float threshold;
102  unsigned int stillTime;
103 };
104 
105 /************************************************/
108 class GenRot_Y_params : public Gesture_params
109 {
110  public:
111  float threshold;
112  unsigned int stillTime;
113 };
114 
115 /************************************************/
118 class GenRot_Z_params : public Gesture_params
119 {
120  public:
121  float threshold;
122  unsigned int stillTime;
123 };
124 
125 
126 
127 
128 
129 /************************************************/
133 class Gesture
134 {
135  public:
136  BGDM_evt_cb cb;
137  virtual void setParams(void *) {};
138  virtual void printPar(void) = 0;
139  virtual void evalGest(void) = 0;
140 };
146 /************************************************/
149 class T_BGDM
150 {
151  public:
156  {
169  ALL,
170  HALT
171  };
172 
173 
174 
175 
176  /****************************************************************************/
179  T_BGDM(void);
180 
181 
182  /****************************************************************************/
185  void enable(BGDM_gestures gestureToEnable);
186 
187 
188  /****************************************************************************/
191  void engineRun(void);
192 
193 
194  /****************************************************************************/
197  int configGest(BGDM_gestures gestureID, Gesture_params *pPar);
198 
199  /****************************************************************************/
203  int installEventCB(BGDM_gestures gestureID, BGDM_evt_cb pCBFuncPointer);
204 
205 
206  BGDM_evt_cb haltCB;
207 
208  private:
209  unsigned char m_enabledGestures[ALL];
210 
211  Gesture *m_GestArray[ALL];
212 
213 
214 };
215 
216 
217 
218 
220 /************************************************/
223 class Roll_Gesture : public Gesture
224 {
225  public:
226  Roll_Gesture(T_BGDM *pEngine);
227  void setParams(void *);
228  void printPar(void);
229  void evalGest(void);
230 
231  ROLL_ROT_params params;
232 
233  private:
234 
235  typedef enum
236  {
237  STILL,
238  EVENT,
239  WAIT_FOR_STILL,
240  EVENT_HALT
241  }
242  eSTATS_MACHINE;
243 
244  unsigned int m_stillTimeStart;
245  eSTATS_MACHINE m_stat;
246  unsigned int m_HST_FACT_PERC;
247  unsigned int m_STILL_TIME;
248 
249  T_BGDM *m_pEngine;
250 };
251 
252 
253 /************************************************/
256 class Pitch_Gesture : public Gesture
257 {
258  public:
259  Pitch_Gesture(T_BGDM *pEngine);
260  void setParams(void *);
261  void printPar(void);
262  void evalGest(void);
263 
264  PITCH_ROT_params params;
265 
266  private:
267 
268  typedef enum
269  {
270  STILL,
271  EVENT,
272  WAIT_FOR_STILL,
273  EVENT_HALT
274  }
275  eSTATS_MACHINE;
276 
277  unsigned int m_stillTimeStart;
278  eSTATS_MACHINE m_stat;
279  unsigned int m_HST_FACT_PERC;
280  unsigned int m_STILL_TIME;
281 
282  T_BGDM *m_pEngine;
283 };
284 
285 
286 /************************************************/
289 class Yaw_Gesture : public Gesture
290 {
291  public:
292  Yaw_Gesture(T_BGDM *pEngine);
293  void setParams(void *);
294  void printPar(void);
295  void evalGest(void);
296 
297  YAW_ROT_params params;
298 
299  private:
300 
301  typedef enum
302  {
303  FIRST_TIME,
304  STILL,
305  EVENT,
306  WAIT_FOR_STILL,
307  EVENT_HALT
308  }
309  eSTATS_MACHINE;
310 
311  unsigned int m_stillTimeStart;
312  eSTATS_MACHINE m_stat;
313  unsigned int m_HST_FACT_PERC;
314  unsigned int m_STILL_TIME;
315  float m_prevYaw;
316  float m_yawZero;
317 
318  T_BGDM *m_pEngine;
319 };
320 
321 
322 
323 /************************************************/
326 class GenMov_X_Gesture : public Gesture
327 {
328  public:
329  GenMov_X_Gesture(T_BGDM *pEngine);
330  void setParams(void *);
331  void printPar(void);
332  void evalGest(void);
333 
334  GenMov_X_params params;
335 
336  private:
337 
338  typedef enum
339  {
340  STILL,
341  EVENT,
342  WAIT_FOR_STILL,
343  EVENT_HALT
344  }
345  eSTATS_MACHINE;
346 
347  unsigned int m_stillTimeStart;
348  eSTATS_MACHINE m_stat;
349  unsigned int m_HST_FACT_PERC;
350 
351  T_BGDM *m_pEngine;
352 };
353 
354 
355 /************************************************/
358 class GenMov_Y_Gesture : public Gesture
359 {
360  public:
361  GenMov_Y_Gesture(T_BGDM *pEngine);
362  void setParams(void *);
363  void printPar(void);
364  void evalGest(void);
365 
366  GenMov_Y_params params;
367 
368  private:
369 
370  typedef enum
371  {
372  STILL,
373  EVENT,
374  WAIT_FOR_STILL,
375  EVENT_HALT
376  }
377  eSTATS_MACHINE;
378 
379  unsigned int m_stillTimeStart;
380  eSTATS_MACHINE m_stat;
381  unsigned int m_HST_FACT_PERC;
382 
383  T_BGDM *m_pEngine;
384 };
385 
386 /************************************************/
389 class GenMov_Z_Gesture : public Gesture
390 {
391  public:
392  GenMov_Z_Gesture(T_BGDM *pEngine);
393  void setParams(void *);
394  void printPar(void);
395  void evalGest(void);
396 
397  GenMov_Z_params params;
398 
399  private:
400 
401  typedef enum
402  {
403  STILL,
404  EVENT,
405  WAIT_FOR_STILL,
406  EVENT_HALT
407  }
408  eSTATS_MACHINE;
409 
410  unsigned int m_stillTimeStart;
411  eSTATS_MACHINE m_stat;
412  unsigned int m_HST_FACT_PERC;
413 
414  T_BGDM *m_pEngine;
415 };
416 
417 
418 
419 /************************************************/
422 class GenRot_X_Gesture : public Gesture
423 {
424  public:
425  GenRot_X_Gesture(T_BGDM *pEngine);
426  void setParams(void *);
427  void printPar(void);
428  void evalGest(void);
429 
430  GenRot_X_params params;
431 
432  private:
433 
434  typedef enum
435  {
436  STILL,
437  EVENT,
438  WAIT_FOR_STILL,
439  EVENT_HALT
440  }
441  eSTATS_MACHINE;
442 
443  unsigned int m_stillTimeStart;
444  eSTATS_MACHINE m_stat;
445  unsigned int m_HST_FACT_PERC;
446 
447  T_BGDM *m_pEngine;
448 };
449 
450 /************************************************/
453 class GenRot_Y_Gesture : public Gesture
454 {
455  public:
456  GenRot_Y_Gesture(T_BGDM *pEngine);
457  void setParams(void *);
458  void printPar(void);
459  void evalGest(void);
460 
461  GenRot_Y_params params;
462 
463  private:
464 
465  typedef enum
466  {
467  STILL,
468  EVENT,
469  WAIT_FOR_STILL,
470  EVENT_HALT
471  }
472  eSTATS_MACHINE;
473 
474  unsigned int m_stillTimeStart;
475  eSTATS_MACHINE m_stat;
476  unsigned int m_HST_FACT_PERC;
477 
478  T_BGDM *m_pEngine;
479 };
480 
481 /************************************************/
484 class GenRot_Z_Gesture : public Gesture
485 {
486  public:
487  GenRot_Z_Gesture(T_BGDM *pEngine);
488  void setParams(void *);
489  void printPar(void);
490  void evalGest(void);
491 
492  GenRot_Z_params params;
493 
494  private:
495 
496  typedef enum
497  {
498  STILL,
499  EVENT,
500  WAIT_FOR_STILL,
501  EVENT_HALT
502  }
503  eSTATS_MACHINE;
504 
505  unsigned int m_stillTimeStart;
506  eSTATS_MACHINE m_stat;
507  unsigned int m_HST_FACT_PERC;
508 
509  T_BGDM *m_pEngine;
510 };
511 
514 #endif
515 
516 
517 
518 
519 
520 
unsigned int stillTime
Definition: tactigon_BGDM.h:102
Definition: tactigon_BGDM.h:52
int threshold
Definition: tactigon_BGDM.h:45
unsigned int stillTime
Definition: tactigon_BGDM.h:112
Definition: tactigon_BGDM.h:42
unsigned int angleNormalized
Definition: tactigon_BGDM.h:68
Definition: tactigon_BGDM.h:165
int stillTime
Definition: tactigon_BGDM.h:46
unsigned int angleNormalized
Definition: tactigon_BGDM.h:91
int threshold
Definition: tactigon_BGDM.h:35
float threshold
Definition: tactigon_BGDM.h:101
Definition: tactigon_BGDM.h:108
Definition: tactigon_BGDM.h:118
Definition: tactigon_BGDM.h:98
Definition: tactigon_BGDM.h:86
Definition: tactigon_BGDM.h:74
Definition: tactigon_BGDM.h:63
Definition: tactigon_BGDM.h:32
Definition: tactigon_BGDM.h:161
unsigned int stillTime
Definition: tactigon_BGDM.h:67
unsigned int stillTime
Definition: tactigon_BGDM.h:90
float threshold
Definition: tactigon_BGDM.h:121
Definition: tactigon_BGDM.h:167
int stillTime
Definition: tactigon_BGDM.h:36
Definition: tactigon_BGDM.h:159
float threshold
Definition: tactigon_BGDM.h:66
float threshold
Definition: tactigon_BGDM.h:77
Definition: tactigon_BGDM.h:149
int threshold
Definition: tactigon_BGDM.h:55
Definition: tactigon_BGDM.h:157
Definition: tactigon_BGDM.h:158
Definition: tactigon_BGDM.h:162
unsigned int stillTime
Definition: tactigon_BGDM.h:122
float threshold
Definition: tactigon_BGDM.h:89
int stillTime
Definition: tactigon_BGDM.h:56
Definition: tactigon_BGDM.h:166
BGDM_gestures
Definition: tactigon_BGDM.h:155
unsigned int stillTime
Definition: tactigon_BGDM.h:78
float threshold
Definition: tactigon_BGDM.h:111
Definition: tactigon_BGDM.h:163
unsigned int angleNormalized
Definition: tactigon_BGDM.h:79