-
Notifications
You must be signed in to change notification settings - Fork 495
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
Better Receptacle filtering refactor #1889
Conversation
) -> List[Union[Receptacle, AABBReceptacle, TriangleMeshReceptacle]]: | ||
""" | ||
Scrape and return a list of all Receptacles defined in the metadata belonging to the scene's currently instanced objects. | ||
|
||
:param sim: Simulator must be provided. | ||
:param ignore_handles: An optional list of handles for ManagedObjects which should be skipped. No Receptacles for matching objects will be returned. | ||
:param exclude_filter_strings: An optional list of excluded Receptacle substrings. Any Receptacle which contains any excluded filter substring in its unique_name will not be included in the returned set. |
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.
can you provide some examples of what these strings can be?
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.
Sure, these are exactly the strings found in the receptacle_filter_files here: https://huggingface.co/datasets/hssd/hssd-hab/tree/main/scene_filter_files
In that file, they are exact matches for the Receptacle.unique_name
attribute.
They can also be any substring you want. For example, an object hash like 033ec086c23a6d39fb37df87e6748c413bf80e29
or if the receptacles have semantic names, something like "top_drawer".
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.
looks great, thank you!
* refactor filter file loading to extract functions for use elsewhere * add util to cull filtered receptacles and integrate with find_receptacles() function. Add unit test.
* refactor filter file loading to extract functions for use elsewhere * add util to cull filtered receptacles and integrate with find_receptacles() function. Add unit test.
* refactor filter file loading to extract functions for use elsewhere * add util to cull filtered receptacles and integrate with find_receptacles() function. Add unit test.
Motivation and Context
We want to use the scene Receptacle filtering earlier in the process. Currently, filters are only taken into account during sampling which is too late. This means our generic lists of Receptacles in the scene contains many un-usable entries to sift through.
This PR refactors the functionality to load and leverage the filter files into a set of util functions which can be used at other stages. It also adds the option to provide filter strings directly to the
find_receptacles
function to get a pre-filtered list of Receptacle instances.How Has This Been Tested
Added a CI test to validate the functionality.
Example of using the new utils to get a pre-filtered list of Receptacles from the active scene:
Types of changes
Checklist