davidwdw's picture
Archive code-task00-centre-pilot-v9 9d2a766809eb
d2bcc73 verified
Raw History Blame Contribute Delete
967 Bytes
"""Run the simulator with private writable Isaac app configuration on centre."""
import os
from pathlib import Path
import runpy
import sys
import importlib.util
os.environ.setdefault('OMNI_KIT_ACCEPT_EULA', 'YES')
import isaacsim # initializes ISAAC_PATH; does not launch SimulationApp
source = Path(os.environ['ISAAC_PATH'])
runtime = Path(os.environ['OMNIGIBSON_APPDATA_PATH'])/'isaac-runtime'
runtime.mkdir(parents=True, exist_ok=True)
for entry in source.iterdir():
if entry.name != 'apps':
target = runtime/entry.name
if not target.exists() and not target.is_symlink():
target.symlink_to(entry, target_is_directory=entry.is_dir())
apps = runtime/'apps'
apps.mkdir(exist_ok=True)
os.environ['EXP_PATH'] = str(apps)
print('RECOVERY_RUNTIME_SOURCE', importlib.util.find_spec('omnigibson').origin,
'private_apps', str(apps), flush=True)
module = sys.argv.pop(1)
runpy.run_module(module, run_name='__main__', alter_sys=True)