Skip to content

Expose joint wrenches through articulation data - #8344

Merged
ooctipus merged 6 commits into
isaac-sim:developfrom
StafaH:fix/joint-wrench-public-order
Oct 9, 2026
Merged

ooctipus merged 6 commits into
isaac-sim:developfrom
StafaH:fix/joint-wrench-public-order

Conversation

@StafaH

@StafaH StafaH commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

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 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 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
  • I have added changelog fragments for every touched package
  • My name already exists in CONTRIBUTORS.md

Resolve scene joint-wrench sensors against their owning articulation
and publish reportable wrenches in its public body order. Apply the
permutation inside existing backend update kernels so articulation
ordering presets also control wrench observations without another
per-step reorder pass.

Add a real-backend regression for names, forces, and nonzero torques,
and document sensor coverage and selection semantics.
@StafaH
StafaH requested a review from a team October 6, 2026 21:49
@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 6, 2026

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

  • PR description: The body matches the diff and substantiates the launch claim, but “non-breaking” conflicts with required caller reindexing and omits the declaration-order regression; correct the classification and limitation.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: Breaking changes: sensor-before-articulation scene declarations now fail without a transition path; remove the initialization-order dependency rather than documenting it.
  • Implementation: Implementation looks good.
  • Style consistency: BaseJointWrenchSensor’s new constructor lacks the required return annotation and public API documentation; add -> None and document cfg.
  • Test quality: Test quality looks good.

Minor fixes needed. Posted 3 inline findings.

Automated review; human maintainers own approval decisions.

__backend_name__: str = "base"
"""The name of the backend for the joint wrench sensor."""

def __init__(self, cfg: JointWrenchSensorCfg):

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 — Constructor missing docstring and annotation

The contribution guide requires -> None on value-less functions and Google-style docstrings for public APIs; this added __init__ has neither. Add the annotation and document cfg.

Implementation - Abstract methods to be implemented by backend-specific subclasses.
"""

def _initialize_body_ordering(self, native_names: list[str], root_prim_path_expr: str) -> 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 — Concrete helper under abstract-methods banner

This concrete method sits under the section header announcing abstract methods for backend subclasses, making the banner stale and the member ordering inconsistent. Move it below the abstract methods.

)[0][0]
if root.GetPath() == sensor_root.GetPath():
if not articulation.is_initialized:
raise RuntimeError("The owning articulation must initialize before its joint-wrench sensor.")

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 — Declaration order now breaks initialization

Scene entities register physics-ready callbacks in cfg declaration order, so a config declaring this sensor before its articulation now raises instead of working. Resolve the ordering lazily on first body_names or data access.

@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Reorders wrench sensor output to match articulation body ordering.

The PR appears safe to merge; no actionable issues were found.

What we checked:

  • Unchanged order still works: build_articulation_name_map returns None for unchanged order. resolve_backend_index returns the original index when ordering is off.
  • Reordered bodies keep their frames: Newton uses native_j to select both the child body and the joint frame. Each public entry keeps the correct force and torque frame.

Summary

Scene joint-wrench sensors now follow the owning articulation's public body order, limited to bodies that report wrenches.

  • PhysX and OVPhysX reorder readings within their existing update kernels.
  • Newton reorders both the child body and its joint frame.
  • A shared regression checks names, forces, and torques across all three backends.
  • No actionable issues were found. Runtime tests were not run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Scene articulation body names] --> B[Keep reportable bodies]
    B --> C[Build public-to-native map once]
    D[Native wrench readings] --> E[Existing update kernel]
    C --> E
    E --> F[Sensor names, forces, and torques in public order]
Loading

Reviews (1) · Last reviewed commit: "Honor articulation body order in wrench ..."

AntoineRichard and others added 3 commits October 7, 2026 15:47
Only build the sensor name map when a scene articulation matches and its
order differs from the backend order, so standalone and default-ordered
sensors keep working with duplicate link names. Match the owning
articulation without requiring every scene articulation to have a single
root, so multi-root articulations no longer break sensor initialization.

Replace the scene's write to a private sensor attribute with the public
set_scene_articulations() hook, name the kernel map user_to_backend like
the articulation ordering kernels, label the change Breaking, and add a
migration note.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@StafaH

StafaH commented Oct 8, 2026

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 8, 2026
@StafaH StafaH changed the title Honor articulation body order in wrench sensors Expose joint wrenches through articulation data Oct 8, 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 merged commit fd4d613 into isaac-sim:develop Oct 9, 2026
60 checks passed
@ooctipus
ooctipus deleted the fix/joint-wrench-public-order branch October 9, 2026 05:09
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.

3 participants