🚀 Overview
tny-robotics-sdk provides a clean, asynchronous API to communicate with your TNY Robotics robot.
It handles all the complex binary WebSocket framing and event loop bindings under the hood using asyncio, letting you focus on building advanced robotics applications, telemetry scripts, or AI/control algorithms.
✨ Features
- Native Async: Built entirely on top of
asyncioandwebsocketsfor high-performance, non-blocking I/O. - Fully Typed: Strict type hints and
TypedDictimplementations for excellent auto-completion and Developer Experience (DX) in VS Code, PyCharm, etc. - Modular: Access robot features cleanly through dedicated modules (
robot.system,robot.joint,robot.power, etc.).
📦 Installation
Install the package using pip (or your preferred environment manager like poetry or pipenv):
pip install tny-robotics-sdk
💻 Quick Start
Here is a simple example to connect to your TNY-360 and test the connection latency:
import asyncio
import time
from tny_robotics import TNY360
async def main():
print('Creating TNY-360 instance...')
# Replace with your robot's IP address
robot = TNY360('192.168.4.1')
try:
print('Connecting to TNY-360...')
await robot.connect()
print('Connected successfully!')
except Exception as err:
print('Connection error:', err)
return
# Ping test
print('Sending pings...')
start = time.time()
for _ in range(10):
await robot.system.ping()
end = time.time()
# Calculate average time in milliseconds
avg_time = ((end - start) * 1000) / 10
print(f"Average response time: {avg_time:.2f} ms.")
# Clean disconnect
await robot.disconnect()
if __name__ == '__main__':
asyncio.run(main())
🧩 API Structure
The SDK is organized into intuitive modules. Here are some examples of what you can do:
System & Settings
# Get robot statistics
stats = await robot.system.get_statistics()
print(f"Temperature: {stats['temp_c']}°C, CPU0 Usage: {stats['cpu_usage']['core0']}%")
# Change AutoLife mode
from tny_robotics import AutoLifeLevel
await robot.system.set_auto_life_level(AutoLifeLevel.Safeguard)
Motion & Joints
import math
from tny_robotics import MotorId
# Set the front-right knee joint to 30 degrees (converted to radians)
await robot.joint.set_angle(MotorId.FrontRightKneePitch, 30 * (math.pi / 180))
# Get the current angle of the back-left hip roll joint
cur_angle = await robot.joint.get_feedback_angle(MotorId.BackLeftHipRoll)
print(f"Current Hip Roll Angle: {cur_angle * (180 / math.pi):.2f} degrees")
Sensors & Telemetry (Coming soon)
# Subscribe to continuous Lidar distance updates
# (Implementation in progress)
🤝 Contributing
This SDK is part of the open-source TNY-Robotics ecosystem. Found a bug or want to add a new module? Open an Issue or submit a Pull Request!
📄 License
This SDK is licensed under the MIT License. You are free to use it in your open-source or commercial applications, just include the copyright notice.
Metadata
Release files for tny-robotics-sdk 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tny_robotics_sdk-1.2.1.tar.gz | 15.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tny_robotics_sdk-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.8 kB
Release files / tny_robotics_sdk-1.2.1.tar.gz
| Download URL | tny_robotics_sdk-1.2.1.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f0c508d130180ea5edf49ad6dff6df5ae378e0b49529c6963cc4b43345bd96a
|
|
BLAKE2b-256 checksum How to use checksums |
4e20cd55324d5aefe1afd8d3119b16de8bd3eb2a5f33ee6b67d3c41638f6e479
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency logRelease files / tny_robotics_sdk-1.2.1-py3-none-any.whl
| Download URL | tny_robotics_sdk-1.2.1-py3-none-any.whl |
|---|---|
| Size | 21.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ef28a069380df6ba6fb68ea4c49d7955692631f5ba1b6fd4c5df93db3b54bf9
|
|
BLAKE2b-256 checksum How to use checksums |
57fc9cae241775a55ae97ef718af1a908f6a0ee53b21a4f22e9bd860f043dd9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.
Transparency log