isaaclab_contrib.coupling#
Named Newton couplers and their configurations.
This package contains contributed coupled-solver support (proxy and ADMM based rigid-deformable coupling) that wraps Newton’s experimental coupled solvers. Each sub-solver declares its model ownership as a named entry, and coupling interfaces refer to those entries by name.
Classes
Configuration for one named sub-solver and its model ownership. |
|
Base configuration for a Newton experimental coupled solver. |
|
Configuration for one directed virtual-proxy mapping. |
|
Configuration for Newton's lagged-impulse virtual-proxy coupling. |
|
Configuration for Newton's linearized ADMM coupling. |
|
Couple named Newton solver entries through proxy or ADMM interfaces. |
Coupler Configurations#
- class isaaclab_contrib.coupling.coupler_cfg.CouplerEntryCfg[source]#
Bases:
objectConfiguration for one named sub-solver and its model ownership.
Bodies are selected by full Newton body-label regex. Joints and shapes attached to selected bodies are included by default; additional shapes can be selected directly by their full labels.
Attributes:
Unique name used by coupling mappings to reference this entry.
Configuration used to construct this entry's Newton solver.
Bodies owned by this entry.
Parent-model particle indices owned by this entry.
Whether this entry owns every particle in the parent model.
Whether fully selected child joints are owned by this entry.
Whether shapes attached to selected bodies are owned by this entry.
Whether this entry owns all shapes whose body index is
-1.Regexes matched against full Newton shape labels for additional ownership.
Number of equal substeps this entry runs inside one coupled step.
Whether this entry steps in-place instead of using a second state buffer.
- solver_cfg: NewtonSolverCfg#
Configuration used to construct this entry’s Newton solver.
- bodies: list[str]#
Bodies owned by this entry.
Each string is treated as a regex matched against full Newton body labels, including all descendant body labels below the matched path.
- include_child_joints: bool#
Whether fully selected child joints are owned by this entry.
A joint is owned when its child body is selected and its parent is either the world or selected by the same entry.
- class isaaclab_contrib.coupling.coupler_cfg.CouplerCfg[source]#
Bases:
NewtonModelSolverCfgBase configuration for a Newton experimental coupled solver.
Bodies, particles, joints, and shapes may be assigned to at most one entry. Unassigned model elements remain outside the nested solvers. Use a concrete subclass to configure the coupling interfaces.
Attributes:
Coupler implementation class.
Solver type metadata (deprecated).
Global Newton model parameters applied after builder finalization.
Ordered named sub-solver entries and their ownership selectors.
- class_type: type[NewtonManager] | str#
Coupler implementation class.
- 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.
- model_cfg: NewtonModelCfg | None#
Global Newton model parameters applied after builder finalization.
- entries: list[CouplerEntryCfg]#
Ordered named sub-solver entries and their ownership selectors.
- class isaaclab_contrib.coupling.coupler_cfg.CouplerProxyMappingCfg[source]#
Bases:
objectConfiguration for one directed virtual-proxy mapping.
Attributes:
Name of the entry that owns the source bodies.
Name of the entry that receives the proxy bodies.
Source bodies exposed as proxies in the destination entry.
Source particle indices exposed as proxies in the destination entry.
Proxy transfer mode passed to Newton's coupled-proxy solver.
Scale applied to proxy body mass/inertia and particle mass in the destination view.
Proxy-local collision refresh interval.
Configuration or factory for the proxy destination collision pipeline.
- bodies: list[str | int]#
Source bodies exposed as proxies in the destination entry.
String selectors use the full-label-regex semantics of
CouplerEntryCfg.bodies. Raw Newton body ids may be given directly as integers. The coupler resolves selectors to body ids in place, so after build this list holds only integers.
- mode: Literal['lagged', 'staggered']#
Proxy transfer mode passed to Newton’s coupled-proxy solver.
- mass_scale: float#
Scale applied to proxy body mass/inertia and particle mass in the destination view.
- collide_interval: int | None#
Proxy-local collision refresh interval.
Nonerefreshes contacts on every proxy pass. Explicit values must be positive integers and requirecollision_pipelineto be a factory.
- collision_pipeline: NewtonCollisionPipelineCfg | Callable[[ModelView], CollisionPipeline | None] | None#
Configuration or factory for the proxy destination collision pipeline.
Setting the field or returning
Nonefrom the factory passes shared outer contacts to the destination.
- class isaaclab_contrib.coupling.coupler_cfg.CouplerProxyCfg[source]#
Bases:
CouplerCfgConfiguration for Newton’s lagged-impulse virtual-proxy coupling.
Newton’s proxy coupler currently supports at most two solver entries.
Attributes:
Coupler implementation class.
Solver type metadata (deprecated).
Global Newton model parameters applied after builder finalization.
Ordered named sub-solver entries and their ownership selectors.
Directed proxy mappings between named solver entries.
Number of proxy relaxation passes per coupled step.
- class_type: type[NewtonManager] | str#
Coupler implementation class.
- 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.
- model_cfg: NewtonModelCfg | None#
Global Newton model parameters applied after builder finalization.
- entries: list[CouplerEntryCfg]#
Ordered named sub-solver entries and their ownership selectors.
- proxies: list[CouplerProxyMappingCfg]#
Directed proxy mappings between named solver entries.
- class isaaclab_contrib.coupling.coupler_cfg.CouplerAdmmCfg[source]#
Bases:
CouplerCfgConfiguration for Newton’s linearized ADMM coupling.
Attributes:
Coupler implementation class.
Solver type metadata (deprecated).
Global Newton model parameters applied after builder finalization.
Ordered named sub-solver entries and their ownership selectors.
Symmetric contact interfaces as
(entry_name, entry_name)pairs.Number of ADMM dual iterations per coupled step.
ADMM penalty parameter [dimensionless].
Proximal mass scaling parameter [dimensionless].
Position-error correction fraction [dimensionless].
Translational cross-solver joint stiffness [N/m].
Translational cross-solver joint damping [N*s/m].
Angular cross-solver joint stiffness [N*m/rad].
Angular cross-solver joint damping [N*m*s/rad].
Whether cross-solver joint neighbors remain visible as inertial proxies.
Optional entries that receive cross-solver joint proximal bodies.
Mass scale applied to cross-solver joint proximal bodies.
Frame-to-frame matching mode for collision-detected rigid contacts.
Maximum midpoint distance for matching rigid contacts [m].
Minimum normal dot product for matching rigid contacts.
Scale applied to the previous ADMM dual when a rigid contact matches.
- class_type: type[NewtonManager] | str#
Coupler implementation class.
- 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.
- model_cfg: NewtonModelCfg | None#
Global Newton model parameters applied after builder finalization.
- entries: list[CouplerEntryCfg]#
Ordered named sub-solver entries and their ownership selectors.
- contact_pairs: list[tuple[str, str]] | None#
Symmetric contact interfaces as
(entry_name, entry_name)pairs.Noneasks Newton to detect every distinct entry pair automatically. An empty list disables ADMM contact coupling.
- joint_proximal_bodies: bool#
Whether cross-solver joint neighbors remain visible as inertial proxies.
- joint_proximal_destination_entries: list[str] | None#
Optional entries that receive cross-solver joint proximal bodies.
- rigid_contact_matching: Literal['disabled', 'latest', 'sticky']#
Frame-to-frame matching mode for collision-detected rigid contacts.
- contact_matching_pos_threshold: float | None#
Maximum midpoint distance for matching rigid contacts [m].
Newton Coupler#
- class isaaclab_contrib.coupling.coupler.NewtonCouplerManager[source]#
Bases:
NewtonVBDManagerCouple named Newton solver entries through proxy or ADMM interfaces.
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])Create a
ModelBuilderconfigured with default settings.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.
Get the Newton model.
Get the physics timestep in seconds.
Get the list of registered 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_state([scene_data_provider])Get the current Newton state for visualization.
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.
Create builder from USD stage with special treatment for deformable bodies, as these are not read from USD yet.
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.
Refresh derived Newton state before cameras and visualizers read it.
Whether this backend's integrator has implicit numerical damping.
register_callback(callback, event[, order, ...])Register a callback.
register_particle_visual_prim(prim_path, ...)Register a
UsdGeom.Pointsprim whose points mirror a slice of Newton's particle state.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.
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_builder(builder)Set the Newton model builder.
set_decimation(decimation)Set the decimation count and re-capture the CUDA graph.
Start simulation by finalizing model and initializing state.
step()Step the physics simulation.
stop()Stop physics simulation.
Write Newton particle positions to USD/Fabric for Kit viewport rendering.
Write Newton body_q to USD Fabric world matrices for Kit viewport / RTX rendering.
unregister_post_step_callback(callback)Remove a previously registered post-step callback.
update_visualization_state([scene_data_provider])Refresh visualization state for the active sim backend.
Block until the timeline is playing.
- 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.
Converts Isaac Lab pattern conventions (
.*regex, full USD paths) to fnmatch globs and delegates tonewton.sensors.SensorContact.- 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.solvers.SolverNotifyFlags) 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. Recording pipelines (Kit/RTX, Newton GL video, etc.) run from
isaaclab.envs.utils.recording_hooksso they are not tied to a specific physics manager. Default is a no-op.
- 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, **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.
- 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.The delegate (rather than a direct
cls._eval_fk_implcall) is required because the data layer invokesNewtonManager.forward()on the base class, whereclsis the baseNewtonManager; the bound delegate dispatches to the concrete subclass override.
- 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#
Get the Newton model.
When the active sim backend is Newton this returns the manager’s own authoritative model. When the active sim backend is PhysX a shadow Newton model is built lazily (from the visualizer prebuilt artifact) so renderers/visualizers that operate on Newton
ModelandStatecan still drive a PhysX-simulated scene.
- classmethod get_physics_sim_view() list#
Get the list of registered views.
Assets can append their views to this list, and sensors can access them. Returns a list that callers can append to.
- Returns:
List of registered views (e.g., NewtonArticulationView instances).
- 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(scene_data_provider: SceneDataProvider | None = None) newton.State#
Get the current Newton state for visualization.
Use this method from visualizers/renderers/video recorders that need a backend-agnostic Newton
State. When the sim backend is PhysX this refreshes the shadow_state_0.body_qfrom the live PhysX scene viaupdate_visualization_state()before returning, so callers never observe stale transforms. Under the Newton sim backend, pending forward kinematics is applied before returning the live state.
- 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.
TODO: Subclass should not override this method, once deformables supported on Newton import_usd, this can be unified with NewtonManager’s implementation.
- classmethod initialize_solver() None#
Initialize the solver and collision pipeline.
Thin orchestrator: delegates solver construction to
_build_solver()(overridden by each solver subclass), allocates the collision pipeline (when applicable) via_initialize_contacts(), then sets up cubric bindings and either captures the CUDA graph immediately or defers capture until the firststep()call (RTX-active path).Warning
When using a CUDA-enabled device, the simulation is graphed. This means the function steps the simulation once to capture the graph, so it should only be called after everything else in the simulation is initialized.
- classmethod instantiate_builder_from_stage()#
Create builder from USD stage with special treatment for deformable bodies, as these are not read from USD yet.
Detects env Xforms (e.g.
/World/Env_0,/World/Env_1) and builds each as a separate Newton world viabegin_world/end_world. Falls back to a flatadd_usdwhen no env Xforms are found.TODO: Subclass should not override this method, once deformables supported on Newton import_usd, this can be unified with NewtonManager’s implementation.
- 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 provides_implicit_damping() bool#
Whether this backend’s integrator has implicit numerical damping.
With implicit damping (PhysX, OV-PhysX) a camera policy can infer velocity from a single frame. Without it (Newton’s symplectic integrator) the policy needs a temporal cue in the observation (e.g. frame stacking).
The base default is
True; backends without implicit damping override toFalse.- Returns:
Whether the backend’s integrator has implicit numerical damping.
- 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_particle_visual_prim(prim_path: str, particle_offset: int, particle_count: int, sync_frequency: int = 1) None#
Register a
UsdGeom.Pointsprim whose points mirror a slice of Newton’s particle state.
- 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. 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 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.
- 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.
If a CUDA graph was previously captured, it is automatically re-captured with the new decimation count using the same strategy as
start_simulation(): standardwp.ScopedCapturewhen no USDRT stage is active, or deferred relaxed capture when RTX is running.
- 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.
TODO: Subclass should not override this method, missing piece is having Newton bind a surface mesh to volume deformable tetrahedral mesh in addition to removing the deformable_registry data structure.
- 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
- classmethod sync_particles_to_usd() None#
Write Newton particle positions to USD/Fabric for Kit viewport rendering.
Two prim families are synced from
state_0.particle_q:Fabric mesh prims tagged with
newton:particleOffset/newton:particleCount(deformable visual meshes) receive local-frame points on the GPU via_sync_fabric_mesh_particles().UsdGeom.Pointsprims registered throughregister_particle_visual_prim()(MPM particle clouds) receive world-frame points via_sync_particle_points_prims().
No-op when there is no particle state or nothing changed since the last sync.
- classmethod sync_transforms_to_usd() None#
Write Newton body_q to USD Fabric world matrices for Kit viewport / RTX rendering.
No-op when
_usdrt_stageis None (i.e. Kit visualizer is not active) or when transforms have not changed since the last sync.Called at render cadence by
pre_render()(viarender()). Physics stepping marks transforms dirty via_mark_transforms_dirty()so that the expensive Fabric hierarchy update only runs once per render frame rather than after every physics step.Uses
wp.fabricarraydirectly (noisaacsim.physics.newtonextension needed). The Warp kernel readsstate_0.body_q[newton_index[i]]and writes the correspondingmat44dtoomni:fabric:worldMatrixfor each prim.When cubric is available the method mirrors PhysX’s
DirectGpuHelperpattern: pause Fabric change tracking, write transforms, resume tracking, then callIAdapter::computeon the GPU to propagate the hierarchy and notify the Fabric Scene Delegate. Otherwise it falls back to the CPUupdate_world_xforms()path.
- 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.
- classmethod update_visualization_state(scene_data_provider: SceneDataProvider | None = None) None#
Refresh visualization state for the active sim backend.
Newton sim backend: no-op —
_state_0is the live, authoritative state already advanced bystep()/ forward kinematics.PhysX sim backend: pull rigid-body transforms from the
SceneDataProviderand write them into the shadow_state_0.body_qso Newton-native consumers (Newton renderer, Newton/Rerun/Viser visualizers, OVRTX renderer, Newton GL video) see fresh poses.Invoked lazily from
get_state()so consumers do not need to coordinate the sync explicitly.