Repository navigation
[Backport release/3.0.0] Fix Newton body-offset Jacobian and streamline core offset math (#8203) - #8318
Conversation
|
| # The body-local x offset is root-local y; a root-z rotation gives linear velocity -x. | ||
| expected = torch.tensor([[-1.0, 0.0, 0.0, 0.0, 0.0, 1.0]]).repeat(_NUM_ENVS, 1) | ||
| torch.testing.assert_close(jacobian[:, :, 0], expected, atol=1e-6, rtol=0.0) | ||
| assert not hasattr(math_utils, "velocity_at_point") |
There was a problem hiding this comment.
Unrelated assertion makes test fragile
This assertion checks that a math helper does not exist, rather than checking the Jacobian or controller result. If velocity_at_point is added later, this test will fail even though the behavior it tests remains correct. The Jacobian and controller results are already checked separately; remove this assertion.
| assert not hasattr(math_utils, "velocity_at_point") |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Test quality (1). Other reviewed categories look good.
- PR description: The “reduced overhead” claim lacks measurements; cite #8203 with baseline/candidate revisions, command, hardware, backend, environment count, warmup, and metric, or remove the performance wording.
- 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: Style consistency looks good.
- Test quality: The Jacobian regression covers the Newton-specific frame mismatch, but the unrelated
velocity_at_pointsymbol-absence assertion is implementation inventory and must be removed.
Minor fixes needed. Posted 1 inline finding.
Automated review; human maintainers own approval decisions.
| # The body-local x offset is root-local y; a root-z rotation gives linear velocity -x. | ||
| expected = torch.tensor([[-1.0, 0.0, 0.0, 0.0, 0.0, 1.0]]).repeat(_NUM_ENVS, 1) | ||
| torch.testing.assert_close(jacobian[:, :, 0], expected, atol=1e-6, rtol=0.0) | ||
| assert not hasattr(math_utils, "velocity_at_point") |
There was a problem hiding this comment.
🟡 Warning · Test Quality — Unrelated symbol-absence assertion in test
assert not hasattr(math_utils, "velocity_at_point") guards no Jacobian contract and fails if any unrelated helper gains that name. Delete it, correcting the source change on main so this backport stays an exact cherry-pick.
|
run-ci |
# Description Enable the root `ov` extra in the release base Docker image so its locked environment includes `ovphysx`, `ovrtx`, and `ovstage`. This aligns `release/3.0.0` with the base-image dependency set on `develop` and fixes OVRTX-backed task configurations failing during standard Docker package tests with `ModuleNotFoundError: No module named 'ovrtx'`.\n\nThis is a focused release-branch workflow fix for the CI failure exposed by #8318. It does not change dependency pins or the lockfile.\n\n## Type of change\n\n- Bug fix (non-breaking Docker dependency fix)\n\n## Release backport\n\nNot applicable; this PR targets `release/3.0.0` directly.\n\n## Screenshots\n\nNot applicable.\n\n## Validation\n\n- `uv run --extra test python -m pytest docker/test/test_dockerfile_nonroot.py` — 24 passed\n- `SKIP=check-changelog-fragments uv run isaaclab -f` — all applicable formatting and lint hooks passed\n- `git diff --check`\n\nThe full formatting command’s changelog hook compares the release snapshot against `develop` and reports the release branch’s already-compiled fragments. No `source/<package>` files are changed, so no package changelog fragment applies.\n\n## Checklist\n\n- [x] I have read and understood the contribution guidelines\n- [x] I have run the applicable formatting and lint checks\n- [x] Documentation changes are not required for this Docker dependency fix\n- [x] My changes generate no new warnings\n- [x] I have validated the closest Docker contract tests\n- [x] No source package changed, so no package changelog fragment is required\n- [x] My name already exists in `CONTRIBUTORS.md` --------- Co-authored-by: Octi Zhang <zhengyuz@nvidia.com>
|
run-ci |
…c-sim#8203) # Description A task-space action with `body_offset` needs a Jacobian at the offset point. The core DiffIK and OSC actions received the corrected frame convention in isaac-sim#7989, but the Newton model-free action retained its own formula: it used a body-local lever arm against a root-frame Jacobian and rotated the angular rows by the offset orientation. With a rotated body or root, `J @ qdot` therefore disagreed with the offset-frame twist. This PR fixes the Newton action by rotating the offset into world axes, applying `Jv_point = Jv_origin + Jw × r`, and then rotating the Jacobian into root axes. The angular rows stay unchanged. Core DiffIK and OSC now use the same direct `torch.linalg.cross` operation in root axes instead of constructing a skew matrix and multiplying it by the angular Jacobian. The two forms are mathematically equivalent; the direct cross product avoids an extra matrix allocation and multiplication. No new math wrapper is needed. The Newton task-space actions use Newton's model-free controllers, which require a caller-supplied tool-point pose and Jacobian. Newton's separate model-based controllers and IK objectives support tool-site/link offsets, but are not the controller API used here. The Newton action continues to accept both Newton and PhysX asset data through the public link-origin Jacobian contract. On the official Franka validation from the original fix (rotated fixed root and a hand offset), `J @ qdot` matched the simulator's offset-frame twist: Newton linear error fell from about 0.27 m/s to 2e-6 m/s and angular error from about 0.95 rad/s to 1e-7 rad/s. PhysX errors were 1e-4 to 4e-4, matching the core term's floor. Only configurations with `body_offset` are affected; no shipped task currently uses these Newton action terms. Fixes isaac-sim#8202 ## Type of change - Bug fix and task-space offset performance improvement ## Release backport - [x] Backport this pull request to the active release branch after it merges into `develop` ## Validation - `uv run --frozen --extra test python -m pytest source/isaaclab/test/envs/test_diffik_jacobian_aliasing.py -q` — 5 passed. - `uv run --frozen --extra test python -m pytest source/isaaclab_newton/test/controllers/test_newton_controllers.py -q` — 8 passed; the existing DiffIK case now checks the offset Jacobian. - `uv run --frozen isaaclab -f` — passed with the local changelog base set to this PR's upstream base commit. - 4,096-env, 7-joint Torch GPU microbenchmarks on RTX 5090 (median of 8 paired rounds of 100 calls): Newton world-frame point shift, direct cross 149.6 us/call versus skew matrix 213.5 us/call; core root-frame point shift, direct cross 107.0 us/call versus skew matrix 181.0 us/call. These measure Jacobian computation, not a full simulation step. ## Checklist - [x] I have read and understood the contribution guidelines. - [x] I have run the pre-commit checks. - [x] I have added changelog fragments for both touched packages. - [x] The focused regression tests pass. - [ ] I have made corresponding changes to the documentation. --------- Co-authored-by: Octi Zhang <zhengyuz@nvidia.com> (cherry picked from commit e67c5cb)
e3fc1ed to
a62bc47
Compare
|
run-ci |
Description
Backports #8203 onto
release/3.0.0.This fixes the Newton task-space body-offset Jacobian by shifting its translational rows with the world-frame lever arm before rotating the Jacobian into root axes. It also carries the equivalent core task-space optimization that replaces skew-matrix multiplication with batched cross products.
This is an exact, conflict-free cherry-pick of the merged source change. The Newton regression coverage and both package changelog fragments are included unchanged.
Type of change
Release backport
release/3.0.0directly.Screenshots
Not applicable.
Validation
1a90740c29ae269d3409b448dd321d67ba4d2a55.release/3.0.0tip.git diff --checkpassed.Checklist
isaaclabandisaaclab_newtonchangelog fragments.CONTRIBUTORS.md.Original PR: #8203
Cherry-picked merge commit:
e67c5cb4cfbc8f40de8bf60559048707ea229f58Backport commit:
e3fc1ed20