Skip to content

Optimize heterogeneous bin-packing view - #7333

Merged
kellyguo11 merged 2 commits into
isaac-sim:developfrom
rebeccazhang0707:reb/optim_bin_packing
Aug 29, 2026
Merged

kellyguo11 merged 2 commits into
isaac-sim:developfrom
rebeccazhang0707:reb/optim_bin_packing

Conversation

@rebeccazhang0707

Copy link
Copy Markdown
Contributor

Description

This PR reduces the number of physics views created by scripts/demos/bin_packing.py. It keeps the existing scene configuration, clone combinations, and randomized layout flow, but changes each grocery slot to a spawn-only AssetBaseCfg and manages all spawned groceries through one flat PhysX RigidBodyView.

This is a demo-only performance optimization and adds no dependencies.

Type of change

  • Performance improvement (non-breaking change)

Testing

  • uv run isaaclab -f
  • uv run python -m py_compile scripts/demos/bin_packing.py
  • uv run isaaclab -p scripts/demos/bin_packing.py --num_envs 2 --visualizer none

The 2-environment PhysX smoke test completed scene setup, created one flat grocery view, and ran without errors.

Screenshots

Not applicable; the rendered scene and randomized layouts are unchanged.

Checklist

  • I have read and understood the contribution guidelines.
  • I have run the pre-commit checks with uv run isaaclab -f.
  • My changes generate no new warnings.
  • I have tested the updated demo with the PhysX backend.
  • Documentation changes are not required for this internal demo implementation update.
  • A changelog fragment is not required because no source package is changed.
  • My name already exists in CONTRIBUTORS.md.

Keep the existing scene configuration, clone combinations, and layout flow while changing grocery slots to spawn-only assets. Manage all spawned groceries through one flat PhysX rigid-body view.
@rebeccazhang0707
rebeccazhang0707 requested a review from a team August 25, 2026 07:17
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Aug 25, 2026
@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR replaces per-slot rigid-object views in the heterogeneous bin-packing demo with spawn-only assets managed through one flat PhysX rigid-body view.

  • Derives per-row environment origins and reset poses from matched grocery prim paths.
  • Performs batched pose, velocity, and mass updates through the flat view.
  • Retains out-of-bounds recovery using row-specific environment metadata.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or quality issues identified.

The flat view preserves the existing pose and velocity conventions while batching reset, mass, and out-of-bounds operations over the matched grocery bodies.

Important Files Changed

Filename Overview
scripts/demos/bin_packing.py Consolidates grocery simulation state into one flat PhysX view; no concrete correctness or security defects were established.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Config[Spawn-only grocery configurations] --> Scene[Cloned heterogeneous scene]
  Scene --> View[Flat PhysX RigidBodyView]
  View --> Metadata[Environment and slot metadata]
  Metadata --> Reset[Batched pose, velocity, and mass reset]
  View --> Bounds[Read transforms and detect out-of-bounds groceries]
  Bounds --> Correction[Restore spawn pose and zero velocity]
  Correction --> View
Loading

Reviews (1): Last reviewed commit: "Optimize heterogeneous bin-packing view" | Re-trigger Greptile

@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 demo’s single flat PhysX rigid-body view is a reasonable local optimization, but its direct transform writes bypass the quaternion-layout conversion previously handled by RigidObject.

  • Design and architecture: Replacing per-slot RigidObject views with spawn-only assets and one path-indexed RigidBodyView preserves the heterogeneous layout design while moving raw PhysX tensor-boundary responsibilities into the demo. That boundary must explicitly handle transform representation conventions.
  • API: No public Isaac Lab API is changed. The modified grocery_cfg return type and new flat-view helper are local to the demo, and no source package or public documentation surface is affected.
  • Implementation: The reset path supplies Isaac Lab wxyz quaternions directly to the PhysX tensor API, which expects xyzw; the stray-object correction similarly inserts spawn_pose_w rows into PhysX transform buffers without conversion. Convert quaternions at both the write and read boundaries to preserve the orientations produced by the previous RigidObject path.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

Comment thread scripts/demos/bin_packing.py Outdated
pose = groceries.spawn_pose_w.clone()
noise_quat = math_utils.quat_from_euler_xyz(noise[..., 0], noise[..., 1], noise[..., 2])
pose[..., 3:7] = math_utils.quat_mul(pose[..., 3:7], noise_quat)
groceries.root_view.set_transforms(wp.from_torch(pose.contiguous()), groceries.all_indices)

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 — Quaternion layout not converted at PhysX boundary

grocery_spawn_poses, quat_from_euler_xyz, and quat_mul produce (w, x, y, z), while omni.physics.tensors transforms use (x, y, z, w). The replaced write_root_pose_to_sim_index performed this conversion; writing pose directly here, and assigning spawn_pose_w into the get_transforms buffer at line 404, mixes conventions and yields wrong reset orientations. Convert to xyzw before set_transforms and back after get_transforms.

@ooctipus
ooctipus enabled auto-merge (squash) August 27, 2026 09:26
@kellyguo11
kellyguo11 disabled auto-merge August 29, 2026 00:37
@kellyguo11
kellyguo11 merged commit 9c209c0 into isaac-sim:develop Aug 29, 2026
72 of 74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants