Skip to content

[Newton] Report joint reaction wrenches for fixed connections - #7978

Merged
ooctipus merged 3 commits into
isaac-sim:developfrom
ooctipus:fix/newton-fixed-joint-wrench
Sep 24, 2026
Merged

ooctipus merged 3 commits into
isaac-sim:developfrom
ooctipus:fix/newton-fixed-joint-wrench

Conversation

@ooctipus

@ooctipus ooctipus commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Newton's joint wrench sensor omitted welded tool and wrist-sensor bodies because it inherited the articulation's control-joint filter. A fixed connection still transmits force and torque.

Select reportable tree joints from the Newton model while reusing the articulation's cached body bindings. This includes fixed joints between bodies and continues to exclude free joints, world-fixed roots, and loop-closing constraints. The articulation's control-joint selection and the wrench conversion kernel remain unchanged. Callers should select sensor entries by body name.

Extended the existing cartpole gravity-wrench test with a fixed pole joint. Three selection cases cover distinct root types, loop exclusion, reordered bodies, and per-environment anchors. The PR adds no USD fixture or test file, and only the existing Newton sensor test file changes.

Fixes #7969.

Validation

  • All 13 Newton sensor cases passed after merging current develop, using Newton 1.6.0 and Warp 1.17.0.
  • The fixed-pole physics case and all three selection cases failed with the original implementation; the movable-pole case still passed.
  • Verified cached body bindings are reused, no second sensing view is created, and control-joint selection stays unchanged.
  • Six-file architecture audit and uv run --no-sync isaaclab -f passed.

Type of change

  • Bug fix
  • Documentation update

Release backport

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

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • I have added a changelog fragment for every touched package
  • My name already exists in CONTRIBUTORS.md

@ooctipus
ooctipus requested a review from a team September 23, 2026 18:44
@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 Sep 23, 2026
@greptile-apps

greptile-apps Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the expanded fixed-joint selection preserves cached body bindings and is covered by targeted topology, device, frame, and physics tests.

Summary

This PR separates Newton joint-wrench reporting from articulation control-joint filtering so fixed body-to-body connections are measured without modifying or duplicating the cached articulation view.

  • Selects reportable tree joints directly from the Newton model while excluding free roots, world-fixed roots, and loop closures.
  • Rebinds child-side joint frames and body mappings for the expanded sensor selection.
  • Adds analytic welded-tool coverage across Newton and PhysX, plus CPU/CUDA and cached-view selection cases.
  • Updates sensor documentation and changelog guidance to select measurements by body name.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    M[Newton model tree joints] --> S[Sensor-specific joint selection]
    S -->|Exclude free and world-fixed roots| R[Reportable joints]
    S -->|Stop at articulation_end| X[Loop closures excluded]
    V[Cached articulation view] --> B[Shared body bindings]
    R --> F[Per-environment joint frames]
    B --> K[Wrench conversion kernel]
    F --> K
    K --> D[Force and torque indexed by body name]
Loading

Reviews (1) · Last reviewed commit: "Fix Newton joint wrench readings for fix..."

@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

The Newton joint-wrench sensor now selects reportable tree joints directly from the Newton model while reusing the articulation’s cached body bindings. The changed selection, body mapping, documentation, changelog, and Newton/PhysX regression coverage were reviewed without identifying an actionable pre-merge defect.

  • Design and architecture: The sensor’s reportable-joint selection is intentionally separated from the articulation control-joint filter while retaining the shared ArticulationView for body state. The articulation start/end range excludes loop-closing constraints, and the mask retains fixed body-to-body joints while excluding free joints and world-fixed roots. The repository-level placement of the supporting guideline is broad, but the patch does not establish a concrete maintenance failure requiring relocation.
  • API: Newton’s reported body count and ordering can change because fixed connections are now included. This compatibility surface is documented with guidance to select entries through body_names or find_bodies, and no configuration, export, or wrench-buffer interface is changed.
  • Implementation: The model-derived joint IDs, per-environment joint-frame gather, and child-body remapping were traced through the existing conversion kernel. Tests cover cached and newly created views, CPU and CUDA, root-joint variants, loop weld exclusion, differing body/joint order, per-environment anchors, and analytic welded-tool wrenches. The copied joint_X_c array is a snapshot rather than a live view-backed binding, leaving a non-blocking tradeoff if joint frames were ever mutated after initialization.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@Lynn-hh

