Skip to content

Updates Mocks#4720

Open
AntoineRichard wants to merge 11 commits intoisaac-sim:developfrom
AntoineRichard:antoiner/assets_uts
Open

Updates Mocks#4720
AntoineRichard wants to merge 11 commits intoisaac-sim:developfrom
AntoineRichard:antoiner/assets_uts

Conversation

@AntoineRichard
Copy link
Collaborator

@AntoineRichard AntoineRichard commented Feb 25, 2026

Description

Updates the mocks to match the API signature after the latest changes. Builds on top of #4719

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

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

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 25, 2026

Greptile Summary

Updates mock interfaces to match the latest API signatures after recent changes to shape handling and type annotations.

Key changes:

  • Shape corrections: Fixed body_mass from (N, 1, 1) to (N, 1), and body_inertia to consistent (N, num_bodies, 9) format across all mock implementations
  • Type signature updates: Added wp.array and torch.Tensor type hints to all write methods in mocks, matching the real implementations
  • Validation infrastructure: Added assert_shape_and_dtype methods to AssetBase for debug-mode validation of inputs (zero overhead in optimized builds)
  • API consistency: Updated find_joints, find_fixed_tendons, and find_spatial_tendons to accept list[str] instead of list[int] for subset parameters
  • Float support: Updated tendon setter signatures to accept float values in addition to tensors
  • Removed duplicates: Removed duplicate com_pos_b and com_quat_b properties from mocks (now inherited from base classes)
  • Tests updated: All test assertions updated to match the corrected shapes

All changes are consistent and maintain backward compatibility while improving type safety and validation.

Confidence Score: 5/5

  • Safe to merge - well-structured mock updates with comprehensive test coverage
  • All mock interfaces correctly updated to match API signatures, shape fixes are consistent across codebase, tests updated and passing, changelog properly documented, and validation added with zero runtime overhead in production
  • No files require special attention

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/assets/asset_base.py Added shape and dtype validation methods for debug-mode checking
source/isaaclab/isaaclab/test/mock_interfaces/assets/mock_articulation.py Updated mock to match API: body_inertia shape, find methods, type hints, removed duplicate properties
source/isaaclab/isaaclab/test/mock_interfaces/assets/mock_rigid_object.py Updated mock to match API: body_mass shape, type hints, removed duplicate properties, added keyword-only args
source/isaaclab_physx/isaaclab_physx/assets/articulation/articulation.py Added shape/dtype assertions to all write methods for validation
source/isaaclab_physx/isaaclab_physx/assets/rigid_object/rigid_object_data.py Fixed body_mass shape documentation and added reshape for body_inertia to (N, 1, 9)
source/isaaclab_physx/isaaclab_physx/assets/rigid_object_collection/rigid_object_collection_data.py Fixed body_mass reshape to (N, num_bodies) instead of (N, num_bodies, 1)

Last reviewed commit: 314dc3b

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

38 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@kellyguo11
Copy link
Contributor

can you help rebase this one?

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