forked from stepjam/RLBench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclose_microwave.py
29 lines (22 loc) · 919 Bytes
/
close_microwave.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, Tuple
import numpy as np
from pyrep.objects.shape import Shape
from pyrep.objects.joint import Joint
from pyrep.objects.object import Object
from rlbench.backend.task import Task
from rlbench.backend.conditions import JointCondition
class CloseMicrowave(Task):
def init_task(self) -> None:
self.register_success_conditions([JointCondition(
Joint('microwave_door_joint'), np.deg2rad(40))])
def init_episode(self, index: int) -> List[str]:
return ['close microwave',
'shut the microwave',
'close the microwave door',
'push the microwave door shut']
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')