forked from stepjam/RLBench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
straighten_rope.py
29 lines (24 loc) · 1.03 KB
/
straighten_rope.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
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
class StraightenRope(Task):
def init_task(self) -> None:
rope_head = Shape('head')
rope_tail = Shape('tail')
success_head = ProximitySensor('success_head')
success_tail = ProximitySensor('success_tail')
self.register_success_conditions(
[DetectedCondition(rope_head, success_head),
DetectedCondition(rope_tail, success_tail)])
def init_episode(self, index: int) -> List[str]:
return ['straighten rope',
'pull the rope straight',
'grasping each end of the rope in turn, leave the rope straight'
' on the table',
'pull each end of the rope until is is straight',
'tighten the rope',
'pull the rope tight']
def variation_count(self) -> int:
return 1