-
Notifications
You must be signed in to change notification settings - Fork 268
/
Copy pathscoop_with_spatula.py
27 lines (22 loc) · 1.05 KB
/
scoop_with_spatula.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
from rlbench.backend.task import Task
from typing import List
from pyrep.objects.shape import Shape
from pyrep.objects.proximity_sensor import ProximitySensor
from rlbench.backend.conditions import GraspedCondition, DetectedCondition
class ScoopWithSpatula(Task):
def init_task(self) -> None:
spatula = Shape('scoop_with_spatula_spatula')
self.register_graspable_objects([spatula])
self.register_success_conditions([
DetectedCondition(Shape('Cuboid'), ProximitySensor('success')),
GraspedCondition(self.robot.gripper, spatula)
])
def init_episode(self, index: int) -> List[str]:
return ['scoop up the cube and lift it with the spatula',
'scoop up the block and lift it with the spatula',
'use the spatula to scoop the cube and lift it',
'use the spatula to scoop the block and lift it',
'pick up the cube using the spatula',
'pick up the block using the spatula']
def variation_count(self) -> int:
return 1