isaaclab_neural.physics#

Physics and solver configurations, and their adapters, that run newton-neural models on the Newton backend.

Classes

NeRDSolver

Isaac Lab NewtonSolver wrapper for newton-neural's standalone SolverNeRD.

MJWarpNeRDSolver

Isaac Lab MJWarpSolver subclass injecting neural free accelerations via SolverNeRDMuJoCo.

NeRDSolverCfg

Configuration for stepping a robot with newton-neural's standalone SolverNeRD.

MJWarpNeRDSolverCfg

Configuration for two-way coupling a free-motion neural model inside MuJoCo Warp (SolverNeRDMuJoCo).

Solvers#

class isaaclab_neural.physics.NeRDSolver[source]#

Bases: NewtonSolver

Isaac Lab NewtonSolver wrapper for newton-neural’s standalone SolverNeRD.

Uses the ordinary Newton manager and backend. The task declares the model frame as its physics step. Key semantics declared to Isaac Lab:

  • Imports scenes with MuJoCo USD schemas so the resulting newton.Model matches recording.

  • Uses Newton’s collision pipeline; contact sensors read penetration-based normal-force estimates.

  • Rejects IMU, PVA, and joint-wrench sensors (accelerations and reaction wrenches are not computed).

  • External body forces have no effect, and each kind of runtime model mutation emits a NewtonNeuralWarning once.

  • On CUDA, Isaac Lab captures the step into its physics-step CUDA graph (internal solver graphing disabled); any environment state write clears that world’s streaming history.

Methods:

__new__(*args, **kwargs)

__init__(cfg, model, mode[, env_template])

Build Newton's solver.

classmethod __new__(*args, **kwargs)#
__init__(cfg: NewtonSolverCfg, model: Model, mode: wp.DeterministicMode, env_template: str | None = None)[source]#

Build Newton’s solver.

Parameters:
  • cfg – Solver configuration.

  • model – Model, or coupled-entry model view, the solver advances.

  • mode – Warp determinism mode.

  • env_template – Environment path template of the clone plan, e.g. "/World/envs/env_{}".

class isaaclab_neural.physics.MJWarpNeRDSolver[source]#

Bases: MJWarpSolver

Isaac Lab MJWarpSolver subclass injecting neural free accelerations via SolverNeRDMuJoCo.

Preserves all MuJoCo Warp contacts, sensors, resets, and solver options. Post-startup edits to robot masses or gains reach MuJoCo Warp but not the neural weights (each kind emits a NewtonNeuralWarning once). On CUDA, Isaac Lab captures the combined step into its physics-step graph (internal solver graphing disabled).

Methods:

__new__(*args, **kwargs)

__init__(cfg, model, mode[, env_template])

Build Newton's solver.

classmethod __new__(*args, **kwargs)#
__init__(cfg: NewtonSolverCfg, model: Model, mode: wp.DeterministicMode, env_template: str | None = None)[source]#

Build Newton’s solver.

Parameters:
  • cfg – Solver configuration.

  • model – Model, or coupled-entry model view, the solver advances.

  • mode – Warp determinism mode.

  • env_template – Environment path template of the clone plan, e.g. "/World/envs/env_{}".

Solver Configuration#

class isaaclab_neural.physics.NeRDSolverCfg[source]#

Bases: NewtonSolverCfg

Configuration for stepping a robot with newton-neural’s standalone SolverNeRD.

Use it as the solver of an ordinary NewtonCfg. Each solver step must match the checkpoint’s frame duration. For a model trained on one task control period, declare that period as sim.dt, set decimation=1 and num_substeps=1. The native solver rejects a mismatched timestep.

Example

replace(
    newton_mjwarp,
    solver_cfg=NeRDSolverCfg(checkpoint="anymal_c.pt", articulation="{ENV_REGEX_NS}/Robot"),
    num_substeps=1,
)

Attributes:

class_type

Solver adapter class wrapping newton_neural.solvers.SolverNeRD.

checkpoint

Path to the saved state-increment model checkpoint.

articulation

Robot prim path regex (e.g., "{ENV_REGEX_NS}/Robot") matching Newton articulation labels from start.

solver_type

Solver type metadata (deprecated).

precision

Optional inference precision override ("fp32", "tf32", "fp16", "bf16"; checkpoint default).

compile

