isaaclab_ov.assets#
Sub-package for ovphysx-backed assets.
Classes
OVPhysX-backed volume or surface deformable object asset. |
|
Data container for an OVPhysX-backed deformable object. |
Deformable Object#
- class isaaclab_ov.assets.DeformableObject[source]#
Bases:
BaseDeformableObjectOVPhysX-backed volume or surface deformable object asset.
The state of a deformable object comprises the world-frame positions and velocities of its simulation nodes. Volume deformables additionally expose per-node kinematic targets. OVPhysX surface deformables do not support those targets and reject target writes with the same error as the PhysX backend.
OVPhysX deformable tensor bindings are supported only on CUDA simulation devices.
Attributes:
Configuration instance for the deformable object.
Data container for the deformable object.
Number of deformable object instances matched by the asset.
Number of bodies in the asset.
Deformable body view for direct OVPhysX tensor access.
Deprecated property.
Optional deformable material view for direct OVPhysX tensor access.
Maximum number of simulation mesh elements per deformable body.
Maximum number of collision mesh elements per deformable body.
Maximum number of simulation mesh vertices per deformable body.
Maximum number of collision mesh vertices per deformable body.
Memory device for computation.
Whether the asset has a debug visualization implemented.
Whether the asset is initialized.
Methods:
__init__(cfg)Initialize the deformable object.
reset([env_ids, env_mask])Reset the deformable object.
Write pending deformable commands to the simulator.
update(dt)Update the internal simulation timestamp.
write_nodal_state_to_sim_index(nodal_state)Set nodal positions and velocities over selected environments.
write_nodal_pos_to_sim_index(nodal_pos[, ...])Set nodal positions over selected environment indices.
write_nodal_velocity_to_sim_index(nodal_vel)Set nodal velocities over selected environment indices.
Set volume-deformable kinematic targets over selected environments.
assert_shape_and_dtype(tensor, shape, dtype)Assert the shape and dtype of a tensor or warp array.
assert_shape_and_dtype_mask(tensor, masks, dtype)Assert the shape of a tensor or warp array against mask dimensions.
set_debug_vis(debug_vis)Sets whether to visualize the asset data.
set_visibility(visible[, env_ids])Set the visibility of the prims corresponding to the asset.
transform_nodal_pos(nodal_pos[, pos, quat])Transform the nodal positions based on the pose transformation.
write_nodal_kinematic_target_to_sim(targets)Deprecated.
Set the kinematic targets of the simulation mesh for the deformable bodies using mask.
write_nodal_pos_to_sim(nodal_pos[, env_ids])Deprecated.
write_nodal_pos_to_sim_mask(nodal_pos[, ...])Set the nodal positions over selected environment mask into the simulation.
write_nodal_state_to_sim(nodal_state[, env_ids])Deprecated.
write_nodal_state_to_sim_mask(nodal_state[, ...])Set the nodal state over selected environment mask into the simulation.
write_nodal_velocity_to_sim(nodal_vel[, env_ids])Deprecated.
write_nodal_velocity_to_sim_mask(nodal_vel)Set the nodal velocity over selected environment mask into the simulation.
- cfg: DeformableObjectCfg#
Configuration instance for the deformable object.
- __init__(cfg: DeformableObjectCfg) None[source]#
Initialize the deformable object.
- Parameters:
cfg¶ – Configuration instance for the deformable object.
- property data: DeformableObjectData#
Data container for the deformable object.
- property num_bodies: int#
Number of bodies in the asset.
This is always one because each object is a single deformable body.
- property root_view: OvPhysxDeformableBodyView#
Deformable body view for direct OVPhysX tensor access.
Note
Use this view with caution. OVPhysX indexed writes require complete first-dimension buffers even when only selected rows are applied.
- property root_physx_view: OvPhysxDeformableBodyView#
Deprecated property. Please use
root_viewinstead.
- property material_physx_view: OvPhysxView | None#
Optional deformable material view for direct OVPhysX tensor access.
- property max_sim_elements_per_body: int#
Maximum number of simulation mesh elements per deformable body.
- property max_collision_elements_per_body: int#
Maximum number of collision mesh elements per deformable body.
- property max_sim_vertices_per_body: int#
Maximum number of simulation mesh vertices per deformable body.
- property max_collision_vertices_per_body: int#
Maximum number of collision mesh vertices per deformable body.
- reset(env_ids: Sequence[int] | None = None, env_mask: wp.array(dtype=wp.bool) | None = None) None[source]#
Reset the deformable object.
- update(dt: float) None[source]#
Update the internal simulation timestamp.
- Parameters:
dt¶ – Time elapsed since the previous update [s].
- write_nodal_state_to_sim_index(nodal_state: torch.Tensor | wp.array(dtype=vec6f) | ProxyArray, env_ids: Sequence[int] | torch.Tensor | wp.array(dtype=wp.int32) | None = None, full_data: bool = False) None[source]#
Set nodal positions and velocities over selected environments.
- Parameters:
nodal_state¶ – Nodal state in simulation frame [m, m/s]. Shape is
(len(env_ids), max_sim_vertices_per_body, 6)or the full(num_instances, max_sim_vertices_per_body, 6).env_ids¶ – Environment indices. If None, all indices are used.
full_data¶ – Whether
nodal_statecontains all instances.
- write_nodal_pos_to_sim_index(nodal_pos: torch.Tensor | wp.array(dtype=wp.vec3f) | ProxyArray, env_ids: Sequence[int] | torch.Tensor | wp.array(dtype=wp.int32) | None = None, full_data: bool = False) None[source]#
Set nodal positions over selected environment indices.
- write_nodal_velocity_to_sim_index(nodal_vel: torch.Tensor | wp.array(dtype=wp.vec3f) | ProxyArray, env_ids: Sequence[int] | torch.Tensor | wp.array(dtype=wp.int32) | None = None, full_data: bool = False) None[source]#
Set nodal velocities over selected environment indices.
- write_nodal_kinematic_target_to_sim_index(targets: torch.Tensor | wp.array(dtype=wp.vec4f) | ProxyArray, env_ids: Sequence[int] | torch.Tensor | wp.array(dtype=wp.int32) | None = None, full_data: bool = False) None[source]#
Set volume-deformable kinematic targets over selected environments.
- Parameters:
- Raises:
ValueError – If this is a surface deformable body.
- assert_shape_and_dtype(tensor: float | torch.Tensor | wp.array, shape: tuple[int, ...], dtype: type, name: str = '', *, axis_sizes: tuple[int, ...] | None = None) None#
Assert the shape and dtype of a tensor or warp array.
Controlled by
AssetBaseCfg.disable_shape_checks. When checks are disabled this method is a no-op.- Parameters:
tensor¶ – The tensor or warp array to assert the shape of. Floats are skipped.
shape¶ – The expected leading dimensions (e.g.
(num_envs, num_joints)).dtype¶ – The expected warp dtype.
name¶ – Optional parameter name for error messages.
axis_sizes¶ – Optional selector sizes. Defaults to the expected leading dimensions.
- assert_shape_and_dtype_mask(tensor: float | torch.Tensor | wp.array, masks: tuple[wp.array, ...], dtype: type, name: str = '', trailing_dims: tuple[int, ...] = ()) None#
Assert the shape of a tensor or warp array against mask dimensions.
Mask-based write methods expect full-sized data — one element per entry in each mask dimension, regardless of how many entries are
True. The expected leading shape is therefore(mask_0.shape[0], mask_1.shape[0], ...)(i.e. the total size of each dimension, not the number of selected entries).Controlled by
AssetBaseCfg.disable_shape_checks. When checks are disabled this method is a no-op.- Parameters:
tensor¶ – The tensor or warp array to assert the shape of. Floats are skipped.
masks¶ – Tuple of mask arrays whose
shape[0]dimensions form the expected leading shape.dtype¶ – The expected warp dtype.
name¶ – Optional parameter name for error messages.
trailing_dims¶ – Extra trailing dimensions to append (e.g.
(9,)for inertias withwp.float32).
- property has_debug_vis_implementation: bool#
Whether the asset has a debug visualization implemented.
- property is_initialized: bool#
Whether the asset is initialized.
Returns True if the asset is initialized, False otherwise.
- set_debug_vis(debug_vis: bool) bool#
Sets whether to visualize the asset data.
- Parameters:
debug_vis¶ – Whether to visualize the asset data.
- Returns:
Whether the debug visualization was successfully set. False if the asset does not support debug visualization.
- set_visibility(visible: bool, env_ids: Sequence[int] | None = None)#
Set the visibility of the prims corresponding to the asset.
This operation affects the visibility of the prims corresponding to the asset in the USD stage. It is useful for toggling the visibility of the asset in the simulator. For instance, one can hide the asset when it is not being used to reduce the rendering overhead.
Note
This operation uses the PXR API to set the visibility of the prims. Thus, the operation may have an overhead if the number of prims is large.
- transform_nodal_pos(nodal_pos: torch.Tensor, pos: torch.Tensor | None = None, quat: torch.Tensor | None = None) torch.Tensor#
Transform the nodal positions based on the pose transformation.
This function computes the transformation of the nodal positions based on the pose transformation. It multiplies the nodal positions with the rotation matrix of the pose and adds the translation. Internally, it calls the
isaaclab.utils.math.transform_points()function.- Parameters:
nodal_pos¶ – The nodal positions in the simulation frame [m]. Shape is (N, max_sim_vertices_per_body, 3).
pos¶ – The position transformation [m]. Shape is (N, 3). Defaults to None, in which case the position is assumed to be zero.
quat¶ – The orientation transformation as quaternion (x, y, z, w). Shape is (N, 4). Defaults to None, in which case the orientation is assumed to be identity.
- Returns:
The transformed nodal positions [m]. Shape is (N, max_sim_vertices_per_body, 3).
- write_nodal_kinematic_target_to_sim(targets: torch.Tensor | wp.array | ProxyArray, env_ids: Sequence[int] | torch.Tensor | wp.array | None = None) None#
Deprecated. Please use
write_nodal_kinematic_target_to_sim_index()instead.
- write_nodal_kinematic_target_to_sim_mask(targets: torch.Tensor | wp.array | ProxyArray, env_mask: wp.array | None = None) None#
Set the kinematic targets of the simulation mesh for the deformable bodies using mask.
- write_nodal_pos_to_sim(nodal_pos: torch.Tensor | wp.array | ProxyArray, env_ids: Sequence[int] | torch.Tensor | wp.array | None = None) None#
Deprecated. Please use
write_nodal_pos_to_sim_index()instead.
- write_nodal_pos_to_sim_mask(nodal_pos: torch.Tensor | wp.array | ProxyArray, env_mask: wp.array | None = None) None#
Set the nodal positions over selected environment mask into the simulation.
- write_nodal_state_to_sim(nodal_state: torch.Tensor | wp.array | ProxyArray, env_ids: Sequence[int] | torch.Tensor | wp.array | None = None) None#
Deprecated. Please use
write_nodal_state_to_sim_index()instead.
- write_nodal_state_to_sim_mask(nodal_state: torch.Tensor | wp.array | ProxyArray, env_mask: wp.array | None = None) None#
Set the nodal state over selected environment mask into the simulation.
- write_nodal_velocity_to_sim(nodal_vel: torch.Tensor | wp.array | ProxyArray, env_ids: Sequence[int] | torch.Tensor | wp.array | None = None) None#
Deprecated. Please use
write_nodal_velocity_to_sim_index()instead.
- write_nodal_velocity_to_sim_mask(nodal_vel: torch.Tensor | wp.array | ProxyArray, env_mask: wp.array | None = None) None#
Set the nodal velocity over selected environment mask into the simulation.
- class isaaclab_ov.assets.DeformableObjectData[source]#
Bases:
BaseDeformableObjectDataData container for an OVPhysX-backed deformable object.
Simulation state is read lazily into stable Warp allocations. Each public
ProxyArrayis created once and remains valid while OVPhysX refreshes its underlying allocation in place.Attributes:
Default nodal state
[nodal_pos, nodal_vel]in simulation world frame.Simulation mesh kinematic targets for the deformable bodies.
Nodal positions in simulation world frame [m].
Nodal velocities in simulation world frame [m/s].
Nodal position-velocity states in simulation world frame [m, m/s].
Mean simulation-node position in simulation world frame [m].
Mean simulation-node velocity in simulation world frame [m/s].
Methods:
update(dt)Update the data for the deformable object.
- default_nodal_state_w: ProxyArray | None = None#
Default nodal state
[nodal_pos, nodal_vel]in simulation world frame.Shape is (num_instances, max_sim_vertices_per_body), dtype
vec6f. UseProxyArray.warpfor the underlyingwarp.arrayorProxyArray.torchfor a cached zero-copytorch.Tensorview.
- nodal_kinematic_target: ProxyArray | None = None#
Simulation mesh kinematic targets for the deformable bodies.
Shape is (num_instances, max_sim_vertices_per_body), dtype
wp.vec4f. UseProxyArray.warpfor the underlyingwarp.arrayorProxyArray.torchfor a cached zero-copytorch.Tensorview.The kinematic targets are used to drive the simulation mesh vertices to the target positions. The targets are stored as (x, y, z, is_not_kinematic) where “is_not_kinematic” is a binary flag indicating whether the vertex is kinematic or not. The flag is set to 0 for kinematic vertices and 1 for non-kinematic vertices.
- property nodal_pos_w: ProxyArray#
Nodal positions in simulation world frame [m].
Shape is
(num_instances, max_sim_vertices_per_body), dtypewp.vec3f.
- property nodal_vel_w: ProxyArray#
Nodal velocities in simulation world frame [m/s].
Shape is
(num_instances, max_sim_vertices_per_body), dtypewp.vec3f.
- property nodal_state_w: ProxyArray#
Nodal position-velocity states in simulation world frame [m, m/s].
Shape is
(num_instances, max_sim_vertices_per_body), dtypevec6f.
- property root_pos_w: ProxyArray#
Mean simulation-node position in simulation world frame [m].
Shape is
(num_instances,), dtypewp.vec3f.
- property root_vel_w: ProxyArray#
Mean simulation-node velocity in simulation world frame [m/s].
Shape is
(num_instances,), dtypewp.vec3f.
Note
isaaclab.assets.DeformableObjectCfg is the shared configuration
class for deformable objects. The isaaclab_ov extension provides the OVPhysX
implementation of isaaclab.assets.DeformableObject, while
deformable schema and material cfgs referenced by spawn remain
backend-specific.
Additional Public Classes#
The following classes are part of the public isaaclab_ov.assets API.
An articulation asset class. |
|
Data container for an articulation. |
|
A rigid object asset class. |
|
A rigid object collection class. |
|
Data container for a rigid object collection. |
|
Data container for a rigid object. |
- class isaaclab_ov.assets.Articulation[source]#
Bases:
BaseArticulationAn articulation asset class.
An articulation is a collection of rigid bodies connected by joints. The joints can be either fixed or actuated. The joints can be of different types, such as revolute, prismatic, D-6, etc. However, the articulation class has currently been tested with revolute and prismatic joints. The class supports both floating-base and fixed-base articulations. The type of articulation is determined based on the root joint of the articulation. If the root joint is fixed, then the articulation is considered a fixed-base system. Otherwise, it is considered a floating-base system. This can be checked using the
Articulation.is_fixed_baseattribute.For an asset to be considered an articulation, the root prim of the asset must have the USD ArticulationRootAPI. This API is used to define the sub-tree of the articulation using the reduced coordinate formulation. On playing the simulation, the physics engine parses the articulation root prim and creates the corresponding articulation in the physics engine. The articulation root prim can be specified using the
AssetBaseCfg.prim_pathattribute.OVPhysX exposes per-tensor-type
ovphysx.TensorBindingobjects rather than a single opaque view; binding handles are created eagerly in_initialize_impl()and reused across reads and writes. CPU-only bindings (mass, CoM, inertia, joint properties, tendon properties) are routed through pinned-host staging buffers managed byArticulationData.Methods:
- __init__(cfg: ArticulationCfg)[source]#
Initialize the articulation.
- Parameters:
cfg¶ – A configuration instance.
- classmethod __new__(*args, **kwargs)#
- class isaaclab_ov.assets.ArticulationData[source]#
Bases:
BaseArticulationDataData container for an articulation.
This class contains the data for an articulation in the simulation. The data includes the state of the root rigid body, the state of all the bodies in the articulation, and the joint state. The data is stored in the simulation world frame unless otherwise specified.
An articulation is comprised of multiple rigid bodies or links. For a rigid body, there are two frames of reference that are used:
Actor frame: The frame of reference of the rigid body prim. This typically corresponds to the Xform prim with the rigid body schema.
Center of mass frame: The frame of reference of the center of mass of the rigid body.
Depending on the settings, the two frames may not coincide with each other. In the robotics sense, the actor frame can be interpreted as the link frame.
Note
Pull-to-refresh model. OVPhysX state properties are not automatically updated each simulation step. Without ordering or joint-direction correction, first access per timestamp refreshes the public buffer directly from the OVPhysX
TensorBindingand caches it until the next step. Otherwise, the getter normalizes a backend-order staging buffer into an owned public-order shadow. Newton’s solver-owned backend-order buffers are refreshed automatically by the simulation, and its nonidentity public-order shadows are published automatically once per simulation step.Note
CPU-only bindings. OVPhysX exposes a subset of bindings (
BODY_MASS,BODY_COM_POSE,BODY_INERTIA, and mostDOF_*property bindings) on CPU only. These are routed through pinned-host staging buffers via_binding_read()so that GPU-resident consumers see the data without per-step host allocations.Note
Recorded read commands. OVPhysX reads into stable, pre-allocated destination buffers. Outside CUDA graph capture, repeated Warp kernels that derive or reorder public data from those buffers reuse recorded launch commands. Direct
TensorBindingreads continue to useOvPhysxView’s object-identity cache. Recorded commands are discarded whenever ordering buffers may be replaced or the data container is invalidated.Methods:
- __init__(view: OvPhysxView, device: str) None[source]#
Initialize the articulation data container.
- Parameters:
view¶ – The
OvPhysxViewbinding manager for this articulation. All counts (instances, bodies, DOFs, fixed/spatial tendons) are derived from the view metadata. Name lists are assigned by_initialize_impl()after construction.device¶ – Simulation device string (e.g.,
"cuda:0"or"cpu").
- classmethod __new__(*args, **kwargs)#
- class isaaclab_ov.assets.RigidObject[source]#
Bases:
BaseRigidObjectA rigid object asset class.
Rigid objects are assets comprising of rigid bodies. They can be used to represent dynamic objects such as boxes, spheres, etc. A rigid body is described by its pose, velocity and mass distribution.
For an asset to be considered a rigid object, the root prim of the asset must have the USD RigidBodyAPI applied to it. This API is used to define the simulation properties of the rigid body. On playing the simulation, the physics engine will automatically register the rigid body and create a corresponding rigid body handle. State is read and written through ovphysx
TensorBindingobjects acquired from theOvPhysxManager. Only free (non-articulated) rigid bodies are supported; prims under anArticulationRootAPIshould useArticulationinstead.Methods:
- __init__(cfg: RigidObjectCfg)[source]#
Initialize the rigid object.
- Parameters:
cfg¶ – A configuration instance.
- classmethod __new__(*args, **kwargs)#
- class isaaclab_ov.assets.RigidObjectCollection[source]#
Bases:
BaseRigidObjectCollectionA rigid object collection class.
This class represents a collection of rigid objects in the simulation, where the state of the rigid objects can be accessed and modified using a batched
(env_ids, object_ids)API.For each rigid body in the collection, the root prim of the asset must have the USD RigidBodyAPI applied to it. This API is used to define the simulation properties of the rigid bodies. On playing the simulation, the physics engine will automatically register the rigid bodies and create a corresponding rigid body handle. This handle can be accessed using the
root_viewattribute.Rigid objects in the collection are uniquely identified via the key of the dictionary
rigid_objectsin theRigidObjectCollectionCfgconfiguration class. This differs from theRigidObjectclass, where a rigid object is identified by the name of the Xform where the USD RigidBodyAPI is applied. This would not be possible for the rigid object collection since therigid_objectsdictionary could contain the same rigid object multiple times, leading to ambiguity.Methods:
- __init__(cfg: RigidObjectCollectionCfg)[source]#
Initialize the rigid object.
- Parameters:
cfg¶ – A configuration instance.
- classmethod __new__(*args, **kwargs)#
- class isaaclab_ov.assets.RigidObjectCollectionData[source]#
Bases:
BaseRigidObjectCollectionDataData container for a rigid object collection.
This class contains the data for a rigid object collection in the simulation. The data includes the state of all the bodies in the collection. The data is stored in the simulation world frame unless otherwise specified. The data is in the order
(num_instances, num_objects, data_size), where data_size is the size of the data.For a rigid body, there are two frames of reference that are used:
Actor frame: The frame of reference of the rigid body prim. This typically corresponds to the Xform prim with the rigid body schema.
Center of mass frame: The frame of reference of the center of mass of the rigid body.
Depending on the settings of the simulation, the actor frame and the center of mass frame may be the same. This needs to be taken into account when interpreting the data.
The data is lazily updated, meaning that the data is only updated when it is accessed. This is useful when the data is expensive to compute or retrieve. The data is updated when the timestamp of the buffer is older than the current simulation timestamp. The timestamp is updated whenever the data is updated.
Note
Pull-to-refresh model. Properties pull fresh data from the OVPhysX tensor API on first access per timestamp and cache the result. This differs from Newton, where buffers are refreshed automatically by the simulation.
Note
ProxyArray pointer stability. Each
ProxyArraywrapper is created once and reused because the OVPhysX tensor API returns views into stable, pre-allocated GPU buffers whose device pointer does not change across simulation steps.Methods:
- __init__(root_view: OvPhysxView, num_bodies: int, device: str)[source]#
Initializes the rigid object data.
- Parameters:
root_view¶ – The
OvPhysxViewover the collection’s fused multi-prim bindings (one perLINK_*/BODY_*data-class key, created from the underlyingRIGID_BODY_*type viakey_aliases).num_bodies¶ – The number of bodies in the collection.
device¶ – The device used for processing.
- classmethod __new__(*args, **kwargs)#
- class isaaclab_ov.assets.RigidObjectData[source]#
Bases:
BaseRigidObjectDataData container for a rigid object.
This class contains the data for a rigid object in the simulation. The data includes the state of the root rigid body and the state of all the bodies in the object. The data is stored in the simulation world frame unless otherwise specified.
For a rigid body, there are two frames of reference that are used:
Actor frame: The frame of reference of the rigid body prim. This typically corresponds to the Xform prim with the rigid body schema.
Center of mass frame: The frame of reference of the center of mass of the rigid body.
Depending on the settings of the simulation, the actor frame and the center of mass frame may be the same. This needs to be taken into account when interpreting the data.
The data is lazily updated, meaning that the data is only updated when it is accessed. This is useful when the data is expensive to compute or retrieve. The data is updated when the timestamp of the buffer is older than the current simulation timestamp. The timestamp is updated whenever the data is updated.
Note
Pull-to-refresh model. Properties pull fresh data from the PhysX tensor API on first access per timestamp and cache the result. This differs from Newton, where buffers are refreshed automatically by the simulation.
Note
ProxyArray pointer stability. Each
ProxyArraywrapper is created once and reused because the PhysX tensor API returns views into stable, pre-allocated GPU buffers whose device pointer does not change across simulation steps.Methods:
- __init__(view: OvPhysxView, device: str, check_shapes: bool = True)[source]#
Initializes the rigid object data.
- Parameters:
view¶ – The
OvPhysxViewbinding manager for this rigid object.num_instancesis read from therigid_body_posebinding’scountandnum_bodiesis fixed at 1;body_namesis set by_initialize_impl().device¶ – The device used for processing.
check_shapes¶ – Whether to enforce internal shape/dtype invariants on lazy reads. Defaults to
True; production callers thread this fromdisable_shape_checks.
- classmethod __new__(*args, **kwargs)#