Skip to content

Clears object names list on initialization of RigidObjectCollection - #4259

Merged
Mayankm96 merged 1 commit into
isaac-sim:mainfrom
tkgaolol:main
Dec 28, 2025
Merged

Mayankm96 merged 1 commit into
isaac-sim:mainfrom
tkgaolol:main

Conversation

@tkgaolol

Copy link
Copy Markdown
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

@Mayankm96 Mayankm96 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.

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
thiagolages pushed a commit to thiagolages/isaac-lab that referenced this pull request Jan 6, 2026
…saac-sim#4259)

# Description

<!--
Thank you for your interest in sending a pull request. Please make sure
to check the contribution guidelines.

Link:
https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html

💡 Please try to keep PRs small and focused. Large PRs are harder to
review and merge.
-->

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)](isaac-sim#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:**
```bash
python scripts/tools/record_demos.py --task Isaac-Stack-Cube-Instance-Randomize-Franka-IK-Rel-v0 --teleop_device keyboard
```

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

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

## Screenshots

<img width="1492" height="403" alt="image"
src="https://github.com/user-attachments/assets/4402d016-85b3-43e6-8830-dcb862bcd8b7"
/>

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) 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
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->
Edify0991 pushed a commit to Edify0991/IsaacLab that referenced this pull request Jan 14, 2026
…saac-sim#4259)

# Description

<!--
Thank you for your interest in sending a pull request. Please make sure
to check the contribution guidelines.

Link:
https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html

💡 Please try to keep PRs small and focused. Large PRs are harder to
review and merge.
-->

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)](isaac-sim#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:**
```bash
python scripts/tools/record_demos.py --task Isaac-Stack-Cube-Instance-Randomize-Franka-IK-Rel-v0 --teleop_device keyboard
```

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

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

## Screenshots

<img width="1492" height="403" alt="image"
src="https://github.com/user-attachments/assets/4402d016-85b3-43e6-8830-dcb862bcd8b7"
/>

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) 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
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->
nitesh-subedi pushed a commit to nitesh-subedi/IsaacLab that referenced this pull request Feb 5, 2026
…saac-sim#4259)

# Description

<!--
Thank you for your interest in sending a pull request. Please make sure
to check the contribution guidelines.

Link:
https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html

💡 Please try to keep PRs small and focused. Large PRs are harder to
review and merge.
-->

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)](isaac-sim#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:**
```bash
python scripts/tools/record_demos.py --task Isaac-Stack-Cube-Instance-Randomize-Franka-IK-Rel-v0 --teleop_device keyboard
```

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

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

## Screenshots

<img width="1492" height="403" alt="image"
src="https://github.com/user-attachments/assets/4402d016-85b3-43e6-8830-dcb862bcd8b7"
/>

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) 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
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->
csj-275 pushed a commit to csj-275/IsaacLab that referenced this pull request Jul 8, 2026
…saac-sim#4259)

# Description

<!--
Thank you for your interest in sending a pull request. Please make sure
to check the contribution guidelines.

Link:
https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html

💡 Please try to keep PRs small and focused. Large PRs are harder to
review and merge.
-->

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)](isaac-sim#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:**
```bash
python scripts/tools/record_demos.py --task Isaac-Stack-Cube-Instance-Randomize-Franka-IK-Rel-v0 --teleop_device keyboard
```

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

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

## Screenshots

<img width="1492" height="403" alt="image"
src="https://github.com/user-attachments/assets/4402d016-85b3-43e6-8830-dcb862bcd8b7"
/>

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) 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
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->
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