Optional torch.compile toggle (defaults to True on CUDA where Triton is installed).

Methods:

validate_config()

Raise ValueError if checkpoint is empty or does not exist, with training instructions.

class_type: type[NeRDSolver] | str#

Solver adapter class wrapping newton_neural.solvers.SolverNeRD.

checkpoint: str#

Path to the saved state-increment model checkpoint.

A shared physics declaration leaves it empty, and a task that has a model sets it. Validation rejects an empty path, so a task without a model does not offer the preset as runnable.

articulation: str#

Robot prim path regex (e.g., "{ENV_REGEX_NS}/Robot") matching Newton articulation labels from start.

solver_type: str#

Solver type metadata (deprecated).

Deprecated since version Solver: dispatch is driven by the configuration class; this field is retained as metadata for logging and debugging only. Do not branch on solver_type in new code.

precision: str | None#

Optional inference precision override ("fp32", "tf32", "fp16", "bf16"; checkpoint default).

compile: bool | None#

Optional torch.compile toggle (defaults to True on CUDA where Triton is installed).

torch.compile needs Triton for CUDA, and PyTorch installs it on Linux only. Elsewhere, such as on Windows, the default is False: the model runs slower and is otherwise equivalent.

validate_config() → None[source]#

Raise ValueError if checkpoint is empty or does not exist, with training instructions.

class isaaclab_neural.physics.MJWarpNeRDSolverCfg[source]#

Bases: MJWarpSolverCfg

Configuration for two-way coupling a free-motion neural model inside MuJoCo Warp (SolverNeRDMuJoCo).

Inherits all MJWarpSolverCfg fields; sim.dt / num_substeps must match the checkpoint’s frame_dt.

Attributes:

class_type

Solver adapter class wrapping newton_neural.solvers.SolverNeRDMuJoCo.

checkpoint

Path to the saved free-motion model checkpoint.

articulation

Robot prim path regex (e.g., "{ENV_REGEX_NS}/Robot") matching Newton articulation labels from start.

solver_type

Solver type.

njmax

Number of constraints per environment (world).

nconmax

Number of contact points per environment (world).

iterations

Number of solver iterations.

ls_iterations

Number of line search iterations for the solver.

solver

Solver type.

integrator

Integrator type.

use_mujoco_cpu

Whether to use the pure MuJoCo backend instead of mujoco_warp.

disable_contacts

Whether to disable contact computation in MuJoCo.

disable_sensors

Whether to disable MuJoCo Warp's internal sensor computation.

default_actuator_gear

Default gear ratio for all actuators.

actuator_gears

Dictionary mapping joint names to specific gear ratios, overriding the default_actuator_gear.

update_data_interval

Frequency (in solver substeps) at which to update the MuJoCo Data object from the Newton state.

save_to_mjcf

Optional path to save the generated MJCF model file.

impratio

Frictional-to-normal constraint impedance ratio.

cone

The type of contact friction cone.

ccd_iterations

Maximum iterations for convex collision detection (GJK/EPA).

enable_multiccd

Whether to enable multiple-contact convex collision detection.

ls_parallel

Deprecated parallel line search option.

use_mujoco_contacts

Whether to use MuJoCo's internal contact solver.

tolerance

Solver convergence tolerance for the constraint residual.

precision

Optional inference precision override ("fp32", "tf32", "fp16", "bf16"; checkpoint default).

compile

Optional torch.compile toggle (defaults to True on CUDA where Triton is installed).

Methods:

validate_config()

Raise ValueError if checkpoint is empty or does not exist, with training instructions.

from_mjwarp(mujoco, **settings)

Copy all settings from mujoco (excluding class_type) and apply settings overrides.

class_type: type[MJWarpNeRDSolver] | str#

Solver adapter class wrapping newton_neural.solvers.SolverNeRDMuJoCo.

checkpoint: str#

Path to the saved free-motion model checkpoint.

A shared physics declaration leaves it empty, and a task that has a model sets it. Validation rejects an empty path, so a task without a model does not offer the preset as runnable.

articulation: str#

Robot prim path regex (e.g., "{ENV_REGEX_NS}/Robot") matching Newton articulation labels from start.

solver_type: str#

Solver type. Can be “mujoco_warp”.

njmax: int#

Number of constraints per environment (world).

nconmax: int | None#

Number of contact points per environment (world).

