Skip to main content

HandSkeletonService

class · Singleton Unity component singleton
public sealed class HandSkeletonService : Singleton<HandSkeletonService>, IHandSkeletonService

Namespace: AR51.Unity.SDK

Streams this device's tracked hand joints — positions, rotations, and confidence — sourced from the active hands adapter. Drop it on a scene object (it's a Unity component and a singleton); call StartStreaming(), then consume GetStream() for per-frame two-hand info.

Units

Joint positions are world-space meters, transformed by OverrideWorldToLocalMatrix before output (identity by default — no transform).

Prefer the hands adapters

GetStream() yields TwoHandsInfoResponse / HandInfoResponse, which are transport (proto) types. Don't bind UI or gameplay to them directly — read joints through the documented hands adapters, which expose the same data as idiomatic Unity types. See also hand data.

Properties

PropertyTypeDefaultDescription
Streaming
IsStreamingboolfalsetrue while the hand stream is live (get-only)
Transform
OverrideWorldToLocalMatrixMatrix4x4identityapplied to all hand joints before output

Method summary

Instance

MethodReturns
StartStreamingvoidUnity component
StopStreamingvoidUnity component
GetStreamBlockingCollection<TwoHandsInfoResponse>Unity component

→ Full descriptions in Method details below.

Method details

StartStreaming

methodUnity component
public void StartStreaming();

Begins streaming this device's tracked hand joints from the active hands adapter. After this returns, IsStreaming is true and frames start flowing into the collection from GetStream(). Call once (e.g. on Start/OnEnable).

StopStreaming

methodUnity component
public void StopStreaming();

Stops the hand stream and sets IsStreaming back to false. Call when you no longer need hand data (e.g. on OnDisable).

GetStream

methodUnity component
public BlockingCollection<TwoHandsInfoResponse> GetStream();

The per-frame two-hand info stream. Consume it on a background thread (or drain it from a coroutine) — BlockingCollection<T> blocks the caller until an item is available. Each TwoHandsInfoResponse carries both hands' joints in world-space meters, already transformed by OverrideWorldToLocalMatrix.

⚠️ TwoHandsInfoResponse / HandInfoResponse are transport (proto) types. Read joints through the hands adapters rather than binding to these directly.

ReturnsBlockingCollection<TwoHandsInfoResponse>the live two-hand frame stream
Exampleinferred
var hands = HandSkeletonService.Instance;
hands.StartStreaming();

// On a worker thread — GetStream() blocks until a frame is ready:
foreach (var frame in hands.GetStream().GetConsumingEnumerable())
{
// Prefer the hands adapters over reading the transport type directly.
// Joint positions are world-space meters.
}

See also

Was this page helpful?