Skip to content

Keep the configured foot order in the locomotion feet-wrench observation - #8335

Closed
NeoZng wants to merge 2 commits into
isaac-sim:developfrom
NeoZng:fix/locomotion-feet-wrench-order
Closed

NeoZng wants to merge 2 commits into
isaac-sim:developfrom
NeoZng:fix/locomotion-feet-wrench-order

Conversation

@NeoZng

@NeoZng NeoZng commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

The feet-wrench observation of the Ant and Humanoid tasks resolved the feet against the joint-wrench sensor without preserve_order, so its layout followed the sensor's body order, which is [right_foot, left_foot] for the Humanoid on PhysX and [left_foot, right_foot] on Newton. The manager-based configs, LocomotionDirectEnv and the Warp locomotion environment now pass preserve_order=True, so the layout follows feet_body_names on every backend.

The Humanoid layout on PhysX changes from [right_foot, left_foot] to [left_foot, right_foot], which is what Newton, the default backend of the task, already used. A Humanoid checkpoint trained on PhysX before this change sees the wrenches of its two feet swapped after it; checkpoints trained on Newton are unaffected. The Ant is unchanged, because both backends already list its feet in the configured order.

Fixes #8334

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Validation

test_locomotion_feet_wrench_order.py resolves the feet_body_forces term of the manager-based Humanoid config against a stand-in joint-wrench sensor that lists right_foot before left_foot, as the PhysX sensor does, and checks that the feet come out in the order of FEET_BODY_NAMES.

python -m pytest source/isaaclab_tasks/test/core/test_locomotion_feet_wrench_order.py
# before: 1 failed (['right_foot', 'left_foot'])    after: 1 passed

The Warp locomotion environment runs only on Newton, where the sensor order already matched feet_body_names, so its observation is unchanged; the call is changed to match the other two.

On Isaac-Humanoid the repro in the issue prints ['left_foot', 'right_foot'] on PhysX and Newton. With random actions, the feet part of the observation equals 0.01 times the sensor wrench of [left_foot, right_foot] for Isaac-Humanoid on both backends, and Isaac-Humanoid-Direct on both backends. Isaac-Ant is unchanged on PhysX and Newton.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump package versions — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

The feet-wrench observation of the Ant and Humanoid tasks resolved the feet
against the joint-wrench sensor without preserve_order, so its layout followed
the sensor's body order, which differs between PhysX and Newton for the
Humanoid. The manager-based configs, LocomotionDirectEnv and the Warp
locomotion environment now keep the order of feet_body_names.

Signed-off-by: Zeng Qingcheng <[email protected]>
@NeoZng
NeoZng requested a review from a team October 6, 2026 16:36
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Oct 6, 2026
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Fixes feet-wrench observation order in locomotion tasks.

The PR appears safe to merge; extending regression coverage to the direct and Warp paths would reduce the risk of reintroducing the ordering bug.

Findings

  1. P2 Direct paths lack regression coverage ▶

Summary

The PR makes Ant and Humanoid feet-wrench observations follow the configured foot-name order in manager-based, direct, and Warp locomotion environments.

  • Adds a Humanoid regression test for the manager-based configuration using representative PhysX and Newton sensor orders.
  • Documents the changed layout for older PhysX Humanoid policies.

Reviews (1) · Last reviewed commit: "Keep the configured foot order in the lo..."

@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: Style consistency (1), Test quality (1). Other reviewed categories look good.

  • PR description: Mark the PR behavior-changing because PhysX checkpoints receive swapped foot blocks, and report explicit validation for the changed Warp path rather than only manager and direct environments.
  • 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 duplicated added sentence merely restates preserve_order=True; retain only the non-obvious feet-wrench ordering invariant in both environment comments.
  • Test quality: The Newton parameter passes before the fix and the copied backend inventories exercise no distinct path; keep one reversed-order stand-in that fails without preserve_order.

Significant concerns. Posted 2 inline findings.

Automated review; human maintainers own approval decisions.

The Newton case passed without the fix and repeated the PhysX path, and
the copied sensor body lists had to follow each backend. One stand-in
sensor that lists right_foot before left_foot fails without
preserve_order. The feet-wrench comments no longer restate the argument.

Signed-off-by: Zeng Qingcheng <[email protected]>
@AntoineRichard

AntoineRichard commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Hi @NeoZng, thanks a lot for digging into this and for the very clear repro in #8334!

I feel like the different layout between PhysX and Newton is actually expected here. By default, sensors and articulations report bodies in each backend's native order (joint and body data already differ the same way when joint_ordering / body_ordering are left unset), and they're meant to be used by name. Pinning this one term would also swap the feet for existing PhysX-trained Humanoid checkpoints, so I'd rather not change the default.

You did find a real gap though: setting body_ordering on the articulation didn't propagate to the joint-wrench sensor, so the sim-to-sim recipe couldn't restore the layout. #8344 fixes that, and the sensor now follows the articulation's body order. Once it lands, setting body_ordering on the Humanoid (plus joint_ordering for full policy transfer) gives the same feet-wrench layout on both backends. See docs/source/concepts/joint_and_body_ordering.rst.

So I'm going to close this one in favor of #8344. Thanks again, this is what surfaced the issue :)

ooctipus added a commit that referenced this pull request Oct 9, 2026
# Description

Articulation body ordering previously did not apply to joint-wrench
observations because sensors read backend views directly. Added
`ArticulationData.body_joint_wrench` so callers can read joint reaction
wrenches using the same body indices and ordering as the rest of
articulation data.

The property exposes `[force, torque]` with Torch shape `(num_envs,
num_bodies, 6)`, expressed in the child-side joint frame and referenced
at its anchor. PhysX and OVPhysX reuse their existing articulation
body-buffer ordering helpers. Newton uses the articulation's existing
body map during conversion and shares the frame-conversion function with
the standalone sensor.

Newton requires `ArticulationCfg.enable_joint_wrench=True` before
startup to request extended solver state. Free and world-fixed root
entries are zero, and loop-closing constraints are excluded; PhysX and
OVPhysX retain their backend root reactions. Values describe the last
physics step. Read after stepping following a reset or state write.

Standalone sensors retain their existing ordering and update/reset
behavior. No scene-to-sensor association or separate sensor ordering map
is introduced.

Related to #8334 and #8335.

## Type of change

- New feature
- Documentation update

## Validation

- Newton joint-wrench suite: 11 passed, including welded joints and zero
root entries.
- Final renamed API: Newton physical frame/order checks: 2 passed;
PhysX: 2 passed; OVPhysX CPU and CUDA: 4 passed.
- Ordering regression checks distinct masses, rotated joint frames,
nonzero torques, two environments, and refresh after an initial cached
read. Disabling the articulation ordering map makes it fail on incorrect
physical values.
- Shared contract registration: 1 passed.
- Repository formatting, lint, and changelog checks passed.
- Clean documentation build passed without Sphinx warnings or errors.

## Release backport

- [ ] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the pre-commit checks with `uv run isaaclab --format`
- [x] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the test-audit criteria
- [x] I have added changelog fragments for every touched package
- [x] My name already exists in `CONTRIBUTORS.md`

---------

Co-authored-by: Antoine Richard <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Octi Zhang <[email protected]>
@ooctipus

ooctipus commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

fixed in #8344

@NeoZng
NeoZng deleted the fix/locomotion-feet-wrench-order branch November 3, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] Humanoid feet-wrench observation order differs between PhysX and Newton

3 participants