-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathbigger_object.py
More file actions
44 lines (38 loc) · 1.54 KB
/
bigger_object.py
File metadata and controls
44 lines (38 loc) · 1.54 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
# 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_in_container, pick_and_place
from robolab.core.task.task import Task
@configclass
class Terminations:
"""Termination configuration for butter above raisin box task."""
time_out = DoneTerm(func=mdp.time_out, time_out=True)
success = DoneTerm(
func=object_in_container,
params={"object": "raisin_box", "container": "grey_bin", "tolerance": 0.02, "require_gripper_detached": True},
)
@dataclass
class LargerObjectRaisinBoxInBinTask(Task):
"""Task: place the butter on top of the raisin box."""
contact_object_list = ["butter", "grey_bin", "raisin_box", "table"]
scene = import_scene("butter_raisin_box_grey_bin.usda", contact_object_list)
terminations = Terminations
instruction = {
"default": "Place the larger object in the grey bin.",
"vague": "Put the larger object away",
"specific": "Compare the objects and put the larger raisin box in the grey bin",
}
episode_length_s: int = 30
attributes = ['size']
subtasks = [
pick_and_place(
object=["raisin_box"],
container="grey_bin",
logical="all",
score=1.0
)
]