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

--Viewer : minor bugs; refactor drawEvent #1621

Merged
merged 5 commits into from
Jan 18, 2022

Conversation

jturner65
Copy link
Contributor

@jturner65 jturner65 commented Jan 13, 2022

Motivation and Context

This PR addresses a few minor bugs in viewer, where values that should have been mapped from constants were being mapped via magic numbers, or else not being mapped at all (such as the agent's dims if navmesh recalc is requested).

drawEvent functionality was also refactored to not recreate the Sensor Key string every frame when it only changed if sensorMode_ or visualizeMode_ changed.

How Has This Been Tested

It's Viewer! It Always Works!

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 13, 2022
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.

Agreed that settings should come from any loaded config. Not sure about the hard-coded slope fix here. I understand why we should change it, but maybe it should be a change in the NavMesh default settings instead.

Also note we have the python viewer application here. Should these be expected to behave the same way? Open to thoughts here.

@@ -903,6 +903,9 @@ void Viewer::initSimPostReconfigure() {
}
} else if (recomputeNavmesh_) {
esp::nav::NavMeshSettings navMeshSettings;
navMeshSettings.agentHeight = agentConfig_.height;
navMeshSettings.agentRadius = agentConfig_.radius;
navMeshSettings.agentMaxSlope = 55.0f;
Copy link
Contributor

Choose a reason for hiding this comment

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

Danger here is that users will load the asset in viewer and everything looks good, but using the defaults in the episode generator for training won't produce the same results.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, we do need to map the agentConfig values to the navMeshSettings, i think - if we are allowing folks to change agent geometry in viewer then we should have the navmesh synth process track that.
As for the hardcoded max slope, I actually don't wan to have this here, primarily I just wanted to start a conversation about it.

@jturner65
Copy link
Contributor Author

Agreed that settings should come from any loaded config. Not sure about the hard-coded slope fix here. I understand why we should change it, but maybe it should be a change in the NavMesh default settings instead.

Yeah, that would be the ideal situation, but not sure if folks are prepared for any changes that might entail.

Also note we have the python viewer application here. Should these be expected to behave the same way? Open to thoughts here.

I think they should, especially for these particular value-driven quantities (if we are recomputing the navmesh and have locally defined agent specs, we really should use those to build the navmesh, I think)

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, thanks.

@jturner65
Copy link
Contributor Author

Got rid of a bunch of needless if checks building the string sensor key in drawEvent, and streamlined the draw/render process a bit.

@jturner65 jturner65 changed the title Minor viewer.cpp bugs --Viewer : minor bugs; refactor drawEvent Jan 18, 2022
@jturner65 jturner65 merged commit 1b9c101 into facebookresearch:main Jan 18, 2022
@jturner65 jturner65 deleted the viewer_bugs branch January 18, 2022 19:13
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

4 participants