Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions scripts/benchmarks/benchmark_cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
)
from isaaclab.utils.math import orthogonalize_perspective_depth, unproject_depth

from isaaclab_tasks.utils import load_cfg_from_registry
from isaaclab_tasks.utils import parse_env_cfg

"""
Camera Creation
Expand Down Expand Up @@ -527,9 +527,7 @@ def inject_cameras_into_task(
num_cameras_per_env: int = 1,
) -> gym.Env:
"""Loads the task, sticks cameras into the config, and creates the environment."""
cfg = load_cfg_from_registry(task, "env_cfg_entry_point")
cfg.sim.device = args_cli.device
cfg.sim.use_fabric = args_cli.use_fabric
cfg = parse_env_cfg(task, device=args_cli.device, use_fabric=args_cli.use_fabric)
scene_cfg = cfg.scene

num_envs = int(num_cams / num_cameras_per_env)
Expand Down
6 changes: 2 additions & 4 deletions scripts/demos/h1_locomotion.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@
get_published_pretrained_checkpoint,
)

from isaaclab_tasks.core.velocity.config.h1.rough_env_cfg import H1RoughEnvCfg
from isaaclab_tasks.utils import resolve_presets
from isaaclab_tasks.utils import resolve_task_config

TASK = "Isaac-Velocity-Rough-H1"
RL_LIBRARY = "rsl_rl"
Expand All @@ -93,8 +92,7 @@ def __init__(self):
agent_cfg: RslRlOnPolicyRunnerCfg = cli_args.parse_rsl_rl_cfg(TASK, args_cli)
agent_cfg = handle_deprecated_rsl_rl_cfg(agent_cfg, metadata.version("rsl-rl-lib"))
# create envionrment
env_cfg = resolve_presets(H1RoughEnvCfg(), selected=(args_cli.physics,))
env_cfg.play_mode()
env_cfg, _ = resolve_task_config(TASK, "", play_mode=True, overrides=(f"physics={args_cli.physics}",))
env_cfg.scene.num_envs = 25
env_cfg.episode_length_s = 1000000
env_cfg.curriculum = None
Expand Down
6 changes: 2 additions & 4 deletions scripts/demos/heterogeneous_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.scene import add as scene_add

from isaaclab_tasks.utils.hydra import resolve_presets
from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry
from isaaclab_tasks.utils import resolve_task_config

# Tasks composed by default. The selection criterion is simple: every listed
# scene is a PhysX task whose floor is a single flat plane at height zero, so
Expand Down Expand Up @@ -103,8 +102,7 @@ def _load_task_scenes() -> tuple[list[str], list[InteractiveSceneCfg]]:
raise ValueError("Select at least two task scenes.")
scene_cfgs = []
for task_id in task_ids:
# resolve preset placeholders (e.g. object-set choices) to their defaults
env_cfg = resolve_presets(load_cfg_from_registry(task_id, "env_cfg_entry_point"))
env_cfg, _ = resolve_task_config(task_id, "", overrides=hydra_args)
scene_cfgs.append(env_cfg.scene)
return task_ids, scene_cfgs

Expand Down
6 changes: 2 additions & 4 deletions scripts/tutorials/03_envs/policy_inference_in_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
from isaaclab.terrains import TerrainImporterCfg
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, read_file

from isaaclab_tasks.core.velocity.config.h1.rough_env_cfg import H1RoughEnvCfg
from isaaclab_tasks.utils import parse_env_cfg


def main():
Expand All @@ -56,16 +56,14 @@ def main():
policy = torch.jit.load(file, map_location=args_cli.device)

# setup environment
env_cfg = H1RoughEnvCfg()
env_cfg = parse_env_cfg("Isaac-Velocity-Rough-H1", device=args_cli.device, num_envs=1)
env_cfg.play_mode()
env_cfg.scene.num_envs = 1
env_cfg.curriculum = None
env_cfg.scene.terrain = TerrainImporterCfg(
prim_path="/World/ground",
terrain_type="usd",
usd_path=f"{ISAAC_NUCLEUS_DIR}/Environments/Simple_Warehouse/warehouse.usd",
)
env_cfg.sim.device = args_cli.device
if args_cli.device == "cpu":
env_cfg.sim.use_fabric = False

Expand Down
6 changes: 2 additions & 4 deletions scripts/tutorials/03_envs/run_cartpole_rl_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@

from isaaclab.envs import ManagerBasedRLEnv

from isaaclab_tasks.core.cartpole.cartpole_manager_env_cfg import CartpoleEnvCfg
from isaaclab_tasks.utils import parse_env_cfg


def main():
"""Main function."""
# create environment configuration
env_cfg = CartpoleEnvCfg()
env_cfg.scene.num_envs = args_cli.num_envs
env_cfg.sim.device = args_cli.device
env_cfg = parse_env_cfg("Isaac-Cartpole", device=args_cli.device, num_envs=args_cli.num_envs)
# setup RL environment
env = ManagerBasedRLEnv(cfg=env_cfg)

Expand Down
13 changes: 2 additions & 11 deletions scripts/tutorials/07_visualizers/run_video_recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
from isaaclab.app import add_launcher_args, launch_simulation
from isaaclab.envs.utils.video_recorder_cfg import VideoRecorderCfg

from isaaclab_tasks.utils import setup_preset_cli
from isaaclab_tasks.utils import resolve_task_config, setup_preset_cli

# ---------------------------------------------------------------------------
# Constants
Expand Down Expand Up @@ -87,11 +87,7 @@ def _output_dir(example: int) -> str:

def _shadow_env_cfg(num_envs: int, env_spacing: float = _SHADOW_ENV_SPACING):
"""Build a base Shadow Hand camera env cfg shared by all examples."""
from isaaclab_tasks.core.reorient.config.shadow_hand.shadow_hand_direct_camera_env_cfg import ShadowHandCameraEnvCfg

env_cfg = ShadowHandCameraEnvCfg()
env_cfg.tiled_camera = env_cfg.tiled_camera.rgb
env_cfg.tiled_camera.renderer_cfg = env_cfg.tiled_camera.renderer_cfg.default
env_cfg, _ = resolve_task_config(_TASK_SHADOW, "", overrides=(*sys.argv[1:], "env.tiled_camera=rgb"))
env_cfg.tiled_camera.height = 256
env_cfg.tiled_camera.width = 256
env_cfg.scene.num_envs = num_envs
Expand All @@ -109,8 +105,6 @@ def _build_env_cfg_example_1(num_envs: int):
from isaaclab_visualizers.kit import KitVisualizerCfg

env_cfg = _shadow_env_cfg(num_envs)
env_cfg.sim.physics = env_cfg.sim.physics.default

env_cfg.sim.visualizer_cfgs = [KitVisualizerCfg(eye=_SHADOW_EYE, lookat=_SHADOW_LOOKAT)]

out = _output_dir(1)
Expand All @@ -130,7 +124,6 @@ def _build_env_cfg_example_1(num_envs: int):
def _build_env_cfg_example_2(num_envs: int):
"""Shadow Hand + headless: scene tiled-camera sensor clip only."""
env_cfg = _shadow_env_cfg(num_envs, env_spacing=2.0)
env_cfg.sim.physics = env_cfg.sim.physics.default
env_cfg.sim.visualizer_cfgs = [] # no interactive visualizer

out = _output_dir(2)
Expand Down Expand Up @@ -158,8 +151,6 @@ def _build_env_cfg_example_3(num_envs: int):
from isaaclab_visualizers.newton import NewtonGLVisualizerCfg

env_cfg = _shadow_env_cfg(num_envs)
env_cfg.sim.physics = env_cfg.sim.physics.default

kit_cfg = KitVisualizerCfg(
eye=_SHADOW_EYE,
lookat=_SHADOW_LOOKAT,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Removed
^^^^^^^

* **Breaking:** Removed late task-preset resolution from environment construction and the
:func:`isaaclab.utils.resolve_cfg_presets` helper. Compose registered tasks with
:func:`isaaclab_tasks.utils.resolve_task_config` or :func:`isaaclab_tasks.utils.parse_env_cfg`
before constructing an environment.
* **Breaking:** Replaced ``run_config_from_presets`` with ``run_config_from_env_cfg`` in benchmark
capture. Pass the concrete composed environment configuration instead of inferring backends from
selector strings.
24 changes: 10 additions & 14 deletions source/isaaclab/isaaclab/app/sim_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,11 @@ def _is_kit_camera(node) -> bool:
# ``auto_rtx`` is resolved after the initial scan once physics and
# visualizer intent are known; ie. it may become OVRTX for a kitless run.
return False
if isinstance(renderer_cfg, RendererCfg):
return renderer_cfg.renderer_type in ("default", "isaac_rtx")
# PresetCfg renderers (e.g. MultiBackendRendererCfg) are resolved during
# environment construction once the physics backend is known; assume they
# match the backend, so not necessarily Kit.
from isaaclab_tasks.utils import PresetCfg

return not isinstance(renderer_cfg, PresetCfg)
if not isinstance(renderer_cfg, RendererCfg):
raise TypeError(
f"CameraCfg.renderer_cfg must be a concrete RendererCfg or None, got {type(renderer_cfg).__name__}."
)
return renderer_cfg.renderer_type in ("default", "isaac_rtx")


"""
Expand Down Expand Up @@ -218,7 +215,7 @@ class Scan:
"""Signals gathered from one walk of the config tree (see :func:`scan`).

Every field starts as a plain snapshot computed during that single walk.
Automatic PhysX preset selections and RTX placeholders are also recorded so
Automatic PhysX configurations and RTX placeholders are also recorded so
launch-time resolution can update the physics- and renderer-related fields
without traversing the config tree again. ``needs_kit`` is the headline launch
decision after automatic selections are resolved: a Kit-renderer camera or Isaac
Expand Down Expand Up @@ -424,11 +421,11 @@ def _validate_runtime(scan: Scan, kit_sources: tuple[str, ...]) -> None:
"\n"
"To fix this, pick one of the following supported combinations:\n"
" * Keep OvPhysX physics and switch to a kitless renderer/visualizer:\n"
" presets=ovphysx,ovrtx\n"
" use `OvPhysxCfg` with `OVRTXRendererCfg`\n"
" (and use `--visualizer newton`, `--visualizer rerun`, or `--visualizer viser`, or omit\n"
" the visualizer argument for headless execution.)\n"
" * Keep Isaac Sim / Kit and switch to a Kit-compatible physics backend:\n"
" presets=isaacsim_physx,isaacsim_rtx\n"
" use `PhysxCfg` with `IsaacRtxRendererCfg`\n"
)

if not scan.has_ovrtx or not kit_sources:
Expand All @@ -441,11 +438,10 @@ def _validate_runtime(scan: Scan, kit_sources: tuple[str, ...]) -> None:
"\n"
"To fix this, pick one of the following supported combinations:\n"
" * Keep Isaac Sim / Kit and switch the renderer:\n"
" presets=isaacsim_rtx\n"
" (uses `IsaacRtxRendererCfg`, the Kit-compatible renderer.)\n"
" use `IsaacRtxRendererCfg`, the Kit-compatible renderer\n"
" * Keep the OVRTX renderer and switch to a kitless physics backend\n"
" (and avoid `--visualizer kit`):\n"
" presets=newton_mjwarp,ovrtx\n"
" use `NewtonCfg` or `OvPhysxCfg` with `OVRTXRendererCfg`\n"
)


Expand Down
Loading
Loading