isl-org / spear

SPEAR: A Simulator for Photorealistic Embodied AI Research
MIT License
224 stars 15 forks source link

`prepare_scene_for_editing.py` should have a separate option to create symlinks to common folders #213

Open mikeroberts3000 opened 1 year ago

mikeroberts3000 commented 1 year ago

Our current implementation is not symmetric, due to how we are handling common folders. Consider the following example.

python prepare_scene_for_editing.py --scene_id warehouse_0000                 # (A) create symlinks to warehouse_0000 and common folders
python prepare_scene_for_editing.py --scene_id kujiale_0000                   # (B) create symlinks to kujiale_0000 and redundantly create symlinks to common folders
python prepare_scene_for_editing.py --scene_id kujiale_0000 --remove_symlinks # (C) remove symlinks to kujiale_0000 and common folders

At this point, warehouse_0000 is not editable, but it should be. Ideally, calls B and C would exactly undo each other with no other side effects, and we would be in the exact same state as we were after calling A. But since C removes symlinks to common folders, warehouse_0000 is not editable, and we are not in the same state as we were after calling A.

The following design would be better.

python prepare_scene_for_editing.py --create_common_symlinks                  # (A) create symlinks to common folders
python prepare_scene_for_editing.py --scene_id warehouse_0000                 # (B) create symlinks to warehouse_0000
python prepare_scene_for_editing.py --scene_id kujiale_0000                   # (C) create symlinks to kujiale_0000
python prepare_scene_for_editing.py --scene_id kujiale_0000 --remove_symlinks # (D) remove symlinks to kujiale_0000

At this point, warehouse_0000 is still editable because C and D exactly undo each other with no other side effects, i.e., we are in the exact same state as we were after calling A and B.