Skip to content

Adds DisplayPort cable insertion envs - #6398

Closed
shauryadNv wants to merge 75 commits into
isaac-sim:mainfrom
shauryadNv:shauryad/dp_cable_ship
Closed

shauryadNv wants to merge 75 commits into
isaac-sim:mainfrom
shauryadNv:shauryad/dp_cable_ship

Conversation

@shauryadNv

@shauryadNv shauryadNv commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR adds DisplayPort cable insertion training and ROS-inference environments for the Flexiv Rizon4s with Grav gripper.

The environment is added under isaaclab_tasks.contrib.deploy.cable_insertion and includes:

  • DisplayPort plug/socket assets
  • Flexiv Rizon4s + Grav gripper joint-space training environment
  • Flexiv Rizon4s + Grav gripper task-space training environment
  • ROS-inference environment (both joint and task space)
  • no-joint-velocity policy variant (joint-space)
  • play variants for visualization/debugging
  • DisplayPort insertion rewards, termination terms, reset/curriculum events, and success metrics
  • policy deployment documentation for training and inference
  • LEAPP-exportable action terms
  • LEAPP export support for task-space policies

The main trainable task variants are:

  • Isaac-Deploy-DisplayportInsertion-Rizon4s-Grav-v0
  • Isaac-Deploy-DisplayportInsertion-Rizon4s-Grav-NoJointVel-v0
  • Isaac-Deploy-DisplayportInsertion-Rizon4s-Grav-TaskSpace-v0

The main ROS-inference task variants are:

  • Isaac-Deploy-DisplayportInsertion-Rizon4s-Grav-ROS-Inference-v0
  • Isaac-Deploy-DisplayportInsertion-Rizon4s-Grav-NoJointVel-ROS-Inference-v0
  • Isaac-Deploy-DisplayportInsertion-Rizon4s-Grav-TaskSpace-ROS-Inference-v0

The DisplayPort environment uses:

  • physics frequency: 240 Hz
  • decimation: 8
  • effective control frequency: 30 Hz
  • action scale 0.025 -- relative joint-position (rad) in joint-space; Cartesian pose-delta (0.025 m / 0.025 rad) in task-space
  • plug/socket mate-point success threshold: 3 mm

The environments also log insertion metrics:

  • Metrics/success_rate
  • Metrics/plug_socket_pos_error_m
  • Metrics/plug_socket_keypoint_dist_m
  • Metrics/terminal_success_rate

No new external dependencies are required.

Fixes # N/A

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Screenshots

N/A

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@shauryadNv shauryadNv self-assigned this Jul 7, 2026
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Jul 7, 2026
@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds DisplayPort cable insertion environments and tooling. The main changes are:

  • New DisplayPort plug/socket assets and diagnostic scripts.
  • New basic, joint-space, task-space, and ROS inference environment configs.
  • New reset, grasp, observation, reward, termination, action-delay, and success-logging helpers.
  • Gym registrations for the new DisplayPort task variants.

Confidence Score: 4/5

The task-space training path needs a config fix before merging.

  • The new environments are mostly additive and the main import and reset wiring is consistent.
  • The task-space reset curriculum is disabled by its own default values.
  • That can make task-space training run without the seeded insertion starts described by the config.

source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/cable_insertion/config/displayport_rizon_4s/task_space_env_cfg.py

Important Files Changed

Filename Overview
source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/cable_insertion/config/displayport_rizon_4s/task_space_env_cfg.py Defines the task-space DisplayPort insertion environment; the at-goal curriculum is configured but disabled.
source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/cable_insertion/config/displayport_rizon_4s/joint_pos_env_cfg.py Defines the joint-position DisplayPort insertion environment and wires robot, reset, action, and termination settings.
source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/mdp/events.py Adds generic object grasp reset logic and plug-at-goal curriculum reset logic.
source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/mdp/terminations.py Adds plug drop and plug orientation termination terms for the insertion environments.
source/isaaclab_tasks/isaaclab_tasks/contrib/deploy/cable_insertion/insertion_env.py Adds success metric logging for DisplayPort insertion rollouts.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[DisplayPort Gym task id] --> B[DisplayportInsertionEnv]
  B --> C[Environment config]
  C --> D[Reset events]
  D --> E[reset_scene_to_default]
  E --> F[randomize_socket_pose]
  F --> G[reset_plug_at_goal_curriculum]
  G --> H[set_robot_to_object_grasp_pose]
  C --> I[Policy observations and actions]
  C --> J[Rewards and terminations]
  B --> K[Success metric logging]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
  A[DisplayPort Gym task id] --> B[DisplayportInsertionEnv]
  B --> C[Environment config]
  C --> D[Reset events]
  D --> E[reset_scene_to_default]
  E --> F[randomize_socket_pose]
  F --> G[reset_plug_at_goal_curriculum]
  G --> H[set_robot_to_object_grasp_pose]
  C --> I[Policy observations and actions]
  C --> J[Rewards and terminations]
  B --> K[Success metric logging]
