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

Renames exts to source and update extensions for Isaac Lab 2.0 and Is… #46

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .vscode/tools/setup_vscode.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def overwrite_python_analysis_extra_paths(isaaclab_settings: str) -> str:
)

# add the path names that are in the Isaac Lab extensions directory
isaaclab_extensions = os.listdir(os.path.join(PROJECT_DIR, "exts"))
path_names.extend(['"${workspaceFolder}/exts/' + ext + '"' for ext in isaaclab_extensions])
isaaclab_extensions = os.listdir(os.path.join(PROJECT_DIR, "source"))
path_names.extend(['"${workspaceFolder}/source/' + ext + '"' for ext in isaaclab_extensions])

# combine them into a single string
path_names = ",\n\t\t".expandtabs(4).join(path_names)
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Template for Isaac Lab Projects

[![IsaacSim](https://img.shields.io/badge/IsaacSim-4.2.0-silver.svg)](https://docs.omniverse.nvidia.com/isaacsim/latest/overview.html)
[![Isaac Lab](https://img.shields.io/badge/IsaacLab-1.2.0-silver)](https://isaac-sim.github.io/IsaacLab)
[![IsaacSim](https://img.shields.io/badge/IsaacSim-4.5.0-silver.svg)](https://docs.omniverse.nvidia.com/isaacsim/latest/overview.html)
[![Isaac Lab](https://img.shields.io/badge/IsaacLab-2.0.0-silver)](https://isaac-sim.github.io/IsaacLab)
[![Python](https://img.shields.io/badge/python-3.10-blue.svg)](https://docs.python.org/3/whatsnew/3.10.html)
[![Linux platform](https://img.shields.io/badge/platform-linux--64-orange.svg)](https://releases.ubuntu.com/20.04/)
[![Windows platform](https://img.shields.io/badge/platform-windows--64-orange.svg)](https://www.microsoft.com/en-us/)
Expand All @@ -21,9 +21,9 @@ This repository serves as a template for building projects or extensions based o

## Installation

- Install Isaac Lab by following the [installation guide](https://isaac-sim.github.io/IsaacLab/source/setup/installation/index.html). We recommend using the conda installation as it simplifies calling Python scripts from the terminal.
- Install Isaac Lab by following the [installation guide](https://isaac-sim.github.io/IsaacLab/main/source/setup/installation/index.html). We recommend using the conda installation as it simplifies calling Python scripts from the terminal.

- Clone the repository separately from the Isaac Lab installation (i.e. outside the `IsaacLab` directory):
- Clone this repository separately from the Isaac Lab installation (i.e. outside the `IsaacLab` directory):

```bash
# Option 1: HTTPS
Expand All @@ -45,7 +45,7 @@ python scripts/rename_template.py your_fancy_extension_name
- Using a python interpreter that has Isaac Lab installed, install the library

```bash
python -m pip install -e exts/ext_template
python -m pip install -e source/ext_template
```

- Verify that the extension is correctly installed by running the following command:
Expand All @@ -64,15 +64,15 @@ If everything executes correctly, it should create a file .python.env in the `.v

### Setup as Omniverse Extension (Optional)

We provide an example UI extension that will load upon enabling your extension defined in `exts/ext_template/ext_template/ui_extension_example.py`. For more information on UI extensions, enable and check out the source code of the `omni.isaac.ui_template` extension and refer to the introduction on [Isaac Sim Workflows 1.2.3. GUI](https://docs.omniverse.nvidia.com/isaacsim/latest/introductory_tutorials/tutorial_intro_workflows.html#gui).
We provide an example UI extension that will load upon enabling your extension defined in `source/ext_template/ext_template/ui_extension_example.py`.

To enable your extension, follow these steps:

1. **Add the search path of your repository** to the extension manager:
- Navigate to the extension manager using `Window` -> `Extensions`.
- Click on the **Hamburger Icon** (☰), then go to `Settings`.
- In the `Extension Search Paths`, enter the absolute path to `IsaacLabExtensionTemplate/exts`
- If not already present, in the `Extension Search Paths`, enter the path that leads to Isaac Lab's extension directory directory (`IsaacLab/source/extensions`)
- In the `Extension Search Paths`, enter the absolute path to `IsaacLabExtensionTemplate/source`
- If not already present, in the `Extension Search Paths`, enter the path that leads to Isaac Lab's extension directory directory (`IsaacLab/source`)
- Click on the **Hamburger Icon** (☰), then click `Refresh`.

2. **Search and enable your extension**:
Expand All @@ -84,7 +84,7 @@ To enable your extension, follow these steps:
### Building Isaac Lab Base Image

Currently, we don't have the Docker for Isaac Lab publicly available. Hence, you'd need to build the docker image
for Isaac Lab locally by following the steps [here](https://isaac-sim.github.io/IsaacLab/source/deployment/index.html).
for Isaac Lab locally by following the steps [here](https://isaac-sim.github.io/IsaacLab/main/source/deployment/index.html).

Once you have built the base Isaac Lab image, you can check it exists by doing:

Expand Down Expand Up @@ -177,7 +177,7 @@ In some VsCode versions, the indexing of part of the extensions is missing. In t
```json
{
"python.analysis.extraPaths": [
"<path-to-ext-repo>/exts/ext_template"
"<path-to-ext-repo>/source/ext_template"
]
}
```
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COPY ../ ${DOCKER_ISAACLAB_EXTENSION_TEMPLATE_PATH}

# # Install whatever you need as additional dependencies.
RUN bash -i -c "source ${HOME}/.bashrc && \
cd ${DOCKER_ISAACLAB_EXTENSION_TEMPLATE_PATH}/exts/ext_template && \
cd ${DOCKER_ISAACLAB_EXTENSION_TEMPLATE_PATH}/source/ext_template && \
pip install -e ."

# make working directory as the Isaac Lab directory
Expand Down
11 changes: 6 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ extra_standard_library = [
"psutil",
]
known_thirdparty = [
"omni.isaac.core",
"omni.replicator.isaac",
"isaacsim.core.api",
"omni.replicator.core",
"pxr",
"omni.kit.*",
Expand All @@ -49,9 +48,11 @@ known_thirdparty = [
"Semantics",
]
known_isaaclabparty = [
"omni.isaac.lab",
"omni.isaac.lab_tasks",
"omni.isaac.lab_assets"
"isaaclab",
"isaaclab_tasks",
"isaaclab_assets",
"isaaclab_mimic",
"isaaclab_rl"
]

# Modify the following to include the package names of your first-party code
Expand Down
2 changes: 1 addition & 1 deletion scripts/list_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

"""Launch Isaac Sim Simulator first."""

from omni.isaac.lab.app import AppLauncher
from isaaclab.app import AppLauncher

# launch omniverse app
app_launcher = AppLauncher(headless=True)
Expand Down
8 changes: 5 additions & 3 deletions scripts/rename_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ def rename_file_contents(root_dir_path: str, old_name: str, new_name: str, exclu
if proceed.lower() == "y":
# rename the ext_template folder
os.rename(
os.path.join(root_dir_path, "exts", "ext_template", "ext_template"),
os.path.join(root_dir_path, "exts", "ext_template", new_name),
os.path.join(root_dir_path, "source", "ext_template", "ext_template"),
os.path.join(root_dir_path, "source", "ext_template", new_name),
)
os.rename(
os.path.join(root_dir_path, "source", "ext_template"), os.path.join(root_dir_path, "source", new_name)
)
os.rename(os.path.join(root_dir_path, "exts", "ext_template"), os.path.join(root_dir_path, "exts", new_name))
# rename the file contents
rename_file_contents(root_dir_path, old_name, new_name, exclude_dirs=[".git"])
else:
Expand Down
4 changes: 2 additions & 2 deletions scripts/rsl_rl/cli_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from omni.isaac.lab_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg
from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg


def add_rsl_rl_args(parser: argparse.ArgumentParser):
Expand Down Expand Up @@ -43,7 +43,7 @@ def parse_rsl_rl_cfg(task_name: str, args_cli: argparse.Namespace) -> RslRlOnPol
Returns:
The parsed configuration for RSL-RL agent based on inputs.
"""
from omni.isaac.lab_tasks.utils.parse_cfg import load_cfg_from_registry
from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry

# load the default configuration
rslrl_cfg: RslRlOnPolicyRunnerCfg = load_cfg_from_registry(task_name, "rsl_rl_cfg_entry_point")
Expand Down
15 changes: 5 additions & 10 deletions scripts/rsl_rl/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import argparse

from omni.isaac.lab.app import AppLauncher
from isaaclab.app import AppLauncher

# local imports
import cli_args # isort: skip
Expand Down Expand Up @@ -39,15 +39,10 @@

from rsl_rl.runners import OnPolicyRunner

from omni.isaac.lab.envs import DirectMARLEnv, multi_agent_to_single_agent
from omni.isaac.lab.utils.dict import print_dict
from omni.isaac.lab_tasks.utils import get_checkpoint_path, parse_env_cfg
from omni.isaac.lab_tasks.utils.wrappers.rsl_rl import (
RslRlOnPolicyRunnerCfg,
RslRlVecEnvWrapper,
export_policy_as_jit,
export_policy_as_onnx,
)
from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent
from isaaclab.utils.dict import print_dict
from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper, export_policy_as_jit, export_policy_as_onnx
from isaaclab_tasks.utils import get_checkpoint_path, parse_env_cfg

# Import extensions to set up environment tasks
import ext_template.tasks # noqa: F401
Expand Down
14 changes: 7 additions & 7 deletions scripts/rsl_rl/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import argparse
import sys

from omni.isaac.lab.app import AppLauncher
from isaaclab.app import AppLauncher

# local imports
import cli_args # isort: skip
Expand Down Expand Up @@ -51,18 +51,18 @@

from rsl_rl.runners import OnPolicyRunner

from omni.isaac.lab.envs import (
from isaaclab.envs import (
DirectMARLEnv,
DirectMARLEnvCfg,
DirectRLEnvCfg,
ManagerBasedRLEnvCfg,
multi_agent_to_single_agent,
)
from omni.isaac.lab.utils.dict import print_dict
from omni.isaac.lab.utils.io import dump_pickle, dump_yaml
from omni.isaac.lab_tasks.utils import get_checkpoint_path
from omni.isaac.lab_tasks.utils.hydra import hydra_task_config
from omni.isaac.lab_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper
from isaaclab.utils.dict import print_dict
from isaaclab.utils.io import dump_pickle, dump_yaml
from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper
from isaaclab_tasks.utils import get_checkpoint_path
from isaaclab_tasks.utils.hydra import hydra_task_config

# Import extensions to set up environment tasks
import ext_template.tasks # noqa: F401
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ repository = "https://github.com/isaac-sim/IsaacLabExtensionTemplate.git"
keywords = ["extension", "template", "isaaclab"]

[dependencies]
"omni.isaac.lab" = {}
"omni.isaac.lab_assets" = {}
"omni.isaac.lab_tasks" = {}
"isaaclab" = {}
"isaaclab_assets" = {}
"isaclab_mimic" = {}
"isaaclab_rl" = {}
"isaaclab_tasks" = {}
# NOTE: Add additional dependencies here

[[python.module]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import toml

from omni.isaac.lab_tasks.utils import import_packages
from isaaclab_tasks.utils import import_packages

##
# Register Gym environments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

gym.register(
id="Template-Isaac-Velocity-Flat-Anymal-D-v0",
entry_point="omni.isaac.lab.envs:ManagerBasedRLEnv",
entry_point="isaaclab.envs:ManagerBasedRLEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": flat_env_cfg.AnymalDFlatEnvCfg,
Expand All @@ -18,7 +18,7 @@

gym.register(
id="Template-Isaac-Velocity-Flat-Anymal-D-Play-v0",
entry_point="omni.isaac.lab.envs:ManagerBasedRLEnv",
entry_point="isaaclab.envs:ManagerBasedRLEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": flat_env_cfg.AnymalDFlatEnvCfg_PLAY,
Expand All @@ -28,7 +28,7 @@

gym.register(
id="Template-Isaac-Velocity-Rough-Anymal-D-v0",
entry_point="omni.isaac.lab.envs:ManagerBasedRLEnv",
entry_point="isaaclab.envs:ManagerBasedRLEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": rough_env_cfg.AnymalDRoughEnvCfg,
Expand All @@ -38,7 +38,7 @@

gym.register(
id="Template-Isaac-Velocity-Rough-Anymal-D-Play-v0",
entry_point="omni.isaac.lab.envs:ManagerBasedRLEnv",
entry_point="isaaclab.envs:ManagerBasedRLEnv",
disable_env_checker=True,
kwargs={
"env_cfg_entry_point": rough_env_cfg.AnymalDRoughEnvCfg_PLAY,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from omni.isaac.lab.utils import configclass
from omni.isaac.lab_tasks.utils.wrappers.rsl_rl import (
RslRlOnPolicyRunnerCfg,
RslRlPpoActorCriticCfg,
RslRlPpoAlgorithmCfg,
)
from isaaclab.utils import configclass
from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg


@configclass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from omni.isaac.lab.utils import configclass
from isaaclab.utils import configclass

from .rough_env_cfg import AnymalDRoughEnvCfg

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from omni.isaac.lab.utils import configclass
from isaaclab.utils import configclass

from ext_template.tasks.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg

##
# Pre-defined configs
##
from omni.isaac.lab_assets.anymal import ANYMAL_D_CFG # isort: skip
from isaaclab_assets.robots.anymal import ANYMAL_D_CFG # isort: skip


@configclass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""This sub-module contains the functions that are specific to the locomotion environments."""

from omni.isaac.lab.envs.mdp import * # noqa: F401, F403
from isaaclab.envs.mdp import * # noqa: F401, F403

from .curriculums import * # noqa: F401, F403
from .rewards import * # noqa: F401, F403
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Common functions that can be used to create curriculum for the learning environment.

The functions can be passed to the :class:`omni.isaac.lab.managers.CurriculumTermCfg` object to enable
The functions can be passed to the :class:`isaaclab.managers.CurriculumTermCfg` object to enable
the curriculum introduced by the function.
"""

Expand All @@ -10,12 +10,12 @@
from collections.abc import Sequence
from typing import TYPE_CHECKING

from omni.isaac.lab.assets import Articulation
from omni.isaac.lab.managers import SceneEntityCfg
from omni.isaac.lab.terrains import TerrainImporter
from isaaclab.assets import Articulation
from isaaclab.managers import SceneEntityCfg
from isaaclab.terrains import TerrainImporter

if TYPE_CHECKING:
from omni.isaac.lab.envs import RLTaskEnv
from isaaclab.envs import RLTaskEnv


def terrain_levels_vel(
Expand All @@ -28,7 +28,7 @@ def terrain_levels_vel(

.. note::
It is only possible to use this term with the terrain type ``generator``. For further information
on different terrain types, check the :class:`omni.isaac.lab.terrains.TerrainImporter` class.
on different terrain types, check the :class:`isaaclab.terrains.TerrainImporter` class.

Returns:
The mean terrain level for the given environment ids.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import torch
from typing import TYPE_CHECKING

from omni.isaac.lab.managers import SceneEntityCfg
from omni.isaac.lab.sensors import ContactSensor
from isaaclab.managers import SceneEntityCfg
from isaaclab.sensors import ContactSensor

if TYPE_CHECKING:
from omni.isaac.lab.envs import ManagerBasedRLEnv
from isaaclab.envs import ManagerBasedRLEnv


def feet_air_time(
Expand Down
Loading