IsaacLab icon indicating copy to clipboard operation
IsaacLab copied to clipboard

Moves meshes in the `RayCaster` to classvar to be shared between sensors

Open pascal-roth opened this issue 9 months ago • 5 comments

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-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

pascal-roth avatar Mar 28 '25 15:03 pascal-roth

@pascal-roth Pre-commit is failing. Can you check?

Mayankm96 avatar Apr 07 '25 05:04 Mayankm96

lets wait with a merge, just making some tests for the ray_caster to make sure that the new classvar is cleared correclty

pascal-roth avatar Apr 07 '25 07:04 pascal-roth

@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

pascal-roth avatar Apr 07 '25 12:04 pascal-roth

Looks like some tests are failing, is that expected?

kellyguo11 avatar Apr 08 '25 05:04 kellyguo11

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

pascal-roth avatar Apr 10 '25 11:04 pascal-roth

Is the test_environment_determinism.py failure related to the changes?

kellyguo11 avatar May 15 '25 03:05 kellyguo11

Not sure, will have to check today

pascal-roth avatar May 15 '25 06:05 pascal-roth

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 ?

pascal-roth avatar May 15 '25 08:05 pascal-roth

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

kellyguo11 avatar May 16 '25 04:05 kellyguo11

I tend to agree, we can put some debug statements all over the code and see if we find something haha

pascal-roth avatar May 16 '25 06:05 pascal-roth

now included in #3298

pascal-roth avatar Aug 29 '25 15:08 pascal-roth