Skip to content

[Fix] Let Pink IK load robots from mesh directories and floating-base assets - #9310

Merged
kellyguo11 merged 20 commits into
isaac-sim:mainfrom
hujc7:jichuanh/pink-ik-mesh-floating-base
Dec 3, 2026
Merged

kellyguo11 merged 20 commits into
isaac-sim:mainfrom
hujc7:jichuanh/pink-ik-mesh-floating-base

Conversation

@hujc7

@hujc7 hujc7 commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

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

  • 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

  • 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 to any test changes
  • 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)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Nov 30, 2026
@hujc7

hujc7 commented Nov 30, 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 Nov 30, 2026
@hujc7
hujc7 marked this pull request as ready for review November 30, 2026 21:40
@hujc7
hujc7 requested a review from a team November 30, 2026 21:40

@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 (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])

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 — 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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 — 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

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 — 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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 — 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."""

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 — 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 72c0cc0: the docstring now says a non-zero origin.

@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no blocking issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

PinkIKController now accepts local mesh directories and loads supported floating-base models.

  • Pink IK can load meshes from a local directory.
  • Pink IK treats an identity-origin floating root as fixed at the origin.
  • Pink IK rejects joints that need more than one position or velocity value.

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]
Loading

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." · Reviewed by Greptile

@hujc7

hujc7 commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@kellyguo11
kellyguo11 merged commit c92b94c into isaac-sim:main Dec 3, 2026
66 of 67 checks passed
@isaaclab-bot

isaaclab-bot Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.1.0 as 2515ebf.

isaaclab-bot Bot pushed a commit that referenced this pull request Dec 3, 2026
… 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants