Skip to content

Commit a6e7577

Browse files
Document Kamino solver presets (isaac-sim#5457)
# Description Document Kamino solver selection through the existing Hydra preset system. - Adds a "Backend and Solver Presets" section that explains how `newton` and `kamino` presets both use `NewtonCfg` but choose different solver configs. - Notes that Kamino is experimental and depends on assets being structured for Kamino. - Adds a brief mention from the Newton solver-transitioning page and updates the MuJoCo-Warp example to current public config APIs. Fixes: N/A ## Type of change - Documentation update ## Screenshots N/A. Documentation-only change. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension config file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
1 parent 11b8c64 commit a6e7577

2 files changed

Lines changed: 92 additions & 9 deletions

File tree

docs/source/experimental-features/newton-physics-integration/solver-transitioning.rst

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@ Solver Transitioning
22
====================
33

44
Transitioning to the Newton physics engine introduces new physics solvers that handle simulation using different numerical approaches.
5-
While Newton supports several different solvers, our initial focus for Isaac Lab is on using the MuJoCo-Warp solver from Google DeepMind.
5+
While Newton supports several different solvers, our initial focus for Isaac Lab is on using the
6+
MuJoCo-Warp solver from Google DeepMind. Isaac Lab also includes beta support for the Kamino
7+
solver on selected classic tasks. Kamino is selected through a physics preset rather than as a
8+
separate backend; see :ref:`hydra-backend-solver-presets`.
9+
10+
.. note::
11+
12+
Kamino support is experimental and currently depends on assets being structured
13+
in a way that Kamino can consume. Assets that work with MuJoCo-Warp or PhysX
14+
may still require model-structure updates before they work with Kamino.
615

716
The way the physics scene itself is defined does not change - we continue to use USD as the primary way to set basic parameters of objects and robots in the scene,
817
and for current environments, the exact same USD files used for the PhysX-based Isaac Lab are used.
@@ -12,15 +21,18 @@ What does require change is the way that some solver-specific settings are confi
1221
Tuning these parameters can have a significant impact on both simulation performance and behaviour.
1322

1423
For now, we will show an example of setting these parameters to help provide a feel for these changes.
15-
Note that the :class:`~isaaclab.sim.NewtonCfg` replaces the :class:`~isaaclab.sim.PhysxCfg` and is used to set everything related to the physical simulation parameters except for the ``dt``:
24+
Note that the :class:`~isaaclab_newton.physics.NewtonCfg` replaces
25+
:class:`~isaaclab_physx.physics.PhysxCfg` and is used to set everything related to the physical
26+
simulation parameters except for the ``dt``:
1627

1728
.. code-block:: python
1829
19-
from isaaclab.sim._impl.newton_manager_cfg import NewtonCfg
20-
from isaaclab.sim._impl.solvers_cfg import MJWarpSolverCfg
30+
from isaaclab.sim import SimulationCfg
31+
from isaaclab_newton.physics import MJWarpSolverCfg, NewtonCfg
2132
2233
solver_cfg = MJWarpSolverCfg(
23-
nefc_per_env=35,
34+
njmax=35,
35+
nconmax=20,
2436
ls_iterations=10,
2537
cone="pyramidal",
2638
ls_parallel=True,
@@ -31,14 +43,17 @@ Note that the :class:`~isaaclab.sim.NewtonCfg` replaces the :class:`~isaaclab.si
3143
num_substeps=1,
3244
debug_mode=False,
3345
)
34-
sim: SimulationCfg = SimulationCfg(dt=1 / 120, render_interval=decimation, newton_cfg=newton_cfg)
46+
sim: SimulationCfg = SimulationCfg(dt=1 / 120, render_interval=decimation, physics=newton_cfg)
3547
3648
3749
Here is a very brief explanation of some of the key parameters above:
3850

39-
* ``nefc_per_env``: This is the size of the buffer constraints we want MuJoCo warp to
40-
pre-allocate for a given environment. A large value will slow down the simulation,
41-
while a too small value may lead to some contacts being missed.
51+
* ``njmax``: This is the number of constraint rows MuJoCo-Warp pre-allocates for a
52+
given environment. A large value will slow down the simulation, while a too small
53+
value may lead to missing constraints.
54+
55+
* ``nconmax``: This is the maximum number of contact points MuJoCo-Warp pre-allocates
56+
for a given environment. Set it high enough for the expected contact count.
4257

4358
* ``ls_iterations``: The number of line searches performed by the MuJoCo Warp solver.
4459
Line searches are used to find an optimal step size, and for each solver step,

docs/source/features/hydra.rst

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,74 @@ disabled unless explicitly selected:
242242
python train.py --task=Isaac-Reach-Franka-v0 env.scene.camera=large
243243
244244
245+
.. _hydra-backend-solver-presets:
246+
247+
Backend and Solver Presets
248+
^^^^^^^^^^^^^^^^^^^^^^^^^^
249+
250+
Physics backend selection uses the same preset system. A task can define a
251+
``PresetCfg`` whose entries replace the complete physics config:
252+
253+
.. code-block:: python
254+
255+
from isaaclab.utils import configclass
256+
from isaaclab_newton.physics import KaminoSolverCfg, MJWarpSolverCfg, NewtonCfg
257+
from isaaclab_physx.physics import PhysxCfg
258+
from isaaclab_tasks.utils import PresetCfg
259+
260+
@configclass
261+
class CartpolePhysicsCfg(PresetCfg):
262+
default: PhysxCfg = PhysxCfg()
263+
physx: PhysxCfg = PhysxCfg()
264+
newton: NewtonCfg = NewtonCfg(
265+
solver_cfg=MJWarpSolverCfg(njmax=5, nconmax=3),
266+
num_substeps=1,
267+
)
268+
kamino: NewtonCfg = NewtonCfg(
269+
solver_cfg=KaminoSolverCfg(
270+
integrator="moreau",
271+
use_collision_detector=True,
272+
sparse_jacobian=True,
273+
padmm_max_iterations=100,
274+
),
275+
num_substeps=1,
276+
debug_mode=False,
277+
use_cuda_graph=True,
278+
)
279+
280+
The ``newton`` and ``kamino`` entries both select the Newton physics backend because
281+
both entries are :class:`~isaaclab_newton.physics.NewtonCfg` objects. The difference
282+
is the solver configuration: ``newton`` uses
283+
:class:`~isaaclab_newton.physics.MJWarpSolverCfg`, while ``kamino`` uses
284+
:class:`~isaaclab_newton.physics.KaminoSolverCfg`.
285+
286+
Kamino is therefore a solver preset, not a separate Isaac Lab backend. The same
287+
Newton assets, sensors, renderers, and visualizers are used after the preset is
288+
resolved. It is a Proximal Alternating Direction Method of Multipliers (P-ADMM)
289+
based solver for constrained rigid multi-body dynamics, and its Isaac Lab support
290+
is currently beta.
291+
292+
.. note::
293+
294+
Kamino support is experimental and currently depends on the asset being
295+
structured in a way that Kamino can consume. Assets that work with the
296+
MuJoCo-Warp or PhysX presets may still require model-structure updates before
297+
they work with ``presets=kamino``.
298+
299+
.. code-block:: bash
300+
301+
# Select the Kamino solver preset everywhere it is defined
302+
python train.py --task=Isaac-Cartpole-v0 presets=kamino
303+
304+
# Select the Kamino solver preset for a specific physics config path
305+
python train.py --task=Isaac-Cartpole-v0 env.sim.physics=kamino
306+
307+
The ``kamino`` preset is currently defined for ``Isaac-Cartpole-Direct-v0``,
308+
``Isaac-Ant-Direct-v0``, ``Isaac-Cartpole-v0``, and ``Isaac-Ant-v0``. Passing
309+
``presets=kamino`` to a task without a ``kamino`` preset does not enable Kamino;
310+
add and validate a task-specific preset first.
311+
312+
245313
Inline Presets with preset()
246314
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
247315

0 commit comments

Comments
 (0)