Repository navigation
Expand file tree
/
Copy pathcondiments_in_bin_task.py
More file actions
52 lines (45 loc) · 1.79 KB
/
Copy pathcondiments_in_bin_task.py
File metadata and controls
52 lines (45 loc) · 1.79 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
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.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_in_container, pick_and_place
from robolab.core.task.task import Task
@configclass
class CondimentsInBinTerminations:
time_out = DoneTerm(func=mdp.time_out, time_out=True)
success = DoneTerm(
func=object_in_container,
params={
"object": ["mustard", "ranch_dressing", "bbq_sauce_bottle", "bbq_sauce_bottle_01"],
"container": "grey_bin",
"logical": "all",
"require_gripper_detached": True
},
)
@dataclass
class CondimentsInBinTask(Task):
contact_object_list = [
"grey_bin", "mug", "mustard", "bowl", "ranch_dressing",
"bbq_sauce_bottle", "oatmeal_raisin_cookies", "canned_tuna",
"soft_scrub", "wood_block", "coffee_pot", "bbq_sauce_bottle_01", "table"
]
scene = import_scene("bin_condiments.usda", contact_object_list)
terminations = CondimentsInBinTerminations
instruction = {
"default": "Sort the sauce condiments into the grey bin",
"vague": "Put the sauces away",
"specific": "Pick up each sauce condiment bottle from the table and place it into the grey bin",
}
episode_length_s: int = 180
attributes = ['semantics', 'sorting']
subtasks = [
pick_and_place(
object=["mustard", "ranch_dressing", "bbq_sauce_bottle", "bbq_sauce_bottle_01"],
container="grey_bin",
logical="all",
score=1.0
)
]