/** * Constructor. * * @param timestamp time of observation of the posture. * @param posture the tracked posture. * @param pointingProbabilityRight the base probability of a pointing gesture using the right arm. * @param pointingProbabilityLeft the base probability of a pointing gesture using the left arm. */ PostureHistoryEntry(final long timestamp, final TrackedPosture3DFloat posture, final double pointingProbabilityRight, final double pointingProbabilityLeft) { this.timestamp = timestamp; this.probabilityRight = pointingProbabilityRight; this.probabilityLeft = pointingProbabilityLeft; // this.head = PostureFunctions.getPoint3D(posture, Joints.Head); // this.shoulderRight = PostureFunctions.getPoint3D(posture, Joints.ShoulderRight); // this.shoulderLeft = PostureFunctions.getPoint3D(posture, Joints.ShoulderLeft); // this.elbowRight = PostureFunctions.getPoint3D(posture, Joints.ElbowRight); // this.elbowLeft = PostureFunctions.getPoint3D(posture, Joints.ElbowLeft); // this.handRight = PostureFunctions.getPoint3D(posture, Joints.HandRight); // this.handLeft = PostureFunctions.getPoint3D(posture, Joints.HandLeft); this.directionRight = PostureFunctions.getDirection(posture, new JointPair(Joints.ShoulderRight, Joints.HandRight)); this.directionLeft = PostureFunctions.getDirection(posture, new JointPair(Joints.ShoulderLeft, Joints.HandLeft)); }
public static final Point3D postureUpDirection(final TrackedPosture3DFloat posture) { return getDirection(posture, new JointPair(Joints.SpineBase, Joints.Neck)).normalize(); }
public static final double getElbowAngle(final TrackedPosture3DFloat posture, final boolean right) { final JointPair pair1 = right ? new JointPair(Joints.ElbowRight, Joints.ShoulderRight) : new JointPair(Joints.ElbowLeft, Joints.ShoulderLeft); final JointPair pair2 = right ? new JointPair(Joints.ElbowRight, Joints.HandRight) : new JointPair(Joints.ElbowLeft, Joints.HandLeft); return getDirection(posture, pair1).angle(getDirection(posture, pair2)); }
public static final Point3D postureRightDirection(final TrackedPosture3DFloat posture, final Point3D up) { final Point3D hipDir = getDirection(posture, new JointPair(Joints.HipLeft, Joints.HipRight)); final Point3D shoulderDir = getDirection(posture, new JointPair(Joints.ShoulderLeft, Joints.ShoulderRight)); return projectOrthogonal(hipDir.add(shoulderDir.multiply(0.5)), up).normalize(); }
public static final double getHandHeightAngle(final TrackedPosture3DFloat posture, final boolean right, final boolean relative) { final JointPair armJoints = right ? new JointPair(Joints.ShoulderRight, Joints.HandRight) : new JointPair(Joints.ShoulderLeft, Joints.HandLeft); final Point3D direction = getDirection(posture, armJoints); final Point3D up = postureUpDirection(posture, relative); return up.angle(direction); }
public static final double getElbowHeightAngle(final TrackedPosture3DFloat posture, final boolean right, final boolean relative) { final JointPair armJoints = right ? new JointPair(Joints.ShoulderRight, Joints.ElbowRight) : new JointPair(Joints.ShoulderLeft, Joints.ElbowLeft); final Point3D direction = getDirection(posture, armJoints); final Point3D up = postureUpDirection(posture, relative); return up.angle(direction); }
public static final double getSignedHorizontalAngle(final TrackedPosture3DFloat posture, final boolean right, final boolean relative) { final Joints handJoint = right ? Joints.HandRight : Joints.HandLeft; final Point3D up = postureUpDirection(posture, relative); final Point3D front = postureFrontDirection(posture, up); final Point3D direction = projectOrthogonal(getDirection(posture, new JointPair(Joints.SpineMid, handJoint)), up); return getSignedAngle(front, direction, up); } }