Loading

Reviews (1): Last reviewed commit: "Relocate DisplayPort cable_insertion und..." | Re-trigger Greptile

Comment on lines +258 to +259
"at_goal_prob": 0.0,
"at_goal_prob_final": 0.0,

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.

P1 At-Goal Curriculum Disabled

The task-space config documents and wires an at-goal curriculum, but both probabilities are 0.0. reset_plug_at_goal_curriculum only enters the at-goal branch when the current probability is positive, so every reset uses the normal approach-pose randomization and the task-space policy never receives the seeded insertion starts this config describes.

Suggested change
"at_goal_prob": 0.0,
"at_goal_prob_final": 0.0,
"at_goal_prob": 0.8,
"at_goal_prob_final": 0.0,

@shauryadNv
shauryadNv requested a review from ashwinvkNV July 7, 2026 20:59
@shauryadNv
shauryadNv force-pushed the shauryad/dp_cable_ship branch from 7ccabce to 2765083 Compare July 7, 2026 21:16
@shauryadNv
shauryadNv requested a review from a team July 17, 2026 23:38
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 17, 2026
DISPLAY_ASSETS_DIR = os.path.join(CABLE_INSERTION_DIR, "display_cable_insertion_assets")


def _quat_rotate_vec(q_xyzw, v):

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.

can use utils from math.py or some other library thats used in isaaclab already? I don't think we should have the quat utils here in-line.

@frlai frlai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hey @ashwinvkNV @shauryadNv ,

It would be best to not modify export.py. This file is considered generic user facing entry point similar to the original train.py and play.py. If you need to make modifications to the to enable cable insertion, it would be best if you can create your own export.py under cable_insertion to maintain consistency. you can most likely reuse the entire main function and just inject your own configuration functions.

for the terms needed to generate semantics on processed output, I like that you embedded it with the action term but ideally you don't inject that directly into main library code as well. I think you should be able to patch these for your needs if you write your own export.

" with output_tensors.",
term_name,
)
element_names = getattr(term, "_leapp_processed_action_element_names", None)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I understand why you need to do this. But is there any way to add this without modifying library code?

)
element_names = getattr(term, "_leapp_processed_action_element_names", None)
kind = getattr(term, "_leapp_processed_action_kind", None)
extra = getattr(term, "_leapp_processed_action_extra", None)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

extra should also never be extensively used in library code. It you are free to use it on your own but by injecting data into extra you are creating ad hoc fields that downstream deployment frameworks may not honor. Useful as a one off but not generic enough.

@shauryadNv
shauryadNv force-pushed the shauryad/dp_cable_ship branch from 56112bf to 285d971 Compare August 26, 2026 16:49
@j3soon

j3soon commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Reproduced this branch from a clean clone on latest commit 015b113, using the container workflow on an RTX PRO 6000 Blackwell. Just opened a PR shauryadNv#10 that fixes issues (such as --headless flag deprecation in 3.x) encountered during the reproduction. Feel free to merge directly or cherrypick useful commits.

Three additional suggestions/question:

  • Training appears to take more than 5 days on a single RTX PRO 6000. Providing a pretrained checkpoint would make testing and reviewing this work much easier.
  • I only trained for a few iterations to verify the workflow. Is 5+ GPU-days expected for this policy? Most IsaacLab RL examples seem to train within hours to about a day. It would be helpful to document the iterations needed for a usable policy, e.g. ~50% success, versus full training, e.g. ~95%.
  • (Optional) Since there's no cable simulation in this, maybe rename to DP plug/connector insertion (instead of DP cable insertion) can better reflect the task.
