facebookresearch / habitat-sim

A flexible, high-performance 3D simulator for Embodied AI research.
https://aihabitat.org/
MIT License
2.54k stars 414 forks source link

Add max decimal place option to recorder. #2319

Closed 0mdc closed 6 months ago

0mdc commented 7 months ago

Motivation and Context

This changes the gfx-replay Recorder to make the maximum float decimal places configurable.

This is an easy way to increase performance of JSON-based systems, as well as making the output text more compact.

Example usage:

sim.gfx_replay_manager.set_max_decimal_places(3)
[...]
sim.gfx_replay_manager.save_keyframe()
keyframe = sim.gfx_replay_manager.write_saved_keyframes_to_string()
Example data (update frames): Default 3 Decimal Places
4223 bytes 3656 bytes
jsonbefore jsonafter

How Has This Been Tested

Added a unit test, and tested locally on the HITL tool.

Types of changes

Checklist