Skip to content
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

[WIP][HitL] - add query for mapping between object placement point and Receptacle. #2051

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aclegg3
Copy link
Contributor

@aclegg3 aclegg3 commented Aug 29, 2024

Motivation and Context

Also integrated with hitl UI to prevent invalid placements.

TODO: more details and some refactoring

How Has This Been Tested

locally in HitL deployment

Types of changes

  • [Development] A pull request that add new features to the habitat-lab task and environment codebase. Development Pull Requests must be small (less that 500 lines of code change), have unit testing, very extensive documentation and examples. These are typically new tasks, environments, sensors, etc... The review process for these Pull Request is longer because these changes will be maintained by our core team of developers, so make sure your changes are easy to understand!

Checklist

  • My code follows the code style of this project.
  • I have updated the documentation if required.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes if required.

…Integrated with hitl UI to prevent invalid placements
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 29, 2024
…ements and add info_text return for use in UI tooltips
Comment on lines +593 to +595
print(
f"Placed object on Receptacle '{_placement_receptacle}', confidence[0,1]={_confidence}. Info text: {_info_text}"
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this with necessary event logic to cache the new object->Receptacle parenting

point, receptacle_object_id
)
if recepacle_name is None:
# TODO: display the _info_text with failure message
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: UI hook needed here to tell the user why thir placement point isn't valid

@@ -720,6 +721,7 @@ def _create_recep_info(
self, scene_id: str, ignore_handles: List[str]
) -> Dict[str, Receptacle]:
if scene_id not in self._receptacles_cache:
# TODO: consume the filter file to limit loaded receptacle to the "active" set?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this in a separate PR in case it breaks other parts of the codebase. Will link here when ready.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR: #2053

Comment on lines +487 to +492
def get_place_obj_receptacle_and_confidence(
self,
bottom_point: np.ndarray,
support_surface_id: int,
max_dist_to_rec: float = 0.25,
) -> Tuple[Optional[str], float, str]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This utility should probably be moved somewhere like sim_utilities,py so it can be consumed elsewhere in the stack.

Comment on lines +346 to +348
def point_to_tri_dist(
self, point: np.ndarray, triangles: np.ndarray
) -> Tuple[float, np.ndarray]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This utility probably belongs in habitat-sim geometry utils.

local_point = t_form.inverted().transform_point(point)
# iterate over the triangles, getting point to edge distances
# NOTE: list of lists, each with 3 numpy arrays, one for each vertex
# TODO: these could be cached since it doesn't require local->global transform
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be done in receptacle.py

Comment on lines +481 to +483
raise NotImplementedError(
"TODO: add handling for other Receptacle types."
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the limitation. This will only be a problem for use with ReplicaCAD and other older AABBReceptacle types.

@0mdc
Copy link
Contributor

0mdc commented Sep 3, 2024

Looks good so far. Let me know when you're ready for another review pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants