Welcome to the TNY-360 API Reference!
This section documents the commands and data types available to control your TNY-360 from the different SDKs (JavaScript, Python, C/C++, ...).
The API is the common language shared by the robot firmware and these SDKs. Once you understand how the API is organized, you can move between languages without having to learn a completely different control model.
The API is organized into modules, and each module contains a set of actions.
A module represents one of the robot's subsystems, such as the body, motors, or IMU. An action is a specific command or request handled by that subsystem.
The same API concepts are exposed in each SDK, but the naming follows the conventions of the target language:
await robot.body.setVelocity(0.4, 0.0, 0.0);
await robot.body.set_velocity(0.4, 0.0, 0.0)
robot.body.setVelocity(0.4f, 0.0f, 0.0f);
In this example, the three values represent the target body velocity along the X axis, along the Y axis, and around the Z axis. The exact asynchronous syntax may vary depending on the SDK.
setVelocitycontrols the body, not an individual motor. Low-level motor commands are available in the Motor module, but should be used carefully because they bypass part of the robot's normal locomotion control.
| Concept | JavaScript / TypeScript | Python |
|---|---|---|
| Module | robot.body | robot.body |
| Action | setVelocity() | set_velocity() |
| Type names | BodyVelocity | BodyVelocity |
The API reference uses the protocol and JavaScript names for actions. The Python page for each module shows the corresponding snake_case name when it differs.
Most actions communicate with the robot and therefore return asynchronously:
await or handle the returned Promise;await inside an asyncio event loop;Always connect to the robot before calling module actions and disconnect cleanly when your program is finished. See the Python SDK and JavaScript SDK guides for complete connection examples.
Each action page documents:
An action completing its network request does not necessarily mean that the robot accepted every requested value. Check the returned status and validate the result of actions that return data.
The following table lists the modules currently exposed by the API reference. Open a module to see its actions and types.
| Module | Protocol ID | Description |
|---|---|---|
| System | 0x00 | System actions such as pinging, rebooting, and managing robot-level state. |
| Protocol | 0x01 | Communication settings such as stream frequency and stream flags. |
| Gait | 0x02 | Gait type and gait timing. |
| Body | 0x03 | Body velocity, posture, and body-level control. |
| Leg | 0x04 | Leg positions and leg-level control. |
| Joint | 0x05 | Joint angles, states, and joint-level control. |
| Motor | 0x06 | Motor duty cycles, calibration state, and low-level motor control. |
| Imu | 0x07 | Orientation, acceleration, and inertial measurements. |
| Power | 0x09 | Battery voltage, current, and power information. |
| Face | 0x0B | Facial expressions and animations. |
| I2C | 0x0E | Communication with devices connected to the I2C bus. |
| ADC | 0x0F | Analog-to-digital conversion and analog readings. |
| Wi-Fi | 0x10 | Wi-Fi configuration and network information. |
| Bluetooth | 0x11 | Bluetooth communication and controller support. |
| LED | 0x12 | Status and auxiliary LED control. |
| Error | 0x13 | Error information and error handling. |
| Diagnostic | 0x14 | Diagnostic checks and component health monitoring. |
The API reference also contains pages for Laser, Camera, Speaker, and Microphone. Their availability can depend on the installed hardware and the firmware version.
Not every module is available on every TNY-360 revision or firmware build. A module page documents the API surface, but the connected robot may still report that a feature is unavailable or unsupported.