1313 --alg {mimicgen|dexmimicgen|skillgen} \\
1414 --task_descriptor <task_descriptor.yaml> \\
1515 --embodiment <embodiment.yaml> \\
16+ --env_profile <environment_profile.yaml> \\
1617 --input_file <source.hdf5> \\
1718 --output_file <out.hdf5> \\
1819 --generation_num_trials <N> \\
6162 required = True ,
6263 help = "Path to the embodiment YAML (defines the robot's pose ↔ action transforms)." ,
6364)
65+ parser .add_argument (
66+ "--env_profile" ,
67+ type = str ,
68+ default = None ,
69+ help = (
70+ "Optional environment profile YAML overlaid on the base task before env creation "
71+ "(scene additions, reset randomization, motion-planner profile)."
72+ ),
73+ )
6474parser .add_argument ("--generation_num_trials" , type = int , default = None , help = "Number of demos to generate." )
6575parser .add_argument ("--num_envs" , type = int , default = 1 , help = "Number of parallel environments." )
6676parser .add_argument ("--input_file" , type = str , required = True , help = "Source dataset HDF5 file." )
104114from isaac_autodata_interfaces .datastream import Datastream # noqa: E402
105115from isaac_autodata_interfaces .embodiments import embodiment_adapter_from_yaml # noqa: E402
106116from isaac_autodata_interfaces .env import ( # noqa: E402
117+ EnvironmentProfile ,
107118 env_loop ,
108119 get_env_name_from_dataset ,
109120 setup_env_config ,
@@ -209,18 +220,23 @@ def setup_async_generation(
209220 }
210221
211222
212- def _build_motion_planners (datastream , num_envs : int , env_name : str ) -> dict :
223+ def _build_motion_planners (datastream , num_envs : int , env_name : str , planner_profile : str | None = None ) -> dict :
213224 """Construct one cuRobo v1 motion planner per env_id satisfying the SkillGen interface.
214225
215226 Planners read all world state (collision-geometry source, object poses, joint configuration)
216227 through the shared :class:`Datastream`, so they never touch the env/robot handles directly.
228+ The planner config comes from ``planner_profile`` (named by the environment profile) when
229+ given, else from task-name matching.
217230 """
218231 from isaac_autodata_interfaces .motion_planners .curobo .curobo_planner import CuroboPlanner
219232 from isaac_autodata_interfaces .motion_planners .curobo .curobo_planner_cfg import CuroboPlannerCfg
220233
221234 planners : dict [int , CuroboPlanner ] = {}
222235 for env_id in range (num_envs ):
223- planner_config = CuroboPlannerCfg .from_task_name (env_name )
236+ if planner_profile is not None :
237+ planner_config = CuroboPlannerCfg .from_profile (planner_profile )
238+ else :
239+ planner_config = CuroboPlannerCfg .from_task_name (env_name )
224240 # Visualization is rerun-based; limit to env_id 0 to keep simulation responsive.
225241 if env_id != 0 :
226242 planner_config .visualize_spheres = False
@@ -266,13 +282,18 @@ def main() -> None:
266282 alg_cls = REGISTERED_ALGORITHMS [args_cli .alg ]
267283 generation_policy_params .use_skillgen = alg_cls .uses_subtask_start_signals
268284
285+ # The environment profile, when given, overlays scene/reset changes onto the base task and
286+ # names the motion-planner profile tuned for the resulting scene.
287+ env_profile = EnvironmentProfile .from_yaml (args_cli .env_profile ) if args_cli .env_profile else None
288+
269289 env_cfg , success_term = setup_env_config (
270290 env_name = env_name ,
271291 output_dir = output_dir ,
272292 output_file_name = output_file_name ,
273293 num_envs = args_cli .num_envs ,
274294 device = args_cli .device ,
275295 generation_policy_params = generation_policy_params ,
296+ env_profile = env_profile ,
276297 )
277298
278299 env = gym .make (env_name , cfg = env_cfg ).unwrapped
@@ -295,7 +316,12 @@ def main() -> None:
295316 motion_planners : dict | None = None
296317 alg_kwargs : dict = {}
297318 if args_cli .alg == "skillgen" :
298- motion_planners = _build_motion_planners (datastream , args_cli .num_envs , env_name )
319+ motion_planners = _build_motion_planners (
320+ datastream ,
321+ args_cli .num_envs ,
322+ env_name ,
323+ planner_profile = env_profile .planner if env_profile else None ,
324+ )
299325 alg_kwargs ["motion_planners" ] = motion_planners
300326 algorithm = get_algorithm (args_cli .alg , ** alg_kwargs )
301327
@@ -338,6 +364,11 @@ def main() -> None:
338364 algorithm = args_cli .alg ,
339365 requested_trials = generation_policy_params .num_trials ,
340366 stats = async_components ["stats" ],
367+ env_profile = (
368+ {"name" : env_profile .name , "path" : args_cli .env_profile , "planner" : env_profile .planner }
369+ if env_profile
370+ else None
371+ ),
341372 )
342373 finally :
343374 env .close ()
0 commit comments