> ## 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.

# Complex upper body

> A torso that turns, a head that looks, two arms and two grippers, all on one clock.

> [!NOTE]
>
> **Class** `complex_upper_body` · **Parts** `torso`, `head`, `left_arm`, `right_arm`, `left_hand`, `right_hand` · **Env** `robocoliseum` (AgiBot G2 omnipicker)

The G2 has two 7-joint arms, a waist and a head. The agent can look, lean and reach in one keyframe.

## What `move` takes

| Part | Space | Dimensions |
| - | - | - |
| `torso` | `joint_abs` | five waist joints in degrees: `body_pitch1`, `body_pitch2`, `waist_pitch`, `waist_roll`, `waist_yaw` |
| `head` | `joint_abs` | `neck_yaw`, `neck_pitch` in degrees |
| `left_arm`, `right_arm` | `ee_abs` | `x`, `y`, `z`, `roll`, `pitch`, `yaw` of the gripper point, in the base frame |
| `left_hand`, `right_hand` | `grip` | a bare number, 0 open to 1 closed |

## Example spec

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

from rua.direct import Dim, Part, RobotSpec

HAND_SPEED_M_S = 6.0
WRIST_SPEED_RAD_S = 30.0
BODY_SPEED_RAD_S = 1.0
GRIP_SPEED_PER_S = 10.0 / 0.785


def arm(name: str) -> Part:
    return Part(
        name,
        "ee_abs",
        (
            Dim("x", "m", -0.2, 1.1, HAND_SPEED_M_S),
            Dim("y", "m", -1.0, 1.0, HAND_SPEED_M_S),
            Dim("z", "m", 0.0, 1.9, HAND_SPEED_M_S),
            *(
                Dim(axis, "rad", -math.pi, math.pi, WRIST_SPEED_RAD_S, wraps=True)
                for axis in ("roll", "pitch", "yaw")
            ),
        ),
    )


def hand(name: str) -> Part:
    return Part(name, "grip", (Dim("grip", "1", 0.0, 1.0, GRIP_SPEED_PER_S),))


SPEC = RobotSpec(
    "complex_upper_body",
    "ee_abs",
    (
        Part(
            "torso",
            "joint_abs",
            (
                Dim("body_pitch1", "rad", -1.06, 0.0, BODY_SPEED_RAD_S),
                Dim("body_pitch2", "rad", 0.0, 2.65, BODY_SPEED_RAD_S),
                Dim("waist_pitch", "rad", -1.91, 1.57, BODY_SPEED_RAD_S),
                Dim("waist_roll", "rad", -0.43, 0.43, BODY_SPEED_RAD_S),
                Dim("waist_yaw", "rad", -3.05, 3.05, BODY_SPEED_RAD_S),
            ),
        ),
        Part(
            "head",
            "joint_abs",
            (
                Dim("neck_yaw", "rad", -3.14, 3.14, BODY_SPEED_RAD_S),
                Dim("neck_pitch", "rad", -0.52, 0.52, BODY_SPEED_RAD_S),
            ),
        ),
        arm("left_arm"),
        arm("right_arm"),
        hand("left_hand"),
        hand("right_hand"),
    ),
)
```

## Example calls

Look down and left while raising the left hand and closing the right gripper:

```json move theme={"dark"}
{
  "keyframes": [
    {
      "t": 2.0,
      "head": {"neck_yaw": 25, "neck_pitch": 20},
      "left_arm": {"x": 0.6, "y": 0.3, "z": 1.05},
      "right_hand": 1.0
    }
  ],
  "note": "look down-left while raising the left hand and closing the right gripper"
}
```

Turn the waist and the hands stay:

```json move theme={"dark"}
{"keyframes": [{"t": 1.2, "torso": {"waist_yaw": 20}}], "note": "turn the waist, hands stay"}
```

```json done theme={"dark"}
{"reason": "Both items are in the bin."}
```

## What comes back

Every part's measured state and the gap for each named part, and the head and wrist cameras.

## Limits

* A hand target holds in the base frame while the torso moves: the arm's IK compensates every tick.
* Vetoes an arm target out of reach, a joint over its speed limit, and forearms passing through each other or the chest.
* Needs a GPU, and the first observation takes about two minutes after launch.


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