Lynn-hh commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Thanks @ooctipus for turning this around so quickly!

I'd like to follow up on the rotated-frame PhysX discrepancy you mention. Here is a hypothesis I want to verify:

  • The PhysX articulation docs state that the link incoming joint force is "reported in the joint frame of the link's incoming joint" (PhysX 5.5 Articulations).
  • isaaclab_physx/sensors/joint_wrench/kernels.py instead treats the raw wrench as "body1's frame, referenced at body1's origin". It then shifts the torque by joint_pos_b and rotates both components by joint_quat_b.

If the docs are right, those transforms are applied twice whenever the child-side joint frame (localPos1/localRot1) is not identity. That would match your observation: the aligned-frame case agrees, and only the rotated one differs.

I'll try to confirm this with a minimal articulation that has a rotated and offset localPose1 against the analytic wrench. If it holds, I'll open an issue and a fix PR with a PhysX regression test (the rotated variant of your welded_tool fixture). This is the same class of frame issue as the FORGE F/T transform in #7967.

@ooctipus

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 Sep 24, 2026
@ooctipus
ooctipus enabled auto-merge (squash) September 24, 2026 03:46
@ooctipus
ooctipus disabled auto-merge September 24, 2026 04:17
@ooctipus
ooctipus merged commit 6bb09fc into isaac-sim:develop Sep 24, 2026
52 of 53 checks passed
@ooctipus
ooctipus deleted the fix/newton-fixed-joint-wrench branch September 24, 2026 04:17
ooctipus added a commit that referenced this pull request Sep 24, 2026
## Description

Fixes #3513 and the PhysX joint-wrench frame discrepancy discussed in
#7978.

`forge_utils.change_FT_frame` used the inverse rotation and the wrong
lever-arm sign when expressing a wrench in another frame. It now
computes the source pose in the target frame and applies:

- `f_t = R_ts f_s`
- `tau_t = R_ts tau_s + p_ts × f_t`

The existing independent point-force test covers translated frames with
identity and arbitrary rotations. FORGE's current force-only observation
remains unchanged because its call uses identity rotations.

