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)

1import isaacgymenvs
2
3env = isaacgymenvs.make(seed=0,
4                        task="Cartpole",
5                        num_envs=2000,
6                        sim_device="cuda:0",
7                        rl_device="cuda:0",
8                        graphics_device_id=0,
9                        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

1# import the environment loader
2from skrl.envs.torch import load_isaacgym_env_preview4
3
4# load environment
5env = load_isaacgym_env_preview4(task_name="Cartpole")

API

skrl.envs.torch.loaders.load_isaacgym_env_preview4(task_name: str = '', isaacgymenvs_path: str = '', show_cfg: bool = True)

Load an Isaac Gym environment (preview 4)

Isaac Gym benchmark environments: https://github.com/NVIDIA-Omniverse/IsaacGymEnvs

Parameters
  • task_name (str, optional) – The name of the task (default: “”). If not specified, the task name is taken from the command line argument (task=TASK_NAME). Command line argument has priority over function parameter if both are specified

  • isaacgymenvs_path (str, optional) – The path to the isaacgymenvs directory (default: “”). If empty, the path will obtained from isaacgymenvs package metadata

  • show_cfg (bool, optional) – Whether to print the configuration (default: True)

Raises
  • ValueError – The task name has not been defined, neither by the function parameter nor by the command line arguments

  • RuntimeError – The isaacgymenvs package is not installed or the path is wrong

Returns

Isaac Gym environment (preview 4)

Return type

isaacgymenvs.tasks.base.vec_task.VecTask


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

1# import the environment loader
2from skrl.envs.torch import load_isaacgym_env_preview3
3
4# load environment
5env = load_isaacgym_env_preview3(task_name="Cartpole")

API

skrl.envs.torch.loaders.load_isaacgym_env_preview3(task_name: str = '', isaacgymenvs_path: str = '', show_cfg: bool = True)

Load an Isaac Gym environment (preview 3)

Isaac Gym benchmark environments: https://github.com/NVIDIA-Omniverse/IsaacGymEnvs

Parameters
  • task_name (str, optional) – The name of the task (default: “”). If not specified, the task name is taken from the command line argument (task=TASK_NAME). Command line argument has priority over function parameter if both are specified

  • isaacgymenvs_path (str, optional) – The path to the isaacgymenvs directory (default: “”). If empty, the path will obtained from isaacgymenvs package metadata

  • show_cfg (bool, optional) – Whether to print the configuration (default: True)

Raises
  • ValueError – The task name has not been defined, neither by the function parameter nor by the command line arguments

  • RuntimeError – The isaacgymenvs package is not installed or the path is wrong

Returns

Isaac Gym environment (preview 3)

Return type

isaacgymenvs.tasks.base.vec_task.VecTask


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

1# import the environment loader
2from skrl.envs.torch import load_isaacgym_env_preview2
3
4# load environment
5env = load_isaacgym_env_preview2(task_name="Cartpole")

API

skrl.envs.torch.loaders.load_isaacgym_env_preview2(task_name: str = '', isaacgymenvs_path: str = '', show_cfg: bool = True)

Load an Isaac Gym environment (preview 2)

Parameters
  • task_name (str, optional) – The name of the task (default: “”). If not specified, the task name is taken from the command line argument (--task TASK_NAME). Command line argument has priority over function parameter if both are specified

  • isaacgymenvs_path (str, optional) – The path to the rlgpu directory (default: “”). If empty, the path will obtained from isaacgym package metadata

  • show_cfg (bool, optional) – Whether to print the configuration (default: True)

Raises
  • ValueError – The task name has not been defined, neither by the function parameter nor by the command line arguments

  • RuntimeError – The isaacgym package is not installed or the path is wrong

Returns

Isaac Gym environment (preview 2)

Return type

tasks.base.vec_task.VecTask