(feat): dVRK PSM retargeters#769
Conversation
Signed-off-by: Chris von Csefalvay <chris@chrisvoncsefalvay.com>
Signed-off-by: Chris von Csefalvay <chris@chrisvoncsefalvay.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds dVRK PSM clutch and gripper retargeters with NumPy state machines for absolute tool poses and paired jaw targets. The change exposes public configurations and retargeter classes, integrates the package into builds, adds extensive simulator-free tests, and documents behavior, reference frames, Python wiring, and validation commands. Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant ControllersSource
participant DVRKPSMClutchRetargeter
participant DVRKPSMGripperRetargeter
participant OutputCombiner
participant SimulatorIK
ControllersSource->>DVRKPSMClutchRetargeter: grip pose and squeeze
ControllersSource->>DVRKPSMGripperRetargeter: trigger and squeeze
DVRKPSMClutchRetargeter-->>OutputCombiner: ee_pose
DVRKPSMGripperRetargeter-->>OutputCombiner: jaw_targets
OutputCombiner->>SimulatorIK: combined pose and jaw targets
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
📝 Docs preview is not auto-deployed for fork PRs. A maintainer with write access to |
There was a problem hiding this comment.
Pull request overview
Adds simulator-independent XR retargeters for the dVRK Patient Side Manipulator (PSM), providing a clean boundary that outputs a bounded absolute tool pose plus paired jaw targets for downstream IK / articulation control.
Changes:
- Introduces
DVRKPSMClutchRetargeter(7Dee_pose) andDVRKPSMGripperRetargeter(2Djaw_targets) with NumPy-only control kernels. - Wires the new dVRK retargeters into the Python package surface and build/test tooling (mypy path, package staging).
- Adds extensive simulator-free unit tests and new retargeter documentation/reference material.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/retargeters/DVRK/psm_retargeter.py | New engine-facing retargeter wrappers for pose clutch and jaw targets. |
| src/retargeters/DVRK/control.py | New NumPy-only clutch + jaw-intent state machines and math helpers. |
| src/retargeters/DVRK/init.py | Lazy-export surface for the DVRK retargeter subpackage. |
| src/retargeters/CMakeLists.txt | Ensures DVRK __pycache__ is removed during Python package staging. |
| src/retargeters/init.py | Exposes new dVRK retargeters/configs from isaacteleop.retargeters. |
| src/core/retargeting_engine_tests/python/test_dvrk_psm_retargeters.py | New simulator-free test suite for dVRK PSM retargeters and kernels. |
| src/core/retargeting_engine_tests/python/CMakeLists.txt | Adds mypy coverage for the new src/retargeters/DVRK modules. |
| src/core/python/pyproject.toml.in | Includes isaacteleop.retargeters.DVRK in the packaged modules list. |
| docs/source/references/retargeting/index.rst | Adds dVRK entry to the retargeter reference index. |
| docs/source/references/retargeting/dvrk.rst | New documentation page describing dVRK PSM retargeter usage and contracts. |
Signed-off-by: Chris von Csefalvay <chris@chrisvoncsefalvay.com>
Description
Adds reusable XR retargeters for da Vinci Research Kit (dVRK) Patient Side Manipulators (PSMs).
The retargeters provide a simulator-independent boundary between an XR controller and a PSM integration: they emit a bounded absolute tool-tip pose and paired jaw-joint targets, while robot-specific differential IK, articulation control, collision handling, and emergency-stop behaviour remain with the downstream consumer.
What is included
DVRKPSMClutchRetargeteremits a float32ee_posein[x, y, z, qx, qy, qz, qw]order.DVRKPSMGripperRetargeteremits float32jaw_targetsfor the two native PSM jaw joints.isaacteleop.retargetersand included in Python package staging.Control and safety semantics
The squeeze input (deadman) gates target updates. Releasing it holds the last commanded target and re-arms controller-origin capture; it does not disable downstream actuation or latch the measured articulation state. Command disable, measured-state hold, joint and collision limits and emergency-stop behaviour remain the responsibility of the simulator or robot integration.
The output is designed to be fail-safe, i.e. tracking loss, inactive sessions, missing controller data, malformed poses, degenerate quaternions and non-finite samples hold the last safe output and require a fresh engagement. Configuration values that will be narrowed to float32 are validated against the finite float32 range.
The jaw retargeter preserves the last jaw target across clutch release and tracking transitions. Its opening dwell uses observed graph time rather than frame count, including protection against repeated or regressed timestamps.
Type of change
Testing
SKIP=check-copyright-year rtk uvx pre-commit run --all-files: passed.git diff --check: passed.Coverage includes clutch state transitions, workspace clipping, no-jump re-engagement, an independent non-commuting orientation-conjugation oracle, paired jaw interpolation, deliberate opening dwell, graph-time regressions, malformed and non-finite samples, float32-range configuration rejection and, hopefully, public wrapper/kernel parity.
Scope
This PR contains the reusable dVRK retargeters, public API and configuration, focused tests, packaging, and retargeter documentation only. For the sake of separation of concerns, the Isaac Sim/Lab example, diff IK and articulation validation will be in the downstream dual PSM integration.
Checklist
SKIP=check-copyright-year pre-commit run --all-filesgit commit -s) per the DCOSummary by CodeRabbit
New Features
Documentation
Tests