Skip to content

Render Newton cables on all three renderers - #7016

Draft
huidongc wants to merge 16 commits into
isaac-sim:developfrom
huidongc:cable-rendering
Draft

Render Newton cables on all three renderers#7016
huidongc wants to merge 16 commits into
isaac-sim:developfrom
huidongc:cable-rendering

Conversation

@huidongc

@huidongc huidongc commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Cable curve points are now computed on device from the Newton segment bodies and written GPU/ASYNC each frame, so cables follow their simulated pose instead of drawing at their spawn pose and never moving. Drops the CPU mirror in sync_cables_to_usd, which copied the whole model's body_q device-to-host on every dirty render frame.

Fixes OMPE-103001

Type of change

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

Screenshots

Please attach before and after screenshots of the change if applicable.

IsaacSim RTX Newton Warp OVRTX
franka_cable-newton-isaacsim_rtx_renderer-rgb franka_cable-newton-newton_renderer-rgb franka_cable-newton-ovrtx_renderer-rgb

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 added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@huidongc
huidongc requested a review from a team August 11, 2026 03:40
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Aug 11, 2026
@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds animated Newton cable bindings for OVRTX, ovstage, and Isaac RTX, moves Kit cable synchronization onto the simulation device, and adds cross-renderer motion tests.

  • Computes cable curve points from Newton segment bodies and updates renderer bindings each frame.
  • Adds late Fabric-stage handling, camera render-spec validation, and empty-annotator protection.
  • Adds shared rendering fixtures, multi-environment coverage, and a cable-camera demo.

Confidence Score: 3/5

The PR should not merge until PhysX camera forwarding and complete late Fabric-stage recovery are restored.

The changed camera pump leaves PhysX Fabric transforms stale, while the late-stage Newton branch can permanently disable body and particle rendering synchronization.

Files Needing Attention: source/isaaclab_physx/isaaclab_physx/renderers/isaac_rtx_renderer_utils.py; source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py

Important Files Changed

Filename Overview
source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py Adds GPU cable synchronization and late-stage recovery, but the unavailable-stage branch leaves body and particle Fabric paths permanently uninitialized.
source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py Adds legacy and ovstage cable bindings, per-frame point computation, and corresponding teardown.
source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer_kernels.py Adds a Warp kernel that derives world-space curve points from ordered Newton segment shapes.
source/isaaclab_physx/isaaclab_physx/renderers/isaac_rtx_renderer_utils.py Broadens Newton synchronization but drops the required PhysX forward() operation from the camera pump.
source/isaaclab/isaaclab/sensors/camera/camera.py Derives renderer view count from discovered camera prims to match render-product sizing.
source/isaaclab_physx/isaaclab_physx/renderers/isaac_rtx_renderer.py Safely skips tiled reshape when an annotator returns an empty source buffer.

Sequence Diagram

sequenceDiagram
    participant Physics as Newton/PhysX
    participant Camera
    participant Renderer
    participant Fabric
    Physics->>Physics: Step simulation
    Camera->>Renderer: Request frame
    Renderer->>Physics: pre_render()
    Physics->>Fabric: Sync transforms and cable points
    Renderer->>Fabric: Read current scene
    Renderer-->>Camera: RGB output
Loading

Reviews (1): Last reviewed commit: "OMPE-103001: Render and animate Newton c..." | Re-trigger Greptile

# sync_*_to_usd calls that only pre_render() makes. A sensor read that skips them draws bodies at
# the current pose and cables frozen at their spawn pose, which still yields a stable, plausible
# image.
sim.physics_manager.pre_render()

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 PhysX Fabric forwarding is skipped

When an Isaac RTX camera reads after sim.step(render=False) without a visualizer that performs forwarding, this now calls PhysX's no-op pre_render() instead of forward(), so current transforms are not written to Fabric and the camera renders stale body poses.

Knowledge Base Used: IsaacLab Core Simulation Layer

Comment on lines +1619 to +1624
if not cls._clone_physics_only and get_current_stage(fabric=True) is None:
logger.warning(
"[NewtonManager] Fabric stage unavailable at start_simulation; the cable sync will"
" re-acquire it lazily on first use."
)
elif not cls._clone_physics_only:

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 Late Fabric recovery remains partial

When the Fabric stage is unavailable during start_simulation, this branch skips body, cable, and particle initialization, while the later recovery restores only cable bindings. Because body and Fabric-mesh particle synchronization still require _usdrt_stage, those objects remain frozen in Kit rendering after the stage becomes available.

Knowledge Base Used: IsaacLab Core Simulation Layer

@isaaclab-review-bot isaaclab-review-bot 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.

Isaac Lab Review Bot

