Commit 3fd4f48
committed
Patch caller sensor _num_envs from OvPhysxFrameView
Under OVPhysX's clone_usd=False scenes (the default for InteractiveScene),
USD only holds env_0 -- env_1..N are physics-layer clones via physx.clone().
SensorBase.__init__ derives _num_envs from len(find_matching_prims(...)) so
any FrameView-using sensor (RayCaster, MultiMeshRayCaster, Camera) sees
_num_envs=1 even when the scene has many envs. The sensor's
_reset_mask_torch is then sized 1, and the first reset(env_ids=[0..N-1])
triggers a CUDA assert from out-of-bounds indexing.
Walk the call stack at construction time to capture the sensor that owns
this view, then at the end of _initialize_impl re-allocate its env-sized
buffers (_ALL_ENV_MASK, _reset_mask + torch view, _is_outdated, _timestamp,
_timestamp_last_update) to match the OVPhysX RIGID_BODY_POSE binding's
row count. Duck-typed -- works for any SensorBase subclass without an
isaaclab.sensors import dependency. Mirrors the local fix the OVPhysX
ContactSensor already applies to itself at contact_sensor.py:240-248.
This is a hack confined to the OVPhysX backend. A cleaner long-term fix
would source _num_envs from InteractiveScene.num_envs (or move the
under-cloning behaviour to be opt-in for rendering rather than backend-
keyed), but both are larger changes that touch core IsaacLab.
Verified: Anymal-D rough velocity env with presets=ovphysx + 64 envs
now initializes past env.reset() without the CUDA assert.1 parent dbe9e51 commit 3fd4f48
1 file changed
Lines changed: 74 additions & 0 deletions
Lines changed: 74 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
26 | 40 | | |
27 | 41 | | |
28 | 42 | | |
| |||
318 | 332 | | |
319 | 333 | | |
320 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
321 | 341 | | |
322 | 342 | | |
323 | 343 | | |
| |||
334 | 354 | | |
335 | 355 | | |
336 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
337 | 406 | | |
338 | 407 | | |
339 | 408 | | |
| |||
473 | 542 | | |
474 | 543 | | |
475 | 544 | | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
476 | 550 | | |
477 | 551 | | |
478 | 552 | | |
| |||
0 commit comments