nepyope commited on
Commit
58bc650
·
verified ·
1 Parent(s): 08c99f6

Update env.py

Browse files
Files changed (1) hide show
  1. env.py +10 -1
env.py CHANGED
@@ -2,11 +2,20 @@
2
 
3
  from pathlib import Path
4
  import os
 
5
  import errno
6
  import yaml
7
  import gymnasium as gym
8
  from gymnasium import spaces
9
  import numpy as np
 
 
 
 
 
 
 
 
10
 
11
  from sim.simulator_factory import SimulatorFactory, init_channel
12
 
@@ -82,7 +91,7 @@ def make_env(
82
  try:
83
  # --- run_sim.py: main() body ---
84
 
85
- config_path = Path(__file__).parent / "config.yaml"
86
  with open(config_path) as f:
87
  config = yaml.safe_load(f)
88
 
 
2
 
3
  from pathlib import Path
4
  import os
5
+ import sys
6
  import errno
7
  import yaml
8
  import gymnasium as gym
9
  from gymnasium import spaces
10
  import numpy as np
11
+ from huggingface_hub import snapshot_download
12
+
13
+ # Download the full repo and get its path
14
+ _REPO_PATH = Path(snapshot_download(repo_id='lerobot/unitree-g1-mujoco', revision=None, cache_dir=None))
15
+
16
+ # Add the repo to sys.path so we can import sim module
17
+ if str(_REPO_PATH) not in sys.path:
18
+ sys.path.insert(0, str(_REPO_PATH))
19
 
20
  from sim.simulator_factory import SimulatorFactory, init_channel
21
 
 
91
  try:
92
  # --- run_sim.py: main() body ---
93
 
94
+ config_path = _REPO_PATH / "config.yaml"
95
  with open(config_path) as f:
96
  config = yaml.safe_load(f)
97