Skip to content
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

Improve omni.isaac.lab_tasks loading time #1353

Merged
merged 10 commits into from
Nov 4, 2024
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

# Note: Semantic Versioning is used: https://semver.org/
version = "0.10.12"
version = "0.10.13"

# Description
title = "Isaac Lab Environments"
Expand Down
12 changes: 12 additions & 0 deletions source/extensions/omni.isaac.lab_tasks/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Changelog
---------

0.10.13 (2024-10-30)
~~~~~~~~~~~~~~~~~~~~

Changed
^^^^^^^

* Defined the Gymnasium task entry points with configuration strings instead of class types.
This avoids unnecessary imports and improves the load types.
* Blacklisted ``mdp`` directories during the recursive module search.


0.10.12 (2024-10-28)
~~~~~~~~~~~~~~~~~~~~

Expand All @@ -10,6 +21,7 @@ Changed
* Changed manager-based vision cartpole environment names from Isaac-Cartpole-RGB-Camera-v0
and Isaac-Cartpole-Depth-Camera-v0 to Isaac-Cartpole-RGB-v0 and Isaac-Cartpole-Depth-v0


0.10.11 (2024-10-28)
~~~~~~~~~~~~~~~~~~~~

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
from .utils import import_packages

# The blacklist is used to prevent importing configs from sub-packages
_BLACKLIST_PKGS = ["utils"]
_BLACKLIST_PKGS = ["utils", ".mdp"]
# Import all configs in this package
import_packages(__name__, _BLACKLIST_PKGS)
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@
import gymnasium as gym

from . import agents
from .allegro_hand_env_cfg import AllegroHandEnvCfg

##
# Register Gym environments.
##

task_entry = "omni.isaac.lab_tasks.direct.allegro_hand"
inhand_task_entry = "omni.isaac.lab_tasks.direct.inhand_manipulation"

