MCPcopy Create free account
hub / github.com/BrainCoTech/RevoLab / _build_env_cfg

Function _build_env_cfg

scripts/hora/train.py:136–159  ·  view source on GitHub ↗
(seed: int)

Source from the content-addressed store, hash-verified

134
135
136def _build_env_cfg(seed: int):
137 env_cfg = Revo3HandHoraEnvCfg()
138 env_cfg.robot_cfg = _TASK_ROBOT_CFG.get(args.task, REVO3_HAND_CYLINDER_CFG)
139 env_cfg.object_cfg = _TASK_OBJECT_CFG.get(args.task, CYLINDER_OBJECT_CFG)
140 env_cfg.grasp_cache_path = _TASK_CACHE.get(args.task, 'assets/grasp_cache/hora/revo3_right_grasp_cylinder')
141 if args.cache_file:
142 env_cfg.grasp_cache_path = f"assets/grasp_cache/hora/{args.cache_file.replace('.npy', '')}"
143 if args.usd:
144 usd_path = os.path.abspath(args.usd)
145 if not os.path.exists(usd_path):
146 raise FileNotFoundError(f"--usd path not found: {usd_path}")
147 env_cfg.robot_cfg = copy.deepcopy(env_cfg.robot_cfg)
148 if env_cfg.robot_cfg.spawn is None or not hasattr(env_cfg.robot_cfg.spawn, "usd_path"):
149 raise RuntimeError("env_cfg.robot_cfg.spawn has no usd_path to override.")
150 env_cfg.robot_cfg.spawn.usd_path = usd_path
151
152 env_cfg.scene.num_envs = args.num_envs
153
154
155 if hasattr(env_cfg, 'seed'):
156 env_cfg.seed = seed
157 if hasattr(env_cfg.sim, 'device') and getattr(args, 'device', None):
158 env_cfg.sim.device = args.device
159 return env_cfg
160
161
162def _save_run_metadata(output_dif: str, full_config) -> None:

Callers 1

mainFunction · 0.85

Calls 1

Revo3HandHoraEnvCfgClass · 0.90

Tested by

no test coverage detected