Repository navigation
Expose joint wrenches through articulation data - #8344
Conversation
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.
There was a problem hiding this comment.
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
-> Noneand documentcfg. - 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): |
There was a problem hiding this comment.
🟡 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: |
There was a problem hiding this comment.
🟡 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.") |
There was a problem hiding this comment.
🟡 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.
|
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]>
|
run-ci |
|
run-ci |
Description
Articulation body ordering previously did not apply to joint-wrench observations because sensors read backend views directly. Added
ArticulationData.body_joint_wrenchso 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=Truebefore 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
Validation
Release backport
developChecklist
uv run isaaclab --formatCONTRIBUTORS.md