iterations: int#

Number of solver iterations.

ls_iterations: int#

Number of line search iterations for the solver.

solver: str#

Solver type. Can be “cg” or “newton”, or their corresponding MuJoCo integer constants.

integrator: str#

Integrator type. Can be “euler”, “rk4”, or “implicitfast”, or their corresponding MuJoCo integer constants.

use_mujoco_cpu: bool#

Whether to use the pure MuJoCo backend instead of mujoco_warp.

disable_contacts: bool#

Whether to disable contact computation in MuJoCo.

disable_sensors: bool#

Whether to disable MuJoCo Warp’s internal sensor computation.

A determinism guarantee (NewtonCfg.deterministic_mode) disables it automatically. Isaac Lab sensors use Newton state directly and do not depend on MuJoCo Warp’s internal sensor data.

default_actuator_gear: float | None#

Default gear ratio for all actuators.

actuator_gears: dict[str, float] | None#

Dictionary mapping joint names to specific gear ratios, overriding the default_actuator_gear.

update_data_interval: int#

Frequency (in solver substeps) at which to update the MuJoCo Data object from the Newton state.

If 0, periodic state imports are disabled after initialization. With MuJoCo Warp, authored state writes that flag the manager’s reset mask are still synchronized for the affected worlds at the next forward or physics-step boundary, independently of this interval. The native MuJoCo CPU backend only synchronizes template world 0 when it is flagged.

save_to_mjcf: str | None#

Optional path to save the generated MJCF model file.

If None, the MJCF model is not saved.

impratio: float#

Frictional-to-normal constraint impedance ratio.

cone: str#

The type of contact friction cone. Can be “pyramidal” or “elliptic”.

ccd_iterations: int#

Maximum iterations for convex collision detection (GJK/EPA).

Increase this if you see warnings about opt.ccd_iterations needing to be increased, which typically occurs with complex collision geometries (e.g. multi-finger hands).

enable_multiccd: bool#

Whether to enable multiple-contact convex collision detection. Defaults to False.

With use_mujoco_contacts enabled, supported convex geometry pairs can generate a contact manifold (several points across a touching surface) instead of a single point. This can improve stability for flat mesh contacts in stacking and grasping. It does not enable continuous collision detection or prevent tunneling between simulation steps.

MuJoCo Warp’s supported pairs and contact-margin restrictions differ from MuJoCo CPU. Primitive colliders can already produce multiple contacts with this option disabled. Additional contacts can increase solver work and the required nconmax and njmax capacities. See MuJoCo’s multiple-contact documentation.

ls_parallel: bool#

Deprecated parallel line search option.

Setting this to True emits a DeprecationWarning and is ignored. MuJoCo Warp is dropping support for parallel line search; Isaac Lab uses iterative line search for performance.

use_mujoco_contacts: bool#

Whether to use MuJoCo’s internal contact solver.

If True (default), MuJoCo handles collision detection and contact resolution internally. If False, Newton’s CollisionPipeline is used instead. A default pipeline (broad_phase="explicit") is created automatically when NewtonCfg.collision_cfg is None. Set NewtonCfg.collision_cfg to a NewtonCollisionPipelineCfg to customize pipeline parameters (broad phase, contact limits, hydroelastic, etc.).

Note

Setting collision_cfg while use_mujoco_contacts=True raises ValueError because the two collision modes are mutually exclusive.

tolerance: float#

Solver convergence tolerance for the constraint residual.

The solver iterates until the residual drops below this threshold or iterations is reached. Lower values give more precise constraint satisfaction at the cost of more iterations. MuJoCo default is 1e-8; Newton default is 1e-6.

precision: str | None#

Optional inference precision override ("fp32", "tf32", "fp16", "bf16"; checkpoint default).

compile: bool | None#

Optional torch.compile toggle (defaults to True on CUDA where Triton is installed).

torch.compile needs Triton for CUDA, and PyTorch installs it on Linux only. Elsewhere, such as on Windows, the default is False: the model runs slower and is otherwise equivalent.

validate_config() → None[source]#

Raise ValueError if checkpoint is empty or does not exist, with training instructions.

classmethod from_mjwarp(mujoco: MJWarpSolverCfg, **settings: Any) → Self[source]#

Copy all settings from mujoco (excluding class_type) and apply settings overrides.