Skip to content

The first exam for code agents in the physical world: frozen robot tasks from many benchmark suites, each answered with a program and verified in a separate sandbox. Runs on Harbor.

11.1 KB
Raw Blame

DexHand: Serve a pancake from a frying pan with a spatula

Serve the pancake from the frying pan onto the plate using the kitchen turner (spatula). The turner starts resting on the counter in front of the plate, as in the source scene; pick it up with a hand of the two-arm robot first (both hands start open). The pancake lies in the frying pan, the empty ceramic plate stands beside it on the counter. Only the turner may move the pancake: slide its blade under the pancake, lift it out of the pan on the blade, carry it to the plate, set it down in the plate and withdraw the turner. Success requires three stages in this order. (1) On the blade: the pancake touches the turner blade and no other object (no pan, plate, hand, counter or floor contact), its origin is at least 0.015 m above its starting height and it is tilted at most 30 degrees, for 10 consecutive controls. (2) Over the plate: later, while still touching only the turner, the pancake centre is within 0.058 m (horizontally) of the plate centre and above the plate floor. (3) Served: later, the pancake touches only the plate, its centre is within 0.058 m of the plate centre horizontally (the whole pancake inside the plate's 0.128 m rim radius), it is tilted at most 20 degrees from flat, its linear speed is at most 0.02 m/s and angular speed at most 0.3 rad/s, the turner does not touch it and every point of the blade outline is at least 0.08 m from the pancake centre horizontally (withdrawn); this complete condition must hold for 50 consecutive controls (1 s). The episode ends with success at that moment; skipping or reordering a stage never counts. The episode ends immediately with failure, checked after every 1 ms physics substep with no grace period, when the pancake touches the counter top or the floor, falls freely (touching nothing while its centre of mass moves down faster than 0.35 m/s, i.e. after about 6 mm of free fall) or its origin falls below the counter top (z < 0.85 m), when any part of the robot (hands, arm links, stand) touches the pancake, when the turner touches the floor, falls out of the hand (no hand contact while its centre of mass moves down faster than 0.35 m/s) or its origin falls below the counter top, when the pan or the plate moves more than 0.03 m from its starting position or tilts more than 15 degrees, when the pancake, pan, plate or turner leaves the workspace box x in [0.23, 1.13] m, y in [-0.65, 0.45] m, z in [0.80, 1.50] m, or when the physics becomes unstable; later actions cannot undo a failure. Only robot actuator targets are allowed; no object teleports, grasp welds, scripted object motion or direct object forces. The pancake is a rigid coherent disk and the turner blade bends through three passive spring hinges. The episode allows at most 3000 controls at 50 Hz; reaching that limit without success is a failure.

The robot is a fixed Tianji Marvin stand at the world origin facing +x, with two 7-joint arms and a dexterous hand on each wrist (robot id marvin-bimanual-sharpa-wave); the right arm and hand do the task and the left arm stays parked beside the torso. Every arm and finger joint is a position servo in the physics engine under native force bounds; arm servos have stiffness 700 N m/rad, damping 48 N m s/rad and no gravity compensation (a held target sags by about 1 cm at the hand under load unless your targets account for it). The turner is held only by finger and palm contact, and the pancake moves only through contact with the turner, the pan and the plate. The controller runs at 50 Hz, with twenty 1 ms physics substeps per control. World frame: metres and radians, +z up, +x forward from the robot stand, +y to the robot's left.

Scene and modelling

The scene reproduces a 22 cm non-stick frying pan (0.90 kg, free on the counter), an OXO flexible kitchen turner (0.15 kg), a ceramic plate (0.48 kg, free) and one cooked pancake (0.06 kg, about 140 mm across and 9.5 mm thick) on an oak counter whose top is at z = 0.85 m. Declared simplifications: the pancake is a single rigid coherent body (no bending, tearing, heat or fluid); the turner's thin steel-core blade is three rigid strips joined by passive spring hinges (+-0.35 rad); concave pan and plate interiors use convex sector contact shapes. Pair friction coefficients are estimates: pancake-pan 0.45, pancake-blade 0.20, blade-pan 0.20, pancake-plate 0.60, hand-turner grip 1.2, objects on the counter 0.7. The turner is not in a hand at the start: as in the source scene it rests on the counter in front of the plate, at about (0.76, -0.30, 0.878) m with its handle toward -y (handle end and blade base on the counter, the handle 16 to 30 mm above it); pick it up first. It is held only by contact (there is no weld or attachment). Physics runs at 1 ms steps, twenty per 50 Hz control.

Hands

Two genuine manufacturer hand models are available: sharpa (Sharpa Wave, 22 finger actuators; the default) and wuji (Wuji Hand 2.2, 20 finger actuators). The task, scene, mount, objects and success predicate are the same for both; only one hand is used per episode. Each row starts with the 14 Marvin arm joint targets (left arm J1-J7, then right arm J1-J7), followed by the left hand's finger targets and then the right hand's (22 per hand for sharpa, 20 per hand for wuji); the left arm is parked and only the right arm/hand perform the task. Choose the hand with Session(..., hand="wuji") or the environment variable DEXHAND_HAND=wuji (default sharpa). Action rows are 58 wide for sharpa and 54 wide for wuji; s.actuator_names gives the exact order. s.save_trajectory(actions, path) records the hand in the archive (hand member). The verifier rebuilds the scene with the recorded hand (default sharpa when the member is absent) and rejects a trajectory whose width does not match that hand; rows are never padded, truncated or converted between hands.

Action layout

Each row is one 50 Hz control with a position target for every actuator, in model order (s.actuator_names):

  • columns 0-6: left arm SHOULDER_PITCH_L_J1, SHOULDER_ROLL_L_J2, ELBOW_PITCH_L_J3, ELBOW_YAW_L_J4, WRIST_PITCH_L_J5, WRIST_YAW_L_J6, WRIST_ROLL_L_J7 (each name + _target); columns 7-13: the right arm ..._R_J1 to ..._R_J7;
  • sharpa (58 values): columns 14-35 the left Sharpa Wave fingers left_thumb_CMC_FE ... left_pinky_DIP, columns 36-57 the right Sharpa Wave fingers right_thumb_CMC_FE ... right_pinky_DIP;
  • wuji (54 values): columns 14-33 the left Wuji Hand 2.2 fingers (l_wuji_*, vendor order), columns 34-53 the right Wuji fingers (r_wuji_*).

Every target must lie within s.model.actuator_ctrlrange. Both hands start open, the right arm holding its hand above the counter and the left arm parked (task.json initial_qpos and initial_targets per hand, a settled state); s.hold_action() at reset returns the start targets and keeps that pose.

Deliverable

Save /app/output/trajectory.npz with a finite numeric actions array of shape (T, 58) for sharpa or (T, 54) for wuji, at most 3000 rows, plus the hand member (s.save_trajectory writes both), and /app/output/gen.py, the script that produced it. The separate verifier rebuilds the frozen scene with the recorded hand and replays only these motor targets in two fresh processes; both replays must succeed and end in the identical state hash. A replay stops at the first success or the first failure; later rows are not executed. Object poses, configuration overrides, pickled arrays and success claims are not deliverables and are never read. Save the archive compressed (numpy.savez_compressed; s.save_trajectory does): an archive file larger than 64 MB is rejected with reward 0.

Tooling

from rcb_dexhand import Session
s = Session("pancake_serve")               # default hand: DEXHAND_HAND or "sharpa"
s = Session("pancake_serve", hand="wuji")  # explicit hand
s.hand, s.action_dim, s.actuator_names     # selected hand, row width and exact row order
s.hold_action()                            # current motor targets
s.model.actuator_ctrlrange                 # native target limits
s.model, s.data                            # privileged MuJoCo model and state
s.features()                               # pancake pose, contacts, plate distance, withdrawal, stage, failure details
s.status()                                 # success, done, reason, steps, stage (0-3), total_stages
s.step(row)                                # twenty 1 ms physics substeps; a no-op once the episode is done
s.snapshot(), s.restore(snap)              # full simulator + verdict state, for search
s.render_frame("overview")                 # RGB uint8 (480, 640, 3); also "closeup" and "side"
s.reset()                                  # exact frozen reset
s.replay(actions)                          # reset, run rows until the episode ends, return status()
s.save_trajectory(actions, "/app/output/trajectory.npz")

Read /opt/tools/task.json, scene.py, checker.py and runtime.py for the complete geometry, failure checks and predicate. The world frame has z up; lengths are in metres and angles in radians. The counter top is at z = 0.85 m, the pan rests centred at (0.50, 0.10) and the plate at (0.76, 0.18).

External material

You may install packages you need (pip, apt), and you may read anything installed in your container, the simulator's and this benchmark's own source code included. Please solve the task yourself: do not search the web for, or download, a ready-made solution to it, such as published or reference solutions, recorded demonstrations, or policies trained for it. This is an honour rule; trials are reviewed. The network reaches your model's API and the package registries (PyPI, Debian / Ubuntu archives) only.

Resources

Your container: 2 CPUs, 10 GiB of memory, 1024 processes and threads and 10 GiB of disk (new files under /app, /tmp and /root). Your container has no GPU. CPU only slows you down; a process that goes over any other cap can be killed. Usage and caps: /run/rcb-limits/usage.json.

Time limit

You have 3600 seconds to complete this task. Do not cheat by using online solutions or hints specific to this task.

This is wall-clock time from the start of your session; the time a simulator takes to start counts. When it is up you are stopped without warning and only what is in /app/output/ at that moment is graded, so save a deliverable as soon as you have one and overwrite it whenever you have a better one. Your session started when you received this task. /run/rcb-limits/usage.json, rewritten every few seconds, gives the time left on this limit (time_left_s) and its end (deadline_utc), counted from a little before your session started, so it never gives you more time than you have: read it (or run date) before you decide that time is short, never guess. Waiting counts too: a tool call that sends input to a process that keeps running (an interactive interpreter, a simulator loop, a server) can wait for the whole wait or yield time you give it even when the answer is printed at once, so give such calls a short wait and poll again if the output is not complete, or run one-shot scripts that exit when they are done. Installing packages is not cheating (## External material above).