forked from MohitShridhar/RLBench
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopen_washing_machine.py
More file actions
32 lines (24 loc) · 953 Bytes
/
open_washing_machine.py
File metadata and controls
32 lines (24 loc) · 953 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
27
28
29
30
31
32
from pyrep.objects.object import Object
from pyrep.objects.shape import Shape
from pyrep.objects.joint import Joint
from rlbench.backend.conditions import JointCondition
from rlbench.backend.task import Task
from typing import List, Tuple
from math import pi
import numpy as np
class OpenWashingMachine(Task):
def init_task(self) -> None:
self.joint = Joint('door_joint')
self.register_success_conditions([
JointCondition(self.joint, np.deg2rad(40))
])
def init_episode(self, index: int) -> List[str]:
return ['open washing machine',
'open the washing machine door',
'pull the washing machine door open']
def variation_count(self) -> int:
return 1
def base_rotation_bounds(self) -> Tuple[List[float], List[float]]:
return [0, 0, -3.14 / 4.], [0, 0, 3.14 / 4.]
def boundary_root(self) -> Object:
return Shape('boundary_root')