|
| 1 | +.. _backends-and-presets: |
| 2 | + |
| 3 | +Backends and Presets |
| 4 | +==================== |
| 5 | + |
| 6 | +An Isaac Lab environment describes the robot, scene, sensors, and task. A |
| 7 | +**backend** supplies the physics or rendering implementation that brings that |
| 8 | +description to life. A **preset** is a named, tested configuration choice that |
| 9 | +lets you switch implementations or task modes without editing Python. |
| 10 | + |
| 11 | +In practice, the same environment can run with a different physics engine, |
| 12 | +renderer, or observation mode by adding a short selector: |
| 13 | + |
| 14 | +.. code-block:: bash |
| 15 | +
|
| 16 | + uv run isaaclab train --rl_library rsl_rl \ |
| 17 | + --task Isaac-Cartpole-Direct physics=newton_mjwarp |
| 18 | +
|
| 19 | +The task stays ``Isaac-Cartpole-Direct``. The preset changes the configuration |
| 20 | +used to launch it. |
| 21 | + |
| 22 | + |
| 23 | +The mental model |
| 24 | +---------------- |
| 25 | + |
| 26 | +Think of an environment as the experiment and presets as the knobs that select |
| 27 | +tested versions of its larger building blocks: |
| 28 | + |
| 29 | +.. code-block:: text |
| 30 | +
|
| 31 | + Environment |
| 32 | + ├── physics=... Which physics configuration runs the simulation? |
| 33 | + ├── renderer=... Which renderer produces camera data? |
| 34 | + └── presets=... Which task-specific mode or config bundle is used? |
| 35 | +
|
| 36 | +After configuration is resolved, Isaac Lab's common asset, sensor, and scene |
| 37 | +APIs dispatch to the selected backend implementation. Environment code can use |
| 38 | +the same public API across PhysX, Newton, and OvPhysX instead of branching on |
| 39 | +the active engine throughout the task. |
| 40 | + |
| 41 | +Physics, rendering, and visualization are separate choices. For example, a |
| 42 | +camera environment can use Newton physics with the Newton Warp renderer, while |
| 43 | +the visualizer is selected independently with ``--viz``. |
| 44 | + |
| 45 | + |
| 46 | +Find what a task supports |
| 47 | +------------------------- |
| 48 | + |
| 49 | +Preset support is task-specific. Before choosing a name, ask the task what it |
| 50 | +offers: |
| 51 | + |
| 52 | +.. code-block:: bash |
| 53 | +
|
| 54 | + uv run isaaclab train --rl_library rsl_rl \ |
| 55 | + --task Isaac-Cartpole-Camera-Direct --help |
| 56 | +
|
| 57 | +The help output groups names by ``physics=``, ``renderer=``, and ``presets=``. |
| 58 | +To browse all registered environments and their presets at once, run: |
| 59 | + |
| 60 | +.. code-block:: bash |
| 61 | +
|
| 62 | + uv run python scripts/environments/list_envs.py --show_presets |
| 63 | +
|
| 64 | +An empty preset list is not an error. It means that the environment uses its |
| 65 | +registered default configuration and does not expose alternatives. Passing a |
| 66 | +name that a task does not list is unsupported and fails during configuration |
| 67 | +validation. |
| 68 | + |
| 69 | + |
| 70 | +Choose a selector |
| 71 | +----------------- |
| 72 | + |
| 73 | +.. list-table:: |
| 74 | + :widths: 23 32 45 |
| 75 | + :header-rows: 1 |
| 76 | + |
| 77 | + * - Selector |
| 78 | + - Example |
| 79 | + - What it changes |
| 80 | + * - ``physics=NAME`` |
| 81 | + - ``physics=newton_mjwarp`` |
| 82 | + - Selects a physics configuration, including its backend and solver. |
| 83 | + * - ``renderer=NAME`` |
| 84 | + - ``renderer=newton_renderer`` |
| 85 | + - Selects a renderer configuration for tasks that produce camera data. |
| 86 | + * - ``presets=NAME[,NAME,...]`` |
| 87 | + - ``presets=rgb`` |
| 88 | + - Applies task-specific choices such as observation modes, camera layouts, |
| 89 | + or compatible configuration bundles. |
| 90 | + |
| 91 | +These are Hydra tokens, so append them without leading dashes. They work with |
| 92 | +training, playback, and environment scripts that use Isaac Lab's task |
| 93 | +configuration launcher. |
| 94 | + |
| 95 | +Selectors can be combined. This command chooses Newton with the MuJoCo-Warp |
| 96 | +solver, the Newton Warp renderer, and RGB observations: |
| 97 | + |
| 98 | +.. code-block:: bash |
| 99 | +
|
| 100 | + uv run isaaclab train --rl_library rsl_rl \ |
| 101 | + --task Isaac-Cartpole-Camera-Direct \ |
| 102 | + physics=newton_mjwarp renderer=newton_renderer presets=rgb |
| 103 | +
|
| 104 | +Only combine values listed for the task. Some physics, renderer, sensor, and |
| 105 | +observation configurations are incompatible, and the task may reject an |
| 106 | +invalid combination with a focused error message. |
| 107 | + |
| 108 | + |
| 109 | +Common backend choices |
| 110 | +---------------------- |
| 111 | + |
| 112 | +The exact list depends on the environment, but these names follow shared |
| 113 | +conventions: |
| 114 | + |
| 115 | +.. list-table:: Physics presets |
| 116 | + :widths: 30 70 |
| 117 | + :header-rows: 1 |
| 118 | + |
| 119 | + * - Name |
| 120 | + - Meaning |
| 121 | + * - ``isaacsim_physx`` |
| 122 | + - Concrete Isaac Sim PhysX configuration. This is the default for tasks |
| 123 | + whose established default is Isaac Sim PhysX. |
| 124 | + * - ``physx`` |
| 125 | + - Automatic PhysX-family selection. Isaac Sim PhysX is used when the |
| 126 | + runtime needs Kit; a configured OvPhysX alternative can be used for |
| 127 | + fully kit-less runs. |
| 128 | + * - ``newton_mjwarp`` |
| 129 | + - Newton physics with the MuJoCo-Warp solver. |
| 130 | + * - ``newton_kamino`` |
| 131 | + - Newton physics with the Kamino solver. Support is beta and currently |
| 132 | + limited to selected tasks and compatible assets. |
| 133 | + * - ``ovphysx`` |
| 134 | + - Concrete OvPhysX configuration for supported kit-less tasks. |
| 135 | + |
| 136 | +.. list-table:: Renderer presets |
| 137 | + :widths: 30 70 |
| 138 | + :header-rows: 1 |
| 139 | + |
| 140 | + * - Name |
| 141 | + - Meaning |
| 142 | + * - ``isaacsim_rtx`` |
| 143 | + - Concrete Isaac Sim RTX renderer and the established default for |
| 144 | + multi-backend camera tasks. |
| 145 | + * - ``rtx`` |
| 146 | + - Automatic RTX-family selection based on the resolved runtime. |
| 147 | + * - ``newton_renderer`` |
| 148 | + - Newton Warp renderer. |
| 149 | + * - ``ovrtx`` |
| 150 | + - Concrete OVRTX renderer. |
| 151 | + |
| 152 | +Automatic selectors such as ``physics=physx`` and ``renderer=rtx`` are opt-in. |
| 153 | +Defaults are concrete so that running a task without selectors is predictable. |
| 154 | +A solver is not a separate backend: ``newton_mjwarp`` and ``newton_kamino`` |
| 155 | +both use Newton but configure different solvers. |
| 156 | + |
| 157 | + |
| 158 | +Defaults, presets, and fine-tuning |
| 159 | +---------------------------------- |
| 160 | + |
| 161 | +A preset replaces the complete configuration section at its location; it does |
| 162 | +not merge fields from two alternatives. Isaac Lab resolves configuration in |
| 163 | +this order: |
| 164 | + |
| 165 | +1. Apply each preset config's ``default`` choice. |
| 166 | +2. Apply global choices from ``presets=...``. |
| 167 | +3. Apply a preset targeted at a specific path, such as |
| 168 | + ``env.sim.physics=newton_mjwarp``. |
| 169 | +4. Apply scalar Hydra overrides, such as ``env.sim.dt=0.002``. |
| 170 | + |
| 171 | +The last step makes it easy to start from a maintained preset and tune one |
| 172 | +value: |
| 173 | + |
| 174 | +.. code-block:: bash |
| 175 | +
|
| 176 | + uv run isaaclab train --rl_library rsl_rl \ |
| 177 | + --task Isaac-Cartpole-Direct \ |
| 178 | + physics=newton_mjwarp env.sim.dt=0.002 |
| 179 | +
|
| 180 | +Prefer ``physics=`` and ``renderer=`` for backend choices because they state |
| 181 | +intent clearly. Use ``presets=`` for task-specific modes or when one name must |
| 182 | +update several matching sections together. Use a path selector only when you |
| 183 | +intend to replace one particular section. |
| 184 | + |
| 185 | +.. important:: |
| 186 | + |
| 187 | + Keep behavior-changing presets the same when loading a checkpoint. An |
| 188 | + observation preset can change tensor shapes, and a policy trained with one |
| 189 | + observation mode may not load with another. |
| 190 | + |
| 191 | + |
| 192 | +How task authors expose choices |
| 193 | +------------------------------- |
| 194 | + |
| 195 | +Task authors define alternatives with |
| 196 | +:class:`~isaaclab_tasks.utils.hydra.PresetCfg` and choose one as the default. |
| 197 | +For a multi-backend task, the preset wrapper belongs in |
| 198 | +:class:`~isaaclab.sim.SimulationCfg`: |
| 199 | + |
| 200 | +.. code-block:: python |
| 201 | +
|
| 202 | + from isaaclab.physics import PhysxAutoCfg |
| 203 | + from isaaclab.sim import SimulationCfg |
| 204 | + from isaaclab.utils.configclass import configclass |
| 205 | + from isaaclab_newton.physics import MJWarpSolverCfg, NewtonCfg |
| 206 | + from isaaclab_ovphysx.physics import OvPhysxCfg |
| 207 | + from isaaclab_physx.physics import PhysxCfg |
| 208 | + from isaaclab_tasks.utils import PresetCfg |
| 209 | +
|
| 210 | +
|
| 211 | + @configclass |
| 212 | + class PhysicsCfg(PresetCfg): |
| 213 | + isaacsim_physx = PhysxCfg() |
| 214 | + ovphysx = OvPhysxCfg() |
| 215 | + physx = PhysxAutoCfg( |
| 216 | + isaacsim_physx=isaacsim_physx, |
| 217 | + ovphysx=ovphysx, |
| 218 | + ) |
| 219 | + default = isaacsim_physx |
| 220 | + newton_mjwarp = NewtonCfg(solver_cfg=MJWarpSolverCfg()) |
| 221 | +
|
| 222 | +
|
| 223 | + @configclass |
| 224 | + class MyEnvCfg: |
| 225 | + sim: SimulationCfg = SimulationCfg(physics=PhysicsCfg()) |
| 226 | +
|
| 227 | +Keep backend-specific values inside named configurations whenever possible. |
| 228 | +This keeps task logic shared and makes every supported choice visible from the |
| 229 | +command line. |
| 230 | + |
| 231 | + |
| 232 | +Where to go next |
| 233 | +---------------- |
| 234 | + |
| 235 | +- :doc:`/source/overview/environments` lists environments and their supported |
| 236 | + presets. |
| 237 | +- :doc:`/source/features/hydra` covers scalar overrides, preset authoring, |
| 238 | + conflict handling, and advanced configuration behavior. |
| 239 | +- :doc:`/source/overview/core-concepts/multi_backend_architecture` explains how |
| 240 | + factories, the physics manager, assets, and sensors dispatch across backends. |
| 241 | +- :doc:`/source/overview/core-concepts/physical-backends/index` compares physics |
| 242 | + backend capabilities and links to backend-specific setup guides. |
| 243 | +- :doc:`/source/overview/core-concepts/renderers` explains renderer selection and |
| 244 | + implementation details. |
0 commit comments