Skip to content

refactor(so101)!: consolidate the clutch retargeter onto engage-relative full pose - #822

Open
jiwenc-nv wants to merge 2 commits into
NVIDIA:mainfrom
jiwenc-nv:jiwenc/clutch-v2
Open

refactor(so101)!: consolidate the clutch retargeter onto engage-relative full pose#822
jiwenc-nv wants to merge 2 commits into
NVIDIA:mainfrom
jiwenc-nv:jiwenc/clutch-v2

Conversation

@jiwenc-nv

@jiwenc-nv jiwenc-nv commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Description

Consolidates the SO-101 clutch retargeter so the Isaac Lab and LeRobot paths share one
implementation, and adds the motion scale requested in #733.

V1 clutched position only with a fixed orientation_offset; the LeRobot XR path had
meanwhile grown a full-pose, squeeze-gated clutch that re-centers on every engage — the
behaviour this repository's own docs already promise. Both are now one
SO101ClutchRetargeter:

pos = home_pos + position_scale * (grip_pos - origin_pos)
rot = (R_ctrl · R_origin⁻¹) · R_home

On the engage frame this is exactly the home pose whatever the scale — no teleport.
position_scale (default 1.0) maps an operator's ~0.7 m arm travel into the SO-101's
~0.35 m reach; at 1:1, re-engage cycles ratchet the target out of the workspace.

Fixes #733

Breaking changes

  • home_base_T_ee — required 2nd positional, both blocks used (was optional, translation only)
  • input_device, position_scale, squeeze_threshold — keyword-only
  • engaging now needs squeeze > squeeze_threshold as well as RUNNING
  • orientation_offset, debug_log_engage — removed; put the gripper's base-frame orientation in home_base_T_ee

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Testing

82 unit tests pass; verified against the reference implementation (position bit-exact,
orientation 1.116e-15). Hardware validation on a physical SO-101 is still pending.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the linter and formatter with SKIP=check-copyright-year pre-commit run --all-files
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix/feature works (or explained why not)
  • I have signed off all my commits (git commit -s) per the DCO

@github-actions

Copy link
Copy Markdown
Contributor

📝 Docs preview is not auto-deployed for fork PRs.

A maintainer with write access to NVIDIA/IsaacTeleop can deploy a preview by
commenting /preview-docs on this PR. Once deployed, the preview
will live at:

https://nvidia.github.io/IsaacTeleop/preview/pr-822/

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds scikit-build-core source and editable-install packaging, Python-version CMake presets, SKBUILD-specific wheel and executable installation, and CI smoke-test coverage. It also introduces SO101EngageRelativeClutchRetargeter with full-pose latching, quaternion handling, validation, reset behavior, measured-home support, and public package exports. SO101ClutchRetargeter gains configurable translation scaling, with extensive tests and updated build and retargeting documentation.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant uv
  participant scikit_build_core
  participant CMake
  participant isaacteleop_wheel
  uv->>scikit_build_core: start editable source installation
  scikit_build_core->>CMake: configure and build with SKBUILD
  CMake->>isaacteleop_wheel: install staged package and executables
  isaacteleop_wheel-->>uv: expose installed isaacteleop package
Loading
sequenceDiagram
  participant ControllerInput
  participant SO101EngageRelativeClutchRetargeter
  participant MeasuredBaseTEE
  participant RetargetingEngine
  ControllerInput->>SO101EngageRelativeClutchRetargeter: provide grip pose and squeeze state
  MeasuredBaseTEE->>SO101EngageRelativeClutchRetargeter: provide optional measured transform
  SO101EngageRelativeClutchRetargeter->>RetargetingEngine: emit 7D ee_pose
  RetargetingEngine-->>SO101EngageRelativeClutchRetargeter: provide reset or execution state
Loading

Possibly related PRs

  • NVIDIA/IsaacTeleop#820: Overlaps with the scikit-build-core backend, CMake integration, and editable-install CI workflow.
  • NVIDIA/IsaacTeleop#821: Overlaps with position_scale support and its SO-101 clutch retargeter tests.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is specific and matches the main SO-101 retargeter change toward an engage-relative full-pose clutch flow.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/source/getting_started/build_from_source/index.rst`:
