Python SDK for Hand Tracking Streamer telemetry
Project description
Python SDK for consuming telemetry from Hand Tracking Streamer (HTS)
Hand Tracking SDK is a Python package for consuming HTS hand-tracking telemetry (UDP/TCP), parsing wrist/landmark data into typed frames, and providing conversion, visualization, and integration-ready APIs.
This SDK is hosted on PyPI, with API documentation Here
Installation
pip install hand-tracking-sdk
Optional visualization support with Rerun:
pip install "hand-tracking-sdk[visualization]"
Quickstart
from hand_tracking_sdk import HTSClient, HTSClientConfig, StreamOutput
client = HTSClient(
HTSClientConfig(
output=StreamOutput.BOTH, # packets + assembled frames
)
)
for event in client.iter_events():
print(event)
What HTS Sends
HTS emits UTF-8 CSV lines:
- wrist packet: 7 floats (
x, y, z, qx, qy, qz, qw) - landmarks packet: 63 floats (
21 x [x, y, z])
The SDK validates packet labels, hand side, and exact value counts.
Core APIs
- Streaming client:
HTSClient,HTSClientConfig- output modes:
packets,frames,both - transport modes:
udp,tcp_server,tcp_client
- Frame assembly:
HandFrameAssembler- emits a frame only when both wrist and landmarks are available
- Coordinate conversion:
unity_left_to_right_positionunity_left_to_right_quaternionconvert_wrist_pose_unity_left_to_rightconvert_landmarks_unity_left_to_rightconvert_hand_frame_unity_left_to_right
- Parsing:
parse_line
Observability
HTSClient exposes runtime counters and structured log hooks:
get_stats()/reset_stats()ClientStatslog_hookviaHTSClientConfig
ROS2-Friendly Data Model
The SDK is designed so ROS2 adapters can be layered cleanly without a hard ROS dependency:
- explicit timestamps (
recv_ts_ns,recv_time_unix_ns,source_ts_ns) - explicit
frame_idand per-side sequencing - deterministic serialization helpers:
WristPose.to_dict()/from_dict()HandLandmarks.to_dict()/from_dict()HandFrame.to_dict()/from_dict()
Frame Structure
A HandFrame includes:
side:LeftorRightframe_id: frame name for downstream systemswrist:WristPose(x, y, z, qx, qy, qz, qw)landmarks.points: tuple of 21(x, y, z)points- timing/sequence metadata (
sequence_id,recv_ts_ns,recv_time_unix_ns,source_ts_ns)
To get telemetry for a specific joint from a frame, use get_joint(...).
Joint names and order follow the HTS streamed contract (wrist is JointName.WRIST).
from hand_tracking_sdk import HTSClient, HTSClientConfig, JointName, StreamOutput
client = HTSClient(HTSClientConfig(output=StreamOutput.FRAMES))
for frame in client.iter_events():
x, y, z = frame.get_joint(JointName.INDEX_TIP)
print(
f"side={frame.side.value} joint={JointName.INDEX_TIP.value} "
f"xyz=({x:.5f}, {y:.5f}, {z:.5f}) recv_ts_ns={frame.recv_ts_ns}"
)
You can also query by finger group:
index_points = frame.get_finger("index")
# returns dict[JointName, tuple[float, float, float]]
# keys include JointName.INDEX_PROXIMAL, JointName.INDEX_TIP, ...
Examples
- Rerun visualization:
- install extra:
pip install "hand-tracking-sdk[visualization]" uv run python examples/visualize_rerun.py --transport tcp_server --host 0.0.0.0 --port 8000
- install extra:
- Frame-only stream:
uv run python examples/stream_frames.py --transport tcp_server --host 0.0.0.0 --port 8000
- JSONL logging:
uv run python examples/log_to_jsonl.py --transport tcp_server --host 0.0.0.0 --port 8000 --output both --path runs/hand_tracking.jsonl
Protocol and Docs
- HTS protocol reference:
- SDK docs:
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hand_tracking_sdk-1.0.1.tar.gz.
File metadata
- Download URL: hand_tracking_sdk-1.0.1.tar.gz
- Upload date:
- Size: 494.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
933c0668aa02800a899adc731eece613641f74f77d4b55d68c118142be288796
|
|
| MD5 |
cdd2e0f6b5f27507cf705125c9eec6eb
|
|
| BLAKE2b-256 |
6e5e85ecfb74e41c3cfe57a13f80a8cdb5a72c5eff33b1409511ad51764c931c
|
Provenance
The following attestation bundles were made for hand_tracking_sdk-1.0.1.tar.gz:
Publisher:
release.yml on wengmister/hand-tracking-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hand_tracking_sdk-1.0.1.tar.gz -
Subject digest:
933c0668aa02800a899adc731eece613641f74f77d4b55d68c118142be288796 - Sigstore transparency entry: 939699557
- Sigstore integration time:
-
Permalink:
wengmister/hand-tracking-sdk@cd2f7ac434d1aed0403597e66ac072296929e282 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/wengmister
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cd2f7ac434d1aed0403597e66ac072296929e282 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hand_tracking_sdk-1.0.1-py3-none-any.whl.
File metadata
- Download URL: hand_tracking_sdk-1.0.1-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dde067baa2b50a6a4f5c598681e2c1c991f16e16af93ef3baaa1c8fe84436380
|
|
| MD5 |
59b25876248d48beb6f744f7cfd46694
|
|
| BLAKE2b-256 |
b8cb79929a22abd90ab180a21a1edd6eb4fd966e0d0f3e6243c367502f8c3519
|
Provenance
The following attestation bundles were made for hand_tracking_sdk-1.0.1-py3-none-any.whl:
Publisher:
release.yml on wengmister/hand-tracking-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hand_tracking_sdk-1.0.1-py3-none-any.whl -
Subject digest:
dde067baa2b50a6a4f5c598681e2c1c991f16e16af93ef3baaa1c8fe84436380 - Sigstore transparency entry: 939699559
- Sigstore integration time:
-
Permalink:
wengmister/hand-tracking-sdk@cd2f7ac434d1aed0403597e66ac072296929e282 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/wengmister
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cd2f7ac434d1aed0403597e66ac072296929e282 -
Trigger Event:
push
-
Statement type: