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

--Bug fixes: Navmesh building and reconfigure in viewer.py #1632

Merged
merged 3 commits into from
Jan 20, 2022

Conversation

jturner65
Copy link
Contributor

Motivation and Context

This small PR fixes 2 bugs :

  • Viewer.py : Update the locally maintained scene name to be the unique, minimal, name of the currently loaded scene. This is necessary if the user requested a scene by some non-unique substring of a scene name (in which case the first match would be the scene rendered)
  • Do not build a navmesh on a joined collision mesh devoid of vertices. If this is attempted, the process will assert. Reviewers, please share if you feel this is the appropriate response.

How Has This Been Tested

Locally all python and c++ tests pass

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 20, 2022
@jturner65 jturner65 mentioned this pull request Jan 20, 2022
11 tasks
Comment on lines 890 to 896
CORRADE_ASSERT(
joinedMesh->vbo.size() > 0,
"::recomputeNavMesh: "
"Unable to compute a navmesh upon a non-existent mesh - "
"the underlying joined collision mesh has no vertices. This is "
"probably due to the current scene being NONE.",
false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want to have this assert if the joinedMesh is empty? Or just fail? This will probably not occur often - would primarily happen if someone attempts to build a navmesh on the NONE scene, so just failing without the assertion would probably be fine, but I am not sure if there are possible situations where an assertion would be best (i.e. training and somehow an expected collision mesh is empty).

Comment on lines +890 to +894
ESP_CHECK(joinedMesh->vbo.size() > 0,
"::recomputeNavMesh: "
"Unable to compute a navmesh upon a non-existent mesh - "
"the underlying joined collision mesh has no vertices. This is "
"probably due to the current scene being NONE. Aborting");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

...or is it better to have ESP_CHECK for this, which will throw in python and can be trapped in a try if necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like this approach, thanks for adding this check. I've seen the resulting issue a couple times and the current crash message response is non-obvious.

Copy link
Contributor

@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

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

LGTM

@jturner65 jturner65 merged commit e382f36 into facebookresearch:main Jan 20, 2022
@jturner65 jturner65 deleted the BugFixes_navmesh_pyviewer branch January 20, 2022 16:44
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.

None yet

3 participants