Skip to content

(feat): dVRK PSM retargeters#769

Open
chrisvoncsefalvay wants to merge 4 commits into
NVIDIA:mainfrom
chrisvoncsefalvay:feat/dvrk-psm-retargeters
Open

(feat): dVRK PSM retargeters#769
chrisvoncsefalvay wants to merge 4 commits into
NVIDIA:mainfrom
chrisvoncsefalvay:feat/dvrk-psm-retargeters

Conversation

@chrisvoncsefalvay

@chrisvoncsefalvay chrisvoncsefalvay commented Jul 13, 2026

Copy link
Copy Markdown

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

  • DVRKPSMClutchRetargeter emits a float32 ee_pose in [x, y, z, qx, qy, qz, qw] order.
    • Requires an explicit home transform.
    • Supports either controller hand, translation scaling, workspace bounds, orientation calibration, and a configurable clutch threshold.
    • Captures the controller origin on engagement, applies absolute translation and conjugated relative rotation, and re-clutches without a target jump.
  • DVRKPSMGripperRetargeter emits float32 jaw_targets for the two native PSM jaw joints.
    • Supports configurable open and closed endpoints, initial closedness, clutch threshold, trigger deadband, and opening-intent dwell.
    • Closing responds immediately; opening requires deliberate trigger release observed for the configured graph-time duration.
  • NumPy-only Cartesian-clutch and jaw-intent state machines keep the control semantics reusable without importing a simulator runtime.
  • The four public config and retargeter classes are lazy-exported from isaacteleop.retargeters and included in Python package staging.
  • The retargeting reference now includes a dVRK overview, controller and frame contracts, configuration guidance, and a runnable right-controller pipeline with explicit source connections.

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

  • 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

  • Release CMake configure and build: passed.
  • Full CTest suite: 145/145 passed.
  • Focused simulator-independent dVRK suite: 58/58 passed.
  • Mypy: 42 source files clean, including the new dVRK modules in the repository CTest target.
  • Sphinx documentation build with warnings treated as errors: passed.
  • Runnable documentation pipeline construction: passed.
  • Ruff lint and format checks: passed.
  • SKIP=check-copyright-year rtk uvx pre-commit run --all-files: passed.
  • REUSE/SPDX and 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

  • 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

Summary by CodeRabbit

  • New Features

    • Added dVRK Patient Side Manipulator retargeters for clutch-controlled end-effector pose and trigger-controlled paired-jaw targets.
    • Added configurable workspace limits, clutch thresholds, jaw endpoints, initial jaw positions, and orientation offsets.
    • Added robust handling for tracking loss, invalid input, clutch transitions, and reset behavior.
    • Exposed the new retargeters through the public package interface.
  • Documentation

    • Added setup guidance, input/output contracts, frame conventions, usage examples, and test instructions for dVRK retargeting.
  • Tests

    • Added comprehensive coverage for pose, jaw, clutch, reset, validation, timing, and invalid-input behavior.

Signed-off-by: Chris von Csefalvay <chris@chrisvoncsefalvay.com>
Signed-off-by: Chris von Csefalvay <chris@chrisvoncsefalvay.com>
Copilot AI review requested due to automatic review settings July 13, 2026 18:56
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 01ca913e-0e89-4ba8-ba53-c57d82dae5d2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds 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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding dVRK PSM retargeters.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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-769/

