-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdemogen.py
More file actions
80 lines (68 loc) · 2.17 KB
/
demogen.py
File metadata and controls
80 lines (68 loc) · 2.17 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
"""
Copyright (c) 2025 Ning Gao, Shanghai Artificial Intelligence Laboratory
All rights reserved.
Licensed under the MIT License.
"""
import argparse
import os
import sys
import pydantic
import torch
import numpy
from pydantic import BaseModel, Field
from isaacsim import SimulationApp # type: ignore[import-untyped]
current_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(current_dir)
def parse_args() -> argparse.Namespace:
"""Parse the arguments."""
parser = argparse.ArgumentParser()
parser.add_argument(
"-cfg",
"--config",
type=str,
default="configs/tasks/minimal.yml",
help="Path to the YAML config file",
)
parser.add_argument(
"--record",
type=str,
required=False,
default="just for record",
help="Helps to record user name for monitoring in htop/nvidia-smi/nvitop etc.",
)
parser.add_argument(
"--eval",
default=False,
action="store_true",
help="Run in eval mode, generate tasks in 'evaluation_configs' and save to 'tasks' folder",
)
parser.add_argument(
"-wop",
"--without_planning",
default=False,
action="store_true",
help="Run in without planning mode, only generate layout and save first frame results, for vlm data generation",
)
parser.add_argument(
"-l",
"--local",
default=False,
action="store_true",
help="Run in local mode, a quick command to enable Isaac Sim GUI and use local anygrasp server",
)
parser.add_argument(
"-ad",
"--action_debug_mode",
default=False,
action="store_true",
help="Run in action debug mode, reload the task config from the first demonstration config every episode",
)
args = parser.parse_args()
return args
args = parse_args()
simulation_app = SimulationApp({"headless": not args.local})
simulation_app._carb_settings.set("/physics/cooking/ujitsoCollisionCooking", False)
from genmanip.demogen.workflow.demogen import DemoGenWorkflow
if __name__ == "__main__":
workflow = DemoGenWorkflow(args, simulation_app, current_dir)
workflow.run()