isaaclab_newton.physics#
Implementation backends for simulation interfaces.
Classes
Abstract Newton physics manager for Isaac Lab. |
|
Configuration for Newton physics manager. |
|
Allocate model and state from the matching builder; closing them leaves the builder intact. |
|
Share mutable construction data, populated before model allocation and retained across hard resets. |
|
Global soft-contact parameters applied to the finalized Newton model. |
|
Configuration for Newton collision pipeline. |
|
|
|
|
|
|
|
|
|
Newton manager specialization for the VBD solver. |
|
Default per-shape collision properties applied to all shapes in a Newton scene. |
|
Configuration for Newton solver-related parameters. |
|
|
|
Configuration for MuJoCo Warp solver-related parameters. |
|
Configuration for the Vertex Block Descent solver. |
|
An implicit integrator using eXtended Position-Based Dynamics (XPBD) for rigid and soft body simulation. |
|
A semi-implicit integrator using symplectic Euler. |
|
Internal Kamino collision-detector parameters. |
|
Global constraint stabilization parameters for Kamino. |
|
DVI forward-dynamics solver parameters for Kamino. |
|
Configuration for Kamino with the DVI forward-dynamics solver. |
|
Constrained forward-dynamics problem parameters for Kamino. |
|
Forward-kinematics reset solver parameters for Kamino. |
|
Material mixing parameters for Kamino contacts. |
|
P-ADMM forward-dynamics solver parameters for Kamino. |
|
Configuration for Kamino with the P-ADMM forward-dynamics solver. |
|
Configuration for Newton's implicit Material Point Method (MPM) solver. |
|
Configuration for SDF-based hydroelastic collision handling. |
Physics Manager#
- class isaaclab_newton.physics.NewtonManager[source]#
Bases:
PhysicsManagerAbstract Newton physics manager for Isaac Lab.
Class-level manager for physics lifecycle, solvers, contacts, sensors, replication, and CUDA graphs. Model, state, and control allocations belong to the registered native backend. Concrete subclasses (one per solver) implement
_build_solver()and may extend_initialize_contacts(),_prepare_builder_for_finalize(),_step_solver(),_supports_cuda_graph_capture(),_reset_solver_internals(),_solver_specific_clear(),_check_solver_status(), and_log_solver_debug().Subclasses are selected via
NewtonSolverCfg.class_type, whichNewtonCfg.__post_init__()propagates ontoNewtonCfg.class_typeso thatSimulationContextresolves the matching subclass automatically.Lifecycle:
initialize() -> reset() -> step()(repeated)-> close().Note
Assign shared lifecycle state through
NewtonManager, notcls. This keepsbackendand solver state visible to every consumer without shadowing the base attributes on a concrete solver subclass.Methods:
setup_deformable_body(prim, deformable_type, ...)Apply Newton's token deformable anchor schemas and sync the visual mesh geometry.
initialize(sim_context)Initialize the manager with simulation context.
reset([soft])Reset physics simulation.
forward()Update articulation kinematics without stepping physics.
Newton GL headless perspective video capture.
step()Step the physics simulation.
close()Clean up Newton physics resources.
Return the SceneDataBackend for the SceneDataProvider.
register_callback(callback, event[, order, ...])Register a callback.
Return the registered articulation views.
Check if fabric interface is enabled (not applicable for Newton).
clear()Clear all Newton-specific state (callbacks cleared by super().close()).
create_builder([up_axis, physics_cfg])Create a
ModelBuilderconfigured with default settings.cl_register_site(body_pattern, xform, *[, ...])Register a site request for injection into prototypes before replication.
Request an extended state attribute (e.g.
"body_qdd").Request an extended contact attribute (e.g.
"force").add_model_change(change)Register a model change to notify the solver.
invalidate_fk([env_mask, env_ids, ...])Mark environments as needing FK recomputation and solver reset.
invalidate_body_state([env_ids, env_mask])Mark selected maximal-coordinate body state as changed without requesting FK.
Start simulation by finalizing model and initializing state.
Import the explicitly declared clone plan into the Newton builder.
Initialize the solver and collision pipeline.
create_visual_material_writer(batches)Compile material-to-shape addresses for the active Newton model.
create_visual_shape_color_writer(asset, ...)Compile selected articulation-body shape addresses for the active Newton model.
Return the active physics model.
Get the current state.
Get the current Newton contact buffer, if the active solver exposes one.
Return the active scene data provider.
Get the next state.
Get the control object.
get_dt()Get the physics timestep.
Get the solver substep timestep.
Opt an articulation into the Newton actuator fast path.
register_post_actuator_callback(callback)Append a hook to the list invoked after the actuator step on every iteration.
register_state_force_callback(callback)Register a graph-safe callback that applies forces before every solver substep.
register_post_step_callback(callback)Append a hook to the list invoked after the last solver substep on every step.
unregister_post_step_callback(callback)Remove a previously registered post-step callback.
create_fixed_tendon_control(articulation)Build the solver's fixed-tendon command adapter for
articulation.Hook after visualizers have stepped during
render().Remove all registered callbacks.
deregister_callback(callback_id)Remove a registered callback.
dispatch_event(event[, payload])Dispatch an event to all registered callbacks.
fix_articulation_root(articulation_prim[, stage])Ensure that an articulation root has one enabled world fixed joint.
Get the tensor backend being used ("numpy" or "torch").
Get the physics simulation device.
Get the physics timestep in seconds.
Get the current simulation time in seconds.
pause()Pause physics simulation.
play()Start or resume physics simulation.
Sync deferred physics state to the rendering backend.
safe_callback_invoke(fn, *args[, ...])Invoke a callback, catching exceptions that would be swallowed by external event buses.
set_decimation(decimation)Set the decimation count and re-capture the CUDA graph.
stop()Stop physics simulation.
Block until the timeline is playing.
Truewhenstep()executes the full decimation loop internally.add_contact_sensor([body_names_expr, ...])Add a contact sensor for reporting contacts between bodies/shapes.
add_frame_transform_sensor(shapes, ...)Add a frame transform sensor for measuring relative transforms.
add_imu_sensor(sites)Add an IMU sensor for measuring acceleration and angular velocity at sites.
Attributes:
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
Whether this backend can service
--anim_recording_enabled(OVD Recorder).- classmethod setup_deformable_body(prim: Any, deformable_type: str, sim_mesh_prim: Any, vis_mesh_prim: Any) None[source]#
Apply Newton’s token deformable anchor schemas and sync the visual mesh geometry.
- backend: ClassVar[NewtonBackend | None] = None#
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
- classmethod initialize(sim_context: SimulationContext) None[source]#
Initialize the manager with simulation context.
- Parameters:
sim_context¶ – Parent simulation context.
- classmethod reset(soft: bool = False) None[source]#
Reset physics simulation.
A hard reset (
soft=False) re-finalizes the Newton model, reallocating its device arrays. The cached collision pipeline, contacts and any captured CUDA graph reference the old buffers, so they are released here and rebuilt against the re-finalized model byinitialize_solver(). This avoids the illegal CUDA memory access (CUDA error 700) that would otherwise occur on the first step after a hard reset.A soft reset (
soft=True) skips this full reinitialization and reuses the existing model, solver, collision pipeline and CUDA graph.- Parameters:
soft¶ – If True, skip full reinitialization.
- classmethod forward() None[source]#
Update articulation kinematics without stepping physics.
Update body poses from joint coordinates via the solver-specialized FK delegate (
_eval_fk, bound to the active subclass’s_eval_fk_impl()ininitialize_solver()). Only the articulations flagged dirty in_fk_reset_maskand_world_reset_mask(seeinvalidate_fk()) are updated. The masks are consumed (zeroed) afterwards so the nextstep()does not redundantly re-solve them.Asset and scene-data reads share the same pending work. The bound delegate dispatches calls on
NewtonManagerto the active solver’s implementation.
- classmethod step() None[source]#
Step the physics simulation.
The stepping logic follows one of two paths depending on whether all actuators are CUDA-graph-safe:
All-graphable path (
_simulate_full()):Actuators and solver substeps are captured together in a single CUDA graph containing the full
decimation x (actuators + solver substeps)loop.Eager-actuator path (fallback, some actuators not graph-safe):
Actuators are stepped eagerly on the CPU timeline (outside the graph), then a graph containing only the solver substeps is launched via
_simulate_physics_only().In both paths the sequence within one physics step is:
zero actuated DOFs in control.joint_f -> actuator.step (computes effort, writes to control.joint_f) -> solver.step x num_substeps (integrates, reads control.joint_f) -> sensors.update
- classmethod get_scene_data_backend() SceneDataBackend | None[source]#
Return the SceneDataBackend for the SceneDataProvider.
- classmethod register_callback(callback: Callable, event: PhysicsEvent, order: int = 0, name: str | None = None, wrap_weak_ref: bool = True) CallbackHandle[source]#
Register a callback. Passes event to parent class.
- classmethod is_fabric_enabled() bool[source]#
Check if fabric interface is enabled (not applicable for Newton).
- classmethod clear()[source]#
Clear all Newton-specific state (callbacks cleared by super().close()).
- classmethod create_builder(up_axis: str | None = None, *, physics_cfg: NewtonCfg | None = None, **kwargs) newton.ModelBuilder[source]#
Create a
ModelBuilderconfigured with default settings.Forwards
NewtonShapeCfgdefaults onto Newton’s upstreamModelBuilder.default_shape_cfgviachecked_apply(). Falls back to wrapper defaults when no Newton config is active so rough-terrain margin/gap still apply during early construction.- Parameters:
- Returns:
New builder with up-axis and per-shape defaults (gap, margin) applied.
- classmethod cl_register_site(body_pattern: str | None, xform: warp.transform, *, per_world: bool = False) str[source]#
Register a site request for injection into prototypes before replication.
Sensors call this during
__init__. Sites are injected into prototype builders by_cl_inject_sites()(called fromnewton_replicate) beforeadd_builder, so they replicate correctly per-world.Identical
(body_pattern, per_world, transform)registrations share sites.The body_pattern is matched against prototype-local body labels (e.g.
"Robot/link.*") when replication is active, or against the flat builder’s body labels in the fallback path. Wildcard patterns that match multiple bodies create one site per matched body.- Parameters:
body_pattern¶ – Regex pattern matched against body labels in the prototype builder (e.g.
"Robot/link0"or"Robot/finger.*"for multi-body wildcards), orNonefor global sites (world-origin reference, etc.).xform¶ – Site transform relative to body.
per_world¶ – When
True,body_patternmust beNoneand one bodyless site is created in each cloned world’s frame.
- Returns:
Assigned site label suffix.
- classmethod request_extended_state_attribute(attr: str) None[source]#
Request an extended state attribute (e.g.
"body_qdd").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the builder instart_simulation()so that subsequentmodel.state()calls allocate them.- Parameters:
attr¶ – State attribute name (must be in
State.EXTENDED_ATTRIBUTES).
- classmethod request_extended_contact_attribute(attr: str) None[source]#
Request an extended contact attribute (e.g.
"force").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the model instart_simulation()so that subsequentContactscreation includes them.- Parameters:
attr¶ – Contact attribute name.
- classmethod add_model_change(change: newton.ModelFlags) None[source]#
Register a model change to notify the solver.
- classmethod invalidate_fk(env_mask: wp.array | None = None, env_ids: wp.array | None = None, articulation_ids: wp.array | None = None) None[source]#
Mark environments as needing FK recomputation and solver reset.
Called by asset write methods that modify joint coordinates or root transforms. The masks are consumed by the next forward, raw-state, rendering, or physics-step boundary.
- Parameters:
env_mask¶ – Boolean mask of dirtied environments. Shape
(num_envs,). Used by_maskwrite methods.env_ids¶ – Integer indices of dirtied environments. Used by
_indexwrite methods.articulation_ids¶ – Mapping from
(world, arti)to model articulation index. Shape(world_count, count_per_world). Obtained fromArticulationView.articulation_ids.
- classmethod invalidate_body_state(env_ids: wp.array(dtype=wp.int32) | None = None, env_mask: wp.array(dtype=wp.bool) | None = None) None[source]#
Mark selected maximal-coordinate body state as changed without requesting FK.
- classmethod start_simulation() None[source]#
Start simulation by finalizing model and initializing state.
This function finalizes the model and initializes the simulation state. Note: Collision pipeline is initialized later in initialize_solver() after we determine whether the solver needs external collision detection.
- classmethod instantiate_builder_from_stage()[source]#
Import the explicitly declared clone plan into the Newton builder.
- classmethod initialize_solver() None[source]#
Initialize the solver and collision pipeline.
Construct the solver and contacts, establish the initial body state, and schedule graph capture for the first step after the environment has authored its initial state. Initialization and capture do not advance physics.
- classmethod create_visual_material_writer(batches: tuple[VisualMaterialBatch, ...]) VisualMaterialWriter[source]#
Compile material-to-shape addresses for the active Newton model.
- classmethod create_visual_shape_color_writer(asset: BaseArticulation, body_names: tuple[str, ...]) VisualShapeColorWriter[source]#
Compile selected articulation-body shape addresses for the active Newton model.
- classmethod get_model() newton.Model[source]#
Return the active physics model. Render consumers acquire their backend from the registry.
- classmethod get_contacts() Contacts | None[source]#
Get the current Newton contact buffer, if the active solver exposes one.
- classmethod get_scene_data_provider() SceneDataProvider[source]#
Return the active scene data provider.
- classmethod activate_newton_actuator_path() None[source]#
Opt an articulation into the Newton actuator fast path.
Idempotent — called by every Newton-fast-path articulation’s
_process_actuators_cfg:Sets
_use_newton_actuators_active, which_is_all_graphable()checks (adapter presence alone cannot distinguish the fast path from the standard Lab path).On first call, builds the single sim-level
NewtonActuatorAdapterover the full flat DOF layout; later calls reuse it.
- classmethod register_post_actuator_callback(callback: Callable[[], None]) None[source]#
Append a hook to the list invoked after the actuator step on every iteration.
Each callback runs inside the captured CUDA graph (when
_is_all_graphable()isTrue) right afterNewtonActuatorAdapter.step()and before the solver substeps, so kernel writes tostate/controlare visible to the integrator on the same iteration. Multiple articulations register their own implicit-DOF telemetry / FF-routing kernels here; all registered callbacks fire in registration order each step.
- classmethod register_state_force_callback(callback: Callable[[newton.State], None]) None[source]#
Register a graph-safe callback that applies forces before every solver substep.
Callbacks must be registered before solver initialization so they are included in CUDA graph capture.
- Parameters:
callback¶ – Function that adds forces [N, N·m] to the provided state.
- classmethod register_post_step_callback(callback: Callable[[], None]) None[source]#
Append a hook to the list invoked after the last solver substep on every step.
Each callback runs inside the stepped (and, when
_is_all_graphable()isTrue, captured) region right after the final solver substep of the decimation loop and before_update_sensors(), so the launches it issues are recorded into every captured CUDA graph and replayed on each tick. The hook fires exactly once perstep()call, reflecting the state after all decimation iterations (and their solver substeps) have completed – not once per substep and not once per decimation iteration. Callbacks must be graph-safe (fixed shapes, no host branching on device data) and must be registered before capture. Articulations with non-identity ordering register their backend-to-user state republish here; all registered callbacks fire in registration order each step.
- classmethod unregister_post_step_callback(callback: Callable[[], None]) None[source]#
Remove a previously registered post-step callback.
Symmetric to
register_post_step_callback(), this lets an articulation deregister its republish hook when its callbacks are cleared so the bound method does not linger on the class-level list after the articulation is gone. Removing a callback that was never registered (or was already removed) is a safe no-op, matching the tolerant deregistration of other handles.
- classmethod create_fixed_tendon_control(articulation)[source]#
Build the solver’s fixed-tendon command adapter for
articulation.Tendon state is backend-neutral and lives on the articulation; how a target reaches the solver is not. MuJoCo drives tendons through actuator controls, so only the MJWarp manager implements this. The articulation stores what it gets, the way it stores its actuator control, and never needs to know which solver is active.
Only the MuJoCo solver registers the
mujoco:tendonfrequency, so an articulation reports tendons under MJWarp alone and this base is unreachable through the normal path. Reaching it means a solver gained tendons with no way to command them, which is worth saying rather than returning nothing –Nonealready means “this asset’s tendons are all passive”.- Parameters:
articulation¶ – Newton articulation to drive.
- Raises:
NotImplementedError – Always – this solver has no fixed-tendon transmission.
- classmethod after_visualizers_render() None#
Hook after visualizers have stepped during
render().Use for physics-backend sync (e.g. fabric) if needed. Default is a no-op.
- classmethod clear_callbacks() None#
Remove all registered callbacks.
Do NOT reset
_callback_id— handle IDs must remain monotonically unique across the lifetime of the process. Resetting the counter would let a futureregister_callback()hand out an ID that an old, still-aliveCallbackHandle(e.g. on a sensor that has not been garbage-collected yet) holds, so when the old object eventually finalizes its__del__would deregister the new callback. This bit ovphysx’s kitless multi-context tests where twoInteractiveScene``s are created in sequence: the first scene's sensor would post-GC deregister the second scene's ``_initialize_callbackby ID collision, leaving the second sensor forever uninitialized.
- classmethod deregister_callback(callback_id: int | CallbackHandle) None#
Remove a registered callback.
- Parameters:
callback_id¶ – The ID or CallbackHandle returned by register_callback().
- classmethod dispatch_event(event: PhysicsEvent, payload: Any = None) None#
Dispatch an event to all registered callbacks.
This is the default implementation using simple callback lists. Subclasses may override or extend with platform-specific dispatch.
- classmethod fix_articulation_root(articulation_prim: Any, stage: Any = None) Any#
Ensure that an articulation root has one enabled world fixed joint.
The base implementation leaves the root in place. Backends whose parser requires a different root topology may relocate it and return the resulting root prim.
- Parameters:
- Returns:
The articulation-root prim after backend normalization.
- Raises:
NotImplementedError – If a new joint is needed and the root is not a rigid body.
- classmethod pre_render() None#
Sync deferred physics state to the rendering backend.
Called by
render()before cameras and visualizers read scene data. The default implementation is a no-op. Backends that defer transform writes (e.g. Newton’s dirty-flag pattern) should override this to flush pending updates.
- static safe_callback_invoke(fn: Callable, *args, physics_manager: type[PhysicsManager] | None = None) None#
Invoke a callback, catching exceptions that would be swallowed by external event buses.
Ignores
ReferenceError(from garbage-collected weakref proxies). All other exceptions are forwarded to physics_manager.``store_callback_exception`` when available (see note below), or re-raised immediately otherwise.- Note (Octi):
The carb event bus used by PhysX/Omniverse silently swallows exceptions raised inside callbacks.
PhysxManagerworks around this by storing the exception and re-raising it after event dispatch completes (inreset()/step()). Backends that dispatch events directly (e.g. Newton) don’t need this — exceptions propagate normally — sostore_callback_exceptionis not called for them. This is a known wart; a cleaner solution is actively being explored.
- classmethod set_decimation(decimation: int) None[source]#
Set the decimation count and re-capture the CUDA graph.
When all actuators are graphable the entire decimation loop (actuators + solver substeps, repeated decimation times) is captured as a single CUDA graph.
Invalidate the existing graph when the loop changes. Its replacement is captured immediately before the next requested step, after authored state is reconciled.
- supports_anim_recording: ClassVar[bool] = False#
Whether this backend can service
--anim_recording_enabled(OVD Recorder).Overridden by backends that implement the recorder (currently PhysX-only).
- classmethod handles_decimation() bool[source]#
Truewhenstep()executes the full decimation loop internally.This is the case when all Newton actuators are CUDA-graph-safe. The full decimation loop (including the trivial
decimation=1case) is folded into a singlestep()call.
- classmethod add_contact_sensor(body_names_expr: str | list[str] | None = None, shape_names_expr: str | list[str] | None = None, contact_partners_body_expr: str | list[str] | None = None, contact_partners_shape_expr: str | list[str] | None = None, verbose: bool = False) tuple[str | list[str] | None, str | list[str] | None, str | list[str] | None, str | list[str] | None][source]#
Add a contact sensor for reporting contacts between bodies/shapes.
Compiles the Isaac Lab regular expressions and delegates to
newton.sensors.SensorContact, which full-matches compiled patterns against model labels.- Parameters:
- classmethod add_frame_transform_sensor(shapes: list[int], reference_sites: list[int]) int[source]#
Add a frame transform sensor for measuring relative transforms.
Creates a
SensorFrameTransformfrom pre-resolved shape and reference site indices, appends it to the internal list, and returns its index.
- classmethod add_imu_sensor(sites: list[int]) int[source]#
Add an IMU sensor for measuring acceleration and angular velocity at sites.
Creates a
newton.sensors.SensorIMUfrom pre-resolved site indices, appends it to the internal list, and returns its index.- Parameters:
sites¶ – Ordered list of site indices (one per environment).
- Returns:
Index of the newly created sensor in the internal IMU sensor list.
Physics Configuration#
- class isaaclab_newton.physics.NewtonCfg[source]#
Bases:
PhysicsCfgConfiguration for Newton physics manager.
This configuration includes Newton-specific simulation settings and solver configuration.
The active
NewtonManagersubclass is determined bysolver_cfg.class_type, which__post_init__()propagates toclass_typeso thatSimulationContextresolves the right manager subclass automatically. User code keeps the existing two-level shapeNewtonCfg(solver_cfg=...)and does not need to setclass_typeexplicitly.Attributes:
The class type of the
NewtonManager.Whether to request reproducible physics from the backend.
Number of substeps to use for the solver.
Re-collide every N solver substeps within a physics tick (
0= once per tick).Whether to enable debug mode for the solver.
Whether to use CUDA graphing when simulating.
Determinism guarantee applied to the Newton solver and collision pipeline.
Solver configuration.
Global soft-contact parameters applied after model finalization.
Newton collision pipeline configuration.
Default per-shape collision properties applied to every shape in the scene.
Whether Newton replication imports visual-only geometry from USD.
BVH construction algorithm for mesh geometry colliders.
BVH construction algorithm for the top-level scene (broad-phase) hierarchy.
BVH construction algorithm for Gaussian-splat primitives.
- class_type: type[NewtonManager] | str | None#
The class type of the
NewtonManager.Auto-set in
__post_init__()fromsolver_cfg.class_type. Users normally do not set this directly.
- deterministic: bool#
Whether to request reproducible physics from the backend. Defaults to False.
This is the backend-agnostic form of the request, set by the
--deterministiccommand-line flag. Each physics manager translates it into its own settings when the simulation starts, and raises when its configuration cannot provide the guarantee. A backend-specific determinism attribute set explicitly, such asdeterministic_mode, is the more specific instruction and takes precedence.Deterministic execution can increase memory use and reduce simulation performance.
- collision_decimation: int#
Re-collide every N solver substeps within a physics tick (
0= once per tick).
- use_cuda_graph: bool#
Whether to use CUDA graphing when simulating.
Graphs are captured immediately before the first physics step, after reset and decimation setup. Capture does not advance physics. Kit/RTX uses a nonblocking stream with relaxed capture mode; kitless simulation uses Warp’s standard capture mode.
If set to False, the simulation performance will be severely degraded.
- deterministic_mode: Literal['not_guaranteed', 'run_to_run', 'gpu_to_gpu']#
Determinism guarantee applied to the Newton solver and collision pipeline.
The values
"not_guaranteed","run_to_run", and"gpu_to_gpu"map to the correspondingwarp.DeterministicModevalues. Deterministic execution increases memory use and can reduce simulation performance.Warning
Deterministic contact ordering adds sorting work and allocates buffers sized for the configured maximum contact count. Runtime and memory overhead therefore grow with contact capacity. Enable this mode only when its reproducibility guarantee is required.
MJWarp on the GPU with
disable_sensorsset toTrue, XPBD, and Featherstone support this setting. Newton raises an error during solver initialization for unsupported solvers rather than silently running them without the requested guarantee.
- solver_cfg: NewtonSolverCfg | None#
Solver configuration. If None (default), MJWarpSolverCfg is used by default.
- soft_contact_cfg: NewtonSoftContactCfg | None#
Global soft-contact parameters applied after model finalization.
If
None, Newton model defaults are preserved.
- collision_cfg: NewtonCollisionPipelineCfg | None#
Newton collision pipeline configuration.
Controls how Newton’s
CollisionPipelineis configured when it is active. The pipeline is active when the solver delegates collision detection to Newton:MJWarpSolverCfgwithuse_mujoco_contacts=False,KaminoPADMMSolverCfgorKaminoDVISolverCfgwithuse_collision_detector=False,XPBDSolverCfg(always),VBDSolverCfg(always),FeatherstoneSolverCfg(always).
MPMSolverCfgdoes not use this pipeline; implicit MPM treats rigid geometry as colliders internally.If
None(default), a pipeline withbroad_phase="explicit"is created automatically. Set this to aNewtonCollisionPipelineCfgto customize parameters such as broad phase algorithm, contact limits, or hydroelastic mode.Note
Setting this while
MJWarpSolverCfg.use_mujoco_contacts=TrueraisesValueError. When a Kamino solver config hasuse_collision_detector=True, the field is ignored because Kamino’s internal detector handles contacts.
- default_shape_cfg: NewtonShapeCfg#
Default per-shape collision properties applied to every shape in the scene.
Forwarded to Newton’s
ModelBuilder.default_shape_cfgat builder construction viachecked_apply(). SeeNewtonShapeCfgfor the declared fields.
- load_visual_shapes: bool | None#
Whether Newton replication imports visual-only geometry from USD.
Noneimports it only when a viewer, an offscreenrgb_arraycapture, or a camera sensor is active, so headless training does not pay the USD parse time and memory for shapes nothing draws. Set toTrueto always import it, which is needed when a ray-cast sensor must hit geometry that carries no collider.
- bvh_constructor_geometry: Literal['lbvh', 'sah', 'cubql']#
BVH construction algorithm for mesh geometry colliders.
Selects the bounding-volume-hierarchy builder Newton uses for the triangle meshes of collision geometry, forwarded to
ModelBuilder.BvhConfig. Trades build time against query (traversal) quality:"lbvh": linear BVH; fastest to build, lowest-quality tree."sah": surface-area-heuristic BVH; slower build, tighter tree with faster ray/overlap queries."cubql": cuBQL GPU builder; balances fast construction with good tree quality on the GPU (default).
- bvh_constructor_scene: Literal['lbvh', 'sah']#
BVH construction algorithm for the top-level scene (broad-phase) hierarchy.
Selects the builder for the BVH over all colliders used during broad-phase culling, forwarded to
ModelBuilder.BvhConfig. Seebvh_constructor_geometryfor the"lbvh"/"sah"trade-off;"cubql"is not available for the scene hierarchy.
- bvh_constructor_gaussian: Literal['lbvh', 'sah', 'cubql']#
BVH construction algorithm for Gaussian-splat primitives.
Selects the builder for the BVH over 3D Gaussian primitives (used by the Gaussian renderer/collision path), forwarded to
ModelBuilder.BvhConfig. Seebvh_constructor_geometryfor the"lbvh"/"sah"/"cubql"trade-off.
- class isaaclab_newton.physics.NewtonBackendCfg[source]#
Bases:
BackendCfgAllocate model and state from the matching builder; closing them leaves the builder intact.
Attributes:
Constructor called through
instantiate(cfg); the returned resource must implementclose().Selected physics settings, also identifying the shared construction builder.
Device on which to allocate the model and native buffers.
- class_type: type[NewtonBackend] | str#
Constructor called through
instantiate(cfg); the returned resource must implementclose().
- physics_cfg: PhysicsCfg#
Selected physics settings, also identifying the shared construction builder.
- class isaaclab_newton.physics.NewtonBuilderCfg[source]#
Bases:
objectShare mutable construction data, populated before model allocation and retained across hard resets.
Attributes:
Selected physics settings; non-Newton physics requires a render-only Newton representation.
- physics_cfg: PhysicsCfg#
Selected physics settings; non-Newton physics requires a render-only Newton representation.
- isaaclab_newton.physics.create_newton_builder(cfg: NewtonBuilderCfg) newton.ModelBuilder[source]#
Construct a native builder through the selected physics manager’s factory.
- Parameters:
cfg¶ – The selected physics configuration.
- Returns:
An empty builder with the selected solver schemas and shape/BVH defaults.
- class isaaclab_newton.physics.NewtonSoftContactCfg[source]#
Bases:
objectGlobal soft-contact parameters applied to the finalized Newton model.
Attributes:
Body-particle and particle self-contact stiffness [N/m].
Body-particle contact damping [N*s/m].
Body-particle contact friction coefficient [dimensionless].
- class isaaclab_newton.physics.NewtonSolverCfg[source]#
Bases:
objectConfiguration for Newton solver-related parameters.
These parameters are used to configure the Newton solver. For more information, see the Newton documentation.
Subclasses set
class_typeto their matchingNewtonManagersubclass;NewtonCfgpropagates that to its ownNewtonCfg.class_typeinNewtonCfg.__post_init__()so thatSimulationContextresolves the correct manager via the existing dispatch path.Attributes:
Manager class for this solver.
Solver type metadata (deprecated).
- class_type: type[NewtonManager] | str#
Manager class for this solver.
Default points at the abstract
NewtonManager; concrete subclasses override it.
- solver_type: str#
Solver type metadata (deprecated).
Deprecated since version Manager: dispatch is now driven by
class_type; this field is retained as metadata for logging and debugging only. Do not branch onsolver_typein new code.
- class isaaclab_newton.physics.MJWarpSolverCfg[source]#
Bases:
NewtonSolverCfgConfiguration for MuJoCo Warp solver-related parameters.
These parameters are used to configure the MuJoCo Warp solver. For more information, see the MuJoCo Warp documentation.
Attributes:
Manager class for the MuJoCo Warp solver.
Solver type.
Number of constraints per environment (world).
Number of contact points per environment (world).
Number of solver iterations.
Number of line search iterations for the solver.
Solver type.
Integrator type.
Whether to use the pure MuJoCo backend instead of mujoco_warp.
Whether to disable contact computation in MuJoCo.
Whether to disable MuJoCo Warp's internal sensor computation.
Default gear ratio for all actuators.
Dictionary mapping joint names to specific gear ratios, overriding the default_actuator_gear.
Frequency (in simulation steps) at which to update the MuJoCo Data object from the Newton state.
Optional path to save the generated MJCF model file.
Frictional-to-normal constraint impedance ratio.
The type of contact friction cone.
Maximum iterations for convex collision detection (GJK/EPA).
Whether to enable multiple-contact convex collision detection.
Deprecated parallel line search option.
Whether to use MuJoCo's internal contact solver.
Solver convergence tolerance for the constraint residual.
- class_type: type[NewtonManager] | str#
Manager class for the MuJoCo Warp solver.
- integrator: str#
Integrator type. Can be “euler”, “rk4”, or “implicitfast”, or their corresponding MuJoCo integer constants.
- disable_sensors: bool#
Whether to disable MuJoCo Warp’s internal sensor computation.
This must be
TruewhenNewtonCfg.deterministic_moderequests a determinism guarantee. Isaac Lab sensors use Newton state directly and do not depend on MuJoCo Warp’s internal sensor data.
- 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 simulation steps) at which to update the MuJoCo Data object from the Newton state.
If 0, Data is never updated after initialization.
- save_to_mjcf: str | None#
Optional path to save the generated MJCF model file.
If None, the MJCF model is not saved.
- ccd_iterations: int#
Maximum iterations for convex collision detection (GJK/EPA).
Increase this if you see warnings about
opt.ccd_iterationsneeding 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_contactsenabled, 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
nconmaxandnjmaxcapacities. See MuJoCo’s multiple-contact documentation.
- ls_parallel: bool#
Deprecated parallel line search option.
Setting this to
Trueemits aDeprecationWarningand 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. IfFalse, Newton’sCollisionPipelineis used instead. A default pipeline (broad_phase="explicit") is created automatically whenNewtonCfg.collision_cfgisNone. SetNewtonCfg.collision_cfgto aNewtonCollisionPipelineCfgto customize pipeline parameters (broad phase, contact limits, hydroelastic, etc.).Note
Setting
collision_cfgwhileuse_mujoco_contacts=TrueraisesValueErrorbecause 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
iterationsis reached. Lower values give more precise constraint satisfaction at the cost of more iterations. MuJoCo default is1e-8; Newton default is1e-6.
- class isaaclab_newton.physics.VBDSolverCfg[source]#
Bases:
NewtonSolverCfgConfiguration for the Vertex Block Descent solver.
Attributes:
Manager class for the VBD solver.
Number of VBD iterations per substep.
Whether an external solver integrates rigid bodies.
Whether to enable particle self-contact.
Particle radius used for self-contact detection [m].
Self-contact detection margin [m].
<0 before init, 0 before and after init, k>=1 before every k VBD iterations.
Solver type metadata (deprecated).
Preallocation size for each vertex contact buffer.
Preallocation size for each edge contact buffer.
Topological distance below which self-contacts are discarded.
Rest-shape separation threshold for filtering contacts [m].
Whether to use compliant ALM for rigid joints and contacts;
Nonepreserves Newton's default.Initial stiffness seed for rigid-body contacts [N/m].
Per-body body-body contact capacity when VBD integrates rigid bodies.
Per-body particle, edge, and face soft-contact capacity when VBD integrates rigid bodies.
- class_type: type[NewtonManager] | str#
Manager class for the VBD solver.
- particle_collision_detection_interval: int#
<0 before init, 0 before and after init, k>=1 before every k VBD iterations.
- Type:
Self-contact detection
- solver_type: str#
Solver type metadata (deprecated).
Deprecated since version Manager: dispatch is now driven by
class_type; this field is retained as metadata for logging and debugging only. Do not branch onsolver_typein new code.
- particle_topological_contact_filter_threshold: int#
Topological distance below which self-contacts are discarded.
- particle_rest_shape_contact_exclusion_radius: float#
Rest-shape separation threshold for filtering contacts [m].
- rigid_compliant_alm: bool | None#
Whether to use compliant ALM for rigid joints and contacts;
Nonepreserves Newton’s default.
- class isaaclab_newton.physics.XPBDSolverCfg[source]#
Bases:
NewtonSolverCfgAn implicit integrator using eXtended Position-Based Dynamics (XPBD) for rigid and soft body simulation.
References
Miles Macklin, Matthias Müller, and Nuttapong Chentanez. 2016. XPBD: position-based simulation of compliant constrained dynamics. In Proceedings of the 9th International Conference on Motion in Games (MIG ‘16). Association for Computing Machinery, New York, NY, USA, 49-54. https://doi.org/10.1145/2994258.2994272
Matthias Müller, Miles Macklin, Nuttapong Chentanez, Stefan Jeschke, and Tae-Yong Kim. 2020. Detailed rigid body simulation with extended position based dynamics. In Proceedings of the ACM SIGGRAPH/Eurographics Symposium on Computer Animation (SCA ‘20). Eurographics Association, Goslar, DEU, Article 10, 1-12. https://doi.org/10.1111/cgf.14105
Attributes:
Manager class for the XPBD solver.
Solver type.
Number of solver iterations.
Relaxation parameter for soft body simulation.
Relaxation parameter for soft contact simulation.
Relaxation parameter for joint linear simulation.
Relaxation parameter for joint angular simulation.
Compliance parameter for joint linear simulation.
Compliance parameter for joint angular simulation.
Relaxation parameter for rigid contact simulation.
Whether to use contact constraint weighting for rigid contact simulation.
Angular damping parameter for rigid contact simulation.
Whether to enable restitution for rigid contact simulation.
- class_type: type[NewtonManager] | str#
Manager class for the XPBD solver.
- class isaaclab_newton.physics.FeatherstoneSolverCfg[source]#
Bases:
NewtonSolverCfgA semi-implicit integrator using symplectic Euler.
It operates on reduced (also called generalized) coordinates to simulate articulated rigid body dynamics based on Featherstone’s composite rigid body algorithm (CRBA).
See: Featherstone, Roy. Rigid Body Dynamics Algorithms. Springer US, 2014.
Semi-implicit time integration is a variational integrator that preserves energy, however it is not unconditionally stable, and requires a time-step small enough to support the required stiffness and damping forces.
See: https://en.wikipedia.org/wiki/Semi-implicit_Euler_method
Attributes:
Manager class for the Featherstone solver.
Solver type.
Angular damping parameter for rigid contact simulation.
Frequency (in simulation steps) at which to update the mass matrix.
Friction smoothing parameter.
Whether to use tile-based GEMM for the mass matrix.
Whether to fuse the Cholesky decomposition.
- class_type: type[NewtonManager] | str#
Manager class for the Featherstone solver.
- class isaaclab_newton.physics.KaminoPADMMCfg[source]#
Bases:
objectP-ADMM forward-dynamics solver parameters for Kamino.
Attributes:
Maximum number of P-ADMM solver iterations.
Primal residual convergence tolerance.
Dual residual convergence tolerance.
Complementarity residual convergence tolerance.
Combined primal-dual residual tolerance for acceleration restarts.
Initial penalty parameter.
Lower bound on the penalty parameter.
Initial acceleration parameter.
Primal-dual residual threshold for penalty updates.
Penalty increase/decrease factor.
Proximal regularization parameter.
Frequency of penalty updates.
Penalty update method.
Absolute tolerance for the iterative linear solver.
Ratio adapting the linear solver tolerance from the ADMM primal residual.
Whether to use Nesterov-type acceleration (APADMM).
Whether to use CUDA graph conditional nodes in the iterative solver.
Warmstart mode.
Contact warm-start method.
- linear_solver_tolerance: float#
Absolute tolerance for the iterative linear solver. Zero leaves it unchanged.
- class isaaclab_newton.physics.KaminoDVICfg[source]#
Bases:
objectDVI forward-dynamics solver parameters for Kamino.
Attributes:
Convergence tolerance on the projected update size.
Diagonal regularization added to each projected update denominator.
Relaxation factor applied to projected Gauss-Seidel updates.
Maximum outer DVI iterations.
Projected Gauss-Seidel sweeps per DVI iteration.
DVI iterations between repeated direct bilateral solves.
Direct linear solver for the bilateral constraint block.
Additional keyword arguments for the bilateral linear solver.
Warmstart mode.
Contact warm-start method when
warmstart_modeiscontainers.- bilateral_solver_type: Literal['LLTB', 'LLTBRCM']#
Direct linear solver for the bilateral constraint block.
- class isaaclab_newton.physics.KaminoDynamicsCfg[source]#
Bases:
objectConstrained forward-dynamics problem parameters for Kamino.
Attributes:
Whether to precondition the dual problem.
Linear solver for the dynamics problem.
Additional keyword arguments for the linear solver.
- class isaaclab_newton.physics.KaminoConstraintsCfg[source]#
Bases:
objectGlobal constraint stabilization parameters for Kamino.
Attributes:
Baumgarte stabilization for bilateral joint constraints.
Baumgarte stabilization for unilateral joint-limit constraints.
Baumgarte stabilization for unilateral contact constraints.
Contact penetration margin [m].
- class isaaclab_newton.physics.KaminoFKCfg[source]#
Bases:
objectForward-kinematics reset solver parameters for Kamino.
Attributes:
Whether to regularize the FK reset solve (Tikhonov term on body poses).
Weight of the FK reset regularizer when
use_regularizationisTrue.Convergence tolerance of the FK reset solve.
- regularization_weight: float#
Weight of the FK reset regularizer when
use_regularizationisTrue.
- class isaaclab_newton.physics.KaminoCollisionDetectorCfg[source]#
Bases:
objectInternal Kamino collision-detector parameters.
Attributes:
Collision-detection pipeline.
Broad-phase algorithm.
Bounding-volume type.
Model-wide contact buffer capacity cap.
Per-world contact buffer capacity override.
Maximum contacts generated per candidate geometry pair.
Maximum triangle-primitive shape pairs in narrow phase.
Default detection gap [m] applied as a floor to per-geometry gaps.
- pipeline: Literal['primitive', 'unified'] | None#
Collision-detection pipeline.
Noneuses Newton’s default (unified).
- class isaaclab_newton.physics.KaminoMaterialsCfg[source]#
Bases:
objectMaterial mixing parameters for Kamino contacts.
Attributes:
How friction coefficients are mixed for a contact pair.
How restitution coefficients are mixed for a contact pair.
- class isaaclab_newton.physics.KaminoPADMMSolverCfg[source]#
Bases:
_KaminoSolverCfgBaseConfiguration for Kamino with the P-ADMM forward-dynamics solver.
Attributes:
Manager class for the Kamino solver.
Solver type.
Integrator type.
Whether to use Kamino's internal collision detector instead of Newton's pipeline.
Whether to enable the forward kinematics solver for state resets.
Whether to use sparse Jacobian computation.
Whether to use sparse dynamics computation.
Rotation correction mode.
Angular velocity damping factor.
Whether to collect solver convergence and performance info at each step.
Whether to compute solution metrics at each step.
Constrained dynamics problem parameters.
Constraint stabilization parameters.
Forward-kinematics reset solver parameters.
Internal collision-detector parameters.
Material mixing parameters.
Cap the per-world contact pre-allocation handed to Kamino.
P-ADMM forward-dynamics solver parameters.
- class_type: type[NewtonManager] | str#
Manager class for the Kamino solver.
- integrator: Literal['euler', 'moreau']#
Integrator type.
- use_collision_detector: bool#
Whether to use Kamino’s internal collision detector instead of Newton’s pipeline.
- use_fk_solver: bool | None#
Whether to enable the forward kinematics solver for state resets.
When
None, Kamino will automatically determine whether to use the FK solver based on the model’s articulation structure. If the model has loop-closing joints, the FK solver will be used.When
True,NewtonKaminoManager._eval_fk_impl()reconciles body state viaSolverKamino.reset()withSolverKamino.ResetConfig.from_joints. Kamino’s FK solver computes consistent body poses/velocities from the joint coordinates (including the base joint for floating bases), resolves passive / loop-closure joints, and writes back a consistent full joint state. Environment resets only need to write actuated DOFs injoint_q; passive values are filled in by FK. This is required for closed-loop systems.When
False, Newton’s articulatedeval_fkis used instead over the fulljoint_q/joint_qd. It is then up to the user to specify constraint-consistent values. This is the faster option for purely articulated (tree-structured) systems.
- sparse_jacobian: bool | None#
Whether to use sparse Jacobian computation.
Nonelets Newton pick per backend.
- rotation_correction: Literal['twopi', 'continuous', 'none']#
Rotation correction mode.
- collect_solver_info: bool#
Whether to collect solver convergence and performance info at each step.
Warning
Enabling this significantly increases solver runtime and should only be used for debugging.
- compute_solution_metrics: bool#
Whether to compute solution metrics at each step.
Warning
Enabling this significantly increases solver runtime and should only be used for debugging.
- dynamics: KaminoDynamicsCfg | None#
Constrained dynamics problem parameters.
When
None, Newton selects defaults appropriate to the selected dynamics solver and sparsity settings.
- constraints: KaminoConstraintsCfg#
Constraint stabilization parameters.
- fk: KaminoFKCfg#
Forward-kinematics reset solver parameters.
- collision_detector: KaminoCollisionDetectorCfg#
Internal collision-detector parameters.
- materials: KaminoMaterialsCfg#
Material mixing parameters.
- max_contacts_per_world: int | None#
Cap the per-world contact pre-allocation handed to Kamino.
When
None, Kamino falls back togeoms.world_minimum_contactsderived from the collision pipeline, which over-allocates dramatically for contact-rich assets. Set this to bound GPU memory for multi-env training of contact-heavy tasks (e.g. legged locomotion or manipulation). The totalmodel.rigid_contact_maxis computed asmax_contacts_per_world * model.world_countbefore solver construction.This field is applied by
NewtonKaminoManagerand is not forwarded to Newton.
- dynamics_solver_cfg: KaminoPADMMCfg#
P-ADMM forward-dynamics solver parameters.
- class isaaclab_newton.physics.KaminoDVISolverCfg[source]#
Bases:
_KaminoSolverCfgBaseConfiguration for Kamino with the DVI forward-dynamics solver.
Attributes:
Manager class for the Kamino solver.
Solver type.
Integrator type.
Whether to use Kamino's internal collision detector instead of Newton's pipeline.
Whether to enable the forward kinematics solver for state resets.
Whether to use sparse Jacobian computation.
Whether to use sparse dynamics computation.
Rotation correction mode.
Angular velocity damping factor.
Whether to collect solver convergence and performance info at each step.
Whether to compute solution metrics at each step.
Constrained dynamics problem parameters.
Constraint stabilization parameters.
Forward-kinematics reset solver parameters.
Internal collision-detector parameters.
Material mixing parameters.
Cap the per-world contact pre-allocation handed to Kamino.
DVI forward-dynamics solver parameters.
- class_type: type[NewtonManager] | str#
Manager class for the Kamino solver.
- integrator: Literal['euler', 'moreau']#
Integrator type.
- use_collision_detector: bool#
Whether to use Kamino’s internal collision detector instead of Newton’s pipeline.
- use_fk_solver: bool | None#
Whether to enable the forward kinematics solver for state resets.
When
None, Kamino will automatically determine whether to use the FK solver based on the model’s articulation structure. If the model has loop-closing joints, the FK solver will be used.When
True,NewtonKaminoManager._eval_fk_impl()reconciles body state viaSolverKamino.reset()withSolverKamino.ResetConfig.from_joints. Kamino’s FK solver computes consistent body poses/velocities from the joint coordinates (including the base joint for floating bases), resolves passive / loop-closure joints, and writes back a consistent full joint state. Environment resets only need to write actuated DOFs injoint_q; passive values are filled in by FK. This is required for closed-loop systems.When
False, Newton’s articulatedeval_fkis used instead over the fulljoint_q/joint_qd. It is then up to the user to specify constraint-consistent values. This is the faster option for purely articulated (tree-structured) systems.
- sparse_jacobian: bool | None#
Whether to use sparse Jacobian computation.
Nonelets Newton pick per backend.
- rotation_correction: Literal['twopi', 'continuous', 'none']#
Rotation correction mode.
- collect_solver_info: bool#
Whether to collect solver convergence and performance info at each step.
Warning
Enabling this significantly increases solver runtime and should only be used for debugging.
- compute_solution_metrics: bool#
Whether to compute solution metrics at each step.
Warning
Enabling this significantly increases solver runtime and should only be used for debugging.
- dynamics: KaminoDynamicsCfg | None#
Constrained dynamics problem parameters.
When
None, Newton selects defaults appropriate to the selected dynamics solver and sparsity settings.
- constraints: KaminoConstraintsCfg#
Constraint stabilization parameters.
- fk: KaminoFKCfg#
Forward-kinematics reset solver parameters.
- collision_detector: KaminoCollisionDetectorCfg#
Internal collision-detector parameters.
- materials: KaminoMaterialsCfg#
Material mixing parameters.
- max_contacts_per_world: int | None#
Cap the per-world contact pre-allocation handed to Kamino.
When
None, Kamino falls back togeoms.world_minimum_contactsderived from the collision pipeline, which over-allocates dramatically for contact-rich assets. Set this to bound GPU memory for multi-env training of contact-heavy tasks (e.g. legged locomotion or manipulation). The totalmodel.rigid_contact_maxis computed asmax_contacts_per_world * model.world_countbefore solver construction.This field is applied by
NewtonKaminoManagerand is not forwarded to Newton.
- dynamics_solver_cfg: KaminoDVICfg#
DVI forward-dynamics solver parameters.
- class isaaclab_newton.physics.MPMSolverCfg[source]#
Bases:
NewtonSolverCfgConfiguration for Newton’s implicit Material Point Method (MPM) solver.
The implicit MPM solver advances particle materials and treats rigid geometry as colliders. It is not a rigid-body or articulation dynamics solver.
Attributes:
Manager class for the implicit MPM solver.
Solver type.
Maximum number of iterations for the rheology solver.
Tolerance for the rheology solver.
Rheology solver, or an ordered warm-start sequence of solvers.
Warm-start mode for the rheology solver.
Collider velocity computation mode.
Size of the MPM grid voxels [m].
Type of grid to use.
Number of empty cells to add around particles when allocating the grid.
Maximum active grid-cell count shared by all worlds.
Maximum sparse-grid leaf-node count shared by all worlds.
Maximum sparse-grid lower internal-node count shared by all worlds.
Maximum sparse-grid upper internal-node count shared by all worlds.
Whether each Newton world uses an independent local MPM grid environment.
Particle-grid transfer scheme.
Integration scheme controlling shape-function support.
Dimensionless fraction under which the yield surface collapses.
Numerical drag for background air.
Whether collider normals are computed from SDF gradients rather than closest points.
Collider basis function, such as
"S2"or"Q1".Strain basis function, such as
"P0","P1d","Q1", or"Q1d".Velocity basis function, such as
"Q1","B2", or"B3".Whether to hard-project particles out of collider interiors after each substep.
- class_type: type[NewtonManager] | str#
Manager class for the implicit MPM solver.
- solver: str | tuple[str, ...]#
Rheology solver, or an ordered warm-start sequence of solvers.
Values use the canonical tokens defined by
NewtonMPMSceneAPI."auto"lets Newton pick the solver from the velocity basis. Pass a tuple such as("conjugate-residual", "gauss-seidel")to warm-start solvers left-to-right.
- warmstart_mode: Literal['none', 'auto', 'particles', 'grid', 'smoothed']#
Warm-start mode for the rheology solver.
- collider_velocity_mode: Literal['forward', 'backward', 'instantaneous', 'finite_difference']#
Collider velocity computation mode.
"instantaneous"is deprecated in favor of"forward", and"finite_difference"is deprecated in favor of"backward".
- grid_type: Literal['sparse', 'dense', 'fixed']#
Type of grid to use.
- max_active_cell_count: int#
Maximum active grid-cell count shared by all worlds.
A positive value reserves persistent capacity for rebuildable sparse grids and bounds active subsets of dense and fixed grids.
-1keeps sparse allocation dynamic and uses exact active counts for the other grid types.
- max_leaf_node_count: int#
Maximum sparse-grid leaf-node count shared by all worlds.
-1lets Newton derive the capacity frommax_active_cell_count.
- max_lower_node_count: int#
Maximum sparse-grid lower internal-node count shared by all worlds.
-1lets Newton derive the capacity from the initial topology.
- max_upper_node_count: int#
Maximum sparse-grid upper internal-node count shared by all worlds.
-1lets Newton derive the capacity from the initial topology.
- transfer_scheme: Literal['apic', 'pic']#
Particle-grid transfer scheme.
- integration_scheme: Literal['pic', 'gimp']#
Integration scheme controlling shape-function support.
- collider_normal_from_sdf_gradient: bool#
Whether collider normals are computed from SDF gradients rather than closest points.
- project_outside_colliders: bool#
Whether to hard-project particles out of collider interiors after each substep.
When
True,NewtonMPMManagercallsSolverImplicitMPM.project_outside()immediately after every solver substep: it applies a Coulomb response and pushes particles that drifted into a collider back onto its surface. The implicit solve already resolves colliders at the grid level; this is the particle-level correction that stops material from slowly settling inside colliders, mirroring Newton’s MPM examples. Leave itFalsefor collider-free scenes to skip a per-substep projection pass over every particle.This is a manager-level stepping option and is intentionally not part of
SolverImplicitMPM.Config.
- class isaaclab_newton.physics.NewtonCollisionPipelineCfg[source]#
Bases:
objectConfiguration for Newton collision pipeline.
Full-featured collision pipeline with GJK/MPR narrow phase and pluggable broad phase. When this config is set on
NewtonCfg.collision_cfg:MJWarpSolverCfg: Newton’s collision pipeline replaces MuJoCo’s internal contact solver.
Other solvers (XPBD, Featherstone, etc.): Configures the collision pipeline parameters (these solvers always use Newton’s collision pipeline).
Key features:
GJK/MPR algorithms for convex-convex collision detection
Multiple broad phase options: NXN (all-pairs), SAP (sweep-and-prune), EXPLICIT (precomputed pairs)
Mesh-mesh collision via SDF with contact reduction
Optional hydroelastic contact model for compliant surfaces
For more details, see the Newton collision pipeline guide and CollisionPipeline API.
Attributes:
Broad phase algorithm for collision detection.
Whether to reduce contacts for mesh-mesh collisions.
Maximum number of rigid contacts to allocate.
Maximum number of triangle pairs allocated by narrow phase for mesh and heightfield collisions.
Maximum number of soft contacts to allocate.
Margin [m] for soft contact generation.
Whether to generate soft contacts against full-surface-capable rigid colliders.
Whether to enable gradient computation for collision.
Configuration for SDF-based hydroelastic collision handling.
Methods:
Build keyword arguments for
newton.CollisionPipeline.- broad_phase: Literal['explicit', 'nxn', 'sap']#
Broad phase algorithm for collision detection.
Options:
"explicit": Use precomputed shape pairs frommodel.shape_contact_pairs."nxn": All-pairs brute force. Simple but O(n^2) complexity."sap": Sweep-and-prune. Good for scenes with many dynamic objects.
Defaults to
"explicit"(same as Newton’s default whenbroad_phase=None).
- reduce_contacts: bool#
Whether to reduce contacts for mesh-mesh collisions.
When True, uses shared memory contact reduction to select representative contacts. Improves performance and stability for meshes with many vertices.
Defaults to
True(same as Newton’s default).
- rigid_contact_max: int | None#
Maximum number of rigid contacts to allocate.
Resolution order:
If provided, use this value.
Else if
model.rigid_contact_max > 0, use the model value.Else estimate automatically from model shape and pair metadata.
Defaults to
None(auto-estimate, same as Newton’s default).
- max_triangle_pairs: int#
Maximum number of triangle pairs allocated by narrow phase for mesh and heightfield collisions.
Increase this when scenes with large/complex meshes or heightfields report triangle-pair overflow warnings.
Defaults to
1_000_000(same as Newton’s default).
- soft_contact_max: int | None#
Maximum number of soft contacts to allocate.
If None, computed as
shape_count * particle_count.Defaults to
None(auto-compute, same as Newton’s default).
- soft_contact_margin: float#
Margin [m] for soft contact generation.
Defaults to
0.01(same as Newton’s default).
- enable_rigid_soft_full_surface_contact: bool#
Whether to generate soft contacts against full-surface-capable rigid colliders.
When
True, Newton adds edge and triangle-interior soft contacts (in addition to the per-vertex particle contacts) so rigid features that pass between soft vertices are caught. Analytic shapes (boxes, capsules, spheres) are full-surface-capable without an SDF; any participating mesh/convex collider must carry a volume SDF.Defaults to
False(same as Newton’s default).
- requires_grad: bool | None#
Whether to enable gradient computation for collision.
If
None, usesmodel.requires_grad.Defaults to
None(same as Newton’s default).
- sdf_hydroelastic_config: HydroelasticSDFCfg | None#
Configuration for SDF-based hydroelastic collision handling.
If
None, hydroelastic contacts are disabled. If set, enables hydroelastic contacts with the specified parameters.Defaults to
None(hydroelastic disabled, same as Newton’s default).
- to_pipeline_args() dict[str, Any][source]#
Build keyword arguments for
newton.CollisionPipeline.Converts this configuration into the dict expected by
CollisionPipeline.__init__, handling nested config conversion (e.g.HydroelasticSDFCfg→HydroelasticSDF.Config).- Returns:
Keyword arguments suitable for
CollisionPipeline(model, **args).
- class isaaclab_newton.physics.HydroelasticSDFCfg[source]#
Bases:
objectConfiguration for SDF-based hydroelastic collision handling.
Hydroelastic contacts generate distributed contact areas instead of point contacts, providing more realistic force distribution for manipulation and compliant surfaces.
For more details, see the Newton hydroelastic contacts guide.
Attributes:
Whether to reduce contacts to a smaller representative set per shape pair.
(0, 1].
Whether to rotate reduced contact normals to align with aggregate force direction.
Whether to add an anchor contact at the center of pressure for each normal bin.
Contact area [m^2] used for non-penetrating contacts at the margin.
Whether to output hydroelastic contact surface vertices for visualization.
- reduce_contacts: bool#
Whether to reduce contacts to a smaller representative set per shape pair.
When False, all generated contacts are passed through without reduction.
Defaults to
True(same as Newton’s default).
- buffer_fraction: float#
(0, 1].
Lower values reduce memory usage but may cause overflows in dense scenes. Overflows are bounds-safe and emit warnings; increase this value when warnings appear.
Defaults to
1.0(same as Newton’s default).- Type:
Fraction of worst-case hydroelastic buffer allocations. Range
- normal_matching: bool#
Whether to rotate reduced contact normals to align with aggregate force direction.
Only active when
reduce_contactsis True.Defaults to
True(same as Newton’s default).
- anchor_contact: bool#
Whether to add an anchor contact at the center of pressure for each normal bin.
The anchor contact helps preserve moment balance. Only active when
reduce_contactsis True.Defaults to
False(same as Newton’s default).
- class isaaclab_newton.physics.NewtonShapeCfg[source]#
Bases:
objectDefault per-shape collision properties applied to all shapes in a Newton scene.
Mirrors Newton’s
ModelBuilder.default_shape_cfg. Fields that Isaac Lab overrides or exposes for user overrides are declared here; fields not represented keep Newton’s upstream defaults. The struct is forwarded onto Newton’s upstreamShapeConfigviachecked_apply()at builder construction.Attributes:
Default per-shape collision margin [m].
Default per-shape contact gap [m].
Default per-shape normal contact stiffness [N/m].
Default per-shape normal contact damping [N*s/m].
Default per-shape friction coefficient [dimensionless].
- margin: float#
Default per-shape collision margin [m].
A nonzero margin (e.g.
0.01) is required for stable contact on triangle-mesh terrain — without it, lightweight robots fail to learn rough-terrain locomotion on Newton. Newton’s upstream default is0.0.
- ke: float#
Default per-shape normal contact stiffness [N/m].
Applied to shapes that lack an explicit material; per-asset materials override it. Mirrors Newton’s
ShapeConfig.kedefault.
Solver Managers#
- class isaaclab_newton.physics.NewtonMJWarpManager[source]#
Bases:
NewtonManagerNewtonManagerspecialization for the MuJoCo Warp solver.Owns construction of
SolverMuJoCo, contact-buffer allocation in both internal-MuJoCo and Newton-pipeline contact modes, and the debug convergence logging emitted from_log_solver_debug()whenNewtonCfg.debug_modeis enabled.Methods:
create_fixed_tendon_control(articulation)Build the MuJoCo tendon adapter for
articulation.Opt an articulation into the Newton actuator fast path.
add_contact_sensor([body_names_expr, ...])Add a contact sensor for reporting contacts between bodies/shapes.
add_frame_transform_sensor(shapes, ...)Add a frame transform sensor for measuring relative transforms.
add_imu_sensor(sites)Add an IMU sensor for measuring acceleration and angular velocity at sites.
add_model_change(change)Register a model change to notify the solver.
Hook after visualizers have stepped during
render().cl_register_site(body_pattern, xform, *[, ...])Register a site request for injection into prototypes before replication.
clear()Clear all Newton-specific state (callbacks cleared by super().close()).
Remove all registered callbacks.
close()Clean up Newton physics resources.
create_builder([up_axis, physics_cfg])Create a
ModelBuilderconfigured with default settings.create_visual_material_writer(batches)Compile material-to-shape addresses for the active Newton model.
create_visual_shape_color_writer(asset, ...)Compile selected articulation-body shape addresses for the active Newton model.
deregister_callback(callback_id)Remove a registered callback.
dispatch_event(event[, payload])Dispatch an event to all registered callbacks.
fix_articulation_root(articulation_prim[, stage])Ensure that an articulation root has one enabled world fixed joint.
forward()Update articulation kinematics without stepping physics.
Get the tensor backend being used ("numpy" or "torch").
Get the current Newton contact buffer, if the active solver exposes one.
Get the control object.
Get the physics simulation device.
get_dt()Get the physics timestep.
Return the active physics model.
Get the physics timestep in seconds.
Return the registered articulation views.
Return the SceneDataBackend for the SceneDataProvider.
Return the active scene data provider.
Get the current simulation time in seconds.
Get the solver substep timestep.
Get the current state.
Get the next state.
Truewhenstep()executes the full decimation loop internally.initialize(sim_context)Initialize the manager with simulation context.
Initialize the solver and collision pipeline.
Import the explicitly declared clone plan into the Newton builder.
invalidate_body_state([env_ids, env_mask])Mark selected maximal-coordinate body state as changed without requesting FK.
invalidate_fk([env_mask, env_ids, ...])Mark environments as needing FK recomputation and solver reset.
Check if fabric interface is enabled (not applicable for Newton).
pause()Pause physics simulation.
play()Start or resume physics simulation.
Sync deferred physics state to the rendering backend.
register_callback(callback, event[, order, ...])Register a callback.
register_post_actuator_callback(callback)Append a hook to the list invoked after the actuator step on every iteration.
register_post_step_callback(callback)Append a hook to the list invoked after the last solver substep on every step.
register_state_force_callback(callback)Register a graph-safe callback that applies forces before every solver substep.
Request an extended contact attribute (e.g.
"force").Request an extended state attribute (e.g.
"body_qdd").reset([soft])Reset physics simulation.
safe_callback_invoke(fn, *args[, ...])Invoke a callback, catching exceptions that would be swallowed by external event buses.
set_decimation(decimation)Set the decimation count and re-capture the CUDA graph.
setup_deformable_body(prim, deformable_type, ...)Apply Newton's token deformable anchor schemas and sync the visual mesh geometry.
Start simulation by finalizing model and initializing state.
step()Step the physics simulation.
stop()Stop physics simulation.
unregister_post_step_callback(callback)Remove a previously registered post-step callback.
Newton GL headless perspective video capture.
Block until the timeline is playing.
Attributes:
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
Whether this backend can service
--anim_recording_enabled(OVD Recorder).- classmethod create_fixed_tendon_control(articulation)[source]#
Build the MuJoCo tendon adapter for
articulation.- Parameters:
articulation¶ – Newton articulation to drive.
- Returns:
The adapter, or None when no MuJoCo actuator transmits to any of its tendons.
- classmethod activate_newton_actuator_path() None#
Opt an articulation into the Newton actuator fast path.
Idempotent — called by every Newton-fast-path articulation’s
_process_actuators_cfg:Sets
_use_newton_actuators_active, which_is_all_graphable()checks (adapter presence alone cannot distinguish the fast path from the standard Lab path).On first call, builds the single sim-level
NewtonActuatorAdapterover the full flat DOF layout; later calls reuse it.
- classmethod add_contact_sensor(body_names_expr: str | list[str] | None = None, shape_names_expr: str | list[str] | None = None, contact_partners_body_expr: str | list[str] | None = None, contact_partners_shape_expr: str | list[str] | None = None, verbose: bool = False) tuple[str | list[str] | None, str | list[str] | None, str | list[str] | None, str | list[str] | None]#
Add a contact sensor for reporting contacts between bodies/shapes.
Compiles the Isaac Lab regular expressions and delegates to
newton.sensors.SensorContact, which full-matches compiled patterns against model labels.- Parameters:
- classmethod add_frame_transform_sensor(shapes: list[int], reference_sites: list[int]) int#
Add a frame transform sensor for measuring relative transforms.
Creates a
SensorFrameTransformfrom pre-resolved shape and reference site indices, appends it to the internal list, and returns its index.
- classmethod add_imu_sensor(sites: list[int]) int#
Add an IMU sensor for measuring acceleration and angular velocity at sites.
Creates a
newton.sensors.SensorIMUfrom pre-resolved site indices, appends it to the internal list, and returns its index.- Parameters:
sites¶ – Ordered list of site indices (one per environment).
- Returns:
Index of the newly created sensor in the internal IMU sensor list.
- classmethod add_model_change(change: newton.ModelFlags) None#
Register a model change to notify the solver.
- classmethod after_visualizers_render() None#
Hook after visualizers have stepped during
render().Use for physics-backend sync (e.g. fabric) if needed. Default is a no-op.
- backend: ClassVar[NewtonBackend | None] = None#
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
- classmethod cl_register_site(body_pattern: str | None, xform: warp.transform, *, per_world: bool = False) str#
Register a site request for injection into prototypes before replication.
Sensors call this during
__init__. Sites are injected into prototype builders by_cl_inject_sites()(called fromnewton_replicate) beforeadd_builder, so they replicate correctly per-world.Identical
(body_pattern, per_world, transform)registrations share sites.The body_pattern is matched against prototype-local body labels (e.g.
"Robot/link.*") when replication is active, or against the flat builder’s body labels in the fallback path. Wildcard patterns that match multiple bodies create one site per matched body.- Parameters:
body_pattern¶ – Regex pattern matched against body labels in the prototype builder (e.g.
"Robot/link0"or"Robot/finger.*"for multi-body wildcards), orNonefor global sites (world-origin reference, etc.).xform¶ – Site transform relative to body.
per_world¶ – When
True,body_patternmust beNoneand one bodyless site is created in each cloned world’s frame.
- Returns:
Assigned site label suffix.
- classmethod clear()#
Clear all Newton-specific state (callbacks cleared by super().close()).
- classmethod clear_callbacks() None#
Remove all registered callbacks.
Do NOT reset
_callback_id— handle IDs must remain monotonically unique across the lifetime of the process. Resetting the counter would let a futureregister_callback()hand out an ID that an old, still-aliveCallbackHandle(e.g. on a sensor that has not been garbage-collected yet) holds, so when the old object eventually finalizes its__del__would deregister the new callback. This bit ovphysx’s kitless multi-context tests where twoInteractiveScene``s are created in sequence: the first scene's sensor would post-GC deregister the second scene's ``_initialize_callbackby ID collision, leaving the second sensor forever uninitialized.
- classmethod create_builder(up_axis: str | None = None, *, physics_cfg: NewtonCfg | None = None, **kwargs) newton.ModelBuilder#
Create a
ModelBuilderconfigured with default settings.Forwards
NewtonShapeCfgdefaults onto Newton’s upstreamModelBuilder.default_shape_cfgviachecked_apply(). Falls back to wrapper defaults when no Newton config is active so rough-terrain margin/gap still apply during early construction.- Parameters:
- Returns:
New builder with up-axis and per-shape defaults (gap, margin) applied.
- classmethod create_visual_material_writer(batches: tuple[VisualMaterialBatch, ...]) VisualMaterialWriter#
Compile material-to-shape addresses for the active Newton model.
- classmethod create_visual_shape_color_writer(asset: BaseArticulation, body_names: tuple[str, ...]) VisualShapeColorWriter#
Compile selected articulation-body shape addresses for the active Newton model.
- classmethod deregister_callback(callback_id: int | CallbackHandle) None#
Remove a registered callback.
- Parameters:
callback_id¶ – The ID or CallbackHandle returned by register_callback().
- classmethod dispatch_event(event: PhysicsEvent, payload: Any = None) None#
Dispatch an event to all registered callbacks.
This is the default implementation using simple callback lists. Subclasses may override or extend with platform-specific dispatch.
- classmethod fix_articulation_root(articulation_prim: Any, stage: Any = None) Any#
Ensure that an articulation root has one enabled world fixed joint.
The base implementation leaves the root in place. Backends whose parser requires a different root topology may relocate it and return the resulting root prim.
- Parameters:
- Returns:
The articulation-root prim after backend normalization.
- Raises:
NotImplementedError – If a new joint is needed and the root is not a rigid body.
- classmethod forward() None#
Update articulation kinematics without stepping physics.
Update body poses from joint coordinates via the solver-specialized FK delegate (
_eval_fk, bound to the active subclass’s_eval_fk_impl()ininitialize_solver()). Only the articulations flagged dirty in_fk_reset_maskand_world_reset_mask(seeinvalidate_fk()) are updated. The masks are consumed (zeroed) afterwards so the nextstep()does not redundantly re-solve them.Asset and scene-data reads share the same pending work. The bound delegate dispatches calls on
NewtonManagerto the active solver’s implementation.
- classmethod get_contacts() Contacts | None#
Get the current Newton contact buffer, if the active solver exposes one.
- classmethod get_control() newton.Control#
Get the control object.
- classmethod get_model() newton.Model#
Return the active physics model. Render consumers acquire their backend from the registry.
- classmethod get_scene_data_backend() SceneDataBackend | None#
Return the SceneDataBackend for the SceneDataProvider.
- classmethod get_scene_data_provider() SceneDataProvider#
Return the active scene data provider.
- classmethod get_state_0() newton.State#
Get the current state.
- classmethod get_state_1() newton.State#
Get the next state.
- classmethod handles_decimation() bool#
Truewhenstep()executes the full decimation loop internally.This is the case when all Newton actuators are CUDA-graph-safe. The full decimation loop (including the trivial
decimation=1case) is folded into a singlestep()call.
- classmethod initialize(sim_context: SimulationContext) None#
Initialize the manager with simulation context.
- Parameters:
sim_context¶ – Parent simulation context.
- classmethod initialize_solver() None#
Initialize the solver and collision pipeline.
Construct the solver and contacts, establish the initial body state, and schedule graph capture for the first step after the environment has authored its initial state. Initialization and capture do not advance physics.
- classmethod instantiate_builder_from_stage()#
Import the explicitly declared clone plan into the Newton builder.
- classmethod invalidate_body_state(env_ids: wp.array(dtype=wp.int32) | None = None, env_mask: wp.array(dtype=wp.bool) | None = None) None#
Mark selected maximal-coordinate body state as changed without requesting FK.
- classmethod invalidate_fk(env_mask: wp.array | None = None, env_ids: wp.array | None = None, articulation_ids: wp.array | None = None) None#
Mark environments as needing FK recomputation and solver reset.
Called by asset write methods that modify joint coordinates or root transforms. The masks are consumed by the next forward, raw-state, rendering, or physics-step boundary.
- Parameters:
env_mask¶ – Boolean mask of dirtied environments. Shape
(num_envs,). Used by_maskwrite methods.env_ids¶ – Integer indices of dirtied environments. Used by
_indexwrite methods.articulation_ids¶ – Mapping from
(world, arti)to model articulation index. Shape(world_count, count_per_world). Obtained fromArticulationView.articulation_ids.
- classmethod is_fabric_enabled() bool#
Check if fabric interface is enabled (not applicable for Newton).
- classmethod pre_render() None#
Sync deferred physics state to the rendering backend.
Called by
render()before cameras and visualizers read scene data. The default implementation is a no-op. Backends that defer transform writes (e.g. Newton’s dirty-flag pattern) should override this to flush pending updates.
- classmethod register_callback(callback: Callable, event: PhysicsEvent, order: int = 0, name: str | None = None, wrap_weak_ref: bool = True) CallbackHandle#
Register a callback. Passes event to parent class.
- classmethod register_post_actuator_callback(callback: Callable[[], None]) None#
Append a hook to the list invoked after the actuator step on every iteration.
Each callback runs inside the captured CUDA graph (when
_is_all_graphable()isTrue) right afterNewtonActuatorAdapter.step()and before the solver substeps, so kernel writes tostate/controlare visible to the integrator on the same iteration. Multiple articulations register their own implicit-DOF telemetry / FF-routing kernels here; all registered callbacks fire in registration order each step.
- classmethod register_post_step_callback(callback: Callable[[], None]) None#
Append a hook to the list invoked after the last solver substep on every step.
Each callback runs inside the stepped (and, when
_is_all_graphable()isTrue, captured) region right after the final solver substep of the decimation loop and before_update_sensors(), so the launches it issues are recorded into every captured CUDA graph and replayed on each tick. The hook fires exactly once perstep()call, reflecting the state after all decimation iterations (and their solver substeps) have completed – not once per substep and not once per decimation iteration. Callbacks must be graph-safe (fixed shapes, no host branching on device data) and must be registered before capture. Articulations with non-identity ordering register their backend-to-user state republish here; all registered callbacks fire in registration order each step.
- classmethod register_state_force_callback(callback: Callable[[newton.State], None]) None#
Register a graph-safe callback that applies forces before every solver substep.
Callbacks must be registered before solver initialization so they are included in CUDA graph capture.
- Parameters:
callback¶ – Function that adds forces [N, N·m] to the provided state.
- classmethod request_extended_contact_attribute(attr: str) None#
Request an extended contact attribute (e.g.
"force").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the model instart_simulation()so that subsequentContactscreation includes them.- Parameters:
attr¶ – Contact attribute name.
- classmethod request_extended_state_attribute(attr: str) None#
Request an extended state attribute (e.g.
"body_qdd").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the builder instart_simulation()so that subsequentmodel.state()calls allocate them.- Parameters:
attr¶ – State attribute name (must be in
State.EXTENDED_ATTRIBUTES).
- classmethod reset(soft: bool = False) None#
Reset physics simulation.
A hard reset (
soft=False) re-finalizes the Newton model, reallocating its device arrays. The cached collision pipeline, contacts and any captured CUDA graph reference the old buffers, so they are released here and rebuilt against the re-finalized model byinitialize_solver(). This avoids the illegal CUDA memory access (CUDA error 700) that would otherwise occur on the first step after a hard reset.A soft reset (
soft=True) skips this full reinitialization and reuses the existing model, solver, collision pipeline and CUDA graph.- Parameters:
soft¶ – If True, skip full reinitialization.
- static safe_callback_invoke(fn: Callable, *args, physics_manager: type[PhysicsManager] | None = None) None#
Invoke a callback, catching exceptions that would be swallowed by external event buses.
Ignores
ReferenceError(from garbage-collected weakref proxies). All other exceptions are forwarded to physics_manager.``store_callback_exception`` when available (see note below), or re-raised immediately otherwise.- Note (Octi):
The carb event bus used by PhysX/Omniverse silently swallows exceptions raised inside callbacks.
PhysxManagerworks around this by storing the exception and re-raising it after event dispatch completes (inreset()/step()). Backends that dispatch events directly (e.g. Newton) don’t need this — exceptions propagate normally — sostore_callback_exceptionis not called for them. This is a known wart; a cleaner solution is actively being explored.
- classmethod set_decimation(decimation: int) None#
Set the decimation count and re-capture the CUDA graph.
When all actuators are graphable the entire decimation loop (actuators + solver substeps, repeated decimation times) is captured as a single CUDA graph.
Invalidate the existing graph when the loop changes. Its replacement is captured immediately before the next requested step, after authored state is reconciled.
- classmethod setup_deformable_body(prim: Any, deformable_type: str, sim_mesh_prim: Any, vis_mesh_prim: Any) None#
Apply Newton’s token deformable anchor schemas and sync the visual mesh geometry.
- classmethod start_simulation() None#
Start simulation by finalizing model and initializing state.
This function finalizes the model and initializes the simulation state. Note: Collision pipeline is initialized later in initialize_solver() after we determine whether the solver needs external collision detection.
- classmethod step() None#
Step the physics simulation.
The stepping logic follows one of two paths depending on whether all actuators are CUDA-graph-safe:
All-graphable path (
_simulate_full()):Actuators and solver substeps are captured together in a single CUDA graph containing the full
decimation x (actuators + solver substeps)loop.Eager-actuator path (fallback, some actuators not graph-safe):
Actuators are stepped eagerly on the CPU timeline (outside the graph), then a graph containing only the solver substeps is launched via
_simulate_physics_only().In both paths the sequence within one physics step is:
zero actuated DOFs in control.joint_f -> actuator.step (computes effort, writes to control.joint_f) -> solver.step x num_substeps (integrates, reads control.joint_f) -> sensors.update
- supports_anim_recording: ClassVar[bool] = False#
Whether this backend can service
--anim_recording_enabled(OVD Recorder).Overridden by backends that implement the recorder (currently PhysX-only).
- classmethod unregister_post_step_callback(callback: Callable[[], None]) None#
Remove a previously registered post-step callback.
Symmetric to
register_post_step_callback(), this lets an articulation deregister its republish hook when its callbacks are cleared so the bound method does not linger on the class-level list after the articulation is gone. Removing a callback that was never registered (or was already removed) is a safe no-op, matching the tolerant deregistration of other handles.
- class isaaclab_newton.physics.NewtonVBDManager[source]#
Bases:
NewtonManagerNewton manager specialization for the VBD solver.
Methods:
Opt an articulation into the Newton actuator fast path.
add_contact_sensor([body_names_expr, ...])Add a contact sensor for reporting contacts between bodies/shapes.
add_frame_transform_sensor(shapes, ...)Add a frame transform sensor for measuring relative transforms.
add_imu_sensor(sites)Add an IMU sensor for measuring acceleration and angular velocity at sites.
add_model_change(change)Register a model change to notify the solver.
Hook after visualizers have stepped during
render().cl_register_site(body_pattern, xform, *[, ...])Register a site request for injection into prototypes before replication.
clear()Clear all Newton-specific state (callbacks cleared by super().close()).
Remove all registered callbacks.
close()Clean up Newton physics resources.
create_builder([up_axis, physics_cfg])Create a
ModelBuilderconfigured with default settings.create_fixed_tendon_control(articulation)Build the solver's fixed-tendon command adapter for
articulation.create_visual_material_writer(batches)Compile material-to-shape addresses for the active Newton model.
create_visual_shape_color_writer(asset, ...)Compile selected articulation-body shape addresses for the active Newton model.
deregister_callback(callback_id)Remove a registered callback.
dispatch_event(event[, payload])Dispatch an event to all registered callbacks.
fix_articulation_root(articulation_prim[, stage])Ensure that an articulation root has one enabled world fixed joint.
forward()Update articulation kinematics without stepping physics.
Get the tensor backend being used ("numpy" or "torch").
Get the current Newton contact buffer, if the active solver exposes one.
Get the control object.
Get the physics simulation device.
get_dt()Get the physics timestep.
Return the active physics model.
Get the physics timestep in seconds.
Return the registered articulation views.
Return the SceneDataBackend for the SceneDataProvider.
Return the active scene data provider.
Get the current simulation time in seconds.
Get the solver substep timestep.
Get the current state.
Get the next state.
Truewhenstep()executes the full decimation loop internally.initialize(sim_context)Initialize the manager with simulation context.
Initialize the solver and collision pipeline.
Import the explicitly declared clone plan into the Newton builder.
invalidate_body_state([env_ids, env_mask])Mark selected maximal-coordinate body state as changed without requesting FK.
invalidate_fk([env_mask, env_ids, ...])Mark environments as needing FK recomputation and solver reset.
Check if fabric interface is enabled (not applicable for Newton).
pause()Pause physics simulation.
play()Start or resume physics simulation.
Sync deferred physics state to the rendering backend.
register_callback(callback, event[, order, ...])Register a callback.
register_post_actuator_callback(callback)Append a hook to the list invoked after the actuator step on every iteration.
register_post_step_callback(callback)Append a hook to the list invoked after the last solver substep on every step.
register_state_force_callback(callback)Register a graph-safe callback that applies forces before every solver substep.
Request an extended contact attribute (e.g.
"force").Request an extended state attribute (e.g.
"body_qdd").reset([soft])Reset physics simulation.
safe_callback_invoke(fn, *args[, ...])Invoke a callback, catching exceptions that would be swallowed by external event buses.
set_decimation(decimation)Set the decimation count and re-capture the CUDA graph.
setup_deformable_body(prim, deformable_type, ...)Apply Newton's token deformable anchor schemas and sync the visual mesh geometry.
Start simulation by finalizing model and initializing state.
step()Step the physics simulation.
stop()Stop physics simulation.
unregister_post_step_callback(callback)Remove a previously registered post-step callback.
Newton GL headless perspective video capture.
Block until the timeline is playing.
Attributes:
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
Whether this backend can service
--anim_recording_enabled(OVD Recorder).- classmethod activate_newton_actuator_path() None#
Opt an articulation into the Newton actuator fast path.
Idempotent — called by every Newton-fast-path articulation’s
_process_actuators_cfg:Sets
_use_newton_actuators_active, which_is_all_graphable()checks (adapter presence alone cannot distinguish the fast path from the standard Lab path).On first call, builds the single sim-level
NewtonActuatorAdapterover the full flat DOF layout; later calls reuse it.
- classmethod add_contact_sensor(body_names_expr: str | list[str] | None = None, shape_names_expr: str | list[str] | None = None, contact_partners_body_expr: str | list[str] | None = None, contact_partners_shape_expr: str | list[str] | None = None, verbose: bool = False) tuple[str | list[str] | None, str | list[str] | None, str | list[str] | None, str | list[str] | None]#
Add a contact sensor for reporting contacts between bodies/shapes.
Compiles the Isaac Lab regular expressions and delegates to
newton.sensors.SensorContact, which full-matches compiled patterns against model labels.- Parameters:
- classmethod add_frame_transform_sensor(shapes: list[int], reference_sites: list[int]) int#
Add a frame transform sensor for measuring relative transforms.
Creates a
SensorFrameTransformfrom pre-resolved shape and reference site indices, appends it to the internal list, and returns its index.
- classmethod add_imu_sensor(sites: list[int]) int#
Add an IMU sensor for measuring acceleration and angular velocity at sites.
Creates a
newton.sensors.SensorIMUfrom pre-resolved site indices, appends it to the internal list, and returns its index.- Parameters:
sites¶ – Ordered list of site indices (one per environment).
- Returns:
Index of the newly created sensor in the internal IMU sensor list.
- classmethod add_model_change(change: newton.ModelFlags) None#
Register a model change to notify the solver.
- classmethod after_visualizers_render() None#
Hook after visualizers have stepped during
render().Use for physics-backend sync (e.g. fabric) if needed. Default is a no-op.
- backend: ClassVar[NewtonBackend | None] = None#
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
- classmethod cl_register_site(body_pattern: str | None, xform: warp.transform, *, per_world: bool = False) str#
Register a site request for injection into prototypes before replication.
Sensors call this during
__init__. Sites are injected into prototype builders by_cl_inject_sites()(called fromnewton_replicate) beforeadd_builder, so they replicate correctly per-world.Identical
(body_pattern, per_world, transform)registrations share sites.The body_pattern is matched against prototype-local body labels (e.g.
"Robot/link.*") when replication is active, or against the flat builder’s body labels in the fallback path. Wildcard patterns that match multiple bodies create one site per matched body.- Parameters:
body_pattern¶ – Regex pattern matched against body labels in the prototype builder (e.g.
"Robot/link0"or"Robot/finger.*"for multi-body wildcards), orNonefor global sites (world-origin reference, etc.).xform¶ – Site transform relative to body.
per_world¶ – When
True,body_patternmust beNoneand one bodyless site is created in each cloned world’s frame.
- Returns:
Assigned site label suffix.
- classmethod clear()#
Clear all Newton-specific state (callbacks cleared by super().close()).
- classmethod clear_callbacks() None#
Remove all registered callbacks.
Do NOT reset
_callback_id— handle IDs must remain monotonically unique across the lifetime of the process. Resetting the counter would let a futureregister_callback()hand out an ID that an old, still-aliveCallbackHandle(e.g. on a sensor that has not been garbage-collected yet) holds, so when the old object eventually finalizes its__del__would deregister the new callback. This bit ovphysx’s kitless multi-context tests where twoInteractiveScene``s are created in sequence: the first scene's sensor would post-GC deregister the second scene's ``_initialize_callbackby ID collision, leaving the second sensor forever uninitialized.
- classmethod create_builder(up_axis: str | None = None, *, physics_cfg: NewtonCfg | None = None, **kwargs) newton.ModelBuilder#
Create a
ModelBuilderconfigured with default settings.Forwards
NewtonShapeCfgdefaults onto Newton’s upstreamModelBuilder.default_shape_cfgviachecked_apply(). Falls back to wrapper defaults when no Newton config is active so rough-terrain margin/gap still apply during early construction.- Parameters:
- Returns:
New builder with up-axis and per-shape defaults (gap, margin) applied.
- classmethod create_fixed_tendon_control(articulation)#
Build the solver’s fixed-tendon command adapter for
articulation.Tendon state is backend-neutral and lives on the articulation; how a target reaches the solver is not. MuJoCo drives tendons through actuator controls, so only the MJWarp manager implements this. The articulation stores what it gets, the way it stores its actuator control, and never needs to know which solver is active.
Only the MuJoCo solver registers the
mujoco:tendonfrequency, so an articulation reports tendons under MJWarp alone and this base is unreachable through the normal path. Reaching it means a solver gained tendons with no way to command them, which is worth saying rather than returning nothing –Nonealready means “this asset’s tendons are all passive”.- Parameters:
articulation¶ – Newton articulation to drive.
- Raises:
NotImplementedError – Always – this solver has no fixed-tendon transmission.
- classmethod create_visual_material_writer(batches: tuple[VisualMaterialBatch, ...]) VisualMaterialWriter#
Compile material-to-shape addresses for the active Newton model.
- classmethod create_visual_shape_color_writer(asset: BaseArticulation, body_names: tuple[str, ...]) VisualShapeColorWriter#
Compile selected articulation-body shape addresses for the active Newton model.
- classmethod deregister_callback(callback_id: int | CallbackHandle) None#
Remove a registered callback.
- Parameters:
callback_id¶ – The ID or CallbackHandle returned by register_callback().
- classmethod dispatch_event(event: PhysicsEvent, payload: Any = None) None#
Dispatch an event to all registered callbacks.
This is the default implementation using simple callback lists. Subclasses may override or extend with platform-specific dispatch.
- classmethod fix_articulation_root(articulation_prim: Any, stage: Any = None) Any#
Ensure that an articulation root has one enabled world fixed joint.
The base implementation leaves the root in place. Backends whose parser requires a different root topology may relocate it and return the resulting root prim.
- Parameters:
- Returns:
The articulation-root prim after backend normalization.
- Raises:
NotImplementedError – If a new joint is needed and the root is not a rigid body.
- classmethod forward() None#
Update articulation kinematics without stepping physics.
Update body poses from joint coordinates via the solver-specialized FK delegate (
_eval_fk, bound to the active subclass’s_eval_fk_impl()ininitialize_solver()). Only the articulations flagged dirty in_fk_reset_maskand_world_reset_mask(seeinvalidate_fk()) are updated. The masks are consumed (zeroed) afterwards so the nextstep()does not redundantly re-solve them.Asset and scene-data reads share the same pending work. The bound delegate dispatches calls on
NewtonManagerto the active solver’s implementation.
- classmethod get_contacts() Contacts | None#
Get the current Newton contact buffer, if the active solver exposes one.
- classmethod get_control() newton.Control#
Get the control object.
- classmethod get_model() newton.Model#
Return the active physics model. Render consumers acquire their backend from the registry.
- classmethod get_scene_data_backend() SceneDataBackend | None#
Return the SceneDataBackend for the SceneDataProvider.
- classmethod get_scene_data_provider() SceneDataProvider#
Return the active scene data provider.
- classmethod get_state_0() newton.State#
Get the current state.
- classmethod get_state_1() newton.State#
Get the next state.
- classmethod handles_decimation() bool#
Truewhenstep()executes the full decimation loop internally.This is the case when all Newton actuators are CUDA-graph-safe. The full decimation loop (including the trivial
decimation=1case) is folded into a singlestep()call.
- classmethod initialize(sim_context: SimulationContext) None#
Initialize the manager with simulation context.
- Parameters:
sim_context¶ – Parent simulation context.
- classmethod initialize_solver() None#
Initialize the solver and collision pipeline.
Construct the solver and contacts, establish the initial body state, and schedule graph capture for the first step after the environment has authored its initial state. Initialization and capture do not advance physics.
- classmethod instantiate_builder_from_stage()#
Import the explicitly declared clone plan into the Newton builder.
- classmethod invalidate_body_state(env_ids: wp.array(dtype=wp.int32) | None = None, env_mask: wp.array(dtype=wp.bool) | None = None) None#
Mark selected maximal-coordinate body state as changed without requesting FK.
- classmethod invalidate_fk(env_mask: wp.array | None = None, env_ids: wp.array | None = None, articulation_ids: wp.array | None = None) None#
Mark environments as needing FK recomputation and solver reset.
Called by asset write methods that modify joint coordinates or root transforms. The masks are consumed by the next forward, raw-state, rendering, or physics-step boundary.
- Parameters:
env_mask¶ – Boolean mask of dirtied environments. Shape
(num_envs,). Used by_maskwrite methods.env_ids¶ – Integer indices of dirtied environments. Used by
_indexwrite methods.articulation_ids¶ – Mapping from
(world, arti)to model articulation index. Shape(world_count, count_per_world). Obtained fromArticulationView.articulation_ids.
- classmethod is_fabric_enabled() bool#
Check if fabric interface is enabled (not applicable for Newton).
- classmethod pre_render() None#
Sync deferred physics state to the rendering backend.
Called by
render()before cameras and visualizers read scene data. The default implementation is a no-op. Backends that defer transform writes (e.g. Newton’s dirty-flag pattern) should override this to flush pending updates.
- classmethod register_callback(callback: Callable, event: PhysicsEvent, order: int = 0, name: str | None = None, wrap_weak_ref: bool = True) CallbackHandle#
Register a callback. Passes event to parent class.
- classmethod register_post_actuator_callback(callback: Callable[[], None]) None#
Append a hook to the list invoked after the actuator step on every iteration.
Each callback runs inside the captured CUDA graph (when
_is_all_graphable()isTrue) right afterNewtonActuatorAdapter.step()and before the solver substeps, so kernel writes tostate/controlare visible to the integrator on the same iteration. Multiple articulations register their own implicit-DOF telemetry / FF-routing kernels here; all registered callbacks fire in registration order each step.
- classmethod register_post_step_callback(callback: Callable[[], None]) None#
Append a hook to the list invoked after the last solver substep on every step.
Each callback runs inside the stepped (and, when
_is_all_graphable()isTrue, captured) region right after the final solver substep of the decimation loop and before_update_sensors(), so the launches it issues are recorded into every captured CUDA graph and replayed on each tick. The hook fires exactly once perstep()call, reflecting the state after all decimation iterations (and their solver substeps) have completed – not once per substep and not once per decimation iteration. Callbacks must be graph-safe (fixed shapes, no host branching on device data) and must be registered before capture. Articulations with non-identity ordering register their backend-to-user state republish here; all registered callbacks fire in registration order each step.
- classmethod register_state_force_callback(callback: Callable[[newton.State], None]) None#
Register a graph-safe callback that applies forces before every solver substep.
Callbacks must be registered before solver initialization so they are included in CUDA graph capture.
- Parameters:
callback¶ – Function that adds forces [N, N·m] to the provided state.
- classmethod request_extended_contact_attribute(attr: str) None#
Request an extended contact attribute (e.g.
"force").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the model instart_simulation()so that subsequentContactscreation includes them.- Parameters:
attr¶ – Contact attribute name.
- classmethod request_extended_state_attribute(attr: str) None#
Request an extended state attribute (e.g.
"body_qdd").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the builder instart_simulation()so that subsequentmodel.state()calls allocate them.- Parameters:
attr¶ – State attribute name (must be in
State.EXTENDED_ATTRIBUTES).
- classmethod reset(soft: bool = False) None#
Reset physics simulation.
A hard reset (
soft=False) re-finalizes the Newton model, reallocating its device arrays. The cached collision pipeline, contacts and any captured CUDA graph reference the old buffers, so they are released here and rebuilt against the re-finalized model byinitialize_solver(). This avoids the illegal CUDA memory access (CUDA error 700) that would otherwise occur on the first step after a hard reset.A soft reset (
soft=True) skips this full reinitialization and reuses the existing model, solver, collision pipeline and CUDA graph.- Parameters:
soft¶ – If True, skip full reinitialization.
- static safe_callback_invoke(fn: Callable, *args, physics_manager: type[PhysicsManager] | None = None) None#
Invoke a callback, catching exceptions that would be swallowed by external event buses.
Ignores
ReferenceError(from garbage-collected weakref proxies). All other exceptions are forwarded to physics_manager.``store_callback_exception`` when available (see note below), or re-raised immediately otherwise.- Note (Octi):
The carb event bus used by PhysX/Omniverse silently swallows exceptions raised inside callbacks.
PhysxManagerworks around this by storing the exception and re-raising it after event dispatch completes (inreset()/step()). Backends that dispatch events directly (e.g. Newton) don’t need this — exceptions propagate normally — sostore_callback_exceptionis not called for them. This is a known wart; a cleaner solution is actively being explored.
- classmethod set_decimation(decimation: int) None#
Set the decimation count and re-capture the CUDA graph.
When all actuators are graphable the entire decimation loop (actuators + solver substeps, repeated decimation times) is captured as a single CUDA graph.
Invalidate the existing graph when the loop changes. Its replacement is captured immediately before the next requested step, after authored state is reconciled.
- classmethod setup_deformable_body(prim: Any, deformable_type: str, sim_mesh_prim: Any, vis_mesh_prim: Any) None#
Apply Newton’s token deformable anchor schemas and sync the visual mesh geometry.
- classmethod start_simulation() None#
Start simulation by finalizing model and initializing state.
This function finalizes the model and initializes the simulation state. Note: Collision pipeline is initialized later in initialize_solver() after we determine whether the solver needs external collision detection.
- classmethod step() None#
Step the physics simulation.
The stepping logic follows one of two paths depending on whether all actuators are CUDA-graph-safe:
All-graphable path (
_simulate_full()):Actuators and solver substeps are captured together in a single CUDA graph containing the full
decimation x (actuators + solver substeps)loop.Eager-actuator path (fallback, some actuators not graph-safe):
Actuators are stepped eagerly on the CPU timeline (outside the graph), then a graph containing only the solver substeps is launched via
_simulate_physics_only().In both paths the sequence within one physics step is:
zero actuated DOFs in control.joint_f -> actuator.step (computes effort, writes to control.joint_f) -> solver.step x num_substeps (integrates, reads control.joint_f) -> sensors.update
- supports_anim_recording: ClassVar[bool] = False#
Whether this backend can service
--anim_recording_enabled(OVD Recorder).Overridden by backends that implement the recorder (currently PhysX-only).
- classmethod unregister_post_step_callback(callback: Callable[[], None]) None#
Remove a previously registered post-step callback.
Symmetric to
register_post_step_callback(), this lets an articulation deregister its republish hook when its callbacks are cleared so the bound method does not linger on the class-level list after the articulation is gone. Removing a callback that was never registered (or was already removed) is a safe no-op, matching the tolerant deregistration of other handles.
- class isaaclab_newton.physics.NewtonXPBDManager[source]#
Bases:
NewtonManagerNewtonManagerspecialization for the XPBD solver.Always uses Newton’s
CollisionPipelinefor contact handling.Methods:
Opt an articulation into the Newton actuator fast path.
add_contact_sensor([body_names_expr, ...])Add a contact sensor for reporting contacts between bodies/shapes.
add_frame_transform_sensor(shapes, ...)Add a frame transform sensor for measuring relative transforms.
add_imu_sensor(sites)Add an IMU sensor for measuring acceleration and angular velocity at sites.
add_model_change(change)Register a model change to notify the solver.
Hook after visualizers have stepped during
render().cl_register_site(body_pattern, xform, *[, ...])Register a site request for injection into prototypes before replication.
clear()Clear all Newton-specific state (callbacks cleared by super().close()).
Remove all registered callbacks.
close()Clean up Newton physics resources.
create_builder([up_axis, physics_cfg])Create a
ModelBuilderconfigured with default settings.create_fixed_tendon_control(articulation)Build the solver's fixed-tendon command adapter for
articulation.create_visual_material_writer(batches)Compile material-to-shape addresses for the active Newton model.
create_visual_shape_color_writer(asset, ...)Compile selected articulation-body shape addresses for the active Newton model.
deregister_callback(callback_id)Remove a registered callback.
dispatch_event(event[, payload])Dispatch an event to all registered callbacks.
fix_articulation_root(articulation_prim[, stage])Ensure that an articulation root has one enabled world fixed joint.
forward()Update articulation kinematics without stepping physics.
Get the tensor backend being used ("numpy" or "torch").
Get the current Newton contact buffer, if the active solver exposes one.
Get the control object.
Get the physics simulation device.
get_dt()Get the physics timestep.
Return the active physics model.
Get the physics timestep in seconds.
Return the registered articulation views.
Return the SceneDataBackend for the SceneDataProvider.
Return the active scene data provider.
Get the current simulation time in seconds.
Get the solver substep timestep.
Get the current state.
Get the next state.
Truewhenstep()executes the full decimation loop internally.initialize(sim_context)Initialize the manager with simulation context.
Initialize the solver and collision pipeline.
Import the explicitly declared clone plan into the Newton builder.
invalidate_body_state([env_ids, env_mask])Mark selected maximal-coordinate body state as changed without requesting FK.
invalidate_fk([env_mask, env_ids, ...])Mark environments as needing FK recomputation and solver reset.
Check if fabric interface is enabled (not applicable for Newton).
pause()Pause physics simulation.
play()Start or resume physics simulation.
Sync deferred physics state to the rendering backend.
register_callback(callback, event[, order, ...])Register a callback.
register_post_actuator_callback(callback)Append a hook to the list invoked after the actuator step on every iteration.
register_post_step_callback(callback)Append a hook to the list invoked after the last solver substep on every step.
register_state_force_callback(callback)Register a graph-safe callback that applies forces before every solver substep.
Request an extended contact attribute (e.g.
"force").Request an extended state attribute (e.g.
"body_qdd").reset([soft])Reset physics simulation.
safe_callback_invoke(fn, *args[, ...])Invoke a callback, catching exceptions that would be swallowed by external event buses.
set_decimation(decimation)Set the decimation count and re-capture the CUDA graph.
setup_deformable_body(prim, deformable_type, ...)Apply Newton's token deformable anchor schemas and sync the visual mesh geometry.
Start simulation by finalizing model and initializing state.
step()Step the physics simulation.
stop()Stop physics simulation.
unregister_post_step_callback(callback)Remove a previously registered post-step callback.
Newton GL headless perspective video capture.
Block until the timeline is playing.
Attributes:
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
Whether this backend can service
--anim_recording_enabled(OVD Recorder).- classmethod activate_newton_actuator_path() None#
Opt an articulation into the Newton actuator fast path.
Idempotent — called by every Newton-fast-path articulation’s
_process_actuators_cfg:Sets
_use_newton_actuators_active, which_is_all_graphable()checks (adapter presence alone cannot distinguish the fast path from the standard Lab path).On first call, builds the single sim-level
NewtonActuatorAdapterover the full flat DOF layout; later calls reuse it.
- classmethod add_contact_sensor(body_names_expr: str | list[str] | None = None, shape_names_expr: str | list[str] | None = None, contact_partners_body_expr: str | list[str] | None = None, contact_partners_shape_expr: str | list[str] | None = None, verbose: bool = False) tuple[str | list[str] | None, str | list[str] | None, str | list[str] | None, str | list[str] | None]#
Add a contact sensor for reporting contacts between bodies/shapes.
Compiles the Isaac Lab regular expressions and delegates to
newton.sensors.SensorContact, which full-matches compiled patterns against model labels.- Parameters:
- classmethod add_frame_transform_sensor(shapes: list[int], reference_sites: list[int]) int#
Add a frame transform sensor for measuring relative transforms.
Creates a
SensorFrameTransformfrom pre-resolved shape and reference site indices, appends it to the internal list, and returns its index.
- classmethod add_imu_sensor(sites: list[int]) int#
Add an IMU sensor for measuring acceleration and angular velocity at sites.
Creates a
newton.sensors.SensorIMUfrom pre-resolved site indices, appends it to the internal list, and returns its index.- Parameters:
sites¶ – Ordered list of site indices (one per environment).
- Returns:
Index of the newly created sensor in the internal IMU sensor list.
- classmethod add_model_change(change: newton.ModelFlags) None#
Register a model change to notify the solver.
- classmethod after_visualizers_render() None#
Hook after visualizers have stepped during
render().Use for physics-backend sync (e.g. fabric) if needed. Default is a no-op.
- backend: ClassVar[NewtonBackend | None] = None#
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
- classmethod cl_register_site(body_pattern: str | None, xform: warp.transform, *, per_world: bool = False) str#
Register a site request for injection into prototypes before replication.
Sensors call this during
__init__. Sites are injected into prototype builders by_cl_inject_sites()(called fromnewton_replicate) beforeadd_builder, so they replicate correctly per-world.Identical
(body_pattern, per_world, transform)registrations share sites.The body_pattern is matched against prototype-local body labels (e.g.
"Robot/link.*") when replication is active, or against the flat builder’s body labels in the fallback path. Wildcard patterns that match multiple bodies create one site per matched body.- Parameters:
body_pattern¶ – Regex pattern matched against body labels in the prototype builder (e.g.
"Robot/link0"or"Robot/finger.*"for multi-body wildcards), orNonefor global sites (world-origin reference, etc.).xform¶ – Site transform relative to body.
per_world¶ – When
True,body_patternmust beNoneand one bodyless site is created in each cloned world’s frame.
- Returns:
Assigned site label suffix.
- classmethod clear()#
Clear all Newton-specific state (callbacks cleared by super().close()).
- classmethod clear_callbacks() None#
Remove all registered callbacks.
Do NOT reset
_callback_id— handle IDs must remain monotonically unique across the lifetime of the process. Resetting the counter would let a futureregister_callback()hand out an ID that an old, still-aliveCallbackHandle(e.g. on a sensor that has not been garbage-collected yet) holds, so when the old object eventually finalizes its__del__would deregister the new callback. This bit ovphysx’s kitless multi-context tests where twoInteractiveScene``s are created in sequence: the first scene's sensor would post-GC deregister the second scene's ``_initialize_callbackby ID collision, leaving the second sensor forever uninitialized.
- classmethod create_builder(up_axis: str | None = None, *, physics_cfg: NewtonCfg | None = None, **kwargs) newton.ModelBuilder#
Create a
ModelBuilderconfigured with default settings.Forwards
NewtonShapeCfgdefaults onto Newton’s upstreamModelBuilder.default_shape_cfgviachecked_apply(). Falls back to wrapper defaults when no Newton config is active so rough-terrain margin/gap still apply during early construction.- Parameters:
- Returns:
New builder with up-axis and per-shape defaults (gap, margin) applied.
- classmethod create_fixed_tendon_control(articulation)#
Build the solver’s fixed-tendon command adapter for
articulation.Tendon state is backend-neutral and lives on the articulation; how a target reaches the solver is not. MuJoCo drives tendons through actuator controls, so only the MJWarp manager implements this. The articulation stores what it gets, the way it stores its actuator control, and never needs to know which solver is active.
Only the MuJoCo solver registers the
mujoco:tendonfrequency, so an articulation reports tendons under MJWarp alone and this base is unreachable through the normal path. Reaching it means a solver gained tendons with no way to command them, which is worth saying rather than returning nothing –Nonealready means “this asset’s tendons are all passive”.- Parameters:
articulation¶ – Newton articulation to drive.
- Raises:
NotImplementedError – Always – this solver has no fixed-tendon transmission.
- classmethod create_visual_material_writer(batches: tuple[VisualMaterialBatch, ...]) VisualMaterialWriter#
Compile material-to-shape addresses for the active Newton model.
- classmethod create_visual_shape_color_writer(asset: BaseArticulation, body_names: tuple[str, ...]) VisualShapeColorWriter#
Compile selected articulation-body shape addresses for the active Newton model.
- classmethod deregister_callback(callback_id: int | CallbackHandle) None#
Remove a registered callback.
- Parameters:
callback_id¶ – The ID or CallbackHandle returned by register_callback().
- classmethod dispatch_event(event: PhysicsEvent, payload: Any = None) None#
Dispatch an event to all registered callbacks.
This is the default implementation using simple callback lists. Subclasses may override or extend with platform-specific dispatch.
- classmethod fix_articulation_root(articulation_prim: Any, stage: Any = None) Any#
Ensure that an articulation root has one enabled world fixed joint.
The base implementation leaves the root in place. Backends whose parser requires a different root topology may relocate it and return the resulting root prim.
- Parameters:
- Returns:
The articulation-root prim after backend normalization.
- Raises:
NotImplementedError – If a new joint is needed and the root is not a rigid body.
- classmethod forward() None#
Update articulation kinematics without stepping physics.
Update body poses from joint coordinates via the solver-specialized FK delegate (
_eval_fk, bound to the active subclass’s_eval_fk_impl()ininitialize_solver()). Only the articulations flagged dirty in_fk_reset_maskand_world_reset_mask(seeinvalidate_fk()) are updated. The masks are consumed (zeroed) afterwards so the nextstep()does not redundantly re-solve them.Asset and scene-data reads share the same pending work. The bound delegate dispatches calls on
NewtonManagerto the active solver’s implementation.
- classmethod get_contacts() Contacts | None#
Get the current Newton contact buffer, if the active solver exposes one.
- classmethod get_control() newton.Control#
Get the control object.
- classmethod get_model() newton.Model#
Return the active physics model. Render consumers acquire their backend from the registry.
- classmethod get_scene_data_backend() SceneDataBackend | None#
Return the SceneDataBackend for the SceneDataProvider.
- classmethod get_scene_data_provider() SceneDataProvider#
Return the active scene data provider.
- classmethod get_state_0() newton.State#
Get the current state.
- classmethod get_state_1() newton.State#
Get the next state.
- classmethod handles_decimation() bool#
Truewhenstep()executes the full decimation loop internally.This is the case when all Newton actuators are CUDA-graph-safe. The full decimation loop (including the trivial
decimation=1case) is folded into a singlestep()call.
- classmethod initialize(sim_context: SimulationContext) None#
Initialize the manager with simulation context.
- Parameters:
sim_context¶ – Parent simulation context.
- classmethod initialize_solver() None#
Initialize the solver and collision pipeline.
Construct the solver and contacts, establish the initial body state, and schedule graph capture for the first step after the environment has authored its initial state. Initialization and capture do not advance physics.
- classmethod instantiate_builder_from_stage()#
Import the explicitly declared clone plan into the Newton builder.
- classmethod invalidate_body_state(env_ids: wp.array(dtype=wp.int32) | None = None, env_mask: wp.array(dtype=wp.bool) | None = None) None#
Mark selected maximal-coordinate body state as changed without requesting FK.
- classmethod invalidate_fk(env_mask: wp.array | None = None, env_ids: wp.array | None = None, articulation_ids: wp.array | None = None) None#
Mark environments as needing FK recomputation and solver reset.
Called by asset write methods that modify joint coordinates or root transforms. The masks are consumed by the next forward, raw-state, rendering, or physics-step boundary.
- Parameters:
env_mask¶ – Boolean mask of dirtied environments. Shape
(num_envs,). Used by_maskwrite methods.env_ids¶ – Integer indices of dirtied environments. Used by
_indexwrite methods.articulation_ids¶ – Mapping from
(world, arti)to model articulation index. Shape(world_count, count_per_world). Obtained fromArticulationView.articulation_ids.
- classmethod is_fabric_enabled() bool#
Check if fabric interface is enabled (not applicable for Newton).
- classmethod pre_render() None#
Sync deferred physics state to the rendering backend.
Called by
render()before cameras and visualizers read scene data. The default implementation is a no-op. Backends that defer transform writes (e.g. Newton’s dirty-flag pattern) should override this to flush pending updates.
- classmethod register_callback(callback: Callable, event: PhysicsEvent, order: int = 0, name: str | None = None, wrap_weak_ref: bool = True) CallbackHandle#
Register a callback. Passes event to parent class.
- classmethod register_post_actuator_callback(callback: Callable[[], None]) None#
Append a hook to the list invoked after the actuator step on every iteration.
Each callback runs inside the captured CUDA graph (when
_is_all_graphable()isTrue) right afterNewtonActuatorAdapter.step()and before the solver substeps, so kernel writes tostate/controlare visible to the integrator on the same iteration. Multiple articulations register their own implicit-DOF telemetry / FF-routing kernels here; all registered callbacks fire in registration order each step.
- classmethod register_post_step_callback(callback: Callable[[], None]) None#
Append a hook to the list invoked after the last solver substep on every step.
Each callback runs inside the stepped (and, when
_is_all_graphable()isTrue, captured) region right after the final solver substep of the decimation loop and before_update_sensors(), so the launches it issues are recorded into every captured CUDA graph and replayed on each tick. The hook fires exactly once perstep()call, reflecting the state after all decimation iterations (and their solver substeps) have completed – not once per substep and not once per decimation iteration. Callbacks must be graph-safe (fixed shapes, no host branching on device data) and must be registered before capture. Articulations with non-identity ordering register their backend-to-user state republish here; all registered callbacks fire in registration order each step.
- classmethod register_state_force_callback(callback: Callable[[newton.State], None]) None#
Register a graph-safe callback that applies forces before every solver substep.
Callbacks must be registered before solver initialization so they are included in CUDA graph capture.
- Parameters:
callback¶ – Function that adds forces [N, N·m] to the provided state.
- classmethod request_extended_contact_attribute(attr: str) None#
Request an extended contact attribute (e.g.
"force").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the model instart_simulation()so that subsequentContactscreation includes them.- Parameters:
attr¶ – Contact attribute name.
- classmethod request_extended_state_attribute(attr: str) None#
Request an extended state attribute (e.g.
"body_qdd").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the builder instart_simulation()so that subsequentmodel.state()calls allocate them.- Parameters:
attr¶ – State attribute name (must be in
State.EXTENDED_ATTRIBUTES).
- classmethod reset(soft: bool = False) None#
Reset physics simulation.
A hard reset (
soft=False) re-finalizes the Newton model, reallocating its device arrays. The cached collision pipeline, contacts and any captured CUDA graph reference the old buffers, so they are released here and rebuilt against the re-finalized model byinitialize_solver(). This avoids the illegal CUDA memory access (CUDA error 700) that would otherwise occur on the first step after a hard reset.A soft reset (
soft=True) skips this full reinitialization and reuses the existing model, solver, collision pipeline and CUDA graph.- Parameters:
soft¶ – If True, skip full reinitialization.
- static safe_callback_invoke(fn: Callable, *args, physics_manager: type[PhysicsManager] | None = None) None#
Invoke a callback, catching exceptions that would be swallowed by external event buses.
Ignores
ReferenceError(from garbage-collected weakref proxies). All other exceptions are forwarded to physics_manager.``store_callback_exception`` when available (see note below), or re-raised immediately otherwise.- Note (Octi):
The carb event bus used by PhysX/Omniverse silently swallows exceptions raised inside callbacks.
PhysxManagerworks around this by storing the exception and re-raising it after event dispatch completes (inreset()/step()). Backends that dispatch events directly (e.g. Newton) don’t need this — exceptions propagate normally — sostore_callback_exceptionis not called for them. This is a known wart; a cleaner solution is actively being explored.
- classmethod set_decimation(decimation: int) None#
Set the decimation count and re-capture the CUDA graph.
When all actuators are graphable the entire decimation loop (actuators + solver substeps, repeated decimation times) is captured as a single CUDA graph.
Invalidate the existing graph when the loop changes. Its replacement is captured immediately before the next requested step, after authored state is reconciled.
- classmethod setup_deformable_body(prim: Any, deformable_type: str, sim_mesh_prim: Any, vis_mesh_prim: Any) None#
Apply Newton’s token deformable anchor schemas and sync the visual mesh geometry.
- classmethod start_simulation() None#
Start simulation by finalizing model and initializing state.
This function finalizes the model and initializes the simulation state. Note: Collision pipeline is initialized later in initialize_solver() after we determine whether the solver needs external collision detection.
- classmethod step() None#
Step the physics simulation.
The stepping logic follows one of two paths depending on whether all actuators are CUDA-graph-safe:
All-graphable path (
_simulate_full()):Actuators and solver substeps are captured together in a single CUDA graph containing the full
decimation x (actuators + solver substeps)loop.Eager-actuator path (fallback, some actuators not graph-safe):
Actuators are stepped eagerly on the CPU timeline (outside the graph), then a graph containing only the solver substeps is launched via
_simulate_physics_only().In both paths the sequence within one physics step is:
zero actuated DOFs in control.joint_f -> actuator.step (computes effort, writes to control.joint_f) -> solver.step x num_substeps (integrates, reads control.joint_f) -> sensors.update
- supports_anim_recording: ClassVar[bool] = False#
Whether this backend can service
--anim_recording_enabled(OVD Recorder).Overridden by backends that implement the recorder (currently PhysX-only).
- classmethod unregister_post_step_callback(callback: Callable[[], None]) None#
Remove a previously registered post-step callback.
Symmetric to
register_post_step_callback(), this lets an articulation deregister its republish hook when its callbacks are cleared so the bound method does not linger on the class-level list after the articulation is gone. Removing a callback that was never registered (or was already removed) is a safe no-op, matching the tolerant deregistration of other handles.
- class isaaclab_newton.physics.NewtonFeatherstoneManager[source]#
Bases:
NewtonManagerNewtonManagerspecialization for the Featherstone solver.Always uses Newton’s
CollisionPipelinefor contact handling.Methods:
Opt an articulation into the Newton actuator fast path.
add_contact_sensor([body_names_expr, ...])Add a contact sensor for reporting contacts between bodies/shapes.
add_frame_transform_sensor(shapes, ...)Add a frame transform sensor for measuring relative transforms.
add_imu_sensor(sites)Add an IMU sensor for measuring acceleration and angular velocity at sites.
add_model_change(change)Register a model change to notify the solver.
Hook after visualizers have stepped during
render().cl_register_site(body_pattern, xform, *[, ...])Register a site request for injection into prototypes before replication.
clear()Clear all Newton-specific state (callbacks cleared by super().close()).
Remove all registered callbacks.
close()Clean up Newton physics resources.
create_builder([up_axis, physics_cfg])Create a
ModelBuilderconfigured with default settings.create_fixed_tendon_control(articulation)Build the solver's fixed-tendon command adapter for
articulation.create_visual_material_writer(batches)Compile material-to-shape addresses for the active Newton model.
create_visual_shape_color_writer(asset, ...)Compile selected articulation-body shape addresses for the active Newton model.
deregister_callback(callback_id)Remove a registered callback.
dispatch_event(event[, payload])Dispatch an event to all registered callbacks.
fix_articulation_root(articulation_prim[, stage])Ensure that an articulation root has one enabled world fixed joint.
forward()Update articulation kinematics without stepping physics.
Get the tensor backend being used ("numpy" or "torch").
Get the current Newton contact buffer, if the active solver exposes one.
Get the control object.
Get the physics simulation device.
get_dt()Get the physics timestep.
Return the active physics model.
Get the physics timestep in seconds.
Return the registered articulation views.
Return the SceneDataBackend for the SceneDataProvider.
Return the active scene data provider.
Get the current simulation time in seconds.
Get the solver substep timestep.
Get the current state.
Get the next state.
Truewhenstep()executes the full decimation loop internally.initialize(sim_context)Initialize the manager with simulation context.
Initialize the solver and collision pipeline.
Import the explicitly declared clone plan into the Newton builder.
invalidate_body_state([env_ids, env_mask])Mark selected maximal-coordinate body state as changed without requesting FK.
invalidate_fk([env_mask, env_ids, ...])Mark environments as needing FK recomputation and solver reset.
Check if fabric interface is enabled (not applicable for Newton).
pause()Pause physics simulation.
play()Start or resume physics simulation.
Sync deferred physics state to the rendering backend.
register_callback(callback, event[, order, ...])Register a callback.
register_post_actuator_callback(callback)Append a hook to the list invoked after the actuator step on every iteration.
register_post_step_callback(callback)Append a hook to the list invoked after the last solver substep on every step.
register_state_force_callback(callback)Register a graph-safe callback that applies forces before every solver substep.
Request an extended contact attribute (e.g.
"force").Request an extended state attribute (e.g.
"body_qdd").reset([soft])Reset physics simulation.
safe_callback_invoke(fn, *args[, ...])Invoke a callback, catching exceptions that would be swallowed by external event buses.
set_decimation(decimation)Set the decimation count and re-capture the CUDA graph.
setup_deformable_body(prim, deformable_type, ...)Apply Newton's token deformable anchor schemas and sync the visual mesh geometry.
Start simulation by finalizing model and initializing state.
step()Step the physics simulation.
stop()Stop physics simulation.
unregister_post_step_callback(callback)Remove a previously registered post-step callback.
Newton GL headless perspective video capture.
Block until the timeline is playing.
Attributes:
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
Whether this backend can service
--anim_recording_enabled(OVD Recorder).- classmethod activate_newton_actuator_path() None#
Opt an articulation into the Newton actuator fast path.
Idempotent — called by every Newton-fast-path articulation’s
_process_actuators_cfg:Sets
_use_newton_actuators_active, which_is_all_graphable()checks (adapter presence alone cannot distinguish the fast path from the standard Lab path).On first call, builds the single sim-level
NewtonActuatorAdapterover the full flat DOF layout; later calls reuse it.
- classmethod add_contact_sensor(body_names_expr: str | list[str] | None = None, shape_names_expr: str | list[str] | None = None, contact_partners_body_expr: str | list[str] | None = None, contact_partners_shape_expr: str | list[str] | None = None, verbose: bool = False) tuple[str | list[str] | None, str | list[str] | None, str | list[str] | None, str | list[str] | None]#
Add a contact sensor for reporting contacts between bodies/shapes.
Compiles the Isaac Lab regular expressions and delegates to
newton.sensors.SensorContact, which full-matches compiled patterns against model labels.- Parameters:
- classmethod add_frame_transform_sensor(shapes: list[int], reference_sites: list[int]) int#
Add a frame transform sensor for measuring relative transforms.
Creates a
SensorFrameTransformfrom pre-resolved shape and reference site indices, appends it to the internal list, and returns its index.
- classmethod add_imu_sensor(sites: list[int]) int#
Add an IMU sensor for measuring acceleration and angular velocity at sites.
Creates a
newton.sensors.SensorIMUfrom pre-resolved site indices, appends it to the internal list, and returns its index.- Parameters:
sites¶ – Ordered list of site indices (one per environment).
- Returns:
Index of the newly created sensor in the internal IMU sensor list.
- classmethod add_model_change(change: newton.ModelFlags) None#
Register a model change to notify the solver.
- classmethod after_visualizers_render() None#
Hook after visualizers have stepped during
render().Use for physics-backend sync (e.g. fabric) if needed. Default is a no-op.
- backend: ClassVar[NewtonBackend | None] = None#
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
- classmethod cl_register_site(body_pattern: str | None, xform: warp.transform, *, per_world: bool = False) str#
Register a site request for injection into prototypes before replication.
Sensors call this during
__init__. Sites are injected into prototype builders by_cl_inject_sites()(called fromnewton_replicate) beforeadd_builder, so they replicate correctly per-world.Identical
(body_pattern, per_world, transform)registrations share sites.The body_pattern is matched against prototype-local body labels (e.g.
"Robot/link.*") when replication is active, or against the flat builder’s body labels in the fallback path. Wildcard patterns that match multiple bodies create one site per matched body.- Parameters:
body_pattern¶ – Regex pattern matched against body labels in the prototype builder (e.g.
"Robot/link0"or"Robot/finger.*"for multi-body wildcards), orNonefor global sites (world-origin reference, etc.).xform¶ – Site transform relative to body.
per_world¶ – When
True,body_patternmust beNoneand one bodyless site is created in each cloned world’s frame.
- Returns:
Assigned site label suffix.
- classmethod clear()#
Clear all Newton-specific state (callbacks cleared by super().close()).
- classmethod clear_callbacks() None#
Remove all registered callbacks.
Do NOT reset
_callback_id— handle IDs must remain monotonically unique across the lifetime of the process. Resetting the counter would let a futureregister_callback()hand out an ID that an old, still-aliveCallbackHandle(e.g. on a sensor that has not been garbage-collected yet) holds, so when the old object eventually finalizes its__del__would deregister the new callback. This bit ovphysx’s kitless multi-context tests where twoInteractiveScene``s are created in sequence: the first scene's sensor would post-GC deregister the second scene's ``_initialize_callbackby ID collision, leaving the second sensor forever uninitialized.
- classmethod create_builder(up_axis: str | None = None, *, physics_cfg: NewtonCfg | None = None, **kwargs) newton.ModelBuilder#
Create a
ModelBuilderconfigured with default settings.Forwards
NewtonShapeCfgdefaults onto Newton’s upstreamModelBuilder.default_shape_cfgviachecked_apply(). Falls back to wrapper defaults when no Newton config is active so rough-terrain margin/gap still apply during early construction.- Parameters:
- Returns:
New builder with up-axis and per-shape defaults (gap, margin) applied.
- classmethod create_fixed_tendon_control(articulation)#
Build the solver’s fixed-tendon command adapter for
articulation.Tendon state is backend-neutral and lives on the articulation; how a target reaches the solver is not. MuJoCo drives tendons through actuator controls, so only the MJWarp manager implements this. The articulation stores what it gets, the way it stores its actuator control, and never needs to know which solver is active.
Only the MuJoCo solver registers the
mujoco:tendonfrequency, so an articulation reports tendons under MJWarp alone and this base is unreachable through the normal path. Reaching it means a solver gained tendons with no way to command them, which is worth saying rather than returning nothing –Nonealready means “this asset’s tendons are all passive”.- Parameters:
articulation¶ – Newton articulation to drive.
- Raises:
NotImplementedError – Always – this solver has no fixed-tendon transmission.
- classmethod create_visual_material_writer(batches: tuple[VisualMaterialBatch, ...]) VisualMaterialWriter#
Compile material-to-shape addresses for the active Newton model.
- classmethod create_visual_shape_color_writer(asset: BaseArticulation, body_names: tuple[str, ...]) VisualShapeColorWriter#
Compile selected articulation-body shape addresses for the active Newton model.
- classmethod deregister_callback(callback_id: int | CallbackHandle) None#
Remove a registered callback.
- Parameters:
callback_id¶ – The ID or CallbackHandle returned by register_callback().
- classmethod dispatch_event(event: PhysicsEvent, payload: Any = None) None#
Dispatch an event to all registered callbacks.
This is the default implementation using simple callback lists. Subclasses may override or extend with platform-specific dispatch.
- classmethod fix_articulation_root(articulation_prim: Any, stage: Any = None) Any#
Ensure that an articulation root has one enabled world fixed joint.
The base implementation leaves the root in place. Backends whose parser requires a different root topology may relocate it and return the resulting root prim.
- Parameters:
- Returns:
The articulation-root prim after backend normalization.
- Raises:
NotImplementedError – If a new joint is needed and the root is not a rigid body.
- classmethod forward() None#
Update articulation kinematics without stepping physics.
Update body poses from joint coordinates via the solver-specialized FK delegate (
_eval_fk, bound to the active subclass’s_eval_fk_impl()ininitialize_solver()). Only the articulations flagged dirty in_fk_reset_maskand_world_reset_mask(seeinvalidate_fk()) are updated. The masks are consumed (zeroed) afterwards so the nextstep()does not redundantly re-solve them.Asset and scene-data reads share the same pending work. The bound delegate dispatches calls on
NewtonManagerto the active solver’s implementation.
- classmethod get_contacts() Contacts | None#
Get the current Newton contact buffer, if the active solver exposes one.
- classmethod get_control() newton.Control#
Get the control object.
- classmethod get_model() newton.Model#
Return the active physics model. Render consumers acquire their backend from the registry.
- classmethod get_scene_data_backend() SceneDataBackend | None#
Return the SceneDataBackend for the SceneDataProvider.
- classmethod get_scene_data_provider() SceneDataProvider#
Return the active scene data provider.
- classmethod get_state_0() newton.State#
Get the current state.
- classmethod get_state_1() newton.State#
Get the next state.
- classmethod handles_decimation() bool#
Truewhenstep()executes the full decimation loop internally.This is the case when all Newton actuators are CUDA-graph-safe. The full decimation loop (including the trivial
decimation=1case) is folded into a singlestep()call.
- classmethod initialize(sim_context: SimulationContext) None#
Initialize the manager with simulation context.
- Parameters:
sim_context¶ – Parent simulation context.
- classmethod initialize_solver() None#
Initialize the solver and collision pipeline.
Construct the solver and contacts, establish the initial body state, and schedule graph capture for the first step after the environment has authored its initial state. Initialization and capture do not advance physics.
- classmethod instantiate_builder_from_stage()#
Import the explicitly declared clone plan into the Newton builder.
- classmethod invalidate_body_state(env_ids: wp.array(dtype=wp.int32) | None = None, env_mask: wp.array(dtype=wp.bool) | None = None) None#
Mark selected maximal-coordinate body state as changed without requesting FK.
- classmethod invalidate_fk(env_mask: wp.array | None = None, env_ids: wp.array | None = None, articulation_ids: wp.array | None = None) None#
Mark environments as needing FK recomputation and solver reset.
Called by asset write methods that modify joint coordinates or root transforms. The masks are consumed by the next forward, raw-state, rendering, or physics-step boundary.
- Parameters:
env_mask¶ – Boolean mask of dirtied environments. Shape
(num_envs,). Used by_maskwrite methods.env_ids¶ – Integer indices of dirtied environments. Used by
_indexwrite methods.articulation_ids¶ – Mapping from
(world, arti)to model articulation index. Shape(world_count, count_per_world). Obtained fromArticulationView.articulation_ids.
- classmethod is_fabric_enabled() bool#
Check if fabric interface is enabled (not applicable for Newton).
- classmethod pre_render() None#
Sync deferred physics state to the rendering backend.
Called by
render()before cameras and visualizers read scene data. The default implementation is a no-op. Backends that defer transform writes (e.g. Newton’s dirty-flag pattern) should override this to flush pending updates.
- classmethod register_callback(callback: Callable, event: PhysicsEvent, order: int = 0, name: str | None = None, wrap_weak_ref: bool = True) CallbackHandle#
Register a callback. Passes event to parent class.
- classmethod register_post_actuator_callback(callback: Callable[[], None]) None#
Append a hook to the list invoked after the actuator step on every iteration.
Each callback runs inside the captured CUDA graph (when
_is_all_graphable()isTrue) right afterNewtonActuatorAdapter.step()and before the solver substeps, so kernel writes tostate/controlare visible to the integrator on the same iteration. Multiple articulations register their own implicit-DOF telemetry / FF-routing kernels here; all registered callbacks fire in registration order each step.
- classmethod register_post_step_callback(callback: Callable[[], None]) None#
Append a hook to the list invoked after the last solver substep on every step.
Each callback runs inside the stepped (and, when
_is_all_graphable()isTrue, captured) region right after the final solver substep of the decimation loop and before_update_sensors(), so the launches it issues are recorded into every captured CUDA graph and replayed on each tick. The hook fires exactly once perstep()call, reflecting the state after all decimation iterations (and their solver substeps) have completed – not once per substep and not once per decimation iteration. Callbacks must be graph-safe (fixed shapes, no host branching on device data) and must be registered before capture. Articulations with non-identity ordering register their backend-to-user state republish here; all registered callbacks fire in registration order each step.
- classmethod register_state_force_callback(callback: Callable[[newton.State], None]) None#
Register a graph-safe callback that applies forces before every solver substep.
Callbacks must be registered before solver initialization so they are included in CUDA graph capture.
- Parameters:
callback¶ – Function that adds forces [N, N·m] to the provided state.
- classmethod request_extended_contact_attribute(attr: str) None#
Request an extended contact attribute (e.g.
"force").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the model instart_simulation()so that subsequentContactscreation includes them.- Parameters:
attr¶ – Contact attribute name.
- classmethod request_extended_state_attribute(attr: str) None#
Request an extended state attribute (e.g.
"body_qdd").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the builder instart_simulation()so that subsequentmodel.state()calls allocate them.- Parameters:
attr¶ – State attribute name (must be in
State.EXTENDED_ATTRIBUTES).
- classmethod reset(soft: bool = False) None#
Reset physics simulation.
A hard reset (
soft=False) re-finalizes the Newton model, reallocating its device arrays. The cached collision pipeline, contacts and any captured CUDA graph reference the old buffers, so they are released here and rebuilt against the re-finalized model byinitialize_solver(). This avoids the illegal CUDA memory access (CUDA error 700) that would otherwise occur on the first step after a hard reset.A soft reset (
soft=True) skips this full reinitialization and reuses the existing model, solver, collision pipeline and CUDA graph.- Parameters:
soft¶ – If True, skip full reinitialization.
- static safe_callback_invoke(fn: Callable, *args, physics_manager: type[PhysicsManager] | None = None) None#
Invoke a callback, catching exceptions that would be swallowed by external event buses.
Ignores
ReferenceError(from garbage-collected weakref proxies). All other exceptions are forwarded to physics_manager.``store_callback_exception`` when available (see note below), or re-raised immediately otherwise.- Note (Octi):
The carb event bus used by PhysX/Omniverse silently swallows exceptions raised inside callbacks.
PhysxManagerworks around this by storing the exception and re-raising it after event dispatch completes (inreset()/step()). Backends that dispatch events directly (e.g. Newton) don’t need this — exceptions propagate normally — sostore_callback_exceptionis not called for them. This is a known wart; a cleaner solution is actively being explored.
- classmethod set_decimation(decimation: int) None#
Set the decimation count and re-capture the CUDA graph.
When all actuators are graphable the entire decimation loop (actuators + solver substeps, repeated decimation times) is captured as a single CUDA graph.
Invalidate the existing graph when the loop changes. Its replacement is captured immediately before the next requested step, after authored state is reconciled.
- classmethod setup_deformable_body(prim: Any, deformable_type: str, sim_mesh_prim: Any, vis_mesh_prim: Any) None#
Apply Newton’s token deformable anchor schemas and sync the visual mesh geometry.
- classmethod start_simulation() None#
Start simulation by finalizing model and initializing state.
This function finalizes the model and initializes the simulation state. Note: Collision pipeline is initialized later in initialize_solver() after we determine whether the solver needs external collision detection.
- classmethod step() None#
Step the physics simulation.
The stepping logic follows one of two paths depending on whether all actuators are CUDA-graph-safe:
All-graphable path (
_simulate_full()):Actuators and solver substeps are captured together in a single CUDA graph containing the full
decimation x (actuators + solver substeps)loop.Eager-actuator path (fallback, some actuators not graph-safe):
Actuators are stepped eagerly on the CPU timeline (outside the graph), then a graph containing only the solver substeps is launched via
_simulate_physics_only().In both paths the sequence within one physics step is:
zero actuated DOFs in control.joint_f -> actuator.step (computes effort, writes to control.joint_f) -> solver.step x num_substeps (integrates, reads control.joint_f) -> sensors.update
- supports_anim_recording: ClassVar[bool] = False#
Whether this backend can service
--anim_recording_enabled(OVD Recorder).Overridden by backends that implement the recorder (currently PhysX-only).
- classmethod unregister_post_step_callback(callback: Callable[[], None]) None#
Remove a previously registered post-step callback.
Symmetric to
register_post_step_callback(), this lets an articulation deregister its republish hook when its callbacks are cleared so the bound method does not linger on the class-level list after the articulation is gone. Removing a callback that was never registered (or was already removed) is a safe no-op, matching the tolerant deregistration of other handles.
- class isaaclab_newton.physics.NewtonKaminoManager[source]#
Bases:
NewtonManagerNewtonManagerspecialization for the Kamino solver.Uses Newton’s
CollisionPipelineunless itsuse_collision_detectorfield isTrue, in which case Kamino’s internal collision detector handles contact generation.Methods:
Opt an articulation into the Newton actuator fast path.
add_contact_sensor([body_names_expr, ...])Add a contact sensor for reporting contacts between bodies/shapes.
add_frame_transform_sensor(shapes, ...)Add a frame transform sensor for measuring relative transforms.
add_imu_sensor(sites)Add an IMU sensor for measuring acceleration and angular velocity at sites.
add_model_change(change)Register a model change to notify the solver.
Hook after visualizers have stepped during
render().cl_register_site(body_pattern, xform, *[, ...])Register a site request for injection into prototypes before replication.
clear()Clear all Newton-specific state (callbacks cleared by super().close()).
Remove all registered callbacks.
close()Clean up Newton physics resources.
create_builder([up_axis, physics_cfg])Create a
ModelBuilderconfigured with default settings.create_fixed_tendon_control(articulation)Build the solver's fixed-tendon command adapter for
articulation.create_visual_material_writer(batches)Compile material-to-shape addresses for the active Newton model.
create_visual_shape_color_writer(asset, ...)Compile selected articulation-body shape addresses for the active Newton model.
deregister_callback(callback_id)Remove a registered callback.
dispatch_event(event[, payload])Dispatch an event to all registered callbacks.
fix_articulation_root(articulation_prim[, stage])Ensure that an articulation root has one enabled world fixed joint.
forward()Update articulation kinematics without stepping physics.
Get the tensor backend being used ("numpy" or "torch").
Get the current Newton contact buffer, if the active solver exposes one.
Get the control object.
Get the physics simulation device.
get_dt()Get the physics timestep.
Return the active physics model.
Get the physics timestep in seconds.
Return the registered articulation views.
Return the SceneDataBackend for the SceneDataProvider.
Return the active scene data provider.
Get the current simulation time in seconds.
Get the solver substep timestep.
Get the current state.
Get the next state.
Truewhenstep()executes the full decimation loop internally.initialize(sim_context)Initialize the manager with simulation context.
Initialize the solver and collision pipeline.
Import the explicitly declared clone plan into the Newton builder.
invalidate_body_state([env_ids, env_mask])Mark selected maximal-coordinate body state as changed without requesting FK.
invalidate_fk([env_mask, env_ids, ...])Mark environments as needing FK recomputation and solver reset.
Check if fabric interface is enabled (not applicable for Newton).
pause()Pause physics simulation.
play()Start or resume physics simulation.
Sync deferred physics state to the rendering backend.
register_callback(callback, event[, order, ...])Register a callback.
register_post_actuator_callback(callback)Append a hook to the list invoked after the actuator step on every iteration.
register_post_step_callback(callback)Append a hook to the list invoked after the last solver substep on every step.
register_state_force_callback(callback)Register a graph-safe callback that applies forces before every solver substep.
Request an extended contact attribute (e.g.
"force").Request an extended state attribute (e.g.
"body_qdd").reset([soft])Reset physics simulation.
safe_callback_invoke(fn, *args[, ...])Invoke a callback, catching exceptions that would be swallowed by external event buses.
set_decimation(decimation)Set the decimation count and re-capture the CUDA graph.
setup_deformable_body(prim, deformable_type, ...)Apply Newton's token deformable anchor schemas and sync the visual mesh geometry.
Start simulation by finalizing model and initializing state.
step()Step the physics simulation.
stop()Stop physics simulation.
unregister_post_step_callback(callback)Remove a previously registered post-step callback.
Newton GL headless perspective video capture.
Block until the timeline is playing.
Attributes:
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
Whether this backend can service
--anim_recording_enabled(OVD Recorder).- classmethod activate_newton_actuator_path() None#
Opt an articulation into the Newton actuator fast path.
Idempotent — called by every Newton-fast-path articulation’s
_process_actuators_cfg:Sets
_use_newton_actuators_active, which_is_all_graphable()checks (adapter presence alone cannot distinguish the fast path from the standard Lab path).On first call, builds the single sim-level
NewtonActuatorAdapterover the full flat DOF layout; later calls reuse it.
- classmethod add_contact_sensor(body_names_expr: str | list[str] | None = None, shape_names_expr: str | list[str] | None = None, contact_partners_body_expr: str | list[str] | None = None, contact_partners_shape_expr: str | list[str] | None = None, verbose: bool = False) tuple[str | list[str] | None, str | list[str] | None, str | list[str] | None, str | list[str] | None]#
Add a contact sensor for reporting contacts between bodies/shapes.
Compiles the Isaac Lab regular expressions and delegates to
newton.sensors.SensorContact, which full-matches compiled patterns against model labels.- Parameters:
- classmethod add_frame_transform_sensor(shapes: list[int], reference_sites: list[int]) int#
Add a frame transform sensor for measuring relative transforms.
Creates a
SensorFrameTransformfrom pre-resolved shape and reference site indices, appends it to the internal list, and returns its index.
- classmethod add_imu_sensor(sites: list[int]) int#
Add an IMU sensor for measuring acceleration and angular velocity at sites.
Creates a
newton.sensors.SensorIMUfrom pre-resolved site indices, appends it to the internal list, and returns its index.- Parameters:
sites¶ – Ordered list of site indices (one per environment).
- Returns:
Index of the newly created sensor in the internal IMU sensor list.
- classmethod add_model_change(change: newton.ModelFlags) None#
Register a model change to notify the solver.
- classmethod after_visualizers_render() None#
Hook after visualizers have stepped during
render().Use for physics-backend sync (e.g. fabric) if needed. Default is a no-op.
- backend: ClassVar[NewtonBackend | None] = None#
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
- classmethod cl_register_site(body_pattern: str | None, xform: warp.transform, *, per_world: bool = False) str#
Register a site request for injection into prototypes before replication.
Sensors call this during
__init__. Sites are injected into prototype builders by_cl_inject_sites()(called fromnewton_replicate) beforeadd_builder, so they replicate correctly per-world.Identical
(body_pattern, per_world, transform)registrations share sites.The body_pattern is matched against prototype-local body labels (e.g.
"Robot/link.*") when replication is active, or against the flat builder’s body labels in the fallback path. Wildcard patterns that match multiple bodies create one site per matched body.- Parameters:
body_pattern¶ – Regex pattern matched against body labels in the prototype builder (e.g.
"Robot/link0"or"Robot/finger.*"for multi-body wildcards), orNonefor global sites (world-origin reference, etc.).xform¶ – Site transform relative to body.
per_world¶ – When
True,body_patternmust beNoneand one bodyless site is created in each cloned world’s frame.
- Returns:
Assigned site label suffix.
- classmethod clear()#
Clear all Newton-specific state (callbacks cleared by super().close()).
- classmethod clear_callbacks() None#
Remove all registered callbacks.
Do NOT reset
_callback_id— handle IDs must remain monotonically unique across the lifetime of the process. Resetting the counter would let a futureregister_callback()hand out an ID that an old, still-aliveCallbackHandle(e.g. on a sensor that has not been garbage-collected yet) holds, so when the old object eventually finalizes its__del__would deregister the new callback. This bit ovphysx’s kitless multi-context tests where twoInteractiveScene``s are created in sequence: the first scene's sensor would post-GC deregister the second scene's ``_initialize_callbackby ID collision, leaving the second sensor forever uninitialized.
- classmethod create_builder(up_axis: str | None = None, *, physics_cfg: NewtonCfg | None = None, **kwargs) newton.ModelBuilder#
Create a
ModelBuilderconfigured with default settings.Forwards
NewtonShapeCfgdefaults onto Newton’s upstreamModelBuilder.default_shape_cfgviachecked_apply(). Falls back to wrapper defaults when no Newton config is active so rough-terrain margin/gap still apply during early construction.- Parameters:
- Returns:
New builder with up-axis and per-shape defaults (gap, margin) applied.
- classmethod create_fixed_tendon_control(articulation)#
Build the solver’s fixed-tendon command adapter for
articulation.Tendon state is backend-neutral and lives on the articulation; how a target reaches the solver is not. MuJoCo drives tendons through actuator controls, so only the MJWarp manager implements this. The articulation stores what it gets, the way it stores its actuator control, and never needs to know which solver is active.
Only the MuJoCo solver registers the
mujoco:tendonfrequency, so an articulation reports tendons under MJWarp alone and this base is unreachable through the normal path. Reaching it means a solver gained tendons with no way to command them, which is worth saying rather than returning nothing –Nonealready means “this asset’s tendons are all passive”.- Parameters:
articulation¶ – Newton articulation to drive.
- Raises:
NotImplementedError – Always – this solver has no fixed-tendon transmission.
- classmethod create_visual_material_writer(batches: tuple[VisualMaterialBatch, ...]) VisualMaterialWriter#
Compile material-to-shape addresses for the active Newton model.
- classmethod create_visual_shape_color_writer(asset: BaseArticulation, body_names: tuple[str, ...]) VisualShapeColorWriter#
Compile selected articulation-body shape addresses for the active Newton model.
- classmethod deregister_callback(callback_id: int | CallbackHandle) None#
Remove a registered callback.
- Parameters:
callback_id¶ – The ID or CallbackHandle returned by register_callback().
- classmethod dispatch_event(event: PhysicsEvent, payload: Any = None) None#
Dispatch an event to all registered callbacks.
This is the default implementation using simple callback lists. Subclasses may override or extend with platform-specific dispatch.
- classmethod fix_articulation_root(articulation_prim: Any, stage: Any = None) Any#
Ensure that an articulation root has one enabled world fixed joint.
The base implementation leaves the root in place. Backends whose parser requires a different root topology may relocate it and return the resulting root prim.
- Parameters:
- Returns:
The articulation-root prim after backend normalization.
- Raises:
NotImplementedError – If a new joint is needed and the root is not a rigid body.
- classmethod forward() None#
Update articulation kinematics without stepping physics.
Update body poses from joint coordinates via the solver-specialized FK delegate (
_eval_fk, bound to the active subclass’s_eval_fk_impl()ininitialize_solver()). Only the articulations flagged dirty in_fk_reset_maskand_world_reset_mask(seeinvalidate_fk()) are updated. The masks are consumed (zeroed) afterwards so the nextstep()does not redundantly re-solve them.Asset and scene-data reads share the same pending work. The bound delegate dispatches calls on
NewtonManagerto the active solver’s implementation.
- classmethod get_contacts() Contacts | None#
Get the current Newton contact buffer, if the active solver exposes one.
- classmethod get_control() newton.Control#
Get the control object.
- classmethod get_model() newton.Model#
Return the active physics model. Render consumers acquire their backend from the registry.
- classmethod get_scene_data_backend() SceneDataBackend | None#
Return the SceneDataBackend for the SceneDataProvider.
- classmethod get_scene_data_provider() SceneDataProvider#
Return the active scene data provider.
- classmethod get_state_0() newton.State#
Get the current state.
- classmethod get_state_1() newton.State#
Get the next state.
- classmethod handles_decimation() bool#
Truewhenstep()executes the full decimation loop internally.This is the case when all Newton actuators are CUDA-graph-safe. The full decimation loop (including the trivial
decimation=1case) is folded into a singlestep()call.
- classmethod initialize(sim_context: SimulationContext) None#
Initialize the manager with simulation context.
- Parameters:
sim_context¶ – Parent simulation context.
- classmethod initialize_solver() None#
Initialize the solver and collision pipeline.
Construct the solver and contacts, establish the initial body state, and schedule graph capture for the first step after the environment has authored its initial state. Initialization and capture do not advance physics.
- classmethod instantiate_builder_from_stage()#
Import the explicitly declared clone plan into the Newton builder.
- classmethod invalidate_body_state(env_ids: wp.array(dtype=wp.int32) | None = None, env_mask: wp.array(dtype=wp.bool) | None = None) None#
Mark selected maximal-coordinate body state as changed without requesting FK.
- classmethod invalidate_fk(env_mask: wp.array | None = None, env_ids: wp.array | None = None, articulation_ids: wp.array | None = None) None#
Mark environments as needing FK recomputation and solver reset.
Called by asset write methods that modify joint coordinates or root transforms. The masks are consumed by the next forward, raw-state, rendering, or physics-step boundary.
- Parameters:
env_mask¶ – Boolean mask of dirtied environments. Shape
(num_envs,). Used by_maskwrite methods.env_ids¶ – Integer indices of dirtied environments. Used by
_indexwrite methods.articulation_ids¶ – Mapping from
(world, arti)to model articulation index. Shape(world_count, count_per_world). Obtained fromArticulationView.articulation_ids.
- classmethod is_fabric_enabled() bool#
Check if fabric interface is enabled (not applicable for Newton).
- classmethod pre_render() None#
Sync deferred physics state to the rendering backend.
Called by
render()before cameras and visualizers read scene data. The default implementation is a no-op. Backends that defer transform writes (e.g. Newton’s dirty-flag pattern) should override this to flush pending updates.
- classmethod register_callback(callback: Callable, event: PhysicsEvent, order: int = 0, name: str | None = None, wrap_weak_ref: bool = True) CallbackHandle#
Register a callback. Passes event to parent class.
- classmethod register_post_actuator_callback(callback: Callable[[], None]) None#
Append a hook to the list invoked after the actuator step on every iteration.
Each callback runs inside the captured CUDA graph (when
_is_all_graphable()isTrue) right afterNewtonActuatorAdapter.step()and before the solver substeps, so kernel writes tostate/controlare visible to the integrator on the same iteration. Multiple articulations register their own implicit-DOF telemetry / FF-routing kernels here; all registered callbacks fire in registration order each step.
- classmethod register_post_step_callback(callback: Callable[[], None]) None#
Append a hook to the list invoked after the last solver substep on every step.
Each callback runs inside the stepped (and, when
_is_all_graphable()isTrue, captured) region right after the final solver substep of the decimation loop and before_update_sensors(), so the launches it issues are recorded into every captured CUDA graph and replayed on each tick. The hook fires exactly once perstep()call, reflecting the state after all decimation iterations (and their solver substeps) have completed – not once per substep and not once per decimation iteration. Callbacks must be graph-safe (fixed shapes, no host branching on device data) and must be registered before capture. Articulations with non-identity ordering register their backend-to-user state republish here; all registered callbacks fire in registration order each step.
- classmethod register_state_force_callback(callback: Callable[[newton.State], None]) None#
Register a graph-safe callback that applies forces before every solver substep.
Callbacks must be registered before solver initialization so they are included in CUDA graph capture.
- Parameters:
callback¶ – Function that adds forces [N, N·m] to the provided state.
- classmethod request_extended_contact_attribute(attr: str) None#
Request an extended contact attribute (e.g.
"force").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the model instart_simulation()so that subsequentContactscreation includes them.- Parameters:
attr¶ – Contact attribute name.
- classmethod request_extended_state_attribute(attr: str) None#
Request an extended state attribute (e.g.
"body_qdd").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the builder instart_simulation()so that subsequentmodel.state()calls allocate them.- Parameters:
attr¶ – State attribute name (must be in
State.EXTENDED_ATTRIBUTES).
- classmethod reset(soft: bool = False) None#
Reset physics simulation.
A hard reset (
soft=False) re-finalizes the Newton model, reallocating its device arrays. The cached collision pipeline, contacts and any captured CUDA graph reference the old buffers, so they are released here and rebuilt against the re-finalized model byinitialize_solver(). This avoids the illegal CUDA memory access (CUDA error 700) that would otherwise occur on the first step after a hard reset.A soft reset (
soft=True) skips this full reinitialization and reuses the existing model, solver, collision pipeline and CUDA graph.- Parameters:
soft¶ – If True, skip full reinitialization.
- static safe_callback_invoke(fn: Callable, *args, physics_manager: type[PhysicsManager] | None = None) None#
Invoke a callback, catching exceptions that would be swallowed by external event buses.
Ignores
ReferenceError(from garbage-collected weakref proxies). All other exceptions are forwarded to physics_manager.``store_callback_exception`` when available (see note below), or re-raised immediately otherwise.- Note (Octi):
The carb event bus used by PhysX/Omniverse silently swallows exceptions raised inside callbacks.
PhysxManagerworks around this by storing the exception and re-raising it after event dispatch completes (inreset()/step()). Backends that dispatch events directly (e.g. Newton) don’t need this — exceptions propagate normally — sostore_callback_exceptionis not called for them. This is a known wart; a cleaner solution is actively being explored.
- classmethod set_decimation(decimation: int) None#
Set the decimation count and re-capture the CUDA graph.
When all actuators are graphable the entire decimation loop (actuators + solver substeps, repeated decimation times) is captured as a single CUDA graph.
Invalidate the existing graph when the loop changes. Its replacement is captured immediately before the next requested step, after authored state is reconciled.
- classmethod setup_deformable_body(prim: Any, deformable_type: str, sim_mesh_prim: Any, vis_mesh_prim: Any) None#
Apply Newton’s token deformable anchor schemas and sync the visual mesh geometry.
- classmethod start_simulation() None#
Start simulation by finalizing model and initializing state.
This function finalizes the model and initializes the simulation state. Note: Collision pipeline is initialized later in initialize_solver() after we determine whether the solver needs external collision detection.
- classmethod step() None#
Step the physics simulation.
The stepping logic follows one of two paths depending on whether all actuators are CUDA-graph-safe:
All-graphable path (
_simulate_full()):Actuators and solver substeps are captured together in a single CUDA graph containing the full
decimation x (actuators + solver substeps)loop.Eager-actuator path (fallback, some actuators not graph-safe):
Actuators are stepped eagerly on the CPU timeline (outside the graph), then a graph containing only the solver substeps is launched via
_simulate_physics_only().In both paths the sequence within one physics step is:
zero actuated DOFs in control.joint_f -> actuator.step (computes effort, writes to control.joint_f) -> solver.step x num_substeps (integrates, reads control.joint_f) -> sensors.update
- supports_anim_recording: ClassVar[bool] = False#
Whether this backend can service
--anim_recording_enabled(OVD Recorder).Overridden by backends that implement the recorder (currently PhysX-only).
- classmethod unregister_post_step_callback(callback: Callable[[], None]) None#
Remove a previously registered post-step callback.
Symmetric to
register_post_step_callback(), this lets an articulation deregister its republish hook when its callbacks are cleared so the bound method does not linger on the class-level list after the articulation is gone. Removing a callback that was never registered (or was already removed) is a safe no-op, matching the tolerant deregistration of other handles.
- class isaaclab_newton.physics.NewtonMPMManager[source]#
Bases:
NewtonManagerNewtonManagerspecialization for Newton’s implicit MPM solver.MPM advances particle materials in-place and treats rigid geometry as colliders, so it does not consume Newton’s rigid-body collision pipeline and steps with a single
State.Methods:
initialize(sim_context)Initialize Newton and author the MPM solver configuration in USD.
reset_solver_state([state, world_mask, flags])Reset MPM and coupled-solver history after task state is rewritten.
Opt an articulation into the Newton actuator fast path.
add_contact_sensor([body_names_expr, ...])Add a contact sensor for reporting contacts between bodies/shapes.
add_frame_transform_sensor(shapes, ...)Add a frame transform sensor for measuring relative transforms.
add_imu_sensor(sites)Add an IMU sensor for measuring acceleration and angular velocity at sites.
add_model_change(change)Register a model change to notify the solver.
Hook after visualizers have stepped during
render().cl_register_site(body_pattern, xform, *[, ...])Register a site request for injection into prototypes before replication.
clear()Clear all Newton-specific state (callbacks cleared by super().close()).
Remove all registered callbacks.
close()Clean up Newton physics resources.
create_builder([up_axis, physics_cfg])Create a
ModelBuilderconfigured with default settings.create_fixed_tendon_control(articulation)Build the solver's fixed-tendon command adapter for
articulation.create_visual_material_writer(batches)Compile material-to-shape addresses for the active Newton model.
create_visual_shape_color_writer(asset, ...)Compile selected articulation-body shape addresses for the active Newton model.
deregister_callback(callback_id)Remove a registered callback.
dispatch_event(event[, payload])Dispatch an event to all registered callbacks.
fix_articulation_root(articulation_prim[, stage])Ensure that an articulation root has one enabled world fixed joint.
forward()Update articulation kinematics without stepping physics.
Get the tensor backend being used ("numpy" or "torch").
Get the current Newton contact buffer, if the active solver exposes one.
Get the control object.
Get the physics simulation device.
get_dt()Get the physics timestep.
Return the active physics model.
Get the physics timestep in seconds.
Return the registered articulation views.
Return the SceneDataBackend for the SceneDataProvider.
Return the active scene data provider.
Get the current simulation time in seconds.
Get the solver substep timestep.
Get the current state.
Get the next state.
Truewhenstep()executes the full decimation loop internally.Initialize the solver and collision pipeline.
Import the explicitly declared clone plan into the Newton builder.
invalidate_body_state([env_ids, env_mask])Mark selected maximal-coordinate body state as changed without requesting FK.
invalidate_fk([env_mask, env_ids, ...])Mark environments as needing FK recomputation and solver reset.
Check if fabric interface is enabled (not applicable for Newton).
pause()Pause physics simulation.
play()Start or resume physics simulation.
Sync deferred physics state to the rendering backend.
register_callback(callback, event[, order, ...])Register a callback.
register_post_actuator_callback(callback)Append a hook to the list invoked after the actuator step on every iteration.
register_post_step_callback(callback)Append a hook to the list invoked after the last solver substep on every step.
register_state_force_callback(callback)Register a graph-safe callback that applies forces before every solver substep.
Request an extended contact attribute (e.g.
"force").Request an extended state attribute (e.g.
"body_qdd").reset([soft])Reset physics simulation.
safe_callback_invoke(fn, *args[, ...])Invoke a callback, catching exceptions that would be swallowed by external event buses.
set_decimation(decimation)Set the decimation count and re-capture the CUDA graph.
setup_deformable_body(prim, deformable_type, ...)Apply Newton's token deformable anchor schemas and sync the visual mesh geometry.
Start simulation by finalizing model and initializing state.
step()Step the physics simulation.
stop()Stop physics simulation.
unregister_post_step_callback(callback)Remove a previously registered post-step callback.
Newton GL headless perspective video capture.
Block until the timeline is playing.
Attributes:
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
Whether this backend can service
--anim_recording_enabled(OVD Recorder).- classmethod initialize(sim_context: SimulationContext) None[source]#
Initialize Newton and author the MPM solver configuration in USD.
- classmethod reset_solver_state(state: State | None = None, world_mask: wp.array(dtype=wp.bool) | None = None, flags: StateFlags | int | None = None) None[source]#
Reset MPM and coupled-solver history after task state is rewritten.
When
stateis omitted, both distinct manager state buffers are reset so a later buffer swap cannot restore stale history. A mask follows Newton’s canonicalworld_count + 1contract, where the last entry selects global entities in world -1. A selected single local world is promoted to a full reset because a one-world MPM grid has no environment offsets.- Parameters:
- Raises:
RuntimeError – If the MPM solver or a usable state is not initialized.
ValueError – If
world_maskdoes not use Newton’s canonical shape.
- classmethod activate_newton_actuator_path() None#
Opt an articulation into the Newton actuator fast path.
Idempotent — called by every Newton-fast-path articulation’s
_process_actuators_cfg:Sets
_use_newton_actuators_active, which_is_all_graphable()checks (adapter presence alone cannot distinguish the fast path from the standard Lab path).On first call, builds the single sim-level
NewtonActuatorAdapterover the full flat DOF layout; later calls reuse it.
- classmethod add_contact_sensor(body_names_expr: str | list[str] | None = None, shape_names_expr: str | list[str] | None = None, contact_partners_body_expr: str | list[str] | None = None, contact_partners_shape_expr: str | list[str] | None = None, verbose: bool = False) tuple[str | list[str] | None, str | list[str] | None, str | list[str] | None, str | list[str] | None]#
Add a contact sensor for reporting contacts between bodies/shapes.
Compiles the Isaac Lab regular expressions and delegates to
newton.sensors.SensorContact, which full-matches compiled patterns against model labels.- Parameters:
- classmethod add_frame_transform_sensor(shapes: list[int], reference_sites: list[int]) int#
Add a frame transform sensor for measuring relative transforms.
Creates a
SensorFrameTransformfrom pre-resolved shape and reference site indices, appends it to the internal list, and returns its index.
- classmethod add_imu_sensor(sites: list[int]) int#
Add an IMU sensor for measuring acceleration and angular velocity at sites.
Creates a
newton.sensors.SensorIMUfrom pre-resolved site indices, appends it to the internal list, and returns its index.- Parameters:
sites¶ – Ordered list of site indices (one per environment).
- Returns:
Index of the newly created sensor in the internal IMU sensor list.
- classmethod add_model_change(change: newton.ModelFlags) None#
Register a model change to notify the solver.
- classmethod after_visualizers_render() None#
Hook after visualizers have stepped during
render().Use for physics-backend sync (e.g. fabric) if needed. Default is a no-op.
- backend: ClassVar[NewtonBackend | None] = None#
Borrowed native resource shared by physics and scene consumers; the simulation registry owns it.
- classmethod cl_register_site(body_pattern: str | None, xform: warp.transform, *, per_world: bool = False) str#
Register a site request for injection into prototypes before replication.
Sensors call this during
__init__. Sites are injected into prototype builders by_cl_inject_sites()(called fromnewton_replicate) beforeadd_builder, so they replicate correctly per-world.Identical
(body_pattern, per_world, transform)registrations share sites.The body_pattern is matched against prototype-local body labels (e.g.
"Robot/link.*") when replication is active, or against the flat builder’s body labels in the fallback path. Wildcard patterns that match multiple bodies create one site per matched body.- Parameters:
body_pattern¶ – Regex pattern matched against body labels in the prototype builder (e.g.
"Robot/link0"or"Robot/finger.*"for multi-body wildcards), orNonefor global sites (world-origin reference, etc.).xform¶ – Site transform relative to body.
per_world¶ – When
True,body_patternmust beNoneand one bodyless site is created in each cloned world’s frame.
- Returns:
Assigned site label suffix.
- classmethod clear()#
Clear all Newton-specific state (callbacks cleared by super().close()).
- classmethod clear_callbacks() None#
Remove all registered callbacks.
Do NOT reset
_callback_id— handle IDs must remain monotonically unique across the lifetime of the process. Resetting the counter would let a futureregister_callback()hand out an ID that an old, still-aliveCallbackHandle(e.g. on a sensor that has not been garbage-collected yet) holds, so when the old object eventually finalizes its__del__would deregister the new callback. This bit ovphysx’s kitless multi-context tests where twoInteractiveScene``s are created in sequence: the first scene's sensor would post-GC deregister the second scene's ``_initialize_callbackby ID collision, leaving the second sensor forever uninitialized.
- classmethod create_builder(up_axis: str | None = None, *, physics_cfg: NewtonCfg | None = None, **kwargs) newton.ModelBuilder#
Create a
ModelBuilderconfigured with default settings.Forwards
NewtonShapeCfgdefaults onto Newton’s upstreamModelBuilder.default_shape_cfgviachecked_apply(). Falls back to wrapper defaults when no Newton config is active so rough-terrain margin/gap still apply during early construction.- Parameters:
- Returns:
New builder with up-axis and per-shape defaults (gap, margin) applied.
- classmethod create_fixed_tendon_control(articulation)#
Build the solver’s fixed-tendon command adapter for
articulation.Tendon state is backend-neutral and lives on the articulation; how a target reaches the solver is not. MuJoCo drives tendons through actuator controls, so only the MJWarp manager implements this. The articulation stores what it gets, the way it stores its actuator control, and never needs to know which solver is active.
Only the MuJoCo solver registers the
mujoco:tendonfrequency, so an articulation reports tendons under MJWarp alone and this base is unreachable through the normal path. Reaching it means a solver gained tendons with no way to command them, which is worth saying rather than returning nothing –Nonealready means “this asset’s tendons are all passive”.- Parameters:
articulation¶ – Newton articulation to drive.
- Raises:
NotImplementedError – Always – this solver has no fixed-tendon transmission.
- classmethod create_visual_material_writer(batches: tuple[VisualMaterialBatch, ...]) VisualMaterialWriter#
Compile material-to-shape addresses for the active Newton model.
- classmethod create_visual_shape_color_writer(asset: BaseArticulation, body_names: tuple[str, ...]) VisualShapeColorWriter#
Compile selected articulation-body shape addresses for the active Newton model.
- classmethod deregister_callback(callback_id: int | CallbackHandle) None#
Remove a registered callback.
- Parameters:
callback_id¶ – The ID or CallbackHandle returned by register_callback().
- classmethod dispatch_event(event: PhysicsEvent, payload: Any = None) None#
Dispatch an event to all registered callbacks.
This is the default implementation using simple callback lists. Subclasses may override or extend with platform-specific dispatch.
- classmethod fix_articulation_root(articulation_prim: Any, stage: Any = None) Any#
Ensure that an articulation root has one enabled world fixed joint.
The base implementation leaves the root in place. Backends whose parser requires a different root topology may relocate it and return the resulting root prim.
- Parameters:
- Returns:
The articulation-root prim after backend normalization.
- Raises:
NotImplementedError – If a new joint is needed and the root is not a rigid body.
- classmethod forward() None#
Update articulation kinematics without stepping physics.
Update body poses from joint coordinates via the solver-specialized FK delegate (
_eval_fk, bound to the active subclass’s_eval_fk_impl()ininitialize_solver()). Only the articulations flagged dirty in_fk_reset_maskand_world_reset_mask(seeinvalidate_fk()) are updated. The masks are consumed (zeroed) afterwards so the nextstep()does not redundantly re-solve them.Asset and scene-data reads share the same pending work. The bound delegate dispatches calls on
NewtonManagerto the active solver’s implementation.
- classmethod get_contacts() Contacts | None#
Get the current Newton contact buffer, if the active solver exposes one.
- classmethod get_control() newton.Control#
Get the control object.
- classmethod get_model() newton.Model#
Return the active physics model. Render consumers acquire their backend from the registry.
- classmethod get_scene_data_backend() SceneDataBackend | None#
Return the SceneDataBackend for the SceneDataProvider.
- classmethod get_scene_data_provider() SceneDataProvider#
Return the active scene data provider.
- classmethod get_state_0() newton.State#
Get the current state.
- classmethod get_state_1() newton.State#
Get the next state.
- classmethod handles_decimation() bool#
Truewhenstep()executes the full decimation loop internally.This is the case when all Newton actuators are CUDA-graph-safe. The full decimation loop (including the trivial
decimation=1case) is folded into a singlestep()call.
- classmethod initialize_solver() None#
Initialize the solver and collision pipeline.
Construct the solver and contacts, establish the initial body state, and schedule graph capture for the first step after the environment has authored its initial state. Initialization and capture do not advance physics.
- classmethod instantiate_builder_from_stage()#
Import the explicitly declared clone plan into the Newton builder.
- classmethod invalidate_body_state(env_ids: wp.array(dtype=wp.int32) | None = None, env_mask: wp.array(dtype=wp.bool) | None = None) None#
Mark selected maximal-coordinate body state as changed without requesting FK.
- classmethod invalidate_fk(env_mask: wp.array | None = None, env_ids: wp.array | None = None, articulation_ids: wp.array | None = None) None#
Mark environments as needing FK recomputation and solver reset.
Called by asset write methods that modify joint coordinates or root transforms. The masks are consumed by the next forward, raw-state, rendering, or physics-step boundary.
- Parameters:
env_mask¶ – Boolean mask of dirtied environments. Shape
(num_envs,). Used by_maskwrite methods.env_ids¶ – Integer indices of dirtied environments. Used by
_indexwrite methods.articulation_ids¶ – Mapping from
(world, arti)to model articulation index. Shape(world_count, count_per_world). Obtained fromArticulationView.articulation_ids.
- classmethod is_fabric_enabled() bool#
Check if fabric interface is enabled (not applicable for Newton).
- classmethod pre_render() None#
Sync deferred physics state to the rendering backend.
Called by
render()before cameras and visualizers read scene data. The default implementation is a no-op. Backends that defer transform writes (e.g. Newton’s dirty-flag pattern) should override this to flush pending updates.
- classmethod register_callback(callback: Callable, event: PhysicsEvent, order: int = 0, name: str | None = None, wrap_weak_ref: bool = True) CallbackHandle#
Register a callback. Passes event to parent class.
- classmethod register_post_actuator_callback(callback: Callable[[], None]) None#
Append a hook to the list invoked after the actuator step on every iteration.
Each callback runs inside the captured CUDA graph (when
_is_all_graphable()isTrue) right afterNewtonActuatorAdapter.step()and before the solver substeps, so kernel writes tostate/controlare visible to the integrator on the same iteration. Multiple articulations register their own implicit-DOF telemetry / FF-routing kernels here; all registered callbacks fire in registration order each step.
- classmethod register_post_step_callback(callback: Callable[[], None]) None#
Append a hook to the list invoked after the last solver substep on every step.
Each callback runs inside the stepped (and, when
_is_all_graphable()isTrue, captured) region right after the final solver substep of the decimation loop and before_update_sensors(), so the launches it issues are recorded into every captured CUDA graph and replayed on each tick. The hook fires exactly once perstep()call, reflecting the state after all decimation iterations (and their solver substeps) have completed – not once per substep and not once per decimation iteration. Callbacks must be graph-safe (fixed shapes, no host branching on device data) and must be registered before capture. Articulations with non-identity ordering register their backend-to-user state republish here; all registered callbacks fire in registration order each step.
- classmethod register_state_force_callback(callback: Callable[[newton.State], None]) None#
Register a graph-safe callback that applies forces before every solver substep.
Callbacks must be registered before solver initialization so they are included in CUDA graph capture.
- Parameters:
callback¶ – Function that adds forces [N, N·m] to the provided state.
- classmethod request_extended_contact_attribute(attr: str) None#
Request an extended contact attribute (e.g.
"force").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the model instart_simulation()so that subsequentContactscreation includes them.- Parameters:
attr¶ – Contact attribute name.
- classmethod request_extended_state_attribute(attr: str) None#
Request an extended state attribute (e.g.
"body_qdd").Sensors call this during
__init__, before model finalization. Attributes are forwarded to the builder instart_simulation()so that subsequentmodel.state()calls allocate them.- Parameters:
attr¶ – State attribute name (must be in
State.EXTENDED_ATTRIBUTES).
- classmethod reset(soft: bool = False) None#
Reset physics simulation.
A hard reset (
soft=False) re-finalizes the Newton model, reallocating its device arrays. The cached collision pipeline, contacts and any captured CUDA graph reference the old buffers, so they are released here and rebuilt against the re-finalized model byinitialize_solver(). This avoids the illegal CUDA memory access (CUDA error 700) that would otherwise occur on the first step after a hard reset.A soft reset (
soft=True) skips this full reinitialization and reuses the existing model, solver, collision pipeline and CUDA graph.- Parameters:
soft¶ – If True, skip full reinitialization.
- static safe_callback_invoke(fn: Callable, *args, physics_manager: type[PhysicsManager] | None = None) None#
Invoke a callback, catching exceptions that would be swallowed by external event buses.
Ignores
ReferenceError(from garbage-collected weakref proxies). All other exceptions are forwarded to physics_manager.``store_callback_exception`` when available (see note below), or re-raised immediately otherwise.- Note (Octi):
The carb event bus used by PhysX/Omniverse silently swallows exceptions raised inside callbacks.
PhysxManagerworks around this by storing the exception and re-raising it after event dispatch completes (inreset()/step()). Backends that dispatch events directly (e.g. Newton) don’t need this — exceptions propagate normally — sostore_callback_exceptionis not called for them. This is a known wart; a cleaner solution is actively being explored.
- classmethod set_decimation(decimation: int) None#
Set the decimation count and re-capture the CUDA graph.
When all actuators are graphable the entire decimation loop (actuators + solver substeps, repeated decimation times) is captured as a single CUDA graph.
Invalidate the existing graph when the loop changes. Its replacement is captured immediately before the next requested step, after authored state is reconciled.
- classmethod setup_deformable_body(prim: Any, deformable_type: str, sim_mesh_prim: Any, vis_mesh_prim: Any) None#
Apply Newton’s token deformable anchor schemas and sync the visual mesh geometry.
- classmethod start_simulation() None#
Start simulation by finalizing model and initializing state.
This function finalizes the model and initializes the simulation state. Note: Collision pipeline is initialized later in initialize_solver() after we determine whether the solver needs external collision detection.
- classmethod step() None#
Step the physics simulation.
The stepping logic follows one of two paths depending on whether all actuators are CUDA-graph-safe:
All-graphable path (
_simulate_full()):Actuators and solver substeps are captured together in a single CUDA graph containing the full
decimation x (actuators + solver substeps)loop.Eager-actuator path (fallback, some actuators not graph-safe):
Actuators are stepped eagerly on the CPU timeline (outside the graph), then a graph containing only the solver substeps is launched via
_simulate_physics_only().In both paths the sequence within one physics step is:
zero actuated DOFs in control.joint_f -> actuator.step (computes effort, writes to control.joint_f) -> solver.step x num_substeps (integrates, reads control.joint_f) -> sensors.update
- supports_anim_recording: ClassVar[bool] = False#
Whether this backend can service
--anim_recording_enabled(OVD Recorder).Overridden by backends that implement the recorder (currently PhysX-only).
- classmethod unregister_post_step_callback(callback: Callable[[], None]) None#
Remove a previously registered post-step callback.
Symmetric to
register_post_step_callback(), this lets an articulation deregister its republish hook when its callbacks are cleared so the bound method does not linger on the class-level list after the articulation is gone. Removing a callback that was never registered (or was already removed) is a safe no-op, matching the tolerant deregistration of other handles.