gym.register(
id="Isaac-Repose-Cube-Allegro-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.inhand_manipulation:InHandManipulationEnv",
entry_point=f"{inhand_task_entry}.inhand_manipulation_env:InHandManipulationEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": AllegroHandEnvCfg,
"env_cfg_entry_point": f"{task_entry}.allegro_hand_env_cfg:AllegroHandEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:AllegroHandPPORunnerCfg",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@
import gymnasium as gym

from . import agents
from .ant_env import AntEnv, AntEnvCfg

##
# Register Gym environments.
##

task_entry = "omni.isaac.lab_tasks.direct.ant"

gym.register(
id="Isaac-Ant-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.ant:AntEnv",
entry_point=f"{task_entry}.ant_env:AntEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": AntEnvCfg,
"env_cfg_entry_point": f"{task_entry}.ant_env:AntEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:AntPPORunnerCfg",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@
import gymnasium as gym

from . import agents
from .anymal_c_env import AnymalCEnv, AnymalCFlatEnvCfg, AnymalCRoughEnvCfg

##
# Register Gym environments.
##

task_entry = "omni.isaac.lab_tasks.direct.anymal_c"

gym.register(
id="Isaac-Velocity-Flat-Anymal-C-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.anymal_c:AnymalCEnv",
entry_point=f"{task_entry}.anymal_c_env:AnymalCEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": AnymalCFlatEnvCfg,
"env_cfg_entry_point": f"{task_entry}.anymal_c_env:AnymalCFlatEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_flat_ppo_cfg.yaml",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:AnymalCFlatPPORunnerCfg",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_flat_ppo_cfg.yaml",
Expand All @@ -30,10 +31,10 @@

gym.register(
id="Isaac-Velocity-Rough-Anymal-C-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.anymal_c:AnymalCEnv",
entry_point=f"{task_entry}.anymal_c_env:AnymalCEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": AnymalCRoughEnvCfg,
"env_cfg_entry_point": f"{task_entry}.anymal_c_env:AnymalCRoughEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_rough_ppo_cfg.yaml",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:AnymalCRoughPPORunnerCfg",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_rough_ppo_cfg.yaml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@
import gymnasium as gym

from . import agents
from .cart_double_pendulum_env import CartDoublePendulumEnv, CartDoublePendulumEnvCfg

##
# Register Gym environments.
##

task_entry = "omni.isaac.lab_tasks.direct.cart_double_pendulum"

gym.register(
id="Isaac-Cart-Double-Pendulum-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.cart_double_pendulum:CartDoublePendulumEnv",
entry_point=f"{task_entry}.cart_double_pendulum_env:CartDoublePendulumEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": CartDoublePendulumEnvCfg,
"env_cfg_entry_point": f"{task_entry}.cart_double_pendulum_env:CartDoublePendulumEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml",
"skrl_ippo_cfg_entry_point": f"{agents.__name__}:skrl_ippo_cfg.yaml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
import gymnasium as gym

from . import agents
from .cartpole_camera_env import CartpoleCameraEnv, CartpoleDepthCameraEnvCfg, CartpoleRGBCameraEnvCfg
from .cartpole_env import CartpoleEnv, CartpoleEnvCfg

##
# Register Gym environments.
##

task_entry = "omni.isaac.lab_tasks.direct.cartpole"

gym.register(
id="Isaac-Cartpole-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.cartpole:CartpoleEnv",
entry_point=f"{task_entry}.cartpole_env:CartpoleEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": CartpoleEnvCfg,
"env_cfg_entry_point": f"{task_entry}.cartpole_env:CartpoleEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:CartpolePPORunnerCfg",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml",
Expand All @@ -32,21 +32,21 @@

gym.register(
id="Isaac-Cartpole-RGB-Camera-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.cartpole:CartpoleCameraEnv",
entry_point=f"{task_entry}.cartpole_camera_env:CartpoleCameraEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": CartpoleRGBCameraEnvCfg,
"env_cfg_entry_point": f"{task_entry}.cartpole_camera_env:CartpoleRGBCameraEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_camera_ppo_cfg.yaml",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_camera_ppo_cfg.yaml",
},
)

gym.register(
id="Isaac-Cartpole-Depth-Camera-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.cartpole:CartpoleCameraEnv",
entry_point=f"{task_entry}.cartpole_camera_env:CartpoleCameraEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": CartpoleDepthCameraEnvCfg,
"env_cfg_entry_point": f"{task_entry}.cartpole_camera_env:CartpoleDepthCameraEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_camera_ppo_cfg.yaml",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_camera_ppo_cfg.yaml",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
import gymnasium as gym

from . import agents
from .franka_cabinet_env import FrankaCabinetEnv, FrankaCabinetEnvCfg

##
# Register Gym environments.
##

task_entry = "omni.isaac.lab_tasks.direct.franka_cabinet"

gym.register(
id="Isaac-Franka-Cabinet-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.franka_cabinet:FrankaCabinetEnv",
entry_point=f"{task_entry}.franka_cabinet_env:FrankaCabinetEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": FrankaCabinetEnvCfg,
"env_cfg_entry_point": f"{task_entry}.franka_cabinet_env:FrankaCabinetEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:FrankaCabinetPPORunnerCfg",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@
import gymnasium as gym

from . import agents
from .humanoid_env import HumanoidEnv, HumanoidEnvCfg

##
# Register Gym environments.
##

task_entry = "omni.isaac.lab_tasks.direct.humanoid"

gym.register(
id="Isaac-Humanoid-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.humanoid:HumanoidEnv",
entry_point=f"{task_entry}.humanoid_env:HumanoidEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": HumanoidEnvCfg,
"env_cfg_entry_point": f"{task_entry}.humanoid_env:HumanoidEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:HumanoidPPORunnerCfg",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@
import gymnasium as gym

from . import agents
from .quadcopter_env import QuadcopterEnv, QuadcopterEnvCfg

##
# Register Gym environments.
##

task_entry = "omni.isaac.lab_tasks.direct.quadcopter"

gym.register(
id="Isaac-Quadcopter-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.quadcopter:QuadcopterEnv",
entry_point=f"{task_entry}.quadcopter_env:QuadcopterEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": QuadcopterEnvCfg,
"env_cfg_entry_point": f"{task_entry}.quadcopter_env:QuadcopterEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:QuadcopterPPORunnerCfg",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@
import gymnasium as gym

from . import agents
from .shadow_hand_env_cfg import ShadowHandEnvCfg, ShadowHandOpenAIEnvCfg
from .shadow_hand_vision_env import ShadowHandVisionEnvCfg, ShadowHandVisionEnvPlayCfg

##
# Register Gym environments.
##

task_entry = "omni.isaac.lab_tasks.direct.shadow_hand"
inhand_task_entry = "omni.isaac.lab_tasks.direct.inhand_manipulation"

gym.register(
id="Isaac-Repose-Cube-Shadow-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.inhand_manipulation:InHandManipulationEnv",
entry_point=f"{inhand_task_entry}.inhand_manipulation_env:InHandManipulationEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": ShadowHandEnvCfg,
"env_cfg_entry_point": f"{task_entry}.shadow_hand_env_cfg:ShadowHandEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:ShadowHandPPORunnerCfg",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml",
Expand All @@ -31,10 +32,10 @@

gym.register(
id="Isaac-Repose-Cube-Shadow-OpenAI-FF-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.inhand_manipulation:InHandManipulationEnv",
entry_point=f"{inhand_task_entry}.inhand_manipulation_env:InHandManipulationEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": ShadowHandOpenAIEnvCfg,
"env_cfg_entry_point": f"{task_entry}.shadow_hand_env_cfg:ShadowHandOpenAIEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_ff_cfg.yaml",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:ShadowHandAsymFFPPORunnerCfg",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_ff_ppo_cfg.yaml",
Expand All @@ -43,10 +44,10 @@

gym.register(
id="Isaac-Repose-Cube-Shadow-OpenAI-LSTM-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.inhand_manipulation:InHandManipulationEnv",
entry_point=f"{inhand_task_entry}.inhand_manipulation_env:InHandManipulationEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": ShadowHandOpenAIEnvCfg,
"env_cfg_entry_point": f"{task_entry}.shadow_hand_env_cfg:ShadowHandOpenAIEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_lstm_cfg.yaml",
},
)
Expand All @@ -55,21 +56,21 @@

gym.register(
id="Isaac-Repose-Cube-Shadow-Vision-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.shadow_hand.shadow_hand_vision_env:ShadowHandVisionEnv",
entry_point=f"{task_entry}.shadow_hand_vision_env:ShadowHandVisionEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": ShadowHandVisionEnvCfg,
"env_cfg_entry_point": f"{task_entry}.shadow_hand_vision_env:ShadowHandVisionEnvCfg",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:ShadowHandVisionFFPPORunnerCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_vision_cfg.yaml",
},
)

gym.register(
id="Isaac-Repose-Cube-Shadow-Vision-Direct-Play-v0",
entry_point="omni.isaac.lab_tasks.direct.shadow_hand.shadow_hand_vision_env:ShadowHandVisionEnv",
entry_point=f"{task_entry}.shadow_hand_vision_env:ShadowHandVisionEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": ShadowHandVisionEnvPlayCfg,
"env_cfg_entry_point": f"{task_entry}.shadow_hand_vision_env:ShadowHandVisionEnvPlayCfg",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:ShadowHandVisionFFPPORunnerCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_vision_cfg.yaml",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
import gymnasium as gym

from . import agents
from .shadow_hand_over_env import ShadowHandOverEnv
from .shadow_hand_over_env_cfg import ShadowHandOverEnvCfg

##
# Register Gym environments.
##

task_entry = "omni.isaac.lab_tasks.direct.shadow_hand_over"

gym.register(
id="Isaac-Shadow-Hand-Over-Direct-v0",
entry_point="omni.isaac.lab_tasks.direct.shadow_hand_over:ShadowHandOverEnv",
entry_point=f"{task_entry}.shadow_hand_over_env:ShadowHandOverEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": ShadowHandOverEnvCfg,
"env_cfg_entry_point": f"{task_entry}.shadow_hand_over_env_cfg:ShadowHandOverEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml",
"skrl_ippo_cfg_entry_point": f"{agents.__name__}:skrl_ippo_cfg.yaml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@

import gymnasium as gym

from . import agents, ant_env_cfg
from . import agents

##
# Register Gym environments.
##

task_entry = "omni.isaac.lab_tasks.manager_based.classic.ant"

gym.register(
id="Isaac-Ant-v0",
entry_point="omni.isaac.lab.envs:ManagerBasedRLEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": ant_env_cfg.AntEnvCfg,
"env_cfg_entry_point": f"{task_entry}.ant_env_cfg:AntEnvCfg",
"rsl_rl_cfg_entry_point": f"{agents.__name__}.rsl_rl_ppo_cfg:AntPPORunnerCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_ppo_cfg.yaml",
Expand Down
Loading
Loading