Class PoseLandmarks

java.lang.Object
com.codename1.ai.vision.PoseLandmarks

public final class PoseLandmarks extends Object

The joint names Pose.Landmark.getName() reports, as constants instead of literals. Backends detect different subsets of this list: ML Kit reports the hand and foot detail, Apple Vision reports NECK and ROOT that ML Kit does not, and a joint the backend did not report is simply absent. Read one through Pose.getLandmark(String) and check for null rather than assuming a fixed skeleton.

detector.process(VisionImage.fromCameraFrame(frame)).ready(pose -> {
    Pose.Landmark wrist = pose.getLandmark(PoseLandmarks.RIGHT_WRIST);
    Pose.Landmark shoulder = pose.getLandmark(PoseLandmarks.RIGHT_SHOULDER);
    if (wrist != null && shoulder != null
            && wrist.getConfidence() > 0.6f
            && wrist.getPosition().getY() < shoulder.getPosition().getY()) {
        Log.p("hand raised");
    }
});