OmniGibson icon indicating copy to clipboard operation
OmniGibson copied to clipboard

Add support for multiple envs/scenes under a single simulator instance

Open cgokmen opened this issue 4 months ago • 0 comments

  1. Add a scene= argument to prim/object load, and make the object's scene accessible through self.scene. (you might also need to add this into prim/object __init__ for scene objects)
  2. Add a property scenes onto Simulator that returns [self._scene]
  3. Replace all references to og.sim.scene with .scene on some relevant object/prim. If there are any use cases that involve iterating over all scenes and all objects, use og.sim.scenes making sure to iterate over all the scenes (for now there will only be one)
  4. Remove the og.sim.scene property (not _scene just yet)
  5. Change the dependency direction between scene.add_object and sim.import_object (make the former call the latter). Replace all use cases of sim.import_object with scene.add_object.
  6. In simulator, remove the ._scene member, instead add a ._scenes member. Make it possible to import multiple scenes (add position offset + name prefix). Replace references to _scene with loops over all the scenes.
  7. Add an example and a unit test that loads multiple scenes. Make sure they dont overlap and we dont get any errors.
  8. Refactor environment to be called VectorEnvironment, and vectorize every member (e.g. configs, scenes, tasks, obs, ...). Add a new class called Environment that wraps around a VectorEnvironment(n=1) and wraps & unwraps actions/observations/infos/etc.
  9. Make sure that nothing calls cross-env destructive behaviors like og.sim.clear etc. or steps across environments (og.sim.step).

cgokmen avatar Mar 06 '24 00:03 cgokmen