isaaclab_physx.physics#

Implementation backends for simulation interfaces.

Classes

PhysxManager

Manages PhysX physics simulation lifecycle.

PhysxCfg

Configuration for PhysX physics manager.

Physics Manager#

class isaaclab_physx.physics.PhysxManager[source]#

Bases: PhysicsManager

Manages PhysX physics simulation lifecycle.

Lifecycle: initialize() -> reset() -> step() (repeated) -> close()

Methods:

get_physics_sim_view()

Get the physics simulation view.

__new__(*args, **kwargs)

__init__()

classmethod get_physics_sim_view() omni.physics.tensors.SimulationView | None[source]#

Get the physics simulation view. Override in subclasses.

classmethod __new__(*args, **kwargs)#
__init__()#

Physics Configuration#

class isaaclab_physx.physics.PhysxCfg[source]#

Bases: PhysicsCfg

Configuration for PhysX physics manager.

This configuration includes all PhysX-specific settings including solver parameters, scene configuration, and GPU buffer sizes. For more information, see the PhysX 5 SDK documentation.

PhysX 5 supports GPU-accelerated physics simulation. This is enabled by default, but can be disabled by setting device to cpu. Unlike CPU PhysX, the GPU simulation feature is unable to dynamically grow all the buffers. Therefore, it is necessary to provide a reasonable estimate of the buffer sizes for GPU features. If insufficient buffer sizes are provided, the simulation will fail with errors and lead to adverse behaviors. The buffer sizes can be adjusted through the gpu_* parameters.

Attributes:

class_type

The class type of the PhysxManager.

solver_type

The type of solver to use.

solve_articulation_contact_last

Changes the ordering inside the articulation solver.

min_position_iteration_count

Minimum number of solver position iterations (rigid bodies, cloth, particles etc.).

max_position_iteration_count

Maximum number of solver position iterations (rigid bodies, cloth, particles etc.).

min_velocity_iteration_count

Minimum number of solver velocity iterations (rigid bodies, cloth, particles etc.).

max_velocity_iteration_count

Maximum number of solver velocity iterations (rigid bodies, cloth, particles etc.).

enable_scene_query_support

Enable/disable scene query support for collision shapes.

enable_ccd

Enable a second broad-phase pass that makes it possible to prevent objects from tunneling through each other.

enable_stabilization

Enable/disable additional stabilization pass in solver.

enable_external_forces_every_iteration

Enable/disable external forces every position iteration in the TGS solver.

enable_enhanced_determinism

Enable/disable improved determinism at the expense of performance.

bounce_threshold_velocity

Relative velocity threshold for contacts to bounce (in m/s).

friction_offset_threshold

Threshold for contact point to experience friction force (in m).

friction_correlation_distance

Distance threshold for merging contacts into a single friction anchor point (in m).

gpu_max_rigid_contact_count

Size of rigid contact stream buffer allocated in pinned host memory.

gpu_max_rigid_patch_count

Size of the rigid contact patch stream buffer allocated in pinned host memory.

gpu_found_lost_pairs_capacity

Capacity of found and lost buffers allocated in GPU global memory.

gpu_found_lost_aggregate_pairs_capacity

Capacity of found and lost buffers in aggregate system allocated in GPU global memory.

gpu_total_aggregate_pairs_capacity

Capacity of total number of aggregate pairs allocated in GPU global memory.

gpu_collision_stack_size

Size of the collision stack buffer allocated in pinned host memory.

gpu_heap_capacity

Initial capacity of the GPU and pinned host memory heaps.

gpu_temp_buffer_capacity

Capacity of temp buffer allocated in pinned host memory.

gpu_max_num_partitions

Limitation for the partitions in the GPU dynamics pipeline.

gpu_max_soft_body_contacts

Size of soft body contacts stream buffer allocated in pinned host memory.

gpu_max_particle_contacts

Size of particle contacts stream buffer allocated in pinned host memory.

class_type: type[PhysxManager] | str#

The class type of the PhysxManager.

solver_type: Literal[0, 1]#

The type of solver to use. Default is 1 (TGS).

Available solvers:

  • 0: PGS (Projective Gauss-Seidel)

  • 1: TGS (Temporal Gauss-Seidel)

solve_articulation_contact_last: bool#

Changes the ordering inside the articulation solver. Default is False.

PhysX employs a strict ordering for handling constraints in an articulation. The outcome of each constraint resolution modifies the joint and associated link speeds. However, the default ordering may not be ideal for gripping scenarios because the solver favours the constraint types that are resolved last. This is particularly true of stiff constraint systems that are hard to resolve without resorting to vanishingly small simulation timesteps.

With dynamic contact resolution being such an important part of gripping, it may make more sense to solve dynamic contact towards the end of the solver rather than at the beginning. This parameter modifies the default ordering to enable this change.

For more information, please check here.

Added in version v2.3: This parameter is only available with Isaac Sim 5.1.

min_position_iteration_count: int#