Default View Zoomed In View
02_train_jointspace_iter0.mp4
05_zoom_taskspace_insertion.mp4

(tested on policy trained for only ~25 iterations for validating the inference code path)

Note: I guided Claude to reproduce the walkthrough, draft the fixes and validate them. The remainder is drafted by Claude.


What I found

Every command producing a deployable artifact failed, three of them silently. The
environment itself is untouched here: all nine task ids instantiate, the observation and
action contracts match the tutorial, and a task-space policy trained on this branch inserts
to 1.94 mm in deterministic play.

1. Task-space LEAPP export writes no model, and reports validation as passing. The
recommended deployment path. Exits 0 with a success banner, writing no .onnx and
model_path: null:

[WARNING]: Model DisplayPortTaskSpace does not have a compiled model. Skipping validation.
[INFO]:   Passed: 1/1

Skipped validation still counts as passing, so the tutorial ships a package with no policy
and reports success. export_displayport_insertion.py:320 forwards args_cli.export_method,
default None, so LEAPP compiles nothing. Line 225 already defaults it on the other path.

2. Joint-space LEAPP export aborts on the default backend.

DispatchError: No ONNX function found for <OpOverload(op='aten.masked_select', ...)>

rigid_object_quat_w canonicalises the socket quaternion with boolean-mask assignment;
isaaclab.utils.math.quat_unique does the same as a torch.where. Task space is
unaffected, using the 6D rotation term. Fixing only that, the graph is then rejected:

INVALID_GRAPH: Type 'tensor(int32)' of input parameter (val_204) of operator (GatherND)

JointAction stores find_joints output as warp-backed int32; ONNX GatherND needs
int64. Torch accepts int32 indexing, so it only appears once traced. Any manager-based task
exporting a joint action hits this.

3. DP_ROBOT_USD is documented but never read. Named twice, including in the
important block telling the reader to run flexiv_calibration and select the result with
it. No Python file references it. Fails silently: calibrate, export the variable, train for
days against the shipped Rizon4s-063459, discover it on hardware.

Related: the control spaces start from different robots. Joint space spawns the calibrated
asset, task space never set a usd_path and spawns the stock arm.

4. The training commands do not run, twice over.

train.py: error: unrecognized arguments: --headless

Headless is now the default; --visualizer opts into a GUI. Five occurrences, though Step 1
already uses the current flag. Removing it exposes ModuleNotFoundError for MoviePy, which
the container does not ship and the page never mentions.

5. Smaller gaps. Two of three station-pose definitions are documented, omitting
task_space_ros_inference_env_cfg.py, so the recommended control space is the one never
mentioned. The play examples claim to apply unchanged to task space while passing the
joint-space pose, 10 mm off in Z. And save_interval = 50 puts the first trained checkpoint
at model_50.pt (model_0.pt is untrained), so the export half needs a long run first,
unmentioned.

What this PR changes

Commit Change
187bfd02 Resolve the export backend once, so the task-space path stops forwarding None
e3f59262 Use quat_unique; normalise JointAction indices to int64
4af575ec Add resolve_robot_usd(), use it in both control spaces, document the defaults
6a492f1b Remove --headless, add the MoviePy note and prerequisites
b4bbb751 Document the task-space station pose, correct the play example
f0099780 Note agent.save_interval for reaching the export step sooner
318bb571 Changelog fragments
b7b766f6 Make play_displayport_insertion.py pass the pre-commit hooks
4fd7b33a Regression tests for the robot USD override

Defaults are unchanged. DP_ROBOT_USD passes to the spawner untouched, so a local path,
Nucleus URL or HTTP(S) URL all work, and the spawner still raises on an unreachable one.

b7b766f6 is unrelated, included because the file fails ruff, ruff format and
codespell as it stands, so uv run isaaclab -f errors on a clean checkout. Three needed a
decision, each following existing convention here: contextlib.suppress for SIM105,
# noqa: C901 on main as five other entrypoints do, and renaming the local rin rather
than growing ignore-words-list.

Validation

Isaac Sim 6.0.0, LEAPP 0.6.1, ONNX Runtime 1.29.0. Checkpoints were trained on this branch
and are not converged; they only need to export.

Check Before After
Task-space export, documented command exits 0, no .onnx, validation skipped but passing .onnx written, metadata populated, validation runs
Joint-space export, default backend DispatchError completes, graph loads, passes
Joint-space export, quaternion fix alone n/a INVALID_GRAPH, so both halves are needed
DP_ROBOT_USD local / omniverse:// / HTTP(S) ignored honoured in both spaces
DP_ROBOT_USD unset, empty, whitespace n/a falls back to each default
Documented training command --headless, then MoviePy error runs, records 200 frames
Nine task ids, 200-step play rollout pass unchanged
check-changelog-fragments, play_*.py hooks fail pass

quat_unique is bit-identical to the mask assignment over 2000 random unit quaternions.

The tests are 18 parametrised cases, 1.5 s, no GPU or Kit. They were confirmed to fail
without the fix against two broken states: configs not calling the helper, and the helper
validating via os.path.isfile, which rejects the remote URLs, hence those cases. The
export-backend and ONNX fixes have no collected tests, being observable only by a real
export.


Additional info, kept out of the docs as the figures are machine-specific.

At --num_envs 256 an iteration takes ~315 s, of which 309.2 s is physics collection and
5.7 s the PPO update: ~416 env steps/s, 38 GB VRAM, 92 % utilisation at 110 W of 300 W. The
shipped max_iterations = 1500 is therefore ~5.5 days on one GPU, unstated on a page that
presents single-GPU training as the default. The workload is contact-latency bound, so more
GPUs or cheaper contact settings help where a faster GPU does not.

Not addressed here

The two deployment stations still disagree on position; that is a hardware question, so I
documented it rather than picking one.

curiep and others added 6 commits September 9, 2026 14:58
The Rizon 4s cable-insertion task was failing every episode at reset:
the IK + open-loop close sequence put the gripper next to the plug
instead of around it, the fingers closed on empty space, and the
plug fell to the floor (or twisted away when a finger clipped its
edge).

Root cause was a geometry mismatch between the un-flattened plug USD
and the IK target. The un-flattened plug has its visible/collision
``Mesh`` offset ~3 cm from the rigid-body origin
(``bbox_center_local = (0.0312, 0.0009, -0.0107)`` in body frame).
``set_robot_to_object_grasp_pose`` snapped the plug body to the
gripper-achieved pose, but the achieved pose was a function of the
*body* origin, not the visible centre, so the fingertips landed
~3 cm from the actual plug.

Switch to the flattened plug + socket USDs (``flattened/`` directory)
where ``bbox_center == (0, 0, 0)`` and the visible mesh coincides
with the rigid-body origin. With that, the grasp parameters reduce
to the gripper tool length only:

* ``grasp_offset = (0, 0, -0.13)`` -- only backs ``link7`` off by
  the Grav tool length so the fingertips land at the plug body
  origin (which is now also the visible centre).
* ``grasp_rot_offset = (-0.707, 0.707, 0, 0)`` (unchanged) keeps
  ``link7`` pointing straight down with the gripper finger axis
  perpendicular to the plug's long body Y axis.
* Plug + socket use identity ``init_state.rot``; the flattened USDs
  already align the long axis with body Y.
* Plug spawns 5 cm above the socket so the policy has descent room.
* ``hand_close_width = 0.0`` matches the gear-assembly small-gear
  close target. ``-0.155`` (the joint hard limit) was tried and
  ejected the plug because the drive over-commanded the fingers.

Also extend ``set_robot_to_object_grasp_pose``:

* Snap the held object to the achieved hand pose after IK so any
  IK residual error or geometry offset is washed out before the
  gripper closes.
* One-shot ``[GRASP-DBG]`` log dumps the initial pose, the IK
  target, the achieved hand pose and the snapped object pose --
  invaluable for diagnosing future grasp regressions.
The Flexiv Rizon 4s in the NVIDIA Hubble Lab is wall-mounted with the
arm rotated about the negative X-axis. Update the ROS inference env
config so the simulator's reset state matches the physical robot:

* Set the home joint pose to the lab's joint convention.
* Set the robot base orientation to the wall-mount quaternion so the
  arm hangs the same way in sim and in the real cell.

This keeps the policy roll-out and the live deployment in the same
robot frame, which is required for the policy obs (computed relative
to ``base_link``) to be valid at inference time.
Three small scripts under ``scripts/tools/`` to diagnose and repair
USD assets whose visible/collision geometry is offset from the
rigid-body origin -- the failure mode that broke the Rizon 4s
cable-insertion grasp.

* ``inspect_cable_usd.py``: standalone Pixar-USD walker. Lists xform
  ops, ``RigidBodyAPI`` / ``MassAPI`` / ``CollisionAPI`` markers and
  per-mesh ``bbox_center_local`` / ``bbox_size``. Use this from any
  shell that already has ``pxr`` on PYTHONPATH (e.g. a Kit Python).

* ``inspect_cable_usd_kit.py``: same walker run inside an IsaacLab
  ``AppLauncher`` context so ``pxr`` is available without extra setup.
  This is what we actually used during debugging from the IsaacLab
  conda env.

* ``flatten_cable_usd.py``: bake the chain of intermediate xforms
  down into the leaf mesh's points, then reset all xform ops on the
  rigid-body and its children to identity. The result is a USD whose
  visible mesh is centered at the rigid-body origin -- exactly the
  invariant the IK-based grasp event assumes. Supports an optional
  ``--rotate-z-deg`` knob for assets whose body-local pose needs an
  additional rotation baked in.

Both inspectors print the bounding-box centre in body-local frame so
``grasp_offset`` can be set deterministically from the asset rather
than tuned by trial and error.
shauryadNv and others added 14 commits September 9, 2026 14:58
Activate the measured-kinematics Rizon4s USD (added under display_cable_insertion_assets) as the robot spawn USD in place of the stock Nucleus rizon4s_with_grav.usd, for sim-to-real calibration experiments.
Adds an operational-space-control variant of the DisplayPort cable
insertion task alongside the existing joint-space environments, plus the
export path needed to deploy it through Isaac ROS.

The policy commands a 6-DoF Cartesian pose delta instead of joint
targets. The actor observes the gripper TCP (flange + 192.5 mm) while the
controller acts on the flange, matching the frames the trained
checkpoints use. Arm PD gains are zeroed because OSC commands joint
efforts; an active joint PD would hold its reset target and override
them.

Deploy action wrappers mark their processed actions for export so the
LEAPP graph carries the scaled Cartesian delta with proper semantics
rather than an unlabelled tensor. The annotator honours that metadata and
lets the processed action replace per-asset write outputs.

Export reuses the RSL-RL LEAPP exporter behind --task_space_contract,
which splits the 18-D observation into named pose tensors
(eef_pos, eef_rot_6d, socket_kp_pos, socket_kp_rot_6d) and emits
arm_action. That contract annotates its own graph node, so it bypasses
the automatic env patcher, aligns the recurrent-state node name, and
annotates inputs before the state tensors are registered.

Verified on the ship branch: task registration, training on the
task-space and ROS-inference variants, and an export whose artifacts are
byte-identical to the previous standalone script.
The previous commit inadvertently included in-progress documentation and
export entries for `sysid_cfg.py` and `delayed_joint_actions*.py`, which
are not part of this branch. This left the docs describing files a fresh
clone does not have, and `mdp/__init__.pyi` lazily exporting six symbols
from an absent module (accessing any of them raised ModuleNotFoundError;
no committed code referenced them).

Removes the "Sim-to-Real / SysID Action Model" section, the two Code
Layout entries, and the six `Delayed*`/`FlexivDynamicsAware*` stub
exports. The task-space (OSC) work from the previous commit is unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Review feedback: `scripts/reinforcement_learning/leapp/rsl_rl/export.py` is a
generic, user-facing entry point (like train.py / play.py) and should stay
task-agnostic, and task-specific processed-action semantics should not be
injected into the core library.

Both shared files are restored to upstream verbatim:
  - scripts/reinforcement_learning/leapp/rsl_rl/export.py
  - source/isaaclab/isaaclab/utils/leapp/export_annotator.py

