1. Install
rua needs Python 3.11 or 3.12.These pages describe rua 0.2.4 and later. The
rua 0.0.1 release on PyPI holds only the
eval interface. To try an unreleased commit, install
"rua @ git+https://github.com/hud-evals/rua.git@<sha>".2. Write a simulator
A simulator is aRobotBridge: three hooks and a contract that describes the robot’s action and observations.
This one is a gripper that tracks its commanded (x, y) exactly. It succeeds once x reaches 0.5 with the
gripper closed. Save it as sim.py:
sim.py
attach_gym serves it, and direct control needs only a short contract.
3. Declare the environment
RobotEndpoint runs the bridge in its own process. DirectControl serves the robot as one MCP move tool,
and ContractEmbodiment builds the robot’s parts from the contract alone. The task template resets the sim,
hands the agent the sim’s instruction as its prompt, and returns the sim’s grade. Save it as env.py:
env.py
4. Move the robot
An agent is anything that opens thecontrol capability and calls its tools. This one plays two fixed move
calls, each a list of timed keyframes. In practice the agent is a tool-calling LLM, as in
the last section. Save it as run.py:
run.py
5. Run it
ended, because the task succeeded while the second move played. Each spawn also prints a
harmless RuntimeWarning from runpy about rua.sim.bridge, left out of the output above, and warnings from
HUD, which you can silence with python -W ignore run.py.
Try a move that is too fast, such as "t": 0.5 for the arm. The reply is vetoed and says how long the move
needs. Nothing moves.
What just happened
LocalRuntimeloadedenv.py.RobotEndpointstarted the bridge in its own process, andDirectControlserved acontrolcapability next to therobotwire.- The
reachtemplate calledsim.reset(...). The sim reset itself and returned its instruction as the prompt. - The agent opened
controland calledmove. Each call was checked against the contract’s limits and the speeds you gaveContractEmbodiment, then played tick by tick on the sim. - When the task succeeded, the template returned
sim.result(): a score of1.0. The score became the reward.
HUD_API_KEY set, the same run also streams every tick’s state, every move request and the camera
video to a trace on hud.ai.
Let an LLM drive it
Swap the scripted agent for a model from the HUD gateway.create_direct_agent builds one with the system
prompt for move, and needs HUD_API_KEY. In run.py, replace Scripted() with:
Next steps
Concepts
The sim process, the wire, slots and the agent loop.
Serving a gym env
Build args, vectorized envs, and contract files.
Direct control
Spaces, units, settings and two arms.
Code control
Let an LLM write Python against the same checked moves.