可视化#
Isaac Lab 提供了 5 种可视化器,用于实时查看和调试仿真。渲染器负责生成训练所需的传感器数据,而可视化器则提供快速、轻量的画面反馈,方便人工观察和录制。可视化器也可以通过相机流面板显示同样的传感器数据。
本页介绍:
五种可视化器运行 Isaac-Velocity-Flat-AnymalD,并使用环形速度指令
绿色箭头表示指令速度;蓝色箭头表示当前速度。
注意:Newton RTX 暂不支持可视化标记,因此没有速度箭头。
快速开始#
在任意训练命令中加入 --viz 即可启动可视化器。 --visualizer 是等效的别名。
# Newton GL: lightweight OpenGL viewport
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz newton_gl
# Viser: browser-based viewer
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz viser
# Kit viewport
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz kit
# Multiple visualizers simultaneously (comma-separated, no spaces)
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz rerun,newton_rtx
./isaaclab.sh train --rl_library rsl_rl --task Isaac-Cartpole --viz newton_gl
./isaaclab.sh train --rl_library rsl_rl --task Isaac-Cartpole --viz viser
./isaaclab.sh train --rl_library rsl_rl --task Isaac-Cartpole --viz kit
./isaaclab.sh train --rl_library rsl_rl --task Isaac-Cartpole --viz rerun,newton_rtx
备注
大多数任务默认使用 PhysX 后端,需要安装 Isaac Sim。如果尚未安装,请在上述 uv run 命令中加入 --extra isaacsim ;详情见 可选依赖组 。
备注
train 和 play 仅在传入 --viz 时启动可视化器;内置演示和示例则会打开各自的默认可视化器。--viz none 可以关闭可视化器。
关于组合使用可视化器、无界面运行等常见场景,请参阅下文的 使用方法 。
可视化器概览#
可视化器 |
描述 |
|---|---|
Newton GL |
轻量,功能支持完善;推荐使用 |
Viser |
基于网页,支持录制和回放;推荐使用 |
Newton RTX |
高质量 RTX 渲染;实验性功能,部分功能尚未实现 |
Rerun |
基于网页,支持录制和回放;界面中的开关选项较少 |
Kit |
高质量 RTX 渲染,配备丰富的 Isaac Sim 工具;启动时间较长 |
Newton GL 可视化器提供轻量的 OpenGL 窗口,启动开销很小。
Newton GL 可视化器中的 Isaac-Reorient-Cube-Allegro
每只 Allegro 手调整立方体朝向,使其与上方标记显示的目标一致
该可视化器的特有功能:
ImGui 中的 Pause Rendering (暂停渲染)、 Pause Simulation (暂停仿真)和 Reset Episode (重置回合)控件
右键拖动刚体,见右侧演示(仅限 Newton 求解器)
可调整渲染更新频率
newton-dominoes 示例
右键拖动第一张骨牌,在 NVIDIA 标志形状的骨牌布局中触发连锁倒下
核心配置:
from isaaclab_visualizers.newton import NewtonGLVisualizerCfg
visualizer_cfg = NewtonGLVisualizerCfg(
eye=(8.0, 8.0, 3.0),
lookat=(0.0, 0.0, 0.0),
window_width=1920,
window_height=1080,
show_joints=False,
show_contacts=False,
enable_live_plots=True,
)
完整的配置参考见下列配置类。
NewtonGLVisualizerCfg 源代码
@configclass
class NewtonGLVisualizerCfg(NewtonVisualizerCfg):
"""Configuration for the Newton OpenGL rasterizer visualizer.
Selects Newton's OpenGL backend — fast local window with the full Isaac Lab
feature set: streaming camera panel, particle color override, and live scalar/array plots.
The streaming camera panel is enabled by default (``streaming_view=True``) but starts
hidden — no camera rendering work is performed until the user opens the panel via the
sidebar combo, keeping per-step overhead zero when the panel is closed.
"""
class_type: type[NewtonGLVisualizer] | str = "{DIR}.newton_visualizer:NewtonGLVisualizer"
"""Visualizer implementation class."""
visualizer_type: str = "newton_gl"
"""Visualizer selector identifier. Do not change."""
streaming_view: bool = True
"""Enable the tiled streaming camera panel.
Overrides the base-class default of ``False``. The panel starts **hidden** so there
is no per-step camera rendering cost; the user can open it at any time via the
*Streaming View* combo in the Newton sidebar.
"""
NewtonVisualizerCfg 源代码(Newton 可视化器共用的基类)
@configclass
class NewtonVisualizerCfg(VisualizerCfg):
"""Shared configuration base for Newton visualizer backends.
.. deprecated::
:class:`NewtonVisualizerCfg` is deprecated. Use :class:`NewtonGLVisualizerCfg` for the
OpenGL rasterizer or :class:`NewtonRTXVisualizerCfg` for the OVRTX path tracer.
"""
class_type: type[NewtonGLVisualizer] | str = "{DIR}.newton_visualizer:NewtonGLVisualizer"
"""Deprecated alias for the Newton GL visualizer implementation."""
# Deprecated alias: "newton" routes to the GL backend via visualizer_cfg._VISUALIZER_ALIASES.
visualizer_type: str = "newton_gl"
cloning_contexts: tuple[type | str, ...] = ("isaaclab_newton.cloner:NewtonReplicateContext",)
streaming_cam_renderer_cfg: RendererCfg = NewtonWarpRendererCfg()
"""Renderer configuration for the auto-created streaming camera."""
background_color: tuple[float, float, float] | None = None
"""Solid background color as normalized RGB values in ``[0, 1]``.
``None`` preserves Newton GL's procedural sky or Newton RTX's native background.
"""
def __post_init__(self) -> None:
super().__post_init__()
if type(self) is NewtonVisualizerCfg:
warnings.warn(
"NewtonVisualizerCfg is deprecated and will be removed in a future release. "
"Use NewtonGLVisualizerCfg (OpenGL rasterizer) or NewtonRTXVisualizerCfg (OVRTX path tracer) instead.",
DeprecationWarning,
stacklevel=3,
)
window_width: int = 1920
"""Window width in pixels."""
window_height: int = 1080
"""Window height in pixels."""
headless: bool = False
"""Run the Newton viewer without requiring a display server."""
update_frequency: int = 1
"""Visualizer update frequency (renders every N simulation frames)."""
world_spacing: tuple[float, float, float] = (0.0, 0.0, 0.0)
"""Visual spacing between simulation worlds along each axis [m].
Non-zero axes arrange visible worlds in a compact grid without changing their simulated poses.
"""
show_joints: bool = False
"""Show joint visualization."""
show_contacts: bool = False
"""Show contact visualization."""
show_collision: bool = False
"""Show collision visualization."""
show_springs: bool = False
"""Show spring visualization."""
show_inertia_boxes: bool = False
"""Show inertia box visualization."""
show_com: bool = False
"""Show center of mass visualization."""
show_particles: bool = False
"""Show particle visualization."""
particle_color: tuple[float, float, float] | None = None
"""Optional particle color RGB [0, 1]. Uses Newton viewer defaults when ``None``."""
enable_picking: bool = True
"""Enable right-click dragging with Newton rigid-body solvers.
Supported coupled solvers may expose dragging through a rigid-body entry.
Disabled automatically for headless viewers, standalone MPM, and non-Newton
physics. MPM particles are not pickable.
"""
enable_shadows: bool = True
"""Enable shadow rendering."""
enable_sky: bool = True
"""Enable procedural sky rendering when ``background_color`` is ``None``."""
enable_wireframe: bool = False
"""Enable wireframe rendering."""
sky_upper_color: tuple[float, float, float] = (0.2, 0.4, 0.6)
"""Sky upper color RGB [0, 1]."""
sky_lower_color: tuple[float, float, float] = (0.5, 0.6, 0.7)
"""Sky lower color RGB [0, 1]."""
light_color: tuple[float, float, float] = (1.0, 1.0, 1.0)
"""Light color RGB [0, 1]."""
VisualizerCfg 源代码(共用基类)
@configclass
class VisualizerCfg:
"""Base configuration for all visualizer backends.
Note:
This configuration can be used directly as
:attr:`~isaaclab.sim.SimulationCfg.default_visualizer_cfg` to provide shared defaults.
To create a visualizer, use a concrete config from ``isaaclab_visualizers``, such as
``KitVisualizerCfg`` or ``NewtonGLVisualizerCfg``.
"""
class_type: type[BaseVisualizer] | str | None = None
"""Visualizer implementation class. Concrete configs must set this field."""
cloning_contexts: tuple[type | str, ...] = ()
"""Clone contexts that build this visualizer's scene representation from the asset plan."""
# Primary interactive camera settings
eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
"""Interactive visualizer camera eye position in world coordinates."""
lookat: tuple[float, float, float] = (0.0, 0.0, 0.0)
"""Interactive visualizer camera look-at target in world coordinates."""
focal_length: float = 12.0
"""Camera focal length in millimeters for visualizer camera views."""
background_color: tuple[float, float, float] | None = (0.30, 0.55, 0.82)
"""Solid background color as normalized RGB values in ``[0, 1]``.
Kit, Newton GL, and Newton RTX honor this field. Set it to ``None`` to preserve the
backend's native background. Scene lighting remains independent of the visible background.
"""
# ── Streaming view ────────────────────────────────────────────────────────
# Captures pixels from a camera sensor (existing or auto-created), tiles them
# across envs and GT types, and shows the result as an image panel in interactive
# visualizers (Newton GL, Kit) or pushes it per-step to sink-based ones (Rerun, Viser).
streaming_view: bool = False
"""Enable the streaming camera image view (opt-in, disabled by default)."""
# Source — existing sensor (takes priority when set)
streaming_sensor_prim_path: str | None = None
"""Prim path of an existing TiledCamera sensor to stream from.
When set, all ``streaming_cam_*`` fields are ignored. Should point to an
existing camera sensor, e.g. ``"/World/envs/*/Camera"``.
"""
# Source — auto-created camera (used when streaming_sensor_prim_path is None)
streaming_cam_target_prim_path: str | None = None
"""Target prim for the auto-created streaming camera (ignored when
:attr:`streaming_sensor_prim_path` is set).
When ``None`` (the default), the visualizer adopts the first scene camera
sensor it discovers dynamically at initialization time. If no scene camera
exists the streaming panel remains empty. Set this explicitly (e.g.
``"/World/envs/*/Robot"``) only when you need an auto-created follow-camera
and no suitable scene camera is present.
"""
streaming_cam_eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
"""Eye offset [m] for the auto-created streaming camera relative to the target prim."""
streaming_cam_renderer_cfg: RendererCfg | None = None
"""Renderer for the auto-created streaming camera.
Concrete visualizer configs declare their default renderer configuration.
Its ``class_type`` selects the implementation, including custom renderers.
Ignored when :attr:`streaming_sensor_prim_path` is set.
"""
# Shared settings
streaming_envs: int | list[int] = 32
"""Environments to capture.
* ``int`` — sample this many envs once at initialization (from all visible envs).
* ``list[int]`` — capture exactly these env indices.
"""
streaming_gt_types: tuple[str, ...] = ("rgb",)
"""GT data types displayed left-to-right per environment row.
Valid values: ``"rgb"``, ``"depth"``, ``"segmentation"``, ``"normals"``.
Validated against :data:`~isaaclab.envs.utils.camera_colorizer.SUPPORTED_GT_TYPES`
at initialization time (only when :attr:`streaming_view` is ``True``).
"""
streaming_depth_min: float = 0.1
"""Near-clip for the turbo depth colormap [m]. Used when ``"depth"`` is in
:attr:`streaming_gt_types`."""
streaming_depth_max: float = 10.0
"""Far-clip for the turbo depth colormap [m]. Used when ``"depth"`` is in
:attr:`streaming_gt_types`."""
# Partial visualization settings
max_visible_envs: int | None = None
"""Upper bound on how many envs are shown.
* If visible_env_indices is not None, then this field will apply also
to the explicit env indices set to the visible_env_indices.
"""
visible_env_indices: list[int] | None = None
"""env indices to visualize in order (out-of-range indices are dropped)."""
randomly_sample_visible_envs: bool = True
"""If ``max_visible_envs`` is provided, when enabled, selected visible envs are randomly sampled.
If disabled, the first ``max_visible_envs`` envs are selected.
* Note: ``visible_env_indices`` overrides this field.
"""
# Visualization Markers
enable_markers: bool = True
"""Enable visualization markers (debug drawing)."""
# Live Plots
enable_live_plots: bool = True
"""Stream per-step scalar data (manager terms, episode reward, episode length) into the visualizer.
Plot windows start hidden or collapsed by default and can be toggled open at runtime.
Set to ``False`` to disable live plots entirely and avoid any collection overhead.
"""
live_plots_update_interval: int = 5
"""Collect and push live plot data every ``N`` simulation steps (default: every 5 steps)."""
# Internal
visualizer_type: str | None = None
"""Type identifier (e.g., 'newton', 'rerun', 'viser', 'kit'). Must be overridden by subclasses."""
# Deprecated aliases kept for one-release compatibility. Remove in the next major release.
tiled_cam_view: bool | None = None
"""Deprecated. Use :attr:`streaming_view` instead."""
tiled_cam_num: int | None = None
"""Deprecated. Use :attr:`streaming_envs` (int) instead."""
tiled_cam_env_indices: list[int] | None = None
"""Deprecated. Use :attr:`streaming_envs` (list[int]) instead."""
tiled_cam_prim_path: str | None = None
"""Deprecated. Use :attr:`streaming_sensor_prim_path` instead."""
tiled_cam_eye: tuple[float, float, float] | None = None
"""Deprecated. Use :attr:`streaming_cam_eye` instead."""
tiled_cam_target_prim_path: str | None = None
"""Deprecated. Use :attr:`streaming_cam_target_prim_path` instead."""
def __post_init__(self) -> None:
import warnings
if self.background_color is not None:
if len(self.background_color) != 3 or any(not 0.0 <= value <= 1.0 for value in self.background_color):
raise ValueError("background_color must contain three normalized RGB values in [0, 1].")
self.background_color = tuple(float(value) for value in self.background_color)
_simple = [
("tiled_cam_view", "streaming_view"),
("tiled_cam_prim_path", "streaming_sensor_prim_path"),
("tiled_cam_eye", "streaming_cam_eye"),
("tiled_cam_target_prim_path", "streaming_cam_target_prim_path"),
]
for old, new in _simple:
val = getattr(self, old)
if val is not None:
warnings.warn(f"{old!r} is deprecated; use {new!r} instead.", DeprecationWarning, stacklevel=3)
setattr(self, new, val)
setattr(self, old, None)
# tiled_cam_env_indices takes priority over tiled_cam_num
env_indices = getattr(self, "tiled_cam_env_indices")
if env_indices is not None:
warnings.warn(
"'tiled_cam_env_indices' is deprecated; use 'streaming_envs' instead.",
DeprecationWarning,
stacklevel=3,
)
self.streaming_envs = env_indices
self.tiled_cam_env_indices = None
self.tiled_cam_num = None
else:
num = getattr(self, "tiled_cam_num")
if num is not None:
warnings.warn(
"'tiled_cam_num' is deprecated; use 'streaming_envs' instead.",
DeprecationWarning,
stacklevel=3,
)
self.streaming_envs = num
self.tiled_cam_num = None
Viser 将 Newton Warp 渲染器的画面传输到本地 Web 服务器,默认地址为 http://localhost:8080 。还可以通过 share=True 获取公开分享链接,或录制为 .viser 文件以供回放。
Viser 可视化器中的 Isaac-Lift-KukaAllegro
各 Kuka 机械臂和 Allegro 手将立方体从桌面举起
桌面颜色表示成功状态:立方体到达目标位姿前为红色,到达后变为绿色。
该可视化器的特有功能:
设置
share=True可生成用于远程访问的公开分享链接侧栏中的 Pause Rendering (暂停渲染)、 Pause Simulation (暂停仿真)和 Reset Episode (重置回合)控件
重要
训练开始前会输出访问地址。设置 open_browser=True 可自动打开该地址。如需远程访问,请将 display_address 设为机器的主机名或 IP 地址,并确保浏览器能够访问配置的 port 。
╭────── viser (listening *:8080) ───────╮
│ URL │ http://localhost:8080 │
╰───────────────────────────────────────╯
核心配置:
from isaaclab_visualizers.viser import ViserVisualizerCfg
visualizer_cfg = ViserVisualizerCfg(
port=8080,
bind_address="0.0.0.0", # use 0.0.0.0 for remote access
display_address="localhost", # hostname shown in the printed URL
open_browser=False,
share=False, # request a public share URL
record_to_viser=None, # set a path to save a .viser recording
)
完整的配置参考见下列配置类。
ViserVisualizerCfg 源代码
@configclass
class ViserVisualizerCfg(VisualizerCfg):
"""Configuration for Viser visualizer (web-based visualization)."""
class_type: type[ViserVisualizer] | str = "{DIR}.viser_visualizer:ViserVisualizer"
"""Visualizer implementation class."""
visualizer_type: str = "viser"
"""Type identifier for Viser visualizer."""
cloning_contexts: tuple[type | str, ...] = ("isaaclab_newton.cloner:NewtonReplicateContext",)
streaming_cam_renderer_cfg: RendererCfg = NewtonWarpRendererCfg()
"""Renderer configuration for the auto-created streaming camera."""
port: int = 8080
"""Port of the local viser web server."""
bind_address: str = "0.0.0.0"
"""Host/interface for the Viser server to bind.
Use ``"0.0.0.0"`` to listen on all interfaces for remote access.
"""
display_address: str = "localhost"
"""Host name or IP address shown in the printed browser URL.
For remote access, set this to the hostname/IP reachable from your browser.
"""
open_browser: bool = False
"""Whether to attempt opening the viser web viewer URL in a browser.
The viewer URL is always logged during initialization. Set this to ``True`` to auto-launch it.
"""
verbose: bool = True
"""Whether to print viewer server startup information."""
share: bool = False
"""Whether to request a public share URL from viser."""
record_to_viser: str | None = None
"""Path to save a .viser recording file. None = no recording."""
show_particles: bool = True
"""Whether to render particle systems (MPM, VBD) in the Viser viewer.
Defaults to ``True`` so particle simulations (granular, cloth, soft-body) are
visible on startup. Can also be toggled at runtime via the Visualization Markers
panel in the Viser sidebar.
"""
VisualizerCfg 源代码(共用基类)
@configclass
class VisualizerCfg:
"""Base configuration for all visualizer backends.
Note:
This configuration can be used directly as
:attr:`~isaaclab.sim.SimulationCfg.default_visualizer_cfg` to provide shared defaults.
To create a visualizer, use a concrete config from ``isaaclab_visualizers``, such as
``KitVisualizerCfg`` or ``NewtonGLVisualizerCfg``.
"""
class_type: type[BaseVisualizer] | str | None = None
"""Visualizer implementation class. Concrete configs must set this field."""
cloning_contexts: tuple[type | str, ...] = ()
"""Clone contexts that build this visualizer's scene representation from the asset plan."""
# Primary interactive camera settings
eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
"""Interactive visualizer camera eye position in world coordinates."""
lookat: tuple[float, float, float] = (0.0, 0.0, 0.0)
"""Interactive visualizer camera look-at target in world coordinates."""
focal_length: float = 12.0
"""Camera focal length in millimeters for visualizer camera views."""
background_color: tuple[float, float, float] | None = (0.30, 0.55, 0.82)
"""Solid background color as normalized RGB values in ``[0, 1]``.
Kit, Newton GL, and Newton RTX honor this field. Set it to ``None`` to preserve the
backend's native background. Scene lighting remains independent of the visible background.
"""
# ── Streaming view ────────────────────────────────────────────────────────
# Captures pixels from a camera sensor (existing or auto-created), tiles them
# across envs and GT types, and shows the result as an image panel in interactive
# visualizers (Newton GL, Kit) or pushes it per-step to sink-based ones (Rerun, Viser).
streaming_view: bool = False
"""Enable the streaming camera image view (opt-in, disabled by default)."""
# Source — existing sensor (takes priority when set)
streaming_sensor_prim_path: str | None = None
"""Prim path of an existing TiledCamera sensor to stream from.
When set, all ``streaming_cam_*`` fields are ignored. Should point to an
existing camera sensor, e.g. ``"/World/envs/*/Camera"``.
"""
# Source — auto-created camera (used when streaming_sensor_prim_path is None)
streaming_cam_target_prim_path: str | None = None
"""Target prim for the auto-created streaming camera (ignored when
:attr:`streaming_sensor_prim_path` is set).
When ``None`` (the default), the visualizer adopts the first scene camera
sensor it discovers dynamically at initialization time. If no scene camera
exists the streaming panel remains empty. Set this explicitly (e.g.
``"/World/envs/*/Robot"``) only when you need an auto-created follow-camera
and no suitable scene camera is present.
"""
streaming_cam_eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
"""Eye offset [m] for the auto-created streaming camera relative to the target prim."""
streaming_cam_renderer_cfg: RendererCfg | None = None
"""Renderer for the auto-created streaming camera.
Concrete visualizer configs declare their default renderer configuration.
Its ``class_type`` selects the implementation, including custom renderers.
Ignored when :attr:`streaming_sensor_prim_path` is set.
"""
# Shared settings
streaming_envs: int | list[int] = 32
"""Environments to capture.
* ``int`` — sample this many envs once at initialization (from all visible envs).
* ``list[int]`` — capture exactly these env indices.
"""
streaming_gt_types: tuple[str, ...] = ("rgb",)
"""GT data types displayed left-to-right per environment row.
Valid values: ``"rgb"``, ``"depth"``, ``"segmentation"``, ``"normals"``.
Validated against :data:`~isaaclab.envs.utils.camera_colorizer.SUPPORTED_GT_TYPES`
at initialization time (only when :attr:`streaming_view` is ``True``).
"""
streaming_depth_min: float = 0.1
"""Near-clip for the turbo depth colormap [m]. Used when ``"depth"`` is in
:attr:`streaming_gt_types`."""
streaming_depth_max: float = 10.0
"""Far-clip for the turbo depth colormap [m]. Used when ``"depth"`` is in
:attr:`streaming_gt_types`."""
# Partial visualization settings
max_visible_envs: int | None = None
"""Upper bound on how many envs are shown.
* If visible_env_indices is not None, then this field will apply also
to the explicit env indices set to the visible_env_indices.
"""
visible_env_indices: list[int] | None = None
"""env indices to visualize in order (out-of-range indices are dropped)."""
randomly_sample_visible_envs: bool = True
"""If ``max_visible_envs`` is provided, when enabled, selected visible envs are randomly sampled.
If disabled, the first ``max_visible_envs`` envs are selected.
* Note: ``visible_env_indices`` overrides this field.
"""
# Visualization Markers
enable_markers: bool = True
"""Enable visualization markers (debug drawing)."""
# Live Plots
enable_live_plots: bool = True
"""Stream per-step scalar data (manager terms, episode reward, episode length) into the visualizer.
Plot windows start hidden or collapsed by default and can be toggled open at runtime.
Set to ``False`` to disable live plots entirely and avoid any collection overhead.
"""
live_plots_update_interval: int = 5
"""Collect and push live plot data every ``N`` simulation steps (default: every 5 steps)."""
# Internal
visualizer_type: str | None = None
"""Type identifier (e.g., 'newton', 'rerun', 'viser', 'kit'). Must be overridden by subclasses."""
# Deprecated aliases kept for one-release compatibility. Remove in the next major release.
tiled_cam_view: bool | None = None
"""Deprecated. Use :attr:`streaming_view` instead."""
tiled_cam_num: int | None = None
"""Deprecated. Use :attr:`streaming_envs` (int) instead."""
tiled_cam_env_indices: list[int] | None = None
"""Deprecated. Use :attr:`streaming_envs` (list[int]) instead."""
tiled_cam_prim_path: str | None = None
"""Deprecated. Use :attr:`streaming_sensor_prim_path` instead."""
tiled_cam_eye: tuple[float, float, float] | None = None
"""Deprecated. Use :attr:`streaming_cam_eye` instead."""
tiled_cam_target_prim_path: str | None = None
"""Deprecated. Use :attr:`streaming_cam_target_prim_path` instead."""
def __post_init__(self) -> None:
import warnings
if self.background_color is not None:
if len(self.background_color) != 3 or any(not 0.0 <= value <= 1.0 for value in self.background_color):
raise ValueError("background_color must contain three normalized RGB values in [0, 1].")
self.background_color = tuple(float(value) for value in self.background_color)
_simple = [
("tiled_cam_view", "streaming_view"),
("tiled_cam_prim_path", "streaming_sensor_prim_path"),
("tiled_cam_eye", "streaming_cam_eye"),
("tiled_cam_target_prim_path", "streaming_cam_target_prim_path"),
]
for old, new in _simple:
val = getattr(self, old)
if val is not None:
warnings.warn(f"{old!r} is deprecated; use {new!r} instead.", DeprecationWarning, stacklevel=3)
setattr(self, new, val)
setattr(self, old, None)
# tiled_cam_env_indices takes priority over tiled_cam_num
env_indices = getattr(self, "tiled_cam_env_indices")
if env_indices is not None:
warnings.warn(
"'tiled_cam_env_indices' is deprecated; use 'streaming_envs' instead.",
DeprecationWarning,
stacklevel=3,
)
self.streaming_envs = env_indices
self.tiled_cam_env_indices = None
self.tiled_cam_num = None
else:
num = getattr(self, "tiled_cam_num")
if num is not None:
warnings.warn(
"'tiled_cam_num' is deprecated; use 'streaming_envs' instead.",
DeprecationWarning,
stacklevel=3,
)
self.streaming_envs = num
self.tiled_cam_num = None
Newton RTX 可视化器目前处于 实验阶段 ,使用 --viz newton_rtx 启动。它通过 OVRTX 路径追踪器实现照片级真实感渲染,无需启动 Kit 进程。由于高质量 RTX 渲染的开销较大,其速度略低于 Newton GL 可视化器。
Newton RTX 可视化器中的 Isaac-Velocity-Rough-H1
各 H1 人形机器人攀登楼梯子地形
该可视化器的特有功能:
使用 OVRTX 路径追踪,实现照片级真实感、基于物理的光照
备注
以下功能尚未支持,将在后续版本中加入:可视化标记、实时曲线和暂停渲染。其他可视化器均支持这些功能。相机流面板目前也无法在屏幕上实时预览,但支持无界面模式下的相机流采集(例如用于 VideoRecorderCfg )。
核心配置:
from isaaclab_visualizers.newton import NewtonRTXVisualizerCfg
visualizer_cfg = NewtonRTXVisualizerCfg(
eye=(8.0, 8.0, 3.0),
lookat=(0.0, 0.0, 0.0),
)
完整的配置参考见下列配置类。
NewtonRTXVisualizerCfg 源代码
@configclass
class NewtonRTXVisualizerCfg(NewtonVisualizerCfg):
"""Configuration for the Newton OVRTX path-tracer visualizer.
Selects Newton's OVRTX backend — photorealistic rendering using the same
``begin_frame / log_state / end_frame`` step interface as the GL backend.
.. note::
Lighting environment and denoiser settings use ``ViewerRTX`` defaults.
``render_rgb_array()`` captures the path-traced LDR framebuffer at
:attr:`window_width` by :attr:`window_height`. The tiled camera panel remains
unsupported because ``ViewerRTX.log_image`` has no display sink.
"""
class_type: type[NewtonRTXVisualizer] | str = "{DIR}.newton_visualizer:NewtonRTXVisualizer"
"""Visualizer implementation class."""
visualizer_type: str = "newton_rtx"
"""Visualizer selector identifier. Do not change."""
rtx_environment: str = "default"
"""OVRTX lighting environment. One of ``"default"`` (dome + distant light),
``"studio"`` (three-point rig for cleaner highlights), or ``"none"``."""
render_settings: dict[str, Any] = dict()
"""RTX attributes to author on the OVRTX render product, as ``{name: (usd_type_name, value)}``.
``usd_type_name`` names an ``Sdf.ValueTypeNames`` member, as a string so the config stays
copyable. For example, ``{"omni:rtx:quality": ("Int", 100)}`` re-enables the path tracer's
quality convergence loop, which ``ViewerRTX`` otherwise disables to keep interactive latency
down."""
NewtonVisualizerCfg 源代码(Newton 可视化器共用的基类)
@configclass
class NewtonVisualizerCfg(VisualizerCfg):
"""Shared configuration base for Newton visualizer backends.
.. deprecated::
:class:`NewtonVisualizerCfg` is deprecated. Use :class:`NewtonGLVisualizerCfg` for the
OpenGL rasterizer or :class:`NewtonRTXVisualizerCfg` for the OVRTX path tracer.
"""
class_type: type[NewtonGLVisualizer] | str = "{DIR}.newton_visualizer:NewtonGLVisualizer"
"""Deprecated alias for the Newton GL visualizer implementation."""
# Deprecated alias: "newton" routes to the GL backend via visualizer_cfg._VISUALIZER_ALIASES.
visualizer_type: str = "newton_gl"
cloning_contexts: tuple[type | str, ...] = ("isaaclab_newton.cloner:NewtonReplicateContext",)
streaming_cam_renderer_cfg: RendererCfg = NewtonWarpRendererCfg()
"""Renderer configuration for the auto-created streaming camera."""
background_color: tuple[float, float, float] | None = None
"""Solid background color as normalized RGB values in ``[0, 1]``.
``None`` preserves Newton GL's procedural sky or Newton RTX's native background.
"""
def __post_init__(self) -> None:
super().__post_init__()
if type(self) is NewtonVisualizerCfg:
warnings.warn(
"NewtonVisualizerCfg is deprecated and will be removed in a future release. "
"Use NewtonGLVisualizerCfg (OpenGL rasterizer) or NewtonRTXVisualizerCfg (OVRTX path tracer) instead.",
DeprecationWarning,
stacklevel=3,
)
window_width: int = 1920
"""Window width in pixels."""
window_height: int = 1080
"""Window height in pixels."""
headless: bool = False
"""Run the Newton viewer without requiring a display server."""
update_frequency: int = 1
"""Visualizer update frequency (renders every N simulation frames)."""
world_spacing: tuple[float, float, float] = (0.0, 0.0, 0.0)
"""Visual spacing between simulation worlds along each axis [m].
Non-zero axes arrange visible worlds in a compact grid without changing their simulated poses.
"""
show_joints: bool = False
"""Show joint visualization."""
show_contacts: bool = False
"""Show contact visualization."""
show_collision: bool = False
"""Show collision visualization."""
show_springs: bool = False
"""Show spring visualization."""
show_inertia_boxes: bool = False
"""Show inertia box visualization."""
show_com: bool = False
"""Show center of mass visualization."""
show_particles: bool = False
"""Show particle visualization."""
particle_color: tuple[float, float, float] | None = None
"""Optional particle color RGB [0, 1]. Uses Newton viewer defaults when ``None``."""
enable_picking: bool = True
"""Enable right-click dragging with Newton rigid-body solvers.
Supported coupled solvers may expose dragging through a rigid-body entry.
Disabled automatically for headless viewers, standalone MPM, and non-Newton
physics. MPM particles are not pickable.
"""
enable_shadows: bool = True
"""Enable shadow rendering."""
enable_sky: bool = True
"""Enable procedural sky rendering when ``background_color`` is ``None``."""
enable_wireframe: bool = False
"""Enable wireframe rendering."""
sky_upper_color: tuple[float, float, float] = (0.2, 0.4, 0.6)
"""Sky upper color RGB [0, 1]."""
sky_lower_color: tuple[float, float, float] = (0.5, 0.6, 0.7)
"""Sky lower color RGB [0, 1]."""
light_color: tuple[float, float, float] = (1.0, 1.0, 1.0)
"""Light color RGB [0, 1]."""
VisualizerCfg 源代码(共用基类)
@configclass
class VisualizerCfg:
"""Base configuration for all visualizer backends.
Note:
This configuration can be used directly as
:attr:`~isaaclab.sim.SimulationCfg.default_visualizer_cfg` to provide shared defaults.
To create a visualizer, use a concrete config from ``isaaclab_visualizers``, such as
``KitVisualizerCfg`` or ``NewtonGLVisualizerCfg``.
"""
class_type: type[BaseVisualizer] | str | None = None
"""Visualizer implementation class. Concrete configs must set this field."""
cloning_contexts: tuple[type | str, ...] = ()
"""Clone contexts that build this visualizer's scene representation from the asset plan."""
# Primary interactive camera settings
eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
"""Interactive visualizer camera eye position in world coordinates."""
lookat: tuple[float, float, float] = (0.0, 0.0, 0.0)
"""Interactive visualizer camera look-at target in world coordinates."""
focal_length: float = 12.0
"""Camera focal length in millimeters for visualizer camera views."""
background_color: tuple[float, float, float] | None = (0.30, 0.55, 0.82)
"""Solid background color as normalized RGB values in ``[0, 1]``.
Kit, Newton GL, and Newton RTX honor this field. Set it to ``None`` to preserve the
backend's native background. Scene lighting remains independent of the visible background.
"""
# ── Streaming view ────────────────────────────────────────────────────────
# Captures pixels from a camera sensor (existing or auto-created), tiles them
# across envs and GT types, and shows the result as an image panel in interactive
# visualizers (Newton GL, Kit) or pushes it per-step to sink-based ones (Rerun, Viser).
streaming_view: bool = False
"""Enable the streaming camera image view (opt-in, disabled by default)."""
# Source — existing sensor (takes priority when set)
streaming_sensor_prim_path: str | None = None
"""Prim path of an existing TiledCamera sensor to stream from.
When set, all ``streaming_cam_*`` fields are ignored. Should point to an
existing camera sensor, e.g. ``"/World/envs/*/Camera"``.
"""
# Source — auto-created camera (used when streaming_sensor_prim_path is None)
streaming_cam_target_prim_path: str | None = None
"""Target prim for the auto-created streaming camera (ignored when
:attr:`streaming_sensor_prim_path` is set).
When ``None`` (the default), the visualizer adopts the first scene camera
sensor it discovers dynamically at initialization time. If no scene camera
exists the streaming panel remains empty. Set this explicitly (e.g.
``"/World/envs/*/Robot"``) only when you need an auto-created follow-camera
and no suitable scene camera is present.
"""
streaming_cam_eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
"""Eye offset [m] for the auto-created streaming camera relative to the target prim."""
streaming_cam_renderer_cfg: RendererCfg | None = None
"""Renderer for the auto-created streaming camera.
Concrete visualizer configs declare their default renderer configuration.
Its ``class_type`` selects the implementation, including custom renderers.
Ignored when :attr:`streaming_sensor_prim_path` is set.
"""
# Shared settings
streaming_envs: int | list[int] = 32
"""Environments to capture.
* ``int`` — sample this many envs once at initialization (from all visible envs).
* ``list[int]`` — capture exactly these env indices.
"""
streaming_gt_types: tuple[str, ...] = ("rgb",)
"""GT data types displayed left-to-right per environment row.
Valid values: ``"rgb"``, ``"depth"``, ``"segmentation"``, ``"normals"``.
Validated against :data:`~isaaclab.envs.utils.camera_colorizer.SUPPORTED_GT_TYPES`
at initialization time (only when :attr:`streaming_view` is ``True``).
"""
streaming_depth_min: float = 0.1
"""Near-clip for the turbo depth colormap [m]. Used when ``"depth"`` is in
:attr:`streaming_gt_types`."""
streaming_depth_max: float = 10.0
"""Far-clip for the turbo depth colormap [m]. Used when ``"depth"`` is in
:attr:`streaming_gt_types`."""
# Partial visualization settings
max_visible_envs: int | None = None
"""Upper bound on how many envs are shown.
* If visible_env_indices is not None, then this field will apply also
to the explicit env indices set to the visible_env_indices.
"""
visible_env_indices: list[int] | None = None
"""env indices to visualize in order (out-of-range indices are dropped)."""
randomly_sample_visible_envs: bool = True
"""If ``max_visible_envs`` is provided, when enabled, selected visible envs are randomly sampled.
If disabled, the first ``max_visible_envs`` envs are selected.
* Note: ``visible_env_indices`` overrides this field.
"""
# Visualization Markers
enable_markers: bool = True
"""Enable visualization markers (debug drawing)."""
# Live Plots
enable_live_plots: bool = True
"""Stream per-step scalar data (manager terms, episode reward, episode length) into the visualizer.
Plot windows start hidden or collapsed by default and can be toggled open at runtime.
Set to ``False`` to disable live plots entirely and avoid any collection overhead.
"""
live_plots_update_interval: int = 5
"""Collect and push live plot data every ``N`` simulation steps (default: every 5 steps)."""
# Internal
visualizer_type: str | None = None
"""Type identifier (e.g., 'newton', 'rerun', 'viser', 'kit'). Must be overridden by subclasses."""
# Deprecated aliases kept for one-release compatibility. Remove in the next major release.
tiled_cam_view: bool | None = None
"""Deprecated. Use :attr:`streaming_view` instead."""
tiled_cam_num: int | None = None
"""Deprecated. Use :attr:`streaming_envs` (int) instead."""
tiled_cam_env_indices: list[int] | None = None
"""Deprecated. Use :attr:`streaming_envs` (list[int]) instead."""
tiled_cam_prim_path: str | None = None
"""Deprecated. Use :attr:`streaming_sensor_prim_path` instead."""
tiled_cam_eye: tuple[float, float, float] | None = None
"""Deprecated. Use :attr:`streaming_cam_eye` instead."""
tiled_cam_target_prim_path: str | None = None
"""Deprecated. Use :attr:`streaming_cam_target_prim_path` instead."""
def __post_init__(self) -> None:
import warnings
if self.background_color is not None:
if len(self.background_color) != 3 or any(not 0.0 <= value <= 1.0 for value in self.background_color):
raise ValueError("background_color must contain three normalized RGB values in [0, 1].")
self.background_color = tuple(float(value) for value in self.background_color)
_simple = [
("tiled_cam_view", "streaming_view"),
("tiled_cam_prim_path", "streaming_sensor_prim_path"),
("tiled_cam_eye", "streaming_cam_eye"),
("tiled_cam_target_prim_path", "streaming_cam_target_prim_path"),
]
for old, new in _simple:
val = getattr(self, old)
if val is not None:
warnings.warn(f"{old!r} is deprecated; use {new!r} instead.", DeprecationWarning, stacklevel=3)
setattr(self, new, val)
setattr(self, old, None)
# tiled_cam_env_indices takes priority over tiled_cam_num
env_indices = getattr(self, "tiled_cam_env_indices")
if env_indices is not None:
warnings.warn(
"'tiled_cam_env_indices' is deprecated; use 'streaming_envs' instead.",
DeprecationWarning,
stacklevel=3,
)
self.streaming_envs = env_indices
self.tiled_cam_env_indices = None
self.tiled_cam_num = None
else:
num = getattr(self, "tiled_cam_num")
if num is not None:
warnings.warn(
"'tiled_cam_num' is deprecated; use 'streaming_envs' instead.",
DeprecationWarning,
stacklevel=3,
)
self.streaming_envs = num
self.tiled_cam_num = None
警告
Newton RTX(OVRTX)是不依赖 Kit 的渲染器,不能与 Kit( presets=isaacsim_physx )在同一进程中使用。 presets=ovphysx 本身也不依赖 Kit,可以与 Newton RTX 配合使用。请将 --viz newton_rtx 与 presets=newton_mjwarp,ovrtx 或 presets=ovphysx,ovrtx 搭配,或者改用 --viz newton_gl 、 --viz viser 、 --viz rerun ;也可以在兼容 Kit 的物理后端下使用 --viz kit 。
与 Viser 类似, Rerun 将仿真状态传输到本地 Web 服务器,支持远程观察、时间线回放和录制为 .rrd 文件。
Rerun 可视化器中的 Isaac-Reorient-Cube-Shadow-Direct
各 Shadow Hand 调整立方体朝向,使其与目标位姿一致
该可视化器的特有功能:
在时间线上拖动定位,并回放
.rrd录制文件ImGui 侧栏中的 Pause Rendering (暂停渲染)和 Reset Episode (重置回合)控件
备注
在实时查看仿真或训练过程时,Rerun 界面原生的时间线播放/暂停控件不起作用。这些控件默认隐藏,但仍可通过 Rerun 的停靠面板界面显示;即使显示出来,点击也不会生效。请使用 Isaac Lab 自身的 Pause Rendering (暂停渲染)和 Reset Episode (重置回合)控件。时间线控件仅在回放已保存的 .rrd 文件时有效。
重要
训练开始前,终端会突出显示访问地址。按住 Ctrl 点击即可打开查看器,也可以设置 open_browser=True 自动打开。
╭─────────────────────────── rerun (listening *:9090) ───────────────────────────╮
│ URL │ http://127.0.0.1:9090/?url=rerun%2Bhttp://127.0.0.1:9876/proxy │
╰────────────────────────────────────────────────────────────────────────────────╯
核心配置:
from isaaclab_visualizers.rerun import RerunVisualizerCfg
visualizer_cfg = RerunVisualizerCfg(
eye=(8.0, 8.0, 3.0),
lookat=(0.0, 0.0, 0.0),
keep_historical_data=False, # enable for time scrubbing
keep_scalar_history=False, # enable for scalar time-series
record_to_rrd=None, # set a path to save a .rrd recording
open_browser=False,
)
完整的配置参考见下列配置类。
RerunVisualizerCfg 源代码
@configclass
class RerunVisualizerCfg(VisualizerCfg):
"""Configuration for Rerun visualizer (web-based visualization)."""
class_type: type[RerunVisualizer] | str = "{DIR}.rerun_visualizer:RerunVisualizer"
"""Visualizer implementation class."""
visualizer_type: str = "rerun"
"""Type identifier for Rerun visualizer."""
cloning_contexts: tuple[type | str, ...] = ("isaaclab_newton.cloner:NewtonReplicateContext",)
streaming_cam_renderer_cfg: RendererCfg = NewtonWarpRendererCfg()
"""Renderer configuration for the auto-created streaming camera."""
app_id: str = "isaaclab-simulation"
"""Application identifier shown in viewer title."""
web_port: int = 9090
"""Port of the local rerun web viewer whose URL is logged during initialization."""
grpc_port: int = 9876
"""Port of the rerun gRPC server (used when serving web viewer externally)."""
bind_address: str | None = "0.0.0.0"
"""Host used for endpoint formatting and reuse checks.
Notes:
- If an existing rerun server is reachable on ``grpc_port``, it is reused.
- New server startup is managed by ``newton.viewer.ViewerRerun`` via the rerun Python SDK.
- Local browser links normalize common loopback/wildcard hosts to ``127.0.0.1``.
"""
open_browser: bool = False
"""Whether to attempt opening the rerun web viewer URL in a browser.
The viewer URL is always logged during initialization. Set this to ``True`` to auto-launch it.
"""
keep_historical_data: bool = False
"""Keep transform history for time scrubbing (False = constant memory for training)."""
keep_scalar_history: bool = False
"""Accumulate scalars as a time-series in the Rerun timeline (True = live plot history, False = constant memory).
When :attr:`~isaaclab.visualizers.VisualizerCfg.enable_live_plots` is ``True`` (the default),
this is automatically forced to ``True`` so that scalar values accumulate as a time series in
the Rerun viewer. Set to ``False`` explicitly to reduce memory usage when scalar history is
not needed, but note this will disable live plot curves.
"""
show_particles: bool = True
"""Whether to show model particles.
Disable this option to reduce streaming overhead for large particle clouds.
"""
record_to_rrd: str | None = None
"""Path to save .rrd recording file. None = no recording."""
VisualizerCfg 源代码(共用基类)
@configclass
class VisualizerCfg:
"""Base configuration for all visualizer backends.
Note:
This configuration can be used directly as
:attr:`~isaaclab.sim.SimulationCfg.default_visualizer_cfg` to provide shared defaults.
To create a visualizer, use a concrete config from ``isaaclab_visualizers``, such as
``KitVisualizerCfg`` or ``NewtonGLVisualizerCfg``.
"""
class_type: type[BaseVisualizer] | str | None = None
"""Visualizer implementation class. Concrete configs must set this field."""
cloning_contexts: tuple[type | str, ...] = ()
"""Clone contexts that build this visualizer's scene representation from the asset plan."""
# Primary interactive camera settings
eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
"""Interactive visualizer camera eye position in world coordinates."""
lookat: tuple[float, float, float] = (0.0, 0.0, 0.0)
"""Interactive visualizer camera look-at target in world coordinates."""
focal_length: float = 12.0
"""Camera focal length in millimeters for visualizer camera views."""
background_color: tuple[float, float, float] | None = (0.30, 0.55, 0.82)
"""Solid background color as normalized RGB values in ``[0, 1]``.
Kit, Newton GL, and Newton RTX honor this field. Set it to ``None`` to preserve the
backend's native background. Scene lighting remains independent of the visible background.
"""
# ── Streaming view ────────────────────────────────────────────────────────
# Captures pixels from a camera sensor (existing or auto-created), tiles them
# across envs and GT types, and shows the result as an image panel in interactive
# visualizers (Newton GL, Kit) or pushes it per-step to sink-based ones (Rerun, Viser).
streaming_view: bool = False
"""Enable the streaming camera image view (opt-in, disabled by default)."""
# Source — existing sensor (takes priority when set)
streaming_sensor_prim_path: str | None = None
"""Prim path of an existing TiledCamera sensor to stream from.
When set, all ``streaming_cam_*`` fields are ignored. Should point to an
existing camera sensor, e.g. ``"/World/envs/*/Camera"``.
"""
# Source — auto-created camera (used when streaming_sensor_prim_path is None)
streaming_cam_target_prim_path: str | None = None
"""Target prim for the auto-created streaming camera (ignored when
:attr:`streaming_sensor_prim_path` is set).
When ``None`` (the default), the visualizer adopts the first scene camera
sensor it discovers dynamically at initialization time. If no scene camera
exists the streaming panel remains empty. Set this explicitly (e.g.
``"/World/envs/*/Robot"``) only when you need an auto-created follow-camera
and no suitable scene camera is present.
"""
streaming_cam_eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
"""Eye offset [m] for the auto-created streaming camera relative to the target prim."""
streaming_cam_renderer_cfg: RendererCfg | None = None
"""Renderer for the auto-created streaming camera.
Concrete visualizer configs declare their default renderer configuration.
Its ``class_type`` selects the implementation, including custom renderers.
Ignored when :attr:`streaming_sensor_prim_path` is set.
"""
# Shared settings
streaming_envs: int | list[int] = 32
"""Environments to capture.
* ``int`` — sample this many envs once at initialization (from all visible envs).
* ``list[int]`` — capture exactly these env indices.
"""
streaming_gt_types: tuple[str, ...] = ("rgb",)
"""GT data types displayed left-to-right per environment row.
Valid values: ``"rgb"``, ``"depth"``, ``"segmentation"``, ``"normals"``.
Validated against :data:`~isaaclab.envs.utils.camera_colorizer.SUPPORTED_GT_TYPES`
at initialization time (only when :attr:`streaming_view` is ``True``).
"""
streaming_depth_min: float = 0.1
"""Near-clip for the turbo depth colormap [m]. Used when ``"depth"`` is in
:attr:`streaming_gt_types`."""
streaming_depth_max: float = 10.0
"""Far-clip for the turbo depth colormap [m]. Used when ``"depth"`` is in
:attr:`streaming_gt_types`."""
# Partial visualization settings
max_visible_envs: int | None = None
"""Upper bound on how many envs are shown.
* If visible_env_indices is not None, then this field will apply also
to the explicit env indices set to the visible_env_indices.
"""
visible_env_indices: list[int] | None = None
"""env indices to visualize in order (out-of-range indices are dropped)."""
randomly_sample_visible_envs: bool = True
"""If ``max_visible_envs`` is provided, when enabled, selected visible envs are randomly sampled.
If disabled, the first ``max_visible_envs`` envs are selected.
* Note: ``visible_env_indices`` overrides this field.
"""
# Visualization Markers
enable_markers: bool = True
"""Enable visualization markers (debug drawing)."""
# Live Plots
enable_live_plots: bool = True
"""Stream per-step scalar data (manager terms, episode reward, episode length) into the visualizer.
Plot windows start hidden or collapsed by default and can be toggled open at runtime.
Set to ``False`` to disable live plots entirely and avoid any collection overhead.
"""
live_plots_update_interval: int = 5
"""Collect and push live plot data every ``N`` simulation steps (default: every 5 steps)."""
# Internal
visualizer_type: str | None = None
"""Type identifier (e.g., 'newton', 'rerun', 'viser', 'kit'). Must be overridden by subclasses."""
# Deprecated aliases kept for one-release compatibility. Remove in the next major release.
tiled_cam_view: bool | None = None
"""Deprecated. Use :attr:`streaming_view` instead."""
tiled_cam_num: int | None = None
"""Deprecated. Use :attr:`streaming_envs` (int) instead."""
tiled_cam_env_indices: list[int] | None = None
"""Deprecated. Use :attr:`streaming_envs` (list[int]) instead."""
tiled_cam_prim_path: str | None = None
"""Deprecated. Use :attr:`streaming_sensor_prim_path` instead."""
tiled_cam_eye: tuple[float, float, float] | None = None
"""Deprecated. Use :attr:`streaming_cam_eye` instead."""
tiled_cam_target_prim_path: str | None = None
"""Deprecated. Use :attr:`streaming_cam_target_prim_path` instead."""
def __post_init__(self) -> None:
import warnings
if self.background_color is not None:
if len(self.background_color) != 3 or any(not 0.0 <= value <= 1.0 for value in self.background_color):
raise ValueError("background_color must contain three normalized RGB values in [0, 1].")
self.background_color = tuple(float(value) for value in self.background_color)
_simple = [
("tiled_cam_view", "streaming_view"),
("tiled_cam_prim_path", "streaming_sensor_prim_path"),
("tiled_cam_eye", "streaming_cam_eye"),
("tiled_cam_target_prim_path", "streaming_cam_target_prim_path"),
]
for old, new in _simple:
val = getattr(self, old)
if val is not None:
warnings.warn(f"{old!r} is deprecated; use {new!r} instead.", DeprecationWarning, stacklevel=3)
setattr(self, new, val)
setattr(self, old, None)
# tiled_cam_env_indices takes priority over tiled_cam_num
env_indices = getattr(self, "tiled_cam_env_indices")
if env_indices is not None:
warnings.warn(
"'tiled_cam_env_indices' is deprecated; use 'streaming_envs' instead.",
DeprecationWarning,
stacklevel=3,
)
self.streaming_envs = env_indices
self.tiled_cam_env_indices = None
self.tiled_cam_num = None
else:
num = getattr(self, "tiled_cam_num")
if num is not None:
warnings.warn(
"'tiled_cam_num' is deprecated; use 'streaming_envs' instead.",
DeprecationWarning,
stacklevel=3,
)
self.streaming_envs = num
self.tiled_cam_num = None
Kit 可视化器将 Isaac Lab 嵌入 Kit 进程,可以访问完整的 Isaac Sim USD 舞台、RTX 渲染器和图形界面工具。在这 5 种可视化器中,它的启动和运行开销最大。
Kit 可视化器中的 Isaac-Reach-Franka
各 Franka 机械臂将末端执行器移动到随机目标位姿
该可视化器的特有功能:
可直接访问 Isaac Sim USD 舞台,在运行时查看和编辑 prim
完整的 Isaac Sim 图形界面工具(Property、Layers 和 Stage 面板)
备注
Kit 的 ImGui 界面会在进程的工作目录中写入 imgui.ini 文件,记录窗口布局(面板位置、停靠方式和折叠状态)。如果工作目录是仓库根目录,该文件就会作为未跟踪文件出现。 .gitignore 已列出 imgui.ini ;如果希望它完全不出现在仓库中,可以删除该文件,或在仓库外的目录中启动程序。
核心配置:
from isaaclab_visualizers.kit import KitVisualizerCfg
visualizer_cfg = KitVisualizerCfg(
eye=(8.0, 8.0, 3.0),
lookat=(0.0, 0.0, 0.0),
window_width=1280,
window_height=720,
enable_markers=True,
enable_live_plots=True,
)
完整的配置参考见下列配置类。
KitVisualizerCfg 源代码
@configclass
class KitVisualizerCfg(VisualizerCfg):
"""Configuration for Kit visualizer using Isaac Sim viewport.
.. note::
The streaming camera panel (``streaming_view=True``) requires the
``--enable_cameras`` CLI flag. Without it, the streaming view is silently
skipped and no image panel is created. Set ``dock_position="RIGHT"`` so
the panel appears side-by-side with the Viewport instead of as a hidden tab.
"""
class_type: type[KitVisualizer] | str = "{DIR}.kit_visualizer:KitVisualizer"
"""Visualizer implementation class."""
visualizer_type: str = "kit"
"""Type identifier for Kit visualizer."""
streaming_cam_renderer_cfg: RendererCfg = IsaacRtxRendererCfg()
"""Renderer configuration for the auto-created streaming camera."""
viewport_name: str | None = None
"""Name for a new viewport window when :attr:`create_viewport` is ``True``.
If ``None``, a default name (``"Visualizer Viewport"``) is used.
"""
create_viewport: bool = False
"""If ``True``, create a new viewport window; if ``False``, use the active viewport window."""
headless: bool = False
"""Run without creating viewport windows when supported by the app."""
dock_position: str = "SAME"
"""Dock position for the streaming image panel and any new viewport window.
Options: ``'LEFT'``, ``'RIGHT'``, ``'BOTTOM'``, ``'SAME'``.
.. note::
``'SAME'`` (the default) places the streaming panel as a hidden tab in the
same dock group as the main Viewport — you must click the panel's tab to see it.
Use ``'RIGHT'`` to keep both the Viewport and the streaming panel visible
side-by-side.
"""
window_width: int = 1280
"""Viewport width in pixels (when :attr:`create_viewport` is ``True``)."""
window_height: int = 720
"""Viewport height in pixels (when :attr:`create_viewport` is ``True``)."""
origin_type: str = "world"
"""Frame in which :attr:`~isaaclab.visualizers.VisualizerCfg.eye` and
:attr:`~isaaclab.visualizers.VisualizerCfg.lookat` are interpreted.
Options:
* ``"world"``: global origin.
* ``"env"``: origin of the environment at :attr:`origin_env_index`.
* ``"asset"``: a scene asset (or body) specified by :attr:`origin_track_path`.
"""
origin_env_index: int = 0
"""Index of the environment used as the viewport camera origin.
Only meaningful when :attr:`origin_type` is ``"env"`` or ``"asset"``.
"""
origin_track_path: str | None = None
"""Asset tracking path for the viewport camera origin.
Format: ``"<asset_name>"`` to track the asset root, or ``"<asset_name>/<body_name>"``
to track a specific body on the asset. Required when :attr:`origin_type` is ``"asset"``.
Examples::
origin_track_path = "robot" # track robot root
origin_track_path = "robot/panda_hand" # track panda_hand body on robot
"""
VisualizerCfg 源代码(共用基类)
@configclass
class VisualizerCfg:
"""Base configuration for all visualizer backends.
Note:
This configuration can be used directly as
:attr:`~isaaclab.sim.SimulationCfg.default_visualizer_cfg` to provide shared defaults.
To create a visualizer, use a concrete config from ``isaaclab_visualizers``, such as
``KitVisualizerCfg`` or ``NewtonGLVisualizerCfg``.
"""
class_type: type[BaseVisualizer] | str | None = None
"""Visualizer implementation class. Concrete configs must set this field."""
cloning_contexts: tuple[type | str, ...] = ()
"""Clone contexts that build this visualizer's scene representation from the asset plan."""
# Primary interactive camera settings
eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
"""Interactive visualizer camera eye position in world coordinates."""
lookat: tuple[float, float, float] = (0.0, 0.0, 0.0)
"""Interactive visualizer camera look-at target in world coordinates."""
focal_length: float = 12.0
"""Camera focal length in millimeters for visualizer camera views."""
background_color: tuple[float, float, float] | None = (0.30, 0.55, 0.82)
"""Solid background color as normalized RGB values in ``[0, 1]``.
Kit, Newton GL, and Newton RTX honor this field. Set it to ``None`` to preserve the
backend's native background. Scene lighting remains independent of the visible background.
"""
# ── Streaming view ────────────────────────────────────────────────────────
# Captures pixels from a camera sensor (existing or auto-created), tiles them
# across envs and GT types, and shows the result as an image panel in interactive
# visualizers (Newton GL, Kit) or pushes it per-step to sink-based ones (Rerun, Viser).
streaming_view: bool = False
"""Enable the streaming camera image view (opt-in, disabled by default)."""
# Source — existing sensor (takes priority when set)
streaming_sensor_prim_path: str | None = None
"""Prim path of an existing TiledCamera sensor to stream from.
When set, all ``streaming_cam_*`` fields are ignored. Should point to an
existing camera sensor, e.g. ``"/World/envs/*/Camera"``.
"""
# Source — auto-created camera (used when streaming_sensor_prim_path is None)
streaming_cam_target_prim_path: str | None = None
"""Target prim for the auto-created streaming camera (ignored when
:attr:`streaming_sensor_prim_path` is set).
When ``None`` (the default), the visualizer adopts the first scene camera
sensor it discovers dynamically at initialization time. If no scene camera
exists the streaming panel remains empty. Set this explicitly (e.g.
``"/World/envs/*/Robot"``) only when you need an auto-created follow-camera
and no suitable scene camera is present.
"""
streaming_cam_eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
"""Eye offset [m] for the auto-created streaming camera relative to the target prim."""
streaming_cam_renderer_cfg: RendererCfg | None = None
"""Renderer for the auto-created streaming camera.
Concrete visualizer configs declare their default renderer configuration.
Its ``class_type`` selects the implementation, including custom renderers.
Ignored when :attr:`streaming_sensor_prim_path` is set.
"""
# Shared settings
streaming_envs: int | list[int] = 32
"""Environments to capture.
* ``int`` — sample this many envs once at initialization (from all visible envs).
* ``list[int]`` — capture exactly these env indices.
"""
streaming_gt_types: tuple[str, ...] = ("rgb",)
"""GT data types displayed left-to-right per environment row.
Valid values: ``"rgb"``, ``"depth"``, ``"segmentation"``, ``"normals"``.
Validated against :data:`~isaaclab.envs.utils.camera_colorizer.SUPPORTED_GT_TYPES`
at initialization time (only when :attr:`streaming_view` is ``True``).
"""
streaming_depth_min: float = 0.1
"""Near-clip for the turbo depth colormap [m]. Used when ``"depth"`` is in
:attr:`streaming_gt_types`."""
streaming_depth_max: float = 10.0
"""Far-clip for the turbo depth colormap [m]. Used when ``"depth"`` is in
:attr:`streaming_gt_types`."""
# Partial visualization settings
max_visible_envs: int | None = None
"""Upper bound on how many envs are shown.
* If visible_env_indices is not None, then this field will apply also
to the explicit env indices set to the visible_env_indices.
"""
visible_env_indices: list[int] | None = None
"""env indices to visualize in order (out-of-range indices are dropped)."""
randomly_sample_visible_envs: bool = True
"""If ``max_visible_envs`` is provided, when enabled, selected visible envs are randomly sampled.
If disabled, the first ``max_visible_envs`` envs are selected.
* Note: ``visible_env_indices`` overrides this field.
"""
# Visualization Markers
enable_markers: bool = True
"""Enable visualization markers (debug drawing)."""
# Live Plots
enable_live_plots: bool = True
"""Stream per-step scalar data (manager terms, episode reward, episode length) into the visualizer.
Plot windows start hidden or collapsed by default and can be toggled open at runtime.
Set to ``False`` to disable live plots entirely and avoid any collection overhead.
"""
live_plots_update_interval: int = 5
"""Collect and push live plot data every ``N`` simulation steps (default: every 5 steps)."""
# Internal
visualizer_type: str | None = None
"""Type identifier (e.g., 'newton', 'rerun', 'viser', 'kit'). Must be overridden by subclasses."""
# Deprecated aliases kept for one-release compatibility. Remove in the next major release.
tiled_cam_view: bool | None = None
"""Deprecated. Use :attr:`streaming_view` instead."""
tiled_cam_num: int | None = None
"""Deprecated. Use :attr:`streaming_envs` (int) instead."""
tiled_cam_env_indices: list[int] | None = None
"""Deprecated. Use :attr:`streaming_envs` (list[int]) instead."""
tiled_cam_prim_path: str | None = None
"""Deprecated. Use :attr:`streaming_sensor_prim_path` instead."""
tiled_cam_eye: tuple[float, float, float] | None = None
"""Deprecated. Use :attr:`streaming_cam_eye` instead."""
tiled_cam_target_prim_path: str | None = None
"""Deprecated. Use :attr:`streaming_cam_target_prim_path` instead."""
def __post_init__(self) -> None:
import warnings
if self.background_color is not None:
if len(self.background_color) != 3 or any(not 0.0 <= value <= 1.0 for value in self.background_color):
raise ValueError("background_color must contain three normalized RGB values in [0, 1].")
self.background_color = tuple(float(value) for value in self.background_color)
_simple = [
("tiled_cam_view", "streaming_view"),
("tiled_cam_prim_path", "streaming_sensor_prim_path"),
("tiled_cam_eye", "streaming_cam_eye"),
("tiled_cam_target_prim_path", "streaming_cam_target_prim_path"),
]
for old, new in _simple:
val = getattr(self, old)
if val is not None:
warnings.warn(f"{old!r} is deprecated; use {new!r} instead.", DeprecationWarning, stacklevel=3)
setattr(self, new, val)
setattr(self, old, None)
# tiled_cam_env_indices takes priority over tiled_cam_num
env_indices = getattr(self, "tiled_cam_env_indices")
if env_indices is not None:
warnings.warn(
"'tiled_cam_env_indices' is deprecated; use 'streaming_envs' instead.",
DeprecationWarning,
stacklevel=3,
)
self.streaming_envs = env_indices
self.tiled_cam_env_indices = None
self.tiled_cam_num = None
else:
num = getattr(self, "tiled_cam_num")
if num is not None:
warnings.warn(
"'tiled_cam_num' is deprecated; use 'streaming_envs' instead.",
DeprecationWarning,
stacklevel=3,
)
self.streaming_envs = num
self.tiled_cam_num = None
使用方法#
常用示例#
无界面训练并录制视频
不打开窗口,将 Newton GL 或 Kit 可视化器保持运行,作为视频片段的采集来源:
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole \
--viz newton_gl --headless --video
./isaaclab.sh train --rl_library rsl_rl --task Isaac-Cartpole \
--viz newton_gl --headless --video
片段长度、录制间隔和多数据源选项见 录制视频 。
组合使用交互视图和无界面录制来源
同时配置 Kit 和无界面 Newton GL 可视化器,并在 VideoRecorderCfg 中选择 Newton GL,即可用 Kit 实时查看训练,同时从独立的 Newton GL 视角录制。配置方法见 从独立相机视角录制 。
跟随移动的机器人(Kit)
将 Kit 相机锁定到移动的资产上,无需每一步自行更新 eye / lookat :
from isaaclab_visualizers.kit import KitVisualizerCfg
sim_cfg.visualizer_cfgs = [
KitVisualizerCfg(
origin_type="asset",
origin_track_path="robot", # or "robot/panda_hand" to track a specific body
eye=(4.0, 4.0, 2.0), # offset from the tracked asset
)
]
与远程协作者共享实时画面
Viser 可以为正在运行的会话生成公开分享链接,方便远程协作,无需共享屏幕:
from isaaclab_visualizers.viser import ViserVisualizerCfg
sim_cfg.visualizer_cfgs = [ViserVisualizerCfg(share=True, open_browser=True)]
启动时会在日志中输出分享链接。Rerun 没有对应的配置字段,但其原生界面中提供了分享按钮。
配置解析规则#
可视化器由 --viz (以逗号分隔,例如 --viz kit,newton_gl )或代码中的 SimulationCfg.visualizer_cfgs 决定。不传入 --viz 时使用配置值; --viz none 始终禁用所有可视化器,无论配置如何。
在 --viz kit 或 --viz newton_gl 的基础上加入 --headless ,可使该可视化器保持运行而不显示窗口。例如,在没有显示设备的机器上,将其作为 --video 的录制来源。
如需在代码中配置可视化器,将 VisualizerCfg 实例传给 SimulationCfg :
from isaaclab.sim import SimulationCfg
from isaaclab_visualizers.kit import KitVisualizerCfg
from isaaclab_visualizers.newton import NewtonGLVisualizerCfg
sim_cfg = SimulationCfg(
visualizer_cfgs=[
KitVisualizerCfg(eye=(0.0, 0.0, 20.0)),
NewtonGLVisualizerCfg(eye=(5.0, 5.0, 5.0), show_joints=True),
]
)
命令行参数 |
|
实际行为 |
|---|---|---|
不传入 |
|
不启动可视化器;没有窗口,也没有采集来源。 |
|
|
启动默认的 Kit 和 Newton GL 可视化器。 |
|
|
启动不带窗口的 Newton GL,例如用作 |
|
|
启动默认 Kit 和自定义 Newton GL;不启动 Rerun。 |
不传入 |
|
启动配置中的自定义 Newton GL 和 Rerun。 |
|
|
禁用所有可视化器;没有窗口,也没有采集来源。 |
关于迁移背景,请参阅 迁移到 3.0 。
场景背景#
Kit 默认使用 VisualizerCfg.background_color 指定的纯天蓝色背景。Newton 可视化器将这一默认值改为 None,使 Newton GL 保留其程序化天空,Newton RTX 保留其原生背景。对于任何可视化器,将 background_color 设为 None 会保留后端的原生背景;也可以设置归一化 RGB 颜色,覆盖显示的背景色。场景灯光仍会照亮物体并参与反射:
from isaaclab.visualizers import VisualizerCfg
env_cfg.sim.default_visualizer_cfg = VisualizerCfg(background_color=(0.1, 0.2, 0.3))
性能#
可视化器 |
提示 |
|---|---|
Newton GL |
开销最低;增大 |
Viser |
使用 Newton Warp 渲染器;可通过 |
Newton RTX |
使用路径追踪,单帧开销最高;可通过 |
Rerun |
环境较多时,网页查看器可能变慢;可通过 |
Kit |
在这 5 种可视化器中开销最大;可减小 |
限制#
后端功能支持:
特性 |
Newton GL |
Newton RTX |
Viser |
Rerun |
Kit |
|---|---|---|---|---|---|
可视化标记 |
✓ |
✗ |
✓ |
✓ |
✓ |
实时曲线 |
✓ |
✗ |
✓ |
✓ |
✓ |
相机流面板 |
✓ |
✗ |
✓ |
✓ |
✓ |
视频录制, |
✓ |
✓ |
✗ |
✗ |
✓ |
暂停渲染 |
✓ |
✗ |
✓ |
✓ |
✓ |
无界面模式 |
✓ |
✓ |
✓ |
✓ |
✓ |
各可视化器的光照差异
各后端的光照方式不同,因此同一环境在不同可视化器中可能呈现明显不同的效果。Kit 渲染场景中实际编写的 USD 灯光。Newton GL 使用固定的天空渐变和单个方向光颜色( sky_upper_color 、 sky_lower_color 、 light_color ),不受场景 USD 灯光影响。Newton RTX 仅支持 3 种光照环境预设( rtx_environment : "default" 、 "studio" 、 "none" ),不使用场景中编写的 USD 灯光。Viser 只使用单个环境光,没有方向主光,因此场景通常比其他后端更暗、更缺乏层次。Rerun 使用查看器内置的固定着色方式,不由场景灯光驱动。
Kit:与 ovphysx / ovrtx 预设不兼容
--viz kit 不能在同一进程中与 presets=ovphysx 或 presets=ovrtx 配合使用。请在这些预设下使用 --viz newton_gl 、 --viz rerun 或 --viz viser ,也可以省略 --viz 进行无界面运行。
Newton RTX:与 Kit 不兼容
如果启用的物理后端是 isaacsim_physx (即 presets=isaacsim_physx ), --viz newton_rtx 会在启动时抛出 RuntimeError ,因为 OVRTX 不依赖 Kit,不能与 Kit 共用进程。 presets=ovphysx 本身不依赖 Kit,仍受支持。请将 --viz newton_rtx 与 presets=newton_mjwarp,ovrtx 或 presets=ovphysx,ovrtx 配合使用,或者改用 --viz newton_gl 、 --viz viser 、 --viz rerun ;也可以在兼容 Kit 的物理后端下使用 --viz kit 。
Rerun:大量环境下的性能
环境较多时,Rerun 网页查看器可能变慢或崩溃。可通过 --num_envs 降低负载:
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz rerun --num_envs 512
./isaaclab.sh train --rl_library rsl_rl --task Isaac-Cartpole --viz rerun --num_envs 512
Rerun:首批数据加载前页面为空白
Rerun 浏览器标签页打开后会先显示空白,几秒后才出现场景和实时曲线(视场景大小而定,最长约 10 秒)。这是正常现象:网页查看器需要连接本地 Rerun 服务器并接收首批日志数据。但在此期间页面没有加载提示,看起来可能像是卡住了。无需操作,等待第一帧到达即可。
Newton GL:CUDA/OpenGL 互操作警告
在某些配置下,Newton GL 可视化器会输出关于 CUDA/OpenGL 互操作的警告:
Warning: Could not get MSAA config, falling back to non-AA.
Warp CUDA error 999: unknown error (in function wp_cuda_graphics_register_gl_buffer)
Warp UserWarning: Could not register GL buffer …
可视化器仍能正常工作,但会回退到 CPU 拷贝操作,性能会有所下降。
Newton GL:OpenGL 上下文创建失败
如果 pyglet 提示 glCreateShader 未导出,或需要 OpenGL 2.0,说明进程运行时没有 GPU 支持的显示上下文(例如服务会话,或未启用 GPU 加速的远程桌面)。请在具有 GPU 支持的交互式显示会话中运行,也可以省略 --viz newton_gl ,改为无界面运行。
Newton GL:Spark + conda
通过 conda 安装的 X11 库可能在 Spark 上与 pyglet 冲突,产生如下错误:
pyglet.window.xlib.XlibException: Could not create UTF8 text property
移除存在冲突的 conda 包,改用系统库:
conda remove --force xorg-libx11 libxcb
另请参阅#
在可视化器中显示相机流视图:逐步配置相机流视图
录制视频:从可视化器或传感器录制 MP4 视频片段
创建可视化标记:创建和配置自定义可视化标记
在训练期间采集传感器帧 :在训练期间保存逐帧传感器输出
渲染器 :渲染器后端(RTX、Newton Warp、OVRTX)
场景数据提供器:场景数据如何传递给可视化器
Newton :Newton 后端指南
迁移到 3.0 :可视化器迁移参考