Repository navigation
[OVPhysX] Report aggregate friction and total contact forces (requires 0.6.4) - #8422
Conversation
|
run-ci |
|
run-ci |
|
run-ci |
|
| scene_cfg.total_sensor = replace( | ||
| scene_cfg.contact_sensor, | ||
| track_pose=False, | ||
| track_contact_points=False, | ||
| track_friction_forces=False, | ||
| max_contact_data_count_per_prim=0, | ||
| filter_prim_paths_expr=[scene_cfg.shape.prim_path], |
There was a problem hiding this comment.
Filtered friction can go untested
test_friction_reporting never checks a nonzero filtered total with track_friction_forces=False. Its only sensor with that option disabled filters out the ground, so force_matrix_w and its history stay zero. A regression that drops friction from filtered totals when separate friction tracking is disabled would pass.
Add a sensor with friction tracking disabled and a ground filter, then compare its filtered totals and history against the sensor with friction tracking enabled.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Compatibility and deprecation (2), Style consistency (2), Test quality (1). Other reviewed categories look good.
- PR description: Validation targets 273f128, not head e39ee8b; update it, remove stale commit narration, and report baseline/head friction-read latency with revisions, command, hardware, backend, environment count, warmup, and metric.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: No over-engineering issues.
- API: API changes look good.
- Compatibility and deprecation: Breaking changes: unchanged OVPhysX 0.6.3 pins cannot support the new calls, and friction_forces_w changes shape without an old-contract-functional deprecation bridge; update pins and preserve the alias during a warned transition.
- Implementation: Implementation looks good.
- Style consistency: The added total_sensor field omits the purpose and default documentation used by sibling fields; document it consistently.
- Test quality: The reset sweep includes zero-by-design buffers, making those checks vacuous; exclude them and restore the pre-reset nonzero guard.
Significant concerns. Posted 5 inline findings.
Automated review; human maintainers own approval decisions.
| self._contact_binding.read_net_forces(self._net_forces_flat_buf) | ||
| if self._force_matrix_flat_buf is not None: | ||
| self._contact_binding.read_force_matrix(self._force_matrix_flat_buf) | ||
| self._contact_binding.read_net_normal_forces(self._net_normal_forces_flat_buf) |
There was a problem hiding this comment.
🔴 Critical · Compatibility — OVPhysX 0.6.4 APIs without pin update
These reads exist only in OVPhysX 0.6.4, but the dependency pins and lockfile are unchanged, so every OVPhysX contact sensor raises AttributeError on the supported runtime. Land the coordinated pins with this change.
| :meth:`compute_first_contact` / :meth:`compute_first_air`. | ||
| * ``track_contact_points`` — average contact positions [m] per sensor/filter pair. | ||
| * ``track_friction_forces`` — summed friction forces [N] per sensor/filter pair, including history. | ||
| * ``track_friction_forces`` - aggregate and per-filter friction forces [N], including history. |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Bullet uses hyphen not em dash
Every adjacent bullet in this list separates the option name from its description with an em dash; this line uses a plain hyphen. Match the surrounding punctuation.
|
|
||
| None if :attr:`ContactSensorCfg.track_friction_forces` is False. | ||
| """ | ||
| return self.net_friction_forces_w |
There was a problem hiding this comment.
🟡 Warning · Compatibility — friction_forces_w shape changes silently
This alias previously returned the filtered (E,S,F,3) matrix with a UserWarning on OVPhysX; it now returns (E,S,3) with no warning, so existing indexing breaks silently. Emit a targeted warning naming net_friction_forces_w for one release.
| This is a second contact sensor used for testing contact filtering. | ||
| """ | ||
|
|
||
| total_sensor: ContactSensorCfg = None |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Scene config field lacks docstring
Sibling optional fields shape_2 and contact_sensor_2 document their purpose and None default. Add an equivalent docstring stating that total_sensor filters out the ground to check aggregate-versus-filtered forces.
| ) | ||
| torch.testing.assert_close(data.friction_force_matrix_w.torch[:, :, 0], data.net_friction_forces_w.torch) | ||
|
|
||
| forces = [ |
There was a problem hiding this comment.
🟡 Warning · Test Quality — Reset sweep lost non-vacuity guard
The removed count_nonzero(before) > 0 assertion no longer protects this loop, and total_sensor.force_matrix_w is asserted all-zero at line 922, so its reset checks cannot fail. Exclude zero-by-design buffers and restore the guard.
# Description Backports #8422 to `release/3.0.0`. OVPhysX contact sensors now report separate normal and friction components plus their total, including filtered forces and histories. The backport preserves normal-based contact timing, selective resets, contact loss handling, and the documented `friction_forces_w` aggregate shape. Depends on #8441, which upgrades the release branch to OVPhysX `0.6.4.72118723` and OVStage `0.2.1.385922`. Keep this PR in draft until #8441 merges and CI is rerun against those required APIs. The source commit cherry-picked without conflicts. The only intentional release-specific range difference is retaining the release-line benchmark command `./isaaclab.sh -p`; `release/3.0.0` has not adopted the develop-line `uv run` CLI migration. ## Type of change - Bug fix - Behavior change to the `friction_forces_w` alias - Documentation update ## Release backport - [x] Not applicable: this PR targets `release/3.0.0` directly. ## Screenshots Not applicable. ## Validation - `ISAACLAB_CHANGELOG_BASE_REF=changelog-validation-backport-8422 uvx pre-commit run --all-files` — passed every hook, including changelog validation against the current upstream release tip; the temporary validation ref was removed afterward. - `git diff --check upstream/release/3.0.0...HEAD` — passed. - `git range-diff` against source commit `bad20159e` — matched except for the intentional release-line benchmark invocation described above. - `pytest source/isaaclab_ov/test/sensors/test_contact_sensor_kernels.py -q` — collected successfully; both CUDA-scoped cases skipped because the local macOS host has no CUDA. - Full OVPhysX simulation coverage is pending CI after #8441 merges. The release lockfile excludes macOS and OVPhysX is unavailable on this host. ## Checklist - [x] I have read and understood the contribution guidelines. - [x] I have run the pre-commit checks. - [x] I have made corresponding documentation changes. - [x] My changes generate no new static-check warnings. - [x] I reviewed the focused regression coverage against the test-audit criteria. - [x] I retained changelog fragments for both touched source packages. - [x] Contributor names already exist in `CONTRIBUTORS.md`. Co-authored-by: Alesiani Marco <[email protected]> Co-authored-by: marcodiiga <[email protected]> Co-authored-by: Octi Zhang <[email protected]>
Description
OVPhysX contact sensors currently expose normal-only force totals and reject aggregate friction reads. Use the separate normal/friction APIs available in OVPhysX 0.6.4 to report both components and their sum, including filtered forces and histories.
Aggregate friction works without filters or detailed-contact capacity. Total forces include friction even when separate friction tracking is disabled. Preserve normal-based contact timing and handle selective resets and contact loss. The
friction_forces_walias now returns aggregate vectors(E, S, 3); usefriction_force_matrix_wfor filtered(E, S, F, 3)data. Update the documentation and regression coverage.Maintainer follow-up
This PR supersedes #8166. Commit
9529486consolidates force-history loops and test parameter combinations, and folds an excluded-filter check into the existing friction test. The repository formatter, changelog gate, and CPU Warp checks passed. Full simulation tests could not run locally because the NVIDIA driver fails CUDA initialization before sensor setup.Validation
Validated commit
273f128fwith an OVPhysX 0.6.4 candidate and OVStage0.2.1.385922. Repository dependency pins remain unchanged.cuda:1.07daf4426with both candidate and original locked dependencies. These are baseline failures; this rendering sweep is not fully green. No tolerances were changed.Current CI has 55 failed test executions from missing new contact APIs with the unchanged OVPhysX
0.6.3pin. The candidate-runtime results above are separate from public pinned-package CI. Rerun CI with the published, coordinated dependencies before marking this ready for review; candidate ARM execution remains unverified.Type of change
friction_forces_waliasRelease backport
developChecklist
uv run --no-sync isaaclab --formatCONTRIBUTORS.md