Moves meshes in the `RayCaster` to classvar to be shared between sensors
Description
Moves meshes in the RayCaster to classvar to be shared between sensors. This should save memory.
Type of change
- Bug fix (non-breaking change which fixes an issue)
Checklist
- [ ] I have run the
pre-commitchecks 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.tomlfile - [ ] I have added my name to the
CONTRIBUTORS.mdor my name already exists there
@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:
- test_ray_caster.py: fail is expected as written in pytest (not sure why our unittest framework even catches that one)
- test_tiled_camera.py and test_contact_sensor.py fail but are not even in the log, don't think that is from this PR
- test_environment.py times out again
Lets really push for the pytest conversion, this will make the whole setup much easier
Is the test_environment_determinism.py failure related to the changes?
Not sure, will have to check today
So, the tests are passing locally!
When investigating the log, then it complains about reaching a recusion depth during the raycasting.
source/isaaclab/isaaclab/utils/configclass.py:282: in _validate
missing_fields.extend(_validate(value, prefix=current_path))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
obj = '/isaac-sim/extscache/omni.warp.core-1.5.0+lx64/warp/bin/warp.so'
prefix = 'height_scanner.class_type.meshes./World/ground.device.runtime.device_map.cpu.runtime.device_map.cpu.runtime.device_ma...map.cpu.runtime.device_map.cpu.runtime.device_map.cpu.runtime.device_map.cpu.runtime.device_map.cpu.runtime.core._name'
def _validate(obj: object, prefix: str = "") -> list[str]:
"""Check the validity of configclass object.
This function checks if the object is a valid configclass object. A valid configclass object contains no MISSING
entries.
Args:
obj: The object to check.
prefix: The prefix to add to the missing fields. Defaults to ''.
Returns:
A list of missing fields.
Raises:
TypeError: When the object is not a valid configuration object.
"""
missing_fields = []
if type(obj) is type(MISSING):
missing_fields.append(prefix)
return missing_fields
> elif isinstance(obj, (list, tuple)):
E RecursionError: maximum recursion depth exceeded in __instancecheck__
I don't really know what might cause the issue as now every script is run on its own. Any idea @kellyguo11 or @Mayankm96 ?
hmm very strange! I can't repro it locally either, even inside the docker container. but CI seems to be failing quite consistently on the Anymal-C rough environment, which also feels somehow related to the ray caster changes...
I tend to agree, we can put some debug statements all over the code and see if we find something haha
now included in #3298