Minimum number of solver position iterations (rigid bodies, cloth, particles etc.). Default is 1.

Note

Each physics actor in Omniverse specifies its own solver iteration count. The solver takes the number of iterations specified by the actor with the highest iteration and clamps it to the range [min_position_iteration_count, max_position_iteration_count].

max_position_iteration_count: int#

Maximum number of solver position iterations (rigid bodies, cloth, particles etc.). Default is 255.

Note

Each physics actor in Omniverse specifies its own solver iteration count. The solver takes the number of iterations specified by the actor with the highest iteration and clamps it to the range [min_position_iteration_count, max_position_iteration_count].

min_velocity_iteration_count: int#

Minimum number of solver velocity iterations (rigid bodies, cloth, particles etc.). Default is 0.

Note

Each physics actor in Omniverse specifies its own solver iteration count. The solver takes the number of iterations specified by the actor with the highest iteration and clamps it to the range [min_velocity_iteration_count, max_velocity_iteration_count].

max_velocity_iteration_count: int#

Maximum number of solver velocity iterations (rigid bodies, cloth, particles etc.). Default is 255.

Note

Each physics actor in Omniverse specifies its own solver iteration count. The solver takes the number of iterations specified by the actor with the highest iteration and clamps it to the range [min_velocity_iteration_count, max_velocity_iteration_count].

enable_scene_query_support: bool#

Enable/disable scene query support for collision shapes. Default is False.

This flag allows performing collision queries (raycasts, sweeps, and overlaps) on actors and attached shapes in the scene. This is useful for implementing custom collision detection logic outside of the physics engine.

If set to False, the physics engine does not create the scene query manager and the scene query functionality will not be available. However, this provides some performance speed-up.

Note

This flag is overridden to True when running the simulation with the GUI enabled. This is to allow certain GUI features to work properly.

enable_ccd: bool#

Enable a second broad-phase pass that makes it possible to prevent objects from tunneling through each other. Default is False.

enable_stabilization: bool#

Enable/disable additional stabilization pass in solver. Default is False.

Note

We recommend setting this flag to true only when the simulation step size is large (i.e., less than 30 Hz or more than 0.0333 seconds).

Warning

Enabling this flag may lead to incorrect contact forces report from the contact sensor.

enable_external_forces_every_iteration: bool#

Enable/disable external forces every position iteration in the TGS solver. Default is True.

When using the TGS solver (solver_type is 1), this flag allows enabling external forces every solver position iteration. This can help improve the accuracy of velocity updates. Increasing the number of velocity iterations, together with this flag, can help improve the accuracy of velocity updates.

Note

This flag is ignored when using the PGS solver (solver_type is 0).

Deprecated since version TBD: This flag is deprecated and will be removed in a future PhysX release.

enable_enhanced_determinism: bool#

Enable/disable improved determinism at the expense of performance. Defaults to False.

For more information on PhysX determinism, please check here.

bounce_threshold_velocity: float#

Relative velocity threshold for contacts to bounce (in m/s). Default is 0.5 m/s.

friction_offset_threshold: float#

Threshold for contact point to experience friction force (in m). Default is 0.04 m.

friction_correlation_distance: float#

Distance threshold for merging contacts into a single friction anchor point (in m). Default is 0.025 m.

gpu_max_rigid_contact_count: int#

Size of rigid contact stream buffer allocated in pinned host memory. Default is 2 ** 23.

gpu_max_rigid_patch_count: int#

Size of the rigid contact patch stream buffer allocated in pinned host memory. Default is 5 * 2 ** 15.

gpu_found_lost_pairs_capacity: int#

Capacity of found and lost buffers allocated in GPU global memory. Default is 2 ** 21.

This is used for the found/lost pair reports in the BP.

gpu_found_lost_aggregate_pairs_capacity: int#

Capacity of found and lost buffers in aggregate system allocated in GPU global memory. Default is 2 ** 25.

This is used for the found/lost pair reports in AABB manager.

gpu_total_aggregate_pairs_capacity: int#

Capacity of total number of aggregate pairs allocated in GPU global memory. Default is 2 ** 21.

gpu_collision_stack_size: int#

Size of the collision stack buffer allocated in pinned host memory. Default is 2 ** 26.

gpu_heap_capacity: int#

Initial capacity of the GPU and pinned host memory heaps. Additional memory will be allocated if more memory is required. Default is 2 ** 26.

gpu_temp_buffer_capacity: int#

Capacity of temp buffer allocated in pinned host memory. Default is 2 ** 24.

gpu_max_num_partitions: int#

Limitation for the partitions in the GPU dynamics pipeline. Default is 8.

This variable must be power of 2. A value greater than 32 is currently not supported. Range: (1, 32)

gpu_max_soft_body_contacts: int#

Size of soft body contacts stream buffer allocated in pinned host memory. Default is 2 ** 20.

gpu_max_particle_contacts: int#

Size of particle contacts stream buffer allocated in pinned host memory. Default is 2 ** 20.