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 run headless by default.
To open a viewer, set the load function’s visualizer argument (e.g.: "kit", "newton_gl")
or invoke the scripts as follows: python script.py --viz newton_gl.
Physics and rendering backends¶
Isaac Lab supports multiple physics and rendering backends. They can be selected via the load function’s
physics, renderer and presets arguments, or via Hydra-style command line selectors.
Available backends depend on the task. Isaac Sim (Kit) is only launched if the selected configuration requires it.
See Isaac Lab documentation for more details.
Command line selector |
Function parameter |
Values |
|---|---|---|
|
|
|
|
|
|
|
|
Task-specific configuration preset(s) |
Run the main script with --task <task_name> --help to see the selectors supported by a given task.
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", physics="newton_mjwarp")
# import the environment loader
from skrl.envs.loaders.jax import load_isaaclab_env
# load environment
env = load_isaaclab_env(task_name="Isaac-Cartpole", physics="newton_mjwarp")
# import the environment loader
from skrl.envs.loaders.warp import load_isaaclab_env
# load environment
env = load_isaaclab_env(task_name="Isaac-Cartpole", physics="newton_mjwarp")
# 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:
python main.py --task Isaac-Cartpole physics=newton_mjwarp
API¶
PyTorch¶
- skrl.envs.loaders.torch.load_isaaclab_env(*, task_name: str = '', num_envs: int | None = None, physics: str | None = None, renderer: str | None = None, presets: str | Sequence[str] | None = None, visualizer: str | Sequence[str] | None = None, cli_args: Sequence[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 nodesIsaac Lab simulation launcher arguments (e.g.:
--device,--visualizer/--viz,--deterministic)Isaac Lab Hydra-style backend/preset selectors and overrides (e.g.:
physics=newton_mjwarp,renderer=newton_renderer,presets=NAME[,NAME,...],env.scene.num_envs=64)
The Isaac Sim (Kit) runtime is launched only if the resolved configuration requires it (e.g.:
physics=isaacsim_physx,renderer=isaacsim_rtxor--viz kit).- 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
physics – Physics backend (e.g.:
"newton_mjwarp","newton_kamino","ovphysx","isaacsim_physx"). If not specified, the default task configuration is used. Command line argument (physics=NAME) has priority over function parameter if both are specifiedrenderer – Rendering backend for camera-based tasks (e.g.:
"newton_renderer","ovrtx","isaacsim_rtx","rtx"). If not specified, the default task configuration is used. Command line argument (renderer=NAME) has priority over function parameter if both are specifiedpresets – Task-specific configuration preset name(s). If not specified, the default task configuration is used. Unlike other parameters, they are merged with the command line presets (
presets=NAME[,NAME,...]). Isaac Lab raises an error if the merged presets select conflicting alternativesvisualizer – Visualizer backend(s) to run (e.g.:
"kit","newton_gl","rerun","viser"). If not specified, the simulation runs headless. Command line argument (--visualizer/--viz) has priority over function parameter if both are specifiedcli_args – Isaac Lab configuration and command line arguments (e.g.:
["--seed", "42", "physics=ovphysx"]). They are treated as if they were specified on the command line.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:
TypeError – The
cli_argsparameter is a string instead of a sequence of strings.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, physics: str | None = None, renderer: str | None = None, presets: str | Sequence[str] | None = None, visualizer: str | Sequence[str] | None = None, cli_args: Sequence[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 nodesIsaac Lab simulation launcher arguments (e.g.:
--device,--visualizer/--viz,--deterministic)Isaac Lab Hydra-style backend/preset selectors and overrides (e.g.:
physics=newton_mjwarp,renderer=newton_renderer,presets=NAME[,NAME,...],env.scene.num_envs=64)
The Isaac Sim (Kit) runtime is launched only if the resolved configuration requires it (e.g.:
physics=isaacsim_physx,renderer=isaacsim_rtxor--viz kit).- 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
physics – Physics backend (e.g.:
"newton_mjwarp","newton_kamino","ovphysx","isaacsim_physx"). If not specified, the default task configuration is used. Command line argument (physics=NAME) has priority over function parameter if both are specifiedrenderer – Rendering backend for camera-based tasks (e.g.:
"newton_renderer","ovrtx","isaacsim_rtx","rtx"). If not specified, the default task configuration is used. Command line argument (renderer=NAME) has priority over function parameter if both are specifiedpresets – Task-specific configuration preset name(s). If not specified, the default task configuration is used. Unlike other parameters, they are merged with the command line presets (
presets=NAME[,NAME,...]). Isaac Lab raises an error if the merged presets select conflicting alternativesvisualizer – Visualizer backend(s) to run (e.g.:
"kit","newton_gl","rerun","viser"). If not specified, the simulation runs headless. Command line argument (--visualizer/--viz) has priority over function parameter if both are specifiedcli_args – Isaac Lab configuration and command line arguments (e.g.:
["--seed", "42", "physics=ovphysx"]). They are treated as if they were specified on the command line.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:
TypeError – The
cli_argsparameter is a string instead of a sequence of strings.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, physics: str | None = None, renderer: str | None = None, presets: str | Sequence[str] | None = None, visualizer: str | Sequence[str] | None = None, cli_args: Sequence[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 nodesIsaac Lab simulation launcher arguments (e.g.:
--device,--visualizer/--viz,--deterministic)Isaac Lab Hydra-style backend/preset selectors and overrides (e.g.:
physics=newton_mjwarp,renderer=newton_renderer,presets=NAME[,NAME,...],env.scene.num_envs=64)
The Isaac Sim (Kit) runtime is launched only if the resolved configuration requires it (e.g.:
physics=isaacsim_physx,renderer=isaacsim_rtxor--viz kit).- 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
physics – Physics backend (e.g.:
"newton_mjwarp","newton_kamino","ovphysx","isaacsim_physx"). If not specified, the default task configuration is used. Command line argument (physics=NAME) has priority over function parameter if both are specifiedrenderer – Rendering backend for camera-based tasks (e.g.:
"newton_renderer","ovrtx","isaacsim_rtx","rtx"). If not specified, the default task configuration is used. Command line argument (renderer=NAME) has priority over function parameter if both are specifiedpresets – Task-specific configuration preset name(s). If not specified, the default task configuration is used. Unlike other parameters, they are merged with the command line presets (
presets=NAME[,NAME,...]). Isaac Lab raises an error if the merged presets select conflicting alternativesvisualizer – Visualizer backend(s) to run (e.g.:
"kit","newton_gl","rerun","viser"). If not specified, the simulation runs headless. Command line argument (--visualizer/--viz) has priority over function parameter if both are specifiedcli_args – Isaac Lab configuration and command line arguments (e.g.:
["--seed", "42", "physics=ovphysx"]). They are treated as if they were specified on the command line.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:
TypeError – The
cli_argsparameter is a string instead of a sequence of strings.ValueError – The task name has not been defined, neither by the function parameter nor by the command line arguments.