Repository navigation
[PhysX] Write transforms to Fabric for on-demand video captures - #8339
AntoineRichard merged 2 commits into
Conversation
Headless video capture turns off continuous Fabric transform updates and refreshes Fabric before each frame instead. That refresh is gated by the same setting, so it wrote nothing: Kit rendered every PhysX body at its USD default pose while the camera followed the simulated robot. Enable transform writes for the duration of the on-demand refresh. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
| PhysxManager._fabric.force_update(0.0, 0.0) | ||
| if not continuous: | ||
| sim.set_setting("/physics/fabricUpdateTransformations", False) |
There was a problem hiding this comment.
Failed refresh leaves writes enabled
During headless video capture, if force_update() raises, the setting is never restored. The video pump catches rendering errors and can continue, so continuous Fabric transform writes remain enabled for the rest of the run, bringing back the training-throughput cost this setting is meant to avoid. Restore the setting in a finally block.
| PhysxManager._fabric.force_update(0.0, 0.0) | |
| if not continuous: | |
| sim.set_setting("/physics/fabricUpdateTransformations", False) | |
| try: | |
| PhysxManager._fabric.force_update(0.0, 0.0) | |
| finally: | |
| if not continuous: | |
| sim.set_setting("/physics/fabricUpdateTransformations", False) |
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Style consistency (1). Other reviewed categories look good.
- PR description: Name
PhysxSceneDataBackend._update_fabricas the fix owner and remove the prohibited AI attribution; the remaining scope, behavior, and validation match the diff. - Design and architecture: Architecture looks good.
- Scope and over-engineering: No over-engineering issues.
- API: API changes look good.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Implementation looks good.
- Style consistency: The new nested
Mockassignment exceeds the configured line length; split it and declarerefreshesbefore the closing lambda. - Test quality: Test quality looks good.
Minor fixes needed. Posted 1 inline finding.
Automated review; human maintainers own approval decisions.
| fabric = Mock() | ||
| # On-demand capture keeps continuous Fabric writes off; each refresh must enable them while it runs. | ||
| settings = {"/physics/fabricUpdateTransformations": False} | ||
| fabric = Mock(force_update=Mock(side_effect=lambda *_: refreshes.append(settings["/physics/fabricUpdateTransformations"]))) |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Line exceeds formatter limit
This assignment is about 127 columns, past the repository's 120-column limit, so uv run isaaclab -f will rewrite it. Split the nested Mock construction and declare refreshes before the lambda that closes over it.
| if self._fabric_timestamp != timestamp: | ||
| # On-demand capture disables continuous Fabric transform writes, which also gates this refresh. | ||
| sim = PhysicsManager._sim | ||
| continuous = bool(sim.get_setting("/physics/fabricUpdateTransformations")) |
There was a problem hiding this comment.
nit: perhaps we can save this string to a var, since we use it 3 times here: "/physics/fabricUpdateTransformations"
| sim = PhysicsManager._sim | ||
| continuous = bool(sim.get_setting("/physics/fabricUpdateTransformations")) | ||
| if not continuous: | ||
| sim.set_setting("/physics/fabricUpdateTransformations", True) |
There was a problem hiding this comment.
nice this looks like a safe way to ungate the fabric transforms while not incidentally introducing double updates
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
run-ci |
|
Backported to |
# Description Since #7642, headless video capture turns off continuous PhysX Fabric transform updates (`/physics/fabricUpdateTransformations`) and refreshes Fabric with `force_update()` before each captured frame. That setting also gates the explicit refresh, so it wrote nothing: Kit rendered every PhysX body at its USD default pose for the whole clip while the simulation, and any camera tracking it, kept moving. - `PhysxManager` enables Fabric transform writes for the duration of the on-demand refresh and restores the previous value, keeping #7642's training throughput between captures. Migration: none. Dependencies: none. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Validation - `source/isaaclab_physx/test/sim/test_physx_scene_data_backend.py` (inside a headless Kit app): 6 passed. The extended test fails before the fix, where the refresh runs with transform writes off. - Single-env `Isaac-Velocity-Flat-H1 physics=physx --video kit`: before the fix, the pelvis `omni:fabric:worldMatrix` stayed at its spawn pose `(0, 0, 2.15)` while PhysX moved the root from `(0.50, -0.38)` to `(0.81, -0.44)`; after, Fabric matches the PhysX root every frame and the clip shows the robot walking. Reproduced on `develop` before the fix. - Recorded all ten `Isaac-Velocity-{Flat,Rough}-*` tasks and `Isaac-Open-Drawer-Franka{,-Direct}` with PhysX through Kit: robots and the cabinet animate correctly. ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks with `uv run isaaclab -f` - [ ] I have made corresponding changes to the documentation (no documented behavior changes) - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added a changelog fragment for every touched source package - [x] My name already exists in `CONTRIBUTORS.md` 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` --------- Co-authored-by: Claude Opus 5.5 <[email protected]> (cherry picked from commit 9a62fa3)
Description
Since #7642, headless video capture turns off continuous PhysX Fabric transform updates (
/physics/fabricUpdateTransformations) and refreshes Fabric withforce_update()before each captured frame. That setting also gates the explicit refresh, so it wrote nothing: Kit rendered every PhysX body at its USD default pose for the whole clip while the simulation, and any camera tracking it, kept moving.PhysxManagerenables Fabric transform writes for the duration of the on-demand refresh and restores the previous value, keeping Avoid continuous rendering between video captures #7642's training throughput between captures.Migration: none. Dependencies: none.
Type of change
Validation
source/isaaclab_physx/test/sim/test_physx_scene_data_backend.py(inside a headless Kit app): 6 passed. The extended test fails before the fix, where the refresh runs with transform writes off.Isaac-Velocity-Flat-H1 physics=physx --video kit: before the fix, the pelvisomni:fabric:worldMatrixstayed at its spawn pose(0, 0, 2.15)while PhysX moved the root from(0.50, -0.38)to(0.81, -0.44); after, Fabric matches the PhysX root every frame and the clip shows the robot walking. Reproduced ondevelopbefore the fix.Isaac-Velocity-{Flat,Rough}-*tasks andIsaac-Open-Drawer-Franka{,-Direct}with PhysX through Kit: robots and the cabinet animate correctly.Checklist
uv run isaaclab -fCONTRIBUTORS.md🤖 Generated with Claude Code
Release backport
develop