Spaces:
Sleeping
Sleeping
File size: 5,230 Bytes
1ec9b78 |
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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
import numpy as np
from env_utils import execute, reset_to_default_pose
from perception_utils import search_object
from plan_utils import get_target_pose, get_operation
# Query: move ee forward for 10cm.
while True:
movable = search_object('gripper')
target_pose = get_target_pose(f'a point 10cm in front of {movable.position}')
success = execute(movable, target_pose)
if success: break
# Query: go back to default.
reset_to_default_pose()
# Query: move the gripper behind the bowl.
while True:
movable = search_object('gripper')
target_pose = get_target_pose('a point 15cm behind the bowl')
success = execute(movable, target_pose=target_pose)
if success: break
# Query: move to the back side of the table.
while True:
movable = search_object('gripper')
target_pose = get_target_pose('a point on the back side of the table')
success = execute(movable, target_pose=target_pose)
if success: break
# Query: move to the top of the plate.
while True:
movable = search_object('gripper')
target_pose = get_target_pose('a point 10cm above the plate')
success = execute(movable, target_pose=target_pose)
if success: break
# Query: drop the toy inside container.
while True:
movable = search_object('gripper')
target_pose = get_target_pose('a point 15cm above the container')
operation = get_operation('close everywhere but open when on top of the container')
success = execute(movable, target_pose=target_pose, operation=operation)
if success: break
# Query: push close the topmost drawer.
while True:
movable = search_object('topmost drawer handle')
target_pose = get_target_pose('a point 30cm into the topmost drawer handle')
success = execute(movable, target_pose=target_pose)
if success: break
# Query: push the second to the left block along the red line.
while True:
movable = search_object('second to the left block')
target_pose = get_target_pose('the red line')
success = execute(movable, target_pose=target_pose)
if success: break
# Query: grasp the blue block from the table.
while True:
movable = search_object('gripper')
target_pose = get_target_pose('a point at the center of blue block')
operation = get_operation('open everywhere except 1cm around the blue block')
success = execute(movable, target_pose=target_pose, operation=operation)
if success: break
# Query: move to the left of the brown block.
while True:
movable = search_object('gripper')
target_pose = get_target_pose('a point 10cm to the left of the brown block')
success = execute(movable, target_pose=target_pose)
if success: break
# Query: move to the top of the tray that contains the lemon.
while True:
movable = search_object('gripper')
target_pose = get_target_pose('a point 10cm above the tray that contains the lemon')
success = execute(movable, target_pose=target_pose)
if success: break
# Query: close drawer by 5cm.
while True:
movable = search_object('drawer handle')
target_pose = get_target_pose('a point 5cm into the drawer handle')
success = execute(movable, target_pose=target_pose)
if success: break
# Query: move to 5cm on top of the soda can, when within 20cm of the wooden mug.
while True:
movable = search_object('gripper')
target_pose = get_target_pose('a point 5cm above the soda can')
success = execute(movable, target_pose=target_pose)
if success: break
# Query: wipe the red dot.
while True:
movable = search_object('gripper')
target_pose = get_target_pose('the red dot')
success = execute(movable, target_pose=target_pose)
if success: break
# Query: grasp the mug from the shelf.
while True:
movable = search_object('gripper')
target_pose = get_target_pose('a point at the center of the mug handle')
operation = get_operation('open everywhere except 1cm around the mug handle')
success = execute(movable, target_pose=target_pose, operation=operation)
if success: break
# Query: move to 10cm on top of the soup bowl, and 5cm to the left of the soup bowl.
while True:
movable = search_object('gripper')
target_pose = get_target_pose('a point 10cm above and 5cm to the left of the soup bowl')
success = execute(movable, target_pose=target_pose)
if success: break
# Query: open gripper.
while True:
movable = search_object('gripper')
operation = get_operation('open everywhere')
success = execute(movable, operation=operation)
if success: break
# Query: sweep all particles to the left side of the table.
particles = search_object('particles')
for particle in particles:
while True:
movable = particle
target_pose = get_target_pose('a point on the left side of the table')
success = execute(particle, target_pose=target_pose)
if success: break
# Query: grasp the bottom drawer handle.
while True:
movable = search_object('gripper')
target_pose = get_target_pose('a point at the center of the bottom drawer handle')
operation = get_operation('open everywhere except 1cm around the bottom drawer handle')
success = execute(movable, target_pose=target_pose, operation=operation)
if success: break |