Unverified Commit 07e45a97 authored by James Smith's avatar James Smith Committed by GitHub

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
parent 3e3d7df7
...@@ -269,3 +269,6 @@ class AssetBase(ABC): ...@@ -269,3 +269,6 @@ class AssetBase(ABC):
def _invalidate_initialize_callback(self, event): def _invalidate_initialize_callback(self, event):
"""Invalidates the scene elements.""" """Invalidates the scene elements."""
self._is_initialized = False self._is_initialized = False
if self._debug_vis_handle is not None:
self._debug_vis_handle.unsubscribe()
self._debug_vis_handle = None
...@@ -276,6 +276,9 @@ class SensorBase(ABC): ...@@ -276,6 +276,9 @@ class SensorBase(ABC):
def _invalidate_initialize_callback(self, event): def _invalidate_initialize_callback(self, event):
"""Invalidates the scene elements.""" """Invalidates the scene elements."""
self._is_initialized = False self._is_initialized = False
if self._debug_vis_handle is not None:
self._debug_vis_handle.unsubscribe()
self._debug_vis_handle = None
""" """
Helper functions. Helper functions.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment