isaaclab.sim#
Sub-package containing simulation-specific functionalities.
These include:
Ability to spawn different objects and materials into Omniverse
Define and modify various schemas on USD prims
Converters to obtain USD file from other file formats (such as URDF, OBJ, STL, FBX)
Utility class to control the simulator
Note
Currently, only a subset of all possible schemas and prims in Omniverse are supported. We are expanding the these set of functions on a need basis. In case, there are specific prims or schemas that you would like to include, please open an issue on GitHub as a feature request elaborating on the required application.
To make it convenient to use the module, we recommend importing the module as follows:
import isaaclab.sim as sim_utils
Submodules
Sub-module containing converters for converting various file types to USD. |
|
Sub-module containing utilities for schemas used in Omniverse. |
|
Sub-module containing utilities for creating prims in Omniverse. |
|
Utilities built around USD operations. |
Classes
Controls simulation lifecycle including physics stepping and rendering. |
|
Configuration for simulation physics. |
|
Configuration for Omniverse RTX Renderer. |
Functions
Context manager to build a simulation context with the provided settings. |
Simulation Context#
- class isaaclab.sim.SimulationContext[source]#
Bases:
objectControls simulation lifecycle including physics stepping and rendering.
This singleton class manages:
Physics configuration (time-step, solver parameters via
isaaclab.sim.SimulationCfg)Simulation state (play, pause, step, stop)
Rendering and visualization
The singleton instance can be accessed using the
instance()class method.Methods:
__new__(cls[, cfg])Enforce singleton pattern.
instance()Get the singleton instance, or None if not created.
__init__([cfg])Initialize the simulation context.
Returns the physics time step.
Resolve visualizer types from config or CLI settings.
Initialize visualizers from SimulationCfg.visualizer_cfgs.
Return scene-data requirements resolved from visualizers/renderers.
update_scene_data_requirements(requirements)Update scene-data requirements.
Return optional prebuilt visualizer artifact.
Set or clear the optional visualizer prebuilt artifact.
Clear optional prebuilt artifact in provider context.
Return rendering dt, allowing visualizer-specific override.
set_camera_view(eye, target)Set camera view on all visualizers that support it.
forward()Update kinematics without stepping physics.
reset([soft])Reset the simulation.
step([render])Step physics and optionally render.
render([mode])Update visualizers and render the scene.
Update visualizers without triggering renderer/GUI.
play()Start or resume the simulation.
pause()Pause the simulation (can be resumed with play).
stop()Stop the simulation completely.
Returns True if simulation is playing (not paused or stopped).
Returns True if simulation is stopped (not just paused).
set_setting(name, value)Set a setting value.
get_setting(name)Get a setting value.
Clean up resources and clear the singleton instance.
Clear the current USD stage (preserving /World and PhysicsScene).
Attributes:
Returns the physics simulation view.
Returns the device on which the simulation is running.
Returns the tensor backend being used ("numpy" or "torch").
Returns whether GUI is enabled (cached at init).
Returns whether offscreen rendering is enabled (cached at init).
Returns whether rendering is active (GUI, RTX sensors, visualizers, or XR).
Returns the list of active visualizers.
- static __new__(cls, cfg: SimulationCfg | None = None)[source]#
Enforce singleton pattern.
- classmethod instance() SimulationContext | None[source]#
Get the singleton instance, or None if not created.
- __init__(cfg: SimulationCfg | None = None)[source]#
Initialize the simulation context.
- Parameters:
cfg – Simulation configuration. Defaults to None (uses default config).
- property physics_sim_view#
Returns the physics simulation view.
- property has_offscreen_render: bool#
Returns whether offscreen rendering is enabled (cached at init).
- property is_rendering: bool#
Returns whether rendering is active (GUI, RTX sensors, visualizers, or XR).
- get_scene_data_requirements() SceneDataRequirement[source]#
Return scene-data requirements resolved from visualizers/renderers.
- update_scene_data_requirements(requirements: SceneDataRequirement) None[source]#
Update scene-data requirements.
- get_scene_data_visualizer_prebuilt_artifact() VisualizerPrebuiltArtifacts | None[source]#
Return optional prebuilt visualizer artifact.
- set_scene_data_visualizer_prebuilt_artifact(artifact: VisualizerPrebuiltArtifacts | None) None[source]#
Set or clear the optional visualizer prebuilt artifact.
The scene (clone flow) writes this once, and providers can read it during initialization as a fast path.
- clear_scene_data_visualizer_prebuilt_artifact() None[source]#
Clear optional prebuilt artifact in provider context.
- set_camera_view(eye: tuple, target: tuple) None[source]#
Set camera view on all visualizers that support it.
- reset(soft: bool = False) None[source]#
Reset the simulation.
- Parameters:
soft – If True, skip full reinitialization.
- step(render: bool = True) None[source]#
Step physics and optionally render.
- Parameters:
render – Whether to render the scene after stepping. Defaults to True.
Simulation Configuration#
- class isaaclab.sim.SimulationCfg[source]#
Bases:
objectConfiguration for simulation physics.
This class contains the main simulation parameters including physics time-step, gravity, device settings, and physics backend configuration.
Attributes:
The device to run the simulation on.
The physics simulation time-step (in seconds).
The gravity vector (in m/s^2).
The prim path where the USD PhysicsScene is created.
Default physics material settings for rigid bodies.
Enable/disable reading of physics buffers directly.
The number of physics simulation steps per rendering step.
Enable/disable scene query support for collision shapes.
Physics manager configuration.
Render settings.
If stage is first created in memory.
The logging level.
Save logs to a file.
The directory to save the logs to.
The visualizer configuration(s).
- device: str#
The device to run the simulation on. Default is
"cuda:0".Valid options are:
"cpu": Use CPU."cuda": Use GPU, where the device ID is inferred fromAppLauncher’s config."cuda:N": Use GPU, where N is the device ID. For example, “cuda:0”.
- physics_prim_path: str#
The prim path where the USD PhysicsScene is created. Default is “/physicsScene”.
- physics_material: RigidBodyMaterialCfg#
Default physics material settings for rigid bodies. Default is RigidBodyMaterialCfg.
The physics engine defaults to this physics material for all the rigid body prims that do not have any physics material specified on them.
The material is created at the path:
{physics_prim_path}/defaultMaterial.
- use_fabric: bool#
Enable/disable reading of physics buffers directly. Default is True.
When running the simulation, updates in the states in the scene is normally synchronized with USD. This leads to an overhead in reading the data and does not scale well with massive parallelization. This flag allows disabling the synchronization and reading the data directly from the physics buffers.
It is recommended to set this flag to
Truewhen running the simulation with a large number of primitives in the scene.
- enable_scene_query_support: bool#
Enable/disable scene query support for collision shapes. Default is False.
This flag allows performing collision queries (raycasts, sweeps, and overlaps) on actors and attached shapes in the scene. This is useful for implementing custom collision detection logic outside of the physics engine.
If set to False, the physics engine does not create the scene query manager and the scene query functionality will not be available. However, this provides some performance speed-up.
Note
This flag is overridden to True inside the
SimulationContextclass when running the simulation with the GUI enabled. This is to allow certain GUI features to work properly.
- physics: PhysicsCfg | None#
Physics manager configuration. Default is None (uses PhysxCfg()).
This configuration determines which physics manager to use. Override with a different config (e.g., NewtonManagerCfg) to use a different physics backend.
- create_stage_in_memory: bool#
If stage is first created in memory. Default is False.
Creating the stage in memory can reduce start-up time.
- logging_level: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']#
The logging level. Default is “WARNING”.
- log_dir: str | None#
The directory to save the logs to. Default is None.
If
save_logs_to_fileis True, the logs will be saved to the directory specified bylog_dir. If None, the logs will be saved to the temp directory.
- class isaaclab.sim.RenderCfg[source]#
Bases:
objectConfiguration for Omniverse RTX Renderer.
These parameters are used to configure the Omniverse RTX Renderer.
The defaults for IsaacLab are set in the experience files:
apps/isaaclab.python.rendering.kit: Setting used when running the simulation with the GUI enabled.apps/isaaclab.python.headless.rendering.kit: Setting used when running the simulation in headless mode.
Setting any value here will override the defaults of the experience files.
For more information, see the Omniverse RTX Renderer documentation.
Attributes:
Enables translucency for specular transmissive surfaces such as glass.
Enables reflections at the cost of some performance.
Enables Diffused Global Illumination at the cost of some performance.
Selects the anti-aliasing mode to use.
"Enables the use of DLSS-G.
Enables the use of a DL denoiser.
For DLSS anti-aliasing, selects the performance/quality tradeoff mode.
Enable direct light contributions from lights.
Defines the Direct Lighting samples per pixel.
Enables shadows at the cost of performance.
Enables ambient occlusion at the cost of some performance.
Selects how to sample the Dome Light.
A general dictionary for users to supply all carb rendering settings with native names.
The rendering mode.
- enable_translucency: bool | None#
Enables translucency for specular transmissive surfaces such as glass.
This comes at the cost of some performance. Default is False. This is set by the variable:
/rtx/translucency/enabled.
- enable_reflections: bool | None#
Enables reflections at the cost of some performance. Default is False.
This is set by the variable:
/rtx/reflections/enabled.
- enable_global_illumination: bool | None#
Enables Diffused Global Illumination at the cost of some performance. Default is False.
This is set by the variable:
/rtx/indirectDiffuse/enabled.
- antialiasing_mode: Literal['Off', 'FXAA', 'DLSS', 'TAA', 'DLAA'] | None#
Selects the anti-aliasing mode to use. Defaults to DLSS.
DLSS: Boosts performance by using AI to output higher resolution frames from a lower resolution input. DLSS samples multiple lower resolution images and uses motion data and feedback from prior frames to reconstruct native quality images.
DLAA: Provides higher image quality with an AI-based anti-aliasing technique. DLAA uses the same Super Resolution technology developed for DLSS, reconstructing a native resolution image to maximize image quality.
This is set by the variable:
/rtx/post/dlss/execMode.
- enable_dlssg: bool | None#
“Enables the use of DLSS-G. Default is False.
DLSS Frame Generation boosts performance by using AI to generate more frames. DLSS analyzes sequential frames and motion data to create additional high quality frames.
Note
This feature requires an Ada Lovelace architecture GPU. Enabling this feature also enables additional thread-related activities, which can hurt performance.
This is set by the variable:
/rtx-transient/dlssg/enabled.
- enable_dl_denoiser: bool | None#
Enables the use of a DL denoiser.
The DL denoiser can help improve the quality of renders, but comes at a cost of performance.
This is set by the variable:
/rtx-transient/dldenoiser/enabled.
- dlss_mode: Literal[0, 1, 2, 3] | None#
For DLSS anti-aliasing, selects the performance/quality tradeoff mode. Default is 0.
Valid values are:
0 (Performance)
1 (Balanced)
2 (Quality)
3 (Auto)
This is set by the variable:
/rtx/post/dlss/execMode.
- enable_direct_lighting: bool | None#
Enable direct light contributions from lights. Default is False.
This is set by the variable:
/rtx/directLighting/enabled.
- samples_per_pixel: int | None#
Defines the Direct Lighting samples per pixel. Default is 1.
A higher value increases the direct lighting quality at the cost of performance.
This is set by the variable:
/rtx/directLighting/sampledLighting/samplesPerPixel.
- enable_shadows: bool | None#
Enables shadows at the cost of performance. Defaults to True.
When disabled, lights will not cast shadows.
This is set by the variable:
/rtx/shadows/enabled.
- enable_ambient_occlusion: bool | None#
Enables ambient occlusion at the cost of some performance. Default is False.
This is set by the variable:
/rtx/ambientOcclusion/enabled.
- dome_light_upper_lower_strategy: Literal[0, 3, 4] | None#
Selects how to sample the Dome Light. Default is 0. For more information, refer to the documentation.
Valid values are:
0: Image-Based Lighting (IBL) - Most accurate even for high-frequency Dome Light textures. Can introduce sampling artifacts in real-time mode.
3: Limited Image-Based Lighting - Only sampled for reflection and refraction. Fastest, but least accurate. Good for cases where the Dome Light contributes less than other light sources.
4: Approximated Image-Based Lighting - Fast and artifacts-free sampling in real-time mode but only works well with a low-frequency texture (e.g., a sky with no sun disc where the sun is instead a separate Distant Light). Requires enabling Direct Lighting denoiser.
This is set by the variable:
/rtx/domeLight/upperLowerStrategy.
- carb_settings: dict[str, Any] | None#
A general dictionary for users to supply all carb rendering settings with native names.
The keys of the dictionary can be formatted like a carb setting, .kit file setting, or python variable. For instance, a key value pair can be
/rtx/translucency/enabled: False(carb),rtx.translucency.enabled: False(.kit), orrtx_translucency_enabled: False(python).
Simulation Context Builder#
- simulation_context.build_simulation_context(gravity_enabled: bool = True, device: str = 'cuda:0', dt: float = 0.01, sim_cfg: SimulationCfg | None = None, add_ground_plane: bool = False, add_lighting: bool = False, auto_add_lighting: bool = False, visualizers: list[str] | None = None) Iterator[SimulationContext]#
Context manager to build a simulation context with the provided settings.
- Parameters:
create_new_stage – Whether to create a new stage. Defaults to True.
gravity_enabled – Whether to enable gravity. Defaults to True.
device – Device to run the simulation on. Defaults to “cuda:0”.
dt – Time step for the simulation. Defaults to 0.01.
sim_cfg – SimulationCfg to use. Defaults to None.
add_ground_plane – Whether to add a ground plane. Defaults to False.
add_lighting – Whether to add a dome light. Defaults to False.
auto_add_lighting – Whether to auto-add lighting if GUI present. Defaults to False.
visualizers – List of visualizer backend keys to enable (e.g.
["kit", "newton", "rerun"]). Valid types:"kit","newton","rerun","viser". When provided, sets the/isaaclab/visualizer/typessetting so the existing visualizer resolution machinery picks them up. Defaults to None.
- Yields:
The simulation context to use for the simulation.