Commit ee91a42d authored by Kelly Guo's avatar Kelly Guo Committed by Kelly Guo

Restructures extension folders and removes old imitation learning scripts (#206)

This change brings some breaking changes in restructuring some of the
existing extensions and folders:

- Removes old imitation learning / robomimic scripts
- Moves wrappers folder in isaaclab_tasks to its own extension -
isaaclab_rl
- Splits the isaaclab_assets folder into robots and sensors
subdirectories

<!-- As you go through the list, delete the ones that are not
applicable. -->

- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- This change requires a documentation update

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [ ] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->
parent 8c1287ab
...@@ -27,6 +27,7 @@ app.version = "4.5.0" ...@@ -27,6 +27,7 @@ app.version = "4.5.0"
"omni.warp.core" = {} "omni.warp.core" = {}
"usdrt.scenegraph" = {} "usdrt.scenegraph" = {}
"omni.kit.telemetry" = {} "omni.kit.telemetry" = {}
"omni.kit.loop" = {}
[settings] [settings]
......
...@@ -22,6 +22,10 @@ sys.path.insert(0, os.path.abspath("../source/isaaclab")) ...@@ -22,6 +22,10 @@ sys.path.insert(0, os.path.abspath("../source/isaaclab"))
sys.path.insert(0, os.path.abspath("../source/isaaclab/isaaclab")) sys.path.insert(0, os.path.abspath("../source/isaaclab/isaaclab"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_tasks")) sys.path.insert(0, os.path.abspath("../source/isaaclab_tasks"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_tasks/isaaclab_tasks")) sys.path.insert(0, os.path.abspath("../source/isaaclab_tasks/isaaclab_tasks"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_rl"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_rl/isaaclab_rl"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_mimic"))
sys.path.insert(0, os.path.abspath("../source/isaaclab_mimic/isaaclab_mimic"))
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
......
...@@ -4,7 +4,7 @@ API Reference ...@@ -4,7 +4,7 @@ API Reference
This page gives an overview of all the modules and classes in the Isaac Lab extensions. This page gives an overview of all the modules and classes in the Isaac Lab extensions.
isaaclab extension isaaclab extension
------------------------ ------------------
The following modules are available in the ``isaaclab`` extension: The following modules are available in the ``isaaclab`` extension:
...@@ -38,7 +38,7 @@ The following modules are available in the ``isaaclab`` extension: ...@@ -38,7 +38,7 @@ The following modules are available in the ``isaaclab`` extension:
lab/isaaclab.sim.spawners lab/isaaclab.sim.spawners
isaaclab_tasks extension isaaclab_tasks extension
-------------------------------- ------------------------
The following modules are available in the ``isaaclab_tasks`` extension: The following modules are available in the ``isaaclab_tasks`` extension:
...@@ -50,8 +50,12 @@ The following modules are available in the ``isaaclab_tasks`` extension: ...@@ -50,8 +50,12 @@ The following modules are available in the ``isaaclab_tasks`` extension:
utils utils
.. toctree:: isaaclab_rl extension
:hidden: ---------------------
lab_tasks/isaaclab_tasks.utils.wrappers The following wrappers are available in the ``isaaclab_rl`` extension:
lab_tasks/isaaclab_tasks.utils.data_collector
.. currentmodule:: isaaclab_rl
.. autosummary::
:toctree: lab_rl
isaaclab_tasks.utils.wrappers isaaclab_rl
============================= ===========
.. automodule:: isaaclab_tasks.utils.wrappers .. automodule:: isaaclab_rl
RL-Games Wrapper RL-Games Wrapper
---------------- ----------------
.. automodule:: isaaclab_tasks.utils.wrappers.rl_games .. automodule:: isaaclab_rl.rl_games
:members: :members:
:show-inheritance: :show-inheritance:
RSL-RL Wrapper RSL-RL Wrapper
-------------- --------------
.. automodule:: isaaclab_tasks.utils.wrappers.rsl_rl .. automodule:: isaaclab_rl.rsl_rl
:members: :members:
:imported-members: :imported-members:
:show-inheritance: :show-inheritance:
...@@ -21,13 +21,13 @@ RSL-RL Wrapper ...@@ -21,13 +21,13 @@ RSL-RL Wrapper
SKRL Wrapper SKRL Wrapper
------------ ------------
.. automodule:: isaaclab_tasks.utils.wrappers.skrl .. automodule:: isaaclab_rl.skrl
:members: :members:
:show-inheritance: :show-inheritance:
Stable-Baselines3 Wrapper Stable-Baselines3 Wrapper
------------------------- -------------------------
.. automodule:: isaaclab_tasks.utils.wrappers.sb3 .. automodule:: isaaclab_rl.sb3
:members: :members:
:show-inheritance: :show-inheritance:
isaaclab_tasks.utils.data_collector
===================================
.. automodule:: isaaclab_tasks.utils.data_collector
.. Rubric:: Classes
.. autosummary::
RobomimicDataCollector
Robomimic Data Collector
------------------------
.. autoclass:: RobomimicDataCollector
:members:
:show-inheritance:
...@@ -6,8 +6,3 @@ ...@@ -6,8 +6,3 @@
:imported-members: :imported-members:
.. rubric:: Submodules .. rubric:: Submodules
.. autosummary::
data_collector
wrappers
...@@ -73,7 +73,7 @@ The following steps can be followed to integrate a new library with Isaac Lab: ...@@ -73,7 +73,7 @@ The following steps can be followed to integrate a new library with Isaac Lab:
installed or available. installed or available.
2. Install your library in the Python environment used by Isaac Lab. You can do this by following the steps mentioned 2. Install your library in the Python environment used by Isaac Lab. You can do this by following the steps mentioned
in the previous section. in the previous section.
3. Create a wrapper for the library. You can check the module :mod:`isaaclab_tasks.utils.wrappers` 3. Create a wrapper for the library. You can check the module :mod:`isaaclab_rl`
for examples of wrappers for different libraries. You can create a new wrapper for your library and add it to the for examples of wrappers for different libraries. You can create a new wrapper for your library and add it to the
module. You can also create a new module for the wrapper if you prefer. module. You can also create a new module for the wrapper if you prefer.
4. Create workflow scripts for your library to train and evaluate agents. You can check the existing workflow scripts 4. Create workflow scripts for your library to train and evaluate agents. You can check the existing workflow scripts
...@@ -84,8 +84,8 @@ Optionally, you can also add some tests and documentation for the wrapper. This ...@@ -84,8 +84,8 @@ Optionally, you can also add some tests and documentation for the wrapper. This
works as expected and can guide users on how to use the wrapper. works as expected and can guide users on how to use the wrapper.
* Add some tests to ensure that the wrapper works as expected and remains compatible with the library. * Add some tests to ensure that the wrapper works as expected and remains compatible with the library.
These tests can be added to the ``source/isaaclab_tasks/test/wrappers`` directory. These tests can be added to the ``source/isaaclab_rl/test`` directory.
* Add some documentation for the wrapper. You can add the API documentation to the * Add some documentation for the wrapper. You can add the API documentation to the
``docs/source/api/lab_tasks/isaaclab_tasks.utils.wrappers.rst`` file. ``docs/source/api/lab_tasks/isaaclab_rl.rst`` file.
.. _rsl-rl: https://github.com/leggedrobotics/rsl_rl .. _rsl-rl: https://github.com/leggedrobotics/rsl_rl
...@@ -135,7 +135,7 @@ As an example of how to use the RL task environment with Stable-Baselines3: ...@@ -135,7 +135,7 @@ As an example of how to use the RL task environment with Stable-Baselines3:
.. code:: python .. code:: python
from isaaclab_tasks.utils.wrappers.sb3 import Sb3VecEnvWrapper from isaaclab_rl.sb3 import Sb3VecEnvWrapper
# create isaac-env instance # create isaac-env instance
env = gym.make(task_name, cfg=env_cfg) env = gym.make(task_name, cfg=env_cfg)
...@@ -153,7 +153,7 @@ As an example of how to use the RL task environment with Stable-Baselines3: ...@@ -153,7 +153,7 @@ As an example of how to use the RL task environment with Stable-Baselines3:
Adding new wrappers Adding new wrappers
------------------- -------------------
All new wrappers should be added to the :mod:`isaaclab_tasks.utils.wrappers` module. All new wrappers should be added to the :mod:`isaaclab_rl` module.
They should check that the underlying environment is an instance of :class:`isaaclab.envs.ManagerBasedRLEnv` They should check that the underlying environment is an instance of :class:`isaaclab.envs.ManagerBasedRLEnv`
or :class:`~envs.DirectRLEnv` or :class:`~envs.DirectRLEnv`
before applying the wrapper. This can be done by using the :func:`unwrapped` property. before applying the wrapper. This can be done by using the :func:`unwrapped` property.
......
...@@ -22,7 +22,7 @@ is free to move along a rail, and the pole is free to rotate about the cart. ...@@ -22,7 +22,7 @@ is free to move along a rail, and the pole is free to rotate about the cart.
.. dropdown:: Code for Cartpole configuration .. dropdown:: Code for Cartpole configuration
:icon: code :icon: code
.. literalinclude:: ../../../source/isaaclab_assets/isaaclab_assets/cartpole.py .. literalinclude:: ../../../source/isaaclab_assets/isaaclab_assets/robots/cartpole.py
:language: python :language: python
:linenos: :linenos:
...@@ -44,7 +44,7 @@ This configuration object takes in the following parameters: ...@@ -44,7 +44,7 @@ This configuration object takes in the following parameters:
The last two parameters are optional. If not specified, they are kept at their default values in the USD file. The last two parameters are optional. If not specified, they are kept at their default values in the USD file.
.. literalinclude:: ../../../source/isaaclab_assets/isaaclab_assets/cartpole.py .. literalinclude:: ../../../source/isaaclab_assets/isaaclab_assets/robots/cartpole.py
:language: python :language: python
:lines: 19-35 :lines: 19-35
:dedent: :dedent:
...@@ -72,7 +72,7 @@ initial state of the root of the articulation and the initial state of all its j ...@@ -72,7 +72,7 @@ initial state of the root of the articulation and the initial state of all its j
example, we will spawn the Cartpole at the origin of the XY plane at a Z height of 2.0 meters. example, we will spawn the Cartpole at the origin of the XY plane at a Z height of 2.0 meters.
Meanwhile, the joint positions and velocities are set to 0.0. Meanwhile, the joint positions and velocities are set to 0.0.
.. literalinclude:: ../../../source/isaaclab_assets/isaaclab_assets/cartpole.py .. literalinclude:: ../../../source/isaaclab_assets/isaaclab_assets/robots/cartpole.py
:language: python :language: python
:lines: 36-38 :lines: 36-38
:dedent: :dedent:
...@@ -94,7 +94,7 @@ to combine them into a single actuator model. ...@@ -94,7 +94,7 @@ to combine them into a single actuator model.
.. dropdown:: Actuator model configuration with separate actuator models .. dropdown:: Actuator model configuration with separate actuator models
:icon: code :icon: code
.. literalinclude:: ../../../source/isaaclab_assets/isaaclab_assets/cartpole.py .. literalinclude:: ../../../source/isaaclab_assets/isaaclab_assets/robots/cartpole.py
:language: python :language: python
:lines: 39-49 :lines: 39-49
:dedent: :dedent:
......
...@@ -20,6 +20,8 @@ The Isaac Lab repository is structured as follows: ...@@ -20,6 +20,8 @@ The Isaac Lab repository is structured as follows:
├── source ├── source
│   ├── isaaclab │   ├── isaaclab
│   ├── isaaclab_assets │   ├── isaaclab_assets
│   ├── isaaclab_mimic
│   ├── isaaclab_rl
│   └── isaaclab_tasks │   └── isaaclab_tasks
├── scripts ├── scripts
│   ├── demos │   ├── demos
...@@ -49,8 +51,9 @@ The extensions are organized as follows: ...@@ -49,8 +51,9 @@ The extensions are organized as follows:
* **isaaclab**: Contains the core interface extension for Isaac Lab. This provides the main modules for actuators, * **isaaclab**: Contains the core interface extension for Isaac Lab. This provides the main modules for actuators,
objects, robots and sensors. objects, robots and sensors.
* **isaaclab_assets**: Contains the extension with pre-configured assets for Isaac Lab. * **isaaclab_assets**: Contains the extension with pre-configured assets for Isaac Lab.
* **isaaclab_tasks**: Contains the extension with pre-configured environments for Isaac Lab. It also includes * **isaaclab_tasks**: Contains the extension with pre-configured environments for Isaac Lab.
wrappers for using these environments with different agents. * **isaaclab_mimic**: Contains APIs and pre-configured environments for data generation for imitation learning.
* **isaaclab_rl**: Contains wrappers for using the above environments with different reinforcement learning agents.
Standalone Standalone
......
...@@ -42,6 +42,28 @@ From the Isaac Sim UI, both URDF and MJCF importers can now be accessed directly ...@@ -42,6 +42,28 @@ From the Isaac Sim UI, both URDF and MJCF importers can now be accessed directly
menu when selecting a corresponding .urdf or .xml file in the file browser. menu when selecting a corresponding .urdf or .xml file in the file browser.
Changes in URDF Importer
------------------------
Isaac Sim 4.5 brings some updates to the URDF Importer, with a fresh UI to allow for better configurations
when importing robots from URDF. As a result, the Isaac Lab URDF Converter has also been updated to
reflect these changes. The :class:`UrdfConverterCfg` includes some new settings, such as :class:`PDGainsCfg`
and :class:`NaturalFrequencyGainsCfg` classes for configuring the gains of the drives.
One breaking change to note is that the :attr:`UrdfConverterCfg.JointDriveCfg.gains` attribute must
be of class type :class:`PDGainsCfg` or :class:`NaturalFrequencyGainsCfg`.
The stiffness of the :class:`PDGainsCfg` must be specified, as such:
.. code::python
joint_drive=sim_utils.UrdfConverterCfg.JointDriveCfg(
gains=sim_utils.UrdfConverterCfg.JointDriveCfg.PDGainsCfg(stiffness=None, damping=None)
)
The :attr:`natural_frequency` must be specified for :class:`NaturalFrequencyGainsCfg`.
Renaming of omni.isaac.core Classes Renaming of omni.isaac.core Classes
----------------------------------- -----------------------------------
...@@ -93,4 +115,21 @@ through the ``source`` and ``docs`` directories in your local Isaac Lab project ...@@ -93,4 +115,21 @@ through the ``source`` and ``docs`` directories in your local Isaac Lab project
directories and imports. **Please use the script at your own risk as it will overwrite source files directly.** directories and imports. **Please use the script at your own risk as it will overwrite source files directly.**
Restructuring of Isaac Lab Extensions
-------------------------------------
With the introduction of ``isaaclab_mimic``, designed for supporting data generation workflows for imitation learning,
we have also split out the previous ``wrappers`` folder under ``isaaclab_tasks`` to its own module, named ``isaaclab_rl``.
This new extension will contain reinforcement learning specific wrappers for the various RL libraries supported by Isaac Lab.
The new ``isaaclab_mimic`` extension will also replace the previous imitation learning scripts under the ``robomimic`` folder.
We have removed the old scripts for data collection and dataset preparation in favor of the new mimic workflow. For users
who prefer to use the previous scripts, they will be available in previous release branches.
Additionally, we have also restructured the ``isaaclab_assets`` extension to be split into ``robots`` and ``sensors``
subdirectories. This allows for clearer separation between the pre-defined configurations provided in the extension.
For any existing imports such as ``from omni.isaac.lab_assets.anymal import ANYMAL_C_CFG``, please replace it with
``from isaaclab.robots.anymal import ANYMAL_C_CFG``.
.. _simple script: https://gist.github.com/kellyguo11/3e8f73f739b1c013b1069ad372277a85 .. _simple script: https://gist.github.com/kellyguo11/3e8f73f739b1c013b1069ad372277a85
...@@ -198,7 +198,7 @@ Some wrappers include: ...@@ -198,7 +198,7 @@ Some wrappers include:
Most RL libraries expect their own variation of an environment interface. This means the Most RL libraries expect their own variation of an environment interface. This means the
data types needed by each library differs. Isaac Lab provides its own wrappers to convert data types needed by each library differs. Isaac Lab provides its own wrappers to convert
the environment into the expected interface by the RL library a user wants to use. These are the environment into the expected interface by the RL library a user wants to use. These are
specified in the `Isaac Lab utils wrapper module <https://isaac-sim.github.io/IsaacLab/main/source/api/lab_tasks/isaaclab_tasks.utils.wrappers.html#module-isaaclab_tasks.utils.wrappers>`__. specified in the `Isaac Lab utils wrapper module <https://isaac-sim.github.io/IsaacLab/main/source/api/lab_tasks/isaaclab_rl.html#module-isaaclab_rl>`__.
See the `full list <https://gymnasium.farama.org/api/wrappers/#gymnasium.Wrapper>`__ of other wrappers APIs. For more information on how these wrappers work, See the `full list <https://gymnasium.farama.org/api/wrappers/#gymnasium.Wrapper>`__ of other wrappers APIs. For more information on how these wrappers work,
please refer to the `Wrapping environments <https://isaac-sim.github.io/IsaacLab/main/source/how-to/wrap_rl_env.html#how-to-env-wrappers>`__ documentation. please refer to the `Wrapping environments <https://isaac-sim.github.io/IsaacLab/main/source/how-to/wrap_rl_env.html#how-to-env-wrappers>`__ documentation.
......
...@@ -20,7 +20,7 @@ For example, `Stable-Baselines3`_ expects the environment to conform to its ...@@ -20,7 +20,7 @@ For example, `Stable-Baselines3`_ expects the environment to conform to its
`RSL-RL`_, `RL-Games`_ and `SKRL`_ expect a different interface. Since there is no one-size-fits-all `RSL-RL`_, `RL-Games`_ and `SKRL`_ expect a different interface. Since there is no one-size-fits-all
solution, we do not base the :class:`envs.ManagerBasedRLEnv` on any particular learning library. solution, we do not base the :class:`envs.ManagerBasedRLEnv` on any particular learning library.
Instead, we implement wrappers to convert the environment into the expected interface. Instead, we implement wrappers to convert the environment into the expected interface.
These are specified in the :mod:`isaaclab_tasks.utils.wrappers` module. These are specified in the :mod:`isaaclab_rl` module.
In this tutorial, we will use `Stable-Baselines3`_ to train an RL agent to solve the In this tutorial, we will use `Stable-Baselines3`_ to train an RL agent to solve the
cartpole balancing task. cartpole balancing task.
......
...@@ -291,7 +291,7 @@ if "%arg%"=="-i" ( ...@@ -291,7 +291,7 @@ if "%arg%"=="-i" (
shift shift
) )
rem install the rl-frameworks specified rem install the rl-frameworks specified
call !python_exe! -m pip install -e %ISAACLAB_PATH%\source\isaaclab_tasks[!framework_name!] call !python_exe! -m pip install -e %ISAACLAB_PATH%\source\isaaclab_rl[!framework_name!]
shift shift
) else if "%arg%"=="--install" ( ) else if "%arg%"=="--install" (
rem install the python packages in source directory rem install the python packages in source directory
...@@ -316,7 +316,7 @@ if "%arg%"=="-i" ( ...@@ -316,7 +316,7 @@ if "%arg%"=="-i" (
shift shift
) )
rem install the rl-frameworks specified rem install the rl-frameworks specified
call !python_exe! -m pip install -e %ISAACLAB_PATH%\source\isaaclab_tasks[!framework_name!] call !python_exe! -m pip install -e %ISAACLAB_PATH%\source\isaaclab_rl[!framework_name!]
rem update the vscode settings rem update the vscode settings
rem once we have a docker container, we need to disable vscode settings rem once we have a docker container, we need to disable vscode settings
call :update_vscode_settings call :update_vscode_settings
......
...@@ -296,7 +296,7 @@ while [[ $# -gt 0 ]]; do ...@@ -296,7 +296,7 @@ while [[ $# -gt 0 ]]; do
shift # past argument shift # past argument
fi fi
# install the rl-frameworks specified # install the rl-frameworks specified
${python_exe} -m pip install -e ${ISAACLAB_PATH}/source/isaaclab_tasks["${framework_name}"] ${python_exe} -m pip install -e ${ISAACLAB_PATH}/source/isaaclab_rl["${framework_name}"]
# check if we are inside a docker container or are building a docker image # check if we are inside a docker container or are building a docker image
# in that case don't setup VSCode since it asks for EULA agreement which triggers user interaction # in that case don't setup VSCode since it asks for EULA agreement which triggers user interaction
......
...@@ -69,6 +69,7 @@ import random ...@@ -69,6 +69,7 @@ import random
import torch import torch
from datetime import datetime from datetime import datetime
from isaaclab_rl.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
from rl_games.common import env_configurations, vecenv from rl_games.common import env_configurations, vecenv
from rl_games.common.algo_observer import IsaacAlgoObserver from rl_games.common.algo_observer import IsaacAlgoObserver
from rl_games.torch_runner import Runner from rl_games.torch_runner import Runner
...@@ -79,7 +80,6 @@ from isaaclab.utils.io import dump_pickle, dump_yaml ...@@ -79,7 +80,6 @@ from isaaclab.utils.io import dump_pickle, dump_yaml
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils.hydra import hydra_task_config from isaaclab_tasks.utils.hydra import hydra_task_config
from isaaclab_tasks.utils.wrappers.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
imports_time_end = time.perf_counter_ns() imports_time_end = time.perf_counter_ns()
......
...@@ -67,6 +67,7 @@ import os ...@@ -67,6 +67,7 @@ import os
import torch import torch
from datetime import datetime from datetime import datetime
from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper
from rsl_rl.runners import OnPolicyRunner from rsl_rl.runners import OnPolicyRunner
from isaaclab.envs import DirectMARLEnvCfg, DirectRLEnvCfg, ManagerBasedRLEnvCfg from isaaclab.envs import DirectMARLEnvCfg, DirectRLEnvCfg, ManagerBasedRLEnvCfg
...@@ -76,7 +77,6 @@ from isaaclab.utils.io import dump_pickle, dump_yaml ...@@ -76,7 +77,6 @@ from isaaclab.utils.io import dump_pickle, dump_yaml
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils import get_checkpoint_path from isaaclab_tasks.utils import get_checkpoint_path
from isaaclab_tasks.utils.hydra import hydra_task_config from isaaclab_tasks.utils.hydra import hydra_task_config
from isaaclab_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper
imports_time_end = time.perf_counter_ns() imports_time_end = time.perf_counter_ns()
......
...@@ -40,7 +40,7 @@ from isaaclab.sim import SimulationContext ...@@ -40,7 +40,7 @@ from isaaclab.sim import SimulationContext
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.cassie import CASSIE_CFG # isort:skip from isaaclab_assets.robots.cassie import CASSIE_CFG # isort:skip
from isaaclab_assets import H1_CFG # isort:skip from isaaclab_assets import H1_CFG # isort:skip
from isaaclab_assets import G1_CFG # isort:skip from isaaclab_assets import G1_CFG # isort:skip
......
...@@ -54,7 +54,7 @@ from isaaclab.utils import configclass ...@@ -54,7 +54,7 @@ from isaaclab.utils import configclass
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab.terrains.config.rough import ROUGH_TERRAINS_CFG # isort:skip from isaaclab.terrains.config.rough import ROUGH_TERRAINS_CFG # isort:skip
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort: skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort: skip
@configclass @configclass
......
...@@ -43,8 +43,8 @@ from isaaclab.assets import Articulation ...@@ -43,8 +43,8 @@ from isaaclab.assets import Articulation
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.allegro import ALLEGRO_HAND_CFG # isort:skip from isaaclab_assets.robots.allegro import ALLEGRO_HAND_CFG # isort:skip
from isaaclab_assets.shadow_hand import SHADOW_HAND_CFG # isort:skip from isaaclab_assets.robots.shadow_hand import SHADOW_HAND_CFG # isort:skip
def define_origins(num_origins: int, spacing: float) -> list[list[float]]: def define_origins(num_origins: int, spacing: float) -> list[list[float]]:
......
...@@ -59,7 +59,7 @@ from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR ...@@ -59,7 +59,7 @@ from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR
# Pre-defined Configuration # Pre-defined Configuration
## ##
from isaaclab_assets.anymal import ANYDRIVE_3_LSTM_ACTUATOR_CFG # isort: skip from isaaclab_assets.robots.anymal import ANYDRIVE_3_LSTM_ACTUATOR_CFG # isort: skip
## ##
......
...@@ -43,9 +43,9 @@ from isaaclab.assets import Articulation ...@@ -43,9 +43,9 @@ from isaaclab.assets import Articulation
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_B_CFG, ANYMAL_C_CFG, ANYMAL_D_CFG # isort:skip from isaaclab_assets.robots.anymal import ANYMAL_B_CFG, ANYMAL_C_CFG, ANYMAL_D_CFG # isort:skip
from isaaclab_assets.spot import SPOT_CFG # isort:skip from isaaclab_assets.robots.spot import SPOT_CFG # isort:skip
from isaaclab_assets.unitree import UNITREE_A1_CFG, UNITREE_GO1_CFG, UNITREE_GO2_CFG # isort:skip from isaaclab_assets.robots.unitree import UNITREE_A1_CFG, UNITREE_GO1_CFG, UNITREE_GO2_CFG # isort:skip
def define_origins(num_origins: int, spacing: float) -> list[list[float]]: def define_origins(num_origins: int, spacing: float) -> list[list[float]]:
......
...@@ -34,7 +34,7 @@ from isaaclab.utils import configclass ...@@ -34,7 +34,7 @@ from isaaclab.utils import configclass
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort: skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort: skip
@configclass @configclass
......
...@@ -32,7 +32,7 @@ from isaaclab.utils import configclass ...@@ -32,7 +32,7 @@ from isaaclab.utils import configclass
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort: skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort: skip
@configclass @configclass
......
...@@ -34,7 +34,7 @@ from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR ...@@ -34,7 +34,7 @@ from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort: skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort: skip
@configclass @configclass
......
# Copyright (c) 2022-2025, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""Script to collect demonstrations with Isaac Lab environments."""
"""Launch Isaac Sim Simulator first."""
import argparse
from isaaclab.app import AppLauncher
# add argparse arguments
parser = argparse.ArgumentParser(description="Collect demonstrations for Isaac Lab environments.")
parser.add_argument("--num_envs", type=int, default=1, help="Number of environments to simulate.")
parser.add_argument("--task", type=str, default=None, help="Name of the task.")
parser.add_argument("--teleop_device", type=str, default="keyboard", help="Device for interacting with environment")
parser.add_argument("--num_demos", type=int, default=1, help="Number of episodes to store in the dataset.")
parser.add_argument("--filename", type=str, default="hdf_dataset", help="Basename of output file.")
# append AppLauncher cli args
AppLauncher.add_app_launcher_args(parser)
# parse the arguments
args_cli = parser.parse_args()
# launch the simulator
app_launcher = AppLauncher(args_cli)
simulation_app = app_launcher.app
"""Rest everything follows."""
import contextlib
import gymnasium as gym
import os
import torch
from isaaclab.devices import Se3Keyboard, Se3SpaceMouse
from isaaclab.managers import TerminationTermCfg as DoneTerm
from isaaclab.utils.io import dump_pickle, dump_yaml
import isaaclab_tasks # noqa: F401
from isaaclab_tasks.manager_based.manipulation.lift import mdp
from isaaclab_tasks.utils.data_collector import RobomimicDataCollector
from isaaclab_tasks.utils.parse_cfg import parse_env_cfg
def pre_process_actions(delta_pose: torch.Tensor, gripper_command: bool) -> torch.Tensor:
"""Pre-process actions for the environment."""
# compute actions based on environment
if "Reach" in args_cli.task:
# note: reach is the only one that uses a different action space
# compute actions
return delta_pose
else:
# resolve gripper command
gripper_vel = torch.zeros((delta_pose.shape[0], 1), dtype=torch.float, device=delta_pose.device)
gripper_vel[:] = -1 if gripper_command else 1
# compute actions
return torch.concat([delta_pose, gripper_vel], dim=1)
def main():
"""Collect demonstrations from the environment using teleop interfaces."""
assert (
args_cli.task == "Isaac-Lift-Cube-Franka-IK-Rel-v0"
), "Only 'Isaac-Lift-Cube-Franka-IK-Rel-v0' is supported currently."
# parse configuration
env_cfg = parse_env_cfg(args_cli.task, device=args_cli.device, num_envs=args_cli.num_envs)
# modify configuration such that the environment runs indefinitely
# until goal is reached
env_cfg.terminations.time_out = None
# set the resampling time range to large number to avoid resampling
env_cfg.commands.object_pose.resampling_time_range = (1.0e9, 1.0e9)
# we want to have the terms in the observations returned as a dictionary
# rather than a concatenated tensor
env_cfg.observations.policy.concatenate_terms = False
# add termination condition for reaching the goal otherwise the environment won't reset
env_cfg.terminations.object_reached_goal = DoneTerm(func=mdp.object_reached_goal)
# create environment
env = gym.make(args_cli.task, cfg=env_cfg)
# create controller
if args_cli.teleop_device.lower() == "keyboard":
teleop_interface = Se3Keyboard(pos_sensitivity=0.04, rot_sensitivity=0.08)
elif args_cli.teleop_device.lower() == "spacemouse":
teleop_interface = Se3SpaceMouse(pos_sensitivity=0.05, rot_sensitivity=0.005)
else:
raise ValueError(f"Invalid device interface '{args_cli.teleop_device}'. Supported: 'keyboard', 'spacemouse'.")
# add teleoperation key for env reset
teleop_interface.add_callback("L", env.reset)
# print helper
print(teleop_interface)
# specify directory for logging experiments
log_dir = os.path.join("./logs/robomimic", args_cli.task)
# dump the configuration into log-directory
dump_yaml(os.path.join(log_dir, "params", "env.yaml"), env_cfg)
dump_pickle(os.path.join(log_dir, "params", "env.pkl"), env_cfg)
# create data-collector
collector_interface = RobomimicDataCollector(
env_name=args_cli.task,
directory_path=log_dir,
filename=args_cli.filename,
num_demos=args_cli.num_demos,
flush_freq=env.num_envs,
env_config={"teleop_device": args_cli.teleop_device},
)
# reset environment
obs_dict, _ = env.reset()
# reset interfaces
teleop_interface.reset()
collector_interface.reset()
# simulate environment -- run everything in inference mode
with contextlib.suppress(KeyboardInterrupt) and torch.inference_mode():
while not collector_interface.is_stopped():
# get keyboard command
delta_pose, gripper_command = teleop_interface.advance()
# convert to torch
delta_pose = torch.tensor(delta_pose, dtype=torch.float, device=env.device).repeat(env.num_envs, 1)
# compute actions based on environment
actions = pre_process_actions(delta_pose, gripper_command)
# TODO: Deal with the case when reset is triggered by teleoperation device.
# The observations need to be recollected.
# store signals before stepping
# -- obs
for key, value in obs_dict["policy"].items():
collector_interface.add(f"obs/{key}", value)
# -- actions
collector_interface.add("actions", actions)
# perform action on environment
obs_dict, rewards, terminated, truncated, info = env.step(actions)
dones = terminated | truncated
# check that simulation is stopped or not
if env.unwrapped.sim.is_stopped():
break
# robomimic only cares about policy observations
# store signals from the environment
# -- next_obs
for key, value in obs_dict["policy"].items():
collector_interface.add(f"next_obs/{key}", value)
# -- rewards
collector_interface.add("rewards", rewards)
# -- dones
collector_interface.add("dones", dones)
# -- is success label
collector_interface.add("success", env.termination_manager.get_term("object_reached_goal"))
# flush data from collector for successful environments
reset_env_ids = dones.nonzero(as_tuple=False).squeeze(-1)
collector_interface.flush(reset_env_ids)
# check if enough data is collected
if collector_interface.is_stopped():
break
# close the simulator
collector_interface.close()
env.close()
if __name__ == "__main__":
# run the main function
main()
# close sim app
simulation_app.close()
# Copyright (c) 2022-2025, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""Tool to merge multiple episodes with single trajectory into one episode with multiple trajectories."""
import argparse
import h5py
import json
import os
if __name__ == "__main__":
# parse arguments
parser = argparse.ArgumentParser(description="Merge multiple episodes with single trajectory into one episode.")
parser.add_argument(
"--dir", type=str, default=None, help="Path to directory that contains all single episode hdf5 files"
)
parser.add_argument("--task", type=str, default=None, help="Name of the task.")
parser.add_argument("--out", type=str, default="merged_dataset.hdf5", help="output hdf5 file")
args_cli = parser.parse_args()
# read arguments
parent_dir = args_cli.dir
merged_dataset_name = args_cli.out
task_name = args_cli.task
# check valid task name
if task_name is None:
raise ValueError("Please specify a valid task name.")
# get hdf5 entries from specified directory
entries = [i for i in os.listdir(parent_dir) if i.endswith(".hdf5")]
# create new hdf5 file for merging episodes
fp = h5py.File(parent_dir + merged_dataset_name, "a")
# initiate data group
f_grp = fp.create_group("data")
f_grp.attrs["num_samples"] = 0
# merge all episodes
for count, entry in enumerate(entries):
fc = h5py.File(parent_dir + entry, "r")
# find total number of samples in all demos
f_grp.attrs["num_samples"] = f_grp.attrs["num_samples"] + fc["data"]["demo_0"].attrs["num_samples"]
fc.copy("data/demo_0", fp["data"], "demo_" + str(count))
# This is needed to run env in robomimic
fp["data"].attrs["env_args"] = json.dumps({"env_name": task_name, "type": 2, "env_kwargs": {}})
fp.close()
print("merged")
# Copyright (c) 2022-2025, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""Tool to check structure of hdf5 files."""
import argparse
import h5py
def check_group(f, num: int):
"""Print the data from different keys in stored dictionary."""
# print name of the group first
for subs in f:
if isinstance(subs, str):
print("\t" * num, subs, ":", type(f[subs]))
check_group(f[subs], num + 1)
# print attributes of the group
print("\t" * num, "attributes", ":")
for attr in f.attrs:
print("\t" * (num + 1), attr, ":", type(f.attrs[attr]), ":", f.attrs[attr])
if __name__ == "__main__":
# parse arguments
parser = argparse.ArgumentParser(description="Check structure of hdf5 file.")
parser.add_argument("file", type=str, default=None, help="The path to HDF5 file to analyze.")
args_cli = parser.parse_args()
# open specified file
with h5py.File(args_cli.file, "r") as f:
# print name of the file first
print(f)
# print contents of file
check_group(f["data"], 1)
# Copyright (c) 2022-2025, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
# MIT License
#
# Copyright (c) 2021 Stanford Vision and Learning Lab
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
"""
Script for splitting a dataset hdf5 file into training and validation trajectories.
Args:
dataset: path to hdf5 dataset
filter_key: if provided, split the subset of trajectories
in the file that correspond to this filter key into a training
and validation set of trajectories, instead of splitting the
full set of trajectories
ratio: validation ratio, in (0, 1). Defaults to 0.1, which is 10%.
Example usage:
python split_train_val.py --dataset /path/to/demo.hdf5 --ratio 0.1
"""
import argparse
import h5py
import numpy as np
from robomimic.utils.file_utils import create_hdf5_filter_key
def split_train_val_from_hdf5(hdf5_path: str, val_ratio=0.1, filter_key=None):
"""
Splits data into training set and validation set from HDF5 file.
Args:
hdf5_path: path to the hdf5 file to load the transitions from
val_ratio: ratio of validation demonstrations to all demonstrations
filter_key: if provided, split the subset of demonstration keys stored
under mask/@filter_key instead of the full set of demonstrations
"""
# retrieve number of demos
f = h5py.File(hdf5_path, "r")
if filter_key is not None:
print(f"Using filter key: {filter_key}")
demos = sorted(elem.decode("utf-8") for elem in np.array(f[f"mask/{filter_key}"]))
else:
demos = sorted(list(f["data"].keys()))
num_demos = len(demos)
f.close()
# get random split
num_demos = len(demos)
num_val = int(val_ratio * num_demos)
mask = np.zeros(num_demos)
mask[:num_val] = 1.0
np.random.shuffle(mask)
mask = mask.astype(int)
train_inds = (1 - mask).nonzero()[0]
valid_inds = mask.nonzero()[0]
train_keys = [demos[i] for i in train_inds]
valid_keys = [demos[i] for i in valid_inds]
print(f"{num_val} validation demonstrations out of {num_demos} total demonstrations.")
# pass mask to generate split
name_1 = "train"
name_2 = "valid"
if filter_key is not None:
name_1 = f"{filter_key}_{name_1}"
name_2 = f"{filter_key}_{name_2}"
train_lengths = create_hdf5_filter_key(hdf5_path=hdf5_path, demo_keys=train_keys, key_name=name_1)
valid_lengths = create_hdf5_filter_key(hdf5_path=hdf5_path, demo_keys=valid_keys, key_name=name_2)
print(f"Total number of train samples: {np.sum(train_lengths)}")
print(f"Average number of train samples {np.mean(train_lengths)}")
print(f"Total number of valid samples: {np.sum(valid_lengths)}")
print(f"Average number of valid samples {np.mean(valid_lengths)}")
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("dataset", type=str, help="path to hdf5 dataset")
parser.add_argument(
"--filter_key",
type=str,
default=None,
help=(
"If provided, split the subset of trajectories in the file that correspond to this filter key"
" into a training and validation set of trajectories, instead of splitting the full set of"
" trajectories."
),
)
parser.add_argument("--ratio", type=float, default=0.1, help="validation ratio, in (0, 1)")
args = parser.parse_args()
# seed to make sure results are consistent
np.random.seed(0)
split_train_val_from_hdf5(args.dataset, val_ratio=args.ratio, filter_key=args.filter_key)
...@@ -51,6 +51,7 @@ import math ...@@ -51,6 +51,7 @@ import math
import os import os
import torch import torch
from isaaclab_rl.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
from rl_games.common import env_configurations, vecenv from rl_games.common import env_configurations, vecenv
from rl_games.common.player import BasePlayer from rl_games.common.player import BasePlayer
from rl_games.torch_runner import Runner from rl_games.torch_runner import Runner
...@@ -62,7 +63,6 @@ from isaaclab.utils.pretrained_checkpoint import get_published_pretrained_checkp ...@@ -62,7 +63,6 @@ from isaaclab.utils.pretrained_checkpoint import get_published_pretrained_checkp
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils import get_checkpoint_path, load_cfg_from_registry, parse_env_cfg from isaaclab_tasks.utils import get_checkpoint_path, load_cfg_from_registry, parse_env_cfg
from isaaclab_tasks.utils.wrappers.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
def main(): def main():
......
...@@ -50,6 +50,7 @@ import os ...@@ -50,6 +50,7 @@ import os
import random import random
from datetime import datetime from datetime import datetime
from isaaclab_rl.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
from rl_games.common import env_configurations, vecenv from rl_games.common import env_configurations, vecenv
from rl_games.common.algo_observer import IsaacAlgoObserver from rl_games.common.algo_observer import IsaacAlgoObserver
from rl_games.torch_runner import Runner from rl_games.torch_runner import Runner
...@@ -67,7 +68,6 @@ from isaaclab.utils.io import dump_pickle, dump_yaml ...@@ -67,7 +68,6 @@ from isaaclab.utils.io import dump_pickle, dump_yaml
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils.hydra import hydra_task_config from isaaclab_tasks.utils.hydra import hydra_task_config
from isaaclab_tasks.utils.wrappers.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
@hydra_task_config(args_cli.task, "rl_games_cfg_entry_point") @hydra_task_config(args_cli.task, "rl_games_cfg_entry_point")
......
...@@ -10,7 +10,7 @@ import random ...@@ -10,7 +10,7 @@ import random
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
if TYPE_CHECKING: if TYPE_CHECKING:
from isaaclab_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg
def add_rsl_rl_args(parser: argparse.ArgumentParser): def add_rsl_rl_args(parser: argparse.ArgumentParser):
......
...@@ -47,6 +47,7 @@ import gymnasium as gym ...@@ -47,6 +47,7 @@ import gymnasium as gym
import os import os
import torch import torch
from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper, export_policy_as_jit, export_policy_as_onnx
from rsl_rl.runners import OnPolicyRunner from rsl_rl.runners import OnPolicyRunner
from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent
...@@ -56,12 +57,6 @@ from isaaclab.utils.pretrained_checkpoint import get_published_pretrained_checkp ...@@ -56,12 +57,6 @@ from isaaclab.utils.pretrained_checkpoint import get_published_pretrained_checkp
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils import get_checkpoint_path, parse_env_cfg from isaaclab_tasks.utils import get_checkpoint_path, parse_env_cfg
from isaaclab_tasks.utils.wrappers.rsl_rl import (
RslRlOnPolicyRunnerCfg,
RslRlVecEnvWrapper,
export_policy_as_jit,
export_policy_as_onnx,
)
def main(): def main():
......
...@@ -49,6 +49,7 @@ import os ...@@ -49,6 +49,7 @@ import os
import torch import torch
from datetime import datetime from datetime import datetime
from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper
from rsl_rl.runners import OnPolicyRunner from rsl_rl.runners import OnPolicyRunner
from isaaclab.envs import ( from isaaclab.envs import (
...@@ -64,7 +65,6 @@ from isaaclab.utils.io import dump_pickle, dump_yaml ...@@ -64,7 +65,6 @@ from isaaclab.utils.io import dump_pickle, dump_yaml
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils import get_checkpoint_path from isaaclab_tasks.utils import get_checkpoint_path
from isaaclab_tasks.utils.hydra import hydra_task_config from isaaclab_tasks.utils.hydra import hydra_task_config
from isaaclab_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper
torch.backends.cuda.matmul.allow_tf32 = True torch.backends.cuda.matmul.allow_tf32 = True
torch.backends.cudnn.allow_tf32 = True torch.backends.cudnn.allow_tf32 = True
......
...@@ -49,6 +49,7 @@ import os ...@@ -49,6 +49,7 @@ import os
import random import random
from datetime import datetime from datetime import datetime
from isaaclab_rl.sb3 import Sb3VecEnvWrapper, process_sb3_cfg
from stable_baselines3 import PPO from stable_baselines3 import PPO
from stable_baselines3.common.callbacks import CheckpointCallback from stable_baselines3.common.callbacks import CheckpointCallback
from stable_baselines3.common.logger import configure from stable_baselines3.common.logger import configure
...@@ -66,7 +67,6 @@ from isaaclab.utils.io import dump_pickle, dump_yaml ...@@ -66,7 +67,6 @@ from isaaclab.utils.io import dump_pickle, dump_yaml
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils.hydra import hydra_task_config from isaaclab_tasks.utils.hydra import hydra_task_config
from isaaclab_tasks.utils.wrappers.sb3 import Sb3VecEnvWrapper, process_sb3_cfg
@hydra_task_config(args_cli.task, "sb3_cfg_entry_point") @hydra_task_config(args_cli.task, "sb3_cfg_entry_point")
......
...@@ -80,13 +80,14 @@ if args_cli.ml_framework.startswith("torch"): ...@@ -80,13 +80,14 @@ if args_cli.ml_framework.startswith("torch"):
elif args_cli.ml_framework.startswith("jax"): elif args_cli.ml_framework.startswith("jax"):
from skrl.utils.runner.jax import Runner from skrl.utils.runner.jax import Runner
from isaaclab_rl.skrl import SkrlVecEnvWrapper
from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent
from isaaclab.utils.dict import print_dict from isaaclab.utils.dict import print_dict
from isaaclab.utils.pretrained_checkpoint import get_published_pretrained_checkpoint from isaaclab.utils.pretrained_checkpoint import get_published_pretrained_checkpoint
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils import get_checkpoint_path, load_cfg_from_registry, parse_env_cfg from isaaclab_tasks.utils import get_checkpoint_path, load_cfg_from_registry, parse_env_cfg
from isaaclab_tasks.utils.wrappers.skrl import SkrlVecEnvWrapper
# config shortcuts # config shortcuts
algorithm = args_cli.algorithm.lower() algorithm = args_cli.algorithm.lower()
......
...@@ -83,6 +83,8 @@ if args_cli.ml_framework.startswith("torch"): ...@@ -83,6 +83,8 @@ if args_cli.ml_framework.startswith("torch"):
elif args_cli.ml_framework.startswith("jax"): elif args_cli.ml_framework.startswith("jax"):
from skrl.utils.runner.jax import Runner from skrl.utils.runner.jax import Runner
from isaaclab_rl.skrl import SkrlVecEnvWrapper
from isaaclab.envs import ( from isaaclab.envs import (
DirectMARLEnv, DirectMARLEnv,
DirectMARLEnvCfg, DirectMARLEnvCfg,
...@@ -95,7 +97,6 @@ from isaaclab.utils.io import dump_pickle, dump_yaml ...@@ -95,7 +97,6 @@ from isaaclab.utils.io import dump_pickle, dump_yaml
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils.hydra import hydra_task_config from isaaclab_tasks.utils.hydra import hydra_task_config
from isaaclab_tasks.utils.wrappers.skrl import SkrlVecEnvWrapper
# config shortcuts # config shortcuts
algorithm = args_cli.algorithm.lower() algorithm = args_cli.algorithm.lower()
......
...@@ -60,7 +60,7 @@ from isaaclab.utils.noise import AdditiveUniformNoiseCfg as Unoise ...@@ -60,7 +60,7 @@ from isaaclab.utils.noise import AdditiveUniformNoiseCfg as Unoise
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab.terrains.config.rough import ROUGH_TERRAINS_CFG # isort: skip from isaaclab.terrains.config.rough import ROUGH_TERRAINS_CFG # isort: skip
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort: skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort: skip
## ##
......
...@@ -50,7 +50,7 @@ from isaaclab.utils import configclass ...@@ -50,7 +50,7 @@ from isaaclab.utils import configclass
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort: skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort: skip
@configclass @configclass
......
...@@ -48,7 +48,7 @@ from isaaclab.sim import SimulationContext ...@@ -48,7 +48,7 @@ from isaaclab.sim import SimulationContext
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort:skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort:skip
def define_sensor() -> FrameTransformer: def define_sensor() -> FrameTransformer:
......
...@@ -62,7 +62,7 @@ class InteractiveScene: ...@@ -62,7 +62,7 @@ class InteractiveScene:
from isaaclab.scene import InteractiveSceneCfg from isaaclab.scene import InteractiveSceneCfg
from isaaclab.utils import configclass from isaaclab.utils import configclass
from isaaclab_assets.anymal import ANYMAL_C_CFG from isaaclab_assets.robots.anymal import ANYMAL_C_CFG
@configclass @configclass
class MySceneCfg(InteractiveSceneCfg): class MySceneCfg(InteractiveSceneCfg):
......
...@@ -31,7 +31,7 @@ class InteractiveSceneCfg: ...@@ -31,7 +31,7 @@ class InteractiveSceneCfg:
from isaaclab.sensors.ray_caster import GridPatternCfg, RayCasterCfg from isaaclab.sensors.ray_caster import GridPatternCfg, RayCasterCfg
from isaaclab.utils import configclass from isaaclab.utils import configclass
from isaaclab_assets.anymal import ANYMAL_C_CFG from isaaclab_assets.robots.anymal import ANYMAL_C_CFG
@configclass @configclass
class MySceneCfg(InteractiveSceneCfg): class MySceneCfg(InteractiveSceneCfg):
......
...@@ -698,8 +698,9 @@ class SimulationContext(_SimulationContext): ...@@ -698,8 +698,9 @@ class SimulationContext(_SimulationContext):
logging.set_level_threshold(carb.logging.LEVEL_ERROR) logging.set_level_threshold(carb.logging.LEVEL_ERROR)
# App shutdown is disabled to prevent crashes on shutdown. Terminating carb is faster # App shutdown is disabled to prevent crashes on shutdown. Terminating carb is faster
# self._app.shutdown() self._app.shutdown()
self._framework.unload_all_plugins() self._framework.unload_all_plugins()
sys.exit(0)
@contextmanager @contextmanager
......
...@@ -45,7 +45,7 @@ from isaaclab.sim import SimulationContext ...@@ -45,7 +45,7 @@ from isaaclab.sim import SimulationContext
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort:skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort:skip
def main(): def main():
......
...@@ -42,7 +42,7 @@ from isaaclab.assets import Articulation ...@@ -42,7 +42,7 @@ from isaaclab.assets import Articulation
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.ridgeback_franka import RIDGEBACK_FRANKA_PANDA_CFG # isort:skip from isaaclab_assets.robots.ridgeback_franka import RIDGEBACK_FRANKA_PANDA_CFG # isort:skip
def design_scene(): def design_scene():
......
...@@ -54,7 +54,7 @@ from isaaclab.utils.noise import AdditiveUniformNoiseCfg as Unoise ...@@ -54,7 +54,7 @@ from isaaclab.utils.noise import AdditiveUniformNoiseCfg as Unoise
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab.terrains.config.rough import ROUGH_TERRAINS_CFG # isort: skip from isaaclab.terrains.config.rough import ROUGH_TERRAINS_CFG # isort: skip
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort: skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort: skip
## ##
......
...@@ -47,7 +47,7 @@ from isaaclab.utils import configclass ...@@ -47,7 +47,7 @@ from isaaclab.utils import configclass
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort:skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort:skip
@configclass @configclass
......
...@@ -39,7 +39,7 @@ from isaaclab.utils.timer import Timer ...@@ -39,7 +39,7 @@ from isaaclab.utils.timer import Timer
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort: skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort: skip
@configclass @configclass
......
...@@ -49,7 +49,7 @@ from isaaclab.sensors.contact_sensor import ContactSensor, ContactSensorCfg ...@@ -49,7 +49,7 @@ from isaaclab.sensors.contact_sensor import ContactSensor, ContactSensorCfg
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort:skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort:skip
""" """
......
...@@ -31,7 +31,7 @@ from isaaclab.utils import configclass ...@@ -31,7 +31,7 @@ from isaaclab.utils import configclass
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort:skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort:skip
def quat_from_euler_rpy(roll, pitch, yaw, degrees=False): def quat_from_euler_rpy(roll, pitch, yaw, degrees=False):
......
...@@ -32,7 +32,7 @@ from isaaclab.utils import configclass ...@@ -32,7 +32,7 @@ from isaaclab.utils import configclass
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort: skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort: skip
from isaaclab.utils.assets import NUCLEUS_ASSET_ROOT_DIR # isort: skip from isaaclab.utils.assets import NUCLEUS_ASSET_ROOT_DIR # isort: skip
# offset of imu_link from base_link on anymal_c # offset of imu_link from base_link on anymal_c
......
[package] [package]
# Semantic Versioning is used: https://semver.org/ # Semantic Versioning is used: https://semver.org/
version = "0.1.4" version = "0.2.0"
# Description # Description
title = "Isaac Lab Assets" title = "Isaac Lab Assets"
......
Changelog Changelog
--------- ---------
0.2.0 (2024-12-27)
~~~~~~~~~~~~~~~~~~
Changed
^^^^^^^
* Restructured the assets directory into ``robots`` and ``sensors`` subdirectories.
0.1.4 (2024-08-21) 0.1.4 (2024-08-21)
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# All rights reserved. # All rights reserved.
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
"""Package containing asset and sensor configurations.""" """Package containing asset and sensor configurations."""
import os import os
...@@ -21,22 +20,5 @@ ISAACLAB_ASSETS_METADATA = toml.load(os.path.join(ISAACLAB_ASSETS_EXT_DIR, "conf ...@@ -21,22 +20,5 @@ ISAACLAB_ASSETS_METADATA = toml.load(os.path.join(ISAACLAB_ASSETS_EXT_DIR, "conf
# Configure the module-level variables # Configure the module-level variables
__version__ = ISAACLAB_ASSETS_METADATA["package"]["version"] __version__ = ISAACLAB_ASSETS_METADATA["package"]["version"]
from .robots import *
## from .sensors import *
# Configuration for different assets.
##
from .allegro import *
from .ant import *
from .anymal import *
from .cart_double_pendulum import *
from .cartpole import *
from .franka import *
from .humanoid import *
from .kinova import *
from .quadcopter import *
from .ridgeback_franka import *
from .sawyer import *
from .shadow_hand import *
from .unitree import *
from .universal_robots import *
# Copyright (c) 2022-2024, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
##
# Configuration for different assets.
##
from .allegro import *
from .ant import *
from .anymal import *
from .cart_double_pendulum import *
from .cartpole import *
from .franka import *
from .humanoid import *
from .kinova import *
from .quadcopter import *
from .ridgeback_franka import *
from .sawyer import *
from .shadow_hand import *
from .spot import *
from .unitree import *
from .universal_robots import *
...@@ -19,14 +19,14 @@ Reference: ...@@ -19,14 +19,14 @@ Reference:
""" """
from isaaclab_assets.sensors.velodyne import VELODYNE_VLP_16_RAYCASTER_CFG
import isaaclab.sim as sim_utils import isaaclab.sim as sim_utils
from isaaclab.actuators import ActuatorNetLSTMCfg, DCMotorCfg from isaaclab.actuators import ActuatorNetLSTMCfg, DCMotorCfg
from isaaclab.assets.articulation import ArticulationCfg from isaaclab.assets.articulation import ArticulationCfg
from isaaclab.sensors import RayCasterCfg from isaaclab.sensors import RayCasterCfg
from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR
from .velodyne import VELODYNE_VLP_16_RAYCASTER_CFG
## ##
# Configuration - Actuators. # Configuration - Actuators.
## ##
......
# Copyright (c) 2022-2024, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
##
# Configuration for different assets.
##
from .velodyne import *
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"""Installation script for the 'isaaclab_mimic' python package.""" """Installation script for the 'isaaclab_mimic' python package."""
import os import os
import platform
import toml import toml
from setuptools import setup from setuptools import setup
...@@ -15,6 +16,14 @@ EXTENSION_PATH = os.path.dirname(os.path.realpath(__file__)) ...@@ -15,6 +16,14 @@ EXTENSION_PATH = os.path.dirname(os.path.realpath(__file__))
# Read the extension.toml file # Read the extension.toml file
EXTENSION_TOML_DATA = toml.load(os.path.join(EXTENSION_PATH, "config", "extension.toml")) EXTENSION_TOML_DATA = toml.load(os.path.join(EXTENSION_PATH, "config", "extension.toml"))
# Extra dependencies for IL agents
EXTRAS_REQUIRE = {"robomimic": []}
# Check if the platform is Linux and add the dependency
if platform.system() == "Linux":
EXTRAS_REQUIRE["robomimic"].append("robomimic@git+https://github.com/ARISE-Initiative/robomimic.git")
# Installation operation # Installation operation
setup( setup(
name="isaaclab_mimic", name="isaaclab_mimic",
...@@ -25,6 +34,7 @@ setup( ...@@ -25,6 +34,7 @@ setup(
version=EXTENSION_TOML_DATA["package"]["version"], version=EXTENSION_TOML_DATA["package"]["version"],
description=EXTENSION_TOML_DATA["package"]["description"], description=EXTENSION_TOML_DATA["package"]["description"],
keywords=EXTENSION_TOML_DATA["package"]["keywords"], keywords=EXTENSION_TOML_DATA["package"]["keywords"],
extras_require=EXTRAS_REQUIRE,
license="MIT", license="MIT",
include_package_data=True, include_package_data=True,
python_requires=">=3.10", python_requires=">=3.10",
......
[package]
# Note: Semantic Versioning is used: https://semver.org/
version = "0.1.0"
# Description
title = "Isaac Lab RL"
description="Extension containing collection of wrappers for reinforcement learning."
readme = "docs/README.md"
repository = "https://github.com/isaac-sim/IsaacLab"
category = "robotics"
keywords = ["robotics", "rl", "wrappers", "learning"]
[dependencies]
"isaaclab" = {}
"isaaclab_assets" = {}
"isaaclab_tasks" = {}
[python.pipapi]
requirements = [
"h5py",
"tensorboard",
"stable-baselines3>=2.1",
"rl-games==1.6.1",
"rsl-rl@git+https://github.com/leggedrobotics/rsl_rl.git",
"skrl>=1.3.0"
]
modules = [
"h5py",
"tensorboard",
"stable_baselines3",
"rl_games",
"rsl_rl",
"skrl"
]
use_online_index=true
[[python.module]]
name = "isaaclab_tasks"
Changelog
---------
0.1.0 (2024-12-27)
~~~~~~~~~~~~~~~~~~
Added
^^^^^
Initial version of the extension.
This extension is split off from ``isaaclab_tasks`` to include the wrapper scripts for the supported RL libraries.
Supported RL libraries are:
* RL Games
* RSL RL
* SKRL
* Stable Baselines3
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
"""Sub-module for environment wrappers to different learning frameworks. """Module for environment wrappers to different learning frameworks.
Wrappers allow you to modify the behavior of an environment without modifying the environment itself. Wrappers allow you to modify the behavior of an environment without modifying the environment itself.
This is useful for modifying the observation space, action space, or reward function. Additionally, This is useful for modifying the observation space, action space, or reward function. Additionally,
...@@ -21,7 +21,7 @@ For instance, to wrap an environment in the `Stable-Baselines3`_ wrapper, you ca ...@@ -21,7 +21,7 @@ For instance, to wrap an environment in the `Stable-Baselines3`_ wrapper, you ca
.. code-block:: python .. code-block:: python
from isaaclab_tasks.utils.wrappers.sb3 import Sb3VecEnvWrapper from isaaclab_rl.sb3 import Sb3VecEnvWrapper
env = Sb3VecEnvWrapper(env) env = Sb3VecEnvWrapper(env)
......
...@@ -12,7 +12,7 @@ for RL-Games :class:`Runner` class: ...@@ -12,7 +12,7 @@ for RL-Games :class:`Runner` class:
from rl_games.common import env_configurations, vecenv from rl_games.common import env_configurations, vecenv
from isaaclab_tasks.utils.wrappers.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper from isaaclab_rl.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
# configuration parameters # configuration parameters
rl_device = "cuda:0" rl_device = "cuda:0"
......
...@@ -9,7 +9,7 @@ The following example shows how to wrap an environment for RSL-RL: ...@@ -9,7 +9,7 @@ The following example shows how to wrap an environment for RSL-RL:
.. code-block:: python .. code-block:: python
from isaaclab_tasks.utils.wrappers.rsl_rl import RslRlVecEnvWrapper from isaaclab_rl.rsl_rl import RslRlVecEnvWrapper
env = RslRlVecEnvWrapper(env) env = RslRlVecEnvWrapper(env)
......
...@@ -9,7 +9,7 @@ The following example shows how to wrap an environment for Stable-Baselines3: ...@@ -9,7 +9,7 @@ The following example shows how to wrap an environment for Stable-Baselines3:
.. code-block:: python .. code-block:: python
from isaaclab_tasks.utils.wrappers.sb3 import Sb3VecEnvWrapper from isaaclab_rl.sb3 import Sb3VecEnvWrapper
env = Sb3VecEnvWrapper(env) env = Sb3VecEnvWrapper(env)
......
...@@ -9,7 +9,7 @@ The following example shows how to wrap an environment for skrl: ...@@ -9,7 +9,7 @@ The following example shows how to wrap an environment for skrl:
.. code-block:: python .. code-block:: python
from isaaclab_tasks.utils.wrappers.skrl import SkrlVecEnvWrapper from isaaclab_rl.skrl import SkrlVecEnvWrapper
env = SkrlVecEnvWrapper(env, ml_framework="torch") # or ml_framework="jax" env = SkrlVecEnvWrapper(env, ml_framework="torch") # or ml_framework="jax"
......
[build-system]
requires = ["setuptools", "wheel", "toml"]
build-backend = "setuptools.build_meta"
# Copyright (c) 2022-2024, The Isaac Lab Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""Installation script for the 'isaaclab_rl' python package."""
import itertools
import os
import toml
from setuptools import setup
# Obtain the extension data from the extension.toml file
EXTENSION_PATH = os.path.dirname(os.path.realpath(__file__))
# Read the extension.toml file
EXTENSION_TOML_DATA = toml.load(os.path.join(EXTENSION_PATH, "config", "extension.toml"))
# Minimum dependencies required prior to installation
INSTALL_REQUIRES = [
# generic
"numpy",
"torch==2.5.1",
"torchvision>=0.14.1", # ensure compatibility with torch 1.13.1
# 5.26.0 introduced a breaking change, so we restricted it for now.
# See issue https://github.com/tensorflow/tensorboard/issues/6808 for details.
"protobuf>=3.20.2, < 5.0.0",
# configuration management
"hydra-core",
# data collection
"h5py",
# basic logger
"tensorboard",
# video recording
"moviepy",
]
PYTORCH_INDEX_URL = ["https://download.pytorch.org/whl/cu118"]
# Extra dependencies for RL agents
EXTRAS_REQUIRE = {
"sb3": ["stable-baselines3>=2.1"],
"skrl": ["skrl>=1.3.0"],
"rl-games": ["rl-games==1.6.1", "gym"], # rl-games still needs gym :(
"rsl-rl": ["rsl-rl@git+https://github.com/leggedrobotics/rsl_rl.git"],
}
# Add the names with hyphens as aliases for convenience
EXTRAS_REQUIRE["rl_games"] = EXTRAS_REQUIRE["rl-games"]
EXTRAS_REQUIRE["rsl_rl"] = EXTRAS_REQUIRE["rsl-rl"]
# Cumulation of all extra-requires
EXTRAS_REQUIRE["all"] = list(itertools.chain.from_iterable(EXTRAS_REQUIRE.values()))
# Remove duplicates in the all list to avoid double installations
EXTRAS_REQUIRE["all"] = list(set(EXTRAS_REQUIRE["all"]))
# Installation operation
setup(
name="isaaclab_rl",
author="Isaac Lab Project Developers",
maintainer="Isaac Lab Project Developers",
url=EXTENSION_TOML_DATA["package"]["repository"],
version=EXTENSION_TOML_DATA["package"]["version"],
description=EXTENSION_TOML_DATA["package"]["description"],
keywords=EXTENSION_TOML_DATA["package"]["keywords"],
include_package_data=True,
python_requires=">=3.10",
install_requires=INSTALL_REQUIRES,
dependency_links=PYTORCH_INDEX_URL,
extras_require=EXTRAS_REQUIRE,
packages=["isaaclab_rl"],
classifiers=[
"Natural Language :: English",
"Programming Language :: Python :: 3.10",
"Isaac Sim :: 4.2.0",
"Isaac Sim :: 4.1.0",
],
zip_safe=False,
)
...@@ -20,12 +20,12 @@ import unittest ...@@ -20,12 +20,12 @@ import unittest
import carb import carb
import omni.usd import omni.usd
from isaaclab_rl.rl_games import RlGamesVecEnvWrapper
from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils.parse_cfg import parse_env_cfg from isaaclab_tasks.utils.parse_cfg import parse_env_cfg
from isaaclab_tasks.utils.wrappers.rl_games import RlGamesVecEnvWrapper
class TestRlGamesVecEnvWrapper(unittest.TestCase): class TestRlGamesVecEnvWrapper(unittest.TestCase):
......
...@@ -20,12 +20,12 @@ import unittest ...@@ -20,12 +20,12 @@ import unittest
import carb import carb
import omni.usd import omni.usd
from isaaclab_rl.rsl_rl import RslRlVecEnvWrapper
from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils.parse_cfg import parse_env_cfg from isaaclab_tasks.utils.parse_cfg import parse_env_cfg
from isaaclab_tasks.utils.wrappers.rsl_rl import RslRlVecEnvWrapper
class TestRslRlVecEnvWrapper(unittest.TestCase): class TestRslRlVecEnvWrapper(unittest.TestCase):
......
...@@ -21,12 +21,12 @@ import unittest ...@@ -21,12 +21,12 @@ import unittest
import carb import carb
import omni.usd import omni.usd
from isaaclab_rl.sb3 import Sb3VecEnvWrapper
from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils.parse_cfg import parse_env_cfg from isaaclab_tasks.utils.parse_cfg import parse_env_cfg
from isaaclab_tasks.utils.wrappers.sb3 import Sb3VecEnvWrapper
class TestStableBaselines3VecEnvWrapper(unittest.TestCase): class TestStableBaselines3VecEnvWrapper(unittest.TestCase):
......
...@@ -20,12 +20,12 @@ import unittest ...@@ -20,12 +20,12 @@ import unittest
import carb import carb
import omni.usd import omni.usd
from isaaclab_rl.skrl import SkrlVecEnvWrapper
from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent from isaaclab.envs import DirectMARLEnv, multi_agent_to_single_agent
import isaaclab_tasks # noqa: F401 import isaaclab_tasks # noqa: F401
from isaaclab_tasks.utils.parse_cfg import parse_env_cfg from isaaclab_tasks.utils.parse_cfg import parse_env_cfg
from isaaclab_tasks.utils.wrappers.skrl import SkrlVecEnvWrapper
class TestSKRLVecEnvWrapper(unittest.TestCase): class TestSKRLVecEnvWrapper(unittest.TestCase):
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
from isaaclab.utils import configclass from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg
from isaaclab_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg from isaaclab.utils import configclass
@configclass @configclass
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
from isaaclab_assets.allegro import ALLEGRO_HAND_CFG from isaaclab_assets.robots.allegro import ALLEGRO_HAND_CFG
import isaaclab.sim as sim_utils import isaaclab.sim as sim_utils
from isaaclab.assets import ArticulationCfg, RigidObjectCfg from isaaclab.assets import ArticulationCfg, RigidObjectCfg
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
from isaaclab.utils import configclass from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg
from isaaclab_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg from isaaclab.utils import configclass
@configclass @configclass
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
from __future__ import annotations from __future__ import annotations
from isaaclab_assets.ant import ANT_CFG from isaaclab_assets.robots.ant import ANT_CFG
import isaaclab.sim as sim_utils import isaaclab.sim as sim_utils
from isaaclab.assets import ArticulationCfg from isaaclab.assets import ArticulationCfg
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
from isaaclab.utils import configclass from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg
from isaaclab_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg from isaaclab.utils import configclass
@configclass @configclass
......
...@@ -18,7 +18,7 @@ from isaaclab.utils import configclass ...@@ -18,7 +18,7 @@ from isaaclab.utils import configclass
## ##
# Pre-defined configs # Pre-defined configs
## ##
from isaaclab_assets.anymal import ANYMAL_C_CFG # isort: skip from isaaclab_assets.robots.anymal import ANYMAL_C_CFG # isort: skip
from isaaclab.terrains.config.rough import ROUGH_TERRAINS_CFG # isort: skip from isaaclab.terrains.config.rough import ROUGH_TERRAINS_CFG # isort: skip
......
...@@ -9,7 +9,7 @@ import math ...@@ -9,7 +9,7 @@ import math
import torch import torch
from collections.abc import Sequence from collections.abc import Sequence
from isaaclab_assets.cart_double_pendulum import CART_DOUBLE_PENDULUM_CFG from isaaclab_assets.robots.cart_double_pendulum import CART_DOUBLE_PENDULUM_CFG
import isaaclab.sim as sim_utils import isaaclab.sim as sim_utils
from isaaclab.assets import Articulation, ArticulationCfg from isaaclab.assets import Articulation, ArticulationCfg
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
# #
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
from isaaclab.utils import configclass from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg
from isaaclab_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlPpoActorCriticCfg, RslRlPpoAlgorithmCfg from isaaclab.utils import configclass
@configclass @configclass
......
...@@ -9,7 +9,7 @@ import math ...@@ -9,7 +9,7 @@ import math
import torch import torch
from collections.abc import Sequence from collections.abc import Sequence
from isaaclab_assets.cartpole import CARTPOLE_CFG from isaaclab_assets.robots.cartpole import CARTPOLE_CFG
import isaaclab.sim as sim_utils import isaaclab.sim as sim_utils
from isaaclab.assets import Articulation, ArticulationCfg from isaaclab.assets import Articulation, ArticulationCfg
......
...@@ -9,7 +9,7 @@ import math ...@@ -9,7 +9,7 @@ import math
import torch import torch
from collections.abc import Sequence from collections.abc import Sequence
from isaaclab_assets.cartpole import CARTPOLE_CFG from isaaclab_assets.robots.cartpole import CARTPOLE_CFG
import isaaclab.sim as sim_utils import isaaclab.sim as sim_utils
from isaaclab.assets import Articulation, ArticulationCfg from isaaclab.assets import Articulation, ArticulationCfg
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment