-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathkeyboard_out_of_bin_task.py
More file actions
53 lines (46 loc) · 1.81 KB
/
keyboard_out_of_bin_task.py
File metadata and controls
53 lines (46 loc) · 1.81 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: CC-BY-NC-4.0
from dataclasses import dataclass
import isaaclab.envs.mdp as mdp
from isaaclab.managers import TerminationTermCfg as DoneTerm
from isaaclab.utils import configclass
from robolab.core.scenes.utils import import_scene
from robolab.core.task.conditionals import object_outside_of_and_on_surface, pick_and_place_on_surface
from robolab.core.task.task import Task
@configclass
class KeyboardOutOfBinTerminations:
time_out = DoneTerm(func=mdp.time_out, time_out=True)
success = DoneTerm(
func=object_outside_of_and_on_surface,
params={
"object": "keyboard",
"container": "grey_bin",
"surface": "table",
"require_gripper_detached": True
},
)
@dataclass
class KeyboardOutOfBinTask(Task):
"""Task: Take the keyboard out of the bin and put it on the table."""
contact_object_list = [
"ceramic_mug", "glasses", "keyboard", "lizard_figurine", "marker",
"remote_control", "smartphone", "wooden_bowl", "spoon_big",
"computer_mouse", "yogurt_cup", "granola_bars", "grey_bin", "table"
]
scene = import_scene("workdesk_bin.usda", contact_object_list)
terminations = KeyboardOutOfBinTerminations
instruction = {
"default": "Take the keyboard out of the bin and put it on the table",
"vague": "Take the keyboard out",
"specific": "Reach into the bin, grasp the keyboard, lift it out, and place it on the table surface",
}
episode_length_s: int = 60
attributes = ['spatial']
subtasks = [
pick_and_place_on_surface(
object=["keyboard"],
surface="table",
logical="all",
score=1.0
)
]