def init_episode(self, index: int) -> List[str]: option = OPTIONS[index] conditions = [ DetectedCondition(self.cup, self.success_sensor), NothingGrasped(self.robot.gripper) ] if option == 'left': self.waypoint0.set_position( self.left_initial_waypoint.get_position()) self.waypoint1.set_position( self.left_close_waypoint.get_position()) self.waypoint2.set_position(self.left_far_waypoint.get_position()) self.waypoint6.set_position( self.place_cup_left_waypoint.get_position()) conditions.append(JointCondition(self.left_joint, 0.06)) else: conditions.append(JointCondition(self.right_joint, 0.06)) self.register_success_conditions(conditions) return [ 'put cup in %s cabinet' % option, 'put the mug away in the %s half of the cabinet' % option, 'open the %s side of the cabinet and put the cup away in it' % option, 'grasping the %s handle, open the cabinet, then pick up the cup' ' and set it down inside the cabinet' % option, 'slide open the %s door on the cabinet and put away the mug' % option ]
def init_episode(self, index: int) -> List[str]: self._variation_index = index b = SpawnBoundary([self.boundary]) for holder in self.holders: b.sample(holder, min_distance=0.01) self.w1 = Dummy('waypoint1') self.w1.set_position([0, 0, +10*10**(-3)], relative_to=self.bulb_glass_visual[index % 2], reset_dynamics=False) target_color_name, target_color_rgb = colors[index] color_choice = np.random.choice( list(range(index)) + list( range(index + 1, len(colors))), size=1, replace=False)[0] _, distractor_color_rgb = colors[color_choice] self.holders[index % 2].set_color(target_color_rgb) other_index = {0: 1, 1: 0} self.holders[other_index[index % 2]].set_color(distractor_color_rgb) self.register_success_conditions([DetectedCondition( self.bulbs[index % 2], ProximitySensor('success')), NothingGrasped(self.robot.gripper)]) return ['screw in the %s light bulb' % target_color_name, 'screw the light bulb from the %s holder into the lamp' % target_color_name, 'pick up the light bulb from the %s stand, lift it up to just ' 'above the lamp, then screw it down into the lamp in a ' 'clockwise fashion' % target_color_name, 'put the light bulb from the %s casing into the lamp' % target_color_name]
def init_task(self) -> None: phone = Shape('phone') self.register_graspable_objects([phone]) self.register_success_conditions([ DetectedCondition(phone, ProximitySensor('success')), NothingGrasped(self.robot.gripper) ])
def init_task(self): success_sensor = ProximitySensor('success') umbrella = Shape('umbrella') self.register_graspable_objects([umbrella]) self.register_success_conditions( [DetectedCondition(umbrella, success_sensor), NothingGrasped(self.robot.gripper)])
def init_task(self) -> None: piece2 = Shape('solve_puzzle_piece2') self.register_graspable_objects([piece2]) self.register_success_conditions([ NothingGrasped(self.robot.gripper), DetectedCondition(piece2, ProximitySensor('success')) ])
def init_task(self) -> None: roll = Shape('toilet_roll') success_sensor = ProximitySensor('success') self.register_graspable_objects([roll]) self.register_success_conditions( [DetectedCondition(roll, success_sensor, negated=True), NothingGrasped(self.robot.gripper)])
def init_task(self) -> None: needle_minute = Shape('clock_needle_minute') success_detector = ProximitySensor('detector_minute0') self.register_success_conditions([ NothingGrasped(self.robot.gripper), DetectedCondition(needle_minute, success_detector) ])
def init_task(self): wine_bottle = Shape('wine_bottle') self.register_graspable_objects([wine_bottle]) self.register_success_conditions([ DetectedCondition(wine_bottle, ProximitySensor('success')), NothingGrasped(self.robot.gripper) ])
def init_task(self) -> None: self.needle = Shape('scales_meter_needle') self.needle_pivot = Shape('scales_meter_pivot') self.top_plate = Shape('scales_tray_visual') self.joint = Joint('scales_joint') _, _, starting_z = self.top_plate.get_position() self.top_plate_starting_z = starting_z self.needle_starting_ori = self.needle.get_orientation( relative_to=self.needle_pivot) self.peppers = [Shape('pepper%d' % i) for i in range(3)] self.register_graspable_objects(self.peppers) self.boundary = Shape('peppers_boundary') self.success_detector = ProximitySensor('success_detector') self.needle_detector = ProximitySensor('needle_sensor') self.success_conditions = [ NothingGrasped(self.robot.gripper), DetectedCondition(self.needle, self.needle_detector) ] self.w0 = Dummy('waypoint0') self.w0_rel_pos = [ +2.6203 * 10**(-3), -1.7881 * 10**(-7), +1.5197 * 10**(-1) ] self.w0_rel_ori = [-3.1416, -1.7467 * 10**(-2), -3.1416]
def init_task(self) -> None: bottle = Shape('bottle') success_sensor = ProximitySensor('success') self.register_graspable_objects([bottle]) self.register_success_conditions( [DetectedCondition(bottle, success_sensor), NothingGrasped(self.robot.gripper)])
def init_task(self) -> None: self.bulbs_visual = [Shape('light_bulb%d' % i) for i in range(2)] self.bulb_glass_visual = [Shape('bulb%d' % i) for i in range(2)] self.holders = [Shape('bulb_holder%d' % i) for i in range(2)] self.bulbs = [Shape('bulb_phys%d' % i) for i in range(2)] self.conditions = [NothingGrasped(self.robot.gripper)] self.register_graspable_objects(self.bulbs) self.boundary = Shape('spawn_boundary')
def init_task(self) -> None: success_detector = ProximitySensor('success') tray = Shape('tray') self.register_graspable_objects([tray]) self.register_success_conditions([ DetectedCondition(tray, success_detector, negated=True), NothingGrasped(self.robot.gripper) ])
def init_task(self) -> None: success_detector = ProximitySensor('success') self.tray = Shape('tray') self.register_graspable_objects([self.tray]) self.register_success_conditions( [DetectedCondition(self.tray, success_detector), NothingGrasped(self.robot.gripper)]) self.boundary = SpawnBoundary([Shape('oven_tray_boundary')])
def init_task(self) -> None: success_sensor = ProximitySensor('success') frame = Shape('frame') frame_detector = Shape('frame_detector') self.register_graspable_objects([frame]) self.register_success_conditions([ DetectedCondition(frame_detector, success_sensor), NothingGrasped(self.robot.gripper) ])
def init_task(self) -> None: self.hanger_holder = Shape('hanger_holder') hanger = Shape('clothes_hanger') success_detector = ProximitySensor('success_detector0') self.register_success_conditions([ NothingGrasped(self.robot.gripper), DetectedCondition(hanger, success_detector) ]) self.register_graspable_objects([hanger]) self.workspace_boundary = SpawnBoundary([Shape('workspace')])
def init_task(self) -> None: middle_sensor = ProximitySensor('middle_sensor') right_sensor = ProximitySensor('right_sensor') wand = Shape('wand') self.register_graspable_objects([wand]) self.register_success_conditions([ DetectedCondition(wand, middle_sensor, negated=True), DetectedCondition(wand, right_sensor), NothingGrasped(self.robot.gripper) ])
def init_task(self) -> None: self.hanger = Shape('clothes_hanger0') self.initx, self.inity, self.initz = self.hanger.get_position() self.register_graspable_objects([self.hanger]) success_detector = ProximitySensor('success_detector') hanger_visual = Shape('clothes_hanger_visual0') self.register_success_conditions([ DetectedCondition(hanger_visual, success_detector), NothingGrasped(self.robot.gripper) ])
def init_task(self) -> None: self.index_dic = {0: 'bottom', 1: 'middle', 2: 'top'} self.money = Shape('dollar_stack') self.money_boundary = Shape('dollar_stack_boundary') self.register_graspable_objects([self.money]) self.success_conditions = [NothingGrasped(self.robot.gripper)] self.w1_rel_pos = [-2.7287 * 10 ** (-4), -2.3246 * 10 ** (-6), +4.5627 * 10 ** (-2)] self.w1_rel_ori = [-3.1416, 7.2824 * 10 ** (-1), -2.1265 * 10 ** (-2)]
def init_task(self): shoe1 = Shape('shoe1') shoe2 = Shape('shoe2') self.register_graspable_objects([shoe1, shoe2]) success_sensor = ProximitySensor('success') self.register_success_conditions([ DetectedCondition(shoe1, success_sensor), DetectedCondition(shoe2, success_sensor), NothingGrasped(self.robot.gripper) ])
def init_task(self) -> None: frame = Shape('frame') self.register_graspable_objects([frame]) self.register_success_conditions([ DetectedCondition(frame, ProximitySensor('hanger_detector'), negated=True), DetectedCondition(frame, ProximitySensor('success')), NothingGrasped(self.robot.gripper) ])
def init_task(self) -> None: knife = Shape('knife') success = ProximitySensor('success') self.knife_block = Shape('knife_block') self.chopping_board = Shape('chopping_board') self.register_graspable_objects([knife]) cond_set = ConditionSet([DetectedCondition(knife, success), NothingGrasped(self.robot.gripper)], order_matters=True) self.register_success_conditions([cond_set]) self.boundary = SpawnBoundary([Shape('boundary')])
def init_task(self) -> None: self.plate = Shape('plate') self.success_poses = [Dummy('success_pos%d' % i) for i in range(3)] self.register_graspable_objects([self.plate]) self.register_success_conditions([ DetectedCondition(self.plate, ProximitySensor('success_source'), negated=True), DetectedCondition(self.plate, ProximitySensor('success_target')), NothingGrasped(self.robot.gripper) ])
def init_task(self) -> None: target = Shape('target_cuboid') original_detector = ProximitySensor('original_detector') bricks = [Shape('Cuboid%d' % i) for i in range(13)] conds = [DetectedCondition(b, original_detector) for b in bricks] conds.extend([ DetectedCondition(target, original_detector, negated=True), NothingGrasped(self.robot.gripper) ]) self.register_success_conditions(conds) self.register_graspable_objects([target])
def init_task(self) -> None: roll = Shape('toilet_roll') self.boundary_roll = SpawnBoundary([Shape('boundary_roll')]) self.boundary_stand = SpawnBoundary([Shape('boundary_stand')]) self.roll_box = Shape('toilet_roll_box') self.stand_base = Shape('stand_base') success_sensor = ProximitySensor('success') self.register_graspable_objects([roll]) self.register_success_conditions( [DetectedCondition(roll, success_sensor), NothingGrasped(self.robot.gripper)])
def init_task(self) -> None: bottle_detector = ProximitySensor("bottle_detector") cap_detector = ProximitySensor("cap_detector") bottle = Shape('bottle') self.joint = Joint('joint') self.cap = Shape('cap') self.register_success_conditions( [DetectedCondition(bottle, bottle_detector), DetectedCondition(self.cap, cap_detector, negated=True), NothingGrasped(self.robot.gripper)]) self.cap_turned_condition = JointCondition( self.joint, np.deg2rad(150))
def init_task(self) -> None: success_sensor = ProximitySensor('success') book0 = Shape('book0') book1 = Shape('book1') book2 = Shape('book2') self.register_success_conditions([ DetectedCondition(book0, success_sensor), DetectedCondition(book1, success_sensor), DetectedCondition(book2, success_sensor), NothingGrasped(self.robot.gripper) ]) self.register_graspable_objects([book2, book1, book0])
def init_episode(self, index: int) -> List[str]: self.boundary.clear() [self.boundary.sample(g, min_distance=0.1) for g in self.groceries] self.waypoint1.set_pose(self.grasp_points[index].get_pose()) self.register_success_conditions( [DetectedCondition(self.groceries[index], ProximitySensor('success')), NothingGrasped(self.robot.gripper)]) return ['put the %s in the cupboard' % GROCERY_NAMES[index], 'pick up the %s and place it in the cupboard' % GROCERY_NAMES[index], 'move the %s to the bottom shelf' % GROCERY_NAMES[index], 'put away the %s in the cupboard' % GROCERY_NAMES[index]]
def init_task(self) -> None: sensor_right_hole = ProximitySensor('sensor1') sensor_left_hole = ProximitySensor('sensor2') charger = Shape('charger') self.charger_base = Dummy('charger_base') charger_right_stick = Shape('detector1') charger_left_stick = Shape('detector2') self.boundary = SpawnBoundary([Shape('charger_boundary')]) self.register_graspable_objects([charger]) self.register_success_conditions([ DetectedCondition(charger_right_stick, sensor_right_hole), DetectedCondition(charger_left_stick, sensor_left_hole), NothingGrasped(self.robot.gripper) ])
def init_task(self) -> None: plate = Shape('plate') fork = Shape('fork') knife = Shape('knife') spoon = Shape('spoon') glass = Shape('glass') self.register_success_conditions([ DetectedCondition(plate, ProximitySensor('plate_detector')), DetectedCondition(fork, ProximitySensor('fork_detector')), DetectedCondition(knife, ProximitySensor('knife_detector')), DetectedCondition(spoon, ProximitySensor('spoon_detector')), DetectedCondition(glass, ProximitySensor('glass_detector')), NothingGrasped(self.robot.gripper) ]) self.register_graspable_objects([plate, fork, knife, spoon, glass])
def init_task(self) -> None: plate = Shape('plate') self.dish_rack = Shape('dish_rack') self.plate_stand = Shape('plate_stand') self.success_sensor = ProximitySensor('success') self.success_poses = [Dummy('success_pos%d' % i) for i in range(3)] self.pillars = [Shape('dish_rack_pillar%d' % i) for i in range(6)] self.boundary = SpawnBoundary([Shape('boundary')]) self.register_graspable_objects([plate]) cond_set = ConditionSet([ DetectedCondition(plate, self.success_sensor), NothingGrasped(self.robot.gripper) ], order_matters=True) self.register_success_conditions([cond_set])