-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Moves meshes in the RayCaster
to classvar to be shared between sensors
#2183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Moves meshes in the RayCaster
to classvar to be shared between sensors
#2183
Conversation
Co-authored-by: Mayank Mittal <12863862+Mayankm96@users.noreply.github.com> Signed-off-by: Pascal Roth <57946385+pascal-roth@users.noreply.github.com>
…oth/IsaacLab into fearture/mesh-storing-raycaster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR moves the mesh storage for raycasting from instance attributes to class-level variables to allow sharing between sensors and reduce memory usage.
- Moves warp mesh and mesh view dictionaries to class-level with type annotations.
- Introduces an instance counter and a del method to clear the shared dictionaries when no instances remain.
- Updates the typing import to include ClassVar.
Comments suppressed due to low confidence (1)
source/isaaclab/isaaclab/sensors/ray_caster/ray_caster.py:314
- [nitpick] Relying on del for cleanup of shared class variables can be unpredictable due to Python's garbage collection behavior. Consider using an explicit cleanup method or context management to ensure reliable resource release.
def __del__(self):
@pascal-roth Pre-commit is failing. Can you check? |
lets wait with a merge, just making some tests for the ray_caster to make sure that the new classvar is cleared correclty |
@Mayankm96 ready for a review, now the raycaster also has a first set of basic tests. IMPORTANT: the test already run with pytest, commented out part at the top is for the time when everything is upgraded to pytest |
Looks like some tests are failing, is that expected? |
so regarding the tests:
Lets really push for the pytest conversion, this will make the whole setup much easier |
Description
Moves meshes in the
RayCaster
to classvar to be shared between sensors. This should save memory.Type of change
Checklist
pre-commit
checks with./isaaclab.sh --format
config/extension.toml
fileCONTRIBUTORS.md
or my name already exists there