The task-space contract now lives in a DisplayPort-specific exporter,
`export_displayport_insertion.py`, which reuses the generic flow and only
substitutes the export routine: `run_export_with_hydra` resolves
`export_rsl_rl_agent` as a module global, so rebinding it is sufficient.
Argument parsing, checkpoint resolution, Hydra config, runner construction
and graph compilation remain shared with upstream.

The annotator changes were reachable only via `patch_env_for_export`, which
the task-space path deliberately skips, so reverting them does not affect the
exported artifacts.

The `isaaclab` changelog fragment is dropped since the core library is no
longer modified.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The tutorial described the joint-space environments almost exclusively, even
though task-space (OSC) variants ship alongside them. It now presents both
control spaces side by side.

Content:
* Task details state that the policy observes the robot's current state (arm
  joint angles in joint space, flange/end-effector pose in task space), and
  that the output is a joint-position delta or a Cartesian pose delta.
* Notes that this environment has been deployed and tested on a real
  Flexiv Rizon 4s, matching the gear assembly tutorial.
* Observation, action, training, export and deployment-metadata sections are
  tabbed by control space; adds a "Choosing a Control Space" comparison.
* Documents the task-space specifics: 18-dim actor input, 6D rotation
  representation, zeroed joint PD gains, and the TCP-observe / flange-control
  split.
* Generalizes the proprioceptive-noise rationale to the task-space
  end-effector pose, and clarifies which observation carries perception noise.

Cleanup:
* Drops the SysID / delayed-action code-layout entries and section; that work
  is not part of this branch.
* Refers to the plug and socket assets generically instead of naming files
  under a specific directory.
* Adds the joint-space, task-space and exporter entries to the code layout.

Also carries four pre-existing wording fixes from the working tree
(Isaac ROS naming, "DisplayPort plug", "considerable").

Verified with a Sphinx build: 6 tab-sets / 12 tab-items render, and the
tutorial's rst pre-commit hooks pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…pace

Records two pieces of deployment guidance that were not written down:

* Task space is the recommended control space. Task-space policies have
  transferred better than joint-space ones in our testing on the real Flexiv
  Rizon 4s, because a Cartesian pose delta keeps the policy independent of the
  arm's joint servo behavior and of small kinematic-model errors.

* Joint-space training needs a robot USD that matches the specific arm. The
  policy commands joints directly, so kinematic mismatch surfaces as
  end-effector error at sub-millimetre clearances. Points at Flexiv's
  flexiv_calibration workflow for exporting a calibrated robot description, and
  documents the DP_ROBOT_USD environment variable for selecting the result.

The guidance appears in "Choosing a Control Space" (new anchor), with pointers
from the task details and Step 1, and a robot-asset paragraph in the asset
quality section.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Two corrections to the DisplayPort tutorial.

The "use the NoJointVel variant" note sat at the top level of the observation
section, so it read as the tutorial's overall sim-to-real recommendation while
actually only concerning the joint-space variants — and it competed with the
task-space recommendation. It now lives inside the joint-space tab, is worded
as a choice among the joint-space variants, and points at
"Choosing a Control Space" for the broader question.

The ROS-inference environments are the ones actually used to train deployed
policies, not just an export-time configuration. In addition to the training
setup they declare the metadata Isaac Manipulator and LEAPP consume and pin
the plug, socket and seed joint pose to the real deployment station, so
training on them means the trained environment and the exported contract are
identical and a checkpoint deploys with Isaac ROS without a config swap.

* Registered environments table is reordered around this: the two
  `-ROS-Inference-v0` ids lead as the training + deployment entries, with the
  plain ids described as experiment-only.
* Step 1 and Step 2 commands train on the `-ROS-Inference-v0` ids in both
  control spaces.
* Drops the "(optional)" framing that presented ROS-aligned metadata as an
  extra, and notes in the export section that no id swap is needed.

Sphinx build passes; all nine registered ids are documented.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Assets
------
Removes the three vendored USD binaries and loads the plug and socket from
the Isaac asset server instead, under
``Props/Factory/display_port_cable_assets``, matching how the sibling gear
assembly task sources its assets.

The asset root is pinned to the staging bucket for now: the DisplayPort
assets are published there but are not yet mirrored to the production bucket
that ``ISAAC_NUCLEUS_DIR`` resolves to. A comment marks the one-line switch to
``ISAAC_NUCLEUS_DIR`` once they are promoted.

