-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_sim.py
More file actions
37 lines (23 loc) · 830 Bytes
/
Copy pathrun_sim.py
File metadata and controls
37 lines (23 loc) · 830 Bytes
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
#!/usr/bin/env python3
"""Start a DEEPRobotics simulation by product name."""
from pathlib import Path
import sys
REPOSITORY_ROOT = Path(__file__).resolve().parent
def print_usage() -> None:
print("Usage: python3 run_sim.py <product>")
print("Supported products: dr02_pro, dr02_std")
def main(argv: list[str]) -> int:
if len(argv) != 2:
print_usage()
return 1
if argv[1] == "dr02_pro":
from dr02_pro.mujoco_simulation import run
return run(REPOSITORY_ROOT / "dr02_pro" / "config.yaml")
if argv[1] == "dr02_std":
from dr02_std.mujoco_simulation import run
return run(REPOSITORY_ROOT / "dr02_std" / "config.yaml")
print(f"Unknown product: {argv[1]}")
print_usage()
return 1
if __name__ == "__main__":
raise SystemExit(main(sys.argv))