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

# Direct Control

> Let an agent move a robot with tool calls: it names where each part goes and when, then looks at the result.

In direct control, the agent is the policy. It looks at the camera images and moves the robot with one tool call at a time. No trained robot policy sits in between. The examples use one arm on a table, and [the same tool serves every kind of robot](#every-robot-one-tool), from two arms to a drone.

## One call, then a look

Each call is one move. The interface checks it, plays it on the robot, and replies with the camera images, the state of every part, and the gap to the target. The agent looks, then decides the next call.

## One tool, named parts

`move` is the only motion tool. Each keyframe names the body parts it moves, such as `arm` and `gripper`. A part has one space, fixed for the run: a hand pose, a hand pose change, joint angles, a grip value, or a base's velocity or pose. A different robot has different parts, so the tool's schema lists them with their ranges.

A call names only what it changes. A part or dimension left out keeps its last command, the gripper included, and a moving base left out comes to rest. Positions are in metres in the robot's base frame (x forward, y left, z up), angles are in degrees, and `grip` runs from 0 (open) to 1 (closed).

## A move is a few keyframes

A **keyframe** says where the robot should be and when. The interface draws one smooth curve through all of them and stops only at the last.

![A side view of the hand following one smooth curve through three keyframes at 1.5, 3.0, and 4.0 seconds.](https://mintcdn.com/rua-docs-mirror/LFSTnYdqqaVRgoqO/images/interfaces/direct-control-keyframes.svg?fit=max\&auto=format\&n=LFSTnYdqqaVRgoqO\&q=85\&s=a3183586e688d344c0f23c3bcbdd18ec)

One call, three keyframes: lift, carry over the plate, lower and close.

```python theme={"dark"}
move(keyframes=[
    {"t": 1.5, "arm": {"z": 0.15}},
    {"t": 3.0, "arm": {"x": 0.33, "y": 0.10}},
    {"t": 4.0, "arm": {"z": 0.12}, "gripper": 1.0},
])
```

* **Time sets speed.** `t` is seconds from the start of the call.
* **To pause,** repeat a pose at a later `t`. There is no `wait` tool.
* **Parts share a clock.** Everything named at one `t` arrives together.
* **A hand pose change** (`ee_delta`) counts from the pose at the start of the call, not from the previous keyframe.

## Every robot, one tool

The tool does not change with the robot. A **spec** lists the robot's parts, each with its space and ranges, and the tool's schema and description are generated from it. Two arms are four parts, and one keyframe can move all of them, so both arms arrive on the same clock:

```python theme={"dark"}
move(keyframes=[
    {"t": 2.0, "left_arm": {"x": 0.4, "z": 0.3}, "right_arm": {"x": 0.5, "y": -0.3}},
    {"t": 3.0, "left_hand": 1.0, "right_hand": 0.5},
])
```

Every other robot is the same call with different parts.

| Robot | Parts, with their space |
| - | - |
| Single arm | `arm` (hand pose or joints), `gripper` (grip) |
| Bimanual | `left_arm` and `right_arm` (hand pose or joints), `left_hand` and `right_hand` (grip) |
| Dexterous hand on an arm | `arm` (hand pose), `hand` (finger joints, or grip) |
| Complex upper body | `torso` and `head` (joints), `left_arm` and `right_arm` (hand pose), `left_hand` and `right_hand` (grip) |
| Simple mobile base | `base` (velocity), or `drive` (velocity) and `steering` (joint) for a car |
| Legged robot | `base` (velocity) to walk, or one part per leg (joints) |
| Drone | `base` (velocity, including `vz`) |
| Mobile manipulator | `base` (velocity), `torso` (joints), `arm` (hand pose), `gripper` (grip) |
| Humanoid | `base` (velocity), `torso` (joints), `left_arm` and `right_arm` (hand pose), both hands (finger joints), or every joint |

A robot that can be driven two ways, such as a legged robot by velocity or by leg joints, has one spec per way, and the run picks one. Part and dimension names come from the spec, so these calls show the shape and not fixed names.

```python Single arm theme={"dark"}
move(keyframes=[
    {"t": 2.0, "arm": {"x": 0.45, "z": 0.20, "yaw": 90}},
    {"t": 3.0, "arm": {"z": 0.12}, "gripper": 1.0},
])
```

```python Dexterous hand theme={"dark"}
move(keyframes=[
    {"t": 1.5, "arm": {"x": 0.4, "z": 0.15}, "hand": {"THJ2": 40, "FFJ3": 20}},
    {"t": 2.5, "arm": {"z": 0.10}, "hand": {"FFJ3": 60, "FFJ2": 50}},
])
```

```python Upper body theme={"dark"}
move(keyframes=[
    {"t": 2.0, "torso": {"waist_yaw": 30}, "left_arm": {"x": 0.35, "z": 0.3}},
    {"t": 3.0, "left_arm": {"z": 0.2}, "left_hand": 1.0, "head": {"neck_pitch": 20}},
])
```

```python Mobile base theme={"dark"}
# Speed up to 0.2 m/s, turn left while driving, then stop.
move(keyframes=[
    {"t": 1.0, "base": {"vx": 0.2}},
    {"t": 3.0, "base": {"vx": 0.2, "wz": 45}},
    {"t": 4.0, "base": {"vx": 0.0, "wz": 0}},
])
```

```python Car theme={"dark"}
move(keyframes=[
    {"t": 1.0, "drive": {"vx": 0.5}, "steering": {"steer": 20}},
    {"t": 4.0, "drive": {"vx": 0.0}, "steering": {"steer": 0}},
])
```

```python Legged theme={"dark"}
# Walk forward, then stop.
move(keyframes=[
    {"t": 3.0, "base": {"vx": 0.5}},
    {"t": 4.0, "base": {"vx": 0.0}},
])
```

```python Drone theme={"dark"}
# Climb, then fly forward while turning.
move(keyframes=[
    {"t": 1.0, "base": {"vz": 0.5}},
    {"t": 2.0, "base": {"vz": 0.0}},
    {"t": 5.0, "base": {"vx": 1.0, "wz": 30}},
    {"t": 6.0, "base": {"vx": 0.0, "wz": 0}},
])
```

```python Mobile manipulator theme={"dark"}
move(keyframes=[
    {"t": 3.0, "base": {"vx": 0.3}, "torso": {"lift": 0.30}, "arm": {"x": 0.35, "z": 0.5}},
    {"t": 4.0, "base": {"vx": 0.0}, "arm": {"x": 0.5}, "gripper": 1.0},
])
```

```python Humanoid theme={"dark"}
# Walk to the table, then reach with the left arm while leaning.
move(keyframes=[
    {"t": 4.0, "base": {"vx": 0.4, "wz": 10}},
    {"t": 5.0, "base": {"vx": 0.0, "wz": 0}},
    {"t": 7.0, "left_arm": {"x": 0.35, "y": 0.20, "z": 0.20}, "torso": {"waist_pitch": 10}},
])
```

rua ships embodiments for any robot known by its contract and for several of those joined as one robot. Any other robot plugs in by implementing the embodiment protocol. Both are in the [reference](https://docs.rua.hud.ai/reference/direct-control.md#embodiments), and each robot class has a page in the [embodiment gallery](https://docs.rua.hud.ai/catalog.md).

## What comes back

Every reply has an image from each camera showing now, the measured state of every part, and the gap to the target for each part the call named. It never says whether the task is going well.

## When a call does not play

A call can end three ways other than playing in full. The reply always says which and why, so the agent can plan again.

* **Refused.** The call is malformed: an unknown part, a value out of range, a missing or non-increasing `t`, or too many keyframes. Nothing moves, and the reason names the part and the keyframe.
* **Vetoed.** The call is well formed but the robot cannot do it safely, for example a pose out of reach, a joint past its limit, or a collision. Nothing moves. A move that is too fast or too sharp comes back with the minimum feasible time. The interface checks the whole curve for every part, including between keyframes, so one bad keyframe on one arm vetoes the call for both.
* **Cut short.** A call that would play longer than the call limit, 10 s by default, is not refused. It plays up to the limit and says it was cut short, so the agent learns the limit from the reply.

An arm known only by its contract has one more rule. It never sends the controller a value outside the limits the contract declares. If a part reads slightly past a limit, for example a joint that drifted, a call may move it back inside, and the values sent are clipped to the limit until it is. That call is not refused or vetoed.

## Limitations

* **Posture.** A hand pose does not fix the elbow. A robot whose arm is in a joint space sets it directly.
* **Precision.** A move ends when its last setpoint plays, so the arm can finish short. The gap shows by how much.
* **Moving things.** The agent sees one snapshot per camera. Past frames (`frame_history`) and snapshots at observed keyframes (`observe`) are opt-in, and how best to see motion is an open question.
* **Reaction.** Control returns at least every 10 s by default, and the agent cannot interrupt a move that is playing.
* **Collisions between arms.** By default nothing vetoes one arm hitting the other; the simulator decides. An env can opt in to an arm against arm check. The task prompt should say the arms can collide.
* **The table and objects.** Contact with the table and objects is never refused, since touching things is often the task. The simulator decides contact.

> [!WARNING]
>
> **Image memory works with Claude agents only.** The standard keeps images from the last 10 turns. OpenAI keeps its conversation on its own servers, so an OpenAI agent keeps every image and behaves differently on the same task. Do not compare the two until a `hud-python` change lands.

For every field and setting, see the [reference](https://docs.rua.hud.ai/reference/direct-control.md). To control the robot by writing code against the same moves, see [Code Control](https://docs.rua.hud.ai/interfaces/code-as-policy.md). [Hierarchical Control](https://docs.rua.hud.ai/interfaces/hierarchical-control.md) is coming soon.


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