ST / Mbed 2 deprecated 53L0A1_HandGestureRecognition

Dependencies:   X_NUCLEO_53L0A1 mbed

Fork of 53L0A1_HandGestureRecognition by Licio Mapelli

Embed: (wiki syntax)

« Back to documentation index

Directional SWIPE (1)

Directional SWIPE (1)
[Tof_gestures]

Directional (left/right) Swipe gesture detection based on motion detector (dual ToF devices) More...

Data Structures

struct  Gesture_DIRSWIPE_1_Data_t
 Data structure for directional swipes detection (using two ranging devices) More...

Enumerations

enum  Gestures_DirSwipe1_Code_t { GESTURES_DIRSWIPE_1_START = 0, GESTURES_DIRSWIPE_1_END = 1 }
 

Codes used to detect directional swipes (internal state machine)

More...

Functions

int tof_gestures_initDIRSWIPE_1 (int32_t threshold, int minSipeDuration, int maxSwipeDuration, bool handMustCoverBoth, Gesture_DIRSWIPE_1_Data_t *data)
 Initialize gesture data.
int tof_gestures_detectDIRSWIPE_1 (int32_t left_range_mm, int32_t right_range_mm, Gesture_DIRSWIPE_1_Data_t *data)
 Detect gesture.

Detailed Description

Directional (left/right) Swipe gesture detection based on motion detector (dual ToF devices)

Description
This tof_gestures module allows to detect a directional swipe (from left to right or from right to left) using two ToF devices (left and right). It is based on the tof_motion module with simple threshold and timing considerations. It returns one of the following gestures codes : GESTURES_SWIPE_LEFT_RIGHT, GESTURES_SWIPE_RIGHT_LEFT when gesture is detected or GESTURES_NULL, GESTURES_DISCARDED_TOO_SLOW or GESTURES_DISCARDED_TOO_FAST when no gesture is detected.
Known Limitations
None (very fast swipes can be detected)

Enumeration Type Documentation

Codes used to detect directional swipes (internal state machine)

Enumerator:
GESTURES_DIRSWIPE_1_START 

Ready to detect gesture start

GESTURES_DIRSWIPE_1_END 

Ready to detect gesture end

Definition at line 64 of file tof_gestures_DIRSWIPE_1.h.


Function Documentation

int tof_gestures_detectDIRSWIPE_1 ( int32_t  left_range_mm,
int32_t  right_range_mm,
Gesture_DIRSWIPE_1_Data_t data 
)

Detect gesture.

Parameters:
left_range_mmRanging distance in mm from left device
right_range_mmRanging distance in mm from right device
Returns:
One of these gestures code from Gestures_Code_t : GESTURES_SWIPE_LEFT_RIGHT, GESTURES_SWIPE_RIGHT_LEFT, GESTURES_NULL, GESTURES_DISCARDED_TOO_SLOW or GESTURES_DISCARDED_TOO_FAST

Definition at line 52 of file tof_gestures_DIRSWIPE_1.c.

int tof_gestures_initDIRSWIPE_1 ( int32_t  threshold,
int  minSipeDuration,
int  maxSwipeDuration,
bool  handMustCoverBoth,
Gesture_DIRSWIPE_1_Data_t data 
)

Initialize gesture data.

Parameters:
thresholdDistance below which a SWIPE may be detected. All distances above this threshold are not considered.
minSwipeDurationMinimum duration of a swipe. Set to 0 if no minimum speed is required.
maxSwipeDurationMaximum swipe duration. If a swipe is too slow, it is discarded.
handMustCoverBothIf set to true, hand must cover both devices at some point to validate a swipe. This may be useful to get a more robust swipe detection but this requires both sensors to not be too far away from each other. If both devices are too far from each other, it is necessary to set this flag to false to detect swipes.
Returns:
0 on success

Definition at line 39 of file tof_gestures_DIRSWIPE_1.c.