Esempio n. 1
0
    def init_episode(self, index: int) -> List[str]:
        self.right_frame.set_dynamic(False)
        self.left_frame.set_dynamic(False)
        self.left_unlocked = False
        self.right_unlocked = False

        option = OPTIONS[index]

        if option == 'right':
            self.waypoint0.set_position(self.waypoint0_.get_position())
            self.waypoint1.set_position(self.waypoint1_.get_position())
            self.waypoint2.set_position(self.waypoint2_.get_position())
            self.waypoint2.set_orientation(self.waypoint2_.get_orientation())
            self.waypoint3.set_position(self.waypoint3_.get_position())
            self.waypoint3.set_orientation(self.waypoint3_.get_orientation())
            self.register_success_conditions(
                [JointCondition(Joint('right_window_joint'), np.deg2rad(50))])
        else:
            self.register_success_conditions(
                [JointCondition(Joint('left_window_joint'), np.deg2rad(50))])
        return [
            'open %s window' % option,
            'rotate the handle to unlock the %s window, then open it' % option,
            'push the %s window open' % option,
            'use the handle to open the %s window' % option
        ]
Esempio n. 2
0
    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
        ]
Esempio n. 3
0
 def init_task(self) -> None:
     self.door_main = Shape('door_main')
     self.door_main.set_dynamic(False)
     door_joint = Joint('door_frame_joint')
     handle_joint = Joint('door_handle_joint')
     self.register_success_conditions(
         [JointCondition(door_joint, np.deg2rad(25))])
     self.door_unlock_cond = JointCondition(handle_joint, np.deg2rad(25))
Esempio n. 4
0
 def init_task(self) -> None:
     self.tv = Shape('tv_frame')
     self.screen_on = Shape('tv_screen_on')
     self.screen_up = Shape('tv_screen_up')
     self.screen_down = Shape('tv_screen_down')
     self.remote = Shape('tv_remote')
     self.boundary = Shape('spawn_boundary')
     self.joint_conditions = [
         JointCondition(Joint('target_button_joint1'), 0.005),
         JointCondition(Joint('target_button_joint2'), 0.005)
     ]
Esempio n. 5
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')]
Esempio n. 6
0
 def init_task(self) -> None:
     cup = Shape('cup')
     self.register_graspable_objects([cup])
     self.register_success_conditions([
         JointCondition(Joint('joint'), np.deg2rad(1)),
         DetectedCondition(cup, ProximitySensor('success'))
     ])
Esempio n. 7
0
    def init_task(self):
        self.waypoint0 = Dummy('waypoint0')
        self.waypoint1 = Dummy('waypoint1')
        self.waypoint2 = Dummy('waypoint2')
        self.waypoint3 = Dummy('waypoint3')

        self.waypoint0_ = Dummy('waypoint0_')
        self.waypoint1_ = Dummy('waypoint1_')
        self.waypoint2_ = Dummy('waypoint2_')
        self.waypoint3_ = Dummy('waypoint3_')

        self.right_unlocked_cond = JointCondition(Joint('right_handle_joint'),
                                                  np.deg2rad(60))
        self.left_unlocked_cond = JointCondition(Joint('left_handle_joint'),
                                                 np.deg2rad(60))
        self.right_frame = Shape('right_frame')
        self.left_frame = Shape('left_frame')
Esempio n. 8
0
 def init_task(self) -> None:
     cap_detector = ProximitySensor("cap_detector")
     self.joint = Joint('joint')
     self.force_sensor = ForceSensor('Force_sensor')
     self.cap = Shape('cap')
     self.register_success_conditions(
         [DetectedCondition(self.cap, cap_detector, negated=True)])
     self.cap_turned_condition = JointCondition(
         self.joint, np.deg2rad(150))
Esempio n. 9
0
    def init_episode(self, index: int) -> List[str]:
        option = OPTIONS[index]
        if option == 'right':
            self.left_start.set_position(self.right_start.get_position())
            self.left_start.set_orientation(self.right_start.get_orientation())
            self.left_end.set_position(self.right_end.get_position())
            self.left_end.set_orientation(self.right_end.get_orientation())
            self.register_success_conditions(
                [JointCondition(self.right_joint, 1.57)])
        else:
            self.register_success_conditions(
                [JointCondition(self.left_joint, 1.57)])

        return [
            'turn %s tap' % option,
            'rotate the %s tap' % option,
            'grasp the %s tap and turn it' % option
        ]
Esempio n. 10
0
    def init_task(self) -> None:
        screw_driver = Shape('screw_driver')
        self.block = Shape('block')
        self.register_graspable_objects([screw_driver])
        screw_joint = Joint('screw_joint')

        cond_set = ConditionSet([
            GraspedCondition(self.robot.gripper, screw_driver),
            JointCondition(screw_joint, 1.4)],  # about 90 degrees
            order_matters=True)
        self.register_success_conditions([cond_set])
