public static IEnumerable <Pose> ElbowFlexion(int numberOfRepetitions = 8) { // First create the start pose and set both arms to point down var startTransform = BodyTransformBuilder.ArmsDownTransform(); // The create a new pose for the rise of the left arm CompositeBodyTransform leftUpTransform = new CompositeBodyTransform(); leftUpTransform = startTransform.Compose(JointType.WristLeft, new SetJointDirectionTransform(0, 1, 0)); // And another for the rise of the right arm CompositeBodyTransform rightUpTransform = new CompositeBodyTransform(); rightUpTransform = startTransform.Compose(JointType.WristRight, new SetJointDirectionTransform(0, 1, 0)); // Add the needed yield return(new Pose("", startTransform)); for (int i = 0; i < numberOfRepetitions; ++i) { yield return(new Pose("", leftUpTransform)); yield return(new Pose("", rightUpTransform)); } }
// Gestures as a List of Poses public static IEnumerable <Pose> CrossoverArmStretch(int numberOfRepetitions = 4) { var startTransform = BodyTransformBuilder.ArmsDownTransform(); yield return(new Pose("ArmsDownTransform", startTransform, BodyRestrictionBuilder.ShouldersRelaxedRestriction())); var leftStretch = BodyTransformBuilder.CrossoverArmStretchTransform(JointSide.Left); var rightStretch = BodyTransformBuilder.CrossoverArmStretchTransform(JointSide.Right); for (int i = 0; i < numberOfRepetitions; ++i) { yield return(new Pose("leftStretch", leftStretch)); yield return(new Pose("rightStretch", rightStretch)); } }