XRoboToolkit-PC-Service-Pybind
This project provides a python interface to extract XR state using XRoboToolkit-PC-Service sdk.
Requirements
- Linux (x86_64 or aarch64, e.g. NVIDIA Orin) or Windows (x64), Python >= 3.10
- A running XRoboToolkit PC Service with a connected PICO headset (at runtime)
The prebuilt PXREARobotSDK binaries are vendored in vendor/, so no manual
SDK download or build is needed.
Installation
From PyPI
uv add xrobotoolkit-sdk
# or
pip install xrobotoolkit-sdk
From source
If you do not have uv installed, run:
curl -LsSf https://astral.sh/uv/install.sh | sh
Then (requires a C++17 compiler; CMake >= 3.26 is downloaded automatically if not installed):
git clone https://github.com/XR-Robotics/XRoboToolkit-PC-Service-Pybind.git
cd XRoboToolkit-PC-Service-Pybind
uv sync
uv sync creates .venv/ with any available Python >= 3.10 (pick one with
e.g. uv sync --python 3.12), builds the extension, and installs the package
into it. Run scripts with e.g. uv run examples/example.py.
To build distributable artifacts locally: uv build. The extension is built
against the CPython stable ABI, so the wheel (e.g.
xrobotoolkit_sdk-1.1.0-cp310-abi3-win_amd64.whl) installs on any CPython
= 3.10 for the same OS and architecture, whichever Python version built it. Wheels for Linux/Windows are also built in CI via cibuildwheel, see
.github/workflows/wheels.yml.
Using the Python Bindings
1. Get Controller and Headset Poses
import xrobotoolkit_sdk as xrt
xrt.init()
left_pose = xrt.get_left_controller_pose()
right_pose = xrt.get_right_controller_pose()
headset_pose = xrt.get_headset_pose()
print(f"Left Controller Pose: {left_pose}")
print(f"Right Controller Pose: {right_pose}")
print(f"Headset Pose: {headset_pose}")
xrt.close()
2. Get Controller Inputs (Triggers, Grips, Buttons, Axes)
import xrobotoolkit_sdk as xrt
xrt.init()
# Triggers and Grips
left_trigger = xrt.get_left_trigger()
right_grip = xrt.get_right_grip()
print(f"Left Trigger: {left_trigger}, Right Grip: {right_grip}")
# Buttons
a_button_pressed = xrt.get_A_button()
x_button_pressed = xrt.get_X_button()
print(f"A Button Pressed: {a_button_pressed}, X Button Pressed: {x_button_pressed}")
# Axes
left_axis = xrt.get_left_axis()
right_axis_click = xrt.get_right_axis_click()
print(f"Left Axis: {left_axis}, Right Axis Clicked: {right_axis_click}")
# Timestamp
timestamp = xrt.get_time_stamp_ns()
print(f"Current Timestamp (ns): {timestamp}")
xrt.close()
3. Get hand tracking state
import xrobotoolkit_sdk as xrt
xrt.init()
# Left Hand State
left_hand_tracking_state = xrt.get_left_hand_tracking_state()
print(f"Left Hand State: {left_hand_tracking_state}")
# Left Hand isActive
left_hand_is_active = xrt.get_left_hand_is_active()
print(f"Left Hand isActive: {left_hand_is_active}")
# Right Hand State
right_hand_tracking_state = xrt.get_right_hand_tracking_state()
print(f"Right Hand State: {right_hand_tracking_state}")
# Right Hand isActive
right_hand_is_active = xrt.get_right_hand_is_active()
print(f"Right Hand isActive: {right_hand_is_active}")
xrt.close()
4. Get whole body motion tracking (please refer to this example when check Full Body tracking mode in UNITY app)
import xrobotoolkit_sdk as xrt
xrt.init()
# Check if body tracking data is available
if xrt.is_body_data_available():
# Get body joint poses (24 joints, 7 values each: x,y,z,qx,qy,qz,qw)
body_poses = xrt.get_body_joints_pose()
print(f"Body joints pose data: {body_poses}")
# Get body joint velocities (24 joints, 6 values each: vx,vy,vz,wx,wy,wz)
body_velocities = xrt.get_body_joints_velocity()
print(f"Body joints velocity data: {body_velocities}")
# Get body joint accelerations (24 joints, 6 values each: ax,ay,az,wax,way,waz)
body_accelerations = xrt.get_body_joints_acceleration()
print(f"Body joints acceleration data: {body_accelerations}")
# Get IMU timestamps for each joint
imu_timestamps = xrt.get_body_joints_timestamp()
print(f"IMU timestamps: {imu_timestamps}")
# Get body data timestamp
body_timestamp = xrt.get_body_timestamp_ns()
print(f"Body data timestamp: {body_timestamp}")
# Example: Get specific joint data (Head joint is index 15)
head_pose = body_poses[15] # Head joint
x, y, z, qx, qy, qz, qw = head_pose
print(f"Head pose: Position({x:.3f}, {y:.3f}, {z:.3f}) Rotation({qx:.3f}, {qy:.3f}, {qz:.3f}, {qw:.3f})")
else:
print("Body tracking data not available. Make sure:")
print("1. PICO headset is connected")
print("2. Body tracking is enabled in the control panel")
print("3. At least two Pico Swift devices are connected and calibrated")
xrt.close()
Body Joint Indices (similar to SMPL, 24 joints total):
- 0: Pelvis, 1: Left Hip, 2: Right Hip, 3: Spine1, 4: Left Knee, 5: Right Knee
- 6: Spine2, 7: Left Ankle, 8: Right Ankle, 9: Spine3, 10: Left Foot, 11: Right Foot
- 12: Neck, 13: Left Collar, 14: Right Collar, 15: Head, 16: Left Shoulder, 17: Right Shoulder
- 18: Left Elbow, 19: Right Elbow, 20: Left Wrist, 21: Right Wrist, 22: Left Hand, 23: Right Hand
Metadata
Release files for xrobotoolkit-sdk 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xrobotoolkit_sdk-1.1.0.tar.gz | 26.5 MB | Without provenance | Details for xrobotoolkit_sdk-1.1.0.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xrobotoolkit_sdk-1.1.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for xrobotoolkit_sdk-1.1.0-cp310-abi3-win_amd64.whl |
| xrobotoolkit_sdk-1.1.0-cp310-abi3-manylinux_2_34_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.34+ x86-64 | Details for xrobotoolkit_sdk-1.1.0-cp310-abi3-manylinux_2_34_x86_64.whl |
| xrobotoolkit_sdk-1.1.0-cp310-abi3-manylinux_2_34_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.34+ ARM64 | Details for xrobotoolkit_sdk-1.1.0-cp310-abi3-manylinux_2_34_aarch64.whl |
Total release size: 53.4 MB
Release files / xrobotoolkit_sdk-1.1.0.tar.gz
| Download URL | xrobotoolkit_sdk-1.1.0.tar.gz |
|---|---|
| Size | 26.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85073057869928440c0391b98203a23298722f31e1768ba56b7188f51f76fa07
|
|
BLAKE2b-256 checksum How to use checksums |
a4237f83081e3dfe991c89f1ee17aa4088e8d3e7531aa80d6199d3e150856de1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / xrobotoolkit_sdk-1.1.0-cp310-abi3-win_amd64.whl
| Download URL | xrobotoolkit_sdk-1.1.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
cad7a9c2ad06be74b8c629b3ef1d2a5242e1e31fc6725efa0b2e3f6bed6ff7c2
|
|
BLAKE2b-256 checksum How to use checksums |
20e00b1d352df1b9b30af1a4c285b55dceb5c5ca2ebc538516ed65b358877bd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / xrobotoolkit_sdk-1.1.0-cp310-abi3-manylinux_2_34_x86_64.whl
| Download URL | xrobotoolkit_sdk-1.1.0-cp310-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 8.4 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
ec8ce525110cfa742b901f8f43b4429692b1e825f1586903499732218fab3a89
|
|
BLAKE2b-256 checksum How to use checksums |
0d96f80a994b0b83088ed8f08995a70ce3c13e3cfebfa494038ff96ea74b36cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / xrobotoolkit_sdk-1.1.0-cp310-abi3-manylinux_2_34_aarch64.whl
| Download URL | xrobotoolkit_sdk-1.1.0-cp310-abi3-manylinux_2_34_aarch64.whl |
|---|---|
| Size | 16.0 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
d2c3c7314c1aee7d8f914ec255a09538d97e9a95d1d90110897891dce32d6be0
|
|
BLAKE2b-256 checksum How to use checksums |
7458f9e9f232653ae96f432e95ce6f55f4922f73e2b7daaf5fb18b036dcae7cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for xrobotoolkit-sdk 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.