What's the difference between simulation_app.update(), world.step() and rep.orchestrator.step()?

When I test this example code, the three step functions almost get same results, except that rep.orchestrator.step() is much slower.

#launch Isaac Sim before any other imports
#default first two lines in any standalone application
from isaacsim import SimulationApp
simulation_app = SimulationApp({"headless": False}) # we can also run as headless.

from omni.isaac.core import World
from omni.isaac.core.objects import DynamicCuboid
import numpy as np
import omni.replicator.core as rep


world = World()
world.scene.add_default_ground_plane()
fancy_cube =  world.scene.add(
    DynamicCuboid(
        prim_path="/World/random_cube",
        name="fancy_cube",
        position=np.array([0, 0, 1.0]),
        scale=np.array([0.5015, 0.5015, 0.5015]),
        color=np.array([0, 0, 1.0]),
    ))
# Resetting the world needs to be called before querying anything related to an articulation specifically.
# Its recommended to always do a reset after adding your assets, for physics handles to be propagated properly
world.reset()
for i in range(500):
    position, orientation = fancy_cube.get_world_pose()
    linear_velocity = fancy_cube.get_linear_velocity()
    # will be shown on terminal
    print("Cube position is : " + str(position))
    print("Cube's orientation is : " + str(orientation))
    print("Cube's linear velocity is : " + str(linear_velocity))

    # we have control over stepping physics and rendering in this workflow
    # things run in sync
    world.step(render=True) # execute one physics step and one rendering step
    # simulation_app.update() # execute one rendering step
    # rep.orchestrator.step()

simulation_app.close() # close Isaac Sim**strong text**

Thank you for posting this. These functions serve somewhat different purposes. Specifically, from the docs:

World.step: Step the physics simulation while rendering or without. This class inherits from SimulationContext.
SimulationApp.update: Convenience function to step the application forward one frame.
Rep.orchestrator.step: Replicator step one frame (standalone workflow). Synchronous step function: only use from standalone workflow (controlling Kit app from python). If Replicator is not yet started, an initialization step is first taken to ensure the necessary settings are set for data capture. The renderer will then render as many subframes as required by current settings and schedule a frame to be captured by any active annotators and writers.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.