[isaacsim.core.simulation_manager] Isaac Sim Core Simulation Manager#
Version: 1.7.2
The Core Simulation Manager extension provides a set of APIs to control and query the simulation’s state and the different callbacks available.
Enable Extension#
The extension can be enabled (if not already) in one of the following ways:
Define the next entry as an application argument from a terminal.
APP_SCRIPT.(sh|bat) --enable isaacsim.core.simulation_manager
Define the next entry under [dependencies] in an experience (.kit) file or an extension configuration (extension.toml) file.
[dependencies]
"isaacsim.core.simulation_manager" = {}
Open the Window > Extensions menu in a running application instance and search for isaacsim.core.simulation_manager.
Then, toggle the enable control button if it is not already active.
Usage#
Simulation Lifecycle#
The following diagram illustrates the simulation lifecycle and the events taking place within it.
Refer to the SimulationEvent enum for more details.
These events can be triggered/operated from:
The application window, via the Play, Pause, and Stop buttons.
The Core Experimental API
play(),pause(), andstop()utils functions, which are a thin and convenient wrapper around theomni.timelineAPI.
Notes:
[1,2] When the application is played for the first time (or after being stopped), the
SIMULATION_SETUPand theSIMULATION_STARTEDevents are triggered one after the other. TheSIMULATION_SETUPevent is used by the Isaac Sim Core extensions, among other extensions, to prepare the physics tensor entities, for example.Therefore, from the user perspective and to avoid conflicts, it is recommended that the
SIMULATION_STARTEDevent be used to carry out custom preparatory procedures just before the simulation progresses rather than theSIMULATION_SETUP.
API#
Python API#
Simulation event types. |
|
This class provide functions that take care of many time-related events such as warm starting simulation in order for the physics data to be retrievable. |
|
Isaac events types. |
- class SimulationEvent(
- value,
- names=<not given>,
- *values,
- module=None,
- qualname=None,
- type=None,
- start=1,
- boundary=None,
Simulation event types.
- PHYSICS_POST_STEP = 'isaacsim.simulation.physics_post_step'#
Event triggered after a physics step is performed.
- PHYSICS_PRE_STEP = 'isaacsim.simulation.physics_pre_step'#
Event triggered before a physics step is performed.
- PRIM_DELETED = 'isaacsim.simulation.prim_deleted'#
Event triggered when a prim is deleted from the stage.
- SIMULATION_PAUSED = 'isaacsim.simulation.paused'#
Event triggered when the simulation is paused.
- SIMULATION_RESUMED = 'isaacsim.simulation.resumed'#
Event triggered when the simulation is resumed.
The simulation is resumed when the application is played again after being paused.
- SIMULATION_SETUP = 'isaacsim.simulation.simulation_setup'#
Event triggered when the simulation setup is complete.
The simulation setup is complete once 1) the application has been played and 2) a warm-up step has been performed. The warm-up step ensures that:
The physics engine creates and initializes its internal state for the attached stage.
An entry point to the physics engine is created through
omni.physics.tensors.
At that point, the simulation is ready to advance.
- SIMULATION_STARTED = 'isaacsim.simulation.started'#
Event triggered when the simulation setup is complete and the simulation is ready to advance.
- SIMULATION_STOPPED = 'isaacsim.simulation.stopped'#
Event triggered when the simulation is stopped.
- class SimulationManager#
Bases:
objectThis class provide functions that take care of many time-related events such as warm starting simulation in order for the physics data to be retrievable. Adding/ removing callback functions that gets triggered with certain events such as a physics step, on post reset, on physics ready..etc.
- classmethod assets_loading() bool#
Checks if textures are loaded.
- Returns:
True if textures are loading and not done yet, otherwise False.
- Return type:
bool
- classmethod deregister_callback(callback_id)#
Deregisters a callback which was previously registered using register_callback.
- Parameters:
callback_id – The ID of the callback returned by register_callback to deregister.
- classmethod enable_all_default_callbacks(
- enable: bool = True,
Enable or disable all default callbacks. Default callbacks are: warm_start, on_stop, post_warm_start, stage_open.
- Parameters:
enable – Whether to enable all callbacks.
- classmethod enable_ccd(
- flag: bool,
- physics_scene: str = None,
Enables Continuous Collision Detection (CCD).
- Parameters:
flag (bool) – enables or disables CCD on the PhysicsScene.
physics_scene (str, optional) – physics scene prim path.
- Raises:
Exception – If the prim path registered in context doesn’t correspond to a valid prim path currently.
- classmethod enable_fabric(enable)#
Enables or disables physics fabric integration and associated settings.
- Parameters:
enable – Whether to enable or disable fabric.
- classmethod enable_fabric_usd_notice_handler(stage_id, flag)#
Enables or disables the fabric usd notice handler.
- Parameters:
stage_id – The stage ID to enable or disable the handler for.
flag – Whether to enable or disable the handler.
- classmethod enable_gpu_dynamics(
- flag: bool,
- physics_scene: str = None,
Enables gpu dynamics pipeline, required for deformables for instance.
- Parameters:
flag (bool) – enables or disables gpu dynamics on the PhysicsScene. If flag is true, CCD is disabled.
physics_scene (str, optional) – physics scene prim path.
- Raises:
Exception – If the prim path registered in context doesn’t correspond to a valid prim path currently.
- classmethod enable_on_stop_callback(enable: bool = True) None#
Enable or disable the on stop callback.
- Parameters:
enable – Whether to enable the callback.
- classmethod enable_post_warm_start_callback(
- enable: bool = True,
Enable or disable the post warm start callback.
Deprecated since version 1.7.0:
ThePHYSICS_WARMUPevent is deprecated. Calling this method will have no effect.- Parameters:
enable – Whether to enable the callback.
- classmethod enable_stablization(
- flag: bool,
- physics_scene: str = None,
Enables additional stabilization pass in the solver.
- Parameters:
flag (bool) – enables or disables stabilization on the PhysicsScene
physics_scene (str, optional) – physics scene prim path.
- Raises:
Exception – If the prim path registered in context doesn’t correspond to a valid prim path currently.
- classmethod enable_stage_open_callback(
- enable: bool = True,
Enable or disable the stage open callback. Note: This also enables/disables the assets loading and loaded callbacks. If disabled, assets_loading() will always return True.
- Parameters:
enable – Whether to enable the callback.
- classmethod enable_usd_notice_handler(flag)#
Enables or disables the usd notice handler.
- Parameters:
flag – Whether to enable or disable the handler.
- classmethod enable_warm_start_callback(
- enable: bool = True,
Enable or disable the warm start callback.
- Parameters:
enable – Whether to enable the callback.
- classmethod get_backend() str#
Get the backend used by the simulation manager.
Deprecated since version 1.7.0:
No replacement is provided, as the core experimental API relies solely on Warp.
- classmethod get_broadphase_type(
- physics_scene: str = None,
Gets current broadcast phase algorithm type.
- Parameters:
physics_scene (str, optional) – physics scene prim path.
- Raises:
Exception – If the prim path registered in context doesn’t correspond to a valid prim path currently.
- Returns:
Broadcast phase algorithm used.
- Return type:
str
- classmethod get_default_callback_status() dict#
Get the status of all default callbacks. Default callbacks are: warm_start, on_stop, post_warm_start, stage_open.
- Returns:
Dictionary with callback names and their enabled status.
- classmethod get_default_physics_scene() str#
- classmethod get_num_physics_steps()#
- classmethod get_physics_dt(physics_scene: str = None) str#
Returns the current physics dt.
- Parameters:
physics_scene (str, optional) – physics scene prim path.
- Raises:
Exception – If the prim path registered in context doesn’t correspond to a valid prim path currently.
- Returns:
physics dt.
- Return type:
float
- classmethod get_physics_sim_device() str#
- classmethod get_physics_sim_view()#
- classmethod get_simulation_time()#
- classmethod get_solver_type(physics_scene: str = None) str#
Gets current solver type.
- Parameters:
physics_scene (str, optional) – physics scene prim path.
- Raises:
Exception – If the prim path registered in context doesn’t correspond to a valid prim path currently.
- Returns:
solver used for simulation.
- Return type:
str
- classmethod is_ccd_enabled(physics_scene: str = None) bool#
Checks if Continuous Collision Detection (CCD) is enabled.
- Parameters:
physics_scene (str, optional) – physics scene prim path.
- Raises:
Exception – If the prim path registered in context doesn’t correspond to a valid prim path currently.
- Returns:
True if CCD is enabled, otherwise False.
- Return type:
bool
- classmethod is_default_callback_enabled(
- callback_name: str,
Check if a specific default callback is enabled. Default callbacks are: warm_start, on_stop, post_warm_start, stage_open.
- Parameters:
callback_name – Name of the callback to check.
- Returns:
Whether the callback is enabled.
- classmethod is_fabric_enabled()#
Check if fabric is enabled.
- Returns:
True if fabric is enabled, otherwise False.
- Return type:
bool
- classmethod is_fabric_usd_notice_handler_enabled(stage_id)#
Checks if fabric usd notice handler is enabled.
- Parameters:
stage_id – The stage ID to check.
- Returns:
True if fabric usd notice handler is enabled, otherwise False.
- Return type:
bool
- classmethod is_gpu_dynamics_enabled(
- physics_scene: str = None,
Checks if Gpu Dynamics is enabled.
- Parameters:
physics_scene (str, optional) – physics scene prim path.
- Raises:
Exception – If the prim path registered in context doesn’t correspond to a valid prim path currently.
- Returns:
True if Gpu Dynamics is enabled, otherwise False.
- Return type:
bool
- classmethod is_paused()#
- classmethod is_simulating()#
- classmethod is_stablization_enabled(
- physics_scene: str = None,
Checks if stabilization is enabled.
- Parameters:
physics_scene (str, optional) – physics scene prim path.
- Raises:
Exception – If the prim path registered in context doesn’t correspond to a valid prim path currently.
- Returns:
True if stabilization is enabled, otherwise False.
- Return type:
bool
- classmethod register_callback(
- callback: Callable,
- event: SimulationEvent | IsaacEvents,
- order: int = 0,
- **kwargs,
Register/subscribe a callback to be triggered when a specific simulation event occurs.
Warning
The parameter
nameis not longer supported. A warning message will be logged if it is defined. Future versions will completely remove it. At that time, defining it will result in an exception.- Parameters:
callback – The callback function to register.
event – The simulation event to subscribe to.
order – The subscription order. Callbacks registered within the same order will be triggered in the order they were registered.
- Returns:
The unique identifier of the callback subscription.
- Raises:
ValueError – If event is invalid.
- classmethod set_backend(val: str) None#
Set the backend used by the simulation manager.
Deprecated since version 1.7.0:
No replacement is provided, as the core experimental API relies solely on Warp.
- classmethod set_broadphase_type(
- val: str,
- physics_scene: str = None,
Broadcast phase algorithm used in simulation.
- Parameters:
val (str) – type of broadcasting to be used, can be “MBP”.
physics_scene (str, optional) – physics scene prim path.
- Raises:
Exception – If the prim path registered in context doesn’t correspond to a valid prim path currently.
- classmethod set_default_physics_scene(
- physics_scene_prim_path: str,
- classmethod set_physics_dt(
- dt: float = 0.016666666666666666,
- physics_scene: str = None,
Sets the physics dt on the physics scene provided.
- Parameters:
dt (float, optional) – physics dt. Defaults to 1.0/60.0.
physics_scene (str, optional) – physics scene prim path. Defaults to first physics scene found in the stage.
- Raises:
RuntimeError – If the simulation is running/playing and dt is being set.
Exception – If the prim path registered in context doesn’t correspond to a valid prim path currently.
ValueError – If the dt is not in the range [0.0, 1.0].
- classmethod set_solver_type(
- solver_type: str,
- physics_scene: str = None,
solver used for simulation.
- Parameters:
solver_type (str) – can be “TGS” or “PGS”.
physics_scene (str, optional) – physics scene prim path.
- Raises:
Exception – If the prim path registered in context doesn’t correspond to a valid prim path currently.
- classmethod step(
- *,
- steps: int = 1,
- callback: Callable[[int, int], bool | None] | None = None,
- update_fabric: bool = False,
Step the physics simulation.
- Parameters:
steps – Number of steps to perform.
callback – Optional callback function to call after each step. The function should take two arguments: the current step number and the total number of steps. If no return value is provided, the internal loop will run for the specified number of steps. However, if the function returns
False, no more steps will be performed.update_fabric – Whether to update fabric with the latest physics results after each step.
- Raises:
ValueError – If the fabric is not enabled and
update_fabricis set to True.
- class IsaacEvents(
- value,
- names=<not given>,
- *values,
- module=None,
- qualname=None,
- type=None,
- start=1,
- boundary=None,
Bases:
EnumIsaac events types.
Deprecated since version 1.7.0: Use
SimulationEventenum instead.- PHYSICS_READY = 'isaac.physics_ready'#
Physics ready.
Deprecated since version 1.7.0: Use
SimulationEvent’sSIMULATION_STARTEDinstead.
- PHYSICS_WARMUP = 'isaac.physics_warmup'#
Physics warm-up.
Deprecated since version 1.7.0: Use
SimulationEvent’sSIMULATION_SETUPinstead.
- POST_PHYSICS_STEP = 'isaac.post_physics_step'#
Post physics step.
Deprecated since version 1.7.0: Use
SimulationEvent’sPHYSICS_POST_STEPinstead.
- POST_RESET = 'isaac.post_reset'#
Post reset.
Deprecated since version 1.7.0:
No replacement is provided, as the core experimental API does not use such event.
- PRE_PHYSICS_STEP = 'isaac.pre_physics_step'#
Pre physics step.
Deprecated since version 1.7.0: Use
SimulationEvent’sPHYSICS_PRE_STEPinstead.
- PRIM_DELETION = 'isaac.prim_deletion'#
Prim deletion.
Deprecated since version 1.7.0: Use
SimulationEvent’sPRIM_DELETEDinstead.
- SIMULATION_VIEW_CREATED = 'isaac.simulation_view_created'#
Simulation view created.
Deprecated since version 1.7.0: Use
SimulationEvent’sSIMULATION_SETUPinstead.
- TIMELINE_STOP = 'isaac.timeline_stop'#
Timeline stop.
Deprecated since version 1.7.0: Use
SimulationEvent’sSIMULATION_STOPPEDinstead.