facebookresearch / habitat-sim

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

--Add Configuration State Flags - Part 1 #2396

Closed jturner65 closed 4 months ago

jturner65 commented 4 months ago

Motivation and Context

This is the first of 2 PRs to handle this functionality. The 2nd PR will handle making sure configuration filepaths do not get saved to JSON with inappropriate path information.

This PR is intended to expand the capabilities of the Configurations without incurring much cost by providing status flags for each ConfigValue that reside within the 4 byte gap the current _type field causes due to 8 byte alignment.

Not only will these features prevent the unnecessary writing to disk of default fields, but they can also be used to prevent configurations being written in a potentially damaging or indeterminant state due to modifications done internally as part of the program's flow.

Also adds a repathing tool in the io namespace :

io::getPathRelativeToAbsPath(const std::string& toRelPath,
                                     const std::string& absPath)

which converts the absolute path toRelPath to be relative to the given target absPath

How Has This Been Tested

Locally c++ and python tests pass

Types of changes

Checklist