Skip to main content
Direct Control is the standard that serves a robot’s action space to an agent as one move tool. The idea is in Direct Control, and the setup is in the guide.

Tools

move takes keyframes, a list, and an optional note. Each keyframe has t and names body parts. A part has one space, fixed for the run by the robot’s spec, and the schema lists each part with its dimensions and ranges.
A part or dimension a keyframe leaves out holds, and so does one set to null. A position part or dimension the whole call leaves out keeps its last command, not the measured value, so a closed hand stays closed and an arm that sags under load does not drift down call by call. An ee_delta offset left out stays at zero. A base_vel part or dimension the call leaves out keeps its last commanded velocity. All parts share one clock, so everything named at one t arrives together. There is no wait tool. t is seconds from the start of the call, above 0 and increasing. Position parts follow one smooth curve through every keyframe that rests only at the last. A position or grip dimension starts from its last command, or from its measured value before its first: a hand pressing on something or closed on an object measures short of its command, and restarting from the measurement would first move the command back to it, letting go. A base_vel part ramps linearly instead, from its last command, and holds its last keyframe’s velocity after the call ends: the call returns with the base still moving at it, and the velocity stays commanded until a later call changes it. To stop, command 0 in a keyframe; the base then slows at its acceleration limit. Before the first command, a measured velocity within 5% of its range of zero counts as zero.

Replies and vetoes

A reply opens with a JSON block, then a caption and an image per camera for each frame in the history: by default one frame, now, captioned camera front, now:. With observe on, each keyframe with observe: true adds a snapshot of every camera at its t, captioned camera front at t=2.00 s of this call: and sorted by time with the history frames; see Settings.
status is completed, cut_short, refused, vetoed or ended. reason is set on a refusal or veto, and settle when settle is on. Each part reports its measured state, and the gap to its target when the call named it. A robot with several arms reports every part in the same reply, under the names the spec gives:
Readouts of something no part commands, such as a legged robot’s trunk, go under state. A move ends when its last setpoint plays, and the next one starts from the last command (see the start rule above), so a part that stopped short shows its gap in the reply. The speed check runs on the whole curve, not on the average speed between keyframes. A move from rest to rest peaks at 1.5 times its average speed, so a move can be vetoed when distance divided by time looks within the limit. With several parts, the first part to fail vetoes the call for all of them, and the reason names that part.

Clipping

A contract arm checks its controller rows against the limits its contract declares. An absolute column that already reads past a limit, such as a joint that drifted slightly beyond it, does not make every call fail: the check allows the column as far out as it is, so a call can move it back inside. The rows sent to the controller are then clipped into the declared limits, which the controller enforces anyway, so no row is ever outside them. A column that reads inside its limits is never clipped, because a row outside them is vetoed instead. A ContractEmbodiment clips only the columns a call can set.

Robot specs

A RobotSpec lists each part’s dimensions with a range and limits. A position dimension needs max_speed, and its max_accel is optional. A base_vel dimension needs max_accel, and its range caps the speed. A part’s hand position (x, y, z) or base velocity (vx, vy, vz, named linear) is one group, and its roll, pitch, yaw are another. A group’s members share one max_speed and one max_accel, and the limit caps the norm: the hand’s speed in m/s, and its turn rate along the shortest arc. Joints and grip are limited one by one. Each limit is the fastest speed the sim’s controller can actually follow. If nobody has measured that, use the robot’s rated joint speed. Never use a cautious comfort value: a slow limit makes the agent slow, and a benchmark then measures the limit, not the agent. Hand joints take Shadow Hand names: a finger, TH, FF, MF, RF or LF, then J and a number counted from the tip, so FFJ1 is the index fingertip joint. A hand with fewer joints uses the numbers of the joints it has. rua.direct.finger_joint("FF", 1) returns FFJ1. A spec has a robot class from rua.direct.CLASSES: single_arm, bimanual, dexterous_arm, complex_upper_body, simple_mobile_base, articulated_mobile_base, drone, mobile_manipulator and humanoid. A class outside the list raises a ValueError. The class and the reference string, which says how the robot is commanded (ee_abs, or base_vel + ee_abs), are labels: neither changes what a call can do, and the agent is not shown either. The interface page shows a call for each class.

Embodiments

