Commit b422e5a
committed
Fix Newton viewer fully-black: assign PyVec3 to camera.pos
NewtonVisualizer._apply_camera_pose was assigning
``self._viewer.camera.pos = wp.vec3(*cam_pos)``, but Newton's
``Camera.translate()`` adds a ``pyglet.math.Vec3`` delta to ``camera.pos``
via ``+=`` on every viewer update.
warp 1.13's strict ``__add__`` rejects ``wp.vec3 + pyglet.math.Vec3``
with::
TypeError: Built-in functions cannot be called with non-Warp array
types, such as lists, tuples, and NumPy arrays. Use a Warp type
such as `wp.vec`, `wp.mat`, `wp.quat`, or `wp.transform`.
The TypeError is silenced by the visualizer's ``try/except``
(``logger.debug``), which then short-circuits before
``renderer.render()`` -- so the framebuffer never gets written and
``ViewerGL.get_frame`` reads back all zeros. The test asserts that
the last frame is non-black, hence "Viewer frame appears fully black."
Same render-path failure manifested across the Newton 1.2.0rc2 +
warp 1.13 cohort. Earlier hypotheses ruled out: viewer-code rc1->rc2
diff, ``wp.RegisteredGLBuffer`` API change, pure flakiness, the bump
cohort alone, ``_make_current()``, and an explicit ``glFinish`` +
``wp.synchronize_device``. Direct CPU readback of the FBO confirmed
it was empty (and a control ``glClear`` to red persisted untouched
across all 60 frames -- proof that nothing was writing to the FBO,
not even the renderer's own ``glClearColor`` + ``glClear``).
Local repro on a non-MIG L40 with Kit 110.0.0 + Newton 1.2.0rc2 +
warp 1.13.0 reproduces the failure deterministically. With
``cam_pos`` assigned as ``pyglet.math.Vec3`` instead, the
``+=`` is type-homogeneous, no exception, ``renderer.render()`` runs,
and both ``[physx]`` and ``[newton]`` parametrizations pass in
~50 s each.
This also re-enables the test that was skipped as a workaround in
PR #5538.1 parent e15b1d0 commit b422e5a
3 files changed
Lines changed: 26 additions & 17 deletions
File tree
- source/isaaclab_visualizers
- changelog.d
- isaaclab_visualizers/newton
- test
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
467 | 477 | | |
468 | 478 | | |
469 | 479 | | |
| |||
Lines changed: 0 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | 525 | | |
542 | 526 | | |
543 | 527 | | |
| |||
0 commit comments