Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Fixed
^^^^^

* Fixed :meth:`~isaaclab_physx.assets.RigidObjectCollection.set_coms_index` and
:meth:`~isaaclab_physx.assets.RigidObjectCollection.set_coms_mask` raising a ``KeyError`` because the
center-of-mass poses were passed to the PhysX tensor API as ``wp.transformf`` instead of ``float32``.
* Fixed :meth:`~isaaclab_physx.assets.RigidObjectCollection.set_coms_index` and
:meth:`~isaaclab_physx.assets.RigidObjectCollection.set_coms_mask` leaving the unselected entries of
:attr:`~isaaclab_physx.assets.RigidObjectCollectionData.body_com_pose_b` zeroed when they were called for a
subset of bodies or environments before the property was first read.
* Fixed :meth:`~isaaclab_physx.assets.RigidObjectCollection.set_inertias_index` and
:meth:`~isaaclab_physx.assets.RigidObjectCollection.set_inertias_mask` failing in the PhysX backend because the
inertias were passed to the PhysX tensor API with the wrong layout.
Original file line number Diff line number Diff line change
Expand Up @@ -1032,13 +1032,13 @@ def set_coms_index(
],
device=self.device,
)
# Invalidate the cached buffer
self.data._body_com_pose_b.timestamp = self.data._sim_timestamp
# Invalidate the cached buffers. The next read refreshes from the view, so that a partial write does not
# expose entries of the buffer that were never read back from the simulation.
self.data._reset_body_com_pose_b_dependents()
# Set into simulation, note that when updating "model" properties with PhysX we need to do it on CPU.
# Convert from instance order (num_instances, num_bodies, 7) to view order (num_bodies*num_instances, 7) for
# PhysX.
com_view_order = self.reshape_data_to_view_2d(self.data._body_com_pose_b.data, device="cpu") # (B*I, 7)
com_view_order = self.reshape_data_to_view_2d(self.data._body_com_pose_b.data, device="cpu").view(wp.float32)
view_ids = self._env_body_ids_to_view_ids(env_ids, body_ids, device="cpu")
self.root_view.set_coms(com_view_order, indices=view_ids)

Expand Down Expand Up @@ -1128,8 +1128,9 @@ def set_inertias_index(
device=self.device,
)
# Set into simulation, note that when updating "model" properties with PhysX we need to do it on CPU.
# Convert from instance order (num_instances, num_bodies) to view order for PhysX.
inertia_view_order = self.reshape_data_to_view_2d(self.data._body_inertia, device="cpu")
# Convert from instance order (num_instances, num_bodies, 9) to view order (num_bodies*num_instances, 9) for
# PhysX.
inertia_view_order = self.reshape_data_to_view_3d(self.data._body_inertia, 9, device="cpu")
view_ids = self._env_body_ids_to_view_ids(env_ids, body_ids, device="cpu")
self.root_view.set_inertias(inertia_view_order, indices=view_ids)

Expand Down
Loading
Loading