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

HITL: Limit amount of float decimals in JSON transmissions. #1800

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

0mdc
Copy link
Contributor

@0mdc 0mdc commented Feb 9, 2024

Motivation and Context

This uses the gfx_replay_manager API introduced here to limit the amount of floating point decimals used in HITL JSON serialization.

How Has This Been Tested

Tested locally. Verified that this doesn't introduce z-fighting.

Types of changes

  • [Development]

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.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 9, 2024
Copy link
Contributor

@eundersander eundersander left a comment

Choose a reason for hiding this comment

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

Are you sure about 3 places? GPT says a quaternion error could be as high as 3.6 degrees. I have done this JSON trick previously but I used 5 digits at that time.

Aside from that question, LGTM!

@0mdc
Copy link
Contributor Author

0mdc commented Feb 14, 2024

Are you sure about 3 places? GPT says a quaternion error could be as high as 3.6 degrees.

Great question. I've been running exclusively from this code for a while now. Axis-aligned quaternions don't show precision issues, and animations are smooth (testing with skinned mesh animations).

That aside, I believe that we don't have calculations that strictly depend on having normalized quaternions. As a rule of thumb, we should never trust serialized quaternions to be normalized.

Initially, I was mostly concerned with Z-fighting as HSSD has lots of co-planar geometry (carpets, wall art, ...). This also works fine after decreasing prevision.

@0mdc 0mdc force-pushed the hitl-json-decimal-places branch from d681d60 to 89f1c62 Compare March 6, 2024 04:08
@0mdc
Copy link
Contributor Author

0mdc commented Mar 6, 2024

Changed to 4 decimal places.

@0mdc 0mdc merged commit c18a71c into main Mar 6, 2024
3 checks passed
@0mdc 0mdc deleted the hitl-json-decimal-places branch March 6, 2024 04:10
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
…research#1800)

* Limit amount of float decimals in HITL JSON tranmissions.

* Set max decimal places to 4.
HHYHRHY pushed a commit to SgtVincent/habitat-lab that referenced this pull request Aug 31, 2024
…research#1800)

* Limit amount of float decimals in HITL JSON tranmissions.

* Set max decimal places to 4.
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