The calibrated per-robot USD is dropped as well; the environments now spawn
the stock ``FLEXIV_RIZON4S_GRAV_GRIPPER_CFG`` asset. That describes a nominal
Rizon 4s rather than a specific arm, so the documentation now tells users to
substitute a calibrated description of their own robot before training a
joint-space policy they intend to deploy, and no longer refers to a
``DP_ROBOT_USD`` environment variable that this branch does not define.

Lint
----
Fixes three pre-existing failures in ``play_displayport_insertion.py`` that
would fail CI:

* ``SIM105``: ``try``/``except``/``pass`` replaced with
  ``contextlib.suppress``.
* ``C901``: ``main`` exceeds the complexity limit; waived with ``noqa`` rather
  than restructuring a working inference entry point.
* ``codespell``: the local ``rin`` reads as a misspelling; renamed to
  ``rnn_in_vec``.

Also applies ``ruff format`` and re-syncs the DisplayPort exporter with
upstream's ``compile_graph`` change, which now publishes graph metadata
(policy frequency) via ``create_graph_configs``.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@shauryadNv
shauryadNv force-pushed the shauryad/dp_cable_ship branch from 015b113 to 0e6d1c7 Compare September 9, 2026 22:12
@shauryadNv

Copy link
Copy Markdown
Contributor 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 Sep 9, 2026
Export
------
``--export_method`` defaults to ``None`` upstream, and the effective backend is
resolved into a local variable. The DisplayPort exporter passed the raw
``args_cli.export_method`` to the task-space action annotation, so
``export_with=None`` reached LEAPP: the run still exited 0 but emitted only the
YAML contract and the recurrent initial values, with no compiled model, and
LEAPP skipped validation. Resolve the backend once and use it for both the
patcher and the action annotation.

This only surfaced after rebasing onto current develop; the previous parser
defaulted the flag to ``onnx-dynamo``.

Docs
----
The unified entry point has no ``--headless`` flag; the visualizer is selected
with ``--visualizer`` / ``--viz``. Replaces the five ``--headless`` usages with
``--viz none`` and corrects the flag glossary.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

# Flexiv Rizon 4s - Joint space
gym.register(
id="Isaac-Deploy-DisplayportInsertion-Rizon4s-Grav-v0",

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.

contrib tasks should start with IsaacContrib


01_io_descriptors/io_descriptors_101
02_gear_assembly/gear_assembly_policy
06_displayport_insertion/displayport_insertion_policy

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.

should this replace the above tutorial? is there value to keeping both?


.. code-block:: bash

./isaaclab.sh -p scripts/reinforcement_learning/deploy/play_displayport_insertion.py \\

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.

commands should use uv run instead

_DEFAULT_TASK = "Isaac-Deploy-DisplayportInsertion-Rizon4s-Grav-NoJointVel-ROS-Inference-v0"

# -- argparse ----------------------------------------------------------------
parser = argparse.ArgumentParser(

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.

is this a common script for deployment or something very specific to the task? it's also an extremely long script...

import torch


class SuccessTracker:

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.

this also doesn't feel like should belong here?

# DisplayPort assets are published on the Isaac staging asset server. They are not yet mirrored
# to the production bucket that ``ISAAC_NUCLEUS_DIR`` resolves to, so the root is pinned here.
# Switch to ``f"{ISAAC_NUCLEUS_DIR}/Props/Factory/display_port_cable_assets"`` once promoted.
_DISPLAY_ASSETS_STAGING_ROOT = "https://omniverse-content-staging.s3-us-west-2.amazonaws.com/Assets/Isaac/6.0/Isaac"

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.

this path should not be here

)


def _quat_mul(q1_xyzw, q2_xyzw):

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.

we should have these utilities already defined in utils, are these really necessary?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1



@configclass
class DisplayPortPlug(RigidObjectCfg):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think this is standard way we define

please do

DisplayPortPlug=RigidObjectCfg(....)



@configclass
class DisplayPortSocket(RigidObjectCfg):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

similar for this

init_state=AssetBaseCfg.InitialStateCfg(pos=(0.0, 0.0, -1.05)),
)

