示例#1
0
class PutGroceriesInCupboard(Task):

    def init_task(self) -> None:
        self.groceries = [Shape(name.replace(' ', '_'))
                          for name in GROCERY_NAMES]
        self.grasp_points = [Dummy('%s_grasp_point' % name.replace(' ', '_'))
                             for name in GROCERY_NAMES]
        self.waypoint1 = Dummy('waypoint1')
        self.register_graspable_objects(self.groceries)
        self.boundary = SpawnBoundary([Shape('workspace')])

    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 variation_count(self) -> int:
        return len(GROCERY_NAMES)

    def boundary_root(self) -> Object:
        return Shape('boundary_root')

    def base_rotation_bounds(self) -> Tuple[Tuple[float, float, float],
                                            Tuple[float, float, float]]:
        return (0.0, 0.0, -1.), (0.0, 0.0, 1.)
示例#2
0
    def __init__(self,
                 pyrep: PyRep,
                 robot: Robot,
                 obs_config=ObservationConfig()):
        self._pyrep = pyrep
        self._robot = robot
        self._obs_config = obs_config
        self._active_task = None
        self._inital_task_state = None
        self._start_arm_joint_pos = robot.arm.get_joint_positions()
        self._starting_gripper_joint_pos = robot.gripper.get_joint_positions()
        self._workspace = Shape('workspace')
        self._workspace_boundary = SpawnBoundary([self._workspace])
        self._cam_over_shoulder_left = VisionSensor('cam_over_shoulder_left')
        self._cam_over_shoulder_right = VisionSensor('cam_over_shoulder_right')
        self._cam_wrist = VisionSensor('cam_wrist')
        self._cam_over_shoulder_left_mask = VisionSensor(
            'cam_over_shoulder_left_mask')
        self._cam_over_shoulder_right_mask = VisionSensor(
            'cam_over_shoulder_right_mask')
        self._cam_wrist_mask = VisionSensor('cam_wrist_mask')
        self._has_init_task = self._has_init_episode = False
        self._variation_index = 0

        self._initial_robot_state = (robot.arm.get_configuration_tree(),
                                     robot.gripper.get_configuration_tree())

        # Set camera properties from observation config
        self._set_camera_properties()
示例#3
0
    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]
class PutKnifeOnChoppingBoard(Task):

    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_episode(self, index: int) -> List[str]:
        self.boundary.clear()
        self.boundary.sample(self.knife_block)
        return ['put the knife on the chopping board',
                'slide the knife out of the knife block and put it down on the '
                'chopping board',
                'place the knife on the chopping board',
                'pick up the knife and leave it on the chopping board',
                'move the knife from the holder to the chopping board']

    def variation_count(self) -> int:
        return 1
示例#5
0
    def init_episode(self, index: int) -> List[str]:
        pillar0 = Shape('hannoi_square_pillar0')
        pillar1 = Shape('hannoi_square_pillar1')
        pillar2 = Shape('hannoi_square_pillar2')
        spokes = [pillar0, pillar1, pillar2]

        color_name, color_rgb = colors[index]
        chosen_pillar = np.random.choice(spokes)
        chosen_pillar.set_color(color_rgb)
        _, _, z = self.success_centre.get_position()
        x, y, _ = chosen_pillar.get_position()
        self.success_centre.set_position([x, y, z])

        color_choices = np.random.choice(list(range(index)) +
                                         list(range(index + 1, len(colors))),
                                         size=2,
                                         replace=False)
        spokes.remove(chosen_pillar)
        for spoke, i in zip(spokes, color_choices):
            name, rgb = colors[i]
            spoke.set_color(rgb)

        boundary1 = Shape('hannoi_square_boundary0')
        square_ring = Shape('hannoi_square_ring')
        b = SpawnBoundary([boundary1])
        b.sample(square_ring)

        return [
            'put the ring on the %s spoke' % color_name,
            'slide the ring onto the %s colored spoke' % color_name,
            'place the ring onto the %s spoke' % color_name
        ]
