The MGC3130 is the world’s first electrical-field (E-field) based three-dimensional (3D) tracking and gesture controller
Dependents: NucleoMGC3130 i2c_master
Gesture/GestureInfo.h@8:de7934ec7ea2, 2015-11-14 (annotated)
- Committer:
- yangcq88517
- Date:
- Sat Nov 14 15:44:44 2015 +0000
- Revision:
- 8:de7934ec7ea2
- Parent:
- 2:c7d984193741
change to unsigned char array
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yangcq88517 | 1:621c4e9238ef | 1 | #ifndef UK_AC_HERTS_SMARTLAB_MGC3130_GestuerInfo |
yangcq88517 | 1:621c4e9238ef | 2 | #define UK_AC_HERTS_SMARTLAB_MGC3130_GestuerInfo |
yangcq88517 | 1:621c4e9238ef | 3 | |
yangcq88517 | 2:c7d984193741 | 4 | /** Recognized Gestures: |
yangcq88517 | 2:c7d984193741 | 5 | * The recognized gestures are results of the HMM classification. Edge detection |
yangcq88517 | 2:c7d984193741 | 6 | * can be used to further classify where the gesture has been done (Edge |
yangcq88517 | 2:c7d984193741 | 7 | * Flicks). Furthermore, gesture attributes give information about the direction of |
yangcq88517 | 2:c7d984193741 | 8 | * the flick. |
yangcq88517 | 2:c7d984193741 | 9 | */ |
yangcq88517 | 1:621c4e9238ef | 10 | class GestureInfo |
yangcq88517 | 1:621c4e9238ef | 11 | { |
yangcq88517 | 1:621c4e9238ef | 12 | private: |
yangcq88517 | 2:c7d984193741 | 13 | |
yangcq88517 | 2:c7d984193741 | 14 | /// 4 bytes gesture information. |
yangcq88517 | 8:de7934ec7ea2 | 15 | unsigned char * data; |
yangcq88517 | 1:621c4e9238ef | 16 | public: |
yangcq88517 | 1:621c4e9238ef | 17 | |
yangcq88517 | 2:c7d984193741 | 18 | /** Set the internal memory, used by API itself. |
yangcq88517 | 2:c7d984193741 | 19 | * |
yangcq88517 | 2:c7d984193741 | 20 | * @param value 4 bytes char array |
yangcq88517 | 2:c7d984193741 | 21 | */ |
yangcq88517 | 8:de7934ec7ea2 | 22 | void set(unsigned char * value); |
yangcq88517 | 1:621c4e9238ef | 23 | |
yangcq88517 | 2:c7d984193741 | 24 | /** Get the recognized gesture information. |
yangcq88517 | 2:c7d984193741 | 25 | * |
yangcq88517 | 2:c7d984193741 | 26 | * @returns |
yangcq88517 | 2:c7d984193741 | 27 | 0 No Gesture |
yangcq88517 | 2:c7d984193741 | 28 | 1 Garbage Model |
yangcq88517 | 2:c7d984193741 | 29 | 2 Flick West To East |
yangcq88517 | 2:c7d984193741 | 30 | 3 Flick East To West |
yangcq88517 | 2:c7d984193741 | 31 | 4 Flick South To North, |
yangcq88517 | 2:c7d984193741 | 32 | 5 Flick North To South |
yangcq88517 | 2:c7d984193741 | 33 | 6 Circle Clockwise, only active if AirWheel disabled |
yangcq88517 | 2:c7d984193741 | 34 | 7 Circle Counterclockwise, only active if AirWheel disabled |
yangcq88517 | 2:c7d984193741 | 35 | 8 WaveX |
yangcq88517 | 2:c7d984193741 | 36 | 9 WaveY |
yangcq88517 | 2:c7d984193741 | 37 | 64 Hold |
yangcq88517 | 2:c7d984193741 | 38 | 73 Presence |
yangcq88517 | 2:c7d984193741 | 39 | 65 Edge Flick West To East |
yangcq88517 | 2:c7d984193741 | 40 | 66 Edge Flick East To West |
yangcq88517 | 2:c7d984193741 | 41 | 67 Edge Flick South To North |
yangcq88517 | 2:c7d984193741 | 42 | 68 Edge Flick North To South |
yangcq88517 | 2:c7d984193741 | 43 | 69 Double Flick West To East |
yangcq88517 | 2:c7d984193741 | 44 | 70 Double Flick East To West |
yangcq88517 | 2:c7d984193741 | 45 | 71 Double Flick South To North |
yangcq88517 | 2:c7d984193741 | 46 | 72 Double Flick North To South |
yangcq88517 | 1:621c4e9238ef | 47 | */ |
yangcq88517 | 2:c7d984193741 | 48 | int getRecognizedGesture(); |
yangcq88517 | 1:621c4e9238ef | 49 | |
yangcq88517 | 2:c7d984193741 | 50 | /** Get the recognized gesture class. |
yangcq88517 | 2:c7d984193741 | 51 | * |
yangcq88517 | 2:c7d984193741 | 52 | * @returns |
yangcq88517 | 2:c7d984193741 | 53 | * 0 Garbage Model |
yangcq88517 | 2:c7d984193741 | 54 | * 1 Flick Gesture |
yangcq88517 | 2:c7d984193741 | 55 | * 2 Circula Gesture |
yangcq88517 | 1:621c4e9238ef | 56 | */ |
yangcq88517 | 2:c7d984193741 | 57 | int getGestureClass(); |
yangcq88517 | 1:621c4e9238ef | 58 | |
yangcq88517 | 2:c7d984193741 | 59 | /** Check if the recognized gesture is classified as edge flick. |
yangcq88517 | 2:c7d984193741 | 60 | * |
yangcq88517 | 2:c7d984193741 | 61 | * @returns |
yangcq88517 | 2:c7d984193741 | 62 | * true qualified |
yangcq88517 | 2:c7d984193741 | 63 | * false not qualified |
yangcq88517 | 2:c7d984193741 | 64 | */ |
yangcq88517 | 2:c7d984193741 | 65 | bool isEdgeFlick(); |
yangcq88517 | 2:c7d984193741 | 66 | |
yangcq88517 | 2:c7d984193741 | 67 | /** Check if the user’s hand is within the sensing space. |
yangcq88517 | 2:c7d984193741 | 68 | * |
yangcq88517 | 2:c7d984193741 | 69 | * @returns |
yangcq88517 | 2:c7d984193741 | 70 | * true qualified |
yangcq88517 | 2:c7d984193741 | 71 | * false not qualified |
yangcq88517 | 2:c7d984193741 | 72 | */ |
yangcq88517 | 2:c7d984193741 | 73 | bool isHandPresence(); |
yangcq88517 | 2:c7d984193741 | 74 | |
yangcq88517 | 2:c7d984193741 | 75 | /** Check if the hand is not moving. Further dependencies can be adjusted inside Aurea Parametrization. |
yangcq88517 | 2:c7d984193741 | 76 | * |
yangcq88517 | 2:c7d984193741 | 77 | * @returns |
yangcq88517 | 2:c7d984193741 | 78 | * true qualified |
yangcq88517 | 2:c7d984193741 | 79 | * false not qualified |
yangcq88517 | 2:c7d984193741 | 80 | */ |
yangcq88517 | 2:c7d984193741 | 81 | bool isHandHold(); |
yangcq88517 | 1:621c4e9238ef | 82 | |
yangcq88517 | 2:c7d984193741 | 83 | /** Check if the user’s hand is approximately above the sensor. |
yangcq88517 | 2:c7d984193741 | 84 | * |
yangcq88517 | 2:c7d984193741 | 85 | * @returns |
yangcq88517 | 2:c7d984193741 | 86 | * true qualified |
yangcq88517 | 2:c7d984193741 | 87 | * false not qualified |
yangcq88517 | 2:c7d984193741 | 88 | */ |
yangcq88517 | 2:c7d984193741 | 89 | bool isHandInside(); |
yangcq88517 | 2:c7d984193741 | 90 | |
yangcq88517 | 2:c7d984193741 | 91 | /** Check if the gesture recognition in progress. This bit is set when the Gesture Recognizer is active and Reset when the gesture is recognized and the Recognizer is Off. |
yangcq88517 | 2:c7d984193741 | 92 | * |
yangcq88517 | 2:c7d984193741 | 93 | * @returns |
yangcq88517 | 2:c7d984193741 | 94 | * true qualified |
yangcq88517 | 2:c7d984193741 | 95 | * false not qualified |
yangcq88517 | 2:c7d984193741 | 96 | */ |
yangcq88517 | 2:c7d984193741 | 97 | bool isRecognitionInProcess(); |
yangcq88517 | 1:621c4e9238ef | 98 | }; |
yangcq88517 | 1:621c4e9238ef | 99 | |
yangcq88517 | 1:621c4e9238ef | 100 | #endif |