Skip to main content

Python SDK for Hand Tracking Streamer telemetry

Project description

Hand Tracking SDK

Python SDK for consuming telemetry from Hand Tracking Streamer (HTS).

Overview

HTS streams UTF-8 CSV lines for wrist pose and hand landmarks.
This SDK provides typed parsing and validation for:

  • wrist packets: 7 floats (x, y, z, qx, qy, qz, qw)
  • landmark packets: 63 floats (21 x [x, y, z])

Streamed joints are in Mediapipe-style 21 landmark points.

[!IMPORTANT] Pre-release: This library is actively under development. Expect breaking changes to come.

Transport API

The SDK includes socket transport primitives for line-based ingestion:

  • UDPLineReceiver
  • TCPServerLineReceiver
  • TCPClientLineReceiver

Network timeout and disconnect behavior is reported through typed exceptions:

  • TransportTimeoutError
  • TransportDisconnectedError
  • TransportClosedError

Frame Assembly API

Use HandFrameAssembler to combine wrist and landmark packets into coherent per-hand frames.

  • Emits a frame only after both components are present for a hand.
  • Ignores stale out-of-order updates (older receive timestamps).
  • Increments sequence_id per hand side on each newly emitted frame.
  • Supports:
    • recv_ts_ns (monotonic receive time)
    • recv_time_unix_ns (optional wall-clock receive time)
    • source_ts_ns (optional upstream timestamp; currently caller-provided)

Coordinate Conversion API

The SDK provides explicit Unity-left-handed to right-handed conversion helpers:

  • unity_left_to_right_position
  • unity_left_to_right_quaternion
  • convert_wrist_pose_unity_left_to_right
  • convert_landmarks_unity_left_to_right
  • convert_hand_frame_unity_left_to_right

Current conversion profile:

  • position: flip Y sign (x, y, z -> x, -y, z)
  • orientation: basis transform equivalent to Y-axis reflection
from hand_tracking_sdk import (
    HandFrameAssembler,
    convert_hand_frame_unity_left_to_right,
)

assembler = HandFrameAssembler()
frame = assembler.push_line("Right wrist:, 0.1, 0.2, 0.3, 0.0, 0.0, 0.0, 1.0")
if frame is not None:
    converted = convert_hand_frame_unity_left_to_right(frame)

Streaming Client API

HTSClient provides a high-level sync stream with filtering and error policy controls.

Key controls:

  • transport mode: udp, tcp_server, tcp_client
  • output mode: packets, frames, both
  • hand filter: left, right, both
  • parse error policy: strict (raise) or tolerant (skip malformed lines)
from hand_tracking_sdk import HTSClient, HTSClientConfig, StreamOutput

client = HTSClient(HTSClientConfig(output=StreamOutput.FRAMES))
for event in client.iter_events():
    print(event)

Example

from hand_tracking_sdk import parse_line

packet = parse_line("Right wrist:, 0.1, 0.2, 0.3, 0.0, 0.0, 0.0, 1.0")
print(packet.side, packet.kind, packet.data)

The parser validates packet label, side, and value count, and raises ParseError on malformed input.

Protocol Reference

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hand_tracking_sdk-0.1.0.tar.gz (39.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hand_tracking_sdk-0.1.0-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file hand_tracking_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: hand_tracking_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.9

File hashes

Hashes for hand_tracking_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 616c3119eb8c7236852daf443c772ccfce723102dfed8c729f27c1498c3acdd3
MD5 edb3640c7108a4e073004600945adf6f
BLAKE2b-256 f254f92e4faddd371de847ccb28149ba83f0cfd304590bb384421b5b15af3775

See more details on using hashes here.

File details

Details for the file hand_tracking_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hand_tracking_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cae7225c39b85b02bc417cadfa566a75a7b040d2bcd8735140538b556ac54030
MD5 e5c4df0e8f488ce6dce75f184899b4f7
BLAKE2b-256 b8c7befd7a46a1f1b7509f140ca948d21007a37370afcf2b6deffacc9cfd4339

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page