Skip to content

Latest commit

 

History

History
193 lines (116 loc) · 6.53 KB

skrl.envs.isaac_gym.rst

File metadata and controls

193 lines (116 loc) · 6.53 KB

Isaac Gym environments

Omniverse Isaac Gym environments


Environments (preview 4)

The repository https://github.com/NVIDIA-Omniverse/IsaacGymEnvs provides the example reinforcement learning environments for Isaac Gym (preview 4)

With the release of Isaac Gym (preview 4), NVIDIA developers provide an easy-to-use API for creating/loading preset vectorized environments (see creating-an-environment)

Easy-to-use API from NVIDIA

import isaacgymenvs

env = isaacgymenvs.make(seed=0,
                        task="Cartpole",
                        num_envs=2000,
                        sim_device="cuda:0",
                        rl_device="cuda:0",
                        graphics_device_id=0,
                        headless=False)

Nevertheless, in order to maintain the loading style of previous versions, skrl provides its own implementation for loading such environments. The environments can be easily loaded and configured by calling a single function provided with this library. This function also makes it possible to configure the environment from the command line arguments (see configuration-and-command-line-arguments) or from its parameters as a python dictionary

Note

Only the configuration related to the environment will be used. The configuration related to RL algorithms are discarded since they do not belong to this library

Note

Isaac Gym environments implement a functionality to get their configuration from the command line. Setting the headless option from the trainer configuration will not work. In this case, it is necessary to invoke the scripts as follows: python script.py headless=True

Basic usage

Function parameters

# import the environment loader
from skrl.envs.torch import load_isaacgym_env_preview4

# load environment
env = load_isaacgym_env_preview4(task_name="Cartpole")

Command line arguments (priority)

# import the environment loader
from skrl.envs.torch import load_isaacgym_env_preview4

# load environment
env = load_isaacgym_env_preview4()

Run the main script passing the configuration as command line arguments. For example:

python main.py task=Cartpole

API

skrl.envs.torch.loaders.load_isaacgym_env_preview4


Environments (preview 3)

The repository https://github.com/NVIDIA-Omniverse/IsaacGymEnvs provides the example reinforcement learning environments for Isaac Gym (preview 3)

These environments can be easily loaded and configured by calling a single function provided with this library. This function also makes it possible to configure the environment from the command line arguments (see configuration-and-command-line-arguments) or from its parameters as a python dictionary

Note

Only the configuration related to the environment will be used. The configuration related to RL algorithms are discarded since they do not belong to this library

Note

Isaac Gym environments implement a functionality to get their configuration from the command line. Setting the headless option from the trainer configuration will not work. In this case, it is necessary to invoke the scripts as follows: python script.py headless=True

Basic usage

Function parameters

# import the environment loader
from skrl.envs.torch import load_isaacgym_env_preview3

# load environment
env = load_isaacgym_env_preview3(task_name="Cartpole")

Command line arguments (priority)

# import the environment loader
from skrl.envs.torch import load_isaacgym_env_preview3

# load environment
env = load_isaacgym_env_preview3()

Run the main script passing the configuration as command line arguments. For example:

python main.py task=Cartpole

API

skrl.envs.torch.loaders.load_isaacgym_env_preview3


Environments (preview 2)

The example reinforcement learning environments for Isaac Gym (preview 2) are located within the same package (in the python/rlgpu directory)

These environments can be easily loaded and configured by calling a single function provided with this library. This function also makes it possible to configure the environment from the command line arguments or from its parameters as a python dictionary

Note

Isaac Gym environments implement a functionality to get their configuration from the command line. Setting the headless option from the trainer configuration will not work. In this case, it is necessary to invoke the scripts as follows: python script.py --headless

Basic usage

Function parameters

# import the environment loader
from skrl.envs.torch import load_isaacgym_env_preview2

# load environment
env = load_isaacgym_env_preview2(task_name="Cartpole")

Command line arguments (priority)

# import the environment loader
from skrl.envs.torch import load_isaacgym_env_preview2

# load environment
env = load_isaacgym_env_preview2()

Run the main script passing the configuration as command line arguments. For example:

python main.py --task Cartpole

API

skrl.envs.torch.loaders.load_isaacgym_env_preview2