Hello,
With IsaacSim2022.1.0, we used SyntheticDataHelper to get images from different cameras and created a different viewport for each camera. To reduce the amount of RAM used when using several cameras, we used to hide the viewports of the cameras for which we didn’t need to fetch images so at most one camera viewport was visible at each moment. We did as follows:
from omni.isaac.kit import SimulationApp
headless = False
simulation_app = SimulationApp({"headless": headless})
import omni
from omni.isaac.core.utils.prims import create_prim
from omni.isaac.synthetic_utils import SyntheticDataHelper
stage = omni.usd.get_context().get_stage()
# For each of the camera create the camera prim and related viewport:
prim_path="/World/cam"
create_prim(prim_path=prim_path,
prim_type="Camera")
camera_prim = stage.GetPrimAtPath(prim_path)
viewport_interface = omni.kit.viewport_legacy.get_viewport_interface()
viewport_handle = viewport_interface.create_instance()
viewport_window = viewport_interface.get_viewport_window(viewport_handle)
viewport_window.set_active_camera(prim_path)
viewport_window.set_visible(False)
sd_helper = SyntheticDataHelper()
# If need to fetch an image, then switch the viewport_window visibility before getting the image
viewport_window.set_visible(True)
# Get the image
sd_helper.get_groundtruth(["depth"], viewport_window)
viewport_window.set_visible(False)
However, now with IsaacSim2022.2.0, we use the replicator api to create the cameras and we do not know how to reduce the GPU memory used by cameras. How could we do it now? With replicators, is there a similar way to set the visibility of a camera to reduce GPU memory used?