The device-side cable rendering paths are coherently integrated across Newton Fabric, OVRTX, and Isaac RTX, but two concrete issues remain: late Fabric-stage recovery is blocked by the dirty-flag guard, and the demo silently accepts --frames_dir without enabling a camera, producing no frames.

  • Design and architecture: The cable-point setup, per-frame update, and teardown follow the existing geometry-binding architecture across both OVRTX paths. However, the lazy Fabric-stage recovery cannot fulfill its intended role because cable synchronization is not marked dirty when _usdrt_stage was unavailable at startup.
  • API: CameraRenderSpec now consistently enforces the documented camera-path/view-count invariant. The demo’s new --frames_dir option has an ambiguous invalid combination: without --camera, it creates a directory but writes nothing, so argument validation should reject that usage.
  • Implementation: The device kernels, OVRTX ASYNC stream handoff, ovstage host-copy path, Fabric invalidation, and Isaac RTX pre_render() pump are internally consistent. The remaining implementation defect is that sync_cables_to_usd() checks _cables_dirty before attempting recovery, while per-step dirtying depends on _usdrt_stage; therefore the targeted late-stage case never reaches _recover_cable_fabric_path().

Minor fixes needed. Posted 2 actionable findings inline.

Automated review; human maintainers own approval decisions.

if not cls._cables_dirty:
return
if cls._usdrt_stage is None or cls._cable_shape_ids is None:
if cls._cable_fabric_stage() is None:

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.

🟡 Warning · Implementation — Lazy Fabric cable recovery is unreachable

sync_cables_to_usd returns at the _cables_dirty guard before reaching _recover_cable_fabric_path. Per-frame dirtying in step() is gated on cls._usdrt_stage is not None, and recovery deliberately stores the stage in _cable_usdrt_stage only, so in the exact late-stage case this targets the flag never becomes true and cables keep rendering frozen. Mark cables dirty (or attempt recovery) independently of _usdrt_stage.

Comment thread scripts/demos/cables.py Outdated
help="Attach a camera that renders the cable pile with the given renderer.",
)
parser.add_argument(
"--frames_dir",

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.

🔵 Suggestion · Api — frames_dir accepted without a camera

--frames_dir documents writing each rendered frame, but save_frame is only reached inside the camera is not None branch of run_simulator. Passing --frames_dir without --camera creates the directory and then writes nothing, with no diagnostic. Add a parser.error for this combination alongside the existing argument checks.

@huidongc
huidongc marked this pull request as draft August 11, 2026 03:54
@huidongc huidongc changed the title Render and animate Newton cables on all three renderers Render Newton cables on all three renderers Aug 12, 2026
@huidongc
huidongc force-pushed the cable-rendering branch 2 times, most recently from 8da16c3 to 86752a2 Compare August 13, 2026 09:30
jmart-nv and others added 10 commits August 14, 2026 20:37
Cable curve points are now computed on device from the Newton segment bodies and written GPU/ASYNC each frame, so cables follow their simulated pose instead of drawing at their spawn pose and never moving. Drops the CPU mirror in sync_cables_to_usd, which copied the whole model's body_q device-to-host on every dirty render frame.

Adds the first rendering coverage for cables, gated on motion rather than presence, and fixes three defects found alongside: the view_count / camera-prim mismatch, the Isaac RTX sensor pump refreshing transforms only, and the Fabric stage being resolved exactly once at startup.

Requires Kit !47946, !48359 and !48511, and OVRTX >= 0.4.1. The rendering cells skip below those floors rather than fail.
…dering

Keep the cable PR focused on sync/binding; peel the view_count contract and Isaac RTX empty-annotator skip for a follow-up.
Register Isaac-Lift-Cable-Franka(+Camera) with a CouplerProxy MJWarp+VBD four-cable pile and kit/kitless golden-image tests so Newton cable rendering is exercised across AOVs and renderers.
…capture.

Spawn cables above the table so free-fall is visible under gravity, and gate multi-step camera capture behind ISAAC_LAB_SAVE_RENDERING_GIF while keeping golden validation as the default path.
Validate clone destinations against source USD prototypes in collect_cable_segment_shapes and pass ClonePlan from OVRTX so env_1+ cables animate instead of staying frozen at spawn.
…able spawn heights and increasing thickness of cables.
Switch to one camera per env with wider spacing and clipping so lit-mask
metrics cover every tile without neighbor leakage, thicken the cable for
reliable segmentation, and add optional GIF capture for debugging.
Reuse shared golden scene overrides for the production Franka cable
camera env, refresh mismatched AOV baselines across Isaac RTX, Newton,
and OVRTX, and add a skip changelog fragment for the test-only changes.
Newton cable/particle Fabric sync belongs on SimulationContext.render()
via physics_manager.pre_render(). ensure_isaac_rtx_render_update() is the
Kit pump path and should keep forward() for PhysX Fabric refresh; using
pre_render() here papers over callers that skip sim.render() and regresses
PhysX on paths that rely on this util alone.
The changelog and isaac_rtx cable test assumed camera.update() after
sim.step(render=False) must itself sync Newton cable/particle Fabric
state. That is not the production contract: SimulationContext.render()
already calls physics_manager.pre_render() before sensors/visualizers,
and ensure_isaac_rtx_render_update() is the Kit pump path that should
keep forward() for PhysX Fabric refresh. The test therefore imposed an
invalid premise and pushed a layer-crossing "fix" that papers over
skipping sim.render() while regressing PhysX on util-only pump paths.
Remove the fragment and test rather than reshape production around them.
Align cable dirty-retry and stage handling with particle Fabric sync, register
cables from CableObject for Fabric/OVRTX, and drop clone_plan discovery.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants