Unverified Commit 3149af00 authored by Mayank Mittal's avatar Mayank Mittal Committed by GitHub

Renames Gym Envs related extensions to Tasks (#228)

# Description

Since there is a lot of confusion and debate around what is a scene vs.
environment vs. task, this MR makes it explicit that Gym/RL-related
definitions are always called "tasks". Thus, the corresponding
extensions are renamed from `orbit_envs` to `orbit_tasks`.

Fixes #143

## Type of change

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

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [ ] 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
parent 137f836d
......@@ -20,8 +20,8 @@ import sys
sys.path.insert(0, os.path.abspath("../source/extensions/omni.isaac.orbit"))
sys.path.insert(0, os.path.abspath("../source/extensions/omni.isaac.orbit/omni/isaac/orbit"))
sys.path.insert(0, os.path.abspath("../source/extensions/omni.isaac.orbit_envs"))
sys.path.insert(0, os.path.abspath("../source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs"))
sys.path.insert(0, os.path.abspath("../source/extensions/omni.isaac.orbit_tasks"))
sys.path.insert(0, os.path.abspath("../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks"))
# -- Project information -----------------------------------------------------
......
......@@ -25,13 +25,13 @@ omni.isaac.orbit extension
orbit.utils.mdp
orbit.compat
omni.isaac.orbit_envs extension
-------------------------------
omni.isaac.orbit_tasks extension
--------------------------------
.. toctree::
:maxdepth: 1
orbit_envs.isaac_env
orbit_envs.utils
orbit_envs.utils.data_collector
orbit_envs.utils.wrappers
orbit_tasks.isaac_env
orbit_tasks.utils
orbit_tasks.utils.data_collector
orbit_tasks.utils.wrappers
omni.isaac.orbit_envs.isaac_env
===============================
omni.isaac.orbit_tasks.isaac_env
================================
We use OpenAI Gym registry to register the environment and their default configuration file.
The default configuration file is passed to the argument "kwargs" in the Gym specification registry.
......@@ -18,8 +18,8 @@ class. This is done using the function :meth:`load_default_env_cfg` in the sub-m
.. code-block:: python
import gym
import omni.isaac.orbit_envs
from omni.isaac.orbit_envs.utils.parse_cfg import load_default_env_cfg
import omni.isaac.orbit_tasks
from omni.isaac.orbit_tasks.utils.parse_cfg import load_default_env_cfg
task_name = "Isaac-Cartpole-v0"
cfg = load_default_env_cfg(task_name)
......@@ -27,7 +27,7 @@ class. This is done using the function :meth:`load_default_env_cfg` in the sub-m
All environments must inherit from :class:`IsaacEnv` class which is defined in the sub-module
:mod:`omni.isaac.orbit_envs.isaac_env`.
:mod:`omni.isaac.orbit_tasks.isaac_env`.
The main methods that needs to be implemented by an inherited environment class:
* :meth:`_design_scene`: Design the template environment for cloning.
......@@ -47,7 +47,7 @@ The action and observation space correspond to single environment (and not vecto
Base Environment
----------------
.. automodule:: omni.isaac.orbit_envs.isaac_env
.. automodule:: omni.isaac.orbit_tasks.isaac_env
:members:
:undoc-members:
:show-inheritance:
......@@ -57,7 +57,7 @@ Base Environment
Base Configuration
---------------------
.. automodule:: omni.isaac.orbit_envs.isaac_env_cfg
.. automodule:: omni.isaac.orbit_tasks.isaac_env_cfg
:members:
:undoc-members:
:show-inheritance:
omni.isaac.orbit_envs.utils.data_collector
omni.isaac.orbit_tasks.utils.data_collector
==========================================
All post-processed robomimic compatible datasets share the same data structure. A single dataset is a
......@@ -16,7 +16,7 @@ The following sample shows how to use the ``robomimic`` data collector:
import os
import torch
from omni.isaac.orbit_envs.utils.data_collector import RobomimicDataCollector
from omni.isaac.orbit_tasks.utils.data_collector import RobomimicDataCollector
# name of the environment (needed by robomimic)
task_name = "Isaac-Franka-Lift-v0"
......@@ -73,7 +73,7 @@ The following sample shows how to use the ``robomimic`` data collector:
collector_interface.close()
.. automodule:: omni.isaac.orbit_envs.utils.data_collector
.. automodule:: omni.isaac.orbit_tasks.utils.data_collector
:members:
:undoc-members:
:show-inheritance:
omni.isaac.orbit_envs.utils
omni.isaac.orbit_tasks.utils
===============================
.. automodule:: omni.isaac.orbit_envs.utils
.. automodule:: omni.isaac.orbit_tasks.utils
:members:
:undoc-members:
:show-inheritance:
omni.isaac.orbit_envs.utils.wrappers
omni.isaac.orbit_tasks.utils.wrappers
====================================
Wrappers allow you to modify the behavior of an environment without modifying the environment itself.
......@@ -14,7 +14,7 @@ environment instance to the wrapper constructor. For instance, to wrap an enviro
.. code-block:: python
from omni.isaac.orbit_envs.utils.wrappers.sb3 import Sb3VecEnvWrapper
from omni.isaac.orbit_tasks.utils.wrappers.sb3 import Sb3VecEnvWrapper
env = Sb3VecEnvWrapper(env)
......@@ -28,27 +28,27 @@ environment instance to the wrapper constructor. For instance, to wrap an enviro
RL-Games Wrapper
----------------
.. automodule:: omni.isaac.orbit_envs.utils.wrappers.rl_games
.. automodule:: omni.isaac.orbit_tasks.utils.wrappers.rl_games
:members:
:show-inheritance:
RSL-RL Wrapper
--------------
.. automodule:: omni.isaac.orbit_envs.utils.wrappers.rsl_rl
.. automodule:: omni.isaac.orbit_tasks.utils.wrappers.rsl_rl
:members:
:show-inheritance:
SKRL Wrapper
------------
.. automodule:: omni.isaac.orbit_envs.utils.wrappers.skrl
.. automodule:: omni.isaac.orbit_tasks.utils.wrappers.skrl
:members:
:show-inheritance:
Stable-Baselines3 Wrapper
-------------------------
.. automodule:: omni.isaac.orbit_envs.utils.wrappers.sb3
.. automodule:: omni.isaac.orbit_tasks.utils.wrappers.sb3
:members:
:show-inheritance:
......@@ -15,19 +15,19 @@ Extension containing the core framework of Orbit.
:start-line: 3
omni.isaac.orbit_envs
---------------------
omni.isaac.orbit_tasks
----------------------
Extension containing the environments built using Orbit.
.. include:: ../../../source/extensions/omni.isaac.orbit_envs/docs/CHANGELOG.rst
.. include:: ../../../source/extensions/omni.isaac.orbit_tasks/docs/CHANGELOG.rst
:start-line: 3
omni.isaac.contrib_envs
-----------------------
omni.isaac.contrib_tasks
------------------------
Extension for environments contributed by the community.
.. include:: ../../../source/extensions/omni.isaac.contrib_envs/docs/CHANGELOG.rst
.. include:: ../../../source/extensions/omni.isaac.contrib_tasks/docs/CHANGELOG.rst
:start-line: 3
......@@ -68,7 +68,7 @@ argument to the :class:`SimulationContext` class. For example, to increase the s
sim = SimulationContext(sim_params={"gpu_found_lost_pairs_capacity": 4096})
These settings are also directly exposed through the :class:`PhysxCfg` class in the ``omni.isaac.orbit_envs``
These settings are also directly exposed through the :class:`PhysxCfg` class in the ``omni.isaac.orbit_tasks``
extension, which can be used to configure the simulation engine. Please see the documentation for
:class:`PhysxCfg` for more details.
......
......@@ -90,8 +90,8 @@ The ``orbit`` repository is structured as follows:
├── source
│   ├── extensions
│   │   ├── omni.isaac.orbit
│   │   └── omni.isaac.orbit_envs
│   │   └── omni.isaac.contrib_envs
│   │   └── omni.isaac.orbit_tasks
│   │   └── omni.isaac.contrib_tasks
│   ├── standalone
│   │   ├── demo
│   │   ├── environments
......@@ -227,7 +227,7 @@ The ``source/standalone`` directory contains various standalone applications des
provided by ``orbit``. These applications are written in python and are structured as follows:
* **demo**: Contains various demo applications that showcase the core framework ``omni.isaac.orbit``.
* **environments**: Contains applications for running environments defined in ``omni.isaac.orbit_envs`` with different agents.
* **environments**: Contains applications for running environments defined in ``omni.isaac.orbit_tasks`` with different agents.
These include a random policy, zero-action policy, teleoperation or scripted state machines.
* **workflows**: Contains applications for using environments with various learning-based frameworks. These include different
reinforcement learning or imitation learning libraries.
......@@ -44,7 +44,7 @@ Environments
------------
With Orbit, we also provide a suite of benchmark environments included
in the ``omni.isaac.orbit_envs`` extension. We use the OpenAI Gym registry
in the ``omni.isaac.orbit_tasks`` extension. We use the OpenAI Gym registry
to register these environments. For each environment, we provide a default
configuration file that defines the scene, observations, rewards and action spaces.
......@@ -141,7 +141,7 @@ format.
.. code:: bash
# install python module (for robomimic)
./orbit.sh -p -m pip install -e 'source/extensions/omni.isaac.orbit_envs[robomimic]'
./orbit.sh -p -m pip install -e 'source/extensions/omni.isaac.orbit_tasks[robomimic]'
# split data
./orbit.sh -p source/standalone//workflows/robomimic/tools/split_train_val.py logs/robomimic/Isaac-Lift-Franka-v0/hdf_dataset.hdf5 --ratio 0.2
......@@ -171,7 +171,7 @@ from the environments into the respective libraries function argument and return
.. code:: bash
# install python module (for stable-baselines3)
./orbit.sh -p -m pip install -e 'source/extensions/omni.isaac.orbit_envs[sb3]'
./orbit.sh -p -m pip install -e 'source/extensions/omni.isaac.orbit_tasks[sb3]'
# run script for training
# note: we enable cpu flag since SB3 doesn't optimize for GPU anyway
./orbit.sh -p source/standalone/workflows/sb3/train.py --task Isaac-Cartpole-v0 --headless --cpu
......@@ -184,7 +184,7 @@ from the environments into the respective libraries function argument and return
.. code:: bash
# install python module (for skrl)
./orbit.sh -p -m pip install -e 'source/extensions/omni.isaac.orbit_envs[skrl]'
./orbit.sh -p -m pip install -e 'source/extensions/omni.isaac.orbit_tasks[skrl]'
# run script for training
./orbit.sh -p source/standalone/workflows/skrl/train.py --task Isaac-Reach-Franka-v0 --headless
# run script for playing with 32 environments
......@@ -196,7 +196,7 @@ from the environments into the respective libraries function argument and return
.. code:: bash
# install python module (for rl-games)
./orbit.sh -p -m pip install -e 'source/extensions/omni.isaac.orbit_envs[rl_games]'
./orbit.sh -p -m pip install -e 'source/extensions/omni.isaac.orbit_tasks[rl_games]'
# run script for training
./orbit.sh -p source/standalone/workflows/rl_games/train.py --task Isaac-Ant-v0 --headless
# run script for playing with 32 environments
......@@ -208,7 +208,7 @@ from the environments into the respective libraries function argument and return
.. code:: bash
# install python module (for rsl-rl)
./orbit.sh -p -m pip install -e 'source/extensions/omni.isaac.orbit_envs[rsl_rl]'
./orbit.sh -p -m pip install -e 'source/extensions/omni.isaac.orbit_tasks[rsl_rl]'
# run script for training
./orbit.sh -p source/standalone/workflows/rsl_rl/train.py --task Isaac-Reach-Franka-v0 --headless
# run script for playing with 32 environments
......
Running an RL environment
=========================
In this tutorial, we will learn how to run existing learning environments provided in the ``omni.isaac.orbit_envs``
In this tutorial, we will learn how to run existing learning environments provided in the ``omni.isaac.orbit_tasks``
extension. All the environments included in Orbit follow the ``gym.Env`` interface, which means that they can be used
with any reinforcement learning framework that supports OpenAI Gym. However, since the environments are implemented
in a vectorized fashion, they can only be used with frameworks that support vectorized environments.
......@@ -9,7 +9,7 @@ in a vectorized fashion, they can only be used with frameworks that support vect
Many common frameworks come with their own desired definitions of a vectorized environment and require the returned data
to follow their supported data types and data structures. For example, ``stable-baselines3`` uses ``numpy`` arrays, while
``rsl-rl``, ``rl-games``, or ``skrl`` use ``torch.Tensor``. We provide wrappers for these different frameworks, which can be found
in the ``omni.isaac.orbit_envs.utils.wrappers`` module.
in the ``omni.isaac.orbit_tasks.utils.wrappers`` module.
The Code
......@@ -31,24 +31,24 @@ Using gym registry for environments
All environments are registered using the ``gym`` registry, which means that you can create an instance of
an environment by calling ``gym.make``. The environments are registered in the ``__init__.py`` file of the
``omni.isaac.orbit_envs`` extension with the following syntax:
``omni.isaac.orbit_tasks`` extension with the following syntax:
.. code-block:: python
# Cartpole environment
gym.register(
id="Isaac-Cartpole-v0",
entry_point="omni.isaac.orbit_envs.classic.cartpole:CartpoleEnv",
kwargs={"cfg_entry_point": "omni.isaac.orbit_envs.classic.cartpole:cartpole_cfg.yaml"},
entry_point="omni.isaac.orbit_tasks.classic.cartpole:CartpoleEnv",
kwargs={"cfg_entry_point": "omni.isaac.orbit_tasks.classic.cartpole:cartpole_cfg.yaml"},
)
The ``cfg_entry_point`` argument is used to load the default configuration for the environment. The default
configuration is loaded using the :meth:`omni.isaac.orbit_envs.utils.parse_cfg.load_default_env_cfg` function.
configuration is loaded using the :meth:`omni.isaac.orbit_tasks.utils.parse_cfg.load_default_env_cfg` function.
The configuration entry point can correspond to both a YAML file or a python configuration
class. The default configuration can be overridden by passing a custom configuration instance to the ``gym.make``
function as shown later in the tutorial.
To inform the ``gym`` registry with all the environments provided by the ``omni.isaac.orbit_envs`` extension,
To inform the ``gym`` registry with all the environments provided by the ``omni.isaac.orbit_tasks`` extension,
we must import the module at the start of the script.
.. literalinclude:: ../../../source/standalone/environments/zero_agent.py
......@@ -59,7 +59,7 @@ we must import the module at the start of the script.
.. note::
As a convention, we name all the environments in ``omni.isaac.orbit_envs`` extension with the prefix ``Isaac-``.
As a convention, we name all the environments in ``omni.isaac.orbit_tasks`` extension with the prefix ``Isaac-``.
For more complicated environments, we follow the pattern: ``Isaac-<TaskName>-<RobotName>-v<N>``,
where `N` is used to specify different observations or action spaces within the same task definition. For example,
for legged locomotion with ANYmal C, the environment is called ``Isaac-Velocity-Anymal-C-v0``.
......
......@@ -4,8 +4,8 @@ Creating an environment
In Orbit, we provide a set of environments that are ready to use. However, you may want to create your own
environment for your application. This tutorial will show you how to create a new environment from scratch.
As a practice, we maintain all the environments that are *officially* provided in the ``omni.isaac.orbit_envs``
extension. It is recommended to add your environment to the extension ``omni.isaac.contrib_envs``. This way, you can
As a practice, we maintain all the environments that are *officially* provided in the ``omni.isaac.orbit_tasks``
extension. It is recommended to add your environment to the extension ``omni.isaac.contrib_tasks``. This way, you can
easily update your environment when the API changes and you can also contribute your environment to the community.
In this tutorial, we will look at the base class :py:class:`IsaacEnv` and discuss the different methods that you
......@@ -60,7 +60,7 @@ The base class :py:class:`IsaacEnv` is defined in the file ``isaac_env.py``:
.. dropdown:: :fa:`eye,mr-1` Code for `isaac_env.py`
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs/isaac_env.py
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/isaac_env.py
:language: python
:linenos:
......@@ -91,7 +91,7 @@ under the prim path ``/World/defaultGroundPlane`` and optionally, markers for de
.. dropdown:: :fa:`eye,mr-1` Code for `_design_scene` method in `lift_env.py`
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs/manipulation/lift/lift_env.py
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/manipulation/lift/lift_env.py
:language: python
:lines: 75-110
:linenos:
......@@ -114,7 +114,7 @@ various buffers corresponding to episode counter, episode reward, history, senso
.. dropdown:: :fa:`eye,mr-1` Code for `_reset_idx` method in `lift_env.py`
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs/manipulation/lift/lift_env.py
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/manipulation/lift/lift_env.py
:language: python
:lines: 112-137
:linenos:
......@@ -126,7 +126,7 @@ instances are displaced correctly in the simulation stage (i.e. account for the
An example of this is shown in the :py:meth:`_randomize_object_initial_pose` method for the Lift environment:
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs/manipulation/lift/lift_env.py
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/manipulation/lift/lift_env.py
:language: python
:lines: 298-326
:lineno-start: 298
......@@ -171,7 +171,7 @@ the simulator at a specified , updates the buffers and sensors, and computes the
.. dropdown:: :fa:`eye,mr-1` Code for `_step_impl` method in `lift_env.py`
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs/manipulation/lift/lift_env.py
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/manipulation/lift/lift_env.py
:language: python
:lines: 139-189
:emphasize-lines: 21-29,42-47
......@@ -197,7 +197,7 @@ found in the `MDP managers <../api/orbit.utils.mdp.html>`_ section.
.. dropdown:: :fa:`eye,mr-1` Code for `_get_observations` method in `lift_env.py`
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs/manipulation/lift/lift_env.py
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/manipulation/lift/lift_env.py
:language: python
:lines: 191-193
:linenos:
......@@ -209,7 +209,7 @@ Registering the environment
Before you can run your environment, you need to register your environment with the OpenAI Gym interface.
To register an environment, call the :py:meth:`gym.register` method in the :py:mod:`__init__.py` file of your environment package
(for instance, in ``omni.isaac.contrib_envs.__init__.py``). This has the following components:
(for instance, in ``omni.isaac.contrib_tasks.__init__.py``). This has the following components:
* **Name of the environment:** This should ideally be in the format :py:const:`Isaac-\<EnvironmentName\>-\<Robot\>-\<Version\>`.
However, this is not a strict requirement and you can use any name you want.
......@@ -217,11 +217,11 @@ To register an environment, call the :py:meth:`gym.register` method in the :py:m
* **Config entry point:** This is the import path of the environment configuration file. This is used to instantiate the environment configuration.
The configuration file can be either a YAML file or a Python dataclass
As examples of this in the ``omni.isaac.orbit_envs`` package, we have the following:
As examples of this in the ``omni.isaac.orbit_tasks`` package, we have the following:
.. dropdown:: :fa:`eye,mr-1` Registering an environment with a YAML configuration file
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs/__init__.py
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/__init__.py
:language: python
:lines: 52-56
:linenos:
......@@ -229,7 +229,7 @@ As examples of this in the ``omni.isaac.orbit_envs`` package, we have the follow
.. dropdown:: :fa:`eye,mr-1` Registering an environment with a Python dataclass configuration file
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_envs/omni/isaac/orbit_envs/__init__.py
.. literalinclude:: ../../../source/extensions/omni.isaac.orbit_tasks/omni/isaac/orbit_tasks/__init__.py
:language: python
:lines: 84-88
:linenos:
......@@ -239,8 +239,8 @@ As examples of this in the ``omni.isaac.orbit_envs`` package, we have the follow
The Code Execution
~~~~~~~~~~~~~~~~~~
Now that we have gone through the code, let's run the environment. All environments registered in the ``omni.isaac.orbit_envs``
and ``omni.isaac.contrib_envs`` packages are automatically available in the included standalone environments and workflows scripts.
Now that we have gone through the code, let's run the environment. All environments registered in the ``omni.isaac.orbit_tasks``
and ``omni.isaac.contrib_tasks`` packages are automatically available in the included standalone environments and workflows scripts.
As an example, to run the Lift environment, you can use the following command.
......
......@@ -6,7 +6,7 @@ This can be used to apply functions to modify observations or rewards, record vi
A detailed description of the API is available in the `gym.Wrapper <https://gymnasium.farama.org/api/wrappers/>`_ class.
At present, all environments inheriting from the :class:`omni.isaac.orbit_envs.isaac_env.IsaacEnv` class
At present, all environments inheriting from the :class:`omni.isaac.orbit_tasks.isaac_env.IsaacEnv` class
are compatible with ``gym.Wrapper``, since the base class implements the ``gym.Env`` interface.
In order to wrap an environment, you need to first initialize the base environment. After that, you can
wrap it with as many wrappers as you want by calling `env = wrapper(env, *args, **kwargs)` repeatedly.
......@@ -28,8 +28,8 @@ For example, here is how you would wrap an environment to enforce that reset is
import gym
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import load_default_env_cfg
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import load_default_env_cfg
# create base environment
cfg = load_default_env_cfg("Isaac-Reach-Franka-v0")
......@@ -138,7 +138,7 @@ As an example of how to use the :class:`IsaacEnv` with Stable-Baselines3:
.. code:: python
from omni.isaac.orbit_envs.utils.wrappers.sb3 import Sb3VecEnvWrapper
from omni.isaac.orbit_tasks.utils.wrappers.sb3 import Sb3VecEnvWrapper
# create isaac-env instance
env = gym.make(task_name, cfg=env_cfg, render=headless)
......@@ -156,5 +156,5 @@ As an example of how to use the :class:`IsaacEnv` with Stable-Baselines3:
To add support for a new learning framework, you need to implement a wrapper class that
converts the :class:`IsaacEnv` to the learning framework's environment definition. This
wrapper class should typically inherit from the ``gym.Wrapper`` class. We include a
set of these wrappers in the :mod:`omni.isaac.orbit_envs.utils.wrappers` module. You can
set of these wrappers in the :mod:`omni.isaac.orbit_tasks.utils.wrappers` module. You can
use these wrappers as a reference to implement your own wrapper for a new learning framework.
......@@ -236,7 +236,7 @@ while [[ $# -gt 0 ]]; do
echo "[INFO] Installing extra requirements such as learning frameworks..."
python_exe=$(extract_python_exe)
# install the rl-frameworks specified
${python_exe} -m pip install -e ${ORBIT_PATH}/source/extensions/omni.isaac.orbit_envs[all]
${python_exe} -m pip install -e ${ORBIT_PATH}/source/extensions/omni.isaac.orbit_tasks[all]
shift # past argument
;;
-c|--conda)
......
......@@ -51,8 +51,8 @@ known_third_party = [
known_first_party = "omni.isaac.orbit"
known_assets_firstparty = "omni.isaac.assets"
known_extra_firstparty = [
"omni.isaac.contrib_envs",
"omni.isaac.orbit_envs"
"omni.isaac.contrib_tasks",
"omni.isaac.orbit_tasks"
]
# Imports from the local folder
known_local_folder = "config"
......
......@@ -13,10 +13,10 @@ keywords = ["robotics", "rl", "il", "learning"]
[dependencies]
"omni.isaac.orbit" = {}
"omni.isaac.orbit_envs" = {}
"omni.isaac.orbit_tasks" = {}
"omni.isaac.core" = {}
"omni.isaac.gym" = {}
"omni.replicator.isaac" = {}
[[python.module]]
name = "omni.isaac.contrib_envs"
name = "omni.isaac.contrib_tasks"
# Orbit: Contributed Environment
This extension serves as a platform to host contributed environments from the robotics and machine learning
community. The extension follows the same style as the `omni.isaac.orbit_envs` extension.
community. The extension follows the same style as the `omni.isaac.orbit_tasks` extension.
The environments should follow the `gym.Env` API from OpenAI Gym version `0.21.0`. They need to be registered using
the Gym registry.
......@@ -15,12 +15,12 @@ The environments can be configured using either Python classes (wrapped using `c
YAML files. The template structure of the environment is always put at the same level as the environment file
itself. However, its various instances should be included in directories within the environment directory itself.
The environments should then be registered in the `omni/isaac/contrib_envs/__init__.py`:
The environments should then be registered in the `omni/isaac/contrib_tasks/__init__.py`:
```python
gym.register(
id="Isaac-Contrib-<my-awesome-env>-v0",
entry_point="omni.isaac.contrib_envs.<your-env-package>:<your-env-class>",
kwargs={"cfg_entry_point": "omni.isaac.contrib_envs.<your-env-package-cfg>:<your-env-class-cfg>"},
entry_point="omni.isaac.contrib_tasks.<your-env-package>:<your-env-class>",
kwargs={"cfg_entry_point": "omni.isaac.contrib_tasks.<your-env-package-cfg>:<your-env-class-cfg>"},
)
```
......@@ -19,8 +19,8 @@ Note:
Usage:
>>> import gym
>>> import omni.isaac.contrib_envs
>>> from omni.isaac.orbit_envs.utils.parse_cfg import load_default_env_cfg
>>> import omni.isaac.contrib_tasks
>>> from omni.isaac.orbit_tasks.utils.parse_cfg import load_default_env_cfg
>>>
>>> task_name = "Isaac-Contrib-<my-registered-env-name>-v0"
>>> cfg = load_default_env_cfg(task_name)
......@@ -34,14 +34,11 @@ import os
import toml
# Conveniences to other module directories via relative paths
ORBIT_CONTRIB_ENVS_EXT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../"))
ORBIT_CONTRIB_TASKS_EXT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../"))
"""Path to the extension source directory."""
ORBIT_CONTRIB_ENVS_DATA_DIR = os.path.join(ORBIT_CONTRIB_ENVS_EXT_DIR, "data")
"""Path to the extension data directory."""
ORBIT_CONTRIB_ENVS_METADATA = toml.load(os.path.join(ORBIT_CONTRIB_ENVS_EXT_DIR, "config", "extension.toml"))
ORBIT_CONTRIB_TASKS_METADATA = toml.load(os.path.join(ORBIT_CONTRIB_TASKS_EXT_DIR, "config", "extension.toml"))
"""Extension metadata dictionary parsed from the extension.toml file."""
# Configure the module-level variables
__version__ = ORBIT_CONTRIB_ENVS_METADATA["package"]["version"]
__version__ = ORBIT_CONTRIB_TASKS_METADATA["package"]["version"]
......@@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause
"""Installation script for the 'omni.isaac.contrib_envs' python package."""
"""Installation script for the 'omni.isaac.contrib_tasks' python package."""
from __future__ import annotations
......@@ -19,7 +19,7 @@ EXTENSION_TOML_DATA = toml.load(os.path.join(EXTENSION_PATH, "config", "extensio
# Installation operation
setup(
name="omni-isaac-contrib_envs",
name="omni-isaac-contrib_tasks",
author="Community",
url=EXTENSION_TOML_DATA["package"]["repository"],
version=EXTENSION_TOML_DATA["package"]["version"],
......@@ -27,7 +27,7 @@ setup(
keywords=EXTENSION_TOML_DATA["package"]["keywords"],
include_package_data=True,
python_requires=">=3.7",
packages=["omni.isaac.contrib_envs"],
packages=["omni.isaac.contrib_tasks"],
classifiers=["Natural Language :: English", "Programming Language :: Python :: 3.7"],
zip_safe=False,
)
[package]
# Note: Semantic Versioning is used: https://semver.org/
version = "0.9.31"
version = "0.9.32"
# Description
title = "ORBIT framework for Robot Learning"
......
Changelog
---------
0.9.32 (2023-11-02)
~~~~~~~~~~~~~~~~~~~
Changed
^^^^^^^
* Renamed the :class:`omni.isaac.orbit.envs.RLEnv` class to :class:`omni.isaac.orbit.envs.RLTaskEnv` to
avoid confusions in terminologies between environments and tasks.
0.9.31 (2023-11-02)
~~~~~~~~~~~~~~~~~~~
......
......@@ -5,8 +5,8 @@
from .base_env import BaseEnv
from .base_env_cfg import BaseEnvCfg, ViewerCfg
from .rl_env import RLEnv, VecEnvObs, VecEnvStepReturn
from .rl_env_cfg import RLEnvCfg
from .rl_task_env import RLTaskEnv, VecEnvObs, VecEnvStepReturn
from .rl_task_env_cfg import RLTaskEnvCfg
__all__ = [
# base
......@@ -14,8 +14,8 @@ __all__ = [
"BaseEnvCfg",
"ViewerCfg",
# rl
"RLEnv",
"RLEnvCfg",
"RLTaskEnv",
"RLTaskEnvCfg",
# env type variables
"VecEnvObs",
"VecEnvStepReturn",
......
......@@ -15,7 +15,7 @@ from omni.isaac.orbit.assets.articulation import Articulation
from omni.isaac.orbit.managers.action_manager import ActionTerm
if TYPE_CHECKING:
from omni.isaac.orbit.envs.rl_env import BaseEnv
from omni.isaac.orbit.envs import BaseEnv
from . import actions_cfg
......
......@@ -15,7 +15,7 @@ from omni.isaac.orbit.assets.articulation import Articulation
from omni.isaac.orbit.managers.action_manager import ActionTerm
if TYPE_CHECKING:
from omni.isaac.orbit.envs.rl_env import BaseEnv
from omni.isaac.orbit.envs import BaseEnv
from . import actions_cfg
......
......@@ -19,11 +19,11 @@ from omni.isaac.orbit.managers import SceneEntityCfg
from omni.isaac.orbit.terrains import TerrainImporter
if TYPE_CHECKING:
from omni.isaac.orbit.envs.rl_env import RLEnv
from omni.isaac.orbit.envs import RLTaskEnv
def terrain_levels_vel(
env: RLEnv, env_ids: Sequence[int], asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")
env: RLTaskEnv, env_ids: Sequence[int], asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")
) -> torch.Tensor:
"""Curriculum based on the distance the robot walked when commanded to move at a desired velocity.
......@@ -53,7 +53,7 @@ def terrain_levels_vel(
return torch.mean(terrain.terrain_levels.float())
def modify_reward_weight(env: RLEnv, env_ids: Sequence[int], term_name: str, weight: float, num_steps: int):
def modify_reward_weight(env: RLTaskEnv, env_ids: Sequence[int], term_name: str, weight: float, num_steps: int):
"""Curriculum that modifies a reward weight a given number of steps.
Args:
......
......@@ -19,7 +19,7 @@ from omni.isaac.orbit.managers import SceneEntityCfg
from omni.isaac.orbit.sensors import RayCaster
if TYPE_CHECKING:
from omni.isaac.orbit.envs.base_env import BaseEnv
from omni.isaac.orbit.envs import BaseEnv
"""
Root state.
......
......@@ -22,7 +22,7 @@ from omni.isaac.orbit.managers import SceneEntityCfg
from omni.isaac.orbit.utils.math import quat_from_euler_xyz, sample_uniform
if TYPE_CHECKING:
from omni.isaac.orbit.envs.base_env import BaseEnv
from omni.isaac.orbit.envs import BaseEnv
def randomize_rigid_body_material(
......
......@@ -19,14 +19,14 @@ from omni.isaac.orbit.managers import SceneEntityCfg
from omni.isaac.orbit.sensors import ContactSensor
if TYPE_CHECKING:
from omni.isaac.orbit.envs.rl_env import RLEnv
from omni.isaac.orbit.envs import RLTaskEnv
"""
General.
"""
def termination_penalty(env: RLEnv) -> torch.Tensor:
def termination_penalty(env: RLTaskEnv) -> torch.Tensor:
"""Penalize terminated episodes that don't correspond to episodic timeouts."""
return env.reset_buf * (~env.termination_manager.time_outs)
......@@ -36,21 +36,21 @@ Root penalties.
"""
def lin_vel_z_l2(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def lin_vel_z_l2(env: RLTaskEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
"""Penalize z-axis base linear velocity using L2-kernel."""
# extract the used quantities (to enable type-hinting)
asset: RigidObject = env.scene[asset_cfg.name]
return torch.square(asset.data.root_lin_vel_b[:, 2])
def ang_vel_xy_l2(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def ang_vel_xy_l2(env: RLTaskEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
"""Penalize xy-axis base angular velocity using L2-kernel."""
# extract the used quantities (to enable type-hinting)
asset: RigidObject = env.scene[asset_cfg.name]
return torch.sum(torch.square(asset.data.root_ang_vel_b[:, :2]), dim=1)
def flat_orientation_l2(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def flat_orientation_l2(env: RLTaskEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
"""Penalize non-flat base orientation using L2-kernel.
This is computed by penalizing the xy-components of the projected gravity vector.
......@@ -61,7 +61,7 @@ def flat_orientation_l2(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("
def base_height_l2(
env: RLEnv, target_height: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")
env: RLTaskEnv, target_height: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")
) -> torch.Tensor:
"""Penalize asset height from its target using L2-kernel.
......@@ -74,7 +74,7 @@ def base_height_l2(
return torch.square(asset.data.root_pos_w[:, 2] - target_height)
def body_lin_acc_l2(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def body_lin_acc_l2(env: RLTaskEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
"""Penalize the linear acceleration of bodies using L2-kernel."""
asset: Articulation = env.scene[asset_cfg.name]
return torch.sum(torch.norm(asset.data.body_lin_acc_w[:, asset_cfg.body_ids, :], dim=-1), dim=1)
......@@ -85,28 +85,28 @@ Joint penalties.
"""
def joint_torques_l2(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def joint_torques_l2(env: RLTaskEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
"""Penalize torques applied on the articulation using L2-kernel."""
# extract the used quantities (to enable type-hinting)
asset: Articulation = env.scene[asset_cfg.name]
return torch.sum(torch.square(asset.data.applied_torque), dim=1)
def joint_vel_l2(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def joint_vel_l2(env: RLTaskEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
"""Penalize joint velocities on the articulation."""
# extract the used quantities (to enable type-hinting)
asset: Articulation = env.scene[asset_cfg.name]
return torch.sum(torch.square(asset.data.joint_vel), dim=1)
def joint_acc_l2(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def joint_acc_l2(env: RLTaskEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
"""Penalize joint accelerations on the articulation using L2-kernel."""
# extract the used quantities (to enable type-hinting)
asset: Articulation = env.scene[asset_cfg.name]
return torch.sum(torch.square(asset.data.joint_acc), dim=1)
def joint_pos_limits(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def joint_pos_limits(env: RLTaskEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
"""Penalize joint positions if they cross the soft limits.
This is computed as a sum of the absolute value of the difference between the joint position and the soft limits.
......@@ -120,7 +120,7 @@ def joint_pos_limits(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("rob
def joint_vel_limits(
env: RLEnv, soft_ratio: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")
env: RLTaskEnv, soft_ratio: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")
) -> torch.Tensor:
"""Penalize joint velocities if they cross the soft limits.
......@@ -143,7 +143,7 @@ Action penalties.
"""
def applied_torque_limits(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def applied_torque_limits(env: RLTaskEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
"""Penalize applied torques if they cross the limits.
This is computed as a sum of the absolute value of the difference between the applied torques and the limits.
......@@ -160,7 +160,7 @@ def applied_torque_limits(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg
return torch.sum(out_of_limits, dim=1)
def action_rate_l2(env: RLEnv) -> torch.Tensor:
def action_rate_l2(env: RLTaskEnv) -> torch.Tensor:
"""Penalize the rate of change of the actions using L2-kernel."""
return torch.sum(torch.square(env.action_manager.action - env.action_manager.prev_action), dim=1)
......@@ -170,7 +170,7 @@ Contact sensor.
"""
def undesired_contacts(env: RLEnv, threshold: float, sensor_cfg: SceneEntityCfg) -> torch.Tensor:
def undesired_contacts(env: RLTaskEnv, threshold: float, sensor_cfg: SceneEntityCfg) -> torch.Tensor:
"""Penalize undesired contacts as the number of violations that are above a threshold."""
# extract the used quantities (to enable type-hinting)
contact_sensor: ContactSensor = env.scene.sensors[sensor_cfg.name]
......@@ -181,7 +181,7 @@ def undesired_contacts(env: RLEnv, threshold: float, sensor_cfg: SceneEntityCfg)
return torch.sum(is_contact, dim=1)
def contact_forces(env: RLEnv, threshold: float, sensor_cfg: SceneEntityCfg) -> torch.Tensor:
def contact_forces(env: RLTaskEnv, threshold: float, sensor_cfg: SceneEntityCfg) -> torch.Tensor:
"""Penalize contact forces as the amount of violations of the net contact force."""
# extract the used quantities (to enable type-hinting)
contact_sensor: ContactSensor = env.scene.sensors[sensor_cfg.name]
......@@ -197,7 +197,9 @@ Velocity-tracking rewards.
"""
def track_lin_vel_xy_exp(env: RLEnv, std: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def track_lin_vel_xy_exp(
env: RLTaskEnv, std: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")
) -> torch.Tensor:
"""Reward tracking of linear velocity commands (xy axes) using exponential kernel."""
# extract the used quantities (to enable type-hinting)
asset: RigidObject = env.scene[asset_cfg.name]
......@@ -208,7 +210,9 @@ def track_lin_vel_xy_exp(env: RLEnv, std: float, asset_cfg: SceneEntityCfg = Sce
return torch.exp(-lin_vel_error / std**2)
def track_ang_vel_z_exp(env: RLEnv, std: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def track_ang_vel_z_exp(
env: RLTaskEnv, std: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")
) -> torch.Tensor:
"""Reward tracking of angular velocity commands (yaw) using exponential kernel."""
# extract the used quantities (to enable type-hinting)
asset: RigidObject = env.scene[asset_cfg.name]
......
......@@ -19,19 +19,19 @@ from omni.isaac.orbit.managers import SceneEntityCfg
from omni.isaac.orbit.sensors import ContactSensor
if TYPE_CHECKING:
from omni.isaac.orbit.envs.rl_env import RLEnv
from omni.isaac.orbit.envs import RLTaskEnv
"""
MDP terminations.
"""
def time_out(env: RLEnv) -> torch.Tensor:
def time_out(env: RLTaskEnv) -> torch.Tensor:
"""Terminate the episode when the episode length exceeds the maximum episode length."""
return env.episode_length_buf >= env.max_episode_length
def command_resample(env: RLEnv, num_resamples: int = 1) -> torch.Tensor:
def command_resample(env: RLTaskEnv, num_resamples: int = 1) -> torch.Tensor:
"""Terminate the episode based on the total number of times commands have been re-sampled.
This makes the maximum episode length fluid in nature as it depends on how the commands are
......@@ -48,7 +48,7 @@ Root terminations.
def bad_orientation(
env: RLEnv, limit_angle: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")
env: RLTaskEnv, limit_angle: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")
) -> torch.Tensor:
"""Terminate when the asset's orientation is too far from the desired orientation limits.
......@@ -59,7 +59,9 @@ def bad_orientation(
return torch.acos(-asset.data.projected_gravity_b[:, 2]).abs() > limit_angle
def base_height(env: RLEnv, minimum_height: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def base_height(
env: RLTaskEnv, minimum_height: float, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")
) -> torch.Tensor:
"""Terminate when the asset's height is below the minimum height.
Note:
......@@ -75,7 +77,7 @@ Joint terminations.
"""
def joint_pos_limit(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def joint_pos_limit(env: RLTaskEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
"""Terminate when the asset's joint positions are outside of the soft joint limits."""
# extract the used quantities (to enable type-hinting)
asset: Articulation = env.scene[asset_cfg.name]
......@@ -85,7 +87,9 @@ def joint_pos_limit(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robo
return torch.logical_or(out_of_upper_limits, out_of_lower_limits)
def joint_velocity_limit(env: RLEnv, max_velocity, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def joint_velocity_limit(
env: RLTaskEnv, max_velocity, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")
) -> torch.Tensor:
"""Terminate when the asset's joint velocities are outside of the soft joint limits."""
# extract the used quantities (to enable type-hinting)
asset: Articulation = env.scene[asset_cfg.name]
......@@ -93,7 +97,7 @@ def joint_velocity_limit(env: RLEnv, max_velocity, asset_cfg: SceneEntityCfg = S
return torch.any(torch.abs(asset.data.joint_vel) > max_velocity, dim=1)
def joint_torque_limit(env: RLEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
def joint_torque_limit(env: RLTaskEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
"""Terminate when torque applied on the asset's joints are are outside of the soft joint limits."""
# extract the used quantities (to enable type-hinting)
asset: Articulation = env.scene[asset_cfg.name]
......@@ -108,7 +112,7 @@ Contact sensor.
"""
def illegal_contact(env: RLEnv, threshold: float, sensor_cfg: SceneEntityCfg) -> torch.Tensor:
def illegal_contact(env: RLTaskEnv, threshold: float, sensor_cfg: SceneEntityCfg) -> torch.Tensor:
"""Terminate when the contact force on the sensor exceeds the force threshold."""
# extract the used quantities (to enable type-hinting)
contact_sensor: ContactSensor = env.scene.sensors[sensor_cfg.name]
......
......@@ -15,7 +15,7 @@ from omni.isaac.orbit.command_generators import CommandGeneratorBase
from omni.isaac.orbit.managers import CurriculumManager, RewardManager, TerminationManager
from .base_env import BaseEnv
from .rl_env_cfg import RLEnvCfg
from .rl_task_env_cfg import RLTaskEnvCfg
VecEnvObs = Dict[str, Union[torch.Tensor, Dict[str, torch.Tensor]]]
"""Observation returned by the environment.
......@@ -32,7 +32,7 @@ observation term in the group, or a single tensor obtained from concatenating al
Note:
By default, most learning frameworks deal with default and privileged observations in different ways.
This handling must be taken care of by the wrapper around the :class:`RLEnv` instance.
This handling must be taken care of by the wrapper around the :class:`RLTaskEnv` instance.
For included frameworks (RSL-RL, RL-Games, skrl), the observations must have the key "policy". In case,
the key "critic" is also present, then the critic observations are taken from the "critic" group.
......@@ -48,7 +48,7 @@ It contains the observation, reward, termination signal and additional informati
"""
class RLEnv(BaseEnv, gym.Env):
class RLTaskEnv(BaseEnv, gym.Env):
"""The superclass for reinforcement learning-based environments.
This class inherits from :class:`BaseEnv` and implements the core functionality for
......@@ -75,10 +75,10 @@ class RLEnv(BaseEnv, gym.Env):
metadata: ClassVar[dict[str, Any]] = {"render.modes": ["human", "rgb_array"]}
"""Metadata for the environment."""
cfg: RLEnvCfg
cfg: RLTaskEnvCfg
"""Configuration for the environment."""
def __init__(self, cfg: RLEnvCfg, **kwargs):
def __init__(self, cfg: RLTaskEnvCfg, **kwargs):
# initialize the base class to setup the scene.
super().__init__(cfg=cfg)
......
......@@ -11,15 +11,15 @@ from omni.isaac.orbit.command_generators import CommandGeneratorBaseCfg
from omni.isaac.orbit.utils import configclass
from .base_env_cfg import BaseEnvCfg
from .ui import RLEnvWindow
from .ui import RLTaskEnvWindow
@configclass
class RLEnvCfg(BaseEnvCfg):
class RLTaskEnvCfg(BaseEnvCfg):
"""Configuration for a reinforcement learning environment."""
# ui settings
ui_window_class_type: type | None = RLEnvWindow
ui_window_class_type: type | None = RLTaskEnvWindow
# general settings
episode_length_s: float = MISSING
......
......@@ -19,6 +19,6 @@ enable_extension("omni.isaac.ui")
# import all UI elements here
from .base_env_window import BaseEnvWindow
from .rl_env_window import RLEnvWindow
from .rl_task_env_window import RLTaskEnvWindow
__all__ = ["BaseEnvWindow", "RLEnvWindow"]
__all__ = ["BaseEnvWindow", "RLTaskEnvWindow"]
......@@ -10,17 +10,17 @@ from typing import TYPE_CHECKING
from .base_env_window import BaseEnvWindow
if TYPE_CHECKING:
from ..rl_env import RLEnv
from ..rl_task_env import RLTaskEnv
class RLEnvWindow(BaseEnvWindow):
class RLTaskEnvWindow(BaseEnvWindow):
"""Window manager for the RL environment.
On top of the basic environment window, this class adds controls for the RL environment.
This includes visualization of the command manager.
"""
def __init__(self, env: RLEnv, window_name: str = "Orbit"):
def __init__(self, env: RLTaskEnv, window_name: str = "Orbit"):
"""Initialize the window.
Args:
......
......@@ -15,7 +15,7 @@ from .manager_base import ManagerBase
from .manager_cfg import CurriculumTermCfg
if TYPE_CHECKING:
from omni.isaac.orbit.envs import RLEnv
from omni.isaac.orbit.envs import RLTaskEnv
class CurriculumManager(ManagerBase):
......@@ -29,10 +29,10 @@ class CurriculumManager(ManagerBase):
parameters. Each curriculum term should instantiate the :class:`CurriculumTermCfg` class.
"""
_env: RLEnv
_env: RLTaskEnv
"""The environment instance."""
def __init__(self, cfg: object, env: RLEnv):
def __init__(self, cfg: object, env: RLTaskEnv):
"""Initialize the manager.
Args:
......
......@@ -17,7 +17,7 @@ from .manager_base import ManagerBase
from .manager_cfg import RandomizationTermCfg
if TYPE_CHECKING:
from omni.isaac.orbit.envs import RLEnv
from omni.isaac.orbit.envs import RLTaskEnv
class RandomizationManager(ManagerBase):
......@@ -49,10 +49,10 @@ class RandomizationManager(ManagerBase):
"""
_env: RLEnv
_env: RLTaskEnv
"""The environment instance."""
def __init__(self, cfg: object, env: RLEnv):
def __init__(self, cfg: object, env: RLTaskEnv):
"""Initialize the randomization manager.
Args:
......
......@@ -15,7 +15,7 @@ from .manager_base import ManagerBase
from .manager_cfg import RewardTermCfg
if TYPE_CHECKING:
from omni.isaac.orbit.envs import RLEnv
from omni.isaac.orbit.envs import RLTaskEnv
class RewardManager(ManagerBase):
......@@ -36,10 +36,10 @@ class RewardManager(ManagerBase):
"""
_env: RLEnv
_env: RLTaskEnv
"""The environment instance."""
def __init__(self, cfg: object, env: RLEnv):
def __init__(self, cfg: object, env: RLTaskEnv):
"""Initialize the reward manager.
Args:
......
......@@ -15,7 +15,7 @@ from .manager_base import ManagerBase
from .manager_cfg import TerminationTermCfg
if TYPE_CHECKING:
from omni.isaac.orbit.envs import RLEnv
from omni.isaac.orbit.envs import RLTaskEnv
class TerminationManager(ManagerBase):
......@@ -30,10 +30,10 @@ class TerminationManager(ManagerBase):
parameters. Each termination term should instantiate the :class:`TerminationTermCfg` class.
"""
_env: RLEnv
_env: RLTaskEnv
"""The environment instance."""
def __init__(self, cfg: object, env: RLEnv):
def __init__(self, cfg: object, env: RLTaskEnv):
"""Initializes the termination manager.
Args:
......
......@@ -18,4 +18,4 @@ keywords = ["robotics", "rl", "il", "learning"]
"omni.replicator.isaac" = {}
[[python.module]]
name = "omni.isaac.orbit_envs"
name = "omni.isaac.orbit_tasks"
......@@ -9,6 +9,12 @@ Changed
* Changed the way agent configs are handled for environments and learning agents. Switched from yaml to configclasses.
Fixed
^^^^^
* Fixed the way package import automation is handled in the :mod:`omni.isaac.orbit_tasks` module. Earlier it was
not skipping the blacklisted packages properly.
0.4.3 (2023-09-25)
~~~~~~~~~~~~~~~~~~
......
......@@ -14,7 +14,7 @@ itself. However, its various instances are included in directories within the en
This looks like as follows:
```tree
omni/isaac/orbit_envs/locomotion/
omni/isaac/orbit_tasks/locomotion/
├── __init__.py
└── velocity
├── a1
......@@ -26,19 +26,19 @@ omni/isaac/orbit_envs/locomotion/
└── velocity_env.py
```
The environments are then registered in the `omni/isaac/orbit_envs/__init__.py`:
The environments are then registered in the `omni/isaac/orbit_tasks/__init__.py`:
```python
gym.register(
id="Isaac-Velocity-Anymal-C-v0",
entry_point="omni.isaac.orbit_envs.locomotion.velocity:LocomotionEnv",
kwargs={"cfg_entry_point": "omni.isaac.orbit_envs.locomotion.velocity.anymal_c.flat_terrain_cfg:FlatTerrainCfg"},
entry_point="omni.isaac.orbit_tasks.locomotion.velocity:LocomotionEnv",
kwargs={"cfg_entry_point": "omni.isaac.orbit_tasks.locomotion.velocity.anymal_c.flat_terrain_cfg:FlatTerrainCfg"},
)
gym.register(
id="Isaac-Velocity-A1-v0",
entry_point="omni.isaac.orbit_envs.locomotion.velocity:LocomotionEnv",
kwargs={"cfg_entry_point": "omni.isaac.orbit_envs.locomotion.velocity.a1.flat_terrain_cfg:FlatTerrainCfg"},
entry_point="omni.isaac.orbit_tasks.locomotion.velocity:LocomotionEnv",
kwargs={"cfg_entry_point": "omni.isaac.orbit_tasks.locomotion.velocity.a1.flat_terrain_cfg:FlatTerrainCfg"},
)
```
......
......@@ -19,8 +19,8 @@ Note:
Usage:
>>> import gym
>>> import omni.isaac.orbit_envs
>>> from omni.isaac.orbit_envs.utils.parse_cfg import load_default_env_cfg
>>> import omni.isaac.orbit_tasks
>>> from omni.isaac.orbit_tasks.utils.parse_cfg import load_default_env_cfg
>>>
>>> task_name = "Isaac-Cartpole-v0"
>>> cfg = load_default_env_cfg(task_name)
......@@ -29,64 +29,26 @@ Usage:
from __future__ import annotations
import importlib
import os
import pkgutil
import toml
# Conveniences to other module directories via relative paths
ORBIT_ENVS_EXT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../"))
ORBIT_TASKS_EXT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../"))
"""Path to the extension source directory."""
ORBIT_ENVS_DATA_DIR = os.path.join(ORBIT_ENVS_EXT_DIR, "data")
"""Path to the extension data directory."""
ORBIT_ENVS_METADATA = toml.load(os.path.join(ORBIT_ENVS_EXT_DIR, "config", "extension.toml"))
ORBIT_TASKS_METADATA = toml.load(os.path.join(ORBIT_TASKS_EXT_DIR, "config", "extension.toml"))
"""Extension metadata dictionary parsed from the extension.toml file."""
# Configure the module-level variables
__version__ = ORBIT_ENVS_METADATA["package"]["version"]
__version__ = ORBIT_TASKS_METADATA["package"]["version"]
##
# Register Gym environments.
##
def _import_all(package_name: str, blacklist_pkgs: list[str] = None):
"""Import all sub-packages in a package recursively.
It is easier to use this function to import all sub-packages in a package recursively
than to manually import each sub-package.
It replaces the need of the following code:
.. code-block:: python
import .locomotion.velocity
import .manipulation.reach
import .manipulation.lift
Args:
package_name: The package name.
blacklist_pkgs: The list of blacklisted packages to skip. Defaults to None,
which means no packages are blacklisted.
"""
# Default blacklist
if blacklist_pkgs is None:
blacklist_pkgs = []
# Import the package
package = importlib.import_module(package_name)
# Import all Python files
for file_name, module_name, is_pkg in pkgutil.walk_packages(package.__path__, package.__name__ + "."):
# check blacklisted
if any([pkg_name in module_name for pkg_name in blacklist_pkgs]):
continue
if is_pkg:
importlib.import_module(module_name)
_import_all(module_name, blacklist_pkgs)
from .utils import import_packages
# The blacklist is used to prevent importing configs from sub-packages
_BLACKLIST_PKGS = ["locomotion.velocity.config.anymal_d", "classic", "manipulation", "utils"]
# Import all configs in this package
_import_all(__name__, _BLACKLIST_PKGS)
import_packages(__name__, _BLACKLIST_PKGS)
......@@ -17,7 +17,7 @@ from . import agents
gym.register(
id="Isaac-Ant-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": f"{__name__}:ant_env_cfg.yaml",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
......
......@@ -16,8 +16,8 @@ from omni.isaac.core.articulations import ArticulationView
import omni.isaac.orbit.compat.utils.kit as kit_utils
from omni.isaac.orbit_envs.isaac_env import IsaacEnv, VecEnvIndices, VecEnvObs
from omni.isaac.orbit_envs.isaac_env_cfg import EnvCfg, IsaacEnvCfg
from omni.isaac.orbit_tasks.isaac_env import IsaacEnv, VecEnvIndices, VecEnvObs
from omni.isaac.orbit_tasks.isaac_env_cfg import EnvCfg, IsaacEnvCfg
class AntEnv(IsaacEnv):
......
......@@ -17,7 +17,7 @@ from . import agents
gym.register(
id="Isaac-Cartpole-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": f"{__name__}:ant_env_cfg.yaml",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
......
......@@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause
from omni.isaac.orbit_envs.utils.wrappers.rsl_rl import (
from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import (
RslRlOnPolicyRunnerCfg,
RslRlPpoActorCriticCfg,
RslRlPpoAlgorithmCfg,
......
......@@ -15,8 +15,8 @@ from omni.isaac.core.articulations import ArticulationView
import omni.isaac.orbit.compat.utils.kit as kit_utils
from omni.isaac.orbit_envs.isaac_env import IsaacEnv, VecEnvIndices, VecEnvObs
from omni.isaac.orbit_envs.isaac_env_cfg import EnvCfg, IsaacEnvCfg
from omni.isaac.orbit_tasks.isaac_env import IsaacEnv, VecEnvIndices, VecEnvObs
from omni.isaac.orbit_tasks.isaac_env_cfg import EnvCfg, IsaacEnvCfg
class CartpoleEnv(IsaacEnv):
......
......@@ -17,7 +17,7 @@ from . import agents
gym.register(
id="Isaac-Humanoid-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": f"{__name__}:ant_env_cfg.yaml",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
......
......@@ -16,8 +16,8 @@ from omni.isaac.core.articulations import ArticulationView
import omni.isaac.orbit.compat.utils.kit as kit_utils
from omni.isaac.orbit_envs.isaac_env import IsaacEnv, VecEnvIndices, VecEnvObs
from omni.isaac.orbit_envs.isaac_env_cfg import EnvCfg, IsaacEnvCfg
from omni.isaac.orbit_tasks.isaac_env import IsaacEnv, VecEnvIndices, VecEnvObs
from omni.isaac.orbit_tasks.isaac_env_cfg import EnvCfg, IsaacEnvCfg
class HumanoidEnv(IsaacEnv):
......
......@@ -13,7 +13,7 @@ from . import agents, flat_env_cfg, rough_env_cfg
gym.register(
id="Isaac-Velocity-Flat-Anymal-B-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": flat_env_cfg.AnymalBFlatEnvCfg,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.AnymalBFlatPPORunnerCfg,
......@@ -22,7 +22,7 @@ gym.register(
gym.register(
id="Isaac-Velocity-Flat-Anymal-B-Play-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": flat_env_cfg.AnymalBFlatEnvCfg_PLAY,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.AnymalBFlatPPORunnerCfg,
......@@ -31,7 +31,7 @@ gym.register(
gym.register(
id="Isaac-Velocity-Rough-Anymal-B-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": rough_env_cfg.AnymalBRoughEnvCfg,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.AnymalBRoughPPORunnerCfg,
......@@ -40,7 +40,7 @@ gym.register(
gym.register(
id="Isaac-Velocity-Rough-Anymal-B-Play-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": rough_env_cfg.AnymalBRoughEnvCfg_PLAY,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.AnymalBRoughPPORunnerCfg,
......
......@@ -5,7 +5,7 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_envs.utils.wrappers.rsl_rl import (
from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import (
RslRlOnPolicyRunnerCfg,
RslRlPpoActorCriticCfg,
RslRlPpoAlgorithmCfg,
......
......@@ -5,7 +5,7 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_envs.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
from omni.isaac.orbit_tasks.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
##
# Pre-defined configs
......
......@@ -5,7 +5,7 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_envs.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
from omni.isaac.orbit_tasks.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
##
# Pre-defined configs
......
......@@ -13,17 +13,17 @@ from . import agents, flat_env_cfg, rough_env_cfg
gym.register(
id="Isaac-Velocity-Flat-Anymal-C-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": flat_env_cfg.AnymalCFlatEnvCfg,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.AnymalCFlatPPORunnerCfg,
"skrl_cfg_entry_point": "omni.isaac.orbit_envs.locomotion.velocity.anymal_c.agents:skrl_cfg.yaml",
"skrl_cfg_entry_point": "omni.isaac.orbit_tasks.locomotion.velocity.anymal_c.agents:skrl_cfg.yaml",
},
)
gym.register(
id="Isaac-Velocity-Flat-Anymal-C-Play-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": flat_env_cfg.AnymalCFlatEnvCfg_PLAY,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.AnymalCFlatPPORunnerCfg,
......@@ -32,7 +32,7 @@ gym.register(
gym.register(
id="Isaac-Velocity-Rough-Anymal-C-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": rough_env_cfg.AnymalCRoughEnvCfg,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.AnymalCRoughPPORunnerCfg,
......@@ -41,7 +41,7 @@ gym.register(
gym.register(
id="Isaac-Velocity-Rough-Anymal-C-Play-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": rough_env_cfg.AnymalCRoughEnvCfg_PLAY,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.AnymalCRoughPPORunnerCfg,
......
......@@ -5,7 +5,7 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_envs.utils.wrappers.rsl_rl import (
from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import (
RslRlOnPolicyRunnerCfg,
RslRlPpoActorCriticCfg,
RslRlPpoAlgorithmCfg,
......
......@@ -5,7 +5,7 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_envs.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
from omni.isaac.orbit_tasks.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
##
# Pre-defined configs
......
......@@ -5,7 +5,7 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_envs.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
from omni.isaac.orbit_tasks.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
##
# Pre-defined configs
......
......@@ -13,7 +13,7 @@ from . import agents, flat_env_cfg, rough_env_cfg
gym.register(
id="Isaac-Velocity-Flat-Anymal-D-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": flat_env_cfg.AnymalDFlatEnvCfg,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.AnymalDFlatPPORunnerCfg,
......@@ -22,7 +22,7 @@ gym.register(
gym.register(
id="Isaac-Velocity-Flat-Anymal-D-Play-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": flat_env_cfg.AnymalDFlatEnvCfg_PLAY,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.AnymalDFlatPPORunnerCfg,
......@@ -31,7 +31,7 @@ gym.register(
gym.register(
id="Isaac-Velocity-Rough-Anymal-D-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": rough_env_cfg.AnymalDRoughEnvCfg,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.AnymalDRoughPPORunnerCfg,
......@@ -40,7 +40,7 @@ gym.register(
gym.register(
id="Isaac-Velocity-Rough-Anymal-D-Play-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": rough_env_cfg.AnymalDRoughEnvCfg_PLAY,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.AnymalDRoughPPORunnerCfg,
......
......@@ -5,7 +5,7 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_envs.utils.wrappers.rsl_rl import (
from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import (
RslRlOnPolicyRunnerCfg,
RslRlPpoActorCriticCfg,
RslRlPpoAlgorithmCfg,
......
......@@ -5,7 +5,7 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_envs.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
from omni.isaac.orbit_tasks.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
##
# Pre-defined configs
......
......@@ -5,7 +5,7 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_envs.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
from omni.isaac.orbit_tasks.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
##
# Pre-defined configs
......
......@@ -13,7 +13,7 @@ from . import agents, flat_env_cfg, rough_env_cfg
gym.register(
id="Isaac-Velocity-Flat-Unitree-A1-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": flat_env_cfg.UnitreeA1FlatEnvCfg,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.UnitreeA1FlatPPORunnerCfg,
......@@ -22,7 +22,7 @@ gym.register(
gym.register(
id="Isaac-Velocity-Flat-Unitree-A1-Play-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": flat_env_cfg.UnitreeA1FlatEnvCfg_PLAY,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.UnitreeA1FlatPPORunnerCfg,
......@@ -31,7 +31,7 @@ gym.register(
gym.register(
id="Isaac-Velocity-Rough-Unitree-A1-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": rough_env_cfg.UnitreeA1RoughEnvCfg,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.UnitreeA1RoughPPORunnerCfg,
......@@ -40,7 +40,7 @@ gym.register(
gym.register(
id="Isaac-Velocity-Rough-Unitree-A1-Play-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": rough_env_cfg.UnitreeA1RoughEnvCfg_PLAY,
"rsl_rl_cfg_entry_point": agents.rsl_rl_cfg.UnitreeA1RoughPPORunnerCfg,
......
......@@ -5,7 +5,7 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_envs.utils.wrappers.rsl_rl import (
from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import (
RslRlOnPolicyRunnerCfg,
RslRlPpoActorCriticCfg,
RslRlPpoAlgorithmCfg,
......
......@@ -5,7 +5,7 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_envs.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
from omni.isaac.orbit_tasks.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
##
# Pre-defined configs
......
......@@ -5,7 +5,7 @@
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit_envs.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
from omni.isaac.orbit_tasks.locomotion.velocity.velocity_env_cfg import LocomotionVelocityRoughEnvCfg
##
# Pre-defined configs
......
......@@ -12,10 +12,10 @@ from omni.isaac.orbit.managers import SceneEntityCfg
from omni.isaac.orbit.sensors import ContactSensor
if TYPE_CHECKING:
from omni.isaac.orbit.envs import RLEnv
from omni.isaac.orbit.envs import RLTaskEnv
def feet_air_time(env: RLEnv, sensor_cfg: SceneEntityCfg, threshold: float) -> torch.Tensor:
def feet_air_time(env: RLTaskEnv, sensor_cfg: SceneEntityCfg, threshold: float) -> torch.Tensor:
"""Reward long steps taken by the feet using L2-kernel.
This function rewards the agent for taking steps that are longer than a threshold. This helps ensure
......
......@@ -11,7 +11,7 @@ from dataclasses import MISSING
import omni.isaac.orbit.sim as sim_utils
from omni.isaac.orbit.assets import ArticulationCfg, AssetBaseCfg
from omni.isaac.orbit.command_generators import UniformVelocityCommandGeneratorCfg
from omni.isaac.orbit.envs import RLEnvCfg
from omni.isaac.orbit.envs import RLTaskEnvCfg
from omni.isaac.orbit.managers import CurriculumTermCfg as CurrTerm
from omni.isaac.orbit.managers import ObservationGroupCfg as ObsGroup
from omni.isaac.orbit.managers import ObservationTermCfg as ObsTerm
......@@ -25,7 +25,7 @@ from omni.isaac.orbit.terrains import TerrainImporterCfg
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit.utils.noise import AdditiveUniformNoiseCfg as Unoise
import omni.isaac.orbit_envs.locomotion.velocity.mdp as mdp
import omni.isaac.orbit_tasks.locomotion.velocity.mdp as mdp
##
# Pre-defined configs
......@@ -243,7 +243,7 @@ class CurriculumCfg:
@configclass
class LocomotionVelocityRoughEnvCfg(RLEnvCfg):
class LocomotionVelocityRoughEnvCfg(RLTaskEnvCfg):
"""Configuration for the locomotion velocity-tracking environment."""
# Scene settings
......
......@@ -5,7 +5,7 @@
# TODO: be moved once CabinetEnv exists
from omni.isaac.orbit_envs.utils.wrappers.rsl_rl import (
from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import (
RslRlOnPolicyRunnerCfg,
RslRlPpoActorCriticCfg,
RslRlPpoAlgorithmCfg,
......
......@@ -17,7 +17,7 @@ from . import agents
gym.register(
id="Isaac-Lift-Franka-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": f"{__name__}.lift_env_cfg:LiftEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
......
......@@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause
from omni.isaac.orbit_envs.utils.wrappers.rsl_rl import (
from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import (
RslRlOnPolicyRunnerCfg,
RslRlPpoActorCriticCfg,
RslRlPpoAlgorithmCfg,
......
......@@ -12,7 +12,7 @@ from omni.isaac.orbit.robots.single_arm import SingleArmManipulatorCfg
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit.utils.assets import ISAAC_NUCLEUS_DIR
from omni.isaac.orbit_envs.isaac_env_cfg import EnvCfg, IsaacEnvCfg, PhysxCfg, SimCfg, ViewerCfg
from omni.isaac.orbit_tasks.isaac_env_cfg import EnvCfg, IsaacEnvCfg, PhysxCfg, SimCfg, ViewerCfg
##
# Scene settings
......
......@@ -20,7 +20,7 @@ from omni.isaac.orbit.robots.single_arm import SingleArmManipulator
from omni.isaac.orbit.utils.dict import class_to_dict
from omni.isaac.orbit.utils.math import quat_inv, quat_mul, random_orientation, sample_uniform, scale_transform
from omni.isaac.orbit_envs.isaac_env import IsaacEnv, VecEnvIndices, VecEnvObs
from omni.isaac.orbit_tasks.isaac_env import IsaacEnv, VecEnvIndices, VecEnvObs
from .lift_cfg import LiftEnvCfg, RandomizationCfg
......
......@@ -15,7 +15,7 @@ from . import agents
gym.register(
id="Isaac-Reach-Franka-v0",
entry_point="omni.isaac.orbit.envs.rl_env:RLEnv",
entry_point="omni.isaac.orbit.envs:RLTaskEnv",
kwargs={
"env_cfg_entry_point": f"{__name__}.reach_env_cfg:ReachEnvCfg",
"rl_games_cfg_entry_point": f"{agents.__name__}:rl_games_ppo_cfg.yaml",
......
......@@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause
from omni.isaac.orbit_envs.utils.wrappers.rsl_rl import (
from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import (
RslRlOnPolicyRunnerCfg,
RslRlPpoActorCriticCfg,
RslRlPpoAlgorithmCfg,
......
......@@ -11,7 +11,7 @@ from omni.isaac.orbit.robots.single_arm import SingleArmManipulatorCfg
from omni.isaac.orbit.utils import configclass
from omni.isaac.orbit.utils.assets import ISAAC_NUCLEUS_DIR
from omni.isaac.orbit_envs.isaac_env_cfg import EnvCfg, IsaacEnvCfg, SimCfg, ViewerCfg
from omni.isaac.orbit_tasks.isaac_env_cfg import EnvCfg, IsaacEnvCfg, SimCfg, ViewerCfg
##
# Scene settings
......
......@@ -19,7 +19,7 @@ from omni.isaac.orbit.robots.single_arm import SingleArmManipulator
from omni.isaac.orbit.utils.dict import class_to_dict
from omni.isaac.orbit.utils.math import random_orientation, sample_uniform, scale_transform
from omni.isaac.orbit_envs.isaac_env import IsaacEnv, VecEnvIndices, VecEnvObs
from omni.isaac.orbit_tasks.isaac_env import IsaacEnv, VecEnvIndices, VecEnvObs
from .reach_cfg import RandomizationCfg, ReachEnvCfg
......
......@@ -5,6 +5,7 @@
"""Utilities and wrappers for environments."""
from .importer import import_packages
from .parse_cfg import get_checkpoint_path, load_cfg_from_registry, parse_env_cfg
__all__ = ["load_cfg_from_registry", "parse_env_cfg", "get_checkpoint_path"]
__all__ = ["load_cfg_from_registry", "parse_env_cfg", "get_checkpoint_path", "import_packages"]
# Copyright (c) 2022-2023, The ORBIT Project Developers.
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""Utilities for importing all configs in a package recursively."""
from __future__ import annotations
import importlib
import pkgutil
import sys
__all__ = ["import_packages"]
def import_packages(package_name: str, blacklist_pkgs: list[str] = None):
"""Import all sub-packages in a package recursively.
It is easier to use this function to import all sub-packages in a package recursively
than to manually import each sub-package.
It replaces the need of the following code snippet on the top of each package's ``__init__.py`` file:
.. code-block:: python
import .locomotion.velocity
import .manipulation.reach
import .manipulation.lift
Args:
package_name: The package name.
blacklist_pkgs: The list of blacklisted packages to skip. Defaults to None,
which means no packages are blacklisted.
"""
# Default blacklist
if blacklist_pkgs is None:
blacklist_pkgs = []
# Import the package itself
package = importlib.import_module(package_name)
# Import all Python files
for _ in _walk_packages(package.__path__, package.__name__ + ".", blacklist_pkgs=blacklist_pkgs):
pass
def _walk_packages(
path: str | None = None,
prefix: str = "",
onerror: callable | None = None,
blacklist_pkgs: list[str] | None = None,
):
"""Yields ModuleInfo for all modules recursively on path, or, if path is None, all accessible modules.
Note:
This function is a modified version of the original ``pkgutil.walk_packages`` function. It adds
the `blacklist_pkgs` argument to skip blacklisted packages. Please refer to the original
``pkgutil.walk_packages`` function for more details.
"""
if blacklist_pkgs is None:
blacklist_pkgs = []
def seen(p, m={}):
if p in m:
return True
m[p] = True # noqa: R503
for info in pkgutil.iter_modules(path, prefix):
# check blacklisted
if any([black_pkg_name in info.name for black_pkg_name in blacklist_pkgs]):
continue
# yield the module info
yield info
if info.ispkg:
try:
__import__(info.name)
except ImportError:
if onerror is not None:
onerror(info.name)
except Exception:
if onerror is not None:
onerror(info.name)
else:
raise
else:
path = getattr(sys.modules[info.name], "__path__", None) or []
# don't traverse path items we've seen before
path = [p for p in path if not seen(p)]
yield from _walk_packages(path, info.name + ".", onerror, blacklist_pkgs)
......@@ -37,7 +37,7 @@ def load_cfg_from_registry(task_name: str, entry_point_key: str) -> dict | Any:
Usage:
.. code-block:: python
from omni.isaac.orbit_envs.utils.parse_cfg import load_cfg_from_registry
from omni.isaac.orbit_tasks.utils.parse_cfg import load_cfg_from_registry
cfg = load_cfg_from_registry("My-Awesome-Task-v0", "env_entry_point_cfg")
......
......@@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause
"""Wrapper to configure an :class:`RLEnv` instance to RL-Games vectorized environment.
"""Wrapper to configure an :class:`RLTaskEnv` instance to RL-Games vectorized environment.
The following example shows how to wrap an environment for RL-Games and register the environment construction
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 omni.isaac.orbit_envs.utils.wrappers.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
from omni.isaac.orbit_tasks.utils.wrappers.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
# configuration parameters
rl_device = "cuda:0"
......@@ -39,7 +39,7 @@ import torch
from rl_games.common import env_configurations
from rl_games.common.vecenv import IVecEnv
from omni.isaac.orbit.envs import RLEnv, VecEnvObs
from omni.isaac.orbit.envs import RLTaskEnv, VecEnvObs
__all__ = ["RlGamesVecEnvWrapper", "RlGamesGpuEnv"]
......@@ -74,7 +74,7 @@ class RlGamesVecEnvWrapper(gym.Wrapper):
https://github.com/NVIDIA-Omniverse/IsaacGymEnvs
"""
def __init__(self, env: RLEnv, rl_device: str, clip_obs: float, clip_actions: float):
def __init__(self, env: RLTaskEnv, rl_device: str, clip_obs: float, clip_actions: float):
"""Initializes the wrapper instance.
Args:
......@@ -84,11 +84,11 @@ class RlGamesVecEnvWrapper(gym.Wrapper):
clip_actions: The clipping value for actions.
Raises:
ValueError: The environment is not inherited from :class:`RLEnv`.
ValueError: The environment is not inherited from :class:`RLTaskEnv`.
"""
# check that input is valid
if not isinstance(env.unwrapped, RLEnv):
raise ValueError(f"The environment must be inherited from RLEnv. Environment type: {type(env)}")
if not isinstance(env.unwrapped, RLTaskEnv):
raise ValueError(f"The environment must be inherited from RLTaskEnv. Environment type: {type(env)}")
# initialize gym wrapper
gym.Wrapper.__init__(self, env)
# initialize rl-games vec-env
......
......@@ -3,13 +3,13 @@
#
# SPDX-License-Identifier: BSD-3-Clause
"""Wrapper to configure an :class:`RLEnv` instance to RSL-RL vectorized environment.
"""Wrapper to configure an :class:`RLTaskEnv` instance to RSL-RL vectorized environment.
The following example shows how to wrap an environment for RSL-RL:
.. code-block:: python
from omni.isaac.orbit_envs.utils.wrappers.rsl_rl import RslRlVecEnvWrapper
from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import RslRlVecEnvWrapper
env = RslRlVecEnvWrapper(env)
......@@ -21,7 +21,7 @@ import gym
import gym.spaces
import torch
from omni.isaac.orbit.envs import RLEnv
from omni.isaac.orbit.envs import RLTaskEnv
class RslRlVecEnvWrapper(gym.Wrapper):
......@@ -38,22 +38,22 @@ class RslRlVecEnvWrapper(gym.Wrapper):
https://github.com/leggedrobotics/rsl_rl/blob/master/rsl_rl/env/vec_env.py
"""
def __init__(self, env: RLEnv):
def __init__(self, env: RLTaskEnv):
"""Initializes the wrapper.
Args:
env: The environment to wrap around.
Raises:
ValueError: When the environment is not an instance of :class:`RLEnv`.
ValueError: When the environment is not an instance of :class:`RLTaskEnv`.
"""
# check that input is valid
if not isinstance(env.unwrapped, RLEnv):
raise ValueError(f"The environment must be inherited from RLEnv. Environment type: {type(env)}")
if not isinstance(env.unwrapped, RLTaskEnv):
raise ValueError(f"The environment must be inherited from RLTaskEnv. Environment type: {type(env)}")
# initialize the wrapper
gym.Wrapper.__init__(self, env)
# store information required by wrapper
orbit_env: RLEnv = self.env.unwrapped
orbit_env: RLTaskEnv = self.env.unwrapped
self.num_envs = orbit_env.num_envs
self.num_actions = orbit_env.action_manager.total_action_dim
self.num_obs = orbit_env.observation_manager.group_obs_dim["policy"][0]
......
......@@ -3,13 +3,13 @@
#
# SPDX-License-Identifier: BSD-3-Clause
"""Wrapper to configure an :class:`RLEnv` instance to Stable-Baselines3 vectorized environment.
"""Wrapper to configure an :class:`RLTaskEnv` instance to Stable-Baselines3 vectorized environment.
The following example shows how to wrap an environment for Stable-Baselines3:
.. code-block:: python
from omni.isaac.orbit_envs.utils.wrappers.sb3 import Sb3VecEnvWrapper
from omni.isaac.orbit_tasks.utils.wrappers.sb3 import Sb3VecEnvWrapper
env = Sb3VecEnvWrapper(env)
......@@ -24,7 +24,7 @@ from typing import Any
from stable_baselines3.common.vec_env.base_vec_env import VecEnv, VecEnvObs, VecEnvStepReturn
from omni.isaac.orbit.envs import RLEnv
from omni.isaac.orbit.envs import RLTaskEnv
__all__ = ["process_sb3_cfg", "Sb3VecEnvWrapper"]
......@@ -72,7 +72,7 @@ class Sb3VecEnvWrapper(gym.Wrapper, VecEnv):
still considered a single environment instance, Stable Baselines tries to wrap
around it using the :class:`DummyVecEnv`. This is only done if the environment
is not inheriting from their :class:`VecEnv`. Thus, this class thinly wraps
over the environment from :class:`RLEnv`.
over the environment from :class:`RLTaskEnv`.
We also add monitoring functionality that computes the un-discounted episode
return and length. This information is added to the info dicts under key `episode`.
......@@ -97,18 +97,18 @@ class Sb3VecEnvWrapper(gym.Wrapper, VecEnv):
https://stable-baselines3.readthedocs.io/en/master/common/monitor.html
"""
def __init__(self, env: RLEnv):
def __init__(self, env: RLTaskEnv):
"""Initialize the wrapper.
Args:
env: The environment to wrap around.
Raises:
ValueError: When the environment is not an instance of :class:`RLEnv`.
ValueError: When the environment is not an instance of :class:`RLTaskEnv`.
"""
# check that input is valid
if not isinstance(env.unwrapped, RLEnv):
raise ValueError(f"The environment must be inherited from RLEnv. Environment type: {type(env)}")
if not isinstance(env.unwrapped, RLTaskEnv):
raise ValueError(f"The environment must be inherited from RLTaskEnv. Environment type: {type(env)}")
# initialize the wrapper
gym.Wrapper.__init__(self, env)
# initialize vec-env
......@@ -152,7 +152,7 @@ class Sb3VecEnvWrapper(gym.Wrapper, VecEnv):
reset_ids = (dones > 0).nonzero(as_tuple=False)
# convert data types to numpy depending on backend
# Note: RLEnv uses torch backend (by default).
# Note: RLTaskEnv uses torch backend (by default).
obs = self._process_obs(obs_dict)
rew = rew.cpu().numpy()
dones = dones.cpu().numpy()
......@@ -198,7 +198,7 @@ class Sb3VecEnvWrapper(gym.Wrapper, VecEnv):
"""Convert observations into NumPy data type."""
# Sb3 doesn't support asymmetric observation spaces, so we only use "policy"
obs = obs_dict["policy"]
# Note: RLEnv uses torch backend (by default).
# Note: RLTaskEnv uses torch backend (by default).
if self.env.sim.backend == "torch":
if isinstance(obs, dict):
for key, value in obs.items():
......
......@@ -3,13 +3,13 @@
#
# SPDX-License-Identifier: BSD-3-Clause
"""Wrapper to configure an :class:`RLEnv` instance to skrl environment.
"""Wrapper to configure an :class:`RLTaskEnv` instance to skrl environment.
The following example shows how to wrap an environment for skrl:
.. code-block:: python
from omni.isaac.orbit_envs.utils.wrappers.skrl import SkrlVecEnvWrapper
from omni.isaac.orbit_tasks.utils.wrappers.skrl import SkrlVecEnvWrapper
env = SkrlVecEnvWrapper(env)
......@@ -37,7 +37,7 @@ from skrl.trainers.torch import Trainer
from skrl.trainers.torch.sequential import SEQUENTIAL_TRAINER_DEFAULT_CONFIG
from skrl.utils.model_instantiators import Shape # noqa: F401
from omni.isaac.orbit.envs import RLEnv
from omni.isaac.orbit.envs import RLTaskEnv
__all__ = ["SkrlVecEnvWrapper", "SkrlSequentialLogTrainer"]
......@@ -92,10 +92,10 @@ Vectorized environment wrapper.
"""
def SkrlVecEnvWrapper(env: RLEnv):
def SkrlVecEnvWrapper(env: RLTaskEnv):
"""Wraps around Isaac Orbit environment for skrl.
This function wraps around the Isaac Orbit environment. Since the :class:`RLEnv` environment
This function wraps around the Isaac Orbit environment. Since the :class:`RLTaskEnv` environment
wrapping functionality is defined within the skrl library itself, this implementation
is maintained for compatibility with the structure of the extension that contains it.
Internally it calls the :func:`wrap_env` from the skrl library API.
......@@ -104,14 +104,14 @@ def SkrlVecEnvWrapper(env: RLEnv):
env: The environment to wrap around.
Raises:
ValueError: When the environment is not an instance of :class:`RLEnv`.
ValueError: When the environment is not an instance of :class:`RLTaskEnv`.
Reference:
https://skrl.readthedocs.io/en/latest/modules/skrl.envs.wrapping.html
"""
# check that input is valid
if not isinstance(env.unwrapped, RLEnv):
raise ValueError(f"The environment must be inherited from RLEnv. Environment type: {type(env)}")
if not isinstance(env.unwrapped, RLTaskEnv):
raise ValueError(f"The environment must be inherited from RLTaskEnv. Environment type: {type(env)}")
# wrap and return the environment
return wrap_env(env, wrapper="isaac-orbit")
......
......@@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause
"""Installation script for the 'omni.isaac.orbit_envs' python package."""
"""Installation script for the 'omni.isaac.orbit_tasks' python package."""
import itertools
import os
......@@ -42,7 +42,7 @@ EXTRAS_REQUIRE["all"] = list(itertools.chain.from_iterable(EXTRAS_REQUIRE.values
# Installation operation
setup(
name="omni-isaac-orbit_envs",
name="omni-isaac-orbit_tasks",
author="NVIDIA, ETH Zurich, and University of Toronto",
maintainer="Mayank Mittal",
maintainer_email="mittalma@ethz.ch",
......@@ -54,7 +54,7 @@ setup(
python_requires=">=3.7",
install_requires=INSTALL_REQUIRES,
extras_require=EXTRAS_REQUIRE,
packages=["omni.isaac.orbit_envs"],
packages=["omni.isaac.orbit_tasks"],
classifiers=["Natural Language :: English", "Programming Language :: Python :: 3.7"],
zip_safe=False,
)
......@@ -9,7 +9,7 @@ import os
import torch
import unittest
from omni.isaac.orbit_envs.utils.data_collector import RobomimicDataCollector
from omni.isaac.orbit_tasks.utils.data_collector import RobomimicDataCollector
class TestRobomimicDataCollector(unittest.TestCase):
......
......@@ -27,8 +27,8 @@ import unittest
import omni.usd
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils.parse_cfg import parse_env_cfg
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils.parse_cfg import parse_env_cfg
class TestEnvironments(unittest.TestCase):
......
......@@ -24,9 +24,9 @@ import os
import torch
import unittest
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import parse_env_cfg
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import parse_env_cfg
class TestRecordVideoWrapper(unittest.TestCase):
......
......@@ -9,7 +9,7 @@ Script to print all the available environments in ORBIT.
The script iterates over all registered environments and stores the details in a table.
It prints the name of the environment, the entry point and the config file.
All the environments are registered in the `omni.isaac.orbit_envs` extension. They start
All the environments are registered in the `omni.isaac.orbit_tasks` extension. They start
with `Isaac` in their name.
"""
......@@ -30,12 +30,12 @@ simulation_app = app_launcher.app
import gym
from prettytable import PrettyTable
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
def main():
"""Print all environments registered in `omni.isaac.orbit_envs` extension."""
"""Print all environments registered in `omni.isaac.orbit_tasks` extension."""
# print all the available environments
table = PrettyTable(["S. No.", "Task Name", "Entry Point", "Config"])
table.title = "Available Environments in ORBIT"
......
......@@ -37,9 +37,9 @@ import traceback
import carb
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import parse_env_cfg
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import parse_env_cfg
def main():
......
......@@ -47,8 +47,8 @@ import warp as wp
from omni.isaac.orbit.utils.timer import Timer
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils.parse_cfg import parse_env_cfg
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils.parse_cfg import parse_env_cfg
# initialize warp
wp.init()
......
......@@ -41,9 +41,9 @@ import carb
from omni.isaac.orbit.devices import Se3Gamepad, Se3Keyboard, Se3SpaceMouse
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import parse_env_cfg
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import parse_env_cfg
def pre_process_actions(delta_pose: torch.Tensor, gripper_command: bool) -> torch.Tensor:
......
......@@ -36,9 +36,9 @@ import traceback
import carb
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import parse_env_cfg
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import parse_env_cfg
def main():
......
......@@ -48,10 +48,10 @@ from rl_games.common import env_configurations, vecenv
from rl_games.common.player import BasePlayer
from rl_games.torch_runner import Runner
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import get_checkpoint_path, load_cfg_from_registry, parse_env_cfg
from omni.isaac.orbit_envs.utils.wrappers.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import get_checkpoint_path, load_cfg_from_registry, parse_env_cfg
from omni.isaac.orbit_tasks.utils.wrappers.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
def main():
......
......@@ -55,10 +55,10 @@ from rl_games.torch_runner import Runner
from omni.isaac.orbit.utils.dict import print_dict
from omni.isaac.orbit.utils.io import dump_pickle, dump_yaml
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import load_cfg_from_registry, parse_env_cfg
from omni.isaac.orbit_envs.utils.wrappers.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import load_cfg_from_registry, parse_env_cfg
from omni.isaac.orbit_tasks.utils.wrappers.rl_games import RlGamesGpuEnv, RlGamesVecEnvWrapper
def main():
......
......@@ -45,10 +45,10 @@ import carb
from omni.isaac.orbit.devices import Se3Keyboard, Se3SpaceMouse
from omni.isaac.orbit.utils.io import dump_pickle, dump_yaml
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils.data_collector import RobomimicDataCollector
from omni.isaac.orbit_envs.utils.parse_cfg import parse_env_cfg
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils.data_collector import RobomimicDataCollector
from omni.isaac.orbit_tasks.utils.parse_cfg import parse_env_cfg
def pre_process_actions(delta_pose: torch.Tensor, gripper_command: bool) -> torch.Tensor:
......
......@@ -40,9 +40,9 @@ import robomimic # noqa: F401
import robomimic.utils.file_utils as FileUtils
import robomimic.utils.torch_utils as TorchUtils
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import parse_env_cfg
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import parse_env_cfg
def main():
......
......@@ -9,7 +9,7 @@ import argparse
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from omni.isaac.orbit_envs.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg
from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg
def add_rsl_rl_args(parser: argparse.ArgumentParser):
......@@ -38,7 +38,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.orbit_envs.utils.parse_cfg import load_cfg_from_registry
from omni.isaac.orbit_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")
......
......@@ -44,10 +44,10 @@ import traceback
import carb
from rsl_rl.runners import OnPolicyRunner
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import get_checkpoint_path, parse_env_cfg
from omni.isaac.orbit_envs.utils.wrappers.rsl_rl import (
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import get_checkpoint_path, parse_env_cfg
from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import (
RslRlOnPolicyRunnerCfg,
RslRlVecEnvWrapper,
export_policy_as_onnx,
......
......@@ -56,14 +56,14 @@ from datetime import datetime
import carb
from rsl_rl.runners import OnPolicyRunner
from omni.isaac.orbit.envs.rl_env_cfg import RLEnvCfg
from omni.isaac.orbit.envs import RLTaskEnvCfg
from omni.isaac.orbit.utils.dict import print_dict
from omni.isaac.orbit.utils.io import dump_pickle, dump_yaml
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import get_checkpoint_path, parse_env_cfg
from omni.isaac.orbit_envs.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import get_checkpoint_path, parse_env_cfg
from omni.isaac.orbit_tasks.utils.wrappers.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper
torch.backends.cuda.matmul.allow_tf32 = True
torch.backends.cudnn.allow_tf32 = True
......@@ -74,7 +74,7 @@ torch.backends.cudnn.benchmark = False
def main():
"""Train with RSL-RL agent."""
# parse configuration
env_cfg: RLEnvCfg = parse_env_cfg(args_cli.task, use_gpu=not args_cli.cpu, num_envs=args_cli.num_envs)
env_cfg: RLTaskEnvCfg = parse_env_cfg(args_cli.task, use_gpu=not args_cli.cpu, num_envs=args_cli.num_envs)
agent_cfg: RslRlOnPolicyRunnerCfg = cli_args.parse_rsl_rl_cfg(args_cli.task, args_cli)
# specify directory for logging experiments
......
......@@ -41,10 +41,10 @@ import carb
from stable_baselines3 import PPO
from stable_baselines3.common.vec_env import VecNormalize
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils.parse_cfg import load_cfg_from_registry, parse_env_cfg
from omni.isaac.orbit_envs.utils.wrappers.sb3 import Sb3VecEnvWrapper, process_sb3_cfg
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils.parse_cfg import load_cfg_from_registry, parse_env_cfg
from omni.isaac.orbit_tasks.utils.wrappers.sb3 import Sb3VecEnvWrapper, process_sb3_cfg
def main():
......
......@@ -57,10 +57,10 @@ from stable_baselines3.common.vec_env import VecNormalize
from omni.isaac.orbit.utils.dict import print_dict
from omni.isaac.orbit.utils.io import dump_pickle, dump_yaml
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import load_cfg_from_registry, parse_env_cfg
from omni.isaac.orbit_envs.utils.wrappers.sb3 import Sb3VecEnvWrapper, process_sb3_cfg
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import load_cfg_from_registry, parse_env_cfg
from omni.isaac.orbit_tasks.utils.wrappers.sb3 import Sb3VecEnvWrapper, process_sb3_cfg
def main():
......
......@@ -46,10 +46,10 @@ import carb
from skrl.agents.torch.ppo import PPO, PPO_DEFAULT_CONFIG
from skrl.utils.model_instantiators import deterministic_model, gaussian_model, shared_model
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import get_checkpoint_path, load_cfg_from_registry, parse_env_cfg
from omni.isaac.orbit_envs.utils.wrappers.skrl import SkrlVecEnvWrapper, process_skrl_cfg
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import get_checkpoint_path, load_cfg_from_registry, parse_env_cfg
from omni.isaac.orbit_tasks.utils.wrappers.skrl import SkrlVecEnvWrapper, process_skrl_cfg
def main():
......
......@@ -61,10 +61,10 @@ from skrl.utils.model_instantiators import deterministic_model, gaussian_model,
from omni.isaac.orbit.utils.dict import print_dict
from omni.isaac.orbit.utils.io import dump_pickle, dump_yaml
import omni.isaac.contrib_envs # noqa: F401
import omni.isaac.orbit_envs # noqa: F401
from omni.isaac.orbit_envs.utils import load_cfg_from_registry, parse_env_cfg
from omni.isaac.orbit_envs.utils.wrappers.skrl import SkrlSequentialLogTrainer, SkrlVecEnvWrapper, process_skrl_cfg
import omni.isaac.contrib_tasks # noqa: F401
import omni.isaac.orbit_tasks # noqa: F401
from omni.isaac.orbit_tasks.utils import load_cfg_from_registry, parse_env_cfg
from omni.isaac.orbit_tasks.utils.wrappers.skrl import SkrlSequentialLogTrainer, SkrlVecEnvWrapper, process_skrl_cfg
def main():
......
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