File size: 36,499 Bytes
97b7684
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
 "adjust_bottle": "",
 "beat_block_hammer": "# Skills available for this task (call as plain functions, robot first):\ndef lower_onto_target(robot, target_name, place_side, hover_height, lower_delta):\n    \"\"\"Carry the held object over a DETECTED target and lower it onto/into it.\"\"\"\n    # where is the target, and which way is the wrist pointing right now?\n    target = robot.detect_objects_oneshot(target_name)\n    state = robot.get_robot_state()\n    target_pos = target.data['detections'][0]['position_3d']\n    # hover above the target, keeping the CURRENT rpy so the carried object is not re-oriented\n    robot.move_arm(place_side, [target_pos[0], target_pos[1], target_pos[2] + hover_height], state.data[place_side]['ee_rpy'])\n    # lower it in\n    robot.servo_ee_delta(place_side, lower_delta)\n",
 "blocks_ranking_rgb": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "blocks_ranking_size": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "click_alarmclock": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\n",
 "click_bell": "# Skills available for this task (call as plain functions, robot first):\ndef tap_press_with_gripper(robot, target_name, side):\n    \"\"\"Close the gripper into a rigid tip and press/tap a target's actuating face, then stop.\"\"\"\n    # form the rigid tip -- nothing is being grasped\n    robot.close_gripper(side)\n    # drive onto the actuating face\n    robot.press(target_name, side)\n",
 "dump_bin_bigbin": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef tilt_pour_over_target(robot, vessel_name, target_name, side, aim_delta, approach_rpy, tilt_deg=90.0):\n    \"\"\"Carry a HELD vessel over a receptacle, tip it out, bring it back upright.\"\"\"\n    # find the receptacle in the current frame\n    target = robot.detect_objects_oneshot(target_name)\n    # carry the vessel over it\n    robot.move_arm(side, target.data['detections'][0]['position_3d'], approach_rpy)\n    # rise clear of the rim before tipping\n    robot.servo_ee_delta(side, aim_delta)\n    # tip -- THIS is the pour\n    robot.rotate(vessel_name, tilt_deg, side)\n    # back upright, or it keeps emptying\n    robot.rotate(vessel_name, -tilt_deg, side)\n",
 "grab_roller": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\n",
 "handover_block": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\n",
 "handover_mic": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\n",
 "hanging_mug": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\n",
 "lift_pot": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\n",
 "move_can_pot": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "move_pillbottle_pad": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "move_playingcard_away": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "move_stapler_pad": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "open_laptop": "# Skills available for this task (call as plain functions, robot first):\ndef pull_open_and_hold(robot, object_name, direction, side):\n    \"\"\"Take hold of a handle/leaf/free end where it sits and draw it open\"\"\"\n    # Take it where it sits.\n    robot.grasp(object_name, side)\n    # Draw it open / out along the direction.\n    robot.move_arm(side, direction)\n",
 "open_microwave": "# Skills available for this task (call as plain functions, robot first):\ndef pull_open_and_hold(robot, object_name, direction, side):\n    \"\"\"Take hold of a handle/leaf/free end where it sits and draw it open\"\"\"\n    # Take it where it sits.\n    robot.grasp(object_name, side)\n    # Draw it open / out along the direction.\n    robot.move_arm(side, direction)\n",
 "pick_diverse_bottles": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\n",
 "pick_dual_bottles": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\n",
 "place_a2b_left": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "place_a2b_right": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "place_bread_basket": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef lower_onto_target(robot, target_name, place_side, hover_height, lower_delta):\n    \"\"\"Carry the held object over a DETECTED target and lower it onto/into it.\"\"\"\n    # where is the target, and which way is the wrist pointing right now?\n    target = robot.detect_objects_oneshot(target_name)\n    state = robot.get_robot_state()\n    target_pos = target.data['detections'][0]['position_3d']\n    # hover above the target, keeping the CURRENT rpy so the carried object is not re-oriented\n    robot.move_arm(place_side, [target_pos[0], target_pos[1], target_pos[2] + hover_height], state.data[place_side]['ee_rpy'])\n    # lower it in\n    robot.servo_ee_delta(place_side, lower_delta)\n",
 "place_bread_skillet": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\n",
 "place_burger_fries": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\n",
 "place_can_basket": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "place_cans_plasticbox": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef lower_onto_target(robot, target_name, place_side, hover_height, lower_delta):\n    \"\"\"Carry the held object over a DETECTED target and lower it onto/into it.\"\"\"\n    # where is the target, and which way is the wrist pointing right now?\n    target = robot.detect_objects_oneshot(target_name)\n    state = robot.get_robot_state()\n    target_pos = target.data['detections'][0]['position_3d']\n    # hover above the target, keeping the CURRENT rpy so the carried object is not re-oriented\n    robot.move_arm(place_side, [target_pos[0], target_pos[1], target_pos[2] + hover_height], state.data[place_side]['ee_rpy'])\n    # lower it in\n    robot.servo_ee_delta(place_side, lower_delta)\n",
 "place_container_plate": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "place_dual_shoes": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef lower_onto_target(robot, target_name, place_side, hover_height, lower_delta):\n    \"\"\"Carry the held object over a DETECTED target and lower it onto/into it.\"\"\"\n    # where is the target, and which way is the wrist pointing right now?\n    target = robot.detect_objects_oneshot(target_name)\n    state = robot.get_robot_state()\n    target_pos = target.data['detections'][0]['position_3d']\n    # hover above the target, keeping the CURRENT rpy so the carried object is not re-oriented\n    robot.move_arm(place_side, [target_pos[0], target_pos[1], target_pos[2] + hover_height], state.data[place_side]['ee_rpy'])\n    # lower it in\n    robot.servo_ee_delta(place_side, lower_delta)\ndef place_two_objects_together(robot, left_object, right_object, target_name):\n    \"\"\"Both arms carry one object each and set them into the same target together.\"\"\"\n    robot.close_gripper('left')\n    robot.close_gripper('right')\n    robot.place(left_object, target_name, 'left')\n    robot.place(right_object, target_name, 'right')\n",
 "place_empty_cup": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "place_fan": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "place_mouse_pad": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "place_object_basket": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "place_object_scale": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "place_object_stand": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "place_phone_stand": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "place_shoe": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "press_stapler": "",
 "put_bottles_dustbin": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef lower_onto_target(robot, target_name, place_side, hover_height, lower_delta):\n    \"\"\"Carry the held object over a DETECTED target and lower it onto/into it.\"\"\"\n    # where is the target, and which way is the wrist pointing right now?\n    target = robot.detect_objects_oneshot(target_name)\n    state = robot.get_robot_state()\n    target_pos = target.data['detections'][0]['position_3d']\n    # hover above the target, keeping the CURRENT rpy so the carried object is not re-oriented\n    robot.move_arm(place_side, [target_pos[0], target_pos[1], target_pos[2] + hover_height], state.data[place_side]['ee_rpy'])\n    # lower it in\n    robot.servo_ee_delta(place_side, lower_delta)\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "put_object_cabinet": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef lower_onto_target(robot, target_name, place_side, hover_height, lower_delta):\n    \"\"\"Carry the held object over a DETECTED target and lower it onto/into it.\"\"\"\n    # where is the target, and which way is the wrist pointing right now?\n    target = robot.detect_objects_oneshot(target_name)\n    state = robot.get_robot_state()\n    target_pos = target.data['detections'][0]['position_3d']\n    # hover above the target, keeping the CURRENT rpy so the carried object is not re-oriented\n    robot.move_arm(place_side, [target_pos[0], target_pos[1], target_pos[2] + hover_height], state.data[place_side]['ee_rpy'])\n    # lower it in\n    robot.servo_ee_delta(place_side, lower_delta)\n",
 "rotate_qrcode": "# Skills available for this task (call as plain functions, robot first):\ndef rotate_in_hand(robot, object_name, side, angle_deg):\n    \"\"\"Pick an object up and turn it about the wrist to a required orientation.\"\"\"\n    robot.pick(object_name, side)\n    robot.rotate(object_name, angle_deg, side)\n",
 "scan_object": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\n",
 "shake_bottle": "# Skills available for this task (call as plain functions, robot first):\ndef shake_held_object(robot, object_name, side, shake_delta):\n    \"\"\"Pick an object up and oscillate it once out-and-back along one axis.\"\"\"\n    robot.pick(object_name, side)\n    robot.servo_ee_delta(side, shake_delta)\n    robot.servo_ee_delta(side, [-shake_delta[0], -shake_delta[1], -shake_delta[2]])\n",
 "shake_bottle_horizontally": "",
 "stack_blocks_three": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef lower_onto_target(robot, target_name, place_side, hover_height, lower_delta):\n    \"\"\"Carry the held object over a DETECTED target and lower it onto/into it.\"\"\"\n    # where is the target, and which way is the wrist pointing right now?\n    target = robot.detect_objects_oneshot(target_name)\n    state = robot.get_robot_state()\n    target_pos = target.data['detections'][0]['position_3d']\n    # hover above the target, keeping the CURRENT rpy so the carried object is not re-oriented\n    robot.move_arm(place_side, [target_pos[0], target_pos[1], target_pos[2] + hover_height], state.data[place_side]['ee_rpy'])\n    # lower it in\n    robot.servo_ee_delta(place_side, lower_delta)\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "stack_blocks_two": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "stack_bowls_three": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef lower_onto_target(robot, target_name, place_side, hover_height, lower_delta):\n    \"\"\"Carry the held object over a DETECTED target and lower it onto/into it.\"\"\"\n    # where is the target, and which way is the wrist pointing right now?\n    target = robot.detect_objects_oneshot(target_name)\n    state = robot.get_robot_state()\n    target_pos = target.data['detections'][0]['position_3d']\n    # hover above the target, keeping the CURRENT rpy so the carried object is not re-oriented\n    robot.move_arm(place_side, [target_pos[0], target_pos[1], target_pos[2] + hover_height], state.data[place_side]['ee_rpy'])\n    # lower it in\n    robot.servo_ee_delta(place_side, lower_delta)\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "stack_bowls_two": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "stamp_seal": "# Skills available for this task (call as plain functions, robot first):\ndef relocate_object(robot, object_name, target_name, side):\n    \"\"\"Move an object from where it sits to a named target: lift it clear and\"\"\"\n    # lift it clear of the surface\n    robot.pick(object_name, side)\n    # set it down at the target and let go\n    robot.place(object_name, target_name, side)\n",
 "turn_switch": "# Skills available for this task (call as plain functions, robot first):\ndef approach_best_grasp(robot, object_name, approach_side, close_in_delta):\n    \"\"\"Sample grasps for an object, take the best reachable one, and bring the\"\"\"\n    # rank the sampled grasps by reachability for THIS arm\n    candidates = robot.sample_grasp_pose(object_name)\n    best = robot.select_best_grasp(candidates.data['grasps'], side=approach_side)\n    # drive the end-effector onto the winning grasp pose\n    robot.move_arm(approach_side, best.data['grasp'].position, best.data['grasp'].rpy)\n    # close the last centimetres with a bounded nudge\n    robot.servo_ee_delta(approach_side, close_in_delta)\ndef lower_onto_target(robot, target_name, place_side, hover_height, lower_delta):\n    \"\"\"Carry the held object over a DETECTED target and lower it onto/into it.\"\"\"\n    # where is the target, and which way is the wrist pointing right now?\n    target = robot.detect_objects_oneshot(target_name)\n    state = robot.get_robot_state()\n    target_pos = target.data['detections'][0]['position_3d']\n    # hover above the target, keeping the CURRENT rpy so the carried object is not re-oriented\n    robot.move_arm(place_side, [target_pos[0], target_pos[1], target_pos[2] + hover_height], state.data[place_side]['ee_rpy'])\n    # lower it in\n    robot.servo_ee_delta(place_side, lower_delta)\n"
}