Isaac Lab environments¶
Overview¶
The repository https://github.com/isaac-sim/IsaacLab provides the example reinforcement learning environments for Isaac Lab (Orbit and Omniverse Isaac Gym unification).
These environments can be easily loaded and configured by calling a single function provided with this library. Such function also makes it possible to configure the environment from the command line arguments or from its parameters.
Note
The command line arguments has priority over the function parameters.
Note
Isaac Lab 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 set the load function’s headless argument to True
or to invoke the scripts as follows: isaaclab -p script.py --headless.
Usage¶
The following snippets show how to load Isaac Lab environments:
# import the environment loader
from skrl.envs.loaders.torch import load_isaaclab_env
# load environment
env = load_isaaclab_env(task_name="Isaac-Cartpole-v0")
# import the environment loader
from skrl.envs.loaders.jax import load_isaaclab_env
# load environment
env = load_isaaclab_env(task_name="Isaac-Cartpole-v0")
# import the environment loader
from skrl.envs.loaders.warp import load_isaaclab_env
# load environment
env = load_isaaclab_env(task_name="Isaac-Cartpole-v0")
# import the environment loader
from skrl.envs.loaders.torch import load_isaaclab_env
# load environment
env = load_isaaclab_env()
# import the environment loader
from skrl.envs.loaders.jax import load_isaaclab_env
# load environment
env = load_isaaclab_env()
# import the environment loader
from skrl.envs.loaders.warp import load_isaaclab_env
# load environment
env = load_isaaclab_env()
Run the main script passing the configuration as command line arguments. For example:
isaaclab -p main.py --task Isaac-Cartpole-v0
API¶
PyTorch¶
- skrl.envs.loaders.torch.load_isaaclab_env(*, task_name: str = '', num_envs: int | None = None, headless: bool | None = None, cli_args: list[str] = [], show_cfg: bool = True, parser: ArgumentParser | None = None)[source]¶
Load an Isaac Lab environment.
Isaac Lab: https://isaac-sim.github.io/IsaacLab
This function includes the definition and parsing of command line arguments used by Isaac Lab:
--num_envs: Number of environments to simulate--task: Name of the task--seed: Seed used for the environment--disable_fabric: Disable fabric and use USD I/O operations.--distributed: Run training with multiple GPUs or nodes
- Parameters:
task_name – The name of the task. 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 specifiednum_envs – Number of parallel environments to create. If not specified, the default number of environments defined in the task configuration is used. Command line argument has priority over function parameter if both are specified
headless – Whether to use headless mode (no rendering). If not specified, the default task configuration is used. Command line argument has priority over function parameter if both are specified
cli_args – Isaac Lab configuration and command line arguments.
show_cfg – Whether to print the configuration.
parser – The argument parser to use. If not specified, a new argument parser will be created.
- Returns:
Isaac Lab environment.
- Raises:
ValueError – The task name has not been defined, neither by the function parameter nor by the command line arguments.
JAX¶
- skrl.envs.loaders.jax.load_isaaclab_env(*, task_name: str = '', num_envs: int | None = None, headless: bool | None = None, cli_args: list[str] = [], show_cfg: bool = True, parser: ArgumentParser | None = None)[source]¶
Load an Isaac Lab environment.
Isaac Lab: https://isaac-sim.github.io/IsaacLab
This function includes the definition and parsing of command line arguments used by Isaac Lab:
--num_envs: Number of environments to simulate--task: Name of the task--seed: Seed used for the environment--disable_fabric: Disable fabric and use USD I/O operations.--distributed: Run training with multiple GPUs or nodes
- Parameters:
task_name – The name of the task. 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 specifiednum_envs – Number of parallel environments to create. If not specified, the default number of environments defined in the task configuration is used. Command line argument has priority over function parameter if both are specified
headless – Whether to use headless mode (no rendering). If not specified, the default task configuration is used. Command line argument has priority over function parameter if both are specified
cli_args – Isaac Lab configuration and command line arguments.
show_cfg – Whether to print the configuration.
parser – The argument parser to use. If not specified, a new argument parser will be created.
- Returns:
Isaac Lab environment.
- Raises:
ValueError – The task name has not been defined, neither by the function parameter nor by the command line arguments.
Warp¶
- skrl.envs.loaders.warp.load_isaaclab_env(*, task_name: str = '', num_envs: int | None = None, headless: bool | None = None, cli_args: list[str] = [], show_cfg: bool = True, parser: ArgumentParser | None = None)[source]¶
Load an Isaac Lab environment.
Isaac Lab: https://isaac-sim.github.io/IsaacLab
This function includes the definition and parsing of command line arguments used by Isaac Lab:
--num_envs: Number of environments to simulate--task: Name of the task--seed: Seed used for the environment--disable_fabric: Disable fabric and use USD I/O operations.--distributed: Run training with multiple GPUs or nodes
- Parameters:
task_name – The name of the task. 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 specifiednum_envs – Number of parallel environments to create. If not specified, the default number of environments defined in the task configuration is used. Command line argument has priority over function parameter if both are specified
headless – Whether to use headless mode (no rendering). If not specified, the default task configuration is used. Command line argument has priority over function parameter if both are specified
cli_args – Isaac Lab configuration and command line arguments.
show_cfg – Whether to print the configuration.
parser – The argument parser to use. If not specified, a new argument parser will be created.
- Returns:
Isaac Lab environment.
- Raises:
ValueError – The task name has not been defined, neither by the function parameter nor by the command line arguments.