-
Notifications
You must be signed in to change notification settings - Fork 241
/
straighten_rope.py
25 lines (20 loc) · 925 Bytes
/
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
from typing import List
from pyrep.objects.proximity_sensor import ProximitySensor
from pyrep.objects.shape import Shape
from rlbench.backend.conditions import DetectedCondition
from rlbench.backend.task import Task
class StraightenRope(Task):
def init_task(self) -> None:
self.register_success_conditions(
[DetectedCondition(Shape('head'), ProximitySensor('success_head')),
DetectedCondition(Shape('tail'), ProximitySensor('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