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.
Python ai-agentsbenchmarkcoding-agentsembodied-aievaluationharborllm-agentsrobot-learningroboticssimulation
"""Reference solution of a MuJoCo Playground quadruped realtime task: the privileged reference's rows
(solution/oracle.npy, one row per control step) planned into the episode from its first step in one `submit(at=0)`
(chunks of at most max_chunk_s, each planned at the step where it takes over), then the episode is watched to its end.
It uses no privileged information at run time; on the realtime clock the rows run at the same control steps as in
the privileged replay, so the graded trajectory is the reference."""
import os
import sys
import time
import numpy as np
from rcb_client import Robot
rows = np.load(os.path.join(os.path.dirname(os.path.abspath(__file__)), "oracle.npy")).astype(np.float32).astype(np.float64)
r = Robot()
spec = r.spec()
dt = float(spec["control_dt"])
n = max(1, int(round(float(spec["max_chunk_s"]) / dt)))
for at in range(0, len(rows), n):
while at and r.status()["control_steps"] < at - n // 2: # the next chunk once the plan is half through
time.sleep(0.05)
r.submit("joint_position", rows[at:at + n], dt=dt, interpolate="hold", at=at, cameras=[])
while not r.status()["done"]:
time.sleep(0.2)
st = r.status()
print(st)
sys.exit(0 if st.get("reason") == "success" else 1)