Expose SO-101 clutch position scale as a constructor parameter#821
Expose SO-101 clutch position scale as a constructor parameter#821jiwenc-nv wants to merge 1 commit into
Conversation
The SO101ClutchRetargeter integrated controller position deltas 1:1 (the module constant _CLUTCH_POSITION_SCALE = 1.0). Because an operator's comfortable arm travel (~0.7 m) is roughly twice the SO-101's reach (~0.35 m), 1:1 motion plus clutch release/re-engage cycles ratchet the commanded end-effector target out of the reachable workspace. Add a validated position_scale constructor parameter (default 1.0, position-only, must be positive and finite) that scales the clutch delta so a full operator sweep can be mapped inside the arm's reach. Orientation is untouched. The default preserves current behavior; the corrective value is set by the caller. Validation rejects non-positive and non-finite scales (a zero scale freezes the EE, a negative one inverts the mapping, and the finite check closes the inf*0 = nan path before it reaches the SE3 IK). Adds unit tests for the scaled compute path, constructor validation, and the motivating N-cycle ratchet property. Signed-off-by: Jiwen Cai <jiwenc@nvidia.com>
|
📝 Docs preview is not auto-deployed for fork PRs. A maintainer with write access to |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
SO101ClutchRetargeterintegrated controller position deltas 1:1 (the moduleconstant
_CLUTCH_POSITION_SCALE = 1.0). Because an operator's comfortable armtravel (~0.7 m) is roughly twice the SO-101's reach (~0.35 m), 1:1 motion plus
clutch release/re-engage cycles ratchet the commanded end-effector target out of
the reachable workspace.
This exposes the clutch position scale as a validated constructor parameter so a
full operator sweep can be mapped inside the arm's reach.
Changes
position_scale: floattoSO101ClutchRetargeter.__init__(slotted afterhome_base_T_ee, beforeorientation_offset), defaulting to_CLUTCH_POSITION_SCALE(1.0). It scales the clutch position delta only —orientation is always tracked 1:1.
float, then reject non-positive andnon-finite values with
ValueError. A zero scale freezes the EE, a negativeone inverts the hand→EE mapping, and the finite check closes the
inf * 0 = nanpath before it can reach the SE3 IK. No upper clamp.
self._position_scale; the 7Dee_poseoutputcontract and the no-teleport-on-engage invariant are unchanged (the latter holds
at any finite scale).
Testing
Adds sim-free unit tests to
test_so101_retargeters.py:test_position_scale_scales_delta— scaled compute path, incl. no-teleport on engage.test_invalid_position_scale_rejected— parametrized over0.0, -1.0, nan, inf.test_reengage_ratchets_scaled_delta_per_cycle— the motivating N-cycle ratchetproperty (
home + N·scale·δ, vshome + N·δat unit scale).All 32 tests in the module pass; the new cases were confirmed to fail against the
unmodified retargeter.
ruff format/checkclean.Scope / follow-up
The default
1.0preserves current behavior — this PR enables the fix withoutchanging runtime behavior on its own. Landing the operator-facing correction
requires the SO-101 task config to pass a sub-unity
position_scale(that wiringlives outside this repo and is a separate follow-up).
Runtime motion-scale control (HUD v2) is intentionally out of scope; this is a
construction-time parameter.
Part of #733.
Summary by CodeRabbit
New Features
Tests