Skip to main content

Skeleton

class · sealed immutable thread-safe
namespace AR51.Net;

public sealed class Skeleton

One tracked person at one moment: the 3D position and confidence of each body joint, the hands when a hand-tracking headset reports them, plus identity and timing.

Positions are in meters, in the AR 51 world: left-handed, X right, Y up, Z forward (the same axes as Unity). A joint the cameras could not see is reported at (0, 0, 0) with confidence 0; use TryGetPosition to tell it apart. Instances are immutable and safe to share across threads.

Units

Positions are in meters, in the AR 51 world: left-handed, X right, Y up, Z forward (the same axes as Unity). See Data conventions.

How-to

This page is reference (facts only). For a walkthrough with a complete sample, see the Skeletons guide.

Example
// Hands are present only when the person wears a hand-tracking headset.
if (skeleton.LeftHand is { } hand)
Console.WriteLine($"left index fingertip at {hand.GetPosition(HandJoint.IndexTip)} m");

Properties​

PropertyTypeAccessDescription
IdstringgetTracking id of this person, stable while the person stays tracked.
EntityIdstringgetIdentity assigned to this person at registration, stable across sessions. Empty when the person is not registered.
EntityDisplayNamestringgetName of the registered person, for display. Empty when the person is not registered.
DeviceIdstringgetId of the headset worn by this person, the same as DeviceInfo.Id. Empty when no headset is associated with this person.
PositionsIReadOnlyList<Vector3>getJoint positions in meters (left-handed: X right, Y up, Z forward), indexed by Joint.
ConfidencesIReadOnlyList<float>getHow sure the cameras are of each joint, from 0 (not seen) to 1, indexed by Joint. Empty when the server does not report confidence.
LeftHandHandPose?getThe left hand's joints, or null unless this person wears a headset with hand tracking. Hands come from the headset, not from the cameras.
RightHandHandPose?getThe right hand's joints, or null unless this person wears a headset with hand tracking. Hands come from the headset, not from the cameras.
CaptureTimeDateTimeOffsetgetWhen the cameras captured this skeleton (server clock, UTC). The Unix epoch (1970-01-01) when the server did not send a valid time.
ReceivedTimeDateTimeOffsetgetWhen this client received it (local clock). CaptureTime uses the server's clock and this uses yours, so their difference is the true delay only when both clocks are synchronized (for example with NTP).

Method summary​

→ Full descriptions in Method details below.

Method details​

GetPosition​

method
public Vector3 GetPosition(Joint joint);

Gets the position of a joint, in meters.

Parameters
jointJointThe joint.
ReturnsVector3The position, or (0, 0, 0) when the joint was not detected.

GetConfidence​

method
public float GetConfidence(Joint joint);

Gets how sure the cameras are of a joint.

Parameters
jointJointThe joint.
ReturnsfloatFrom 0 (not seen) to 1. 0 when the server does not report confidence.

TryGetPosition​

method
public bool TryGetPosition(Joint joint, out Vector3 position);

Gets the position of a joint if it was detected.

Parameters
jointJointThe joint.
positionout Vector3The position in meters, or (0, 0, 0) when not detected.
Returnsbooltrue when the joint was detected: its confidence is above 0 (or, when the server does not report confidence, its position is not (0, 0, 0)).
Example
if (skeleton.TryGetPosition(Joint.RightWrist, out Vector3 wrist))
Console.WriteLine($"right wrist at {wrist} m (confidence {skeleton.GetConfidence(Joint.RightWrist):F2})");
else
Console.WriteLine("right wrist not seen");

Small types used by this class, documented here.

Joint​

enum
public enum Joint

Body joints reported in a Skeleton. The value is the index into Skeleton.Positions.

note

Left and right are the person's own left and right.

ValueMeaning
Nose = 0Tip of the nose.
Neck = 1Base of the neck, between the shoulders.
RightShoulder = 2Right shoulder.
RightElbow = 3Right elbow.
RightWrist = 4Right wrist.
LeftShoulder = 5Left shoulder.
LeftElbow = 6Left elbow.
LeftWrist = 7Left wrist.
MidHip = 8Center of the pelvis, between the hips.
RightHip = 9Right hip.
RightKnee = 10Right knee.
RightAnkle = 11Right ankle.
LeftHip = 12Left hip.
LeftKnee = 13Left knee.
LeftAnkle = 14Left ankle.
RightEye = 15Right eye.
LeftEye = 16Left eye.
RightEar = 17Right ear.
LeftEar = 18Left ear.
LeftBigToe = 19Left big toe.
LeftSmallToe = 20Left small toe.
LeftHeel = 21Left heel.
RightBigToe = 22Right big toe.
RightSmallToe = 23Right small toe.
RightHeel = 24Right heel.

See also​

Was this page helpful?