An embodiment is the one object that knows a robot. DirectControl(embodiment) serves the move tool for it, and a new robot is a new class with these four methods. Values are in metres, radians and a grip from 0 open to 1 closed. rua ships two embodiments:

Composite

Composite gives a robot with several limbs one spec and one clock. Each member keeps its own embodiment and fills its own columns of the controller’s action. The members’ parts are renamed <member>_<part>, and a single arm’s gripper becomes hand. Two contract arms named left and right give left_arm, left_hand, right_arm and right_hand, listed in the order the members are given. The spec’s reference joins the members’ references, so an arm in joints beside an arm in hand pose reads joint_abs + ee_abs. A veto from one member leads with the robot’s part name, such as left_arm, keyframe 1: x would need a step of 0.0228 at step 2, outside the controller's limits of -0.02 to 0.02., and keeps its minimum time.

Arm against arm

The check is off by default everywhere: arms that touch play, and the sim decides what happens, so no legal action is refused. An env opts in by passing a check. It fails open: if the check raises, a warning is logged and the call plays unchecked. A clash check sees every member’s planned path at every tick, including between keyframes, and vetoes the whole call at the first tick on which two members would collide. The veto names both arms, the keyframe, what would touch and the time, and has no minimum time, since going slower does not help:
A robot whose members are known only by their contracts has no model of their links, so HandClearance is the most it can check, and it is off unless hand_clearance is set. A clash check is any callable that takes each member’s planned path and returns a Clash or None, so an env with a model of its robot can bring its own. Say in the task prompt that the arms can collide.
contract_arms builds a Composite of one ContractEmbodiment per arm from a contract whose action columns are named <prefix>.<column>, such as left.x or right.grip:
A column without a prefix, or an arm without a column, raises a ValueError that names it. Arms may differ in space, for example one in joints and one in hand pose: build each ContractEmbodiment and pass them to Composite with their columns.

ContractEmbodiment

ContractEmbodiment reads the contract’s action to decide what the agent can move, and converts between the interface’s frame and units and the controller’s. The action’s bounds are its limits, or its stats when it has none. Any other kind raises a ValueError that lists the supported ones. The arm is the part arm, and a grip column adds the part gripper. A contract arm serves one end effector, and a contract with two raises a ValueError. A contract that states only changes gives no workspace, so absolute calls to it stay within 1 m of the base origin.

Grading

DirectControl.recording holds the episode’s played ticks, each with its state and the env’s privileged state, and the done_reason and hindsight the agent gave. An env template grades it outside the sim:
A Task(instruction, measure) measures a recording: measure returns a Measure(feature, index, value, bar, unit), or None when there is nothing to measure. last_above_first(feature, index, rise) measures how far privileged[feature][index] ends above where it began. grade returns score (1.0 or 0.0), success, which is exactly value >= bar, the measure, and the agent’s done_reason and hindsight. Those two are the agent’s claims, kept beside the measure so a review can check one against the other.

Settings

The interface settings are the tunable factors of the interface itself, not of a task or an eval. rua.direct.SETTINGS holds each setting’s one default. DirectControl(embodiment) and create_direct_agent(...) each resolve every setting the same way, so the tool and the prompt agree: the value in their settings= argument, else the RUA_DC_<NAME> variable, else the default. read_settings(overrides, environ) does that resolving and returns the dict. A setting it does not know, or a value that does not parse, raises a ValueError that names it, and so does a RUA_DC_ variable that is not a setting. A run on Modal, Docker or a deployed env sets the variables where the env runs, and where the agent runs.
An episode has no limit of rua’s own. If a benchmark’s standard implementation has a time limit, the environment states it in the task prompt, since rua cannot know it. max_turns caps the model’s turns, and the agent is not told it.

create_direct_agent

Builds a HUD gateway agent, which needs HUD_API_KEY, with Direct Control’s system prompt. spec comes from embodiment.spec(). The prompt covers the move tool, the parts and their ranges, the frames and what a reply shows. It names no budget, no turn count and no time limit, and max_turns caps the model’s turns without telling it. image_turns works with Claude agents only today. Any other agent type raises a ValueError unless image_turns is None. supports_image_turns(model) says which case a model is, and overview(read_settings(), spec) returns the prompt alone.