error handling
Browse files
env.py
CHANGED
|
@@ -225,16 +225,16 @@ def _create_isaaclab_env(config: dict, n_envs: int) -> dict[str, dict[int, gym.v
|
|
| 225 |
# Validate config
|
| 226 |
state_keys = tuple(k.strip() for k in (config.get("state_keys") or "").split(",") if k.strip())
|
| 227 |
camera_keys = tuple(k.strip() for k in (config.get("camera_keys") or "").split(",") if k.strip())
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
|
| 239 |
# Get task description
|
| 240 |
task = config.get("task")
|
|
|
|
| 225 |
# Validate config
|
| 226 |
state_keys = tuple(k.strip() for k in (config.get("state_keys") or "").split(",") if k.strip())
|
| 227 |
camera_keys = tuple(k.strip() for k in (config.get("camera_keys") or "").split(",") if k.strip())
|
| 228 |
+
try:
|
| 229 |
+
validate_config(
|
| 230 |
+
raw_env, state_keys, camera_keys,
|
| 231 |
+
config.get("state_dim", 54),
|
| 232 |
+
config.get("action_dim", 36)
|
| 233 |
+
)
|
| 234 |
+
except Exception:
|
| 235 |
+
logging.info("Validation failed, cleaning up...")
|
| 236 |
+
cleanup_isaaclab(raw_env, app_launcher)
|
| 237 |
+
raise
|
| 238 |
|
| 239 |
# Get task description
|
| 240 |
task = config.get("task")
|