Skip to content

Add num_shapes_per_body to Newton RigidObject#7

Open
vidurv-nvidia wants to merge 1 commit intoooctipus:feature/event_mdp_parityfrom
vidurv-nvidia:vidur/fix-rigid-object-num-shapes
Open

Add num_shapes_per_body to Newton RigidObject#7
vidurv-nvidia wants to merge 1 commit intoooctipus:feature/event_mdp_parityfrom
vidurv-nvidia:vidur/fix-rigid-object-num-shapes

Conversation

@vidurv-nvidia
Copy link
Copy Markdown

Summary

The Newton randomize_rigid_body_material implementation calls asset.num_shapes_per_body on both Articulation and RigidObject. The property was added to Articulation but is missing from RigidObject, causing AttributeError when randomizing friction on rigid objects (e.g. a power supply object in a manipulation task).

This adds the same cached num_shapes_per_body property to Newton's RigidObject, using self._root_view.body_shapes (same approach as the Articulation implementation).

Test

Without this fix:

File "isaaclab/envs/mdp/events.py", line 288, in __init__
    total_shapes = sum(asset.num_shapes_per_body)
AttributeError: 'RigidObject' object has no attribute 'num_shapes_per_body'

With this fix: randomize_rigid_body_material works on both Articulation and RigidObject assets on the Newton backend.

The Newton randomize_rigid_body_material impl calls
asset.num_shapes_per_body on both Articulation and RigidObject.
The property existed on Articulation but was missing from RigidObject,
causing AttributeError when randomizing friction on rigid objects.
@github-actions github-actions bot added bug Something isn't working isaac-lab labels Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant