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.

1.4 KB
Raw Blame
{
 "methods": [
  {
   "cls": "Powerlift",
   "module": "humanoid_bench.envs.powerlift",
   "name": "get_reward",
   "source": "def get_reward(self):\n    standing = rewards.tolerance(\n        self.robot.head_height(),\n        bounds=(_STAND_HEIGHT, float(\"inf\")),\n        margin=_STAND_HEIGHT / 3,\n    )\n    upright = rewards.tolerance(\n        self.robot.torso_upright(),\n        bounds=(0.8, float(\"inf\")),\n        sigmoid=\"linear\",\n        margin=1.9,\n        value_at_margin=0,\n    )\n    stand_reward = standing * upright\n    small_control = rewards.tolerance(\n        self.robot.actuator_forces(),\n        margin=10,\n        value_at_margin=0,\n        sigmoid=\"quadratic\",\n    ).mean()\n    small_control = (4 + small_control) / 5\n\n    dumbbell_height = self._env.named.data.xpos[\"dumbbell\", \"z\"]\n    reward_dumbbell_lifted = rewards.tolerance(\n        dumbbell_height, bounds=(1.9, 2.1), margin=2\n    )\n\n    reward = 0.2 * (small_control * stand_reward) + 0.8 * reward_dumbbell_lifted\n    return reward, {\n        \"stand_reward\": stand_reward,\n        \"small_control\": small_control,\n        \"reward_dumbbell_lifted\": reward_dumbbell_lifted,\n        \"standing\": standing,\n        \"upright\": upright,\n    }"
  }
 ],
 "module_globals": {
  "humanoid_bench.envs.powerlift": "_STAND_HEIGHT = 1.65"
 },
 "task_class": "humanoid_bench.envs.powerlift.Powerlift"
}