omni.isaac.lab.envs.ui#
Sub-module providing UI window implementation for environments.
The UI elements are used to control the environment and visualize the state of the environment. This includes functionalities such as tracking a robot in the simulation, toggling different debug visualization tools, and other user-defined functionalities.
Classes
Window manager for the basic environment. |
|
Window manager for the RL environment. |
|
This class handles controlling the camera associated with a viewport in the simulator. |
Base Environment UI#
- class omni.isaac.lab.envs.ui.BaseEnvWindow[source]#
Window manager for the basic environment.
This class creates a window that is used to control the environment. The window contains controls for rendering, debug visualization, and other environment-specific UI elements.
Users can add their own UI elements to the window by using the with context manager. This can be done either be inheriting the class or by using the env.window object directly from the standalone execution script.
- Example for adding a UI element from the standalone execution script:
>>> with env.window.ui_window_elements["main_vstack"]: >>> ui.Label("My UI element")
Methods:
__init__
(env[, window_name])Initialize the window.
- __init__(env: ManagerBasedEnv, window_name: str = 'IsaacLab')[source]#
Initialize the window.
- Parameters:
env – The environment object.
window_name – The name of the window. Defaults to “IsaacLab”.
Config Based RL Environment UI#
- class omni.isaac.lab.envs.ui.ManagerBasedRLEnvWindow[source]#
Bases:
BaseEnvWindow
Window manager for the RL environment.
On top of the basic environment window, this class adds controls for the RL environment. This includes visualization of the command manager.
Methods:
__init__
(env[, window_name])Initialize the window.
- __init__(env: ManagerBasedRLEnv, window_name: str = 'IsaacLab')[source]#
Initialize the window.
- Parameters:
env – The environment object.
window_name – The name of the window. Defaults to “IsaacLab”.
Viewport Camera Controller#
- class omni.isaac.lab.envs.ui.ViewportCameraController[source]#
This class handles controlling the camera associated with a viewport in the simulator.
It can be used to set the viewpoint camera to track different origin types:
world: the center of the world (static)
env: the center of an environment (static)
asset_root: the root of an asset in the scene (e.g. tracking a robot moving in the scene)
On creation, the camera is set to track the origin type specified in the configuration.
For the
asset_root
origin type, the camera is updated at each rendering step to track the asset’s root position. For this, it registers a callback to the post update event stream from the simulation app.Methods:
__init__
(env, cfg)Initialize the ViewportCameraController.
set_view_env_index
(env_index)Sets the environment index for the camera view.
Updates the viewer's origin to the origin of the world which is (0, 0, 0).
Updates the viewer's origin to the origin of the selected environment.
update_view_to_asset_root
(asset_name)Updates the viewer's origin based upon the root of an asset in the scene.
update_view_location
([eye, lookat])Updates the camera view pose based on the current viewer origin and the eye and lookat positions.
Attributes:
The configuration for the viewer.
- __init__(env: ManagerBasedEnv | DirectRLEnv, cfg: ViewerCfg)[source]#
Initialize the ViewportCameraController.
- Parameters:
env – The environment.
cfg – The configuration for the viewport camera controller.
- Raises:
ValueError – If origin type is configured to be “env” but
cfg.env_index
is out of bounds.ValueError – If origin type is configured to be “asset_root” but
cfg.asset_name
is unset.
- set_view_env_index(env_index: int)[source]#
Sets the environment index for the camera view.
- Parameters:
env_index – The index of the environment to set the camera view to.
- Raises:
ValueError – If the environment index is out of bounds. It should be between 0 and num_envs - 1.
- update_view_to_world()[source]#
Updates the viewer’s origin to the origin of the world which is (0, 0, 0).
- update_view_to_env()[source]#
Updates the viewer’s origin to the origin of the selected environment.
- update_view_to_asset_root(asset_name: str)[source]#
Updates the viewer’s origin based upon the root of an asset in the scene.
- Parameters:
asset_name – The name of the asset in the scene. The name should match the name of the asset in the scene.
- Raises:
ValueError – If the asset is not in the scene.
- update_view_location(eye: Sequence[float] | None = None, lookat: Sequence[float] | None = None)[source]#
Updates the camera view pose based on the current viewer origin and the eye and lookat positions.
- Parameters:
eye – The eye position of the camera. If None, the current eye position is used.
lookat – The lookat position of the camera. If None, the current lookat position is used.