Skip to content

Commit

Permalink
Update environment loader and wrapper for Isaac Lab 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni-SM committed Jan 7, 2025
1 parent deb28ff commit 8998421
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions skrl/envs/loaders/torch/isaaclab_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ def load_isaaclab_env(
)

# launch the simulation app
from omni.isaac.lab.app import AppLauncher
try:
from omni.isaac.lab.app import AppLauncher
except ModuleNotFoundError:
from isaaclab.app import AppLauncher

AppLauncher.add_app_launcher_args(parser)
args = parser.parse_args()
Expand All @@ -149,8 +152,12 @@ def load_isaaclab_env(
def close_the_simulator():
app_launcher.app.close()

import omni.isaac.lab_tasks # type: ignore
from omni.isaac.lab_tasks.utils import parse_env_cfg # type: ignore
try:
import omni.isaac.lab_tasks # type: ignore
from omni.isaac.lab_tasks.utils import parse_env_cfg # type: ignore
except ModuleNotFoundError:
import isaaclab_tasks # type: ignore
from isaaclab_tasks.utils import parse_env_cfg # type: ignore

cfg = parse_env_cfg(args.task, device=args.device, num_envs=args.num_envs, use_fabric=not args.disable_fabric)

Expand Down
2 changes: 1 addition & 1 deletion skrl/envs/wrappers/jax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _in(values, container):
if verbose:
logger.info(f"Environment wrapper: 'auto' (class: {', '.join(base_classes)})")

if _in("omni.isaac.lab.envs..*", base_classes):
if _in(["omni.isaac.lab.*", "isaaclab.*"], base_classes):
return "isaaclab-*"
elif _in("omni.isaac.gym..*", base_classes):
return "omniverse-isaacgym"
Expand Down
2 changes: 1 addition & 1 deletion skrl/envs/wrappers/torch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _in(values, container):
if verbose:
logger.info(f"Environment wrapper: 'auto' (class: {', '.join(base_classes)})")

if _in("omni.isaac.lab.envs..*", base_classes):
if _in(["omni.isaac.lab.*", "isaaclab.*"], base_classes):
return "isaaclab-*"
elif _in("omni.isaac.gym..*", base_classes):
return "omniverse-isaacgym"
Expand Down

0 comments on commit 8998421

Please sign in to comment.