-
Notifications
You must be signed in to change notification settings - Fork 309
Expand file tree
/
Copy pathtake_usb_out_of_computer.py
More file actions
26 lines (21 loc) · 969 Bytes
/
take_usb_out_of_computer.py
File metadata and controls
26 lines (21 loc) · 969 Bytes
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
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 TakeUsbOutOfComputer(Task):
def init_task(self) -> None:
usb = Shape('usb')
self.register_graspable_objects([usb])
self.register_success_conditions(
[DetectedCondition(usb, ProximitySensor('success'), negated=True),
NothingGrasped(self.robot.gripper)])
def init_episode(self, index: int) -> List[str]:
return ['take usb out of computer',
'remove the usb stick from its port',
'retrieve the usb stick',
'grasp the usb stick and slide it out of the pc',
'get a hold of the usb stick and pull it out of the desktop '
'computer']
def variation_count(self) -> int:
return 1