Esempio n. 11
0
 def init_episode(self, index: int) -> List[str]:
     option = self.options[index]
     self.waypoint1.set_position(self.anchors[index].get_position())
     self.register_success_conditions(
         [JointCondition(self.joints[index], 0.15)])
     return [
         'open %s drawer' % option,
         'grip the %s handle and pull the %s drawer open' %
         (option, option),
         'slide the %s drawer open' % option
     ]
Esempio n. 12
0
    def init_episode(self, index: int) -> List[str]:
        option = OPTIONS[index]
        self.joints[index].set_joint_position(0.1)
        self.register_success_conditions(
            [JointCondition(self.joints[index], 0.06)])
        x, y, z = self.waypoint0.get_position()
        _, _, target_z = self.anchors[index].get_position()
        self.waypoint0.set_position([x, y, target_z])

        return ['close %s drawer' % (option,),
                'shut the %s drawer' % (option,),
                'slide the %s drawer shut' % (option,)]
Esempio n. 13
0
 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))
Esempio n. 14
0
    def init_task(self) -> None:
        self.buttons_pushed = 0
        self.color_variation_index = 0
        self.target_buttons = [Shape('push_buttons_target%d' % i)
                               for i in range(3)]
        self.target_topPlates = [Shape('target_button_topPlate%d' % i)
                                 for i in range(3)]
        self.target_joints = [Joint('target_button_joint%d' % i)
                              for i in range(3)]
        self.target_wraps = [Shape('target_button_wrap%d' % i)
                             for i in range(3)]
        self.boundaries = Shape('push_buttons_boundary')
        # goal_conditions merely state joint conditions for push action for
        # each button regardless of whether the task involves pushing it
        self.goal_conditions = [JointCondition(self.target_joints[n], 0.005)
                                for n in range(3)]

        self.register_waypoint_ability_start(0, self._move_above_next_target)
        self.register_waypoints_should_repeat(self._repeat)
Esempio n. 15
0
 def init_task(self) -> None:
     door_joint = Joint('door_frame_joint')
     self.register_success_conditions(
         [JointCondition(door_joint, np.deg2rad(25)),
          NothingGrasped(self.robot.gripper)])
Esempio n. 16
0
 def init_task(self) -> None:
     joint = Joint('toilet_seat_up_revolute_joint')
     self.register_success_conditions([JointCondition(joint, 1.7)])
Esempio n. 17
0
 def init_task(self):
     top_joint = Joint('top_joint')
     self.register_success_conditions(
         [JointCondition(top_joint, np.deg2rad(30))])
Esempio n. 18
0
 def init_task(self) -> None:
     self.register_success_conditions(
         [JointCondition(Joint('microwave_door_joint'), np.deg2rad(80))])
Esempio n. 19
0
 def init_task(self) -> None:
     self._door_joint = Joint('door_frame_joint')
     self.register_success_conditions(
         [JointCondition(self._door_joint, np.deg2rad(25))])
     self.door_unlock_cond = JointCondition(Joint('door_handle_joint'),
                                            np.deg2rad(25))
Esempio n. 20
0
 def init_task(self) -> None:
     switch_joint = Joint('joint')
     self.register_success_conditions([JointCondition(switch_joint, 1.0)])
Esempio n. 21
0
 def init_task(self) -> None:
     knob_joint = Joint('oven_knob_joint')
     self.register_success_conditions([JointCondition(knob_joint, 1.5)])
Esempio n. 22
0
 def init_task(self):
     box_joint = Joint('joint')
     self.register_success_conditions([JointCondition(box_joint, 1.9)])
Esempio n. 23
0
 def init_task(self) -> None:
     self.bulb_glass_visual = Shape('bulb')
     self.bulb_glass_visual.set_color([0, 0, 0])
     self.joint = Joint('target_button_joint')
     self.condition = JointCondition(self.joint, 0.005)
Esempio n. 24
0
 def init_task(self):
     self.target_button = Shape('push_button_target')
     self.target_topPlate = Shape('target_button_topPlate')
     self.joint = Joint('target_button_joint')
     self.target_wrap = Shape('target_button_wrap')
     self.goal_condition = JointCondition(self.joint, 0.005)
Esempio n. 25
0
 def init_task(self) -> None:
     self.drops = []
     self.success_sensor = ProximitySensor('success')
     self.cup = Shape('cup')
     self.register_graspable_objects([self.cup])
     self.tongue_condition = JointCondition(Joint('joint'), np.deg2rad(1))
Esempio n. 26
0
 def init_task(self) -> None:
     self.tv = Shape('tv_frame')
     self.screen_on = Shape('tv_screen_on')
     self.remote = Shape('tv_remote')
     self.boundary = Shape('spawn_boundary')
     self.condition = JointCondition(Joint('target_button_joint0'), 0.003)
Esempio n. 27
0
 def init_task(self) -> None:
     box_joint = Joint('joint')
     self.register_success_conditions([JointCondition(box_joint, 2.6)])
Esempio n. 28
0
 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)])
Esempio n. 29
0
 def init_task(self) -> None:
     laptop_joint = Joint('joint')
     self.register_success_conditions([JointCondition(laptop_joint, 1.79)])