- Around line 110-119: Update the documented CMake prerequisite to require
version 3.21 or newer, matching the schema and cmakeMinimumRequired values used
by CMakePresets.json and the documented preset workflow.

In `@src/retargeters/SO101/engage_relative_clutch_retargeter.py`:
- Around line 394-397: Update the measured pose handling near
MEASURED_BASE_T_EE_INPUT to validate base_T_ee[:3, 3] with a finiteness check
before copying it into _home_pos. Treat None or non-finite translation as
invalid and preserve the existing warn-once fallback behavior, ensuring invalid
measurements cannot propagate into commanded or latched pose state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 30370915-01de-4240-baed-9072b73658ba

📥 Commits

Reviewing files that changed from the base of the PR and between fa10f04 and c36724e.

📒 Files selected for processing (16)
  • .github/workflows/build-ubuntu.yml
  • CMakeLists.txt
  • CMakePresets.json
  • CMakePresets.json.license
  • cmake/SetupPython.cmake
  • docs/source/getting_started/build_from_source/index.rst
  • docs/source/references/build.rst
  • docs/source/references/retargeting/index.rst
  • docs/source/references/retargeting/so101.rst
  • pyproject.toml
  • src/core/python/CMakeLists.txt
  • src/core/retargeting_engine_tests/python/test_retargeter_reset.py
  • src/core/retargeting_engine_tests/python/test_so101_retargeters.py
  • src/retargeters/SO101/clutch_retargeter.py
  • src/retargeters/SO101/engage_relative_clutch_retargeter.py
  • src/retargeters/__init__.py

Comment thread docs/source/getting_started/build_from_source/index.rst
Comment thread src/retargeters/SO101/engage_relative_clutch_retargeter.py Outdated
@jiwenc-nv
jiwenc-nv force-pushed the jiwenc/clutch-v2 branch 2 times, most recently from 4c038a7 to b527706 Compare July 28, 2026 06:04
@jiwenc-nv jiwenc-nv changed the title Jiwenc/clutch v2 refactor(so101)!: consolidate the clutch retargeter onto engage-relative full pose Jul 28, 2026
An operator's comfortable arm travel (~0.7 m) is roughly twice the SO-101's
reach (~0.35 m), so integrating controller deltas 1:1 ratchets the commanded EE
target out of the workspace across clutch cycles.

Add a validated position_scale constructor parameter (default 1.0, position
only) that scales the clutch delta. Non-positive and non-finite values are
rejected: zero freezes the EE, negative inverts the mapping, and inf * 0 = nan
would reach the SE3 IK.

Adds tests for the scaled compute path, validation, and the ratchet property.

Refs NVIDIA#733

Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
…ive full pose

V1 clutched position only and composed a fixed orientation_offset. The LeRobot
XR path had grown a full-pose, squeeze-gated clutch that re-centers on every
engage -- the behaviour these docs already promise. Fold both into one
retargeter:

    pos = home_pos + position_scale * (grip_pos - origin_pos)
    rot = (R_ctrl . R_origin^-1) . R_home

On the engage frame this is exactly the home pose, so there is no teleport.

BREAKING CHANGE: home_base_T_ee is now required positionally and both of its
blocks are used; engagement also requires squeeze > squeeze_threshold;
orientation_offset and debug_log_engage are gone -- put the gripper's base-frame
orientation into home_base_T_ee instead.

Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
@jiwenc-nv
jiwenc-nv requested a review from rwiltz July 29, 2026 06:47
@jiwenc-nv

Copy link
Copy Markdown
Collaborator Author

/preview-docs

@github-actions

Copy link
Copy Markdown
Contributor

✅ Preview deployed: https://NVIDIA.github.io/IsaacTeleop/preview/pr-822/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose clutch position scale as a constructor parameter (operator arm travel vs robot reach mismatch)

1 participant