forked from stepjam/RLBench
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathsolve_puzzle.py
28 lines (21 loc) · 850 Bytes
/
solve_puzzle.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
from typing import List
from pyrep.objects.proximity_sensor import ProximitySensor
from pyrep.objects.shape import Shape
from rlbench.backend.conditions import NothingGrasped, DetectedCondition
from rlbench.backend.task import Task
class SolvePuzzle(Task):
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_episode(self, index: int) -> List[str]:
return [
'solve the puzzle',
'put the puzzle piece into the puzzle',
'pick up the puzzle piece and place it on the puzzle'
]
def variation_count(self) -> int:
return 1