Custom Gesture & nuitrack AI

i found that there are enum GestureType.
but i have no idea how to add custom gesture detection. for example run, wave hand
is there any tutorial / demo can be shared…?

if i use Nuitrack Ai license, does it work smart continuously?
for example. if i play 100 times of swipe gesture, does it detect the gesture more smart? if yes, where can i find the data set and reuse it for the other project?

  1. Unfortunately, Nuitrack "out of the box " recognizes gestures listed only in GestureType.
    To detect custom gestures, you need to come up with a detection method yourself, using, for example, skeleton data or nuitrack.HandTrackerData.
Example of detecting a raised hand.
bool CheckGesture()
{
    nuitrack.Skeleton skeleton = CurrentUserTracker.CurrentSkeleton;

    if (skeleton == null)
	    return false;

    Vector3 leftHandPos = skeleton.GetJoint(nuitrack.JointType.LeftHand).ToVector3();
    Vector3 rightHandPos = skeleton.GetJoint(nuitrack.JointType.RightHand).ToVector3();

    Vector3 leftElbowPos = skeleton.GetJoint(nuitrack.JointType.LeftElbow).ToVector3();
    Vector3 rightElbowPos = skeleton.GetJoint(nuitrack.JointType.RightElbow).ToVector3();

    Vector3 leftShoulderPos = skeleton.GetJoint(nuitrack.JointType.LeftShoulder).ToVector3();
    Vector3 rightShoulderPos = skeleton.GetJoint(nuitrack.JointType.RightShoulder).ToVector3();

    return CheckAngle(leftShoulderPos, leftElbowPos, 135) && CheckAngle(leftElbowPos, leftHandPos, 135) &&
	    CheckAngle(rightShoulderPos, rightElbowPos, 85) && CheckAngle(rightElbowPos, rightHandPos, 85);
}

bool CheckAngle(Vector3 v1, Vector3 v2, float targetAngle)
{
    float luft = 25;
    Vector3 dir = v1 - v2;
    float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;

    return Mathf.Abs(angle - targetAngle) <= luft;
}
  1. The AI does not perform additional training at runtime.