示例#6
0
class PlaceHangerOnRack(Task):
    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_episode(self, index: int) -> List[str]:
        self.workspace_boundary.clear()
        self.workspace_boundary.sample(self.hanger_holder)
        return [
            'pick up the hanger and place in on the rack'
            'put the hanger on the rack', 'hang the hanger up',
            'grasp the hanger and hang it up'
        ]

    def variation_count(self) -> int:
        return 1

    def is_static_workspace(self) -> bool:
        return True
示例#7
0
class PutTrayInOven(Task):

    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_episode(self, index: int) -> List[str]:
        self.boundary.clear()
        self.boundary.sample(
            self.tray, min_rotation=(0, 0, 0), max_rotation=(0, 0, 0))
        return ['put tray in oven',
                'place the tray in the oven',
                'open the oven, then slide the tray in',
                'open the oven door, pick up the tray, and put it down on the '
                'oven shelf']


    def variation_count(self) -> int:
        return 1

    def base_rotation_bounds(self) -> Tuple[List[float], List[float]]:
        return [0, 0, -3.14 / 4.], [0, 0, 3.14 / 4.]

    def boundary_root(self) -> Object:
        return Shape('oven_boundary_root')
示例#8
0
 def init_episode(self, index: int) -> List[str]:
     b = SpawnBoundary([self.boundary])
     success = ProximitySensor('success')
     for obj in self.jars:
         b.sample(obj, min_distance=0.01)
     w0 = Dummy('waypoint0')
     w0.set_orientation([-np.pi, 0, -np.pi], reset_dynamics=False)
     w0.set_position([0, 0, 0.1],
                     relative_to=self.lids[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.jars[index % 2].set_color(target_color_rgb)
     other_index = {0: 1, 1: 0}
     self.jars[other_index[index % 2]].set_color(distractor_color_rgb)
     self.conditions += [DetectedCondition(self.lids[index % 2], success)]
     self.register_success_conditions(self.conditions)
     return [
         'open the %s jar' % target_color_name,
         'unscrew the %s jar' % target_color_name,
         'grasp the lid of the %s jar, unscrew it in an anti_clockwise '
         'direction until it is removed from the jar, and leave it on '
         'the table top' % target_color_name,
         'remove the lid from the %s jam jar and set it down on the '
         'table' % target_color_name
     ]
示例#9
0
 def init_episode(self, index: int) -> List[str]:
     detectors = [ProximitySensor('success%d' % i) for i in range(2)]
     self.register_success_conditions([
         self.joint_conditions[index],
         DetectedCondition(self.remote, detectors[0]),
         DetectedCondition(self.remote, detectors[1])
     ])
     self.register_graspable_objects([self.remote])
     w6 = Dummy('waypoint6')
     _, _, z = w6.get_position(relative_to=self.remote)
     rel_pos_lst = [
         Shape('target_button_wrap1').get_position(relative_to=self.remote),
         Shape('target_button_wrap2').get_position(relative_to=self.remote)
     ]
     rel_pos_lst[index % 2][2] = z
     w6.set_position(rel_pos_lst[index],
                     relative_to=self.remote,
                     reset_dynamics=False)
     b = SpawnBoundary([self.boundary])
     b.sample(self.remote)
     btn = {0: 'plus', 1: 'minus'}
     chnl = {0: 'up', 1: 'minus'}
     return [
         'turn the channel %s' % chnl[index],
         'change the television channel %s' % chnl[index],
         'point the remote at the tv and press the %s button to turn '
         'the channel %s' % (btn[index], chnl[index]),
         'using the tv remote, ensure it is facing the television and '
         'press the %s button to increment the channel %s by one' %
         (btn[index], chnl[index]),
         'find the %s button on the remote, rotate the remote such that'
         ' it is pointed at the tv, then press the button to change '
         'the channel %s' % (chnl[index], btn[index])
     ]
    def init_episode(self, index: int) -> List[str]:
        color_name, color_rgb = colors[index]
        self.target.set_color(color_rgb)
        color_choices = np.random.choice(list(range(index)) +
                                         list(range(index + 1, len(colors))),
                                         size=2,
                                         replace=False)
        for ob, i in zip([self.distractor0, self.distractor1], color_choices):
            name, rgb = colors[i]
            ob.set_color(rgb)
        b = SpawnBoundary([self.boundaries])
        for ob in [self.target, self.distractor0, self.distractor1]:
            b.sample(ob,
                     min_distance=0.2,
                     min_rotation=(0, 0, 0),
                     max_rotation=(0, 0, 0))

        # change the position of the robot
        q = self.robot.arm.get_joint_positions()
        new_q = np.array([1.2, 0, 0, 0, 0, 0, 0]) + q
        self.robot.arm.set_joint_positions(new_q)

        self.step_in_episode = 0

        return [
            'reach the %s target' % color_name,
            'touch the %s ball with the panda gripper' % color_name,
            'reach the %s sphere' % color_name
        ]
示例#11
0
    def init_episode(self, index: int) -> List[str]:
        self.target_shelf = index
        w4 = Dummy('waypoint4')
        target_dummy_name = 'dummy_shelf' + str(self.target_shelf)
        target_pos_dummy = Dummy(target_dummy_name)
        target_pos = target_pos_dummy.get_position()
        w4.set_position(target_pos, reset_dynamics=False)

        self.success_detector = ProximitySensor(
            ('success_detector' + str(self.target_shelf))
        )

        while len(self.success_conditions) > 1:
            self.success_conditions.pop()

        self.success_conditions.append(
            DetectedCondition(self.money, self.success_detector)
        )
        self.register_success_conditions(self.success_conditions)

        b = SpawnBoundary([self.money_boundary])
        b.sample(self.money,
                 min_rotation=(0.00, 0.00, 0.00),
                 max_rotation=(0.00, 0.00, +0.5 * np.pi))

        return ['put the money away in the safe on the %s shelf'
                % self.index_dic[index],
                'leave the money on the %s shelf on the safe'
                % self.index_dic[index],
                'place the stack of bank notes on the %s shelf of the safe'
                % self.index_dic[index]]
示例#12
0
文件: tv_on.py 项目: stepjam/RLBench
class TvOn(Task):
    def init_task(self) -> None:
        self._remote = Shape('tv_remote')
        self._spawn_boundary = SpawnBoundary([Shape('spawn_boundary')])
        self.register_graspable_objects([self._remote])
        self.register_success_conditions(
            [JointCondition(Joint('target_button_joint0'), 0.003)])

    def init_episode(self, index: int) -> List[str]:
        self._spawn_boundary.clear()
        self._spawn_boundary.sample(self._remote)
        return [
            'turn on the TV',
            'point the remote control at the television and turn on the '
            'television',
            'pick up the remote and rotate it such that the front of the '
            'remote is pointed straight at the television, then set the '
            'remote down and press the power button down in order to switch'
            ' on the TV',
            'find the power button at the top of the remote, ensure the '
            'remote is pointed at the tv, then turn the tv on'
        ]

    def variation_count(self) -> int:
        return 1

    def base_rotation_bounds(
            self
    ) -> Tuple[Tuple[float, float, float], Tuple[float, float, float]]:
        return (0.0, 0.0, -0.5 * np.pi), (0.0, 0.0, +0.5 * np.pi)
示例#13
0
 def init_episode(self, index: int) -> List[str]:
     b = SpawnBoundary([self.boundary])
     for obj in self.jars:
         b.sample(obj, min_distance=0.01)
     success = ProximitySensor('success')
     success.set_position([0.0, 0.0, 0.05],
                          relative_to=self.jars[index % 2],
                          reset_dynamics=False)
     w3 = Dummy('waypoint3')
     w3.set_orientation([-np.pi, 0, -np.pi], reset_dynamics=False)
     w3.set_position([0.0, 0.0, 0.125],
                     relative_to=self.jars[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.jars[index % 2].set_color(target_color_rgb)
     other_index = {0: 1, 1: 0}
     self.jars[other_index[index % 2]].set_color(distractor_color_rgb)
     self.conditions += [DetectedCondition(self.lid, success)]
     self.register_success_conditions(self.conditions)
     return [
         'close the %s jar' % target_color_name,
         'screw on the %s jar lid' % target_color_name,
         'grasping the lid, lift it from the table and use it to seal '
         'the %s jar' % target_color_name,
         'pick up the lid from the table and put it on the %s jar' %
         target_color_name
     ]
class PlugChargerInPowerSupply(Task):
    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_episode(self, index: int) -> List[str]:
        self.boundary.clear()
        self.boundary.sample(self.charger_base)
        return [
            'plug charger in power supply',
            'pick up the charger and plug in it',
            'plug the charger into the mains',
            'lift the charger up to the wall and plug it in',
            'plug the charger into the wall'
        ]

    def variation_count(self) -> int:
        return 1

    def base_rotation_bounds(self) -> Tuple[List[float], List[float]]:
        return [0, 0, -3.14 / 4.], [0, 0, 3.14 / 4.]
示例#15
0
 def init_task(self) -> None:
     self.block = Shape('block')
     self.success_sensor = ProximitySensor('success')
     self.register_success_conditions([
         DetectedCondition(self.block, self.success_sensor)])
     self.target = Shape('target')
     self.workspace = Shape('workspace')
     self.target_boundary = SpawnBoundary([Shape('target_boundary')])
示例#16
0
 def init_task(self) -> None:
     self.groceries = [Shape(name.replace(' ', '_'))
                       for name in GROCERY_NAMES]
     self.grasp_points = [Dummy('%s_grasp_point' % name.replace(' ', '_'))
                          for name in GROCERY_NAMES]
     self.waypoint1 = Dummy('waypoint1')
     self.register_graspable_objects(self.groceries)
     self.boundary = SpawnBoundary([Shape('workspace')])
示例#17
0
 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')])
示例#18
0
    def init_task(self) -> None:
        self.dirt_spots = []
        self.sponge = Shape('sponge')
        self.sensor = ProximitySensor('sponge_sensor')
        self.register_graspable_objects([self.sponge])

        boundaries = [Shape('dirt_boundary')]
        _, _, self.z_boundary = boundaries[0].get_position()
        self.b = SpawnBoundary(boundaries)
示例#19
0
 def init_task(self) -> None:
     self.cup1 = Shape('cup1')
     self.cup2 = Shape('cup2')
     self.cup1_visual = Shape('cup1_visual')
     self.cup2_visual = Shape('cup2_visual')
     self.boundary = SpawnBoundary([Shape('boundary')])
     self.register_graspable_objects([self.cup1, self.cup2])
     self.register_success_conditions([
         DetectedCondition(self.cup1, ProximitySensor('success')),
     ])
示例#20
0
 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')])
示例#21
0
    def init_episode(self, index: int) -> List[str]:

        color_name, color_rgb = colors[index]
        self.target.set_color(color_rgb)
        b = SpawnBoundary([self.boundaries])
        for ob in [self.target]:
            b.sample(ob,
                     min_distance=0.2,
                     min_rotation=(0, 0, 0),
                     max_rotation=(0, 0, 0))
        return ['reach the %s target' % color_name]
 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)])
示例#23
0
 def init_task(self) -> None:
     self.large_container = Shape('large_container')
     self.target_container0 = Shape('small_container0')
     self.target_container1 = Shape('small_container1')
     self.success_detector0 = ProximitySensor('success0')
     self.success_detector1 = ProximitySensor('success1')
     self.target_waypoint = Dummy('waypoint3')
     self.spawn_boundary = SpawnBoundary([Shape('spawn_boundary')])
     self.register_waypoint_ability_start(1, self._move_above_object)
     self.register_waypoints_should_repeat(self._repeat)
     self.bin_objects = []
 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')])
示例#25
0
    def init_task(self) -> None:
        self.spawn_boundary = SpawnBoundary([Shape('spawn_boundary')])
        self.target = Shape('target')

        self.bin_objects = []
        self.block, self.block_visual = get_one_procedural_object_by_index(
            self.get_base(), self.procedural_ind)
        self.block_pose = self.block.get_pose()
        self.block_visual.set_color(self.COLOR_TUPLE)
        self.register_graspable_objects([self.block])
        self.ind = 0
示例#26
0
 def init_task(self) -> None:
     self.cup1 = Shape('cup1')
     self.cup2 = Shape('cup2')
     self.cup1_visual = Shape('cup1_visual')
     self.cup2_visual = Shape('cup2_visual')
     self.boundary = SpawnBoundary([Shape('boundary')])
     self.success_sensor = ProximitySensor('success')
     self.register_graspable_objects([self.cup1, self.cup2])
     self.register_success_conditions([
         DetectedCondition(self.cup1, self.success_sensor, negated=True),
         GraspedCondition(self.robot.gripper, self.cup1),
     ])
示例#27
0
 def init_task(self) -> None:
     self._remote = Shape('tv_remote')
     self._joint_conditions = [
         JointCondition(Joint('target_button_joint1'), 0.003),
         JointCondition(Joint('target_button_joint2'), 0.003)
     ]
     self._w6 = Dummy('waypoint6')
     self._w6z = self._w6.get_position()[2]
     self.register_graspable_objects([self._remote])
     self._spawn_boundary = SpawnBoundary([Shape('spawn_boundary')])
     self._target_buttons = [
         Shape('target_button_wrap1'), Shape('target_button_wrap2')]
示例#28
0
class WipeDesk(Task):
    def init_task(self) -> None:
        self.dirt_spots = []
        self.sponge = Shape('sponge')
        self.sensor = ProximitySensor('sponge_sensor')
        self.register_graspable_objects([self.sponge])

        boundaries = [Shape('dirt_boundary')]
        _, _, self.z_boundary = boundaries[0].get_position()
        self.b = SpawnBoundary(boundaries)

    def init_episode(self, index: int) -> List[str]:
        self._place_dirt()
        self.register_success_conditions([EmptyCondition(self.dirt_spots)])
        return [
            'wipe dirt off the desk', 'use the sponge to clean up the desk',
            'remove the dirt from the desk',
            'grip the sponge and wipe it back and forth over any dirt you '
            'see', 'clean up the mess', 'wipe the dirt up'
        ]

    def variation_count(self) -> int:
        return 1

    def step(self) -> None:
        for d in self.dirt_spots:
            if self.sensor.is_detected(d):
                self.dirt_spots.remove(d)
                d.remove()

    def cleanup(self) -> None:
        for d in self.dirt_spots:
            d.remove()
        self.dirt_spots = []

    def _place_dirt(self):
        for i in range(DIRT_POINTS):
            spot = Shape.create(type=PrimitiveShape.CUBOID,
                                size=[.005, .005, .001],
                                mass=0,
                                static=True,
                                respondable=False,
                                renderable=True,
                                color=[0.58, 0.29, 0.0])
            spot.set_parent(self.get_base())
            spot.set_position([-1, -1, self.z_boundary + 0.001])
            self.b.sample(spot,
                          min_distance=0.00,
                          min_rotation=(0.00, 0.00, 0.00),
                          max_rotation=(0.00, 0.00, 0.00))
            self.dirt_spots.append(spot)
        self.b.clear()
示例#29
0
    def init_task(self) -> None:
        self.block = Shape('pick_and_lift_target')
        self.register_graspable_objects([self.block])
        self.boundary = SpawnBoundary([Shape('pick_and_lift_boundary')])
        self.success_detector = ProximitySensor('pick_and_lift_success')

        cond_set = ConditionSet([
            GraspedCondition(self.robot.gripper, self.block),
            DetectedCondition(self.block, self.success_detector)
        ])
        self.register_success_conditions([cond_set])

        self.target = Shape('target')
示例#30
0
 def init_episode(self, index: int) -> List[str]:
     self.register_success_conditions([self.condition])
     self.register_graspable_objects([self.remote])
     b = SpawnBoundary([self.boundary])
     b.sample(self.remote)
     return ['turn on the TV',
             'point the remote control at the television and turn on the '
             'television',
             'pick up the remote and rotate it such that the front of the '
             'remote is pointed straight at the television, then set the '
             'remote down and press the power button down in order to switch'
             ' on the TV',
             'find the power button at the top of the remote, ensure the '
             'remote is pointed at the tv, then turn the tv on']