Upload folder using huggingface_hub
Browse files
__pycache__/bi_so101_clean_toytable_2objects.cpython-311.pyc
ADDED
|
Binary file (1.77 kB). View file
|
|
|
bi_so101_clean_toytable_2objects.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
+
from huggingface_hub import snapshot_download
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def make_env(n_envs: int = 1, use_async_envs: bool = False):
|
| 8 |
+
"""
|
| 9 |
+
Create vectorized environments for leisaac task.
|
| 10 |
+
|
| 11 |
+
Bi-arm direct: pick torus and cuboid into the box (2 objects).
|
| 12 |
+
|
| 13 |
+
Args:
|
| 14 |
+
n_envs: Number of parallel environments
|
| 15 |
+
use_async_envs: Whether to use AsyncVectorEnv or SyncVectorEnv
|
| 16 |
+
(not use now)
|
| 17 |
+
|
| 18 |
+
Returns:
|
| 19 |
+
ManagerBasedRLEnv or DirectRLEnv inherit from gym.Env implemented in IsaacLab
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
+
# Scene/robot assets live on the upstream Hub repo; materialize them next to this script so
|
| 23 |
+
# thin forks (e.g. kd-forge/leisaac_env with only envs/*.py) still resolve LEISAAC_ASSETS_ROOT.
|
| 24 |
+
repo_root = Path(__file__).resolve().parent.parent
|
| 25 |
+
assets_root = repo_root / "assets"
|
| 26 |
+
snapshot_download(
|
| 27 |
+
repo_id="kd-forge/leisaac_env",
|
| 28 |
+
local_dir=str(repo_root),
|
| 29 |
+
allow_patterns=["assets/**"],
|
| 30 |
+
)
|
| 31 |
+
os.environ["LEISAAC_ASSETS_ROOT"] = str(assets_root)
|
| 32 |
+
|
| 33 |
+
from isaaclab.app import AppLauncher
|
| 34 |
+
|
| 35 |
+
_ = AppLauncher({"enable_cameras": True})
|
| 36 |
+
|
| 37 |
+
from leisaac.utils.envhub_utils import export_env
|
| 38 |
+
|
| 39 |
+
return export_env(
|
| 40 |
+
"LeIsaac-SO101-CleanToyTable-2Objects-BiArm-Direct-v0",
|
| 41 |
+
device="cuda:0",
|
| 42 |
+
num_envs=n_envs,
|
| 43 |
+
)
|