nvkartik commited on
Commit
b8e4f24
·
1 Parent(s): 3f9b161
Files changed (1) hide show
  1. env.py +38 -11
env.py CHANGED
@@ -295,17 +295,44 @@ def make_env(
295
  if n_envs < 1:
296
  raise ValueError("`n_envs` must be at least 1")
297
 
298
- # Start with empty config - will be populated from YAML defaults
299
- config = {}
300
-
301
- # Always load YAML defaults first (single source of truth)
302
- yaml_path = _find_config_file(kwargs.get("config_path"))
303
- if yaml_path is not None:
304
- logging.info(f"Loading config from: {yaml_path}")
305
- with open(yaml_path) as f:
306
- config = yaml.safe_load(f) or {}
307
-
308
- # Override with runtime kwargs (highest priority)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  config.update(kwargs)
310
 
311
  if "environment" not in config:
 
295
  if n_envs < 1:
296
  raise ValueError("`n_envs` must be at least 1")
297
 
298
+ # Build config from cfg attributes directly (hub path) or YAML (local dev)
299
+ if cfg is not None and hasattr(cfg, 'environment'):
300
+ # Extract config directly from EnvConfig attributes
301
+ config = {
302
+ "environment": cfg.environment,
303
+ "embodiment": cfg.embodiment,
304
+ "object": cfg.object,
305
+ "mimic": cfg.mimic,
306
+ "teleop_device": cfg.teleop_device,
307
+ "seed": cfg.seed,
308
+ "device": cfg.device,
309
+ "disable_fabric": cfg.disable_fabric,
310
+ "enable_cameras": cfg.enable_cameras,
311
+ "headless": cfg.headless,
312
+ "enable_pinocchio": cfg.enable_pinocchio,
313
+ "episode_length": cfg.episode_length,
314
+ "state_dim": cfg.state_dim,
315
+ "action_dim": cfg.action_dim,
316
+ "camera_height": cfg.camera_height,
317
+ "camera_width": cfg.camera_width,
318
+ "video": cfg.video,
319
+ "video_length": cfg.video_length,
320
+ "video_interval": cfg.video_interval,
321
+ "state_keys": cfg.state_keys,
322
+ "camera_keys": cfg.camera_keys or "", # Pass empty string for no cameras
323
+ "task": cfg.task,
324
+ }
325
+ else:
326
+ # Fallback to YAML for local development
327
+ yaml_path = _find_config_file(kwargs.get("config_path"))
328
+ if yaml_path is not None:
329
+ logging.info(f"Loading config from: {yaml_path}")
330
+ with open(yaml_path) as f:
331
+ config = yaml.safe_load(f) or {}
332
+ else:
333
+ config = {}
334
+
335
+ # Apply any runtime overrides (highest priority)
336
  config.update(kwargs)
337
 
338
  if "environment" not in config: