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

sample points on the floor in a particular region #1945

Merged
merged 1 commit into from
May 10, 2024

Conversation

aclegg3
Copy link
Contributor

@aclegg3 aclegg3 commented May 9, 2024

Motivation and Context

This PR adds a simulation utility function to sample points on the floor in a particular SemanticRegion using navmesh sampling.

High level algorithm:

  • first snap the region AABB center to the navmesh and attempt sampling within 1 meter of that point. This will work nicely for many convex regions.
  • if nearby center sampling fails, globally sample the entire navmesh (or island)
  • in both cases above, search for the sample with the greatest "distance_to_obstacle" (a heuristic for open space around the point) in order to find "good" points with maximum accessibility.

An option exists to limit sampling to a maximum number of attempts and to return the first valid sample if time is more important than the other qualities mentioned above.

How Has This Been Tested

TODO: need a CI test, but no region annotations in testing assets yet so deferring to a later PR.

Tested locally with a viewer application:

point_in_region-2024-05-08_16.02.34.mp4

In the video, yellow circles are sampled as the agent enters a new region.

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 jturner65, zephirefaith and 0mdc May 9, 2024 18:28
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 9, 2024
Copy link
Contributor

@xavierpuigf xavierpuigf left a comment

Choose a reason for hiding this comment

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

Looks great to me! Thanks Alex!!

Copy link
Contributor

@zephirefaith zephirefaith left a comment

Choose a reason for hiding this comment

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

Tested in hab-llm a bit and worked as expected! Thank you for this superquick fix!

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.

LGTM!

@rutadesai rutadesai merged commit cab9dc9 into main May 10, 2024
4 checks passed
@aclegg3 aclegg3 deleted the alex-05_09-point_in_region branch May 10, 2024 14:13
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
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.

6 participants