Skip to content

Conversation

@tkgaolol
Copy link
Contributor

Description

This PR fixes a bug in RigidObjectCollection where _object_names_list accumulates duplicate entries when the simulation resets multiple times, leading to incorrect object counts.

Fixes # (4258)

Problem:
When using workflows that trigger multiple simulation resets (e.g., record_demos.py), the _initialize_impl() method gets called multiple times without clearing the existing _object_names_list, causing duplicate object names to be appended.

Solution:
Added self._object_names_list.clear() at the beginning of _initialize_impl() to ensure the list is reset before repopulating it, making the initialization process idempotent.

Test Command:

python scripts/tools/record_demos.py --task Isaac-Stack-Cube-Instance-Randomize-Franka-IK-Rel-v0 --teleop_device keyboard

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

image

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

Copy link
Contributor

@Mayankm96 Mayankm96 left a comment

Choose a reason for hiding this comment

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

Thank you for the fix! Nice catch!

@Mayankm96 Mayankm96 changed the title Clear object names list on initialization Clears object names list on initialization of RigidObjectCollection Dec 28, 2025
@Mayankm96 Mayankm96 merged commit 1425cb8 into isaac-sim:main Dec 28, 2025
2 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.

[Bug Report] RigidObjectCollection double counting of object names

2 participants