isaaclab.visualizers#
Visualizer configurations and implementations.
Custom visualizers implement initialize(sim, *, cameras) and reset(soft=False).
Initialization receives the simulation owner explicitly. Call super().initialize(sim, cameras=cameras)
to retain the simulation as self._sim and bind scene data. Resolve backend-specific resources in
the implementation; core lifecycle dispatch does not import or construct them. Hard resets can reacquire
resources through self._sim.get_or_create_backend(...) and access the stage through self._sim.stage.
Rendering uses the resolved resources.
Additional Public Classes#
The following classes are part of the public isaaclab.visualizers API.
Base class for all visualizer backends. |
|
Keyboard input from a focused visualizer window. |
|
A listener subscribed with |
|
View, window, and scene settings independent of the selected visualizer backend. |
|
Implementation and backend-specific options for a visualizer. |
|
Native window presentation, independent of the camera's image resolution. |
|
Initial pose and optics for an interactive perspective camera. |
|
Select an existing scene camera's output as the visualizer's main view. |
|
A shared image selection consumed by windows and recorders. |
|
Own one composed GPU image shared by its display and recording consumers. |
- class isaaclab.visualizers.BaseVisualizer[source]#
Bases:
ABCBase class for all visualizer backends.
Lifecycle: __init__() -> initialize() -> step() (repeated) -> close()
Methods:
- __init__(cfg: VisualizerCfg)[source]#
Initialize visualizer with config.
- Parameters:
cfg¶ – Visualizer configuration.
- classmethod __new__(*args, **kwargs)#
- class isaaclab.visualizers.KeyEventSource[source]#
Keyboard input from a focused visualizer window.
Obtained from
key_event_source. For every backend:Subscribing, closing and every callback happen on the thread that steps the visualizer.
on_keyreceives the window’s presses and releases as W3CKeyboardEvent.codestrings. Key repeat can arrive as further presses, and a release can arrive without its press (e.g. a key pressed in the visualizer’s UI), so a listener tracks the keys it holds.on_focus_lostruns when the window stops delivering keys: it lost focus, the visualizer’s UI took the keyboard, or the source closed. The listener treats every held key as released.A listener that raises is logged and does not affect other listeners.
Closing the source delivers a final focus loss to every listener; afterwards
add_key_listener()raisesRuntimeError.
The visualizer connects native events when its window initializes and closes the source before the window closes. Backend bridges report events through
_emit_key()and_emit_focus_lost(); adding or removing a listener never changes native window resources.Methods:
__init__()add_key_listener(on_key, on_focus_lost)Subscribe to key presses and releases from the initialized window.
close()Close every subscription and deliver a final focus loss to its listener.
__new__(*args, **kwargs)Attributes:
Whether the source was closed.
- add_key_listener(on_key: Callable[[str, bool], None], on_focus_lost: Callable[[], None]) KeyboardSubscription[source]#
Subscribe to key presses and releases from the initialized window.
- Parameters:
- Returns:
The subscription. Close it to unsubscribe.
- Raises:
RuntimeError – If the source is closed.
- classmethod __new__(*args, **kwargs)#
- class isaaclab.visualizers.KeyboardSubscription[source]#
A listener subscribed with
KeyEventSource.add_key_listener().Close it (or use it as a context manager) to unsubscribe. Closing is idempotent and delivers no final focus loss: the listener chose to leave.
Methods:
Attributes:
Whether the subscription no longer receives callbacks.
- __init__(source: KeyEventSource, on_key: Callable[[str, bool], None], on_focus_lost: Callable[[], None]) None[source]#
- classmethod __new__(*args, **kwargs)#
- isaaclab.visualizers.add_key_callbacks(visualizers: Sequence[BaseVisualizer], callbacks: Mapping[str, Callable[[], None]]) Callable[[], None][source]#
Call
callbacks[key]whenkeyis pressed in a visualizer window, e.g. for a script’s hotkeys.Keys are letters or digits (
"N","1") or W3CKeyboardEvent.codestrings ("Escape"). Key repeat is not a press, and a press reported by several visualizers (Kit visualizers share the app window) fires once. The callbacks end when the visualizers close, or when the returned function is called.
- class isaaclab.visualizers.VisualizerCfg[source]#
Bases:
objectView, window, and scene settings independent of the selected visualizer backend.
Methods:
- classmethod __new__(*args, **kwargs)#
- __init__(backend: ~isaaclab.visualizers.visualizer_cfg.VisualizerBackendCfg | list[~isaaclab.visualizers.visualizer_cfg.VisualizerBackendCfg] = <factory>, view: ~isaaclab.visualizers.visualizer_cfg.ImageViewCfg | None = <factory>, window: ~isaaclab.visualizers.visualizer_cfg.WindowCfg = <factory>, headless: bool = <factory>, cameras: list[~isaaclab.visualizers.visualizer_cfg.PerspectiveCameraCfg | ~isaaclab.visualizers.visualizer_cfg.SceneCameraCfg] | None = <factory>, eye: tuple[float, float, float] = <factory>, lookat: tuple[float, float, float] = <factory>, focal_length: float = <factory>, background_color: tuple[float, float, float] | None = <factory>, streaming_view: bool = <factory>, streaming_sensor_prim_path: str | None = <factory>, streaming_envs: int | list[int] = <factory>, streaming_gt_types: tuple[str, ...] = <factory>, streaming_depth_min: float = <factory>, streaming_depth_max: float = <factory>, max_visible_envs: int | None = <factory>, visible_env_indices: list[int] | None = <factory>, randomly_sample_visible_envs: bool = <factory>, enable_markers: bool = <factory>, enable_live_plots: bool = <factory>, live_plots_update_interval: int = <factory>) None#
- class isaaclab.visualizers.VisualizerBackendCfg[source]#
Bases:
objectImplementation and backend-specific options for a visualizer.
Methods:
- classmethod __new__(*args, **kwargs)#
- class isaaclab.visualizers.PerspectiveCameraCfg[source]#
Bases:
objectInitial pose and optics for an interactive perspective camera.
Newton RTX launch preparation expands this declaration into a scene CameraCfg. Newton GL uses its native viewer camera.
Methods:
- classmethod __new__(*args, **kwargs)#
- class isaaclab.visualizers.SceneCameraCfg[source]#
Bases:
objectSelect an existing scene camera’s output as the visualizer’s main view.
This does not create a sensor. Declare its pose, optics, and renderer in the scene’s CameraCfg.
Methods:
- classmethod __new__(*args, **kwargs)#
- class isaaclab.visualizers.ImageViewCfg[source]#
Bases:
objectA shared image selection consumed by windows and recorders.
Reusing this declaration shares one runtime view within a simulation, including across copies of an environment configuration. Use
isaaclab.utils.replace()to declare an independent view.Methods:
- classmethod __new__(*args, **kwargs)#
- class isaaclab.visualizers.ImageView[source]#
Own one composed GPU image shared by its display and recording consumers.
The scene retains ownership of sensors and their capture cadence. Perspective producers write device pixels through
render. Reading twice for the same frame reuses the composed image; onlyread_rgb()transfers pixels to the host.Methods:
__init__(cfg, *[, camera])Bind a view declaration to a scene sensor or an initially unbound perspective producer.
read(frame_id)Return native RGB/RGBA perspective pixels or composed uint8 [H, W, 4] sensor tiles; None for no rows.
read_rgb(frame_id)Download the composed frame once for CPU encoders or network transports.
Invalidate cached pixels after camera movement, a source update, or a simulation reset.
__new__(*args, **kwargs)- __init__(cfg: ImageViewCfg, *, camera: Camera | BaseRayCasterCamera | None = None) None[source]#
Bind a view declaration to a scene sensor or an initially unbound perspective producer.
- read(frame_id: int | float) array | None[source]#
Return native RGB/RGBA perspective pixels or composed uint8 [H, W, 4] sensor tiles; None for no rows.
- read_rgb(frame_id: int | float) ndarray | None[source]#
Download the composed frame once for CPU encoders or network transports.
- invalidate() None[source]#
Invalidate cached pixels after camera movement, a source update, or a simulation reset.
- classmethod __new__(*args, **kwargs)#