Fix Newton external wrench frame - #6934
Conversation
Greptile SummaryThe PR corrects Newton external-wrench packing by rotating body-frame forces and torques into world coordinates using each link pose quaternion. The implementation covers shared, articulation-ordered, rigid-object, and rigid-object-collection paths and adds focused CPU Warp regression tests.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or non-blocking defects identified. The updated kernels consistently invert the wrench composer's world-to-body conversion, use correctly ordered link poses, preserve COM-referenced torque, and are covered by focused ordering and frame regressions. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Composed body-frame force and torque] --> B{Articulation body ordering}
B -->|Identity or rigid asset| C[Read public-order link rotation]
B -->|Nonidentity| D[Read public-order link rotation and body map]
C --> E[Rotate force and torque into world frame]
D --> E
E --> F{Backend ordering required?}
F -->|No| G[Write world-frame Newton wrench]
F -->|Yes| H[Scatter to backend body index]
H --> G
Reviews (1): Last reviewed commit: "Correct Newton torque unit notation" | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
The Newton external-wrench fix consistently rotates composed body-frame forces and torques into world coordinates at the packing boundary, with all changed kernel launch sites updated to pass body poses.
- Design and architecture: Performing the rotation in the Newton packing kernels preserves the wrench composer's body-frame contract and avoids additional buffers or kernel launches. The reorder-free and ordered articulation paths, rigid objects, and rigid-object collections follow the same conversion design.
- API: No public API surface is changed. The internal kernel signatures and supplied callers were updated together, while launch dimensions, masks, spatial-vector layout, and public-to-backend body ordering remain consistent. The package changelog fragment is correctly scoped and formatted.
- Implementation: The kernels use only the link-pose quaternion, correctly avoiding a translation-induced moment for COM-referenced wrenches. Public-order poses are indexed before the ordered path scatters into backend order, and regression tests cover rotation, nonzero translation, and nonidentity ordering. Asset-level integration remains a CI validation point because it was unavailable locally.
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.
Document the corrected frame contract for external wrenches. The fused packing conversion now rotates body-frame forces and torques into the world frame before simulation.
Use N·m consistently in the wrench kernel docstrings so their physical-unit annotations follow repository documentation conventions.
|
Could we centralize the body-to-world conversion in the existing |
e0983e1 to
ffed6e9
Compare
| inputs=[ | ||
| composer.out_force_b.warp, | ||
| composer.out_torque_b.warp, | ||
| self._data.body_link_pose_w.warp, |
There was a problem hiding this comment.
These proxy arrays should work without .warp right?
There was a problem hiding this comment.
They should, but I may as well use the right one explicitely!
Description
Newton's external-wrench writers passed the body-frame output of the wrench composer directly to Newton's world-frame
State.body_fbuffer. This caused forces and torques applied to rotated bodies to follow world axes instead of the requested body axes.This change:
No new dependencies are required.
Type of change
Testing
Tests ran in a dedicated virtual environment created from the rebased branch's
uv.lock.379 passed: WrenchComposer plus direct and articulation-ordered Newton packing regressions on CPU/CUDA.10 passed: rigid-object external-force integration selection.18 passed: rigid-object-collection external-force integration selection.20 passed: articulation external-force integration selection.4 passed: focused articulation force-at-position parameterizations across CPU/CUDA and one/two environments../isaaclab.sh -fpassed all hooks before commit and again before push.The corrected wrench direction made the pre-existing 100 N articulation stress load overflow Newton's constraint capacity in three of four parameterizations. A one-line 100 N to 50 N test-load reduction keeps all 100 steps and the original angular-velocity assertion while avoiding unrelated solver divergence. Direct packing tests retain exact frame and body-order assertions.
Screenshots
Not applicable.
Checklist
./isaaclab.sh -fsource/isaaclab_newton/changelog.d/CONTRIBUTORS.md