The PhysX sensor had a separate error: `get_link_incoming_joint_force()`
already returns forces and torques in the child-side joint frame, about
its anchor. The sensor applied `localPos1` and `localRot1` again. It now
exposes the native components directly, removing the redundant USD
traversal, frame buffers, and GPU transformations. This follows the
[PhysX tensor API
contract](https://docs.omniverse.nvidia.com/kit/docs/omni_physics/108.0/extensions/runtime/source/omni.physics.tensors/docs/api/python.html#omni.physics.tensors.impl.api.ArticulationView.get_link_incoming_joint_force).

Replaced the circular PhysX frame test with one shared integration
fixture used by both Newton and PhysX. It uses the same timestep,
geometry, loads, expected values, and tolerances: a passive vertical
hinge supports a 2 kg body through an offset child frame rotated 90
degrees relative to the body. The articulation is also rotated about
world Z. Both backends must report `F=(0, 0, 19.62) N` and `tau=(-1.962,
4.905, 0) N·m`, calculated from gravity and the known lever arm. The
test checks that the body stays at rest. No raw wrench or production
conversion is used to calculate the reference.

The fixture reuses the existing simple articulation asset with temporary
USD overrides; no asset is added to the repository. The existing backend
test files invoke the shared check. Removed the old circular reference
helper.

## Validation

- Newton sensor suite and FORGE tests: 12 passed.
- PhysX sensor suite: 16 passed, including eager/recorded updates and
reset behavior.
- The shared physical test failed with the original PhysX
implementation, with a 19.62 N force-component error, and passed after
removing the duplicate transform. Newton passes the same analytic
contract.
- Architecture audit and `uv run --no-sync isaaclab -f` passed.
- Recorded GPU update microbenchmark at 1024 environments × 8 links:
approximately 3 microseconds per launch before and after. Initialization
no longer scans USD joint frames or allocates their buffers.

## Type of change

- Bug fix
- Documentation update

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the pre-commit checks
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective
- [x] I have added a changelog fragment for every touched package
- [x] My name already exists in `CONTRIBUTORS.md`

## Follow-up

FORGE names its raw incoming-joint wrench `force_sensor_world`, although
the API reports the child joint frame. Moving FORGE's observation to an
explicitly selected frame is separate work because it can change policy
inputs. This PR preserves its current force observation.

---------

Signed-off-by: Lynn <[email protected]>
Co-authored-by: Octi Zhang <[email protected]>
ooctipus added a commit that referenced this pull request Sep 25, 2026
…ts (#8018)

## Description

Completes the missing `develop` backports to `release/3.0.0` from the
48-hour audit window ending September 25, 2026 at 05:55 UTC. Of 30
merged source PRs, 25 were already present on release, three had no
backport, and two had inferred draft backports.

- #7978: report Newton reaction wrenches for fixed connections while
preserving articulation control-joint ownership.
- #7997: correct OVPhysX joint-wrench frames and move the shared
analytic sensor contract into the test tree.
- #7989: correct body-offset Jacobians in task-space actions without
mutating backend buffers.
- #8010 and #8009: backport the OVPhysX and PhysX test audits after
their wrench prerequisite.

All five source patches apply without conflicts in this order. This
supersedes the now-closed inferred draft backports #8016 and #8017,
which were generated without #7997 and adapted their sensor tests around
the old release implementation. Source commit hashes are recorded in the
commit message.

## Validation

- Audited all 778 paths touched by the 30 source PRs. Remaining
differences in those paths are existing release metadata, cloning
documentation, a CLI test version example, and release-only renderer
tests.
- **55 focused checks passed:** 6 Jacobian/shared-contract unit tests,
14 Newton sensor tests, 9 OVPhysX sensor tests across CPU/GPU, 9 PhysX
sensor tests, 14 changed shared-ordering cases, and 3 live PhysX OSC
tracking/gravity cases. Seven PhysX ordering variants skipped in the
direct invocation; the live PhysX checks ran separately with Kit.
- Backend validation used Newton 1.6.0, Warp 1.17.0, OVPhysX 0.6.3, and
the pinned Isaac Sim 6.1.0 installation. Package imports were verified
to resolve to this backport checkout.
- `uv run --no-sync isaaclab -f`, `git diff --check`, and the full `make
-C docs current-docs` build with warnings as errors passed.
- Additional renderer contract coverage: 53 passed; two live-render
cases could not initialize the local native CRenderApi library despite
installing the pinned `ov` extra. Full Docker/GPU CI is running on the
PR head.
- The broader shared ordering file has 14 OVPhysX failures on both this
branch and unchanged release, with identical failing node IDs and no
added failures. The changed cases listed above passed.

## Controller coverage review

The live PhysX OSC tests remain in
`source/isaaclab/test/controllers/test_operational_space.py`; its
fixture uses `SimulationCfg`'s default `PhysxCfg`, and the file is
included in CI. The existing absolute-pose tracking,
gravity-compensation, and nullspace-centering cases passed against Isaac
Sim 6.1.0. The test audit removes the duplicate asset-suite cases while
retaining this controller-suite coverage.

## Existing release CI failures

The latest [release
run](https://github.com/isaac-sim/IsaacLab/actions/runs/36097576980) and
[develop
run](https://github.com/isaac-sim/IsaacLab/actions/runs/36099567240)
fail the same five OvStage image comparisons in
`rendering-correctness-kitless (ovstage)` and `ovrtx-cache-warm`:
Cartpole on Newton and OVPhysX, plus Newton Franka cable, cloth, and
soft. Cartpole is 2.03–2.04% different against a 1.50% threshold on both
branches; cloth is 32.48% on both. These shared rendering failures
predate this catch-up; this PR does not change rendering output or image
thresholds.

## Checklist

- [x] Contribution guidance followed and formatting checks passed
- [x] Original package changelog fragments and documentation included
- [x] File-by-file backport audit completed
- [x] Warning-free documentation build completed
- [ ] Full CI completed

Targets `release/3.0.0`; no further backport is needed.
@ooctipus ooctipus self-assigned this Sep 25, 2026
@ooctipus ooctipus added this to the Isaac Lab 3.0 GA milestone Sep 25, 2026
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

Status: Done

Development

Successfully merging this pull request may close these issues.

[Proposal] Newton JointWrenchSensor: report in-tree FIXED joints (wrist F/T parity with PhysX)

2 participants