Fix for regression where Dexsuite robot arm only appears in env_0 for Newton + IsaacRTX#6204
Conversation
…D prims are populated
6cf4b27 to
a4288b4
Compare
Greptile SummaryThis draft PR fixes a regression in the Newton physics backend where USD prims were only being replicated into
Confidence Score: 4/5The three one-line additions mirror an established pattern from the PhysX backend and cannot cause duplicate replication because replicate() deduplicates by taking the union of row sets keyed on id(cfg). The golden images are correctly updated to reflect the now-populated multi-environment scene. The fix is targeted and correct. The only open item is a cosmetic import placement in articulation.py that the pre-commit formatter will catch; none of the unchecked checklist items block correctness of this change. No files require special attention beyond the import ordering nit in articulation.py. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Caller
participant NewtonAsset as Newton Asset __init__
participant BaseAsset as BaseAsset.__init__
participant RepQueue as REPLICATION_QUEUE
participant Replicate as replicate()
Caller->>NewtonAsset: Articulation(cfg) / RigidObject(cfg)
NewtonAsset->>BaseAsset: super().__init__(cfg)
BaseAsset-->>NewtonAsset: (spawns USD prim)
NewtonAsset->>RepQueue: queue_usd_replication(cfg) NEW
NewtonAsset->>RepQueue: queue_newton_physics_replication(cfg)
Note over RepQueue: Both (cfg, UsdReplicateContext) and (cfg, NewtonReplicateContext) are queued
Caller->>Replicate: "replicate(plan, stage=stage)"
Replicate->>RepQueue: drain queue
Replicate->>Replicate: group by BackendCtxCls, union row sets
Replicate->>Replicate: UsdReplicateContext.replicate() copies USD prims to env_1..N
Replicate->>Replicate: NewtonReplicateContext.replicate() copies physics data to env_1..N
%%{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"}}}%%
sequenceDiagram
participant Caller
participant NewtonAsset as Newton Asset __init__
participant BaseAsset as BaseAsset.__init__
participant RepQueue as REPLICATION_QUEUE
participant Replicate as replicate()
Caller->>NewtonAsset: Articulation(cfg) / RigidObject(cfg)
NewtonAsset->>BaseAsset: super().__init__(cfg)
BaseAsset-->>NewtonAsset: (spawns USD prim)
NewtonAsset->>RepQueue: queue_usd_replication(cfg) NEW
NewtonAsset->>RepQueue: queue_newton_physics_replication(cfg)
Note over RepQueue: Both (cfg, UsdReplicateContext) and (cfg, NewtonReplicateContext) are queued
Caller->>Replicate: "replicate(plan, stage=stage)"
Replicate->>RepQueue: drain queue
Replicate->>Replicate: group by BackendCtxCls, union row sets
Replicate->>Replicate: UsdReplicateContext.replicate() copies USD prims to env_1..N
Replicate->>Replicate: NewtonReplicateContext.replicate() copies physics data to env_1..N
|
|
I am not the best to review this pr. Let's ask @ooctipus . |
Description
Fix for regression where Dexsuite robot arm only appears in env_0 for Newton + IsaacRTX
When using the Newton physics backend, USD prims were not being replicated into the cloned environments.
I've added calls to queue_usd_replication before each of the queue_newton_physics_replication sites. This fixes the rendering correctness tests.
However, when training with the kit visualizer:
./isaaclab.sh train --rl_library rsl_rl \ --task Isaac-Lift-KukaAllegro-Camera \ presets=newton_mjwarp,isaacsim_rtx_renderer,rgb64,single_camera \ --seed 42 \ --num_envs 4 \ --max_iterations 100 \ --visualizer kitOnly env_0's robot is visible - but that seems to be a separate and intentional design choice by the authoring of the
omni:scenePartitionattribute/primvar on each env's Scope prim and on the camera (which controls which env is visible):https://github.com/isaac-sim/IsaacLab/blob/develop/source/isaaclab_physx/isaaclab_physx/renderers/isaac_rtx_renderer.py#L182
Using the
physx,isaacsim_rtx_renderer,rgb64,single_camerapreset exhibits the same behavior where only env_0 is visible in the viewport.Screenshots
Before the addition of the
queue_usd_replicationcalls to the IsaacLab newton physics integration, we will notice that the robot and table USD prims for env 1-3 are not present in the outliner. After the addition of the calls, they are:Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there