Skip to content

Commit 72d56c1

Browse files
committed
Use ProxyArray.torch accessor in fabric view tests
wp.to_torch on a ProxyArray is deprecated in favor of the .torch accessor. Switch the three call sites that consume the ProxyArray returned by get_world_poses; leave get_scales call sites alone since that method still returns a raw wp.array (no .torch accessor).
1 parent 0da3c0a commit 72d56c1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

source/isaaclab_physx/test/sim/test_views_xform_prim_fabric.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_fabric_set_world_does_not_write_back_to_usd(device, view_factory):
186186

187187
# Verify Fabric has the new position
188188
fab_pos, _ = view.get_world_poses()
189-
pos_torch = wp.to_torch(fab_pos)
189+
pos_torch = fab_pos.torch
190190
assert torch.allclose(pos_torch, torch.tensor([[99.0, 99.0, 99.0]], device=device), atol=0.1), (
191191
f"Fabric should have new position, got {pos_torch}"
192192
)
@@ -247,7 +247,7 @@ def force_topology_changed():
247247
# Read back — proves the rebuilt _view_to_fabric and _fabric_world_matrices
248248
# are still consistent.
249249
ret_pos, _ = view.get_world_poses()
250-
pos_torch = wp.to_torch(ret_pos)
250+
pos_torch = ret_pos.torch
251251
expected = torch.tensor([[4.0, 5.0, 6.0], [4.0, 5.0, 6.0]], device=device)
252252
assert torch.allclose(pos_torch, expected, atol=1e-7), f"Read after rebuild failed on {device}: {pos_torch}"
253253

@@ -273,7 +273,7 @@ def test_fabric_cuda1_world_pose_roundtrip(device, view_factory):
273273
view.set_world_poses(positions=new_pos)
274274

275275
ret_pos, _ = view.get_world_poses()
276-
pos_torch = wp.to_torch(ret_pos)
276+
pos_torch = ret_pos.torch
277277
expected = torch.tensor([[10.0, 20.0, 30.0], [10.0, 20.0, 30.0]], device=device)
278278
assert torch.allclose(pos_torch, expected, atol=1e-7), f"Roundtrip failed on {device}: {pos_torch}"
279279

0 commit comments

Comments
 (0)