Repository navigation
[Fix] Let Pink IK load robots from mesh directories and floating-base assets - #9310
Conversation
|
run-ci |
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Compatibility and deprecation (2), Style consistency (3). Other reviewed categories look good.
- PR description: The title and validation table match the loading changes; qualify “non-breaking,” remove patch attribution and unsubstantiated first-compute timing, and condense repeated explanations while preserving template sections; initialization-only changes need no benchmark.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: No over-engineering issues.
- API: API changes look good.
- Compatibility and deprecation: Breaking changes: unconditional root reduction removes documented full-model entries, and scalar-joint validation rejects previously accepted construction; preserve legacy paths through targeted warnings, migration documentation, removal guidance, and transition coverage.
- Implementation: Implementation looks good.
- Style consistency: The validation introduces a redundant model alias, and added test prose misstates mesh placement and origin rejection; use direct attributes and describe the actual fixture and non-zero-origin constraint.
- Test quality: Test quality looks good.
Significant concerns. Posted 5 inline findings.
Automated review; human maintainers own approval decisions.
| raise ValueError( | ||
| f"Pink IK does not support a non-zero origin on the floating root joint '{model.names[1]}'." | ||
| ) | ||
| self.robot_wrapper = self.robot_wrapper.buildReducedRobot([1]) |
There was a problem hiding this comment.
🟡 Warning · Compatibility — Preserve the floating-root model
Unconditional reduction removes the documented floating-base entries from full_q and full_model for direct callers. Make controller root locking explicit; keep the old constructor path functional through a warned, documented, tested transition.
There was a problem hiding this comment.
Not changed. On main a floating root never worked: the controller raised ValueError: 'floating_base' is not in list, and a directly built PinkKinematicsConfiguration raised ValueError on its first update(q) (9 configuration entries against 3 joint names), so there is no working path to preserve; the in-repo callers all use fixed-root URDFs.
| # Each joint position fills one entry of q and each joint velocity one entry of v, so every joint, controlled | ||
| # or not, must have nq == nv == 1. A continuous joint is one DoF (nv == 1) but Pinocchio stores it as | ||
| # (cos, sin) (nq == 2), so it cannot be updated from a joint position and is rejected here. | ||
| model = self.full_model |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Remove the redundant model alias
Assigning self.full_model to model solely shortens known-attribute access and adds a second name for the validated model. Use self.full_model directly in this check.
There was a problem hiding this comment.
Done in 72c0cc0: the check uses self.full_model directly. The earlier model alias stays, since it names the model before the root is reduced.
| for i in range(1, model.njoints) | ||
| if model.nqs[i] != 1 or model.nvs[i] != 1 | ||
| ] | ||
| if unsupported: |
There was a problem hiding this comment.
🟡 Warning · Compatibility — Preserve continuous-joint construction
This rejects previously constructible configurations with uncontrolled continuous joints before callers update them. Keep legacy construction functional while introducing the restriction through a targeted warning, migration documentation, and old/new path tests.
There was a problem hiding this comment.
Not changed. On main such a configuration was built, but its first update(q) raised ValueError because the continuous joint takes two configuration entries, and PinkIKController.compute() calls update on every step. Rejecting it at construction moves that failure earlier with a clear message; no Pink task URDF has such a joint.
| mesh = tmp_path / "robot" / "meshes" / "triangle.obj" | ||
| mesh.parent.mkdir(parents=True) | ||
| mesh.write_text("v 0 0 0\nv 1 0 0\nv 0 1 0\nf 1 2 3\n") | ||
| # Keep the URDF outside mesh_path so that only mesh_path resolves the mesh. |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Correct the mesh fixture comment
The URDF is inside mesh_path (tmp_path), not outside it. Say it is outside the mesh package directory so the comment describes what this fixture actually establishes.
There was a problem hiding this comment.
Done in 72c0cc0: the URDF's location does not resolve package:// meshes in any placement, so the comment and the urdf/ subfolder are removed and the URDF now sits in tmp_path.
| np.testing.assert_allclose(floating.get_frame_jacobian("link_2"), pink_config.get_frame_jacobian("link_2")) | ||
|
|
||
| def test_floating_root_with_origin_raises(self, urdf_path, controlled_joint_names, tmp_path): | ||
| """A floating root joint with an origin would not put the robot base at the origin, so it is rejected.""" |
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Specify a non-zero origin
The docstring says a floating root with an origin is rejected, but the constructor accepts an identity origin. Say “non-zero origin” to match the tested constraint.
There was a problem hiding this comment.
Done in 72c0cc0: the docstring now says a non-zero origin.
[Medium impact] The PR appears safe to merge; no blocking issues were found. Summary
No actionable new issues were found. Tests were inspected but not run during this review. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Controller configuration] --> B{URDF supplied?}
B -->|Yes| C[Resolve URDF and mesh paths]
B -->|No| D[Export USD to URDF]
C --> E[Build Pinocchio robot]
D --> E
E --> F{Floating root?}
F -->|Yes| G[Check origin and lock root]
F -->|No| H[Check joint sizes]
G --> H
H --> I[Build controlled model]
Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." · Reviewed by Greptile |
|
@greptileai review |
|
Backported to |
… assets (#9310) ## Summary - `PinkIKController` loads robots whose `mesh_path` is a local mesh directory (`FileNotFoundError` since #8011). - It loads floating-base robots, from `usd_path` or an exported floating-root URDF (`ValueError: 'floating_base' is not in list`). # Description | # | Cause | Fix | |---|---|---| | 1 | `retrieve_file_path` raises for a local directory | Pass a local directory to Pinocchio as is; other values unchanged | | 2 | The URDF exporter's `floating_base` root joint has no articulation joint | Lock it at its neutral pose (`buildReducedRobot`): the fixed-base model, matching the base-frame IK targets | - Rejected at construction: a floating root joint with a non-zero origin, and any other joint with `nq`/`nv` ≠ 1 (a continuous joint, which on `main` failed at the first `compute()`). - Xu Li's patch on the bug takes the same approach. Fixes NVBug 7003829 Suggested reviewers: ooctipus, StafaH ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `main` ## Test plan | Check | Setup | Result | |---|---|---| | 4 new tests (mesh directory, floating root = fixed base, root origin, continuous joint) + Pink component, null-space and local-frame tests | kitless, desk CPU | 48 passed; each new test fails on `main` | | New `test_pink_ik_controller_loads_floating_base_usd` (real URDF exporter) | Kit, `isaac-lab:latest-main`, desk | pass; fails on `main` | | `test_pink_ik.py` (GR1T2, G1 environments) | Kit, desk | 19 passed, 1 skipped | | Reported setup: floating-base G1-Inspire via `usd_path`, through the action manager | Kit, desk | `main` fails as reported; this branch builds and steps | | No regression vs `main`: fixed-root GR1T2 URDF at 20 random configurations; joints of every Pink task URDF | kitless, desk CPU | poses, Jacobians, IK velocities identical; no joint with `nq`/`nv` ≠ 1 | ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `uv run isaaclab --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have validated the changed behavior with focused coverage and applied the [test-audit criteria](https://github.com/isaac-sim/IsaacLab/blob/HEAD/skills/developer/test-audit/SKILL.md) to any test changes - [x] 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) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there (cherry picked from commit c92b94c)
Summary
PinkIKControllerloads robots whosemesh_pathis a local mesh directory (FileNotFoundErrorsince [Core] Resolve nested local and remote USD dependencies #8011).usd_pathor an exported floating-root URDF (ValueError: 'floating_base' is not in list).Description
retrieve_file_pathraises for a local directoryfloating_baseroot joint has no articulation jointbuildReducedRobot): the fixed-base model, matching the base-frame IK targetsnq/nv≠ 1 (a continuous joint, which onmainfailed at the firstcompute()).Fixes NVBug 7003829
Suggested reviewers: ooctipus, StafaH
Type of change
Release backport
mainTest plan
maintest_pink_ik_controller_loads_floating_base_usd(real URDF exporter)isaac-lab:latest-main, deskmaintest_pink_ik.py(GR1T2, G1 environments)usd_path, through the action managermainfails as reported; this branch builds and stepsmain: fixed-root GR1T2 URDF at 20 random configurations; joints of every Pink task URDFnq/nv≠ 1Checklist
pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists there