Skip to content

[OVPhysX] Report aggregate friction and total contact forces (requires 0.6.4) - #8422

Merged
ooctipus merged 3 commits into
isaac-sim:developfrom
marcodiiga:fix/malesiani/aggregate_contact_friction
Oct 9, 2026
Merged

ooctipus merged 3 commits into
isaac-sim:developfrom
marcodiiga:fix/malesiani/aggregate_contact_friction

Conversation

@marcodiiga

@marcodiiga marcodiiga commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Description

DRAFT: UPDATE DEPENDENCY PINS BEFORE MERGE

OVPhysX 0.6.4.72118723 is now public and requires OVStage 0.2.1.385922. Keep this PR in draft until the IsaacLab pins and lockfile are updated and CI passes. This PR still leaves the existing pins unchanged.

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_w alias now returns aggregate vectors (E, S, 3); use friction_force_matrix_w for filtered (E, S, F, 3) data. Update the documentation and regression coverage.

Maintainer follow-up

This PR supersedes #8166. Commit 9529486 consolidates 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 273f128f with an OVPhysX 0.6.4 candidate and OVStage 0.2.1.385922. Repository dependency pins remain unchanged.

  • OV backend suite: 540 passed, 19 skipped, 2 xfailed.
  • Shared contract tests: 838 passed, 16 skipped, 5 xfailed; one additional Kit-only module could not collect without Kit.
  • Task smoke coverage: 48/48 registered explicit OVPhysX task presets, each with two environments and 20 steps, plus four single-environment repeats. Three additional Kuka configuration checks passed.
  • Training smoke: 20 single-GPU iterations and 10 distributed iterations across two GPUs, with 256 environments per GPU. Both distributed ranks completed every policy update with finite rewards/losses/parameters and nonzero friction contributions. This checks execution, not convergence.
  • Contact-buffer scale: 1,024/1,024 and 4,096/4,096 sensors in contact, each after 100 warmup and 100 measured steps.
  • CPU/CUDA force-balance and outside-filter probes passed, along with all three friction cases on logical cuda:1.
  • Repository formatting and clean documentation build passed.
  • Kitless golden rendering, both stage variants: 30 passed, 25 failed, 18 skipped. Every failed case also failed on unchanged base 07daf4426 with 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.3 pin. 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

  • Bug fix
  • Behavior change to the friction_forces_w alias
  • Documentation update

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Checklist

  • Read the contribution guidelines
  • Ran uv run --no-sync isaaclab --format
  • Updated the documentation
  • Added focused regression coverage and applied the test-audit criteria
  • Added changelog fragments for the touched packages
  • Contributor name is already in CONTRIBUTORS.md
  • OVPhysX 0.6.4 is publicly available and the matching dependency pins/lockfile are updated
  • CI passes with the updated dependencies

@github-actions github-actions Bot added bug Something isn't working documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Oct 9, 2026
@marcodiiga

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 9, 2026
@ooctipus

ooctipus commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 9, 2026
@ooctipus

ooctipus commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 9, 2026
@ooctipus
ooctipus marked this pull request as ready for review October 9, 2026 22:16
@ooctipus
ooctipus requested a review from a team October 9, 2026 22:16
@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[High impact] Adds aggregate friction force reporting to contact sensor.

The review found no additional blocking defect; the filtered-total test gap is non-blocking.

Findings

  1. P2 Filtered friction can go untested ▶

Summary

OVPhysX contact sensors now read normal and friction forces separately and expose their sum.

  • OVPhysX sensors report total forces with friction included.

Acknowledged by marcodiiga: dependency pins and the lockfile remain unchanged, causing missing-API CI failures; coordinated dependency updates and a CI rerun are deferred before readiness. marcodiiga also identifies the aggregate shape of friction_forces_w as an intentional behavior change.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[OVPhysX contact binding] --> B[Normal force reads]
    A --> C[Friction force reads]
    B --> D[Selected environment update]
    C --> D
    D --> E[Normal buffers and histories]
    D --> F[Total buffers and histories]
    D --> G{Separate friction tracking enabled?}
    G -->|Yes| H[Friction buffers and histories]
    E --> I[Contact timing]
Loading

Reviews (1) · Last reviewed commit: "Merge branch 'develop' into fix/malesian..." · Reviewed by Greptile

Comment on lines +847 to +853
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],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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!

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

@ooctipus
ooctipus merged commit bad2015 into isaac-sim:develop Oct 9, 2026
58 of 60 checks passed
@kellyguo11 kellyguo11 mentioned this pull request Oct 10, 2026
8 tasks done
kellyguo11 added a commit that referenced this pull request Oct 10, 2026
# 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants