The MGC3130 is the world’s first electrical-field (E-field) based three-dimensional (3D) tracking and gesture controller
Dependents: NucleoMGC3130 i2c_master
Diff: Gesture/GestureInfo.h
- Revision:
- 2:c7d984193741
- Parent:
- 1:621c4e9238ef
- Child:
- 8:de7934ec7ea2
diff -r 621c4e9238ef -r c7d984193741 Gesture/GestureInfo.h --- a/Gesture/GestureInfo.h Wed Oct 07 20:43:39 2015 +0000 +++ b/Gesture/GestureInfo.h Thu Oct 08 11:14:18 2015 +0000 @@ -1,71 +1,100 @@ #ifndef UK_AC_HERTS_SMARTLAB_MGC3130_GestuerInfo #define UK_AC_HERTS_SMARTLAB_MGC3130_GestuerInfo +/** Recognized Gestures: +* The recognized gestures are results of the HMM classification. Edge detection +* can be used to further classify where the gesture has been done (Edge +* Flicks). Furthermore, gesture attributes give information about the direction of +* the flick. +*/ class GestureInfo { private: + + /// 4 bytes gesture information. char * data; public: - void set(char * value) { - data = value; - } + /** Set the internal memory, used by API itself. + * + * @param value 4 bytes char array + */ + void set(char * value); - /* - NoGesture = 0, - GarbageModel = 1, - FlickWestToEast = 2, - FlickEastToWest = 3, - FlickSouthToNorth = 4, - FlickNorthToSouth = 5, - CircleClockwise = 6, //only active if AirWheel disabled - CircleCounterclockwise = 7, //only active if AirWheel disabled - WaveX = 8, - WaveY = 9, - Hold= 64, - Presence = 73, - EdgeFlickWestToEast = 65, - EdgeFlickEastToWest = 66, - EdgeFlickSouthToNorth = 67, - EdgeFlickNorthToSouth = 68, - DoubleFlickWestToEast = 69, - DoubleFlickEastToWest = 70, - DoubleFlickSouthToNorth = 71, - DoubleFlickNorthToSouth = 72, + /** Get the recognized gesture information. + * + * @returns + 0 No Gesture + 1 Garbage Model + 2 Flick West To East + 3 Flick East To West + 4 Flick South To North, + 5 Flick North To South + 6 Circle Clockwise, only active if AirWheel disabled + 7 Circle Counterclockwise, only active if AirWheel disabled + 8 WaveX + 9 WaveY + 64 Hold + 73 Presence + 65 Edge Flick West To East + 66 Edge Flick East To West + 67 Edge Flick South To North + 68 Edge Flick North To South + 69 Double Flick West To East + 70 Double Flick East To West + 71 Double Flick South To North + 72 Double Flick North To South */ - int getRecognizedGesture() { - return data[0]; - } + int getRecognizedGesture(); - /* - GarbageModel = 0, - FlickGesture = 1, - CirculaGesture = 2, + /** Get the recognized gesture class. + * + * @returns + * 0 Garbage Model + * 1 Flick Gesture + * 2 Circula Gesture */ - int getGestureClass() { - return (data[1] & 0xF0) >> 4; - } - - //Edge flick – is ‘1’ if flick gesture is classified as edge flick - bool isEdgeFlick() { - return (data[2] & 0x01) == 0x01? true: false; - } + int getGestureClass(); - bool isHandPresence() { - return (data[3] & 0x08) == 0x08? true: false; - } - - bool isHandHold() { - return (data[3] & 0x10) == 0x10? true: false; - } + /** Check if the recognized gesture is classified as edge flick. + * + * @returns + * true qualified + * false not qualified + */ + bool isEdgeFlick(); + + /** Check if the user’s hand is within the sensing space. + * + * @returns + * true qualified + * false not qualified + */ + bool isHandPresence(); + + /** Check if the hand is not moving. Further dependencies can be adjusted inside Aurea Parametrization. + * + * @returns + * true qualified + * false not qualified + */ + bool isHandHold(); - bool isHandInside() { - return (data[3] & 0x20) == 0x20? true: false; - } - - bool isRecognitionInProcess() { - return (data[3] & 0x80) == 0x80? true: false; - } + /** Check if the user’s hand is approximately above the sensor. + * + * @returns + * true qualified + * false not qualified + */ + bool isHandInside(); + + /** 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. + * + * @returns + * true qualified + * false not qualified + */ + bool isRecognitionInProcess(); }; #endif \ No newline at end of file