๐Ÿ‘ˆHand Tracking Pose Gesture Tracking

Hand Gesture Event

The HandGestureEvent class manages hand gesture events, including tracking hands, updating pose difference values, and triggering gesture start and stop events. It also handles optional finger mask settings and directional requirements for gestures.

Poses are saved and managed the same way as Grabbale Pose

  • Recommend using HandGestureEventTextWriter script for fine tuning of pose gestures settings

Tracking Hands : List of hands being tracked for gesture recognition.

Minimum Pose Distance : The minimum distance required for a pose to be considered valid. Angle distance is calculated in the angles difference between each finger joint current state and it's poses target state. Depending on the hand tracking setup and how the gestures are saved a gesture might not go below ~1, so adjust your minimum pose distance depending on your rig/pose is important.

Required Pose Hold Activation Time : The required time to hold a pose in seconds for activation. Main to prevent deactivation/activation flickering. Recommend between 0.1-0.4

Required Pose Stop Activation Time : The required time in seconds to stop holding a pose for deactivation.

Finger Masks : Optional settings for masking finger positions. Adding a finger mask will cause the finger tracker to ignore fingers set to value 0, value poses from that finger less if set to 0-1, or priorities some finger poses more other by using values over 1.

Direction Settings (Optional)

Required Angle Closeness : The angle closeness required for directional validation. Direction validation is important depending on the type of pose. A thumbs up pose wants to use a palm axis of

Palm Axis : (SET TO NONE TO DISABLE) The axis of the palm used for directional validation, compared against the target axis and the given relative transform (if no relative transform it uses world space)

Target Axis : The target axis used for directional validation.

Relative Transform : The transform used as a reference for directional validation.

On Gesture Start Event : Event triggered when a gesture starts.

On Gesture Stop Event : Event triggered when a gesture stops.

Direction Settings Example

If you want a thumbs up pose, that only works when my thumb is pointing to sky, you need to set the palm axis to UP (yellow arrow), Set that target axis to UP with the relative transform empty, (this will use global up). Then set the Required Angle Closeness to 45. This will only allow the thumbs out pose to trigger if the thumb is pointed to the sky within 45 degrees

Advanced Information

Code Example

csharpCopy codeusing UnityEngine;
using UnityEngine.Events;

public class HandGestureEventExample : MonoBehaviour {
    public HandGestureEvent handGestureEvent;

    void OnEnable() {
        handGestureEvent.OnGestureStartEvent.AddListener(OnGestureStart);
        handGestureEvent.OnGestureStopEvent.AddListener(OnGestureStop);
    }

    void OnDisable() {
        handGestureEvent.OnGestureStartEvent.RemoveListener(OnGestureStart);
        handGestureEvent.OnGestureStopEvent.RemoveListener(OnGestureStop);
    }

    void OnGestureStart(Hand hand, HandPoseGestureData gestureData) {
        Debug.Log("Gesture Started with hand: " + hand.name);
    }

    void OnGestureStop(Hand hand, HandPoseGestureData gestureData) {
        Debug.Log("Gesture Stopped with hand: " + hand.name);
    }
}

In the example above, the HandGestureEventExample script demonstrates how to subscribe to and handle gesture events using the HandGestureEvent class.

Last updated