Skip to content

Commit

Permalink
Merge pull request #99 from StanfordVL/og-develop
Browse files Browse the repository at this point in the history
Release 0.0.4
  • Loading branch information
cgokmen authored Feb 20, 2023
2 parents c0cd203 + 5eee272 commit cb70ec4
Show file tree
Hide file tree
Showing 95 changed files with 2,581 additions and 2,113 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nvcr.io/nvidia/isaac-sim:2022.1.1
FROM nvcr.io/nvidia/isaac-sim:2022.2.0

# Set up all the prerequisites.
RUN apt-get update && apt-get install -y \
Expand Down
3 changes: 2 additions & 1 deletion docs/getting_started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,10 @@ obs, rew, done, info = env.step(env.action_space.sample())
"name": "brilliant_light",
"light_type": "Sphere",
"intensity": 50000,
"radius": 0.1
"radius": 0.1,
"position": [3.0, 3.0, 4.0],
},
]

# Define robots
cfg["robots"] = [
Expand Down
80 changes: 58 additions & 22 deletions omnigibson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import nest_asyncio
nest_asyncio.apply()

__version__ = "0.0.1"
__version__ = "0.0.4"

logging.getLogger().setLevel(logging.INFO)

Expand Down Expand Up @@ -73,31 +73,59 @@
# whether to enable debugging mode for object sampling
debug_sampling = False

# Finally, we must create the omnigibson application
from omnigibson.app_omni import OmniApp
# Initialize global variables
app = None # (this is a singleton so it's okay that it's global)
sim = None # (this is a singleton so it's okay that it's global)
Environment = None
REGISTERED_SCENES = None
REGISTERED_OBJECTS = None
REGISTERED_ROBOTS = None
REGISTERED_CONTROLLERS = None
REGISTERED_TASKS = None
ALL_SENSOR_MODALITIES = None

# Create app as a global reference so any submodule can access it
if not (os.getenv("OMNIGIBSON_NO_OMNIVERSE", 'False').lower() in ('true', '1', 't')):
app = OmniApp(
{
"headless": gm.HEADLESS,
},
debug=gm.DEBUG,
)

# Next import must be simulator
sim = None
from omnigibson.simulator import Simulator
# Helper functions for starting omnigibson
def print_save_usd_warning(_):
logging.warning("Exporting individual USDs has been disabled in OG due to copyrights.")

# Create simulator (this is a singleton so it's okay that it's global)
sim = Simulator()

def create_app():
global app
from omni.isaac.kit import SimulationApp
app = SimulationApp({"headless": gm.HEADLESS})
import omni
def print_save_usd_warning(_):
logging.warning("Exporting individual USDs has been disabled in OG due to copyrights.")

# Possibly hide windows if in debug mode
if not gm.DEBUG:
hide_window_names = ["Console", "Main ToolBar", "Stage", "Layer", "Property", "Render Settings", "Content",
"Flow", "Semantics Schema Editor"]
for name in hide_window_names:
window = omni.ui.Workspace.get_window(name)
if window is not None:
window.visible = False
app.update()

omni.kit.widget.stage.context_menu.ContextMenu.save_prim = print_save_usd_warning

return app


def create_sim():
global sim
from omnigibson.simulator import Simulator
sim = Simulator()
return sim


def start():
global app, sim, Environment, REGISTERED_SCENES, REGISTERED_OBJECTS, REGISTERED_ROBOTS, REGISTERED_CONTROLLERS, \
REGISTERED_TASKS, ALL_SENSOR_MODALITIES

# First create the app, then create the sim
app = create_app()
sim = create_sim()

# Import any remaining items we want to access directly from the main omnigibson import
from omnigibson.envs import Environment
from omnigibson.scenes import REGISTERED_SCENES
Expand All @@ -106,9 +134,17 @@ def print_save_usd_warning(_):
from omnigibson.controllers import REGISTERED_CONTROLLERS
from omnigibson.tasks import REGISTERED_TASKS
from omnigibson.sensors import ALL_SENSOR_MODALITIES
return app, sim, Environment, REGISTERED_SCENES, REGISTERED_OBJECTS, REGISTERED_ROBOTS, REGISTERED_CONTROLLERS, \
REGISTERED_TASKS, ALL_SENSOR_MODALITIES


# Automatically start omnigibson's omniverse backend unless explicitly told not to
if not (os.getenv("OMNIGIBSON_NO_OMNIVERSE", 'False').lower() in {'true', '1', 't'}):
app, sim, Environment, REGISTERED_SCENES, REGISTERED_OBJECTS, REGISTERED_ROBOTS, REGISTERED_CONTROLLERS, \
REGISTERED_TASKS, ALL_SENSOR_MODALITIES = start()


# Define convenience function for shutting down OmniGibson cleanly
def shutdown():
app.close()
exit(0)
def shutdown():
global app
app.close()
exit(0)
Loading

0 comments on commit cb70ec4

Please sign in to comment.