-
Notifications
You must be signed in to change notification settings - Fork 268
/
Copy pathtake_frame_off_hanger.py
31 lines (26 loc) · 1.2 KB
/
take_frame_off_hanger.py
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
from typing import List
from pyrep.objects.shape import Shape
from pyrep.objects.proximity_sensor import ProximitySensor
from rlbench.backend.task import Task
from rlbench.backend.conditions import DetectedCondition, NothingGrasped
class TakeFrameOffHanger(Task):
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_episode(self, index: int) -> List[str]:
return ['take frame off hanger',
'slide the photo off of the hanger and set it down on the '
'table',
'grab a hold of the frame, remove it from the hanger and put it'
' down',
'grasping the picture frame, take it off the wall and place it'
'on the table top',
'take the picture down',
'remove the photo frame from the wall']
def variation_count(self) -> int:
return 1