Copilot AI 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.

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 (7D ee_pose) and DVRKPSMGripperRetargeter (2D jaw_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.

Comment thread src/retargeters/DVRK/psm_retargeter.py Outdated
Comment thread src/retargeters/DVRK/control.py Outdated
Comment thread src/retargeters/DVRK/__init__.py Outdated
Comment thread src/core/retargeting_engine_tests/python/test_dvrk_psm_retargeters.py Outdated
Comment thread docs/source/references/retargeting/dvrk.rst Outdated
Signed-off-by: Chris von Csefalvay <chris@chrisvoncsefalvay.com>
@chrisvoncsefalvay

Copy link
Copy Markdown
Author

@jiwenc-nv &al. - this is very closely linked with a PR in Isaac Lab that's contingent on it: #6527, and might make sense to be reviewed together. The latter is still in draft, so when this is merged, I can undraft it.

@jiwenc-nv

Copy link
Copy Markdown
Collaborator

Hey Chris, thanks for contributing. Will take a look soon. Wondering whether you have more context on the overall effort? Looks interesting, but wanna to know how we can better support your work.

@chrisvoncsefalvay

Copy link
Copy Markdown
Author

Hi @jiwenc-nv, very fair point, and my apologies for not getting this in sooner.

The dVRK (da Vinci Research Kit) is the closest that surgical robotics has to a SO-ARM 101. It is a research tool made available by Intuitive Surgical (ISRG), who make the da Vinci surgical robots. These consist of four arms, of which typically one holds an endoscopic camera (the ECM) and up to three hold what are known as patient-side modules (PSMs), which are the tool arms. They come loaded with instruments such as needle drivers, forceps &c. Unfortunately, you can't just go out and buy a dVRK - there are around 35 or so of them around in the whole world, all of them at universities, and the requirements to get one are fairly stringent. This makes developing policies and testing them on surgical tasks rather difficult.

At the same time, exactly because of the academic abundance (relative to all other surgical robots) of the dVRK, as well as the fact that it's effectively open-source and is arguably the closest thing we have to a broadly adopted, purpose-built research embodiment, and because it has an explicit non-clinical research boundary, it is very widely used. Open-H-Embodiment, an NVIDIA-sponsored initiative to collect surgical robotic training data, uses it extensively (around 1/7th of the data comes from dVRK or da Vinci units, which are kinematically identical - the CMR Versius is more abundant but less open), and most of the basic robotic surgical routine primitives (needle passing being one example) are implemented.

It is thus an optimal embodiment to offer an entry into surgical robotic teleoperation. Not only is this a way for users without access to a dVRK to collect high quality teleop data, it is also representative of a class of retargeters that is not present here (there are some kinematic quirks to how laparoscopic surgical robots work that are not replicated by the conventional structures) and since it's almost always (at least) bimanual, it's a good veer into that realm as well.

I have previously explored dVRK + Isaac in LeOnardo⁠, an Isaac Sim extension for bimanual PSM teleoperation using two SO-ARM 101 leader arms. That was useful proof that the combination works, but it also reinforced that there is little value in maintaining a separate bespoke stack when IsaacTeleop, Isaac Lab, OpenXR/CloudXR and Isaac Sim already form such a strong ecosystem. I would much rather put the reusable control seam upstream here and keep task-specific IK, articulation, contacts, limits and emergency-stop behaviour downstream.

An example of an immediate downstream use case is now IsaacLab #6570⁠, which supersedes the earlier #6527. It adds a contact- and load-qualified bimanual needle pass—one of the foundational subtasks within suturing—with paired-controller XR teleoperation. The same primitive already supports SurgiSabre⁠, essentially Beat Saber for surgical robots: a deliberately playful, low-stakes familiarisation environment for clutching, remote-centre motion and workspace limits. Longer term, I would love to see this shared dVRK teleoperation layer become part of the backbone of CERTIS⁠, an Isaac-native collection of composable surgical tasks for teleoperation, demonstration collection, training and reproducible evaluation, and also be a starting point for others developing in surgical robotics.

I have deliberately kept #769 small and simulator-independent: controller input in, bounded PSM pose and jaw targets out. I would be grateful for any guidance and support on making sure that my way of making this work aligns with what your longer term architectural ideas are for IsaacTeleop - after all, I'm the guest here, I have tried to align as well as I could with the preexisting codebase but happy to accommodate any changes.

@jiwenc-nv

Copy link
Copy Markdown
Collaborator

Hi @jiwenc-nv, very fair point, and my apologies for not getting this in sooner.

The dVRK (da Vinci Research Kit) is the closest that surgical robotics has to a SO-ARM 101. It is a research tool made available by Intuitive Surgical (ISRG), who make the da Vinci surgical robots. These consist of four arms, of which typically one holds an endoscopic camera (the ECM) and up to three hold what are known as patient-side modules (PSMs), which are the tool arms. They come loaded with instruments such as needle drivers, forceps &c. Unfortunately, you can't just go out and buy a dVRK - there are around 35 or so of them around in the whole world, all of them at universities, and the requirements to get one are fairly stringent. This makes developing policies and testing them on surgical tasks rather difficult.

Very thoughtful and nice writeup! Thanks for posting. I will encourage you to include a version of that explanation into: docs/source/references/retargeting/dvrk.rst as well.

Also on dvrk.rst, I'd recommend you include a gif (no larger than 5MB please to show case the teleoperation you have).

We are also brining in SO-101 leader arm within Isaac Teleop as well. (also more leader arm to come), would love you to also think about how those hardware can be useful for you as well.

@rwiltz can you take a pass on the PR as well? as you are the expert for our retargeting pipeline.

@jiwenc-nv
jiwenc-nv requested a review from rwiltz July 17, 2026 22:12
Brief context of embodiment, ECM/PSM roles and simulation, add GIF of bimanual needle passing teleop run sub 5 megs.

Signed-off-by: Chris von Csefalvay <chris@chrisvoncsefalvay.com>
@chrisvoncsefalvay

Copy link
Copy Markdown
Author

@jiwenc-nv added, thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants