-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Warp-first experimental envs implements lazy export + cfg implementation split #5916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
798ba4e
fix warp environemtns.
ooctipus bf9a7be
add changelog fragments
ooctipus 8d8ee01
Commit experimental lazy_export stubs and fix config-load pxr leak
ooctipus c637995
add fix
ooctipus 76c184d
ci: re-trigger checks
ooctipus 59ae4ea
fix import
ooctipus 9a827b5
check against cfg
ooctipus 860bf3b
pyi fix
ooctipus f4fba26
cartpole directory
ooctipus c91c18b
fix linting
ooctipus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
source/isaaclab/changelog.d/fix-warp-env-cfg-forbidden-imports.skip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Internal: hoisted module-local backend imports (``pxr``/``sim_utils``) to module top in | ||
| implementation files (``scene_data/scene_data_provider``, ``sim/schemas/schemas_actuators``, | ||
| ``envs/utils/camera_view``, ``terrains/utils``). No user-facing change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
source/isaaclab_experimental/changelog.d/fix-warp-env-cfg-forbidden-imports.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| Fixed | ||
| ^^^^^ | ||
|
|
||
| * Fixed the experimental packages eagerly importing backend modules (``pxr``, | ||
| ``omni``, ``carb``, ``isaacsim``, ``scipy``) at import time, which crashed when | ||
| a warp task's env config was loaded before ``SimulationApp`` was launched. The | ||
| ``managers``, ``envs``, ``envs.mdp`` and ``envs.mdp.actions`` packages now use | ||
| ``lazy_export`` with ``.pyi`` stubs, and the MDP term leaf modules guard runtime | ||
| types (``Articulation``, ``InteractiveScene``, ``ContactSensor``, action terms) | ||
| under ``TYPE_CHECKING`` with string ``class_type`` references. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
source/isaaclab_experimental/isaaclab_experimental/envs/__init__.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| __all__ = [ | ||
| "mdp", | ||
| "DirectRLEnvWarp", | ||
| "InteractiveSceneWarp", | ||
| "ManagerBasedEnvWarp", | ||
| "ManagerBasedRLEnvWarp", | ||
| ] | ||
|
|
||
| from . import mdp | ||
| from .direct_rl_env_warp import DirectRLEnvWarp | ||
| from .interactive_scene_warp import InteractiveSceneWarp | ||
| from .manager_based_env_warp import ManagerBasedEnvWarp | ||
| from .manager_based_rl_env_warp import ManagerBasedRLEnvWarp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
source/isaaclab_experimental/isaaclab_experimental/envs/mdp/__init__.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| # Forward all stable MDP terms (commands/curriculums/events/observations/...) via a | ||
| # lazy fallback, so unresolved names defer to the stable package without eagerly | ||
| # importing its backend-dependent submodules. | ||
| from isaaclab.envs.mdp import * # noqa: F401, F403 | ||
|
|
||
| # Experimental Warp-first action terms. Listed by name (not ``*``) so the runtime | ||
| # implementations in ``joint_actions`` stay lazy and only the pure-data config | ||
| # classes are imported when an env config is constructed. | ||
| from .actions import ( # noqa: F401 | ||
| JointAction, | ||
| JointActionCfg, | ||
| JointEffortAction, | ||
| JointEffortActionCfg, | ||
| JointPositionAction, | ||
| JointPositionActionCfg, | ||
| ) | ||
|
|
||
| # Override stable terms with experimental Warp-first implementations. These leaf | ||
| # modules are import-clean (no eager backend imports), so re-exporting them here | ||
| # is safe. | ||
| from .events import * # noqa: F401, F403 | ||
| from .observations import * # noqa: F401, F403 | ||
| from .rewards import * # noqa: F401, F403 | ||
| from .terminations import * # noqa: F401, F403 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
source/isaaclab_experimental/isaaclab_experimental/envs/mdp/actions/__init__.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| __all__ = [ | ||
| "JointAction", | ||
| "JointActionCfg", | ||
| "JointEffortAction", | ||
| "JointEffortActionCfg", | ||
| "JointPositionAction", | ||
| "JointPositionActionCfg", | ||
| ] | ||
|
|
||
| from .actions_cfg import JointActionCfg, JointEffortActionCfg, JointPositionActionCfg | ||
| from .joint_actions import JointAction, JointEffortAction, JointPositionAction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,18 +7,14 @@ | |
|
|
||
| This package is intended for experimental forks of manager implementations while | ||
| keeping stable task configs and the stable `isaaclab.managers` package intact. | ||
| """ | ||
|
|
||
| from isaaclab.managers import * # noqa: F401,F403 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fallback is needed I think like that in mdp in .pyi?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it seems we covered all managers? but just in case ill add it back |
||
| Symbols are lazily resolved from the ``__init__.pyi`` stub so that importing this | ||
| package (e.g. to access pure-data cfg types like | ||
| :class:`~isaaclab_experimental.managers.ObservationTermCfg`) does not eagerly | ||
| pull in runtime managers that depend on a running simulator. This mirrors the | ||
| stable :mod:`isaaclab.managers` package. | ||
| """ | ||
|
|
||
| from .action_manager import ActionManager # noqa: F401 | ||
| from .command_manager import CommandManager # noqa: F401 | ||
| from .event_manager import EventManager # noqa: F401 | ||
| from isaaclab.utils.module import lazy_export | ||
|
|
||
| # Override the stable implementation with the experimental fork. | ||
| from .manager_base import ManagerTermBase # noqa: F401 | ||
| from .manager_term_cfg import ObservationTermCfg, RewardTermCfg, TerminationTermCfg # noqa: F401 | ||
| from .observation_manager import ObservationManager # noqa: F401 | ||
| from .reward_manager import RewardManager # noqa: F401 | ||
| from .scene_entity_cfg import SceneEntityCfg # noqa: F401 | ||
| from .termination_manager import TerminationManager # noqa: F401 | ||
| lazy_export() | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.