dp_plug = DisplayPortPlug()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please use dp_plug = RigidObjectCfg(...)

return torch.cat((corners, -corners[-3:]), dim=0)


class DisplayportInsertionEnv(ManagerBasedRLEnv):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if you are using manager based environment please don't create subclass, manager base environment is meant to be fully cfg driven with no central envrionment implementation code, sublcass only apply to direct environment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

instead of do this I recommend writing all the play logic into the environment cfg and use the generic play script rather than writing a separate ply disport script

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Seconded, please remove this file and success_utils.py

import torch


class SuccessTracker:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

again this suppose to be in envrionment logic doesn't belong in scripts

Three review comments from PR isaac-sim#6398.

Task ids (kellyguo11: "contrib tasks should start with IsaacContrib")
--------------------------------------------------------------------
Renames all nine registrations from ``Isaac-Deploy-DisplayportInsertion-*``
to ``IsaacContrib-Deploy-DisplayportInsertion-*``. Also drops the ``-v0``
suffix: 92 of the 95 ids under ``contrib`` carry no version suffix, and the
sibling gear assembly task registers
``IsaacContrib-Deploy-GearAssembly-Rizon4s-Grav``, so this matches the
convention on both counts.

Quaternion helpers (ashwinvkNV, kellyguo11: use existing math utils)
-------------------------------------------------------------------
The hand-rolled quaternion rotate and multiply are replaced with
``isaaclab.utils.math.quat_apply`` and ``quat_mul``, which use the same
``(x, y, z, w)`` ordering, so no convention conversion is needed. What
remains are two named adapters adapting the module's plain-tuple asset
offsets to the tensor API; the math itself is no longer duplicated here.

The three derived constants are unchanged, verified bit-identical against
the previous implementation (max delta 0.0): ``_SOCKET_ROOT_POS``,
``_DEFAULT_PLUG_ROT`` and ``_PLUG_ROOT_POS``.

Commands (kellyguo11: "commands should use uv run")
---------------------------------------------------
``uv`` is now the documented workflow. The four training commands and both
export commands use the gear assembly tutorial's nested tab layout (outer
tab per control space, inner tab for uv vs isaaclab.sh); the remaining
commands, and the play script's own usage examples, use ``uv run``
directly. Adds a note mapping the two forms, and corrects the leapp
prerequisite, which now ships as the ``leapp`` extra rather than a separate
pip install.

Verified end to end on the renamed ids with the new uv environment:
training, inference, and a task-space LEAPP export producing a complete
bundle.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@StafaH StafaH left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

High level comments:

  • We currently name things IsaacContrib-Action-Specific-Robot, where action = insert, specific = displayport, and robot = Rizon4s. This allows for in the future other robots, other specifics, and other actions (e.g. IsaacContrib-Unplug-Displayport-Rizon4s might be another task)
  • Presets can be used to probably help collapse things down into less environments. More manageable
  • Lots of old IsaacLab conventions are being used (e.g. _PLAY env) which will need to be removed.
  • If LEAPP does not support something, you will need to work together to figure out how to cleanly implement customization, we won't be able to add custom scripts for one task

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Seconded, please remove this file and success_utils.py

@@ -0,0 +1,358 @@
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we moved all leapp logic out of scripts. In general we are trying to remove all scripts/ into module logic, so this logic has to somehow be folded in with leapp. If leapp is not providing the correct export logic, then work with @frlai to figure out how to allows users to create "custom" export logic and still use export.py. Then the code can be moved into environment logic and leapp export can pick up the custom logic during the export.


# Flexiv Rizon 4s - Joint space without joint velocity Play
gym.register(
id="IsaacContrib-Deploy-DisplayportInsertion-Rizon4s-Grav-NoJointVel-Play",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We no longer recommend registering play and inference environments, and building seperate configs. You can override theplay_mode function, and our play script will pick up your logic when play is called.


# Flexiv Rizon 4s - Joint space Play
gym.register(
id="IsaacContrib-Deploy-DisplayportInsertion-Rizon4s-Grav-Play",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All of these environments could be one and use a preset over the action space.

@AntoineRichard

Copy link
Copy Markdown
Collaborator

Thanks for the PR. Please open your own repo using the template generator.

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

Labels

documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants