Skip to content

Commit 2f2a4e1

Browse files
Pass 3D wrench buffer to LINK_WRENCH binding
The OVPhysX wheel's ``LINK_WRENCH`` binding expects a 3D ``(num_instances, num_bodies, 9)`` tensor (force ⊕ torque ⊕ position), but ``compute()`` was passing the 2D ``(N*B, 9)`` flat reshape view, so the wheel rejected with ``write_tensor_binding: expected 3D tensor, got 2D``. Pass the 3D buffer directly and drop the now-unused flat alias.
1 parent e44809c commit 2f2a4e1

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

  • source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation

source/isaaclab_ovphysx/isaaclab_ovphysx/assets/articulation/articulation.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def write_data_to_sim(self) -> None:
226226
)
227227
binding = self._get_binding(TT.LINK_WRENCH)
228228
if binding is not None:
229-
binding.write(self._wrench_buf_flat)
229+
binding.write(self._wrench_buf)
230230
inst.reset()
231231

232232
# 2. Actuator model.
@@ -695,17 +695,10 @@ def _create_buffers(self) -> None:
695695
self._ALL_TRUE_FIXED_TENDON_MASK = wp.array(np.ones(FT, dtype=bool), dtype=wp.bool, device=device)
696696
self._ALL_TRUE_SPATIAL_TENDON_MASK = wp.array(np.ones(ST, dtype=bool), dtype=wp.bool, device=device)
697697

698-
# Wrench buffer + flat view (multi-body generalization).
699-
# The kernel writes into the (N, B, 9) view; the binding consumes the (N*B, 9)
700-
# view -- both alias the same allocation, so we cache the flat reshape once.
698+
# Wrench buffer (force, torque, position) per body, written by the
699+
# ``_body_wrench_to_world`` kernel and consumed by the
700+
# ``LINK_WRENCH`` binding which expects the 3D ``(N, B, 9)`` shape.
701701
self._wrench_buf = wp.zeros((N, B, 9), dtype=wp.float32, device=device)
702-
self._wrench_buf_flat = wp.array(
703-
ptr=self._wrench_buf.ptr,
704-
shape=(N * B, 9),
705-
dtype=wp.float32,
706-
device=device,
707-
copy=False,
708-
)
709702

710703
# Wrench composers.
711704
self._instantaneous_wrench_composer = WrenchComposer(self)

0 commit comments

Comments
 (0)