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

Embodied Unoccluded Navmesh Snap util #1949

Merged
merged 6 commits into from
May 21, 2024

Conversation

aclegg3
Copy link
Contributor

@aclegg3 aclegg3 commented May 13, 2024

Motivation and Context

This PR adds the embodied_unoccluded_navmesh_snap function from #1778 without the proposed full-stack refactor. See that PR for video and context. The implementation remains largely unchanged. The goal is to leverage this function downstream and retroactively refactor existing code in later changes.

TL;DR: we want to able to place embodied agents in the world nearby a particular object or furniture asset via the navmesh while considering the constraints of their embodiment and also preventing naive placement errors such as locations on the other side of a thin wall.

Accompanying refactors:

  • merged SpotParams into MobileManipulatorParams and added navmesh_offsets parameter.
  • removed navmesh_offset from config in favor of params

How Has This Been Tested

Added a unit test.

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.

@aclegg3 aclegg3 requested review from rutadesai and jimmytyyang May 13, 2024 22:02
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 13, 2024
Copy link

@rutadesai rutadesai left a comment

Choose a reason for hiding this comment

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

LGTM! Would be great to have a unit test at some point. Thanks, Alex!

start_rotation = agent_embodiment.base_rot

agent_embodiment.base_pos = batch_sample[0]
agent_embodiment.base_rot = desired_angle

Choose a reason for hiding this comment

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

I am not sure I understand orientation noise in these functions. Should it apply to desired_angle here/agent orientation basically?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, basically this is an option to sample random noisy orientations from a gaussian centered on the forward facing direction (robot facing toward the target).
The final, valid orientation is part of the return Tuple.

We have to set the agent orientation during the sampling process such that the collision checking can validate it.

This is helpful because it may be the case that some parts of the scene are tight enough that the robot will only fit into the space within a limited range of orientations (e.g. walking between sofa and coffee table). Sampling accurately in these kinds of poses requires many iterations and a high degree of noise.

Copy link
Contributor

@jimmytyyang jimmytyyang left a comment

Choose a reason for hiding this comment

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

LGTM!

@aclegg3 aclegg3 requested review from rutadesai and jimmytyyang May 16, 2024 21:04
Copy link
Contributor

@0mdc 0mdc left a comment

Choose a reason for hiding this comment

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

Looks good from my context! Thanks for improving typing and adding detailed usage documentation.

orientation_noise: float = 0,
max_orientation_samples: int = 5,
data_out: Dict[Any, Any] = None,
) -> Tuple[mn.Vector3, float, bool]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: It's possible to return null values for the first two parameters.

Copy link

@rutadesai rutadesai left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for adding the test!

@@ -597,6 +608,7 @@ def collision_check(
"""
# Get the offset positions
num_check_cylinder = len(self._navmesh_offset)
# TODO: height 0 is not a good assumption in general. This must be changed to query current navmesh height.

Choose a reason for hiding this comment

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

any reason to not do this right now?

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 would be a breaking change in behavior for the action. So far everything in this PR is transparent. I didn't want to potentially change downstream behaviors.

@aclegg3 aclegg3 merged commit e105fed into main May 21, 2024
4 checks passed
@aclegg3 aclegg3 deleted the alex-05_13-embodied_unoccluded_navmesh_snap_util branch May 21, 2024 21:19
0mdc pushed a commit that referenced this pull request May 23, 2024
*  add new method embodied_unoccluded_navmesh_snap and test

* update APIs with ignore_object_ids and fix some doc typos

* refactor to unify MobileManipulatorParams and SpotParams, add navmesh_offsets to params

* remove navmesh_offset from config in favor of params and refactor the BaseVelNonCylinderAction
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jun 26, 2024
*  add new method embodied_unoccluded_navmesh_snap and test

* update APIs with ignore_object_ids and fix some doc typos

* refactor to unify MobileManipulatorParams and SpotParams, add navmesh_offsets to params

* remove navmesh_offset from config in favor of params and refactor the BaseVelNonCylinderAction
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
*  add new method embodied_unoccluded_navmesh_snap and test

* update APIs with ignore_object_ids and fix some doc typos

* refactor to unify MobileManipulatorParams and SpotParams, add navmesh_offsets to params

* remove navmesh_offset from config in favor of params and refactor the BaseVelNonCylinderAction
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
*  add new method embodied_unoccluded_navmesh_snap and test

* update APIs with ignore_object_ids and fix some doc typos

* refactor to unify MobileManipulatorParams and SpotParams, add navmesh_offsets to params

* remove navmesh_offset from config in favor of params and refactor the BaseVelNonCylinderAction
joannetruong pushed a commit that referenced this pull request Aug 19, 2024
*  add new method embodied_unoccluded_navmesh_snap and test

* update APIs with ignore_object_ids and fix some doc typos

* refactor to unify MobileManipulatorParams and SpotParams, add navmesh_offsets to params

* remove navmesh_offset from config in favor of params and refactor the BaseVelNonCylinderAction
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.

5 participants