Standalone code for larger projects

Hi,

I’m running standalone with some sucess but looking what is the best workflow to create indvidual modules that run within the standalone workflow?

When we run the extensions we can have multiple modules using the init.py method

image

In the standalone examples we only have one file which uses the

from isaacsim import SimulationApp

method

Should I use the

Start the omniverse application

simulation_app = SimulationApp(CONFIG)
from omni.isaac.core.utils.extensions import enable_extension

Enable the layers and stage windows in the UI

enable_extension(“omni.kit.widget.stage”)
enable_extension(“omni.kit.widget.layers”)
simulation_app.update()

Example being

enable_extension(“My.folder.ext”)

where ext would be the foilder that contains My custom ext?

Or can I just use the init.py method in the smae way as extentions without having to build extensions?

Run the simulation loop

for i in range(10000):
# Update positions every 60 frames
if i % 60 == 0:
for path in control_points[“target”]:
xform_prim = stage.GetPrimAtPath(path)
pos = np.random.uniform(-10, 10, size=3)
xform = UsdGeom.Xform(xform_prim)
xform.ClearXformOpOrder() # Clear previous operations
xform.AddTranslateOp().Set(Gf.Vec3f(*pos.astype(float)))

# Update the simulation
simulation_app.update()

In this example the sim loop runs for 10000 steps and closes. So as I understand it, my runtime is within this loop. I’d like to get my structure correct before I make my code base too big so its managable. Obvoiusly I need the modules callable inside the loop to run the individual funcitons?

Thanks

Scott

Yes, but nobody knows what you are going to do or how large your project can get.
A simulation should contain a finite set of tasks and actions.
Moreover, when you choose the standalone workflow, you limit your interaction with your simulation. Why do you need the UI when using standalone workflow? to avoid asynchronous programming?

No my question is about using the init method or similar. I’m already using standalone as it’s a SDG application

Rather than have a single script having multiple scripts to break it up