Subject: glove gesture recognition

From: Dave Stampe-Psy+Eng <dstamp@watserv1>
Date: Tue, 14 Jul 92 23:24:51 -0400

I've been working on some code for glove gesture recognition, and it
seems robust enough to be firm.  So here's the specs for your perusal:

The recognition code is built into the interrupt-driven glove code for
REND386.  It updates 2 variables: gesture_type, and gesture_length.
Gesture_length is the number of glove reads (about 20/sec) that the
gesture has been stable for, and makes "debouncing" a geture trivial--
just check if the count exceeds a certain threshold.

Gesture_type is a code for the gesture.  At present there are 11
gestures:
FLAT -- open hand (neutral, do nothing)
FIST -- all fingers and thumb closed
THUMB_OUT -- fist with extended thumb
POINT -- index finger extended, thumb ignored
RING_IN -- effectively, both index and middle finger pointing, thumb ignored
MIDDLE_IN -- only middle figer bent.  Seems stable, but can degenerate to POINT
INDEX_IN -- only index finger bent.
PINCH -- both thumb and index finger bent.  Yiu really have to get the thumb
_under_ the index finger for the glove to sense this, so it can degenerate to
just INDEX_IN
BADFINGER -- middle finger extended.  Nuff said.
RING_OUT -- only ring figer extended.

Also, UNKNOWN is returned if none of the previous match.  At present, none
of the finger positions match this code.  I use a table of finger max/mins
and then "compile" a 256-entry lookup table at run-time, so changes could 
make this show up.  

Since in proctice, the glove data dependes on its calibration and the wearer,
some of the codes are nearly unusable, and should be combined into a simpler
set.  The interrupt code supports a mapping table, so that the combined 
codes may be debounced.  The best use seems to be to map THUMB_IN to FLAT
and INDEX_IN to PINCH as well as RING_OUT to FIST.  This reflects the noisy
ring finger and poor thumb calibration I've seen on my gloves.  But you
end up with a nice set of gesture states, and thanks to the max/min table
and some tweeking, they are very stable and can be commanded at will.  I
haven't tried mapping in rotation as yet, but it'd have to be less glitchy
to work anyway.

The proposed uses are FLAT as do-nothing, FIST as move, POINT as select,
and RING_IN (2-finger point) as menu callup.  I'm sure other gesture
uses will be forthcoming.  Now if I could just keep my knuckles from
getting worn raw in those @@$$@! gloves...

-Dave STampe