Skip to content

Commit 07e45a9

Browse files
authored
Unsubscribes from debug vis handle when timeline is stopped (#2214)
# Description This PR fixes a bug where old callbacks for sensors were being called after the scene had been cleared, resulting in exceptions and a crash of extensions built off of Isaac Lab. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] 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
1 parent 3e3d7df commit 07e45a9

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

source/isaaclab/isaaclab/assets/asset_base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,3 +269,6 @@ def _initialize_callback(self, event):
269269
def _invalidate_initialize_callback(self, event):
270270
"""Invalidates the scene elements."""
271271
self._is_initialized = False
272+
if self._debug_vis_handle is not None:
273+
self._debug_vis_handle.unsubscribe()
274+
self._debug_vis_handle = None

source/isaaclab/isaaclab/sensors/sensor_base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ def _initialize_callback(self, event):
276276
def _invalidate_initialize_callback(self, event):
277277
"""Invalidates the scene elements."""
278278
self._is_initialized = False
279+
if self._debug_vis_handle is not None:
280+
self._debug_vis_handle.unsubscribe()
281+
self._debug_vis_handle = None
279282

280283
"""
281284
Helper functions.

0 commit comments

Comments
 (0)