> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rua.hud.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Humanoid

> A Unitree G1: walk to the table and reach, or drive every joint.

> [!NOTE]
>
> **Class** `humanoid` · **Parts** `base`, `torso`, `left_arm`, `right_arm`, both hands · **Env** `humanoid` (Unitree G1 with Dex3 hands)

Two references, one per run:

| | `wbc` (whole body) | `joints` (every joint) |
| - | - | - |
| Balance | a whole-body policy walks and balances | none: the agent keeps the robot standing |
| Parts | `base`, `torso`, `left_arm`, `right_arm`, `left_hand`, `right_hand` | `left_leg`, `right_leg`, `torso`, `left_arm`, `right_arm`, `left_hand`, `right_hand` |
| Spaces | `base_vel`; `torso` and hands `joint_abs`; arms `ee_abs` | all `joint_abs` |

## Example spec

The `wbc` reference without the two hands, which are seven Dex3 joints each in `joint_abs`:

```python Spec theme={"dark"}
import math

from rua.direct import Dim, Part, RobotSpec

DEG = math.pi / 180
HAND_BOX = {"x": (-0.4, 0.6), "y": (-0.6, 0.6), "z": (-0.3, 0.8)}


def arm(name: str) -> Part:
    return Part(
        name,
        "ee_abs",
        (
            *(Dim(axis, "m", *HAND_BOX[axis], 1.0) for axis in "xyz"),
            *(
                Dim(axis, "rad", -math.pi, math.pi, 180 * DEG, wraps=True)
                for axis in ("roll", "pitch", "yaw")
            ),
        ),
    )


SPEC = RobotSpec(
    "humanoid",
    "base_vel + ee_abs",
    (
        Part(
            "base",
            "base_vel",
            (
                Dim("vx", "m/s", -0.5, 1.0, max_accel=1.0),
                Dim("vy", "m/s", -0.3, 0.3, max_accel=1.0),
                Dim("wz", "rad/s", -60 * DEG, 60 * DEG, max_accel=120 * DEG),
            ),
        ),
        Part(
            "torso",
            "joint_abs",
            (
                Dim("waist_yaw", "rad", -60 * DEG, 60 * DEG, 20 * DEG),
                Dim("waist_roll", "rad", -30 * DEG, 30 * DEG, 20 * DEG),
                Dim("waist_pitch", "rad", -30 * DEG, 30 * DEG, 20 * DEG),
            ),
        ),
        arm("left_arm"),
        arm("right_arm"),
    ),
)
```

## Example calls

`wbc`: walk forward a little while raising the left hand.

```json move theme={"dark"}
{
  "keyframes": [
    {
      "t": 3.0,
      "base": {"vx": 0.3},
      "torso": {"waist_yaw": 10},
      "left_arm": {"x": 0.30, "y": 0.25, "z": 0.25, "roll": 0, "pitch": 0, "yaw": 0}
    },
    {"t": 4.0, "base": {"vx": 0.0}}
  ],
  "note": "walk forward a little while raising the left hand"
}
```

`joints`: the arm part is named in its own joints, such as `left_shoulder_pitch`.

```json move joints theme={"dark"}
{
  "keyframes": [
    {
      "t": 2.0,
      "left_arm": {"left_shoulder_pitch": -40, "left_elbow": 30},
      "torso": {"waist_yaw": 15}
    }
  ],
  "note": "raise the left arm and turn the waist"
}
```

```json done theme={"dark"}
{"reason": "The box is on the table."}
```

## What comes back

Each part's state and the gap for each named part, and the head and a follow camera.

## Limits

* `wbc` base: `vx` -0.5 to 1.0 m/s, `vy` ±0.3 m/s, `wz` ±60 deg/s. Waist yaw is held to ±60 degrees because the walking policy loses its heading past that.
* Vetoes self-collision, an unreachable hand, and joint speed. `wbc` skips the legs, since the policy decides their pose.
* The hands are Dex3: seven finger joints each, no spread and no ring or little finger.
* A part left out holds its last command, which is what keeps the `joints` robot standing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.