From 6821fe6e2a189e1be5572ba34100c211a5509f3f Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 15 Oct 2026 20:46:01 +0000
Subject: [PATCH 001/140] Add task views to PerspectiveCameraCfg
A perspective view can now frame an environment or follow an asset: env_index
places it relative to an environment origin, and track_path follows an asset's
position and, with follow_heading, its smoothed yaw. CameraFollower turns such
a view into world poses and reseeds the heading when an environment resets.
Visualizers that declare only task views get a free view beside them, and the
scene cameras they would find are kept. Add the viz::tracking video
source, which records the first task view whichever view the window shows.
Builds on the tracking views of #7760 by Antoine Richard.
---
.../changelog.d/task-view-tracking.added.rst | 4 +
.../changelog.d/task-view-tracking.minor | 0
.../isaaclab/envs/utils/video_recorder.py | 10 +-
.../isaaclab/envs/utils/video_recorder_cfg.py | 15 ++-
.../isaaclab/sim/simulation_context.py | 11 +-
.../isaaclab/visualizers/base_visualizer.py | 6 +-
.../isaaclab/visualizers/camera_follower.py | 98 +++++++++++++++++
.../isaaclab/visualizers/visualizer_cfg.py | 60 ++++++++++-
.../isaaclab/test/envs/test_video_recorder.py | 15 +++
.../test/visualizers/test_camera_follower.py | 101 ++++++++++++++++++
10 files changed, 307 insertions(+), 13 deletions(-)
create mode 100644 source/isaaclab/changelog.d/task-view-tracking.added.rst
create mode 100644 source/isaaclab/changelog.d/task-view-tracking.minor
create mode 100644 source/isaaclab/isaaclab/visualizers/camera_follower.py
create mode 100644 source/isaaclab/test/visualizers/test_camera_follower.py
diff --git a/source/isaaclab/changelog.d/task-view-tracking.added.rst b/source/isaaclab/changelog.d/task-view-tracking.added.rst
new file mode 100644
index 000000000000..775a82dcd9fe
--- /dev/null
+++ b/source/isaaclab/changelog.d/task-view-tracking.added.rst
@@ -0,0 +1,4 @@
+* Added ``env_index``, ``track_path``, ``follow_heading``, and ``heading_smoothing_time_constant`` to
+ :class:`~isaaclab.visualizers.PerspectiveCameraCfg`, so a perspective view can frame an environment or follow an asset
+ with smoothed yaw. Added the ``viz::tracking`` video source, which records the first such view whichever view
+ the window shows, for Newton GL.
diff --git a/source/isaaclab/changelog.d/task-view-tracking.minor b/source/isaaclab/changelog.d/task-view-tracking.minor
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/source/isaaclab/isaaclab/envs/utils/video_recorder.py b/source/isaaclab/isaaclab/envs/utils/video_recorder.py
index e389b8d2deee..23e1294e4371 100644
--- a/source/isaaclab/isaaclab/envs/utils/video_recorder.py
+++ b/source/isaaclab/isaaclab/envs/utils/video_recorder.py
@@ -68,7 +68,15 @@ def __init__(self, cfg: VideoRecorderCfg, env: object):
if channel == "streaming_view" and not viz.cfg.streaming_view:
raise RuntimeError(f"Enable streaming_view on {viz.cfg.visualizer_type!r} to record its sensor view.")
# Legacy recording follows camera selection in the window.
- self._capture = viz.render_tiled_rgb_array if channel == "streaming_view" else viz.render_rgb_array
+ if channel == "tracking":
+ if viz.cfg.visualizer_type != "newton_gl":
+ raise RuntimeError(
+ f"The {viz.cfg.visualizer_type!r} visualizer cannot record a tracking view. Use "
+ "'viz:newton_gl:tracking'."
+ )
+ self._capture = viz.render_task_view_rgb_array
+ else:
+ self._capture = viz.render_tiled_rgb_array if channel == "streaming_view" else viz.render_rgb_array
self.cfg = cfg
self._env = env
diff --git a/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py b/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
index 80092ae68855..9d0ec4374cff 100644
--- a/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
+++ b/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
@@ -23,9 +23,9 @@ def parse_video_source(source: str) -> tuple[str, str, str]:
"""Split a string :attr:`VideoRecorderCfg.source` into ``(kind, name, sub)``.
``kind`` is ``"viz"`` or ``"sensor"``; ``name`` is the canonical visualizer type (``""`` for a bare
- ``"viz"``) or the sensor name; ``sub`` is ``"streaming_view"``, a sensor channel, or ``""``. The prefix
- ``visualizer`` is the long form of ``viz``, as ``--visualizer`` is of ``--viz``; the deprecated ``newton``
- type is mapped to ``newton_gl`` with a :class:`DeprecationWarning`.
+ ``"viz"``) or the sensor name; ``sub`` is ``"streaming_view"``, ``"tracking"``, a sensor channel, or ``""``.
+ The prefix ``visualizer`` is the long form of ``viz``, as ``--visualizer`` is of ``--viz``; the deprecated
+ ``newton`` type is mapped to ``newton_gl`` with a :class:`DeprecationWarning`.
A bare visualizer type is shorthand for ``viz:``.
Raises:
@@ -38,7 +38,11 @@ def parse_video_source(source: str) -> tuple[str, str, str]:
name, sub = (*parts, "", "")[:2]
if kind == "viz" and not parts:
return kind, "", ""
- if kind == "viz" and parts[1:] in ([], ["streaming_view"]) and name in (*VISUALIZER_TYPES, *VISUALIZER_ALIASES):
+ if (
+ kind == "viz"
+ and parts[1:] in ([], ["streaming_view"], ["tracking"])
+ and name in (*VISUALIZER_TYPES, *VISUALIZER_ALIASES)
+ ):
if name in VISUALIZER_ALIASES:
warnings.warn(
f"Video source type {name!r} is deprecated. Use {VISUALIZER_ALIASES[name]!r} instead.",
@@ -74,6 +78,9 @@ class VideoRecorderCfg:
camera: the one ``--viz`` selected, else a headless one added for the recording.
* ``"viz::streaming_view"`` – the streaming camera panel of that visualizer (requires
``streaming_view=True`` on its config, e.g. :class:`~isaaclab_visualizers.kit.KitVisualizerCfg`).
+ * ``"viz::tracking"`` – the first perspective view of that visualizer that is tied to an
+ environment or an asset (:class:`~isaaclab.visualizers.PerspectiveCameraCfg` with ``env_index`` or
+ ``track_path``), whichever view its window shows. Only Newton GL supports it.
* ``"sensor:"`` – scene sensor, RGB channel (default); no visualizer is added.
* ``"sensor::"`` – scene sensor channel: ``rgb``, ``depth`` (colorized via the turbo
colormap), ``segmentation`` or ``normals`` (colorized).
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index a35f849a9925..1ffb5f862768 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -40,6 +40,7 @@
VISUALIZER_TYPES,
PerspectiveCameraCfg,
SceneCameraCfg,
+ with_free_view,
)
from .utils import create_new_stage
from .utils import stage as stage_utils
@@ -461,12 +462,18 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
eye=visualizer.cfg.eye, lookat=visualizer.cfg.lookat, focal_length=visualizer.cfg.focal_length
)
]) # fmt: skip
+ cameras = with_free_view(cameras, visualizer.cfg.eye, visualizer.cfg.lookat, visualizer.cfg.focal_length)
if visualizer.cfg.view is None and visualizer.cfg.streaming_view:
sensors = self._scene_data_provider.get_camera_sensors()
env_template = self._clone_plan.env_template if self._clone_plan is not None else DEFAULT_ENV_TEMPLATE
for gt_type in visualizer.cfg.streaming_gt_types:
sensor_key_for_gt_type(gt_type)
- if visualizer.cfg.cameras is None:
+ # task views only add to the scene cameras the visualizer would find on its own
+ task_views_only = bool(visualizer.cfg.cameras) and all(
+ isinstance(camera, PerspectiveCameraCfg) and camera.is_task_view
+ for camera in visualizer.cfg.cameras
+ )
+ if visualizer.cfg.cameras is None or task_views_only:
if visualizer.cfg.streaming_sensor_prim_path is not None:
cameras.insert(0, SceneCameraCfg(prim_path=visualizer.cfg.streaming_sensor_prim_path))
else:
@@ -499,6 +506,8 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
f"Declare a CameraCfg in the scene; available paths: {available_paths}."
)
cameras[index] = camera
+ # scene cameras follow the free view, and task views come last
+ cameras.sort(key=lambda camera: isinstance(camera, PerspectiveCameraCfg) and camera.is_task_view)
visualizer.initialize(self, cameras=cameras)
self._pending_visualizers.remove(visualizer)
self._visualizers.append(visualizer)
diff --git a/source/isaaclab/isaaclab/visualizers/base_visualizer.py b/source/isaaclab/isaaclab/visualizers/base_visualizer.py
index 3a3c3377ebf7..77d507aee3b2 100644
--- a/source/isaaclab/isaaclab/visualizers/base_visualizer.py
+++ b/source/isaaclab/isaaclab/visualizers/base_visualizer.py
@@ -333,9 +333,9 @@ def set_camera_view(self, eye: tuple, target: tuple) -> None:
"""
pass
- def _focal_length_to_vertical_fov_degrees(self) -> float:
- """Convert cfg focal length to vertical FOV using USD's default aperture."""
- focal_length = float(self.cfg.focal_length)
+ def _focal_length_to_vertical_fov_degrees(self, focal_length: float | None = None) -> float:
+ """Convert a focal length, by default the config's, to vertical FOV using USD's default aperture."""
+ focal_length = float(self.cfg.focal_length if focal_length is None else focal_length)
if focal_length <= 0.0:
raise ValueError("VisualizerCfg.focal_length must be positive.")
return math.degrees(2.0 * math.atan(_USD_DEFAULT_VERTICAL_APERTURE_MM / (2.0 * focal_length)))
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
new file mode 100644
index 000000000000..204843c42363
--- /dev/null
+++ b/source/isaaclab/isaaclab/visualizers/camera_follower.py
@@ -0,0 +1,98 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""World poses for perspective views tied to an environment or an asset."""
+
+from __future__ import annotations
+
+import math
+from typing import TYPE_CHECKING
+
+import torch
+
+if TYPE_CHECKING:
+ from ..scene import InteractiveScene
+ from .visualizer_cfg import PerspectiveCameraCfg
+
+_RESET_JUMP = 1.0
+"""Distance [m] an asset moves between two updates only when its environment resets."""
+
+
+class CameraFollower:
+ """Turns a :class:`~isaaclab.visualizers.PerspectiveCameraCfg` tied to an environment into world poses.
+
+ A view that only has :attr:`~isaaclab.visualizers.PerspectiveCameraCfg.env_index` stays fixed relative to that
+ environment's origin. A view with :attr:`~isaaclab.visualizers.PerspectiveCameraCfg.track_path` follows the
+ asset's position, and its yaw when ``follow_heading`` is set, with the heading filtered over time.
+ """
+
+ def __init__(self, cfg: PerspectiveCameraCfg, scene: InteractiveScene) -> None:
+ self.cfg = cfg
+ self._scene = scene
+ self._env = cfg.env_index or 0
+ if not 0 <= self._env < scene.num_envs:
+ raise ValueError(f"env_index {self._env} is outside the {scene.num_envs} environments of the scene.")
+ self._asset = None
+ self._body_index: int | None = None
+ self._body_name = ""
+ if cfg.track_path:
+ asset_name, _, self._body_name = cfg.track_path.partition("/")
+ try:
+ self._asset = scene[asset_name]
+ except KeyError as exc:
+ raise ValueError(f"track_path refers to an unknown scene asset: {asset_name!r}.") from exc
+ self._yaw: float | None = None
+ self._last_position: torch.Tensor | None = None
+
+ def pose(self, dt: float) -> tuple[tuple[float, float, float], tuple[float, float, float]] | None:
+ """Return the world eye and look-at target after *dt* [s] of simulation, or None until the asset is ready.
+
+ Args:
+ dt: Simulation time since the previous call [s]; only the heading filter uses it.
+ """
+ cfg = self.cfg
+ origin = self._scene.env_origins[self._env]
+ offsets = torch.tensor((cfg.eye, cfg.lookat), dtype=torch.float32, device=origin.device)
+ if self._asset is None:
+ eye, target = (origin + offsets).tolist()
+ return tuple(eye), tuple(target)
+ asset = self._asset
+ if not asset.is_initialized:
+ return None
+ data = asset.data
+ if self._body_name:
+ if self._body_index is None:
+ body_ids, _ = asset.find_bodies(self._body_name)
+ if len(body_ids) != 1:
+ raise ValueError(f"track_path must match exactly one body: {cfg.track_path!r}.")
+ self._body_index = body_ids[0]
+ position = data.body_pos_w.torch[self._env, self._body_index]
+ quat = data.body_quat_w.torch[self._env, self._body_index]
+ else:
+ position, quat = data.root_pos_w.torch[self._env], data.root_quat_w.torch[self._env]
+ if cfg.follow_heading:
+ # one device-to-host copy per frame
+ state = torch.cat((position, quat)).tolist()
+ yaw = self._filtered_yaw(state[3:], state[:3], dt)
+ cos, sin = math.cos(yaw), math.sin(yaw)
+ rotation = torch.tensor(((cos, -sin, 0.0), (sin, cos, 0.0), (0.0, 0.0, 1.0)), device=offsets.device)
+ offsets = offsets @ rotation.T
+ eye, target = (position + offsets).tolist()
+ return tuple(eye), tuple(target)
+
+ def _filtered_yaw(self, quat: list[float], position: list[float], dt: float) -> float:
+ """Return the yaw of the xyzw *quat*, filtered along the shortest rotation.
+
+ The first sample, and the sample after an environment resets and moves the asset, is not filtered.
+ """
+ x, y, z, w = quat
+ yaw = math.atan2(2.0 * (w * z + x * y), 1.0 - 2.0 * (y * y + z * z))
+ last, self._last_position = self._last_position, position
+ reset = self._yaw is None or last is None or math.dist(position, last) > _RESET_JUMP
+ tau = self.cfg.heading_smoothing_time_constant
+ if tau > 0.0 and not reset:
+ yaw = self._yaw + -math.expm1(-dt / tau) * math.remainder(yaw - self._yaw, math.tau)
+ self._yaw = yaw
+ return yaw
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index a17d7b9aba36..df520dbe4ad0 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -60,17 +60,69 @@ def parse_visualizer_csv(value: str | list[str]) -> list[str]:
@configclass
class PerspectiveCameraCfg:
- """Initial pose and optics for a visualizer-owned interactive perspective camera."""
+ """Pose and optics for a visualizer-owned perspective camera.
+
+ By default the pose is in world coordinates. With :attr:`env_index` or :attr:`track_path` set, the view is tied
+ to an environment or to an asset in it, so it frames that robot however the scene is laid out, and the
+ visualizer renders it from the viewer camera. Nothing is created in the scene.
+ """
eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
- """Eye position in world coordinates [m]."""
+ """Eye position [m]: world coordinates, or an offset from the environment origin or the tracked asset."""
lookat: tuple[float, float, float] = (0.0, 0.0, 0.0)
- """Look-at target in world coordinates [m]."""
+ """Look-at target [m], in the same frame as :attr:`eye`."""
focal_length: float = 12.0
"""Perspective camera focal length [mm]."""
+ env_index: int | None = None
+ """Environment whose origin :attr:`eye` and :attr:`lookat` are relative to; None keeps world coordinates.
+
+ With :attr:`track_path` it is the environment of the tracked asset, and None means environment 0.
+ """
+
+ track_path: str | None = None
+ """Scene asset the view follows, or None for a view fixed relative to the environment origin.
+
+ Use ``"robot"`` for an asset root or ``"robot/base"`` for a named body, which must match exactly one body.
+ """
+
+ follow_heading: bool = False
+ """Rotate :attr:`eye` and :attr:`lookat` with the tracked asset's yaw, keeping the horizon level.
+
+ Without it the offsets stay aligned with the world axes. Only used with :attr:`track_path`.
+ """
+
+ heading_smoothing_time_constant: float = 0.0
+ """Exponential heading-filter time constant [s]; zero follows the heading immediately.
+
+ Larger values damp rapid turns more, with more lag. Only used with :attr:`follow_heading`.
+ """
+
+ @property
+ def is_task_view(self) -> bool:
+ """Whether the view is tied to an environment or an asset, not fixed in the world."""
+ return self.env_index is not None or self.track_path is not None
+
+ def __post_init__(self) -> None:
+ if self.env_index is not None and self.env_index < 0:
+ raise ValueError("env_index must be non-negative.")
+ if not math.isfinite(self.heading_smoothing_time_constant) or self.heading_smoothing_time_constant < 0.0:
+ raise ValueError("heading_smoothing_time_constant must be finite and non-negative.")
+
+
+def with_free_view(cameras: list, eye: tuple, lookat: tuple, focal_length: float) -> list:
+ """Return *cameras*, preceded by a free perspective view when it has task views but no free view of its own.
+
+ A task view follows a robot or frames an environment, so the interactive view that a user moves stays
+ available beside it, at the visualizer's own ``eye``, ``lookat`` and ``focal_length``.
+ """
+ perspective = [camera for camera in cameras if isinstance(camera, PerspectiveCameraCfg)]
+ if any(camera.is_task_view for camera in perspective) and all(camera.is_task_view for camera in perspective):
+ return [PerspectiveCameraCfg(eye=eye, lookat=lookat, focal_length=focal_length), *cameras]
+ return cameras
+
@configclass
class SceneCameraCfg:
@@ -300,5 +352,5 @@ def __post_init__(self) -> None:
if not self.cameras:
raise ValueError("cameras must contain at least one display source.")
self.streaming_view = any(isinstance(camera, SceneCameraCfg) for camera in self.cameras)
- if isinstance(camera := self.cameras[0], PerspectiveCameraCfg):
+ if isinstance(camera := self.cameras[0], PerspectiveCameraCfg) and not camera.is_task_view:
self.eye, self.lookat, self.focal_length = camera.eye, camera.lookat, camera.focal_length
diff --git a/source/isaaclab/test/envs/test_video_recorder.py b/source/isaaclab/test/envs/test_video_recorder.py
index 5bba9662a64e..674cdec825ca 100644
--- a/source/isaaclab/test/envs/test_video_recorder.py
+++ b/source/isaaclab/test/envs/test_video_recorder.py
@@ -97,6 +97,7 @@ def _make_env(visualizers=(), sensors: dict | None = None):
("viser", ("viz", "viser", "")),
("rerun", ("viz", "rerun", "")),
("viz:newton_gl:streaming_view", ("viz", "newton_gl", "streaming_view")),
+ ("viz:newton_gl:tracking", ("viz", "newton_gl", "tracking")),
("sensor:tiled_camera", ("sensor", "tiled_camera", "")),
("sensor:tiled_camera:depth", ("sensor", "tiled_camera", "depth")),
# ``visualizer`` is the long form of ``viz``
@@ -258,6 +259,20 @@ def test_source_resolves_frame(source, make_env, caplog):
assert not caplog.records
+def test_a_tracking_source_records_the_task_view_not_the_selected_one():
+ viz = _FakeViz("newton_gl")
+ task_frame = np.full_like(_FRAME, 7)
+ viz.render_task_view_rgb_array = lambda: task_frame
+ recorder = VideoRecorder(_cfg(source="viz:newton_gl:tracking"), _make_env(visualizers=[viz]))
+ assert recorder._capture() is task_frame
+ assert viz.render_calls == 0
+
+
+def test_a_visualizer_without_task_views_cannot_record_tracking():
+ with pytest.raises(RuntimeError, match="cannot record a tracking view"):
+ VideoRecorder(_cfg(source="viz:kit:tracking"), _make_env(visualizers=[_FakeViz("kit")]))
+
+
@pytest.mark.parametrize(
"source,make_env,error,message",
[
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
new file mode 100644
index 000000000000..8e33f2ac8f7d
--- /dev/null
+++ b/source/isaaclab/test/visualizers/test_camera_follower.py
@@ -0,0 +1,101 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Unit tests for perspective views tied to an environment or an asset."""
+
+from __future__ import annotations
+
+import math
+from types import SimpleNamespace
+
+import pytest
+import torch
+
+from isaaclab.visualizers import PerspectiveCameraCfg, SceneCameraCfg, VisualizerCfg
+from isaaclab.visualizers.camera_follower import CameraFollower
+from isaaclab.visualizers.visualizer_cfg import with_free_view
+
+
+def _quat_z(yaw: float) -> list[float]:
+ """Quaternion (x, y, z, w) of a rotation of *yaw* about +Z."""
+ return [0.0, 0.0, math.sin(yaw / 2), math.cos(yaw / 2)]
+
+
+class _Scene:
+ """Two environments, 10 m apart, with a robot at the origin of the second."""
+
+ num_envs = 2
+ env_origins = torch.tensor([[0.0, 0.0, 0.0], [10.0, 0.0, 0.0]])
+
+ def __init__(self, ready: bool = True):
+ data = SimpleNamespace(
+ root_pos_w=SimpleNamespace(torch=torch.tensor([[0.0, 0.0, 0.5], [10.0, 0.0, 0.5]])),
+ root_quat_w=SimpleNamespace(torch=torch.tensor([[0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 0.0, 1.0]])),
+ )
+ self.robot = SimpleNamespace(is_initialized=ready, data=data)
+
+ def __getitem__(self, name):
+ return self.robot
+
+
+def _eye(follower: CameraFollower) -> torch.Tensor:
+ return torch.tensor(follower.pose(0.1)[0])
+
+
+def test_a_view_with_an_environment_stays_fixed_relative_to_its_origin():
+ cfg = PerspectiveCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0))
+ eye, target = CameraFollower(cfg, _Scene()).pose(0.1)
+ assert eye == (11.0, 2.0, 3.0)
+ assert target == (10.0, 0.0, 1.0)
+
+
+def test_a_tracked_view_follows_the_asset_and_rotates_with_its_heading():
+ scene = _Scene()
+ cfg = PerspectiveCameraCfg(env_index=1, track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
+ follower = CameraFollower(cfg, scene)
+ torch.testing.assert_close(_eye(follower), torch.tensor([7.0, 0.0, 1.5]))
+ # turned a quarter turn, the robot's back is at -y
+ scene.robot.data.root_quat_w.torch[1] = torch.tensor(_quat_z(math.pi / 2))
+ torch.testing.assert_close(_eye(follower), torch.tensor([10.0, -3.0, 1.5]), atol=1e-5, rtol=0)
+ # without heading the offsets stay aligned with the world axes
+ cfg.follow_heading = False
+ torch.testing.assert_close(_eye(follower), torch.tensor([7.0, 0.0, 1.5]))
+
+
+def test_smoothing_lags_a_turn_but_not_the_first_sample_or_a_reset():
+ def run(jump: float) -> torch.Tensor:
+ scene = _Scene()
+ cfg = PerspectiveCameraCfg(track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
+ cfg.heading_smoothing_time_constant = 0.5
+ follower = CameraFollower(cfg, scene)
+ follower.pose(0.1)
+ scene.robot.data.root_quat_w.torch[0] = torch.tensor(_quat_z(math.pi / 2))
+ scene.robot.data.root_pos_w.torch[0, 0] += jump # an environment reset moves the asset
+ return _eye(follower)
+
+ smooth, reset = run(0.0), run(5.0)
+ assert smooth[1] > -2.0 # still mostly behind the old heading
+ torch.testing.assert_close(reset[1] - 0.0, torch.tensor(-3.0), atol=1e-4, rtol=0) # the new heading at once
+
+
+def test_a_view_waits_for_its_asset_and_rejects_bad_targets():
+ assert CameraFollower(PerspectiveCameraCfg(track_path="robot"), _Scene(ready=False)).pose(0.1) is None
+ with pytest.raises(ValueError, match="outside"):
+ CameraFollower(PerspectiveCameraCfg(env_index=2), _Scene())
+ with pytest.raises(ValueError, match="non-negative"):
+ PerspectiveCameraCfg(env_index=-1)
+ with pytest.raises(ValueError, match="non-negative"):
+ PerspectiveCameraCfg(heading_smoothing_time_constant=-1.0)
+
+
+def test_task_views_get_a_free_view_beside_them():
+ free, task = PerspectiveCameraCfg(), PerspectiveCameraCfg(env_index=0)
+ args = ((1.0, 2.0, 3.0), (0.0, 0.0, 0.0), 30.0)
+ assert with_free_view([task], *args)[0].eye == (1.0, 2.0, 3.0)
+ assert len(with_free_view([task], *args)) == 2
+ assert with_free_view([free, task], *args) == [free, task]
+ assert with_free_view([SceneCameraCfg(prim_path="/cam")], *args) == [SceneCameraCfg(prim_path="/cam")]
+ # a task view first does not replace the visualizer's own pose
+ assert VisualizerCfg(eye=(7.0, 0.0, 0.0), cameras=[task]).eye == (7.0, 0.0, 0.0)
From 17a6ab6747bcd6e4447b314e4f957cef41368ef9 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 15 Oct 2026 20:46:02 +0000
Subject: [PATCH 002/140] Render task views from the Newton GL viewer camera
Each perspective view renders itself, so a task view appears in Camera View
and the interactive view stays free. A recorder captures a task view by
borrowing the viewer camera for one frame and handing it back, so it does not
need the window to show that view. Nothing is created in the scene.
---
.../changelog.d/task-view-tracking.added.rst | 2 +
.../changelog.d/task-view-tracking.minor | 0
.../newton/newton_visualizer.py | 88 ++++++++++++--
.../test/test_newton_adapter.py | 3 +-
.../test/test_newton_task_views.py | 108 ++++++++++++++++++
5 files changed, 190 insertions(+), 11 deletions(-)
create mode 100644 source/isaaclab_visualizers/changelog.d/task-view-tracking.added.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/task-view-tracking.minor
create mode 100644 source/isaaclab_visualizers/test/test_newton_task_views.py
diff --git a/source/isaaclab_visualizers/changelog.d/task-view-tracking.added.rst b/source/isaaclab_visualizers/changelog.d/task-view-tracking.added.rst
new file mode 100644
index 000000000000..3e29d517420b
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/task-view-tracking.added.rst
@@ -0,0 +1,2 @@
+* Added task views to the Newton GL visualizer: perspective views tied to an environment or an asset are
+ rendered from the viewer camera, selectable in **Camera View**, and recordable without changing the window's view.
diff --git a/source/isaaclab_visualizers/changelog.d/task-view-tracking.minor b/source/isaaclab_visualizers/changelog.d/task-view-tracking.minor
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index e642f107c325..f5fe17cb8fc4 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -47,6 +47,7 @@
from isaaclab.utils.backend_utils import FactoryBase
from isaaclab.utils.math import quat_apply, quat_from_matrix, quat_mul
from isaaclab.visualizers.base_visualizer import BaseVisualizer
+from isaaclab.visualizers.camera_follower import CameraFollower
from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg, WindowCfg
from isaaclab_visualizers.desktop_entry import write_desktop_entry
@@ -501,10 +502,16 @@ def __init__(self, cfg):
self._last_present_time = -math.inf
self._last_render_step = -1
self._pending_mesh_submissions: dict[str, Callable[[], None]] = {}
+ self._followers: dict[object, CameraFollower] = {}
+ self._follow_time = 0.0
def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraCfg | Camera]) -> None:
"""Bind scene data and the Newton model shared with the simulation."""
super().initialize(sim, cameras=cameras)
+ # each perspective view renders itself, so a recorder can capture one the window does not show
+ for view in self._image_views:
+ if view.camera is None:
+ view.render = partial(self._capture_view, view)
self.newton_cfg = NewtonBackendCfg(physics_cfg=sim.cfg.physics, device=sim.device)
self.backend = self._sim.get_or_create_backend(self.newton_cfg)
self._transform_mapping = self._sim.get_scene_data_provider().create_mapping(
@@ -594,15 +601,12 @@ def _select_camera(self, index: int) -> None:
camera = self.current_image_view.cfg.source
self.current_image_view.invalidate()
if isinstance(camera, PerspectiveCameraCfg):
- if (
- self.current_image_view.render is not None
- and self.current_image_view.render != self._capture_perspective
- ):
- raise ValueError("A perspective image view must have exactly one rendering owner.")
- self.current_image_view.render = self._capture_perspective
- self.set_camera_view(camera.eye, camera.lookat)
- self.cfg.focal_length = camera.focal_length
- self._viewer.camera.fov = self._focal_length_to_vertical_fov_degrees()
+ if camera.is_task_view:
+ self._apply_view_pose(self.current_image_view)
+ else:
+ self.set_camera_view(camera.eye, camera.lookat)
+ self.cfg.focal_length = camera.focal_length
+ self._viewer.camera.fov = self._focal_length_to_vertical_fov_degrees()
if self._viewer.picking is not None:
# Release an existing drag without replacing any graph-captured picking buffers.
self._viewer.picking.release()
@@ -625,6 +629,51 @@ def _navigate_scene_camera(self) -> None:
camera.set_world_poses(positions + translation, quat_mul(orientations, rotation), convention="opengl")
self.current_image_view.invalidate()
+ def _apply_view_pose(self, view) -> bool:
+ """Point the viewer camera where a perspective *view* looks, leaving the configured poses untouched.
+
+ Returns:
+ Whether the view had a pose yet; a view that follows an asset has none until the asset is ready.
+ """
+ source = view.cfg.source
+ if source.is_task_view:
+ follower = self._followers.get(view)
+ if follower is None:
+ scene = self._sim.get_scene_data_provider().get_interactive_scene()
+ if scene is None:
+ return False
+ follower = self._followers[view] = CameraFollower(source, scene)
+ sim_time = self._sim.get_physics_step_count() * self._sim.get_physics_dt()
+ pose = follower.pose(max(sim_time - self._follow_time, 0.0))
+ self._follow_time = sim_time
+ if pose is None:
+ return False
+ else:
+ pose = (source.eye, source.lookat)
+ camera = self._viewer.camera
+ camera.pos = PygletVec3(*pose[0])
+ camera.look_at(pose[1])
+ self._viewer.set_camera(camera.pos, camera.pitch, camera.yaw)
+ camera.fov = self._focal_length_to_vertical_fov_degrees(source.focal_length)
+ return True
+
+ def _capture_view(self, view, output: wp.array | None) -> wp.array:
+ """Capture a perspective *view*, borrowing the viewer camera when the window shows another one."""
+ current = self.current_image_view
+ if view is current:
+ return self._capture_perspective(output)
+ camera = self._viewer.camera
+ saved = (PygletVec3(camera.pos.x, camera.pos.y, camera.pos.z), camera.pitch, camera.yaw, camera.fov)
+ self.current_image_view = view
+ try:
+ self._last_render_step = -1
+ return self._capture_perspective(output)
+ finally:
+ self.current_image_view = current
+ camera.fov = saved[3]
+ self._viewer.set_camera(*saved[:3])
+ self._last_render_step = -1
+
def set_camera_view(
self, eye: tuple[float, float, float] | list[float], target: tuple[float, float, float] | list[float]
) -> None:
@@ -674,9 +723,10 @@ def close(self) -> None:
"""Detach perspective producers before releasing the visualizer's borrowed views."""
self._pending_mesh_submissions.clear()
for view in self._image_views:
- if view.render == self._capture_perspective:
+ if view.camera is None:
view.render = None
view.invalidate()
+ self._followers.clear()
super().close()
def supports_markers(self) -> bool:
@@ -738,6 +788,18 @@ def render_rgb_array(self) -> np.ndarray:
raise RuntimeError("The visualizer must be initialized before capturing an image.")
return self.current_image_view.read_rgb(self._sim.get_physics_step_count())
+ def render_task_view_rgb_array(self) -> np.ndarray:
+ """Download the first perspective view that is tied to an environment or an asset, whatever the window shows."""
+ view = next(
+ (v for v in self._image_views if v.camera is None and getattr(v.cfg.source, "is_task_view", False)), None
+ )
+ if view is None:
+ raise RuntimeError(
+ "No perspective view is tied to an environment or an asset. Declare "
+ "PerspectiveCameraCfg(env_index=..., track_path=...) in the visualizer's cameras."
+ )
+ return view.read_rgb(self._sim.get_physics_step_count())
+
class NewtonGLVisualizer(NewtonVisualizerBase):
"""Newton model rendering, picking, and contact overlays used by the GL visualizer."""
@@ -883,6 +945,9 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
def _render_frame(self) -> None:
"""Render one GL frame for the window or an on-demand capture."""
viewer = self._viewer
+ view = self.current_image_view
+ if view.camera is None and getattr(view.cfg.source, "is_task_view", False):
+ self._apply_view_pose(view)
viewer.begin_frame(self._sim_time)
try:
if self.current_image_view.camera is not None:
@@ -1230,6 +1295,9 @@ def _update_geometries(self) -> None:
def _render_frame(self) -> None:
"""Update controls and publish GPU poses or sensor pixels to Newton once per frame."""
viewer = self._viewer
+ view = self.current_image_view
+ if view.camera is None and getattr(view.cfg.source, "is_task_view", False):
+ self._apply_view_pose(view)
viewer.begin_frame(self._sim_time)
try:
if self.current_image_view.camera is not None:
diff --git a/source/isaaclab_visualizers/test/test_newton_adapter.py b/source/isaaclab_visualizers/test/test_newton_adapter.py
index 713be54faa4c..fe73787c9d51 100644
--- a/source/isaaclab_visualizers/test/test_newton_adapter.py
+++ b/source/isaaclab_visualizers/test/test_newton_adapter.py
@@ -916,7 +916,8 @@ def test_newton_scene_camera_controls_apply_uniformly_to_active_copies(monkeypat
back_frame = back.frame.torch.clone()
assert visualizer.current_image_view.camera is None
assert isinstance(visualizer._image_views[0].cfg.source, PerspectiveCameraCfg)
- assert [view.camera.cfg.prim_path for view in visualizer._image_views[1:]] == [
+ # the task's own task view comes after the scene cameras
+ assert [view.camera.cfg.prim_path for view in visualizer._image_views[1:] if view.camera is not None] == [
color.cfg.prim_path,
back.cfg.prim_path,
]
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
new file mode 100644
index 000000000000..ea54a5581d01
--- /dev/null
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -0,0 +1,108 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Unit tests for Newton viewer perspective views that follow an asset or frame an environment."""
+
+from __future__ import annotations
+
+from types import SimpleNamespace
+
+import pytest
+import torch
+
+pytest.importorskip("newton")
+from isaaclab_visualizers.newton.newton_visualizer import NewtonVisualizerBase
+from pyglet.math import Vec3
+
+from isaaclab.visualizers import PerspectiveCameraCfg
+
+
+class _Camera:
+ """The viewer camera: a position, a look-at target stored as angles, and a field of view."""
+
+ def __init__(self):
+ self.pos, self.pitch, self.yaw, self.fov = Vec3(1.0, 1.0, 1.0), 0.1, 0.2, 40.0
+ self.target = None
+
+ def look_at(self, target):
+ self.target = tuple(target)
+
+
+class _Scene:
+ num_envs = 2
+ env_origins = torch.tensor([[0.0, 0.0, 0.0], [10.0, 0.0, 0.0]])
+
+
+def _visualizer(views) -> NewtonVisualizerBase:
+ viz = NewtonVisualizerBase.__new__(NewtonVisualizerBase)
+ viz.cfg = SimpleNamespace(focal_length=12.0, eye=(4.0, -4.0, 3.0), lookat=(0.0, 0.0, 0.0))
+ viz._followers, viz._follow_time, viz._last_render_step = {}, 0.0, 5
+ camera = _Camera()
+
+ def set_camera(pos, pitch, yaw):
+ camera.pos, camera.pitch, camera.yaw = pos, pitch, yaw
+
+ viz._viewer = SimpleNamespace(camera=camera, set_camera=set_camera)
+ viz._sim = SimpleNamespace(
+ get_scene_data_provider=lambda: SimpleNamespace(get_interactive_scene=lambda: _Scene()),
+ get_physics_step_count=lambda: 10,
+ get_physics_dt=lambda: 0.1,
+ )
+ viz._image_views = list(views)
+ viz.current_image_view = viz._image_views[0]
+ return viz
+
+
+class _View:
+ """A perspective image view: hashable like the real one, with no scene camera."""
+
+ camera, render = None, None
+
+ def __init__(self, cfg: PerspectiveCameraCfg):
+ self.cfg = SimpleNamespace(source=cfg)
+
+
+def _view(cfg: PerspectiveCameraCfg) -> _View:
+ return _View(cfg)
+
+
+def test_a_task_view_points_the_viewer_without_changing_the_configured_pose():
+ task = _view(PerspectiveCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0), focal_length=24.0))
+ viz = _visualizer([task])
+ assert viz._apply_view_pose(task)
+ camera = viz._viewer.camera
+ assert (camera.pos.x, camera.pos.y, camera.pos.z) == (11.0, 2.0, 3.0)
+ assert camera.target == (10.0, 0.0, 1.0)
+ assert camera.fov == pytest.approx(viz._focal_length_to_vertical_fov_degrees(24.0))
+ assert viz.cfg.eye == (4.0, -4.0, 3.0) and viz.cfg.focal_length == 12.0
+
+
+def test_capturing_another_view_hands_the_viewer_camera_back():
+ free, task = _view(PerspectiveCameraCfg()), _view(PerspectiveCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0)))
+ viz = _visualizer([free, task])
+ seen = {}
+
+ def capture(output):
+ # the window's own view is borrowed for the capture, and the camera moves while it renders
+ seen["view"] = viz.current_image_view
+ viz._viewer.camera.pos, viz._viewer.camera.fov = Vec3(11.0, 2.0, 3.0), 20.0
+ return "frame"
+
+ viz._capture_perspective = capture
+ assert viz._capture_view(task, None) == "frame"
+ assert seen["view"] is task
+ camera = viz._viewer.camera
+ assert (camera.pos.x, camera.pos.y, camera.pos.z, camera.fov) == (1.0, 1.0, 1.0, 40.0)
+ assert viz.current_image_view is free and viz._last_render_step == -1
+
+
+def test_the_task_view_recording_picks_the_first_tied_view_and_reports_none():
+ free, task = _view(PerspectiveCameraCfg()), _view(PerspectiveCameraCfg(track_path="robot"))
+ viz = _visualizer([free, task])
+ viz._sim.get_physics_step_count = lambda: 3
+ task.read_rgb = lambda step: ("task", step)
+ assert viz.render_task_view_rgb_array() == ("task", 3)
+ with pytest.raises(RuntimeError, match="tied to an environment or an asset"):
+ _visualizer([free]).render_task_view_rgb_array()
From 866763bb6c6799512ecfcf92b52896d9e0dcb43e Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 15 Oct 2026 20:46:02 +0000
Subject: [PATCH 003/140] Declare task views for the core tasks
Fixed environment views and robot-following views for the locomotion tasks,
with the framings of #7760. Each task keeps its own viewport pose.
---
.../changelog.d/task-view-tracking.added.rst | 2 ++
.../changelog.d/task-view-tracking.minor | 0
.../core/cabinet/cabinet_env_cfg.py | 19 ++++++++++++++-----
.../cartpole_direct_camera_env_cfg.py | 5 ++---
.../core/cartpole/cartpole_direct_env_cfg.py | 14 ++++++++++++--
.../cartpole_manager_camera_env_cfg.py | 6 +++---
.../core/cartpole/cartpole_manager_env_cfg.py | 14 ++++++++++++--
.../fourbar_pole_manager_env_cfg.py | 14 ++++++++++++--
.../core/handover/handover_common.py | 9 +++++++--
.../config/franka_soft/franka_soft_env_cfg.py | 10 ++++++++--
.../isaaclab_tasks/core/lift/lift_env_cfg.py | 15 +++++++++++++--
.../core/locomotion/ant/ant_common.py | 15 +++++++++++++++
.../core/locomotion/ant/ant_direct_env_cfg.py | 8 +++++++-
.../locomotion/ant/ant_manager_env_cfg.py | 2 ++
.../locomotion/humanoid/humanoid_common.py | 15 +++++++++++++++
.../humanoid/humanoid_direct_env_cfg.py | 16 ++++++++++++++--
.../humanoid/humanoid_manager_env_cfg.py | 2 ++
.../core/pendulum/pendulum_marl_env_cfg.py | 17 ++++++++++++++++-
.../reach/config/ur_10/joint_pos_env_cfg.py | 2 ++
.../core/reach/reach_env_cfg.py | 14 ++++++++++++--
.../isaaclab_tasks/core/reorient/utils.py | 16 +++++++++++++---
.../velocity/config/anymal_d/rough_env_cfg.py | 1 +
.../velocity/config/cassie/rough_env_cfg.py | 1 +
.../core/velocity/config/go2/rough_env_cfg.py | 1 +
.../core/velocity/config/h1/rough_env_cfg.py | 1 +
.../core/velocity/velocity_env_cfg.py | 13 +++++++++++++
26 files changed, 200 insertions(+), 32 deletions(-)
create mode 100644 source/isaaclab_tasks/changelog.d/task-view-tracking.added.rst
create mode 100644 source/isaaclab_tasks/changelog.d/task-view-tracking.minor
diff --git a/source/isaaclab_tasks/changelog.d/task-view-tracking.added.rst b/source/isaaclab_tasks/changelog.d/task-view-tracking.added.rst
new file mode 100644
index 000000000000..6d29df5db455
--- /dev/null
+++ b/source/isaaclab_tasks/changelog.d/task-view-tracking.added.rst
@@ -0,0 +1,2 @@
+* Added task views to the core tasks: a fixed view of the environment, or a view that follows the robot for
+ locomotion tasks. Record them with ``--video viz:newton_gl:tracking``.
diff --git a/source/isaaclab_tasks/changelog.d/task-view-tracking.minor b/source/isaaclab_tasks/changelog.d/task-view-tracking.minor
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py
index 759ca25c808b..bd866f9c0df2 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py
@@ -29,7 +29,7 @@
from isaaclab.sim import SimulationCfg
from isaaclab.utils import clone, configclass, replace
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
-from isaaclab.visualizers import VisualizerCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -108,16 +108,25 @@ class CabinetSimCfg(PresetCfg):
dt=1 / 60,
render_interval=1,
physics=PhysxCfg(bounce_threshold_velocity=0.01, friction_correlation_distance=0.00625),
- default_visualizer_cfg=VisualizerCfg(eye=(-2.0, 2.0, 2.0), lookat=(0.8, 0.0, 0.5)),
+ default_visualizer_cfg=VisualizerCfg(
+ eye=(-2.0, 2.0, 2.0),
+ lookat=(0.8, 0.0, 0.5),
+ cameras=[
+ PerspectiveCameraCfg(
+ env_index=0,
+ eye=(-1.8, 2.0, 1.6),
+ lookat=(0.55, 0.0, 0.5),
+ focal_length=28.0,
+ ),
+ ],
+ ),
)
ovphysx: SimulationCfg = replace(isaacsim_physx, physics=OvPhysxCfg())
physx: SimulationCfg = replace(
isaacsim_physx, physics=PhysxAutoCfg(isaacsim_physx=isaacsim_physx.physics, ovphysx=ovphysx.physics)
)
- newton_mjwarp: SimulationCfg = SimulationCfg(
+ newton_mjwarp: SimulationCfg = isaacsim_physx.replace(
dt=1 / 600,
- render_interval=1,
- default_visualizer_cfg=VisualizerCfg(eye=(-2.0, 2.0, 2.0), lookat=(0.8, 0.0, 0.5)),
physics=NewtonCfg(
solver_cfg=MJWarpSolverCfg(
njmax=90,
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_camera_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_camera_env_cfg.py
index 1b0086229176..62a0f05d314d 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_camera_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_camera_env_cfg.py
@@ -10,7 +10,6 @@
import math
from isaaclab.utils import configclass
-from isaaclab.visualizers import VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -60,8 +59,8 @@ class BaseCartpoleCameraEnvCfg(CartpoleEnvCfg):
def __post_init__(self):
super().__post_init__()
- # the base sets the proprioceptive camera view; widen it to see the camera environments
- self.sim.default_visualizer_cfg = VisualizerCfg(eye=(20.0, 20.0, 20.0))
+ # widen the viewport to see the camera environments; the tracking camera stays as the base declares it
+ self.sim.default_visualizer_cfg.eye = (20.0, 20.0, 20.0)
default = BaseCartpoleCameraEnvCfg()
depth = BaseCartpoleCameraEnvCfg(observation_space=[1, 96, 96])
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py
index 9c7aceb26c43..380be50e8ccb 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py
@@ -15,7 +15,7 @@
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.sim import SimulationCfg
from isaaclab.utils import configclass, replace
-from isaaclab.visualizers import VisualizerCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
from isaaclab_assets.robots.cartpole import CARTPOLE_CFG
@@ -72,4 +72,14 @@ class CartpoleEnvCfg(DirectRLEnvCfg):
rew_scale_pole_vel = -0.005
def __post_init__(self):
- self.sim.default_visualizer_cfg = VisualizerCfg(eye=(8.0, 0.0, 5.0))
+ self.sim.default_visualizer_cfg = VisualizerCfg(
+ eye=(8.0, 0.0, 5.0),
+ cameras=[
+ PerspectiveCameraCfg(
+ env_index=0,
+ eye=(8.0, 0.0, 2.5),
+ lookat=(0.0, 0.0, 2.5),
+ focal_length=24.0,
+ ),
+ ],
+ )
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_camera_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_camera_env_cfg.py
index dd113cf7341c..3d46af86fffe 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_camera_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_camera_env_cfg.py
@@ -12,7 +12,6 @@
from isaaclab.managers import SceneEntityCfg
from isaaclab.utils import configclass
from isaaclab.utils.images import is_depth_like
-from isaaclab.visualizers import VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -145,8 +144,9 @@ def __post_init__(self):
self.scene.ground = None
# reset: smaller initial pole angle than the proprioceptive task
self.events.reset_pole_position.params["position_range"] = (-0.125 * math.pi, 0.125 * math.pi)
- # visualizer settings
- self.sim.default_visualizer_cfg = VisualizerCfg(eye=(20.0, 20.0, 20.0), lookat=(0.0, 0.0, 0.0))
+ # widen the viewport to see the camera environments; the tracking camera stays as the base declares it
+ self.sim.default_visualizer_cfg.eye = (20.0, 20.0, 20.0)
+ self.sim.default_visualizer_cfg.lookat = (0.0, 0.0, 0.0)
rgb = BaseCartpoleCameraEnvCfg(observations=image_observations_cfg("rgb"))
depth = BaseCartpoleCameraEnvCfg(observations=image_observations_cfg("depth"))
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py
index 259177e3afdc..0597c8c5d434 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py
@@ -18,7 +18,7 @@
from isaaclab.managers import TerminationTermCfg as DoneTerm
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.utils import configclass, replace
-from isaaclab.visualizers import VisualizerCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
from isaaclab_assets.robots.cartpole import CARTPOLE_CFG
@@ -181,4 +181,14 @@ def __post_init__(self):
self.sim.render_interval = self.decimation
self.sim.physics = CartpolePhysicsCfg()
# visualizer settings
- self.sim.default_visualizer_cfg = VisualizerCfg(eye=(8.0, 0.0, 5.0))
+ self.sim.default_visualizer_cfg = VisualizerCfg(
+ eye=(8.0, 0.0, 5.0),
+ cameras=[
+ PerspectiveCameraCfg(
+ env_index=0,
+ eye=(8.0, 0.0, 2.5),
+ lookat=(0.0, 0.0, 2.5),
+ focal_length=24.0,
+ ),
+ ],
+ )
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
index 60af0b1f0814..80728379d2ff 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
@@ -24,7 +24,7 @@
from isaaclab.managers import TerminationTermCfg as DoneTerm
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.utils import configclass, replace
-from isaaclab.visualizers import VisualizerCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -240,7 +240,17 @@ def __post_init__(self) -> None:
self.decimation = 2
self.episode_length_s = 5
# Match Newton GL / --video camera to the task viewport when --viz newton creates the visualizer.
- self.sim.default_visualizer_cfg = VisualizerCfg(eye=(12.0, 0.0, 4.0))
+ self.sim.default_visualizer_cfg = VisualizerCfg(
+ eye=(12.0, 0.0, 4.0),
+ cameras=[
+ PerspectiveCameraCfg(
+ env_index=0,
+ eye=(4.5, 0.0, 1.8),
+ lookat=(0.0, 0.0, 1.8),
+ focal_length=24.0,
+ ),
+ ],
+ )
# simulation settings
self.sim.dt = 1 / 120
self.sim.render_interval = self.decimation
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py b/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py
index 33e3b12b023f..cb5be396ae5c 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py
@@ -13,7 +13,7 @@
from isaaclab.markers import VisualizationMarkersCfg
from isaaclab.utils import index_fill_
from isaaclab.utils.math import quat_apply
-from isaaclab.visualizers import VisualizerCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
from isaaclab_tasks.core.reorient.utils import SuccessTracker
@@ -34,7 +34,12 @@
# The camera is world-framed, so this aims at the environment nearest the grid center for the
# default 2048 environments (x = 0.75 m); other counts shift the grid.
-VISUALIZER_CFG = VisualizerCfg(eye=(2.35, -0.5, 1.1), lookat=(0.75, -0.5, 0.55), focal_length=35.0)
+VISUALIZER_CFG = VisualizerCfg(
+ eye=(2.35, -0.5, 1.1),
+ lookat=(0.75, -0.5, 0.55),
+ focal_length=35.0,
+ cameras=[PerspectiveCameraCfg(env_index=0, eye=(1.15, -1.65, 1.15), lookat=(0.0, -0.5, 0.55), focal_length=35.0)],
+)
"""Recording view facing one hand pair from the side, with both hands and the object between them."""
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py
index b50b3e11242d..897851375b05 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py
@@ -39,7 +39,7 @@
from isaaclab.sim.spawners.from_files.from_files_cfg import GroundPlaneCfg
from isaaclab.utils import configclass, replace
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
-from isaaclab.visualizers import VisualizerCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
from isaaclab_contrib.coupling import CouplerEntryCfg, CouplerProxyCfg, CouplerProxyMappingCfg
@@ -638,7 +638,13 @@ def __post_init__(self):
self.sim.render_interval = self.decimation
self.sim.physics = PhysicsCfg()
# visualizer settings
- self.sim.default_visualizer_cfg = VisualizerCfg(eye=(0.75, 0.25, 0.65), lookat=(0.0, 0.75, 0.4))
+ self.sim.default_visualizer_cfg = VisualizerCfg(
+ eye=(0.75, 0.25, 0.65),
+ lookat=(0.0, 0.75, 0.4),
+ cameras=[
+ PerspectiveCameraCfg(env_index=0, eye=(1.8, -1.8, 1.5), lookat=(0.35, 0.0, 0.35), focal_length=28.0)
+ ],
+ )
def play_mode(self):
super().play_mode()
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py
index 330ddaa30ab7..eadfc8f07063 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py
@@ -27,7 +27,7 @@
from isaaclab.utils import configclass
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
from isaaclab.utils.noise import UniformNoiseCfg as Unoise
-from isaaclab.visualizers import VisualizerCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -563,7 +563,18 @@ def __post_init__(self):
self.sim.render_interval = self.decimation
self.sim.physics = PhysicsCfg()
# visualizer settings
- self.sim.default_visualizer_cfg = VisualizerCfg(eye=(-2.25, 0.0, 0.75), lookat=(0.0, 0.0, 0.45))
+ self.sim.default_visualizer_cfg = VisualizerCfg(
+ eye=(-2.25, 0.0, 0.75),
+ lookat=(0.0, 0.0, 0.45),
+ cameras=[
+ PerspectiveCameraCfg(
+ env_index=0,
+ eye=(-1.8, -1.8, 1.45),
+ lookat=(-0.3, 0.0, 0.45),
+ focal_length=28.0,
+ ),
+ ],
+ )
def play_mode(self):
super().play_mode()
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_common.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_common.py
index 763b44306f18..e62a3e04fbec 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_common.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_common.py
@@ -13,9 +13,24 @@
from isaaclab.physics import PhysxAutoCfg
from isaaclab.terrains import TerrainImporterCfg
from isaaclab.utils import configclass
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
+VISUALIZER_CFG = VisualizerCfg(
+ cameras=[
+ PerspectiveCameraCfg(
+ eye=(3.5, -1.0, 2.8),
+ lookat=(0.0, 0.0, 0.0),
+ focal_length=26.0,
+ track_path="robot",
+ follow_heading=True,
+ heading_smoothing_time_constant=0.5,
+ ),
+ ],
+)
+"""Recording view following the Ant with smoothed heading."""
+
TERRAIN_CFG = TerrainImporterCfg(
prim_path="/World/ground",
terrain_type="plane",
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_direct_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_direct_env_cfg.py
index f9eda2e7e065..c01166f31210 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_direct_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_direct_env_cfg.py
@@ -21,6 +21,7 @@
FEET_BODY_NAMES,
JOINT_GEARS,
TERRAIN_CFG,
+ VISUALIZER_CFG,
WALK_TARGET_POS,
AntPhysicsCfg,
)
@@ -51,7 +52,12 @@ class AntEnvCfg(DirectRLEnvCfg):
state_space = 0
# simulation
- sim: SimulationCfg = SimulationCfg(dt=1 / 120, render_interval=decimation, physics=AntPhysicsCfg())
+ sim: SimulationCfg = SimulationCfg(
+ dt=1 / 120,
+ render_interval=decimation,
+ physics=AntPhysicsCfg(),
+ default_visualizer_cfg=VISUALIZER_CFG.copy(),
+ )
# scene
scene: AntDirectSceneCfg = AntDirectSceneCfg(
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_manager_env_cfg.py
index fb51bea46478..c72693b762ae 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_manager_env_cfg.py
@@ -25,6 +25,7 @@
FEET_BODY_NAMES,
JOINT_GEARS,
TERRAIN_CFG,
+ VISUALIZER_CFG,
WALK_TARGET_POS,
AntPhysicsCfg,
)
@@ -186,6 +187,7 @@ def __post_init__(self):
self.sim.dt = 1 / 120
self.sim.render_interval = self.decimation
self.sim.physics = AntPhysicsCfg()
+ self.sim.default_visualizer_cfg = VISUALIZER_CFG.copy()
self.sim.physics_material.static_friction = 1.0
self.sim.physics_material.dynamic_friction = 1.0
self.sim.physics_material.restitution = 0.0
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_common.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_common.py
index fd88c38ccc78..bae554f6ce6b 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_common.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_common.py
@@ -13,9 +13,24 @@
from isaaclab.physics import PhysxAutoCfg
from isaaclab.terrains import TerrainImporterCfg
from isaaclab.utils import configclass
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
+VISUALIZER_CFG = VisualizerCfg(
+ cameras=[
+ PerspectiveCameraCfg(
+ eye=(2.5, -3.5, 0.9),
+ lookat=(0.0, 0.0, -0.5),
+ focal_length=26.0,
+ track_path="robot",
+ follow_heading=True,
+ heading_smoothing_time_constant=0.5,
+ ),
+ ],
+)
+"""Recording view following the Humanoid with smoothed heading."""
+
TERRAIN_CFG = TerrainImporterCfg(
prim_path="/World/ground",
terrain_type="plane",
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_direct_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_direct_env_cfg.py
index 196b514a6025..81b5dd279a0e 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_direct_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_direct_env_cfg.py
@@ -17,7 +17,14 @@
from isaaclab_assets.robots.humanoid import HUMANOID_CFG
-from .humanoid_common import FEET_BODY_NAMES, JOINT_GEARS, TERRAIN_CFG, WALK_TARGET_POS, HumanoidPhysicsCfg
+from .humanoid_common import (
+ FEET_BODY_NAMES,
+ JOINT_GEARS,
+ TERRAIN_CFG,
+ VISUALIZER_CFG,
+ WALK_TARGET_POS,
+ HumanoidPhysicsCfg,
+)
@configclass
@@ -45,7 +52,12 @@ class HumanoidEnvCfg(DirectRLEnvCfg):
state_space = 0
# simulation
- sim: SimulationCfg = SimulationCfg(dt=1 / 120, render_interval=decimation, physics=HumanoidPhysicsCfg())
+ sim: SimulationCfg = SimulationCfg(
+ dt=1 / 120,
+ render_interval=decimation,
+ physics=HumanoidPhysicsCfg(),
+ default_visualizer_cfg=VISUALIZER_CFG.copy(),
+ )
# scene
scene: HumanoidDirectSceneCfg = HumanoidDirectSceneCfg(
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_manager_env_cfg.py
index 65c5a7a3930f..79c0b656e039 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_manager_env_cfg.py
@@ -26,6 +26,7 @@
FEET_BODY_NAMES,
JOINT_EFFORT_LIMITS,
JOINT_GEARS,
+ VISUALIZER_CFG,
WALK_TARGET_POS,
HumanoidPhysicsCfg,
)
@@ -197,6 +198,7 @@ def __post_init__(self):
self.sim.dt = 1 / 120
self.sim.render_interval = self.decimation
self.sim.physics = HumanoidPhysicsCfg()
+ self.sim.default_visualizer_cfg = VISUALIZER_CFG.copy()
self.sim.physics_material.static_friction = 1.0
self.sim.physics_material.dynamic_friction = 1.0
self.sim.physics_material.restitution = 0.0
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py
index 689aea70139b..0f6243dc878a 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py
@@ -18,6 +18,7 @@
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.sim import SimulationCfg
from isaaclab.utils import configclass, replace
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -76,7 +77,21 @@ class PendulumMARLEnvCfg(DirectMARLEnvCfg):
state_space = -1
# simulation
- sim: SimulationCfg = SimulationCfg(dt=1 / 120, render_interval=decimation, physics=PendulumPhysicsCfg())
+ sim: SimulationCfg = SimulationCfg(
+ dt=1 / 120,
+ render_interval=decimation,
+ physics=PendulumPhysicsCfg(),
+ default_visualizer_cfg=VisualizerCfg(
+ cameras=[
+ PerspectiveCameraCfg(
+ env_index=0,
+ eye=(8.0, 0.0, 2.3),
+ lookat=(0.0, 0.0, 2.3),
+ focal_length=24.0,
+ ),
+ ],
+ ),
+ )
cart_dof_name = "slider_to_cart"
pole_dof_name = "cart_to_pole"
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reach/config/ur_10/joint_pos_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reach/config/ur_10/joint_pos_env_cfg.py
index 3d862407462e..caf2ea1b8e03 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reach/config/ur_10/joint_pos_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reach/config/ur_10/joint_pos_env_cfg.py
@@ -25,6 +25,8 @@ class UR10ReachEnvCfg(ReachEnvCfg):
def __post_init__(self):
super().__post_init__()
+ self.sim.default_visualizer_cfg.cameras[0].eye = (2.2, -2.2, 1.6)
+ self.sim.default_visualizer_cfg.cameras[0].lookat = (0.3, 0.0, 0.45)
# switch robot to ur10
self.scene.robot = replace(UR10_CFG, prim_path="{ENV_REGEX_NS}/Robot")
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py
index 8f0b99fcebe0..36a2120be018 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py
@@ -27,7 +27,7 @@
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.utils import configclass
from isaaclab.utils.noise import UniformNoiseCfg as Unoise
-from isaaclab.visualizers import VisualizerCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -248,4 +248,14 @@ def __post_init__(self):
self.sim.render_interval = self.decimation
self.sim.physics = ReachPhysicsCfg()
# visualizer settings
- self.sim.default_visualizer_cfg = VisualizerCfg(eye=(3.5, 3.5, 3.5))
+ self.sim.default_visualizer_cfg = VisualizerCfg(
+ eye=(3.5, 3.5, 3.5),
+ cameras=[
+ PerspectiveCameraCfg(
+ env_index=0,
+ eye=(1.8, -1.8, 1.5),
+ lookat=(0.3, 0.0, 0.4),
+ focal_length=28.0,
+ ),
+ ],
+ )
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py
index 6d6c12b2ff18..0e7d94d7f3af 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py
@@ -19,7 +19,7 @@
import isaaclab.utils.math as math_utils
from isaaclab.utils import index_fill_
from isaaclab.utils.math import quat_from_angle_axis, quat_mul
-from isaaclab.visualizers import VisualizerCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
if TYPE_CHECKING:
from isaaclab.assets import Articulation
@@ -28,10 +28,20 @@
GOAL_MARKER_OFFSET = (-0.08, -0.09, 0.06)
"""Goal-cube display offset from the in-hand position [m], beside the hand in the recording view."""
-VISUALIZER_CFG = VisualizerCfg(eye=(0.995, -0.80, 0.85), lookat=(0.375, -0.28, 0.53), focal_length=35.0)
+VISUALIZER_CFG = VisualizerCfg(
+ eye=(0.995, -0.80, 0.85),
+ lookat=(0.375, -0.28, 0.53),
+ focal_length=35.0,
+ cameras=[PerspectiveCameraCfg(env_index=0, eye=(0.62, -0.80, 0.85), lookat=(0.0, -0.28, 0.53), focal_length=35.0)],
+)
"""Recording view of an environment in the 50-environment play grid."""
-CAMERA_VISUALIZER_CFG = VisualizerCfg(eye=(1.62, -1.80, 0.85), lookat=(1.0, -1.28, 0.53), focal_length=35.0)
+CAMERA_VISUALIZER_CFG = VisualizerCfg(
+ eye=(1.62, -1.80, 0.85),
+ lookat=(1.0, -1.28, 0.53),
+ focal_length=35.0,
+ cameras=[PerspectiveCameraCfg(env_index=0, eye=(0.62, -0.80, 0.85), lookat=(0.0, -0.28, 0.53), focal_length=35.0)],
+)
"""Recording view of an environment in the camera tasks' 64-environment play grid."""
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py
index e5cb5fea0394..9297f1bad53f 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py
@@ -18,6 +18,7 @@ class AnymalDRoughEnvCfg(LocomotionVelocityRoughEnvCfg):
def __post_init__(self):
super().__post_init__()
+ self.sim.default_visualizer_cfg.cameras[0].eye = (2.0, -3.0, 1.4)
# scene
self.scene.robot = replace(
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/rough_env_cfg.py
index 1c4b565934bb..a54efaf298ce 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/rough_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/rough_env_cfg.py
@@ -67,6 +67,7 @@ class CassieRoughEnvCfg(LocomotionVelocityRoughEnvCfg):
def __post_init__(self):
super().__post_init__()
+ self.sim.default_visualizer_cfg.cameras[0].lookat = (0.15, 0.0, -0.25)
# scene
self.scene.robot = replace(CASSIE_CFG, prim_path="{ENV_REGEX_NS}/Robot")
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/go2/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/go2/rough_env_cfg.py
index 71160e332795..f18d288dc914 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/go2/rough_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/go2/rough_env_cfg.py
@@ -43,6 +43,7 @@ class UnitreeGo2RoughEnvCfg(LocomotionVelocityRoughEnvCfg):
def __post_init__(self):
super().__post_init__()
+ self.sim.default_visualizer_cfg.cameras[0].eye = (1.5, -2.5, 1.1)
# simulation
# execute the DC motor actuators through the backend-native path
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/h1/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/h1/rough_env_cfg.py
index 304f0fc6f57a..576c46c92d2c 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/h1/rough_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/h1/rough_env_cfg.py
@@ -77,6 +77,7 @@ class H1RoughEnvCfg(LocomotionVelocityRoughEnvCfg):
def __post_init__(self):
super().__post_init__()
+ self.sim.default_visualizer_cfg.cameras[0].eye = (2.5, -3.5, 1.3)
# scene
self.scene.robot = replace(H1_MINIMAL_CFG, prim_path="{ENV_REGEX_NS}/Robot")
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py
index 0e92889fc9fd..4b623da9c549 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py
@@ -37,6 +37,7 @@
from isaaclab.utils import configclass
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, ISAACLAB_NUCLEUS_DIR
from isaaclab.utils.noise import UniformNoiseCfg as Unoise
+from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -357,6 +358,18 @@ def __post_init__(self):
# simulation settings
self.sim.dt = 0.005
self.sim.render_interval = self.decimation
+ self.sim.default_visualizer_cfg = VisualizerCfg(
+ cameras=[
+ PerspectiveCameraCfg(
+ eye=(1.8, -3.0, 1.1),
+ lookat=(0.15, 0.0, 0.0),
+ focal_length=26.0,
+ track_path="robot",
+ follow_heading=True,
+ heading_smoothing_time_constant=0.2,
+ ),
+ ],
+ )
self.sim.physics_material = self.scene.terrain.physics_material
# update sensor update periods
# we tick all the sensors based on the smallest update period (physics update period)
From 91e655019bb270e01d4a6e9f99cf392106f2cac8 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 15 Oct 2026 20:46:02 +0000
Subject: [PATCH 004/140] Document task views and the tracking recording source
---
docs/source/how-to/record_video.rst | 3 ++
.../visualizer_streaming_camera_view.rst | 39 +++++++++++++++++++
2 files changed, 42 insertions(+)
diff --git a/docs/source/how-to/record_video.rst b/docs/source/how-to/record_video.rst
index 5291532a1dc6..38c59097973f 100644
--- a/docs/source/how-to/record_video.rst
+++ b/docs/source/how-to/record_video.rst
@@ -286,6 +286,9 @@ The ``source`` string selects what to capture:
- Newton OVRTX path-traced viewport
* - ``"viz:newton_gl:streaming_view"``
- Newton GL streaming camera panel, requires ``streaming_view=True``
+ * - ``"viz:newton_gl:tracking"``
+ - First perspective view tied to an environment or an asset (``env_index`` or ``track_path``),
+ whichever view the window shows; see :ref:`how-to-visualizer-task-views`
* - ``"sensor:"``
- ``env.scene.sensors[name]``, RGB (default)
* - ``"sensor::rgb"``
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index fd023a103525..115a6d90ddb7 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -160,6 +160,45 @@ Newton windows present at up to ``WindowCfg.fps`` (30 by default), measured in w
Changing the simulation timestep does not change that limit. Headless on-demand capture is
independent of the window update rate; Kit uses its application's update cadence.
+.. _how-to-visualizer-task-views:
+
+Task views that follow a robot
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A ``PerspectiveCameraCfg`` with ``env_index`` or ``track_path`` is a *task view*: it is placed relative to an
+environment or an asset, so it frames a robot wherever the scene puts it. The viewer renders it from its own
+camera, so nothing is created in the scene, nothing depends on the number of environments, and the view has the
+viewport's markers and shadows. Tasks declare one in ``sim.default_visualizer_cfg``:
+
+.. code-block:: python
+
+ from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+
+ self.sim.default_visualizer_cfg = VisualizerCfg(
+ cameras=[
+ PerspectiveCameraCfg(
+ eye=(1.8, -3.0, 1.1),
+ lookat=(0.15, 0.0, 0.0),
+ track_path="robot",
+ follow_heading=True,
+ heading_smoothing_time_constant=0.2,
+ )
+ ],
+ )
+
+* ``eye`` and ``lookat`` are offsets [m] from the tracked asset, or from the origin of ``env_index``
+ when ``track_path`` is None, which keeps the view fixed in that environment.
+* ``track_path`` names a scene asset (``"robot"``) or one of its bodies (``"robot/base"``) in environment
+ ``env_index``, which defaults to 0.
+* ``follow_heading`` rotates the offsets with the asset's yaw, keeping the horizon level.
+ ``heading_smoothing_time_constant`` [s] damps rapid turns; zero follows immediately.
+
+The interactive view stays free: a free perspective view at the visualizer's own ``eye`` and ``lookat`` is
+added before the task view, and the **Camera View** selector switches between them. While a task view is
+selected the window follows the robot, and selecting the free view hands the camera back. Record a task view,
+whichever view the window shows, with ``--video viz:newton_gl:tracking``. Newton GL supports task views; the
+other visualizers ignore them.
+
Newton RTX uses Newton's native ``ViewerRTX`` with a simulation-owned OVStage containing the
authored scene and clone placements. Newton owns its perspective renderer, window, and debug
markers; scene cameras retain their own renderer and resources. No default lights are added:
From c944f4900fa0ae95ace1ca7883725642c1e74231 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 15 Oct 2026 20:52:18 +0000
Subject: [PATCH 005/140] Validate task views at initialization and track
follower time per view
Create each task view's follower when the viewer initializes, so a bad env_index
or track_path fails there, and warn when the framed environment is not visible.
Keep the one-owner check on a perspective view's renderer, give each follower its
own clock, leave the streaming choice alone when a configuration only declares
task views, and drop a branch no caller reaches.
---
.../isaaclab/sim/simulation_context.py | 2 +-
.../isaaclab/visualizers/camera_follower.py | 10 +++--
.../isaaclab/visualizers/visualizer_cfg.py | 6 ++-
.../test/visualizers/test_camera_follower.py | 12 +++---
.../newton/newton_visualizer.py | 42 ++++++++++---------
.../test/test_newton_task_views.py | 7 +++-
6 files changed, 47 insertions(+), 32 deletions(-)
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index 1ffb5f862768..7d7c941459b1 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -506,7 +506,7 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
f"Declare a CameraCfg in the scene; available paths: {available_paths}."
)
cameras[index] = camera
- # scene cameras follow the free view, and task views come last
+ # task views come last, after the free view and the scene cameras
cameras.sort(key=lambda camera: isinstance(camera, PerspectiveCameraCfg) and camera.is_task_view)
visualizer.initialize(self, cameras=cameras)
self._pending_visualizers.remove(visualizer)
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
index 204843c42363..a6ac53dfbe38 100644
--- a/source/isaaclab/isaaclab/visualizers/camera_follower.py
+++ b/source/isaaclab/isaaclab/visualizers/camera_follower.py
@@ -44,13 +44,14 @@ def __init__(self, cfg: PerspectiveCameraCfg, scene: InteractiveScene) -> None:
except KeyError as exc:
raise ValueError(f"track_path refers to an unknown scene asset: {asset_name!r}.") from exc
self._yaw: float | None = None
- self._last_position: torch.Tensor | None = None
+ self._last_position: list[float] | None = None
+ self._time: float | None = None
- def pose(self, dt: float) -> tuple[tuple[float, float, float], tuple[float, float, float]] | None:
- """Return the world eye and look-at target after *dt* [s] of simulation, or None until the asset is ready.
+ def pose(self, time: float) -> tuple[tuple[float, float, float], tuple[float, float, float]] | None:
+ """Return the world eye and look-at target at simulation *time*, or None until the asset is ready.
Args:
- dt: Simulation time since the previous call [s]; only the heading filter uses it.
+ time: Simulation time [s]. Only the heading filter uses it, through the time since the previous call.
"""
cfg = self.cfg
origin = self._scene.env_origins[self._env]
@@ -75,6 +76,7 @@ def pose(self, dt: float) -> tuple[tuple[float, float, float], tuple[float, floa
if cfg.follow_heading:
# one device-to-host copy per frame
state = torch.cat((position, quat)).tolist()
+ dt, self._time = (0.0 if self._time is None else max(time - self._time, 0.0)), time
yaw = self._filtered_yaw(state[3:], state[:3], dt)
cos, sin = math.cos(yaw), math.sin(yaw)
rotation = torch.tensor(((cos, -sin, 0.0), (sin, cos, 0.0), (0.0, 0.0, 1.0)), device=offsets.device)
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index df520dbe4ad0..bcebfdd657f5 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -119,7 +119,7 @@ def with_free_view(cameras: list, eye: tuple, lookat: tuple, focal_length: float
available beside it, at the visualizer's own ``eye``, ``lookat`` and ``focal_length``.
"""
perspective = [camera for camera in cameras if isinstance(camera, PerspectiveCameraCfg)]
- if any(camera.is_task_view for camera in perspective) and all(camera.is_task_view for camera in perspective):
+ if perspective and all(camera.is_task_view for camera in perspective):
return [PerspectiveCameraCfg(eye=eye, lookat=lookat, focal_length=focal_length), *cameras]
return cameras
@@ -351,6 +351,8 @@ def __post_init__(self) -> None:
if self.cameras is not None:
if not self.cameras:
raise ValueError("cameras must contain at least one display source.")
- self.streaming_view = any(isinstance(camera, SceneCameraCfg) for camera in self.cameras)
+ # task views only add to the cameras the visualizer finds, so they leave the streaming choice alone
+ if not all(isinstance(camera, PerspectiveCameraCfg) and camera.is_task_view for camera in self.cameras):
+ self.streaming_view = any(isinstance(camera, SceneCameraCfg) for camera in self.cameras)
if isinstance(camera := self.cameras[0], PerspectiveCameraCfg) and not camera.is_task_view:
self.eye, self.lookat, self.focal_length = camera.eye, camera.lookat, camera.focal_length
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
index 8e33f2ac8f7d..fc926b0ab05b 100644
--- a/source/isaaclab/test/visualizers/test_camera_follower.py
+++ b/source/isaaclab/test/visualizers/test_camera_follower.py
@@ -40,8 +40,8 @@ def __getitem__(self, name):
return self.robot
-def _eye(follower: CameraFollower) -> torch.Tensor:
- return torch.tensor(follower.pose(0.1)[0])
+def _eye(follower: CameraFollower, time: float = 0.1) -> torch.Tensor:
+ return torch.tensor(follower.pose(time)[0])
def test_a_view_with_an_environment_stays_fixed_relative_to_its_origin():
@@ -70,7 +70,7 @@ def run(jump: float) -> torch.Tensor:
cfg = PerspectiveCameraCfg(track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
cfg.heading_smoothing_time_constant = 0.5
follower = CameraFollower(cfg, scene)
- follower.pose(0.1)
+ follower.pose(0.0)
scene.robot.data.root_quat_w.torch[0] = torch.tensor(_quat_z(math.pi / 2))
scene.robot.data.root_pos_w.torch[0, 0] += jump # an environment reset moves the asset
return _eye(follower)
@@ -97,5 +97,7 @@ def test_task_views_get_a_free_view_beside_them():
assert len(with_free_view([task], *args)) == 2
assert with_free_view([free, task], *args) == [free, task]
assert with_free_view([SceneCameraCfg(prim_path="/cam")], *args) == [SceneCameraCfg(prim_path="/cam")]
- # a task view first does not replace the visualizer's own pose
- assert VisualizerCfg(eye=(7.0, 0.0, 0.0), cameras=[task]).eye == (7.0, 0.0, 0.0)
+ # a task view first does not replace the visualizer's own pose or its streaming choice
+ cfg = VisualizerCfg(eye=(7.0, 0.0, 0.0), streaming_view=True, cameras=[task])
+ assert cfg.eye == (7.0, 0.0, 0.0) and cfg.streaming_view
+ assert not VisualizerCfg(streaming_view=True, cameras=[free]).streaming_view
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index f5fe17cb8fc4..7500f7dc459d 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -503,15 +503,29 @@ def __init__(self, cfg):
self._last_render_step = -1
self._pending_mesh_submissions: dict[str, Callable[[], None]] = {}
self._followers: dict[object, CameraFollower] = {}
- self._follow_time = 0.0
def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraCfg | Camera]) -> None:
"""Bind scene data and the Newton model shared with the simulation."""
super().initialize(sim, cameras=cameras)
# each perspective view renders itself, so a recorder can capture one the window does not show
+ scene = self._sim.get_scene_data_provider().get_interactive_scene()
for view in self._image_views:
- if view.camera is None:
- view.render = partial(self._capture_view, view)
+ if view.camera is not None:
+ continue
+ if view.render is not None:
+ raise ValueError("A perspective image view must have exactly one rendering owner.")
+ view.render = partial(self._capture_view, view)
+ source = view.cfg.source
+ if source.is_task_view and scene is not None:
+ # fail at initialization, not on a frame: a bad env_index or track_path raises here
+ self._followers[view] = CameraFollower(source, scene)
+ if self._env_ids is not None and (source.env_index or 0) not in self._env_ids:
+ logger.warning(
+ "[NewtonVisualizer] A task view frames environment %d, which is not among the visible "
+ "environments %s, so it will show an empty scene.",
+ source.env_index or 0,
+ list(self._env_ids),
+ )
self.newton_cfg = NewtonBackendCfg(physics_cfg=sim.cfg.physics, device=sim.device)
self.backend = self._sim.get_or_create_backend(self.newton_cfg)
self._transform_mapping = self._sim.get_scene_data_provider().create_mapping(
@@ -630,26 +644,15 @@ def _navigate_scene_camera(self) -> None:
self.current_image_view.invalidate()
def _apply_view_pose(self, view) -> bool:
- """Point the viewer camera where a perspective *view* looks, leaving the configured poses untouched.
+ """Point the viewer camera where a task *view* looks, leaving the configured poses untouched.
Returns:
Whether the view had a pose yet; a view that follows an asset has none until the asset is ready.
"""
source = view.cfg.source
- if source.is_task_view:
- follower = self._followers.get(view)
- if follower is None:
- scene = self._sim.get_scene_data_provider().get_interactive_scene()
- if scene is None:
- return False
- follower = self._followers[view] = CameraFollower(source, scene)
- sim_time = self._sim.get_physics_step_count() * self._sim.get_physics_dt()
- pose = follower.pose(max(sim_time - self._follow_time, 0.0))
- self._follow_time = sim_time
- if pose is None:
- return False
- else:
- pose = (source.eye, source.lookat)
+ pose = self._followers[view].pose(self._sim.get_physics_step_count() * self._sim.get_physics_dt())
+ if pose is None:
+ return False
camera = self._viewer.camera
camera.pos = PygletVec3(*pose[0])
camera.look_at(pose[1])
@@ -723,7 +726,8 @@ def close(self) -> None:
"""Detach perspective producers before releasing the visualizer's borrowed views."""
self._pending_mesh_submissions.clear()
for view in self._image_views:
- if view.camera is None:
+ owned = isinstance(view.render, partial) and view.render.func == self._capture_view
+ if owned or view.render == self._capture_perspective:
view.render = None
view.invalidate()
self._followers.clear()
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index ea54a5581d01..3f711e437ebe 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -17,6 +17,7 @@
from pyglet.math import Vec3
from isaaclab.visualizers import PerspectiveCameraCfg
+from isaaclab.visualizers.camera_follower import CameraFollower
class _Camera:
@@ -34,11 +35,14 @@ class _Scene:
num_envs = 2
env_origins = torch.tensor([[0.0, 0.0, 0.0], [10.0, 0.0, 0.0]])
+ def __getitem__(self, name):
+ return SimpleNamespace(is_initialized=False)
+
def _visualizer(views) -> NewtonVisualizerBase:
viz = NewtonVisualizerBase.__new__(NewtonVisualizerBase)
viz.cfg = SimpleNamespace(focal_length=12.0, eye=(4.0, -4.0, 3.0), lookat=(0.0, 0.0, 0.0))
- viz._followers, viz._follow_time, viz._last_render_step = {}, 0.0, 5
+ viz._followers, viz._last_render_step = {}, 5
camera = _Camera()
def set_camera(pos, pitch, yaw):
@@ -51,6 +55,7 @@ def set_camera(pos, pitch, yaw):
get_physics_dt=lambda: 0.1,
)
viz._image_views = list(views)
+ viz._followers = {view: CameraFollower(view.cfg.source, _Scene()) for view in views if view.cfg.source.is_task_view}
viz.current_image_view = viz._image_views[0]
return viz
From dfff4865ffd1670f1f960047869a1d94c28e0e3c Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 15 Oct 2026 20:53:10 +0000
Subject: [PATCH 006/140] Reseed the heading filter when an environment resets
in place
A velocity-task environment can reset near its old position with a new heading,
which the distance check misses. Also treat a yaw change no robot turns at
(over 10 rad/s) as a reset.
---
.../isaaclab/visualizers/camera_follower.py | 8 ++++++-
.../test/visualizers/test_camera_follower.py | 22 +++++++++++++++----
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
index a6ac53dfbe38..aee6721ecb23 100644
--- a/source/isaaclab/isaaclab/visualizers/camera_follower.py
+++ b/source/isaaclab/isaaclab/visualizers/camera_follower.py
@@ -19,6 +19,9 @@
_RESET_JUMP = 1.0
"""Distance [m] an asset moves between two updates only when its environment resets."""
+_RESET_YAW_RATE = 10.0
+"""Yaw rate [rad/s] no robot turns at, so a heading that changes faster means its environment reset."""
+
class CameraFollower:
"""Turns a :class:`~isaaclab.visualizers.PerspectiveCameraCfg` tied to an environment into world poses.
@@ -87,12 +90,15 @@ def pose(self, time: float) -> tuple[tuple[float, float, float], tuple[float, fl
def _filtered_yaw(self, quat: list[float], position: list[float], dt: float) -> float:
"""Return the yaw of the xyzw *quat*, filtered along the shortest rotation.
- The first sample, and the sample after an environment resets and moves the asset, is not filtered.
+ The first sample, and the sample after an environment resets, is not filtered.
"""
x, y, z, w = quat
yaw = math.atan2(2.0 * (w * z + x * y), 1.0 - 2.0 * (y * y + z * z))
last, self._last_position = self._last_position, position
reset = self._yaw is None or last is None or math.dist(position, last) > _RESET_JUMP
+ if not reset and dt > 0.0:
+ # an environment can reset in place with a new heading
+ reset = abs(math.remainder(yaw - self._yaw, math.tau)) / dt > _RESET_YAW_RATE
tau = self.cfg.heading_smoothing_time_constant
if tau > 0.0 and not reset:
yaw = self._yaw + -math.expm1(-dt / tau) * math.remainder(yaw - self._yaw, math.tau)
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
index fc926b0ab05b..4a46ac0b5d12 100644
--- a/source/isaaclab/test/visualizers/test_camera_follower.py
+++ b/source/isaaclab/test/visualizers/test_camera_follower.py
@@ -71,13 +71,27 @@ def run(jump: float) -> torch.Tensor:
cfg.heading_smoothing_time_constant = 0.5
follower = CameraFollower(cfg, scene)
follower.pose(0.0)
- scene.robot.data.root_quat_w.torch[0] = torch.tensor(_quat_z(math.pi / 2))
- scene.robot.data.root_pos_w.torch[0, 0] += jump # an environment reset moves the asset
+ scene.robot.data.root_quat_w.torch[0] = torch.tensor(_quat_z(0.2)) # 2 rad/s
+ scene.robot.data.root_pos_w.torch[0, 0] += jump # an environment reset also moves the asset
return _eye(follower)
smooth, reset = run(0.0), run(5.0)
- assert smooth[1] > -2.0 # still mostly behind the old heading
- torch.testing.assert_close(reset[1] - 0.0, torch.tensor(-3.0), atol=1e-4, rtol=0) # the new heading at once
+ assert smooth[1] > -0.3 # filtered toward the new heading
+ torch.testing.assert_close(reset[1], torch.tensor(-3.0 * math.sin(0.2)), atol=1e-4, rtol=0) # the new one at once
+
+
+def test_a_reset_in_place_with_a_new_heading_is_not_smoothed_but_a_real_turn_is():
+ def run(yaw: float) -> torch.Tensor:
+ scene = _Scene()
+ cfg = PerspectiveCameraCfg(track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
+ cfg.heading_smoothing_time_constant = 0.5
+ follower = CameraFollower(cfg, scene)
+ follower.pose(0.0)
+ scene.robot.data.root_quat_w.torch[0] = torch.tensor(_quat_z(yaw)) # the position does not change
+ return torch.tensor(follower.pose(0.02)[0])
+
+ torch.testing.assert_close(run(math.pi / 2)[1], torch.tensor(-3.0), atol=1e-4, rtol=0) # 78 rad/s: a reset
+ assert run(0.05)[1] > -0.2 # 2.5 rad/s: a turn, filtered toward the new heading
def test_a_view_waits_for_its_asset_and_rejects_bad_targets():
From 3f6b0bd0891e2baf21923e3b883419aae8122ec8 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 15 Oct 2026 21:00:29 +0000
Subject: [PATCH 007/140] Name task views in the Camera View selector
Say what a task view follows or frames instead of numbering it as another
perspective view.
---
.../newton/newton_visualizer.py | 17 +++++++++++++----
.../test/test_newton_task_views.py | 10 ++++++++++
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 7500f7dc459d..d599184f36cb 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -594,15 +594,24 @@ def _update_state(self) -> newton.State:
provider.get_geometry_points(output=state.particle_q, offsets=backend.geometry_offsets)
return state
+ @staticmethod
+ def _view_label(index: int, view) -> str:
+ """Name a view for the Camera View selector: a task view says what it follows or frames."""
+ if view.camera is not None:
+ return view.cfg.source
+ source = view.cfg.source
+ if source.track_path:
+ return f"Following {source.track_path} (env {source.env_index or 0})"
+ if source.env_index is not None:
+ return f"Environment {source.env_index}"
+ return f"Perspective {index + 1}"
+
def _draw_streaming_view_controls(self, imgui) -> None:
"""Choose one declared display source without reading the other sensors."""
imgui.set_next_item_open(True, imgui.Cond_.appearing)
if not imgui.collapsing_header("Camera View"):
return
- labels = [
- f"Perspective {i + 1}" if view.camera is None else view.cfg.source
- for i, view in enumerate(self._image_views)
- ]
+ labels = [self._view_label(i, view) for i, view in enumerate(self._image_views)]
changed, index = imgui.combo("Camera", self._image_views.index(self.current_image_view), labels)
if changed:
self._select_camera(index)
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index 3f711e437ebe..77c68fb7188c 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -111,3 +111,13 @@ def test_the_task_view_recording_picks_the_first_tied_view_and_reports_none():
assert viz.render_task_view_rgb_array() == ("task", 3)
with pytest.raises(RuntimeError, match="tied to an environment or an asset"):
_visualizer([free]).render_task_view_rgb_array()
+
+
+def test_the_selector_names_what_a_task_view_follows_or_frames():
+ label = NewtonVisualizerBase._view_label
+ assert label(0, _view(PerspectiveCameraCfg())) == "Perspective 1"
+ assert label(1, _view(PerspectiveCameraCfg(env_index=2))) == "Environment 2"
+ assert label(1, _view(PerspectiveCameraCfg(track_path="robot/base"))) == "Following robot/base (env 0)"
+ assert label(2, SimpleNamespace(camera=object(), cfg=SimpleNamespace(source="/World/envs/env_0/cam"))) == (
+ "/World/envs/env_0/cam"
+ )
From 59c4b0cfc18a74945871c2f5673c343a98fd6d44 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 15 Oct 2026 21:49:08 +0000
Subject: [PATCH 008/140] Address task view review comments
Report the tracking form in the invalid video source error, correct the docs on
which visualizers show task views, type and place the free-view helper, give a
task view no pose instead of an error when no follower exists, and read the
task-view flag directly. Merge the Kit tracking case into the parametrized
invalid-source test and cover each recording case separately.
---
.../visualizer_streaming_camera_view.rst | 4 +--
.../isaaclab/envs/utils/video_recorder_cfg.py | 6 ++--
.../isaaclab/visualizers/visualizer_cfg.py | 29 +++++++++++--------
.../isaaclab/test/envs/test_video_recorder.py | 11 +++----
.../newton/newton_visualizer.py | 20 ++++++++-----
.../test/test_newton_task_views.py | 23 +++++++++++----
6 files changed, 57 insertions(+), 36 deletions(-)
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index 115a6d90ddb7..fb42e25ae4b0 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -196,8 +196,8 @@ viewport's markers and shadows. Tasks declare one in ``sim.default_visualizer_cf
The interactive view stays free: a free perspective view at the visualizer's own ``eye`` and ``lookat`` is
added before the task view, and the **Camera View** selector switches between them. While a task view is
selected the window follows the robot, and selecting the free view hands the camera back. Record a task view,
-whichever view the window shows, with ``--video viz:newton_gl:tracking``. Newton GL supports task views; the
-other visualizers ignore them.
+whichever view the window shows, with ``--video viz:newton_gl:tracking``. Newton GL supports task views and their recording.
+Newton RTX shares the same view code but is untested, and Kit, Rerun, and Viser ignore task views.
Newton RTX uses Newton's native ``ViewerRTX`` with a simulation-owned OVStage containing the
authored scene and clone placements. Newton owns its perspective renderer, window, and debug
diff --git a/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py b/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
index 9d0ec4374cff..7a134ba987e6 100644
--- a/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
+++ b/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
@@ -53,9 +53,9 @@ def parse_video_source(source: str) -> tuple[str, str, str]:
if kind == "sensor" and 1 <= len(parts) <= 2 and name and sub in ("", *SENSOR_CHANNELS):
return kind, name, sub
raise ValueError(
- f"Invalid video source {source!r}: expected '', 'viz', 'viz:', 'viz::streaming_view' or "
- f"'sensor:[:]', with one of {', '.join(VISUALIZER_TYPES)} and one of "
- f"{', '.join(SENSOR_CHANNELS)}."
+ f"Invalid video source {source!r}: expected '', 'viz', 'viz:', 'viz::streaming_view', "
+ f"'viz::tracking' or 'sensor:[:]', with one of "
+ f"{', '.join(VISUALIZER_TYPES)} and one of {', '.join(SENSOR_CHANNELS)}."
)
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index bcebfdd657f5..5606a3335d5c 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -58,6 +58,23 @@ def parse_visualizer_csv(value: str | list[str]) -> list[str]:
return list(dict.fromkeys(names))
+def with_free_view(
+ cameras: list[PerspectiveCameraCfg | SceneCameraCfg],
+ eye: tuple[float, float, float],
+ lookat: tuple[float, float, float],
+ focal_length: float,
+) -> list[PerspectiveCameraCfg | SceneCameraCfg]:
+ """Return *cameras*, preceded by a free perspective view when it has task views but no free view of its own.
+
+ A task view follows a robot or frames an environment, so the interactive view that a user moves stays
+ available beside it, at the visualizer's own ``eye``, ``lookat`` and ``focal_length``.
+ """
+ perspective = [camera for camera in cameras if isinstance(camera, PerspectiveCameraCfg)]
+ if perspective and all(camera.is_task_view for camera in perspective):
+ return [PerspectiveCameraCfg(eye=eye, lookat=lookat, focal_length=focal_length), *cameras]
+ return cameras
+
+
@configclass
class PerspectiveCameraCfg:
"""Pose and optics for a visualizer-owned perspective camera.
@@ -112,18 +129,6 @@ def __post_init__(self) -> None:
raise ValueError("heading_smoothing_time_constant must be finite and non-negative.")
-def with_free_view(cameras: list, eye: tuple, lookat: tuple, focal_length: float) -> list:
- """Return *cameras*, preceded by a free perspective view when it has task views but no free view of its own.
-
- A task view follows a robot or frames an environment, so the interactive view that a user moves stays
- available beside it, at the visualizer's own ``eye``, ``lookat`` and ``focal_length``.
- """
- perspective = [camera for camera in cameras if isinstance(camera, PerspectiveCameraCfg)]
- if perspective and all(camera.is_task_view for camera in perspective):
- return [PerspectiveCameraCfg(eye=eye, lookat=lookat, focal_length=focal_length), *cameras]
- return cameras
-
-
@configclass
class SceneCameraCfg:
"""Select an existing scene camera's output as the visualizer's main view.
diff --git a/source/isaaclab/test/envs/test_video_recorder.py b/source/isaaclab/test/envs/test_video_recorder.py
index 674cdec825ca..71ffd8fc8d4f 100644
--- a/source/isaaclab/test/envs/test_video_recorder.py
+++ b/source/isaaclab/test/envs/test_video_recorder.py
@@ -268,11 +268,6 @@ def test_a_tracking_source_records_the_task_view_not_the_selected_one():
assert viz.render_calls == 0
-def test_a_visualizer_without_task_views_cannot_record_tracking():
- with pytest.raises(RuntimeError, match="cannot record a tracking view"):
- VideoRecorder(_cfg(source="viz:kit:tracking"), _make_env(visualizers=[_FakeViz("kit")]))
-
-
@pytest.mark.parametrize(
"source,make_env,error,message",
[
@@ -284,6 +279,12 @@ def test_a_visualizer_without_task_views_cannot_record_tracking():
RuntimeError,
"Enable streaming_view",
),
+ (
+ "viz:kit:tracking",
+ lambda: _make_env(visualizers=[_FakeViz("kit")]),
+ RuntimeError,
+ "cannot record a tracking view",
+ ),
("sensor:missing", lambda: _make_env(sensors={"tiled_camera": MagicMock()}), ValueError, "missing"),
("sensor:tiled_camera:depth", lambda: _make_env(sensors={"tiled_camera": _rgb_sensor()}), KeyError, "depth"),
],
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index d599184f36cb..52df1410651f 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -516,7 +516,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
raise ValueError("A perspective image view must have exactly one rendering owner.")
view.render = partial(self._capture_view, view)
source = view.cfg.source
- if source.is_task_view and scene is not None:
+ if self._is_task_view(view) and scene is not None:
# fail at initialization, not on a frame: a bad env_index or track_path raises here
self._followers[view] = CameraFollower(source, scene)
if self._env_ids is not None and (source.env_index or 0) not in self._env_ids:
@@ -594,6 +594,11 @@ def _update_state(self) -> newton.State:
provider.get_geometry_points(output=state.particle_q, offsets=backend.geometry_offsets)
return state
+ @staticmethod
+ def _is_task_view(view) -> bool:
+ """Whether *view* is a perspective view tied to an environment or an asset."""
+ return isinstance(view.cfg.source, PerspectiveCameraCfg) and view.cfg.source.is_task_view
+
@staticmethod
def _view_label(index: int, view) -> str:
"""Name a view for the Camera View selector: a task view says what it follows or frames."""
@@ -659,8 +664,9 @@ def _apply_view_pose(self, view) -> bool:
Whether the view had a pose yet; a view that follows an asset has none until the asset is ready.
"""
source = view.cfg.source
- pose = self._followers[view].pose(self._sim.get_physics_step_count() * self._sim.get_physics_dt())
- if pose is None:
+ follower = self._followers.get(view)
+ pose = follower and follower.pose(self._sim.get_physics_step_count() * self._sim.get_physics_dt())
+ if pose is None or follower is None:
return False
camera = self._viewer.camera
camera.pos = PygletVec3(*pose[0])
@@ -803,9 +809,7 @@ def render_rgb_array(self) -> np.ndarray:
def render_task_view_rgb_array(self) -> np.ndarray:
"""Download the first perspective view that is tied to an environment or an asset, whatever the window shows."""
- view = next(
- (v for v in self._image_views if v.camera is None and getattr(v.cfg.source, "is_task_view", False)), None
- )
+ view = next((v for v in self._image_views if self._is_task_view(v)), None)
if view is None:
raise RuntimeError(
"No perspective view is tied to an environment or an asset. Declare "
@@ -959,7 +963,7 @@ def _render_frame(self) -> None:
"""Render one GL frame for the window or an on-demand capture."""
viewer = self._viewer
view = self.current_image_view
- if view.camera is None and getattr(view.cfg.source, "is_task_view", False):
+ if self._is_task_view(view):
self._apply_view_pose(view)
viewer.begin_frame(self._sim_time)
try:
@@ -1309,7 +1313,7 @@ def _render_frame(self) -> None:
"""Update controls and publish GPU poses or sensor pixels to Newton once per frame."""
viewer = self._viewer
view = self.current_image_view
- if view.camera is None and getattr(view.cfg.source, "is_task_view", False):
+ if self._is_task_view(view):
self._apply_view_pose(view)
viewer.begin_frame(self._sim_time)
try:
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index 77c68fb7188c..a8445b7267d1 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -103,14 +103,25 @@ def capture(output):
assert viz.current_image_view is free and viz._last_render_step == -1
-def test_the_task_view_recording_picks_the_first_tied_view_and_reports_none():
- free, task = _view(PerspectiveCameraCfg()), _view(PerspectiveCameraCfg(track_path="robot"))
- viz = _visualizer([free, task])
+def test_the_task_view_recording_picks_the_first_tied_view():
+ free = _view(PerspectiveCameraCfg())
+ first, second = _view(PerspectiveCameraCfg(track_path="robot")), _view(PerspectiveCameraCfg(env_index=1))
+ viz = _visualizer([free, first, second])
viz._sim.get_physics_step_count = lambda: 3
- task.read_rgb = lambda step: ("task", step)
- assert viz.render_task_view_rgb_array() == ("task", 3)
+ first.read_rgb, second.read_rgb = (lambda step: ("first", step)), (lambda step: ("second", step))
+ assert viz.render_task_view_rgb_array() == ("first", 3)
+
+
+def test_the_task_view_recording_reports_a_visualizer_without_one():
with pytest.raises(RuntimeError, match="tied to an environment or an asset"):
- _visualizer([free]).render_task_view_rgb_array()
+ _visualizer([_view(PerspectiveCameraCfg())]).render_task_view_rgb_array()
+
+
+def test_a_task_view_without_a_follower_has_no_pose_instead_of_failing():
+ task = _view(PerspectiveCameraCfg(env_index=1))
+ viz = _visualizer([task])
+ viz._followers.clear() # no interactive scene was registered when the viewer initialized
+ assert not viz._apply_view_pose(task)
def test_the_selector_names_what_a_task_view_follows_or_frames():
From 2d4fd34179e7064dc0f3a52835d9762f9c02f0f8 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 15 Oct 2026 21:50:15 +0000
Subject: [PATCH 009/140] Describe task views in the streaming view docs
---
docs/source/concepts/visualization.rst | 7 +++++--
docs/source/how-to/visualizer_streaming_camera_view.rst | 6 ++++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index 1d56ea771bc6..c89015fe3054 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -545,10 +545,12 @@ task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton G
Rerun, and Viser visualizers. **Kit** opens it as a separate **Streaming View** viewport, which can
sit side by side with the default viewport for dual monitoring. **Newton GL** and **Newton RTX**
provide a **Camera View** selector in the sidebar for switching between perspective and scene-camera
-views.
+views. In **Newton GL** a perspective view can also be a *task view* that follows a robot or frames an
+environment, rendered by the viewer itself, so the interactive view stays free; select it in **Camera View**
+or record it with ``--video viz:newton_gl:tracking``.
See :doc:`/source/how-to/visualizer_streaming_camera_view` for the ``VisualizerCfg`` options, display
-sources, troubleshooting, migration from generated cameras, and step-by-step examples.
+sources, task views that follow a robot, troubleshooting, migration from generated cameras, and step-by-step examples.
Visualization Markers
@@ -725,6 +727,7 @@ step, running with ``--viz kit``:
from isaaclab_visualizers.kit import KitVisualizerCfg
+ # Kit moves its interactive viewport itself; Newton GL offers a separate task view instead.
sim_cfg.visualizer_cfgs = [
KitVisualizerCfg(
origin_type="asset",
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index fb42e25ae4b0..d03dacbe2ceb 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -8,8 +8,8 @@ Streaming a camera view in a visualizer
.. currentmodule:: isaaclab
This guide shows how to show ground-truth camera frames from many environments in one live
-panel of a visualizer. For how the view works and which visualizers support it, see
-:ref:`visualization-streaming-camera-view`.
+panel of a visualizer, and how to add a view that follows a robot (see :ref:`how-to-visualizer-task-views`).
+For how the view works and which visualizers support it, see :ref:`visualization-streaming-camera-view`.
Sharing a view with recording
@@ -123,6 +123,8 @@ for dual monitoring.
**Newton GL and Newton RTX** have a **Camera View** selector in the sidebar. Selecting a scene camera displays
its tiled output in the main viewport instead of rendering a perspective view behind it.
Selecting a perspective camera restores interactive scene rendering. Newton GL also restores picking.
+A perspective entry that follows a robot or frames an environment is a task view and is named for what it does,
+such as ``Following robot (env 0)`` or ``Environment 0``; see :ref:`how-to-visualizer-task-views`.
Without an explicit ``cameras`` list, the viewer starts in perspective and offers scene cameras
that provide every requested ``streaming_gt_types`` channel. An explicit
From e4e0d8716af114a470b34edb825d88ab76153015 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 15 Oct 2026 22:14:14 +0000
Subject: [PATCH 010/140] Follow task views in Kit and Viser and pick the
environment
Kit follows a task view with its viewport, replacing the origin_type,
origin_env_index and origin_track_path fields of KitVisualizerCfg: the viewport
starts on the first declared view, and follow(), unfollow(), set_follow_env()
and set_view_offsets() switch it, from the environment window or code. The
deprecated viewer bridge and ViewportCameraController map onto them.
Viser gets a Follow task view checkbox, off by default, and an Environment
field. Newton GL gets an Environment field beside Camera View. A follower can
change its environment at runtime.
---
docs/source/concepts/visualization.rst | 27 +--
.../visualizer_streaming_camera_view.rst | 19 +-
.../migration/migrating_to_isaaclab_3-0.rst | 22 ++-
.../changelog.d/task-view-kit.changed.rst | 3 +
source/isaaclab/isaaclab/envs/common.py | 51 +++---
.../isaaclab/envs/ui/base_env_window.py | 40 +----
.../envs/ui/viewport_camera_controller.py | 65 +++----
.../isaaclab/visualizers/camera_follower.py | 27 ++-
.../isaaclab/test/envs/test_video_recorder.py | 9 +-
.../changelog.d/task-view-kit.changed.rst | 2 +
.../changelog.d/task-view-kit.minor | 0
.../contrib/franka_pour/pour_env_cfg.py | 10 +-
.../ur10_particle_push_env_cfg.py | 11 +-
.../changelog.d/task-view-kit.changed.rst | 5 +
.../changelog.d/task-view-kit.major | 0
.../changelog.d/task-view-viser.added.rst | 2 +
.../kit/kit_visualizer.py | 170 +++++++++---------
.../kit/kit_visualizer_cfg.py | 29 ---
.../newton/newton_visualizer.py | 29 ++-
.../viser/viser_visualizer.py | 58 +++++-
.../test_kit_visualizer_scene_partitioning.py | 63 ++++++-
.../test/test_viser_task_view.py | 102 +++++++++++
22 files changed, 486 insertions(+), 258 deletions(-)
create mode 100644 source/isaaclab/changelog.d/task-view-kit.changed.rst
create mode 100644 source/isaaclab_tasks/changelog.d/task-view-kit.changed.rst
create mode 100644 source/isaaclab_tasks/changelog.d/task-view-kit.minor
create mode 100644 source/isaaclab_visualizers/changelog.d/task-view-kit.changed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/task-view-kit.major
create mode 100644 source/isaaclab_visualizers/changelog.d/task-view-viser.added.rst
create mode 100644 source/isaaclab_visualizers/test/test_viser_task_view.py
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index c89015fe3054..6d4341cf63be 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -545,9 +545,10 @@ task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton G
Rerun, and Viser visualizers. **Kit** opens it as a separate **Streaming View** viewport, which can
sit side by side with the default viewport for dual monitoring. **Newton GL** and **Newton RTX**
provide a **Camera View** selector in the sidebar for switching between perspective and scene-camera
-views. In **Newton GL** a perspective view can also be a *task view* that follows a robot or frames an
-environment, rendered by the viewer itself, so the interactive view stays free; select it in **Camera View**
-or record it with ``--video viz:newton_gl:tracking``.
+views. A perspective view can also be a *task view* that follows a robot or frames an environment. **Newton GL**
+renders it as its own view, so the interactive view stays free; select it in **Camera View** or record it with
+``--video viz:newton_gl:tracking``. **Viser** follows it when you toggle it, and **Kit** follows it with its
+viewport.
See :doc:`/source/how-to/visualizer_streaming_camera_view` for the ``VisualizerCfg`` options, display
sources, task views that follow a robot, troubleshooting, migration from generated cameras, and step-by-step examples.
@@ -718,21 +719,27 @@ Watch training live in Kit while recording from a separate headless Newton GL an
``--viz kit --video viz:newton_gl`` and giving each visualizer its own camera. See
:ref:`Recording from an independent camera angle ` for the configuration.
-**Following a moving robot (Kit)**
+**Following a moving robot**
-Lock the Kit camera to a moving asset instead of updating ``eye``/``lookat`` yourself every
-step, running with ``--viz kit``:
+Declare a *task view* instead of updating ``eye``/``lookat`` yourself every step. Newton GL renders it
+as a separate view, Kit follows with its viewport, and Viser follows when you toggle it; see
+:ref:`how-to-visualizer-task-views`:
.. code-block:: python
+ from isaaclab.visualizers import PerspectiveCameraCfg
from isaaclab_visualizers.kit import KitVisualizerCfg
- # Kit moves its interactive viewport itself; Newton GL offers a separate task view instead.
+ # the first view starts active, so Kit's viewport starts on the task view; a free view follows it
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
+ cameras=[
+ PerspectiveCameraCfg(
+ track_path="robot", # or "robot/panda_hand" to track a specific body
+ eye=(4.0, 4.0, 2.0), # offset from the tracked asset
+ ),
+ PerspectiveCameraCfg(),
+ ]
)
]
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index d03dacbe2ceb..8f6a0d32c0ff 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -196,10 +196,21 @@ viewport's markers and shadows. Tasks declare one in ``sim.default_visualizer_cf
``heading_smoothing_time_constant`` [s] damps rapid turns; zero follows immediately.
The interactive view stays free: a free perspective view at the visualizer's own ``eye`` and ``lookat`` is
-added before the task view, and the **Camera View** selector switches between them. While a task view is
-selected the window follows the robot, and selecting the free view hands the camera back. Record a task view,
-whichever view the window shows, with ``--video viz:newton_gl:tracking``. Newton GL supports task views and their recording.
-Newton RTX shares the same view code but is untested, and Kit, Rerun, and Viser ignore task views.
+added before the task view, and the first view starts active. Each visualizer offers the task view its own way:
+
+* **Newton GL:** the **Camera View** selector lists it, named for what it does (``Following robot (env 0)`` or
+ ``Environment 0``), and an **Environment** field beside the selector picks the environment it follows. While it
+ is selected the window follows the robot, and selecting the free view hands the camera back. Record it,
+ whichever view the window shows, with ``--video viz:newton_gl:tracking``.
+* **Viser:** a **Camera View** folder in the sidebar has a **Follow task view** checkbox, off by default, and an
+ **Environment** field, 0 unless the view declares another. While it is on, the browser camera follows the robot;
+ turning it off leaves the camera where it is, free to move. Viser cannot be recorded.
+* **Kit:** the viewport starts on the task view when it is declared first, and follows the environment or the
+ asset until the **Follow Mode** control in the environment window or ``KitVisualizer.unfollow()`` hands it back.
+ The **Camera Eye** and **Camera Target** controls then edit the offsets. This replaces the ``origin_type``,
+ ``origin_env_index``, and ``origin_track_path`` fields of ``KitVisualizerCfg``.
+
+Newton RTX shares the Newton GL view code but is untested, and Rerun ignores task views.
Newton RTX uses Newton's native ``ViewerRTX`` with a simulation-owned OVStage containing the
authored scene and clone placements. Newton owns its perspective renderer, window, and debug
diff --git a/docs/source/migration/migrating_to_isaaclab_3-0.rst b/docs/source/migration/migrating_to_isaaclab_3-0.rst
index 32c00ca7cf1f..b44dac5838c7 100644
--- a/docs/source/migration/migrating_to_isaaclab_3-0.rst
+++ b/docs/source/migration/migrating_to_isaaclab_3-0.rst
@@ -2615,9 +2615,9 @@ on the sim config instead.
Similarly, :class:`~isaaclab.envs.ui.ViewportCameraController` is deprecated. A shim class
remains so existing imports do not break, but it raises a :class:`DeprecationWarning` at
-construction. Camera tracking is now handled directly by
-:class:`~isaaclab_visualizers.kit.KitVisualizer` via ``origin_type`` and
-``origin_track_path`` on :class:`~isaaclab_visualizers.kit.KitVisualizerCfg`.
+construction. Camera tracking is now a task view: a :class:`~isaaclab.visualizers.PerspectiveCameraCfg` with
+``env_index`` or ``track_path`` in the ``cameras`` of :class:`~isaaclab_visualizers.kit.KitVisualizerCfg`.
+The ``origin_type``, ``origin_env_index``, and ``origin_track_path`` fields of ``KitVisualizerCfg`` are removed.
.. code-block:: python
@@ -2629,9 +2629,9 @@ construction. Camera tracking is now handled directly by
from isaaclab.visualizers import VisualizerCfg
env_cfg.sim.default_visualizer_cfg = VisualizerCfg(eye=(4.5, 0.0, 6.0), lookat=(0.0, 0.0, 2.0))
-For asset-body tracking (previously ``origin_type="asset_root"`` / ``"asset_body"``), use
-:class:`~isaaclab_visualizers.kit.KitVisualizerCfg` with ``origin_type="asset"`` and
-``origin_track_path``:
+For asset-body tracking (previously ``origin_type="asset_root"`` / ``"asset_body"``), declare a task view
+with ``track_path`` first in :class:`~isaaclab_visualizers.kit.KitVisualizerCfg` ``cameras``, so the viewport
+starts on it, followed by a free view:
.. code-block:: python
@@ -2640,11 +2640,17 @@ For asset-body tracking (previously ``origin_type="asset_root"`` / ``"asset_body
env_cfg.viewer.asset_name = "robot"
# After (Isaac Lab 3.x)
+ from isaaclab.visualizers import PerspectiveCameraCfg
from isaaclab_visualizers.kit import KitVisualizerCfg
- env_cfg.sim.visualizer_cfgs = [KitVisualizerCfg(origin_type="asset", origin_track_path="robot")] # --viz kit
+ env_cfg.sim.visualizer_cfgs = [
+ KitVisualizerCfg(
+ cameras=[PerspectiveCameraCfg(track_path="robot", eye=(4.0, 4.0, 2.0)), PerspectiveCameraCfg()]
+ )
+ ] # --viz kit
The :class:`~isaaclab.envs.ui.ViewportCameraController` class is also deprecated; camera
-tracking is handled directly by :class:`~isaaclab_visualizers.kit.KitVisualizer`.
+tracking is a task view of :class:`~isaaclab_visualizers.kit.KitVisualizer`, switched at runtime with its
+``follow()`` and ``unfollow()`` methods or the **Follow Mode** control of the environment window.
Custom visualizers receive their owning ``sim`` and bound ``cameras`` in ``initialize()``.
diff --git a/source/isaaclab/changelog.d/task-view-kit.changed.rst b/source/isaaclab/changelog.d/task-view-kit.changed.rst
new file mode 100644
index 000000000000..da98f3139ad4
--- /dev/null
+++ b/source/isaaclab/changelog.d/task-view-kit.changed.rst
@@ -0,0 +1,3 @@
+* Changed the Kit environment window controls, the deprecated ``viewer`` bridge, and the deprecated
+ ``ViewportCameraController`` to use Kit's task view following instead of the removed ``KitVisualizerCfg``
+ ``origin_*`` fields.
diff --git a/source/isaaclab/isaaclab/envs/common.py b/source/isaaclab/isaaclab/envs/common.py
index d9e9086310f8..89cf55e34fd1 100644
--- a/source/isaaclab/isaaclab/envs/common.py
+++ b/source/isaaclab/isaaclab/envs/common.py
@@ -103,9 +103,11 @@ def _apply_deprecated_viewer_cfg(env_cfg: object) -> None:
Mapping from deprecated :class:`ViewerCfg` fields to :class:`~isaaclab_visualizers.kit.KitVisualizerCfg`:
* ``eye`` / ``lookat`` → ``eye`` / ``lookat``
- * ``env_index`` → ``origin_env_index``
- * ``origin_type="asset_root"`` → ``origin_type="asset"``, ``origin_track_path=""``
- * ``origin_type="asset_body"`` → ``origin_type="asset"``, ``origin_track_path="/"``
+ * ``origin_type="env"`` → a :class:`~isaaclab.visualizers.PerspectiveCameraCfg` with ``env_index``
+ * ``origin_type="asset_root"`` → the same view with ``track_path=""``
+ * ``origin_type="asset_body"`` → the same view with ``track_path="/"``
+
+ The view comes first, so the viewport starts on it, followed by a free view.
Must be called before :class:`~isaaclab.sim.SimulationContext` is constructed so
that the translated cfg is visible to the context.
@@ -155,32 +157,35 @@ def _apply_deprecated_viewer_cfg(env_cfg: object) -> None:
)
return
- # Map deprecated origin_type values to the new KitVisualizerCfg fields.
- new_origin_type = viewer.origin_type
- origin_track_path = None
- if viewer.origin_type in ("asset_root", "asset_body"):
- new_origin_type = "asset"
- if getattr(viewer, "asset_name", None) is not None:
- body_name = getattr(viewer, "body_name", None)
- if viewer.origin_type == "asset_body" and body_name is not None:
- origin_track_path = f"{viewer.asset_name}/{body_name}"
- else:
- origin_track_path = viewer.asset_name
+ # Map deprecated origin_type values to a task view, which starts the viewport following.
+ track_path = None
+ if viewer.origin_type in ("asset_root", "asset_body") and getattr(viewer, "asset_name", None) is not None:
+ body_name = getattr(viewer, "body_name", None)
+ track_path = (
+ f"{viewer.asset_name}/{body_name}"
+ if viewer.origin_type == "asset_body" and body_name is not None
+ else viewer.asset_name
+ )
+ tied = viewer.origin_type == "env" or track_path is not None
try:
from isaaclab_visualizers.kit import KitVisualizerCfg
- from ..visualizers import WindowCfg
+ from ..visualizers import PerspectiveCameraCfg, WindowCfg
resolution = getattr(viewer, "resolution", None)
- sim_cfg.default_visualizer_cfg = KitVisualizerCfg(
- eye=tuple(viewer.eye),
- lookat=tuple(viewer.lookat),
- origin_type=new_origin_type,
- origin_env_index=getattr(viewer, "env_index", 0),
- origin_track_path=origin_track_path,
- **({"window": WindowCfg(size=tuple(resolution))} if resolution is not None else {}),
- )
+ options = {"window": WindowCfg(size=tuple(resolution))} if resolution is not None else {}
+ if tied:
+ view = PerspectiveCameraCfg(
+ env_index=getattr(viewer, "env_index", 0),
+ track_path=track_path,
+ eye=tuple(viewer.eye),
+ lookat=tuple(viewer.lookat),
+ )
+ options["cameras"] = [view, PerspectiveCameraCfg()]
+ else:
+ options.update(eye=tuple(viewer.eye), lookat=tuple(viewer.lookat))
+ sim_cfg.default_visualizer_cfg = KitVisualizerCfg(**options)
except ImportError:
from ..visualizers import VisualizerCfg
diff --git a/source/isaaclab/isaaclab/envs/ui/base_env_window.py b/source/isaaclab/isaaclab/envs/ui/base_env_window.py
index cfac5b2c6e53..43b43dbdc1cf 100644
--- a/source/isaaclab/isaaclab/envs/ui/base_env_window.py
+++ b/source/isaaclab/isaaclab/envs/ui/base_env_window.py
@@ -212,7 +212,7 @@ def _build_viewer_frame(self):
viewport_origin_cfg = {
"label": "Environment Index",
"type": "button",
- "default_val": (_viz.cfg.origin_env_index if _viz is not None else 0) + 1,
+ "default_val": (_viz.follow_env_index if _viz is not None else 0) + 1,
"min": 1,
"max": self.env.num_envs,
"tooltip": "The environment index to follow. Only effective if follow mode is not 'World'.",
@@ -416,57 +416,35 @@ def _get_kit_visualizer(self):
return None
def _set_viewer_origin_type_fn(self, value: str):
- """Sets the origin of the viewport's camera. This is based on the drop-down menu in the UI."""
+ """Sets what the viewport's camera follows. This is based on the drop-down menu in the UI."""
viz = self._get_kit_visualizer()
if viz is None:
return
if value == "World":
- viz.cfg.origin_type = "world"
+ viz.unfollow()
elif value == "Env":
- viz.cfg.origin_type = "env"
+ viz.follow(None)
else:
fancy_names = [name.replace("_", " ").title() for name in self._viewer_assets_options]
- viewer_asset_name = self._viewer_assets_options[fancy_names.index(value)]
- viz.cfg.origin_type = "asset"
- viz.cfg.origin_track_path = viewer_asset_name
-
- # Reposition the viewport camera immediately so the new origin is reflected
- # without waiting for the next env.step() call.
- viz.reapply_origin()
+ viz.follow(self._viewer_assets_options[fancy_names.index(value)])
def _set_viewer_location_fn(self, model: omni.ui.SimpleFloatModel):
- """Sets the viewport camera location based on the UI."""
+ """Sets the viewport camera location based on the UI: offsets while following, world coordinates if free."""
viz = self._get_kit_visualizer()
if viz is None:
return
eye = [self.ui_window_elements["viewer_eye"][i].get_value_as_float() for i in range(3)]
lookat = [self.ui_window_elements["viewer_lookat"][i].get_value_as_float() for i in range(3)]
- viz.set_camera_view(eye, lookat)
-
- # Persist the slider values back to cfg so that asset-tracking steps do not
- # snap the camera back to the previously configured offsets.
- origin = viz.viewer_origin
- if origin is not None:
- origin_np = origin.detach().cpu().numpy()
- viz.cfg.eye = tuple(float(e - o) for e, o in zip(eye, origin_np))
- viz.cfg.lookat = tuple(float(lk - o) for lk, o in zip(lookat, origin_np))
- else:
- viz.cfg.eye = tuple(float(v) for v in eye)
- viz.cfg.lookat = tuple(float(v) for v in lookat)
+ viz.set_view_offsets(eye, lookat)
def _set_viewer_env_index_fn(self, model: omni.ui.SimpleIntModel):
- """Sets the environment index and updates the camera if in 'env' origin mode."""
+ """Sets the environment the viewport camera follows."""
viz = self._get_kit_visualizer()
env_index = model.as_int - 1
if viz is not None:
- viz.cfg.origin_env_index = env_index
- # For "env" origin the camera must be repositioned immediately; for asset-tracking
- # origins reapply_origin() defers the update to the next step() call (asset state
- # is needed to compute the new position).
- if viz.cfg.origin_type == "env":
- viz.reapply_origin()
+ viz.set_follow_env(env_index)
# notify additional listeners
for listener in self._ui_listeners:
listener.set_env_selection(env_index)
diff --git a/source/isaaclab/isaaclab/envs/ui/viewport_camera_controller.py b/source/isaaclab/isaaclab/envs/ui/viewport_camera_controller.py
index ebedf5f1875e..4c45c7d74186 100644
--- a/source/isaaclab/isaaclab/envs/ui/viewport_camera_controller.py
+++ b/source/isaaclab/isaaclab/envs/ui/viewport_camera_controller.py
@@ -6,8 +6,8 @@
"""Deprecated: ViewportCameraController compatibility shim.
Camera tracking is now built into :class:`~isaaclab_visualizers.kit.KitVisualizer`.
-Configure ``eye``, ``lookat``, ``origin_type``, and ``origin_track_path`` directly on
-:class:`~isaaclab_visualizers.kit.KitVisualizerCfg` and add it to
+Declare a :class:`~isaaclab.visualizers.PerspectiveCameraCfg` with ``env_index`` or ``track_path`` in the
+``cameras`` of :class:`~isaaclab_visualizers.kit.KitVisualizerCfg`, and add it to
:attr:`~isaaclab.sim.SimulationCfg.visualizer_cfgs`.
"""
@@ -17,7 +17,6 @@
from typing import TYPE_CHECKING
import numpy as np
-import torch
if TYPE_CHECKING:
from .. import ViewerCfg
@@ -26,8 +25,8 @@
def _warn_method(name: str) -> None:
warnings.warn(
f"ViewportCameraController.{name}() is deprecated. "
- "Set cfg fields (origin_type, origin_track_path, eye, lookat) on KitVisualizerCfg and "
- "call visualizer.reapply_origin() to update at runtime.",
+ "Declare a PerspectiveCameraCfg with env_index or track_path in KitVisualizerCfg.cameras, and call "
+ "visualizer.follow() or visualizer.unfollow() to change it at runtime.",
DeprecationWarning,
stacklevel=3,
)
@@ -38,18 +37,17 @@ class ViewportCameraController:
.. deprecated::
:class:`ViewportCameraController` has been removed. Camera tracking is now built into
- :class:`~isaaclab_visualizers.kit.KitVisualizer`. Set ``origin_type``,
- ``origin_track_path``, ``eye``, and ``lookat`` directly on
- :class:`~isaaclab_visualizers.kit.KitVisualizerCfg` and pass it to
+ :class:`~isaaclab_visualizers.kit.KitVisualizer`. Declare a
+ :class:`~isaaclab.visualizers.PerspectiveCameraCfg` with ``env_index`` or ``track_path`` in
+ :class:`~isaaclab_visualizers.kit.KitVisualizerCfg` ``cameras`` and pass it to
:attr:`~isaaclab.sim.SimulationCfg.visualizer_cfgs`.
"""
def __init__(self, env: object, cfg: ViewerCfg):
warnings.warn(
"ViewportCameraController is deprecated and has been removed. "
- "Camera tracking is now built into KitVisualizer — configure "
- "origin_type, origin_track_path, eye, and lookat directly on KitVisualizerCfg "
- "and add it to SimulationCfg.visualizer_cfgs.",
+ "Camera tracking is now built into KitVisualizer: declare a PerspectiveCameraCfg with "
+ "env_index or track_path in KitVisualizerCfg.cameras and add it to SimulationCfg.visualizer_cfgs.",
DeprecationWarning,
stacklevel=2,
)
@@ -71,7 +69,7 @@ def cfg(self) -> ViewerCfg:
# ------------------------------------------------------------------
def set_view_env_index(self, env_index: int) -> None:
- """Deprecated. Update :attr:`~KitVisualizerCfg.origin_env_index` on the visualizer instead."""
+ """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.set_follow_env` instead."""
_warn_method("set_view_env_index")
num_envs = getattr(self._env, "num_envs", None)
if num_envs is not None and not (0 <= env_index < num_envs):
@@ -81,72 +79,53 @@ def set_view_env_index(self, env_index: int) -> None:
)
self._cfg.env_index = env_index
for viz in self._get_kit_visualizers():
- viz.cfg.origin_env_index = env_index
- if getattr(viz.cfg, "origin_type", None) == "env":
- viz.reapply_origin()
+ viz.set_follow_env(env_index)
def update_view_to_world(self) -> None:
- """Deprecated. Set ``origin_type='world'`` on :class:`~isaaclab_visualizers.kit.KitVisualizerCfg` instead."""
+ """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.unfollow` instead."""
_warn_method("update_view_to_world")
self._cfg.origin_type = "world"
- origin = torch.zeros(3)
for viz in self._get_kit_visualizers():
- viz.cfg.origin_type = "world"
- eye = (origin + torch.tensor(self.default_cam_eye, dtype=torch.float32)).tolist()
- target = (origin + torch.tensor(self.default_cam_lookat, dtype=torch.float32)).tolist()
- viz.set_camera_view(tuple(eye), tuple(target))
+ viz.unfollow()
+ viz.set_view_offsets(tuple(self.default_cam_eye.tolist()), tuple(self.default_cam_lookat.tolist()))
def update_view_to_env(self) -> None:
- """Deprecated. Set ``origin_type='env'`` on :class:`~isaaclab_visualizers.kit.KitVisualizerCfg` instead."""
+ """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.follow` instead."""
_warn_method("update_view_to_env")
self._cfg.origin_type = "env"
for viz in self._get_kit_visualizers():
- viz.cfg.origin_type = "env"
- viz.reapply_origin()
+ viz.follow(None)
def update_view_to_asset_root(self, asset_name: str) -> None:
- """Deprecated. Set ``origin_type='asset'`` and ``origin_track_path`` on
- :class:`~isaaclab_visualizers.kit.KitVisualizerCfg` instead."""
+ """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.follow` with the asset instead."""
_warn_method("update_view_to_asset_root")
self._cfg.asset_name = asset_name
self._cfg.origin_type = "asset_root"
for viz in self._get_kit_visualizers():
- viz.cfg.origin_type = "asset"
- viz.cfg.origin_track_path = asset_name
- viz.reapply_origin()
+ viz.follow(asset_name)
def update_view_to_asset_body(self, asset_name: str, body_name: str) -> None:
- """Deprecated. Set ``origin_type='asset'`` and ``origin_track_path`` on
- :class:`~isaaclab_visualizers.kit.KitVisualizerCfg` instead."""
+ """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.follow` with the body instead."""
_warn_method("update_view_to_asset_body")
self._cfg.asset_name = asset_name
self._cfg.body_name = body_name
self._cfg.origin_type = "asset_body"
for viz in self._get_kit_visualizers():
- viz.cfg.origin_type = "asset"
- viz.cfg.origin_track_path = f"{asset_name}/{body_name}"
- viz.reapply_origin()
+ viz.follow(f"{asset_name}/{body_name}")
def update_view_location(
self,
eye: tuple[float, float, float] | None = None,
lookat: tuple[float, float, float] | None = None,
) -> None:
- """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.set_camera_view` directly instead."""
+ """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.set_view_offsets` directly instead."""
_warn_method("update_view_location")
if eye is not None:
self.default_cam_eye = np.asarray(eye, dtype=float)
if lookat is not None:
self.default_cam_lookat = np.asarray(lookat, dtype=float)
for viz in self._get_kit_visualizers():
- # Persist relative offsets into the visualizer config so that
- # subsequent reapply_origin() calls (e.g. from asset tracking) use
- # the updated offsets rather than the stale original values.
- viz.cfg.eye = tuple(self.default_cam_eye.tolist())
- viz.cfg.lookat = tuple(self.default_cam_lookat.tolist())
- # reapply_origin() adds the current world/env/asset origin and pushes
- # the result to the viewport, preserving origin-relative behaviour.
- viz.reapply_origin()
+ viz.set_view_offsets(tuple(self.default_cam_eye.tolist()), tuple(self.default_cam_lookat.tolist()))
# ------------------------------------------------------------------
# Private helpers
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
index aee6721ecb23..d8c914734592 100644
--- a/source/isaaclab/isaaclab/visualizers/camera_follower.py
+++ b/source/isaaclab/isaaclab/visualizers/camera_follower.py
@@ -34,9 +34,11 @@ class CameraFollower:
def __init__(self, cfg: PerspectiveCameraCfg, scene: InteractiveScene) -> None:
self.cfg = cfg
self._scene = scene
- self._env = cfg.env_index or 0
- if not 0 <= self._env < scene.num_envs:
- raise ValueError(f"env_index {self._env} is outside the {scene.num_envs} environments of the scene.")
+ self._env = 0
+ self._yaw: float | None = None
+ self._last_position: list[float] | None = None
+ self._time: float | None = None
+ self.set_env(cfg.env_index or 0)
self._asset = None
self._body_index: int | None = None
self._body_name = ""
@@ -46,9 +48,22 @@ def __init__(self, cfg: PerspectiveCameraCfg, scene: InteractiveScene) -> None:
self._asset = scene[asset_name]
except KeyError as exc:
raise ValueError(f"track_path refers to an unknown scene asset: {asset_name!r}.") from exc
- self._yaw: float | None = None
- self._last_position: list[float] | None = None
- self._time: float | None = None
+
+ @property
+ def env(self) -> int:
+ """Environment whose origin or asset the view follows."""
+ return self._env
+
+ def set_env(self, index: int) -> None:
+ """Follow environment *index* from now on, with the heading filter starting afresh.
+
+ Raises:
+ ValueError: If *index* is outside the scene's environments.
+ """
+ if not 0 <= index < self._scene.num_envs:
+ raise ValueError(f"env_index {index} is outside the {self._scene.num_envs} environments of the scene.")
+ self._env = int(index)
+ self._yaw = self._last_position = self._time = None
def pose(self, time: float) -> tuple[tuple[float, float, float], tuple[float, float, float]] | None:
"""Return the world eye and look-at target at simulation *time*, or None until the asset is ready.
diff --git a/source/isaaclab/test/envs/test_video_recorder.py b/source/isaaclab/test/envs/test_video_recorder.py
index 71ffd8fc8d4f..3812b984bb1a 100644
--- a/source/isaaclab/test/envs/test_video_recorder.py
+++ b/source/isaaclab/test/envs/test_video_recorder.py
@@ -317,9 +317,12 @@ def test_apply_deprecated_viewer_preserves_pose_and_tracking(origin_type, expect
_apply_deprecated_viewer_cfg(env_cfg)
cfg = env_cfg.sim.default_visualizer_cfg
assert cfg is not None
- assert cfg.eye == (1.0, 2.0, 3.0)
- assert cfg.origin_type == ("asset" if expected_path else "world")
- assert cfg.origin_track_path == expected_path
+ if expected_path is None:
+ assert cfg.eye == (1.0, 2.0, 3.0)
+ return
+ # a followed asset becomes a task view that comes first, so the viewport starts on it
+ assert cfg.cameras[0].track_path == expected_path and cfg.cameras[0].eye == (1.0, 2.0, 3.0)
+ assert not cfg.cameras[1].is_task_view
def test_apply_deprecated_viewer_noop_when_defaults():
diff --git a/source/isaaclab_tasks/changelog.d/task-view-kit.changed.rst b/source/isaaclab_tasks/changelog.d/task-view-kit.changed.rst
new file mode 100644
index 000000000000..e4686a502bb5
--- /dev/null
+++ b/source/isaaclab_tasks/changelog.d/task-view-kit.changed.rst
@@ -0,0 +1,2 @@
+* Changed the Franka pour and UR10 particle push tasks to frame environment 0 with a task view instead of the
+ removed ``KitVisualizerCfg`` ``origin_*`` fields.
diff --git a/source/isaaclab_tasks/changelog.d/task-view-kit.minor b/source/isaaclab_tasks/changelog.d/task-view-kit.minor
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
index 042500e389fa..b905d24e4089 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
@@ -37,6 +37,7 @@
from isaaclab.sim.spawners.materials import RigidBodyMaterialBaseCfg
from isaaclab.utils import configclass, replace
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, ISAACLAB_NUCLEUS_DIR
+from isaaclab.visualizers import PerspectiveCameraCfg
from isaaclab_contrib.coupling import CouplerEntryCfg, CouplerProxyCfg, CouplerProxyMappingCfg
@@ -590,11 +591,12 @@ def __post_init__(self):
self.sim.dt = 1.0 / 120.0
self.sim.render_interval = self.decimation
self.sim.use_newton_actuators = True
+ # the viewport starts on the first view, framing environment 0; a free view follows it
self.sim.default_visualizer_cfg = KitVisualizerCfg(
- eye=(1.4, 1.4, 0.9),
- lookat=(0.5, 0.0, 0.1),
- origin_type="env",
- origin_env_index=0,
+ cameras=[
+ PerspectiveCameraCfg(env_index=0, eye=(1.4, 1.4, 0.9), lookat=(0.5, 0.0, 0.1)),
+ PerspectiveCameraCfg(),
+ ]
)
self.sim.physics = NewtonCfg(
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
index 2989bc976566..417f33cb4009 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
@@ -962,11 +962,14 @@ def validate_config(self) -> None:
def __post_init__(self) -> None:
from isaaclab_visualizers.kit import KitVisualizerCfg
+ from isaaclab.visualizers import PerspectiveCameraCfg
+
+ # the viewport starts on the first view, framing environment 0; a free view follows it
self.sim.default_visualizer_cfg = KitVisualizerCfg(
- eye=(1.7, 1.5, 1.0),
- lookat=(0.55, 0.0, 0.0),
- origin_type="env",
- origin_env_index=0,
+ cameras=[
+ PerspectiveCameraCfg(env_index=0, eye=(1.7, 1.5, 1.0), lookat=(0.55, 0.0, 0.0)),
+ PerspectiveCameraCfg(),
+ ]
)
self.sim.physics = NewtonCfg(
solver_cfg=CouplerProxyCfg(
diff --git a/source/isaaclab_visualizers/changelog.d/task-view-kit.changed.rst b/source/isaaclab_visualizers/changelog.d/task-view-kit.changed.rst
new file mode 100644
index 000000000000..8e69c4903fea
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/task-view-kit.changed.rst
@@ -0,0 +1,5 @@
+* **Breaking:** Removed ``origin_type``, ``origin_env_index``, and ``origin_track_path`` from
+ :class:`~isaaclab_visualizers.kit.KitVisualizerCfg`. Declare a :class:`~isaaclab.visualizers.PerspectiveCameraCfg` with
+ ``env_index`` or ``track_path`` first in ``cameras`` instead; the viewport starts on it. Switch at runtime with
+ ``KitVisualizer.follow()``, ``unfollow()``, ``set_follow_env()``, and ``set_view_offsets()``, which replace
+ ``reapply_origin()`` and ``viewer_origin``.
diff --git a/source/isaaclab_visualizers/changelog.d/task-view-kit.major b/source/isaaclab_visualizers/changelog.d/task-view-kit.major
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/source/isaaclab_visualizers/changelog.d/task-view-viser.added.rst b/source/isaaclab_visualizers/changelog.d/task-view-viser.added.rst
new file mode 100644
index 000000000000..bed1be9677ee
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/task-view-viser.added.rst
@@ -0,0 +1,2 @@
+* Added task views to the Viser visualizer: a **Follow task view** checkbox, off by default, and an **Environment**
+ field in the sidebar make the browser camera follow a robot or frame an environment.
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
index a61b673f1f31..bc21bbfa2237 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
@@ -22,6 +22,7 @@
from isaaclab.utils.math import create_rotation_matrix_from_view, quat_from_matrix
from isaaclab.utils.renderers import ISAAC_RTX_SHOW_ALL_PARTITIONS_BY_DEFAULT_SETTING
from isaaclab.visualizers.base_visualizer import BaseVisualizer
+from isaaclab.visualizers.camera_follower import CameraFollower
from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg
from isaaclab_visualizers.desktop_entry import write_desktop_entry
@@ -82,9 +83,13 @@ def __init__(self, cfg: KitVisualizerCfg):
self._app_pumped_this_step: bool = False
self._controls_kit_timeline = False
self._owns_kit_timeline = False
- # Camera tracking state (replaces ViewportCameraController)
+ # Task view following state: the viewport camera follows an environment or an asset, or is free
self._interactive_scene = None # set from SimulationContext._interactive_scene in initialize()
- self._viewer_origin: torch.Tensor | None = None # world-space origin offset for eye/lookat
+ self._start_cameras: list = []
+ self._declared_task_view: PerspectiveCameraCfg | None = None
+ self._follow_view: PerspectiveCameraCfg | None = None
+ self._follower: CameraFollower | None = None
+ self._follow_env = 0
# ---- Lifecycle ------------------------------------------------------------------------
@@ -107,6 +112,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
return
super().initialize(sim, cameras=cameras)
+ self._start_cameras = list(cameras)
scene_data_provider = self._sim.get_scene_data_provider()
num_envs = scene_data_provider.num_envs
@@ -177,8 +183,7 @@ def step(self, dt: float) -> None:
provider = self._sim.get_scene_data_provider()
self._fabric.update_transforms(provider)
self._fabric.update_geometries(provider, self._sim.render_generation)
- if self.cfg.origin_type == "asset":
- self._update_asset_tracking_camera()
+ self._update_follow_camera()
self._app_pumped_this_step = self._pump_kit_app_update()
if self._camera_image_provider is not None:
image = self.current_image_view.frame.data if self.is_training_paused() else self.render_tiled_rgba_array()
@@ -294,8 +299,8 @@ def render_rgb_array(self) -> np.ndarray:
provider = self._sim.get_scene_data_provider()
self._fabric.update_transforms(provider)
self._fabric.update_geometries(provider, self._sim.render_generation)
- if self._runtime_headless and self.cfg.origin_type == "asset":
- self._update_asset_tracking_camera()
+ if self._runtime_headless:
+ self._update_follow_camera()
w, h = self.cfg.window.size
# Create the render product and annotator before the app update so the first
@@ -441,29 +446,66 @@ def set_camera_view(
return
self._set_viewport_camera(tuple(eye), tuple(target))
- def reapply_origin(self) -> None:
- """Recompute the camera position from the current :attr:`~KitVisualizerCfg.origin_type` and push it to
- the viewport.
+ @property
+ def following(self) -> bool:
+ """Whether the viewport camera follows an environment or an asset instead of being free."""
+ return self._follower is not None
- Call this after mutating :attr:`cfg.origin_type`, :attr:`cfg.origin_env_index`, or
- :attr:`cfg.origin_track_path` so the viewport reflects the new origin immediately rather than
- waiting for the next :meth:`step` call.
+ @property
+ def follow_env_index(self) -> int:
+ """Environment the viewport camera follows, or would follow when asked to."""
+ return self._follow_env
- For ``"asset"`` origins the camera update is deferred to the
- next :meth:`step` because asset state is not available until after
- :meth:`~isaaclab.sim.SimulationContext.reset`.
- """
- self._setup_initial_camera_view()
+ def follow(self, track_path: str | None = None, *, env_index: int | None = None) -> None:
+ """Make the viewport camera frame an environment, or follow an asset in it.
- @property
- def viewer_origin(self) -> torch.Tensor | None:
- """Current world-space origin offset applied to :attr:`~KitVisualizerCfg.eye` and
- :attr:`~KitVisualizerCfg.lookat` when computing the absolute camera position.
+ :attr:`~KitVisualizerCfg.eye` and :attr:`~KitVisualizerCfg.lookat` become offsets from the environment
+ origin, or from the tracked asset when *track_path* is set. A task view declared in the configuration
+ supplies the heading behaviour when it follows the same asset.
- Returns ``None`` before :meth:`initialize` is called or when no valid origin has been
- established yet (e.g. asset-tracking before the first :meth:`step`).
+ Args:
+ track_path: ``""`` or ``"/"``, or None to frame the environment's origin.
+ env_index: Environment to follow; None keeps the one last chosen, 0 at first.
"""
- return self._viewer_origin
+ if env_index is not None:
+ self._follow_env = int(env_index)
+ scene = self._interactive_scene
+ if scene is None:
+ logger.warning("[KitVisualizer] Cannot follow before the scene is registered.")
+ return
+ template = self._declared_task_view
+ same_asset = template is not None and template.track_path == track_path
+ self._follow_view = PerspectiveCameraCfg(
+ env_index=self._follow_env,
+ track_path=track_path,
+ eye=self.cfg.eye,
+ lookat=self.cfg.lookat,
+ focal_length=self.cfg.focal_length,
+ follow_heading=same_asset and template.follow_heading,
+ heading_smoothing_time_constant=template.heading_smoothing_time_constant if same_asset else 0.0,
+ )
+ self._follower = CameraFollower(self._follow_view, scene)
+ self._update_follow_camera()
+
+ def unfollow(self) -> None:
+ """Hand the viewport camera back to the user, keeping its current pose."""
+ self._follower = self._follow_view = None
+
+ def set_follow_env(self, env_index: int) -> None:
+ """Follow *env_index* from now on; a free camera only remembers the choice."""
+ self._follow_env = int(env_index)
+ if self._follower is not None:
+ self._follower.set_env(env_index)
+ self._update_follow_camera()
+
+ def set_view_offsets(self, eye: tuple[float, float, float], lookat: tuple[float, float, float]) -> None:
+ """Set the camera pose: offsets while following, world coordinates while free."""
+ self.cfg.eye, self.cfg.lookat = tuple(float(v) for v in eye), tuple(float(v) for v in lookat)
+ if self._follow_view is None:
+ self.set_camera_view(self.cfg.eye, self.cfg.lookat)
+ return
+ self._follow_view.eye, self._follow_view.lookat = self.cfg.eye, self.cfg.lookat
+ self._update_follow_camera()
# ---- Viewport + camera ----------------------------------------------------------------
@@ -926,74 +968,34 @@ def _restore_env_visibility(self) -> None:
self._point_instancer_invisible_ids_backup.clear()
def _setup_initial_camera_view(self) -> None:
- """Position the viewport camera according to :attr:`KitVisualizerCfg.origin_type`.
+ """Start on the first declared view: a task view follows from the start, any other view is free.
- Called once at the end of :meth:`initialize`. For ``"world"`` and ``"env"`` origins the
- camera is positioned immediately. For asset-tracking origins the first update is deferred
- to :meth:`step` because asset state is not yet available at initialization time.
+ Called once at the end of :meth:`initialize`. An asset is followed from the first step, because its
+ state is not available before :meth:`~isaaclab.sim.SimulationContext.reset`.
"""
self._interactive_scene = self._sim.get_scene_data_provider().get_interactive_scene()
-
- if self.cfg.origin_type == "world":
- self._viewer_origin = torch.zeros(3)
- elif self.cfg.origin_type == "env":
- scene = self._interactive_scene
- if scene is None:
- logger.warning("[KitVisualizer] origin_type='env' requested but no scene is registered yet.")
- self._viewer_origin = torch.zeros(3)
- else:
- num_envs = scene.num_envs
- if not (0 <= self.cfg.origin_env_index < num_envs):
- raise ValueError(
- f"[KitVisualizer] origin_env_index {self.cfg.origin_env_index} is out of range "
- f"[0, {num_envs - 1}] for origin_type='env'."
- )
- self._viewer_origin = scene.env_origins[self.cfg.origin_env_index]
- elif self.cfg.origin_type == "asset":
- if self.cfg.origin_track_path is None:
- raise ValueError("[KitVisualizer] origin_type='asset' requires origin_track_path to be set.")
- # Asset data is not available until after sim.reset(); defer to step().
+ views = [camera for camera in self._start_cameras if isinstance(camera, PerspectiveCameraCfg)]
+ self._declared_task_view = next((view for view in views if view.is_task_view), None)
+ if views and views[0].is_task_view:
+ first = views[0]
+ self.cfg.eye, self.cfg.lookat, self.cfg.focal_length = first.eye, first.lookat, first.focal_length
+ self.follow(first.track_path, env_index=first.env_index or 0)
+
+ def _update_follow_camera(self) -> None:
+ """Move the viewport camera to the followed environment or asset, once both are ready."""
+ if self._follower is None:
return
- else:
- logger.warning("[KitVisualizer] Unknown origin_type '%s'; defaulting to world.", self.cfg.origin_type)
- self._viewer_origin = torch.zeros(3)
-
- self._apply_viewer_origin_to_camera()
-
- def _update_asset_tracking_camera(self) -> None:
- """Update the viewport camera to track an asset root or body.
-
- Called before viewport frames when :attr:`KitVisualizerCfg.origin_type` is ``"asset"``.
- Parses :attr:`~KitVisualizerCfg.origin_track_path`: ``"asset_name"`` tracks the root,
- ``"asset_name/body_name"`` tracks a specific body.
- """
- scene = self._interactive_scene
- if scene is None or self.cfg.origin_track_path is None:
+ pose = self._follower.pose(self._sim.get_physics_step_count() * self._sim.get_physics_dt())
+ if pose is None:
return
- asset_name, _, body_name = self.cfg.origin_track_path.partition("/")
- try:
- asset = scene[asset_name]
- except KeyError:
- return
- if body_name:
- body_ids, _ = asset.find_bodies(body_name)
- self._viewer_origin = asset.data.body_pos_w.torch[self.cfg.origin_env_index, body_ids[0]]
- else:
- self._viewer_origin = asset.data.root_pos_w.torch[self.cfg.origin_env_index]
- self._apply_viewer_origin_to_camera()
-
- def _apply_viewer_origin_to_camera(self) -> None:
- """Compute absolute eye/target from :attr:`_viewer_origin` and push to the viewport."""
- if self._viewer_origin is None:
- return
- origin = self._viewer_origin.detach().cpu().numpy()
- eye = np.array(self.cfg.eye, dtype=float) + origin
- target = np.array(self.cfg.lookat, dtype=float) + origin
- self.set_camera_view(tuple(float(v) for v in eye), tuple(float(v) for v in target))
+ eye, target = pose
+ self.set_camera_view(eye, target)
# Keep the Isaac RTX renderer camera in sync (no-op if isaaclab_physx is not installed).
try:
from isaaclab_physx.renderers.kit_viewport_utils import set_kit_renderer_camera_view # noqa: PLC0415
- set_kit_renderer_camera_view(eye=eye, target=target, camera_prim_path="/OmniverseKit_Persp")
+ set_kit_renderer_camera_view(
+ eye=np.array(eye), target=np.array(target), camera_prim_path="/OmniverseKit_Persp"
+ )
except (ImportError, ModuleNotFoundError):
pass
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer_cfg.py b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer_cfg.py
index 70840ea6ba96..7905ce390a24 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer_cfg.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer_cfg.py
@@ -54,32 +54,3 @@ class KitVisualizerCfg(VisualizerCfg):
window: WindowCfg = WindowCfg(size=(1280, 720))
"""Viewport and capture dimensions. Kit owns the application update cadence."""
-
- 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: ``""`` to track the asset root, or ``"/"``
- 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
- """
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 52df1410651f..7da17946e102 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -600,15 +600,22 @@ def _is_task_view(view) -> bool:
return isinstance(view.cfg.source, PerspectiveCameraCfg) and view.cfg.source.is_task_view
@staticmethod
- def _view_label(index: int, view) -> str:
- """Name a view for the Camera View selector: a task view says what it follows or frames."""
+ def _view_label(index: int, view, env: int | None = None) -> str:
+ """Name a view for the Camera View selector: a task view says what it follows or frames.
+
+ Args:
+ index: Position of the view in the selector.
+ view: The view to name.
+ env: Environment the view currently follows; None uses the one its configuration declares.
+ """
if view.camera is not None:
return view.cfg.source
source = view.cfg.source
+ env = (source.env_index or 0) if env is None else env
if source.track_path:
- return f"Following {source.track_path} (env {source.env_index or 0})"
+ return f"Following {source.track_path} (env {env})"
if source.env_index is not None:
- return f"Environment {source.env_index}"
+ return f"Environment {env}"
return f"Perspective {index + 1}"
def _draw_streaming_view_controls(self, imgui) -> None:
@@ -616,10 +623,22 @@ def _draw_streaming_view_controls(self, imgui) -> None:
imgui.set_next_item_open(True, imgui.Cond_.appearing)
if not imgui.collapsing_header("Camera View"):
return
- labels = [self._view_label(i, view) for i, view in enumerate(self._image_views)]
+ labels = [
+ self._view_label(i, view, follower.env if (follower := self._followers.get(view)) else None)
+ for i, view in enumerate(self._image_views)
+ ]
changed, index = imgui.combo("Camera", self._image_views.index(self.current_image_view), labels)
if changed:
self._select_camera(index)
+ follower = self._followers.get(self.current_image_view)
+ if follower is not None:
+ # which environment a task view follows, next to the view selector
+ changed, env = imgui.input_int("Environment", follower.env)
+ num_envs = self._sim.get_scene_data_provider().num_envs
+ if changed and 0 <= env < num_envs:
+ follower.set_env(env)
+ self.current_image_view.invalidate()
+ self._last_render_step = -1
if imgui.is_item_hovered():
imgui.set_tooltip(labels[self._image_views.index(self.current_image_view)])
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/viser/viser_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/viser/viser_visualizer.py
index c94b404773bd..c65a4bf7b00f 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/viser/viser_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/viser/viser_visualizer.py
@@ -24,6 +24,7 @@
from isaaclab.scene_data import SceneDataFormat
from isaaclab.sim import SimulationContext
from isaaclab.visualizers.base_visualizer import BaseVisualizer
+from isaaclab.visualizers.camera_follower import CameraFollower
from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg
from isaaclab_visualizers.newton.newton_visualization_markers import render_newton_visualization_markers
@@ -292,6 +293,9 @@ def __init__(self, cfg: ViserVisualizerCfg):
self._warned_marker_render_failure = False
self._paused_rendering = False
self._paused_simulation = False
+ self._task_view: PerspectiveCameraCfg | None = None
+ self._task_follower: CameraFollower | None = None
+ self._following_task_view = False
def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraCfg | Camera]) -> None:
"""Initialize viewer resources and bind scene data provider.
@@ -326,6 +330,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
self._log_viewer_url("ViserVisualizer", viewer_url)
self._viewer.set_model(self.backend.model)
self._viewer.show_particles = self.cfg.show_particles
+ self._bind_task_view(cameras)
# set_model() clears model-dependent GUI elements; build the sidebar afterwards.
self._setup_isaaclab_sidebar(self._viewer._server)
self._viewer.set_visible_worlds(self._env_ids)
@@ -365,6 +370,10 @@ def step(self, dt: float) -> None:
self.set_camera_view(*self._pending_camera_pose)
self._sim_time += dt
+ if self._following_task_view and self._task_follower is not None:
+ pose = self._task_follower.pose(self._sim_time)
+ if pose is not None:
+ self.set_camera_view(*pose, focal_length=self._task_view.focal_length)
# Skip all rendering when no browser clients are connected.
if not self._viewer._server.get_clients():
@@ -455,6 +464,8 @@ def close(self) -> None:
self._viewer = None
self._is_initialized = False
self.backend = self._transform_mapping = None
+ self._task_view = self._task_follower = None
+ self._following_task_view = False
super().close()
self._pending_camera_pose = None
@@ -500,6 +511,19 @@ def _render_live_plots(self) -> None:
for i, v in enumerate(values):
self._viewer.log_scalar(f"{source.manager_name}/{term_name}[{i}]", v)
+ def _bind_task_view(self, cameras: list) -> None:
+ """Bind the first task view the config declares, so a bad environment or asset fails at initialization."""
+ self._task_view = next(
+ (camera for camera in cameras if isinstance(camera, PerspectiveCameraCfg) and camera.is_task_view), None
+ )
+ self._following_task_view = False
+ self._task_follower = None
+ if self._task_view is None:
+ return
+ scene = self._sim.get_scene_data_provider().get_interactive_scene()
+ if scene is not None:
+ self._task_follower = CameraFollower(self._task_view, scene)
+
def _setup_isaaclab_sidebar(self, server) -> None:
"""Configure the Viser sidebar as the Isaac Lab panel.
@@ -533,6 +557,9 @@ def _(_):
def _(_):
self._reset_requested = True
+ if self._task_follower is not None:
+ self._add_task_view_controls(server)
+
live_plots_folder = server.gui.add_folder("Live Plots", expand_by_default=False)
viewer._live_plots_folder = live_plots_folder
@@ -559,21 +586,48 @@ def _(_):
def _(event, _attr=attr):
setattr(viewer, _attr, event.target.value)
+ def _add_task_view_controls(self, server) -> None:
+ """Add the task view toggle, off by default, and the environment it follows, 0 by default."""
+ follower = self._task_follower
+ folder = server.gui.add_folder("Camera View", expand_by_default=True)
+ with folder:
+ toggle = server.gui.add_checkbox("Follow task view", initial_value=self._following_task_view)
+ env_input = server.gui.add_number(
+ "Environment",
+ initial_value=follower.env,
+ min=0,
+ max=self._sim.get_scene_data_provider().num_envs - 1,
+ step=1,
+ )
+
+ @toggle.on_update
+ def _(event):
+ self._following_task_view = bool(event.target.value)
+
+ @env_input.on_update
+ def _(event):
+ with contextlib.suppress(ValueError):
+ follower.set_env(int(event.target.value))
+
def set_camera_view(
- self, eye: tuple[float, float, float] | list[float], target: tuple[float, float, float] | list[float]
+ self,
+ eye: tuple[float, float, float] | list[float],
+ target: tuple[float, float, float] | list[float],
+ focal_length: float | None = None,
) -> None:
"""Set every connected client's camera eye/target.
Args:
eye: Camera eye position.
target: Camera look-at target.
+ focal_length: Focal length [mm]; None uses the configured one.
"""
self._pending_camera_pose = (tuple(float(v) for v in eye), tuple(float(v) for v in target))
if self._viewer is None:
return
clients = self._viewer._server.get_clients()
for client in clients.values():
- client.camera.fov = math.radians(self._focal_length_to_vertical_fov_degrees())
+ client.camera.fov = math.radians(self._focal_length_to_vertical_fov_degrees(focal_length))
client.camera.position, client.camera.look_at = self._pending_camera_pose
if clients:
self._pending_camera_pose = None
diff --git a/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py b/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
index 437f4f0dfb6b..0ccfd5ea3d1c 100644
--- a/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
+++ b/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
@@ -59,14 +59,14 @@ def kit_timeline(monkeypatch):
@pytest.mark.parametrize("headless", [False, True])
def test_viewport_pose_publication_is_deferred_for_headless_capture(monkeypatch, kit_app, headless):
- visualizer = KitVisualizer(KitVisualizerCfg(headless=headless, origin_type="asset"))
+ visualizer = KitVisualizer(KitVisualizerCfg(headless=headless))
visualizer._is_initialized = True
visualizer._fabric = MagicMock()
visualizer._sim = sim = MagicMock(render_generation=12)
provider = sim.get_scene_data_provider.return_value
monkeypatch.setattr(visualizer, "is_training_paused", lambda: True)
tracking = MagicMock()
- monkeypatch.setattr(visualizer, "_update_asset_tracking_camera", tracking)
+ monkeypatch.setattr(visualizer, "_update_follow_camera", tracking)
monkeypatch.setattr(visualizer, "_refresh_partial_viz_point_instancers_if_needed", MagicMock())
settings = MagicMock()
settings.get.return_value = None
@@ -343,3 +343,62 @@ def test_marker_environment_ids_are_sticky_and_revalidated_on_change() -> None:
)
assert not primvar.GetAttr().HasAuthoredValueOpinion()
+
+
+class _FollowScene:
+ num_envs = 3
+ env_origins = torch.tensor([[0.0, 0.0, 0.0], [10.0, 0.0, 0.0], [20.0, 0.0, 0.0]])
+
+ def __getitem__(self, name):
+ asset = MagicMock(is_initialized=True)
+ asset.data.root_pos_w.torch = torch.tensor([[0.0, 0.0, 0.5], [10.0, 0.0, 0.5], [20.0, 0.0, 0.5]])
+ asset.data.root_quat_w.torch = torch.tensor([[0.0, 0.0, 0.0, 1.0]] * 3)
+ return asset
+
+
+def _following_visualizer(monkeypatch, cameras):
+ visualizer = KitVisualizer(KitVisualizerCfg())
+ visualizer._sim = MagicMock()
+ visualizer._sim.get_scene_data_provider.return_value.get_interactive_scene.return_value = _FollowScene()
+ visualizer._sim.get_physics_step_count.return_value = 5
+ visualizer._sim.get_physics_dt.return_value = 0.1
+ visualizer._start_cameras = cameras
+ poses = []
+ monkeypatch.setattr(visualizer, "set_camera_view", lambda eye, target: poses.append((eye, target)))
+ return visualizer, poses
+
+
+def test_the_viewport_starts_free_unless_the_first_view_is_a_task_view(monkeypatch):
+ from isaaclab.visualizers import PerspectiveCameraCfg
+
+ task = PerspectiveCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0))
+ free, poses = _following_visualizer(monkeypatch, [PerspectiveCameraCfg(), task])
+ free._setup_initial_camera_view()
+ assert not free.following and poses == []
+
+ visualizer, poses = _following_visualizer(monkeypatch, [task, PerspectiveCameraCfg()])
+ visualizer._setup_initial_camera_view()
+ assert visualizer.following and visualizer.follow_env_index == 1
+ assert visualizer.cfg.eye == (1.0, 2.0, 3.0) # offsets while following
+ assert poses == [((11.0, 2.0, 3.0), (10.0, 0.0, 1.0))]
+
+
+def test_follow_unfollow_and_the_environment_selection(monkeypatch):
+ from isaaclab.visualizers import PerspectiveCameraCfg
+
+ visualizer, poses = _following_visualizer(monkeypatch, [PerspectiveCameraCfg()])
+ visualizer._setup_initial_camera_view()
+ visualizer.cfg.eye, visualizer.cfg.lookat = (0.0, 0.0, 1.0), (1.0, 0.0, 0.0)
+
+ visualizer.set_follow_env(2) # free: only remembered
+ assert not visualizer.following and visualizer.follow_env_index == 2 and poses == []
+ visualizer.follow("robot")
+ assert poses[-1] == ((20.0, 0.0, 1.5), (21.0, 0.0, 0.5)) # offsets from the asset in env 2
+ visualizer.set_follow_env(0)
+ assert poses[-1][0] == (0.0, 0.0, 1.5)
+ visualizer.set_view_offsets((0.0, 0.0, 2.0), (1.0, 0.0, 0.0))
+ assert poses[-1][0] == (0.0, 0.0, 2.5) and visualizer.cfg.eye == (0.0, 0.0, 2.0)
+
+ visualizer.unfollow()
+ visualizer.set_view_offsets((4.0, 4.0, 4.0), (0.0, 0.0, 0.0))
+ assert not visualizer.following and poses[-1] == ((4.0, 4.0, 4.0), (0.0, 0.0, 0.0))
diff --git a/source/isaaclab_visualizers/test/test_viser_task_view.py b/source/isaaclab_visualizers/test/test_viser_task_view.py
new file mode 100644
index 000000000000..ee0d35829d09
--- /dev/null
+++ b/source/isaaclab_visualizers/test/test_viser_task_view.py
@@ -0,0 +1,102 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Unit tests for the Viser task view: a toggle that is off by default and an environment selector."""
+
+from __future__ import annotations
+
+import contextlib
+from types import SimpleNamespace
+
+import pytest
+import torch
+from isaaclab_visualizers.viser import ViserVisualizer, ViserVisualizerCfg
+
+from isaaclab.visualizers import PerspectiveCameraCfg
+
+
+class _Scene:
+ num_envs = 3
+ env_origins = torch.tensor([[0.0, 0.0, 0.0], [10.0, 0.0, 0.0], [20.0, 0.0, 0.0]])
+
+ def __getitem__(self, name):
+ return SimpleNamespace(is_initialized=False)
+
+
+class _Element:
+ """A GUI element that records its initial value and its update callback."""
+
+ def __init__(self, initial_value):
+ self.initial_value, self.callback = initial_value, None
+
+ def on_update(self, fn):
+ self.callback = fn
+ return fn
+
+
+class _Gui:
+ def __init__(self):
+ self.elements = {}
+
+ def add_folder(self, label, expand_by_default=True):
+ return contextlib.nullcontext()
+
+ def add_checkbox(self, label, initial_value):
+ return self.elements.setdefault(label, _Element(initial_value))
+
+ def add_number(self, label, initial_value, min=None, max=None, step=None):
+ element = self.elements.setdefault(label, _Element(initial_value))
+ element.bounds = (min, max, step)
+ return element
+
+
+def _visualizer(cameras):
+ viz = ViserVisualizer(ViserVisualizerCfg())
+ scene = _Scene()
+ viz._sim = SimpleNamespace(
+ get_scene_data_provider=lambda: SimpleNamespace(get_interactive_scene=lambda: scene, num_envs=scene.num_envs)
+ )
+ viz._bind_task_view(cameras)
+ return viz
+
+
+def test_the_task_view_is_off_by_default_and_the_environment_defaults_to_zero():
+ viz = _visualizer([PerspectiveCameraCfg(), PerspectiveCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0))])
+ server = SimpleNamespace(gui=_Gui())
+ viz._add_task_view_controls(server)
+ toggle, env = server.gui.elements["Follow task view"], server.gui.elements["Environment"]
+ assert toggle.initial_value is False and viz._following_task_view is False
+ assert env.initial_value == 1 and env.bounds == (0, 2, 1) # the environment the view declares
+ assert _visualizer([PerspectiveCameraCfg(track_path="robot")])._task_follower.env == 0 # else 0
+
+
+def test_toggling_follows_the_task_view_and_the_selector_changes_its_environment():
+ viz = _visualizer(
+ [PerspectiveCameraCfg(env_index=0, eye=(1.0, 0.0, 0.0), lookat=(0.0, 0.0, 0.0), focal_length=30.0)]
+ )
+ server = SimpleNamespace(gui=_Gui())
+ viz._add_task_view_controls(server)
+ poses = []
+ viz.set_camera_view = lambda eye, target, focal_length=None: poses.append((eye, focal_length))
+ viz._is_initialized, viz._sim_time = True, 0.0
+ viz._viewer = SimpleNamespace(_server=SimpleNamespace(get_clients=lambda: {}))
+ viz._pending_camera_pose = None
+ viz.step(0.1)
+ assert poses == [] # off: the browser camera is left alone
+
+ server.gui.elements["Follow task view"].callback(SimpleNamespace(target=SimpleNamespace(value=True)))
+ server.gui.elements["Environment"].callback(SimpleNamespace(target=SimpleNamespace(value=2)))
+ viz.step(0.1)
+ assert poses == [((21.0, 0.0, 0.0), 30.0)]
+
+ server.gui.elements["Environment"].callback(SimpleNamespace(target=SimpleNamespace(value=9))) # out of range
+ assert viz._task_follower.env == 2
+
+
+def test_a_visualizer_without_a_task_view_adds_no_controls():
+ viz = _visualizer([PerspectiveCameraCfg()])
+ assert viz._task_follower is None and viz._task_view is None
+ with pytest.raises(AttributeError):
+ viz._add_task_view_controls(SimpleNamespace(gui=_Gui()))
From 6d76a1a48ac77fe89aa52a9ef25b9e84e724c379 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Tue, 27 Oct 2026 19:21:37 +0000
Subject: [PATCH 011/140] Fix review findings in task view following
Start Kit on the first declared task view instead of the first listed one,
re-apply only an asset follow every step so an environment view stays
movable, warn when the deprecated viewer cannot add a task view, keep a view
tied to its environment when its asset is cleared, detect environment resets
by heading change instead of yaw rate, and drop the always-true reset result.
---
source/isaaclab/isaaclab/envs/common.py | 9 ++++++-
.../isaaclab/visualizers/camera_follower.py | 13 ++++++---
.../test/visualizers/test_camera_follower.py | 19 +++++++++++++
.../kit/kit_visualizer.py | 13 ++++++---
.../newton/newton_visualizer.py | 4 ++-
.../test_kit_visualizer_scene_partitioning.py | 27 ++++++++++++++++++-
6 files changed, 75 insertions(+), 10 deletions(-)
diff --git a/source/isaaclab/isaaclab/envs/common.py b/source/isaaclab/isaaclab/envs/common.py
index 4f6c04a68c2c..410312d6b82d 100644
--- a/source/isaaclab/isaaclab/envs/common.py
+++ b/source/isaaclab/isaaclab/envs/common.py
@@ -105,7 +105,14 @@ def _apply_deprecated_viewer_cfg(env_cfg: object) -> None:
continue
cfg.window.size = tuple(viewer.resolution)
if tied:
- if cfg.cameras is None:
+ if cfg.cameras is not None:
+ warnings.warn(
+ "env_cfg.viewer tracks an environment or an asset, but the visualizer already declares "
+ "cameras, so the viewer's tracking and offsets are not applied. Declare a "
+ "PerspectiveCameraCfg with env_index or track_path in VisualizerCfg.cameras instead.",
+ stacklevel=2,
+ )
+ else:
view = PerspectiveCameraCfg(
env_index=viewer.env_index,
track_path=track_path,
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
index 7c826b1ffcbe..a68ec5b9c65f 100644
--- a/source/isaaclab/isaaclab/visualizers/camera_follower.py
+++ b/source/isaaclab/isaaclab/visualizers/camera_follower.py
@@ -19,8 +19,10 @@
_RESET_JUMP = 1.0
"""Distance [m] an asset moves between two updates only when its environment resets."""
-_RESET_YAW_RATE = 10.0
-"""Yaw rate [rad/s] no robot turns at, so a heading that changes faster means its environment reset."""
+_RESET_YAW_JUMP = 1.5
+"""Heading change [rad] between two updates that a robot only makes when its environment resets.
+
+A fixed angle, unlike a rate, does not misfire when two updates are a few milliseconds apart."""
class CameraFollower:
@@ -65,6 +67,9 @@ def set_track_path(self, track_path: str | None) -> None:
if body_name and asset.is_initialized and len(asset.find_bodies(body_name)[0]) != 1:
raise ValueError(f"track_path must match exactly one body: {track_path!r}.")
self.cfg.track_path = track_path or None
+ if self.cfg.track_path is None and self.cfg.env_index is None:
+ # keep the view tied to its environment, so it stays a task view without an asset
+ self.cfg.env_index = self._env
self._asset, self._body_name, self._body_index = asset, body_name, None
self._yaw = self._last_position = self._time = None
@@ -142,9 +147,9 @@ def _filtered_yaw(self, quat: list[float], position: list[float], dt: float) ->
yaw = math.atan2(2.0 * (w * z + x * y), 1.0 - 2.0 * (y * y + z * z))
last, self._last_position = self._last_position, position
reset = self._yaw is None or last is None or math.dist(position, last) > _RESET_JUMP
- if not reset and dt > 0.0:
+ if not reset:
# an environment can reset in place with a new heading
- reset = abs(math.remainder(yaw - self._yaw, math.tau)) / dt > _RESET_YAW_RATE
+ reset = abs(math.remainder(yaw - self._yaw, math.tau)) > _RESET_YAW_JUMP
tau = self.cfg.heading_smoothing_time_constant
if tau > 0.0 and not reset:
yaw = self._yaw + -math.expm1(-dt / tau) * math.remainder(yaw - self._yaw, math.tau)
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
index 4baba074e718..4e2e5b4e55dc 100644
--- a/source/isaaclab/test/visualizers/test_camera_follower.py
+++ b/source/isaaclab/test/visualizers/test_camera_follower.py
@@ -171,3 +171,22 @@ def test_the_followable_assets_and_bodies_are_listed():
assert follower.body_names("robot") == ["base", "LF_FOOT"]
assert follower.body_names("cube") == []
assert follower.body_names("missing") == []
+
+
+def test_clearing_the_asset_keeps_the_view_tied_to_its_environment():
+ cfg = PerspectiveCameraCfg(track_path="robot")
+ follower = CameraFollower(cfg, _NamedScene())
+ assert cfg.is_task_view
+ follower.set_track_path(None)
+ assert cfg.track_path is None and cfg.is_task_view
+
+
+def test_two_updates_a_millisecond_apart_are_not_mistaken_for_an_environment_reset():
+ cfg = PerspectiveCameraCfg(
+ env_index=0, track_path="robot", follow_heading=True, heading_smoothing_time_constant=1.0
+ )
+ follower = CameraFollower(cfg, _NamedScene())
+ follower.pose(0.0)
+ follower._yaw = 0.0
+ follower._last_position = [0.0, 0.0, 0.5]
+ assert follower._filtered_yaw([0.0, 0.0, 0.0099995, 0.99995], [0.0, 0.0, 0.5], 0.001) < 0.02
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
index d9e22e47edf5..f7c7648e8d0d 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
@@ -191,7 +191,7 @@ def step(self, dt: float) -> None:
provider = self._sim.get_scene_data_provider()
self._fabric.update_transforms(provider)
self._fabric.update_geometries(provider, self._sim.render_generation)
- self._update_follow_camera()
+ self._update_asset_follow_camera()
self._app_pumped_this_step = self._pump_kit_app_update()
if self._camera_image_provider is not None:
image = self.current_image_view.frame.data if self.is_training_paused() else self.render_tiled_rgba_array()
@@ -309,7 +309,7 @@ def render_rgb_array(self) -> np.ndarray:
self._fabric.update_transforms(provider)
self._fabric.update_geometries(provider, self._sim.render_generation)
if self._runtime_headless:
- self._update_follow_camera()
+ self._update_asset_follow_camera()
w, h = self.cfg.window.size
# Create the render product and annotator before the app update so the first
@@ -991,13 +991,20 @@ def _setup_initial_camera_view(self) -> None:
state is not available before :meth:`~isaaclab.sim.SimulationContext.reset`.
"""
self._interactive_scene = self._sim.get_scene_data_provider().get_interactive_scene()
- views = [camera for camera in self._start_cameras if isinstance(camera, PerspectiveCameraCfg)]
+ # declaration order, not the order the simulation lists the views in, which puts task views after the free one
+ declared = self.cfg.cameras if self.cfg.cameras is not None else self._start_cameras
+ views = [camera for camera in declared if isinstance(camera, PerspectiveCameraCfg)]
self._declared_task_view = next((view for view in views if view.is_task_view), None)
if views and views[0].is_task_view:
first = views[0]
self.cfg.eye, self.cfg.lookat, self.cfg.focal_length = first.eye, first.lookat, first.focal_length
self.follow(first.track_path, env_index=first.env_index or 0)
+ def _update_asset_follow_camera(self) -> None:
+ """Re-apply the pose every step while an asset is followed; a fixed environment view is left movable."""
+ if self._follower is not None and self._follower.cfg.track_path:
+ self._update_follow_camera()
+
def _update_follow_camera(self) -> None:
"""Move the viewport camera to the followed environment or asset, once both are ready."""
if self._follower is None:
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index fb8f7a631e26..012a9f32ce57 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -778,7 +778,9 @@ def _reset_tracking_camera(self, follower: CameraFollower) -> bool:
cfg.follow_heading = defaults["follow_heading"]
cfg.heading_smoothing_time_constant = defaults["heading_smoothing_time_constant"]
follower.set_env(defaults["env"])
- return self._set_tracking_path(follower, defaults["track_path"]) or True
+ # the pose, optics and heading settings are restored even when the asset cannot be, which is reported
+ self._set_tracking_path(follower, defaults["track_path"])
+ return True
def _apply_view_pose(self, view) -> bool:
"""Point the viewer camera where a task *view* looks, leaving the configured poses untouched.
diff --git a/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py b/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
index 6c9315203974..a0a99b398917 100644
--- a/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
+++ b/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
@@ -67,7 +67,7 @@ def test_viewport_pose_publication_is_deferred_for_headless_capture(monkeypatch,
provider = sim.get_scene_data_provider.return_value
monkeypatch.setattr(visualizer, "is_training_paused", lambda: True)
tracking = MagicMock()
- monkeypatch.setattr(visualizer, "_update_follow_camera", tracking)
+ monkeypatch.setattr(visualizer, "_update_asset_follow_camera", tracking)
monkeypatch.setattr(visualizer, "_refresh_partial_viz_point_instancers_if_needed", MagicMock())
settings = MagicMock()
settings.get.return_value = None
@@ -410,3 +410,28 @@ def test_follow_unfollow_and_the_environment_selection(monkeypatch):
visualizer.unfollow()
visualizer.set_view_offsets((4.0, 4.0, 4.0), (0.0, 0.0, 0.0))
assert not visualizer.following and poses[-1] == ((4.0, 4.0, 4.0), (0.0, 0.0, 0.0))
+
+
+def test_the_declared_order_decides_the_start_view_not_the_order_the_simulation_lists_them(monkeypatch):
+ from isaaclab.visualizers import PerspectiveCameraCfg
+
+ task = PerspectiveCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0))
+ visualizer, poses = _following_visualizer(monkeypatch, [PerspectiveCameraCfg(), task])
+ visualizer.cfg.cameras = [task, PerspectiveCameraCfg()] # the simulation puts task views after the free view
+ visualizer._setup_initial_camera_view()
+ assert visualizer.following and visualizer.follow_env_index == 1
+
+
+def test_only_a_followed_asset_is_reapplied_every_step(monkeypatch):
+ from isaaclab.visualizers import PerspectiveCameraCfg
+
+ visualizer, poses = _following_visualizer(monkeypatch, [PerspectiveCameraCfg()])
+ visualizer._setup_initial_camera_view()
+ visualizer.follow(None) # an environment view, which the user can orbit
+ poses.clear()
+ visualizer._update_asset_follow_camera()
+ assert poses == []
+ visualizer.follow("robot")
+ poses.clear()
+ visualizer._update_asset_follow_camera()
+ assert len(poses) == 1
From 434dd8782b8f7263f2a907eddc14bee6533e6477 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Tue, 27 Oct 2026 19:49:36 +0000
Subject: [PATCH 012/140] Keep the task view on the reorient tasks in play mode
---
.../reorient/config/allegro_hand/allegro_hand_direct_env_cfg.py | 1 +
.../config/shadow_hand/shadow_hand_camera_manager_env_cfg.py | 1 +
.../config/shadow_hand/shadow_hand_direct_camera_env_cfg.py | 1 +
.../reorient/config/shadow_hand/shadow_hand_direct_env_cfg.py | 1 +
.../isaaclab_tasks/core/reorient/reorient_manager_env_cfg.py | 1 +
5 files changed, 5 insertions(+)
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/allegro_hand/allegro_hand_direct_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/allegro_hand/allegro_hand_direct_env_cfg.py
index 5a41dc14a01f..73119ddcf4ff 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/allegro_hand/allegro_hand_direct_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/allegro_hand/allegro_hand_direct_env_cfg.py
@@ -102,3 +102,4 @@ def play_mode(self) -> None:
viewer.eye = VISUALIZER_CFG.eye
viewer.lookat = VISUALIZER_CFG.lookat
viewer.focal_length = VISUALIZER_CFG.focal_length
+ viewer.cameras = [camera.replace() for camera in VISUALIZER_CFG.cameras]
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_camera_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_camera_manager_env_cfg.py
index a9d1f1c1fe4f..34c612297a5b 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_camera_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_camera_manager_env_cfg.py
@@ -131,6 +131,7 @@ def play_mode(self):
viewer.eye = CAMERA_VISUALIZER_CFG.eye
viewer.lookat = CAMERA_VISUALIZER_CFG.lookat
viewer.focal_length = CAMERA_VISUALIZER_CFG.focal_length
+ viewer.cameras = [camera.replace() for camera in CAMERA_VISUALIZER_CFG.cameras]
# mutate rather than replace: subclasses may have disabled the CNN
self.feature_extractor.train = False
self.feature_extractor.load_checkpoint = True
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_camera_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_camera_env_cfg.py
index d42b8bdddb64..94843caa5041 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_camera_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_camera_env_cfg.py
@@ -202,6 +202,7 @@ def play_mode(self):
viewer.eye = CAMERA_VISUALIZER_CFG.eye
viewer.lookat = CAMERA_VISUALIZER_CFG.lookat
viewer.focal_length = CAMERA_VISUALIZER_CFG.focal_length
+ viewer.cameras = [camera.replace() for camera in CAMERA_VISUALIZER_CFG.cameras]
# inference for CNN
self.feature_extractor.train = False
self.feature_extractor.load_checkpoint = True
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_env_cfg.py
index 9d95e79fbde4..207579fd7fa2 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_env_cfg.py
@@ -104,3 +104,4 @@ def play_mode(self) -> None:
viewer.eye = VISUALIZER_CFG.eye
viewer.lookat = VISUALIZER_CFG.lookat
viewer.focal_length = VISUALIZER_CFG.focal_length
+ viewer.cameras = [camera.replace() for camera in VISUALIZER_CFG.cameras]
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/reorient_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/reorient_manager_env_cfg.py
index e95d7a261f83..ce88521ff421 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/reorient_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/reorient_manager_env_cfg.py
@@ -241,3 +241,4 @@ def play_mode(self) -> None:
viewer.eye = VISUALIZER_CFG.eye
viewer.lookat = VISUALIZER_CFG.lookat
viewer.focal_length = VISUALIZER_CFG.focal_length
+ viewer.cameras = [camera.replace() for camera in VISUALIZER_CFG.cameras]
From 714171203c7fb110f5c4f7940405a95f95cbee86 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Tue, 27 Oct 2026 22:00:30 +0000
Subject: [PATCH 013/140] Keep declared scene cameras first and apply the task
view lens in Kit
Insert the free view right before the first task view so scene cameras
declared ahead of it still open first, and set the viewport camera's focal
length when Kit starts following a task view.
---
.../isaaclab/isaaclab/visualizers/visualizer_cfg.py | 9 ++++++---
.../test/visualizers/test_camera_follower.py | 4 ++++
.../isaaclab_visualizers/kit/kit_visualizer.py | 9 +++++++++
.../test/test_kit_visualizer_scene_partitioning.py | 12 ++++++++++++
4 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index 09fc2bcc3763..de78581bd87b 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -33,14 +33,17 @@ def with_free_view(
lookat: tuple[float, float, float],
focal_length: float,
) -> list[PerspectiveCameraCfg | SceneCameraCfg]:
- """Return *cameras*, preceded by a free perspective view when it has task views but no free view of its own.
+ """Return *cameras* with a free perspective view added when it has task views but no free view of its own.
A task view follows a robot or frames an environment, so the interactive view that a user moves stays
- available beside it, at the visualizer's own ``eye``, ``lookat`` and ``focal_length``.
+ available beside it, at the visualizer's own ``eye``, ``lookat`` and ``focal_length``. The free view goes
+ right before the first task view, so scene cameras declared ahead of it stay first.
"""
perspective = [camera for camera in cameras if isinstance(camera, PerspectiveCameraCfg)]
if perspective and all(camera.is_task_view for camera in perspective):
- return [PerspectiveCameraCfg(eye=eye, lookat=lookat, focal_length=focal_length), *cameras]
+ free = PerspectiveCameraCfg(eye=eye, lookat=lookat, focal_length=focal_length)
+ first_task = next(i for i, camera in enumerate(cameras) if isinstance(camera, PerspectiveCameraCfg))
+ return [*cameras[:first_task], free, *cameras[first_task:]]
return cameras
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
index 4e2e5b4e55dc..4b698721735d 100644
--- a/source/isaaclab/test/visualizers/test_camera_follower.py
+++ b/source/isaaclab/test/visualizers/test_camera_follower.py
@@ -110,6 +110,10 @@ def test_task_views_get_a_free_view_beside_them():
assert with_free_view([task], *args)[0].eye == (1.0, 2.0, 3.0)
assert len(with_free_view([task], *args)) == 2
assert with_free_view([free, task], *args) == [free, task]
+ # scene cameras declared ahead of the task view stay first
+ sensor = SceneCameraCfg(prim_path="/cam")
+ views = with_free_view([sensor, task], *args)
+ assert views[0] is sensor and views[1].eye == (1.0, 2.0, 3.0) and views[2] is task
assert with_free_view([SceneCameraCfg(prim_path="/cam")], *args) == [SceneCameraCfg(prim_path="/cam")]
# a task view first does not replace the visualizer's own pose or its streaming choice
cfg = VisualizerCfg(eye=(7.0, 0.0, 0.0), streaming_view=True, cameras=[task])
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
index f7c7648e8d0d..9456a7765d22 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
@@ -494,6 +494,7 @@ def follow(self, track_path: str | None = None, *, env_index: int | None = None)
heading_smoothing_time_constant=template.heading_smoothing_time_constant if same_asset else 0.0,
)
self._follower = CameraFollower(self._follow_view, scene)
+ self._set_viewport_focal_length(self._follow_view.focal_length)
self._update_follow_camera()
def unfollow(self) -> None:
@@ -831,6 +832,14 @@ def _set_viewport_camera(self, position: tuple[float, float, float], target: tup
camera_state.set_position_world(Gf.Vec3d(float(position[0]), float(position[1]), float(position[2])), False)
camera_state.set_target_world(Gf.Vec3d(float(target[0]), float(target[1]), float(target[2])), True)
+ def _set_viewport_focal_length(self, focal_length: float) -> None:
+ """Set the lens of the viewport camera [mm], in the session layer so the user's stage is left alone."""
+ camera_path = (self._viewport_api.get_active_camera() if self._viewport_api is not None else None) or (
+ _DEFAULT_VIEWPORT_CAMERA_PATH
+ )
+ with Usd.EditContext(self._sim.stage, self._sim.stage.GetSessionLayer()):
+ UsdGeom.Camera.Define(self._sim.stage, camera_path).GetFocalLengthAttr().Set(float(focal_length))
+
def _set_usd_camera_pose(self, camera_path: str, position, target) -> bool:
"""Apply eye/target camera pose directly to a USD camera prim.
diff --git a/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py b/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
index a0a99b398917..f3e055cc76e0 100644
--- a/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
+++ b/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
@@ -373,6 +373,7 @@ def _following_visualizer(monkeypatch, cameras):
visualizer._start_cameras = cameras
poses = []
monkeypatch.setattr(visualizer, "set_camera_view", lambda eye, target: poses.append((eye, target)))
+ monkeypatch.setattr(visualizer, "_set_viewport_focal_length", lambda focal_length: None)
return visualizer, poses
@@ -435,3 +436,14 @@ def test_only_a_followed_asset_is_reapplied_every_step(monkeypatch):
poses.clear()
visualizer._update_asset_follow_camera()
assert len(poses) == 1
+
+
+def test_following_applies_the_task_views_lens_to_the_viewport_camera(monkeypatch):
+ from isaaclab.visualizers import PerspectiveCameraCfg
+
+ task = PerspectiveCameraCfg(env_index=0, track_path="robot", focal_length=26.0)
+ visualizer, _ = _following_visualizer(monkeypatch, [task, PerspectiveCameraCfg()])
+ lenses = []
+ monkeypatch.setattr(visualizer, "_set_viewport_focal_length", lenses.append)
+ visualizer._setup_initial_camera_view()
+ assert lenses == [26.0]
From 9d47742b814ab21f53d0bb1dd556281ad8e50fff Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Tue, 27 Oct 2026 22:26:52 +0000
Subject: [PATCH 014/140] Tighten the task view documentation and drop outdated
behavior
Move the task view section after the Newton RTX description, remove the
untested-RTX note, the Kit control details and the duplicated migration
paragraph, and shorten the visualization concept text.
---
docs/source/concepts/visualization.rst | 15 +--
.../visualizer_streaming_camera_view.rst | 102 +++++++++---------
docs/source/isaaclab/migrating.rst | 10 +-
3 files changed, 55 insertions(+), 72 deletions(-)
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index c5155385a284..760eb0f96e2a 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -567,10 +567,8 @@ task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton G
Rerun, and Viser visualizers. **Kit** opens it as a separate **Streaming View** viewport, which can
sit side by side with the default viewport for dual monitoring. **Newton GL** and **Newton RTX**
provide a **Camera View** selector in the sidebar for switching between perspective and scene-camera
-views. A perspective view can also be a *task view* that follows a robot or frames an environment. **Newton GL**
-renders it as its own view, so the interactive view stays free; select it in **Camera View** or record it with
-``--video viz:newton_gl:tracking``. **Viser** follows it when you toggle it, and **Kit** follows it with its
-viewport.
+views. A perspective view can also be a *task view* that follows a robot or frames an environment; Newton GL, Viser
+and Kit support it.
See :doc:`/source/how-to/visualizer_streaming_camera_view` for the ``VisualizerCfg`` options, display
sources, task views that follow a robot, troubleshooting, migration from generated cameras, and step-by-step examples.
@@ -800,26 +798,19 @@ Watch training live in Kit while recording from a separate headless Newton GL an
**Following a moving robot**
-Declare a *task view* instead of updating ``eye``/``lookat`` yourself every step. Newton GL renders it
-as a separate view, Kit follows with its viewport, and Viser follows when you toggle it; see
-:ref:`how-to-visualizer-task-views`:
+Declare a *task view* instead of updating ``eye``/``lookat`` every step; see :ref:`how-to-visualizer-task-views`:
.. code-block:: python
- from isaaclab_visualizers.kit import KitBackendCfg
-
from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
- # the first view starts active, so Kit's viewport starts on the task view; a free view follows it
sim_cfg.visualizer_cfgs = VisualizerCfg(
cameras=[
PerspectiveCameraCfg(
track_path="robot", # or "robot/panda_hand" to track a specific body
eye=(4.0, 4.0, 2.0), # offset from the tracked asset
),
- PerspectiveCameraCfg(),
],
- backend=KitBackendCfg(),
)
**Sharing a live view with a remote teammate**
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index a882f034057b..cdd02f2d2262 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -126,8 +126,7 @@ for dual monitoring.
**Newton GL and Newton RTX** have a **Camera View** selector in the sidebar. Selecting a scene camera displays
its tiled output in the main viewport instead of rendering a perspective view behind it.
Selecting a perspective camera restores interactive scene rendering. Newton GL also restores picking.
-A perspective entry that follows a robot or frames an environment is a task view and is listed as
-**Tracking Camera**; the free view is listed as **Perspective**. See :ref:`how-to-visualizer-task-views`.
+A task view is listed as **Tracking Camera**; see :ref:`how-to-visualizer-task-views`.
Without an explicit ``cameras`` list, Newton GL starts in perspective and offers scene cameras
that provide every requested ``streaming_gt_types`` channel. An explicit
@@ -172,58 +171,6 @@ Newton windows present at up to ``WindowCfg.fps`` (30 by default), measured in w
Changing the simulation timestep does not change that limit. Headless on-demand capture is
independent of the window update rate; Kit uses its application's update cadence.
-.. _how-to-visualizer-task-views:
-
-Task views that follow a robot
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-A ``PerspectiveCameraCfg`` with ``env_index`` or ``track_path`` is a *task view*: it is placed relative to an
-environment or an asset, so it frames a robot wherever the scene puts it. The viewer renders it from its own
-camera, so nothing is created in the scene, nothing depends on the number of environments, and the view has the
-viewport's markers and shadows. Tasks declare one in ``sim.visualizer_cfgs``:
-
-.. code-block:: python
-
- from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
-
- self.sim.visualizer_cfgs = VisualizerCfg(
- cameras=[
- PerspectiveCameraCfg(
- eye=(1.8, -3.0, 1.1),
- lookat=(0.15, 0.0, 0.0),
- track_path="robot",
- follow_heading=True,
- heading_smoothing_time_constant=0.2,
- )
- ],
- )
-
-* ``eye`` and ``lookat`` are offsets [m] from the tracked asset, or from the origin of ``env_index``
- when ``track_path`` is None, which keeps the view fixed in that environment.
-* ``track_path`` names a scene asset (``"robot"``) or one of its bodies (``"robot/base"``) in environment
- ``env_index``, which defaults to 0.
-* ``follow_heading`` rotates the offsets with the asset's yaw, keeping the horizon level.
- ``heading_smoothing_time_constant`` [s] damps rapid turns; zero follows immediately.
-
-The interactive view stays free: a free perspective view at the visualizer's own ``eye`` and ``lookat`` is
-added before the task view, and the first view starts active. Each visualizer offers the task view its own way:
-
-* **Newton GL:** the **Camera View** selector lists it as **Tracking Camera**, and a **Tracking Camera** group
- below the selector edits it while it runs: the environment, the followed asset and body, the eye and look-at
- offsets, the focal length, heading follow, and heading smoothing. **Reset to Task Default** restores what the task
- declared, and an unknown asset or ambiguous body is reported there while the camera keeps its previous target.
- While it is selected the window follows the robot, and selecting the free view hands the camera back. Record it,
- whichever view the window shows, with ``--video viz:newton_gl:tracking``.
-* **Viser:** a **Camera View** folder in the sidebar has a **Follow task view** checkbox, off by default, and an
- **Environment** field, 0 unless the view declares another. While it is on, the browser camera follows the robot;
- turning it off leaves the camera where it is, free to move. Viser cannot be recorded.
-* **Kit:** the viewport starts on the task view when it is declared first, and follows the environment or the
- asset until the **Follow Mode** control in the environment window or ``KitVisualizer.unfollow()`` hands it back.
- The **Camera Eye** and **Camera Target** controls then edit the offsets. This replaces the ``origin_type``,
- ``origin_env_index``, and ``origin_track_path`` fields of ``KitBackendCfg``.
-
-Newton RTX shares the Newton GL view code but is untested, and Rerun ignores task views.
-
Newton RTX displays ordinary camera output in a Newton GL window. Equal ``OVRTXRendererCfg``
configurations share one renderer and its scene. ``NewtonRTXBackendCfg.renderer_cfg`` selects
the renderer for generated perspective cameras; explicitly selected scene cameras retain their
@@ -296,6 +243,53 @@ Unselected cameras are still allocated and may render if another consumer reads
scene uses eager sensor updates. ``streaming_envs`` selects displayed tiles, not capture work.
+.. _how-to-visualizer-task-views:
+
+Task views that follow a robot
+------------------------------
+
+A ``PerspectiveCameraCfg`` with ``env_index`` or ``track_path`` is a *task view*. Its ``eye`` and ``lookat`` are
+offsets [m] from the environment origin, or from the tracked asset, so it frames the robot wherever the scene puts
+it. The visualizer renders it from its own camera: nothing is added to the scene, and the view keeps the
+viewport's markers and shadows.
+
+.. code-block:: python
+
+ from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+
+ self.sim.visualizer_cfgs = VisualizerCfg(
+ cameras=[
+ PerspectiveCameraCfg(
+ eye=(1.8, -3.0, 1.1),
+ lookat=(0.15, 0.0, 0.0),
+ track_path="robot",
+ follow_heading=True,
+ heading_smoothing_time_constant=0.2,
+ )
+ ],
+ )
+
+* ``env_index``: the environment to frame or follow; defaults to 0.
+* ``track_path``: a scene asset (``"robot"``) or one of its bodies (``"robot/base"``). Without it, the view stays
+ fixed in the environment.
+* ``follow_heading``: rotate the offsets with the asset's yaw, keeping the horizon level.
+ ``heading_smoothing_time_constant`` [s] damps rapid turns.
+
+A free view at the visualizer's own ``eye`` and ``lookat`` is added before the first task view, so the
+interactive camera stays free.
+
+* **Newton GL:** **Camera View** lists the task view as **Tracking Camera** beside **Perspective**. A
+ **Tracking Camera** group edits its environment, asset, body, eye, look-at, focal length and heading settings
+ while it runs; **Reset to Task Default** restores the declaration. Record it with
+ ``--video viz:newton_gl:tracking``, whichever view the window shows.
+* **Viser:** a **Follow task view** checkbox, off by default, and an **Environment** field in the **Camera View**
+ folder.
+* **Kit:** the viewport starts on the first declared view when it is a task view, and follows it until
+ ``KitVisualizer.unfollow()`` or the **Follow Mode** control in the environment window. An environment view can
+ still be moved; an asset view is re-applied every step.
+* **Newton RTX** and **Rerun** ignore task views.
+
+
Examples
--------
diff --git a/docs/source/isaaclab/migrating.rst b/docs/source/isaaclab/migrating.rst
index b58759d36412..b71dabe41b9e 100644
--- a/docs/source/isaaclab/migrating.rst
+++ b/docs/source/isaaclab/migrating.rst
@@ -2706,8 +2706,7 @@ The ``origin_type``, ``origin_env_index``, and ``origin_track_path`` fields of
env_cfg.sim.visualizer_cfgs = VisualizerCfg(eye=(4.5, 0.0, 6.0), lookat=(0.0, 0.0, 2.0))
For asset-body tracking (previously ``origin_type="asset_root"`` / ``"asset_body"``), declare a task view
-with ``track_path`` first in :class:`~isaaclab.visualizers.VisualizerCfg` ``cameras``, so the viewport
-starts on it, followed by a free view:
+with ``track_path`` in :class:`~isaaclab.visualizers.VisualizerCfg` ``cameras``; a free view is added beside it:
.. code-block:: python
@@ -2721,12 +2720,11 @@ starts on it, followed by a free view:
from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
env_cfg.sim.visualizer_cfgs = VisualizerCfg(
- cameras=[PerspectiveCameraCfg(track_path="robot", eye=(4.0, 4.0, 2.0)), PerspectiveCameraCfg()],
+ cameras=[PerspectiveCameraCfg(track_path="robot", eye=(4.0, 4.0, 2.0))],
) # visualizer=kit
-The :class:`~isaaclab.envs.ui.ViewportCameraController` class is also deprecated; camera
-tracking is a task view of :class:`~isaaclab_visualizers.kit.KitVisualizer`, switched at runtime with its
-``follow()`` and ``unfollow()`` methods or the **Follow Mode** control of the environment window.
+At runtime, :class:`~isaaclab_visualizers.kit.KitVisualizer` switches with ``follow()`` and ``unfollow()``, or the
+**Follow Mode** control of the environment window.
Custom visualizers receive their owning ``sim`` and bound ``cameras`` in ``initialize()``.
From f2b0beb01f9308a48ecc7eaaf9bc8242a7da2495 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Tue, 27 Oct 2026 22:29:10 +0000
Subject: [PATCH 015/140] Remove Viser task view following and note the
RTX-only filters
Viser keeps its main behavior and ignores task views. Mark the two Newton RTX
filters as removable together with the RTX visualizer.
---
docs/source/concepts/visualization.rst | 4 +-
.../visualizer_streaming_camera_view.rst | 4 +-
source/isaaclab/isaaclab/app/sim_launcher.py | 3 +-
.../isaaclab/sim/simulation_context.py | 3 +-
.../changelog.d/task-view-viser.added.rst | 2 -
.../viser/viser_visualizer.py | 58 +---------
.../test/test_viser_task_view.py | 102 ------------------
7 files changed, 9 insertions(+), 167 deletions(-)
delete mode 100644 source/isaaclab_visualizers/changelog.d/task-view-viser.added.rst
delete mode 100644 source/isaaclab_visualizers/test/test_viser_task_view.py
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index 760eb0f96e2a..de6a922b6269 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -567,8 +567,8 @@ task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton G
Rerun, and Viser visualizers. **Kit** opens it as a separate **Streaming View** viewport, which can
sit side by side with the default viewport for dual monitoring. **Newton GL** and **Newton RTX**
provide a **Camera View** selector in the sidebar for switching between perspective and scene-camera
-views. A perspective view can also be a *task view* that follows a robot or frames an environment; Newton GL, Viser
-and Kit support it.
+views. A perspective view can also be a *task view* that follows a robot or frames an environment; Newton GL and Kit
+support it.
See :doc:`/source/how-to/visualizer_streaming_camera_view` for the ``VisualizerCfg`` options, display
sources, task views that follow a robot, troubleshooting, migration from generated cameras, and step-by-step examples.
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index cdd02f2d2262..1f186c2bdedd 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -282,12 +282,10 @@ interactive camera stays free.
**Tracking Camera** group edits its environment, asset, body, eye, look-at, focal length and heading settings
while it runs; **Reset to Task Default** restores the declaration. Record it with
``--video viz:newton_gl:tracking``, whichever view the window shows.
-* **Viser:** a **Follow task view** checkbox, off by default, and an **Environment** field in the **Camera View**
- folder.
* **Kit:** the viewport starts on the first declared view when it is a task view, and follows it until
``KitVisualizer.unfollow()`` or the **Follow Mode** control in the environment window. An environment view can
still be moved; an asset view is re-applied every step.
-* **Newton RTX** and **Rerun** ignore task views.
+* **Newton RTX**, **Viser** and **Rerun** ignore task views.
Examples
diff --git a/source/isaaclab/isaaclab/app/sim_launcher.py b/source/isaaclab/isaaclab/app/sim_launcher.py
index b5b4f4bf93b0..88583b566aad 100644
--- a/source/isaaclab/isaaclab/app/sim_launcher.py
+++ b/source/isaaclab/isaaclab/app/sim_launcher.py
@@ -316,7 +316,8 @@ def validate_launch( # noqa: C901
if visualizer.view is not None:
sources = [visualizer.view.source]
else:
- # task views follow the viewer camera, which an RTX scene camera cannot do, so RTX leaves them out
+ # Task views follow the viewer camera, which an RTX scene camera cannot do, so RTX leaves them out.
+ # RTX-only: remove this filter, and the one in SimulationContext, with the RTX visualizer.
sources = [
camera
for camera in visualizer.cameras or []
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index 182b9f519d9a..5f19bf37892f 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -433,7 +433,8 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
)
]) # fmt: skip
if visualizer.cfg.backend.visualizer_type == "newton_rtx":
- # an RTX window shows scene cameras, so task views have nothing to follow there
+ # An RTX window shows scene cameras, so task views have nothing to follow there.
+ # RTX-only: remove this branch, and the filter in sim_launcher, with the RTX visualizer.
cameras = [
camera
for camera in cameras
diff --git a/source/isaaclab_visualizers/changelog.d/task-view-viser.added.rst b/source/isaaclab_visualizers/changelog.d/task-view-viser.added.rst
deleted file mode 100644
index bed1be9677ee..000000000000
--- a/source/isaaclab_visualizers/changelog.d/task-view-viser.added.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-* Added task views to the Viser visualizer: a **Follow task view** checkbox, off by default, and an **Environment**
- field in the sidebar make the browser camera follow a robot or frame an environment.
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/viser/viser_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/viser/viser_visualizer.py
index 488d9bd3263b..b35dc3162840 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/viser/viser_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/viser/viser_visualizer.py
@@ -25,7 +25,6 @@
from isaaclab.sim import SimulationContext
from isaaclab.visualizers import VisualizerCfg
from isaaclab.visualizers.base_visualizer import BaseVisualizer
-from isaaclab.visualizers.camera_follower import CameraFollower
from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg
from isaaclab_visualizers.newton.newton_visualization_markers import render_newton_visualization_markers
@@ -291,9 +290,6 @@ def __init__(self, cfg: VisualizerCfg):
self._warned_marker_render_failure = False
self._paused_rendering = False
self._paused_simulation = False
- self._task_view: PerspectiveCameraCfg | None = None
- self._task_follower: CameraFollower | None = None
- self._following_task_view = False
def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraCfg | Camera]) -> None:
"""Initialize viewer resources and bind scene data provider.
@@ -328,7 +324,6 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
self._log_viewer_url("ViserVisualizer", viewer_url)
self._viewer.set_model(self.backend.model)
self._viewer.show_particles = self.cfg.backend.show_particles
- self._bind_task_view(cameras)
# set_model() clears model-dependent GUI elements; build the sidebar afterwards.
self._setup_isaaclab_sidebar(self._viewer._server)
self._viewer.set_visible_worlds(self._env_ids)
@@ -368,10 +363,6 @@ def step(self, dt: float) -> None:
self.set_camera_view(*self._pending_camera_pose)
self._sim_time += dt
- if self._following_task_view and self._task_follower is not None:
- pose = self._task_follower.pose(self._sim_time)
- if pose is not None:
- self.set_camera_view(*pose, focal_length=self._task_view.focal_length)
# Skip all rendering when no browser clients are connected.
if not self._viewer._server.get_clients():
@@ -464,8 +455,6 @@ def close(self) -> None:
self._viewer = None
self._is_initialized = False
self.backend = self._transform_mapping = None
- self._task_view = self._task_follower = None
- self._following_task_view = False
super().close()
self._pending_camera_pose = None
@@ -511,19 +500,6 @@ def _render_live_plots(self) -> None:
for i, v in enumerate(values):
self._viewer.log_scalar(f"{source.manager_name}/{term_name}[{i}]", v)
- def _bind_task_view(self, cameras: list) -> None:
- """Bind the first task view the config declares, so a bad environment or asset fails at initialization."""
- self._task_view = next(
- (camera for camera in cameras if isinstance(camera, PerspectiveCameraCfg) and camera.is_task_view), None
- )
- self._following_task_view = False
- self._task_follower = None
- if self._task_view is None:
- return
- scene = self._sim.get_scene_data_provider().get_interactive_scene()
- if scene is not None:
- self._task_follower = CameraFollower(self._task_view, scene)
-
def _setup_isaaclab_sidebar(self, server) -> None:
"""Configure the Viser sidebar as the Isaac Lab panel.
@@ -557,9 +533,6 @@ def _(_):
def _(_):
self._reset_requested = True
- if self._task_follower is not None:
- self._add_task_view_controls(server)
-
live_plots_folder = server.gui.add_folder("Live Plots", expand_by_default=False)
viewer._live_plots_folder = live_plots_folder
@@ -586,48 +559,21 @@ def _(_):
def _(event, _attr=attr):
setattr(viewer, _attr, event.target.value)
- def _add_task_view_controls(self, server) -> None:
- """Add the task view toggle, off by default, and the environment it follows, 0 by default."""
- follower = self._task_follower
- folder = server.gui.add_folder("Camera View", expand_by_default=True)
- with folder:
- toggle = server.gui.add_checkbox("Follow task view", initial_value=self._following_task_view)
- env_input = server.gui.add_number(
- "Environment",
- initial_value=follower.env,
- min=0,
- max=self._sim.get_scene_data_provider().num_envs - 1,
- step=1,
- )
-
- @toggle.on_update
- def _(event):
- self._following_task_view = bool(event.target.value)
-
- @env_input.on_update
- def _(event):
- with contextlib.suppress(ValueError):
- follower.set_env(int(event.target.value))
-
def set_camera_view(
- self,
- eye: tuple[float, float, float] | list[float],
- target: tuple[float, float, float] | list[float],
- focal_length: float | None = None,
+ self, eye: tuple[float, float, float] | list[float], target: tuple[float, float, float] | list[float]
) -> None:
"""Set every connected client's camera eye/target.
Args:
eye: Camera eye position.
target: Camera look-at target.
- focal_length: Focal length [mm]; None uses the configured one.
"""
self._pending_camera_pose = (tuple(float(v) for v in eye), tuple(float(v) for v in target))
if self._viewer is None:
return
clients = self._viewer._server.get_clients()
for client in clients.values():
- client.camera.fov = math.radians(self._focal_length_to_vertical_fov_degrees(focal_length))
+ client.camera.fov = math.radians(self._focal_length_to_vertical_fov_degrees())
client.camera.position, client.camera.look_at = self._pending_camera_pose
if clients:
self._pending_camera_pose = None
diff --git a/source/isaaclab_visualizers/test/test_viser_task_view.py b/source/isaaclab_visualizers/test/test_viser_task_view.py
deleted file mode 100644
index ee0d35829d09..000000000000
--- a/source/isaaclab_visualizers/test/test_viser_task_view.py
+++ /dev/null
@@ -1,102 +0,0 @@
-# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
-# All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-"""Unit tests for the Viser task view: a toggle that is off by default and an environment selector."""
-
-from __future__ import annotations
-
-import contextlib
-from types import SimpleNamespace
-
-import pytest
-import torch
-from isaaclab_visualizers.viser import ViserVisualizer, ViserVisualizerCfg
-
-from isaaclab.visualizers import PerspectiveCameraCfg
-
-
-class _Scene:
- num_envs = 3
- env_origins = torch.tensor([[0.0, 0.0, 0.0], [10.0, 0.0, 0.0], [20.0, 0.0, 0.0]])
-
- def __getitem__(self, name):
- return SimpleNamespace(is_initialized=False)
-
-
-class _Element:
- """A GUI element that records its initial value and its update callback."""
-
- def __init__(self, initial_value):
- self.initial_value, self.callback = initial_value, None
-
- def on_update(self, fn):
- self.callback = fn
- return fn
-
-
-class _Gui:
- def __init__(self):
- self.elements = {}
-
- def add_folder(self, label, expand_by_default=True):
- return contextlib.nullcontext()
-
- def add_checkbox(self, label, initial_value):
- return self.elements.setdefault(label, _Element(initial_value))
-
- def add_number(self, label, initial_value, min=None, max=None, step=None):
- element = self.elements.setdefault(label, _Element(initial_value))
- element.bounds = (min, max, step)
- return element
-
-
-def _visualizer(cameras):
- viz = ViserVisualizer(ViserVisualizerCfg())
- scene = _Scene()
- viz._sim = SimpleNamespace(
- get_scene_data_provider=lambda: SimpleNamespace(get_interactive_scene=lambda: scene, num_envs=scene.num_envs)
- )
- viz._bind_task_view(cameras)
- return viz
-
-
-def test_the_task_view_is_off_by_default_and_the_environment_defaults_to_zero():
- viz = _visualizer([PerspectiveCameraCfg(), PerspectiveCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0))])
- server = SimpleNamespace(gui=_Gui())
- viz._add_task_view_controls(server)
- toggle, env = server.gui.elements["Follow task view"], server.gui.elements["Environment"]
- assert toggle.initial_value is False and viz._following_task_view is False
- assert env.initial_value == 1 and env.bounds == (0, 2, 1) # the environment the view declares
- assert _visualizer([PerspectiveCameraCfg(track_path="robot")])._task_follower.env == 0 # else 0
-
-
-def test_toggling_follows_the_task_view_and_the_selector_changes_its_environment():
- viz = _visualizer(
- [PerspectiveCameraCfg(env_index=0, eye=(1.0, 0.0, 0.0), lookat=(0.0, 0.0, 0.0), focal_length=30.0)]
- )
- server = SimpleNamespace(gui=_Gui())
- viz._add_task_view_controls(server)
- poses = []
- viz.set_camera_view = lambda eye, target, focal_length=None: poses.append((eye, focal_length))
- viz._is_initialized, viz._sim_time = True, 0.0
- viz._viewer = SimpleNamespace(_server=SimpleNamespace(get_clients=lambda: {}))
- viz._pending_camera_pose = None
- viz.step(0.1)
- assert poses == [] # off: the browser camera is left alone
-
- server.gui.elements["Follow task view"].callback(SimpleNamespace(target=SimpleNamespace(value=True)))
- server.gui.elements["Environment"].callback(SimpleNamespace(target=SimpleNamespace(value=2)))
- viz.step(0.1)
- assert poses == [((21.0, 0.0, 0.0), 30.0)]
-
- server.gui.elements["Environment"].callback(SimpleNamespace(target=SimpleNamespace(value=9))) # out of range
- assert viz._task_follower.env == 2
-
-
-def test_a_visualizer_without_a_task_view_adds_no_controls():
- viz = _visualizer([PerspectiveCameraCfg()])
- assert viz._task_follower is None and viz._task_view is None
- with pytest.raises(AttributeError):
- viz._add_task_view_controls(SimpleNamespace(gui=_Gui()))
From dd676d65682e43c55aaff3c131bed94ba1169f03 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Tue, 27 Oct 2026 22:39:45 +0000
Subject: [PATCH 016/140] Split tracking cameras from perspective cameras
Add TrackingCameraCfg, a PerspectiveCameraCfg subclass that frames an
environment or follows an asset, and give PerspectiveCameraCfg back its
world-coordinate meaning. Rename task views to tracking cameras in the
code, tests, docs and changelog fragments.
---
docs/source/api/lab/isaaclab.visualizers.rst | 4 ++
docs/source/concepts/visualization.rst | 10 +--
docs/source/how-to/record_video.rst | 3 +-
.../visualizer_streaming_camera_view.rst | 26 ++++----
docs/source/isaaclab/migrating.rst | 10 +--
.../changelog.d/task-view-kit.changed.rst | 3 -
.../changelog.d/task-view-tracking.added.rst | 6 --
.../tracking-camera-kit.changed.rst | 3 +
.../tracking-camera-tracking.added.rst | 4 ++
...g.minor => tracking-camera-tracking.minor} | 0
source/isaaclab/isaaclab/app/sim_launcher.py | 17 +++--
source/isaaclab/isaaclab/envs/common.py | 6 +-
.../isaaclab/envs/utils/video_recorder.py | 2 +-
.../isaaclab/sim/simulation_context.py | 22 +++----
.../isaaclab/visualizers/__init__.pyi | 11 +++-
.../isaaclab/visualizers/camera_follower.py | 15 ++---
.../isaaclab/visualizers/visualizer_cfg.py | 66 +++++++++++--------
.../isaaclab/test/envs/test_video_recorder.py | 4 +-
.../test/envs/test_viewer_cfg_deprecation.py | 6 +-
.../test/visualizers/test_camera_follower.py | 42 ++++++------
.../changelog.d/task-view-kit.changed.rst | 2 -
.../changelog.d/task-view-tracking.added.rst | 2 -
.../tracking-camera-kit.changed.rst | 2 +
...ew-kit.minor => tracking-camera-kit.minor} | 0
.../tracking-camera-tracking.added.rst | 2 +
...g.minor => tracking-camera-tracking.minor} | 0
.../contrib/franka_pour/pour_env_cfg.py | 4 +-
.../multitask_env_cfg.py | 2 +-
.../ur10_particle_push_env_cfg.py | 4 +-
.../core/cabinet/cabinet_env_cfg.py | 4 +-
.../core/cartpole/cartpole_direct_env_cfg.py | 4 +-
.../core/cartpole/cartpole_manager_env_cfg.py | 4 +-
.../fourbar_pole_manager_env_cfg.py | 6 +-
.../core/handover/handover_common.py | 4 +-
.../config/franka_soft/franka_soft_env_cfg.py | 6 +-
.../isaaclab_tasks/core/lift/lift_env_cfg.py | 4 +-
.../core/locomotion/ant/ant_common.py | 4 +-
.../locomotion/humanoid/humanoid_common.py | 4 +-
.../core/pendulum/pendulum_marl_env_cfg.py | 4 +-
.../core/reach/reach_env_cfg.py | 4 +-
.../isaaclab_tasks/core/reorient/utils.py | 6 +-
.../core/velocity/velocity_env_cfg.py | 4 +-
.../changelog.d/task-view-kit.changed.rst | 5 --
.../changelog.d/task-view-tracking.added.rst | 6 --
.../tracking-camera-kit.changed.rst | 5 ++
...ew-kit.major => tracking-camera-kit.major} | 0
.../tracking-camera-tracking.added.rst | 3 +
...g.minor => tracking-camera-tracking.minor} | 0
.../kit/kit_visualizer.py | 20 +++---
.../newton/newton_visualizer.py | 28 ++++----
.../test_kit_visualizer_scene_partitioning.py | 18 ++---
.../test/test_newton_adapter.py | 2 +-
...ews.py => test_newton_tracking_cameras.py} | 36 +++++-----
53 files changed, 235 insertions(+), 224 deletions(-)
delete mode 100644 source/isaaclab/changelog.d/task-view-kit.changed.rst
delete mode 100644 source/isaaclab/changelog.d/task-view-tracking.added.rst
create mode 100644 source/isaaclab/changelog.d/tracking-camera-kit.changed.rst
create mode 100644 source/isaaclab/changelog.d/tracking-camera-tracking.added.rst
rename source/isaaclab/changelog.d/{task-view-tracking.minor => tracking-camera-tracking.minor} (100%)
delete mode 100644 source/isaaclab_tasks/changelog.d/task-view-kit.changed.rst
delete mode 100644 source/isaaclab_tasks/changelog.d/task-view-tracking.added.rst
create mode 100644 source/isaaclab_tasks/changelog.d/tracking-camera-kit.changed.rst
rename source/isaaclab_tasks/changelog.d/{task-view-kit.minor => tracking-camera-kit.minor} (100%)
create mode 100644 source/isaaclab_tasks/changelog.d/tracking-camera-tracking.added.rst
rename source/isaaclab_tasks/changelog.d/{task-view-tracking.minor => tracking-camera-tracking.minor} (100%)
delete mode 100644 source/isaaclab_visualizers/changelog.d/task-view-kit.changed.rst
delete mode 100644 source/isaaclab_visualizers/changelog.d/task-view-tracking.added.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/tracking-camera-kit.changed.rst
rename source/isaaclab_visualizers/changelog.d/{task-view-kit.major => tracking-camera-kit.major} (100%)
create mode 100644 source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.added.rst
rename source/isaaclab_visualizers/changelog.d/{task-view-tracking.minor => tracking-camera-tracking.minor} (100%)
rename source/isaaclab_visualizers/test/{test_newton_task_views.py => test_newton_tracking_cameras.py} (79%)
diff --git a/docs/source/api/lab/isaaclab.visualizers.rst b/docs/source/api/lab/isaaclab.visualizers.rst
index f18253c6f9de..07b406c12768 100644
--- a/docs/source/api/lab/isaaclab.visualizers.rst
+++ b/docs/source/api/lab/isaaclab.visualizers.rst
@@ -27,6 +27,7 @@ The following classes are part of the public :mod:`isaaclab.visualizers` API.
VisualizerBackendCfg
WindowCfg
PerspectiveCameraCfg
+ TrackingCameraCfg
SceneCameraCfg
ImageViewCfg
ImageView
@@ -51,6 +52,9 @@ The following classes are part of the public :mod:`isaaclab.visualizers` API.
.. autoclass:: PerspectiveCameraCfg
:show-inheritance:
+.. autoclass:: TrackingCameraCfg
+ :show-inheritance:
+
.. autoclass:: SceneCameraCfg
:show-inheritance:
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index de6a922b6269..02a76116a6ce 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -567,11 +567,11 @@ task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton G
Rerun, and Viser visualizers. **Kit** opens it as a separate **Streaming View** viewport, which can
sit side by side with the default viewport for dual monitoring. **Newton GL** and **Newton RTX**
provide a **Camera View** selector in the sidebar for switching between perspective and scene-camera
-views. A perspective view can also be a *task view* that follows a robot or frames an environment; Newton GL and Kit
+views. A perspective view can also be a *tracking camera* that follows a robot or frames an environment; Newton GL and Kit
support it.
See :doc:`/source/how-to/visualizer_streaming_camera_view` for the ``VisualizerCfg`` options, display
-sources, task views that follow a robot, troubleshooting, migration from generated cameras, and step-by-step examples.
+sources, tracking cameras that follow a robot, troubleshooting, migration from generated cameras, and step-by-step examples.
Visualization Markers
@@ -798,15 +798,15 @@ Watch training live in Kit while recording from a separate headless Newton GL an
**Following a moving robot**
-Declare a *task view* instead of updating ``eye``/``lookat`` every step; see :ref:`how-to-visualizer-task-views`:
+Declare a *tracking camera* instead of updating ``eye``/``lookat`` every step; see :ref:`how-to-visualizer-tracking-cameras`:
.. code-block:: python
- from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+ from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
sim_cfg.visualizer_cfgs = VisualizerCfg(
cameras=[
- PerspectiveCameraCfg(
+ TrackingCameraCfg(
track_path="robot", # or "robot/panda_hand" to track a specific body
eye=(4.0, 4.0, 2.0), # offset from the tracked asset
),
diff --git a/docs/source/how-to/record_video.rst b/docs/source/how-to/record_video.rst
index 5f2c725e1e70..19e3ecf90072 100644
--- a/docs/source/how-to/record_video.rst
+++ b/docs/source/how-to/record_video.rst
@@ -289,8 +289,7 @@ The ``source`` string selects what to capture:
* - ``"viz:newton_gl:streaming_view"``
- Newton GL streaming camera panel, requires ``streaming_view=True``
* - ``"viz:newton_gl:tracking"``
- - First perspective view tied to an environment or an asset (``env_index`` or ``track_path``),
- whichever view the window shows; see :ref:`how-to-visualizer-task-views`
+ - First ``TrackingCameraCfg`` of the visualizer, whichever view the window shows; see :ref:`how-to-visualizer-tracking-cameras`
* - ``"sensor:"``
- ``env.scene.sensors[name]``, RGB (default)
* - ``"sensor::rgb"``
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index 1f186c2bdedd..69731381ed30 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -8,7 +8,7 @@ Streaming a camera view in a visualizer
.. currentmodule:: isaaclab
This guide shows how to show ground-truth camera frames from many environments in one live
-panel of a visualizer, and how to add a view that follows a robot (see :ref:`how-to-visualizer-task-views`).
+panel of a visualizer, and how to add a view that follows a robot (see :ref:`how-to-visualizer-tracking-cameras`).
For how the view works and which visualizers support it, see :ref:`visualization-streaming-camera-view`.
@@ -55,7 +55,7 @@ For Newton RTX, a perspective declaration is expanded into an ordinary scene cam
.. code-block:: python
- from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+ from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
view = ImageViewCfg(source=PerspectiveCameraCfg(eye=(4.0, -4.0, 3.0)))
env_cfg.sim.visualizer_cfgs = VisualizerCfg(
@@ -126,7 +126,7 @@ for dual monitoring.
**Newton GL and Newton RTX** have a **Camera View** selector in the sidebar. Selecting a scene camera displays
its tiled output in the main viewport instead of rendering a perspective view behind it.
Selecting a perspective camera restores interactive scene rendering. Newton GL also restores picking.
-A task view is listed as **Tracking Camera**; see :ref:`how-to-visualizer-task-views`.
+A tracking camera is listed as **Tracking Camera**; see :ref:`how-to-visualizer-tracking-cameras`.
Without an explicit ``cameras`` list, Newton GL starts in perspective and offers scene cameras
that provide every requested ``streaming_gt_types`` channel. An explicit
@@ -243,23 +243,23 @@ Unselected cameras are still allocated and may render if another consumer reads
scene uses eager sensor updates. ``streaming_envs`` selects displayed tiles, not capture work.
-.. _how-to-visualizer-task-views:
+.. _how-to-visualizer-tracking-cameras:
-Task views that follow a robot
-------------------------------
+Tracking cameras that follow a robot
+------------------------------------
-A ``PerspectiveCameraCfg`` with ``env_index`` or ``track_path`` is a *task view*. Its ``eye`` and ``lookat`` are
+A ``TrackingCameraCfg`` frames an environment or follows an asset in it. Its ``eye`` and ``lookat`` are
offsets [m] from the environment origin, or from the tracked asset, so it frames the robot wherever the scene puts
it. The visualizer renders it from its own camera: nothing is added to the scene, and the view keeps the
viewport's markers and shadows.
.. code-block:: python
- from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+ from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
self.sim.visualizer_cfgs = VisualizerCfg(
cameras=[
- PerspectiveCameraCfg(
+ TrackingCameraCfg(
eye=(1.8, -3.0, 1.1),
lookat=(0.15, 0.0, 0.0),
track_path="robot",
@@ -275,17 +275,17 @@ viewport's markers and shadows.
* ``follow_heading``: rotate the offsets with the asset's yaw, keeping the horizon level.
``heading_smoothing_time_constant`` [s] damps rapid turns.
-A free view at the visualizer's own ``eye`` and ``lookat`` is added before the first task view, so the
+A free view at the visualizer's own ``eye`` and ``lookat`` is added before the first tracking camera, so the
interactive camera stays free.
-* **Newton GL:** **Camera View** lists the task view as **Tracking Camera** beside **Perspective**. A
+* **Newton GL:** **Camera View** lists the tracking camera as **Tracking Camera** beside **Perspective**. A
**Tracking Camera** group edits its environment, asset, body, eye, look-at, focal length and heading settings
while it runs; **Reset to Task Default** restores the declaration. Record it with
``--video viz:newton_gl:tracking``, whichever view the window shows.
-* **Kit:** the viewport starts on the first declared view when it is a task view, and follows it until
+* **Kit:** the viewport starts on the first declared view when it is a tracking camera, and follows it until
``KitVisualizer.unfollow()`` or the **Follow Mode** control in the environment window. An environment view can
still be moved; an asset view is re-applied every step.
-* **Newton RTX**, **Viser** and **Rerun** ignore task views.
+* **Newton RTX**, **Viser** and **Rerun** ignore tracking cameras.
Examples
diff --git a/docs/source/isaaclab/migrating.rst b/docs/source/isaaclab/migrating.rst
index b71dabe41b9e..4d84dc0bde5f 100644
--- a/docs/source/isaaclab/migrating.rst
+++ b/docs/source/isaaclab/migrating.rst
@@ -2689,8 +2689,8 @@ on the sim config instead.
Similarly, :class:`~isaaclab.envs.ui.ViewportCameraController` is deprecated. A shim class
remains so existing imports do not break, but it raises a :class:`DeprecationWarning` at
-construction. Camera tracking is now a task view: a :class:`~isaaclab.visualizers.PerspectiveCameraCfg` with
-``env_index`` or ``track_path`` in the ``cameras`` of :class:`~isaaclab.visualizers.VisualizerCfg`.
+construction. Camera tracking is now a :class:`~isaaclab.visualizers.TrackingCameraCfg` in the ``cameras`` of
+:class:`~isaaclab.visualizers.VisualizerCfg`.
The ``origin_type``, ``origin_env_index``, and ``origin_track_path`` fields of
:class:`~isaaclab_visualizers.kit.KitBackendCfg` are removed.
@@ -2705,7 +2705,7 @@ The ``origin_type``, ``origin_env_index``, and ``origin_track_path`` fields of
env_cfg.sim.visualizer_cfgs = VisualizerCfg(eye=(4.5, 0.0, 6.0), lookat=(0.0, 0.0, 2.0))
-For asset-body tracking (previously ``origin_type="asset_root"`` / ``"asset_body"``), declare a task view
+For asset-body tracking (previously ``origin_type="asset_root"`` / ``"asset_body"``), declare a tracking camera
with ``track_path`` in :class:`~isaaclab.visualizers.VisualizerCfg` ``cameras``; a free view is added beside it:
.. code-block:: python
@@ -2717,10 +2717,10 @@ with ``track_path`` in :class:`~isaaclab.visualizers.VisualizerCfg` ``cameras``;
env_cfg.viewer.asset_name = "robot"
# After (Isaac Lab 3.x)
- from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+ from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
env_cfg.sim.visualizer_cfgs = VisualizerCfg(
- cameras=[PerspectiveCameraCfg(track_path="robot", eye=(4.0, 4.0, 2.0))],
+ cameras=[TrackingCameraCfg(track_path="robot", eye=(4.0, 4.0, 2.0))],
) # visualizer=kit
At runtime, :class:`~isaaclab_visualizers.kit.KitVisualizer` switches with ``follow()`` and ``unfollow()``, or the
diff --git a/source/isaaclab/changelog.d/task-view-kit.changed.rst b/source/isaaclab/changelog.d/task-view-kit.changed.rst
deleted file mode 100644
index da98f3139ad4..000000000000
--- a/source/isaaclab/changelog.d/task-view-kit.changed.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-* Changed the Kit environment window controls, the deprecated ``viewer`` bridge, and the deprecated
- ``ViewportCameraController`` to use Kit's task view following instead of the removed ``KitVisualizerCfg``
- ``origin_*`` fields.
diff --git a/source/isaaclab/changelog.d/task-view-tracking.added.rst b/source/isaaclab/changelog.d/task-view-tracking.added.rst
deleted file mode 100644
index 1ed4fb1cfe93..000000000000
--- a/source/isaaclab/changelog.d/task-view-tracking.added.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-* Added ``env_index``, ``track_path``, ``follow_heading``, and ``heading_smoothing_time_constant`` to
- :class:`~isaaclab.visualizers.PerspectiveCameraCfg`, so a perspective view can frame an environment or follow an asset
- with smoothed yaw. Added the ``viz::tracking`` video source, which records the first such view whichever view
- the window shows, for Newton GL.
-* Added :meth:`~isaaclab.visualizers.camera_follower.CameraFollower.set_track_path`, ``asset_names``, and
- ``body_names`` so a view can switch the asset or body it follows while running.
diff --git a/source/isaaclab/changelog.d/tracking-camera-kit.changed.rst b/source/isaaclab/changelog.d/tracking-camera-kit.changed.rst
new file mode 100644
index 000000000000..c03b5b8f702d
--- /dev/null
+++ b/source/isaaclab/changelog.d/tracking-camera-kit.changed.rst
@@ -0,0 +1,3 @@
+* Changed the Kit environment window controls, the deprecated ``viewer`` bridge, and the deprecated
+ ``ViewportCameraController`` to use Kit's tracking camera instead of the removed ``KitBackendCfg`` ``origin_*``
+ fields.
diff --git a/source/isaaclab/changelog.d/tracking-camera-tracking.added.rst b/source/isaaclab/changelog.d/tracking-camera-tracking.added.rst
new file mode 100644
index 000000000000..39b7a1cbd926
--- /dev/null
+++ b/source/isaaclab/changelog.d/tracking-camera-tracking.added.rst
@@ -0,0 +1,4 @@
+* Added :class:`~isaaclab.visualizers.TrackingCameraCfg`, a perspective camera that frames an environment or follows
+ an asset with optional smoothed heading, and :class:`~isaaclab.visualizers.camera_follower.CameraFollower`, which
+ can switch the followed asset while running. Added the ``viz::tracking`` video source, which records the first
+ tracking camera whichever view the window shows, for Newton GL.
diff --git a/source/isaaclab/changelog.d/task-view-tracking.minor b/source/isaaclab/changelog.d/tracking-camera-tracking.minor
similarity index 100%
rename from source/isaaclab/changelog.d/task-view-tracking.minor
rename to source/isaaclab/changelog.d/tracking-camera-tracking.minor
diff --git a/source/isaaclab/isaaclab/app/sim_launcher.py b/source/isaaclab/isaaclab/app/sim_launcher.py
index 88583b566aad..328bfd31105d 100644
--- a/source/isaaclab/isaaclab/app/sim_launcher.py
+++ b/source/isaaclab/isaaclab/app/sim_launcher.py
@@ -42,7 +42,14 @@
from ..utils.images import sensor_key_for_gt_type
from ..utils.math import create_rotation_matrix_from_view, quat_from_matrix
from ..utils.string import string_to_callable
-from ..visualizers import ImageViewCfg, PerspectiveCameraCfg, SceneCameraCfg, VisualizerBackendCfg, VisualizerCfg
+from ..visualizers import (
+ ImageViewCfg,
+ PerspectiveCameraCfg,
+ SceneCameraCfg,
+ TrackingCameraCfg,
+ VisualizerBackendCfg,
+ VisualizerCfg,
+)
from ..visualizers.visualizer_cfg import VISUALIZER_ALIASES, migrate_visualizer_cfgs
from .logging_utils import apply_python_logging_level, ensure_console_handlers, resolve_python_logging_level
from .settings_manager import get_settings_manager
@@ -316,13 +323,9 @@ def validate_launch( # noqa: C901
if visualizer.view is not None:
sources = [visualizer.view.source]
else:
- # Task views follow the viewer camera, which an RTX scene camera cannot do, so RTX leaves them out.
+ # Tracking cameras follow the viewer camera, which an RTX scene camera cannot do, so RTX leaves them out.
# RTX-only: remove this filter, and the one in SimulationContext, with the RTX visualizer.
- sources = [
- camera
- for camera in visualizer.cameras or []
- if not (isinstance(camera, PerspectiveCameraCfg) and camera.is_task_view)
- ]
+ sources = [camera for camera in visualizer.cameras or [] if not (isinstance(camera, TrackingCameraCfg))]
if not sources:
sources = [
PerspectiveCameraCfg(
diff --git a/source/isaaclab/isaaclab/envs/common.py b/source/isaaclab/isaaclab/envs/common.py
index 410312d6b82d..d5ef7693a85e 100644
--- a/source/isaaclab/isaaclab/envs/common.py
+++ b/source/isaaclab/isaaclab/envs/common.py
@@ -13,7 +13,7 @@
import torch
from ..utils import configclass
-from ..visualizers import PerspectiveCameraCfg, VisualizerCfg
+from ..visualizers import PerspectiveCameraCfg, TrackingCameraCfg, VisualizerCfg
##
# Deprecated: ViewerCfg
@@ -81,7 +81,7 @@ def __post_init__(self) -> None:
def _apply_deprecated_viewer_cfg(env_cfg: object) -> None:
"""Forward the deprecated viewport declaration to configured visualizers before scene creation.
- A viewer tied to an environment or an asset becomes a task view,
+ A viewer tied to an environment or an asset becomes a tracking camera,
:class:`~isaaclab.visualizers.PerspectiveCameraCfg` with ``env_index`` or ``track_path``, followed by a free view,
so the viewport starts on it. Other viewers set ``eye`` and ``lookat`` on the visualizer.
"""
@@ -113,7 +113,7 @@ def _apply_deprecated_viewer_cfg(env_cfg: object) -> None:
stacklevel=2,
)
else:
- view = PerspectiveCameraCfg(
+ view = TrackingCameraCfg(
env_index=viewer.env_index,
track_path=track_path,
eye=tuple(viewer.eye),
diff --git a/source/isaaclab/isaaclab/envs/utils/video_recorder.py b/source/isaaclab/isaaclab/envs/utils/video_recorder.py
index 9f73e1e6b03c..5c704dc345da 100644
--- a/source/isaaclab/isaaclab/envs/utils/video_recorder.py
+++ b/source/isaaclab/isaaclab/envs/utils/video_recorder.py
@@ -76,7 +76,7 @@ def __init__(self, cfg: VideoRecorderCfg, env: object):
f"The {viz.cfg.backend.visualizer_type!r} visualizer cannot record a tracking view. Use "
"'viz:newton_gl:tracking'."
)
- self._capture = viz.render_task_view_rgb_array
+ self._capture = viz.render_tracking_rgb_array
else:
self._capture = viz.render_tiled_rgb_array if channel == "streaming_view" else viz.render_rgb_array
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index 5f19bf37892f..ce60f92573c2 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -39,6 +39,7 @@
from ..visualizers.visualizer_cfg import (
PerspectiveCameraCfg,
SceneCameraCfg,
+ TrackingCameraCfg,
VisualizerCfg,
migrate_visualizer_cfgs,
with_free_view,
@@ -433,13 +434,9 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
)
]) # fmt: skip
if visualizer.cfg.backend.visualizer_type == "newton_rtx":
- # An RTX window shows scene cameras, so task views have nothing to follow there.
+ # An RTX window shows scene cameras, so tracking cameras have nothing to follow there.
# RTX-only: remove this branch, and the filter in sim_launcher, with the RTX visualizer.
- cameras = [
- camera
- for camera in cameras
- if not (isinstance(camera, PerspectiveCameraCfg) and camera.is_task_view)
- ]
+ cameras = [camera for camera in cameras if not (isinstance(camera, TrackingCameraCfg))]
else:
cameras = with_free_view(
cameras, visualizer.cfg.eye, visualizer.cfg.lookat, visualizer.cfg.focal_length
@@ -449,12 +446,11 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
env_template = self._clone_plan.env_template if self._clone_plan is not None else DEFAULT_ENV_TEMPLATE
for gt_type in visualizer.cfg.streaming_gt_types:
sensor_key_for_gt_type(gt_type)
- # task views only add to the scene cameras the visualizer would find on its own
- task_views_only = bool(visualizer.cfg.cameras) and all(
- isinstance(camera, PerspectiveCameraCfg) and camera.is_task_view
- for camera in visualizer.cfg.cameras
+ # tracking cameras only add to the scene cameras the visualizer would find on its own
+ tracking_only = bool(visualizer.cfg.cameras) and all(
+ isinstance(camera, TrackingCameraCfg) for camera in visualizer.cfg.cameras
)
- if visualizer.cfg.cameras is None or task_views_only:
+ if visualizer.cfg.cameras is None or tracking_only:
if visualizer.cfg.streaming_sensor_prim_path is not None:
cameras.insert(0, SceneCameraCfg(prim_path=visualizer.cfg.streaming_sensor_prim_path))
else:
@@ -487,8 +483,8 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
f"Declare a CameraCfg in the scene; available paths: {available_paths}."
)
cameras[index] = camera
- # task views come last, after the free view and the scene cameras
- cameras.sort(key=lambda camera: isinstance(camera, PerspectiveCameraCfg) and camera.is_task_view)
+ # tracking cameras come last, after the free view and the scene cameras
+ cameras.sort(key=lambda camera: isinstance(camera, TrackingCameraCfg))
visualizer.initialize(self, cameras=cameras)
self._pending_visualizers.remove(visualizer)
self._visualizers.append(visualizer)
diff --git a/source/isaaclab/isaaclab/visualizers/__init__.pyi b/source/isaaclab/isaaclab/visualizers/__init__.pyi
index 803df022f934..f170d6c27475 100644
--- a/source/isaaclab/isaaclab/visualizers/__init__.pyi
+++ b/source/isaaclab/isaaclab/visualizers/__init__.pyi
@@ -10,6 +10,7 @@ __all__ = [
"KeyEventSource",
"KeyboardSubscription",
"PerspectiveCameraCfg",
+ "TrackingCameraCfg",
"SceneCameraCfg",
"VisualizerCfg",
"VisualizerBackendCfg",
@@ -20,4 +21,12 @@ __all__ = [
from .base_visualizer import BaseVisualizer
from .image_view import ImageView
from .key_event_source import KeyboardSubscription, KeyEventSource, add_key_callbacks
-from .visualizer_cfg import WindowCfg, ImageViewCfg, PerspectiveCameraCfg, SceneCameraCfg, VisualizerCfg, VisualizerBackendCfg
+from .visualizer_cfg import (
+ ImageViewCfg,
+ PerspectiveCameraCfg,
+ SceneCameraCfg,
+ TrackingCameraCfg,
+ VisualizerBackendCfg,
+ VisualizerCfg,
+ WindowCfg,
+)
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
index a68ec5b9c65f..f1fda4cfe948 100644
--- a/source/isaaclab/isaaclab/visualizers/camera_follower.py
+++ b/source/isaaclab/isaaclab/visualizers/camera_follower.py
@@ -14,7 +14,7 @@
if TYPE_CHECKING:
from ..scene import InteractiveScene
- from .visualizer_cfg import PerspectiveCameraCfg
+ from .visualizer_cfg import TrackingCameraCfg
_RESET_JUMP = 1.0
"""Distance [m] an asset moves between two updates only when its environment resets."""
@@ -26,21 +26,21 @@
class CameraFollower:
- """Turns a :class:`~isaaclab.visualizers.PerspectiveCameraCfg` tied to an environment into world poses.
+ """Turns a :class:`~isaaclab.visualizers.TrackingCameraCfg` tied to an environment into world poses.
- A view that only has :attr:`~isaaclab.visualizers.PerspectiveCameraCfg.env_index` stays fixed relative to that
- environment's origin. A view with :attr:`~isaaclab.visualizers.PerspectiveCameraCfg.track_path` follows the
+ A view that only has :attr:`~isaaclab.visualizers.TrackingCameraCfg.env_index` stays fixed relative to that
+ environment's origin. A view with :attr:`~isaaclab.visualizers.TrackingCameraCfg.track_path` follows the
asset's position, and its yaw when ``follow_heading`` is set, with the heading filtered over time.
"""
- def __init__(self, cfg: PerspectiveCameraCfg, scene: InteractiveScene) -> None:
+ def __init__(self, cfg: TrackingCameraCfg, scene: InteractiveScene) -> None:
self.cfg = cfg
self._scene = scene
self._env = 0
self._yaw: float | None = None
self._last_position: list[float] | None = None
self._time: float | None = None
- self.set_env(cfg.env_index or 0)
+ self.set_env(cfg.env_index)
self._asset = None
self._body_index: int | None = None
self._body_name = ""
@@ -67,9 +67,6 @@ def set_track_path(self, track_path: str | None) -> None:
if body_name and asset.is_initialized and len(asset.find_bodies(body_name)[0]) != 1:
raise ValueError(f"track_path must match exactly one body: {track_path!r}.")
self.cfg.track_path = track_path or None
- if self.cfg.track_path is None and self.cfg.env_index is None:
- # keep the view tied to its environment, so it stays a task view without an asset
- self.cfg.env_index = self._env
self._asset, self._body_name, self._body_index = asset, body_name, None
self._yaw = self._last_position = self._time = None
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index de78581bd87b..4d23ee2fb61b 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -33,46 +33,56 @@ def with_free_view(
lookat: tuple[float, float, float],
focal_length: float,
) -> list[PerspectiveCameraCfg | SceneCameraCfg]:
- """Return *cameras* with a free perspective view added when it has task views but no free view of its own.
+ """Return *cameras* with a free perspective view added when it has tracking cameras but no free view of its own.
- A task view follows a robot or frames an environment, so the interactive view that a user moves stays
+ A tracking camera follows a robot or frames an environment, so the interactive view that a user moves stays
available beside it, at the visualizer's own ``eye``, ``lookat`` and ``focal_length``. The free view goes
- right before the first task view, so scene cameras declared ahead of it stay first.
+ right before the first tracking camera, so scene cameras declared ahead of it stay first.
"""
perspective = [camera for camera in cameras if isinstance(camera, PerspectiveCameraCfg)]
- if perspective and all(camera.is_task_view for camera in perspective):
+ if perspective and all(isinstance(camera, TrackingCameraCfg) for camera in perspective):
free = PerspectiveCameraCfg(eye=eye, lookat=lookat, focal_length=focal_length)
- first_task = next(i for i, camera in enumerate(cameras) if isinstance(camera, PerspectiveCameraCfg))
- return [*cameras[:first_task], free, *cameras[first_task:]]
+ first_tracking = next(i for i, camera in enumerate(cameras) if isinstance(camera, PerspectiveCameraCfg))
+ return [*cameras[:first_tracking], free, *cameras[first_tracking:]]
return cameras
@configclass
class PerspectiveCameraCfg:
- """Pose and optics for a visualizer-owned perspective camera.
+ """Initial pose and optics for an interactive perspective camera.
- By default the pose is in world coordinates. With :attr:`env_index` or :attr:`track_path` set, the view is tied
- to an environment or to an asset in it, so it frames that robot however the scene is laid out, and the
- visualizer renders it from the viewer camera. Nothing is created in the scene.
- """
+ Newton RTX launch preparation expands this declaration into a scene CameraCfg. Newton GL
+ uses its native viewer camera."""
eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
- """Eye position [m]: world coordinates, or an offset from the environment origin or the tracked asset."""
+ """Eye position in world coordinates [m]."""
lookat: tuple[float, float, float] = (0.0, 0.0, 0.0)
- """Look-at target [m], in the same frame as :attr:`eye`."""
+ """Look-at target in world coordinates [m]."""
focal_length: float = 12.0
"""Perspective camera focal length [mm]."""
- env_index: int | None = None
- """Environment whose origin :attr:`eye` and :attr:`lookat` are relative to; None keeps world coordinates.
- With :attr:`track_path` it is the environment of the tracked asset, and None means environment 0.
+@configclass
+class TrackingCameraCfg(PerspectiveCameraCfg):
+ """A camera that frames an environment or follows an asset in it, however the scene is laid out.
+
+ The visualizer renders it from the viewer camera, so nothing is created in the scene. Only Newton GL
+ and Kit support it; other visualizers ignore it.
"""
+ eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
+ """Eye position [m], as an offset from the tracked asset, or from the origin of :attr:`env_index`."""
+
+ lookat: tuple[float, float, float] = (0.0, 0.0, 0.0)
+ """Look-at target [m], in the same frame as :attr:`eye`."""
+
+ env_index: int = 0
+ """Environment to frame, or the one holding the tracked asset."""
+
track_path: str | None = None
- """Scene asset the view follows, or None for a view fixed relative to the environment origin.
+ """Scene asset to follow, or None for a view fixed relative to the environment origin.
Use ``"robot"`` for an asset root or ``"robot/base"`` for a named body, which must match exactly one body.
"""
@@ -89,13 +99,8 @@ class PerspectiveCameraCfg:
Larger values damp rapid turns more, with more lag. Only used with :attr:`follow_heading`.
"""
- @property
- def is_task_view(self) -> bool:
- """Whether the view is tied to an environment or an asset, not fixed in the world."""
- return self.env_index is not None or self.track_path is not None
-
def __post_init__(self) -> None:
- if self.env_index is not None and self.env_index < 0:
+ if self.env_index < 0:
raise ValueError("env_index must be non-negative.")
if not math.isfinite(self.heading_smoothing_time_constant) or self.heading_smoothing_time_constant < 0.0:
raise ValueError("heading_smoothing_time_constant must be finite and non-negative.")
@@ -218,11 +223,12 @@ class VisualizerCfg:
"""Render on demand without opening a native viewer window."""
# Primary interactive camera settings
- cameras: list[PerspectiveCameraCfg | SceneCameraCfg] | None = None
+ cameras: list[PerspectiveCameraCfg | TrackingCameraCfg | SceneCameraCfg] | None = None
"""Camera sources available to the visualizer.
- PerspectiveCameraCfg configures the interactive view; SceneCameraCfg refers to an existing scene
- sensor. Newton GL and RTX display the first source and offer a dropdown for switching sources.
+ PerspectiveCameraCfg configures the interactive view, TrackingCameraCfg a view that frames an environment
+ or follows an asset, and SceneCameraCfg refers to an existing scene sensor.
+ Newton GL and RTX display the first source and offer a dropdown for switching sources.
Kit, Rerun, and Viser display the first scene source in their camera panel.
None uses eye/lookat/focal_length and the streaming settings below.
Every explicit scene source must provide all requested streaming_gt_types channels.
@@ -336,10 +342,12 @@ def __post_init__(self) -> None:
if self.cameras is not None:
if not self.cameras:
raise ValueError("cameras must contain at least one display source.")
- # task views only add to the cameras the visualizer finds, so they leave the streaming choice alone
- if not all(isinstance(camera, PerspectiveCameraCfg) and camera.is_task_view for camera in self.cameras):
+ # tracking cameras only add to the cameras the visualizer finds, so they leave the streaming choice alone
+ if not all(isinstance(camera, TrackingCameraCfg) for camera in self.cameras):
self.streaming_view = any(isinstance(camera, SceneCameraCfg) for camera in self.cameras)
- if isinstance(camera := self.cameras[0], PerspectiveCameraCfg) and not camera.is_task_view:
+ if isinstance(camera := self.cameras[0], PerspectiveCameraCfg) and not isinstance(
+ camera, TrackingCameraCfg
+ ):
self.eye, self.lookat, self.focal_length = camera.eye, camera.lookat, camera.focal_length
diff --git a/source/isaaclab/test/envs/test_video_recorder.py b/source/isaaclab/test/envs/test_video_recorder.py
index f79a59202c89..ae1afc454c6a 100644
--- a/source/isaaclab/test/envs/test_video_recorder.py
+++ b/source/isaaclab/test/envs/test_video_recorder.py
@@ -259,10 +259,10 @@ def test_source_resolves_frame(source, make_env, caplog):
assert not caplog.records
-def test_a_tracking_source_records_the_task_view_not_the_selected_one():
+def test_a_tracking_source_records_the_tracking_camera_not_the_selected_one():
viz = _FakeViz("newton_gl")
task_frame = np.full_like(_FRAME, 7)
- viz.render_task_view_rgb_array = lambda: task_frame
+ viz.render_tracking_rgb_array = lambda: task_frame
recorder = VideoRecorder(_cfg(source="viz:newton_gl:tracking"), _make_env(visualizers=[viz]))
assert recorder._capture() is task_frame
assert viz.render_calls == 0
diff --git a/source/isaaclab/test/envs/test_viewer_cfg_deprecation.py b/source/isaaclab/test/envs/test_viewer_cfg_deprecation.py
index ade4da26dc91..672da3e828b2 100644
--- a/source/isaaclab/test/envs/test_viewer_cfg_deprecation.py
+++ b/source/isaaclab/test/envs/test_viewer_cfg_deprecation.py
@@ -17,7 +17,7 @@
from isaaclab_visualizers.kit import KitBackendCfg
from isaaclab.envs.common import ViewerCfg, _apply_deprecated_viewer_cfg
-from isaaclab.visualizers import VisualizerBackendCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerBackendCfg, VisualizerCfg
def test_viewer_cfg_default_no_warning():
@@ -67,9 +67,9 @@ def test_deprecated_viewer_forwards_only_to_unconfigured_views(case, expected_pa
elif expected_path is None:
assert (view.eye, view.lookat) == (viewer.eye, viewer.lookat) and view.cameras is None
else:
- # a followed asset becomes a task view that comes first, so the viewport starts on it
+ # a followed asset becomes a tracking camera that comes first, so the viewport starts on it
assert view.cameras[0].track_path == expected_path and view.cameras[0].eye == viewer.eye
- assert not view.cameras[1].is_task_view
+ assert not isinstance(view.cameras[1], TrackingCameraCfg)
def test_combined_visualizer_configs_translate_once_before_launch():
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
index 4b698721735d..88dc48c7c1c7 100644
--- a/source/isaaclab/test/visualizers/test_camera_follower.py
+++ b/source/isaaclab/test/visualizers/test_camera_follower.py
@@ -13,7 +13,7 @@
import pytest
import torch
-from isaaclab.visualizers import PerspectiveCameraCfg, SceneCameraCfg, VisualizerCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, SceneCameraCfg, TrackingCameraCfg, VisualizerCfg
from isaaclab.visualizers.camera_follower import CameraFollower
from isaaclab.visualizers.visualizer_cfg import with_free_view
@@ -45,7 +45,7 @@ def _eye(follower: CameraFollower, time: float = 0.1) -> torch.Tensor:
def test_a_view_with_an_environment_stays_fixed_relative_to_its_origin():
- cfg = PerspectiveCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0))
+ cfg = TrackingCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0))
eye, target = CameraFollower(cfg, _Scene()).pose(0.1)
assert eye == (11.0, 2.0, 3.0)
assert target == (10.0, 0.0, 1.0)
@@ -53,7 +53,7 @@ def test_a_view_with_an_environment_stays_fixed_relative_to_its_origin():
def test_a_tracked_view_follows_the_asset_and_rotates_with_its_heading():
scene = _Scene()
- cfg = PerspectiveCameraCfg(env_index=1, track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
+ cfg = TrackingCameraCfg(env_index=1, track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
follower = CameraFollower(cfg, scene)
torch.testing.assert_close(_eye(follower), torch.tensor([7.0, 0.0, 1.5]))
# turned a quarter turn, the robot's back is at -y
@@ -67,7 +67,7 @@ def test_a_tracked_view_follows_the_asset_and_rotates_with_its_heading():
def test_smoothing_lags_a_turn_but_not_the_first_sample_or_a_reset():
def run(jump: float) -> torch.Tensor:
scene = _Scene()
- cfg = PerspectiveCameraCfg(track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
+ cfg = TrackingCameraCfg(track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
cfg.heading_smoothing_time_constant = 0.5
follower = CameraFollower(cfg, scene)
follower.pose(0.0)
@@ -83,7 +83,7 @@ def run(jump: float) -> torch.Tensor:
def test_a_reset_in_place_with_a_new_heading_is_not_smoothed_but_a_real_turn_is():
def run(yaw: float) -> torch.Tensor:
scene = _Scene()
- cfg = PerspectiveCameraCfg(track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
+ cfg = TrackingCameraCfg(track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
cfg.heading_smoothing_time_constant = 0.5
follower = CameraFollower(cfg, scene)
follower.pose(0.0)
@@ -95,27 +95,27 @@ def run(yaw: float) -> torch.Tensor:
def test_a_view_waits_for_its_asset_and_rejects_bad_targets():
- assert CameraFollower(PerspectiveCameraCfg(track_path="robot"), _Scene(ready=False)).pose(0.1) is None
+ assert CameraFollower(TrackingCameraCfg(track_path="robot"), _Scene(ready=False)).pose(0.1) is None
with pytest.raises(ValueError, match="outside"):
- CameraFollower(PerspectiveCameraCfg(env_index=2), _Scene())
+ CameraFollower(TrackingCameraCfg(env_index=2), _Scene())
with pytest.raises(ValueError, match="non-negative"):
- PerspectiveCameraCfg(env_index=-1)
+ TrackingCameraCfg(env_index=-1)
with pytest.raises(ValueError, match="non-negative"):
- PerspectiveCameraCfg(heading_smoothing_time_constant=-1.0)
+ TrackingCameraCfg(heading_smoothing_time_constant=-1.0)
-def test_task_views_get_a_free_view_beside_them():
- free, task = PerspectiveCameraCfg(), PerspectiveCameraCfg(env_index=0)
+def test_tracking_cameras_get_a_free_view_beside_them():
+ free, task = PerspectiveCameraCfg(), TrackingCameraCfg(env_index=0)
args = ((1.0, 2.0, 3.0), (0.0, 0.0, 0.0), 30.0)
assert with_free_view([task], *args)[0].eye == (1.0, 2.0, 3.0)
assert len(with_free_view([task], *args)) == 2
assert with_free_view([free, task], *args) == [free, task]
- # scene cameras declared ahead of the task view stay first
+ # scene cameras declared ahead of the tracking camera stay first
sensor = SceneCameraCfg(prim_path="/cam")
views = with_free_view([sensor, task], *args)
assert views[0] is sensor and views[1].eye == (1.0, 2.0, 3.0) and views[2] is task
assert with_free_view([SceneCameraCfg(prim_path="/cam")], *args) == [SceneCameraCfg(prim_path="/cam")]
- # a task view first does not replace the visualizer's own pose or its streaming choice
+ # a tracking camera first does not replace the visualizer's own pose or its streaming choice
cfg = VisualizerCfg(eye=(7.0, 0.0, 0.0), streaming_view=True, cameras=[task])
assert cfg.eye == (7.0, 0.0, 0.0) and cfg.streaming_view
assert not VisualizerCfg(streaming_view=True, cameras=[free]).streaming_view
@@ -141,7 +141,7 @@ def __getitem__(self, name):
def test_the_followed_asset_can_be_switched_and_cleared_while_running():
- cfg = PerspectiveCameraCfg(env_index=1, eye=(1.0, 0.0, 0.0), lookat=(0.0, 0.0, 0.0))
+ cfg = TrackingCameraCfg(env_index=1, eye=(1.0, 0.0, 0.0), lookat=(0.0, 0.0, 0.0))
follower = CameraFollower(cfg, _NamedScene())
assert _eye(follower).tolist() == [11.0, 0.0, 0.0] # Fixed relative to the environment origin.
@@ -155,7 +155,7 @@ def test_the_followed_asset_can_be_switched_and_cleared_while_running():
def test_an_unknown_asset_or_ambiguous_body_is_rejected_and_keeps_the_current_target():
- cfg = PerspectiveCameraCfg(env_index=0, track_path="robot")
+ cfg = TrackingCameraCfg(env_index=0, track_path="robot")
follower = CameraFollower(cfg, _NamedScene())
with pytest.raises(ValueError, match="unknown scene asset"):
@@ -169,7 +169,7 @@ def test_an_unknown_asset_or_ambiguous_body_is_rejected_and_keeps_the_current_ta
def test_the_followable_assets_and_bodies_are_listed():
- follower = CameraFollower(PerspectiveCameraCfg(env_index=0), _NamedScene())
+ follower = CameraFollower(TrackingCameraCfg(env_index=0), _NamedScene())
assert follower.asset_names() == ["robot", "cube"]
assert follower.body_names("robot") == ["base", "LF_FOOT"]
@@ -178,17 +178,15 @@ def test_the_followable_assets_and_bodies_are_listed():
def test_clearing_the_asset_keeps_the_view_tied_to_its_environment():
- cfg = PerspectiveCameraCfg(track_path="robot")
+ cfg = TrackingCameraCfg(track_path="robot")
follower = CameraFollower(cfg, _NamedScene())
- assert cfg.is_task_view
+ assert isinstance(cfg, TrackingCameraCfg)
follower.set_track_path(None)
- assert cfg.track_path is None and cfg.is_task_view
+ assert cfg.track_path is None and isinstance(cfg, TrackingCameraCfg)
def test_two_updates_a_millisecond_apart_are_not_mistaken_for_an_environment_reset():
- cfg = PerspectiveCameraCfg(
- env_index=0, track_path="robot", follow_heading=True, heading_smoothing_time_constant=1.0
- )
+ cfg = TrackingCameraCfg(env_index=0, track_path="robot", follow_heading=True, heading_smoothing_time_constant=1.0)
follower = CameraFollower(cfg, _NamedScene())
follower.pose(0.0)
follower._yaw = 0.0
diff --git a/source/isaaclab_tasks/changelog.d/task-view-kit.changed.rst b/source/isaaclab_tasks/changelog.d/task-view-kit.changed.rst
deleted file mode 100644
index e4686a502bb5..000000000000
--- a/source/isaaclab_tasks/changelog.d/task-view-kit.changed.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-* Changed the Franka pour and UR10 particle push tasks to frame environment 0 with a task view instead of the
- removed ``KitVisualizerCfg`` ``origin_*`` fields.
diff --git a/source/isaaclab_tasks/changelog.d/task-view-tracking.added.rst b/source/isaaclab_tasks/changelog.d/task-view-tracking.added.rst
deleted file mode 100644
index 6d29df5db455..000000000000
--- a/source/isaaclab_tasks/changelog.d/task-view-tracking.added.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-* Added task views to the core tasks: a fixed view of the environment, or a view that follows the robot for
- locomotion tasks. Record them with ``--video viz:newton_gl:tracking``.
diff --git a/source/isaaclab_tasks/changelog.d/tracking-camera-kit.changed.rst b/source/isaaclab_tasks/changelog.d/tracking-camera-kit.changed.rst
new file mode 100644
index 000000000000..781276b20557
--- /dev/null
+++ b/source/isaaclab_tasks/changelog.d/tracking-camera-kit.changed.rst
@@ -0,0 +1,2 @@
+* Changed the Franka pour and UR10 particle push tasks to frame environment 0 with a tracking camera instead of the
+ removed ``KitBackendCfg`` ``origin_*`` fields.
diff --git a/source/isaaclab_tasks/changelog.d/task-view-kit.minor b/source/isaaclab_tasks/changelog.d/tracking-camera-kit.minor
similarity index 100%
rename from source/isaaclab_tasks/changelog.d/task-view-kit.minor
rename to source/isaaclab_tasks/changelog.d/tracking-camera-kit.minor
diff --git a/source/isaaclab_tasks/changelog.d/tracking-camera-tracking.added.rst b/source/isaaclab_tasks/changelog.d/tracking-camera-tracking.added.rst
new file mode 100644
index 000000000000..ef2cc7e525f7
--- /dev/null
+++ b/source/isaaclab_tasks/changelog.d/tracking-camera-tracking.added.rst
@@ -0,0 +1,2 @@
+* Added tracking cameras to the core tasks: a fixed view of the environment, or a view that follows the robot for
+ locomotion tasks. Record them with ``--video viz:newton_gl:tracking``.
diff --git a/source/isaaclab_tasks/changelog.d/task-view-tracking.minor b/source/isaaclab_tasks/changelog.d/tracking-camera-tracking.minor
similarity index 100%
rename from source/isaaclab_tasks/changelog.d/task-view-tracking.minor
rename to source/isaaclab_tasks/changelog.d/tracking-camera-tracking.minor
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
index 5e978dc7888b..b111b174a8dd 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
@@ -37,7 +37,7 @@
from isaaclab.sim.spawners.materials import RigidBodyMaterialBaseCfg
from isaaclab.utils import configclass, replace
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, ISAACLAB_NUCLEUS_DIR
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_contrib.coupling import CouplerEntryCfg, CouplerProxyCfg, CouplerProxyMappingCfg
@@ -532,7 +532,7 @@ class FrankaPourResetDatasetEnvCfg(ManagerBasedRLEnvCfg):
sim: sim_utils.SimulationCfg = sim_utils.SimulationCfg(
# the viewport starts on the first view, framing environment 0; a free view follows it
visualizer_cfgs=VisualizerCfg(
- cameras=[PerspectiveCameraCfg(env_index=0, eye=(1.4, 1.4, 0.9), lookat=(0.5, 0.0, 0.1))],
+ cameras=[TrackingCameraCfg(env_index=0, eye=(1.4, 1.4, 0.9), lookat=(0.5, 0.0, 0.1))],
)
)
observations: ResetDatasetObservationsCfg = ResetDatasetObservationsCfg()
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/multitask_manipulation/multitask_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/multitask_manipulation/multitask_env_cfg.py
index cf9aa466f9ec..af78c67d9da0 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/multitask_manipulation/multitask_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/multitask_manipulation/multitask_env_cfg.py
@@ -491,7 +491,7 @@ def __post_init__(self):
self.sim.visualizer_cfgs = VisualizerCfg(eye=(-3.0, 3.0, 2.5), lookat=(0.0, 0.0, 0.5))
def validate_config(self) -> None:
- """Validate the minimum batch size required to instantiate all task views."""
+ """Validate the minimum batch size required to instantiate all tracking cameras."""
if self.scene.num_envs < 3:
raise ValueError("IsaacContrib-Multitask-Manipulation requires at least three environments, one per task.")
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
index ceb2e207f4a8..3f591e4fda68 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
@@ -34,7 +34,7 @@
from isaaclab.sim.spawners.materials import RigidBodyMaterialBaseCfg
from isaaclab.utils import configclass, replace
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_contrib.coupling import CouplerEntryCfg, CouplerProxyCfg, CouplerProxyMappingCfg
@@ -616,7 +616,7 @@ class UR10ParticlePushEnvCfg(ManagerBasedRLEnvCfg):
render_interval=decimation,
# the viewport starts on the first view, framing environment 0; a free view follows it
visualizer_cfgs=VisualizerCfg(
- cameras=[PerspectiveCameraCfg(env_index=0, eye=(1.7, 1.5, 1.0), lookat=(0.55, 0.0, 0.0))],
+ cameras=[TrackingCameraCfg(env_index=0, eye=(1.7, 1.5, 1.0), lookat=(0.55, 0.0, 0.0))],
),
)
actions: ActionsCfg = ActionsCfg()
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py
index 3ecc28f83b3f..3ea152ea4a50 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py
@@ -29,7 +29,7 @@
from isaaclab.sim import SimulationCfg
from isaaclab.utils import clone, configclass, replace
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -112,7 +112,7 @@ class CabinetSimCfg(PresetCfg):
eye=(-2.0, 2.0, 2.0),
lookat=(0.8, 0.0, 0.5),
cameras=[
- PerspectiveCameraCfg(
+ TrackingCameraCfg(
env_index=0,
eye=(-1.8, 2.0, 1.6),
lookat=(0.55, 0.0, 0.5),
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py
index 5db9796bda6f..4f0149673a3f 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py
@@ -15,7 +15,7 @@
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.sim import SimulationCfg
from isaaclab.utils import configclass, replace
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_assets.robots.cartpole import CARTPOLE_CFG
@@ -73,7 +73,7 @@ def __post_init__(self):
self.sim.visualizer_cfgs = VisualizerCfg(
eye=(8.0, 0.0, 5.0),
cameras=[
- PerspectiveCameraCfg(
+ TrackingCameraCfg(
env_index=0,
eye=(8.0, 0.0, 2.5),
lookat=(0.0, 0.0, 2.5),
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py
index c76ba6225bbc..51be97f26892 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py
@@ -18,7 +18,7 @@
from isaaclab.managers import TerminationTermCfg as DoneTerm
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.utils import configclass, replace
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_assets.robots.cartpole import CARTPOLE_CFG
@@ -184,7 +184,7 @@ def __post_init__(self):
self.sim.visualizer_cfgs = VisualizerCfg(
eye=(8.0, 0.0, 5.0),
cameras=[
- PerspectiveCameraCfg(
+ TrackingCameraCfg(
env_index=0,
eye=(8.0, 0.0, 2.5),
lookat=(0.0, 0.0, 2.5),
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
index cb4deddeb61a..e57b2f80a156 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
@@ -24,7 +24,7 @@
from isaaclab.managers import TerminationTermCfg as DoneTerm
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.utils import configclass, replace
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -239,11 +239,11 @@ def __post_init__(self) -> None:
# general settings
self.decimation = 2
self.episode_length_s = 5
- # Match Newton GL / --video camera to the task viewport when --viz newton creates the visualizer.
+ # Match Newton GL / --video camera to the tracking cameraport when --viz newton creates the visualizer.
self.sim.visualizer_cfgs = VisualizerCfg(
eye=(12.0, 0.0, 4.0),
cameras=[
- PerspectiveCameraCfg(
+ TrackingCameraCfg(
env_index=0,
eye=(4.5, 0.0, 1.8),
lookat=(0.0, 0.0, 1.8),
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py b/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py
index 667982f287ce..c9abd4fdb76c 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py
@@ -13,7 +13,7 @@
from isaaclab.markers import VisualizationMarkersCfg
from isaaclab.utils import index_fill_
from isaaclab.utils.math import quat_apply
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.core.reorient.utils import SuccessTracker
@@ -39,7 +39,7 @@
eye=(2.35, -0.5, 1.1),
lookat=(0.75, -0.5, 0.55),
focal_length=35.0,
- cameras=[PerspectiveCameraCfg(env_index=0, eye=(1.15, -1.65, 1.15), lookat=(0.0, -0.5, 0.55), focal_length=35.0)],
+ cameras=[TrackingCameraCfg(env_index=0, eye=(1.15, -1.65, 1.15), lookat=(0.0, -0.5, 0.55), focal_length=35.0)],
)
"""Recording view facing one hand pair from the side, with both hands and the object between them."""
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py
index 6394d7a972a2..5459469fdb12 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py
@@ -39,7 +39,7 @@
from isaaclab.sim.spawners.from_files.from_files_cfg import GroundPlaneCfg
from isaaclab.utils import configclass, replace
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_contrib.coupling import CouplerEntryCfg, CouplerProxyCfg, CouplerProxyMappingCfg
@@ -636,9 +636,7 @@ def __post_init__(self):
self.sim.visualizer_cfgs = VisualizerCfg(
eye=(0.75, 0.25, 0.65),
lookat=(0.0, 0.75, 0.4),
- cameras=[
- PerspectiveCameraCfg(env_index=0, eye=(1.8, -1.8, 1.5), lookat=(0.35, 0.0, 0.35), focal_length=28.0)
- ],
+ cameras=[TrackingCameraCfg(env_index=0, eye=(1.8, -1.8, 1.5), lookat=(0.35, 0.0, 0.35), focal_length=28.0)],
)
def play_mode(self):
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py
index 0a61defab87f..2acf3931b9d7 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py
@@ -27,7 +27,7 @@
from isaaclab.utils import configclass
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
from isaaclab.utils.noise import UniformNoiseCfg as Unoise
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -567,7 +567,7 @@ def __post_init__(self):
eye=(-2.25, 0.0, 0.75),
lookat=(0.0, 0.0, 0.45),
cameras=[
- PerspectiveCameraCfg(
+ TrackingCameraCfg(
env_index=0,
eye=(-1.8, -1.8, 1.45),
lookat=(-0.3, 0.0, 0.45),
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_common.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_common.py
index e62a3e04fbec..f01a7035c09c 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_common.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_common.py
@@ -13,13 +13,13 @@
from isaaclab.physics import PhysxAutoCfg
from isaaclab.terrains import TerrainImporterCfg
from isaaclab.utils import configclass
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
VISUALIZER_CFG = VisualizerCfg(
cameras=[
- PerspectiveCameraCfg(
+ TrackingCameraCfg(
eye=(3.5, -1.0, 2.8),
lookat=(0.0, 0.0, 0.0),
focal_length=26.0,
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_common.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_common.py
index bae554f6ce6b..30380684592c 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_common.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_common.py
@@ -13,13 +13,13 @@
from isaaclab.physics import PhysxAutoCfg
from isaaclab.terrains import TerrainImporterCfg
from isaaclab.utils import configclass
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
VISUALIZER_CFG = VisualizerCfg(
cameras=[
- PerspectiveCameraCfg(
+ TrackingCameraCfg(
eye=(2.5, -3.5, 0.9),
lookat=(0.0, 0.0, -0.5),
focal_length=26.0,
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py
index 5994a0678840..0b25e54d9889 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py
@@ -18,7 +18,7 @@
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.sim import SimulationCfg
from isaaclab.utils import configclass, replace
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -83,7 +83,7 @@ class PendulumMARLEnvCfg(DirectMARLEnvCfg):
physics=PendulumPhysicsCfg(),
visualizer_cfgs=VisualizerCfg(
cameras=[
- PerspectiveCameraCfg(
+ TrackingCameraCfg(
env_index=0,
eye=(8.0, 0.0, 2.3),
lookat=(0.0, 0.0, 2.3),
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py
index 19b7f6e55556..be82505ff58a 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py
@@ -27,7 +27,7 @@
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.utils import configclass
from isaaclab.utils.noise import UniformNoiseCfg as Unoise
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -251,7 +251,7 @@ def __post_init__(self):
self.sim.visualizer_cfgs = VisualizerCfg(
eye=(3.5, 3.5, 3.5),
cameras=[
- PerspectiveCameraCfg(
+ TrackingCameraCfg(
env_index=0,
eye=(1.8, -1.8, 1.5),
lookat=(0.3, 0.0, 0.4),
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py
index 0e7d94d7f3af..b038c9a807c5 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py
@@ -19,7 +19,7 @@
import isaaclab.utils.math as math_utils
from isaaclab.utils import index_fill_
from isaaclab.utils.math import quat_from_angle_axis, quat_mul
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
if TYPE_CHECKING:
from isaaclab.assets import Articulation
@@ -32,7 +32,7 @@
eye=(0.995, -0.80, 0.85),
lookat=(0.375, -0.28, 0.53),
focal_length=35.0,
- cameras=[PerspectiveCameraCfg(env_index=0, eye=(0.62, -0.80, 0.85), lookat=(0.0, -0.28, 0.53), focal_length=35.0)],
+ cameras=[TrackingCameraCfg(env_index=0, eye=(0.62, -0.80, 0.85), lookat=(0.0, -0.28, 0.53), focal_length=35.0)],
)
"""Recording view of an environment in the 50-environment play grid."""
@@ -40,7 +40,7 @@
eye=(1.62, -1.80, 0.85),
lookat=(1.0, -1.28, 0.53),
focal_length=35.0,
- cameras=[PerspectiveCameraCfg(env_index=0, eye=(0.62, -0.80, 0.85), lookat=(0.0, -0.28, 0.53), focal_length=35.0)],
+ cameras=[TrackingCameraCfg(env_index=0, eye=(0.62, -0.80, 0.85), lookat=(0.0, -0.28, 0.53), focal_length=35.0)],
)
"""Recording view of an environment in the camera tasks' 64-environment play grid."""
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py
index d5bdd587a18e..4a3a60cd6a2f 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py
@@ -37,7 +37,7 @@
from isaaclab.utils import configclass
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, ISAACLAB_NUCLEUS_DIR
from isaaclab.utils.noise import UniformNoiseCfg as Unoise
-from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
+from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -360,7 +360,7 @@ def __post_init__(self):
self.sim.render_interval = self.decimation
self.sim.visualizer_cfgs = VisualizerCfg(
cameras=[
- PerspectiveCameraCfg(
+ TrackingCameraCfg(
eye=(1.8, -3.0, 1.1),
lookat=(0.15, 0.0, 0.0),
focal_length=26.0,
diff --git a/source/isaaclab_visualizers/changelog.d/task-view-kit.changed.rst b/source/isaaclab_visualizers/changelog.d/task-view-kit.changed.rst
deleted file mode 100644
index 8e69c4903fea..000000000000
--- a/source/isaaclab_visualizers/changelog.d/task-view-kit.changed.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-* **Breaking:** Removed ``origin_type``, ``origin_env_index``, and ``origin_track_path`` from
- :class:`~isaaclab_visualizers.kit.KitVisualizerCfg`. Declare a :class:`~isaaclab.visualizers.PerspectiveCameraCfg` with
- ``env_index`` or ``track_path`` first in ``cameras`` instead; the viewport starts on it. Switch at runtime with
- ``KitVisualizer.follow()``, ``unfollow()``, ``set_follow_env()``, and ``set_view_offsets()``, which replace
- ``reapply_origin()`` and ``viewer_origin``.
diff --git a/source/isaaclab_visualizers/changelog.d/task-view-tracking.added.rst b/source/isaaclab_visualizers/changelog.d/task-view-tracking.added.rst
deleted file mode 100644
index b471c431a95e..000000000000
--- a/source/isaaclab_visualizers/changelog.d/task-view-tracking.added.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-* Added task views to the Newton GL visualizer: perspective views tied to an environment or an asset are
- rendered from the viewer camera, listed in **Camera View** as "Tracking Camera" beside the free "Perspective" view,
- and recordable without changing the window's view.
-* Added editable Tracking Camera fields to the Newton GL **Camera View** section: environment, followed asset and
- body, eye, look-at, focal length, heading follow, and heading smoothing, with a reset to what the task declared. An
- unknown asset or ambiguous body is reported and the camera keeps its previous target.
diff --git a/source/isaaclab_visualizers/changelog.d/tracking-camera-kit.changed.rst b/source/isaaclab_visualizers/changelog.d/tracking-camera-kit.changed.rst
new file mode 100644
index 000000000000..5deedecf9a05
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/tracking-camera-kit.changed.rst
@@ -0,0 +1,5 @@
+* **Breaking:** Removed ``origin_type``, ``origin_env_index``, and ``origin_track_path`` from
+ :class:`~isaaclab_visualizers.kit.KitBackendCfg`. Declare a :class:`~isaaclab.visualizers.TrackingCameraCfg` first
+ in ``cameras`` instead; the viewport starts on it. Switch at runtime with ``KitVisualizer.follow()``,
+ ``unfollow()``, ``set_follow_env()``, and ``set_view_offsets()``, which replace ``reapply_origin()`` and
+ ``viewer_origin``.
diff --git a/source/isaaclab_visualizers/changelog.d/task-view-kit.major b/source/isaaclab_visualizers/changelog.d/tracking-camera-kit.major
similarity index 100%
rename from source/isaaclab_visualizers/changelog.d/task-view-kit.major
rename to source/isaaclab_visualizers/changelog.d/tracking-camera-kit.major
diff --git a/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.added.rst b/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.added.rst
new file mode 100644
index 000000000000..ac4d5c735959
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.added.rst
@@ -0,0 +1,3 @@
+* Added tracking camera support to the Newton GL visualizer. **Camera View** lists it as "Tracking Camera" beside the
+ free "Perspective" view, and a Tracking Camera group edits its environment, asset, body, eye, look-at, focal length
+ and heading settings, with a reset to the task's declaration.
diff --git a/source/isaaclab_visualizers/changelog.d/task-view-tracking.minor b/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.minor
similarity index 100%
rename from source/isaaclab_visualizers/changelog.d/task-view-tracking.minor
rename to source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.minor
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
index 9456a7765d22..0b30de2f260d 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
@@ -24,7 +24,7 @@
from isaaclab.visualizers import VisualizerCfg
from isaaclab.visualizers.base_visualizer import BaseVisualizer
from isaaclab.visualizers.camera_follower import CameraFollower
-from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg
+from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg, TrackingCameraCfg
from isaaclab_visualizers.desktop_entry import write_desktop_entry
@@ -83,10 +83,10 @@ def __init__(self, cfg: VisualizerCfg):
self._app_pumped_this_step: bool = False
self._controls_kit_timeline = False
self._owns_kit_timeline = False
- # Task view following state: the viewport camera follows an environment or an asset, or is free
+ # Tracking camera following state: the viewport camera follows an environment or an asset, or is free
self._interactive_scene = None # set from SimulationContext._interactive_scene in initialize()
self._start_cameras: list = []
- self._declared_task_view: PerspectiveCameraCfg | None = None
+ self._declared_tracking_camera: PerspectiveCameraCfg | None = None
self._follow_view: PerspectiveCameraCfg | None = None
self._follower: CameraFollower | None = None
self._follow_env = 0
@@ -469,7 +469,7 @@ def follow(self, track_path: str | None = None, *, env_index: int | None = None)
"""Make the viewport camera frame an environment, or follow an asset in it.
:attr:`~KitVisualizerCfg.eye` and :attr:`~KitVisualizerCfg.lookat` become offsets from the environment
- origin, or from the tracked asset when *track_path* is set. A task view declared in the configuration
+ origin, or from the tracked asset when *track_path* is set. A tracking camera declared in the configuration
supplies the heading behaviour when it follows the same asset.
Args:
@@ -482,9 +482,9 @@ def follow(self, track_path: str | None = None, *, env_index: int | None = None)
if scene is None:
logger.warning("[KitVisualizer] Cannot follow before the scene is registered.")
return
- template = self._declared_task_view
+ template = self._declared_tracking_camera
same_asset = template is not None and template.track_path == track_path
- self._follow_view = PerspectiveCameraCfg(
+ self._follow_view = TrackingCameraCfg(
env_index=self._follow_env,
track_path=track_path,
eye=self.cfg.eye,
@@ -994,17 +994,17 @@ def _restore_env_visibility(self) -> None:
self._point_instancer_invisible_ids_backup.clear()
def _setup_initial_camera_view(self) -> None:
- """Start on the first declared view: a task view follows from the start, any other view is free.
+ """Start on the first declared view: a tracking camera follows from the start, any other view is free.
Called once at the end of :meth:`initialize`. An asset is followed from the first step, because its
state is not available before :meth:`~isaaclab.sim.SimulationContext.reset`.
"""
self._interactive_scene = self._sim.get_scene_data_provider().get_interactive_scene()
- # declaration order, not the order the simulation lists the views in, which puts task views after the free one
+ # declaration order, not the simulation's, which lists tracking cameras after the free view
declared = self.cfg.cameras if self.cfg.cameras is not None else self._start_cameras
views = [camera for camera in declared if isinstance(camera, PerspectiveCameraCfg)]
- self._declared_task_view = next((view for view in views if view.is_task_view), None)
- if views and views[0].is_task_view:
+ self._declared_tracking_camera = next((view for view in views if isinstance(view, TrackingCameraCfg)), None)
+ if views and isinstance(views[0], TrackingCameraCfg):
first = views[0]
self.cfg.eye, self.cfg.lookat, self.cfg.focal_length = first.eye, first.lookat, first.focal_length
self.follow(first.track_path, env_index=first.env_index or 0)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 012a9f32ce57..63458ac58120 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -50,7 +50,7 @@
from isaaclab.utils.math import quat_apply, quat_from_matrix, quat_mul
from isaaclab.visualizers.base_visualizer import BaseVisualizer
from isaaclab.visualizers.camera_follower import CameraFollower
-from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg, WindowCfg
+from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg, TrackingCameraCfg, WindowCfg
from isaaclab_visualizers.desktop_entry import write_desktop_entry
from isaaclab_visualizers.newton.newton_visualization_markers import render_newton_visualization_markers
@@ -520,7 +520,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
raise ValueError("A perspective image view must have exactly one rendering owner.")
view.render = partial(self._capture_view, view)
source = view.cfg.source
- if self._is_task_view(view) and scene is not None:
+ if self._is_tracking_view(view) and scene is not None:
# fail at initialization, not on a frame: a bad env_index or track_path raises here
self._followers[view] = follower = CameraFollower(source, scene)
self._tracking_defaults[view] = {
@@ -534,7 +534,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
}
if self._env_ids is not None and (source.env_index or 0) not in self._env_ids:
logger.warning(
- "[NewtonVisualizer] A task view frames environment %d, which is not among the visible "
+ "[NewtonVisualizer] A tracking camera frames environment %d, which is not among the visible "
"environments %s, so it will show an empty scene.",
source.env_index or 0,
list(self._env_ids),
@@ -614,19 +614,19 @@ def log_mesh(
) # fmt: skip
@staticmethod
- def _is_task_view(view) -> bool:
+ def _is_tracking_view(view) -> bool:
"""Whether *view* is a perspective view tied to an environment or an asset."""
- return isinstance(view.cfg.source, PerspectiveCameraCfg) and view.cfg.source.is_task_view
+ return isinstance(view.cfg.source, TrackingCameraCfg)
def _view_labels(self) -> list[str]:
- """Name the views for the selector: a task view is the Tracking Camera, a free view the Perspective."""
- free = [v for v in self._image_views if v.camera is None and not self._is_task_view(v)]
- tracking = [v for v in self._image_views if self._is_task_view(v)]
+ """Name the views for the selector: "Tracking Camera" for a tracking camera, "Perspective" for a free view."""
+ free = [v for v in self._image_views if v.camera is None and not self._is_tracking_view(v)]
+ tracking = [v for v in self._image_views if self._is_tracking_view(v)]
labels = []
for view in self._image_views:
if view.camera is not None:
labels.append(view.cfg.source)
- elif self._is_task_view(view):
+ elif self._is_tracking_view(view):
labels.append(
"Tracking Camera" if len(tracking) == 1 else f"Tracking Camera {tracking.index(view) + 1}"
)
@@ -655,7 +655,7 @@ def _select_camera(self, index: int) -> None:
camera = self.current_image_view.cfg.source
self.current_image_view.invalidate()
if isinstance(camera, PerspectiveCameraCfg):
- if camera.is_task_view:
+ if isinstance(camera, TrackingCameraCfg):
self._apply_view_pose(self.current_image_view)
else:
self.set_camera_view(camera.eye, camera.lookat)
@@ -943,13 +943,13 @@ def render_rgb_array(self) -> np.ndarray:
)
return self.current_image_view.read_rgb(frame_id)
- def render_task_view_rgb_array(self) -> np.ndarray:
+ def render_tracking_rgb_array(self) -> np.ndarray:
"""Download the first perspective view that is tied to an environment or an asset, whatever the window shows."""
- view = next((v for v in self._image_views if self._is_task_view(v)), None)
+ view = next((v for v in self._image_views if self._is_tracking_view(v)), None)
if view is None:
raise RuntimeError(
"No perspective view is tied to an environment or an asset. Declare "
- "PerspectiveCameraCfg(env_index=..., track_path=...) in the visualizer's cameras."
+ "TrackingCameraCfg(env_index=..., track_path=...) in the visualizer's cameras."
)
return view.read_rgb(self._sim.get_physics_step_count())
@@ -1090,7 +1090,7 @@ def _render_frame(self) -> None:
"""Render one GL frame for the window or an on-demand capture."""
viewer = self._viewer
view = self.current_image_view
- if self._is_task_view(view):
+ if self._is_tracking_view(view):
self._apply_view_pose(view)
viewer.begin_frame(self._sim_time)
try:
diff --git a/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py b/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
index f3e055cc76e0..26a5599aa709 100644
--- a/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
+++ b/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
@@ -377,10 +377,10 @@ def _following_visualizer(monkeypatch, cameras):
return visualizer, poses
-def test_the_viewport_starts_free_unless_the_first_view_is_a_task_view(monkeypatch):
- from isaaclab.visualizers import PerspectiveCameraCfg
+def test_the_viewport_starts_free_unless_the_first_view_is_a_tracking_camera(monkeypatch):
+ from isaaclab.visualizers import PerspectiveCameraCfg, TrackingCameraCfg
- task = PerspectiveCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0))
+ task = TrackingCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0))
free, poses = _following_visualizer(monkeypatch, [PerspectiveCameraCfg(), task])
free._setup_initial_camera_view()
assert not free.following and poses == []
@@ -414,11 +414,11 @@ def test_follow_unfollow_and_the_environment_selection(monkeypatch):
def test_the_declared_order_decides_the_start_view_not_the_order_the_simulation_lists_them(monkeypatch):
- from isaaclab.visualizers import PerspectiveCameraCfg
+ from isaaclab.visualizers import PerspectiveCameraCfg, TrackingCameraCfg
- task = PerspectiveCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0))
+ task = TrackingCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0))
visualizer, poses = _following_visualizer(monkeypatch, [PerspectiveCameraCfg(), task])
- visualizer.cfg.cameras = [task, PerspectiveCameraCfg()] # the simulation puts task views after the free view
+ visualizer.cfg.cameras = [task, PerspectiveCameraCfg()] # the simulation puts tracking cameras after the free view
visualizer._setup_initial_camera_view()
assert visualizer.following and visualizer.follow_env_index == 1
@@ -438,10 +438,10 @@ def test_only_a_followed_asset_is_reapplied_every_step(monkeypatch):
assert len(poses) == 1
-def test_following_applies_the_task_views_lens_to_the_viewport_camera(monkeypatch):
- from isaaclab.visualizers import PerspectiveCameraCfg
+def test_following_applies_the_tracking_cameras_lens_to_the_viewport_camera(monkeypatch):
+ from isaaclab.visualizers import PerspectiveCameraCfg, TrackingCameraCfg
- task = PerspectiveCameraCfg(env_index=0, track_path="robot", focal_length=26.0)
+ task = TrackingCameraCfg(env_index=0, track_path="robot", focal_length=26.0)
visualizer, _ = _following_visualizer(monkeypatch, [task, PerspectiveCameraCfg()])
lenses = []
monkeypatch.setattr(visualizer, "_set_viewport_focal_length", lenses.append)
diff --git a/source/isaaclab_visualizers/test/test_newton_adapter.py b/source/isaaclab_visualizers/test/test_newton_adapter.py
index 74ae5c5d0cad..e83cbf068e95 100644
--- a/source/isaaclab_visualizers/test/test_newton_adapter.py
+++ b/source/isaaclab_visualizers/test/test_newton_adapter.py
@@ -942,7 +942,7 @@ def test_newton_scene_camera_controls_apply_uniformly_to_active_copies(monkeypat
back_frame = back.frame.torch.clone()
assert visualizer.current_image_view.camera is None
assert isinstance(visualizer._image_views[0].cfg.source, PerspectiveCameraCfg)
- # the task's own task view comes after the scene cameras
+ # the task's own tracking camera comes after the scene cameras
assert [view.camera.cfg.prim_path for view in visualizer._image_views[1:] if view.camera is not None] == [
color.cfg.prim_path,
back.cfg.prim_path,
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
similarity index 79%
rename from source/isaaclab_visualizers/test/test_newton_task_views.py
rename to source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
index e9cdc98581b1..ac1dcca481fa 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
@@ -16,7 +16,7 @@
from isaaclab_visualizers.newton.newton_visualizer import NewtonVisualizerBase
from pyglet.math import Vec3
-from isaaclab.visualizers import PerspectiveCameraCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, TrackingCameraCfg
from isaaclab.visualizers.camera_follower import CameraFollower
@@ -56,7 +56,11 @@ def set_camera(pos, pitch, yaw):
get_physics_dt=lambda: 0.1,
)
viz._image_views = list(views)
- viz._followers = {view: CameraFollower(view.cfg.source, _Scene()) for view in views if view.cfg.source.is_task_view}
+ viz._followers = {
+ view: CameraFollower(view.cfg.source, _Scene())
+ for view in views
+ if isinstance(view.cfg.source, TrackingCameraCfg)
+ }
viz.current_image_view = viz._image_views[0]
return viz
@@ -74,8 +78,8 @@ def _view(cfg: PerspectiveCameraCfg) -> _View:
return _View(cfg)
-def test_a_task_view_points_the_viewer_without_changing_the_configured_pose():
- task = _view(PerspectiveCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0), focal_length=24.0))
+def test_a_tracking_camera_points_the_viewer_without_changing_the_configured_pose():
+ task = _view(TrackingCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0), focal_length=24.0))
viz = _visualizer([task])
assert viz._apply_view_pose(task)
camera = viz._viewer.camera
@@ -86,7 +90,7 @@ def test_a_task_view_points_the_viewer_without_changing_the_configured_pose():
def test_capturing_another_view_hands_the_viewer_camera_back():
- free, task = _view(PerspectiveCameraCfg()), _view(PerspectiveCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0)))
+ free, task = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0)))
viz = _visualizer([free, task])
seen = {}
@@ -104,22 +108,22 @@ def capture(output):
assert viz.current_image_view is free and viz._last_render_step == -1
-def test_the_task_view_recording_picks_the_first_tied_view():
+def test_the_tracking_camera_recording_picks_the_first_tied_view():
free = _view(PerspectiveCameraCfg())
- first, second = _view(PerspectiveCameraCfg(track_path="robot")), _view(PerspectiveCameraCfg(env_index=1))
+ first, second = _view(TrackingCameraCfg(track_path="robot")), _view(TrackingCameraCfg(env_index=1))
viz = _visualizer([free, first, second])
viz._sim.get_physics_step_count = lambda: 3
first.read_rgb, second.read_rgb = (lambda step: ("first", step)), (lambda step: ("second", step))
- assert viz.render_task_view_rgb_array() == ("first", 3)
+ assert viz.render_tracking_rgb_array() == ("first", 3)
-def test_the_task_view_recording_reports_a_visualizer_without_one():
+def test_the_tracking_camera_recording_reports_a_visualizer_without_one():
with pytest.raises(RuntimeError, match="tied to an environment or an asset"):
- _visualizer([_view(PerspectiveCameraCfg())]).render_task_view_rgb_array()
+ _visualizer([_view(PerspectiveCameraCfg())]).render_tracking_rgb_array()
-def test_a_task_view_without_a_follower_has_no_pose_instead_of_failing():
- task = _view(PerspectiveCameraCfg(env_index=1))
+def test_a_tracking_camera_without_a_follower_has_no_pose_instead_of_failing():
+ task = _view(TrackingCameraCfg(env_index=1))
viz = _visualizer([task])
viz._followers.clear() # no interactive scene was registered when the viewer initialized
assert not viz._apply_view_pose(task)
@@ -127,16 +131,16 @@ def test_a_task_view_without_a_follower_has_no_pose_instead_of_failing():
def test_the_selector_names_the_tracking_camera_and_the_free_perspective():
sensor = SimpleNamespace(camera=object(), cfg=SimpleNamespace(source="/World/envs/env_0/cam"))
- viz = _visualizer([_view(PerspectiveCameraCfg()), _view(PerspectiveCameraCfg(env_index=1))])
+ viz = _visualizer([_view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=1))])
viz._image_views.append(sensor)
assert viz._view_labels() == ["Perspective", "Tracking Camera", "/World/envs/env_0/cam"]
- viz = _visualizer([_view(PerspectiveCameraCfg(env_index=0)), _view(PerspectiveCameraCfg(track_path="robot"))])
+ viz = _visualizer([_view(TrackingCameraCfg(env_index=0)), _view(TrackingCameraCfg(track_path="robot"))])
assert viz._view_labels() == ["Tracking Camera 1", "Tracking Camera 2"]
def test_resetting_the_tracking_camera_restores_what_the_task_declared():
- task = _view(PerspectiveCameraCfg(env_index=0, eye=(1.0, 0.0, 0.0), track_path="robot", follow_heading=True))
+ task = _view(TrackingCameraCfg(env_index=0, eye=(1.0, 0.0, 0.0), track_path="robot", follow_heading=True))
viz = _visualizer([task])
cfg, follower = task.cfg.source, viz._followers[task]
viz._tracking_defaults = {
@@ -154,7 +158,7 @@ def test_resetting_the_tracking_camera_restores_what_the_task_declared():
def test_an_unknown_asset_is_reported_and_the_camera_keeps_following_its_target():
- task = _view(PerspectiveCameraCfg(env_index=0, track_path="robot"))
+ task = _view(TrackingCameraCfg(env_index=0, track_path="robot"))
viz = _visualizer([task])
viz._tracking_error = ""
follower = viz._followers[task]
From 70e1a8cbfcac75206fba616f160f795b476ea74b Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Tue, 27 Oct 2026 22:48:11 +0000
Subject: [PATCH 017/140] Default the tracking camera to the middle environment
env_index is now optional. None picks the middle of the visible environments,
so the view has neighbors on every side, and the tasks no longer repeat env 0.
---
.../visualizer_streaming_camera_view.rst | 2 +-
.../isaaclab/visualizers/camera_follower.py | 16 ++++++++++++++--
.../isaaclab/visualizers/visualizer_cfg.py | 7 ++++---
.../test/visualizers/test_camera_follower.py | 10 ++++++++++
.../contrib/franka_pour/pour_env_cfg.py | 2 +-
.../ur10_particle_push_env_cfg.py | 2 +-
.../core/cabinet/cabinet_env_cfg.py | 1 -
.../core/cartpole/cartpole_direct_env_cfg.py | 1 -
.../core/cartpole/cartpole_manager_env_cfg.py | 1 -
.../fourbar_pole_manager_env_cfg.py | 1 -
.../core/handover/handover_common.py | 2 +-
.../config/franka_soft/franka_soft_env_cfg.py | 2 +-
.../isaaclab_tasks/core/lift/lift_env_cfg.py | 1 -
.../core/pendulum/pendulum_marl_env_cfg.py | 1 -
.../isaaclab_tasks/core/reach/reach_env_cfg.py | 1 -
.../isaaclab_tasks/core/reorient/utils.py | 4 ++--
.../isaaclab_visualizers/kit/kit_visualizer.py | 18 +++++++++++-------
.../newton/newton_visualizer.py | 6 +++---
18 files changed, 49 insertions(+), 29 deletions(-)
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index 69731381ed30..fa06ef04b8f9 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -269,7 +269,7 @@ viewport's markers and shadows.
],
)
-* ``env_index``: the environment to frame or follow; defaults to 0.
+* ``env_index``: the environment to frame or follow; defaults to the middle one, which has neighbors on every side.
* ``track_path``: a scene asset (``"robot"``) or one of its bodies (``"robot/base"``). Without it, the view stays
fixed in the environment.
* ``follow_heading``: rotate the offsets with the asset's yaw, keeping the horizon level.
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
index f1fda4cfe948..e5ed70019a9a 100644
--- a/source/isaaclab/isaaclab/visualizers/camera_follower.py
+++ b/source/isaaclab/isaaclab/visualizers/camera_follower.py
@@ -8,6 +8,7 @@
from __future__ import annotations
import math
+from collections.abc import Sequence
from typing import TYPE_CHECKING
import torch
@@ -33,14 +34,25 @@ class CameraFollower:
asset's position, and its yaw when ``follow_heading`` is set, with the heading filtered over time.
"""
- def __init__(self, cfg: TrackingCameraCfg, scene: InteractiveScene) -> None:
+ def __init__(self, cfg: TrackingCameraCfg, scene: InteractiveScene, env_ids: Sequence[int] | None = None) -> None:
+ """Bind *cfg* to *scene*.
+
+ Args:
+ cfg: The tracking camera. Its ``env_index`` None selects the middle environment.
+ scene: The scene to read environment origins and assets from.
+ env_ids: The visible environments, or None when all are; the middle one is picked from these.
+ """
self.cfg = cfg
self._scene = scene
self._env = 0
self._yaw: float | None = None
self._last_position: list[float] | None = None
self._time: float | None = None
- self.set_env(cfg.env_index)
+ if cfg.env_index is not None:
+ self.set_env(cfg.env_index)
+ else:
+ ids = list(env_ids) if env_ids else range(scene.num_envs)
+ self.set_env(ids[(len(ids) - 1) // 2])
self._asset = None
self._body_index: int | None = None
self._body_name = ""
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index 4d23ee2fb61b..a5ccd996c2d9 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -78,8 +78,9 @@ class TrackingCameraCfg(PerspectiveCameraCfg):
lookat: tuple[float, float, float] = (0.0, 0.0, 0.0)
"""Look-at target [m], in the same frame as :attr:`eye`."""
- env_index: int = 0
- """Environment to frame, or the one holding the tracked asset."""
+ env_index: int | None = None
+ """Environment to frame, or the one holding the tracked asset; None picks the middle one of the visible
+ environments, which has neighbors on every side."""
track_path: str | None = None
"""Scene asset to follow, or None for a view fixed relative to the environment origin.
@@ -100,7 +101,7 @@ class TrackingCameraCfg(PerspectiveCameraCfg):
"""
def __post_init__(self) -> None:
- if self.env_index < 0:
+ if self.env_index is not None and self.env_index < 0:
raise ValueError("env_index must be non-negative.")
if not math.isfinite(self.heading_smoothing_time_constant) or self.heading_smoothing_time_constant < 0.0:
raise ValueError("heading_smoothing_time_constant must be finite and non-negative.")
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
index 88dc48c7c1c7..35802b829ab4 100644
--- a/source/isaaclab/test/visualizers/test_camera_follower.py
+++ b/source/isaaclab/test/visualizers/test_camera_follower.py
@@ -192,3 +192,13 @@ def test_two_updates_a_millisecond_apart_are_not_mistaken_for_an_environment_res
follower._yaw = 0.0
follower._last_position = [0.0, 0.0, 0.5]
assert follower._filtered_yaw([0.0, 0.0, 0.0099995, 0.99995], [0.0, 0.0, 0.5], 0.001) < 0.02
+
+
+def test_without_an_env_index_the_middle_visible_environment_is_followed():
+ class _Many(_Scene):
+ num_envs = 256
+ env_origins = torch.zeros(256, 3)
+
+ assert CameraFollower(TrackingCameraCfg(), _Many()).env == 127
+ assert CameraFollower(TrackingCameraCfg(), _Many(), env_ids=[3, 10, 40]).env == 10
+ assert CameraFollower(TrackingCameraCfg(env_index=5), _Many()).env == 5
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
index b111b174a8dd..60ed668b6ae0 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
@@ -532,7 +532,7 @@ class FrankaPourResetDatasetEnvCfg(ManagerBasedRLEnvCfg):
sim: sim_utils.SimulationCfg = sim_utils.SimulationCfg(
# the viewport starts on the first view, framing environment 0; a free view follows it
visualizer_cfgs=VisualizerCfg(
- cameras=[TrackingCameraCfg(env_index=0, eye=(1.4, 1.4, 0.9), lookat=(0.5, 0.0, 0.1))],
+ cameras=[TrackingCameraCfg(eye=(1.4, 1.4, 0.9), lookat=(0.5, 0.0, 0.1))],
)
)
observations: ResetDatasetObservationsCfg = ResetDatasetObservationsCfg()
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
index 3f591e4fda68..ab8dc1b2184a 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
@@ -616,7 +616,7 @@ class UR10ParticlePushEnvCfg(ManagerBasedRLEnvCfg):
render_interval=decimation,
# the viewport starts on the first view, framing environment 0; a free view follows it
visualizer_cfgs=VisualizerCfg(
- cameras=[TrackingCameraCfg(env_index=0, eye=(1.7, 1.5, 1.0), lookat=(0.55, 0.0, 0.0))],
+ cameras=[TrackingCameraCfg(eye=(1.7, 1.5, 1.0), lookat=(0.55, 0.0, 0.0))],
),
)
actions: ActionsCfg = ActionsCfg()
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py
index 3ea152ea4a50..3280f52fb801 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py
@@ -113,7 +113,6 @@ class CabinetSimCfg(PresetCfg):
lookat=(0.8, 0.0, 0.5),
cameras=[
TrackingCameraCfg(
- env_index=0,
eye=(-1.8, 2.0, 1.6),
lookat=(0.55, 0.0, 0.5),
focal_length=28.0,
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py
index 4f0149673a3f..01e01bcfdb39 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py
@@ -74,7 +74,6 @@ def __post_init__(self):
eye=(8.0, 0.0, 5.0),
cameras=[
TrackingCameraCfg(
- env_index=0,
eye=(8.0, 0.0, 2.5),
lookat=(0.0, 0.0, 2.5),
focal_length=24.0,
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py
index 51be97f26892..ed2242fbb67d 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py
@@ -185,7 +185,6 @@ def __post_init__(self):
eye=(8.0, 0.0, 5.0),
cameras=[
TrackingCameraCfg(
- env_index=0,
eye=(8.0, 0.0, 2.5),
lookat=(0.0, 0.0, 2.5),
focal_length=24.0,
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
index e57b2f80a156..5ecf45e81353 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
@@ -244,7 +244,6 @@ def __post_init__(self) -> None:
eye=(12.0, 0.0, 4.0),
cameras=[
TrackingCameraCfg(
- env_index=0,
eye=(4.5, 0.0, 1.8),
lookat=(0.0, 0.0, 1.8),
focal_length=24.0,
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py b/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py
index c9abd4fdb76c..75fc56fe7f8e 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py
@@ -39,7 +39,7 @@
eye=(2.35, -0.5, 1.1),
lookat=(0.75, -0.5, 0.55),
focal_length=35.0,
- cameras=[TrackingCameraCfg(env_index=0, eye=(1.15, -1.65, 1.15), lookat=(0.0, -0.5, 0.55), focal_length=35.0)],
+ cameras=[TrackingCameraCfg(eye=(1.15, -1.65, 1.15), lookat=(0.0, -0.5, 0.55), focal_length=35.0)],
)
"""Recording view facing one hand pair from the side, with both hands and the object between them."""
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py
index 5459469fdb12..75f8a9c46657 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py
@@ -636,7 +636,7 @@ def __post_init__(self):
self.sim.visualizer_cfgs = VisualizerCfg(
eye=(0.75, 0.25, 0.65),
lookat=(0.0, 0.75, 0.4),
- cameras=[TrackingCameraCfg(env_index=0, eye=(1.8, -1.8, 1.5), lookat=(0.35, 0.0, 0.35), focal_length=28.0)],
+ cameras=[TrackingCameraCfg(eye=(1.8, -1.8, 1.5), lookat=(0.35, 0.0, 0.35), focal_length=28.0)],
)
def play_mode(self):
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py
index 2acf3931b9d7..523d2c559eaf 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py
@@ -568,7 +568,6 @@ def __post_init__(self):
lookat=(0.0, 0.0, 0.45),
cameras=[
TrackingCameraCfg(
- env_index=0,
eye=(-1.8, -1.8, 1.45),
lookat=(-0.3, 0.0, 0.45),
focal_length=28.0,
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py
index 0b25e54d9889..75b4ceed6bf1 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py
@@ -84,7 +84,6 @@ class PendulumMARLEnvCfg(DirectMARLEnvCfg):
visualizer_cfgs=VisualizerCfg(
cameras=[
TrackingCameraCfg(
- env_index=0,
eye=(8.0, 0.0, 2.3),
lookat=(0.0, 0.0, 2.3),
focal_length=24.0,
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py
index be82505ff58a..4f3e6bfb81f4 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py
@@ -252,7 +252,6 @@ def __post_init__(self):
eye=(3.5, 3.5, 3.5),
cameras=[
TrackingCameraCfg(
- env_index=0,
eye=(1.8, -1.8, 1.5),
lookat=(0.3, 0.0, 0.4),
focal_length=28.0,
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py
index b038c9a807c5..92b11eb96a24 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py
@@ -32,7 +32,7 @@
eye=(0.995, -0.80, 0.85),
lookat=(0.375, -0.28, 0.53),
focal_length=35.0,
- cameras=[TrackingCameraCfg(env_index=0, eye=(0.62, -0.80, 0.85), lookat=(0.0, -0.28, 0.53), focal_length=35.0)],
+ cameras=[TrackingCameraCfg(eye=(0.62, -0.80, 0.85), lookat=(0.0, -0.28, 0.53), focal_length=35.0)],
)
"""Recording view of an environment in the 50-environment play grid."""
@@ -40,7 +40,7 @@
eye=(1.62, -1.80, 0.85),
lookat=(1.0, -1.28, 0.53),
focal_length=35.0,
- cameras=[TrackingCameraCfg(env_index=0, eye=(0.62, -0.80, 0.85), lookat=(0.0, -0.28, 0.53), focal_length=35.0)],
+ cameras=[TrackingCameraCfg(eye=(0.62, -0.80, 0.85), lookat=(0.0, -0.28, 0.53), focal_length=35.0)],
)
"""Recording view of an environment in the camera tasks' 64-environment play grid."""
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
index 0b30de2f260d..a80f64f648d0 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
@@ -89,7 +89,7 @@ def __init__(self, cfg: VisualizerCfg):
self._declared_tracking_camera: PerspectiveCameraCfg | None = None
self._follow_view: PerspectiveCameraCfg | None = None
self._follower: CameraFollower | None = None
- self._follow_env = 0
+ self._follow_env: int | None = None
# ---- Lifecycle ------------------------------------------------------------------------
@@ -463,18 +463,21 @@ def following(self) -> bool:
@property
def follow_env_index(self) -> int:
"""Environment the viewport camera follows, or would follow when asked to."""
+ if self._follow_env is None:
+ scene = self._interactive_scene
+ return 0 if scene is None else (scene.num_envs - 1) // 2
return self._follow_env
def follow(self, track_path: str | None = None, *, env_index: int | None = None) -> None:
"""Make the viewport camera frame an environment, or follow an asset in it.
- :attr:`~KitVisualizerCfg.eye` and :attr:`~KitVisualizerCfg.lookat` become offsets from the environment
- origin, or from the tracked asset when *track_path* is set. A tracking camera declared in the configuration
- supplies the heading behaviour when it follows the same asset.
+ The configuration's ``eye`` and ``lookat`` become offsets from the environment origin, or from the tracked
+ asset when *track_path* is set. A tracking camera declared in the configuration supplies the heading
+ behaviour when it follows the same asset.
Args:
track_path: ``""`` or ``"/"``, or None to frame the environment's origin.
- env_index: Environment to follow; None keeps the one last chosen, 0 at first.
+ env_index: Environment to follow; None keeps the one last chosen, the middle one at first.
"""
if env_index is not None:
self._follow_env = int(env_index)
@@ -493,7 +496,8 @@ def follow(self, track_path: str | None = None, *, env_index: int | None = None)
follow_heading=same_asset and template.follow_heading,
heading_smoothing_time_constant=template.heading_smoothing_time_constant if same_asset else 0.0,
)
- self._follower = CameraFollower(self._follow_view, scene)
+ self._follower = CameraFollower(self._follow_view, scene, self._env_ids)
+ self._follow_env = self._follower.env
self._set_viewport_focal_length(self._follow_view.focal_length)
self._update_follow_camera()
@@ -1007,7 +1011,7 @@ def _setup_initial_camera_view(self) -> None:
if views and isinstance(views[0], TrackingCameraCfg):
first = views[0]
self.cfg.eye, self.cfg.lookat, self.cfg.focal_length = first.eye, first.lookat, first.focal_length
- self.follow(first.track_path, env_index=first.env_index or 0)
+ self.follow(first.track_path, env_index=first.env_index)
def _update_asset_follow_camera(self) -> None:
"""Re-apply the pose every step while an asset is followed; a fixed environment view is left movable."""
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 63458ac58120..f574ef1423dc 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -522,7 +522,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
source = view.cfg.source
if self._is_tracking_view(view) and scene is not None:
# fail at initialization, not on a frame: a bad env_index or track_path raises here
- self._followers[view] = follower = CameraFollower(source, scene)
+ self._followers[view] = follower = CameraFollower(source, scene, self._env_ids)
self._tracking_defaults[view] = {
"eye": source.eye,
"lookat": source.lookat,
@@ -532,11 +532,11 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
"heading_smoothing_time_constant": source.heading_smoothing_time_constant,
"env": follower.env,
}
- if self._env_ids is not None and (source.env_index or 0) not in self._env_ids:
+ if self._env_ids is not None and follower.env not in self._env_ids:
logger.warning(
"[NewtonVisualizer] A tracking camera frames environment %d, which is not among the visible "
"environments %s, so it will show an empty scene.",
- source.env_index or 0,
+ follower.env,
list(self._env_ids),
)
self._runtime_headless = self.cfg.headless or (
From a66e2f839e1a2017c4b5e352be55da6e112fc860 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 28 Oct 2026 00:15:14 +0000
Subject: [PATCH 018/140] Remove tracking camera support from the Kit
visualizer
---
docs/source/concepts/visualization.rst | 4 +-
.../visualizer_streaming_camera_view.rst | 5 +-
docs/source/isaaclab/migrating.rst | 22 +-
.../tracking-camera-kit.changed.rst | 3 -
source/isaaclab/isaaclab/envs/common.py | 45 ++---
.../isaaclab/envs/ui/base_env_window.py | 40 +++-
.../envs/ui/viewport_camera_controller.py | 66 +++---
.../test/envs/test_viewer_cfg_deprecation.py | 14 +-
.../tracking-camera-kit.changed.rst | 2 -
.../changelog.d/tracking-camera-kit.minor | 0
.../tracking-camera-kit.changed.rst | 5 -
.../changelog.d/tracking-camera-kit.major | 0
.../kit/kit_visualizer.py | 188 +++++++-----------
.../kit/kit_visualizer_cfg.py | 29 +++
.../test_kit_visualizer_scene_partitioning.py | 102 +---------
15 files changed, 215 insertions(+), 310 deletions(-)
delete mode 100644 source/isaaclab/changelog.d/tracking-camera-kit.changed.rst
delete mode 100644 source/isaaclab_tasks/changelog.d/tracking-camera-kit.changed.rst
delete mode 100644 source/isaaclab_tasks/changelog.d/tracking-camera-kit.minor
delete mode 100644 source/isaaclab_visualizers/changelog.d/tracking-camera-kit.changed.rst
delete mode 100644 source/isaaclab_visualizers/changelog.d/tracking-camera-kit.major
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index 02a76116a6ce..ae104ceee0a2 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -567,8 +567,8 @@ task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton G
Rerun, and Viser visualizers. **Kit** opens it as a separate **Streaming View** viewport, which can
sit side by side with the default viewport for dual monitoring. **Newton GL** and **Newton RTX**
provide a **Camera View** selector in the sidebar for switching between perspective and scene-camera
-views. A perspective view can also be a *tracking camera* that follows a robot or frames an environment; Newton GL and Kit
-support it.
+views. A perspective view can also be a *tracking camera* that follows a robot or frames an environment; only Newton GL
+supports it.
See :doc:`/source/how-to/visualizer_streaming_camera_view` for the ``VisualizerCfg`` options, display
sources, tracking cameras that follow a robot, troubleshooting, migration from generated cameras, and step-by-step examples.
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index fa06ef04b8f9..89e93d67eb9b 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -282,10 +282,7 @@ interactive camera stays free.
**Tracking Camera** group edits its environment, asset, body, eye, look-at, focal length and heading settings
while it runs; **Reset to Task Default** restores the declaration. Record it with
``--video viz:newton_gl:tracking``, whichever view the window shows.
-* **Kit:** the viewport starts on the first declared view when it is a tracking camera, and follows it until
- ``KitVisualizer.unfollow()`` or the **Follow Mode** control in the environment window. An environment view can
- still be moved; an asset view is re-applied every step.
-* **Newton RTX**, **Viser** and **Rerun** ignore tracking cameras.
+* **Kit**, **Newton RTX**, **Viser** and **Rerun** ignore tracking cameras.
Examples
diff --git a/docs/source/isaaclab/migrating.rst b/docs/source/isaaclab/migrating.rst
index 4d84dc0bde5f..51b38ed2d400 100644
--- a/docs/source/isaaclab/migrating.rst
+++ b/docs/source/isaaclab/migrating.rst
@@ -2689,10 +2689,9 @@ on the sim config instead.
Similarly, :class:`~isaaclab.envs.ui.ViewportCameraController` is deprecated. A shim class
remains so existing imports do not break, but it raises a :class:`DeprecationWarning` at
-construction. Camera tracking is now a :class:`~isaaclab.visualizers.TrackingCameraCfg` in the ``cameras`` of
-:class:`~isaaclab.visualizers.VisualizerCfg`.
-The ``origin_type``, ``origin_env_index``, and ``origin_track_path`` fields of
-:class:`~isaaclab_visualizers.kit.KitBackendCfg` are removed.
+construction. Camera tracking is now handled directly by
+:class:`~isaaclab_visualizers.kit.KitVisualizer` via ``origin_type`` and
+``origin_track_path`` on :class:`~isaaclab_visualizers.kit.KitBackendCfg`.
.. code-block:: python
@@ -2705,8 +2704,9 @@ The ``origin_type``, ``origin_env_index``, and ``origin_track_path`` fields of
env_cfg.sim.visualizer_cfgs = VisualizerCfg(eye=(4.5, 0.0, 6.0), lookat=(0.0, 0.0, 2.0))
-For asset-body tracking (previously ``origin_type="asset_root"`` / ``"asset_body"``), declare a tracking camera
-with ``track_path`` in :class:`~isaaclab.visualizers.VisualizerCfg` ``cameras``; a free view is added beside it:
+For asset-body tracking (previously ``origin_type="asset_root"`` / ``"asset_body"``), use
+:class:`~isaaclab_visualizers.kit.KitBackendCfg` with ``origin_type="asset"`` and
+``origin_track_path``:
.. code-block:: python
@@ -2717,14 +2717,16 @@ with ``track_path`` in :class:`~isaaclab.visualizers.VisualizerCfg` ``cameras``;
env_cfg.viewer.asset_name = "robot"
# After (Isaac Lab 3.x)
- from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+ from isaaclab_visualizers.kit import KitBackendCfg
+
+ from isaaclab_tasks.utils.presets import MultiBackendVisualizerCfg
env_cfg.sim.visualizer_cfgs = VisualizerCfg(
- cameras=[TrackingCameraCfg(track_path="robot", eye=(4.0, 4.0, 2.0))],
+ backend=MultiBackendVisualizerCfg(kit=KitBackendCfg(origin_type="asset", origin_track_path="robot")),
) # visualizer=kit
-At runtime, :class:`~isaaclab_visualizers.kit.KitVisualizer` switches with ``follow()`` and ``unfollow()``, or the
-**Follow Mode** control of the environment window.
+The :class:`~isaaclab.envs.ui.ViewportCameraController` class is also deprecated; camera
+tracking is handled directly by :class:`~isaaclab_visualizers.kit.KitVisualizer`.
Custom visualizers receive their owning ``sim`` and bound ``cameras`` in ``initialize()``.
diff --git a/source/isaaclab/changelog.d/tracking-camera-kit.changed.rst b/source/isaaclab/changelog.d/tracking-camera-kit.changed.rst
deleted file mode 100644
index c03b5b8f702d..000000000000
--- a/source/isaaclab/changelog.d/tracking-camera-kit.changed.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-* Changed the Kit environment window controls, the deprecated ``viewer`` bridge, and the deprecated
- ``ViewportCameraController`` to use Kit's tracking camera instead of the removed ``KitBackendCfg`` ``origin_*``
- fields.
diff --git a/source/isaaclab/isaaclab/envs/common.py b/source/isaaclab/isaaclab/envs/common.py
index d5ef7693a85e..4bf55047f7ad 100644
--- a/source/isaaclab/isaaclab/envs/common.py
+++ b/source/isaaclab/isaaclab/envs/common.py
@@ -11,9 +11,10 @@
import gymnasium as gym
import torch
+from isaaclab_visualizers.kit import KitBackendCfg
from ..utils import configclass
-from ..visualizers import PerspectiveCameraCfg, TrackingCameraCfg, VisualizerCfg
+from ..visualizers import VisualizerCfg
##
# Deprecated: ViewerCfg
@@ -79,49 +80,27 @@ def __post_init__(self) -> None:
def _apply_deprecated_viewer_cfg(env_cfg: object) -> None:
- """Forward the deprecated viewport declaration to configured visualizers before scene creation.
-
- A viewer tied to an environment or an asset becomes a tracking camera,
- :class:`~isaaclab.visualizers.PerspectiveCameraCfg` with ``env_index`` or ``track_path``, followed by a free view,
- so the viewport starts on it. Other viewers set ``eye`` and ``lookat`` on the visualizer.
- """
+ """Forward the deprecated viewport declaration to configured visualizers before scene creation."""
viewer = env_cfg.viewer
if viewer == ViewerCfg():
return
configs = env_cfg.sim.visualizer_cfgs
configs = configs if isinstance(configs, list) else [configs]
defaults = VisualizerCfg()
- track_path = None
- if viewer.origin_type in ("asset_root", "asset_body") and viewer.asset_name is not None:
- track_path = (
- f"{viewer.asset_name}/{viewer.body_name}"
- if viewer.origin_type == "asset_body" and viewer.body_name is not None
- else viewer.asset_name
- )
- tied = viewer.origin_type == "env" or track_path is not None
for cfg in configs:
# A deliberately configured common view takes precedence over the deprecated declaration.
if (cfg.eye, cfg.lookat, cfg.window) != (defaults.eye, defaults.lookat, defaults.window):
continue
+ cfg.eye, cfg.lookat = tuple(viewer.eye), tuple(viewer.lookat)
cfg.window.size = tuple(viewer.resolution)
- if tied:
- if cfg.cameras is not None:
- warnings.warn(
- "env_cfg.viewer tracks an environment or an asset, but the visualizer already declares "
- "cameras, so the viewer's tracking and offsets are not applied. Declare a "
- "PerspectiveCameraCfg with env_index or track_path in VisualizerCfg.cameras instead.",
- stacklevel=2,
- )
- else:
- view = TrackingCameraCfg(
- env_index=viewer.env_index,
- track_path=track_path,
- eye=tuple(viewer.eye),
- lookat=tuple(viewer.lookat),
- )
- cfg.cameras = [view, PerspectiveCameraCfg()]
- else:
- cfg.eye, cfg.lookat = tuple(viewer.eye), tuple(viewer.lookat)
+ if isinstance(cfg.backend, KitBackendCfg):
+ cfg.backend.origin_env_index = viewer.env_index
+ cfg.backend.origin_type = viewer.origin_type
+ if viewer.origin_type in ("asset_root", "asset_body"):
+ cfg.backend.origin_type = "asset"
+ cfg.backend.origin_track_path = viewer.asset_name
+ if viewer.origin_type == "asset_body" and viewer.body_name is not None:
+ cfg.backend.origin_track_path = f"{viewer.asset_name}/{viewer.body_name}"
##
diff --git a/source/isaaclab/isaaclab/envs/ui/base_env_window.py b/source/isaaclab/isaaclab/envs/ui/base_env_window.py
index 43b43dbdc1cf..8b4b095d71c3 100644
--- a/source/isaaclab/isaaclab/envs/ui/base_env_window.py
+++ b/source/isaaclab/isaaclab/envs/ui/base_env_window.py
@@ -212,7 +212,7 @@ def _build_viewer_frame(self):
viewport_origin_cfg = {
"label": "Environment Index",
"type": "button",
- "default_val": (_viz.follow_env_index if _viz is not None else 0) + 1,
+ "default_val": (_viz.cfg.backend.origin_env_index if _viz is not None else 0) + 1,
"min": 1,
"max": self.env.num_envs,
"tooltip": "The environment index to follow. Only effective if follow mode is not 'World'.",
@@ -416,35 +416,57 @@ def _get_kit_visualizer(self):
return None
def _set_viewer_origin_type_fn(self, value: str):
- """Sets what the viewport's camera follows. This is based on the drop-down menu in the UI."""
+ """Sets the origin of the viewport's camera. This is based on the drop-down menu in the UI."""
viz = self._get_kit_visualizer()
if viz is None:
return
if value == "World":
- viz.unfollow()
+ viz.cfg.backend.origin_type = "world"
elif value == "Env":
- viz.follow(None)
+ viz.cfg.backend.origin_type = "env"
else:
fancy_names = [name.replace("_", " ").title() for name in self._viewer_assets_options]
- viz.follow(self._viewer_assets_options[fancy_names.index(value)])
+ viewer_asset_name = self._viewer_assets_options[fancy_names.index(value)]
+ viz.cfg.backend.origin_type = "asset"
+ viz.cfg.backend.origin_track_path = viewer_asset_name
+
+ # Reposition the viewport camera immediately so the new origin is reflected
+ # without waiting for the next env.step() call.
+ viz.reapply_origin()
def _set_viewer_location_fn(self, model: omni.ui.SimpleFloatModel):
- """Sets the viewport camera location based on the UI: offsets while following, world coordinates if free."""
+ """Sets the viewport camera location based on the UI."""
viz = self._get_kit_visualizer()
if viz is None:
return
eye = [self.ui_window_elements["viewer_eye"][i].get_value_as_float() for i in range(3)]
lookat = [self.ui_window_elements["viewer_lookat"][i].get_value_as_float() for i in range(3)]
- viz.set_view_offsets(eye, lookat)
+ viz.set_camera_view(eye, lookat)
+
+ # Persist the slider values back to cfg so that asset-tracking steps do not
+ # snap the camera back to the previously configured offsets.
+ origin = viz.viewer_origin
+ if origin is not None:
+ origin_np = origin.detach().cpu().numpy()
+ viz.cfg.eye = tuple(float(e - o) for e, o in zip(eye, origin_np))
+ viz.cfg.lookat = tuple(float(lk - o) for lk, o in zip(lookat, origin_np))
+ else:
+ viz.cfg.eye = tuple(float(v) for v in eye)
+ viz.cfg.lookat = tuple(float(v) for v in lookat)
def _set_viewer_env_index_fn(self, model: omni.ui.SimpleIntModel):
- """Sets the environment the viewport camera follows."""
+ """Sets the environment index and updates the camera if in 'env' origin mode."""
viz = self._get_kit_visualizer()
env_index = model.as_int - 1
if viz is not None:
- viz.set_follow_env(env_index)
+ viz.cfg.backend.origin_env_index = env_index
+ # For "env" origin the camera must be repositioned immediately; for asset-tracking
+ # origins reapply_origin() defers the update to the next step() call (asset state
+ # is needed to compute the new position).
+ if viz.cfg.backend.origin_type == "env":
+ viz.reapply_origin()
# notify additional listeners
for listener in self._ui_listeners:
listener.set_env_selection(env_index)
diff --git a/source/isaaclab/isaaclab/envs/ui/viewport_camera_controller.py b/source/isaaclab/isaaclab/envs/ui/viewport_camera_controller.py
index a52a1ed1e464..15413d7d66df 100644
--- a/source/isaaclab/isaaclab/envs/ui/viewport_camera_controller.py
+++ b/source/isaaclab/isaaclab/envs/ui/viewport_camera_controller.py
@@ -6,9 +6,8 @@
"""Deprecated: ViewportCameraController compatibility shim.
Camera tracking is now built into :class:`~isaaclab_visualizers.kit.KitVisualizer`.
-Declare a :class:`~isaaclab.visualizers.PerspectiveCameraCfg` with ``env_index`` or ``track_path`` in the
-``cameras`` of :class:`~isaaclab.visualizers.VisualizerCfg`, and add it to
-:attr:`~isaaclab.sim.SimulationCfg.visualizer_cfgs`.
+Configure ``eye`` and ``lookat`` on :class:`~isaaclab.visualizers.VisualizerCfg`, and
+``origin_type`` and ``origin_track_path`` on its :class:`~isaaclab_visualizers.kit.KitBackendCfg` backend.
"""
from __future__ import annotations
@@ -17,6 +16,7 @@
from typing import TYPE_CHECKING
import numpy as np
+import torch
if TYPE_CHECKING:
from .. import ViewerCfg
@@ -25,8 +25,8 @@
def _warn_method(name: str) -> None:
warnings.warn(
f"ViewportCameraController.{name}() is deprecated. "
- "Declare a PerspectiveCameraCfg with env_index or track_path in VisualizerCfg.cameras, and call "
- "visualizer.follow() or visualizer.unfollow() to change it at runtime.",
+ "Set eye/lookat on VisualizerCfg and origin_type/origin_track_path on its KitBackendCfg backend; "
+ "call visualizer.reapply_origin() to update at runtime.",
DeprecationWarning,
stacklevel=3,
)
@@ -37,17 +37,16 @@ class ViewportCameraController:
.. deprecated::
:class:`ViewportCameraController` has been removed. Camera tracking is now built into
- :class:`~isaaclab_visualizers.kit.KitVisualizer`. Declare a
- :class:`~isaaclab.visualizers.PerspectiveCameraCfg` with ``env_index`` or ``track_path`` in
- :class:`~isaaclab.visualizers.VisualizerCfg` ``cameras`` and pass it to
- :attr:`~isaaclab.sim.SimulationCfg.visualizer_cfgs`.
+ :class:`~isaaclab_visualizers.kit.KitVisualizer`. Set ``eye`` and ``lookat`` on
+ :class:`~isaaclab.visualizers.VisualizerCfg`, and ``origin_type`` and ``origin_track_path``
+ on its :class:`~isaaclab_visualizers.kit.KitBackendCfg` backend.
"""
def __init__(self, env: object, cfg: ViewerCfg):
warnings.warn(
"ViewportCameraController is deprecated and has been removed. "
- "Camera tracking is now built into KitVisualizer: declare a PerspectiveCameraCfg with "
- "env_index or track_path in VisualizerCfg.cameras and add it to SimulationCfg.visualizer_cfgs.",
+ "Camera tracking is now built into KitVisualizer — configure "
+ "eye/lookat on VisualizerCfg and origin_type/origin_track_path on its KitBackendCfg backend.",
DeprecationWarning,
stacklevel=2,
)
@@ -69,7 +68,7 @@ def cfg(self) -> ViewerCfg:
# ------------------------------------------------------------------
def set_view_env_index(self, env_index: int) -> None:
- """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.set_follow_env` instead."""
+ """Deprecated. Update :attr:`~KitBackendCfg.origin_env_index` on the visualizer instead."""
_warn_method("set_view_env_index")
num_envs = getattr(self._env, "num_envs", None)
if num_envs is not None and not (0 <= env_index < num_envs):
@@ -79,53 +78,72 @@ def set_view_env_index(self, env_index: int) -> None:
)
self._cfg.env_index = env_index
for viz in self._get_kit_visualizers():
- viz.set_follow_env(env_index)
+ viz.cfg.backend.origin_env_index = env_index
+ if viz.cfg.backend.origin_type == "env":
+ viz.reapply_origin()
def update_view_to_world(self) -> None:
- """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.unfollow` instead."""
+ """Deprecated. Set ``origin_type='world'`` on :class:`~isaaclab_visualizers.kit.KitBackendCfg` instead."""
_warn_method("update_view_to_world")
self._cfg.origin_type = "world"
+ origin = torch.zeros(3)
for viz in self._get_kit_visualizers():
- viz.unfollow()
- viz.set_view_offsets(tuple(self.default_cam_eye.tolist()), tuple(self.default_cam_lookat.tolist()))
+ viz.cfg.backend.origin_type = "world"
+ eye = (origin + torch.tensor(self.default_cam_eye, dtype=torch.float32)).tolist()
+ target = (origin + torch.tensor(self.default_cam_lookat, dtype=torch.float32)).tolist()
+ viz.set_camera_view(tuple(eye), tuple(target))
def update_view_to_env(self) -> None:
- """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.follow` instead."""
+ """Deprecated. Set ``origin_type='env'`` on :class:`~isaaclab_visualizers.kit.KitBackendCfg` instead."""
_warn_method("update_view_to_env")
self._cfg.origin_type = "env"
for viz in self._get_kit_visualizers():
- viz.follow(None)
+ viz.cfg.backend.origin_type = "env"
+ viz.reapply_origin()
def update_view_to_asset_root(self, asset_name: str) -> None:
- """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.follow` with the asset instead."""
+ """Deprecated. Set ``origin_type='asset'`` and ``origin_track_path`` on
+ :class:`~isaaclab_visualizers.kit.KitBackendCfg` instead."""
_warn_method("update_view_to_asset_root")
self._cfg.asset_name = asset_name
self._cfg.origin_type = "asset_root"
for viz in self._get_kit_visualizers():
- viz.follow(asset_name)
+ viz.cfg.backend.origin_type = "asset"
+ viz.cfg.backend.origin_track_path = asset_name
+ viz.reapply_origin()
def update_view_to_asset_body(self, asset_name: str, body_name: str) -> None:
- """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.follow` with the body instead."""
+ """Deprecated. Set ``origin_type='asset'`` and ``origin_track_path`` on
+ :class:`~isaaclab_visualizers.kit.KitBackendCfg` instead."""
_warn_method("update_view_to_asset_body")
self._cfg.asset_name = asset_name
self._cfg.body_name = body_name
self._cfg.origin_type = "asset_body"
for viz in self._get_kit_visualizers():
- viz.follow(f"{asset_name}/{body_name}")
+ viz.cfg.backend.origin_type = "asset"
+ viz.cfg.backend.origin_track_path = f"{asset_name}/{body_name}"
+ viz.reapply_origin()
def update_view_location(
self,
eye: tuple[float, float, float] | None = None,
lookat: tuple[float, float, float] | None = None,
) -> None:
- """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.set_view_offsets` directly instead."""
+ """Deprecated. Call :meth:`~isaaclab_visualizers.kit.KitVisualizer.set_camera_view` directly instead."""
_warn_method("update_view_location")
if eye is not None:
self.default_cam_eye = np.asarray(eye, dtype=float)
if lookat is not None:
self.default_cam_lookat = np.asarray(lookat, dtype=float)
for viz in self._get_kit_visualizers():
- viz.set_view_offsets(tuple(self.default_cam_eye.tolist()), tuple(self.default_cam_lookat.tolist()))
+ # Persist relative offsets into the visualizer config so that
+ # subsequent reapply_origin() calls (e.g. from asset tracking) use
+ # the updated offsets rather than the stale original values.
+ viz.cfg.eye = tuple(self.default_cam_eye.tolist())
+ viz.cfg.lookat = tuple(self.default_cam_lookat.tolist())
+ # reapply_origin() adds the current world/env/asset origin and pushes
+ # the result to the viewport, preserving origin-relative behaviour.
+ viz.reapply_origin()
# ------------------------------------------------------------------
# Private helpers
diff --git a/source/isaaclab/test/envs/test_viewer_cfg_deprecation.py b/source/isaaclab/test/envs/test_viewer_cfg_deprecation.py
index 672da3e828b2..3ef3ceb0a100 100644
--- a/source/isaaclab/test/envs/test_viewer_cfg_deprecation.py
+++ b/source/isaaclab/test/envs/test_viewer_cfg_deprecation.py
@@ -17,7 +17,7 @@
from isaaclab_visualizers.kit import KitBackendCfg
from isaaclab.envs.common import ViewerCfg, _apply_deprecated_viewer_cfg
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerBackendCfg, VisualizerCfg
+from isaaclab.visualizers import VisualizerBackendCfg, VisualizerCfg
def test_viewer_cfg_default_no_warning():
@@ -61,15 +61,12 @@ def test_deprecated_viewer_forwards_only_to_unconfigured_views(case, expected_pa
env_cfg = SimpleNamespace(viewer=viewer, sim=SimpleNamespace(visualizer_cfgs=views))
_apply_deprecated_viewer_cfg(env_cfg)
for view in views:
- assert view.window.size == (viewer.resolution if case not in ("defaults", "configured") else shared.window.size)
if case in ("defaults", "configured"):
assert (view.eye, view.lookat, view.window) == (shared.eye, shared.lookat, shared.window)
- elif expected_path is None:
- assert (view.eye, view.lookat) == (viewer.eye, viewer.lookat) and view.cameras is None
else:
- # a followed asset becomes a tracking camera that comes first, so the viewport starts on it
- assert view.cameras[0].track_path == expected_path and view.cameras[0].eye == viewer.eye
- assert not isinstance(view.cameras[1], TrackingCameraCfg)
+ assert (view.eye, view.lookat, view.window.size) == (viewer.eye, viewer.lookat, viewer.resolution)
+ assert views[0].backend.origin_type == ("asset" if expected_path else "world")
+ assert views[0].backend.origin_track_path == expected_path
def test_combined_visualizer_configs_translate_once_before_launch():
@@ -87,7 +84,7 @@ def test_combined_visualizer_configs_translate_once_before_launch():
physics=PhysicsCfg(), device="cpu",
default_visualizer_cfg=VisualizerCfg(max_visible_envs=16, window=WindowCfg(fps=60)),
visualizer_cfgs=[
- KitVisualizerCfg(),
+ KitVisualizerCfg(origin_type="asset", origin_track_path="robot/base"),
NewtonGLVisualizerCfg(eye=(1.0, 2.0, 3.0), max_visible_envs=4, enable_shadows=False),
],
) # fmt: skip
@@ -101,6 +98,7 @@ def test_combined_visualizer_configs_translate_once_before_launch():
assert kit.window.size == (1280, 720) and gl.window.size == (1920, 1080)
assert kit.window.fps == gl.window.fps == 60
assert kit.max_visible_envs == 16 and gl.max_visible_envs == 4
+ assert (kit.backend.origin_type, kit.backend.origin_track_path) == ("asset", "robot/base")
assert gl.eye == (1.0, 2.0, 3.0) and gl.streaming_view and not gl.backend.enable_shadows
assert cfg.default_visualizer_cfg is None
assert vars(kit).keys().isdisjoint(vars(kit.backend))
diff --git a/source/isaaclab_tasks/changelog.d/tracking-camera-kit.changed.rst b/source/isaaclab_tasks/changelog.d/tracking-camera-kit.changed.rst
deleted file mode 100644
index 781276b20557..000000000000
--- a/source/isaaclab_tasks/changelog.d/tracking-camera-kit.changed.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-* Changed the Franka pour and UR10 particle push tasks to frame environment 0 with a tracking camera instead of the
- removed ``KitBackendCfg`` ``origin_*`` fields.
diff --git a/source/isaaclab_tasks/changelog.d/tracking-camera-kit.minor b/source/isaaclab_tasks/changelog.d/tracking-camera-kit.minor
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/source/isaaclab_visualizers/changelog.d/tracking-camera-kit.changed.rst b/source/isaaclab_visualizers/changelog.d/tracking-camera-kit.changed.rst
deleted file mode 100644
index 5deedecf9a05..000000000000
--- a/source/isaaclab_visualizers/changelog.d/tracking-camera-kit.changed.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-* **Breaking:** Removed ``origin_type``, ``origin_env_index``, and ``origin_track_path`` from
- :class:`~isaaclab_visualizers.kit.KitBackendCfg`. Declare a :class:`~isaaclab.visualizers.TrackingCameraCfg` first
- in ``cameras`` instead; the viewport starts on it. Switch at runtime with ``KitVisualizer.follow()``,
- ``unfollow()``, ``set_follow_env()``, and ``set_view_offsets()``, which replace ``reapply_origin()`` and
- ``viewer_origin``.
diff --git a/source/isaaclab_visualizers/changelog.d/tracking-camera-kit.major b/source/isaaclab_visualizers/changelog.d/tracking-camera-kit.major
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
index a80f64f648d0..66bdbbba80dd 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer.py
@@ -23,8 +23,7 @@
from isaaclab.utils.renderers import ISAAC_RTX_SHOW_ALL_PARTITIONS_BY_DEFAULT_SETTING
from isaaclab.visualizers import VisualizerCfg
from isaaclab.visualizers.base_visualizer import BaseVisualizer
-from isaaclab.visualizers.camera_follower import CameraFollower
-from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg, TrackingCameraCfg
+from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg
from isaaclab_visualizers.desktop_entry import write_desktop_entry
@@ -83,13 +82,9 @@ def __init__(self, cfg: VisualizerCfg):
self._app_pumped_this_step: bool = False
self._controls_kit_timeline = False
self._owns_kit_timeline = False
- # Tracking camera following state: the viewport camera follows an environment or an asset, or is free
+ # Camera tracking state (replaces ViewportCameraController)
self._interactive_scene = None # set from SimulationContext._interactive_scene in initialize()
- self._start_cameras: list = []
- self._declared_tracking_camera: PerspectiveCameraCfg | None = None
- self._follow_view: PerspectiveCameraCfg | None = None
- self._follower: CameraFollower | None = None
- self._follow_env: int | None = None
+ self._viewer_origin: torch.Tensor | None = None # world-space origin offset for eye/lookat
# ---- Lifecycle ------------------------------------------------------------------------
@@ -112,7 +107,6 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
return
super().initialize(sim, cameras=cameras)
- self._start_cameras = list(cameras)
scene_data_provider = self._sim.get_scene_data_provider()
num_envs = scene_data_provider.num_envs
@@ -160,7 +154,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
self._fabric = sim.get_or_create_backend(FabricBackendCfg(stage=sim.stage, device=sim.device))
self._fabric.bind_transforms(scene_data_provider)
self._is_initialized = True
- self._setup_initial_camera_view()
+ self.reapply_origin()
self._controls_kit_timeline = sim.has_gui and self.physics_backend not in ("physx", "ovphysx")
if self._controls_kit_timeline:
self.play()
@@ -191,7 +185,8 @@ def step(self, dt: float) -> None:
provider = self._sim.get_scene_data_provider()
self._fabric.update_transforms(provider)
self._fabric.update_geometries(provider, self._sim.render_generation)
- self._update_asset_follow_camera()
+ if self.cfg.backend.origin_type == "asset":
+ self._update_asset_tracking_camera()
self._app_pumped_this_step = self._pump_kit_app_update()
if self._camera_image_provider is not None:
image = self.current_image_view.frame.data if self.is_training_paused() else self.render_tiled_rgba_array()
@@ -308,8 +303,8 @@ def render_rgb_array(self) -> np.ndarray:
provider = self._sim.get_scene_data_provider()
self._fabric.update_transforms(provider)
self._fabric.update_geometries(provider, self._sim.render_generation)
- if self._runtime_headless:
- self._update_asset_follow_camera()
+ if self._runtime_headless and self.cfg.backend.origin_type == "asset":
+ self._update_asset_tracking_camera()
w, h = self.cfg.window.size
# Create the render product and annotator before the app update so the first
@@ -456,70 +451,14 @@ def set_camera_view(
self._set_viewport_camera(tuple(eye), tuple(target))
@property
- def following(self) -> bool:
- """Whether the viewport camera follows an environment or an asset instead of being free."""
- return self._follower is not None
-
- @property
- def follow_env_index(self) -> int:
- """Environment the viewport camera follows, or would follow when asked to."""
- if self._follow_env is None:
- scene = self._interactive_scene
- return 0 if scene is None else (scene.num_envs - 1) // 2
- return self._follow_env
+ def viewer_origin(self) -> torch.Tensor | None:
+ """Current world-space origin offset applied to :attr:`~isaaclab.visualizers.VisualizerCfg.eye` and
+ :attr:`~isaaclab.visualizers.VisualizerCfg.lookat` when computing the absolute camera position.
- def follow(self, track_path: str | None = None, *, env_index: int | None = None) -> None:
- """Make the viewport camera frame an environment, or follow an asset in it.
-
- The configuration's ``eye`` and ``lookat`` become offsets from the environment origin, or from the tracked
- asset when *track_path* is set. A tracking camera declared in the configuration supplies the heading
- behaviour when it follows the same asset.
-
- Args:
- track_path: ``""`` or ``"/"``, or None to frame the environment's origin.
- env_index: Environment to follow; None keeps the one last chosen, the middle one at first.
+ Returns ``None`` before :meth:`initialize` is called or when no valid origin has been
+ established yet (e.g. asset-tracking before the first :meth:`step`).
"""
- if env_index is not None:
- self._follow_env = int(env_index)
- scene = self._interactive_scene
- if scene is None:
- logger.warning("[KitVisualizer] Cannot follow before the scene is registered.")
- return
- template = self._declared_tracking_camera
- same_asset = template is not None and template.track_path == track_path
- self._follow_view = TrackingCameraCfg(
- env_index=self._follow_env,
- track_path=track_path,
- eye=self.cfg.eye,
- lookat=self.cfg.lookat,
- focal_length=self.cfg.focal_length,
- follow_heading=same_asset and template.follow_heading,
- heading_smoothing_time_constant=template.heading_smoothing_time_constant if same_asset else 0.0,
- )
- self._follower = CameraFollower(self._follow_view, scene, self._env_ids)
- self._follow_env = self._follower.env
- self._set_viewport_focal_length(self._follow_view.focal_length)
- self._update_follow_camera()
-
- def unfollow(self) -> None:
- """Hand the viewport camera back to the user, keeping its current pose."""
- self._follower = self._follow_view = None
-
- def set_follow_env(self, env_index: int) -> None:
- """Follow *env_index* from now on; a free camera only remembers the choice."""
- self._follow_env = int(env_index)
- if self._follower is not None:
- self._follower.set_env(env_index)
- self._update_follow_camera()
-
- def set_view_offsets(self, eye: tuple[float, float, float], lookat: tuple[float, float, float]) -> None:
- """Set the camera pose: offsets while following, world coordinates while free."""
- self.cfg.eye, self.cfg.lookat = tuple(float(v) for v in eye), tuple(float(v) for v in lookat)
- if self._follow_view is None:
- self.set_camera_view(self.cfg.eye, self.cfg.lookat)
- return
- self._follow_view.eye, self._follow_view.lookat = self.cfg.eye, self.cfg.lookat
- self._update_follow_camera()
+ return self._viewer_origin
# ---- Viewport + camera ----------------------------------------------------------------
@@ -836,14 +775,6 @@ def _set_viewport_camera(self, position: tuple[float, float, float], target: tup
camera_state.set_position_world(Gf.Vec3d(float(position[0]), float(position[1]), float(position[2])), False)
camera_state.set_target_world(Gf.Vec3d(float(target[0]), float(target[1]), float(target[2])), True)
- def _set_viewport_focal_length(self, focal_length: float) -> None:
- """Set the lens of the viewport camera [mm], in the session layer so the user's stage is left alone."""
- camera_path = (self._viewport_api.get_active_camera() if self._viewport_api is not None else None) or (
- _DEFAULT_VIEWPORT_CAMERA_PATH
- )
- with Usd.EditContext(self._sim.stage, self._sim.stage.GetSessionLayer()):
- UsdGeom.Camera.Define(self._sim.stage, camera_path).GetFocalLengthAttr().Set(float(focal_length))
-
def _set_usd_camera_pose(self, camera_path: str, position, target) -> bool:
"""Apply eye/target camera pose directly to a USD camera prim.
@@ -997,42 +928,77 @@ def _restore_env_visibility(self) -> None:
inv_attr.Set(prev)
self._point_instancer_invisible_ids_backup.clear()
- def _setup_initial_camera_view(self) -> None:
- """Start on the first declared view: a tracking camera follows from the start, any other view is free.
+ def reapply_origin(self) -> None:
+ """Apply the configured world, environment, or asset origin to the viewport camera.
- Called once at the end of :meth:`initialize`. An asset is followed from the first step, because its
- state is not available before :meth:`~isaaclab.sim.SimulationContext.reset`.
+ Called during initialization and after changing ``cfg.backend.origin_type``,
+ ``cfg.backend.origin_env_index``, or ``cfg.backend.origin_track_path`` at runtime.
+ Asset tracking waits for the next :meth:`step`, when simulation state is available.
"""
self._interactive_scene = self._sim.get_scene_data_provider().get_interactive_scene()
- # declaration order, not the simulation's, which lists tracking cameras after the free view
- declared = self.cfg.cameras if self.cfg.cameras is not None else self._start_cameras
- views = [camera for camera in declared if isinstance(camera, PerspectiveCameraCfg)]
- self._declared_tracking_camera = next((view for view in views if isinstance(view, TrackingCameraCfg)), None)
- if views and isinstance(views[0], TrackingCameraCfg):
- first = views[0]
- self.cfg.eye, self.cfg.lookat, self.cfg.focal_length = first.eye, first.lookat, first.focal_length
- self.follow(first.track_path, env_index=first.env_index)
-
- def _update_asset_follow_camera(self) -> None:
- """Re-apply the pose every step while an asset is followed; a fixed environment view is left movable."""
- if self._follower is not None and self._follower.cfg.track_path:
- self._update_follow_camera()
-
- def _update_follow_camera(self) -> None:
- """Move the viewport camera to the followed environment or asset, once both are ready."""
- if self._follower is None:
+
+ if self.cfg.backend.origin_type == "world":
+ self._viewer_origin = torch.zeros(3)
+ elif self.cfg.backend.origin_type == "env":
+ scene = self._interactive_scene
+ if scene is None:
+ logger.warning("[KitVisualizer] origin_type='env' requested but no scene is registered yet.")
+ self._viewer_origin = torch.zeros(3)
+ else:
+ num_envs = scene.num_envs
+ if not (0 <= self.cfg.backend.origin_env_index < num_envs):
+ raise ValueError(
+ f"[KitVisualizer] origin_env_index {self.cfg.backend.origin_env_index} is out of range "
+ f"[0, {num_envs - 1}] for origin_type='env'."
+ )
+ self._viewer_origin = scene.env_origins[self.cfg.backend.origin_env_index]
+ elif self.cfg.backend.origin_type == "asset":
+ if self.cfg.backend.origin_track_path is None:
+ raise ValueError("[KitVisualizer] origin_type='asset' requires origin_track_path to be set.")
+ # Asset data is not available until after sim.reset(); defer to step().
return
- pose = self._follower.pose(self._sim.get_physics_step_count() * self._sim.get_physics_dt())
- if pose is None:
+ else:
+ logger.warning(
+ "[KitVisualizer] Unknown origin_type '%s'; defaulting to world.", self.cfg.backend.origin_type
+ )
+ self._viewer_origin = torch.zeros(3)
+
+ self._apply_viewer_origin_to_camera()
+
+ def _update_asset_tracking_camera(self) -> None:
+ """Update the viewport camera to track an asset root or body.
+
+ Called before viewport frames when :attr:`KitBackendCfg.origin_type` is ``"asset"``.
+ Parses :attr:`~KitBackendCfg.origin_track_path`: ``"asset_name"`` tracks the root,
+ ``"asset_name/body_name"`` tracks a specific body.
+ """
+ scene = self._interactive_scene
+ if scene is None or self.cfg.backend.origin_track_path is None:
+ return
+ asset_name, _, body_name = self.cfg.backend.origin_track_path.partition("/")
+ try:
+ asset = scene[asset_name]
+ except KeyError:
return
- eye, target = pose
- self.set_camera_view(eye, target)
+ if body_name:
+ body_ids, _ = asset.find_bodies(body_name)
+ self._viewer_origin = asset.data.body_pos_w.torch[self.cfg.backend.origin_env_index, body_ids[0]]
+ else:
+ self._viewer_origin = asset.data.root_pos_w.torch[self.cfg.backend.origin_env_index]
+ self._apply_viewer_origin_to_camera()
+
+ def _apply_viewer_origin_to_camera(self) -> None:
+ """Compute absolute eye/target from :attr:`_viewer_origin` and push to the viewport."""
+ if self._viewer_origin is None:
+ return
+ origin = self._viewer_origin.detach().cpu().numpy()
+ eye = np.array(self.cfg.eye, dtype=float) + origin
+ target = np.array(self.cfg.lookat, dtype=float) + origin
+ self.set_camera_view(tuple(float(v) for v in eye), tuple(float(v) for v in target))
# Keep the Isaac RTX renderer camera in sync (no-op if isaaclab_physx is not installed).
try:
from isaaclab_physx.renderers.kit_viewport_utils import set_kit_renderer_camera_view # noqa: PLC0415
- set_kit_renderer_camera_view(
- eye=np.array(eye), target=np.array(target), camera_prim_path="/OmniverseKit_Persp"
- )
+ set_kit_renderer_camera_view(eye=eye, target=target, camera_prim_path="/OmniverseKit_Persp")
except (ImportError, ModuleNotFoundError):
pass
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer_cfg.py b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer_cfg.py
index 3d67eccfe129..9054ca94a3dc 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer_cfg.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/kit/kit_visualizer_cfg.py
@@ -54,6 +54,35 @@ class KitBackendCfg(VisualizerBackendCfg):
side-by-side.
"""
+ 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: ``""`` to track the asset root, or ``"/"``
+ 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
+ """
+
@configclass
class KitVisualizerCfg(KitBackendCfg, VisualizerCfg):
diff --git a/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py b/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
index 26a5599aa709..1f393616d38f 100644
--- a/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
+++ b/source/isaaclab_visualizers/test/test_kit_visualizer_scene_partitioning.py
@@ -60,14 +60,14 @@ def kit_timeline(monkeypatch):
@pytest.mark.parametrize("headless", [False, True])
def test_viewport_pose_publication_is_deferred_for_headless_capture(monkeypatch, kit_app, headless):
- visualizer = KitVisualizer(VisualizerCfg(headless=headless, backend=KitBackendCfg()))
+ visualizer = KitVisualizer(VisualizerCfg(headless=headless, backend=KitBackendCfg(origin_type="asset")))
visualizer._is_initialized = True
visualizer._fabric = MagicMock()
visualizer._sim = sim = MagicMock(render_generation=12)
provider = sim.get_scene_data_provider.return_value
monkeypatch.setattr(visualizer, "is_training_paused", lambda: True)
tracking = MagicMock()
- monkeypatch.setattr(visualizer, "_update_asset_follow_camera", tracking)
+ monkeypatch.setattr(visualizer, "_update_asset_tracking_camera", tracking)
monkeypatch.setattr(visualizer, "_refresh_partial_viz_point_instancers_if_needed", MagicMock())
settings = MagicMock()
settings.get.return_value = None
@@ -221,7 +221,7 @@ def test_timeline_controls_only_non_physx_backends(monkeypatch, physics_backend,
monkeypatch.setattr(visualizer, "_setup_viewport", MagicMock())
monkeypatch.setattr(visualizer, "_apply_viewport_camera_scene_partition", MagicMock())
monkeypatch.setattr(visualizer, "_log_initialization_table", MagicMock())
- monkeypatch.setattr(visualizer, "_setup_initial_camera_view", MagicMock())
+ monkeypatch.setattr(visualizer, "reapply_origin", MagicMock())
play = MagicMock()
monkeypatch.setattr(visualizer, "play", play)
@@ -351,99 +351,3 @@ def test_marker_environment_ids_are_sticky_and_revalidated_on_change() -> None:
)
assert not primvar.GetAttr().HasAuthoredValueOpinion()
-
-
-class _FollowScene:
- num_envs = 3
- env_origins = torch.tensor([[0.0, 0.0, 0.0], [10.0, 0.0, 0.0], [20.0, 0.0, 0.0]])
-
- def __getitem__(self, name):
- asset = MagicMock(is_initialized=True)
- asset.data.root_pos_w.torch = torch.tensor([[0.0, 0.0, 0.5], [10.0, 0.0, 0.5], [20.0, 0.0, 0.5]])
- asset.data.root_quat_w.torch = torch.tensor([[0.0, 0.0, 0.0, 1.0]] * 3)
- return asset
-
-
-def _following_visualizer(monkeypatch, cameras):
- visualizer = KitVisualizer(VisualizerCfg(backend=KitBackendCfg()))
- visualizer._sim = MagicMock()
- visualizer._sim.get_scene_data_provider.return_value.get_interactive_scene.return_value = _FollowScene()
- visualizer._sim.get_physics_step_count.return_value = 5
- visualizer._sim.get_physics_dt.return_value = 0.1
- visualizer._start_cameras = cameras
- poses = []
- monkeypatch.setattr(visualizer, "set_camera_view", lambda eye, target: poses.append((eye, target)))
- monkeypatch.setattr(visualizer, "_set_viewport_focal_length", lambda focal_length: None)
- return visualizer, poses
-
-
-def test_the_viewport_starts_free_unless_the_first_view_is_a_tracking_camera(monkeypatch):
- from isaaclab.visualizers import PerspectiveCameraCfg, TrackingCameraCfg
-
- task = TrackingCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0))
- free, poses = _following_visualizer(monkeypatch, [PerspectiveCameraCfg(), task])
- free._setup_initial_camera_view()
- assert not free.following and poses == []
-
- visualizer, poses = _following_visualizer(monkeypatch, [task, PerspectiveCameraCfg()])
- visualizer._setup_initial_camera_view()
- assert visualizer.following and visualizer.follow_env_index == 1
- assert visualizer.cfg.eye == (1.0, 2.0, 3.0) # offsets while following
- assert poses == [((11.0, 2.0, 3.0), (10.0, 0.0, 1.0))]
-
-
-def test_follow_unfollow_and_the_environment_selection(monkeypatch):
- from isaaclab.visualizers import PerspectiveCameraCfg
-
- visualizer, poses = _following_visualizer(monkeypatch, [PerspectiveCameraCfg()])
- visualizer._setup_initial_camera_view()
- visualizer.cfg.eye, visualizer.cfg.lookat = (0.0, 0.0, 1.0), (1.0, 0.0, 0.0)
-
- visualizer.set_follow_env(2) # free: only remembered
- assert not visualizer.following and visualizer.follow_env_index == 2 and poses == []
- visualizer.follow("robot")
- assert poses[-1] == ((20.0, 0.0, 1.5), (21.0, 0.0, 0.5)) # offsets from the asset in env 2
- visualizer.set_follow_env(0)
- assert poses[-1][0] == (0.0, 0.0, 1.5)
- visualizer.set_view_offsets((0.0, 0.0, 2.0), (1.0, 0.0, 0.0))
- assert poses[-1][0] == (0.0, 0.0, 2.5) and visualizer.cfg.eye == (0.0, 0.0, 2.0)
-
- visualizer.unfollow()
- visualizer.set_view_offsets((4.0, 4.0, 4.0), (0.0, 0.0, 0.0))
- assert not visualizer.following and poses[-1] == ((4.0, 4.0, 4.0), (0.0, 0.0, 0.0))
-
-
-def test_the_declared_order_decides_the_start_view_not_the_order_the_simulation_lists_them(monkeypatch):
- from isaaclab.visualizers import PerspectiveCameraCfg, TrackingCameraCfg
-
- task = TrackingCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0))
- visualizer, poses = _following_visualizer(monkeypatch, [PerspectiveCameraCfg(), task])
- visualizer.cfg.cameras = [task, PerspectiveCameraCfg()] # the simulation puts tracking cameras after the free view
- visualizer._setup_initial_camera_view()
- assert visualizer.following and visualizer.follow_env_index == 1
-
-
-def test_only_a_followed_asset_is_reapplied_every_step(monkeypatch):
- from isaaclab.visualizers import PerspectiveCameraCfg
-
- visualizer, poses = _following_visualizer(monkeypatch, [PerspectiveCameraCfg()])
- visualizer._setup_initial_camera_view()
- visualizer.follow(None) # an environment view, which the user can orbit
- poses.clear()
- visualizer._update_asset_follow_camera()
- assert poses == []
- visualizer.follow("robot")
- poses.clear()
- visualizer._update_asset_follow_camera()
- assert len(poses) == 1
-
-
-def test_following_applies_the_tracking_cameras_lens_to_the_viewport_camera(monkeypatch):
- from isaaclab.visualizers import PerspectiveCameraCfg, TrackingCameraCfg
-
- task = TrackingCameraCfg(env_index=0, track_path="robot", focal_length=26.0)
- visualizer, _ = _following_visualizer(monkeypatch, [task, PerspectiveCameraCfg()])
- lenses = []
- monkeypatch.setattr(visualizer, "_set_viewport_focal_length", lenses.append)
- visualizer._setup_initial_camera_view()
- assert lenses == [26.0]
From 68fd75e98d967db140fdf90d8c716535424fe774 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 28 Oct 2026 00:16:32 +0000
Subject: [PATCH 019/140] Document tracking cameras as Newton GL only in
TrackingCameraCfg
---
source/isaaclab/isaaclab/visualizers/visualizer_cfg.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index a5ccd996c2d9..542ff016016e 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -69,7 +69,7 @@ class TrackingCameraCfg(PerspectiveCameraCfg):
"""A camera that frames an environment or follows an asset in it, however the scene is laid out.
The visualizer renders it from the viewer camera, so nothing is created in the scene. Only Newton GL
- and Kit support it; other visualizers ignore it.
+ supports it; other visualizers ignore it.
"""
eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
From 418804c0738cfcc1e24230dbd92545bb0fdc32a6 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 11 Nov 2026 20:48:57 +0000
Subject: [PATCH 020/140] Remove an unused import
---
.../isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py | 2 --
.../contrib/ur10_particle_push/ur10_particle_push_env_cfg.py | 2 --
2 files changed, 4 deletions(-)
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
index 732252a36215..aea004173f32 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
@@ -40,8 +40,6 @@
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, ISAACLAB_NUCLEUS_DIR
from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
-from isaaclab_tasks.utils.presets import MultiBackendVisualizerCfg
-
from isaaclab_assets.robots.franka import FRANKA_PANDA_CFG
from . import mdp
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
index f5150bf65bcc..48fdf218a925 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
@@ -37,8 +37,6 @@
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
-from isaaclab_tasks.utils.presets import MultiBackendVisualizerCfg
-
from isaaclab_assets.robots.universal_robots import UR10_CFG
from . import mdp
From 7e907ae38b5f916b160945f13be6a30f5e97b1d9 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 12 Nov 2026 23:39:56 +0000
Subject: [PATCH 021/140] Address review feedback on tracking cameras
Apply a free view's pose when capturing it, reject tracking cameras without a scene or as an RTX image source, clear the heading filter on reset, and correct the docs, comments, and test markers.
Co-Authored-By: Claude Sonnet 5.5
---
.../how-to/visualizer_streaming_camera_view.rst | 4 ++--
source/isaaclab/isaaclab/app/sim_launcher.py | 3 ++-
.../isaaclab/envs/utils/video_recorder_cfg.py | 2 +-
source/isaaclab/isaaclab/sim/simulation_context.py | 1 -
.../isaaclab/isaaclab/visualizers/camera_follower.py | 4 ++++
.../test/visualizers/test_camera_follower.py | 2 ++
.../contrib/franka_pour/pour_env_cfg.py | 2 +-
.../multitask_manipulation/multitask_env_cfg.py | 2 +-
.../ur10_particle_push/ur10_particle_push_env_cfg.py | 2 +-
.../fourbar_pole/fourbar_pole_manager_env_cfg.py | 2 +-
.../isaaclab_visualizers/newton/newton_visualizer.py | 12 +++++++++++-
.../test/test_newton_tracking_cameras.py | 2 ++
12 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index 835f68f7f960..20d13bc50604 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -55,7 +55,7 @@ For Newton RTX, a perspective declaration is expanded into an ordinary scene cam
.. code-block:: python
- from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+ from isaaclab.visualizers import PerspectiveCameraCfg, VisualizerCfg
view = ImageViewCfg(source=PerspectiveCameraCfg(eye=(4.0, -4.0, 3.0)))
env_cfg.sim.visualizer_cfgs = VisualizerCfg(
@@ -262,7 +262,7 @@ viewport's markers and shadows.
from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
- self.sim.visualizer_cfgs = VisualizerCfg(
+ env_cfg.sim.visualizer_cfgs = VisualizerCfg(
cameras=[
TrackingCameraCfg(
eye=(1.8, -3.0, 1.1),
diff --git a/source/isaaclab/isaaclab/app/sim_launcher.py b/source/isaaclab/isaaclab/app/sim_launcher.py
index 4e89bd048c3a..42849eb9325e 100644
--- a/source/isaaclab/isaaclab/app/sim_launcher.py
+++ b/source/isaaclab/isaaclab/app/sim_launcher.py
@@ -320,10 +320,11 @@ def validate_launch( # noqa: C901
if not isinstance(visualizer.backend, NewtonRTXBackendCfg) or scene_cfg is None:
continue
if visualizer.view is not None:
+ if isinstance(visualizer.view.source, TrackingCameraCfg):
+ raise ValueError("A tracking camera cannot be the image source of an RTX viewer.")
sources = [visualizer.view.source]
else:
# Tracking cameras follow the viewer camera, which an RTX scene camera cannot do, so RTX leaves them out.
- # RTX-only: remove this filter, and the one in SimulationContext, with the RTX visualizer.
sources = [camera for camera in visualizer.cameras or [] if not (isinstance(camera, TrackingCameraCfg))]
if not sources:
sources = [
diff --git a/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py b/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
index fa57e507af75..c2d9d45d05c9 100644
--- a/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
+++ b/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
@@ -79,7 +79,7 @@ class VideoRecorderCfg:
* ``"viz::streaming_view"`` – the streaming camera panel of that visualizer (requires
``streaming_view=True`` on its :class:`~isaaclab.visualizers.VisualizerCfg`).
* ``"viz::tracking"`` – the first perspective view of that visualizer that is tied to an
- environment or an asset (:class:`~isaaclab.visualizers.PerspectiveCameraCfg` with ``env_index`` or
+ environment or an asset (:class:`~isaaclab.visualizers.TrackingCameraCfg` with ``env_index`` or
``track_path``), whichever view its window shows. Only Newton GL supports it.
* ``"sensor:"`` – scene sensor, RGB channel (default); no visualizer is added.
* ``"sensor::"`` – scene sensor channel: ``rgb``, ``depth`` (colorized via the turbo
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index ce60f92573c2..0414faf35edc 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -435,7 +435,6 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
]) # fmt: skip
if visualizer.cfg.backend.visualizer_type == "newton_rtx":
# An RTX window shows scene cameras, so tracking cameras have nothing to follow there.
- # RTX-only: remove this branch, and the filter in sim_launcher, with the RTX visualizer.
cameras = [camera for camera in cameras if not (isinstance(camera, TrackingCameraCfg))]
else:
cameras = with_free_view(
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
index e5ed70019a9a..316cee2e9767 100644
--- a/source/isaaclab/isaaclab/visualizers/camera_follower.py
+++ b/source/isaaclab/isaaclab/visualizers/camera_follower.py
@@ -82,6 +82,10 @@ def set_track_path(self, track_path: str | None) -> None:
self._asset, self._body_name, self._body_index = asset, body_name, None
self._yaw = self._last_position = self._time = None
+ def reset(self) -> None:
+ """Forget the heading history, so the next pose is not smoothed against the previous episode."""
+ self._yaw = self._last_position = self._time = None
+
def asset_names(self) -> list[str]:
"""Return the names of the scene assets the view can follow."""
scene = self._scene
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
index 35802b829ab4..85668df25b4e 100644
--- a/source/isaaclab/test/visualizers/test_camera_follower.py
+++ b/source/isaaclab/test/visualizers/test_camera_follower.py
@@ -17,6 +17,8 @@
from isaaclab.visualizers.camera_follower import CameraFollower
from isaaclab.visualizers.visualizer_cfg import with_free_view
+pytestmark = pytest.mark.kitless
+
def _quat_z(yaw: float) -> list[float]:
"""Quaternion (x, y, z, w) of a rotation of *yaw* about +Z."""
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
index aea004173f32..1372c5bc3120 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
@@ -529,7 +529,7 @@ class FrankaPourResetDatasetEnvCfg(ManagerBasedRLEnvCfg):
scene: PourSceneCfg = PourSceneCfg(num_envs=2, env_spacing=2.5)
sim: sim_utils.SimulationCfg = sim_utils.SimulationCfg(
- # the viewport starts on the first view, framing environment 0; a free view follows it
+ # the viewport starts on the free view; the tracking camera is the next choice in the Camera Source list
visualizer_cfgs=VisualizerCfg(
cameras=[TrackingCameraCfg(eye=(1.4, 1.4, 0.9), lookat=(0.5, 0.0, 0.1))],
)
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/multitask_manipulation/multitask_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/multitask_manipulation/multitask_env_cfg.py
index af78c67d9da0..5cd892c82c47 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/multitask_manipulation/multitask_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/multitask_manipulation/multitask_env_cfg.py
@@ -491,7 +491,7 @@ def __post_init__(self):
self.sim.visualizer_cfgs = VisualizerCfg(eye=(-3.0, 3.0, 2.5), lookat=(0.0, 0.0, 0.5))
def validate_config(self) -> None:
- """Validate the minimum batch size required to instantiate all tracking cameras."""
+ """Validate the minimum batch size: one environment per task."""
if self.scene.num_envs < 3:
raise ValueError("IsaacContrib-Multitask-Manipulation requires at least three environments, one per task.")
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
index 48fdf218a925..20a00898eb4a 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
@@ -613,7 +613,7 @@ class UR10ParticlePushEnvCfg(ManagerBasedRLEnvCfg):
sim: SimulationCfg = SimulationCfg(
dt=1.0 / 120.0,
render_interval=decimation,
- # the viewport starts on the first view, framing environment 0; a free view follows it
+ # the viewport starts on the free view; the tracking camera is the next choice in the Camera Source list
visualizer_cfgs=VisualizerCfg(
cameras=[TrackingCameraCfg(eye=(1.7, 1.5, 1.0), lookat=(0.55, 0.0, 0.0))],
),
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
index 0ab21bbd1cc3..31c3dc3c9edb 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
@@ -239,7 +239,7 @@ def __post_init__(self) -> None:
# general settings
self.decimation = 2
self.episode_length_s = 5
- # Match Newton GL / --video camera to the tracking cameraport when --viz newton creates the visualizer.
+ # Declare the tracking camera that --video viz:newton:tracking records.
self.sim.visualizer_cfgs = VisualizerCfg(
eye=(12.0, 0.0, 4.0),
cameras=[
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index c4f6dcb36bd7..cd18df797f6a 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -520,7 +520,9 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
raise ValueError("A perspective image view must have exactly one rendering owner.")
view.render = partial(self._capture_view, view)
source = view.cfg.source
- if self._is_tracking_view(view) and scene is not None:
+ if self._is_tracking_view(view):
+ if scene is None:
+ raise ValueError("A tracking camera needs an interactive scene to follow.")
# fail at initialization, not on a frame: a bad env_index or track_path raises here
self._followers[view] = follower = CameraFollower(source, scene, self._env_ids)
self._tracking_defaults[view] = {
@@ -808,6 +810,12 @@ def _capture_view(self, view, output: wp.array | None) -> wp.array:
camera = self._viewer.camera
saved = (PygletVec3(camera.pos.x, camera.pos.y, camera.pos.z), camera.pitch, camera.yaw, camera.fov)
self.current_image_view = view
+ if not self._is_tracking_view(view): # a free view renders from its declared pose and optics
+ source = view.cfg.source
+ camera.pos = PygletVec3(*source.eye)
+ camera.look_at(source.lookat)
+ self._viewer.set_camera(camera.pos, camera.pitch, camera.yaw)
+ camera.fov = self._focal_length_to_vertical_fov_degrees(source.focal_length)
try:
self._last_render_step = -1
return self._capture_frame(output)
@@ -856,6 +864,8 @@ def reset(self, soft: bool = False) -> None:
"""Invalidate the displayed frame after a simulation reset."""
super().reset(soft)
self._last_render_step = -1
+ for follower in self._followers.values():
+ follower.reset() # the heading filter must not carry the previous episode over
def close(self) -> None:
"""Detach perspective producers before releasing the visualizer's borrowed views."""
diff --git a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
index ac1dcca481fa..389fc7ac2ec5 100644
--- a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
+++ b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
@@ -19,6 +19,8 @@
from isaaclab.visualizers import PerspectiveCameraCfg, TrackingCameraCfg
from isaaclab.visualizers.camera_follower import CameraFollower
+pytestmark = pytest.mark.kitless
+
class _Camera:
"""The viewer camera: a position, a look-at target stored as angles, and a field of view."""
From 6ac4f43781c6d8ff42a201cbe9df0dca91762f2a Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 12 Nov 2026 23:57:32 +0000
Subject: [PATCH 022/140] Compare a tracking camera's raw heading when
detecting a reset
Co-Authored-By: Claude Sonnet 5.5
---
.../isaaclab/visualizers/camera_follower.py | 13 +++++++----
.../test/visualizers/test_camera_follower.py | 23 +++++++++++++++----
2 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
index 316cee2e9767..453de50c519a 100644
--- a/source/isaaclab/isaaclab/visualizers/camera_follower.py
+++ b/source/isaaclab/isaaclab/visualizers/camera_follower.py
@@ -46,6 +46,7 @@ def __init__(self, cfg: TrackingCameraCfg, scene: InteractiveScene, env_ids: Seq
self._scene = scene
self._env = 0
self._yaw: float | None = None
+ self._raw_yaw: float | None = None
self._last_position: list[float] | None = None
self._time: float | None = None
if cfg.env_index is not None:
@@ -80,11 +81,11 @@ def set_track_path(self, track_path: str | None) -> None:
raise ValueError(f"track_path must match exactly one body: {track_path!r}.")
self.cfg.track_path = track_path or None
self._asset, self._body_name, self._body_index = asset, body_name, None
- self._yaw = self._last_position = self._time = None
+ self._yaw = self._raw_yaw = self._last_position = self._time = None
def reset(self) -> None:
"""Forget the heading history, so the next pose is not smoothed against the previous episode."""
- self._yaw = self._last_position = self._time = None
+ self._yaw = self._raw_yaw = self._last_position = self._time = None
def asset_names(self) -> list[str]:
"""Return the names of the scene assets the view can follow."""
@@ -112,7 +113,7 @@ def set_env(self, index: int) -> None:
if not 0 <= index < self._scene.num_envs:
raise ValueError(f"env_index {index} is outside the {self._scene.num_envs} environments of the scene.")
self._env = int(index)
- self._yaw = self._last_position = self._time = None
+ self._yaw = self._raw_yaw = self._last_position = self._time = None
def pose(self, time: float) -> tuple[tuple[float, float, float], tuple[float, float, float]] | None:
"""Return the world eye and look-at target at simulation *time*, or None until the asset is ready.
@@ -161,8 +162,10 @@ def _filtered_yaw(self, quat: list[float], position: list[float], dt: float) ->
last, self._last_position = self._last_position, position
reset = self._yaw is None or last is None or math.dist(position, last) > _RESET_JUMP
if not reset:
- # an environment can reset in place with a new heading
- reset = abs(math.remainder(yaw - self._yaw, math.tau)) > _RESET_YAW_JUMP
+ # an environment can reset in place with a new heading; the raw heading is compared, since the filtered
+ # one lags behind a steady turn
+ reset = abs(math.remainder(yaw - self._raw_yaw, math.tau)) > _RESET_YAW_JUMP
+ self._raw_yaw = yaw
tau = self.cfg.heading_smoothing_time_constant
if tau > 0.0 and not reset:
yaw = self._yaw + -math.expm1(-dt / tau) * math.remainder(yaw - self._yaw, math.tau)
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
index 85668df25b4e..ef35e0c17434 100644
--- a/source/isaaclab/test/visualizers/test_camera_follower.py
+++ b/source/isaaclab/test/visualizers/test_camera_follower.py
@@ -187,13 +187,26 @@ def test_clearing_the_asset_keeps_the_view_tied_to_its_environment():
assert cfg.track_path is None and isinstance(cfg, TrackingCameraCfg)
-def test_two_updates_a_millisecond_apart_are_not_mistaken_for_an_environment_reset():
+def test_a_steady_turn_with_heavy_smoothing_is_not_mistaken_for_an_environment_reset():
+ cfg = TrackingCameraCfg(env_index=0, track_path="robot", follow_heading=True, heading_smoothing_time_constant=2.0)
+ follower = CameraFollower(cfg, _NamedScene())
+ previous = None
+ for step in range(120): # one radian per second sampled at 10 Hz, so the filter lags by more than a reset jump
+ raw = 0.1 * step
+ yaw = follower._filtered_yaw([0.0, 0.0, math.sin(raw / 2), math.cos(raw / 2)], [0.0, 0.0, 0.5], 0.1)
+ if previous is not None:
+ assert abs(math.remainder(yaw - previous, math.tau)) < 0.2
+ previous = yaw
+
+
+def test_the_heading_filter_starts_afresh_after_a_reset():
cfg = TrackingCameraCfg(env_index=0, track_path="robot", follow_heading=True, heading_smoothing_time_constant=1.0)
follower = CameraFollower(cfg, _NamedScene())
- follower.pose(0.0)
- follower._yaw = 0.0
- follower._last_position = [0.0, 0.0, 0.5]
- assert follower._filtered_yaw([0.0, 0.0, 0.0099995, 0.99995], [0.0, 0.0, 0.5], 0.001) < 0.02
+ follower._filtered_yaw([0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 0.5], 0.1)
+
+ follower.reset()
+
+ assert follower._filtered_yaw([0.0, 0.0, 0.2, 0.98], [0.0, 0.0, 0.5], 0.1) == pytest.approx(0.4027, abs=1e-3)
def test_without_an_env_index_the_middle_visible_environment_is_followed():
From 66862f6e2446521f8a217ef38232b4dad2302368 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Mon, 16 Nov 2026 07:38:43 +0000
Subject: [PATCH 023/140] Drop a camera follower test that asserts a
true-by-construction type check
Co-Authored-By: Claude Sonnet 5.5
---
source/isaaclab/test/visualizers/test_camera_follower.py | 8 --------
1 file changed, 8 deletions(-)
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
index ef35e0c17434..d74f462f682d 100644
--- a/source/isaaclab/test/visualizers/test_camera_follower.py
+++ b/source/isaaclab/test/visualizers/test_camera_follower.py
@@ -179,14 +179,6 @@ def test_the_followable_assets_and_bodies_are_listed():
assert follower.body_names("missing") == []
-def test_clearing_the_asset_keeps_the_view_tied_to_its_environment():
- cfg = TrackingCameraCfg(track_path="robot")
- follower = CameraFollower(cfg, _NamedScene())
- assert isinstance(cfg, TrackingCameraCfg)
- follower.set_track_path(None)
- assert cfg.track_path is None and isinstance(cfg, TrackingCameraCfg)
-
-
def test_a_steady_turn_with_heavy_smoothing_is_not_mistaken_for_an_environment_reset():
cfg = TrackingCameraCfg(env_index=0, track_path="robot", follow_heading=True, heading_smoothing_time_constant=2.0)
follower = CameraFollower(cfg, _NamedScene())
From 60ab29ad585118cdbd0dee4eac13001d2cbe08f0 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Tue, 17 Nov 2026 07:19:23 +0000
Subject: [PATCH 024/140] Address review feedback on the tracking camera
---
.../visualizer_streaming_camera_view.rst | 2 +-
.../isaaclab/sim/simulation_context.py | 2 -
.../isaaclab/visualizers/camera_follower.py | 11 +++---
.../isaaclab/visualizers/visualizer_cfg.py | 2 +-
.../test/visualizers/test_camera_follower.py | 4 +-
.../contrib/franka_pour/pour_env_cfg.py | 1 -
.../ur10_particle_push_env_cfg.py | 1 -
.../fourbar_pole_manager_env_cfg.py | 1 -
.../newton/newton_visualizer.py | 37 +++++++++++--------
.../test/test_newton_adapter.py | 1 -
.../test/test_newton_tracking_cameras.py | 14 +------
11 files changed, 32 insertions(+), 44 deletions(-)
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index 20d13bc50604..5c27460c22ab 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -274,7 +274,7 @@ viewport's markers and shadows.
],
)
-* ``env_index``: the environment to frame or follow; defaults to the middle one, which has neighbors on every side.
+* ``env_index``: the environment to frame or follow; defaults to the middle one.
* ``track_path``: a scene asset (``"robot"``) or one of its bodies (``"robot/base"``). Without it, the view stays
fixed in the environment.
* ``follow_heading``: rotate the offsets with the asset's yaw, keeping the horizon level.
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index 0414faf35edc..243f01ee7b07 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -482,8 +482,6 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
f"Declare a CameraCfg in the scene; available paths: {available_paths}."
)
cameras[index] = camera
- # tracking cameras come last, after the free view and the scene cameras
- cameras.sort(key=lambda camera: isinstance(camera, TrackingCameraCfg))
visualizer.initialize(self, cameras=cameras)
self._pending_visualizers.remove(visualizer)
self._visualizers.append(visualizer)
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
index 453de50c519a..5956dab9d19c 100644
--- a/source/isaaclab/isaaclab/visualizers/camera_follower.py
+++ b/source/isaaclab/isaaclab/visualizers/camera_follower.py
@@ -60,6 +60,11 @@ def __init__(self, cfg: TrackingCameraCfg, scene: InteractiveScene, env_ids: Seq
if cfg.track_path:
self.set_track_path(cfg.track_path)
+ @property
+ def env(self) -> int:
+ """Environment whose origin or asset the view follows."""
+ return self._env
+
def set_track_path(self, track_path: str | None) -> None:
"""Follow another asset or body, or only the environment origin when *track_path* is empty.
@@ -99,11 +104,6 @@ def body_names(self, asset_name: str) -> list[str]:
except KeyError:
return []
- @property
- def env(self) -> int:
- """Environment whose origin or asset the view follows."""
- return self._env
-
def set_env(self, index: int) -> None:
"""Follow environment *index* from now on, with the heading filter starting afresh.
@@ -113,6 +113,7 @@ def set_env(self, index: int) -> None:
if not 0 <= index < self._scene.num_envs:
raise ValueError(f"env_index {index} is outside the {self._scene.num_envs} environments of the scene.")
self._env = int(index)
+ self.cfg.env_index = self._env
self._yaw = self._raw_yaw = self._last_position = self._time = None
def pose(self, time: float) -> tuple[tuple[float, float, float], tuple[float, float, float]] | None:
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index 542ff016016e..8527ab52c3e5 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -80,7 +80,7 @@ class TrackingCameraCfg(PerspectiveCameraCfg):
env_index: int | None = None
"""Environment to frame, or the one holding the tracked asset; None picks the middle one of the visible
- environments, which has neighbors on every side."""
+ environments."""
track_path: str | None = None
"""Scene asset to follow, or None for a view fixed relative to the environment origin.
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
index d74f462f682d..fd935e29a073 100644
--- a/source/isaaclab/test/visualizers/test_camera_follower.py
+++ b/source/isaaclab/test/visualizers/test_camera_follower.py
@@ -66,7 +66,7 @@ def test_a_tracked_view_follows_the_asset_and_rotates_with_its_heading():
torch.testing.assert_close(_eye(follower), torch.tensor([7.0, 0.0, 1.5]))
-def test_smoothing_lags_a_turn_but_not_the_first_sample_or_a_reset():
+def test_smoothing_lags_a_turn_but_not_a_reset():
def run(jump: float) -> torch.Tensor:
scene = _Scene()
cfg = TrackingCameraCfg(track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
@@ -93,7 +93,7 @@ def run(yaw: float) -> torch.Tensor:
return torch.tensor(follower.pose(0.02)[0])
torch.testing.assert_close(run(math.pi / 2)[1], torch.tensor(-3.0), atol=1e-4, rtol=0) # 78 rad/s: a reset
- assert run(0.05)[1] > -0.2 # 2.5 rad/s: a turn, filtered toward the new heading
+ assert run(0.05)[1] > -0.05 # 2.5 rad/s: a turn; unfiltered it would be -0.15
def test_a_view_waits_for_its_asset_and_rejects_bad_targets():
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
index 1372c5bc3120..10c7600fd777 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
@@ -529,7 +529,6 @@ class FrankaPourResetDatasetEnvCfg(ManagerBasedRLEnvCfg):
scene: PourSceneCfg = PourSceneCfg(num_envs=2, env_spacing=2.5)
sim: sim_utils.SimulationCfg = sim_utils.SimulationCfg(
- # the viewport starts on the free view; the tracking camera is the next choice in the Camera Source list
visualizer_cfgs=VisualizerCfg(
cameras=[TrackingCameraCfg(eye=(1.4, 1.4, 0.9), lookat=(0.5, 0.0, 0.1))],
)
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
index 20a00898eb4a..0de9b2b2dae8 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
@@ -613,7 +613,6 @@ class UR10ParticlePushEnvCfg(ManagerBasedRLEnvCfg):
sim: SimulationCfg = SimulationCfg(
dt=1.0 / 120.0,
render_interval=decimation,
- # the viewport starts on the free view; the tracking camera is the next choice in the Camera Source list
visualizer_cfgs=VisualizerCfg(
cameras=[TrackingCameraCfg(eye=(1.7, 1.5, 1.0), lookat=(0.55, 0.0, 0.0))],
),
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
index 31c3dc3c9edb..e0b62e0345d6 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
@@ -239,7 +239,6 @@ def __post_init__(self) -> None:
# general settings
self.decimation = 2
self.episode_length_s = 5
- # Declare the tracking camera that --video viz:newton:tracking records.
self.sim.visualizer_cfgs = VisualizerCfg(
eye=(12.0, 0.0, 4.0),
cameras=[
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index cd18df797f6a..2ed935242f04 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -525,15 +525,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
raise ValueError("A tracking camera needs an interactive scene to follow.")
# fail at initialization, not on a frame: a bad env_index or track_path raises here
self._followers[view] = follower = CameraFollower(source, scene, self._env_ids)
- self._tracking_defaults[view] = {
- "eye": source.eye,
- "lookat": source.lookat,
- "focal_length": source.focal_length,
- "track_path": source.track_path,
- "follow_heading": source.follow_heading,
- "heading_smoothing_time_constant": source.heading_smoothing_time_constant,
- "env": follower.env,
- }
+ self._remember_tracking_defaults(view, follower)
if self._env_ids is not None and follower.env not in self._env_ids:
logger.warning(
"[NewtonVisualizer] A tracking camera frames environment %d, which is not among the visible "
@@ -784,6 +776,19 @@ def _reset_tracking_camera(self, follower: CameraFollower) -> bool:
self._set_tracking_path(follower, defaults["track_path"])
return True
+ def _remember_tracking_defaults(self, view, follower: CameraFollower) -> None:
+ """Keep what the task declared for a tracking *view*, which its reset control restores."""
+ source = view.cfg.source
+ self._tracking_defaults[view] = {
+ "eye": source.eye,
+ "lookat": source.lookat,
+ "focal_length": source.focal_length,
+ "track_path": source.track_path,
+ "follow_heading": source.follow_heading,
+ "heading_smoothing_time_constant": source.heading_smoothing_time_constant,
+ "env": follower.env,
+ }
+
def _apply_view_pose(self, view) -> bool:
"""Point the viewer camera where a task *view* looks, leaving the configured poses untouched.
@@ -809,14 +814,14 @@ def _capture_view(self, view, output: wp.array | None) -> wp.array:
return self._capture_frame(output)
camera = self._viewer.camera
saved = (PygletVec3(camera.pos.x, camera.pos.y, camera.pos.z), camera.pitch, camera.yaw, camera.fov)
- self.current_image_view = view
- if not self._is_tracking_view(view): # a free view renders from its declared pose and optics
- source = view.cfg.source
- camera.pos = PygletVec3(*source.eye)
- camera.look_at(source.lookat)
- self._viewer.set_camera(camera.pos, camera.pitch, camera.yaw)
- camera.fov = self._focal_length_to_vertical_fov_degrees(source.focal_length)
try:
+ self.current_image_view = view
+ if not self._is_tracking_view(view): # a free view renders from its declared pose and optics
+ source = view.cfg.source
+ camera.pos = PygletVec3(*source.eye)
+ camera.look_at(source.lookat)
+ self._viewer.set_camera(camera.pos, camera.pitch, camera.yaw)
+ camera.fov = self._focal_length_to_vertical_fov_degrees(source.focal_length)
self._last_render_step = -1
return self._capture_frame(output)
finally:
diff --git a/source/isaaclab_visualizers/test/test_newton_adapter.py b/source/isaaclab_visualizers/test/test_newton_adapter.py
index e9c4ef004c7e..80f7cba9cc72 100644
--- a/source/isaaclab_visualizers/test/test_newton_adapter.py
+++ b/source/isaaclab_visualizers/test/test_newton_adapter.py
@@ -948,7 +948,6 @@ def test_newton_scene_camera_controls_apply_uniformly_to_active_copies(monkeypat
back_frame = back.frame.torch.clone()
assert visualizer.current_image_view.camera is None
assert isinstance(visualizer._image_views[0].cfg.source, PerspectiveCameraCfg)
- # the task's own tracking camera comes after the scene cameras
assert [view.camera.cfg.prim_path for view in visualizer._image_views[1:] if view.camera is not None] == [
color.cfg.prim_path,
back.cfg.prim_path,
diff --git a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
index 389fc7ac2ec5..2109ae71ae49 100644
--- a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
+++ b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
@@ -124,13 +124,6 @@ def test_the_tracking_camera_recording_reports_a_visualizer_without_one():
_visualizer([_view(PerspectiveCameraCfg())]).render_tracking_rgb_array()
-def test_a_tracking_camera_without_a_follower_has_no_pose_instead_of_failing():
- task = _view(TrackingCameraCfg(env_index=1))
- viz = _visualizer([task])
- viz._followers.clear() # no interactive scene was registered when the viewer initialized
- assert not viz._apply_view_pose(task)
-
-
def test_the_selector_names_the_tracking_camera_and_the_free_perspective():
sensor = SimpleNamespace(camera=object(), cfg=SimpleNamespace(source="/World/envs/env_0/cam"))
viz = _visualizer([_view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=1))])
@@ -145,12 +138,7 @@ def test_resetting_the_tracking_camera_restores_what_the_task_declared():
task = _view(TrackingCameraCfg(env_index=0, eye=(1.0, 0.0, 0.0), track_path="robot", follow_heading=True))
viz = _visualizer([task])
cfg, follower = task.cfg.source, viz._followers[task]
- viz._tracking_defaults = {
- task: {
- "eye": cfg.eye, "lookat": cfg.lookat, "focal_length": cfg.focal_length, "track_path": "robot",
- "follow_heading": True, "heading_smoothing_time_constant": 0.0, "env": follower.env,
- }
- } # fmt: skip
+ viz._remember_tracking_defaults(task, follower)
cfg.eye, cfg.follow_heading = (5.0, 5.0, 5.0), False
follower.set_env(1)
follower.set_track_path(None)
From 338d3d3c035108ccea50ae55d686e5ac92542973 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 18 Nov 2026 01:04:18 +0000
Subject: [PATCH 025/140] Validate the tracking view when the recorder binds
and freeze the tracking camera with a paused scene
---
source/isaaclab/isaaclab/envs/direct_rl_env.py | 8 +++++---
.../isaaclab/isaaclab/envs/manager_based_rl_env.py | 8 +++++---
.../isaaclab/isaaclab/envs/utils/video_recorder.py | 5 +++++
source/isaaclab/test/app/test_remote_greetings.py | 6 +++---
source/isaaclab/test/envs/test_video_recorder.py | 12 ++++++++++++
.../isaaclab_visualizers/newton/newton_visualizer.py | 7 ++++++-
.../test/test_newton_tracking_cameras.py | 6 ++++++
7 files changed, 42 insertions(+), 10 deletions(-)
diff --git a/source/isaaclab/isaaclab/envs/direct_rl_env.py b/source/isaaclab/isaaclab/envs/direct_rl_env.py
index ea08d72ac536..0ea6b47cd986 100644
--- a/source/isaaclab/isaaclab/envs/direct_rl_env.py
+++ b/source/isaaclab/isaaclab/envs/direct_rl_env.py
@@ -535,9 +535,11 @@ def setup_direct_visualizers(self):
"""
scalars = {
"episode": {
- "mean_reward": lambda: float(getattr(self, "reward_buf", None).mean())
- if getattr(self, "reward_buf", None) is not None
- else 0.0,
+ "mean_reward": lambda: (
+ float(getattr(self, "reward_buf", None).mean())
+ if getattr(self, "reward_buf", None) is not None
+ else 0.0
+ ),
"episode_length": lambda: float(self.episode_length_buf.float().mean()),
}
}
diff --git a/source/isaaclab/isaaclab/envs/manager_based_rl_env.py b/source/isaaclab/isaaclab/envs/manager_based_rl_env.py
index c8687c4bbdff..6fa619bc35b2 100644
--- a/source/isaaclab/isaaclab/envs/manager_based_rl_env.py
+++ b/source/isaaclab/isaaclab/envs/manager_based_rl_env.py
@@ -157,9 +157,11 @@ def setup_manager_visualizers(self):
}
scalars = {
"episode": {
- "mean_reward": lambda: float(getattr(self, "reward_buf", None).mean())
- if getattr(self, "reward_buf", None) is not None
- else 0.0,
+ "mean_reward": lambda: (
+ float(getattr(self, "reward_buf", None).mean())
+ if getattr(self, "reward_buf", None) is not None
+ else 0.0
+ ),
"episode_length": lambda: float(self.episode_length_buf.float().mean()),
}
}
diff --git a/source/isaaclab/isaaclab/envs/utils/video_recorder.py b/source/isaaclab/isaaclab/envs/utils/video_recorder.py
index 5c704dc345da..36b34a8a57a3 100644
--- a/source/isaaclab/isaaclab/envs/utils/video_recorder.py
+++ b/source/isaaclab/isaaclab/envs/utils/video_recorder.py
@@ -76,6 +76,11 @@ def __init__(self, cfg: VideoRecorderCfg, env: object):
f"The {viz.cfg.backend.visualizer_type!r} visualizer cannot record a tracking view. Use "
"'viz:newton_gl:tracking'."
)
+ if not viz.has_tracking_view:
+ raise RuntimeError(
+ "The newton_gl visualizer declares no tracking camera to record. Add "
+ "TrackingCameraCfg(env_index=..., track_path=...) to its cameras."
+ )
self._capture = viz.render_tracking_rgb_array
else:
self._capture = viz.render_tiled_rgb_array if channel == "streaming_view" else viz.render_rgb_array
diff --git a/source/isaaclab/test/app/test_remote_greetings.py b/source/isaaclab/test/app/test_remote_greetings.py
index b2b787418075..19b7a0bf9879 100644
--- a/source/isaaclab/test/app/test_remote_greetings.py
+++ b/source/isaaclab/test/app/test_remote_greetings.py
@@ -70,9 +70,9 @@ def source(tmp_path, monkeypatch):
transport=remote._read_bytes,
)
source.read = Mock(
- side_effect=lambda url, limit: json.dumps(source.manifest).encode()
- if url.endswith("/manifest.json")
- else source.blob
+ side_effect=lambda url, limit: (
+ json.dumps(source.manifest).encode() if url.endswith("/manifest.json") else source.blob
+ )
)
monkeypatch.setenv("XDG_CACHE_HOME", str(source.cache))
monkeypatch.setattr(remote, "datetime", SimpleNamespace(now=lambda tz: source.now.astimezone(tz)))
diff --git a/source/isaaclab/test/envs/test_video_recorder.py b/source/isaaclab/test/envs/test_video_recorder.py
index 0d8574405dc6..00caa781f55d 100644
--- a/source/isaaclab/test/envs/test_video_recorder.py
+++ b/source/isaaclab/test/envs/test_video_recorder.py
@@ -58,6 +58,7 @@ def __init__(self, viz_type: str, frame: np.ndarray | None = None):
self.cfg = VisualizerCfg(backend=VisualizerBackendCfg(visualizer_type=viz_type))
self._frame = frame if frame is not None else _FRAME.copy()
self.render_calls = 0
+ self.has_tracking_view = True
def render_rgb_array(self) -> np.ndarray:
self.render_calls += 1
@@ -67,6 +68,11 @@ def supports_markers(self) -> bool:
return True
+def _without_tracking_view(viz: _FakeViz) -> _FakeViz:
+ viz.has_tracking_view = False
+ return viz
+
+
def _make_env(visualizers=(), sensors: dict | None = None):
env = SimpleNamespace(sim=MagicMock(), scene=SimpleNamespace(), step_dt=0.02)
env.sim.visualizers = list(visualizers)
@@ -279,6 +285,12 @@ def test_a_tracking_source_records_the_tracking_camera_not_the_selected_one():
RuntimeError,
"Enable streaming_view",
),
+ (
+ "viz:newton_gl:tracking",
+ lambda: _make_env(visualizers=[_without_tracking_view(_FakeViz("newton_gl"))]),
+ RuntimeError,
+ "declares no tracking camera",
+ ),
(
"viz:kit:tracking",
lambda: _make_env(visualizers=[_FakeViz("kit")]),
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 2ed935242f04..19987a078d12 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -958,6 +958,11 @@ def render_rgb_array(self) -> np.ndarray:
)
return self.current_image_view.read_rgb(frame_id)
+ @property
+ def has_tracking_view(self) -> bool:
+ """Whether a perspective view is tied to an environment or an asset."""
+ return any(self._is_tracking_view(view) for view in self._image_views)
+
def render_tracking_rgb_array(self) -> np.ndarray:
"""Download the first perspective view that is tied to an environment or an asset, whatever the window shows."""
view = next((v for v in self._image_views if self._is_tracking_view(v)), None)
@@ -1110,7 +1115,7 @@ def _render_frame(self) -> None:
"""Render one GL frame for the window or an on-demand capture."""
viewer = self._viewer
view = self.current_image_view
- if self._is_tracking_view(view):
+ if self._is_tracking_view(view) and not viewer.is_paused(): # a paused scene is frozen, so is its camera
self._apply_view_pose(view)
viewer.begin_frame(self._sim_time)
try:
diff --git a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
index 2109ae71ae49..e41ee0d3608d 100644
--- a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
+++ b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
@@ -163,3 +163,9 @@ def __getitem__(self, name):
assert not viz._set_tracking_path(follower, "ghost")
assert "unknown scene asset" in viz._tracking_error and task.cfg.source.track_path == "robot"
assert viz._set_tracking_path(follower, "robot") and viz._tracking_error == ""
+
+
+def test_a_visualizer_reports_whether_it_declares_a_tracking_view():
+ free, task = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=1))
+ assert not _visualizer([free]).has_tracking_view
+ assert _visualizer([free, task]).has_tracking_view
From 0438b74238d0814cd7d8a6d3d523077c72f219ca Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 11 Nov 2026 21:05:23 +0000
Subject: [PATCH 026/140] Add an RTX renderer toggle and rendering settings to
the Newton visualizer
---
docs/source/concepts/visualization.rst | 36 +
.../changelog.d/display-channels.added.rst | 3 +
.../rtx-viewer-camera-launch.added.rst | 3 +
source/isaaclab/isaaclab/app/sim_launcher.py | 65 +
.../isaaclab/sim/simulation_context.py | 10 +-
source/isaaclab/isaaclab/utils/images.py | 40 +-
.../isaaclab/visualizers/base_visualizer.py | 13 +-
.../app/test_launch_simulation_require_kit.py | 24 +
.../test/app/test_rtx_viewer_camera.py | 72 +
.../test_simulation_context_visualizers.py | 5 +-
.../test/visualizers/test_streaming_view.py | 49 +-
.../ovrtx-environment-visibility.added.rst | 2 +
.../ovrtx-mesh-color-type.fixed.rst | 2 +
.../isaaclab_ov/renderers/ovrtx_renderer.py | 88 +-
.../renderers/ovrtx_renderer_kernels.py | 16 +
.../test/test_ovrtx_hidden_environments.py | 105 ++
.../newton-gl-camera-sources.added.rst | 9 +
.../newton-gl-rtx-renderer-toggle.added.rst | 6 +
.../changelog.d/newton-impulse-drag.added.rst | 4 +
.../changelog.d/newton-pause-keys.changed.rst | 4 +
.../newton-picking-arrow.changed.rst | 2 +
.../newton-rtx-drag-arrow.fixed.rst | 2 +
.../changelog.d/newton-rtx-overlays.added.rst | 3 +
.../newton-rtx-paused-render.fixed.rst | 2 +
.../newton-rtx-tracking-reset.fixed.rst | 3 +
.../newton-sensor-channels.added.rst | 8 +
.../isaaclab_visualizers/newton/__init__.py | 1 +
.../newton/newton_impulse_drag.py | 162 ++
.../newton/newton_overlay_meshes.py | 245 +++
.../newton/newton_rtx_appearance.py | 324 ++++
.../newton/newton_visualizer.py | 1436 ++++++++++++++---
.../newton/newton_visualizer_cfg.py | 14 +
.../test/test_newton_adapter.py | 123 +-
.../test/test_newton_impulse_drag.py | 258 +++
.../test/test_newton_overlay_meshes.py | 114 ++
.../test/test_newton_rtx_appearance.py | 345 ++++
.../test/test_newton_task_views.py | 265 +++
.../test/test_newton_tracking_cameras.py | 5 +-
38 files changed, 3653 insertions(+), 215 deletions(-)
create mode 100644 source/isaaclab/changelog.d/display-channels.added.rst
create mode 100644 source/isaaclab/changelog.d/rtx-viewer-camera-launch.added.rst
create mode 100644 source/isaaclab/test/app/test_rtx_viewer_camera.py
create mode 100644 source/isaaclab_ov/changelog.d/ovrtx-environment-visibility.added.rst
create mode 100644 source/isaaclab_ov/changelog.d/ovrtx-mesh-color-type.fixed.rst
create mode 100644 source/isaaclab_ov/test/test_ovrtx_hidden_environments.py
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-gl-rtx-renderer-toggle.added.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-impulse-drag.added.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-pause-keys.changed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-picking-arrow.changed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-rtx-drag-arrow.fixed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-rtx-overlays.added.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-rtx-paused-render.fixed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-rtx-tracking-reset.fixed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-sensor-channels.added.rst
create mode 100644 source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_impulse_drag.py
create mode 100644 source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_overlay_meshes.py
create mode 100644 source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
create mode 100644 source/isaaclab_visualizers/test/test_newton_impulse_drag.py
create mode 100644 source/isaaclab_visualizers/test/test_newton_overlay_meshes.py
create mode 100644 source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
create mode 100644 source/isaaclab_visualizers/test/test_newton_task_views.py
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index a56a77b58926..a89bcc9caffa 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -292,6 +292,31 @@ Visualizer Overview
Try :ref:`Domino cascade ` for a compact 24-slab version running
locally in the browser, with friction and a repeatable toppling pulse.
+ **RTX rendering**
+
+ The **Renderer** selector in the Rendering Options section switches the main view to the OVRTX path tracer for
+ photorealistic rendering without a Kit process. It appears when the scene has the OVRTX viewer camera, which launch
+ declares when ``ovrtx`` is installed and the physics is not PhysX. RTX rendering is slightly slower than OpenGL.
+
+ .. raw:: html
+
+
+
Isaac-Velocity-Rough-H1 in the Newton Visualizer with RTX rendering Each H1 humanoid climbs a
+ staircase sub-terrain
+
+ Picking, visualization markers, camera selection, pause controls, Visible Envs, and headless recording work in
+ the RTX view. Model overlays and rigid-body dragging apply to the OpenGL view only.
+
+ .. warning::
+
+ OVRTX is a kitless renderer and cannot be used in the same process as Kit
+ (``presets=isaacsim_physx``). ``presets=ovphysx`` is itself kitless and works fine with
+ RTX rendering. Use ``presets=newton_mjwarp,ovrtx`` or ``presets=ovphysx,ovrtx`` with
+ ``--viz newton_gl``, or switch to ``--viz viser``, ``--viz rerun``,
+ or ``--viz kit`` with a Kit-compatible physics backend.
+
.. dropdown:: NewtonGLBackendCfg source
:icon: code
@@ -569,6 +594,10 @@ sit side by side with the default viewport for dual monitoring. **Newton GL** an
provide a **Camera View** selector in the sidebar for switching between perspective and scene-camera
views. A perspective view can also be a *tracking camera* that follows a robot or frames an environment; only Newton GL
supports it.
+Selecting a scene sensor in **Camera View** shows its channel: the **Channel** selector lists the
+sensor's outputs (RGB, depth, normals, or segmentation), and depth, normals, and segmentation are
+converted to colors for display. When the sensor is declared once per environment, **Tiled Envs**
+sets how many of its feeds are tiled into the window.
See :doc:`/source/how-to/visualizer_streaming_camera_view` for the ``VisualizerCfg`` options, display
sources, tracking cameras that follow a robot, troubleshooting, migration from generated cameras, and step-by-step examples.
@@ -832,6 +861,11 @@ without screen-sharing, running with ``--viz viser``:
The share URL is logged on startup. Rerun has no equivalent config field, but exposes its own
share button in the native UI.
+**Choosing how many environments are drawn**
+
+Every Newton viewer has a **Visible Envs** slider in its left panel that sets how many
+environments are drawn. It changes only what is rendered, not the simulation.
+
Resolution Rules
~~~~~~~~~~~~~~~~
@@ -1008,6 +1042,8 @@ Limitations
- ✗
- ✓
+In Newton's RTX view, model overlays and rigid-body dragging are not available.
+
**Lighting differences across visualizers**
Each backend lights the scene differently, so the same environment can look noticeably
diff --git a/source/isaaclab/changelog.d/display-channels.added.rst b/source/isaaclab/changelog.d/display-channels.added.rst
new file mode 100644
index 000000000000..752266d8356b
--- /dev/null
+++ b/source/isaaclab/changelog.d/display-channels.added.rst
@@ -0,0 +1,3 @@
+* Added :func:`~isaaclab.utils.images.display_channels` and :func:`~isaaclab.utils.images.resolve_display_channels`
+ to name the channels a camera sensor can show. Visualizers now list a scene camera that lacks the requested channels
+ with its own channel, and color images such as ``albedo`` and the simple shading outputs display as RGB.
diff --git a/source/isaaclab/changelog.d/rtx-viewer-camera-launch.added.rst b/source/isaaclab/changelog.d/rtx-viewer-camera-launch.added.rst
new file mode 100644
index 000000000000..5e31bd8f3495
--- /dev/null
+++ b/source/isaaclab/changelog.d/rtx-viewer-camera-launch.added.rst
@@ -0,0 +1,3 @@
+* Added an OVRTX viewer camera that the launcher declares in the scene for Newton GL windows, so the window can switch
+ its main view to OVRTX rendering. The window size is fitted to the display so the camera and the window share an
+ aspect ratio.
diff --git a/source/isaaclab/isaaclab/app/sim_launcher.py b/source/isaaclab/isaaclab/app/sim_launcher.py
index 42849eb9325e..a88396295895 100644
--- a/source/isaaclab/isaaclab/app/sim_launcher.py
+++ b/source/isaaclab/isaaclab/app/sim_launcher.py
@@ -8,6 +8,7 @@
from __future__ import annotations
import argparse
+import importlib.util
import logging
import os
import sys
@@ -164,6 +165,39 @@ def visit(node):
return tuple(configs)
+def _fit_window_to_display(size: tuple[int, int], margin: float = 0.92) -> tuple[int, int]:
+ """Shrink a window size, keeping its aspect ratio, so the window fits the display with room for decorations.
+
+ Args:
+ size: Requested window width and height [px].
+ margin: Fraction of the display the window may occupy.
+
+ Returns:
+ The requested size, or a proportionally smaller one; unchanged when the display size is unknown.
+ """
+ if sys.platform not in ("win32", "darwin") and not os.environ.get("DISPLAY"):
+ return size
+ try:
+ import pyglet # noqa: PLC0415
+
+ screen = pyglet.display.get_display().get_default_screen()
+ scale = min(1.0, margin * screen.width / size[0], margin * screen.height / size[1])
+ except Exception:
+ return size
+ return (max(1, int(size[0] * scale)), max(1, int(size[1] * scale)))
+
+
+def _wants_rtx_viewer_camera(visualizer: VisualizerCfg, simulations: list[SimulationCfg]) -> bool:
+ """Return whether a Newton GL window should get an OVRTX viewer camera in its scene."""
+ backend = visualizer.backend
+ if not isinstance(backend, NewtonGLBackendCfg) or visualizer.headless or visualizer.view is not None:
+ return False
+ if backend.rtx_camera is not None:
+ return backend.rtx_camera
+ on_physx = any(isinstance(sim.physics, (PhysxCfg, PhysxAutoCfg, OvPhysxCfg)) for sim in simulations)
+ return importlib.util.find_spec("ovrtx") is not None and not on_physx
+
+
def validate_launch( # noqa: C901
cfg, launcher_args: argparse.Namespace | dict | None = None
) -> tuple[tuple[Any, ...], tuple[str, ...]]:
@@ -316,6 +350,31 @@ def validate_launch( # noqa: C901
# Declare RTX perspective cameras before scene construction; runtime viewers only borrow their output.
scene_cfg = next((node for node in configs if isinstance(node, InteractiveSceneCfg)), None)
+ # A Newton GL window can switch its main view to an OVRTX camera, which must already exist in the scene.
+ implicit_viewer_cameras: list[tuple[str, VisualizerCfg, tuple[int, int], bool]] = []
+ for viewer_index, visualizer in enumerate(viewers):
+ if scene_cfg is None or not _wants_rtx_viewer_camera(visualizer, simulations):
+ continue
+ name = f"viewer_camera_{viewer_index}_rtx"
+ # The window must open at the camera's aspect ratio; an oversized window is clamped by the window manager.
+ declared = (visualizer.window.size, visualizer.streaming_view) # Restored if a Kit run drops the camera.
+ visualizer.window.size = _fit_window_to_display(visualizer.window.size)
+ width, height = visualizer.window.size
+ rotation = quat_from_matrix(create_rotation_matrix_from_view(
+ torch.tensor([visualizer.eye]), torch.tensor([visualizer.lookat]), "Z", device="cpu"
+ ))[0].tolist() # fmt: skip
+ implicit_viewer_cameras.append((name, visualizer, *declared))
+ vars(scene_cfg)[name] = CameraCfg(
+ prim_path=f"/World/{name}", width=width, height=height, data_types=["rgba"],
+ spawn=PinholeCameraCfg(
+ focal_length=visualizer.focal_length, vertical_aperture=15.2908,
+ horizontal_aperture=15.2908 * width / height,
+ ),
+ offset=CameraCfg.OffsetCfg(pos=visualizer.eye, rot=tuple(rotation), convention="opengl"),
+ renderer_cfg=visualizer.backend.rtx_renderer_cfg, background_color=visualizer.background_color,
+ render_settings={"omni:rtx:quality": ("Int", 0), **visualizer.backend.rtx_render_settings},
+ ) # fmt: skip
+ visualizer.streaming_view = True # The window lists scene cameras, including this one, as view sources.
for viewer_index, visualizer in enumerate(viewers):
if not isinstance(visualizer.backend, NewtonRTXBackendCfg) or scene_cfg is None:
continue
@@ -399,6 +458,12 @@ def validate_launch( # noqa: C901
node.max_visible_envs = max_visible
configs = _walk_runtime_configs(cfg, replacements)
+ if kit_sources and implicit_viewer_cameras:
+ # The OVRTX runtime cannot share a process with Kit, so a Kit run keeps the OpenGL view only.
+ for name, visualizer, window_size, streaming_view in implicit_viewer_cameras:
+ vars(scene_cfg).pop(name, None)
+ visualizer.window.size, visualizer.streaming_view = window_size, streaming_view
+ configs = _walk_runtime_configs(cfg, replacements)
if kit_sources:
for node in configs:
if isinstance(node, OvPhysxCfg):
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index 243f01ee7b07..2798afae83f4 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -31,7 +31,7 @@
from ..scene_data import REQUIRES_STAGE_AND_MODEL, SceneDataProvider
from ..utils import instantiate
from ..utils.device import reserve_cuda_graph_memory
-from ..utils.images import sensor_key_for_gt_type
+from ..utils.images import resolve_display_channels, sensor_key_for_gt_type
from ..utils.string import clear_resolve_matching_names_cache, string_to_callable
from ..utils.version import has_kit
from ..visualizers.base_visualizer import BaseVisualizer
@@ -454,12 +454,8 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
cameras.insert(0, SceneCameraCfg(prim_path=visualizer.cfg.streaming_sensor_prim_path))
else:
for camera in sensors.values():
- available = frozenset(camera.cfg.data_types)
- has_requested_channels = all(
- sensor_key_for_gt_type(gt, available, required=False) is not None
- for gt in visualizer.cfg.streaming_gt_types
- )
- if has_requested_channels:
+ # A sensor without the requested channels still shows its own, such as depth only.
+ if resolve_display_channels(visualizer.cfg.streaming_gt_types, camera.cfg.data_types):
cameras.append(camera)
for index, source in enumerate(cameras):
if not isinstance(source, SceneCameraCfg):
diff --git a/source/isaaclab/isaaclab/utils/images.py b/source/isaaclab/isaaclab/utils/images.py
index 0d7742c225a8..693d98d1ce30 100644
--- a/source/isaaclab/isaaclab/utils/images.py
+++ b/source/isaaclab/isaaclab/utils/images.py
@@ -527,7 +527,14 @@ def make_camera_output_grid(images: torch.Tensor) -> torch.Tensor:
_CAMERA_CHANNEL_KEYS = {
- "rgb": ("rgb", "rgba", "simple_shading_full_mdl"),
+ "rgb": (
+ "rgb",
+ "rgba",
+ "albedo",
+ "simple_shading_full_mdl",
+ "simple_shading_diffuse_mdl",
+ "simple_shading_constant_diffuse",
+ ),
"depth": ("depth", "distance_to_image_plane"),
"segmentation": ("semantic_segmentation", "instance_segmentation"),
"normals": ("normals",),
@@ -564,6 +571,37 @@ def sensor_key_for_gt_type(
raise KeyError(f"No sensor output found for GT type {gt_type!r}. Tried {keys}; available: {sorted(available_keys)}")
+DISPLAY_CHANNELS = ("rgb", "depth", "normals", "segmentation")
+"""Display channels in the order a viewer lists them; each has a colorizing kernel in :func:`compose_image`."""
+
+
+def display_channels(available_keys) -> tuple[str, ...]:
+ """Return the display channels a sensor can show, in :data:`DISPLAY_CHANNELS` order.
+
+ Args:
+ available_keys: Output names of the sensor, such as its ``data_types``.
+
+ Returns:
+ The channels among rgb, depth, normals, and segmentation that the sensor provides.
+ """
+ keys = frozenset(available_keys)
+ return tuple(c for c in DISPLAY_CHANNELS if sensor_key_for_gt_type(c, keys, required=False) is not None)
+
+
+def resolve_display_channels(requested, available_keys) -> tuple[str, ...]:
+ """Choose the channels to show for a sensor: the requested ones it provides, else its first channel.
+
+ Args:
+ requested: Channels asked for, in display order.
+ available_keys: Output names of the sensor, such as its ``data_types``.
+
+ Returns:
+ The channels to show, or an empty tuple when the sensor provides nothing a viewer can display.
+ """
+ provided = display_channels(available_keys)
+ return tuple(c for c in requested if c in provided) or provided[:1]
+
+
def compose_image(
output: wp.array,
sources: tuple[wp.array, ...],
diff --git a/source/isaaclab/isaaclab/visualizers/base_visualizer.py b/source/isaaclab/isaaclab/visualizers/base_visualizer.py
index d578fe2008d2..e6e01102550a 100644
--- a/source/isaaclab/isaaclab/visualizers/base_visualizer.py
+++ b/source/isaaclab/isaaclab/visualizers/base_visualizer.py
@@ -21,11 +21,13 @@
from ..utils import validate
from ..utils.backend_utils import FactoryBase
+from ..utils.images import resolve_display_channels
from .image_view import ImageView
from .key_event_source import KeyEventSource
from .visualizer_cfg import (
ImageViewCfg,
PerspectiveCameraCfg,
+ TrackingCameraCfg,
VisualizerBackendCfg,
VisualizerCfg,
migrate_visualizer_cfgs,
@@ -122,15 +124,24 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
pool = self._env_ids if self._env_ids is not None else range(num_envs)
num_tiles = min(int(self.cfg.streaming_envs), _VISUALIZER_MAX_TILES, len(pool))
env_ids = sorted(random.sample(pool, num_tiles))
+ task_views_only = bool(self.cfg.cameras) and all(
+ isinstance(camera, TrackingCameraCfg) for camera in self.cfg.cameras
+ )
+ automatic_sources = (
+ self.cfg.cameras is None or task_views_only
+ ) and self.cfg.streaming_sensor_prim_path is None
for camera in cameras:
if isinstance(camera, PerspectiveCameraCfg):
if self.cfg.backend.visualizer_type not in ("newton_gl", "newton_rtx"):
continue
view = sim.get_or_create_backend(ImageViewCfg(source=camera))
else:
+ channels = tuple(self.cfg.streaming_gt_types)
+ if automatic_sources: # Explicitly named sensors must provide what was requested.
+ channels = resolve_display_channels(channels, camera.cfg.data_types)
view_cfg = ImageViewCfg(
source=camera.cfg.prim_path, envs=(0,) if camera.num_instances == 1 else tuple(map(int, env_ids)),
- channels=tuple(self.cfg.streaming_gt_types),
+ channels=channels,
depth_range=(self.cfg.streaming_depth_min, self.cfg.streaming_depth_max),
) # fmt: skip
view = sim.get_or_create_backend(view_cfg, camera=camera)
diff --git a/source/isaaclab/test/app/test_launch_simulation_require_kit.py b/source/isaaclab/test/app/test_launch_simulation_require_kit.py
index c2a473d55ba5..dacad85e2667 100644
--- a/source/isaaclab/test/app/test_launch_simulation_require_kit.py
+++ b/source/isaaclab/test/app/test_launch_simulation_require_kit.py
@@ -137,6 +137,30 @@ def test_rtx_perspective_configuration_declares_scene_cameras(channels):
assert [item for item in vars(cfg.scene).values() if isinstance(item, sim_launcher.CameraCfg)] == cameras
+def test_kit_run_drops_the_implicit_ovrtx_viewer_camera(monkeypatch: pytest.MonkeyPatch):
+ """A Kit run cannot load the OVRTX runtime, so its Newton GL window keeps the OpenGL view only."""
+ monkeypatch.setattr(sim_launcher, "_fit_window_to_display", lambda size: (640, 360)) # As on a small display.
+ from isaaclab_visualizers.newton import NewtonGLBackendCfg
+
+ from isaaclab.scene import InteractiveSceneCfg
+ from isaaclab.visualizers import VisualizerCfg, WindowCfg
+
+ visualizer = VisualizerCfg(window=WindowCfg(size=(5000, 3000)), backend=NewtonGLBackendCfg(rtx_camera=True))
+ cfg = types.SimpleNamespace(
+ sim=SimulationCfg(physics=sim_launcher.NewtonCfg(), visualizer_cfgs=visualizer),
+ scene=InteractiveSceneCfg(num_envs=2, env_spacing=4.0),
+ )
+
+ configs, kit_sources = sim_launcher.validate_launch(cfg, {"require_kit": True})
+
+ assert kit_sources
+ assert not [name for name in vars(cfg.scene) if name.startswith("viewer_camera_")]
+ # The camera only justified fitting the window to the display and listing scene cameras, so none of it stays.
+ launched = cfg.sim.visualizer_cfgs[0] # The launcher may hold a copy of the declaration.
+ assert launched.window.size == (5000, 3000) and not launched.streaming_view
+ assert not [node for node in configs if isinstance(node, sim_launcher.OVRTXRendererCfg)]
+
+
@pytest.mark.parametrize(("outcome", "exit_code"), [("ok", 0), ("interrupt", 130), ("error", 1)])
def test_config_named_launcher_starts_and_closes(monkeypatch: pytest.MonkeyPatch, outcome, exit_code):
"""A config-selected launcher closes on success, interruption or failure with the matching exit status."""
diff --git a/source/isaaclab/test/app/test_rtx_viewer_camera.py b/source/isaaclab/test/app/test_rtx_viewer_camera.py
new file mode 100644
index 000000000000..f7703312eddf
--- /dev/null
+++ b/source/isaaclab/test/app/test_rtx_viewer_camera.py
@@ -0,0 +1,72 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Launch-time decisions for the OVRTX viewer camera that a Newton GL window can switch to."""
+
+import importlib.util
+import sys
+import types
+
+import pytest
+from isaaclab_physx.physics import PhysxCfg
+from isaaclab_visualizers.newton import NewtonGLBackendCfg
+
+import isaaclab.app.sim_launcher as sim_launcher
+from isaaclab.visualizers import VisualizerCfg
+
+
+def _fake_display(monkeypatch: pytest.MonkeyPatch, width: int = 1920, height: int = 1080) -> None:
+ """Make the launcher see an X display of the given size, whatever the host."""
+ screen = types.SimpleNamespace(width=width, height=height)
+ display = types.SimpleNamespace(get_default_screen=lambda: screen)
+ monkeypatch.setitem(
+ sys.modules, "pyglet", types.SimpleNamespace(display=types.SimpleNamespace(get_display=lambda: display))
+ )
+ monkeypatch.setattr(sys, "platform", "linux")
+ monkeypatch.setenv("DISPLAY", ":0")
+
+
+def test_oversized_window_shrinks_to_fit_the_display_keeping_its_aspect(monkeypatch: pytest.MonkeyPatch) -> None:
+ _fake_display(monkeypatch)
+
+ width, height = sim_launcher._fit_window_to_display((1920, 1080))
+
+ assert width <= 0.92 * 1920 and height <= 0.92 * 1080
+ assert abs(width / height - 1920 / 1080) < 0.01
+
+
+def test_window_that_already_fits_is_unchanged(monkeypatch: pytest.MonkeyPatch) -> None:
+ _fake_display(monkeypatch)
+
+ assert sim_launcher._fit_window_to_display((1280, 720)) == (1280, 720)
+
+
+def test_window_size_is_unchanged_without_a_display_to_query(monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.setattr(sys, "platform", "linux")
+ monkeypatch.delenv("DISPLAY", raising=False)
+
+ assert sim_launcher._fit_window_to_display((1920, 1080)) == (1920, 1080)
+
+
+@pytest.mark.parametrize(
+ ("rtx_camera", "headless", "physics", "ovrtx_installed", "expected"),
+ [
+ (True, False, PhysxCfg(), False, True),
+ (False, False, None, True, False),
+ (None, True, None, True, False),
+ (None, False, PhysxCfg(), True, False),
+ (None, False, None, False, False),
+ (None, False, None, True, True),
+ ],
+ ids=["explicit-on", "explicit-off", "recording-only-window", "physx", "no-ovrtx-package", "auto"],
+)
+def test_viewer_camera_is_declared_only_where_it_can_be_used(
+ monkeypatch: pytest.MonkeyPatch, rtx_camera, headless, physics, ovrtx_installed, expected
+) -> None:
+ monkeypatch.setattr(importlib.util, "find_spec", lambda name: object() if ovrtx_installed else None)
+ visualizer = VisualizerCfg(backend=NewtonGLBackendCfg(rtx_camera=rtx_camera), headless=headless)
+ simulations = [types.SimpleNamespace(physics=physics)]
+
+ assert sim_launcher._wants_rtx_viewer_camera(visualizer, simulations) is expected
diff --git a/source/isaaclab/test/sim/test_simulation_context_visualizers.py b/source/isaaclab/test/sim/test_simulation_context_visualizers.py
index 417e84c0026f..198e26ece672 100644
--- a/source/isaaclab/test/sim/test_simulation_context_visualizers.py
+++ b/source/isaaclab/test/sim/test_simulation_context_visualizers.py
@@ -755,10 +755,11 @@ def test_visualizer_construction_precedes_initialization_and_happens_once(monkey
assert seen == [cfg]
assert ctx._visualizers == [visualizer]
- # Automatic choices skip unsupported channels; explicit references fail before viewer initialization.
+ # Automatic choices show a sensor's own channel when it lacks the requested one; explicit references fail
+ # before viewer initialization.
for path, channel, expected, error in (
(None, "rgb", [camera], None),
- (None, "depth", [], None),
+ (None, "depth", [camera], None),
("/Missing/Camera", "rgb", None, (ValueError, "No scene Camera matches")),
("{ENV_REGEX_NS}/Camera", "depth", None, (KeyError, "No sensor output")),
(None, "optical_flow", None, (ValueError, "optical_flow")),
diff --git a/source/isaaclab/test/visualizers/test_streaming_view.py b/source/isaaclab/test/visualizers/test_streaming_view.py
index 38af9a6eaa1e..3f7180c042a6 100644
--- a/source/isaaclab/test/visualizers/test_streaming_view.py
+++ b/source/isaaclab/test/visualizers/test_streaming_view.py
@@ -23,7 +23,7 @@
from isaaclab.test.utils import DeviceScope, test_devices
from isaaclab.utils import replace
-from isaaclab.utils.images import compose_image, sensor_key_for_gt_type
+from isaaclab.utils.images import compose_image, display_channels, resolve_display_channels, sensor_key_for_gt_type
from isaaclab.utils.warp import ProxyArray
from isaaclab.visualizers import ImageView, ImageViewCfg
@@ -271,3 +271,50 @@ def test_window_and_recorder_share_fixed_device_image(device, monkeypatch):
sim.close_backend(view)
assert all(resource is not view for _, resource in sim._backend_registry)
camera.close.assert_not_called()
+
+
+@pytest.mark.parametrize(
+ "available,requested,shown",
+ [
+ (["rgb", "depth"], ["rgb"], ("rgb",)),
+ (["depth"], ["rgb"], ("depth",)), # A depth-only sensor shows depth when RGB is asked for.
+ (["rgba", "distance_to_image_plane", "normals"], ["normals", "depth"], ("normals", "depth")),
+ (["instance_segmentation", "motion_vectors"], ["rgb"], ("segmentation",)),
+ (["motion_vectors"], ["rgb"], ()), # Nothing a viewer can display.
+ ],
+)
+def test_a_sensor_shows_its_own_channel_when_the_requested_one_is_missing(available, requested, shown):
+ assert resolve_display_channels(requested, available) == shown
+
+
+@pytest.mark.parametrize("device", test_devices(DeviceScope.DEFAULT_CUDA))
+def test_switching_a_view_to_depth_recomposes_the_same_sensor(device):
+ wp.init()
+ rgba = np.full((1, 4, 4, 4), 200, np.uint8)
+ depth = np.full((1, 4, 4, 1), 5.0, np.float32)
+ camera = SimpleNamespace(
+ cfg=SimpleNamespace(data_types=["rgba", "depth"]),
+ data=SimpleNamespace(
+ output={
+ "rgba": ProxyArray(wp.array(rgba, device=device)),
+ "depth": ProxyArray(wp.array(depth, device=device)),
+ }
+ ),
+ )
+ view = ImageView(ImageViewCfg(source="camera", envs=(0,), channels=("rgb",)), camera=camera)
+ color = view.read(0).numpy()[..., :3].copy()
+ assert np.all(color == 200)
+ view.cfg.channels = ("depth",)
+ shown = view.read(1).numpy()[..., :3]
+ np.testing.assert_array_equal(shown, _reference_colorize(depth[0], "depth"))
+ view.cfg.depth_range = (0.1, 5.0) # Changing the color scale recolors without reselecting the sensor.
+ assert not np.array_equal(view.read(2).numpy()[..., :3], shown)
+
+
+def test_display_channels_come_in_viewer_order():
+ assert display_channels(["instance_segmentation", "normals", "rgba", "depth"]) == (
+ "rgb",
+ "depth",
+ "normals",
+ "segmentation",
+ )
diff --git a/source/isaaclab_ov/changelog.d/ovrtx-environment-visibility.added.rst b/source/isaaclab_ov/changelog.d/ovrtx-environment-visibility.added.rst
new file mode 100644
index 000000000000..2a6b1dbc810d
--- /dev/null
+++ b/source/isaaclab_ov/changelog.d/ovrtx-environment-visibility.added.rst
@@ -0,0 +1,2 @@
+* Added :meth:`~isaaclab_ov.renderers.OVRTXRenderer.set_environment_visibility` to hide the bodies and markers of
+ cloned environments in the scene shared by every OVRTX camera.
diff --git a/source/isaaclab_ov/changelog.d/ovrtx-mesh-color-type.fixed.rst b/source/isaaclab_ov/changelog.d/ovrtx-mesh-color-type.fixed.rst
new file mode 100644
index 000000000000..d95e26175813
--- /dev/null
+++ b/source/isaaclab_ov/changelog.d/ovrtx-mesh-color-type.fixed.rst
@@ -0,0 +1,2 @@
+* Fixed :meth:`~isaaclab_ov.renderers.OVRTXRenderer.log_mesh` failing with a USD type mismatch when the mesh color
+ was a NumPy row or a sequence of NumPy scalars rather than a three-float tuple.
diff --git a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
index b69b8677c0a7..5953775852ea 100644
--- a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
+++ b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
@@ -91,6 +91,7 @@
create_marker_transforms_kernel,
extract_all_tiles_kernel,
generate_random_colors_from_ids_kernel,
+ hide_environment_bodies_kernel,
normalize_mesh_normals,
)
from isaaclab_ov.renderers.ovrtx_shader_cache import redirect_shader_cache
@@ -122,6 +123,8 @@
_RENDER_DELTA_TIME = 1.0 / 60.0
_GPU_CAMERA_TRANSFORMS_ATTRIBUTE = "omni:rtx:scene:hydra:readGPUCameraTransformsFromFabricInRenderDelegate"
_LDR_COLOR_VAR = "LdrColor"
+_HIDDEN_DROP = wp.float64(1.0e6)
+"""Distance [m] below the scene to which the bodies of hidden environments are moved."""
_CAMERA_INTRINSIC_ATTRIBUTES = (
"focalLength",
"horizontalAperture",
@@ -393,6 +396,10 @@ def __init__(self, cfg: OVRTXRendererCfg, *, sim: SimulationContext):
self._transform_writes = _AsyncWriteBuffers(SceneDataFormat.TransposedMatrix44d() for _ in range(2))
self._object_scales: wp.array | None = None
self._geometry_paths: list[str] = []
+ self._visible_envs: np.ndarray | None = None
+ self._hidden_envs: wp.array | None = None
+ self._body_envs: wp.array | None = None
+ self._hidden_matrices: dict[int, wp.array] = {}
self._geometry_offsets: dict[str, int] = {}
self._geometry_writes = _AsyncWriteBuffers[wp.array]()
self._geometry_timestamp = -1
@@ -409,6 +416,7 @@ def __init__(self, cfg: OVRTXRendererCfg, *, sim: SimulationContext):
self._object_xform_binding: AttributeBinding[wp.array] | ovstage.Query | None = None
self._geometry_points_binding: AttributeBinding[list[wp.array]] | ovstage.Query | None = None
self._bindings = contextlib.ExitStack()
+ self._env_paths: Sequence[str] = ()
@property
def visual_material_writer(self):
@@ -424,7 +432,7 @@ def _create_visual_material_writer(self, batches: tuple[VisualMaterialBatch, ...
def prepare_stage(self, stage: Usd.Stage, num_envs: int) -> None:
"""Load, clone, and bind the shared scene before any camera products are registered."""
logger.info("Preparing stage (%d envs)...", num_envs)
- env_paths = self.scene.clone_env_paths
+ env_paths = self._env_paths = self.scene.clone_env_paths
light_partitions = _resolve_env_light_partitions(stage, env_paths, copies=self.scene.clone_copies)
if self.cfg.temp_usd_dir is not None or not self._use_ovstage or not self.scene.ordinal:
if self.cfg.temp_usd_dir is not None:
@@ -1038,6 +1046,76 @@ def _process_render_products(
data.warp_buffers[str(RenderBufferKind.RGBA)],
)
+ def set_environment_visibility(self, visible: Sequence[bool]) -> None:
+ """Show or hide whole cloned environments' bodies and markers in every camera that renders the scene.
+
+ Writing the USD ``visibility`` of a cloned environment corrupts the transforms of its bodies once it is shown
+ again, so hidden bodies are instead moved far below the scene when their poses are published.
+
+ Args:
+ visible: Per-environment flag, in environment order.
+ """
+ num_envs = len(self._env_paths)
+ if len(visible) != num_envs:
+ raise ValueError(f"Expected {num_envs} visibility flags, got {len(visible)}.")
+ self._visible_envs = np.asarray(visible, dtype=bool)
+ hidden = np.zeros(num_envs + 1, dtype=np.uint8) # The last entry stands for bodies outside any environment.
+ hidden[:num_envs] = ~self._visible_envs
+ self._hidden_envs = wp.array(hidden, dtype=wp.uint8, device=self._device) if hidden.any() else None
+ self._transforms_timestamp = -1 # Publish the poses again even when the simulation has not stepped.
+
+ def _visible_marker_rows(self, marker: Any) -> tuple:
+ """Return the marker's translations, orientations, scales, and indices for the visible environments only.
+
+ A batch whose size divides by the environment count is laid out environment-major; other batches are global.
+ """
+ tensors = (marker.translations, marker.orientations, marker.scales, marker.marker_indices)
+ mask, num_envs, count = self._visible_envs, len(self._env_paths), len(marker.translations)
+ if mask is None or mask.all() or num_envs == 0 or count % num_envs:
+ return tensors
+ keep = torch.as_tensor(mask, device=marker.translations.device)
+ per_env = count // num_envs
+ return tuple(
+ None if t is None else t.reshape(num_envs, per_env, *t.shape[1:])[keep].flatten(0, 1) for t in tensors
+ )
+
+ def _body_environment_ids(self) -> wp.array:
+ """Return each published body's environment index, or ``num_envs`` for a body outside any environment."""
+ paths = self._sdp.backend.transform_paths
+ if self._body_envs is None or len(self._body_envs) != len(paths):
+ roots = {root: i for i, root in enumerate(self._env_paths)}
+ outside = len(self._env_paths)
+ env_ids = []
+ for path in paths:
+ env_id, end = outside, path.rfind("/")
+ while end > 0: # Walk up the prim path until it reaches an environment root.
+ env_id = roots.get(path[:end], outside)
+ if env_id != outside:
+ break
+ end = path.rfind("/", 0, end)
+ env_ids.append(env_id)
+ self._body_envs = wp.array(env_ids, dtype=wp.int32, device=self._device)
+ return self._body_envs
+
+ def _hide_environment_bodies(self, matrices: wp.array, stream: wp.Stream) -> wp.array:
+ """Return the body poses with those of hidden environments moved out of view."""
+ if self._hidden_envs is None:
+ return matrices
+ body_envs = self._body_environment_ids()
+ # A published buffer may be shared with other consumers, so hidden poses are written to a copy. The copy is
+ # kept per source buffer: an asynchronous write still reads it until the source buffer is acquired again.
+ hidden = self._hidden_matrices.get(matrices.ptr)
+ if hidden is None or len(hidden) != len(matrices):
+ hidden = self._hidden_matrices[matrices.ptr] = wp.empty(len(matrices), dtype=wp.mat44d, device=self._device)
+ wp.launch(
+ hide_environment_bodies_kernel,
+ len(matrices),
+ [matrices, body_envs, self._hidden_envs, _HIDDEN_DROP, hidden],
+ device=self._device,
+ stream=stream,
+ )
+ return hidden
+
def update_transforms(self) -> None:
"""Write changed SDP transforms to OVRTX."""
binding = self._object_xform_binding
@@ -1051,7 +1129,7 @@ def update_transforms(self) -> None:
output = self._transform_writes.acquire(stream)
if not self._sdp.get_transforms(output, allow_passthrough=not asynchronous, scales=self._object_scales):
return
- matrices = output.matrices
+ matrices = self._hide_environment_bodies(output.matrices, stream)
if self._use_ovstage:
# The write waits for consumption; the producing CUDA stream orders access to the
# borrowed buffer.
@@ -1083,7 +1161,7 @@ def update_geometries(self) -> None:
if marker not in self.markers:
self.markers[marker] = OVRTXMarkers(self, marker.cfg)
self.markers[marker].update(
- marker.translations, marker.orientations, marker.scales, marker.marker_indices,
+ *self._visible_marker_rows(marker),
visible=marker.is_visible(),
) # fmt: skip
binding = self._geometry_points_binding
@@ -1354,6 +1432,8 @@ def update(
normals = self._normals
if self._face_counts is None or len(self._face_counts) != len(indices) // 3:
self._face_counts = wp.full(len(indices) // 3, 3, dtype=wp.int32, device=indices.device)
+ if color is not None:
+ color = tuple(float(channel) for channel in color[:3]) # Callers pass NumPy rows or sequences.
appearance = tuple(
old if value is None else value
for old, value in zip(
@@ -1384,7 +1464,7 @@ def update(
if populate:
mesh.CreateDoubleSidedAttr(not appearance[0])
for name, value in zip(("diffuseColor", "roughness", "metallic", "opacity"), appearance[1:], strict=True):
- surface.GetInput(name).Set(value)
+ surface.GetInput(name).Set(Gf.Vec3f(*value) if name == "diffuseColor" else value)
self._appearance = appearance
if uvs is not None and not UsdGeom.PrimvarsAPI(mesh).HasPrimvar("st"):
UsdGeom.PrimvarsAPI(mesh).CreatePrimvar(
diff --git a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer_kernels.py b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer_kernels.py
index 47bf38b70a49..c972fd40695f 100644
--- a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer_kernels.py
+++ b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer_kernels.py
@@ -34,6 +34,22 @@ def create_marker_transforms_kernel(
transforms[i] = local_transforms[i] * wp.transpose(wp.transform_compose(p, q, s))
+@wp.kernel(enable_backward=False)
+def hide_environment_bodies_kernel(
+ transforms: wp.array(dtype=wp.mat44d),
+ body_envs: wp.array(dtype=wp.int32),
+ hidden_envs: wp.array(dtype=wp.uint8),
+ drop: wp.float64,
+ out: wp.array(dtype=wp.mat44d),
+):
+ """Copy row-vector body poses, moving the bodies of hidden environments down by ``drop`` [m]."""
+ i = wp.tid()
+ pose = transforms[i]
+ if hidden_envs[body_envs[i]] != wp.uint8(0):
+ pose[3, 2] = pose[3, 2] - drop
+ out[i] = pose
+
+
@wp.kernel
def create_camera_transforms_kernel(
positions: wp.array(dtype=wp.vec3), # type: ignore
diff --git a/source/isaaclab_ov/test/test_ovrtx_hidden_environments.py b/source/isaaclab_ov/test/test_ovrtx_hidden_environments.py
new file mode 100644
index 000000000000..abe6ffcad148
--- /dev/null
+++ b/source/isaaclab_ov/test/test_ovrtx_hidden_environments.py
@@ -0,0 +1,105 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Unit tests for hiding the bodies and markers of cloned environments in the OVRTX scene."""
+
+from __future__ import annotations
+
+from types import SimpleNamespace
+
+import numpy as np
+import pytest
+import torch
+import warp as wp
+
+pytest.importorskip("ovrtx")
+
+from isaaclab_ov.renderers.ovrtx_renderer import OVRTXRenderer # noqa: E402
+from isaaclab_ov.renderers.ovrtx_renderer_kernels import hide_environment_bodies_kernel # noqa: E402
+
+
+def test_hidden_environments_drop_only_their_own_bodies():
+ # Row-vector matrices keep the translation in the last row; bodies 0-1 are in env 0, 2 in env 1, 3 in no env.
+ poses = np.tile(np.eye(4), (4, 1, 1))
+ poses[:, 3, :3] = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]
+ body_envs = wp.array([0, 0, 1, 2], dtype=wp.int32, device="cpu")
+ hidden = wp.array([0, 1, 0], dtype=wp.uint8, device="cpu") # Env 1 is hidden; the last entry is "no env".
+ out = wp.empty(4, dtype=wp.mat44d, device="cpu")
+
+ wp.launch(
+ hide_environment_bodies_kernel,
+ 4,
+ [wp.array(poses, dtype=wp.mat44d, device="cpu"), body_envs, hidden, wp.float64(100.0), out],
+ device="cpu",
+ )
+
+ result = out.numpy()
+ np.testing.assert_allclose(result[:, 3, 2], [3, 6, 9 - 100, 12])
+ np.testing.assert_allclose(result[:, 3, :2], poses[:, 3, :2])
+
+
+def _renderer(visible):
+ renderer = object.__new__(OVRTXRenderer)
+ renderer._env_paths = ["/World/envs/env_0", "/World/envs/env_1", "/World/envs/env_2"]
+ renderer._visible_envs = None if visible is None else np.asarray(visible, dtype=bool)
+ return renderer
+
+
+def test_markers_keep_only_the_rows_of_visible_environments():
+ marker = SimpleNamespace(
+ translations=torch.arange(0.0, 12.0, 2.0)[:, None].repeat(1, 3), # 6 markers: 2 per env
+ orientations=None,
+ scales=None,
+ marker_indices=torch.tensor([0, 1, 0, 1, 0, 1]),
+ )
+
+ translations, orientations, scales, indices = _renderer([True, False, True])._visible_marker_rows(marker)
+
+ assert translations[:, 0].tolist() == [0.0, 2.0, 8.0, 10.0]
+ assert orientations is None and scales is None
+ assert indices.tolist() == [0, 1, 0, 1]
+
+
+def test_markers_are_untouched_when_all_environments_show_or_the_batch_is_global():
+ marker = SimpleNamespace(
+ translations=torch.zeros(4, 3), orientations=None, scales=None, marker_indices=None
+ ) # 4 markers do not divide by 3 environments, so they are global.
+
+ assert _renderer([True, False, True])._visible_marker_rows(marker)[0] is marker.translations
+ assert _renderer([True, True, True])._visible_marker_rows(marker)[0] is marker.translations
+ assert _renderer(None)._visible_marker_rows(marker)[0] is marker.translations
+
+
+def test_bodies_map_to_the_environment_that_contains_their_prim_path():
+ renderer = _renderer(None)
+ renderer._device = "cpu"
+ renderer._body_envs = None
+ paths = [
+ "/World/envs/env_0/Robot/base",
+ "/World/envs/env_2/Robot/arm/link_3",
+ "/World/envs/env_1", # The environment root itself is not inside one.
+ "/World/ground",
+ "/World/envs/env_10/Robot", # Shares a prefix with env_1 but is not env_1.
+ ]
+ renderer._sdp = SimpleNamespace(backend=SimpleNamespace(transform_paths=paths))
+
+ assert renderer._body_environment_ids().numpy().tolist() == [0, 2, 3, 3, 3]
+
+
+def test_hidden_poses_use_one_buffer_per_source_buffer():
+ renderer = _renderer(None)
+ renderer._device = "cpu"
+ renderer._body_envs = wp.array([0, 1], dtype=wp.int32, device="cpu")
+ renderer._hidden_matrices = {}
+ renderer._hidden_envs = wp.array([1, 0, 0, 0], dtype=wp.uint8, device="cpu")
+ renderer._sdp = SimpleNamespace(backend=SimpleNamespace(transform_paths=["a", "b"]))
+ sources = [wp.zeros(2, dtype=wp.mat44d, device="cpu") for _ in range(2)]
+
+ first = [renderer._hide_environment_bodies(source, None) for source in sources]
+ again = [renderer._hide_environment_bodies(source, None) for source in sources]
+
+ # An asynchronous write may still read the previous frame's copy, so alternating sources must not share one.
+ assert first[0].ptr != first[1].ptr
+ assert [a.ptr for a in again] == [f.ptr for f in first]
diff --git a/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst b/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst
new file mode 100644
index 000000000000..46d8e859bfdb
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst
@@ -0,0 +1,9 @@
+* The Newton GL Camera Source list now reads Perspective, Tracking Camera, then the scene cameras by their own names
+ (for example "Camera (sensor)"). A scene camera with one image per environment shows one environment at a time, with
+ an Environment field to switch it and a Tile Environments option for the previous side-by-side layout.
+* Added an RTX Appearance section to the Newton GL Camera View, shown instead of the OpenGL Appearance options while
+ the Renderer is RTX. It changes the OVRTX view's background (the dome light's sky or one color) and its lights while
+ running: the scene's own lights (on by default) with an intensity scale and a color tint, a dome light with an
+ intensity, a color, and a sky texture chosen from the HDR skies tasks already use or a file, and a distant light with
+ an intensity, a color, an angle, an elevation, and an azimuth. The dome and distant lights are off by default. The
+ OpenGL options (sky, shadows, wireframe, colors) do not affect the OVRTX image.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-gl-rtx-renderer-toggle.added.rst b/source/isaaclab_visualizers/changelog.d/newton-gl-rtx-renderer-toggle.added.rst
new file mode 100644
index 000000000000..f23adbf2b82f
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-gl-rtx-renderer-toggle.added.rst
@@ -0,0 +1,6 @@
+* Added :attr:`~isaaclab_visualizers.newton.NewtonGLBackendCfg.rtx_camera` and a Renderer toggle (OpenGL or RTX)
+ in the Newton GL HUD's Rendering Options section. The toggle keeps the camera pose, and the OVRTX camera renders only
+ while it is selected.
+* Added right-click picking, visualization markers, and a window-filling image to the OVRTX view of the Newton GL
+ window, so switching renderers no longer leaves thin black bars.
+* Added Visible Envs support to the OVRTX view of the Newton GL window.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-impulse-drag.added.rst b/source/isaaclab_visualizers/changelog.d/newton-impulse-drag.added.rst
new file mode 100644
index 000000000000..7005f266630c
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-impulse-drag.added.rst
@@ -0,0 +1,4 @@
+* Added Impulse Drag to the Newton visualizer. While the simulation is paused, right-clicking and dragging on a body
+ aims an impulse as an arrow that stays after the button is released. Several impulses can wait, and they are applied
+ once when the simulation resumes. The arrow's color runs from green through yellow to red with the size of the
+ impulse. The Control Bindings list describes it.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-pause-keys.changed.rst b/source/isaaclab_visualizers/changelog.d/newton-pause-keys.changed.rst
new file mode 100644
index 000000000000..65b4fa1bc67c
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-pause-keys.changed.rst
@@ -0,0 +1,4 @@
+* Changed the Newton visualizer's Space key to pause and resume the simulation, and added Shift + Space to pause and
+ resume rendering. The Control Bindings list is split into Camera, Objects, Playback, and Window sections.
+* Changed the arrow drawn while dragging a body to change color from green to red with its length, whether or not the
+ simulation is paused.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-picking-arrow.changed.rst b/source/isaaclab_visualizers/changelog.d/newton-picking-arrow.changed.rst
new file mode 100644
index 000000000000..1e1c403ece66
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-picking-arrow.changed.rst
@@ -0,0 +1,2 @@
+* Changed the Newton visualizer to draw the drag of a picked body as a larger arrow, from the picked point to the cursor
+ target, instead of a thin line.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-rtx-drag-arrow.fixed.rst b/source/isaaclab_visualizers/changelog.d/newton-rtx-drag-arrow.fixed.rst
new file mode 100644
index 000000000000..1b3c634be1d7
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-rtx-drag-arrow.fixed.rst
@@ -0,0 +1,2 @@
+* Fixed the drag arrow and the queued impulse arrows of the Newton visualizer not appearing in the OVRTX view unless a
+ visual overlay such as contacts was enabled.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-rtx-overlays.added.rst b/source/isaaclab_visualizers/changelog.d/newton-rtx-overlays.added.rst
new file mode 100644
index 000000000000..cd82d101d617
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-rtx-overlays.added.rst
@@ -0,0 +1,3 @@
+* Added joint, contact, spring, center-of-mass, and inertia-box overlays to the Newton visualizer's RTX view. Newton's
+ line and arrow overlays are republished as thin meshes in the OVRTX scene. Collision shapes, visual meshes, edges,
+ and the gap and margin wireframes remain OpenGL only.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-rtx-paused-render.fixed.rst b/source/isaaclab_visualizers/changelog.d/newton-rtx-paused-render.fixed.rst
new file mode 100644
index 000000000000..059cd42bc81e
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-rtx-paused-render.fixed.rst
@@ -0,0 +1,2 @@
+* Fixed the OVRTX view of the Newton visualizer not updating while the simulation is paused, so that the drag and
+ impulse arrows, and moving the camera, now show in it.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-rtx-tracking-reset.fixed.rst b/source/isaaclab_visualizers/changelog.d/newton-rtx-tracking-reset.fixed.rst
new file mode 100644
index 000000000000..ce65c993dd7a
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-rtx-tracking-reset.fixed.rst
@@ -0,0 +1,3 @@
+* Fixed "Reset to Task Default" doing nothing for a Tracking Camera while the RTX renderer is selected, and made the
+ Newton window remember the free Perspective camera's pose and focal length while another camera source is shown, so
+ switching back restores them instead of the task's initial pose.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-sensor-channels.added.rst b/source/isaaclab_visualizers/changelog.d/newton-sensor-channels.added.rst
new file mode 100644
index 000000000000..b9e34910b278
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-sensor-channels.added.rst
@@ -0,0 +1,8 @@
+* Added a Channel selector to the Camera Sensor controls of the Newton visualizer: a scene camera can show its color
+ image, depth, normals, or segmentation, or all of them side by side, with a depth range for the color scale. Every
+ scene camera with a displayable output now appears in Camera Source, named by its outputs, such as
+ ``Camera (depth sensor)``, so depth-only and segmentation-only sensors can be viewed.
+ The Renderer selector is greyed out while a scene camera is selected, since the sensor is rendered by its own
+ renderer.
+ A multi-environment scene camera now tiles its first 16 environments by default, and "Tiled Envs" sets how many are
+ shown side by side (1 shows the single environment chosen with "Environment").
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/__init__.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/__init__.py
index cf839f096d4b..7f74962ee265 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/__init__.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/__init__.py
@@ -33,6 +33,7 @@
# GL backend
"NewtonGLVisualizer",
"NewtonGLBackendCfg",
+ "NewtonGLVisualizerCfg",
# RTX backend
"NewtonRTXVisualizer",
"NewtonRTXBackendCfg",
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_impulse_drag.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_impulse_drag.py
new file mode 100644
index 000000000000..5af1614b8ef8
--- /dev/null
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_impulse_drag.py
@@ -0,0 +1,162 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Impulse Drag: aim pushes at bodies while the simulation is paused and apply them when it resumes."""
+
+from __future__ import annotations
+
+from dataclasses import dataclass
+
+import numpy as np
+import warp as wp
+
+IMPULSE_GAIN = 6.0
+"""Speed given to a body per meter the arrow is dragged [m/s per m]."""
+MAX_IMPULSE_SPEED = 6.0
+"""Largest speed change an impulse can give a body [m/s]. Longer arrows are clamped to it."""
+MAX_IMPULSES = 16
+"""Impulses that can wait for the simulation to resume."""
+
+
+@wp.kernel
+def _apply_impulses(
+ body_q: wp.array[wp.transform],
+ body_com: wp.array[wp.vec3],
+ body_f: wp.array[wp.spatial_vector],
+ bodies: wp.array[int],
+ points: wp.array[wp.vec3],
+ impulses: wp.array[wp.vec3],
+ inverse_dt: wp.array[float],
+):
+ i = wp.tid()
+ body = bodies[i]
+ if body < 0:
+ return
+ transform = body_q[body]
+ point = wp.transform_point(transform, points[i])
+ com = wp.transform_point(transform, body_com[body])
+ force = impulses[i] * inverse_dt[0]
+ wp.atomic_add(body_f, body, wp.spatial_vector(force, wp.cross(point - com, force)))
+ bodies[i] = -1 # Applied once: the next solver substep finds the slot empty.
+
+
+def impulse_color(fraction: float) -> tuple[float, float, float]:
+ """Return the arrow color for an impulse of ``fraction`` of the largest one: green, yellow, then red."""
+ t = min(max(float(fraction), 0.0), 1.0)
+ if t < 0.5:
+ return (2.0 * t, 1.0, 0.1)
+ return (1.0, 2.0 * (1.0 - t), 0.1)
+
+
+@dataclass
+class Impulse:
+ """One impulse waiting to be applied."""
+
+ body: int
+ """Index of the body the arrow starts on."""
+ point: np.ndarray
+ """Start of the arrow in the body's frame [m]."""
+ vector: np.ndarray
+ """Impulse [N·s], in the world frame."""
+ fraction: float
+ """Size of the impulse relative to the largest one, between 0 and 1."""
+
+
+def make_impulse(body: int, point: np.ndarray, displacement: np.ndarray, mass: float) -> Impulse:
+ """Turn an arrow dragged from a point on a body into the impulse it stands for.
+
+ Args:
+ body: Index of the body.
+ point: Start of the arrow in the body's frame [m].
+ displacement: The arrow, from the picked point to the cursor target, in the world frame [m].
+ mass: Mass the impulse acts on [kg].
+
+ Returns:
+ The impulse. Its speed change is :data:`IMPULSE_GAIN` per meter of arrow, up to :data:`MAX_IMPULSE_SPEED`.
+ """
+ length = float(np.linalg.norm(displacement))
+ if length < 1e-9:
+ return Impulse(body, np.asarray(point, dtype=np.float32), np.zeros(3, dtype=np.float32), 0.0)
+ speed = min(IMPULSE_GAIN * length, MAX_IMPULSE_SPEED)
+ vector = (displacement / length * speed * mass).astype(np.float32)
+ return Impulse(body, np.asarray(point, dtype=np.float32), vector, speed / MAX_IMPULSE_SPEED)
+
+
+class ImpulseDrag:
+ """Impulses aimed while paused, applied through the solver's force callback on the next step.
+
+ The buffers have a fixed size and address so that the CUDA graph that records the solver substeps keeps working;
+ the kernel empties a slot as it applies it.
+ """
+
+ def __init__(self, device, substep_dt: float):
+ """Create the buffers.
+
+ Args:
+ device: Warp device of the model.
+ substep_dt: Duration of one solver substep [s].
+ """
+ self._device = device
+ self.entries: list[Impulse] = []
+ self._bodies = wp.full(MAX_IMPULSES, -1, dtype=int, device=device)
+ self._points = wp.zeros(MAX_IMPULSES, dtype=wp.vec3, device=device)
+ self._impulses = wp.zeros(MAX_IMPULSES, dtype=wp.vec3, device=device)
+ self._inverse_dt = wp.array([1.0 / substep_dt], dtype=float, device=device)
+
+ def set_substep_dt(self, substep_dt: float) -> None:
+ """Set the duration of one solver substep [s], which the impulse is applied over."""
+ self._inverse_dt.assign(np.array([1.0 / substep_dt], dtype=np.float32))
+
+ @property
+ def full(self) -> bool:
+ """Whether no more impulses can be added."""
+ return len(self.entries) >= MAX_IMPULSES
+
+ def add(self, impulse: Impulse) -> bool:
+ """Queue an impulse, replacing the one already waiting on the same body.
+
+ Returns:
+ False when the impulse is empty or the queue is full, so nothing was queued.
+ """
+ if impulse.fraction <= 0.0:
+ return False
+ waiting = next((index for index, entry in enumerate(self.entries) if entry.body == impulse.body), None)
+ if waiting is not None:
+ self.entries[waiting] = impulse
+ elif self.full:
+ return False
+ else:
+ self.entries.append(impulse)
+ self._upload()
+ return True
+
+ def clear(self) -> None:
+ """Drop every queued impulse."""
+ self.entries.clear()
+ self._bodies.fill_(-1)
+
+ def apply(self, state, body_com) -> None:
+ """Launch the kernel that adds the queued impulses to ``state.body_f``; call it from the force callback."""
+ wp.launch(
+ _apply_impulses,
+ dim=MAX_IMPULSES,
+ inputs=[state.body_q, body_com, state.body_f, self._bodies, self._points, self._impulses, self._inverse_dt],
+ device=self._device,
+ )
+
+ def forget_applied(self) -> None:
+ """Drop the queue once the solver has applied it, which empties every slot on the device."""
+ if self.entries and not (self._bodies.numpy() >= 0).any():
+ self.entries.clear()
+
+ def _upload(self) -> None:
+ bodies = np.full(MAX_IMPULSES, -1, dtype=np.int32)
+ points = np.zeros((MAX_IMPULSES, 3), dtype=np.float32)
+ impulses = np.zeros((MAX_IMPULSES, 3), dtype=np.float32)
+ for index, entry in enumerate(self.entries):
+ bodies[index], points[index], impulses[index] = entry.body, entry.point, entry.vector
+ self._points.assign(points)
+ self._impulses.assign(impulses)
+ self._bodies.assign(bodies)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_overlay_meshes.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_overlay_meshes.py
new file mode 100644
index 000000000000..5adef712ba3d
--- /dev/null
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_overlay_meshes.py
@@ -0,0 +1,245 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Draw Newton's line and arrow overlays in the OVRTX view as thin meshes.
+
+Newton's viewer builds its debug overlays (joints, contacts, springs, centers of mass, inertia boxes) from
+:meth:`log_lines` and :meth:`log_arrows` calls that only the OpenGL viewer draws. :class:`OverlayMeshPublisher`
+records those calls and republishes each batch as world-space meshes through
+:meth:`~isaaclab_ov.renderers.OVRTXRenderer.log_mesh`, so the OVRTX view shows the same overlays.
+"""
+
+from __future__ import annotations
+
+import numpy as np
+import warp as wp
+
+_VERTICES_PER_SEGMENT = 13
+"""Four shaft corners at each end, four arrowhead base corners, and the arrowhead tip."""
+
+_MAX_COLORS = 6
+"""Most distinct colors drawn per batch; further colors take the first color."""
+
+_MIN_CAPACITY = 64
+"""Fewest segments a batch's meshes are sized for. Capacities grow in powers of two, so a count that changes each
+frame, like the contacts, rebuilds a mesh only when it outgrows the last one."""
+
+_COLOR_REFRESH_INTERVAL = 60
+"""Publishes between reads of a batch's per-segment colors from the device."""
+
+DEFAULT_COLOR = (0.8, 0.8, 0.8)
+"""Color of a batch that supplies none."""
+
+LINE_RADIUS = 0.004
+"""Radius of a line segment [m]."""
+
+_SEGMENT_TRIANGLES = (
+ # shaft sides: corner k of the start ring, corner k of the end ring
+ *((k, (k + 1) % 4, 4 + (k + 1) % 4) for k in range(4)),
+ *((k, 4 + (k + 1) % 4, 4 + k) for k in range(4)),
+ # shaft start cap
+ (0, 2, 1),
+ (0, 3, 2),
+ # arrowhead base
+ (8, 9, 10),
+ (8, 10, 11),
+ # arrowhead sides
+ *((8 + k, 8 + (k + 1) % 4, 12) for k in range(4)),
+)
+
+
+@wp.kernel
+def build_segment_meshes(
+ starts: wp.array[wp.vec3],
+ ends: wp.array[wp.vec3],
+ classes: wp.array[wp.int32],
+ class_id: int,
+ active: int,
+ shaft_radius: float,
+ head_radius: float,
+ head_length: float,
+ points: wp.array[wp.vec3],
+):
+ """Write the vertices of one thin box (and arrowhead) per segment.
+
+ Segments past *active* and segments of other classes collapse to a point.
+ """
+ i = wp.tid()
+ base = i * 13
+ if i >= active:
+ for k in range(13):
+ points[base + k] = wp.vec3(0.0, 0.0, 0.0)
+ return
+ start = starts[i]
+ direction = ends[i] - start
+ length = wp.length(direction)
+ if classes[i] != class_id or length < 1.0e-6:
+ for k in range(13):
+ points[base + k] = start
+ return
+ axis = direction / length
+ helper = wp.vec3(0.0, 0.0, 1.0)
+ if wp.abs(axis[2]) > 0.9:
+ helper = wp.vec3(1.0, 0.0, 0.0)
+ u = wp.normalize(wp.cross(axis, helper))
+ v = wp.cross(axis, u)
+ head = wp.min(head_length, 0.5 * length)
+ shaft_end = ends[i] - axis * head
+ for k in range(4):
+ # corners (-1, -1), (1, -1), (1, 1), (-1, 1)
+ cx = float(1.0)
+ if k == 0 or k == 3:
+ cx = -1.0
+ cy = float(1.0)
+ if k < 2:
+ cy = -1.0
+ offset = u * (cx * shaft_radius) + v * (cy * shaft_radius)
+ points[base + k] = start + offset
+ points[base + 4 + k] = shaft_end + offset
+ points[base + 8 + k] = shaft_end + u * (cx * head_radius) + v * (cy * head_radius)
+ points[base + 12] = ends[i]
+
+
+def segment_indices(count: int, device) -> wp.array:
+ """Return the triangle indices of *count* segments built by :func:`build_segment_meshes`."""
+ template = np.array(_SEGMENT_TRIANGLES, np.int32).reshape(-1)
+ indices = (template[None, :] + _VERTICES_PER_SEGMENT * np.arange(count, dtype=np.int32)[:, None]).reshape(-1)
+ return wp.array(indices, dtype=wp.int32, device=device)
+
+
+def color_classes(colors, count: int) -> tuple[np.ndarray | None, list[tuple[float, float, float]]]:
+ """Group a batch's colors into at most :data:`_MAX_COLORS` distinct colors.
+
+ Args:
+ colors: A color triplet, a Warp array with a color per segment, or ``None``.
+ count: Number of segments in the batch.
+
+ Returns:
+ The class index of each segment (``None`` when the batch has one color) and the color of each class.
+ """
+ if colors is None:
+ return None, [DEFAULT_COLOR]
+ if isinstance(colors, (tuple, list)):
+ return None, [tuple(float(value) for value in colors[:3])]
+ values = colors.numpy()
+ if values.size == 3 * count:
+ values = values.reshape(count, 3)
+ if values.ndim != 2 or values.shape[0] != count or values.shape[1] != 3:
+ return None, [DEFAULT_COLOR]
+ rounded = np.round(values, 3)
+ unique, inverse, frequency = np.unique(rounded, axis=0, return_inverse=True, return_counts=True)
+ order = np.argsort(-frequency)[:_MAX_COLORS]
+ rank = np.zeros(len(unique), np.int32) # colors beyond the cap take the most frequent one
+ rank[order] = np.arange(len(order), dtype=np.int32)
+ return rank[inverse.reshape(-1)].astype(np.int32), [tuple(float(c) for c in unique[i]) for i in order]
+
+
+def _capacity(count: int) -> int:
+ """Return the segment capacity the meshes of a *count*-segment batch are sized for."""
+ return max(_MIN_CAPACITY, 1 << (count - 1).bit_length())
+
+
+class _Batch:
+ """Meshes of one named line or arrow batch, rebuilt only when its segment count outgrows their capacity."""
+
+ def __init__(self, capacity: int, device) -> None:
+ self.capacity = capacity
+ self.indices = segment_indices(capacity, device)
+ self.points: list[wp.array] = []
+ self.colors: list[tuple[float, float, float]] = []
+ self.classes: wp.array | None = None
+ self.classes_count = -1
+ self.publishes = 0
+
+
+class OverlayMeshPublisher:
+ """Record Newton's line and arrow overlay calls and publish them as meshes to OVRTX renderers."""
+
+ def __init__(self, prefix: str) -> None:
+ """Create a publisher.
+
+ Args:
+ prefix: Mesh path prefix, unique to the owning visualizer.
+ """
+ self._prefix = prefix
+ self._frame: dict[str, tuple] = {}
+ self._batches: dict[str, _Batch] = {}
+ self._published: dict[str, list[str]] = {}
+
+ def record(self, name, starts, ends, colors, width: float, hidden: bool, arrow: bool) -> None:
+ """Remember one overlay batch of the current frame, as Newton's viewer receives it."""
+ self._frame[name] = (starts, ends, colors, width, hidden, arrow)
+
+ def publish(self, renderers) -> None:
+ """Publish the batches recorded since the last call, and hide every earlier batch that was not recorded."""
+ frame, self._frame = self._frame, {}
+ for name in {*self._published, *frame}:
+ batch = frame.get(name)
+ if batch is None or batch[4] or batch[0] is None or batch[1] is None or len(batch[0]) == 0:
+ self._hide(name, renderers)
+ else:
+ self._show(name, *batch, renderers)
+
+ def hide_all(self, renderers) -> None:
+ """Hide every published overlay mesh."""
+ self._frame.clear()
+ for name in tuple(self._published):
+ self._hide(name, renderers)
+
+ def _path(self, name: str, index: int, capacity: int) -> str:
+ return f"{self._prefix}/overlay/{name.strip('/').replace('/', '_')}_{capacity}_{index}"
+
+ def _show(self, name, starts, ends, colors, width, _hidden, arrow, renderers) -> None:
+ count = len(starts)
+ batch = self._batches.get(name)
+ if batch is None or batch.capacity < count or batch.capacity > 4 * _capacity(count):
+ self._hide(name, renderers)
+ batch = self._batches[name] = _Batch(_capacity(count), starts.device)
+ per_segment = not isinstance(colors, (tuple, list)) and colors is not None
+ if (
+ batch.classes is None
+ or (per_segment and batch.classes_count != count)
+ or (per_segment and batch.publishes % _COLOR_REFRESH_INTERVAL == 0)
+ ):
+ classes, batch.colors = color_classes(colors, count)
+ padded = np.zeros(batch.capacity, np.int32)
+ if classes is not None:
+ padded[:count] = classes
+ batch.classes = wp.array(padded, dtype=wp.int32, device=starts.device)
+ batch.classes_count = count
+ while len(batch.points) < len(batch.colors):
+ batch.points.append(
+ wp.zeros(batch.capacity * _VERTICES_PER_SEGMENT, dtype=wp.vec3, device=starts.device)
+ )
+ batch.publishes += 1
+ shaft = max(0.5 * float(width), LINE_RADIUS) if arrow else LINE_RADIUS
+ head_radius, head_length = (2.5 * shaft, 6.0 * shaft) if arrow else (0.0, 0.0)
+ previous = self._published.get(name, ())
+ paths = []
+ for index, color in enumerate(batch.colors):
+ points = batch.points[index]
+ wp.launch(
+ build_segment_meshes,
+ batch.capacity,
+ [starts, ends, batch.classes, index, count, shaft, head_radius, head_length, points],
+ device=starts.device,
+ )
+ path = self._path(name, index, batch.capacity)
+ paths.append(path)
+ for renderer in renderers:
+ renderer.log_mesh(
+ path, points, batch.indices, hidden=False, backface_culling=False, color=color,
+ roughness=0.8, metallic=0.0,
+ ) # fmt: skip
+ for index in range(len(paths), len(previous)): # A color class that no longer occurs must not stay visible.
+ for renderer in renderers:
+ renderer.log_mesh(previous[index], batch.points[index], batch.indices, hidden=True)
+ self._published[name] = paths
+
+ def _hide(self, name: str, renderers) -> None:
+ batch = self._batches.get(name)
+ for index, path in enumerate(self._published.pop(name, ())):
+ for renderer in renderers:
+ renderer.log_mesh(path, batch.points[index], batch.indices, hidden=True)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
new file mode 100644
index 000000000000..a0ad88b719b3
--- /dev/null
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
@@ -0,0 +1,324 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Runtime appearance of the OVRTX view in the Newton GL window: its background and the lights that illuminate it.
+
+The OpenGL view's Appearance options (sky, shadows, wireframe, colors) configure Newton's rasterizer and do not touch
+the OVRTX image, whose lighting and materials come from the scene's USD. What an OVRTX view can change while running is
+the attributes its render product and the scene's lights expose, which this module writes through the renderer.
+
+Three lights are controlled independently: the scene's own lights, and a dome light and a distant light that the viewer
+adds to the OVRTX stage the first time either is enabled.
+"""
+
+from __future__ import annotations
+
+import logging
+import threading
+from dataclasses import dataclass
+from typing import Any
+
+import numpy as np
+
+from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, NVIDIA_NUCLEUS_DIR, retrieve_file_path
+
+logger = logging.getLogger(__name__)
+
+BACKGROUNDS = ("Scene Sky", "Solid Color")
+"""Background choices: the scene's dome light, or one color."""
+
+SKY_TEXTURES = {
+ "Cloudy: Abandoned Parking": f"{NVIDIA_NUCLEUS_DIR}/Assets/Skies/Cloudy/abandoned_parking_4k.hdr",
+ "Cloudy: Evening Road": f"{NVIDIA_NUCLEUS_DIR}/Assets/Skies/Cloudy/evening_road_01_4k.hdr",
+ "Cloudy: Lakeside": f"{NVIDIA_NUCLEUS_DIR}/Assets/Skies/Cloudy/lakeside_4k.hdr",
+ "Clear: Kloofendal": f"{ISAAC_NUCLEUS_DIR}/Materials/Textures/Skies/PolyHaven/kloofendal_43d_clear_puresky_4k.hdr",
+}
+"""Outdoor sky textures that Isaac Lab tasks already use for dome lights, by display name."""
+
+_DOME_PATH, _SUN_PATH = "/NewtonViewerDome", "/NewtonViewerSun"
+_DOME_DEFAULTS = (1000.0, (0.53, 0.68, 0.9))
+_SUN_DEFAULTS = (3000.0, (1.0, 1.0, 1.0), 1.0, 65.0, 35.0) # Intensity, color, angle [deg], elevation, azimuth.
+
+_DOME_USD = """#usda 1.0
+(defaultPrim = "Dome")
+
+def DomeLight "Dome"
+{{
+ float inputs:intensity = 1000
+ color3f inputs:color = (0.53, 0.68, 0.9)
+ asset inputs:texture:file = @{texture}@
+ token inputs:texture:format = "latlong"
+ token visibility = "invisible"
+}}
+"""
+"""The dome light the viewer adds to the OVRTX stage. A texture is a USD asset path, which cannot be written to a
+running stage, so changing it adds the light again."""
+
+_SUN_USD = """#usda 1.0
+(defaultPrim = "Sun")
+
+def DistantLight "Sun"
+{
+ float inputs:intensity = 3000
+ color3f inputs:color = (1, 1, 1)
+ float inputs:angle = 1.0
+ token visibility = "invisible"
+}
+"""
+"""The distant light the viewer adds to the OVRTX stage; its direction is written as a transform."""
+
+
+def sun_matrix(elevation: float, azimuth: float) -> np.ndarray:
+ """Return the renderer's row-vector transform that makes a distant light shine from the given direction.
+
+ Args:
+ elevation: Height of the light above the horizon [deg]; 90 is straight down.
+ azimuth: Direction the light comes from, around the vertical axis [deg].
+ """
+ el, az = np.radians(elevation), np.radians(azimuth)
+ toward_light = np.array([np.cos(el) * np.cos(az), np.cos(el) * np.sin(az), np.sin(el)]) # Local +Z.
+ x_axis = np.cross((0.0, 0.0, 1.0), toward_light)
+ x_axis = x_axis / np.linalg.norm(x_axis) if np.linalg.norm(x_axis) > 1e-6 else np.array([1.0, 0.0, 0.0])
+ y_axis = np.cross(toward_light, x_axis)
+ matrix = np.eye(4)
+ matrix[0, :3], matrix[1, :3], matrix[2, :3] = x_axis, y_axis, toward_light # Rows, for row vectors.
+ return matrix
+
+
+@dataclass
+class SceneLight:
+ """A light of the scene stage and the intensity and color it was authored with."""
+
+ path: str
+ intensity: float
+ color: tuple[float, float, float]
+
+
+def find_scene_lights(stage: Any) -> list[SceneLight]:
+ """Return the lights of ``stage`` that carry an intensity and a color."""
+ lights = []
+ for prim in stage.Traverse():
+ if "Light" not in prim.GetTypeName():
+ continue
+ intensity, color = prim.GetAttribute("inputs:intensity"), prim.GetAttribute("inputs:color")
+ if intensity and color and intensity.HasValue() and color.HasValue():
+ lights.append(SceneLight(str(prim.GetPath()), float(intensity.Get()), tuple(float(c) for c in color.Get())))
+ return lights
+
+
+class RtxAppearance:
+ """Changes the background and lighting of one OVRTX render product while it runs."""
+
+ def __init__(
+ self,
+ stage: Any,
+ renderer: Any,
+ render_product: str,
+ background_color: tuple[float, float, float] | None = None,
+ ):
+ """Create the controller.
+
+ Args:
+ stage: USD stage the scene's lights are read from.
+ renderer: The OVRTX renderer that owns the render product.
+ render_product: Path of the render product whose background is changed.
+ background_color: Solid background the camera was configured with, or None for the scene sky.
+ """
+ self._renderer = renderer
+ self._product = render_product
+ self._initial = (0, (0.2, 0.4, 0.6)) if background_color is None else (1, tuple(background_color))
+ self.lights = find_scene_lights(stage)
+ self._dome_reference = self._sun_reference = None
+ self._texture_thread: threading.Thread | None = None
+ self._texture_result: str | Exception | None = None
+ self.error = ""
+ self.reset_settings()
+
+ def reset_settings(self) -> None:
+ """Restore every setting to its default without writing it."""
+ self.background, self.background_color = self._initial
+ self.scene_enabled, self.scene_scale, self.scene_tint = True, 1.0, (1.0, 1.0, 1.0)
+ self.dome_enabled = False
+ self.dome_intensity, self.dome_color = _DOME_DEFAULTS
+ self.dome_texture = ""
+ """Sky texture of the dome light: a path or URL, or an empty string for none."""
+ self._dome_texture_file = ""
+ self.texture_status = ""
+ self.sun_enabled = False
+ self.sun_intensity, self.sun_color, self.sun_angle, self.sun_elevation, self.sun_azimuth = _SUN_DEFAULTS
+
+ @property
+ def available(self) -> bool:
+ """Whether the renderer accepts attribute writes; the shared-stage path does not yet."""
+ return not self._renderer._use_ovstage and self._renderer.backend.renderer is not None
+
+ def _write(self, paths: list[str], attribute: str, tensor: Any, **kwargs: Any) -> bool:
+ from ovrtx import PrimMode
+
+ try:
+ self._renderer.backend.renderer.write_attribute(
+ prim_paths=paths, attribute_name=attribute, tensor=tensor, prim_mode=PrimMode.MUST_EXIST, **kwargs
+ )
+ except Exception as exc:
+ logger.exception("[NewtonRtxAppearance] Could not write %s.", attribute)
+ self.error = f"Could not change {attribute}: {exc}"
+ return False
+ self.error = ""
+ return True
+
+ def _add(self, usd: str, path: str, what: str) -> Any | None:
+ """Add a light layer to the OVRTX stage and return its reference, or None after reporting why not."""
+ try:
+ return self._renderer.backend.renderer.add_usd_reference_from_string(usd, path)
+ except Exception as exc:
+ logger.exception("[NewtonRtxAppearance] Could not add the %s.", what)
+ self.error = f"Could not add the {what}: {exc}"
+ return None
+
+ def _ensure_lights(self) -> bool:
+ """Add the viewer's dome and distant lights to the OVRTX stage the first time each is enabled."""
+ if self.dome_enabled and self._dome_reference is None:
+ self._dome_reference = self._add(
+ _DOME_USD.format(texture=self._dome_texture_file), _DOME_PATH, "dome light"
+ )
+ if self.sun_enabled and self._sun_reference is None:
+ self._sun_reference = self._add(_SUN_USD, _SUN_PATH, "distant light")
+ return (not self.dome_enabled or self._dome_reference is not None) and (
+ not self.sun_enabled or self._sun_reference is not None
+ )
+
+ def apply_lights(self) -> bool:
+ """Show the enabled lights with their own intensity and color, hide the rest, and aim the distant light."""
+ if not self._ensure_lights():
+ return False
+ from ovrtx import Semantic
+
+ paths = [light.path for light in self.lights]
+ intensities = [light.intensity * self.scene_scale for light in self.lights]
+ colors = [np.multiply(light.color, self.scene_tint) for light in self.lights]
+ visible = [self.scene_enabled] * len(paths)
+ for reference, path, enabled, intensity, color in (
+ (self._dome_reference, _DOME_PATH, self.dome_enabled, self.dome_intensity, self.dome_color),
+ (self._sun_reference, _SUN_PATH, self.sun_enabled, self.sun_intensity, self.sun_color),
+ ):
+ if reference is not None:
+ paths.append(path)
+ intensities.append(intensity)
+ colors.append(color)
+ visible.append(enabled)
+ if not paths:
+ return False
+ states = ["inherited" if show else "invisible" for show in visible]
+ wrote = (
+ self._write(paths, "visibility", states, semantic=Semantic.TOKEN_STRING)
+ and self._write(paths, "inputs:intensity", np.array(intensities, np.float32))
+ and self._write(paths, "inputs:color", np.array(colors, np.float32))
+ )
+ if wrote and self._sun_reference is not None:
+ wrote = self._write([_SUN_PATH], "inputs:angle", np.array([self.sun_angle], np.float32)) and self._write(
+ [_SUN_PATH],
+ "omni:xform",
+ sun_matrix(self.sun_elevation, self.sun_azimuth)[None],
+ semantic=Semantic.XFORM_MAT4x4,
+ )
+ return wrote
+
+ def apply_background(self) -> bool:
+ """Write the background type and, for a solid color, the color."""
+ from ovrtx import Semantic
+
+ solid = self.background == 1
+ wrote = self._write(
+ [self._product],
+ "omni:rtx:background:source:type",
+ ["color" if solid else "domeLight"],
+ semantic=Semantic.TOKEN_STRING,
+ )
+ if solid and wrote:
+ wrote = self._write(
+ [self._product],
+ "omni:rtx:background:source:color",
+ np.array([self.background_color], np.float32),
+ )
+ return wrote
+
+ # ------------------------------------------------------------------
+ # Dome light sky texture
+ # ------------------------------------------------------------------
+
+ def set_dome_texture(self, source: str) -> None:
+ """Give the dome light a sky texture, downloading it first when it is a remote file.
+
+ Args:
+ source: A path or URL of an HDR or EXR sky image, or an empty string to remove the texture. The change
+ shows once :meth:`poll` reports that the file is ready.
+ """
+ self.dome_texture = source
+ if not source:
+ self._dome_texture_file, self.texture_status = "", ""
+ self._apply_texture()
+ return
+ if self._texture_thread is not None and self._texture_thread.is_alive():
+ return
+ self.texture_status = "Loading sky..."
+
+ def work() -> None:
+ try:
+ self._texture_result = retrieve_file_path(source)
+ except Exception as exc:
+ logger.exception("[NewtonRtxAppearance] Could not load the sky texture %s.", source)
+ self._texture_result = exc
+
+ self._texture_thread = threading.Thread(target=work, name="rtx-sky-texture", daemon=True)
+ self._texture_thread.start()
+
+ def poll(self) -> bool:
+ """Apply a sky texture that finished loading; returns whether the image changed."""
+ result, self._texture_result = self._texture_result, None
+ if result is None:
+ return False
+ if isinstance(result, Exception):
+ self.texture_status, self.dome_texture = f"Could not load the sky: {result}", ""
+ return False
+ self._dome_texture_file, self.texture_status = result, ""
+ return self._apply_texture()
+
+ def _apply_texture(self) -> bool:
+ """Add the dome light again with the current sky texture and write its settings."""
+ reference, self._dome_reference = self._dome_reference, None
+ if reference is not None:
+ try:
+ self._renderer.backend.renderer.remove_usd(reference)
+ except Exception:
+ logger.debug("[NewtonRtxAppearance] The dome light was already removed.", exc_info=True)
+ self.dome_enabled = True if self._dome_texture_file else self.dome_enabled
+ return self.apply_lights()
+
+ def use_sky(self, source: str) -> None:
+ """Choose the dome light's sky texture; the light is tinted white for a texture and sky blue without one.
+
+ Args:
+ source: A path or URL of an HDR or EXR sky image, or an empty string for no texture.
+ """
+ self.dome_color = (1.0, 1.0, 1.0) if source else _DOME_DEFAULTS[1]
+ self.set_dome_texture(source)
+
+ def reset(self) -> bool:
+ """Return to the scene's own lights and background, and remove the sky texture."""
+ had_texture = bool(self._dome_texture_file)
+ self.reset_settings()
+ if had_texture:
+ self._apply_texture() # Adds the dome light again, without the texture.
+ return self.apply_lights() & self.apply_background()
+
+ def close(self) -> None:
+ """Remove the lights the viewer added to the stage."""
+ references, self._dome_reference, self._sun_reference = (self._dome_reference, self._sun_reference), None, None
+ for reference in references:
+ if reference is not None:
+ try:
+ self._renderer.backend.renderer.remove_usd(reference)
+ except Exception:
+ logger.debug("[NewtonRtxAppearance] A viewer light was already removed.", exc_info=True)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 19987a078d12..2b2a08ff3bd1 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -8,6 +8,7 @@
from __future__ import annotations
import contextlib
+import inspect
import logging
import math
import os
@@ -47,15 +48,20 @@
from isaaclab.sensors.camera import Camera
from isaaclab.sim import SimulationContext
from isaaclab.utils.backend_utils import FactoryBase
+from isaaclab.utils.images import display_channels, sensor_key_for_gt_type
from isaaclab.utils.math import quat_apply, quat_from_matrix, quat_mul
+from isaaclab.visualizers.base_visualizer import _VISUALIZER_MAX_TILES as MAX_TILED_ENVS
from isaaclab.visualizers.base_visualizer import BaseVisualizer
from isaaclab.visualizers.camera_follower import CameraFollower
from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg, TrackingCameraCfg, WindowCfg
from isaaclab_visualizers.desktop_entry import write_desktop_entry
+from isaaclab_visualizers.newton.newton_overlay_meshes import OverlayMeshPublisher
from isaaclab_visualizers.newton.newton_visualization_markers import render_newton_visualization_markers
+from .newton_impulse_drag import IMPULSE_GAIN, MAX_IMPULSE_SPEED, ImpulseDrag, impulse_color, make_impulse
from .newton_key_event_source import NewtonKeyEventSource
+from .newton_rtx_appearance import SKY_TEXTURES, RtxAppearance
logger = logging.getLogger(__name__)
@@ -73,19 +79,79 @@
_NEWTON_ICON_DIR = Path(newton.__file__).parent / "_src" / "viewer" / "gl"
+_MARKER_TIPS = {
+ "velocity_goal": "Commanded base velocity",
+ "velocity_current": "Current base velocity",
+ "goal_pose": "Commanded goal pose",
+ "pose_goal": "Commanded goal pose",
+ "body_pose": "Current pose of the commanded body",
+ "current_pose": "Current pose of the commanded body",
+ "goal_marker": "Goal the task asks the object to reach",
+ "Goal": "Goal position",
+ "ee_goal": "Goal pose of the end effector",
+ "ee_current": "Current pose of the end effector",
+ "SuccessMarkers": "Marks environments that succeeded",
+ "Policy_Heightmap": "Height scan the policy observes",
+ "TerrainOrigin": "Origin of each terrain tile",
+ "DeformableTarget": "Target of the deformable object",
+ "RayCaster": "Points hit by the ray-caster sensor",
+ "ContactSensor": "Contact points reported by a contact sensor",
+ "FrameTransformer": "Frames tracked by a frame transformer sensor",
+ "EndEffectorFrameTransformer": "End-effector frame tracked by a frame transformer sensor",
+ "CabinetFrameTransformer": "Cabinet frames tracked by a frame transformer sensor",
+ "HandJointMarkers": "Hand joint positions from the hand tracker",
+}
+"""What each marker group shows, by the last component of its prim path."""
+
+
+def hover_tooltip(imgui: Any, text: str) -> None:
+ """Show ``text`` while the last item is hovered, including when it is disabled."""
+ if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
+ imgui.set_tooltip(text)
+
+
+def marker_tooltip(prim_path: str) -> str:
+ """Return a short description of the marker group at ``prim_path``, or a generic line when unknown."""
+ return _MARKER_TIPS.get(prim_path.rsplit("/", 1)[-1], "Show or hide this marker group")
+
+
+def term_summary(manager, term: str) -> str:
+ """Return the first docstring line of a manager term's function, or an empty string when it has none.
+
+ Args:
+ manager: Environment manager that owns the term.
+ term: Name of the term within the manager.
+ """
+ for getter in ("get_term_cfg", "get_term"):
+ try:
+ found = getattr(manager, getter)(term)
+ except Exception: # Not every manager has the accessor, and some take a group as well.
+ continue
+ target = getattr(found, "func", found)
+ doc = inspect.getdoc(target) or ""
+ line = next((line.strip() for line in doc.splitlines() if line.strip()), "")
+ if line and not line.startswith(("Initialize self", "Initialise self")):
+ return line if len(line) <= 120 else line[:117] + "..."
+ return ""
+
+
+DEFAULT_TILED_ENVS = 16
+"""Environments a multi-environment scene camera tiles when it is first shown."""
+
_BACKEND_DISPLAY_NAMES = {"physx": "PhysX", "ovphysx": "OVPhysX", "newton": "Newton MJWarp"}
-def _imgui_optional_checkbox(imgui, label: str, value: bool, available: bool, tip: str) -> bool:
- """Render a checkbox greyed out with a tooltip when *available* is False."""
+def _imgui_optional_checkbox(imgui, label: str, value: bool, available: bool, tip: str, hint: str = "") -> bool:
+ """Render a checkbox greyed out with the reason as tooltip when *available* is False, else with *hint*."""
if not available:
imgui.begin_disabled()
_, new_val = imgui.checkbox(label, value)
if not available:
imgui.end_disabled()
- if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
- imgui.set_tooltip(tip)
+ hover_tooltip(imgui, tip)
return value
+ if hint:
+ hover_tooltip(imgui, hint)
return new_val
@@ -94,6 +160,12 @@ def _imgui_optional_checkbox(imgui, label: str, value: bool, available: bool, ti
# ---------------------------------------------------------------------------
+def _rotate(quaternion: np.ndarray, vector: np.ndarray) -> np.ndarray:
+ """Rotate ``vector`` by a unit quaternion given as ``(x, y, z, w)``."""
+ axis, w = quaternion[:3], quaternion[3]
+ return vector + 2.0 * np.cross(axis, np.cross(axis, vector) + w * vector)
+
+
class NewtonViewerGL(ViewerGL):
"""Newton GL window with Isaac Lab controls and device-image presentation."""
@@ -103,9 +175,164 @@ class NewtonViewerGL(ViewerGL):
"""Set while keyboard camera movement is disabled (see :meth:`NewtonVisualizerBase.set_camera_keys_enabled`)."""
keyboard_frame_hook: Callable[[], object] | None = None
"""Called after every frame while a :class:`NewtonKeyEventSource` listens, to track ImGui keyboard ownership."""
+ _owner = None
+ _show_stats = False
+ """Whether the performance and model statistics overlay in the top-right corner is open."""
+ image_matches_camera = False
+ """Whether the fullscreen image is rendered from :attr:`camera`, so picking rays and window fill are valid."""
+ _overlay_capture = None
+ """Publisher that also receives the line and arrow overlays, while the OVRTX view draws them."""
+ _view_controls = None
+
+ impulse_drag: ImpulseDrag | None = None
+ impulse_substep_dt = 1.0 / 120.0
+ """Duration of one solver substep [s], which impulses are applied over; kept across :meth:`set_model`."""
+ """Impulses aimed while paused; None until a model is set."""
+ _impulse_arrows_shown = False
+
+ PICKING_ARROW_SCALE = 4.0
+ """Screen-space size of the arrow drawn while dragging a body in the OpenGL view, relative to a contact arrow."""
+ PICKING_ARROW_WIDTH = 0.025
+ """Width of the same arrow in the OVRTX view, where it is a mesh [m]. OpenGL sizes it with the scale instead."""
+
+ def log_lines(self, name, starts, ends, colors, width=0.01, hidden=False):
+ """Draw line segments, and hand them to the overlay publisher when one is capturing.
+
+ Newton draws the drag from the picked point to the cursor target as a thin line; it is drawn as an arrow here.
+ """
+ if name == "picking_line":
+ if starts is not None: # The arrow's color grows from green to red with its length, running or paused.
+ length = float(np.linalg.norm(ends.numpy()[0] - starts.numpy()[0]))
+ colors = impulse_color(min(IMPULSE_GAIN * length, MAX_IMPULSE_SPEED) / MAX_IMPULSE_SPEED)
+ self.log_arrows("picking_arrow", starts, ends, colors, width=self.PICKING_ARROW_WIDTH, hidden=hidden)
+ return
+ if self._overlay_capture is not None:
+ self._overlay_capture.record(name, starts, ends, colors, width, hidden, arrow=False)
+ super().log_lines(name, starts, ends, colors, width=width, hidden=hidden)
+
+ def set_model(self, model, *args, **kwargs):
+ """Set the model, and prepare the Impulse Drag buffers for it."""
+ super().set_model(model, *args, **kwargs)
+ self.impulse_drag = ImpulseDrag(model.device, self.impulse_substep_dt) if model is not None else None
+ self._impulse_arrows_shown = False
+
+ def set_impulse_substep_dt(self, substep_dt: float) -> None:
+ """Set the solver substep that impulses are applied over, now and for every later model."""
+ self.impulse_substep_dt = substep_dt
+ if self.impulse_drag is not None:
+ self.impulse_drag.set_substep_dt(substep_dt)
+
+ def apply_forces(self, state):
+ """Apply picking, wind, and the impulses aimed while paused."""
+ super().apply_forces(state)
+ if self.impulse_drag is not None and self.picking_enabled:
+ self.impulse_drag.apply(state, self.model.body_com)
+
+ def on_key_press(self, symbol, modifiers):
+ """Space pauses the simulation, and Shift + Space pauses rendering; Newton's other keys are kept."""
+ from pyglet.window import key
+
+ if symbol == key.SPACE and self.gui is not None and not self.gui.is_keyboard_capturing():
+ if modifiers & key.MOD_SHIFT:
+ self._paused = not self._paused
+ else:
+ self._paused_training = not self._paused_training
+ return
+ super().on_key_press(symbol, modifiers)
+
+ def on_mouse_release(self, x, y, button, modifiers):
+ """Keep the arrow aimed with a right click while the simulation is paused as an impulse for when it resumes."""
+ from pyglet.window import mouse
+
+ if button == mouse.RIGHT and self._paused_training:
+ self._queue_impulse()
+ super().on_mouse_release(x, y, button, modifiers)
+
+ def _queue_impulse(self) -> None:
+ """Queue the drag that is being released as an impulse on the picked body."""
+ picking, drag, state = self.picking, self.impulse_drag, self._last_state
+ if drag is None or picking is None or state is None or not picking.is_picking():
+ return
+ body = int(picking.pick_body.numpy()[0])
+ if body < 0:
+ return
+ pick = picking.pick_state.numpy()[0]
+ local = np.asarray(pick["picked_point_local"], dtype=np.float64)
+ transform = state.body_q.numpy()[body].astype(np.float64)
+ point = transform[:3] + _rotate(transform[3:7], local)
+ displacement = np.asarray(pick["picking_target_world"], dtype=np.float64) - point
+ mass = float(picking._pick_effective_mass.numpy()[body]) or float(self.model.body_mass.numpy()[body])
+ drag.add(make_impulse(body, local, displacement, mass))
+
+ def _render_picking_line(self, state):
+ """Draw the drag in progress, and the impulses waiting for the simulation to resume."""
+ super()._render_picking_line(state)
+ drag = self.impulse_drag
+ if drag is None:
+ return
+ if not self._paused_training:
+ drag.forget_applied()
+ if not drag.entries:
+ if self._impulse_arrows_shown:
+ self.log_arrows("impulse_arrow", None, None, None)
+ self._impulse_arrows_shown = False
+ return
+ transforms = state.body_q.numpy()
+ offsets = self.world_offsets.numpy() if self.world_offsets is not None and self.world_offsets.shape[0] else None
+ body_world = (
+ self.model.body_world.numpy() if offsets is not None and self.model.body_world is not None else None
+ )
+ starts, ends, colors = [], [], []
+ for entry in drag.entries:
+ transform = transforms[entry.body].astype(np.float64)
+ start = transform[:3] + _rotate(transform[3:7], entry.point.astype(np.float64))
+ if body_world is not None and 0 <= body_world[entry.body] < len(offsets):
+ start = start + offsets[body_world[entry.body]]
+ direction = entry.vector / max(float(np.linalg.norm(entry.vector)), 1e-12)
+ starts.append(start)
+ ends.append(start + direction * entry.fraction * MAX_IMPULSE_SPEED / IMPULSE_GAIN)
+ colors.append(impulse_color(entry.fraction))
+ device = self.device
+ self.log_arrows(
+ "impulse_arrow",
+ wp.array(np.array(starts, dtype=np.float32), dtype=wp.vec3, device=device),
+ wp.array(np.array(ends, dtype=np.float32), dtype=wp.vec3, device=device),
+ wp.array(np.array(colors, dtype=np.float32), dtype=wp.vec3, device=device),
+ width=self.PICKING_ARROW_WIDTH,
+ )
+ self._impulse_arrows_shown = True
+
+ def _enlarge_picking_arrow(self) -> None:
+ """Draw the picking arrow in a second pass at :attr:`PICKING_ARROW_SCALE`, leaving the contact arrows alone."""
+ renderer = self.renderer
+ draw_arrows = getattr(renderer, "_render_arrows", None)
+ if draw_arrows is None:
+ return
+
+ def render_arrows(arrows):
+ picking = {key: arrow for key, arrow in arrows.items() if key.endswith(("picking_arrow", "impulse_arrow"))}
+ draw_arrows({key: arrow for key, arrow in arrows.items() if key not in picking})
+ if picking:
+ scale = renderer.arrow_scale
+ renderer.arrow_scale = max(scale, self.PICKING_ARROW_SCALE)
+ try:
+ draw_arrows(picking)
+ finally:
+ renderer.arrow_scale = scale
+
+ renderer._render_arrows = render_arrows
+
+ def log_arrows(self, name, starts, ends, colors, width=0.01, hidden=False):
+ """Draw arrows, and hand them to the overlay publisher when one is capturing."""
+ if self._overlay_capture is not None:
+ self._overlay_capture.record(name, starts, ends, colors, width, hidden, arrow=True)
+ super().log_arrows(name, starts, ends, colors, width=width, hidden=hidden)
def __init__(self, *args, window_cfg: WindowCfg, metadata: dict | None = None, **kwargs):
super().__init__(*args, **kwargs)
+ if hasattr(self.renderer, "set_title"):
+ self.renderer.set_title("Newton Visualizer") # Newton's default caption is "Newton Viewer".
+ self._enlarge_picking_arrow()
self._paused_training = False
self._reset_requested = False
self._metadata = metadata or {}
@@ -121,6 +348,16 @@ def __init__(self, *args, window_cfg: WindowCfg, metadata: dict | None = None, *
self._mpm_particle_flags_cache_key: tuple[int, int, int] | None = None
self._mpm_particles_all_active = False
self._fullscreen_image_active = False
+ draw_texture = getattr(self.renderer, "render_texture", None)
+
+ def render_texture(texture_id, texture_width=0, texture_height=0, **kwargs):
+ screen = self.renderer._screen_width / max(self.renderer._screen_height, 1)
+ if self.image_matches_camera and texture_height and abs(texture_width / texture_height / screen - 1) < 0.1:
+ texture_width = texture_height = 0 # Stretch a nearly matching aspect instead of drawing black bars.
+ draw_texture(texture_id, texture_width, texture_height, **kwargs)
+
+ if draw_texture is not None:
+ self.renderer.render_texture = render_texture
self._implot = self._implot_ctx = None
if self.gui is not None:
from imgui_bundle import implot
@@ -163,18 +400,18 @@ def consume_reset_request(self) -> bool:
def _patch_viewer_panel(self) -> None:
"""Replace Newton's left panel with an IsaacLab-oriented layout.
- New section order:
+ Section order:
- 1. **Simulation** (open) — physics backend, model info, training controls.
+ 1. **Simulation** (open) — physics backend, model info, playback and environment controls.
2. **Live Plots** (closed) — injected when :meth:`~NewtonGLVisualizer.add_live_plots`
is called.
3. **Model Overlays** and **Visualization Markers** (closed) — debug visibility controls.
- 4. **Rendering Options** (open) — VSync and renderer-specific options.
+ 4. **Rendering Options** (open) — VSync, the renderer and camera source, and renderer-specific options.
5. **Controls** (closed) — camera keyboard reference.
6. **Selection API** (closed) — Newton's selection panel.
The top-level Newton ``Pause / Step`` row is suppressed; pause/resume is
- handled by the IsaacLab training controls inside **Simulation**.
+ handled by the IsaacLab controls inside **Simulation**.
"""
import newton as nt
@@ -224,6 +461,8 @@ def _render_left_panel(_g=gui):
imgui.separator()
for callback in _g._ui_callbacks.get("side", []):
callback(imgui)
+ if viewer._has_environment_controls():
+ viewer._render_environment_controls(imgui)
# --- Live Plots -------------------------------------------------
live_plots_cb = viewer._live_plots_callback
@@ -231,80 +470,32 @@ def _render_left_panel(_g=gui):
live_plots_cb(imgui)
# --- Model overlays ---------------------------------------------
- if viewer.model is not None and not viewer._fullscreen_image_active:
+ if viewer.model is not None:
imgui.set_next_item_open(False, imgui.Cond_.appearing)
if imgui.collapsing_header("Model Overlays"):
imgui.separator()
- renderer = viewer.renderer
- _c, viewer.show_joints = imgui.checkbox("Show Joints", viewer.show_joints)
- if viewer.show_joints:
- _, renderer.joint_scale = imgui.slider_float("Joint Scale", renderer.joint_scale, 0.25, 5.0)
- _contacts_available = viewer._contacts_available
- viewer.show_contacts = _imgui_optional_checkbox(
- imgui,
- "Show Contacts",
- viewer.show_contacts,
- _contacts_available,
- "No contact sensors in this environment",
- )
- if viewer.show_contacts and _contacts_available:
- _, renderer.arrow_length_scale = imgui.slider_float(
- "Contact Length", renderer.arrow_length_scale, 0.25, 5.0
+ if viewer._fullscreen_image_active and not viewer.image_matches_camera:
+ imgui.text_disabled("OpenGL only")
+ hover_tooltip(
+ imgui, "Switch the Renderer to OpenGL to draw joints, contacts, and other overlays"
)
- _, renderer.arrow_scale = imgui.slider_float("Contact Width", renderer.arrow_scale, 0.25, 5.0)
- _model = viewer.model
- _has_particles = _model.particle_count > 0
- _has_springs = _model.spring_count > 0
- _has_cloth = _model.tri_count > 0
- viewer.show_particles = _imgui_optional_checkbox(
- imgui,
- "Show Particles",
- viewer.show_particles,
- _has_particles,
- "No particle bodies in this environment",
- )
- viewer.show_springs = _imgui_optional_checkbox(
- imgui,
- "Show Springs",
- viewer.show_springs,
- _has_springs,
- "No spring constraints in this environment",
- )
- _c, viewer.show_com = imgui.checkbox("Show Center of Mass", viewer.show_com)
- if viewer.show_com:
- _, renderer.com_scale = imgui.slider_float("COM Scale", renderer.com_scale, 0.25, 5.0)
- viewer.show_triangles = _imgui_optional_checkbox(
- imgui,
- "Show Cloth",
- viewer.show_triangles,
- _has_cloth,
- "No cloth/triangle meshes in this environment",
- )
- _c, viewer.show_collision = imgui.checkbox("Show Collision", viewer.show_collision)
- _c, renderer.draw_edges = imgui.checkbox("Show Edges", renderer.draw_edges)
- _sdf_labels = ["Off", "Margin", "Margin + Gap"]
- _, new_sdf_idx = imgui.combo("Gap + Margin", int(viewer.sdf_margin_mode), _sdf_labels)
- viewer.sdf_margin_mode = viewer.SDFMarginMode(new_sdf_idx)
- if viewer.sdf_margin_mode != viewer.SDFMarginMode.OFF:
- _, renderer.wireframe_line_width = imgui.slider_float(
- "Wireframe Width (px)", renderer.wireframe_line_width, 0.5, 5.0
- )
- _c, viewer.show_visual = imgui.checkbox("Show Visual", viewer.show_visual)
- _c, viewer.show_inertia_boxes = imgui.checkbox("Show Inertia Boxes", viewer.show_inertia_boxes)
+ elif viewer.image_matches_camera:
+ viewer._draw_model_overlays(imgui, rtx=True)
+ imgui.text_disabled("Collision, visual, edges, and wireframes: OpenGL only")
+ else:
+ viewer._draw_model_overlays(imgui)
if viewer.marker_groups:
imgui.set_next_item_open(False, imgui.Cond_.appearing)
if imgui.collapsing_header("Visualization Markers"):
- for marker in viewer.marker_groups:
- name = marker.cfg.prim_path.rsplit("/", 1)[-1].replace("_", " ")
- changed, visible = imgui.checkbox(f"Show {name}##{id(marker)}", marker.is_visible())
- if changed:
- marker.set_visibility(visible)
+ viewer._draw_marker_controls(imgui)
# --- Rendering Options ------------------------------------------
imgui.set_next_item_open(True, imgui.Cond_.appearing)
if imgui.collapsing_header("Rendering Options"):
imgui.separator()
_c, viewer.vsync = imgui.checkbox("VSync", viewer.vsync)
+ if viewer._view_controls is not None:
+ viewer._view_controls(imgui)
for callback in _g._ui_callbacks.get("rendering", []):
callback(imgui)
@@ -312,26 +503,48 @@ def _render_left_panel(_g=gui):
imgui.set_next_item_open(False, imgui.Cond_.appearing)
if imgui.collapsing_header("Controls"):
imgui.separator()
- _g._render_camera_info()
- imgui.separator()
- imgui.push_style_color(imgui.Col_.text, imgui.ImVec4(*nav_highlight_color))
- imgui.text("Controls:")
- imgui.pop_style_color()
- imgui.text("WASD - Move camera")
- imgui.text("Shift + WASD - Move camera 2x speed")
- imgui.text("QE - Pan up/down")
- imgui.text("Left Click - Look around")
- if viewer.picking_enabled and not viewer._fullscreen_image_active:
- imgui.text("Right Click - Pick and drag objects")
- imgui.text("Middle Click - Orbit")
- imgui.text("Shift + Middle Click - Pan")
- imgui.text("Ctrl + Middle Click - Dolly")
- imgui.text("Scroll - Dolly")
- imgui.text("Ctrl + Scroll - FOV zoom")
- imgui.text("Space - Pause/Resume Rendering")
- imgui.text(". - Step one frame (when paused)")
- imgui.text("H - Toggle UI")
- imgui.text("F - Frame camera around model")
+ picking = viewer.picking_enabled and (
+ not viewer._fullscreen_image_active or viewer.image_matches_camera
+ )
+ sections = [
+ (
+ "Camera",
+ [
+ "WASD - Move",
+ "Shift + WASD - Move 2x faster",
+ "QE - Up / down",
+ "Left Click - Look around",
+ "Middle Click - Orbit",
+ "Shift + Middle Click - Pan",
+ "Ctrl + Middle Click - Dolly",
+ "Scroll - Dolly",
+ "Ctrl + Scroll - FOV zoom",
+ "F - Frame the model",
+ ],
+ ),
+ (
+ "Objects",
+ ["Right Click - Pick and drag", "Paused + Right Click - Aim a push"] if picking else [],
+ ),
+ (
+ "Playback",
+ [
+ "Space - Pause simulation",
+ "Shift + Space - Pause rendering",
+ ". - Step a frame (rendering paused)",
+ ],
+ ),
+ ("Window", ["H - Show / hide the UI"]),
+ ]
+ for title, lines in sections:
+ if not lines:
+ continue
+ imgui.push_style_color(imgui.Col_.text, imgui.ImVec4(*nav_highlight_color))
+ imgui.text(title)
+ imgui.pop_style_color()
+ for line in lines:
+ imgui.text(line)
+ imgui.spacing()
# --- Selection API ----------------------------------------------
_g._render_selection_panel()
@@ -340,22 +553,158 @@ def _render_left_panel(_g=gui):
gui._render_left_panel = _render_left_panel
+ def _has_environment_controls(self) -> bool:
+ """Return whether more than one environment can be shown, so the Environments section is useful."""
+ owner = self._owner
+ return owner is not None and owner.visible_env_limit > 1
+
+ def _render_environment_controls(self, imgui) -> None:
+ """Render the visible-environment count slider."""
+ owner = self._owner
+ imgui.text("Visible Envs")
+ changed, new_count = imgui.slider_int("##VisibleEnvs", owner.visible_env_count, 1, owner.visible_env_limit)
+ if changed:
+ owner.set_visible_env_count(new_count)
+ if imgui.is_item_hovered():
+ imgui.set_tooltip("Number of environments drawn in the viewer; simulation is unaffected")
+
+ def _draw_marker_controls(self, imgui) -> None:
+ """Draw one toggle per visualization marker group the task registers."""
+ groups = list(self.marker_groups)
+ if not groups:
+ imgui.text_disabled("This task registers no visualization markers")
+ hover_tooltip(
+ imgui, "Markers such as velocity-command arrows appear when a task enables debug visualization"
+ )
+ return
+ for marker in groups:
+ name = marker.cfg.prim_path.rsplit("/", 1)[-1].replace("_", " ")
+ changed, visible = imgui.checkbox(f"Show {name}##{id(marker)}", marker.is_visible())
+ hover_tooltip(imgui, marker_tooltip(marker.cfg.prim_path))
+ if changed:
+ marker.set_visibility(visible)
+ if len(groups) > 1:
+ if imgui.button("Show All##markers"):
+ for marker in groups:
+ marker.set_visibility(True)
+ hover_tooltip(imgui, "Show every marker group")
+ imgui.same_line()
+ if imgui.button("Hide All##markers"):
+ for marker in groups:
+ marker.set_visibility(False)
+ hover_tooltip(imgui, "Hide every marker group")
+
+ def _draw_model_overlays(self, imgui, rtx: bool = False) -> None:
+ """Draw Newton's per-overlay toggles; the OVRTX view draws only the line and arrow overlays."""
+ renderer = self.renderer
+
+ def tip(text: str) -> None:
+ hover_tooltip(imgui, text)
+
+ _c, self.show_joints = imgui.checkbox("Show Joints", self.show_joints)
+ tip("Draw the model's joints")
+ if self.show_joints:
+ _, renderer.joint_scale = imgui.slider_float("Joint Scale", renderer.joint_scale, 0.25, 5.0)
+ tip("Size of the joint drawings")
+ _contacts_available = self._contacts_available
+ self.show_contacts = _imgui_optional_checkbox(
+ imgui,
+ "Show Contacts",
+ self.show_contacts,
+ _contacts_available,
+ "No contact sensors in this environment",
+ "Draw contacts as arrows",
+ )
+ if self.show_contacts and _contacts_available:
+ _, renderer.arrow_length_scale = imgui.slider_float(
+ "Contact Length", renderer.arrow_length_scale, 0.25, 5.0
+ )
+ tip("Length of the contact arrows")
+ _, renderer.arrow_scale = imgui.slider_float("Contact Width", renderer.arrow_scale, 0.25, 5.0)
+ tip("Width of the contact arrows")
+ _model = self.model
+ _has_particles = _model.particle_count > 0
+ _has_springs = _model.spring_count > 0
+ if rtx:
+ self.show_springs = _imgui_optional_checkbox(
+ imgui,
+ "Show Springs",
+ self.show_springs,
+ _has_springs,
+ "No spring constraints in this environment",
+ "Draw spring constraints",
+ )
+ _c, self.show_com = imgui.checkbox("Show Center of Mass", self.show_com)
+ tip("Draw each body's center of mass")
+ _c, self.show_inertia_boxes = imgui.checkbox("Show Inertia Boxes", self.show_inertia_boxes)
+ tip("Draw each body's inertia as a box")
+ return
+ _has_cloth = _model.tri_count > 0
+ self.show_particles = _imgui_optional_checkbox(
+ imgui,
+ "Show Particles",
+ self.show_particles,
+ _has_particles,
+ "No particle bodies in this environment",
+ "Draw simulation particles",
+ )
+ self.show_springs = _imgui_optional_checkbox(
+ imgui,
+ "Show Springs",
+ self.show_springs,
+ _has_springs,
+ "No spring constraints in this environment",
+ "Draw spring constraints",
+ )
+ _c, self.show_com = imgui.checkbox("Show Center of Mass", self.show_com)
+ tip("Draw each body's center of mass")
+ if self.show_com:
+ _, renderer.com_scale = imgui.slider_float("COM Scale", renderer.com_scale, 0.25, 5.0)
+ tip("Size of the center-of-mass markers")
+ self.show_triangles = _imgui_optional_checkbox(
+ imgui,
+ "Show Cloth",
+ self.show_triangles,
+ _has_cloth,
+ "No cloth/triangle meshes in this environment",
+ "Draw cloth and triangle meshes",
+ )
+ _c, self.show_collision = imgui.checkbox("Show Collision", self.show_collision)
+ tip("Draw collision shapes")
+ _c, renderer.draw_edges = imgui.checkbox("Show Edges", renderer.draw_edges)
+ tip("Draw mesh edges")
+ _sdf_labels = ["Off", "Margin", "Margin + Gap"]
+ _, new_sdf_idx = imgui.combo("Gap + Margin", int(self.sdf_margin_mode), _sdf_labels)
+ tip("Draw the collision margin, and optionally the gap, around shapes")
+ self.sdf_margin_mode = self.SDFMarginMode(new_sdf_idx)
+ if self.sdf_margin_mode != self.SDFMarginMode.OFF:
+ _, renderer.wireframe_line_width = imgui.slider_float(
+ "Wireframe Width (px)", renderer.wireframe_line_width, 0.5, 5.0
+ )
+ tip("Line width of the margin and gap drawings")
+ _c, self.show_visual = imgui.checkbox("Show Visual", self.show_visual)
+ tip("Draw the visual meshes")
+ _c, self.show_inertia_boxes = imgui.checkbox("Show Inertia Boxes", self.show_inertia_boxes)
+ tip("Draw each body's inertia as a box")
+
def _render_training_controls(self, imgui):
- """Render Isaac Lab training control widgets inside the Isaac Lab panel section."""
+ """Render the Isaac Lab playback controls inside the Simulation section."""
pause_label = "Resume Simulation" if self._paused_training else "Pause Simulation"
if imgui.button(pause_label):
self._paused_training = not self._paused_training
+ hover_tooltip(
+ imgui,
+ "Stop or resume stepping the simulation (Space). The window keeps updating",
+ )
rendering_label = "Resume Rendering" if self._paused else "Pause Rendering"
if imgui.button(rendering_label):
self._paused = not self._paused
+ hover_tooltip(imgui, "Freeze or resume the window image (Shift + Space). The simulation keeps running")
if imgui.button("Reset Episode"):
self._reset_requested = True
-
- _, self.window_cfg.fps = imgui.slider_float("Window FPS", self.window_cfg.fps, 1.0, 120.0, "%.0f FPS")
- if imgui.is_item_hovered():
- imgui.set_tooltip("Maximum window updates per second; independent of simulation speed.")
+ hover_tooltip(imgui, "Reset every environment on the next step")
def is_training_paused(self) -> bool:
"""Return whether simulation is paused by viewer controls."""
@@ -414,9 +763,14 @@ def log_image(self, name: str, image: wp.array | np.ndarray, *, fullscreen: bool
self._fullscreen_image_active = True
def on_mouse_press(self, x, y, button, modifiers):
- """Image coordinates must not pick objects in the hidden perspective scene."""
- if not self._fullscreen_image_active:
- super().on_mouse_press(x, y, button, modifiers)
+ """Image coordinates must not pick objects in the hidden perspective scene, unless it is the image's camera."""
+ if self._fullscreen_image_active and not self.image_matches_camera:
+ return
+ if self._fullscreen_image_active and self.picking_enabled and self._owner is not None:
+ self._last_state = (
+ self._owner._update_state()
+ ) # An image frame does not log state; cast against fresh poses.
+ super().on_mouse_press(x, y, button, modifiers)
def _update_camera(self, dt: float):
"""Move the camera from held keys, unless keyboard camera movement is disabled."""
@@ -495,6 +849,9 @@ def _log_particles(self, state):
class NewtonVisualizerBase(BaseVisualizer):
"""Own Newton resource bindings, frame cadence, and camera selection for both renderers."""
+ _overlay_publisher: OverlayMeshPublisher | None = None
+ _rtx_arrows_pending = False
+
def __init__(self, cfg):
super().__init__(cfg)
self._viewer = None
@@ -504,9 +861,22 @@ def __init__(self, cfg):
self._last_render_step = -1
self._pending_mesh_submissions: dict[str, dict[str, Any]] = {}
self._camera_keys_enabled = True
+ self._overlay_publisher = None
self._followers: dict[object, CameraFollower] = {}
+ """Followers of the tracking cameras, by image view."""
+ self._rtx_pose_view = None
+ """Tracking Camera view that moves the OVRTX camera, or None when the free camera drives it."""
self._tracking_defaults: dict[object, dict] = {}
+ """What the task declared for each tracking camera, for Reset to Task Default."""
self._tracking_error = ""
+ self._perspective_poses: dict[object, tuple] = {}
+ """Last pose and focal length of each free Perspective view, kept while another source is shown."""
+ self._sensor_tiles: dict[object, int] = {}
+ """Number of environments each multi-environment scene camera offers, by image view."""
+ self._rtx_appearance: RtxAppearance | None = None
+ self._rtx_appearance_failed = False
+ self._sky_custom = ""
+ self._sky_custom_open = False
def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraCfg | Camera]) -> None:
"""Bind camera sources and the display mode shared by both windows."""
@@ -550,8 +920,8 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
window_cfg=self.cfg.window,
) # fmt: skip
self._viewer.marker_groups = sim.vis_marker_registry.get_groups().values()
+ self._viewer._view_controls = self._draw_streaming_view_controls
self._viewer.camera_keys_suspended = not self._camera_keys_enabled
- self._viewer.register_ui_callback(self._draw_streaming_view_controls, position="side")
if not self._runtime_headless:
# keyboard input is optional: a failure here must not stop the visualizer from starting
try:
@@ -612,84 +982,359 @@ def _is_tracking_view(view) -> bool:
"""Whether *view* is a perspective view tied to an environment or an asset."""
return isinstance(view.cfg.source, TrackingCameraCfg)
- def _view_labels(self) -> list[str]:
- """Name the views for the selector: "Tracking Camera" for a tracking camera, "Perspective" for a free view."""
- free = [v for v in self._image_views if v.camera is None and not self._is_tracking_view(v)]
- tracking = [v for v in self._image_views if self._is_tracking_view(v)]
- labels = []
- for view in self._image_views:
- if view.camera is not None:
- labels.append(view.cfg.source)
- elif self._is_tracking_view(view):
- labels.append(
- "Tracking Camera" if len(tracking) == 1 else f"Tracking Camera {tracking.index(view) + 1}"
- )
- else:
- labels.append("Perspective" if len(free) == 1 else f"Perspective {free.index(view) + 1}")
- return labels
-
def _draw_streaming_view_controls(self, imgui) -> None:
"""Choose one declared display source without reading the other sensors."""
- imgui.set_next_item_open(True, imgui.Cond_.appearing)
- if not imgui.collapsing_header("Camera View"):
- return
- labels = self._view_labels()
- changed, index = imgui.combo("Camera", self._image_views.index(self.current_image_view), labels)
- if imgui.is_item_hovered():
- imgui.set_tooltip(labels[self._image_views.index(self.current_image_view)])
+ rtx_index = getattr(self, "rtx_view_index", None)
+ if rtx_index is not None:
+ rtx_on = self.rtx_rendering
+ sensor = self.sensor_view_selected
+ if sensor: # The sensor draws its own image, so the choice would only leave the sensor view.
+ imgui.begin_disabled()
+ imgui.text("Renderer")
+ imgui.same_line()
+ if imgui.radio_button("OpenGL", not rtx_on and not sensor) and rtx_on:
+ self.set_rtx_rendering(False)
+ if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
+ imgui.set_tooltip(
+ "Fast rasterizer with visual overlays and markers"
+ if not sensor
+ else "A scene sensor is rendered by its own renderer. This applies to the free and tracking cameras"
+ )
+ imgui.same_line()
+ if imgui.radio_button("RTX", rtx_on) and not rtx_on:
+ self.set_rtx_rendering(True)
+ if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
+ imgui.set_tooltip(
+ "OVRTX path-traced rendering of the scene; slower, without visual overlays"
+ if not sensor
+ else "A scene sensor is rendered by its own renderer. This applies to the free and tracking cameras"
+ )
+ if sensor:
+ imgui.end_disabled()
+ self._draw_focal_length(imgui)
+ # The OVRTX camera is chosen with the Renderer toggle, so the list holds only the other sources.
+ indices = sorted(
+ (i for i in range(len(self._image_views)) if i != rtx_index),
+ key=lambda i: self._source_rank(self._image_views[i]),
+ )
+ labels = self._view_labels(indices)
+ current = self._image_views.index(self.current_image_view)
+ if current == rtx_index: # RTX renders the free perspective source or follows a Tracking Camera.
+ pose_view = self._rtx_pose_view
+ current = (
+ self._image_views.index(pose_view)
+ if pose_view is not None
+ else next(
+ i
+ for i in indices
+ if self._image_views[i].camera is None and not self._is_task_view(self._image_views[i])
+ )
+ )
+ position = indices.index(current)
+ changed, chosen = imgui.combo("Camera Source", position, labels)
if changed:
- self._select_camera(index)
- follower = self._followers.get(self.current_image_view)
+ self._choose_camera_source(indices[chosen])
+ if imgui.is_item_hovered():
+ imgui.set_tooltip(labels[position])
+ self._draw_appearance(imgui)
+ follower = self._followers.get(self._pose_source_view())
if follower is not None:
self._draw_tracking_camera_controls(imgui, follower)
+ elif self.sensor_view_selected:
+ self._draw_sensor_controls(imgui, self.current_image_view)
+ self._draw_camera_info(imgui)
+
+ def _draw_camera_info(self, imgui) -> None:
+ """Draw the navigation camera's position, field of view, and orientation."""
+ camera = getattr(self._viewer, "camera", None)
+ if camera is None:
+ return
+ imgui.separator()
+ pos = camera.pos
+ imgui.text(f"Position: ({pos[0]:.2f}, {pos[1]:.2f}, {pos[2]:.2f})")
+ hover_tooltip(imgui, "World position of the camera [m]")
+ imgui.text(f"Rotation: (pitch {camera.pitch:.1f}, yaw {camera.yaw:.1f}) deg")
+ hover_tooltip(imgui, "Look direction: pitch up or down, yaw around the vertical axis")
+ imgui.text(f"FOV: {camera.fov:.1f} deg")
+ hover_tooltip(imgui, "Vertical field of view; the Focal Length slider changes it")
+
+ def _rtx_appearance_controller(self) -> RtxAppearance | None:
+ """Create the OVRTX appearance controller on first use, or None when it cannot be created."""
+ if self._rtx_appearance is None and not self._rtx_appearance_failed:
+ view = self._rtx_view()
+ try:
+ camera = view.camera
+ renderer = self._sim.get_or_create_backend(camera.cfg.renderer_cfg)
+ self._rtx_appearance = RtxAppearance(
+ self._sim.stage,
+ renderer,
+ camera._render_data.render_product_path,
+ camera.cfg.background_color,
+ )
+ except Exception:
+ logger.exception("[NewtonVisualizer] The OVRTX appearance controls are unavailable.")
+ self._rtx_appearance_failed = True
+ return self._rtx_appearance
+
+ def _draw_appearance(self, imgui) -> None:
+ """Draw the lighting and appearance options of the active renderer, right below the Camera Source selector."""
+ if self.rtx_rendering:
+ self._draw_rtx_appearance(imgui)
+ return
+ callbacks = self._viewer.gui._ui_callbacks.get("rendering") if self._viewer.gui is not None else None
+ if callbacks and imgui.tree_node("Lighting & Appearance###appearance"):
+ for callback in callbacks:
+ callback(imgui)
+ imgui.tree_pop()
- def _select_camera(self, index: int) -> None:
- """Bind the selected source; all scene cameras retain their normal lazy-data lifecycle."""
- self.current_image_view = self._image_views[index]
- camera = self.current_image_view.cfg.source
- self.current_image_view.invalidate()
- if isinstance(camera, PerspectiveCameraCfg):
- if isinstance(camera, TrackingCameraCfg):
- self._apply_view_pose(self.current_image_view)
- else:
- self.set_camera_view(camera.eye, camera.lookat)
- self.cfg.focal_length = camera.focal_length
- self._viewer.camera.fov = self._focal_length_to_vertical_fov_degrees()
+ def _draw_rtx_appearance(self, imgui) -> None:
+ """Draw the Appearance options the OVRTX view supports: its background and its lights, one group per type."""
+ imgui.set_next_item_open(False, imgui.Cond_.appearing)
+ if not imgui.tree_node("Lighting & Appearance###rtx_appearance"):
+ return
+ appearance = self._rtx_appearance_controller()
+ if appearance is None or not appearance.available:
+ imgui.text_disabled("Not available for this renderer")
+ imgui.tree_pop()
+ return
+ edited = appearance.poll()
+
+ def tip(text: str) -> None:
+ hover_tooltip(imgui, text)
+
+ def light_changed(changed: bool) -> bool:
+ return appearance.apply_lights() if changed else False
+
+ def intensity(label: str, value: float, high: float) -> tuple[bool, float]:
+ return imgui.slider_float(label, value, 0.0, high, "%.0f", imgui.SliderFlags_.logarithmic)
+
+ imgui.separator_text("Lights")
+ if appearance.lights:
+ changed, appearance.scene_enabled = imgui.checkbox("Scene Lights", appearance.scene_enabled)
+ tip("The lights the scene authored")
+ edited |= light_changed(changed)
+ if appearance.scene_enabled:
+ imgui.indent()
+ changed, appearance.scene_scale = imgui.slider_float(
+ "Intensity##scene", appearance.scene_scale, 0.0, 3.0, "%.2fx"
+ )
+ tip("Intensity relative to what the scene authored")
+ edited |= light_changed(changed)
+ changed, tint = imgui.color_edit3("Color##scene", list(appearance.scene_tint))
+ tip("Tints the scene's lights; white keeps the colors the scene authored")
+ if changed:
+ appearance.scene_tint = tuple(float(c) for c in tint)
+ edited |= light_changed(changed)
+ imgui.unindent()
else:
- sensor = self.current_image_view.camera
- intrinsics = sensor._data.intrinsic_matrices.torch[0]
- self._viewer.camera.fov = math.degrees(2 * math.atan(sensor.cfg.height / (2 * float(intrinsics[1, 1]))))
- self._navigation_fov = self._viewer.camera.fov
- if self._viewer.picking is not None:
- # Release an existing drag without replacing any graph-captured picking buffers.
- self._viewer.picking.release()
+ imgui.text_disabled("This scene has no lights of its own")
+
+ changed, appearance.dome_enabled = imgui.checkbox("Dome Light", appearance.dome_enabled)
+ tip("Soft light from a sky all around the scene, and the sky behind it. Off by default")
+ edited |= light_changed(changed)
+ if appearance.dome_enabled:
+ imgui.indent()
+ changed, appearance.dome_intensity = intensity("Intensity##dome", appearance.dome_intensity, 10000.0)
+ tip("Brightness of the dome light")
+ edited |= light_changed(changed)
+ changed, color = imgui.color_edit3("Color##dome", list(appearance.dome_color))
+ tip("Color of the dome light; with a sky texture it tints the texture")
+ if changed:
+ appearance.dome_color = tuple(float(c) for c in color)
+ edited |= light_changed(changed)
+ edited |= self._draw_sky_texture(imgui, appearance)
+ imgui.unindent()
+
+ solid = appearance.background == 1
+ changed, solid = imgui.checkbox("Solid Background", solid)
+ tip("Show one color behind the scene instead of the sky. The lighting does not change")
+ if changed:
+ appearance.background = 1 if solid else 0
+ edited |= appearance.apply_background()
+ if solid:
+ imgui.indent()
+ changed, color = imgui.color_edit3("Color##background", list(appearance.background_color))
+ tip("Background color")
+ if changed:
+ appearance.background_color = tuple(float(c) for c in color)
+ edited |= appearance.apply_background()
+ imgui.unindent()
+
+ changed, appearance.sun_enabled = imgui.checkbox("Distant Light", appearance.sun_enabled)
+ tip("Parallel light from one direction, like the sun, casting sharp shadows. Off by default")
+ edited |= light_changed(changed)
+ if appearance.sun_enabled:
+ imgui.indent()
+ changed, appearance.sun_intensity = intensity("Intensity##sun", appearance.sun_intensity, 20000.0)
+ tip("Brightness of the distant light")
+ edited |= light_changed(changed)
+ changed, color = imgui.color_edit3("Color##sun", list(appearance.sun_color))
+ tip("Color of the distant light")
+ if changed:
+ appearance.sun_color = tuple(float(c) for c in color)
+ edited |= light_changed(changed)
+ changed, appearance.sun_angle = imgui.slider_float("Angle", appearance.sun_angle, 0.0, 10.0, "%.1f deg")
+ tip("Apparent size of the light; larger values give softer shadow edges")
+ edited |= light_changed(changed)
+ changed, appearance.sun_elevation = imgui.slider_float(
+ "Elevation", appearance.sun_elevation, 5.0, 90.0, "%.0f deg"
+ )
+ tip("Height of the light above the horizon; 90 is straight down")
+ edited |= light_changed(changed)
+ changed, appearance.sun_azimuth = imgui.slider_float(
+ "Azimuth", appearance.sun_azimuth, 0.0, 360.0, "%.0f deg"
+ )
+ tip("Direction the light comes from, around the vertical axis")
+ edited |= light_changed(changed)
+ imgui.unindent()
+
+ if imgui.button("Reset##rtx_appearance"):
+ edited |= appearance.reset()
+ tip("Return to the scene's own lights and background")
+ if appearance.error:
+ failed = appearance.error.startswith("Could")
+ imgui.push_style_color(
+ imgui.Col_.text, imgui.ImVec4(1.0, 0.35, 0.35, 1.0) if failed else imgui.ImVec4(0.8, 0.8, 0.8, 1.0)
+ )
+ imgui.text_wrapped(appearance.error)
+ imgui.pop_style_color()
+ if edited:
+ self._rtx_view().invalidate()
+ self._last_render_step = -1
+ imgui.tree_pop()
+
+ def _draw_sky_texture(self, imgui, appearance: RtxAppearance) -> bool:
+ """Choose the dome light's sky texture from the ones tasks use, or a file; returns whether it changed."""
+ names = list(SKY_TEXTURES)
+ current = appearance.dome_texture
+ custom = len(names) + 1
+ if self._sky_custom_open: # Stays selected until a listed sky is chosen, since the file is set only on Load.
+ index = custom
+ elif not current:
+ index = 0
+ elif current in SKY_TEXTURES.values():
+ index = names.index(next(n for n in names if SKY_TEXTURES[n] == current)) + 1
+ else:
+ index = custom
+ changed, chosen = imgui.combo("Sky", index, ["None", *names, "Custom File..."])
+ hover_tooltip(imgui, "Wrap a panoramic HDR image around the scene as its sky")
+ edited = False
+ if changed:
+ self._sky_custom_open = chosen == custom
+ if changed and chosen <= len(names):
+ appearance.use_sky(SKY_TEXTURES[names[chosen - 1]] if chosen else "")
+ edited = True
+ if chosen == custom:
+ _c, self._sky_custom = imgui.input_text("File##sky", self._sky_custom)
+ hover_tooltip(imgui, "Path or URL of a panoramic .hdr or .exr image")
+ if imgui.button("Load##sky") and self._sky_custom:
+ appearance.use_sky(self._sky_custom)
+ status = appearance.texture_status
+ if status: # Yellow while the sky downloads, red when it could not be loaded.
+ failed = status.startswith("Could")
+ imgui.text_colored(
+ imgui.ImVec4(1.0, 0.35, 0.35, 1.0) if failed else imgui.ImVec4(1.0, 0.8, 0.2, 1.0), status
+ )
+ return edited
+
+ def _source_rank(self, view) -> int:
+ """Order the Camera Source list: the free Perspective, then Tracking Cameras, then scene sensors."""
+ if view.camera is not None:
+ return 2
+ return 1 if self._is_task_view(view) else 0
+
+ def _draw_sensor_controls(self, imgui, view) -> None:
+ """Choose which channel of a sensor is shown, and which environment, or tile several environments."""
+ camera = view.camera
+ imgui.separator_text("Camera Sensor")
+ self._draw_sensor_channels(imgui, view)
+ offered = self._sensor_tiles.get(view)
+ if offered is None: # A single-instance sensor has no environment to choose.
+ return
+ shown = len(view.cfg.envs)
+ limit = min(offered, MAX_TILED_ENVS)
+ changed, count = imgui.input_int("Tiled Envs", shown)
+ hover_tooltip(
+ imgui, f"How many environments are shown side by side, from environment 0 (up to {limit}). 1 shows one."
+ )
+ if changed:
+ count = max(1, min(count, limit))
+ view.cfg.envs = tuple(range(count)) if count > 1 else (view.cfg.envs[0] if shown == 1 else 0,)
+ self._invalidate_sensor_view(view)
+ if len(view.cfg.envs) > 1:
+ imgui.begin_disabled()
+ env = view.cfg.envs[0] if view.cfg.envs else 0
+ changed, new_env = imgui.input_int("Environment", env)
+ hover_tooltip(imgui, "Environment whose camera is shown when Tiled Envs is 1")
+ if len(view.cfg.envs) > 1:
+ imgui.end_disabled()
+ if changed and len(view.cfg.envs) == 1 and 0 <= new_env < camera.num_instances:
+ view.cfg.envs = (new_env,)
+ self._invalidate_sensor_view(view)
+
+ _CHANNEL_LABELS = {"rgb": "RGB", "depth": "Depth", "normals": "Normals", "segmentation": "Segmentation"}
+
+ def _draw_sensor_channels(self, imgui, view) -> None:
+ """Choose which output of the sensor is shown, with a color scale range for depth."""
+ available = display_channels(view.camera.cfg.data_types)
+ if not available:
+ return
+ keys = frozenset(view.camera.cfg.data_types)
+ options = []
+ for channel in available:
+ key = sensor_key_for_gt_type(channel, keys)
+ # A color image that is not the plain render, such as albedo, is named by its output.
+ options.append(
+ (key if channel == "rgb" and key not in ("rgb", "rgba") else self._CHANNEL_LABELS[channel], (channel,))
+ )
+ if len(available) > 1:
+ options.append(("All", available))
+ current = tuple(view.cfg.channels)
+ index = next((i for i, (_, channels) in enumerate(options) if channels == current), -1)
+ if index < 0:
+ options.append(("Custom", current))
+ index = len(options) - 1
+ changed, chosen = imgui.combo("Channel", index, [label for label, _ in options])
+ hover_tooltip(imgui, "Which output of the sensor is shown: its color image, depth, normals, or segmentation")
+ if changed:
+ self.set_sensor_channels(view, options[chosen][1])
+ if "depth" in view.cfg.channels:
+ near, far = view.cfg.depth_range
+ changed, (new_near, new_far) = imgui.input_float2("Depth Range (m)", [near, far])
+ hover_tooltip(imgui, "Distances mapped to the ends of the depth color scale")
+ if changed and 0.0 <= new_near < new_far:
+ view.cfg.depth_range = (float(new_near), float(new_far))
+ self._invalidate_sensor_view(view)
+
+ def set_sensor_channels(self, view, channels: tuple[str, ...]) -> None:
+ """Show ``channels`` of a sensor view, which the sensor must provide.
- self._navigation_view = self._viewer.camera.get_view_matrix().reshape(4, 4).T.copy()
+ Args:
+ view: Image view of a scene camera.
+ channels: Display channels, such as ``("depth",)``, shown side by side.
+ """
+ view.cfg.channels = tuple(channels)
+ self._invalidate_sensor_view(view)
- def _navigate_scene_camera(self) -> None:
- camera, viewer = self.current_image_view.camera, self._viewer
- if viewer.is_paused():
- return
- if viewer.camera.fov != self._navigation_fov:
- height, width = camera.image_shape
- focal = height / (2 * math.tan(math.radians(viewer.camera.fov) / 2))
- intrinsics = torch.tensor(
- [[focal, 0, width / 2], [0, focal, height / 2], [0, 0, 1]], device=camera.device
- ).expand(camera.num_instances, -1, -1)
- camera.set_intrinsic_matrices(intrinsics)
- self._navigation_fov = viewer.camera.fov
- self.current_image_view.invalidate()
- current = viewer.camera.get_view_matrix().reshape(4, 4).T
- previous, self._navigation_view = self._navigation_view, current.copy()
- if np.array_equal(previous, current):
+ def _invalidate_sensor_view(self, view) -> None:
+ view.invalidate()
+ self._last_render_step = -1
+
+ def _draw_focal_length(self, imgui) -> None:
+ """Draw the focal length of the free camera or the Tracking Camera; sensors have fixed intrinsics."""
+ view = self._pose_source_view()
+ rtx_view = self._image_views[self.rtx_view_index] if self.rtx_view_index is not None else None
+ if view.camera is not None and view is not rtx_view:
return
- delta = previous @ np.linalg.inv(current)
- positions, orientations = camera.get_world_poses(convention="opengl")
- delta = torch.as_tensor(delta, dtype=positions.dtype, device=positions.device)
- translation = quat_apply(orientations, delta[:3, 3].expand_as(positions))
- rotation = quat_from_matrix(delta[:3, :3]).expand_as(orientations)
- camera.set_world_poses(positions + translation, quat_mul(orientations, rotation), convention="opengl")
- self.current_image_view.invalidate()
+ task = self._is_task_view(view)
+ source = view.cfg.source if task else self.cfg
+ changed, focal = imgui.slider_float("Focal Length", float(source.focal_length), 5.0, 64.0, "%.0f mm")
+ hover_tooltip(imgui, "Lens focal length of the camera; smaller values see a wider area")
+ if changed:
+ source.focal_length = focal
+ self._viewer.camera.fov = self._focal_length_to_vertical_fov_degrees(focal)
+ view.invalidate()
+ self._last_render_step = -1
def _draw_tracking_camera_controls(self, imgui, follower: CameraFollower) -> None:
"""Edit the selected Tracking Camera: what it follows, where it sits, and where it looks."""
@@ -697,8 +1342,7 @@ def _draw_tracking_camera_controls(self, imgui, follower: CameraFollower) -> Non
edited = False
def tip(text: str) -> None:
- if imgui.is_item_hovered():
- imgui.set_tooltip(text)
+ hover_tooltip(imgui, text)
imgui.separator_text("Tracking Camera")
changed, env = imgui.input_int("Environment", follower.env)
@@ -726,10 +1370,6 @@ def tip(text: str) -> None:
tip("Point the camera looks at, as an offset from the followed asset or the environment origin")
if changed:
cfg.lookat, edited = tuple(float(v) for v in lookat), True
- changed, focal = imgui.slider_float("Focal Length", float(cfg.focal_length), 5.0, 100.0, "%.0f mm")
- tip("Lens focal length of the camera; smaller values see a wider area")
- if changed:
- cfg.focal_length, edited = focal, True
if asset_name:
changed, cfg.follow_heading = imgui.checkbox("Follow Heading", cfg.follow_heading)
tip("Turn with the asset's heading, so the camera stays behind it and level")
@@ -764,7 +1404,7 @@ def _set_tracking_path(self, follower: CameraFollower, track_path: str | None) -
def _reset_tracking_camera(self, follower: CameraFollower) -> bool:
"""Restore the camera's declared pose, optics, and target; returns whether anything changed."""
- defaults = self._tracking_defaults.get(self.current_image_view)
+ defaults = self._tracking_defaults.get(self._pose_source_view()) # In RTX the Tracking view is not current.
if defaults is None:
return False
cfg = follower.cfg
@@ -772,8 +1412,110 @@ def _reset_tracking_camera(self, follower: CameraFollower) -> bool:
cfg.follow_heading = defaults["follow_heading"]
cfg.heading_smoothing_time_constant = defaults["heading_smoothing_time_constant"]
follower.set_env(defaults["env"])
- # the pose, optics and heading settings are restored even when the asset cannot be, which is reported
- self._set_tracking_path(follower, defaults["track_path"])
+ return self._set_tracking_path(follower, defaults["track_path"]) or True
+
+ def _view_labels(self, indices: list[int] | None = None) -> list[str]:
+ """Name the listed image views: a task view is the Tracking Camera, a free view is the Perspective."""
+ views = self._image_views if indices is None else [self._image_views[i] for i in indices]
+ free = [v for v in views if v.camera is None and not self._is_task_view(v)]
+ tracking = [v for v in views if self._is_task_view(v)]
+ labels = []
+ for view in views:
+ if view.camera is not None:
+ labels.append(self._sensor_label(view.cfg.source, view.camera.cfg.data_types))
+ elif self._is_task_view(view):
+ labels.append(
+ "Tracking Camera" if len(tracking) == 1 else f"Tracking Camera {tracking.index(view) + 1}"
+ )
+ else:
+ labels.append("Perspective" if len(free) == 1 else f"Perspective {free.index(view) + 1}")
+ return labels
+
+ _OUTPUT_NAMES = {
+ "rgb": "RGB",
+ "rgba": "RGB",
+ "depth": "depth",
+ "distance_to_image_plane": "depth",
+ "distance_to_camera": "distance",
+ "normals": "normals",
+ "semantic_segmentation": "semantic seg",
+ "instance_segmentation": "instance seg",
+ "instance_id_segmentation_fast": "instance seg",
+ "albedo": "albedo",
+ "simple_shading_constant_diffuse": "shaded",
+ "simple_shading_diffuse_mdl": "shaded",
+ "simple_shading_full_mdl": "shaded",
+ }
+ """Short names of the outputs a scene camera lists in the Camera Source dropdown."""
+
+ @staticmethod
+ def _sensor_label(prim_path: str, data_types=()) -> str:
+ """Name a scene camera by its own prim name, without the per-environment path pattern.
+
+ The outputs follow in parentheses, such as ``Camera (depth sensor)`` or ``Camera (RGB + depth sensor)``.
+ """
+ names = NewtonVisualizerBase._OUTPUT_NAMES
+ outputs = list(dict.fromkeys(names[key] for key in data_types if key in names))
+ kind = " + ".join(outputs[:3]) + " " if outputs else ""
+ return f"{prim_path.rstrip('/').rsplit('/', 1)[-1]} ({kind}sensor)"
+
+ @staticmethod
+ def _is_task_view(view) -> bool:
+ """Whether *view* is a perspective view tied to an environment or an asset."""
+ return isinstance(view.cfg.source, TrackingCameraCfg)
+
+ def _pose_source_view(self):
+ """Return the view whose camera settings are shown: the one driving the OVRTX camera, or the current view."""
+ if getattr(self, "rtx_rendering", False) and self._rtx_pose_view is not None:
+ return self._rtx_pose_view
+ return self.current_image_view
+
+ def _choose_camera_source(self, index: int) -> None:
+ """Switch the camera source; a free or Tracking Camera source keeps the OVRTX renderer when it is on."""
+ view = self._image_views[index]
+ if self.rtx_rendering and view.camera is None:
+ self._remember_perspective_pose()
+ self._rtx_pose_view = view if self._is_task_view(view) else None
+ if self._rtx_pose_view is not None:
+ self._apply_view_pose(view)
+ else:
+ self._restore_perspective_pose(view)
+ self.current_image_view.invalidate()
+ return
+ self._select_camera(index)
+
+ def _free_view_in_use(self):
+ """Return the free Perspective view whose pose the viewer camera holds, or None when another source has it."""
+ view = self._pose_source_view()
+ if view is not None and view.camera is not None and getattr(self, "rtx_rendering", False):
+ # The OVRTX camera follows the free view when no Tracking Camera drives it.
+ view = next((v for v in self._image_views if v.camera is None and not self._is_task_view(v)), None)
+ if view is None or view.camera is not None or self._is_task_view(view):
+ return None
+ return view
+
+ def _remember_perspective_pose(self) -> None:
+ """Save the free Perspective view's pose before another source takes over the viewer camera."""
+ view = self._free_view_in_use()
+ if view is not None and self._viewer is not None:
+ camera = self._viewer.camera
+ pos = camera.pos
+ self._perspective_poses[view] = (
+ (float(pos[0]), float(pos[1]), float(pos[2])),
+ camera.pitch,
+ camera.yaw,
+ self.cfg.focal_length,
+ )
+
+ def _restore_perspective_pose(self, view) -> bool:
+ """Put the viewer camera back where the free Perspective *view* was left; False when it was never left."""
+ saved = self._perspective_poses.get(view)
+ if saved is None:
+ return False
+ pos, pitch, yaw, focal = saved
+ self._viewer.set_camera(PygletVec3(*pos), pitch, yaw)
+ self.cfg.focal_length = focal
+ self._viewer.camera.fov = self._focal_length_to_vertical_fov_degrees(focal)
return True
def _remember_tracking_defaults(self, view, follower: CameraFollower) -> None:
@@ -795,7 +1537,6 @@ def _apply_view_pose(self, view) -> bool:
Returns:
Whether the view had a pose yet; a view that follows an asset has none until the asset is ready.
"""
- source = view.cfg.source
follower = self._followers.get(view)
pose = follower and follower.pose(self._sim.get_physics_step_count() * self._sim.get_physics_dt())
if pose is None or follower is None:
@@ -804,9 +1545,80 @@ def _apply_view_pose(self, view) -> bool:
camera.pos = PygletVec3(*pose[0])
camera.look_at(pose[1])
self._viewer.set_camera(camera.pos, camera.pitch, camera.yaw)
- camera.fov = self._focal_length_to_vertical_fov_degrees(source.focal_length)
+ camera.fov = self._focal_length_to_vertical_fov_degrees(view.cfg.source.focal_length)
return True
+ def _select_camera(self, index: int, *, keep_pose: bool = False) -> None:
+ """Bind the selected source; all scene cameras retain their normal lazy-data lifecycle.
+
+ Args:
+ index: Image view to display.
+ keep_pose: Continue from the viewer's current camera instead of the source's configured pose.
+ """
+ self._remember_perspective_pose()
+ self.current_image_view = self._image_views[index]
+ if index != self.rtx_view_index:
+ self._rtx_pose_view = None
+ camera = self.current_image_view.cfg.source
+ self.current_image_view.invalidate()
+ if isinstance(camera, PerspectiveCameraCfg):
+ if isinstance(camera, TrackingCameraCfg):
+ self._apply_view_pose(self.current_image_view)
+ elif not keep_pose and not self._restore_perspective_pose(self.current_image_view):
+ self.set_camera_view(camera.eye, camera.lookat)
+ self.cfg.focal_length = camera.focal_length
+ self._viewer.camera.fov = self._focal_length_to_vertical_fov_degrees()
+ elif keep_pose:
+ self._place_scene_camera_at_viewer(self.current_image_view.camera)
+ else:
+ sensor = self.current_image_view.camera
+ intrinsics = sensor._data.intrinsic_matrices.torch[0]
+ self._viewer.camera.fov = math.degrees(2 * math.atan(sensor.cfg.height / (2 * float(intrinsics[1, 1]))))
+ # None makes the first navigation step copy the viewer's field of view to a scene camera.
+ self._navigation_fov = (
+ None if keep_pose and not isinstance(camera, PerspectiveCameraCfg) else self._viewer.camera.fov
+ )
+ if self._viewer.picking is not None:
+ # Release an existing drag without replacing any graph-captured picking buffers.
+ self._viewer.picking.release()
+
+ self._navigation_view = self._viewer.camera.get_view_matrix().reshape(4, 4).T.copy()
+
+ def _place_scene_camera_at_viewer(self, camera: Camera) -> None:
+ """Move a scene camera to the viewer camera's current world pose."""
+ world_from_camera = np.linalg.inv(self._viewer.camera.get_view_matrix().reshape(4, 4).T)
+ positions, orientations = camera.get_world_poses(convention="opengl")
+ position = torch.as_tensor(world_from_camera[:3, 3], dtype=positions.dtype, device=positions.device)
+ rotation = quat_from_matrix(
+ torch.as_tensor(world_from_camera[:3, :3], dtype=positions.dtype, device=positions.device)
+ )
+ camera.set_world_poses(position.expand_as(positions), rotation.expand_as(orientations), convention="opengl")
+
+ def _navigate_scene_camera(self) -> None:
+ camera, viewer = self.current_image_view.camera, self._viewer
+ if viewer.is_paused():
+ return
+ if viewer.camera.fov != self._navigation_fov:
+ height, width = camera.image_shape
+ focal = height / (2 * math.tan(math.radians(viewer.camera.fov) / 2))
+ intrinsics = torch.tensor(
+ [[focal, 0, width / 2], [0, focal, height / 2], [0, 0, 1]], device=camera.device
+ ).expand(camera.num_instances, -1, -1)
+ camera.set_intrinsic_matrices(intrinsics)
+ self._navigation_fov = viewer.camera.fov
+ self.current_image_view.invalidate()
+ current = viewer.camera.get_view_matrix().reshape(4, 4).T
+ previous, self._navigation_view = self._navigation_view, current.copy()
+ if np.array_equal(previous, current):
+ return
+ delta = previous @ np.linalg.inv(current)
+ positions, orientations = camera.get_world_poses(convention="opengl")
+ delta = torch.as_tensor(delta, dtype=positions.dtype, device=positions.device)
+ translation = quat_apply(orientations, delta[:3, 3].expand_as(positions))
+ rotation = quat_from_matrix(delta[:3, :3]).expand_as(orientations)
+ camera.set_world_poses(positions + translation, quat_mul(orientations, rotation), convention="opengl")
+ self.current_image_view.invalidate()
+
def _capture_view(self, view, output: wp.array | None) -> wp.array:
"""Capture a perspective *view*, borrowing the viewer camera when the window shows another one."""
current = self.current_image_view
@@ -875,6 +1687,13 @@ def reset(self, soft: bool = False) -> None:
def close(self) -> None:
"""Detach perspective producers before releasing the visualizer's borrowed views."""
self._pending_mesh_submissions.clear()
+ self._followers.clear()
+ self._tracking_defaults.clear()
+ self._perspective_poses.clear()
+ self._sensor_tiles.clear()
+ if self._rtx_appearance is not None:
+ self._rtx_appearance.close()
+ self._rtx_appearance = None
for view in self._image_views:
owned = isinstance(view.render, partial) and view.render.func == self._capture_view
if owned:
@@ -1030,6 +1849,9 @@ def __init__(self, cfg: VisualizerCfg):
super().__init__(cfg)
self._viewer_picking_binding = self._ViewerPickingBinding()
self._picking_enabled = False
+ self._cfg_visible_env_ids: list[int] | None = None
+ self._visible_env_count: int | None = None
+ self._num_envs = 0
# ------------------------------------------------------------------
# GL lifecycle
@@ -1069,16 +1891,46 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
self._picking_enabled = self.cfg.backend.enable_picking and picking_supported and not self._runtime_headless
self._viewer.set_model(self.backend.model)
+ self._viewer.set_impulse_substep_dt(getattr(self.backend, "solver_dt", None) or sim.get_physics_dt())
if self._picking_enabled:
# Keep Newton's public force path scoped to picking for this integration.
self._viewer.wind = None
- self._viewer.set_visible_worlds(self._env_ids)
- self._viewer.set_world_offsets(self.cfg.backend.world_spacing)
+ self._cfg_visible_env_ids = self._env_ids
+ self._num_envs = num_envs
+ self._viewer._owner = self
+ self._apply_visible_worlds()
self._viewer._paused = False
self._viewer.picking_enabled = self._picking_enabled
self._configure_viewer()
+ scene = self._sim.get_scene_data_provider().get_interactive_scene()
+ for view in self._image_views:
+ if scene is not None and self._is_task_view(view):
+ # Fail at initialization, not on a frame: a bad env_index or track_path raises here.
+ self._followers[view] = follower = CameraFollower(view.cfg.source, scene)
+ cfg = view.cfg.source
+ self._tracking_defaults[view] = {
+ "eye": cfg.eye,
+ "lookat": cfg.lookat,
+ "focal_length": cfg.focal_length,
+ "track_path": cfg.track_path,
+ "follow_heading": cfg.follow_heading,
+ "heading_smoothing_time_constant": cfg.heading_smoothing_time_constant,
+ "env": follower.env,
+ }
+ for view in self._image_views:
+ camera = view.camera
+ if camera is not None and camera.num_instances > 1 and view is not self._rtx_view():
+ # Tile the first environments; the HUD changes how many, down to a single chosen one.
+ self._sensor_tiles[view] = camera.num_instances
+ view.cfg.envs = tuple(range(min(DEFAULT_TILED_ENVS, camera.num_instances)))
self._select_camera(0)
+ if self.cfg.enable_markers and self.rtx_view_index is not None:
+ # OVRTX draws markers as stage prims; the viewer camera's renderer shares the registry's groups.
+ renderer_cfg = self._image_views[self.rtx_view_index].camera.cfg.renderer_cfg
+ sim.get_or_create_backend(renderer_cfg).marker_groups = sim.vis_marker_registry.get_groups().values()
+ if self.rtx_view_index is not None:
+ self._overlay_publisher = OverlayMeshPublisher(f"Viewer_{id(self)}")
num_visualized_envs = len(self._env_ids) if self._env_ids is not None else num_envs
self._log_initialization_table(
@@ -1114,13 +1966,15 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
def _render_frame(self) -> None:
"""Render one GL frame for the window or an on-demand capture."""
viewer = self._viewer
- view = self.current_image_view
- if self._is_tracking_view(view) and not viewer.is_paused(): # a paused scene is frozen, so is its camera
- self._apply_view_pose(view)
viewer.begin_frame(self._sim_time)
try:
+ viewer.image_matches_camera = self.rtx_rendering
+ pose_view = self._pose_source_view()
+ if self._is_task_view(pose_view) and not viewer.is_paused(): # a paused scene is frozen, so is its camera
+ self._apply_view_pose(pose_view)
if self.current_image_view.camera is not None:
self._navigate_scene_camera()
+ self._refresh_paused_rtx_view(self._log_rtx_overlays())
self._log_streaming_image()
elif not viewer.is_paused():
state = self._update_state()
@@ -1146,6 +2000,72 @@ def _render_frame(self) -> None:
if self.current_image_view.camera is None:
self.current_image_view.invalidate()
+ def _log_rtx_overlays(self) -> bool:
+ """Draw the line and arrow overlays the HUD enables, and the drag and impulse arrows, as meshes in OVRTX.
+
+ Returns:
+ Whether a drag or impulse arrow is being drawn, which an OVRTX view that is not stepping must render again.
+ """
+ publisher, viewer = self._overlay_publisher, self._viewer
+ if publisher is None or not self.rtx_rendering:
+ return False
+ renderers = self._rtx_renderers
+ overlays = any(
+ getattr(viewer, flag)
+ for flag in ("show_joints", "show_contacts", "show_springs", "show_com", "show_inertia_boxes")
+ )
+ drag = viewer.impulse_drag
+ dragging = viewer.picking_enabled and (
+ (viewer.picking is not None and viewer.picking.is_picking())
+ or (drag is not None and bool(drag.entries))
+ or viewer._impulse_arrows_shown # One more pass clears the arrows that were drawn.
+ )
+ if not overlays and not dragging:
+ publisher.hide_all(renderers)
+ return False
+ if viewer.is_paused():
+ return False
+ state = self._update_state()
+ if state.body_q is not None and not len(state.body_q):
+ return False
+ viewer._overlay_capture = publisher
+ # Contact disks are instanced meshes that only the OpenGL view draws, and they dominate the contact cost.
+ disks = viewer.show_contact_disks
+ viewer.show_contact_disks = False
+ try:
+ if overlays:
+ # Only the overlays are needed, not the per-shape instances that log_state also updates for OpenGL.
+ getattr(viewer, "_log_non_shape_state", viewer.log_state)(state)
+ contacts = self._sim.backend_manager.get_contacts() if self.physics_backend == "newton" else None
+ if contacts is not None:
+ viewer.log_contacts(contacts, state)
+ else:
+ self._log_scene_contact_sensor_arrows()
+ else:
+ viewer._render_picking_line(state)
+ finally:
+ viewer._overlay_capture = None
+ viewer.show_contact_disks = disks
+ publisher.publish(renderers)
+ return bool(dragging)
+
+ def _refresh_paused_rtx_view(self, arrows_changed: bool) -> None:
+ """Render the OVRTX camera again while the simulation is paused, which does not render it by itself.
+
+ Args:
+ arrows_changed: Whether a drag or impulse arrow is being drawn, so the image changes every frame.
+ """
+ view = self.current_image_view
+ if not self.rtx_rendering or not self.is_training_paused():
+ self._rtx_arrows_pending = False
+ return
+ if not (arrows_changed or self._rtx_arrows_pending or view.frame.timestamp < 0):
+ return
+ view.camera._is_outdated.fill_(True)
+ view.camera.update(0.0, force_recompute=True)
+ view.invalidate()
+ self._rtx_arrows_pending = arrows_changed # One more render shows the arrows gone.
+
def _update_state(self):
"""Publish current scene state while the GL frame is active."""
state = self.backend.state_0
@@ -1157,6 +2077,128 @@ def _update_state(self):
provider.get_geometry_points(output=state.particle_q, offsets=self.backend.geometry_offsets)
return state
+ def _rtx_view(self):
+ """The OVRTX viewer camera's image view, or None when the scene has none."""
+ index = self.rtx_view_index
+ return None if index is None else self._image_views[index]
+
+ @property
+ def rtx_view_index(self) -> int | None:
+ """Index of the OVRTX viewer camera among the image views, or None when the scene has none."""
+ for index, view in enumerate(self._image_views):
+ if view.camera is not None and getattr(view.camera.cfg, "prim_path", "").startswith(
+ "/World/viewer_camera_"
+ ):
+ return index
+ return None
+
+ @property
+ def _rtx_renderers(self) -> tuple:
+ """OVRTX renderers of the viewer camera; empty when the scene has none."""
+ index = self.rtx_view_index
+ if index is None or self._sim is None:
+ return ()
+ return (self._sim.get_or_create_backend(self._image_views[index].camera.cfg.renderer_cfg),)
+
+ @property
+ def sensor_view_selected(self) -> bool:
+ """Whether the main view shows a scene sensor, which is rendered by its own renderer."""
+ view = self.current_image_view
+ return view is not None and view.camera is not None and not self.rtx_rendering
+
+ @property
+ def rtx_rendering(self) -> bool:
+ """Whether the main view is currently rendered by OVRTX."""
+ index = self.rtx_view_index
+ return index is not None and self.current_image_view is self._image_views[index]
+
+ def set_rtx_rendering(self, enabled: bool) -> None:
+ """Render the main camera with OVRTX or with the Newton OpenGL rasterizer, keeping the camera pose.
+
+ Args:
+ enabled: ``True`` for the OVRTX viewer camera, ``False`` for the Newton GL perspective view.
+ """
+ rtx_index = self.rtx_view_index
+ if rtx_index is None:
+ raise RuntimeError("The scene has no OVRTX viewer camera; see NewtonGLBackendCfg.rtx_camera.")
+ free = [i for i, view in enumerate(self._image_views) if view.camera is None and not self._is_task_view(view)]
+ if enabled:
+ # A Tracking Camera keeps moving the OVRTX camera, which has no pose of its own.
+ current = self.current_image_view
+ self._rtx_pose_view = current if self._is_task_view(current) else None
+ self._select_camera(rtx_index, keep_pose=True)
+ else:
+ if self._overlay_publisher is not None:
+ self._overlay_publisher.hide_all(self._rtx_renderers)
+ back = self._rtx_pose_view
+ self._rtx_pose_view = None
+ self._select_camera(self._image_views.index(back) if back is not None else free[0], keep_pose=True)
+
+ @property
+ def visible_env_limit(self) -> int:
+ """Largest value of the visible-environment count: the environments the cfg allows, else all."""
+ return len(self._cfg_visible_env_ids) if self._cfg_visible_env_ids is not None else self._num_envs
+
+ @property
+ def visible_env_count(self) -> int:
+ """Number of environments currently shown."""
+ if self._visible_env_count is not None:
+ return min(self._visible_env_count, self.visible_env_limit)
+ return self.visible_env_limit
+
+ def set_visible_env_count(self, count: int) -> None:
+ """Show only the first ``count`` environments.
+
+ Args:
+ count: Number of environments to show, clamped to ``[1, visible_env_limit]``.
+ """
+ self._visible_env_count = max(1, min(int(count), self.visible_env_limit))
+ self._apply_visible_worlds()
+
+ def _select_visible_env_ids(self) -> list[int] | None:
+ """Resolve the environments to show from the cfg and the HUD count."""
+ if self._visible_env_count is None:
+ return self._cfg_visible_env_ids
+ ids = self._cfg_visible_env_ids if self._cfg_visible_env_ids is not None else range(self._num_envs)
+ return list(ids)[: self._visible_env_count]
+
+ def _drop_shape_instancers(self) -> None:
+ """Free the GL shape instancers so they are re-allocated for the new visible worlds.
+
+ Newton keeps an instancer per shape batch by name and reuses it with its original capacity, so showing
+ more worlds than were visible when it was allocated fails every frame with a capacity error.
+ """
+ objects = getattr(self._viewer, "objects", None)
+ if objects is None or not hasattr(self._viewer, "_qualify"):
+ return
+ prefix = self._viewer._qualify("/model/shapes/")
+ for key in [k for k in objects if k.startswith(prefix) and hasattr(objects[k], "num_instances")]:
+ del objects[key]
+
+ def _apply_visible_worlds(self) -> None:
+ """Apply the visible environments."""
+ if self._viewer is None:
+ return
+ self._env_ids = self._select_visible_env_ids()
+ self._drop_shape_instancers()
+ self._viewer.set_visible_worlds(self._env_ids)
+ self._viewer.set_world_offsets(self.cfg.backend.world_spacing)
+ self._apply_rtx_visible_envs()
+
+ def _apply_rtx_visible_envs(self) -> None:
+ """Hide the environments outside the visible set in the OVRTX viewer camera's scene."""
+ index = self.rtx_view_index
+ if index is None:
+ return
+ renderer = self._sim.get_or_create_backend(self._image_views[index].camera.cfg.renderer_cfg)
+ num_envs = len(renderer._env_paths)
+ if num_envs:
+ visible = np.ones(num_envs, dtype=bool) if self._env_ids is None else np.zeros(num_envs, dtype=bool)
+ if self._env_ids is not None:
+ visible[np.asarray(list(self._env_ids), dtype=int)] = True
+ renderer.set_environment_visibility(visible)
+ self._image_views[index].invalidate()
+
def reset(self, soft: bool = False) -> None:
"""Restore GL overlays and picking after the shared model binding changes."""
super().reset(soft)
@@ -1169,11 +2211,10 @@ def reset(self, soft: bool = False) -> None:
self._transform_mapping = self._sim.get_scene_data_provider().create_mapping(list(backend.model.body_label))
self._viewer.set_model(backend.model)
self._viewer.register_ui_callback(self._viewer._render_training_controls, position="side")
- self._viewer.register_ui_callback(self._draw_streaming_view_controls, position="side")
+ self._viewer._view_controls = self._draw_streaming_view_controls
if self._picking_enabled:
self._viewer.wind = None
- self._viewer.set_visible_worlds(self._env_ids)
- self._viewer.set_world_offsets(self.cfg.backend.world_spacing)
+ self._apply_visible_worlds()
self._configure_viewer()
self._viewer.picking_enabled = self._picking_enabled
if self._picking_enabled:
@@ -1298,7 +2339,9 @@ def _live_plots_panel_imgui(self, imgui) -> None:
if not plots._scalar_buffers and not plots._array_buffers:
return
imgui.set_next_item_open(False, imgui.Cond_.appearing)
- if not imgui.collapsing_header("Live Plots"):
+ expanded = imgui.collapsing_header("Live Plots")
+ hover_tooltip(imgui, "Plot task values such as rewards and observations while it runs")
+ if not expanded:
return
imgui.separator()
scale = viewer.gui.ui.dpi_scale
@@ -1312,7 +2355,9 @@ def _live_plots_panel_imgui(self, imgui) -> None:
for base_name in sorted(groups, key=lambda name: not name.startswith("episode/")):
term_label = base_name.rsplit("/", 1)[-1]
- if not imgui.collapsing_header(term_label):
+ shown = imgui.collapsing_header(term_label)
+ hover_tooltip(imgui, self._live_plot_tooltip(base_name))
+ if not shown:
continue
if implot.begin_plot(f"##{base_name}", imgui.ImVec2(-1, 180 * scale)):
auto = implot.AxisFlags_.auto_fit.value
@@ -1330,9 +2375,20 @@ def _live_plots_panel_imgui(self, imgui) -> None:
panel_width = imgui.get_content_region_avail().x
for name, array in plots._array_buffers.items():
- if imgui.collapsing_header(name):
+ shown = imgui.collapsing_header(name)
+ hover_tooltip(imgui, self._live_plot_tooltip(name))
+ if shown:
plots._render_array_heatmap(imgui, name, array, panel_width - 20 * scale, dpi_scale=scale)
+ def _live_plot_tooltip(self, name: str) -> str:
+ """Describe a plotted ``/`` from the term's docstring, or name where it comes from."""
+ manager_name, _, term = name.partition("/")
+ source = next((source for source in self._live_plot_sources if source.manager_name == manager_name), None)
+ if source is None or not term:
+ return name
+ summary = term_summary(getattr(source, "_manager", None), term)
+ return summary or f"{term} from the {manager_name.replace('_', ' ')}"
+
def _render_live_plots(self) -> None:
"""Push manager-term scalars to the Newton viewer's built-in plot panel."""
if self._viewer is None or not self._live_plot_sources:
@@ -1421,7 +2477,7 @@ def log_mesh(self, name: str, *args, **kwargs) -> None:
for renderer in self._renderers:
renderer.log_mesh(f"Viewer_{id(self)}/{name.lstrip('/')}", *args, **kwargs)
for view in self._image_views:
- view.camera._invalidate_buffers()
+ view.camera.update(0.0)
view.invalidate()
def _render_frame(self) -> None:
@@ -1432,7 +2488,7 @@ def _render_frame(self) -> None:
self._navigate_scene_camera()
if self.cfg.enable_markers and self._marker_revision != self._sim.vis_marker_registry.revision:
for view in self._image_views:
- view.camera._invalidate_buffers()
+ view.camera.update(0.0)
view.invalidate()
self._marker_revision = self._sim.vis_marker_registry.revision
self._log_streaming_image()
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
index dc95a7f9d7b8..de3b509442b8 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
@@ -82,6 +82,20 @@ class NewtonGLBackendCfg(VisualizerBackendCfg):
light_color: tuple[float, float, float] = (1.0, 1.0, 1.0)
"""Light color RGB [0, 1]."""
+ rtx_camera: bool | None = None
+ """Declare an OVRTX viewer camera so the HUD can switch the main view between Newton GL and OVRTX.
+
+ The camera is added to the scene at launch because scene sensors cannot be added later. It renders only
+ while the OVRTX view is selected. ``None`` enables it when the ``ovrtx`` package is installed and the physics
+ backend is not PhysX; ``False`` disables it.
+ """
+
+ rtx_renderer_cfg: OVRTXRendererCfg = OVRTXRendererCfg()
+ """Renderer of the OVRTX viewer camera."""
+
+ rtx_render_settings: dict[str, Any] = dict()
+ """Additional RTX render settings of the OVRTX viewer camera."""
+
@configclass
class NewtonRTXBackendCfg(VisualizerBackendCfg):
diff --git a/source/isaaclab_visualizers/test/test_newton_adapter.py b/source/isaaclab_visualizers/test/test_newton_adapter.py
index 80f7cba9cc72..f9e99c35ea74 100644
--- a/source/isaaclab_visualizers/test/test_newton_adapter.py
+++ b/source/isaaclab_visualizers/test/test_newton_adapter.py
@@ -40,7 +40,7 @@
from isaaclab.test.utils import DeviceScope, test_devices
from isaaclab.utils import validate
from isaaclab.utils.warp import ProxyArray
-from isaaclab.visualizers import PerspectiveCameraCfg, SceneCameraCfg, VisualizerCfg, WindowCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, SceneCameraCfg, TrackingCameraCfg, VisualizerCfg, WindowCfg
from isaaclab.visualizers.base_visualizer import BaseVisualizer
@@ -402,7 +402,10 @@ def text(self, _text):
def slider_float(self, _label, value, _min_value, _max_value, _format):
return False, value
- def is_item_hovered(self):
+ class HoveredFlags_:
+ allow_when_disabled = 1
+
+ def is_item_hovered(self, *_flags):
return False
def set_tooltip(self, _text):
@@ -457,6 +460,12 @@ def test_newton_gl_viewer_skips_picking_only_while_a_fullscreen_image_is_shown(m
viewer.end_frame()
assert picks == [(1, 2, 4, 0)]
+ viewer.picking_enabled = False
+ viewer.image_matches_camera = True # The image comes from the picking camera, e.g. the OVRTX viewer camera.
+ viewer.log_image("Streaming View", np.zeros((2, 2, 3), dtype=np.uint8), fullscreen=True)
+ viewer.end_frame()
+ assert picks == [(1, 2, 4, 0)] * 2
+
def test_newton_viewer_particle_color_override(monkeypatch):
from newton.viewer import ViewerGL
@@ -729,7 +738,8 @@ def test_newton_visualizer_hard_reset_rebinds_viewer_model(monkeypatch, picking)
sim.get_scene_data_provider = visualizer._sim.get_scene_data_provider
visualizer._sim = sim
cfg = visualizer.newton_cfg = NewtonBackendCfg(physics_cfg=object(), device="cpu")
- visualizer._env_ids = [1, 3]
+ visualizer._env_ids = visualizer._cfg_visible_env_ids = [1, 3]
+ visualizer._visible_env_count = None
visualizer._picking_enabled = picking
visualizer.cfg.backend.world_spacing = (2.0, 0.0, 0.0)
visualizer.cfg.backend.show_contacts = True
@@ -740,9 +750,9 @@ def test_newton_visualizer_hard_reset_rebinds_viewer_model(monkeypatch, picking)
assert visualizer.backend is backend
sim.get_or_create_backend.assert_called_with(cfg)
viewer.set_model.assert_called_once_with(new_model)
+ assert viewer._view_controls == visualizer._draw_streaming_view_controls
assert viewer.register_ui_callback.call_args_list == [
call(viewer._render_training_controls, position="side"),
- call(visualizer._draw_streaming_view_controls, position="side"),
]
viewer.set_visible_worlds.assert_called_once_with([1, 3])
viewer.set_world_offsets.assert_called_once_with((2.0, 0.0, 0.0))
@@ -948,12 +958,17 @@ def test_newton_scene_camera_controls_apply_uniformly_to_active_copies(monkeypat
back_frame = back.frame.torch.clone()
assert visualizer.current_image_view.camera is None
assert isinstance(visualizer._image_views[0].cfg.source, PerspectiveCameraCfg)
- assert [view.camera.cfg.prim_path for view in visualizer._image_views[1:] if view.camera is not None] == [
+ # A depth-only sensor is listed too, showing its own channel.
+ assert [view.camera.cfg.prim_path for view in visualizer._image_views[1:]] == [
+ depth.cfg.prim_path,
color.cfg.prim_path,
back.cfg.prim_path,
]
+ assert visualizer._image_views[1].cfg.channels == ("depth",)
- visualizer._select_camera(1)
+ visualizer._select_camera(2)
+ assert visualizer._image_views[2].cfg.envs == (0, 1) # Both environments are tiled by default.
+ visualizer._image_views[2].cfg.envs = (0,)
torch.testing.assert_close(color.frame.torch, color_frame)
image = visualizer.render_tiled_rgb_array()
np.testing.assert_array_equal(image, color.data.output["rgb"].torch[0].cpu().numpy())
@@ -1004,7 +1019,7 @@ def test_newton_scene_camera_controls_apply_uniformly_to_active_copies(monkeypat
color_frame = color.frame.torch.clone()
back.update(cfg.sim.dt)
viewer.paused = True
- visualizer._select_camera(2)
+ visualizer._select_camera(3)
torch.testing.assert_close(back.frame.torch, back_frame)
viewer.camera.get_view_matrix = Mock(return_value=after)
visualizer.step(0.0)
@@ -1344,3 +1359,97 @@ def test_newton_rtx_visualizer_rejects_kit_physics_backend():
with pytest.raises(RuntimeError, match="Newton RTX"):
visualizer.initialize(sim, cameras=[])
+
+
+def test_marker_tooltip_describes_known_markers_and_falls_back():
+ from isaaclab_visualizers.newton.newton_visualizer import marker_tooltip
+
+ assert marker_tooltip("/Visuals/Command/velocity_goal") == "Commanded base velocity"
+ assert marker_tooltip("/Visuals/Brand_New_Marker") == "Show or hide this marker group"
+
+
+def test_term_summary_reads_the_first_docstring_line_of_a_term_function():
+ from isaaclab_visualizers.newton.newton_visualizer import term_summary
+
+ def track_velocity(env):
+ """Reward tracking of the commanded velocity.
+
+ More detail that the tooltip leaves out.
+ """
+
+ def undocumented(env):
+ pass
+
+ class Manager:
+ terms = {"track": SimpleNamespace(func=track_velocity), "plain": SimpleNamespace(func=undocumented)}
+
+ def get_term_cfg(self, name):
+ return self.terms[name]
+
+ manager = Manager()
+ assert term_summary(manager, "track") == "Reward tracking of the commanded velocity."
+ assert term_summary(manager, "plain") == ""
+ assert term_summary(manager, "missing") == ""
+ assert term_summary(object(), "anything") == "" # Managers without a term accessor.
+
+
+def test_the_rtx_view_keeps_following_the_tracking_camera_and_returns_to_it():
+ from isaaclab.visualizers import PerspectiveCameraCfg
+
+ def view(source, camera=None):
+ return SimpleNamespace(camera=camera, cfg=SimpleNamespace(source=source), invalidate=Mock())
+
+ rtx_camera = SimpleNamespace(cfg=SimpleNamespace(prim_path="/World/viewer_camera_0"))
+ free, rtx, tracking = (
+ view(PerspectiveCameraCfg()),
+ view(PerspectiveCameraCfg(), rtx_camera),
+ view(TrackingCameraCfg(env_index=0)),
+ )
+ visualizer = object.__new__(NewtonGLVisualizer)
+ visualizer._image_views = [free, rtx, tracking]
+ visualizer.current_image_view = tracking
+ visualizer._rtx_pose_view = None
+
+ def select(index, keep_pose=False):
+ visualizer.current_image_view = visualizer._image_views[index]
+ if index != visualizer.rtx_view_index:
+ visualizer._rtx_pose_view = None
+
+ visualizer._select_camera = select
+
+ visualizer.set_rtx_rendering(True)
+
+ assert visualizer.rtx_rendering and visualizer._pose_source_view() is tracking
+
+ visualizer.set_rtx_rendering(False)
+
+ assert visualizer.current_image_view is tracking and visualizer._rtx_pose_view is None
+
+
+def test_sensor_labels_name_the_outputs_of_the_sensor():
+ label = NewtonGLVisualizer._sensor_label
+ assert label("/World/envs/env_[^/]+/Camera", ["rgb", "depth"]) == "Camera (RGB + depth sensor)"
+ assert label("/World/envs/env_[^/]+/Camera", ["rgba"]) == "Camera (RGB sensor)"
+ assert label("/World/Camera/", ["semantic_segmentation"]) == "Camera (semantic seg sensor)"
+ assert label("/World/Camera", ["distance_to_image_plane", "normals"]) == "Camera (depth + normals sensor)"
+ assert label("/World/Camera", ["motion_vectors"]) == "Camera (sensor)"
+ assert label("/World/Camera") == "Camera (sensor)"
+
+
+def test_a_scene_sensor_view_is_not_an_opengl_or_rtx_view():
+ visualizer = object.__new__(NewtonGLVisualizer)
+ free, sensor = (
+ SimpleNamespace(camera=None),
+ SimpleNamespace(camera=SimpleNamespace(cfg=SimpleNamespace(prim_path="/World/envs/env_0/Camera"))),
+ )
+ rtx = SimpleNamespace(camera=SimpleNamespace(cfg=SimpleNamespace(prim_path="/World/viewer_camera_0_rtx")))
+ visualizer._image_views = [free, sensor, rtx]
+ for view, selected in ((free, False), (sensor, True), (rtx, False)):
+ visualizer.current_image_view = view
+ assert visualizer.sensor_view_selected is selected
+
+
+def test_the_statistics_overlay_starts_closed():
+ from isaaclab_visualizers.newton.newton_visualizer import NewtonViewerGL
+
+ assert NewtonViewerGL._show_stats is False
diff --git a/source/isaaclab_visualizers/test/test_newton_impulse_drag.py b/source/isaaclab_visualizers/test/test_newton_impulse_drag.py
new file mode 100644
index 000000000000..9f37ce3572cc
--- /dev/null
+++ b/source/isaaclab_visualizers/test/test_newton_impulse_drag.py
@@ -0,0 +1,258 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Unit tests for Impulse Drag, which aims pushes while the simulation is paused."""
+
+from __future__ import annotations
+
+from types import SimpleNamespace
+
+import numpy as np
+import pytest
+
+pytest.importorskip("newton")
+import warp as wp
+from isaaclab_visualizers.newton.newton_impulse_drag import (
+ IMPULSE_GAIN,
+ MAX_IMPULSE_SPEED,
+ MAX_IMPULSES,
+ ImpulseDrag,
+ impulse_color,
+ make_impulse,
+)
+
+
+def test_the_arrow_color_runs_from_green_through_yellow_to_red():
+ assert impulse_color(0.0)[1] == 1.0 and impulse_color(0.0)[0] == 0.0
+ assert impulse_color(0.5)[:2] == (1.0, 1.0)
+ assert impulse_color(1.0)[0] == 1.0 and impulse_color(1.0)[1] == 0.0
+ assert impulse_color(7.0) == impulse_color(1.0) and impulse_color(-1.0) == impulse_color(0.0)
+
+
+def test_an_impulse_gives_the_body_a_speed_in_proportion_to_the_arrow_up_to_a_limit():
+ short = make_impulse(3, np.zeros(3), np.array([0.0, 0.0, 0.2]), mass=2.0)
+ assert short.vector == pytest.approx([0.0, 0.0, IMPULSE_GAIN * 0.2 * 2.0])
+ assert short.fraction == pytest.approx(IMPULSE_GAIN * 0.2 / MAX_IMPULSE_SPEED)
+
+ long = make_impulse(3, np.zeros(3), np.array([10.0, 0.0, 0.0]), mass=2.0)
+ assert long.vector == pytest.approx([MAX_IMPULSE_SPEED * 2.0, 0.0, 0.0]) and long.fraction == 1.0
+
+
+def test_an_arrow_of_no_length_makes_no_impulse():
+ drag = ImpulseDrag("cpu", 1.0 / 120.0)
+
+ assert not drag.add(make_impulse(0, np.zeros(3), np.zeros(3), mass=1.0))
+ assert drag.entries == []
+
+
+def _state(count=2):
+ transforms = np.zeros((count, 7), dtype=np.float32)
+ transforms[:, 6] = 1.0
+ return SimpleNamespace(
+ body_q=wp.array(transforms, dtype=wp.transform, device="cpu"),
+ body_f=wp.zeros(count, dtype=wp.spatial_vector, device="cpu"),
+ )
+
+
+def test_queued_impulses_are_applied_once_over_one_substep_and_may_be_several():
+ dt = 1.0 / 120.0
+ drag = ImpulseDrag("cpu", dt)
+ com = wp.zeros(3, dtype=wp.vec3, device="cpu")
+ state = _state(3)
+ drag.add(make_impulse(0, np.zeros(3), np.array([0.1, 0.0, 0.0]), mass=1.0))
+ drag.add(make_impulse(1, np.array([0.0, 0.5, 0.0]), np.array([0.0, 0.0, 0.1]), mass=1.0))
+ drag.add(make_impulse(2, np.zeros(3), np.array([0.0, 0.1, 0.0]), mass=3.0))
+
+ drag.apply(state, com)
+ forces = state.body_f.numpy()
+
+ assert forces[0][:3] * dt == pytest.approx([IMPULSE_GAIN * 0.1, 0.0, 0.0])
+ assert forces[1][:3] * dt == pytest.approx([0.0, 0.0, IMPULSE_GAIN * 0.1])
+ assert forces[1][3:] * dt == pytest.approx([IMPULSE_GAIN * 0.1 * 0.5, 0.0, 0.0]) # It acts off center.
+ assert forces[2][:3] * dt == pytest.approx([0.0, IMPULSE_GAIN * 0.1 * 3.0, 0.0])
+
+ second = _state(3)
+ drag.apply(second, com)
+ assert not second.body_f.numpy().any() # The next substep finds nothing to apply.
+ drag.forget_applied()
+ assert drag.entries == []
+
+
+def test_impulses_wait_for_the_simulation_and_the_queue_has_a_limit():
+ drag = ImpulseDrag("cpu", 1.0 / 120.0)
+ for body in range(MAX_IMPULSES):
+ assert drag.add(make_impulse(body, np.zeros(3), np.array([0.1, 0.0, 0.0]), mass=1.0))
+
+ drag.forget_applied() # Nothing ran yet, so nothing is dropped.
+ assert len(drag.entries) == MAX_IMPULSES and drag.full
+ assert not drag.add(make_impulse(MAX_IMPULSES, np.zeros(3), np.array([0.1, 0.0, 0.0]), mass=1.0))
+
+ drag.clear()
+ assert drag.entries == [] and not drag.full
+
+
+def test_a_new_impulse_on_a_body_replaces_the_one_waiting_on_it():
+ drag = ImpulseDrag("cpu", 1.0 / 120.0)
+ com = wp.zeros(2, dtype=wp.vec3, device="cpu")
+ drag.add(make_impulse(0, np.zeros(3), np.array([0.1, 0.0, 0.0]), mass=1.0))
+ drag.add(make_impulse(1, np.zeros(3), np.array([0.0, 0.1, 0.0]), mass=1.0))
+ drag.add(make_impulse(0, np.zeros(3), np.array([0.0, 0.0, 0.2]), mass=1.0))
+
+ assert [entry.body for entry in drag.entries] == [0, 1]
+ state = _state()
+ drag.apply(state, com)
+ forces = state.body_f.numpy()
+
+ assert forces[0][0] == pytest.approx(0.0) and forces[0][2] > 0.0 # Only the new one acts on body 0.
+ assert forces[1][1] > 0.0
+
+
+def test_space_pauses_the_simulation_and_shift_space_pauses_rendering():
+ from isaaclab_visualizers.newton.newton_visualizer import NewtonViewerGL
+ from pyglet.window import key
+
+ viewer = NewtonViewerGL.__new__(NewtonViewerGL)
+ viewer.gui = SimpleNamespace(is_keyboard_capturing=lambda: False)
+ viewer.renderer = SimpleNamespace(close=lambda: None)
+ viewer._paused, viewer._paused_training = False, False
+
+ viewer.on_key_press(key.SPACE, 0)
+ assert viewer._paused_training and not viewer._paused
+
+ viewer.on_key_press(key.SPACE, key.MOD_SHIFT)
+ assert viewer._paused and viewer._paused_training
+
+ viewer.on_key_press(key.SPACE, 0)
+ assert viewer._paused and not viewer._paused_training
+
+ viewer.gui = SimpleNamespace(
+ is_keyboard_capturing=lambda: True, handle_key_press=lambda *args, **kwargs: None
+ ) # A text field has the keyboard.
+ viewer.on_key_press(key.SPACE, 0)
+ assert not viewer._paused_training
+
+
+def test_the_drag_arrow_reaches_the_ovrtx_view_as_a_wide_colored_arrow(monkeypatch):
+ from isaaclab_visualizers.newton import newton_visualizer
+ from isaaclab_visualizers.newton.newton_visualizer import NewtonViewerGL
+
+ monkeypatch.setattr(newton_visualizer.ViewerGL, "log_arrows", lambda self, *args, **kwargs: None)
+ recorded = []
+ viewer = NewtonViewerGL.__new__(NewtonViewerGL)
+ viewer._overlay_capture = SimpleNamespace(record=lambda *args, **kwargs: recorded.append((args, kwargs)))
+ starts = wp.array([[0.0, 0.0, 0.0]], dtype=wp.vec3, device="cpu")
+ ends = wp.array([[0.5, 0.0, 0.0]], dtype=wp.vec3, device="cpu")
+
+ viewer.log_lines("picking_line", starts, ends, (0.0, 1.0, 1.0))
+
+ (name, _, _, colors, width, _), kwargs = recorded[0]
+ assert name == "picking_arrow" and kwargs == {"arrow": True} and width == NewtonViewerGL.PICKING_ARROW_WIDTH
+ assert colors == impulse_color(IMPULSE_GAIN * 0.5 / MAX_IMPULSE_SPEED)
+
+
+def _rtx_visualizer(picking: bool, queued: bool = False):
+ from isaaclab_visualizers.newton.newton_visualizer import NewtonGLVisualizer
+
+ viz = NewtonGLVisualizer.__new__(NewtonGLVisualizer)
+ camera = SimpleNamespace(cfg=SimpleNamespace(prim_path="/World/viewer_camera_0", renderer_cfg="ovrtx"))
+ view = SimpleNamespace(camera=camera)
+ viz._image_views, viz.current_image_view = [view], view
+ viz._sim = SimpleNamespace(get_or_create_backend=lambda cfg: cfg)
+ calls = []
+ viz._overlay_publisher = SimpleNamespace(
+ hide_all=lambda renderers: calls.append("hide_all"), publish=lambda renderers: calls.append("publish")
+ )
+ viz._update_state = lambda: SimpleNamespace(body_q=None)
+ viz._viewer = SimpleNamespace(
+ show_joints=False,
+ show_contacts=False,
+ show_springs=False,
+ show_com=False,
+ show_inertia_boxes=False,
+ show_contact_disks=False,
+ picking_enabled=True,
+ picking=SimpleNamespace(is_picking=lambda: picking),
+ impulse_drag=SimpleNamespace(entries=[object()] if queued else []),
+ _impulse_arrows_shown=False,
+ is_paused=lambda: False,
+ _render_picking_line=lambda state: calls.append("picking_line"),
+ )
+ return viz, calls
+
+
+def test_the_drag_arrow_is_published_to_ovrtx_even_when_no_overlay_is_enabled():
+ viz, calls = _rtx_visualizer(picking=True)
+
+ viz._log_rtx_overlays()
+
+ assert calls == ["picking_line", "publish"]
+
+
+def test_queued_impulse_arrows_are_published_while_the_mouse_is_up():
+ viz, calls = _rtx_visualizer(picking=False, queued=True)
+
+ viz._log_rtx_overlays()
+
+ assert calls == ["picking_line", "publish"]
+
+
+def test_nothing_is_published_to_ovrtx_when_nothing_is_being_dragged():
+ viz, calls = _rtx_visualizer(picking=False)
+
+ viz._log_rtx_overlays()
+
+ assert calls == ["hide_all"]
+
+
+def _paused_rtx(paused: bool, timestamp: float = 5.0):
+ viz, _ = _rtx_visualizer(picking=False)
+ renders = []
+ camera = viz.current_image_view.camera
+ camera._is_outdated = SimpleNamespace(fill_=lambda value: renders.append("outdated"))
+ camera.update = lambda dt, force_recompute=False: renders.append(("update", dt, force_recompute))
+ viz.current_image_view.frame = SimpleNamespace(timestamp=timestamp)
+ viz.current_image_view.invalidate = lambda: renders.append("invalidate")
+ viz._viewer.is_training_paused = lambda: paused
+ return viz, renders
+
+
+def test_a_paused_ovrtx_view_is_rendered_again_while_an_arrow_changes_and_once_more_after():
+ viz, renders = _paused_rtx(paused=True)
+
+ viz._refresh_paused_rtx_view(True)
+ assert renders == ["outdated", ("update", 0.0, True), "invalidate"]
+
+ renders.clear()
+ viz._refresh_paused_rtx_view(False) # The arrows are gone; this render removes them from the image.
+ assert len(renders) == 3
+
+ renders.clear()
+ viz._refresh_paused_rtx_view(False)
+ assert renders == []
+
+
+def test_a_paused_ovrtx_view_follows_the_camera_and_a_running_one_is_left_alone():
+ viz, renders = _paused_rtx(paused=True, timestamp=-1.0)
+ viz._refresh_paused_rtx_view(False)
+ assert len(renders) == 3 # Navigating invalidated the image.
+
+ viz, renders = _paused_rtx(paused=False, timestamp=-1.0)
+ viz._refresh_paused_rtx_view(True)
+ assert renders == [] # The simulation renders it.
+
+
+def test_the_solver_substep_survives_a_model_reset(monkeypatch):
+ from isaaclab_visualizers.newton import newton_visualizer
+ from isaaclab_visualizers.newton.newton_visualizer import NewtonViewerGL
+
+ monkeypatch.setattr(newton_visualizer.ViewerGL, "set_model", lambda self, model, *args, **kwargs: None)
+ viewer = object.__new__(NewtonViewerGL)
+ model = SimpleNamespace(device="cpu")
+
+ viewer.set_model(model)
+ viewer.set_impulse_substep_dt(1.0 / 240.0)
+ viewer.set_model(model) # A reset replaces the Impulse Drag, which must keep the solver's substep.
+
+ assert viewer.impulse_drag._inverse_dt.numpy()[0] == pytest.approx(240.0)
diff --git a/source/isaaclab_visualizers/test/test_newton_overlay_meshes.py b/source/isaaclab_visualizers/test/test_newton_overlay_meshes.py
new file mode 100644
index 000000000000..99eb8189f3f6
--- /dev/null
+++ b/source/isaaclab_visualizers/test/test_newton_overlay_meshes.py
@@ -0,0 +1,114 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Newton's line and arrow overlays become thin meshes for the OVRTX view."""
+
+import numpy as np
+import pytest
+import warp as wp
+from isaaclab_visualizers.newton.newton_overlay_meshes import (
+ DEFAULT_COLOR,
+ OverlayMeshPublisher,
+ build_segment_meshes,
+ color_classes,
+ segment_indices,
+)
+
+pytestmark = [pytest.mark.unit]
+
+
+class _Renderer:
+ def __init__(self):
+ self.calls = []
+
+ def log_mesh(self, path, points, indices, **kwargs):
+ self.calls.append((path, points.numpy().copy(), indices.numpy().copy(), kwargs))
+
+
+def _vec3s(values):
+ return wp.array(np.asarray(values, np.float32), dtype=wp.vec3, device="cpu")
+
+
+def test_segment_mesh_spans_the_segment_and_other_classes_collapse():
+ starts, ends = _vec3s([[0, 0, 0], [1, 1, 1]]), _vec3s([[0, 0, 1], [1, 1, 2]])
+ classes = wp.array([0, 1], dtype=wp.int32, device="cpu")
+ points = wp.zeros(26, dtype=wp.vec3, device="cpu")
+ wp.launch(build_segment_meshes, 2, [starts, ends, classes, 0, 2, 0.01, 0.0, 0.0, points], device="cpu")
+ vertices = points.numpy()
+ assert vertices[:13, 2].min() == pytest.approx(0.0) and vertices[:13, 2].max() == pytest.approx(1.0)
+ assert np.abs(vertices[:4, :2]).max() == pytest.approx(0.01)
+ assert np.all(vertices[13:] == [1, 1, 1]) # the other class's segment is a point at its start
+ assert segment_indices(2, "cpu").numpy().max() == 25
+
+
+def test_arrow_head_ends_at_the_tip():
+ points = wp.zeros(13, dtype=wp.vec3, device="cpu")
+ classes = wp.zeros(1, dtype=wp.int32, device="cpu")
+ wp.launch(
+ build_segment_meshes, 1, [_vec3s([[0, 0, 0]]), _vec3s([[2, 0, 0]]), classes, 0, 1, 0.01, 0.03, 0.2, points],
+ device="cpu",
+ ) # fmt: skip
+ vertices = points.numpy()
+ assert vertices[12] == pytest.approx([2, 0, 0])
+ assert vertices[8:12, 0] == pytest.approx([1.8] * 4)
+
+
+def test_color_classes_group_per_segment_colors():
+ assert color_classes((1, 0, 0), 3) == (None, [(1.0, 0.0, 0.0)])
+ assert color_classes(None, 3) == (None, [DEFAULT_COLOR])
+ classes, colors = color_classes(_vec3s([[1, 0, 0], [0, 1, 0], [1, 0, 0]]), 3)
+ assert [colors[i] for i in classes] == [(1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (1.0, 0.0, 0.0)]
+
+
+def test_publisher_shows_recorded_batches_and_hides_the_rest():
+ renderer, publisher = _Renderer(), OverlayMeshPublisher("Viewer_1")
+ starts, ends = _vec3s([[0, 0, 0]]), _vec3s([[0, 0, 1]])
+ publisher.record("/model/joints", starts, ends, (0.0, 1.0, 0.0), 0.01, False, arrow=False)
+ publisher.publish([renderer])
+ assert [(call[0], call[3]["hidden"], call[3]["color"]) for call in renderer.calls] == [
+ ("Viewer_1/overlay/model_joints_64_0", False, (0.0, 1.0, 0.0))
+ ]
+ renderer.calls.clear()
+ publisher.publish([renderer]) # nothing recorded this frame
+ assert [(call[0], call[3]["hidden"]) for call in renderer.calls] == [("Viewer_1/overlay/model_joints_64_0", True)]
+ renderer.calls.clear()
+ publisher.hide_all([renderer])
+ assert not renderer.calls
+
+
+def test_a_changing_segment_count_reuses_the_meshes_until_it_outgrows_them():
+ renderer, publisher = _Renderer(), OverlayMeshPublisher("Viewer_1")
+ paths = []
+ for count in (3, 17, 64, 65, 40):
+ starts = _vec3s(np.zeros((count, 3)))
+ publisher.record("/contacts/normals", starts, _vec3s(np.ones((count, 3))), (0, 1, 0), 0.01, False, arrow=True)
+ publisher.publish([renderer])
+ paths.append(renderer.calls[-1][0])
+ assert paths == [f"Viewer_1/overlay/contacts_normals_{capacity}_0" for capacity in (64, 64, 64, 128, 128)]
+
+
+def test_a_color_class_that_stops_occurring_is_hidden():
+ renderer, publisher = _Renderer(), OverlayMeshPublisher("Viewer_1")
+ three = _vec3s([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
+ publisher.record(
+ "/model/joints", _vec3s(np.zeros((3, 3))), _vec3s(np.ones((3, 3))), three, 0.01, False, arrow=False
+ )
+ publisher.publish([renderer])
+ assert sorted(call[0] for call in renderer.calls) == [f"Viewer_1/overlay/model_joints_64_{i}" for i in range(3)]
+ renderer.calls.clear()
+
+ two = _vec3s([[1, 0, 0], [0, 1, 0], [1, 0, 0], [0, 1, 0]]) # A different count makes the colors be read again.
+ publisher.record("/model/joints", _vec3s(np.zeros((4, 3))), _vec3s(np.ones((4, 3))), two, 0.01, False, arrow=False)
+ publisher.publish([renderer])
+
+ hidden = [call[0] for call in renderer.calls if call[3]["hidden"]]
+ assert hidden == ["Viewer_1/overlay/model_joints_64_2"]
+ assert {call[0] for call in renderer.calls if not call[3]["hidden"]} == {
+ "Viewer_1/overlay/model_joints_64_0",
+ "Viewer_1/overlay/model_joints_64_1",
+ }
+ renderer.calls.clear()
+ publisher.hide_all([renderer]) # Only the two classes still published are hidden afterwards.
+ assert sorted(call[0] for call in renderer.calls) == [f"Viewer_1/overlay/model_joints_64_{i}" for i in range(2)]
diff --git a/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py b/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
new file mode 100644
index 000000000000..6f08e7c49f4e
--- /dev/null
+++ b/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
@@ -0,0 +1,345 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Unit tests for the runtime appearance controls of the OVRTX view in the Newton GL window."""
+
+from __future__ import annotations
+
+import time
+from types import SimpleNamespace
+
+import numpy as np
+import pytest
+
+pytest.importorskip("ovrtx")
+from isaaclab_visualizers.newton import newton_rtx_appearance as module
+from isaaclab_visualizers.newton.newton_rtx_appearance import RtxAppearance, find_scene_lights, sun_matrix
+
+
+class _Attr:
+ def __init__(self, value):
+ self._value = value
+
+ def __bool__(self):
+ return self._value is not None
+
+ def HasValue(self):
+ return self._value is not None
+
+ def Get(self):
+ return self._value
+
+
+class _Prim:
+ def __init__(self, path, kind, intensity=None, color=None):
+ self._path, self._kind = path, kind
+ self._attrs = {"inputs:intensity": _Attr(intensity), "inputs:color": _Attr(color)}
+
+ def GetPath(self):
+ return self._path
+
+ def GetTypeName(self):
+ return self._kind
+
+ def GetAttribute(self, name):
+ return self._attrs.get(name, _Attr(None))
+
+
+class _Stage:
+ def __init__(self, prims):
+ self._prims = prims
+
+ def Traverse(self):
+ return iter(self._prims)
+
+
+class _Native:
+ def __init__(self, fail: bool = False, fail_add: bool = False):
+ self.writes, self.fail, self.fail_add = [], fail, fail_add
+ self.added, self.removed = [], []
+
+ def write_attribute(self, **kwargs):
+ if self.fail:
+ raise RuntimeError("write refused")
+ self.writes.append(kwargs)
+
+ def add_usd_reference_from_string(self, usd, path):
+ if self.fail_add:
+ raise RuntimeError("cannot add")
+ self.added.append((usd, path))
+ return f"reference:{path}:{len(self.added)}"
+
+ def remove_usd(self, reference):
+ self.removed.append(reference)
+
+
+def _appearance(native=None, background_color=None, ovstage=False):
+ prims = [
+ _Prim("/World/sun", "DistantLight", 3000.0, (0.75, 0.75, 0.75)),
+ _Prim("/World/cube", "Cube", 1.0, (1, 1, 1)),
+ ]
+ renderer = SimpleNamespace(_use_ovstage=ovstage, backend=SimpleNamespace(renderer=native or _Native()))
+ return RtxAppearance(
+ _Stage(prims), renderer, "/RenderCamera_0/RenderProduct", background_color
+ ), renderer.backend.renderer
+
+
+def _last(native, attribute):
+ return [w for w in native.writes if w["attribute_name"] == attribute][-1]
+
+
+def _states(native):
+ write = _last(native, "visibility")
+ return dict(zip(write["prim_paths"], write["tensor"], strict=True))
+
+
+def test_only_lights_with_an_intensity_and_a_color_are_found():
+ stage = _Stage(
+ [
+ _Prim("/World/sun", "DistantLight", 3000.0, (0.75, 0.75, 0.75)),
+ _Prim("/World/bare", "DomeLight"),
+ _Prim("/World/cube", "Cube", 1.0, (1.0, 1.0, 1.0)),
+ ]
+ )
+
+ assert [(light.path, light.intensity) for light in find_scene_lights(stage)] == [("/World/sun", 3000.0)]
+
+
+def test_scene_lights_are_on_and_the_dome_and_distant_lights_are_off_by_default():
+ appearance, native = _appearance()
+
+ assert (appearance.scene_enabled, appearance.dome_enabled, appearance.sun_enabled) == (True, False, False)
+ assert appearance.apply_lights()
+
+ assert native.added == [] # The viewer's own lights are only added once enabled.
+ assert _states(native) == {"/World/sun": "inherited"}
+
+
+def test_scene_lights_take_an_intensity_scale_and_a_color_tint():
+ appearance, native = _appearance()
+ appearance.scene_scale, appearance.scene_tint = 0.5, (1.0, 0.0, 0.0)
+
+ appearance.apply_lights()
+
+ np.testing.assert_allclose(_last(native, "inputs:intensity")["tensor"], [1500.0])
+ np.testing.assert_allclose(_last(native, "inputs:color")["tensor"], [[0.75, 0.0, 0.0]])
+
+
+def test_the_dome_light_is_added_once_when_enabled_and_shows_with_its_own_settings():
+ appearance, native = _appearance()
+ appearance.dome_enabled, appearance.dome_intensity, appearance.dome_color = True, 2500.0, (0.2, 0.3, 0.4)
+
+ assert appearance.apply_lights()
+ appearance.dome_intensity = 100.0
+ assert appearance.apply_lights()
+
+ assert [path for _, path in native.added] == ["/NewtonViewerDome"] # Added once.
+ assert "asset inputs:texture:file = @@" in native.added[0][0] # No texture yet.
+ assert _states(native) == {"/World/sun": "inherited", "/NewtonViewerDome": "inherited"}
+ assert _last(native, "inputs:intensity")["tensor"].tolist() == [3000.0, 100.0]
+
+
+def test_each_light_can_be_turned_off_independently():
+ appearance, native = _appearance()
+ appearance.dome_enabled = appearance.sun_enabled = True
+ appearance.scene_enabled = False
+
+ appearance.apply_lights()
+
+ assert _states(native) == {
+ "/World/sun": "invisible",
+ "/NewtonViewerDome": "inherited",
+ "/NewtonViewerSun": "inherited",
+ }
+ appearance.sun_enabled = False
+ appearance.apply_lights()
+ assert _states(native)["/NewtonViewerSun"] == "invisible"
+
+
+def test_the_distant_light_gets_its_angle_and_direction():
+ appearance, native = _appearance()
+ appearance.sun_enabled, appearance.sun_angle, appearance.sun_elevation, appearance.sun_azimuth = (
+ True,
+ 4.0,
+ 90.0,
+ 0.0,
+ )
+
+ assert appearance.apply_lights()
+
+ assert [path for _, path in native.added] == ["/NewtonViewerSun"]
+ np.testing.assert_allclose(_last(native, "inputs:angle")["tensor"], [4.0])
+ matrix = _last(native, "omni:xform")["tensor"]
+ assert matrix.shape == (1, 4, 4)
+ np.testing.assert_allclose(matrix[0][2][:3], [0.0, 0.0, 1.0], atol=1e-9) # Straight down: local +Z is up.
+
+
+@pytest.mark.parametrize(("elevation", "azimuth"), [(40.0, 0.0), (65.0, 35.0), (90.0, 0.0), (10.0, 270.0)])
+def test_the_sun_transform_is_a_rotation_that_points_local_z_toward_the_light(elevation, azimuth):
+ matrix = sun_matrix(elevation, azimuth)
+ rotation = matrix[:3, :3]
+
+ np.testing.assert_allclose(rotation @ rotation.T, np.eye(3), atol=1e-9)
+ assert np.linalg.det(rotation) == pytest.approx(1.0)
+ el, az = np.radians(elevation), np.radians(azimuth)
+ np.testing.assert_allclose(matrix[2, :3], [np.cos(el) * np.cos(az), np.cos(el) * np.sin(az), np.sin(el)], atol=1e-9)
+
+
+def test_a_sky_texture_is_loaded_in_the_background_and_adds_the_dome_light_again_with_it(monkeypatch):
+ monkeypatch.setattr(module, "retrieve_file_path", lambda source: f"/cache/{source.rsplit('/', 1)[-1]}")
+ appearance, native = _appearance()
+ appearance.dome_enabled = True
+ appearance.apply_lights()
+
+ appearance.use_sky("https://assets/skies/lakeside.hdr")
+ assert appearance.texture_status == "Loading sky..."
+ deadline = time.time() + 5
+ while not appearance.poll():
+ assert time.time() < deadline
+ time.sleep(0.01)
+
+ assert native.removed == ["reference:/NewtonViewerDome:1"] # The first dome light was replaced.
+ assert "@/cache/lakeside.hdr@" in native.added[-1][0]
+ assert appearance.dome_color == (1.0, 1.0, 1.0) # A texture is not tinted blue.
+ assert appearance.texture_status == ""
+
+
+def test_removing_the_sky_texture_restores_the_sky_blue_dome_without_a_download():
+ appearance, native = _appearance()
+ appearance.dome_enabled = True
+ appearance._dome_texture_file, appearance.dome_texture = "/cache/sky.hdr", "https://assets/sky.hdr"
+ appearance.apply_lights()
+
+ appearance.use_sky("")
+
+ assert appearance.dome_texture == "" and appearance.dome_color == (0.53, 0.68, 0.9)
+ assert "asset inputs:texture:file = @@" in native.added[-1][0]
+
+
+def test_a_sky_that_cannot_be_loaded_is_reported(monkeypatch):
+ def refuse(source):
+ raise OSError("no network")
+
+ monkeypatch.setattr(module, "retrieve_file_path", refuse)
+ appearance, _ = _appearance()
+ appearance.dome_enabled = True
+
+ appearance.use_sky("https://assets/missing.hdr")
+ deadline = time.time() + 5
+ while appearance.texture_status == "Loading sky...":
+ appearance.poll()
+ assert time.time() < deadline
+ time.sleep(0.01)
+
+ assert appearance.texture_status.startswith("Could not load the sky") and appearance.dome_texture == ""
+
+
+def test_background_is_the_scene_sky_or_one_color():
+ appearance, native = _appearance()
+ appearance.background, appearance.background_color = 1, (0.0, 1.0, 0.0)
+
+ assert appearance.apply_background()
+ kind, color = native.writes
+ assert kind["tensor"] == ["color"] and kind["prim_paths"] == ["/RenderCamera_0/RenderProduct"]
+ np.testing.assert_allclose(color["tensor"], [[0.0, 1.0, 0.0]])
+
+ native.writes.clear()
+ appearance.background = 0
+ assert appearance.apply_background()
+ assert [write["tensor"] for write in native.writes] == [["domeLight"]]
+
+
+def test_reset_returns_to_the_scene_lights_and_the_cameras_configured_background():
+ appearance, native = _appearance(background_color=(0.1, 0.2, 0.3))
+ assert appearance.background == 1 # The camera was configured with a solid color.
+ appearance.background, appearance.scene_enabled, appearance.sun_enabled = 0, False, True
+ appearance.apply_lights()
+
+ assert appearance.reset()
+
+ assert (appearance.background, appearance.background_color) == (1, (0.1, 0.2, 0.3))
+ assert (appearance.scene_enabled, appearance.sun_enabled) == (True, False)
+ assert _states(native) == {"/World/sun": "inherited", "/NewtonViewerSun": "invisible"}
+
+
+def test_a_refused_write_or_a_light_that_cannot_be_added_is_reported_instead_of_raised():
+ refused, _ = _appearance(native=_Native(fail=True))
+ assert not refused.apply_lights()
+ assert "write refused" in refused.error
+
+ cannot_add, _ = _appearance(native=_Native(fail_add=True))
+ cannot_add.dome_enabled = True
+ assert not cannot_add.apply_lights()
+ assert "cannot add" in cannot_add.error
+
+
+def test_closing_removes_the_viewer_lights_once():
+ appearance, native = _appearance()
+ appearance.dome_enabled = appearance.sun_enabled = True
+ appearance.apply_lights()
+
+ appearance.close()
+ appearance.close()
+
+ assert native.removed == ["reference:/NewtonViewerDome:1", "reference:/NewtonViewerSun:2"]
+
+
+def test_the_controls_are_unavailable_on_the_shared_stage_path():
+ appearance, _ = _appearance(ovstage=True)
+
+ assert not appearance.available
+
+
+class _SkyImgui:
+ """Minimal imgui double for the Sky combo; the combo answers with the scripted selections."""
+
+ class ImVec4:
+ def __init__(self, *values):
+ self.values = values
+
+ class HoveredFlags_:
+ allow_when_disabled = 1
+
+ def __init__(self, selections):
+ self.selections, self.inputs = list(selections), []
+
+ def combo(self, label, index, items):
+ chosen = self.selections.pop(0) if self.selections else index
+ return chosen != index, chosen
+
+ def input_text(self, label, text):
+ self.inputs.append(label)
+ return False, text
+
+ def button(self, label):
+ return False
+
+ def is_item_hovered(self, *_flags):
+ return False
+
+ def text_colored(self, *_args):
+ pass
+
+ def set_tooltip(self, _text):
+ pass
+
+
+def test_the_custom_sky_file_input_stays_open_until_a_listed_sky_is_chosen():
+ from isaaclab_visualizers.newton.newton_rtx_appearance import SKY_TEXTURES
+ from isaaclab_visualizers.newton.newton_visualizer import NewtonGLVisualizer
+
+ visualizer = object.__new__(NewtonGLVisualizer)
+ visualizer._sky_custom, visualizer._sky_custom_open = "", False
+ appearance = SimpleNamespace(dome_texture="", texture_status="", use_sky=lambda path: None)
+ custom = len(SKY_TEXTURES) + 1
+ imgui = _SkyImgui([custom]) # Picked once; later frames keep the same selection.
+
+ visualizer._draw_sky_texture(imgui, appearance)
+ visualizer._draw_sky_texture(imgui, appearance) # The next frame, with the texture still unset until Load.
+ assert imgui.inputs == ["File##sky", "File##sky"]
+
+ imgui.selections = [0] # Back to "None".
+ visualizer._draw_sky_texture(imgui, appearance)
+ assert len(imgui.inputs) == 2 and not visualizer._sky_custom_open
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
new file mode 100644
index 000000000000..63cfb33e8092
--- /dev/null
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -0,0 +1,265 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Unit tests for the Tracking Camera views of the Newton GL window."""
+
+from __future__ import annotations
+
+from types import SimpleNamespace
+
+import pytest
+import torch
+
+pytest.importorskip("newton")
+from isaaclab_visualizers.newton.newton_visualizer import NewtonGLVisualizer, NewtonVisualizerBase
+from pyglet.math import Vec3
+
+from isaaclab.visualizers import PerspectiveCameraCfg, TrackingCameraCfg
+from isaaclab.visualizers.camera_follower import CameraFollower
+
+
+class _Camera:
+ """The viewer camera: a position, a look-at target, angles, and a field of view."""
+
+ def __init__(self):
+ self.pos, self.pitch, self.yaw, self.fov = Vec3(1.0, 1.0, 1.0), 0.1, 0.2, 40.0
+ self.target = None
+
+ def look_at(self, target):
+ self.target = tuple(target)
+
+
+class _Scene:
+ num_envs = 2
+ env_origins = torch.tensor([[0.0, 0.0, 0.0], [10.0, 0.0, 0.0]])
+
+ def __getitem__(self, name):
+ return SimpleNamespace(is_initialized=False)
+
+
+class _View:
+ """An image view; a class, not a namespace, so that it can key the follower dictionary."""
+
+ def __init__(self, source, camera=None):
+ self.cfg, self.camera = SimpleNamespace(source=source), camera
+
+
+def _view(source):
+ return _View(source)
+
+
+def _visualizer(views) -> NewtonVisualizerBase:
+ viz = NewtonVisualizerBase.__new__(NewtonVisualizerBase)
+ viz.cfg = SimpleNamespace(focal_length=12.0)
+ camera = _Camera()
+
+ def set_camera(pos, pitch, yaw):
+ camera.pos, camera.pitch, camera.yaw = pos, pitch, yaw
+
+ viz._viewer = SimpleNamespace(camera=camera, set_camera=set_camera)
+ viz._sim = SimpleNamespace(get_physics_step_count=lambda: 10, get_physics_dt=lambda: 0.1)
+ viz._image_views = list(views)
+ viz._followers = {view: CameraFollower(view.cfg.source, _Scene()) for view in views if viz._is_task_view(view)}
+ viz.rtx_rendering, viz._rtx_pose_view, viz._perspective_poses = False, None, {}
+ return viz
+
+
+def test_a_lone_free_view_is_called_perspective_and_a_task_view_the_tracking_camera():
+ free, task = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=0, eye=(2.0, 0.0, 1.0)))
+ viz = _visualizer([free, task])
+
+ assert viz._view_labels([0, 1]) == ["Perspective", "Tracking Camera"]
+ assert [viz._is_task_view(view) for view in viz._image_views] == [False, True]
+
+
+def test_views_are_numbered_only_when_several_share_a_name():
+ views = [_view(PerspectiveCameraCfg()), _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=0))]
+ views += [_view(TrackingCameraCfg(env_index=1))]
+ viz = _visualizer(views)
+
+ assert viz._view_labels([0, 1, 2, 3]) == [
+ "Perspective 1",
+ "Perspective 2",
+ "Tracking Camera 1",
+ "Tracking Camera 2",
+ ]
+
+
+def test_scene_cameras_are_named_by_their_prim_without_the_environment_pattern():
+ camera = SimpleNamespace(cfg=SimpleNamespace(data_types=["rgba"]))
+ sensor = _View("/World/envs/env_[^/]+/Robot/wrist_camera", camera=camera)
+ viz = _visualizer([_view(PerspectiveCameraCfg()), sensor])
+
+ assert viz._view_labels([0, 1]) == ["Perspective", "wrist_camera (RGB sensor)"]
+
+
+def test_the_camera_list_puts_perspective_first_then_tracking_cameras_then_sensors():
+ sensor = _View("/World/envs/env_[^/]+/Camera", camera=object())
+ tracking, free = _view(TrackingCameraCfg(env_index=0)), _view(PerspectiveCameraCfg())
+ viz = _visualizer([sensor, tracking, free])
+
+ order = sorted(range(3), key=lambda i: viz._source_rank(viz._image_views[i]))
+
+ assert order == [2, 1, 0]
+
+
+def test_a_task_view_moves_the_viewer_camera_to_the_followed_environment():
+ view = _view(TrackingCameraCfg(env_index=1, eye=(2.0, 0.0, 1.0), lookat=(0.0, 0.0, 0.5), focal_length=24.0))
+ viz = _visualizer([view])
+
+ assert viz._apply_view_pose(view)
+
+ camera = viz._viewer.camera
+ assert (camera.pos.x, camera.pos.y, camera.pos.z) == pytest.approx((12.0, 0.0, 1.0)) # Environment 1 origin.
+ assert camera.target == pytest.approx((10.0, 0.0, 0.5))
+
+
+def test_switching_the_followed_environment_re_aims_the_camera():
+ view = _view(TrackingCameraCfg(env_index=0, eye=(2.0, 0.0, 1.0)))
+ viz = _visualizer([view])
+
+ viz._followers[view].set_env(1)
+ viz._apply_view_pose(view)
+
+ assert viz._viewer.camera.pos.x == pytest.approx(12.0)
+
+
+def test_resetting_the_tracking_camera_restores_what_the_task_declared():
+ view = _view(TrackingCameraCfg(env_index=0, eye=(2.0, 0.0, 1.0), lookat=(0.0, 0.0, 0.5), focal_length=24.0))
+ viz = _visualizer([view])
+ cfg = view.cfg.source
+ viz._tracking_defaults = {
+ view: {
+ "eye": cfg.eye,
+ "lookat": cfg.lookat,
+ "focal_length": cfg.focal_length,
+ "track_path": cfg.track_path,
+ "follow_heading": cfg.follow_heading,
+ "heading_smoothing_time_constant": cfg.heading_smoothing_time_constant,
+ "env": 0,
+ }
+ }
+ viz.current_image_view = view
+ viz._tracking_error = ""
+ follower = viz._followers[view]
+
+ cfg.eye, cfg.focal_length = (9.0, 9.0, 9.0), 60.0
+ follower.set_env(1)
+ assert viz._reset_tracking_camera(follower)
+
+ assert (cfg.eye, cfg.focal_length, follower.env) == ((2.0, 0.0, 1.0), 24.0, 0)
+
+
+def test_an_invalid_followed_asset_is_reported_not_raised():
+ view = _view(TrackingCameraCfg(env_index=0))
+ viz = _visualizer([view])
+ viz._tracking_error = ""
+
+ class Scene(_Scene):
+ def __getitem__(self, name):
+ raise KeyError(name)
+
+ viz._followers[view]._scene = Scene()
+
+ assert not viz._set_tracking_path(viz._followers[view], "ghost")
+ assert "unknown scene asset" in viz._tracking_error
+
+
+def test_the_free_perspective_pose_is_kept_while_another_source_is_shown():
+ free, task = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=0))
+ viz = _visualizer([free, task])
+ viz._focal_length_to_vertical_fov_degrees = lambda focal=None: 40.0
+ viz.current_image_view = free
+ viz._viewer.camera.fov = 0.0
+ camera = viz._viewer.camera
+ camera.pos, camera.pitch, camera.yaw = (1.0, 2.0, 3.0), -10.0, 45.0
+
+ viz._remember_perspective_pose()
+ camera.pos, camera.pitch, camera.yaw = (9.0, 9.0, 9.0), 0.0, 0.0 # A Tracking Camera or sensor moved it.
+ viz.cfg.focal_length = 50.0
+
+ assert viz._restore_perspective_pose(free)
+ assert (tuple(camera.pos), camera.pitch, camera.yaw, viz.cfg.focal_length) == ((1.0, 2.0, 3.0), -10.0, 45.0, 12.0)
+ assert not viz._restore_perspective_pose(task) # A view that was never left has nothing to restore.
+
+
+def test_resetting_the_tracking_camera_works_while_the_rtx_view_is_current():
+ view = _view(TrackingCameraCfg(env_index=0, eye=(2.0, 0.0, 1.0), lookat=(0.0, 0.0, 0.5), focal_length=24.0))
+ rtx = _View("/World/viewer_camera_0_rtx", camera=object())
+ viz = _visualizer([view])
+ cfg = view.cfg.source
+ viz._tracking_defaults = {
+ view: {
+ "eye": cfg.eye,
+ "lookat": cfg.lookat,
+ "focal_length": cfg.focal_length,
+ "track_path": cfg.track_path,
+ "follow_heading": cfg.follow_heading,
+ "heading_smoothing_time_constant": cfg.heading_smoothing_time_constant,
+ "env": 0,
+ }
+ }
+ viz.current_image_view, viz.rtx_rendering, viz._rtx_pose_view = (
+ rtx,
+ True,
+ view,
+ ) # RTX is showing the Tracking Camera.
+ viz._tracking_error = ""
+
+ cfg.eye = (9.0, 9.0, 9.0)
+ assert viz._reset_tracking_camera(viz._followers[view])
+
+ assert cfg.eye == (2.0, 0.0, 1.0)
+
+
+def _rtx_view():
+ camera = SimpleNamespace(cfg=SimpleNamespace(prim_path="/World/viewer_camera_0", renderer_cfg="ovrtx"))
+ return _View("/World/viewer_camera_0", camera=camera)
+
+
+def _switchable(views):
+ """A visualizer whose camera selection only records which view became current."""
+ base = _visualizer(views)
+ viz = NewtonGLVisualizer.__new__(NewtonGLVisualizer)
+ viz.__dict__.update(base.__dict__)
+ viz._overlay_publisher = SimpleNamespace(hide_all=lambda renderers: viz.hidden.append(renderers))
+ viz._sim.get_or_create_backend = lambda cfg: cfg
+ viz.hidden, viz.current_image_view = [], views[0]
+
+ def select(index, keep_pose=False):
+ viz.current_image_view = viz._image_views[index]
+
+ viz._select_camera = select
+ return viz
+
+
+def test_switching_to_rtx_and_back_returns_to_the_perspective_view():
+ free, rtx = _view(PerspectiveCameraCfg()), _rtx_view()
+ viz = _switchable([free, rtx])
+
+ viz.set_rtx_rendering(True)
+ assert viz.current_image_view is rtx and viz.rtx_rendering
+
+ viz.set_rtx_rendering(False)
+ assert viz.current_image_view is free and not viz.rtx_rendering
+ assert viz.hidden == [("ovrtx",)] # The overlay meshes are hidden when OVRTX stops drawing.
+
+
+def test_switching_to_rtx_while_a_tracking_camera_is_shown_returns_to_it():
+ free, task, rtx = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=0)), _rtx_view()
+ viz = _switchable([free, task, rtx])
+ viz.current_image_view = task
+
+ viz.set_rtx_rendering(True)
+ viz.set_rtx_rendering(False)
+
+ assert viz.current_image_view is task
+
+
+def test_rtx_rendering_needs_the_viewer_camera_declared_at_launch():
+ viz = _switchable([_view(PerspectiveCameraCfg())])
+
+ with pytest.raises(RuntimeError, match="no OVRTX viewer camera"):
+ viz.set_rtx_rendering(True)
diff --git a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
index e41ee0d3608d..7c67a28f3832 100644
--- a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
+++ b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
@@ -125,10 +125,11 @@ def test_the_tracking_camera_recording_reports_a_visualizer_without_one():
def test_the_selector_names_the_tracking_camera_and_the_free_perspective():
- sensor = SimpleNamespace(camera=object(), cfg=SimpleNamespace(source="/World/envs/env_0/cam"))
+ camera = SimpleNamespace(cfg=SimpleNamespace(data_types=["rgba"]))
+ sensor = SimpleNamespace(camera=camera, cfg=SimpleNamespace(source="/World/envs/env_0/cam"))
viz = _visualizer([_view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=1))])
viz._image_views.append(sensor)
- assert viz._view_labels() == ["Perspective", "Tracking Camera", "/World/envs/env_0/cam"]
+ assert viz._view_labels() == ["Perspective", "Tracking Camera", "cam (RGB sensor)"]
viz = _visualizer([_view(TrackingCameraCfg(env_index=0)), _view(TrackingCameraCfg(track_path="robot"))])
assert viz._view_labels() == ["Tracking Camera 1", "Tracking Camera 2"]
From b0308a5b9a4333d073e7d651a67353e063cbc0ae Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 12 Nov 2026 04:49:35 +0000
Subject: [PATCH 027/140] Place Lighting & Appearance under the renderer
toggle, drop the solid background, and apply spawn materials without Kit
Co-Authored-By: Claude Sonnet 5.5
---
...sd-spawn-kitless-visual-material.fixed.rst | 2 ++
.../sim/spawners/from_files/from_files.py | 6 +---
.../test/sim/test_visual_materials_kitless.py | 17 +++++++++
.../newton-gl-camera-sources.added.rst | 2 +-
.../newton/newton_visualizer.py | 36 ++-----------------
5 files changed, 24 insertions(+), 39 deletions(-)
create mode 100644 source/isaaclab/changelog.d/usd-spawn-kitless-visual-material.fixed.rst
diff --git a/source/isaaclab/changelog.d/usd-spawn-kitless-visual-material.fixed.rst b/source/isaaclab/changelog.d/usd-spawn-kitless-visual-material.fixed.rst
new file mode 100644
index 000000000000..bd30c9350c83
--- /dev/null
+++ b/source/isaaclab/changelog.d/usd-spawn-kitless-visual-material.fixed.rst
@@ -0,0 +1,2 @@
+* Fixed :class:`~isaaclab.sim.UsdFileCfg` skipping its ``visual_material`` when Kit is not running, which left
+ visualization markers in kitless renderers such as OVRTX with the asset's own color instead of the configured one.
diff --git a/source/isaaclab/isaaclab/sim/spawners/from_files/from_files.py b/source/isaaclab/isaaclab/sim/spawners/from_files/from_files.py
index 1a982fddcc09..deade19473d0 100644
--- a/source/isaaclab/isaaclab/sim/spawners/from_files/from_files.py
+++ b/source/isaaclab/isaaclab/sim/spawners/from_files/from_files.py
@@ -14,8 +14,6 @@
import numpy as np
from filelock import FileLock
-from isaaclab.utils.version import has_kit
-
from ... import converters, schemas
from ...utils import (
add_labels,
@@ -756,7 +754,7 @@ def spawn_from_usd_file(
shader, _, _ = UsdShade.Material(prim).ComputeSurfaceSource(context)
if shader:
_author_material_inputs(shader.GetPrim(), cfg.visual_material)
- elif has_kit():
+ else:
material_path = (
cfg.visual_material_path
if cfg.visual_material_path.startswith("/")
@@ -764,8 +762,6 @@ def spawn_from_usd_file(
)
cfg.visual_material.func(material_path, cfg.visual_material)
bind_visual_material(prim_path, material_path, stage=stage)
- else:
- logger.warning("Skipping visual material application for '%s' in kitless mode.", prim_path)
for part_path, material_path in cfg.visual_material_bindings.items():
from pxr import UsdShade # noqa: PLC0415
diff --git a/source/isaaclab/test/sim/test_visual_materials_kitless.py b/source/isaaclab/test/sim/test_visual_materials_kitless.py
index 9858d07c3a19..85e3d7804411 100644
--- a/source/isaaclab/test/sim/test_visual_materials_kitless.py
+++ b/source/isaaclab/test/sim/test_visual_materials_kitless.py
@@ -169,3 +169,20 @@ def test_visual_material_spawners_do_not_depend_on_kit_commands():
for module in (sim_utils, sim_utils.spawners, sim_utils.spawners.materials, visual_materials):
assert not hasattr(module, "modify_visual_material")
assert "_author_material_inputs" not in getattr(module, "__all__", ())
+
+
+def test_usd_file_spawn_binds_visual_material_without_kit(stage, tmp_path):
+ """A visual material on a USD file spawn must not be skipped when Kit is absent."""
+ asset = tmp_path / "asset.usda"
+ source = Usd.Stage.CreateNew(str(asset))
+ UsdGeom.Xform.Define(source, "/Asset")
+ UsdGeom.Cube.Define(source, "/Asset/Cube")
+ source.SetDefaultPrim(source.GetPrimAtPath("/Asset"))
+ source.Save()
+ cfg = UsdFileCfg(usd_path=str(asset), visual_material=PreviewSurfaceCfg(diffuse_color=(0.0, 1.0, 0.0)))
+
+ cfg.func("/World/Proto", cfg)
+
+ material, _ = UsdShade.MaterialBindingAPI(stage.GetPrimAtPath("/World/Proto")).ComputeBoundMaterial()
+ shader, _, _ = material.ComputeSurfaceSource()
+ assert tuple(shader.GetInput("diffuseColor").Get()) == (0.0, 1.0, 0.0)
diff --git a/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst b/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst
index 46d8e859bfdb..b7b6454b9bfd 100644
--- a/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst
+++ b/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst
@@ -2,7 +2,7 @@
(for example "Camera (sensor)"). A scene camera with one image per environment shows one environment at a time, with
an Environment field to switch it and a Tile Environments option for the previous side-by-side layout.
* Added an RTX Appearance section to the Newton GL Camera View, shown instead of the OpenGL Appearance options while
- the Renderer is RTX. It changes the OVRTX view's background (the dome light's sky or one color) and its lights while
+ the Renderer is RTX. It changes the OVRTX view's lights while
running: the scene's own lights (on by default) with an intensity scale and a color tint, a dome light with an
intensity, a color, and a sky texture chosen from the HDR skies tasks already use or a file, and a distant light with
an intensity, a color, an angle, an elevation, and an azimuth. The dome and distant lights are off by default. The
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 2b2a08ff3bd1..13fcadae8cb5 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -1005,12 +1005,13 @@ def _draw_streaming_view_controls(self, imgui) -> None:
self.set_rtx_rendering(True)
if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
imgui.set_tooltip(
- "OVRTX path-traced rendering of the scene; slower, without visual overlays"
+ "OVRTX path-traced rendering of the scene; slower than OpenGL"
if not sensor
else "A scene sensor is rendered by its own renderer. This applies to the free and tracking cameras"
)
if sensor:
imgui.end_disabled()
+ self._draw_appearance(imgui)
self._draw_focal_length(imgui)
# The OVRTX camera is chosen with the Renderer toggle, so the list holds only the other sources.
indices = sorted(
@@ -1036,7 +1037,6 @@ def _draw_streaming_view_controls(self, imgui) -> None:
self._choose_camera_source(indices[chosen])
if imgui.is_item_hovered():
imgui.set_tooltip(labels[position])
- self._draw_appearance(imgui)
follower = self._followers.get(self._pose_source_view())
if follower is not None:
self._draw_tracking_camera_controls(imgui, follower)
@@ -1088,7 +1088,7 @@ def _draw_appearance(self, imgui) -> None:
imgui.tree_pop()
def _draw_rtx_appearance(self, imgui) -> None:
- """Draw the Appearance options the OVRTX view supports: its background and its lights, one group per type."""
+ """Draw the Appearance options the OVRTX view supports: its lights, one group per type."""
imgui.set_next_item_open(False, imgui.Cond_.appearing)
if not imgui.tree_node("Lighting & Appearance###rtx_appearance"):
return
@@ -1145,21 +1145,6 @@ def intensity(label: str, value: float, high: float) -> tuple[bool, float]:
edited |= self._draw_sky_texture(imgui, appearance)
imgui.unindent()
- solid = appearance.background == 1
- changed, solid = imgui.checkbox("Solid Background", solid)
- tip("Show one color behind the scene instead of the sky. The lighting does not change")
- if changed:
- appearance.background = 1 if solid else 0
- edited |= appearance.apply_background()
- if solid:
- imgui.indent()
- changed, color = imgui.color_edit3("Color##background", list(appearance.background_color))
- tip("Background color")
- if changed:
- appearance.background_color = tuple(float(c) for c in color)
- edited |= appearance.apply_background()
- imgui.unindent()
-
changed, appearance.sun_enabled = imgui.checkbox("Distant Light", appearance.sun_enabled)
tip("Parallel light from one direction, like the sun, casting sharp shadows. Off by default")
edited |= light_changed(changed)
@@ -1903,21 +1888,6 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
self._viewer.picking_enabled = self._picking_enabled
self._configure_viewer()
- scene = self._sim.get_scene_data_provider().get_interactive_scene()
- for view in self._image_views:
- if scene is not None and self._is_task_view(view):
- # Fail at initialization, not on a frame: a bad env_index or track_path raises here.
- self._followers[view] = follower = CameraFollower(view.cfg.source, scene)
- cfg = view.cfg.source
- self._tracking_defaults[view] = {
- "eye": cfg.eye,
- "lookat": cfg.lookat,
- "focal_length": cfg.focal_length,
- "track_path": cfg.track_path,
- "follow_heading": cfg.follow_heading,
- "heading_smoothing_time_constant": cfg.heading_smoothing_time_constant,
- "env": follower.env,
- }
for view in self._image_views:
camera = view.camera
if camera is not None and camera.num_instances > 1 and view is not self._rtx_view():
From 32611fb1d73ab8c55ef5f2c082da4b0a6c39a69a Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 12 Nov 2026 05:23:56 +0000
Subject: [PATCH 028/140] Remove Impulse Drag and the Space pause bindings
Co-Authored-By: Claude Sonnet 5.5
---
.../changelog.d/newton-impulse-drag.added.rst | 4 -
.../changelog.d/newton-pause-keys.changed.rst | 4 -
.../newton-rtx-drag-arrow.fixed.rst | 4 +-
.../newton/newton_impulse_drag.py | 162 -----------
.../newton/newton_visualizer.py | 133 +--------
.../test/test_newton_impulse_drag.py | 258 ------------------
6 files changed, 11 insertions(+), 554 deletions(-)
delete mode 100644 source/isaaclab_visualizers/changelog.d/newton-impulse-drag.added.rst
delete mode 100644 source/isaaclab_visualizers/changelog.d/newton-pause-keys.changed.rst
delete mode 100644 source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_impulse_drag.py
delete mode 100644 source/isaaclab_visualizers/test/test_newton_impulse_drag.py
diff --git a/source/isaaclab_visualizers/changelog.d/newton-impulse-drag.added.rst b/source/isaaclab_visualizers/changelog.d/newton-impulse-drag.added.rst
deleted file mode 100644
index 7005f266630c..000000000000
--- a/source/isaaclab_visualizers/changelog.d/newton-impulse-drag.added.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-* Added Impulse Drag to the Newton visualizer. While the simulation is paused, right-clicking and dragging on a body
- aims an impulse as an arrow that stays after the button is released. Several impulses can wait, and they are applied
- once when the simulation resumes. The arrow's color runs from green through yellow to red with the size of the
- impulse. The Control Bindings list describes it.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-pause-keys.changed.rst b/source/isaaclab_visualizers/changelog.d/newton-pause-keys.changed.rst
deleted file mode 100644
index 65b4fa1bc67c..000000000000
--- a/source/isaaclab_visualizers/changelog.d/newton-pause-keys.changed.rst
+++ /dev/null
@@ -1,4 +0,0 @@
-* Changed the Newton visualizer's Space key to pause and resume the simulation, and added Shift + Space to pause and
- resume rendering. The Control Bindings list is split into Camera, Objects, Playback, and Window sections.
-* Changed the arrow drawn while dragging a body to change color from green to red with its length, whether or not the
- simulation is paused.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-rtx-drag-arrow.fixed.rst b/source/isaaclab_visualizers/changelog.d/newton-rtx-drag-arrow.fixed.rst
index 1b3c634be1d7..45d62740e2d5 100644
--- a/source/isaaclab_visualizers/changelog.d/newton-rtx-drag-arrow.fixed.rst
+++ b/source/isaaclab_visualizers/changelog.d/newton-rtx-drag-arrow.fixed.rst
@@ -1,2 +1,2 @@
-* Fixed the drag arrow and the queued impulse arrows of the Newton visualizer not appearing in the OVRTX view unless a
- visual overlay such as contacts was enabled.
+* Fixed the drag arrow of the Newton visualizer not appearing in the OVRTX view unless a visual overlay such as contacts
+ was enabled.
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_impulse_drag.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_impulse_drag.py
deleted file mode 100644
index 5af1614b8ef8..000000000000
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_impulse_drag.py
+++ /dev/null
@@ -1,162 +0,0 @@
-# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
-# All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-"""Impulse Drag: aim pushes at bodies while the simulation is paused and apply them when it resumes."""
-
-from __future__ import annotations
-
-from dataclasses import dataclass
-
-import numpy as np
-import warp as wp
-
-IMPULSE_GAIN = 6.0
-"""Speed given to a body per meter the arrow is dragged [m/s per m]."""
-MAX_IMPULSE_SPEED = 6.0
-"""Largest speed change an impulse can give a body [m/s]. Longer arrows are clamped to it."""
-MAX_IMPULSES = 16
-"""Impulses that can wait for the simulation to resume."""
-
-
-@wp.kernel
-def _apply_impulses(
- body_q: wp.array[wp.transform],
- body_com: wp.array[wp.vec3],
- body_f: wp.array[wp.spatial_vector],
- bodies: wp.array[int],
- points: wp.array[wp.vec3],
- impulses: wp.array[wp.vec3],
- inverse_dt: wp.array[float],
-):
- i = wp.tid()
- body = bodies[i]
- if body < 0:
- return
- transform = body_q[body]
- point = wp.transform_point(transform, points[i])
- com = wp.transform_point(transform, body_com[body])
- force = impulses[i] * inverse_dt[0]
- wp.atomic_add(body_f, body, wp.spatial_vector(force, wp.cross(point - com, force)))
- bodies[i] = -1 # Applied once: the next solver substep finds the slot empty.
-
-
-def impulse_color(fraction: float) -> tuple[float, float, float]:
- """Return the arrow color for an impulse of ``fraction`` of the largest one: green, yellow, then red."""
- t = min(max(float(fraction), 0.0), 1.0)
- if t < 0.5:
- return (2.0 * t, 1.0, 0.1)
- return (1.0, 2.0 * (1.0 - t), 0.1)
-
-
-@dataclass
-class Impulse:
- """One impulse waiting to be applied."""
-
- body: int
- """Index of the body the arrow starts on."""
- point: np.ndarray
- """Start of the arrow in the body's frame [m]."""
- vector: np.ndarray
- """Impulse [N·s], in the world frame."""
- fraction: float
- """Size of the impulse relative to the largest one, between 0 and 1."""
-
-
-def make_impulse(body: int, point: np.ndarray, displacement: np.ndarray, mass: float) -> Impulse:
- """Turn an arrow dragged from a point on a body into the impulse it stands for.
-
- Args:
- body: Index of the body.
- point: Start of the arrow in the body's frame [m].
- displacement: The arrow, from the picked point to the cursor target, in the world frame [m].
- mass: Mass the impulse acts on [kg].
-
- Returns:
- The impulse. Its speed change is :data:`IMPULSE_GAIN` per meter of arrow, up to :data:`MAX_IMPULSE_SPEED`.
- """
- length = float(np.linalg.norm(displacement))
- if length < 1e-9:
- return Impulse(body, np.asarray(point, dtype=np.float32), np.zeros(3, dtype=np.float32), 0.0)
- speed = min(IMPULSE_GAIN * length, MAX_IMPULSE_SPEED)
- vector = (displacement / length * speed * mass).astype(np.float32)
- return Impulse(body, np.asarray(point, dtype=np.float32), vector, speed / MAX_IMPULSE_SPEED)
-
-
-class ImpulseDrag:
- """Impulses aimed while paused, applied through the solver's force callback on the next step.
-
- The buffers have a fixed size and address so that the CUDA graph that records the solver substeps keeps working;
- the kernel empties a slot as it applies it.
- """
-
- def __init__(self, device, substep_dt: float):
- """Create the buffers.
-
- Args:
- device: Warp device of the model.
- substep_dt: Duration of one solver substep [s].
- """
- self._device = device
- self.entries: list[Impulse] = []
- self._bodies = wp.full(MAX_IMPULSES, -1, dtype=int, device=device)
- self._points = wp.zeros(MAX_IMPULSES, dtype=wp.vec3, device=device)
- self._impulses = wp.zeros(MAX_IMPULSES, dtype=wp.vec3, device=device)
- self._inverse_dt = wp.array([1.0 / substep_dt], dtype=float, device=device)
-
- def set_substep_dt(self, substep_dt: float) -> None:
- """Set the duration of one solver substep [s], which the impulse is applied over."""
- self._inverse_dt.assign(np.array([1.0 / substep_dt], dtype=np.float32))
-
- @property
- def full(self) -> bool:
- """Whether no more impulses can be added."""
- return len(self.entries) >= MAX_IMPULSES
-
- def add(self, impulse: Impulse) -> bool:
- """Queue an impulse, replacing the one already waiting on the same body.
-
- Returns:
- False when the impulse is empty or the queue is full, so nothing was queued.
- """
- if impulse.fraction <= 0.0:
- return False
- waiting = next((index for index, entry in enumerate(self.entries) if entry.body == impulse.body), None)
- if waiting is not None:
- self.entries[waiting] = impulse
- elif self.full:
- return False
- else:
- self.entries.append(impulse)
- self._upload()
- return True
-
- def clear(self) -> None:
- """Drop every queued impulse."""
- self.entries.clear()
- self._bodies.fill_(-1)
-
- def apply(self, state, body_com) -> None:
- """Launch the kernel that adds the queued impulses to ``state.body_f``; call it from the force callback."""
- wp.launch(
- _apply_impulses,
- dim=MAX_IMPULSES,
- inputs=[state.body_q, body_com, state.body_f, self._bodies, self._points, self._impulses, self._inverse_dt],
- device=self._device,
- )
-
- def forget_applied(self) -> None:
- """Drop the queue once the solver has applied it, which empties every slot on the device."""
- if self.entries and not (self._bodies.numpy() >= 0).any():
- self.entries.clear()
-
- def _upload(self) -> None:
- bodies = np.full(MAX_IMPULSES, -1, dtype=np.int32)
- points = np.zeros((MAX_IMPULSES, 3), dtype=np.float32)
- impulses = np.zeros((MAX_IMPULSES, 3), dtype=np.float32)
- for index, entry in enumerate(self.entries):
- bodies[index], points[index], impulses[index] = entry.body, entry.point, entry.vector
- self._points.assign(points)
- self._impulses.assign(impulses)
- self._bodies.assign(bodies)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 13fcadae8cb5..557cd2b44304 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -59,7 +59,6 @@
from isaaclab_visualizers.newton.newton_overlay_meshes import OverlayMeshPublisher
from isaaclab_visualizers.newton.newton_visualization_markers import render_newton_visualization_markers
-from .newton_impulse_drag import IMPULSE_GAIN, MAX_IMPULSE_SPEED, ImpulseDrag, impulse_color, make_impulse
from .newton_key_event_source import NewtonKeyEventSource
from .newton_rtx_appearance import SKY_TEXTURES, RtxAppearance
@@ -160,12 +159,6 @@ def _imgui_optional_checkbox(imgui, label: str, value: bool, available: bool, ti
# ---------------------------------------------------------------------------
-def _rotate(quaternion: np.ndarray, vector: np.ndarray) -> np.ndarray:
- """Rotate ``vector`` by a unit quaternion given as ``(x, y, z, w)``."""
- axis, w = quaternion[:3], quaternion[3]
- return vector + 2.0 * np.cross(axis, np.cross(axis, vector) + w * vector)
-
-
class NewtonViewerGL(ViewerGL):
"""Newton GL window with Isaac Lab controls and device-image presentation."""
@@ -184,12 +177,6 @@ class NewtonViewerGL(ViewerGL):
"""Publisher that also receives the line and arrow overlays, while the OVRTX view draws them."""
_view_controls = None
- impulse_drag: ImpulseDrag | None = None
- impulse_substep_dt = 1.0 / 120.0
- """Duration of one solver substep [s], which impulses are applied over; kept across :meth:`set_model`."""
- """Impulses aimed while paused; None until a model is set."""
- _impulse_arrows_shown = False
-
PICKING_ARROW_SCALE = 4.0
"""Screen-space size of the arrow drawn while dragging a body in the OpenGL view, relative to a contact arrow."""
PICKING_ARROW_WIDTH = 0.025
@@ -201,107 +188,12 @@ def log_lines(self, name, starts, ends, colors, width=0.01, hidden=False):
Newton draws the drag from the picked point to the cursor target as a thin line; it is drawn as an arrow here.
"""
if name == "picking_line":
- if starts is not None: # The arrow's color grows from green to red with its length, running or paused.
- length = float(np.linalg.norm(ends.numpy()[0] - starts.numpy()[0]))
- colors = impulse_color(min(IMPULSE_GAIN * length, MAX_IMPULSE_SPEED) / MAX_IMPULSE_SPEED)
self.log_arrows("picking_arrow", starts, ends, colors, width=self.PICKING_ARROW_WIDTH, hidden=hidden)
return
if self._overlay_capture is not None:
self._overlay_capture.record(name, starts, ends, colors, width, hidden, arrow=False)
super().log_lines(name, starts, ends, colors, width=width, hidden=hidden)
- def set_model(self, model, *args, **kwargs):
- """Set the model, and prepare the Impulse Drag buffers for it."""
- super().set_model(model, *args, **kwargs)
- self.impulse_drag = ImpulseDrag(model.device, self.impulse_substep_dt) if model is not None else None
- self._impulse_arrows_shown = False
-
- def set_impulse_substep_dt(self, substep_dt: float) -> None:
- """Set the solver substep that impulses are applied over, now and for every later model."""
- self.impulse_substep_dt = substep_dt
- if self.impulse_drag is not None:
- self.impulse_drag.set_substep_dt(substep_dt)
-
- def apply_forces(self, state):
- """Apply picking, wind, and the impulses aimed while paused."""
- super().apply_forces(state)
- if self.impulse_drag is not None and self.picking_enabled:
- self.impulse_drag.apply(state, self.model.body_com)
-
- def on_key_press(self, symbol, modifiers):
- """Space pauses the simulation, and Shift + Space pauses rendering; Newton's other keys are kept."""
- from pyglet.window import key
-
- if symbol == key.SPACE and self.gui is not None and not self.gui.is_keyboard_capturing():
- if modifiers & key.MOD_SHIFT:
- self._paused = not self._paused
- else:
- self._paused_training = not self._paused_training
- return
- super().on_key_press(symbol, modifiers)
-
- def on_mouse_release(self, x, y, button, modifiers):
- """Keep the arrow aimed with a right click while the simulation is paused as an impulse for when it resumes."""
- from pyglet.window import mouse
-
- if button == mouse.RIGHT and self._paused_training:
- self._queue_impulse()
- super().on_mouse_release(x, y, button, modifiers)
-
- def _queue_impulse(self) -> None:
- """Queue the drag that is being released as an impulse on the picked body."""
- picking, drag, state = self.picking, self.impulse_drag, self._last_state
- if drag is None or picking is None or state is None or not picking.is_picking():
- return
- body = int(picking.pick_body.numpy()[0])
- if body < 0:
- return
- pick = picking.pick_state.numpy()[0]
- local = np.asarray(pick["picked_point_local"], dtype=np.float64)
- transform = state.body_q.numpy()[body].astype(np.float64)
- point = transform[:3] + _rotate(transform[3:7], local)
- displacement = np.asarray(pick["picking_target_world"], dtype=np.float64) - point
- mass = float(picking._pick_effective_mass.numpy()[body]) or float(self.model.body_mass.numpy()[body])
- drag.add(make_impulse(body, local, displacement, mass))
-
- def _render_picking_line(self, state):
- """Draw the drag in progress, and the impulses waiting for the simulation to resume."""
- super()._render_picking_line(state)
- drag = self.impulse_drag
- if drag is None:
- return
- if not self._paused_training:
- drag.forget_applied()
- if not drag.entries:
- if self._impulse_arrows_shown:
- self.log_arrows("impulse_arrow", None, None, None)
- self._impulse_arrows_shown = False
- return
- transforms = state.body_q.numpy()
- offsets = self.world_offsets.numpy() if self.world_offsets is not None and self.world_offsets.shape[0] else None
- body_world = (
- self.model.body_world.numpy() if offsets is not None and self.model.body_world is not None else None
- )
- starts, ends, colors = [], [], []
- for entry in drag.entries:
- transform = transforms[entry.body].astype(np.float64)
- start = transform[:3] + _rotate(transform[3:7], entry.point.astype(np.float64))
- if body_world is not None and 0 <= body_world[entry.body] < len(offsets):
- start = start + offsets[body_world[entry.body]]
- direction = entry.vector / max(float(np.linalg.norm(entry.vector)), 1e-12)
- starts.append(start)
- ends.append(start + direction * entry.fraction * MAX_IMPULSE_SPEED / IMPULSE_GAIN)
- colors.append(impulse_color(entry.fraction))
- device = self.device
- self.log_arrows(
- "impulse_arrow",
- wp.array(np.array(starts, dtype=np.float32), dtype=wp.vec3, device=device),
- wp.array(np.array(ends, dtype=np.float32), dtype=wp.vec3, device=device),
- wp.array(np.array(colors, dtype=np.float32), dtype=wp.vec3, device=device),
- width=self.PICKING_ARROW_WIDTH,
- )
- self._impulse_arrows_shown = True
-
def _enlarge_picking_arrow(self) -> None:
"""Draw the picking arrow in a second pass at :attr:`PICKING_ARROW_SCALE`, leaving the contact arrows alone."""
renderer = self.renderer
@@ -310,7 +202,7 @@ def _enlarge_picking_arrow(self) -> None:
return
def render_arrows(arrows):
- picking = {key: arrow for key, arrow in arrows.items() if key.endswith(("picking_arrow", "impulse_arrow"))}
+ picking = {key: arrow for key, arrow in arrows.items() if key.endswith("picking_arrow")}
draw_arrows({key: arrow for key, arrow in arrows.items() if key not in picking})
if picking:
scale = renderer.arrow_scale
@@ -524,13 +416,12 @@ def _render_left_panel(_g=gui):
),
(
"Objects",
- ["Right Click - Pick and drag", "Paused + Right Click - Aim a push"] if picking else [],
+ ["Right Click - Pick and drag"] if picking else [],
),
(
"Playback",
[
- "Space - Pause simulation",
- "Shift + Space - Pause rendering",
+ "Space - Pause / resume rendering",
". - Step a frame (rendering paused)",
],
),
@@ -694,13 +585,13 @@ def _render_training_controls(self, imgui):
self._paused_training = not self._paused_training
hover_tooltip(
imgui,
- "Stop or resume stepping the simulation (Space). The window keeps updating",
+ "Stop or resume stepping the simulation. The window keeps updating",
)
rendering_label = "Resume Rendering" if self._paused else "Pause Rendering"
if imgui.button(rendering_label):
self._paused = not self._paused
- hover_tooltip(imgui, "Freeze or resume the window image (Shift + Space). The simulation keeps running")
+ hover_tooltip(imgui, "Freeze or resume the window image (Space). The simulation keeps running")
if imgui.button("Reset Episode"):
self._reset_requested = True
@@ -1876,7 +1767,6 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
self._picking_enabled = self.cfg.backend.enable_picking and picking_supported and not self._runtime_headless
self._viewer.set_model(self.backend.model)
- self._viewer.set_impulse_substep_dt(getattr(self.backend, "solver_dt", None) or sim.get_physics_dt())
if self._picking_enabled:
# Keep Newton's public force path scoped to picking for this integration.
self._viewer.wind = None
@@ -1971,10 +1861,10 @@ def _render_frame(self) -> None:
self.current_image_view.invalidate()
def _log_rtx_overlays(self) -> bool:
- """Draw the line and arrow overlays the HUD enables, and the drag and impulse arrows, as meshes in OVRTX.
+ """Draw the line and arrow overlays the HUD enables, and the drag arrow, as meshes in OVRTX.
Returns:
- Whether a drag or impulse arrow is being drawn, which an OVRTX view that is not stepping must render again.
+ Whether the drag arrow is being drawn, which an OVRTX view that is not stepping must render again.
"""
publisher, viewer = self._overlay_publisher, self._viewer
if publisher is None or not self.rtx_rendering:
@@ -1984,12 +1874,7 @@ def _log_rtx_overlays(self) -> bool:
getattr(viewer, flag)
for flag in ("show_joints", "show_contacts", "show_springs", "show_com", "show_inertia_boxes")
)
- drag = viewer.impulse_drag
- dragging = viewer.picking_enabled and (
- (viewer.picking is not None and viewer.picking.is_picking())
- or (drag is not None and bool(drag.entries))
- or viewer._impulse_arrows_shown # One more pass clears the arrows that were drawn.
- )
+ dragging = viewer.picking_enabled and viewer.picking is not None and viewer.picking.is_picking()
if not overlays and not dragging:
publisher.hide_all(renderers)
return False
@@ -2023,7 +1908,7 @@ def _refresh_paused_rtx_view(self, arrows_changed: bool) -> None:
"""Render the OVRTX camera again while the simulation is paused, which does not render it by itself.
Args:
- arrows_changed: Whether a drag or impulse arrow is being drawn, so the image changes every frame.
+ arrows_changed: Whether the drag arrow is being drawn, so the image changes every frame.
"""
view = self.current_image_view
if not self.rtx_rendering or not self.is_training_paused():
diff --git a/source/isaaclab_visualizers/test/test_newton_impulse_drag.py b/source/isaaclab_visualizers/test/test_newton_impulse_drag.py
deleted file mode 100644
index 9f37ce3572cc..000000000000
--- a/source/isaaclab_visualizers/test/test_newton_impulse_drag.py
+++ /dev/null
@@ -1,258 +0,0 @@
-# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
-# All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-"""Unit tests for Impulse Drag, which aims pushes while the simulation is paused."""
-
-from __future__ import annotations
-
-from types import SimpleNamespace
-
-import numpy as np
-import pytest
-
-pytest.importorskip("newton")
-import warp as wp
-from isaaclab_visualizers.newton.newton_impulse_drag import (
- IMPULSE_GAIN,
- MAX_IMPULSE_SPEED,
- MAX_IMPULSES,
- ImpulseDrag,
- impulse_color,
- make_impulse,
-)
-
-
-def test_the_arrow_color_runs_from_green_through_yellow_to_red():
- assert impulse_color(0.0)[1] == 1.0 and impulse_color(0.0)[0] == 0.0
- assert impulse_color(0.5)[:2] == (1.0, 1.0)
- assert impulse_color(1.0)[0] == 1.0 and impulse_color(1.0)[1] == 0.0
- assert impulse_color(7.0) == impulse_color(1.0) and impulse_color(-1.0) == impulse_color(0.0)
-
-
-def test_an_impulse_gives_the_body_a_speed_in_proportion_to_the_arrow_up_to_a_limit():
- short = make_impulse(3, np.zeros(3), np.array([0.0, 0.0, 0.2]), mass=2.0)
- assert short.vector == pytest.approx([0.0, 0.0, IMPULSE_GAIN * 0.2 * 2.0])
- assert short.fraction == pytest.approx(IMPULSE_GAIN * 0.2 / MAX_IMPULSE_SPEED)
-
- long = make_impulse(3, np.zeros(3), np.array([10.0, 0.0, 0.0]), mass=2.0)
- assert long.vector == pytest.approx([MAX_IMPULSE_SPEED * 2.0, 0.0, 0.0]) and long.fraction == 1.0
-
-
-def test_an_arrow_of_no_length_makes_no_impulse():
- drag = ImpulseDrag("cpu", 1.0 / 120.0)
-
- assert not drag.add(make_impulse(0, np.zeros(3), np.zeros(3), mass=1.0))
- assert drag.entries == []
-
-
-def _state(count=2):
- transforms = np.zeros((count, 7), dtype=np.float32)
- transforms[:, 6] = 1.0
- return SimpleNamespace(
- body_q=wp.array(transforms, dtype=wp.transform, device="cpu"),
- body_f=wp.zeros(count, dtype=wp.spatial_vector, device="cpu"),
- )
-
-
-def test_queued_impulses_are_applied_once_over_one_substep_and_may_be_several():
- dt = 1.0 / 120.0
- drag = ImpulseDrag("cpu", dt)
- com = wp.zeros(3, dtype=wp.vec3, device="cpu")
- state = _state(3)
- drag.add(make_impulse(0, np.zeros(3), np.array([0.1, 0.0, 0.0]), mass=1.0))
- drag.add(make_impulse(1, np.array([0.0, 0.5, 0.0]), np.array([0.0, 0.0, 0.1]), mass=1.0))
- drag.add(make_impulse(2, np.zeros(3), np.array([0.0, 0.1, 0.0]), mass=3.0))
-
- drag.apply(state, com)
- forces = state.body_f.numpy()
-
- assert forces[0][:3] * dt == pytest.approx([IMPULSE_GAIN * 0.1, 0.0, 0.0])
- assert forces[1][:3] * dt == pytest.approx([0.0, 0.0, IMPULSE_GAIN * 0.1])
- assert forces[1][3:] * dt == pytest.approx([IMPULSE_GAIN * 0.1 * 0.5, 0.0, 0.0]) # It acts off center.
- assert forces[2][:3] * dt == pytest.approx([0.0, IMPULSE_GAIN * 0.1 * 3.0, 0.0])
-
- second = _state(3)
- drag.apply(second, com)
- assert not second.body_f.numpy().any() # The next substep finds nothing to apply.
- drag.forget_applied()
- assert drag.entries == []
-
-
-def test_impulses_wait_for_the_simulation_and_the_queue_has_a_limit():
- drag = ImpulseDrag("cpu", 1.0 / 120.0)
- for body in range(MAX_IMPULSES):
- assert drag.add(make_impulse(body, np.zeros(3), np.array([0.1, 0.0, 0.0]), mass=1.0))
-
- drag.forget_applied() # Nothing ran yet, so nothing is dropped.
- assert len(drag.entries) == MAX_IMPULSES and drag.full
- assert not drag.add(make_impulse(MAX_IMPULSES, np.zeros(3), np.array([0.1, 0.0, 0.0]), mass=1.0))
-
- drag.clear()
- assert drag.entries == [] and not drag.full
-
-
-def test_a_new_impulse_on_a_body_replaces_the_one_waiting_on_it():
- drag = ImpulseDrag("cpu", 1.0 / 120.0)
- com = wp.zeros(2, dtype=wp.vec3, device="cpu")
- drag.add(make_impulse(0, np.zeros(3), np.array([0.1, 0.0, 0.0]), mass=1.0))
- drag.add(make_impulse(1, np.zeros(3), np.array([0.0, 0.1, 0.0]), mass=1.0))
- drag.add(make_impulse(0, np.zeros(3), np.array([0.0, 0.0, 0.2]), mass=1.0))
-
- assert [entry.body for entry in drag.entries] == [0, 1]
- state = _state()
- drag.apply(state, com)
- forces = state.body_f.numpy()
-
- assert forces[0][0] == pytest.approx(0.0) and forces[0][2] > 0.0 # Only the new one acts on body 0.
- assert forces[1][1] > 0.0
-
-
-def test_space_pauses_the_simulation_and_shift_space_pauses_rendering():
- from isaaclab_visualizers.newton.newton_visualizer import NewtonViewerGL
- from pyglet.window import key
-
- viewer = NewtonViewerGL.__new__(NewtonViewerGL)
- viewer.gui = SimpleNamespace(is_keyboard_capturing=lambda: False)
- viewer.renderer = SimpleNamespace(close=lambda: None)
- viewer._paused, viewer._paused_training = False, False
-
- viewer.on_key_press(key.SPACE, 0)
- assert viewer._paused_training and not viewer._paused
-
- viewer.on_key_press(key.SPACE, key.MOD_SHIFT)
- assert viewer._paused and viewer._paused_training
-
- viewer.on_key_press(key.SPACE, 0)
- assert viewer._paused and not viewer._paused_training
-
- viewer.gui = SimpleNamespace(
- is_keyboard_capturing=lambda: True, handle_key_press=lambda *args, **kwargs: None
- ) # A text field has the keyboard.
- viewer.on_key_press(key.SPACE, 0)
- assert not viewer._paused_training
-
-
-def test_the_drag_arrow_reaches_the_ovrtx_view_as_a_wide_colored_arrow(monkeypatch):
- from isaaclab_visualizers.newton import newton_visualizer
- from isaaclab_visualizers.newton.newton_visualizer import NewtonViewerGL
-
- monkeypatch.setattr(newton_visualizer.ViewerGL, "log_arrows", lambda self, *args, **kwargs: None)
- recorded = []
- viewer = NewtonViewerGL.__new__(NewtonViewerGL)
- viewer._overlay_capture = SimpleNamespace(record=lambda *args, **kwargs: recorded.append((args, kwargs)))
- starts = wp.array([[0.0, 0.0, 0.0]], dtype=wp.vec3, device="cpu")
- ends = wp.array([[0.5, 0.0, 0.0]], dtype=wp.vec3, device="cpu")
-
- viewer.log_lines("picking_line", starts, ends, (0.0, 1.0, 1.0))
-
- (name, _, _, colors, width, _), kwargs = recorded[0]
- assert name == "picking_arrow" and kwargs == {"arrow": True} and width == NewtonViewerGL.PICKING_ARROW_WIDTH
- assert colors == impulse_color(IMPULSE_GAIN * 0.5 / MAX_IMPULSE_SPEED)
-
-
-def _rtx_visualizer(picking: bool, queued: bool = False):
- from isaaclab_visualizers.newton.newton_visualizer import NewtonGLVisualizer
-
- viz = NewtonGLVisualizer.__new__(NewtonGLVisualizer)
- camera = SimpleNamespace(cfg=SimpleNamespace(prim_path="/World/viewer_camera_0", renderer_cfg="ovrtx"))
- view = SimpleNamespace(camera=camera)
- viz._image_views, viz.current_image_view = [view], view
- viz._sim = SimpleNamespace(get_or_create_backend=lambda cfg: cfg)
- calls = []
- viz._overlay_publisher = SimpleNamespace(
- hide_all=lambda renderers: calls.append("hide_all"), publish=lambda renderers: calls.append("publish")
- )
- viz._update_state = lambda: SimpleNamespace(body_q=None)
- viz._viewer = SimpleNamespace(
- show_joints=False,
- show_contacts=False,
- show_springs=False,
- show_com=False,
- show_inertia_boxes=False,
- show_contact_disks=False,
- picking_enabled=True,
- picking=SimpleNamespace(is_picking=lambda: picking),
- impulse_drag=SimpleNamespace(entries=[object()] if queued else []),
- _impulse_arrows_shown=False,
- is_paused=lambda: False,
- _render_picking_line=lambda state: calls.append("picking_line"),
- )
- return viz, calls
-
-
-def test_the_drag_arrow_is_published_to_ovrtx_even_when_no_overlay_is_enabled():
- viz, calls = _rtx_visualizer(picking=True)
-
- viz._log_rtx_overlays()
-
- assert calls == ["picking_line", "publish"]
-
-
-def test_queued_impulse_arrows_are_published_while_the_mouse_is_up():
- viz, calls = _rtx_visualizer(picking=False, queued=True)
-
- viz._log_rtx_overlays()
-
- assert calls == ["picking_line", "publish"]
-
-
-def test_nothing_is_published_to_ovrtx_when_nothing_is_being_dragged():
- viz, calls = _rtx_visualizer(picking=False)
-
- viz._log_rtx_overlays()
-
- assert calls == ["hide_all"]
-
-
-def _paused_rtx(paused: bool, timestamp: float = 5.0):
- viz, _ = _rtx_visualizer(picking=False)
- renders = []
- camera = viz.current_image_view.camera
- camera._is_outdated = SimpleNamespace(fill_=lambda value: renders.append("outdated"))
- camera.update = lambda dt, force_recompute=False: renders.append(("update", dt, force_recompute))
- viz.current_image_view.frame = SimpleNamespace(timestamp=timestamp)
- viz.current_image_view.invalidate = lambda: renders.append("invalidate")
- viz._viewer.is_training_paused = lambda: paused
- return viz, renders
-
-
-def test_a_paused_ovrtx_view_is_rendered_again_while_an_arrow_changes_and_once_more_after():
- viz, renders = _paused_rtx(paused=True)
-
- viz._refresh_paused_rtx_view(True)
- assert renders == ["outdated", ("update", 0.0, True), "invalidate"]
-
- renders.clear()
- viz._refresh_paused_rtx_view(False) # The arrows are gone; this render removes them from the image.
- assert len(renders) == 3
-
- renders.clear()
- viz._refresh_paused_rtx_view(False)
- assert renders == []
-
-
-def test_a_paused_ovrtx_view_follows_the_camera_and_a_running_one_is_left_alone():
- viz, renders = _paused_rtx(paused=True, timestamp=-1.0)
- viz._refresh_paused_rtx_view(False)
- assert len(renders) == 3 # Navigating invalidated the image.
-
- viz, renders = _paused_rtx(paused=False, timestamp=-1.0)
- viz._refresh_paused_rtx_view(True)
- assert renders == [] # The simulation renders it.
-
-
-def test_the_solver_substep_survives_a_model_reset(monkeypatch):
- from isaaclab_visualizers.newton import newton_visualizer
- from isaaclab_visualizers.newton.newton_visualizer import NewtonViewerGL
-
- monkeypatch.setattr(newton_visualizer.ViewerGL, "set_model", lambda self, model, *args, **kwargs: None)
- viewer = object.__new__(NewtonViewerGL)
- model = SimpleNamespace(device="cpu")
-
- viewer.set_model(model)
- viewer.set_impulse_substep_dt(1.0 / 240.0)
- viewer.set_model(model) # A reset replaces the Impulse Drag, which must keep the solver's substep.
-
- assert viewer.impulse_drag._inverse_dt.numpy()[0] == pytest.approx(240.0)
From fd7bc96137730baf60b3fe1e213f100eddd3741c Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 18 Nov 2026 01:11:42 +0000
Subject: [PATCH 029/140] Restore three files that formatting touched
---
source/isaaclab/isaaclab/envs/direct_rl_env.py | 8 +++-----
source/isaaclab/isaaclab/envs/manager_based_rl_env.py | 8 +++-----
source/isaaclab/test/app/test_remote_greetings.py | 6 +++---
3 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/source/isaaclab/isaaclab/envs/direct_rl_env.py b/source/isaaclab/isaaclab/envs/direct_rl_env.py
index 0ea6b47cd986..ea08d72ac536 100644
--- a/source/isaaclab/isaaclab/envs/direct_rl_env.py
+++ b/source/isaaclab/isaaclab/envs/direct_rl_env.py
@@ -535,11 +535,9 @@ def setup_direct_visualizers(self):
"""
scalars = {
"episode": {
- "mean_reward": lambda: (
- float(getattr(self, "reward_buf", None).mean())
- if getattr(self, "reward_buf", None) is not None
- else 0.0
- ),
+ "mean_reward": lambda: float(getattr(self, "reward_buf", None).mean())
+ if getattr(self, "reward_buf", None) is not None
+ else 0.0,
"episode_length": lambda: float(self.episode_length_buf.float().mean()),
}
}
diff --git a/source/isaaclab/isaaclab/envs/manager_based_rl_env.py b/source/isaaclab/isaaclab/envs/manager_based_rl_env.py
index 6fa619bc35b2..c8687c4bbdff 100644
--- a/source/isaaclab/isaaclab/envs/manager_based_rl_env.py
+++ b/source/isaaclab/isaaclab/envs/manager_based_rl_env.py
@@ -157,11 +157,9 @@ def setup_manager_visualizers(self):
}
scalars = {
"episode": {
- "mean_reward": lambda: (
- float(getattr(self, "reward_buf", None).mean())
- if getattr(self, "reward_buf", None) is not None
- else 0.0
- ),
+ "mean_reward": lambda: float(getattr(self, "reward_buf", None).mean())
+ if getattr(self, "reward_buf", None) is not None
+ else 0.0,
"episode_length": lambda: float(self.episode_length_buf.float().mean()),
}
}
diff --git a/source/isaaclab/test/app/test_remote_greetings.py b/source/isaaclab/test/app/test_remote_greetings.py
index 19b7a0bf9879..b2b787418075 100644
--- a/source/isaaclab/test/app/test_remote_greetings.py
+++ b/source/isaaclab/test/app/test_remote_greetings.py
@@ -70,9 +70,9 @@ def source(tmp_path, monkeypatch):
transport=remote._read_bytes,
)
source.read = Mock(
- side_effect=lambda url, limit: (
- json.dumps(source.manifest).encode() if url.endswith("/manifest.json") else source.blob
- )
+ side_effect=lambda url, limit: json.dumps(source.manifest).encode()
+ if url.endswith("/manifest.json")
+ else source.blob
)
monkeypatch.setenv("XDG_CACHE_HOME", str(source.cache))
monkeypatch.setattr(remote, "datetime", SimpleNamespace(now=lambda tz: source.now.astimezone(tz)))
From 7ff049bf6764d258ce0e37fd886b20542a353e2e Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 12 Nov 2026 05:24:10 +0000
Subject: [PATCH 030/140] Update the paused OVRTX render changelog fragment
Co-Authored-By: Claude Sonnet 5.5
---
.../changelog.d/newton-rtx-paused-render.fixed.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source/isaaclab_visualizers/changelog.d/newton-rtx-paused-render.fixed.rst b/source/isaaclab_visualizers/changelog.d/newton-rtx-paused-render.fixed.rst
index 059cd42bc81e..0b4a10d73c90 100644
--- a/source/isaaclab_visualizers/changelog.d/newton-rtx-paused-render.fixed.rst
+++ b/source/isaaclab_visualizers/changelog.d/newton-rtx-paused-render.fixed.rst
@@ -1,2 +1,2 @@
-* Fixed the OVRTX view of the Newton visualizer not updating while the simulation is paused, so that the drag and
- impulse arrows, and moving the camera, now show in it.
+* Fixed the OVRTX view of the Newton visualizer not updating while the simulation is paused, so that the drag arrow and
+ moving the camera now show in it.
From 7184ded0bbba9785027f11c4def58f8cece66416 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 12 Nov 2026 21:12:30 +0000
Subject: [PATCH 031/140] Keep OVRTX marker batches intact when environments
are hidden and dim the camera readout
Co-Authored-By: Claude Sonnet 5.5
---
.../isaaclab_ov/renderers/ovrtx_renderer.py | 13 +++++++------
.../test/test_ovrtx_hidden_environments.py | 8 +++++---
.../newton/newton_visualizer.py | 8 ++++----
3 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
index 5953775852ea..4dde89b5a2f2 100644
--- a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
+++ b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
@@ -1065,19 +1065,20 @@ def set_environment_visibility(self, visible: Sequence[bool]) -> None:
self._transforms_timestamp = -1 # Publish the poses again even when the simulation has not stepped.
def _visible_marker_rows(self, marker: Any) -> tuple:
- """Return the marker's translations, orientations, scales, and indices for the visible environments only.
+ """Return the marker's translations, orientations, scales, and indices with hidden markers moved away.
A batch whose size divides by the environment count is laid out environment-major; other batches are global.
+ The batch keeps its size, so the marker instances are never rebuilt when the visible environments change;
+ hidden environments' markers are moved far below the scene, as their bodies are.
"""
tensors = (marker.translations, marker.orientations, marker.scales, marker.marker_indices)
mask, num_envs, count = self._visible_envs, len(self._env_paths), len(marker.translations)
if mask is None or mask.all() or num_envs == 0 or count % num_envs:
return tensors
- keep = torch.as_tensor(mask, device=marker.translations.device)
- per_env = count // num_envs
- return tuple(
- None if t is None else t.reshape(num_envs, per_env, *t.shape[1:])[keep].flatten(0, 1) for t in tensors
- )
+ hidden = torch.as_tensor(~mask, device=marker.translations.device)
+ translations = marker.translations.reshape(num_envs, count // num_envs, -1).clone()
+ translations[hidden, :, 2] -= float(_HIDDEN_DROP)
+ return (translations.reshape(marker.translations.shape), *tensors[1:])
def _body_environment_ids(self) -> wp.array:
"""Return each published body's environment index, or ``num_envs`` for a body outside any environment."""
diff --git a/source/isaaclab_ov/test/test_ovrtx_hidden_environments.py b/source/isaaclab_ov/test/test_ovrtx_hidden_environments.py
index abe6ffcad148..a53c38b3af77 100644
--- a/source/isaaclab_ov/test/test_ovrtx_hidden_environments.py
+++ b/source/isaaclab_ov/test/test_ovrtx_hidden_environments.py
@@ -47,7 +47,7 @@ def _renderer(visible):
return renderer
-def test_markers_keep_only_the_rows_of_visible_environments():
+def test_markers_of_hidden_environments_drop_below_the_scene_without_changing_the_batch():
marker = SimpleNamespace(
translations=torch.arange(0.0, 12.0, 2.0)[:, None].repeat(1, 3), # 6 markers: 2 per env
orientations=None,
@@ -57,9 +57,11 @@ def test_markers_keep_only_the_rows_of_visible_environments():
translations, orientations, scales, indices = _renderer([True, False, True])._visible_marker_rows(marker)
- assert translations[:, 0].tolist() == [0.0, 2.0, 8.0, 10.0]
+ assert translations.shape == marker.translations.shape
+ assert translations[:, 0].tolist() == marker.translations[:, 0].tolist()
+ assert translations[:, 2].tolist() == [0.0, 2.0, 4.0 - 1.0e6, 6.0 - 1.0e6, 8.0, 10.0]
assert orientations is None and scales is None
- assert indices.tolist() == [0, 1, 0, 1]
+ assert indices is marker.marker_indices
def test_markers_are_untouched_when_all_environments_show_or_the_batch_is_global():
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 557cd2b44304..a1658ea3df52 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -938,15 +938,15 @@ def _draw_streaming_view_controls(self, imgui) -> None:
def _draw_camera_info(self, imgui) -> None:
"""Draw the navigation camera's position, field of view, and orientation."""
camera = getattr(self._viewer, "camera", None)
- if camera is None:
+ if camera is None or self.sensor_view_selected: # A sensor draws its own image, not this camera's view.
return
imgui.separator()
pos = camera.pos
- imgui.text(f"Position: ({pos[0]:.2f}, {pos[1]:.2f}, {pos[2]:.2f})")
+ imgui.text_disabled(f"Position: ({pos[0]:.2f}, {pos[1]:.2f}, {pos[2]:.2f})")
hover_tooltip(imgui, "World position of the camera [m]")
- imgui.text(f"Rotation: (pitch {camera.pitch:.1f}, yaw {camera.yaw:.1f}) deg")
+ imgui.text_disabled(f"Rotation: (pitch {camera.pitch:.1f}, yaw {camera.yaw:.1f}) deg")
hover_tooltip(imgui, "Look direction: pitch up or down, yaw around the vertical axis")
- imgui.text(f"FOV: {camera.fov:.1f} deg")
+ imgui.text_disabled(f"FOV: {camera.fov:.1f} deg")
hover_tooltip(imgui, "Vertical field of view; the Focal Length slider changes it")
def _rtx_appearance_controller(self) -> RtxAppearance | None:
From b6e356807216793065d58bd75313f5dc87e23592 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 12 Nov 2026 23:43:41 +0000
Subject: [PATCH 032/140] Address review feedback on the RTX toggle
Drop a sky download that a later choice supersedes, cache the hidden-marker mask, correct the RTX overlay and dragging docs, remove a duplicate export, and route the OVRTX tests to CI.
Co-Authored-By: Claude Sonnet 5.5
---
docs/source/concepts/visualization.rst | 4 +--
.../isaaclab_ov/renderers/ovrtx_renderer.py | 6 +++-
.../test/test_ovrtx_hidden_environments.py | 3 ++
.../isaaclab_visualizers/newton/__init__.py | 1 -
.../newton/newton_rtx_appearance.py | 8 ++---
.../test/test_newton_rtx_appearance.py | 29 +++++++++++++++++++
6 files changed, 43 insertions(+), 8 deletions(-)
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index a89bcc9caffa..0f430dd9ccb7 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -307,7 +307,7 @@ Visualizer Overview
staircase sub-terrain
Picking, visualization markers, camera selection, pause controls, Visible Envs, and headless recording work in
- the RTX view. Model overlays and rigid-body dragging apply to the OpenGL view only.
+ the RTX view, and picking draws the drag arrow there. Model overlays apply to the OpenGL view only.
.. warning::
@@ -1042,7 +1042,7 @@ Limitations
- ✗
- ✓
-In Newton's RTX view, model overlays and rigid-body dragging are not available.
+In Newton's RTX view, model overlays are not available.
**Lighting differences across visualizers**
diff --git a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
index 4dde89b5a2f2..12a70b67e475 100644
--- a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
+++ b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
@@ -397,6 +397,7 @@ def __init__(self, cfg: OVRTXRendererCfg, *, sim: SimulationContext):
self._object_scales: wp.array | None = None
self._geometry_paths: list[str] = []
self._visible_envs: np.ndarray | None = None
+ self._hidden_marker_rows: torch.Tensor | None = None
self._hidden_envs: wp.array | None = None
self._body_envs: wp.array | None = None
self._hidden_matrices: dict[int, wp.array] = {}
@@ -1059,6 +1060,7 @@ def set_environment_visibility(self, visible: Sequence[bool]) -> None:
if len(visible) != num_envs:
raise ValueError(f"Expected {num_envs} visibility flags, got {len(visible)}.")
self._visible_envs = np.asarray(visible, dtype=bool)
+ self._hidden_marker_rows = None
hidden = np.zeros(num_envs + 1, dtype=np.uint8) # The last entry stands for bodies outside any environment.
hidden[:num_envs] = ~self._visible_envs
self._hidden_envs = wp.array(hidden, dtype=wp.uint8, device=self._device) if hidden.any() else None
@@ -1075,7 +1077,9 @@ def _visible_marker_rows(self, marker: Any) -> tuple:
mask, num_envs, count = self._visible_envs, len(self._env_paths), len(marker.translations)
if mask is None or mask.all() or num_envs == 0 or count % num_envs:
return tensors
- hidden = torch.as_tensor(~mask, device=marker.translations.device)
+ hidden = self._hidden_marker_rows
+ if hidden is None or hidden.device != marker.translations.device:
+ hidden = self._hidden_marker_rows = torch.as_tensor(~mask, device=marker.translations.device)
translations = marker.translations.reshape(num_envs, count // num_envs, -1).clone()
translations[hidden, :, 2] -= float(_HIDDEN_DROP)
return (translations.reshape(marker.translations.shape), *tensors[1:])
diff --git a/source/isaaclab_ov/test/test_ovrtx_hidden_environments.py b/source/isaaclab_ov/test/test_ovrtx_hidden_environments.py
index a53c38b3af77..ca33f095259c 100644
--- a/source/isaaclab_ov/test/test_ovrtx_hidden_environments.py
+++ b/source/isaaclab_ov/test/test_ovrtx_hidden_environments.py
@@ -19,6 +19,8 @@
from isaaclab_ov.renderers.ovrtx_renderer import OVRTXRenderer # noqa: E402
from isaaclab_ov.renderers.ovrtx_renderer_kernels import hide_environment_bodies_kernel # noqa: E402
+pytestmark = pytest.mark.ov
+
def test_hidden_environments_drop_only_their_own_bodies():
# Row-vector matrices keep the translation in the last row; bodies 0-1 are in env 0, 2 in env 1, 3 in no env.
@@ -44,6 +46,7 @@ def _renderer(visible):
renderer = object.__new__(OVRTXRenderer)
renderer._env_paths = ["/World/envs/env_0", "/World/envs/env_1", "/World/envs/env_2"]
renderer._visible_envs = None if visible is None else np.asarray(visible, dtype=bool)
+ renderer._hidden_marker_rows = None
return renderer
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/__init__.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/__init__.py
index 7f74962ee265..cf839f096d4b 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/__init__.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/__init__.py
@@ -33,7 +33,6 @@
# GL backend
"NewtonGLVisualizer",
"NewtonGLBackendCfg",
- "NewtonGLVisualizerCfg",
# RTX backend
"NewtonRTXVisualizer",
"NewtonRTXBackendCfg",
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
index a0ad88b719b3..1fe087626c34 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
@@ -260,16 +260,16 @@ def set_dome_texture(self, source: str) -> None:
self._dome_texture_file, self.texture_status = "", ""
self._apply_texture()
return
- if self._texture_thread is not None and self._texture_thread.is_alive():
- return
self.texture_status = "Loading sky..."
def work() -> None:
try:
- self._texture_result = retrieve_file_path(source)
+ result = retrieve_file_path(source)
except Exception as exc:
logger.exception("[NewtonRtxAppearance] Could not load the sky texture %s.", source)
- self._texture_result = exc
+ result = exc
+ if self.dome_texture == source: # A newer choice, a removal, or a reset supersedes this download.
+ self._texture_result = result
self._texture_thread = threading.Thread(target=work, name="rtx-sky-texture", daemon=True)
self._texture_thread.start()
diff --git a/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py b/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
index 6f08e7c49f4e..b967bb99543b 100644
--- a/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
+++ b/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
@@ -17,6 +17,8 @@
from isaaclab_visualizers.newton import newton_rtx_appearance as module
from isaaclab_visualizers.newton.newton_rtx_appearance import RtxAppearance, find_scene_lights, sun_matrix
+pytestmark = pytest.mark.ov
+
class _Attr:
def __init__(self, value):
@@ -206,6 +208,33 @@ def test_a_sky_texture_is_loaded_in_the_background_and_adds_the_dome_light_again
assert appearance.texture_status == ""
+def test_a_sky_download_superseded_by_another_choice_is_not_applied(monkeypatch):
+ import threading
+
+ first_started, release_first = threading.Event(), threading.Event()
+
+ def retrieve(source):
+ if source.endswith("first.hdr"):
+ first_started.set()
+ release_first.wait(5)
+ return f"/cache/{source.rsplit('/', 1)[-1]}"
+
+ monkeypatch.setattr(module, "retrieve_file_path", retrieve)
+ appearance, _ = _appearance()
+ appearance.use_sky("https://assets/first.hdr")
+ assert first_started.wait(5)
+ appearance.use_sky("https://assets/second.hdr")
+ deadline = time.time() + 5
+ while not appearance.poll():
+ assert time.time() < deadline
+ time.sleep(0.01)
+ release_first.set()
+ time.sleep(0.1)
+
+ assert appearance._dome_texture_file == "/cache/second.hdr"
+ assert appearance.poll() is False # The first download finished late and was dropped.
+
+
def test_removing_the_sky_texture_restores_the_sky_blue_dome_without_a_download():
appearance, native = _appearance()
appearance.dome_enabled = True
From 9bec52e84ce814965776c48cfe995e37900bf0e1 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 12 Nov 2026 23:58:21 +0000
Subject: [PATCH 033/140] Keep a sensor view's own environment selection
Co-Authored-By: Claude Sonnet 5.5
---
.../isaaclab_visualizers/newton/newton_visualizer.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index a1658ea3df52..05ce71515c20 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -1781,9 +1781,10 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
for view in self._image_views:
camera = view.camera
if camera is not None and camera.num_instances > 1 and view is not self._rtx_view():
- # Tile the first environments; the HUD changes how many, down to a single chosen one.
+ # Tile the first environments unless the view chose its own; the HUD changes how many.
self._sensor_tiles[view] = camera.num_instances
- view.cfg.envs = tuple(range(min(DEFAULT_TILED_ENVS, camera.num_instances)))
+ if view.cfg.envs == (0,):
+ view.cfg.envs = tuple(range(min(DEFAULT_TILED_ENVS, camera.num_instances)))
self._select_camera(0)
if self.cfg.enable_markers and self.rtx_view_index is not None:
# OVRTX draws markers as stage prims; the viewer camera's renderer shares the registry's groups.
From 2ff8ae6eeb4b9ac9a4ee2ace367f89abc9a61a9e Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Fri, 13 Nov 2026 00:17:04 +0000
Subject: [PATCH 034/140] Keep the Perspective pose when leaving RTX from a
Tracking Camera
Co-Authored-By: Claude Sonnet 5.5
---
.../isaaclab_visualizers/newton/newton_visualizer.py | 3 +--
source/isaaclab_visualizers/test/test_newton_adapter.py | 5 +++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 05ce71515c20..b108bf8e3e87 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -1986,8 +1986,7 @@ def set_rtx_rendering(self, enabled: bool) -> None:
else:
if self._overlay_publisher is not None:
self._overlay_publisher.hide_all(self._rtx_renderers)
- back = self._rtx_pose_view
- self._rtx_pose_view = None
+ back = self._rtx_pose_view # _select_camera clears it after the outgoing pose is saved
self._select_camera(self._image_views.index(back) if back is not None else free[0], keep_pose=True)
@property
diff --git a/source/isaaclab_visualizers/test/test_newton_adapter.py b/source/isaaclab_visualizers/test/test_newton_adapter.py
index f9e99c35ea74..60ac2e8a7216 100644
--- a/source/isaaclab_visualizers/test/test_newton_adapter.py
+++ b/source/isaaclab_visualizers/test/test_newton_adapter.py
@@ -1410,7 +1410,10 @@ def view(source, camera=None):
visualizer.current_image_view = tracking
visualizer._rtx_pose_view = None
+ pose_view_when_selecting = []
+
def select(index, keep_pose=False):
+ pose_view_when_selecting.append(visualizer._rtx_pose_view)
visualizer.current_image_view = visualizer._image_views[index]
if index != visualizer.rtx_view_index:
visualizer._rtx_pose_view = None
@@ -1424,6 +1427,8 @@ def select(index, keep_pose=False):
visualizer.set_rtx_rendering(False)
assert visualizer.current_image_view is tracking and visualizer._rtx_pose_view is None
+ # Selecting away saves the outgoing pose first, which must still see the Tracking Camera driving the viewer.
+ assert pose_view_when_selecting[-1] is tracking
def test_sensor_labels_name_the_outputs_of_the_sensor():
From 76a890fba4a3da7fd903097b8137a45c069d02d6 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Mon, 16 Nov 2026 06:33:01 +0000
Subject: [PATCH 035/140] Move the window fit into WindowCfg and declare the
viewer camera in a helper
Co-Authored-By: Claude Sonnet 5.5
---
source/isaaclab/isaaclab/app/sim_launcher.py | 77 ++++++++-----------
.../isaaclab/visualizers/visualizer_cfg.py | 22 ++++++
.../app/test_launch_simulation_require_kit.py | 3 +-
.../test/app/test_rtx_viewer_camera.py | 8 +-
4 files changed, 61 insertions(+), 49 deletions(-)
diff --git a/source/isaaclab/isaaclab/app/sim_launcher.py b/source/isaaclab/isaaclab/app/sim_launcher.py
index a88396295895..07550657192e 100644
--- a/source/isaaclab/isaaclab/app/sim_launcher.py
+++ b/source/isaaclab/isaaclab/app/sim_launcher.py
@@ -165,28 +165,6 @@ def visit(node):
return tuple(configs)
-def _fit_window_to_display(size: tuple[int, int], margin: float = 0.92) -> tuple[int, int]:
- """Shrink a window size, keeping its aspect ratio, so the window fits the display with room for decorations.
-
- Args:
- size: Requested window width and height [px].
- margin: Fraction of the display the window may occupy.
-
- Returns:
- The requested size, or a proportionally smaller one; unchanged when the display size is unknown.
- """
- if sys.platform not in ("win32", "darwin") and not os.environ.get("DISPLAY"):
- return size
- try:
- import pyglet # noqa: PLC0415
-
- screen = pyglet.display.get_display().get_default_screen()
- scale = min(1.0, margin * screen.width / size[0], margin * screen.height / size[1])
- except Exception:
- return size
- return (max(1, int(size[0] * scale)), max(1, int(size[1] * scale)))
-
-
def _wants_rtx_viewer_camera(visualizer: VisualizerCfg, simulations: list[SimulationCfg]) -> bool:
"""Return whether a Newton GL window should get an OVRTX viewer camera in its scene."""
backend = visualizer.backend
@@ -198,6 +176,37 @@ def _wants_rtx_viewer_camera(visualizer: VisualizerCfg, simulations: list[Simula
return importlib.util.find_spec("ovrtx") is not None and not on_physx
+def _declare_viewer_camera(
+ scene_cfg: InteractiveSceneCfg, viewer_index: int, visualizer: VisualizerCfg
+) -> tuple[str, VisualizerCfg, tuple[int, int], bool]:
+ """Add the OVRTX camera a Newton GL window shows in its RTX view to the scene.
+
+ Returns:
+ The camera name, the visualizer, and the window size and ``streaming_view`` it declared, which a Kit run
+ restores when it drops the camera.
+ """
+ name = f"viewer_camera_{viewer_index}_rtx"
+ declared = (visualizer.window.size, visualizer.streaming_view)
+ # The window must open at the camera's aspect ratio; an oversized window is clamped by the window manager.
+ visualizer.window.size = visualizer.window.fit_to_display()
+ width, height = visualizer.window.size
+ rotation = quat_from_matrix(create_rotation_matrix_from_view(
+ torch.tensor([visualizer.eye]), torch.tensor([visualizer.lookat]), "Z", device="cpu"
+ ))[0].tolist() # fmt: skip
+ vars(scene_cfg)[name] = CameraCfg(
+ prim_path=f"/World/{name}", width=width, height=height, data_types=["rgba"],
+ spawn=PinholeCameraCfg(
+ focal_length=visualizer.focal_length, vertical_aperture=15.2908,
+ horizontal_aperture=15.2908 * width / height,
+ ),
+ offset=CameraCfg.OffsetCfg(pos=visualizer.eye, rot=tuple(rotation), convention="opengl"),
+ renderer_cfg=visualizer.backend.rtx_renderer_cfg, background_color=visualizer.background_color,
+ render_settings={"omni:rtx:quality": ("Int", 0), **visualizer.backend.rtx_render_settings},
+ ) # fmt: skip
+ visualizer.streaming_view = True # The window lists scene cameras, including this one, as view sources.
+ return name, visualizer, *declared
+
+
def validate_launch( # noqa: C901
cfg, launcher_args: argparse.Namespace | dict | None = None
) -> tuple[tuple[Any, ...], tuple[str, ...]]:
@@ -353,28 +362,8 @@ def validate_launch( # noqa: C901
# A Newton GL window can switch its main view to an OVRTX camera, which must already exist in the scene.
implicit_viewer_cameras: list[tuple[str, VisualizerCfg, tuple[int, int], bool]] = []
for viewer_index, visualizer in enumerate(viewers):
- if scene_cfg is None or not _wants_rtx_viewer_camera(visualizer, simulations):
- continue
- name = f"viewer_camera_{viewer_index}_rtx"
- # The window must open at the camera's aspect ratio; an oversized window is clamped by the window manager.
- declared = (visualizer.window.size, visualizer.streaming_view) # Restored if a Kit run drops the camera.
- visualizer.window.size = _fit_window_to_display(visualizer.window.size)
- width, height = visualizer.window.size
- rotation = quat_from_matrix(create_rotation_matrix_from_view(
- torch.tensor([visualizer.eye]), torch.tensor([visualizer.lookat]), "Z", device="cpu"
- ))[0].tolist() # fmt: skip
- implicit_viewer_cameras.append((name, visualizer, *declared))
- vars(scene_cfg)[name] = CameraCfg(
- prim_path=f"/World/{name}", width=width, height=height, data_types=["rgba"],
- spawn=PinholeCameraCfg(
- focal_length=visualizer.focal_length, vertical_aperture=15.2908,
- horizontal_aperture=15.2908 * width / height,
- ),
- offset=CameraCfg.OffsetCfg(pos=visualizer.eye, rot=tuple(rotation), convention="opengl"),
- renderer_cfg=visualizer.backend.rtx_renderer_cfg, background_color=visualizer.background_color,
- render_settings={"omni:rtx:quality": ("Int", 0), **visualizer.backend.rtx_render_settings},
- ) # fmt: skip
- visualizer.streaming_view = True # The window lists scene cameras, including this one, as view sources.
+ if scene_cfg is not None and _wants_rtx_viewer_camera(visualizer, simulations):
+ implicit_viewer_cameras.append(_declare_viewer_camera(scene_cfg, viewer_index, visualizer))
for viewer_index, visualizer in enumerate(viewers):
if not isinstance(visualizer.backend, NewtonRTXBackendCfg) or scene_cfg is None:
continue
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index 8527ab52c3e5..ae23124d51a0 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -8,6 +8,8 @@
from __future__ import annotations
import math
+import os
+import sys
import warnings
from copy import deepcopy
from dataclasses import MISSING, fields
@@ -186,6 +188,26 @@ def validate_config(self) -> None:
if not math.isfinite(self.fps) or self.fps <= 0:
raise ValueError("WindowCfg.fps must be finite and positive.")
+ def fit_to_display(self, margin: float = 0.92) -> tuple[int, int]:
+ """Shrink :attr:`size`, keeping its aspect ratio, so the window fits the display with room for decorations.
+
+ Args:
+ margin: Fraction of the display the window may occupy.
+
+ Returns:
+ :attr:`size`, or a proportionally smaller size; unchanged when the display size is unknown.
+ """
+ if sys.platform not in ("win32", "darwin") and not os.environ.get("DISPLAY"):
+ return self.size
+ try:
+ import pyglet # noqa: PLC0415
+
+ screen = pyglet.display.get_display().get_default_screen()
+ scale = min(1.0, margin * screen.width / self.size[0], margin * screen.height / self.size[1])
+ except Exception:
+ return self.size
+ return (max(1, int(self.size[0] * scale)), max(1, int(self.size[1] * scale)))
+
@configclass
class VisualizerBackendCfg:
diff --git a/source/isaaclab/test/app/test_launch_simulation_require_kit.py b/source/isaaclab/test/app/test_launch_simulation_require_kit.py
index dacad85e2667..1f8763dd282e 100644
--- a/source/isaaclab/test/app/test_launch_simulation_require_kit.py
+++ b/source/isaaclab/test/app/test_launch_simulation_require_kit.py
@@ -139,12 +139,13 @@ def test_rtx_perspective_configuration_declares_scene_cameras(channels):
def test_kit_run_drops_the_implicit_ovrtx_viewer_camera(monkeypatch: pytest.MonkeyPatch):
"""A Kit run cannot load the OVRTX runtime, so its Newton GL window keeps the OpenGL view only."""
- monkeypatch.setattr(sim_launcher, "_fit_window_to_display", lambda size: (640, 360)) # As on a small display.
from isaaclab_visualizers.newton import NewtonGLBackendCfg
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.visualizers import VisualizerCfg, WindowCfg
+ monkeypatch.setattr(WindowCfg, "fit_to_display", lambda self: (640, 360)) # As on a small display.
+
visualizer = VisualizerCfg(window=WindowCfg(size=(5000, 3000)), backend=NewtonGLBackendCfg(rtx_camera=True))
cfg = types.SimpleNamespace(
sim=SimulationCfg(physics=sim_launcher.NewtonCfg(), visualizer_cfgs=visualizer),
diff --git a/source/isaaclab/test/app/test_rtx_viewer_camera.py b/source/isaaclab/test/app/test_rtx_viewer_camera.py
index f7703312eddf..617d2d0f771c 100644
--- a/source/isaaclab/test/app/test_rtx_viewer_camera.py
+++ b/source/isaaclab/test/app/test_rtx_viewer_camera.py
@@ -14,7 +14,7 @@
from isaaclab_visualizers.newton import NewtonGLBackendCfg
import isaaclab.app.sim_launcher as sim_launcher
-from isaaclab.visualizers import VisualizerCfg
+from isaaclab.visualizers import VisualizerCfg, WindowCfg
def _fake_display(monkeypatch: pytest.MonkeyPatch, width: int = 1920, height: int = 1080) -> None:
@@ -31,7 +31,7 @@ def _fake_display(monkeypatch: pytest.MonkeyPatch, width: int = 1920, height: in
def test_oversized_window_shrinks_to_fit_the_display_keeping_its_aspect(monkeypatch: pytest.MonkeyPatch) -> None:
_fake_display(monkeypatch)
- width, height = sim_launcher._fit_window_to_display((1920, 1080))
+ width, height = WindowCfg(size=(1920, 1080)).fit_to_display()
assert width <= 0.92 * 1920 and height <= 0.92 * 1080
assert abs(width / height - 1920 / 1080) < 0.01
@@ -40,14 +40,14 @@ def test_oversized_window_shrinks_to_fit_the_display_keeping_its_aspect(monkeypa
def test_window_that_already_fits_is_unchanged(monkeypatch: pytest.MonkeyPatch) -> None:
_fake_display(monkeypatch)
- assert sim_launcher._fit_window_to_display((1280, 720)) == (1280, 720)
+ assert WindowCfg(size=(1280, 720)).fit_to_display() == (1280, 720)
def test_window_size_is_unchanged_without_a_display_to_query(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setattr(sys, "platform", "linux")
monkeypatch.delenv("DISPLAY", raising=False)
- assert sim_launcher._fit_window_to_display((1920, 1080)) == (1920, 1080)
+ assert WindowCfg(size=(1920, 1080)).fit_to_display() == (1920, 1080)
@pytest.mark.parametrize(
From a363cd205d2995bb9e15e5425706aaedc7a71464 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Mon, 16 Nov 2026 06:35:03 +0000
Subject: [PATCH 036/140] Mark hiding OVRTX environments below the scene as a
workaround
Co-Authored-By: Claude Sonnet 5.5
---
source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
index 12a70b67e475..7e973e3463f0 100644
--- a/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
+++ b/source/isaaclab_ov/isaaclab_ov/renderers/ovrtx_renderer.py
@@ -123,6 +123,7 @@
_RENDER_DELTA_TIME = 1.0 / 60.0
_GPU_CAMERA_TRANSFORMS_ATTRIBUTE = "omni:rtx:scene:hydra:readGPUCameraTransformsFromFabricInRenderDelegate"
_LDR_COLOR_VAR = "LdrColor"
+# TODO: Remove with the below-the-scene hiding workaround in OVRTXRenderer.set_environment_visibility.
_HIDDEN_DROP = wp.float64(1.0e6)
"""Distance [m] below the scene to which the bodies of hidden environments are moved."""
_CAMERA_INTRINSIC_ATTRIBUTES = (
@@ -1053,6 +1054,10 @@ def set_environment_visibility(self, visible: Sequence[bool]) -> None:
Writing the USD ``visibility`` of a cloned environment corrupts the transforms of its bodies once it is shown
again, so hidden bodies are instead moved far below the scene when their poses are published.
+ .. todo::
+ Hiding by moving bodies below the scene is a workaround. Find why writing ``visibility`` on a cloned
+ environment corrupts its body transforms after it is shown again, and hide with ``visibility`` instead.
+
Args:
visible: Per-environment flag, in environment order.
"""
From 19c8a3c0710b33294fb875ee1ff4d4640d813274 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Mon, 16 Nov 2026 07:53:52 +0000
Subject: [PATCH 037/140] Drop redundant visualizer tests
Co-Authored-By: Claude Sonnet 5.5
---
.../test/test_newton_adapter.py | 13 ----
.../test/test_newton_rtx_appearance.py | 2 +-
.../test/test_newton_task_views.py | 73 -------------------
3 files changed, 1 insertion(+), 87 deletions(-)
diff --git a/source/isaaclab_visualizers/test/test_newton_adapter.py b/source/isaaclab_visualizers/test/test_newton_adapter.py
index 60ac2e8a7216..ac0b39209fe4 100644
--- a/source/isaaclab_visualizers/test/test_newton_adapter.py
+++ b/source/isaaclab_visualizers/test/test_newton_adapter.py
@@ -1361,13 +1361,6 @@ def test_newton_rtx_visualizer_rejects_kit_physics_backend():
visualizer.initialize(sim, cameras=[])
-def test_marker_tooltip_describes_known_markers_and_falls_back():
- from isaaclab_visualizers.newton.newton_visualizer import marker_tooltip
-
- assert marker_tooltip("/Visuals/Command/velocity_goal") == "Commanded base velocity"
- assert marker_tooltip("/Visuals/Brand_New_Marker") == "Show or hide this marker group"
-
-
def test_term_summary_reads_the_first_docstring_line_of_a_term_function():
from isaaclab_visualizers.newton.newton_visualizer import term_summary
@@ -1452,9 +1445,3 @@ def test_a_scene_sensor_view_is_not_an_opengl_or_rtx_view():
for view, selected in ((free, False), (sensor, True), (rtx, False)):
visualizer.current_image_view = view
assert visualizer.sensor_view_selected is selected
-
-
-def test_the_statistics_overlay_starts_closed():
- from isaaclab_visualizers.newton.newton_visualizer import NewtonViewerGL
-
- assert NewtonViewerGL._show_stats is False
diff --git a/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py b/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
index b967bb99543b..cc687d803c73 100644
--- a/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
+++ b/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
@@ -178,7 +178,7 @@ def test_the_distant_light_gets_its_angle_and_direction():
np.testing.assert_allclose(matrix[0][2][:3], [0.0, 0.0, 1.0], atol=1e-9) # Straight down: local +Z is up.
-@pytest.mark.parametrize(("elevation", "azimuth"), [(40.0, 0.0), (65.0, 35.0), (90.0, 0.0), (10.0, 270.0)])
+@pytest.mark.parametrize(("elevation", "azimuth"), [(65.0, 35.0), (90.0, 0.0), (10.0, 270.0)])
def test_the_sun_transform_is_a_rotation_that_points_local_z_toward_the_light(elevation, azimuth):
matrix = sun_matrix(elevation, azimuth)
rotation = matrix[:3, :3]
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index 63cfb33e8092..9a5517922e2f 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -105,68 +105,6 @@ def test_the_camera_list_puts_perspective_first_then_tracking_cameras_then_senso
assert order == [2, 1, 0]
-def test_a_task_view_moves_the_viewer_camera_to_the_followed_environment():
- view = _view(TrackingCameraCfg(env_index=1, eye=(2.0, 0.0, 1.0), lookat=(0.0, 0.0, 0.5), focal_length=24.0))
- viz = _visualizer([view])
-
- assert viz._apply_view_pose(view)
-
- camera = viz._viewer.camera
- assert (camera.pos.x, camera.pos.y, camera.pos.z) == pytest.approx((12.0, 0.0, 1.0)) # Environment 1 origin.
- assert camera.target == pytest.approx((10.0, 0.0, 0.5))
-
-
-def test_switching_the_followed_environment_re_aims_the_camera():
- view = _view(TrackingCameraCfg(env_index=0, eye=(2.0, 0.0, 1.0)))
- viz = _visualizer([view])
-
- viz._followers[view].set_env(1)
- viz._apply_view_pose(view)
-
- assert viz._viewer.camera.pos.x == pytest.approx(12.0)
-
-
-def test_resetting_the_tracking_camera_restores_what_the_task_declared():
- view = _view(TrackingCameraCfg(env_index=0, eye=(2.0, 0.0, 1.0), lookat=(0.0, 0.0, 0.5), focal_length=24.0))
- viz = _visualizer([view])
- cfg = view.cfg.source
- viz._tracking_defaults = {
- view: {
- "eye": cfg.eye,
- "lookat": cfg.lookat,
- "focal_length": cfg.focal_length,
- "track_path": cfg.track_path,
- "follow_heading": cfg.follow_heading,
- "heading_smoothing_time_constant": cfg.heading_smoothing_time_constant,
- "env": 0,
- }
- }
- viz.current_image_view = view
- viz._tracking_error = ""
- follower = viz._followers[view]
-
- cfg.eye, cfg.focal_length = (9.0, 9.0, 9.0), 60.0
- follower.set_env(1)
- assert viz._reset_tracking_camera(follower)
-
- assert (cfg.eye, cfg.focal_length, follower.env) == ((2.0, 0.0, 1.0), 24.0, 0)
-
-
-def test_an_invalid_followed_asset_is_reported_not_raised():
- view = _view(TrackingCameraCfg(env_index=0))
- viz = _visualizer([view])
- viz._tracking_error = ""
-
- class Scene(_Scene):
- def __getitem__(self, name):
- raise KeyError(name)
-
- viz._followers[view]._scene = Scene()
-
- assert not viz._set_tracking_path(viz._followers[view], "ghost")
- assert "unknown scene asset" in viz._tracking_error
-
-
def test_the_free_perspective_pose_is_kept_while_another_source_is_shown():
free, task = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=0))
viz = _visualizer([free, task])
@@ -247,17 +185,6 @@ def test_switching_to_rtx_and_back_returns_to_the_perspective_view():
assert viz.hidden == [("ovrtx",)] # The overlay meshes are hidden when OVRTX stops drawing.
-def test_switching_to_rtx_while_a_tracking_camera_is_shown_returns_to_it():
- free, task, rtx = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=0)), _rtx_view()
- viz = _switchable([free, task, rtx])
- viz.current_image_view = task
-
- viz.set_rtx_rendering(True)
- viz.set_rtx_rendering(False)
-
- assert viz.current_image_view is task
-
-
def test_rtx_rendering_needs_the_viewer_camera_declared_at_launch():
viz = _switchable([_view(PerspectiveCameraCfg())])
From 0cc9f881bb5a4a22840cdec30ece1ae4540fa750 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Tue, 17 Nov 2026 07:10:04 +0000
Subject: [PATCH 038/140] Fix the RTX visualizer crash, the hover stub in the
visualizer checks, and per-shape randomization with the viewer camera
---
source/_isaaclab_testing/test/rendering/visualizer_checks.py | 2 +-
.../changelog.d/randomize-visual-shape-ovrtx.fixed.rst | 2 ++
source/isaaclab/isaaclab/envs/mdp/visual_events.py | 2 +-
.../isaaclab_visualizers/newton/newton_visualizer.py | 5 +++--
4 files changed, 7 insertions(+), 4 deletions(-)
create mode 100644 source/isaaclab/changelog.d/randomize-visual-shape-ovrtx.fixed.rst
diff --git a/source/_isaaclab_testing/test/rendering/visualizer_checks.py b/source/_isaaclab_testing/test/rendering/visualizer_checks.py
index c06e295de291..0ff05cc10926 100644
--- a/source/_isaaclab_testing/test/rendering/visualizer_checks.py
+++ b/source/_isaaclab_testing/test/rendering/visualizer_checks.py
@@ -22,7 +22,7 @@ def press_button(viewer, label: str) -> None:
Mock(
button=lambda text: text == label,
slider_float=lambda _label, value, *_args: (False, value),
- is_item_hovered=lambda: False,
+ is_item_hovered=lambda *_: False,
)
)
diff --git a/source/isaaclab/changelog.d/randomize-visual-shape-ovrtx.fixed.rst b/source/isaaclab/changelog.d/randomize-visual-shape-ovrtx.fixed.rst
new file mode 100644
index 000000000000..5e913856ee00
--- /dev/null
+++ b/source/isaaclab/changelog.d/randomize-visual-shape-ovrtx.fixed.rst
@@ -0,0 +1,2 @@
+* Fixed :class:`~isaaclab.envs.mdp.randomize_visual_shape` raising on Newton physics when the Newton visualizer
+ declares its OVRTX viewer camera.
diff --git a/source/isaaclab/isaaclab/envs/mdp/visual_events.py b/source/isaaclab/isaaclab/envs/mdp/visual_events.py
index c70671af1658..ed4bca424f43 100644
--- a/source/isaaclab/isaaclab/envs/mdp/visual_events.py
+++ b/source/isaaclab/isaaclab/envs/mdp/visual_events.py
@@ -72,7 +72,7 @@ def _get_backend(cls, cfg: EventTermCfg, env: ManagerBasedEnv) -> str:
*(cfg.backend.visualizer_type for cfg in env.sim.cfg.visualizer_cfgs if cfg.backend),
*env.sim.render_context.renderer_types,
)
- supported = ("newton_gl", "newton_rtx", "newton_warp")
+ supported = ("newton_gl", "newton_rtx", "newton_warp", "ovrtx")
if consumers and all(name in supported for name in consumers):
return "newton"
raise NotImplementedError(
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index b108bf8e3e87..3f7dd41c2495 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -1199,7 +1199,8 @@ def _invalidate_sensor_view(self, view) -> None:
def _draw_focal_length(self, imgui) -> None:
"""Draw the focal length of the free camera or the Tracking Camera; sensors have fixed intrinsics."""
view = self._pose_source_view()
- rtx_view = self._image_views[self.rtx_view_index] if self.rtx_view_index is not None else None
+ rtx_index = getattr(self, "rtx_view_index", None)
+ rtx_view = self._image_views[rtx_index] if rtx_index is not None else None
if view.camera is not None and view is not rtx_view:
return
task = self._is_task_view(view)
@@ -1433,7 +1434,7 @@ def _select_camera(self, index: int, *, keep_pose: bool = False) -> None:
"""
self._remember_perspective_pose()
self.current_image_view = self._image_views[index]
- if index != self.rtx_view_index:
+ if index != getattr(self, "rtx_view_index", None):
self._rtx_pose_view = None
camera = self.current_image_view.cfg.source
self.current_image_view.invalidate()
From 3f0bea0e8d3ec09ae509484d6612174477aa4853 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Tue, 17 Nov 2026 08:14:42 +0000
Subject: [PATCH 039/140] Refresh the RTX frame when markers change
---
.../isaaclab_visualizers/newton/newton_visualizer.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 3f7dd41c2495..10124c214175 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -2333,7 +2333,7 @@ def log_mesh(self, name: str, *args, **kwargs) -> None:
for renderer in self._renderers:
renderer.log_mesh(f"Viewer_{id(self)}/{name.lstrip('/')}", *args, **kwargs)
for view in self._image_views:
- view.camera.update(0.0)
+ view.camera._invalidate_buffers()
view.invalidate()
def _render_frame(self) -> None:
@@ -2344,7 +2344,7 @@ def _render_frame(self) -> None:
self._navigate_scene_camera()
if self.cfg.enable_markers and self._marker_revision != self._sim.vis_marker_registry.revision:
for view in self._image_views:
- view.camera.update(0.0)
+ view.camera._invalidate_buffers()
view.invalidate()
self._marker_revision = self._sim.vis_marker_registry.revision
self._log_streaming_image()
From b3064ccfbae78e53e469fdc7a7281b567fc78381 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Tue, 17 Nov 2026 08:20:14 +0000
Subject: [PATCH 040/140] Start the window from the configured eye instead of
the viewer's default pose
---
.../isaaclab_visualizers/newton/newton_visualizer.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 10124c214175..e61728c64408 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -753,6 +753,7 @@ def __init__(self, cfg):
self._pending_mesh_submissions: dict[str, dict[str, Any]] = {}
self._camera_keys_enabled = True
self._overlay_publisher = None
+ self._pose_started = False
self._followers: dict[object, CameraFollower] = {}
"""Followers of the tracking cameras, by image view."""
self._rtx_pose_view = None
@@ -1432,7 +1433,8 @@ def _select_camera(self, index: int, *, keep_pose: bool = False) -> None:
index: Image view to display.
keep_pose: Continue from the viewer's current camera instead of the source's configured pose.
"""
- self._remember_perspective_pose()
+ if getattr(self, "_pose_started", True): # the viewer camera holds no pose of its own before the first source
+ self._remember_perspective_pose()
self.current_image_view = self._image_views[index]
if index != getattr(self, "rtx_view_index", None):
self._rtx_pose_view = None
@@ -1460,6 +1462,7 @@ def _select_camera(self, index: int, *, keep_pose: bool = False) -> None:
self._viewer.picking.release()
self._navigation_view = self._viewer.camera.get_view_matrix().reshape(4, 4).T.copy()
+ self._pose_started = True
def _place_scene_camera_at_viewer(self, camera: Camera) -> None:
"""Move a scene camera to the viewer camera's current world pose."""
From 80c32a7c7dddd9501f1c1aeaed26644b405cd3be Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Tue, 17 Nov 2026 08:22:55 +0000
Subject: [PATCH 041/140] Render the OVRTX camera again when visualization
markers change
---
.../newton/newton_visualizer.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index e61728c64408..85a436719e46 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -754,6 +754,7 @@ def __init__(self, cfg):
self._camera_keys_enabled = True
self._overlay_publisher = None
self._pose_started = False
+ self._marker_revision = -1
self._followers: dict[object, CameraFollower] = {}
"""Followers of the tracking cameras, by image view."""
self._rtx_pose_view = None
@@ -1839,6 +1840,7 @@ def _render_frame(self) -> None:
self._apply_view_pose(pose_view)
if self.current_image_view.camera is not None:
self._navigate_scene_camera()
+ self._refresh_rtx_markers()
self._refresh_paused_rtx_view(self._log_rtx_overlays())
self._log_streaming_image()
elif not viewer.is_paused():
@@ -1909,6 +1911,19 @@ def _log_rtx_overlays(self) -> bool:
publisher.publish(renderers)
return bool(dragging)
+ def _refresh_rtx_markers(self) -> None:
+ """Render the OVRTX cameras again when a marker group is shown, hidden, or moved, which OVRTX draws as prims."""
+ if not self.cfg.enable_markers:
+ return
+ revision = self._sim.vis_marker_registry.revision
+ if self._marker_revision == revision:
+ return
+ self._marker_revision = revision
+ for view in self._image_views:
+ if view.camera is not None:
+ view.camera._invalidate_buffers()
+ view.invalidate()
+
def _refresh_paused_rtx_view(self, arrows_changed: bool) -> None:
"""Render the OVRTX camera again while the simulation is paused, which does not render it by itself.
From 5343fd3b3b12d96faebacc39e2ad95d2428db3af Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 18 Nov 2026 01:06:00 +0000
Subject: [PATCH 042/140] Address review feedback on the RTX toggle: standalone
RTX controls, stale sky results, duplicate controls and predicates
---
source/isaaclab/isaaclab/utils/images.py | 2 +-
source/isaaclab_assets/docs/README.md | 1 -
source/isaaclab_contrib/docs/README.md | 61 ++++++++-----------
.../tacsl_sensor/visuotactile_sensor.py | 6 +-
.../test/sensors/test_visuotactile_sensor.py | 6 +-
.../test/physics/test_coupler.py | 16 ++---
.../joint_wrench/joint_wrench_sensor.py | 6 +-
.../isaaclab_ov/test/test_ovrtx_clone_plan.py | 6 +-
source/isaaclab_teleop/docs/README.md | 6 +-
.../newton/newton_rtx_appearance.py | 10 +--
.../newton/newton_visualizer.py | 45 +++++++-------
.../test/test_newton_overlay_meshes.py | 2 +-
.../test/test_newton_rtx_appearance.py | 17 +++++-
.../test/test_newton_task_views.py | 6 +-
14 files changed, 106 insertions(+), 84 deletions(-)
diff --git a/source/isaaclab/isaaclab/utils/images.py b/source/isaaclab/isaaclab/utils/images.py
index 693d98d1ce30..6d7a0afdf805 100644
--- a/source/isaaclab/isaaclab/utils/images.py
+++ b/source/isaaclab/isaaclab/utils/images.py
@@ -530,8 +530,8 @@ def make_camera_output_grid(images: torch.Tensor) -> torch.Tensor:
"rgb": (
"rgb",
"rgba",
- "albedo",
"simple_shading_full_mdl",
+ "albedo",
"simple_shading_diffuse_mdl",
"simple_shading_constant_diffuse",
),
diff --git a/source/isaaclab_assets/docs/README.md b/source/isaaclab_assets/docs/README.md
index 8d37a0dec6d5..8c3f292ae097 100644
--- a/source/isaaclab_assets/docs/README.md
+++ b/source/isaaclab_assets/docs/README.md
@@ -30,7 +30,6 @@ The recommended directory structure inside `data` is as follows:
You can use the following snippet to refer to the assets:
```python
-
from isaaclab_assets import ISAACLAB_ASSETS_DATA_DIR
diff --git a/source/isaaclab_contrib/docs/README.md b/source/isaaclab_contrib/docs/README.md
index d93823b0b37e..d0fb98e8a3cb 100644
--- a/source/isaaclab_contrib/docs/README.md
+++ b/source/isaaclab_contrib/docs/README.md
@@ -108,9 +108,9 @@ from isaaclab_contrib.actuators import ThrusterCfg
# Define thruster actuator configuration
thruster_cfg = ThrusterCfg(
thruster_names_expr=["rotor_[0-3]"], # Match rotors 0-3
- thrust_range=(0.0, 10.0), # Min and max thrust in Newtons
- rise_time_constant=0.12, # Time constant for thrust increase (120ms)
- fall_time_constant=0.25, # Time constant for thrust decrease (250ms)
+ thrust_range=(0.0, 10.0), # Min and max thrust in Newtons
+ rise_time_constant=0.12, # Time constant for thrust increase (120ms)
+ fall_time_constant=0.25, # Time constant for thrust decrease (250ms)
)
# Create multirotor configuration
@@ -120,19 +120,19 @@ multirotor_cfg = MultirotorCfg(
usd_path="path/to/quadcopter.usd",
),
init_state=MultirotorCfg.InitialStateCfg(
- pos=(0.0, 0.0, 1.0), # Start 1m above ground
- rps={".*": 110.0}, # All thrusters at 110 RPS (hover)
+ pos=(0.0, 0.0, 1.0), # Start 1m above ground
+ rps={".*": 110.0}, # All thrusters at 110 RPS (hover)
),
actuators={
"thrusters": thruster_cfg,
},
allocation_matrix=[ # 6x4 matrix for quadcopter
- [1.0, 1.0, 1.0, 1.0], # Total vertical thrust
- [0.0, 0.0, 0.0, 0.0], # Lateral force X
- [0.0, 0.0, 0.0, 0.0], # Lateral force Y
- [0.0, 0.13, 0.0, -0.13], # Roll torque
- [-0.13, 0.0, 0.13, 0.0], # Pitch torque
- [0.01, -0.01, 0.01, -0.01], # Yaw torque
+ [1.0, 1.0, 1.0, 1.0], # Total vertical thrust
+ [0.0, 0.0, 0.0, 0.0], # Lateral force X
+ [0.0, 0.0, 0.0, 0.0], # Lateral force Y
+ [0.0, 0.13, 0.0, -0.13], # Roll torque
+ [-0.13, 0.0, 0.13, 0.0], # Pitch torque
+ [0.01, -0.01, 0.01, -0.01], # Yaw torque
],
rotor_directions=[1, -1, 1, -1], # Alternating CW/CCW
)
@@ -145,6 +145,7 @@ from isaaclab.envs import ManagerBasedRLEnvCfg
from isaaclab.utils import configclass
from isaaclab_contrib.mdp.actions import ThrustActionCfg
+
@configclass
class QuadcopterEnvCfg(ManagerBasedRLEnvCfg):
# ... scene, observations, rewards, etc. ...
@@ -154,9 +155,9 @@ class QuadcopterEnvCfg(ManagerBasedRLEnvCfg):
# Normalized thrust control around hover
thrust = ThrustActionCfg(
asset_name="robot",
- scale=2.0, # Actions in [-1,1] become [-2,2] N deviation
- use_default_offset=True, # Add hover thrust from config
- clip={".*": (0.0, 10.0)}, # Constrain final thrust to [0, 10] N
+ scale=2.0, # Actions in [-1,1] become [-2,2] N deviation
+ use_default_offset=True, # Add hover thrust from config
+ clip={".*": (0.0, 10.0)}, # Constrain final thrust to [0, 10] N
)
actions = ActionsCfg()
@@ -267,26 +268,20 @@ tactile_sensor_cfg = VisuoTactileSensorCfg(
prim_path="{ENV_REGEX_NS}/Robot/elastomer/tactile_sensor",
history_length=0,
debug_vis=False,
-
# Sensor rendering configuration
render_cfg=GELSIGHT_R15_CFG, # Use GelSight R15 sensor parameters
-
# Enable RGB and/or force field sensing
- enable_camera_tactile=True, # RGB tactile images
- enable_force_field=True, # Force field data
-
+ enable_camera_tactile=True, # RGB tactile images
+ enable_force_field=True, # Force field data
# Elastomer configuration
- tactile_array_size=(20, 25), # 20×25 taxel array
- tactile_margin=0.003, # 3mm sensor margin
-
+ tactile_array_size=(20, 25), # 20×25 taxel array
+ tactile_margin=0.003, # 3mm sensor margin
# Contact object configuration
contact_object_prim_path_expr="{ENV_REGEX_NS}/contact_object",
-
# Force field physics parameters
- normal_contact_stiffness=1.0, # Normal stiffness (N/mm)
- friction_coefficient=2.0, # Surface friction
- tangential_stiffness=0.1, # Tangential stiffness
-
+ normal_contact_stiffness=1.0, # Normal stiffness (N/mm)
+ friction_coefficient=2.0, # Surface friction
+ tangential_stiffness=0.1, # Tangential stiffness
# Camera configuration (dimensions must match GELSIGHT_R15_CFG which provides the render_cfg)
camera_cfg=CameraCfg(
prim_path="{ENV_REGEX_NS}/Robot/elastomer_tip/cam",
@@ -308,12 +303,10 @@ robot_cfg = ArticulationCfg(
prim_path="{ENV_REGEX_NS}/Robot",
spawn=sim_utils.UsdFileWithCompliantContactCfg(
usd_path="path/to/gelsight_finger.usd",
-
# Compliant contact parameters for elastomer
- compliant_contact_stiffness=100.0, # Elastomer stiffness
- compliant_contact_damping=10.0, # Elastomer damping
+ compliant_contact_stiffness=100.0, # Elastomer stiffness
+ compliant_contact_damping=10.0, # Elastomer damping
physics_material_prim_path="elastomer", # Prim with compliant contact
-
rigid_props=PhysxRigidBodyCfg(
disable_gravity=True,
max_depenetration_velocity=5.0,
@@ -351,7 +344,7 @@ if tactile_data.tactile_rgb_image is not None:
# Force field data (if enabled)
if tactile_data.tactile_normal_force is not None:
normal_forces = tactile_data.tactile_normal_force # Shape: (num_envs * rows * cols,)
- shear_forces = tactile_data.tactile_shear_force # Shape: (num_envs * rows * cols, 2)
+ shear_forces = tactile_data.tactile_shear_force # Shape: (num_envs * rows * cols, 2)
# Reshape to tactile array dimensions
num_envs = scene.num_envs
@@ -438,8 +431,8 @@ sim_cfg = sim_utils.SimulationCfg(
Also ensure high solver iteration counts for the robot:
```python
-solver_position_iteration_count=12 # Higher = more accurate contact resolution
-solver_velocity_iteration_count=1
+solver_position_iteration_count = 12 # Higher = more accurate contact resolution
+solver_velocity_iteration_count = 1
```
### Performance Considerations
diff --git a/source/isaaclab_contrib/isaaclab_contrib/sensors/tacsl_sensor/visuotactile_sensor.py b/source/isaaclab_contrib/isaaclab_contrib/sensors/tacsl_sensor/visuotactile_sensor.py
index e66b53f78a3d..a19fb2fef70d 100644
--- a/source/isaaclab_contrib/isaaclab_contrib/sensors/tacsl_sensor/visuotactile_sensor.py
+++ b/source/isaaclab_contrib/isaaclab_contrib/sensors/tacsl_sensor/visuotactile_sensor.py
@@ -337,8 +337,10 @@ def _create_physx_views(self) -> None:
mesh, mesh_expr = sim_utils.resolve_matching_prims_from_source(
self.cfg.contact_object_prim_path_expr,
- predicate=lambda prim: prim.HasAPI(UsdPhysics.MeshCollisionAPI)
- and UsdPhysics.MeshCollisionAPI(prim).GetApproximationAttr().Get() == "sdf",
+ predicate=lambda prim: (
+ prim.HasAPI(UsdPhysics.MeshCollisionAPI)
+ and UsdPhysics.MeshCollisionAPI(prim).GetApproximationAttr().Get() == "sdf"
+ ),
expected_num_matches=1,
)[0]
diff --git a/source/isaaclab_contrib/test/sensors/test_visuotactile_sensor.py b/source/isaaclab_contrib/test/sensors/test_visuotactile_sensor.py
index a9aea859f160..4fea263347d8 100644
--- a/source/isaaclab_contrib/test/sensors/test_visuotactile_sensor.py
+++ b/source/isaaclab_contrib/test/sensors/test_visuotactile_sensor.py
@@ -405,8 +405,10 @@ def test_sensor_force_field_requires_one_contact_sdf(setup_nut_rgb_ff, contact_p
objects.append(instantiate(nut_cfg))
mesh = sim_utils.get_first_matching_child_prim(
contact_path,
- predicate=lambda prim: prim.HasAPI(UsdPhysics.MeshCollisionAPI)
- and UsdPhysics.MeshCollisionAPI(prim).GetApproximationAttr().Get() == "sdf",
+ predicate=lambda prim: (
+ prim.HasAPI(UsdPhysics.MeshCollisionAPI)
+ and UsdPhysics.MeshCollisionAPI(prim).GetApproximationAttr().Get() == "sdf"
+ ),
)
sim.stage.DefinePrim(str(mesh.GetPath()) + "Copy").GetReferences().AddInternalReference(mesh.GetPath())
with pytest.raises(RuntimeError, match=rf"Expected 1 prims.*found {sdf_count}\b"):
diff --git a/source/isaaclab_newton/test/physics/test_coupler.py b/source/isaaclab_newton/test/physics/test_coupler.py
index 4d16cbe6c6f4..eac59306e8ec 100644
--- a/source/isaaclab_newton/test/physics/test_coupler.py
+++ b/source/isaaclab_newton/test/physics/test_coupler.py
@@ -697,13 +697,15 @@ def coupled_entry(entry, mode, env_template, drivers):
monkeypatch.setattr(
coupler,
"_build_proxy_coupled_solver",
- lambda model, entries, proxies, cfg, mode: recorded_proxies.extend(proxies)
- or SimpleNamespace(
- kind="proxy",
- solver=lambda name: None,
- get_proxy_contacts=lambda source, destination: (
- None if case in {"destination_fallback", "destination_factory_fallback"} else object()
- ),
+ lambda model, entries, proxies, cfg, mode: (
+ recorded_proxies.extend(proxies)
+ or SimpleNamespace(
+ kind="proxy",
+ solver=lambda name: None,
+ get_proxy_contacts=lambda source, destination: (
+ None if case in {"destination_fallback", "destination_factory_fallback"} else object()
+ ),
+ )
),
)
driver = CouplerSolver(proxy_cfg, model, _NG, _CELL_TEMPLATE)
diff --git a/source/isaaclab_ov/isaaclab_ov/sensors/joint_wrench/joint_wrench_sensor.py b/source/isaaclab_ov/isaaclab_ov/sensors/joint_wrench/joint_wrench_sensor.py
index d0e115da9e6a..c8d13d205e1c 100644
--- a/source/isaaclab_ov/isaaclab_ov/sensors/joint_wrench/joint_wrench_sensor.py
+++ b/source/isaaclab_ov/isaaclab_ov/sensors/joint_wrench/joint_wrench_sensor.py
@@ -160,8 +160,10 @@ def _resolve_articulation_root_prim_path(self) -> str:
first_env_root_prims = get_all_matching_child_prims(
first_env_matching_prim_path,
- predicate=lambda prim: prim.HasAPI(UsdPhysics.ArticulationRootAPI)
- and prim.GetAttribute("physxArticulation:articulationEnabled").Get() is not False,
+ predicate=lambda prim: (
+ prim.HasAPI(UsdPhysics.ArticulationRootAPI)
+ and prim.GetAttribute("physxArticulation:articulationEnabled").Get() is not False
+ ),
traverse_instance_prims=False,
)
if len(first_env_root_prims) == 0:
diff --git a/source/isaaclab_ov/test/test_ovrtx_clone_plan.py b/source/isaaclab_ov/test/test_ovrtx_clone_plan.py
index a2db6fd845d0..6b1b0598674f 100644
--- a/source/isaaclab_ov/test/test_ovrtx_clone_plan.py
+++ b/source/isaaclab_ov/test/test_ovrtx_clone_plan.py
@@ -418,10 +418,8 @@ def _write_array_attribute(prim_paths: list[str], attribute_name: str, tensors:
renderer.backend.renderer.write_array_attribute = _write_array_attribute
renderer.backend.renderer.bind_attribute = lambda **_kwargs: SimpleNamespace(unbind=lambda: None)
- renderer.backend.renderer.write_attribute = (
- lambda prim_paths=None, attribute_name=None, *args, **kwargs: call_order.append("partitions")
- if attribute_name == "primvars:omni:scenePartition"
- else None
+ renderer.backend.renderer.write_attribute = lambda prim_paths=None, attribute_name=None, *args, **kwargs: (
+ call_order.append("partitions") if attribute_name == "primvars:omni:scenePartition" else None
)
renderer.prepare_stage(_make_multi_env_stage(num_envs), num_envs)
spec = _make_camera_render_spec(num_envs=1 if global_camera else num_envs)
diff --git a/source/isaaclab_teleop/docs/README.md b/source/isaaclab_teleop/docs/README.md
index 266f5470dda9..fb811af1ce39 100644
--- a/source/isaaclab_teleop/docs/README.md
+++ b/source/isaaclab_teleop/docs/README.md
@@ -45,6 +45,7 @@ from isaaclab_teleop import (
XrCfg,
)
+
@configclass
class MyEnvCfg(ManagerBasedRLEnvCfg):
def __post_init__(self):
@@ -77,10 +78,13 @@ Create a function that builds your Isaac Capture retargeting pipeline. The build
```python
from isaacteleop.retargeting_engine.deviceio_source_nodes import ControllersSource
from isaacteleop.retargeters import (
- GripperRetargeter, Se3AbsRetargeter, TensorReorderer,
+ GripperRetargeter,
+ Se3AbsRetargeter,
+ TensorReorderer,
)
from isaacteleop.retargeting_engine.interface import OutputCombiner
+
def my_pipeline_builder():
controllers = ControllersSource(name="controllers")
se3 = Se3AbsRetargeter(cfg, name="ee_pose")
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
index 1fe087626c34..06b383c1d94c 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
@@ -132,7 +132,7 @@ def __init__(
self.lights = find_scene_lights(stage)
self._dome_reference = self._sun_reference = None
self._texture_thread: threading.Thread | None = None
- self._texture_result: str | Exception | None = None
+ self._texture_result: tuple[str, str | Exception] | None = None
self.error = ""
self.reset_settings()
@@ -256,6 +256,7 @@ def set_dome_texture(self, source: str) -> None:
shows once :meth:`poll` reports that the file is ready.
"""
self.dome_texture = source
+ self._texture_result = None # a download that finished for an earlier choice must not be applied
if not source:
self._dome_texture_file, self.texture_status = "", ""
self._apply_texture()
@@ -269,16 +270,17 @@ def work() -> None:
logger.exception("[NewtonRtxAppearance] Could not load the sky texture %s.", source)
result = exc
if self.dome_texture == source: # A newer choice, a removal, or a reset supersedes this download.
- self._texture_result = result
+ self._texture_result = (source, result)
self._texture_thread = threading.Thread(target=work, name="rtx-sky-texture", daemon=True)
self._texture_thread.start()
def poll(self) -> bool:
"""Apply a sky texture that finished loading; returns whether the image changed."""
- result, self._texture_result = self._texture_result, None
- if result is None:
+ finished, self._texture_result = self._texture_result, None
+ if finished is None or finished[0] != self.dome_texture:
return False
+ result = finished[1]
if isinstance(result, Exception):
self.texture_status, self.dome_texture = f"Could not load the sky: {result}", ""
return False
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 85a436719e46..cf02b0a934d8 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -387,9 +387,11 @@ def _render_left_panel(_g=gui):
imgui.separator()
_c, viewer.vsync = imgui.checkbox("VSync", viewer.vsync)
if viewer._view_controls is not None:
+ # these controls draw the rendering callbacks in their Lighting & Appearance group
viewer._view_controls(imgui)
- for callback in _g._ui_callbacks.get("rendering", []):
- callback(imgui)
+ else:
+ for callback in _g._ui_callbacks.get("rendering", []):
+ callback(imgui)
# --- Controls ---------------------------------------------------
imgui.set_next_item_open(False, imgui.Cond_.appearing)
@@ -921,7 +923,7 @@ def _draw_streaming_view_controls(self, imgui) -> None:
else next(
i
for i in indices
- if self._image_views[i].camera is None and not self._is_task_view(self._image_views[i])
+ if self._image_views[i].camera is None and not self._is_tracking_view(self._image_views[i])
)
)
position = indices.index(current)
@@ -971,7 +973,10 @@ def _rtx_appearance_controller(self) -> RtxAppearance | None:
def _draw_appearance(self, imgui) -> None:
"""Draw the lighting and appearance options of the active renderer, right below the Camera Source selector."""
- if self.rtx_rendering:
+ rtx_rendering = getattr(self, "rtx_rendering", None)
+ if rtx_rendering is None: # the standalone RTX window has no OpenGL rendering callbacks or toggle
+ return
+ if rtx_rendering:
self._draw_rtx_appearance(imgui)
return
callbacks = self._viewer.gui._ui_callbacks.get("rendering") if self._viewer.gui is not None else None
@@ -1119,7 +1124,7 @@ def _source_rank(self, view) -> int:
"""Order the Camera Source list: the free Perspective, then Tracking Cameras, then scene sensors."""
if view.camera is not None:
return 2
- return 1 if self._is_task_view(view) else 0
+ return 1 if self._is_tracking_view(view) else 0
def _draw_sensor_controls(self, imgui, view) -> None:
"""Choose which channel of a sensor is shown, and which environment, or tile several environments."""
@@ -1205,7 +1210,7 @@ def _draw_focal_length(self, imgui) -> None:
rtx_view = self._image_views[rtx_index] if rtx_index is not None else None
if view.camera is not None and view is not rtx_view:
return
- task = self._is_task_view(view)
+ task = self._is_tracking_view(view)
source = view.cfg.source if task else self.cfg
changed, focal = imgui.slider_float("Focal Length", float(source.focal_length), 5.0, 64.0, "%.0f mm")
hover_tooltip(imgui, "Lens focal length of the camera; smaller values see a wider area")
@@ -1296,13 +1301,13 @@ def _reset_tracking_camera(self, follower: CameraFollower) -> bool:
def _view_labels(self, indices: list[int] | None = None) -> list[str]:
"""Name the listed image views: a task view is the Tracking Camera, a free view is the Perspective."""
views = self._image_views if indices is None else [self._image_views[i] for i in indices]
- free = [v for v in views if v.camera is None and not self._is_task_view(v)]
- tracking = [v for v in views if self._is_task_view(v)]
+ free = [v for v in views if v.camera is None and not self._is_tracking_view(v)]
+ tracking = [v for v in views if self._is_tracking_view(v)]
labels = []
for view in views:
if view.camera is not None:
labels.append(self._sensor_label(view.cfg.source, view.camera.cfg.data_types))
- elif self._is_task_view(view):
+ elif self._is_tracking_view(view):
labels.append(
"Tracking Camera" if len(tracking) == 1 else f"Tracking Camera {tracking.index(view) + 1}"
)
@@ -1338,11 +1343,6 @@ def _sensor_label(prim_path: str, data_types=()) -> str:
kind = " + ".join(outputs[:3]) + " " if outputs else ""
return f"{prim_path.rstrip('/').rsplit('/', 1)[-1]} ({kind}sensor)"
- @staticmethod
- def _is_task_view(view) -> bool:
- """Whether *view* is a perspective view tied to an environment or an asset."""
- return isinstance(view.cfg.source, TrackingCameraCfg)
-
def _pose_source_view(self):
"""Return the view whose camera settings are shown: the one driving the OVRTX camera, or the current view."""
if getattr(self, "rtx_rendering", False) and self._rtx_pose_view is not None:
@@ -1354,7 +1354,7 @@ def _choose_camera_source(self, index: int) -> None:
view = self._image_views[index]
if self.rtx_rendering and view.camera is None:
self._remember_perspective_pose()
- self._rtx_pose_view = view if self._is_task_view(view) else None
+ self._rtx_pose_view = view if self._is_tracking_view(view) else None
if self._rtx_pose_view is not None:
self._apply_view_pose(view)
else:
@@ -1368,8 +1368,8 @@ def _free_view_in_use(self):
view = self._pose_source_view()
if view is not None and view.camera is not None and getattr(self, "rtx_rendering", False):
# The OVRTX camera follows the free view when no Tracking Camera drives it.
- view = next((v for v in self._image_views if v.camera is None and not self._is_task_view(v)), None)
- if view is None or view.camera is not None or self._is_task_view(view):
+ view = next((v for v in self._image_views if v.camera is None and not self._is_tracking_view(v)), None)
+ if view is None or view.camera is not None or self._is_tracking_view(view):
return None
return view
@@ -1580,8 +1580,6 @@ def close(self) -> None:
if owned:
view.render = None
view.invalidate()
- self._followers.clear()
- self._tracking_defaults.clear()
super().close()
def set_camera_keys_enabled(self, enabled: bool) -> None:
@@ -1836,7 +1834,8 @@ def _render_frame(self) -> None:
try:
viewer.image_matches_camera = self.rtx_rendering
pose_view = self._pose_source_view()
- if self._is_task_view(pose_view) and not viewer.is_paused(): # a paused scene is frozen, so is its camera
+ # a paused scene is frozen, and so is its camera
+ if self._is_tracking_view(pose_view) and not viewer.is_paused():
self._apply_view_pose(pose_view)
if self.current_image_view.camera is not None:
self._navigate_scene_camera()
@@ -1996,11 +1995,13 @@ def set_rtx_rendering(self, enabled: bool) -> None:
rtx_index = self.rtx_view_index
if rtx_index is None:
raise RuntimeError("The scene has no OVRTX viewer camera; see NewtonGLBackendCfg.rtx_camera.")
- free = [i for i, view in enumerate(self._image_views) if view.camera is None and not self._is_task_view(view)]
+ free = [
+ i for i, view in enumerate(self._image_views) if view.camera is None and not self._is_tracking_view(view)
+ ]
if enabled:
# A Tracking Camera keeps moving the OVRTX camera, which has no pose of its own.
current = self.current_image_view
- self._rtx_pose_view = current if self._is_task_view(current) else None
+ self._rtx_pose_view = current if self._is_tracking_view(current) else None
self._select_camera(rtx_index, keep_pose=True)
else:
if self._overlay_publisher is not None:
diff --git a/source/isaaclab_visualizers/test/test_newton_overlay_meshes.py b/source/isaaclab_visualizers/test/test_newton_overlay_meshes.py
index 99eb8189f3f6..60a11e066e5e 100644
--- a/source/isaaclab_visualizers/test/test_newton_overlay_meshes.py
+++ b/source/isaaclab_visualizers/test/test_newton_overlay_meshes.py
@@ -16,7 +16,7 @@
segment_indices,
)
-pytestmark = [pytest.mark.unit]
+pytestmark = [pytest.mark.unit, pytest.mark.kitless]
class _Renderer:
diff --git a/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py b/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
index cc687d803c73..c9a71401062b 100644
--- a/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
+++ b/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
@@ -223,18 +223,33 @@ def retrieve(source):
appearance, _ = _appearance()
appearance.use_sky("https://assets/first.hdr")
assert first_started.wait(5)
+ first_download = appearance._texture_thread
appearance.use_sky("https://assets/second.hdr")
deadline = time.time() + 5
while not appearance.poll():
assert time.time() < deadline
time.sleep(0.01)
release_first.set()
- time.sleep(0.1)
+ first_download.join(5)
+ assert not first_download.is_alive()
assert appearance._dome_texture_file == "/cache/second.hdr"
assert appearance.poll() is False # The first download finished late and was dropped.
+def test_a_sky_download_that_finished_before_another_choice_is_not_applied(monkeypatch):
+ monkeypatch.setattr(module, "retrieve_file_path", lambda source: f"/cache/{source.rsplit('/', 1)[-1]}")
+ appearance, _ = _appearance()
+ appearance.use_sky("https://assets/first.hdr")
+ appearance._texture_thread.join(5)
+ assert appearance._texture_result is not None # finished, but not polled yet
+
+ appearance.use_sky("")
+
+ assert appearance.poll() is False
+ assert appearance._dome_texture_file == ""
+
+
def test_removing_the_sky_texture_restores_the_sky_blue_dome_without_a_download():
appearance, native = _appearance()
appearance.dome_enabled = True
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index 9a5517922e2f..8f92338521b5 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -19,6 +19,8 @@
from isaaclab.visualizers import PerspectiveCameraCfg, TrackingCameraCfg
from isaaclab.visualizers.camera_follower import CameraFollower
+pytestmark = pytest.mark.kitless
+
class _Camera:
"""The viewer camera: a position, a look-at target, angles, and a field of view."""
@@ -61,7 +63,7 @@ def set_camera(pos, pitch, yaw):
viz._viewer = SimpleNamespace(camera=camera, set_camera=set_camera)
viz._sim = SimpleNamespace(get_physics_step_count=lambda: 10, get_physics_dt=lambda: 0.1)
viz._image_views = list(views)
- viz._followers = {view: CameraFollower(view.cfg.source, _Scene()) for view in views if viz._is_task_view(view)}
+ viz._followers = {view: CameraFollower(view.cfg.source, _Scene()) for view in views if viz._is_tracking_view(view)}
viz.rtx_rendering, viz._rtx_pose_view, viz._perspective_poses = False, None, {}
return viz
@@ -71,7 +73,7 @@ def test_a_lone_free_view_is_called_perspective_and_a_task_view_the_tracking_cam
viz = _visualizer([free, task])
assert viz._view_labels([0, 1]) == ["Perspective", "Tracking Camera"]
- assert [viz._is_task_view(view) for view in viz._image_views] == [False, True]
+ assert [viz._is_tracking_view(view) for view in viz._image_views] == [False, True]
def test_views_are_numbered_only_when_several_share_a_name():
From 9a60f0ed841f775f79725f7d9738bf7b3f3bdfa5 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 18 Nov 2026 01:07:30 +0000
Subject: [PATCH 043/140] Correct the RTX overlay limitation in the
visualization docs
---
docs/source/concepts/visualization.rst | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index 0f430dd9ccb7..1c50a5ec3aaf 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -307,7 +307,8 @@ Visualizer Overview
staircase sub-terrain
Picking, visualization markers, camera selection, pause controls, Visible Envs, and headless recording work in
- the RTX view, and picking draws the drag arrow there. Model overlays apply to the OpenGL view only.
+ the RTX view, and picking draws the drag arrow there. Joint, contact, spring, center-of-mass, and inertia overlays are drawn in the RTX view too; the collision,
+ visual, edge, and wireframe overlays apply to the OpenGL view only.
.. warning::
@@ -1042,7 +1043,8 @@ Limitations
- ✗
- ✓
-In Newton's RTX view, model overlays are not available.
+In Newton's RTX view, the collision, visual, edge, and wireframe overlays are not available; joint, contact, spring,
+center-of-mass, and inertia overlays are.
**Lighting differences across visualizers**
From a3dabb8b264d8a437eb6357c03de04124068e442 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 18 Nov 2026 01:11:54 +0000
Subject: [PATCH 044/140] Restore files that formatting touched
---
source/isaaclab_assets/docs/README.md | 1 +
source/isaaclab_contrib/docs/README.md | 61 +++++++++++--------
.../tacsl_sensor/visuotactile_sensor.py | 6 +-
.../test/sensors/test_visuotactile_sensor.py | 6 +-
.../test/physics/test_coupler.py | 16 +++--
.../isaaclab_ov/test/test_ovrtx_clone_plan.py | 6 +-
source/isaaclab_teleop/docs/README.md | 6 +-
7 files changed, 51 insertions(+), 51 deletions(-)
diff --git a/source/isaaclab_assets/docs/README.md b/source/isaaclab_assets/docs/README.md
index 8c3f292ae097..8d37a0dec6d5 100644
--- a/source/isaaclab_assets/docs/README.md
+++ b/source/isaaclab_assets/docs/README.md
@@ -30,6 +30,7 @@ The recommended directory structure inside `data` is as follows:
You can use the following snippet to refer to the assets:
```python
+
from isaaclab_assets import ISAACLAB_ASSETS_DATA_DIR
diff --git a/source/isaaclab_contrib/docs/README.md b/source/isaaclab_contrib/docs/README.md
index d0fb98e8a3cb..d93823b0b37e 100644
--- a/source/isaaclab_contrib/docs/README.md
+++ b/source/isaaclab_contrib/docs/README.md
@@ -108,9 +108,9 @@ from isaaclab_contrib.actuators import ThrusterCfg
# Define thruster actuator configuration
thruster_cfg = ThrusterCfg(
thruster_names_expr=["rotor_[0-3]"], # Match rotors 0-3
- thrust_range=(0.0, 10.0), # Min and max thrust in Newtons
- rise_time_constant=0.12, # Time constant for thrust increase (120ms)
- fall_time_constant=0.25, # Time constant for thrust decrease (250ms)
+ thrust_range=(0.0, 10.0), # Min and max thrust in Newtons
+ rise_time_constant=0.12, # Time constant for thrust increase (120ms)
+ fall_time_constant=0.25, # Time constant for thrust decrease (250ms)
)
# Create multirotor configuration
@@ -120,19 +120,19 @@ multirotor_cfg = MultirotorCfg(
usd_path="path/to/quadcopter.usd",
),
init_state=MultirotorCfg.InitialStateCfg(
- pos=(0.0, 0.0, 1.0), # Start 1m above ground
- rps={".*": 110.0}, # All thrusters at 110 RPS (hover)
+ pos=(0.0, 0.0, 1.0), # Start 1m above ground
+ rps={".*": 110.0}, # All thrusters at 110 RPS (hover)
),
actuators={
"thrusters": thruster_cfg,
},
allocation_matrix=[ # 6x4 matrix for quadcopter
- [1.0, 1.0, 1.0, 1.0], # Total vertical thrust
- [0.0, 0.0, 0.0, 0.0], # Lateral force X
- [0.0, 0.0, 0.0, 0.0], # Lateral force Y
- [0.0, 0.13, 0.0, -0.13], # Roll torque
- [-0.13, 0.0, 0.13, 0.0], # Pitch torque
- [0.01, -0.01, 0.01, -0.01], # Yaw torque
+ [1.0, 1.0, 1.0, 1.0], # Total vertical thrust
+ [0.0, 0.0, 0.0, 0.0], # Lateral force X
+ [0.0, 0.0, 0.0, 0.0], # Lateral force Y
+ [0.0, 0.13, 0.0, -0.13], # Roll torque
+ [-0.13, 0.0, 0.13, 0.0], # Pitch torque
+ [0.01, -0.01, 0.01, -0.01], # Yaw torque
],
rotor_directions=[1, -1, 1, -1], # Alternating CW/CCW
)
@@ -145,7 +145,6 @@ from isaaclab.envs import ManagerBasedRLEnvCfg
from isaaclab.utils import configclass
from isaaclab_contrib.mdp.actions import ThrustActionCfg
-
@configclass
class QuadcopterEnvCfg(ManagerBasedRLEnvCfg):
# ... scene, observations, rewards, etc. ...
@@ -155,9 +154,9 @@ class QuadcopterEnvCfg(ManagerBasedRLEnvCfg):
# Normalized thrust control around hover
thrust = ThrustActionCfg(
asset_name="robot",
- scale=2.0, # Actions in [-1,1] become [-2,2] N deviation
- use_default_offset=True, # Add hover thrust from config
- clip={".*": (0.0, 10.0)}, # Constrain final thrust to [0, 10] N
+ scale=2.0, # Actions in [-1,1] become [-2,2] N deviation
+ use_default_offset=True, # Add hover thrust from config
+ clip={".*": (0.0, 10.0)}, # Constrain final thrust to [0, 10] N
)
actions = ActionsCfg()
@@ -268,20 +267,26 @@ tactile_sensor_cfg = VisuoTactileSensorCfg(
prim_path="{ENV_REGEX_NS}/Robot/elastomer/tactile_sensor",
history_length=0,
debug_vis=False,
+
# Sensor rendering configuration
render_cfg=GELSIGHT_R15_CFG, # Use GelSight R15 sensor parameters
+
# Enable RGB and/or force field sensing
- enable_camera_tactile=True, # RGB tactile images
- enable_force_field=True, # Force field data
+ enable_camera_tactile=True, # RGB tactile images
+ enable_force_field=True, # Force field data
+
# Elastomer configuration
- tactile_array_size=(20, 25), # 20×25 taxel array
- tactile_margin=0.003, # 3mm sensor margin
+ tactile_array_size=(20, 25), # 20×25 taxel array
+ tactile_margin=0.003, # 3mm sensor margin
+
# Contact object configuration
contact_object_prim_path_expr="{ENV_REGEX_NS}/contact_object",
+
# Force field physics parameters
- normal_contact_stiffness=1.0, # Normal stiffness (N/mm)
- friction_coefficient=2.0, # Surface friction
- tangential_stiffness=0.1, # Tangential stiffness
+ normal_contact_stiffness=1.0, # Normal stiffness (N/mm)
+ friction_coefficient=2.0, # Surface friction
+ tangential_stiffness=0.1, # Tangential stiffness
+
# Camera configuration (dimensions must match GELSIGHT_R15_CFG which provides the render_cfg)
camera_cfg=CameraCfg(
prim_path="{ENV_REGEX_NS}/Robot/elastomer_tip/cam",
@@ -303,10 +308,12 @@ robot_cfg = ArticulationCfg(
prim_path="{ENV_REGEX_NS}/Robot",
spawn=sim_utils.UsdFileWithCompliantContactCfg(
usd_path="path/to/gelsight_finger.usd",
+
# Compliant contact parameters for elastomer
- compliant_contact_stiffness=100.0, # Elastomer stiffness
- compliant_contact_damping=10.0, # Elastomer damping
+ compliant_contact_stiffness=100.0, # Elastomer stiffness
+ compliant_contact_damping=10.0, # Elastomer damping
physics_material_prim_path="elastomer", # Prim with compliant contact
+
rigid_props=PhysxRigidBodyCfg(
disable_gravity=True,
max_depenetration_velocity=5.0,
@@ -344,7 +351,7 @@ if tactile_data.tactile_rgb_image is not None:
# Force field data (if enabled)
if tactile_data.tactile_normal_force is not None:
normal_forces = tactile_data.tactile_normal_force # Shape: (num_envs * rows * cols,)
- shear_forces = tactile_data.tactile_shear_force # Shape: (num_envs * rows * cols, 2)
+ shear_forces = tactile_data.tactile_shear_force # Shape: (num_envs * rows * cols, 2)
# Reshape to tactile array dimensions
num_envs = scene.num_envs
@@ -431,8 +438,8 @@ sim_cfg = sim_utils.SimulationCfg(
Also ensure high solver iteration counts for the robot:
```python
-solver_position_iteration_count = 12 # Higher = more accurate contact resolution
-solver_velocity_iteration_count = 1
+solver_position_iteration_count=12 # Higher = more accurate contact resolution
+solver_velocity_iteration_count=1
```
### Performance Considerations
diff --git a/source/isaaclab_contrib/isaaclab_contrib/sensors/tacsl_sensor/visuotactile_sensor.py b/source/isaaclab_contrib/isaaclab_contrib/sensors/tacsl_sensor/visuotactile_sensor.py
index a19fb2fef70d..e66b53f78a3d 100644
--- a/source/isaaclab_contrib/isaaclab_contrib/sensors/tacsl_sensor/visuotactile_sensor.py
+++ b/source/isaaclab_contrib/isaaclab_contrib/sensors/tacsl_sensor/visuotactile_sensor.py
@@ -337,10 +337,8 @@ def _create_physx_views(self) -> None:
mesh, mesh_expr = sim_utils.resolve_matching_prims_from_source(
self.cfg.contact_object_prim_path_expr,
- predicate=lambda prim: (
- prim.HasAPI(UsdPhysics.MeshCollisionAPI)
- and UsdPhysics.MeshCollisionAPI(prim).GetApproximationAttr().Get() == "sdf"
- ),
+ predicate=lambda prim: prim.HasAPI(UsdPhysics.MeshCollisionAPI)
+ and UsdPhysics.MeshCollisionAPI(prim).GetApproximationAttr().Get() == "sdf",
expected_num_matches=1,
)[0]
diff --git a/source/isaaclab_contrib/test/sensors/test_visuotactile_sensor.py b/source/isaaclab_contrib/test/sensors/test_visuotactile_sensor.py
index 4fea263347d8..a9aea859f160 100644
--- a/source/isaaclab_contrib/test/sensors/test_visuotactile_sensor.py
+++ b/source/isaaclab_contrib/test/sensors/test_visuotactile_sensor.py
@@ -405,10 +405,8 @@ def test_sensor_force_field_requires_one_contact_sdf(setup_nut_rgb_ff, contact_p
objects.append(instantiate(nut_cfg))
mesh = sim_utils.get_first_matching_child_prim(
contact_path,
- predicate=lambda prim: (
- prim.HasAPI(UsdPhysics.MeshCollisionAPI)
- and UsdPhysics.MeshCollisionAPI(prim).GetApproximationAttr().Get() == "sdf"
- ),
+ predicate=lambda prim: prim.HasAPI(UsdPhysics.MeshCollisionAPI)
+ and UsdPhysics.MeshCollisionAPI(prim).GetApproximationAttr().Get() == "sdf",
)
sim.stage.DefinePrim(str(mesh.GetPath()) + "Copy").GetReferences().AddInternalReference(mesh.GetPath())
with pytest.raises(RuntimeError, match=rf"Expected 1 prims.*found {sdf_count}\b"):
diff --git a/source/isaaclab_newton/test/physics/test_coupler.py b/source/isaaclab_newton/test/physics/test_coupler.py
index eac59306e8ec..4d16cbe6c6f4 100644
--- a/source/isaaclab_newton/test/physics/test_coupler.py
+++ b/source/isaaclab_newton/test/physics/test_coupler.py
@@ -697,15 +697,13 @@ def coupled_entry(entry, mode, env_template, drivers):
monkeypatch.setattr(
coupler,
"_build_proxy_coupled_solver",
- lambda model, entries, proxies, cfg, mode: (
- recorded_proxies.extend(proxies)
- or SimpleNamespace(
- kind="proxy",
- solver=lambda name: None,
- get_proxy_contacts=lambda source, destination: (
- None if case in {"destination_fallback", "destination_factory_fallback"} else object()
- ),
- )
+ lambda model, entries, proxies, cfg, mode: recorded_proxies.extend(proxies)
+ or SimpleNamespace(
+ kind="proxy",
+ solver=lambda name: None,
+ get_proxy_contacts=lambda source, destination: (
+ None if case in {"destination_fallback", "destination_factory_fallback"} else object()
+ ),
),
)
driver = CouplerSolver(proxy_cfg, model, _NG, _CELL_TEMPLATE)
diff --git a/source/isaaclab_ov/test/test_ovrtx_clone_plan.py b/source/isaaclab_ov/test/test_ovrtx_clone_plan.py
index 6b1b0598674f..a2db6fd845d0 100644
--- a/source/isaaclab_ov/test/test_ovrtx_clone_plan.py
+++ b/source/isaaclab_ov/test/test_ovrtx_clone_plan.py
@@ -418,8 +418,10 @@ def _write_array_attribute(prim_paths: list[str], attribute_name: str, tensors:
renderer.backend.renderer.write_array_attribute = _write_array_attribute
renderer.backend.renderer.bind_attribute = lambda **_kwargs: SimpleNamespace(unbind=lambda: None)
- renderer.backend.renderer.write_attribute = lambda prim_paths=None, attribute_name=None, *args, **kwargs: (
- call_order.append("partitions") if attribute_name == "primvars:omni:scenePartition" else None
+ renderer.backend.renderer.write_attribute = (
+ lambda prim_paths=None, attribute_name=None, *args, **kwargs: call_order.append("partitions")
+ if attribute_name == "primvars:omni:scenePartition"
+ else None
)
renderer.prepare_stage(_make_multi_env_stage(num_envs), num_envs)
spec = _make_camera_render_spec(num_envs=1 if global_camera else num_envs)
diff --git a/source/isaaclab_teleop/docs/README.md b/source/isaaclab_teleop/docs/README.md
index fb811af1ce39..266f5470dda9 100644
--- a/source/isaaclab_teleop/docs/README.md
+++ b/source/isaaclab_teleop/docs/README.md
@@ -45,7 +45,6 @@ from isaaclab_teleop import (
XrCfg,
)
-
@configclass
class MyEnvCfg(ManagerBasedRLEnvCfg):
def __post_init__(self):
@@ -78,13 +77,10 @@ Create a function that builds your Isaac Capture retargeting pipeline. The build
```python
from isaacteleop.retargeting_engine.deviceio_source_nodes import ControllersSource
from isaacteleop.retargeters import (
- GripperRetargeter,
- Se3AbsRetargeter,
- TensorReorderer,
+ GripperRetargeter, Se3AbsRetargeter, TensorReorderer,
)
from isaacteleop.retargeting_engine.interface import OutputCombiner
-
def my_pipeline_builder():
controllers = ControllersSource(name="controllers")
se3 = Se3AbsRetargeter(cfg, name="ee_pose")
From 36809df805f65f8adb3684b2048746eb734f0291 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 18 Nov 2026 01:12:08 +0000
Subject: [PATCH 045/140] Restore a file that formatting touched
---
.../isaaclab_ov/sensors/joint_wrench/joint_wrench_sensor.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/source/isaaclab_ov/isaaclab_ov/sensors/joint_wrench/joint_wrench_sensor.py b/source/isaaclab_ov/isaaclab_ov/sensors/joint_wrench/joint_wrench_sensor.py
index c8d13d205e1c..d0e115da9e6a 100644
--- a/source/isaaclab_ov/isaaclab_ov/sensors/joint_wrench/joint_wrench_sensor.py
+++ b/source/isaaclab_ov/isaaclab_ov/sensors/joint_wrench/joint_wrench_sensor.py
@@ -160,10 +160,8 @@ def _resolve_articulation_root_prim_path(self) -> str:
first_env_root_prims = get_all_matching_child_prims(
first_env_matching_prim_path,
- predicate=lambda prim: (
- prim.HasAPI(UsdPhysics.ArticulationRootAPI)
- and prim.GetAttribute("physxArticulation:articulationEnabled").Get() is not False
- ),
+ predicate=lambda prim: prim.HasAPI(UsdPhysics.ArticulationRootAPI)
+ and prim.GetAttribute("physxArticulation:articulationEnabled").Get() is not False,
traverse_instance_prims=False,
)
if len(first_env_root_prims) == 0:
From 25d29f19d947522f257ef60f3a92f91d737cc566 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 18 Nov 2026 18:57:44 +0000
Subject: [PATCH 046/140] Fix the RTX viewer camera selection, visibility, and
paused overlay review findings
---
source/isaaclab/isaaclab/app/sim_launcher.py | 2 +
.../isaaclab/sim/simulation_context.py | 4 ++
.../contrib/franka_pour/pour_env_cfg.py | 7 ++++
.../ur10_particle_push_env_cfg.py | 6 +++
.../newton/newton_visualizer.py | 34 +++++++++++++----
.../newton/newton_visualizer_cfg.py | 3 ++
.../test/test_newton_adapter.py | 1 +
.../test/test_newton_task_views.py | 37 +++++++++++++++++++
8 files changed, 86 insertions(+), 8 deletions(-)
diff --git a/source/isaaclab/isaaclab/app/sim_launcher.py b/source/isaaclab/isaaclab/app/sim_launcher.py
index 07550657192e..3b56d252103e 100644
--- a/source/isaaclab/isaaclab/app/sim_launcher.py
+++ b/source/isaaclab/isaaclab/app/sim_launcher.py
@@ -204,6 +204,7 @@ def _declare_viewer_camera(
render_settings={"omni:rtx:quality": ("Int", 0), **visualizer.backend.rtx_render_settings},
) # fmt: skip
visualizer.streaming_view = True # The window lists scene cameras, including this one, as view sources.
+ visualizer.backend.rtx_camera_prim_path = f"/World/{name}"
return name, visualizer, *declared
@@ -452,6 +453,7 @@ def validate_launch( # noqa: C901
for name, visualizer, window_size, streaming_view in implicit_viewer_cameras:
vars(scene_cfg).pop(name, None)
visualizer.window.size, visualizer.streaming_view = window_size, streaming_view
+ visualizer.backend.rtx_camera_prim_path = None
configs = _walk_runtime_configs(cfg, replacements)
if kit_sources:
for node in configs:
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index 2798afae83f4..8ae781985c00 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -457,6 +457,10 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
# A sensor without the requested channels still shows its own, such as depth only.
if resolve_display_channels(visualizer.cfg.streaming_gt_types, camera.cfg.data_types):
cameras.append(camera)
+ rtx_path = getattr(visualizer.cfg.backend, "rtx_camera_prim_path", None)
+ if rtx_path is not None and not (visualizer.cfg.cameras is None or tracking_only):
+ # Explicit cameras skip discovery; the Renderer switch still needs this window's RTX camera.
+ cameras.append(SceneCameraCfg(prim_path=rtx_path))
for index, source in enumerate(cameras):
if not isinstance(source, SceneCameraCfg):
continue
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
index 10c7600fd777..0e655a72dc9e 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
@@ -21,6 +21,7 @@
from isaaclab_newton.sim.schemas import MujocoJointCfg, NewtonArticulationCfg
from isaaclab_newton.sim.spawners.mpm import MPMParticleMaterialCfg
from isaaclab_physx.sim.schemas import PhysxArticulationCfg
+from isaaclab_visualizers.kit import KitBackendCfg
import isaaclab.sim as sim_utils
from isaaclab.assets import AssetBaseCfg, RigidObjectCfg
@@ -40,6 +41,8 @@
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, ISAACLAB_NUCLEUS_DIR
from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab_tasks.utils.presets import MultiBackendVisualizerCfg
+
from isaaclab_assets.robots.franka import FRANKA_PANDA_CFG
from . import mdp
@@ -530,6 +533,9 @@ class FrankaPourResetDatasetEnvCfg(ManagerBasedRLEnvCfg):
scene: PourSceneCfg = PourSceneCfg(num_envs=2, env_spacing=2.5)
sim: sim_utils.SimulationCfg = sim_utils.SimulationCfg(
visualizer_cfgs=VisualizerCfg(
+ eye=(1.4, 1.4, 0.9),
+ lookat=(0.5, 0.0, 0.1),
+ backend=MultiBackendVisualizerCfg(kit=KitBackendCfg(origin_type="env", origin_env_index=0)),
cameras=[TrackingCameraCfg(eye=(1.4, 1.4, 0.9), lookat=(0.5, 0.0, 0.1))],
)
)
@@ -807,6 +813,7 @@ def play_mode(self) -> None:
"""Configure frozen single-world dataset playback."""
super().play_mode()
self.scene.num_envs = 1
+ self.sim.visualizer_cfgs.eye = (0.9, 0.65, 0.5)
self.sim.visualizer_cfgs.cameras[0].eye = (0.9, 0.65, 0.5)
self.curriculum_freeze = True
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
index 0de9b2b2dae8..6ba02a584c6c 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
@@ -18,6 +18,7 @@
from isaaclab_newton.physics.coupling import CouplerEntryCfg, CouplerProxyCfg, CouplerProxyMappingCfg
from isaaclab_newton.sim.schemas import MujocoJointCfg, NewtonCollisionCfg
from isaaclab_newton.sim.spawners.mpm import MPMGridCfg, MPMParticleMaterialCfg
+from isaaclab_visualizers.kit import KitBackendCfg
import isaaclab.sim as sim_utils
from isaaclab.assets import AssetBaseCfg, RigidObjectCfg
@@ -37,6 +38,8 @@
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab_tasks.utils.presets import MultiBackendVisualizerCfg
+
from isaaclab_assets.robots.universal_robots import UR10_CFG
from . import mdp
@@ -614,6 +617,9 @@ class UR10ParticlePushEnvCfg(ManagerBasedRLEnvCfg):
dt=1.0 / 120.0,
render_interval=decimation,
visualizer_cfgs=VisualizerCfg(
+ eye=(1.7, 1.5, 1.0),
+ lookat=(0.55, 0.0, 0.0),
+ backend=MultiBackendVisualizerCfg(kit=KitBackendCfg(origin_type="env", origin_env_index=0)),
cameras=[TrackingCameraCfg(eye=(1.7, 1.5, 1.0), lookat=(0.55, 0.0, 0.0))],
),
)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index cf02b0a934d8..9d7f430aacbf 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -744,6 +744,12 @@ class NewtonVisualizerBase(BaseVisualizer):
_overlay_publisher: OverlayMeshPublisher | None = None
_rtx_arrows_pending = False
+ _rtx_overlay_flags: tuple | None = None
+
+ # The OpenGL window overrides these; the standalone RTX window has no OpenGL view to switch to.
+ rtx_view_index: int | None = None
+ rtx_rendering: bool = False
+ sensor_view_selected: bool = False
def __init__(self, cfg):
super().__init__(cfg)
@@ -1786,7 +1792,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
if camera is not None and camera.num_instances > 1 and view is not self._rtx_view():
# Tile the first environments unless the view chose its own; the HUD changes how many.
self._sensor_tiles[view] = camera.num_instances
- if view.cfg.envs == (0,):
+ if self.cfg.view is None and view.cfg.envs == (0,):
view.cfg.envs = tuple(range(min(DEFAULT_TILED_ENVS, camera.num_instances)))
self._select_camera(0)
if self.cfg.enable_markers and self.rtx_view_index is not None:
@@ -1881,9 +1887,15 @@ def _log_rtx_overlays(self) -> bool:
for flag in ("show_joints", "show_contacts", "show_springs", "show_com", "show_inertia_boxes")
)
dragging = viewer.picking_enabled and viewer.picking is not None and viewer.picking.is_picking()
+ flags = tuple(
+ getattr(viewer, flag)
+ for flag in ("show_joints", "show_contacts", "show_springs", "show_com", "show_inertia_boxes")
+ )
+ changed = flags != self._rtx_overlay_flags # a paused view must render again to show the change
+ self._rtx_overlay_flags = flags
if not overlays and not dragging:
publisher.hide_all(renderers)
- return False
+ return changed
if viewer.is_paused():
return False
state = self._update_state()
@@ -1908,7 +1920,7 @@ def _log_rtx_overlays(self) -> bool:
viewer._overlay_capture = None
viewer.show_contact_disks = disks
publisher.publish(renderers)
- return bool(dragging)
+ return bool(dragging) or changed
def _refresh_rtx_markers(self) -> None:
"""Render the OVRTX cameras again when a marker group is shown, hidden, or moved, which OVRTX draws as prims."""
@@ -1959,10 +1971,12 @@ def _rtx_view(self):
@property
def rtx_view_index(self) -> int | None:
"""Index of the OVRTX viewer camera among the image views, or None when the scene has none."""
+ declared = getattr(getattr(getattr(self, "cfg", None), "backend", None), "rtx_camera_prim_path", None)
for index, view in enumerate(self._image_views):
- if view.camera is not None and getattr(view.camera.cfg, "prim_path", "").startswith(
- "/World/viewer_camera_"
- ):
+ if view.camera is None:
+ continue
+ prim_path = getattr(view.camera.cfg, "prim_path", "")
+ if prim_path == declared if declared is not None else prim_path.startswith("/World/viewer_camera_"):
return index
return None
@@ -2003,11 +2017,13 @@ def set_rtx_rendering(self, enabled: bool) -> None:
current = self.current_image_view
self._rtx_pose_view = current if self._is_tracking_view(current) else None
self._select_camera(rtx_index, keep_pose=True)
+ self._apply_rtx_visible_envs()
else:
if self._overlay_publisher is not None:
self._overlay_publisher.hide_all(self._rtx_renderers)
back = self._rtx_pose_view # _select_camera clears it after the outgoing pose is saved
self._select_camera(self._image_views.index(back) if back is not None else free[0], keep_pose=True)
+ self._apply_rtx_visible_envs() # restore every environment to the sensors that share the renderer
@property
def visible_env_limit(self) -> int:
@@ -2068,8 +2084,10 @@ def _apply_rtx_visible_envs(self) -> None:
renderer = self._sim.get_or_create_backend(self._image_views[index].camera.cfg.renderer_cfg)
num_envs = len(renderer._env_paths)
if num_envs:
- visible = np.ones(num_envs, dtype=bool) if self._env_ids is None else np.zeros(num_envs, dtype=bool)
- if self._env_ids is not None:
+ # The renderer is shared with scene cameras, so the limit applies only while the RTX view is shown.
+ limited = self._env_ids is not None and self.rtx_rendering
+ visible = np.zeros(num_envs, dtype=bool) if limited else np.ones(num_envs, dtype=bool)
+ if limited:
visible[np.asarray(list(self._env_ids), dtype=int)] = True
renderer.set_environment_visibility(visible)
self._image_views[index].invalidate()
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
index de3b509442b8..7b176655302f 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
@@ -90,6 +90,9 @@ class NewtonGLBackendCfg(VisualizerBackendCfg):
backend is not PhysX; ``False`` disables it.
"""
+ rtx_camera_prim_path: str | None = None
+ """Prim path of this window's OVRTX viewer camera. Set at launch when the camera is declared."""
+
rtx_renderer_cfg: OVRTXRendererCfg = OVRTXRendererCfg()
"""Renderer of the OVRTX viewer camera."""
diff --git a/source/isaaclab_visualizers/test/test_newton_adapter.py b/source/isaaclab_visualizers/test/test_newton_adapter.py
index ac0b39209fe4..32a4ecf213dc 100644
--- a/source/isaaclab_visualizers/test/test_newton_adapter.py
+++ b/source/isaaclab_visualizers/test/test_newton_adapter.py
@@ -1412,6 +1412,7 @@ def select(index, keep_pose=False):
visualizer._rtx_pose_view = None
visualizer._select_camera = select
+ visualizer._apply_rtx_visible_envs = lambda: None
visualizer.set_rtx_rendering(True)
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index 8f92338521b5..a7761ab26f25 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -172,6 +172,7 @@ def select(index, keep_pose=False):
viz.current_image_view = viz._image_views[index]
viz._select_camera = select
+ viz._apply_rtx_visible_envs = lambda: None
return viz
@@ -192,3 +193,39 @@ def test_rtx_rendering_needs_the_viewer_camera_declared_at_launch():
with pytest.raises(RuntimeError, match="no OVRTX viewer camera"):
viz.set_rtx_rendering(True)
+
+
+def test_each_window_selects_the_rtx_camera_declared_for_it():
+ cams = [
+ _View("a", camera=SimpleNamespace(cfg=SimpleNamespace(prim_path=f"/World/viewer_camera_{i}_rtx")))
+ for i in range(2)
+ ]
+ viz = _switchable([_view(PerspectiveCameraCfg()), *cams])
+ viz.cfg = SimpleNamespace(backend=SimpleNamespace(rtx_camera_prim_path="/World/viewer_camera_1_rtx"))
+
+ assert viz.rtx_view_index == 2
+
+
+def test_the_shared_renderer_hides_environments_only_while_the_rtx_view_is_shown():
+ calls = []
+ renderer = SimpleNamespace(
+ _env_paths=["a", "b", "c"], set_environment_visibility=lambda v: calls.append(v.tolist())
+ )
+ rtx = _rtx_view()
+ rtx.invalidate = lambda: None
+ viz = _switchable([_view(PerspectiveCameraCfg()), rtx])
+ viz._apply_rtx_visible_envs = NewtonGLVisualizer._apply_rtx_visible_envs.__get__(viz)
+ viz._sim.get_or_create_backend = lambda cfg: renderer
+ viz._env_ids = [0]
+
+ viz._apply_rtx_visible_envs() # OpenGL is shown, so the sensors keep every environment
+ viz.current_image_view = rtx
+ viz._apply_rtx_visible_envs()
+
+ assert calls == [[True, True, True], [True, False, False]]
+
+
+def test_the_standalone_rtx_window_has_no_opengl_view_state():
+ viz = NewtonVisualizerBase.__new__(NewtonVisualizerBase)
+
+ assert viz.rtx_view_index is None and not viz.rtx_rendering and not viz.sensor_view_selected
From db28da18e90578a4ae6ff8aaefced85d0ee9b13c Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 11 Nov 2026 21:05:24 +0000
Subject: [PATCH 047/140] Reorganize the Newton HUD and remove the Newton RTX
visualizer
---
docs/source/_static/css/demo-browser.js | 5 +-
docs/source/concepts/backends_and_presets.rst | 2 +-
.../concepts/reinforcement_learning.rst | 2 +-
docs/source/concepts/renderers.rst | 4 +-
docs/source/concepts/using_mpm.rst | 16 +-
docs/source/concepts/visualization.rst | 197 +++------
.../developer-tools/template_generator.rst | 4 +-
docs/source/features/isaac_teleop.rst | 6 +-
.../how-to/create_visualization_markers.rst | 2 +-
docs/source/how-to/import_new_asset.rst | 4 +-
docs/source/how-to/mpm_tutorials.rst | 8 +-
docs/source/how-to/multi_asset_spawning.rst | 2 +-
.../source/how-to/policy_inference_in_usd.rst | 8 +-
docs/source/how-to/record_video.rst | 44 +-
docs/source/how-to/run_rl_training.rst | 2 +-
docs/source/how-to/run_state_machines.rst | 4 +-
docs/source/how-to/solver_tuning_kamino.rst | 2 +-
.../visualizer_streaming_camera_view.rst | 76 ++--
docs/source/isaaclab/demos.rst | 42 +-
docs/source/isaaclab/installation.rst | 22 +-
docs/source/isaaclab/migrating.rst | 89 ++--
docs/source/isaaclab/quickstart.rst | 14 +-
...deploying_exported_policies_with_leapp.rst | 10 +-
.../exporting_policies_with_leapp.rst | 2 +-
examples/cables.py | 2 +-
examples/deformables.py | 2 +-
examples/demos/h1_locomotion.py | 4 +-
examples/demos/microduck_warehouse.py | 2 +-
.../demos/newton_viewer_block_and_tackle.py | 2 +-
examples/demos/nist.py | 5 +-
examples/demos/rizon_sharpa_coffee.py | 29 +-
examples/demos/snowball_smash.py | 4 +-
examples/demos/sonic.py | 4 +-
examples/demos/teapot_fill.py | 4 +-
examples/demos/zoo.py | 2 +-
examples/haply_teleoperation.py | 2 +-
examples/mpm/newton_mpm_granular.py | 4 +-
examples/mpm/newton_mpm_twoway_coupling.py | 4 +-
examples/multi_asset.py | 2 +-
examples/newton_viewer_dominoes.py | 2 +-
examples/sensors/contact_sensor.py | 2 +-
examples/sensors/multi_mesh_raycaster.py | 2 +-
examples/sensors/newton_raycast.py | 2 +-
examples/sharpa_rj45.py | 2 +-
examples/tablecloth.py | 2 +-
examples/visual_color_randomization.py | 14 +-
.../state_machine/lift_franka_soft.py | 2 +-
scripts/tools/convert_mjcf.py | 2 +-
scripts/tools/convert_urdf.py | 2 +-
.../run_tiled_camera_visualizer.py | 4 +-
.../07_visualizers/run_video_recording.py | 4 +-
.../08_mpm/surface_reconstruction.py | 30 +-
.../test/rendering/test_visualizers_rtx.py | 20 +-
.../newton-visualizer-name.changed.rst | 3 +
source/isaaclab/isaaclab/app/app_launcher.py | 4 -
source/isaaclab/isaaclab/app/sim_launcher.py | 90 +---
.../isaaclab/envs/mdp/visual_events.py | 2 +-
.../isaaclab/envs/utils/video_recorder.py | 6 +-
.../isaaclab/envs/utils/video_recorder_cfg.py | 31 +-
.../isaaclab/markers/visualization_markers.py | 2 +-
.../isaaclab/physics/physics_manager.py | 2 +-
source/isaaclab/isaaclab/program_browser.py | 2 +-
source/isaaclab/isaaclab/programs.py | 2 +-
.../scene_data/scene_data_provider.py | 2 -
.../isaaclab/sim/simulation_context.py | 10 +-
.../isaaclab/visualizers/base_visualizer.py | 4 +-
.../isaaclab/visualizers/visualizer_cfg.py | 33 +-
.../test/app/standalone_script_cases.py | 47 +--
.../app/test_launch_simulation_require_kit.py | 78 ++--
.../test/app/test_rtx_viewer_camera.py | 23 +-
.../test/app/test_standalone_scripts.py | 33 +-
.../test_installed_workflow_entrypoints.py | 8 +-
.../test/cli/test_teleop_entrypoints.py | 4 +-
.../test/envs/test_event_requirements.py | 2 +-
.../isaaclab/test/envs/test_video_recorder.py | 39 +-
.../markers/test_visualization_markers.py | 4 +-
.../test_simulation_context_visualizers.py | 32 +-
.../test/visualizers/test_visualizer.py | 5 +-
.../isaaclab_newton/physics/newton_manager.py | 2 +-
.../isaaclab_physx/app/kit_launcher.py | 6 +-
.../test/app/test_kit_launcher.py | 8 +-
.../changelog.d/hud-run-info.added.rst | 1 +
.../entrypoints/backends/play_rsl_rl.py | 2 +
.../entrypoints/backends/train_rsl_rl.py | 2 +
.../isaaclab_rl/entrypoints/common.py | 16 +-
.../test/test_apply_video_recording.py | 22 +-
.../newton-gl-alias-quiet.changed.rst | 2 +
.../contrib/gb300_sharpa_insertion/README.md | 2 +-
.../gb300_sharpa_insertion/visual_scene.py | 7 +-
.../contrib/rizon_sharpa_coffee/README.md | 16 +-
.../rizon_sharpa_coffee/demo_env_cfg.py | 13 +-
.../contrib/rizon_sharpa_coffee/rendering.py | 28 +-
.../isaaclab_tasks/utils/hydra.py | 45 +-
.../isaaclab_tasks/utils/presets.py | 9 +-
.../test/core/test_preset_cli.py | 2 +-
.../test_sim_launcher_visualizer_intent.py | 40 +-
.../test/core/test_video_recording.py | 8 +-
.../newton-camera-readout.changed.rst | 1 +
.../newton-gl-rtx-renderer-toggle.added.rst | 2 +-
.../changelog.d/newton-hud-layout.changed.rst | 33 ++
.../newton-rtx-visualizer-removed.removed.rst | 6 +
.../isaaclab_visualizers/newton/__init__.py | 25 +-
.../newton/newton_visualizer.py | 387 +++++++++++-------
.../newton/newton_visualizer_cfg.py | 63 +--
.../newton/particle_surface.py | 6 +-
.../test/test_newton_adapter.py | 45 +-
.../test_newton_visualizer_viewer_release.py | 72 +---
tools/docs/media/capture_quickstart.py | 10 +-
.../media/capture_reinforcement_learning.py | 6 +-
tools/docs/media/generate_quickstart.sh | 2 +-
.../media/generate_reinforcement_learning.sh | 2 +-
.../media/visualizers/capture_visualizer.py | 63 +--
112 files changed, 1051 insertions(+), 1100 deletions(-)
create mode 100644 source/isaaclab/changelog.d/newton-visualizer-name.changed.rst
create mode 100644 source/isaaclab_rl/changelog.d/hud-run-info.added.rst
create mode 100644 source/isaaclab_tasks/changelog.d/newton-gl-alias-quiet.changed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-camera-readout.changed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-hud-layout.changed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-rtx-visualizer-removed.removed.rst
diff --git a/docs/source/_static/css/demo-browser.js b/docs/source/_static/css/demo-browser.js
index f351f17c2004..e8bea6389197 100644
--- a/docs/source/_static/css/demo-browser.js
+++ b/docs/source/_static/css/demo-browser.js
@@ -51,9 +51,6 @@
if (fields.physics.value === "ovphysx") {
requiredExtras.add("ovphysx");
}
- if (fields.visualizer.value === "newton_rtx") {
- requiredExtras.add("ovrtx");
- }
if (["rerun", "viser"].includes(fields.visualizer.value)) {
requiredExtras.add(fields.visualizer.value);
}
@@ -86,7 +83,7 @@
const updateVisualizer = () => {
const preferredVisualizers = fields.physics.value.startsWith("newton")
- ? ["newton_gl", "kit"]
+ ? ["newton", "kit"]
: ["kit"];
populateSelect(fields.visualizer, compatibleVisualizers(), preferredVisualizers);
updateCommand();
diff --git a/docs/source/concepts/backends_and_presets.rst b/docs/source/concepts/backends_and_presets.rst
index 8ea93e2dfc08..7714b5809c0b 100644
--- a/docs/source/concepts/backends_and_presets.rst
+++ b/docs/source/concepts/backends_and_presets.rst
@@ -91,7 +91,7 @@ Choose a selector
- ``renderer=newton_renderer``
- Selects a renderer configuration for tasks that produce camera data.
* - ``visualizer=NAME[,NAME,...]``
- - ``visualizer=newton_gl``
+ - ``visualizer=newton``
- Selects interactive viewers; ``visualizer=none`` disables them.
* - ``presets=NAME[,NAME,...]``
- ``presets=rgb``
diff --git a/docs/source/concepts/reinforcement_learning.rst b/docs/source/concepts/reinforcement_learning.rst
index 51c444a644cc..317b78081c09 100644
--- a/docs/source/concepts/reinforcement_learning.rst
+++ b/docs/source/concepts/reinforcement_learning.rst
@@ -27,7 +27,7 @@ To evaluate the latest compatible checkpoint in the interactive visualizer:
.. code-block:: bash
uv run isaaclab play --rl_library rsl_rl --task Isaac-Cartpole \
- --checkpoint latest --num_envs 32 --viz newton_gl
+ --checkpoint latest --num_envs 32 --viz newton
The ``train`` and ``play`` commands work across the supported RL libraries.
diff --git a/docs/source/concepts/renderers.rst b/docs/source/concepts/renderers.rst
index 0f0f049f7106..32d07400c919 100644
--- a/docs/source/concepts/renderers.rst
+++ b/docs/source/concepts/renderers.rst
@@ -300,8 +300,8 @@ motion vectors, while Newton Warp does not. The :ref:`renderer visual comparison
.. note::
Visualization markers are debug overlays provided by visualizers, not camera outputs. Their
- support is independent of the camera renderer: the Kit, Newton GL, Rerun, and Viser visualizers
- support markers, while the experimental Newton RTX visualizer does not. See
+ support is independent of the camera renderer: the Kit, Newton, Rerun, and Viser visualizers
+ support markers, in both OpenGL and RTX rendering for Newton. See
:doc:`/source/concepts/visualization` for the visualizer support matrix.
.. note::
diff --git a/docs/source/concepts/using_mpm.rst b/docs/source/concepts/using_mpm.rst
index 4d3b52d3f222..628121dd75b8 100644
--- a/docs/source/concepts/using_mpm.rst
+++ b/docs/source/concepts/using_mpm.rst
@@ -16,7 +16,7 @@ Examples and tasks
------------------
These examples and demos introduce MPM construction and interaction. They
-default to Newton GL for interactive viewing. The launcher uses ``cuda:0`` by
+default to the Newton visualizer for interactive viewing. The launcher uses ``cuda:0`` by
default. Pass ``--device cuda:N`` to select a different GPU.
.. grid:: 1 1 2 2
@@ -310,23 +310,23 @@ material behavior. Run the teapot demo to compare the available modes:
# Reconstructed surface
uv run isaaclab demo teapot-fill \
- --visualizer newton_gl --fluid_render_mode surface
+ --visualizer newton --fluid_render_mode surface
# Surface and source particles together
uv run isaaclab demo teapot-fill \
- --visualizer newton_gl --fluid_render_mode both
+ --visualizer newton --fluid_render_mode both
-The teapot demo uses Newton GL and defaults to the reconstructed surface. Select
+The teapot demo uses the Newton visualizer and defaults to the reconstructed surface. Select
``particles`` or ``both`` to inspect the source MPM state. Its ``--visualizer`` / ``--viz``
-option accepts only ``newton_gl``; omit the option to use that default.
+option accepts only ``newton``; omit the option to use that default.
-For a path-traced surface, use the surface-reconstruction tutorial:
+For a path-traced surface, use the surface-reconstruction tutorial, which starts the Newton window in RTX:
.. code-block:: bash
uv run --extra ovrtx python scripts/tutorials/08_mpm/surface_reconstruction.py \
- --visualizer newton_rtx --fluid_render_mode surface
+ --visualizer newton --fluid_render_mode surface
-Surface rendering is available in the Kit, Newton GL, and Newton RTX visualizers.
+Surface rendering is available in the Kit and Newton visualizers, with OpenGL or RTX rendering in the latter.
.. raw:: html
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index 1c50a5ec3aaf..a9bc4effb40d 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -60,7 +60,7 @@ the end effector in Manual mode.
-
Newton GL
+
Newton (OpenGL)
@@ -105,7 +105,7 @@ the end effector in Manual mode.
});
-
Note: Newton RTX has no velocity arrows, since it doesn't yet support visualization markers.
+
Note: the Newton (RTX) clip was recorded without visualization markers, so it shows no velocity arrows.
Quick Start
@@ -120,8 +120,8 @@ alias.
.. code-block:: bash
- # Newton GL: lightweight OpenGL viewport
- uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz newton_gl
+ # Newton: lightweight OpenGL viewport, switchable to RTX rendering
+ uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz newton
# Viser: browser-based viewer
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz viser
@@ -130,7 +130,7 @@ alias.
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
+ uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz rerun,newton
.. note::
@@ -148,8 +148,8 @@ For combining visualizers, running headless, and other common use cases, see `Us
Visualizer presets
~~~~~~~~~~~~~~~~~~
-Task commands accept ``visualizer=newton_gl``, ``visualizer=kit``, or
-``visualizer=rerun,newton_gl``. ``--viz`` and ``--visualizer`` are aliases for the same
+Task commands accept ``visualizer=newton``, ``visualizer=kit``, or
+``visualizer=rerun,newton``. ``--viz`` and ``--visualizer`` are aliases for the same
selection. ``visualizer=none`` disables viewers. Selection happens during configuration
composition, before choosing process runtimes or creating the scene.
@@ -191,13 +191,13 @@ Compose standalone declarations during initial configuration, then call the core
...
One ``VisualizerCfg`` supplies the common settings for every selected backend. Selecting
-``rerun,newton_gl`` creates both viewers; no outer list or repeated common settings is needed.
+``rerun,newton`` creates both viewers; no outer list or repeated common settings is needed.
Backend-specific options are available when needed, but ordinary configuration uses the unchanged
``MultiBackendVisualizerCfg()`` declaration.
Use a list of ``VisualizerCfg`` declarations for different views or window sizes. Backend selection
applies to each declaration independently. For example, a task with these two views opens four
-windows with ``--viz=newton_gl,newton_rtx``: one GL and one RTX window per view.
+windows with ``--viz=newton,rerun``: one Newton and one Rerun window per view.
.. code-block:: python
@@ -217,13 +217,13 @@ Task entry points perform this selection through ``resolve_task_config``:
.. code-block:: bash
- uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole visualizer=rerun,newton_gl
+ uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole visualizer=rerun,newton
-``--viz rerun,newton_gl`` is equivalent. Task composition selects the backends inside
+``--viz rerun,newton`` is equivalent. Task composition selects the backends inside
``VisualizerCfg.backend`` before launch; launch creates each viewer with the shared settings.
Viewer implementations are imported only when constructed.
-For ``--video`` without a selected capture-capable viewer, launch selects a headless Newton GL
+For ``--video`` without a selected capture-capable viewer, launch selects a headless Newton
producer. ``visualizer=none`` disables windows; recording still runs its producer on demand.
Use ``--video sensor:`` to record a scene camera without a visualizer producer.
@@ -238,12 +238,10 @@ Visualizer Overview
* - Visualizer
- Description
- * - **Newton GL**
- - Lightweight, strong feature support; Recommended
+ * - **Newton**
+ - Lightweight, strong feature support, OpenGL or RTX rendering; Recommended
* - **Viser**
- Web-based, supports recording and replay; Recommended
- * - **Newton RTX**
- - High-quality RTX rendering; experimental, missing some features
* - **Rerun**
- Web-based, supports recording and replay; limited UI toggles
* - **Kit**
@@ -251,16 +249,17 @@ Visualizer Overview
.. tab-set::
- .. tab-item:: Newton GL
+ .. tab-item:: Newton
- The Newton GL visualizer is a lightweight OpenGL window with minimal startup overhead.
+ The Newton visualizer is a lightweight OpenGL window with minimal startup overhead. Its **Renderer**
+ selector switches the view to RTX (see below). ``newton_gl`` is an accepted alias of ``newton``.
.. raw:: html
-
Isaac-Reorient-Cube-Allegro in Newton GL Visualizer Each Allegro hand reorients
+
Isaac-Reorient-Cube-Allegro in Newton Visualizer Each Allegro hand reorients
its cube to match the target shown by the marker above it
.. raw:: html
@@ -294,9 +293,10 @@ Visualizer Overview
**RTX rendering**
- The **Renderer** selector in the Rendering Options section switches the main view to the OVRTX path tracer for
+ The **Renderer** selector in the Camera View section switches the main view to the OVRTX path tracer for
photorealistic rendering without a Kit process. It appears when the scene has the OVRTX viewer camera, which launch
- declares when ``ovrtx`` is installed and the physics is not PhysX. RTX rendering is slightly slower than OpenGL.
+ declares when ``ovrtx`` is installed and the physics is not PhysX. Set
+ ``NewtonGLBackendCfg(initial_renderer="rtx")`` to start in RTX. RTX rendering is slightly slower than OpenGL.
.. raw:: html
@@ -315,7 +315,7 @@ Visualizer Overview
OVRTX is a kitless renderer and cannot be used in the same process as Kit
(``presets=isaacsim_physx``). ``presets=ovphysx`` is itself kitless and works fine with
RTX rendering. Use ``presets=newton_mjwarp,ovrtx`` or ``presets=ovphysx,ovrtx`` with
- ``--viz newton_gl``, or switch to ``--viz viser``, ``--viz rerun``,
+ ``--viz newton``, or switch to ``--viz viser``, ``--viz rerun``,
or ``--viz kit`` with a Kit-compatible physics backend.
.. dropdown:: NewtonGLBackendCfg source
@@ -397,59 +397,6 @@ Visualizer Overview
:language: python
:pyobject: VisualizerCfg
- .. tab-item:: Newton RTX
-
- The **experimental** Newton RTX visualizer, launched with ``--viz newton_rtx``, uses the
- OVRTX path-tracer for photorealistic rendering without a Kit process. It is slightly
- slower than the Newton GL visualizer due to the cost of high-quality RTX rendering.
-
- .. raw:: html
-
-
-
-
-
Isaac-Velocity-Rough-H1 in Newton RTX Visualizer Each H1 humanoid climbs a
- staircase sub-terrain
-
- **Visualizer-specific features:**
-
- - OVRTX path-traced rendering for photorealistic, physically-based lighting
-
- .. note::
-
- The following features are not yet supported and will be added in a future release:
- live plots and rigid-body dragging. Visualization markers, camera selection, scene-camera
- display, pause controls, and headless recording are supported.
-
- .. dropdown:: NewtonRTXBackendCfg source
- :icon: code
-
- .. literalinclude:: ../../../source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
- :language: python
- :pyobject: NewtonRTXBackendCfg
-
- .. dropdown:: Shared window options
- :icon: code
-
- .. literalinclude:: ../../../source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
- :language: python
- :pyobject: WindowCfg
-
- .. dropdown:: VisualizerCfg source (shared settings)
- :icon: code
-
- .. literalinclude:: ../../../source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
- :language: python
- :pyobject: VisualizerCfg
-
- .. warning::
-
- Newton RTX (OVRTX) is a kitless renderer and cannot be used in the same process as Kit
- (``presets=isaacsim_physx``). ``presets=ovphysx`` is itself kitless and works fine with
- Newton RTX. Use ``presets=newton_mjwarp,ovrtx`` or ``presets=ovphysx,ovrtx`` with
- ``--viz newton_rtx``, or switch to ``--viz newton_gl``, ``--viz viser``, ``--viz rerun``,
- or ``--viz kit`` with a Kit-compatible physics backend.
-
.. tab-item:: Rerun
Like Viser, `Rerun `_ streams simulation state to a local web server, for
@@ -589,12 +536,11 @@ Multiple visualizers can display the same sensor with different tile selections.
Attach a camera to a robot body to follow its motion, or select an existing view such as the Galbot
-task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton GL, Newton RTX,
+task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton,
Rerun, and Viser visualizers. **Kit** opens it as a separate **Streaming View** viewport, which can
-sit side by side with the default viewport for dual monitoring. **Newton GL** and **Newton RTX**
-provide a **Camera View** selector in the sidebar for switching between perspective and scene-camera
-views. A perspective view can also be a *tracking camera* that follows a robot or frames an environment; only Newton GL
-supports it.
+sit side by side with the default viewport for dual monitoring. **Newton**
+provides a **Camera View** selector in the sidebar for switching between perspective and scene-camera
+views. A perspective view can also be a *tracking camera* that follows a robot or frames an environment.
Selecting a scene sensor in **Camera View** shows its channel: the **Channel** selector lists the
sensor's outputs (RGB, depth, normals, or segmentation), and depth, normals, and segmentation are
converted to colors for display. When the sensor is declared once per environment, **Tiled Envs**
@@ -636,7 +582,7 @@ There are 2 types of visualization markers:
- Goal shapes: cuboid, sphere, and multi-state position-goal markers
- Center of mass markers
-In the Newton GL visualizer's HUD, built-in marker types that aren't currently active are
+In the Newton visualizer's HUD, built-in marker types that aren't currently active are
shown greyed out.
**Custom Markers:**
@@ -649,7 +595,7 @@ shown greyed out.
.. note::
- Visualization markers are supported on Kit, Newton GL, Newton RTX, Rerun, and Viser.
+ Visualization markers are supported on Kit, Newton (OpenGL and RTX), Rerun, and Viser.
Live Plots
@@ -664,7 +610,7 @@ Live plots stream per-step scalar data into the visualizer.
-
Newton GL visualizer, with 3 plots opened
+
Newton visualizer, with 3 plots opened
@@ -675,8 +621,7 @@ Live plots stream per-step scalar data into the visualizer.
Live Plot windows start hidden or collapsed, except for Rerun, where the Live Plots can be
-collapsed by selecting the "eye" icon. Supported on Kit, Newton GL, Rerun, and Viser; not
-yet supported on Newton RTX (experimental).
+collapsed by selecting the "eye" icon. Supported on Kit, Newton, Rerun, and Viser.
**What's plotted:** per-episode total reward and episode length, plus any active manager
term for manager-based environments (e.g. ``joint_pos``).
@@ -718,20 +663,16 @@ visualizers open a window; a visualizer that only records runs headless:
- Records from
* - ``--video`` (same as ``--video viz``)
- the first capture-capable visualizer ``--viz`` selected, in its window; if none is selected, or only
- streaming ones such as ``viser`` or ``rerun``, a headless ``newton_gl``
- * - ``--video viz:newton_rtx``
- - a ``newton_rtx``: the ``--viz``-selected one if selected, else an extra headless one
- * - ``--video --viz newton_rtx``
- - the selected ``newton_rtx`` window
- * - ``--video viz:newton_gl --viz viser``
- - ``viser`` runs; an extra headless ``newton_gl`` is added only for recording
+ streaming ones such as ``viser`` or ``rerun``, a headless ``newton``
+ * - ``--video viz:newton --viz viser``
+ - ``viser`` runs; an extra headless ``newton`` is added only for recording
* - ``--video sensor:wrist_camera[:rgb|depth|...]``
- that scene sensor; no visualizer is added
A Hydra override after ``--video`` is never taken as its source: ``--video presets=newton_mjwarp``
records from ``viz`` and applies the preset.
-Kit, Newton GL, and Newton RTX visualizers can be recorded from; the web-based visualizers Viser and
+The Kit and Newton visualizers can be recorded from; the web-based visualizers Viser and
Rerun cannot.
See :doc:`/source/how-to/record_video` for the full guide and tutorial.
@@ -746,8 +687,7 @@ the keyboard. Each key press and release arrives as a W3C ``KeyboardEvent.code``
- :class:`~isaaclab_visualizers.kit.KitVisualizer` reports physical key positions, independent of
the keyboard layout. Keys typed into Kit's own UI, such as a text field, are reported too.
-- :class:`~isaaclab_visualizers.newton.NewtonGLVisualizer` and
- :class:`~isaaclab_visualizers.newton.NewtonRTXVisualizer` report layout-mapped keys: a code names
+- :class:`~isaaclab_visualizers.newton.NewtonGLVisualizer` reports layout-mapped keys: a code names
the key that types the same character on a US layout. Presses typed into the window's UI are
withheld. Presses and releases pair up reliably on a US layout; on other layouts, changing Shift
while holding a digit or punctuation key can leave it held until the window loses focus.
@@ -804,7 +744,7 @@ Common Recipes
**Headless training with video recording**
-Run without a window and record clips from a headless Newton GL visualizer, or name another
+Run without a window and record clips from a headless Newton visualizer, or name another
capture source, e.g. ``--video viz:kit``:
.. tab-set::
@@ -821,8 +761,8 @@ See :doc:`/source/how-to/record_video` for clip length, interval, and multi-sour
**Combining an interactive view with a headless recording source**
-Watch training live in Kit while recording from a separate headless Newton GL angle by running with
-``--viz kit --video viz:newton_gl`` and giving each visualizer its own camera. See
+Watch training live in Kit while recording from a separate headless Newton angle by running with
+``--viz kit --video viz:newton`` and giving each visualizer its own camera. See
:ref:`Recording from an independent camera angle ` for the configuration.
**Following a moving robot**
@@ -870,7 +810,7 @@ environments are drawn. It changes only what is rendered, not the simulation.
Resolution Rules
~~~~~~~~~~~~~~~~
-``--viz`` (comma-separated, e.g. ``--viz kit,newton_gl``) selects which visualizers run, and
+``--viz`` (comma-separated, e.g. ``--viz kit,newton``) selects which visualizers run, and
``SimulationCfg.visualizer_cfgs`` configures them. Each selected type uses its configured settings,
or else that type's default config. Concrete visualizer configs run as given when no CLI selection
is supplied. ``SimulationCfg.visualizer_cfgs`` defaults to ``VisualizerCfg(backend=[])``;
@@ -896,18 +836,18 @@ only needed for independently configured views, such as a different camera angle
* - no ``--viz``
- ``VisualizerCfg()`` (the default)
- No visualizer launches; no window, no capture source.
- * - ``--viz kit,newton_gl``
+ * - ``--viz kit,newton``
- ``VisualizerCfg(max_visible_envs=16)``
- - Launch Kit and Newton GL, both showing at most 16 environments.
+ - Launch Kit and Newton, both showing at most 16 environments.
* - ``--video`` without ``--viz``
- ``VisualizerCfg()``
- - Launch Newton GL without a window, only as the ``--video`` recording source.
+ - Launch Newton without a window, only as the ``--video`` recording source.
* - no ``--viz``
- ``VisualizerCfg(backend=MultiBackendVisualizerCfg())``
- No visualizer launches; backend alternatives remain inactive until selected.
- * - ``visualizer=rerun,newton_gl``
+ * - ``visualizer=rerun,newton``
- ``VisualizerCfg(max_visible_envs=16, backend=MultiBackendVisualizerCfg())``
- - Launch Rerun and Newton GL, both showing at most 16 environments.
+ - Launch Rerun and Newton, both showing at most 16 environments.
For migration context, see :doc:`/source/isaaclab/migrating`.
@@ -938,7 +878,7 @@ Also, there is a CLI arg ``--max_visible_envs`` that overrides ``VisualizerCfg.m
Scene Background
~~~~~~~~~~~~~~~~
-Kit and Newton RTX use the scene's authored lights and HDR background by default. Configure the
+Kit and the Newton visualizer in RTX mode use the scene's authored lights and HDR background by default. Configure the
environment once on the scene, without repeating its HDR path or intensity in the visualizer:
.. code-block:: python
@@ -948,7 +888,7 @@ environment once on the scene, without repeating its HDR path or intensity in th
``VisualizerCfg.background_color`` defaults to ``None``. An explicit normalized RGB color changes
only the visible background; the scene lights continue to illuminate objects and contribute
-reflections. Newton GL uses its procedural sky when no color override is supplied:
+reflections. The Newton OpenGL view uses its procedural sky when no color override is supplied:
.. code-block:: python
@@ -970,14 +910,11 @@ Performance
* - Visualizer
- Tips
- * - Newton GL
- - Lowest overhead; lower ``window.fps`` to limit wall-clock render frequency.
+ * - Newton
+ - Lowest overhead in OpenGL; lower ``window.fps`` to limit wall-clock render frequency.
* - Viser
- Newton Warp renderer; use ``max_visible_envs`` to limit the number of rendered
environments (see :ref:`visualization-partial-visualization`).
- * - Newton RTX
- - Native Newton RTX rendering; reduce configured perspective resolution or lower ``window.fps``.
- Environment selection limits sensor display tiles; the perspective view shows the full scene.
* - Rerun
- Web viewer may slow down with many environments; use ``--num_envs`` to reduce load.
* - Kit
@@ -991,12 +928,11 @@ Limitations
**Backend feature support:**
.. list-table::
- :widths: 34 11 11 12 11 11
+ :widths: 40 15 15 15 15
:header-rows: 1
* - Feature
- - Newton GL
- - Newton RTX
+ - Newton
- Viser
- Rerun
- Kit
@@ -1005,28 +941,23 @@ Limitations
- ✓
- ✓
- ✓
- - ✓
* - Live plots
- ✓
- - ✗
- ✓
- ✓
- ✓
* - Streaming camera panel
- ✓
- - ✗
- ✓
- ✓
- ✓
* - Video recording, ``--video``
- - ✓
- ✓
- ✗
- ✗
- ✓
* - Pause rendering
- ✓
- - ✗
- ✓
- ✓
- ✓
@@ -1035,12 +966,10 @@ Limitations
- ✓
- ✓
- ✓
- - ✓
* - Keyboard input, ``key_event_source``
- ✓
- ✓
- ✗
- - ✗
- ✓
In Newton's RTX view, the collision, visual, edge, and wireframe overlays are not available; joint, contact, spring,
@@ -1049,12 +978,12 @@ center-of-mass, and inertia overlays are.
**Lighting differences across visualizers**
Each backend lights the scene differently, so the same environment can look noticeably
-different across visualizers. Kit renders the scene's actual authored USD lights. Newton GL
+different across visualizers. Kit renders the scene's actual authored USD lights. The Newton OpenGL view
uses a fixed sky-gradient and single directional light color
(:attr:`~isaaclab_visualizers.newton.NewtonGLBackendCfg.sky_upper_color`,
-``sky_lower_color``, ``light_color``), independent of scene USD lights. Newton RTX renders the
+``sky_lower_color``, ``light_color``), independent of scene USD lights. The Newton RTX view renders the
authored scene through Isaac Lab's OVRTX renderer, shared with cameras using the same
-``OVRTXRendererCfg``. Newton GL displays the rendered GPU image and handles window controls;
+``OVRTXRendererCfg``. The Newton window displays the rendered GPU image and handles window controls;
Newton's ``ViewerRTX`` is not constructed. Scene transforms, deformable geometry, and material
updates follow the camera renderer's normal synchronization. Perspective resolution stays
fixed when the window is resized; the window scales the image for presentation.
@@ -1068,16 +997,16 @@ Rerun uses fixed built-in viewer shading with no scene-driven lighting.
**Kit: incompatible with ovphysx / ovrtx presets**
``--viz kit`` cannot be used with ``presets=ovphysx`` or ``presets=ovrtx`` in the same process.
-Use ``--viz newton_gl``, ``--viz rerun``, or ``--viz viser`` with those presets, or omit
+Use ``--viz newton``, ``--viz rerun``, or ``--viz viser`` with those presets, or omit
``--viz`` for headless execution.
-**Newton RTX: incompatible with Kit**
+**Newton RTX rendering: incompatible with Kit**
-``--viz newton_rtx`` raises a ``RuntimeError`` at startup if the active physics backend is
+Starting Newton in RTX (``initial_renderer="rtx"``) raises a ``RuntimeError`` at startup if the active physics backend is
``isaacsim_physx`` (i.e. ``presets=isaacsim_physx``), since OVRTX is a kitless renderer and cannot share
a process with Kit. ``presets=ovphysx`` is itself kitless and remains supported. Use
-``presets=newton_mjwarp,ovrtx`` or ``presets=ovphysx,ovrtx`` with ``--viz newton_rtx``, or switch
-to ``--viz newton_gl``, ``--viz viser``, ``--viz rerun``, or ``--viz kit`` with a Kit-compatible
+``presets=newton_mjwarp,ovrtx`` or ``presets=ovphysx,ovrtx`` with ``--viz newton``, or switch
+to ``--viz viser``, ``--viz rerun``, or ``--viz kit`` with a Kit-compatible
physics backend.
**Rerun: large environment performance**
@@ -1098,9 +1027,9 @@ The Rerun web viewer may slow down or crash with many environments. Reduce load
Rerun may show a blank browser tab for up to about 10 seconds while it connects
and receives scene data. Wait for the first frame; no action is needed.
-**Newton GL: CUDA/OpenGL interoperability warnings**
+**Newton: CUDA/OpenGL interoperability warnings**
-In some configurations, the Newton GL visualizer emits warnings about CUDA/OpenGL
+In some configurations, the Newton visualizer emits warnings about CUDA/OpenGL
interoperability:
.. code-block:: text
@@ -1112,12 +1041,12 @@ interoperability:
The visualizer still functions correctly but falls back to CPU copy operations, which reduces
performance.
-**Newton GL: OpenGL context failures**
+**Newton: OpenGL context failures**
If pyglet reports that ``glCreateShader`` is not exported or that OpenGL 2.0 is required, the
process is running without a GPU-backed display context (for example, in a service session or
a remote desktop without GPU acceleration). Run from a GPU-backed interactive display session,
-or omit ``--viz newton_gl`` for headless execution.
+or omit ``--viz newton`` for headless execution.
.. raw:: html
diff --git a/docs/source/developer-tools/template_generator.rst b/docs/source/developer-tools/template_generator.rst
index 23c56f6fb8ab..a855d2409792 100644
--- a/docs/source/developer-tools/template_generator.rst
+++ b/docs/source/developer-tools/template_generator.rst
@@ -246,7 +246,7 @@ Copy the task name from the output, then run a quick smoke test:
.. code-block:: bash
- uv run isaaclab random_agent --task --num_envs 16 --viz newton_gl
+ uv run isaaclab random_agent --task --num_envs 16 --viz newton
If the environment launches and the cart moves, the project is ready to edit.
You can then train and play a policy with the same command surface used by
@@ -255,7 +255,7 @@ Isaac Lab itself:
.. code-block:: bash
uv run isaaclab train --rl_library rsl_rl --task
- uv run isaaclab play --rl_library rsl_rl --task --checkpoint latest --viz newton_gl
+ uv run isaaclab play --rl_library rsl_rl --task --checkpoint latest --viz newton
Choose optional features and a simulation backend
-------------------------------------------------
diff --git a/docs/source/features/isaac_teleop.rst b/docs/source/features/isaac_teleop.rst
index 9299547c0ac8..a41057ba5425 100644
--- a/docs/source/features/isaac_teleop.rst
+++ b/docs/source/features/isaac_teleop.rst
@@ -797,8 +797,8 @@ For direct use of :func:`~isaaclab_teleop.create_isaac_teleop_device` or
window input explicitly. The session keeps this live sequence so later windows can join;
omitting it creates a session without window input. ``teleop_se3_agent.py`` and
``record_demos.py`` start Kit only when ``--xr`` or the task needs it, so
-``--viz newton_rtx`` works with a Newton-physics task, e.g.
-``--task Isaac-Reach-Franka --viz newton_rtx physics=newton_mjwarp presets=diffik``.
+``--viz newton`` works with a Newton-physics task, e.g.
+``--task Isaac-Reach-Franka --viz newton physics=newton_mjwarp presets=diffik``.
.. list-table::
:header-rows: 1
@@ -808,7 +808,7 @@ omitting it creates a session without window input. ``teleop_se3_agent.py`` and
- Keyboard input
* - ``--viz kit``
- Keys typed into the Kit window, including keys typed into Kit's own UI (e.g. a text field).
- * - ``--viz newton_gl`` / ``--viz newton_rtx``
+ * - ``--viz newton``
- Keys typed into the Newton viewer window, except keys typed into its UI. While a keyboard
pipeline runs, the viewer's WASD/QE and arrow-key camera movement is turned off; the mouse
still moves the camera.
diff --git a/docs/source/how-to/create_visualization_markers.rst b/docs/source/how-to/create_visualization_markers.rst
index 50193ede4796..db62a9731978 100644
--- a/docs/source/how-to/create_visualization_markers.rst
+++ b/docs/source/how-to/create_visualization_markers.rst
@@ -14,7 +14,7 @@ display-only: they carry no physics and do not affect the simulation.
For plain points, lines, and splines, Isaac Sim's own :mod:`isaacsim.util.debug_draw` extension
is lighter-weight. Use ``VisualizationMarkers`` when you need more complex shapes.
-Markers are supported on Kit, Newton GL, Rerun, and Viser, but not yet on Newton RTX. See
+Markers are supported on Kit, Newton (OpenGL and RTX), Rerun, and Viser. See
:doc:`/source/concepts/visualization` for how to enable them on a given visualizer.
diff --git a/docs/source/how-to/import_new_asset.rst b/docs/source/how-to/import_new_asset.rst
index 23db7240cb6b..7bdbde40e3dd 100644
--- a/docs/source/how-to/import_new_asset.rst
+++ b/docs/source/how-to/import_new_asset.rst
@@ -32,7 +32,7 @@ Standalone URDF/MJCF importers
The URDF and MJCF converter scripts run without Isaac Sim. The standalone
importers are optional; install them with the ``isaaclab[importers]`` command in
:ref:`installation-importers-extra` before running these scripts.
-Optionally pass ``--viz newton_gl`` (or ``rerun`` / ``viser``) to preview the converted asset in a
+Optionally pass ``--viz newton`` (or ``rerun`` / ``viser``) to preview the converted asset in a
kit-less Isaac Lab visualizer:
.. code-block:: bash
@@ -258,7 +258,7 @@ is derived automatically from the robot name in the URDF):
.. _import-new-asset-preview:
The examples pass ``--viz kit`` to open the converted asset in the Isaac Sim viewport, which
-requires a full Isaac Sim installation. Use ``--viz newton_gl``, ``--viz rerun``, or ``--viz viser``
+requires a full Isaac Sim installation. Use ``--viz newton``, ``--viz rerun``, or ``--viz viser``
for a kit-less preview instead. Omit ``--viz`` to exit as soon as the conversion completes.
Inspect the converted geometry and articulation in the viewer, then validate dynamics in the
diff --git a/docs/source/how-to/mpm_tutorials.rst b/docs/source/how-to/mpm_tutorials.rst
index 7cf96b854eaa..cc3f7e2ec19d 100644
--- a/docs/source/how-to/mpm_tutorials.rst
+++ b/docs/source/how-to/mpm_tutorials.rst
@@ -30,8 +30,8 @@ Running the tutorials
---------------------
The material and rigid-body tutorials launch Kit by default, requiring the
-``isaacsim`` extra. The surface-reconstruction tutorial launches Newton GL by
-default. Use ``--viz`` to select another visualizer; Newton RTX also requires
+``isaacsim`` extra. The surface-reconstruction tutorial launches Newton by
+default. Use ``--viz`` to select another visualizer; the Newton RTX view also requires
``uv run --extra ovrtx``.
@@ -172,7 +172,7 @@ for rendering, while leaving the particle simulation unchanged.
.. code-block:: bash
uv run python scripts/tutorials/08_mpm/surface_reconstruction.py \
- --surface_preset balanced --viz newton_gl
+ --surface_preset balanced --viz newton
Run the same scene again with another ``--surface_preset``:
@@ -205,7 +205,7 @@ receive the mesh for the current particle state. See
.. note::
- This tutorial selects Newton GL or Newton RTX for surface reconstruction.
+ This tutorial selects Newton, with OpenGL or RTX rendering, for surface reconstruction.
Select ``--fluid_render_mode particles`` for Kit, Viser, or Rerun.
The shared ``ParticleSurfaceRenderer`` also supports Kit; see the teapot
example in :ref:`newton-using-mpm`.
diff --git a/docs/source/how-to/multi_asset_spawning.rst b/docs/source/how-to/multi_asset_spawning.rst
index 1f1677c74c78..11b105dada31 100644
--- a/docs/source/how-to/multi_asset_spawning.rst
+++ b/docs/source/how-to/multi_asset_spawning.rst
@@ -142,7 +142,7 @@ The physics backend and visualizer are selected independently. Run one of these
uv run --extra isaacsim isaaclab example multi-asset \
--physics newton_mjwarp --visualizer kit --num_envs 2048
- .. tab-item:: Newton MJWarp with Newton GL
+ .. tab-item:: Newton MJWarp with Newton
.. code-block:: bash
diff --git a/docs/source/how-to/policy_inference_in_usd.rst b/docs/source/how-to/policy_inference_in_usd.rst
index b3f49c51d787..3dfab6851c5f 100644
--- a/docs/source/how-to/policy_inference_in_usd.rst
+++ b/docs/source/how-to/policy_inference_in_usd.rst
@@ -40,9 +40,9 @@ when ``--device cpu`` is explicitly selected.
The height scanner starts below the warehouse roof so its downward rays measure the floor.
Keep the same physics preset for training, export, and inference. The commands below use
-Newton MJWarp with the ``newton_gl`` visualizer and do not require Isaac Sim. For a PhysX
+Newton MJWarp with the ``newton`` visualizer and do not require Isaac Sim. For a PhysX
checkpoint trained with Isaac Sim, use ``physics=isaacsim_physx`` throughout and install Isaac Sim;
-the Newton GL viewer can still be used.
+the Newton viewer can still be used.
Cross-backend policy transfer needs additional validation; see
:doc:`transfer_policies_between_physx_and_newton`.
@@ -70,7 +70,7 @@ where you started the simulation.
.. code-block:: bash
- uv run isaaclab play --rl_library rsl_rl --task Isaac-Velocity-Rough-H1 physics=newton_mjwarp --num_envs 64 --checkpoint logs/rsl_rl/h1_rough/EXPERIMENT_NAME/POLICY_FILE.pt --viz newton_gl
+ uv run isaaclab play --rl_library rsl_rl --task Isaac-Velocity-Rough-H1 physics=newton_mjwarp --num_envs 64 --checkpoint logs/rsl_rl/h1_rough/EXPERIMENT_NAME/POLICY_FILE.pt --viz newton
After running the play script, the policy will be exported to jit and onnx files under the experiment logs directory.
@@ -87,7 +87,7 @@ We can then load the warehouse asset and run inference on the H1 robot using the
.. code-block:: bash
- uv run python scripts/tutorials/03_envs/policy_inference_in_usd.py --checkpoint logs/rsl_rl/h1_rough/EXPERIMENT_NAME/exported/policy.pt physics=newton_mjwarp --viz newton_gl
+ uv run python scripts/tutorials/03_envs/policy_inference_in_usd.py --checkpoint logs/rsl_rl/h1_rough/EXPERIMENT_NAME/exported/policy.pt physics=newton_mjwarp --viz newton
.. figure:: ../_static/tutorials/tutorial_policy_inference_in_usd.jpg
diff --git a/docs/source/how-to/record_video.rst b/docs/source/how-to/record_video.rst
index b875c2a294df..eef1267ca07f 100644
--- a/docs/source/how-to/record_video.rst
+++ b/docs/source/how-to/record_video.rst
@@ -160,7 +160,7 @@ Four independent clips are written to ``videos/recording_tutorial/example_3/``:
* ``kit_viewport_0000.mp4``: Kit interactive viewport (RTX renderer)
* ``tiled_kit_viewport_0000.mp4``: Kit tiled-camera grid (per-environment views)
-* ``newton_viewport_0000.mp4``: Newton GL viewer framebuffer
+* ``newton_viewport_0000.mp4``: Newton viewer framebuffer
* ``sensor_0000.mp4``: scene tiled-camera sensor (offline render)
.. raw:: html
@@ -172,7 +172,7 @@ Four independent clips are written to ``videos/recording_tutorial/example_3/``:
-
Newton GL visualizer
+
Newton visualizer
@@ -201,7 +201,7 @@ Record a short clip at regular intervals while training, without opening a windo
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --video \
--video_length 200 --video_interval 2000
-With no ``--viz``, ``--video`` records from a headless Newton GL visualizer. This writes a
+With no ``--viz``, ``--video`` records from a headless Newton visualizer. This writes a
200-step clip every 2,000 steps. The ``train`` and ``play`` entrypoints put clips in ``videos/``
under the run's log directory unless a recorder sets ``output_dir``; a script that builds its own
recorders writes to ``output_dir`` (default ``videos``). Add ``--viz kit`` to watch the run in a
@@ -231,7 +231,7 @@ recorded. Pair them with a capture-capable visualizer that runs headless next to
.. code-block:: bash
- uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz viser --video viz:newton_gl
+ uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz viser --video viz:newton
Alternatively, record directly from a scene camera with ``source="sensor:"``, which needs no
visualizer.
@@ -257,7 +257,7 @@ configure both; the recorder adds the Newton visualizer, headless:
VisualizerCfg(eye=(12.0, 0.0, 6.0), backend=NewtonGLBackendCfg()),
]
env_cfg.video_recorders = [
- VideoRecorderCfg(source="viz:newton_gl", output_dir="videos/"),
+ VideoRecorderCfg(source="viz:newton", output_dir="videos/"),
]
Alternatively, use a :class:`~isaaclab.sensors.CameraCfg` sensor in the scene and record
@@ -277,18 +277,16 @@ The ``source`` string selects what to capture:
* - Source string
- Captures from
* - ``"viz"`` (default)
- - First capture-capable visualizer ``--viz`` selected, else a headless Newton GL visualizer
+ - First capture-capable visualizer ``--viz`` selected, else a headless Newton visualizer
* - ``"viz:kit"``
- Kit visualizer viewport
* - ``"viz:kit:streaming_view"``
- Kit streaming camera panel, requires ``streaming_view=True``
- * - ``"viz:newton_gl"``
- - Newton GL visualizer viewport
- * - ``"viz:newton_rtx"``
- - Newton OVRTX path-traced viewport
- * - ``"viz:newton_gl:streaming_view"``
- - Newton GL streaming camera panel, requires ``streaming_view=True``
- * - ``"viz:newton_gl:tracking"``
+ * - ``"viz:newton"``
+ - Newton visualizer viewport, as rendered by OpenGL or RTX
+ * - ``"viz:newton:streaming_view"``
+ - Newton streaming camera panel, requires ``streaming_view=True``
+ * - ``"viz:newton:tracking"``
- First ``TrackingCameraCfg`` of the visualizer, whichever view the window shows; see :ref:`how-to-visualizer-tracking-cameras`
* - ``"sensor:"``
- ``env.scene.sensors[name]``, RGB (default)
@@ -306,13 +304,13 @@ visualizer config, not on the recorder. A ``viz:`` visualizer that ``--viz
headless, only for the recording, with the settings of its config in ``sim.visualizer_cfgs``.
``visualizer`` is accepted as the long form of the ``viz`` prefix (``"visualizer:kit"`` is ``"viz:kit"``). The
-deprecated ``newton`` type (``"viz:newton"``) still works with a warning; use ``newton_gl``. Bare visualizer
-types are accepted here too, e.g. ``VideoRecorderCfg(source="newton_gl")`` is equivalent to
-``VideoRecorderCfg(source="viz:newton_gl")``.
+deprecated ``newton`` type (``"viz:newton"``) still works with a warning; use ``newton``. Bare visualizer
+types are accepted here too, e.g. ``VideoRecorderCfg(source="newton")`` is equivalent to
+``VideoRecorderCfg(source="viz:newton")``.
.. note::
- The Newton RTX viewer framebuffer can be recorded with ``"viz:newton_rtx"``, but
+ The Newton viewport can be recorded with ``"viz:newton"`` while it renders with RTX, but
recording its streaming view is not supported.
@@ -368,7 +366,7 @@ Clip control
Limitations
-----------
-* ``source="viz:newton_gl:streaming_view"`` and ``source="viz:kit:streaming_view"``
+* ``source="viz:newton:streaming_view"`` and ``source="viz:kit:streaming_view"``
require ``streaming_view=True`` on the corresponding visualizer cfg. A
:class:`~RuntimeError` is raised when the recorder is constructed if it is not set.
@@ -385,22 +383,18 @@ Limitations
* - ``kit``
- ✓
- Launches Isaac Sim; the launch enables camera rendering for the recording.
- * - ``newton_gl``
+ * - ``newton``
- ✓
- Uses pyglet's EGL backend when headless; the default for ``--video`` without a
capture-capable ``--viz``.
- * - ``newton_rtx``
- - ✓
- - Starts the OVRTX runtime; capture performs a GPU-to-CPU readback of the path-traced
- framebuffer.
* - ``rerun``
- ✗
- Remote streaming tool; no local frame-capture API. ``viz:rerun`` is an error;
- ``--video --viz rerun`` records from a headless ``newton_gl``.
+ ``--video --viz rerun`` records from a headless ``newton``.
* - ``viser``
- ✗
- Browser streaming tool; no local frame-capture API. ``viz:viser`` is an error;
- ``--video --viz viser`` records from a headless ``newton_gl``.
+ ``--video --viz viser`` records from a headless ``newton``.
To record video while streaming with Rerun or Viser, see `Recording while streaming with Viser or
Rerun`_.
diff --git a/docs/source/how-to/run_rl_training.rst b/docs/source/how-to/run_rl_training.rst
index 9dc2a8a171ec..d16f09470648 100644
--- a/docs/source/how-to/run_rl_training.rst
+++ b/docs/source/how-to/run_rl_training.rst
@@ -86,7 +86,7 @@ Headless execution with off-screen render
"""""""""""""""""""""""""""""""""""""""""
To inspect behavior from a training run without an interactive window, pass ``--video``.
-By default, it records the scene from a headless Newton GL visualizer. See
+By default, it records the scene from a headless Newton visualizer. See
:doc:`/source/how-to/record_video` to choose a different visualizer or a camera-sensor output.
.. tab-set::
diff --git a/docs/source/how-to/run_state_machines.rst b/docs/source/how-to/run_state_machines.rst
index 50ab0056d32b..e7540f2f2a39 100644
--- a/docs/source/how-to/run_state_machines.rst
+++ b/docs/source/how-to/run_state_machines.rst
@@ -29,12 +29,12 @@ Lift a deformable object
------------------------
This example uses the Newton backend to grasp and lift a soft object. Pass
-``--viz newton_gl`` to open the Newton visualizer:
+``--viz newton`` to open the Newton visualizer:
.. code-block:: bash
uv run --extra tetrahedralization python scripts/environments/state_machine/lift_franka_soft.py \
- --num_envs 1 --viz newton_gl
+ --num_envs 1 --viz newton
Open a cabinet drawer
---------------------
diff --git a/docs/source/how-to/solver_tuning_kamino.rst b/docs/source/how-to/solver_tuning_kamino.rst
index 7e0e616fe3af..ba013a8db554 100644
--- a/docs/source/how-to/solver_tuning_kamino.rst
+++ b/docs/source/how-to/solver_tuning_kamino.rst
@@ -35,7 +35,7 @@ Run one small visual smoke test before training or benchmarking:
.. code-block:: bash
- uv run python scripts/environments/zero_agent.py --task Isaac-Cartpole-Direct --num_envs 4 --viz newton_gl physics=newton_kamino
+ uv run python scripts/environments/zero_agent.py --task Isaac-Cartpole-Direct --num_envs 4 --viz newton physics=newton_kamino
Then fix the initial state, seed, action sequence, and reset distribution. For
that reproduction, record penetration, slip, energy, a task metric, a
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index 5c27460c22ab..305da53c67aa 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -33,7 +33,7 @@ controls presentation independently through ``VisualizerCfg.window``. ``Visualiz
)
env_cfg.video_recorders = [VideoRecorderCfg(source=view, output_dir="videos")]
-Use ``--viz newton_gl`` (or ``--viz newton_rtx`` for the RTX example) to display the window.
+Use ``--viz newton`` to display the window.
Omit ``--viz`` for recording alone. The scene must declare ``front_camera`` with both requested outputs.
The view preserves environment order and native tile dimensions, placing channels beside each other.
``channels`` selects existing outputs; ``depth_range`` only maps depth values to display colors.
@@ -51,7 +51,7 @@ selection. Reading the shared view twice in one physics step reuses its frame an
Changing the view's selection rebuilds composition state; captured composition graphs must then be
recreated. This does not resize the sensor's render product.
-For Newton RTX, a perspective declaration is expanded into an ordinary scene camera before launch:
+A perspective declaration is displayed by the Newton window's own free camera:
.. code-block:: python
@@ -63,15 +63,15 @@ For Newton RTX, a perspective declaration is expanded into an ordinary scene cam
)
env_cfg.video_recorders = [VideoRecorderCfg(source=view)]
-Select ``visualizer=newton_rtx`` or ``visualizer=newton_gl`` at the task entry point.
-Newton RTX fixes perspective render resolution at the initial ``WindowCfg.size``; resizing the window
-scales its image. Newton GL perspective rendering follows its window framebuffer dimensions.
+Select ``visualizer=newton`` at the task entry point. With OpenGL rendering, perspective images follow the window
+framebuffer dimensions. With RTX rendering, they keep the initial ``WindowCfg.size`` and resizing the window
+scales the image.
The recorder reads the completed native render without requesting a second render for that step.
Perspective views currently provide one RGB image, so keep ``envs=(0,)`` and ``channels=("rgb",)``.
A recorded perspective view requires exactly one configured rendering visualizer. In headless runs,
the launcher retains that producer without opening a window; recording a sensor view needs no visualizer.
-``VisualizerCfg.view`` is supported by Newton GL and RTX. Existing ``cameras`` and
+``VisualizerCfg.view`` is supported by the Newton visualizer. Existing ``cameras`` and
``streaming_*`` configurations and CLI recording source strings remain supported; they are translated
at initialization. Use ``view`` instead of combining it with legacy camera selection fields.
@@ -123,12 +123,12 @@ Choose and control displayed views
the Viewport tabs; it can also be placed side by side with the default interactive viewport
for dual monitoring.
-**Newton GL and Newton RTX** have a **Camera View** selector in the sidebar. Selecting a scene camera displays
+The **Newton** visualizer has a **Camera View** selector in the sidebar. Selecting a scene camera displays
its tiled output in the main viewport instead of rendering a perspective view behind it.
-Selecting a perspective camera restores interactive scene rendering. Newton GL also restores picking.
+Selecting a perspective camera restores interactive scene rendering and picking.
A tracking camera is listed as **Tracking Camera**; see :ref:`how-to-visualizer-tracking-cameras`.
-Without an explicit ``cameras`` list, Newton GL starts in perspective and offers scene cameras
+Without an explicit ``cameras`` list, Newton starts in perspective and offers scene cameras
that provide every requested ``streaming_gt_types`` channel. An explicit
``streaming_sensor_prim_path`` starts with that scene camera selected. For example, set
``streaming_gt_types=("depth",)`` to offer depth-only cameras. The RGB view accepts RGB or RGBA
@@ -136,8 +136,10 @@ outputs; the display uses opaque alpha. No images are captured to
build the selector. Explicitly configured scene-camera choices must support the requested channels;
incompatible choices raise a configuration error during initialization, including inactive choices.
-Newton RTX displays only the sources declared in ``view`` or ``cameras``. With neither set, launch
-preparation declares one perspective camera. Scene sensors are never added to its selector automatically.
+A **Renderer** selector switches the main perspective view between OpenGL and RTX when the scene has the OVRTX
+viewer camera, which launch declares when ``ovrtx`` is installed and the physics is not PhysX. Set
+``NewtonGLBackendCfg.initial_renderer="rtx"`` to start in RTX. The RTX view follows the OpenGL camera pose and
+renders only while selected.
Use ``cameras`` to declare a list of selectable views; the first starts active:
@@ -158,23 +160,20 @@ Use ``cameras`` to declare a list of selectable views; the first starts active:
)
The ``cameras`` field is shared across visualizers. Kit, Rerun, and Viser use the first scene
-camera for their image panel; Newton GL and RTX provide the source dropdown shown above.
+camera for their image panel; Newton provides the source dropdown shown above.
``SceneCameraCfg`` selects an existing sensor; ``PerspectiveCameraCfg`` configures the viewer's
-interactive camera. For Newton RTX, ``launch_simulation(env_cfg, ...)`` adds a ``CameraCfg``
-to the scene before any scene objects are constructed and selects it through ``SceneCameraCfg``.
-Newton GL retains its native perspective camera. Newton RTX keeps its perspective
-render resolution fixed at the initial ``WindowCfg.size``; resizing
-its window scales the displayed image. Sensor resolution remains controlled by ``CameraCfg``.
-Window resizing does not reallocate sensor or RTX perspective image buffers. Newton GL perspective
-images follow its framebuffer dimensions.
+interactive camera. Newton retains its native perspective camera, and ``launch_simulation(env_cfg, ...)``
+adds the OVRTX viewer ``CameraCfg`` to the scene before any scene objects are constructed. The RTX view keeps
+its render resolution fixed at the initial ``WindowCfg.size``; resizing its window scales the displayed image.
+Sensor resolution remains controlled by ``CameraCfg``. Window resizing does not reallocate sensor or RTX
+perspective image buffers. OpenGL perspective images follow the framebuffer dimensions.
Newton windows present at up to ``WindowCfg.fps`` (30 by default), measured in wall-clock time.
Changing the simulation timestep does not change that limit. Headless on-demand capture is
independent of the window update rate; Kit uses its application's update cadence.
-Newton RTX displays ordinary camera output in a Newton GL window. Equal ``OVRTXRendererCfg``
-configurations share one renderer and its scene. ``NewtonRTXBackendCfg.renderer_cfg`` selects
-the renderer for generated perspective cameras; explicitly selected scene cameras retain their
-own renderer. Newton's ``ViewerRTX`` and its borrowed-stage interface are not used.
+The Newton window displays ordinary camera output, including RTX. Equal ``OVRTXRendererCfg``
+configurations share one renderer and its scene. ``NewtonGLBackendCfg.rtx_renderer_cfg`` selects
+the renderer of the viewer camera; explicitly selected scene cameras retain their own renderer. Newton's ``ViewerRTX`` and its borrowed-stage interface are not used.
``isaaclab_ov.stage.OvstageBackend`` remains available for downstream consumers that need an
independent native stage. Its ``populate(usda)`` method imports an exported USD scene and applies
the prepared clone operations.
@@ -197,7 +196,7 @@ spawning assets and cameras, including for a single environment:
from isaaclab.utils import instantiate
from isaaclab.visualizers import SceneCameraCfg, VisualizerCfg
from isaaclab_ov.renderers import OVRTXRendererCfg
- from isaaclab_visualizers.newton import NewtonRTXBackendCfg
+ from isaaclab_visualizers.newton import NewtonGLBackendCfg
camera_cfg = CameraCfg(
prim_path="/World/PerspectiveCamera", width=960, height=540,
@@ -206,15 +205,11 @@ spawning assets and cameras, including for a single environment:
render_settings={"omni:rtx:quality": ("Int", 0)},
)
sim_cfg = SimulationCfg(
- visualizer_cfgs=[
- VisualizerCfg(
- backend=NewtonRTXBackendCfg(), cameras=[SceneCameraCfg(prim_path=camera_cfg.prim_path)]
- )
- ]
+ visualizer_cfgs=[NewtonGLBackendCfg(cameras=[SceneCameraCfg(prim_path=camera_cfg.prim_path)])]
)
target_cfg = AssetBaseCfg(prim_path="/World/Target", spawn=CuboidCfg(size=(1.0, 1.0, 1.0)))
light_cfg = AssetBaseCfg(prim_path="/World/Light", spawn=DomeLightCfg(intensity=1000.0))
- with launch_simulation(sim_cfg, {"physics": "ovphysx", "visualizer": ["newton_rtx"]}):
+ with launch_simulation(sim_cfg, {"physics": "ovphysx", "visualizer": ["newton"]}):
sim = SimulationContext(sim_cfg)
with ReplicateSession((target_cfg, light_cfg, camera_cfg), num_clones=1, env_spacing=0.0):
instantiate(target_cfg)
@@ -229,8 +224,7 @@ The script retains the camera and advances its sensor timing, just as it does fo
spawned sensors. ``SceneCameraCfg`` discovers it by prim path without an ``InteractiveScene``.
Display layout and channel mappings are compiled when the source, selection, resolution, or
-color settings change. Composition writes into reusable device RGBA storage. Newton GL, Newton
-RTX, and Kit present CUDA images without downloading pixels. Recording through
+color settings change. Composition writes into reusable device RGBA storage. Newton and Kit present CUDA images without downloading pixels. Recording through
``render_tiled_rgb_array()`` and the Rerun/Viser transports explicitly read back the composed
image. The GPU API, ``render_tiled_rgba_array()``, returns borrowed storage that is reused on the next
composition; consumers must copy it if they need to retain a frame.
@@ -286,8 +280,8 @@ interactive camera stays free.
* **Newton GL:** **Camera View** lists the tracking camera as **Tracking Camera** beside **Perspective**. A
**Tracking Camera** group edits its environment, asset, body, eye, look-at, focal length and heading settings
while it runs; **Reset to Task Default** restores the declaration. Record it with
- ``--video viz:newton_gl:tracking``, whichever view the window shows.
-* **Kit**, **Newton RTX**, **Viser** and **Rerun** ignore tracking cameras.
+ ``--video viz:newton:tracking``, whichever view the window shows.
+* **Kit**, **Viser** and **Rerun** ignore tracking cameras.
Examples
@@ -350,7 +344,7 @@ Example 2: Streaming from Robot-Mounted Cameras
.. code-block:: bash
uv run --extra teleop python scripts/tutorials/07_visualizers/run_tiled_camera_visualizer.py \
- --task IsaacContrib-Stack-Cube-Galbot-Left-Arm-Gripper-Visuomotor --num_envs 25 --viz newton_gl
+ --task IsaacContrib-Stack-Cube-Galbot-Left-Arm-Gripper-Visuomotor --num_envs 25 --viz newton
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
@@ -358,7 +352,7 @@ Example 2: Streaming from Robot-Mounted Cameras
.. code-block:: batch
uv run --extra teleop python scripts/tutorials/07_visualizers/run_tiled_camera_visualizer.py ^
- --task IsaacContrib-Stack-Cube-Galbot-Left-Arm-Gripper-Visuomotor --num_envs 25 --viz newton_gl
+ --task IsaacContrib-Stack-Cube-Galbot-Left-Arm-Gripper-Visuomotor --num_envs 25 --viz newton
The Galbot cube-stacking environment ships with wrist-mounted cameras giving an egocentric
view of the gripper, table, and cubes. The script streams from the scene's first ``CameraCfg``,
@@ -385,10 +379,10 @@ Declare camera resolution, pose, renderer, and output types on ``CameraCfg`` in
Then choose what to display in ``VisualizerCfg``:
* ``cameras=[SceneCameraCfg(prim_path=...)]`` selects a scene camera; ``view=ImageViewCfg(source="name")``
- selects a named sensor and its image layout. Newton RTX uses these explicit declarations.
+ selects a named sensor and its image layout.
* For other viewers, ``streaming_sensor_prim_path`` selects a scene :class:`~isaaclab.sensors.Camera` by its configured
prim path. The ``{ENV_REGEX_NS}`` macro uses the scene's environment template.
- If omitted, Newton GL starts in perspective mode and offers compatible scene cameras
+ If omitted, Newton starts in perspective mode and offers compatible scene cameras
in the Camera View dropdown. Kit and web viewers select the first compatible scene camera;
without one, their panel stays empty.
* ``streaming_envs`` controls how many environment tiles are shown. Pass an ``int`` to randomly
@@ -407,7 +401,7 @@ Display sources
``VisualizerCfg.cameras`` accepts ``PerspectiveCameraCfg`` for the interactive view and
``SceneCameraCfg(prim_path=...)`` for a camera sensor already declared in the scene.
-Newton GL and RTX provide a source dropdown; Kit, Rerun, and Viser use the first scene source
+Newton provides a source dropdown; Kit, Rerun, and Viser use the first scene source
in their camera panel. Every explicit scene source must provide the requested
``streaming_gt_types`` channels.
@@ -415,8 +409,8 @@ in their camera panel. Every explicit scene source must provide the requested
Troubleshooting
---------------
-``--video viz:newton_gl:streaming_view`` records the selected scene-camera tiles, not a network
-stream. Without ``--viz``, capture runs on demand without opening a window. Adding ``--viz newton_gl``
+``--video viz:newton:streaming_view`` records the selected scene-camera tiles, not a network
+stream. Without ``--viz``, capture runs on demand without opening a window. Adding ``--viz newton``
displays the visualizer; it is not required to advance recorded frames. A new physics step refreshes
the image, while repeated captures within the same step reuse it.
diff --git a/docs/source/isaaclab/demos.rst b/docs/source/isaaclab/demos.rst
index bffa294dad45..f9b7fcff2cf9 100644
--- a/docs/source/isaaclab/demos.rst
+++ b/docs/source/isaaclab/demos.rst
@@ -46,9 +46,9 @@ No source checkout is required.
+.. _visualization-newton-recording:
+
+Newton Window Recording
+~~~~~~~~~~~~~~~~~~~~~~~
+
+The **Recording** section of the Newton visualizer saves three things: an ``mp4`` video of the window, a ``.png``
+screenshot of the window without the HUD, and a ``.pt`` checkpoint of the policy being played. Files go to the output
+folder set by :class:`~isaaclab_visualizers.newton.NewtonRecordingCfg`.
+
.. _record_video_cli:
Pass ``--video [SOURCE]`` on the command line for a quick recording, or define multiple
diff --git a/source/isaaclab_rl/changelog.d/recording-checkpoint-saver.added.rst b/source/isaaclab_rl/changelog.d/recording-checkpoint-saver.added.rst
new file mode 100644
index 000000000000..bc821bc42126
--- /dev/null
+++ b/source/isaaclab_rl/changelog.d/recording-checkpoint-saver.added.rst
@@ -0,0 +1,2 @@
+* Added ``offer_checkpoint_saver`` to the RSL-RL play and train entrypoints so the Newton GL HUD's Checkpoint button
+ saves the policy of the run.
diff --git a/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/play_rsl_rl.py b/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/play_rsl_rl.py
index f84087b0f1ae..e27b5d03bc96 100644
--- a/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/play_rsl_rl.py
+++ b/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/play_rsl_rl.py
@@ -11,6 +11,7 @@
import contextlib
import logging
import os
+import shutil
from rsl_rl.runners import DistillationRunner, OnPolicyRunner
@@ -36,6 +37,7 @@
describe_run,
enable_cameras_for_video,
normalize_task_name,
+ offer_checkpoint_saver,
pre_launch_video_config,
resolve_checkpoint_selector,
resolve_published_checkpoint,
@@ -147,6 +149,7 @@ def run(argv: list[str]) -> None:
if args_cli.deterministic:
configure_seed(env_cfg.seed, torch_deterministic=True)
runner.load(resume_path)
+ offer_checkpoint_saver(env, lambda path: shutil.copy2(resume_path, path))
policy = runner.get_inference_policy(device=env.unwrapped.device)
export_model_dir = os.path.join(log_dir, "exported")
diff --git a/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/train_rsl_rl.py b/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/train_rsl_rl.py
index 9fdf33ad287d..423b50bcba8b 100644
--- a/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/train_rsl_rl.py
+++ b/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/train_rsl_rl.py
@@ -39,6 +39,7 @@
describe_run,
dump_train_configs,
enable_cameras_for_video,
+ offer_checkpoint_saver,
pre_launch_video_config,
resolve_checkpoint_selector,
scoped_torch_backend_flags,
@@ -196,6 +197,7 @@ def _run(args_cli: argparse.Namespace) -> None:
map_location=agent_cfg.device,
)
dump_train_configs(rank_dir, env_cfg, agent_cfg)
+ offer_checkpoint_saver(env, runner.save)
if agent_cfg.logger == "wandb":
announce_new_run(agent_cfg.wandb_project, resolve_wandb_entity())
diff --git a/source/isaaclab_rl/isaaclab_rl/entrypoints/common.py b/source/isaaclab_rl/isaaclab_rl/entrypoints/common.py
index 4336811c89bd..136e1f2dc8f4 100644
--- a/source/isaaclab_rl/isaaclab_rl/entrypoints/common.py
+++ b/source/isaaclab_rl/isaaclab_rl/entrypoints/common.py
@@ -555,6 +555,18 @@ def describe_run(env: gym.Env, task: str, mode: str, log_dir: str | None) -> Non
visualizer.set_run_info(task, mode, os.path.basename(log_dir) if log_dir else None)
+def offer_checkpoint_saver(env: gym.Env, save: Callable[[str], None]) -> None:
+ """Enable the Checkpoint button in the HUD of every visualizer that has one.
+
+ Args:
+ env: Environment, possibly wrapped, whose simulation owns the visualizers.
+ save: Callable that writes the run's policy checkpoint to the given path.
+ """
+ for visualizer in env.unwrapped.sim.visualizers:
+ if hasattr(visualizer, "attach_checkpoint_saver"):
+ visualizer.attach_checkpoint_saver(save)
+
+
def close_env(env: gym.Env) -> None:
"""Close the outermost environment wrapper; another SIGINT forces exit.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-gl-recording-section.added.rst b/source/isaaclab_visualizers/changelog.d/newton-gl-recording-section.added.rst
new file mode 100644
index 000000000000..6346dc6e3589
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-gl-recording-section.added.rst
@@ -0,0 +1,5 @@
+* Added a Recording section to the Newton GL HUD that records the window to an ``mp4`` video and the policy being played
+ or trained to a ``.pt`` checkpoint. A video stays in a temporary file when stopped and is kept with Save.
+* Added :class:`~isaaclab_visualizers.newton.NewtonRecordingCfg` (``NewtonGLBackendCfg.recording``) with the
+ output folder, file prefix, auto-numbering, and timestamp options shared by all recordings, plus the video frame
+ rate and a video length after which recording stops by itself.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-recording-hud.changed.rst b/source/isaaclab_visualizers/changelog.d/newton-recording-hud.changed.rst
new file mode 100644
index 000000000000..0a42fdbf8b48
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-recording-hud.changed.rst
@@ -0,0 +1,4 @@
+* Moved the recording status text out of the HUD header into the Recording section: a red REC line with the elapsed
+ time, an unsaved-video note, and a green confirmation after saving. The section title turns red while recording.
+* The default recording output folder is now ``recording`` in the working directory, which Git ignores. A relative
+ recording output folder lands in the repository when running from a source checkout.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-screenshot.added.rst b/source/isaaclab_visualizers/changelog.d/newton-screenshot.added.rst
new file mode 100644
index 000000000000..fe7a665eec61
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-screenshot.added.rst
@@ -0,0 +1,2 @@
+* Added a Screenshot (``.png``) button to the Recording section of the Newton visualizer that saves the current
+ window frame without the HUD.
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/__init__.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/__init__.py
index 41674bc65102..495af7067a4a 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/__init__.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/__init__.py
@@ -13,7 +13,12 @@
from typing import TYPE_CHECKING
-from .newton_visualizer_cfg import NewtonGLBackendCfg, NewtonGLVisualizerCfg, NewtonVisualizerCfg
+from .newton_visualizer_cfg import (
+ NewtonGLBackendCfg,
+ NewtonGLVisualizerCfg,
+ NewtonRecordingCfg,
+ NewtonVisualizerCfg,
+)
if TYPE_CHECKING:
from .newton_visualizer import NewtonGLVisualizer
@@ -26,6 +31,7 @@
# GL backend
"NewtonGLVisualizer",
"NewtonGLBackendCfg",
+ "NewtonRecordingCfg",
# MPM particle-surface rendering
"ParticleSurfaceRenderer",
]
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
new file mode 100644
index 000000000000..92ea13e485b5
--- /dev/null
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
@@ -0,0 +1,383 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Recording section of the Newton GL HUD: video, screenshots, and policy checkpoints."""
+
+from __future__ import annotations
+
+import contextlib
+import logging
+import os
+import re
+import shutil
+import subprocess
+from collections.abc import Callable
+from datetime import datetime
+from pathlib import Path
+from typing import TYPE_CHECKING, Any
+
+import numpy as np
+
+from isaaclab.paths import ISAACLAB_ROOT
+
+if TYPE_CHECKING:
+ from .newton_visualizer import NewtonGLVisualizer
+
+logger = logging.getLogger(__name__)
+
+
+def resolve_output_dir(path: str) -> Path:
+ """Return the absolute recording folder for ``path``.
+
+ A relative path lands in the repository when running from a source checkout, wherever the run was started, and
+ in the working directory otherwise, such as with an installed wheel.
+ """
+ folder = Path(path).expanduser()
+ if folder.is_absolute():
+ return folder
+ return (ISAACLAB_ROOT if (ISAACLAB_ROOT / "source").is_dir() else Path.cwd()) / folder
+
+
+def hover_tooltip(imgui: Any, text: str) -> None:
+ """Show ``text`` while the last item is hovered, including when it is disabled."""
+ if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
+ imgui.set_tooltip(text)
+
+
+_RED = (1.0, 0.35, 0.35, 1.0)
+_YELLOW = (1.0, 0.8, 0.2, 1.0)
+_GREEN = (0.45, 0.9, 0.5, 1.0)
+
+
+def _ffmpeg_executable() -> str | None:
+ """Return an ffmpeg binary, preferring the one bundled with ``imageio-ffmpeg`` (the ``video`` extra)."""
+ try:
+ import imageio_ffmpeg # noqa: PLC0415
+
+ return imageio_ffmpeg.get_ffmpeg_exe()
+ except Exception:
+ return shutil.which("ffmpeg")
+
+
+class NewtonRecordingPanel:
+ """Records the Newton GL window while the HUD asks for it.
+
+ * **Video** streams the displayed frames (OpenGL or RTX) to an ``mp4`` through ffmpeg, like ``--video``.
+ * **Checkpoint** saves the policy being played or trained to a ``.pt`` file with one button press.
+ """
+
+ def __init__(self, owner: NewtonGLVisualizer):
+ """Create the panel.
+
+ Args:
+ owner: Visualizer whose window and simulation state are recorded.
+ """
+ self._owner = owner
+ cfg = owner.cfg.backend.recording
+ self.output_dir = cfg.output_dir
+ self.filename_prefix = cfg.filename_prefix
+ self.auto_increment = cfg.auto_increment
+ self.timestamp = cfg.timestamp
+ self.video_fps = cfg.video_fps or 0
+ """Encoded frame rate [Hz]; ``0`` follows the window update rate."""
+ self.video_length = cfg.video_length or 0.0
+ """Video duration [s] after which recording stops by itself; ``0`` records until stopped."""
+ self.video_path = self.checkpoint_path = ""
+ """Files written by the latest recording of each kind."""
+ self._video_rate = 0
+ self._video_limit: int | None = None
+ self._checkpoint_saver: Callable[[str], None] | None = None
+ self._video_temp: Path | None = None
+ self._video_unsaved: Path | None = None
+ """Finished clip that stays in a temporary file until :meth:`save_video` keeps it."""
+ self._video: subprocess.Popen | None = None
+ self._video_frames = 0
+ self._video_shape: tuple[int, int] | None = None
+ self.screenshot_path = ""
+ """File written by the latest screenshot."""
+ self._screenshot_pending = False
+ self._message = ""
+
+ @property
+ def recording_video(self) -> bool:
+ """Whether video frames are being written."""
+ return self._video is not None
+
+ @property
+ def unsaved_video(self) -> bool:
+ """Whether a stopped video is waiting for :meth:`save_video`."""
+ return self._video_unsaved is not None
+
+ def draw(self, imgui: Any) -> None:
+ """Draw the Recording section."""
+ imgui.set_next_item_open(False, imgui.Cond_.appearing)
+ active = self.recording_video
+ if active: # Keep the state visible when the section is collapsed.
+ imgui.push_style_color(imgui.Col_.text, imgui.ImVec4(*_RED))
+ expanded = imgui.collapsing_header("Recording (REC)###recording" if active else "Recording###recording")
+ if active:
+ imgui.pop_style_color()
+ hover_tooltip(
+ imgui,
+ "Record a video, take a screenshot, or save a policy checkpoint",
+ )
+ if not expanded:
+ return
+ imgui.separator()
+ self._draw_video(imgui)
+ self._draw_screenshot(imgui)
+ self._draw_checkpoint(imgui)
+ self._draw_output(imgui)
+ self._draw_message(imgui)
+
+ def _draw_video(self, imgui: Any) -> None:
+ """Draw the video group: Start, Stop, Save, and status."""
+ imgui.text("Video (.mp4)")
+ if self.recording_video:
+ if imgui.button("Stop##video"):
+ self.stop_video()
+ hover_tooltip(imgui, "Stop recording. Press Save to keep the video")
+ else:
+ if imgui.button("Start##video"):
+ self.start_video()
+ if imgui.is_item_hovered():
+ imgui.set_tooltip("Record the window like --video; needs ffmpeg. Starting replaces an unsaved video.")
+ imgui.same_line()
+ saveable = self.unsaved_video # Saving clears it mid-frame, so the disabled scope must not re-read it.
+ if not saveable:
+ imgui.begin_disabled()
+ if imgui.button("Save##video"):
+ self.save_video()
+ if not saveable:
+ imgui.end_disabled()
+ if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
+ imgui.set_tooltip("Keep the stopped video in the output folder")
+ elapsed = f"{self._video_frames / max(self._video_rate, 1):.2f} s ({self._video_frames} frames)"
+ if self.recording_video:
+ imgui.text_colored(imgui.ImVec4(*_RED), f"REC {elapsed}")
+ elif self.unsaved_video:
+ imgui.text_colored(imgui.ImVec4(*_YELLOW), f"Unsaved {elapsed}")
+ imgui.separator()
+
+ def _draw_screenshot(self, imgui: Any) -> None:
+ """Draw the screenshot group."""
+ imgui.text("Screenshot (.png)")
+ if imgui.button("Capture##screenshot"):
+ self.request_screenshot()
+ hover_tooltip(imgui, "Save the window image without the panels to the output folder")
+ imgui.separator()
+
+ def _draw_checkpoint(self, imgui: Any) -> None:
+ """Draw the policy checkpoint group."""
+ imgui.text("Checkpoint (.pt)")
+ available = self._checkpoint_saver is not None
+ if not available:
+ imgui.begin_disabled()
+ if imgui.button("Save##checkpoint"):
+ self.save_checkpoint()
+ if not available:
+ imgui.end_disabled()
+ if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
+ imgui.set_tooltip(
+ "Save the policy being played or trained to the output folder"
+ if available
+ else "Not available in this run: it has no policy to save"
+ )
+ imgui.separator()
+
+ def _draw_output(self, imgui: Any) -> None:
+ """Draw the output folder, file prefix, and numbering options."""
+ imgui.text("Output")
+ _c, self.output_dir = imgui.input_text("Folder##recording", self.output_dir)
+ if imgui.is_item_hovered():
+ imgui.set_tooltip(
+ f"Root folder, currently {resolve_output_dir(self.output_dir)}."
+ " Files go to /video, /screenshot, and /checkpoint"
+ )
+ _c, self.filename_prefix = imgui.input_text("Prefix##recording", self.filename_prefix)
+ _c, self.auto_increment = imgui.checkbox("Auto-number", self.auto_increment)
+ if imgui.is_item_hovered():
+ imgui.set_tooltip("Add _0001, _0002, ... so a new recording never overwrites an earlier one")
+ imgui.same_line()
+ _c, self.timestamp = imgui.checkbox("Timestamp", self.timestamp)
+ if imgui.is_item_hovered():
+ imgui.set_tooltip("Add the start date and time to the file name")
+ imgui.separator()
+
+ def _draw_message(self, imgui: Any) -> None:
+ """Draw the latest result message, green when saved and red when something failed."""
+ if self._message:
+ imgui.separator()
+ failed = any(word in self._message for word in ("failed", "Could not", "needs ffmpeg", "no policy"))
+ color = _GREEN if self._message.startswith("Saved") else _RED if failed else None
+ if color is None:
+ imgui.text_wrapped(self._message)
+ else:
+ imgui.push_style_color(imgui.Col_.text, imgui.ImVec4(*color))
+ imgui.text_wrapped(self._message)
+ imgui.pop_style_color()
+
+ def _output_path(self, kind: str, suffix: str) -> Path:
+ """Return the next file of ``kind`` from the output settings, creating its folder."""
+ folder = resolve_output_dir(self.output_dir) / kind
+ folder.mkdir(parents=True, exist_ok=True)
+ name = self.filename_prefix or "newton"
+ if self.timestamp:
+ name = f"{name}_{datetime.now():%Y%m%d-%H%M%S}"
+ if not self.auto_increment:
+ return folder / f"{name}{suffix}"
+ pattern = re.compile(rf"^{re.escape(name)}_(\d+){re.escape(suffix)}$")
+ indices = [int(match.group(1)) for file in folder.iterdir() if (match := pattern.match(file.name))]
+ return folder / f"{name}_{max(indices, default=0) + 1:04d}{suffix}"
+
+ # ------------------------------------------------------------------
+ # Video
+ # ------------------------------------------------------------------
+
+ def start_video(self) -> None:
+ """Start writing the displayed frames to :attr:`video_path`; the size is fixed by the first frame."""
+ if self._video is not None:
+ return
+ if _ffmpeg_executable() is None:
+ self._message = "Video needs ffmpeg: install it or the 'video' extra."
+ return
+ self._video_frames, self._video_shape = 0, None
+ self._video_rate = self.video_fps or max(1, round(self._owner.cfg.window.fps))
+ self._video_limit = round(self.video_length * self._video_rate) if self.video_length > 0 else None
+ self._discard_unsaved_video()
+ folder = resolve_output_dir(self.output_dir) / "video"
+ folder.mkdir(parents=True, exist_ok=True)
+ self._video_temp = folder / ".unsaved_video.mp4"
+ self._video = True # Opened on the first frame, once the framebuffer size is known.
+ self._message = "Recording video. Stop, then Save to keep it."
+
+ def _write_video_frame(self, frame: np.ndarray) -> None:
+ if self._video is True:
+ height, width = frame.shape[:2]
+ path = self._video_temp
+ fps = self._video_rate
+ self._video_shape = (height, width)
+ self._video = subprocess.Popen( # noqa: S603
+ [
+ _ffmpeg_executable(), "-y", "-loglevel", "error", "-f", "rawvideo", "-pix_fmt", "rgb24",
+ "-s", f"{width}x{height}", "-r", str(fps), "-i", "-", "-vf", "pad=ceil(iw/2)*2:ceil(ih/2)*2",
+ "-c:v", "libx264", "-pix_fmt", "yuv420p", str(path),
+ ],
+ stdin=subprocess.PIPE,
+ ) # fmt: skip
+ if frame.shape[:2] != self._video_shape:
+ return # The window was resized mid-recording; skip frames the encoder cannot accept.
+ video = self._video
+ try:
+ video.stdin.write(np.ascontiguousarray(frame).tobytes())
+ except OSError: # Includes a broken pipe, which means ffmpeg has exited.
+ self._video = None
+ with contextlib.suppress(OSError):
+ video.stdin.close()
+ video.wait()
+ self._video_unsaved = self._video_temp if self._video_temp.exists() else None
+ self._message = "ffmpeg stopped unexpectedly; video recording ended."
+ return
+ self._video_frames += 1
+ if self._video_limit is not None and self._video_frames >= self._video_limit:
+ self.stop_video()
+ self.save_video() # A fixed length is meant to need no further clicks.
+
+ def stop_video(self) -> None:
+ """End the capture. The clip stays in a temporary file until :meth:`save_video` keeps it."""
+ video, self._video = self._video, None
+ if video is None:
+ return
+ if video is True:
+ self._message = "No frame was recorded."
+ return
+ video.stdin.close()
+ video.wait()
+ self._video_unsaved = self._video_temp
+ self._message = f"Stopped after {self._video_frames} frames. Press Save to keep the video."
+
+ def save_video(self) -> None:
+ """Move the stopped video to its numbered file in the output folder."""
+ temp = self._video_unsaved
+ if temp is None:
+ return
+ path = self._output_path("video", ".mp4")
+ try:
+ os.replace(temp, path)
+ except OSError as exc: # The clip stays in its temporary file, so Save can be pressed again.
+ self._message = f"Could not save the video: {exc}"
+ return
+ self._video_unsaved = None
+ self.video_path = str(path)
+ self._message = f"Saved {self._video_frames} frames to {self.video_path}"
+ logger.info("[NewtonRecording] Wrote %d video frames to %s", self._video_frames, self.video_path)
+
+ def _discard_unsaved_video(self) -> None:
+ temp, self._video_unsaved = self._video_unsaved, None
+ if temp is not None:
+ temp.unlink(missing_ok=True)
+
+ # ------------------------------------------------------------------
+ # Checkpoint
+ # ------------------------------------------------------------------
+
+ def set_checkpoint_saver(self, save: Callable[[str], None] | None) -> None:
+ """Offer the policy of this run to the Checkpoint button.
+
+ Args:
+ save: Callable that writes the policy checkpoint to the given path, or None when the run has no policy.
+ """
+ self._checkpoint_saver = save
+
+ def save_checkpoint(self) -> None:
+ """Write the run's policy checkpoint to a numbered file in the output folder."""
+ if self._checkpoint_saver is None:
+ self._message = "This run has no policy to save."
+ return
+ path = self._output_path("checkpoint", ".pt")
+ try:
+ self._checkpoint_saver(str(path))
+ except Exception as exc:
+ logger.exception("[NewtonRecording] Could not save the policy checkpoint.")
+ self._message = f"Checkpoint failed: {exc}"
+ return
+ self.checkpoint_path = str(path)
+ self._message = f"Saved policy checkpoint to {self.checkpoint_path}"
+
+ # ------------------------------------------------------------------
+ # Per-frame capture
+ # ------------------------------------------------------------------
+
+ def capture(self) -> None:
+ """Record the frame that was just rendered; call once per window update, outside the frame."""
+ owner = self._owner
+ if self._video is not None:
+ self._write_video_frame(owner._viewer.get_frame(render_ui=False).numpy())
+ if self._screenshot_pending:
+ self._screenshot_pending = False
+ self._write_screenshot(owner._viewer.get_frame(render_ui=False).numpy())
+
+ def request_screenshot(self) -> None:
+ """Save the next rendered window frame, without the HUD, as a numbered PNG in the output folder."""
+ self._screenshot_pending = True
+
+ def _write_screenshot(self, frame: np.ndarray) -> None:
+ """Write one frame to the next screenshot file."""
+ from PIL import Image # noqa: PLC0415
+
+ path = self._output_path("screenshot", ".png")
+ try:
+ Image.fromarray(np.ascontiguousarray(frame[..., :3], dtype=np.uint8)).save(path)
+ except Exception as exc:
+ logger.exception("[NewtonRecording] Could not save the screenshot.")
+ self._message = f"Screenshot failed: {exc}"
+ return
+ self.screenshot_path = str(path)
+ self._message = f"Saved screenshot to {self.screenshot_path}"
+
+ def close(self) -> None:
+ """Finish an open video recording, keeping a clip that was running or stopped but not yet saved."""
+ self.stop_video()
+ self.save_video()
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 8c80f40f463d..dd044c11f613 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -60,6 +60,7 @@
from isaaclab_visualizers.newton.newton_visualization_markers import render_newton_visualization_markers
from .newton_key_event_source import NewtonKeyEventSource
+from .newton_recording import NewtonRecordingPanel, hover_tooltip
from .newton_rtx_appearance import SKY_TEXTURES, RtxAppearance
logger = logging.getLogger(__name__)
@@ -106,12 +107,6 @@
"""What each marker group shows, by the last component of its prim path."""
-def hover_tooltip(imgui: Any, text: str) -> None:
- """Show ``text`` while the last item is hovered, including when it is disabled."""
- if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
- imgui.set_tooltip(text)
-
-
def marker_tooltip(prim_path: str) -> str:
"""Return a short description of the marker group at ``prim_path``, or a generic line when unknown."""
return _MARKER_TIPS.get(prim_path.rsplit("/", 1)[-1], "Show or hide this marker group")
@@ -199,6 +194,7 @@ class NewtonViewerGL(ViewerGL):
keyboard_frame_hook: Callable[[], object] | None = None
"""Called after every frame while a :class:`NewtonKeyEventSource` listens, to track ImGui keyboard ownership."""
_owner = None
+ _recording_panel = None
_show_stats = False
"""Whether the performance and model statistics overlay in the top-right corner is open."""
image_matches_camera = False
@@ -334,9 +330,10 @@ def _patch_viewer_panel(self) -> None:
2. **Camera View** (closed) — renderer (OpenGL or RTX), camera source, and renderer-specific options.
3. **Scene** (closed) — visible environments, visualization markers (a toggle per marker group, shared with Kit
and Viser), and visual overlays.
- 4. **Live Plots** (closed) — injected when :meth:`~NewtonGLVisualizer.add_live_plots` is called.
- 5. **Articulation Inspector** (closed) — Newton's articulation selection panel.
- 6. **Control Bindings** (closed) — the camera, keyboard, and mouse controls and what each one does.
+ 4. **Recording** (closed) — video, screenshot, policy checkpoint, and their output settings.
+ 5. **Live Plots** (closed) — injected when :meth:`~NewtonGLVisualizer.add_live_plots` is called.
+ 6. **Articulation Inspector** (closed) — Newton's articulation selection panel.
+ 7. **Control Bindings** (closed) — the camera, keyboard, and mouse controls and what each one does.
The top-level Newton ``Pause / Step`` row is suppressed; pause/resume is handled by the Isaac Lab controls
inside **Playback**.
@@ -399,6 +396,10 @@ def _render_left_panel(_g=gui):
# --- Scene ------------------------------------------------------
viewer._draw_scene_controls(imgui)
+ # --- Recording --------------------------------------------------
+ if viewer._recording_panel is not None:
+ viewer._recording_panel.draw(imgui)
+
# --- Live Plots -------------------------------------------------
live_plots_cb = viewer._live_plots_callback
if live_plots_cb is not None:
@@ -1886,6 +1887,8 @@ def render_tracking_rgb_array(self) -> np.ndarray:
class NewtonGLVisualizer(NewtonVisualizerBase):
"""Newton model rendering, picking, and contact overlays used by the GL visualizer."""
+ _recording: NewtonRecordingPanel | None = None
+
@property
def visual_material_writer(self):
"""Return the shared Newton model color-writer factory."""
@@ -1990,6 +1993,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
self._cfg_visible_env_ids = self._env_ids
self._num_envs = num_envs
self._viewer._owner = self
+ self._recording = self._viewer._recording_panel = NewtonRecordingPanel(self)
self._apply_visible_worlds()
self._viewer._paused = False
self._viewer.picking_enabled = self._picking_enabled
@@ -2084,6 +2088,8 @@ def _render_frame(self) -> None:
viewer.end_frame()
if not viewer.is_running():
self._viewer_picking_binding.deactivate()
+ if self._recording is not None and not viewer.is_paused():
+ self._recording.capture()
self._last_render_step = self._sim.get_physics_step_count()
if self.current_image_view.camera is None:
self.current_image_view.invalidate()
@@ -2223,6 +2229,15 @@ def set_run_info(self, task: str | None = None, mode: str | None = None, run: st
if self._viewer is not None:
self._viewer.set_run_info(task, mode, run)
+ def attach_checkpoint_saver(self, save: Callable[[str], None]) -> None:
+ """Enable the HUD's Checkpoint button for a run that has a policy.
+
+ Args:
+ save: Callable that writes the policy checkpoint to the given path.
+ """
+ if self._recording is not None:
+ self._recording.set_checkpoint_saver(save)
+
@property
def visible_env_limit(self) -> int:
"""Largest value of the visible-environment count: the environments the cfg allows, else all."""
@@ -2334,6 +2349,8 @@ def close(self) -> None:
return
self._close_key_event_source()
try:
+ if self._recording is not None:
+ self._recording.close()
if self._picking_enabled:
# Captured graphs retain neutral picking inputs until their last replay.
self._viewer_picking_binding.deactivate()
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
index e275d41808bc..a31119317e37 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
@@ -18,6 +18,34 @@
from .newton_visualizer import NewtonGLVisualizer
+@configclass
+class NewtonRecordingCfg:
+ """Output settings of the Recording section in the Newton GL HUD.
+
+ Every output lands in ``//``, where ``kind`` is ``video``, ``scene``, or ``checkpoint``.
+ The HUD edits a copy of these values while the window is open.
+ """
+
+ output_dir: str = "recording"
+ """Root folder of all recordings. Relative paths resolve against the working directory, which is the repository
+ folder when the run starts there."""
+
+ filename_prefix: str = "newton"
+ """Start of every recording's file name."""
+
+ auto_increment: bool = True
+ """Append a counter (``_0001``, ``_0002``, ...) so a new recording never overwrites an earlier one."""
+
+ timestamp: bool = False
+ """Append the start date and time (``YYYYmmdd-HHMMSS``) to the file name."""
+
+ video_fps: int | None = None
+ """Frame rate of the encoded video [Hz]. ``None`` uses the window's update rate (:attr:`WindowCfg.fps`)."""
+
+ video_length: float | None = None
+ """Duration of the video [s] after which recording stops by itself. ``None`` records until stopped."""
+
+
@configclass
class NewtonGLBackendCfg(VisualizerBackendCfg):
"""Newton visualizer options: OpenGL rendering and model display, and the optional OVRTX view."""
@@ -82,6 +110,9 @@ class NewtonGLBackendCfg(VisualizerBackendCfg):
light_color: tuple[float, float, float] = (1.0, 1.0, 1.0)
"""Light color RGB [0, 1]."""
+ recording: NewtonRecordingCfg = NewtonRecordingCfg()
+ """Defaults of the HUD's Recording section."""
+
rtx_camera: bool | None = None
"""Declare an OVRTX viewer camera so the HUD can switch the main view between Newton GL and OVRTX.
diff --git a/source/isaaclab_visualizers/test/test_newton_recording.py b/source/isaaclab_visualizers/test/test_newton_recording.py
new file mode 100644
index 000000000000..d4810feb663e
--- /dev/null
+++ b/source/isaaclab_visualizers/test/test_newton_recording.py
@@ -0,0 +1,277 @@
+# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
+# All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+
+"""Tests for the Newton GL HUD recording panel without a window."""
+
+import re
+from pathlib import Path
+from types import SimpleNamespace
+from unittest.mock import Mock
+
+import numpy as np
+import pytest
+from isaaclab_visualizers.newton import NewtonRecordingCfg, newton_recording
+from isaaclab_visualizers.newton.newton_recording import NewtonRecordingPanel, _ffmpeg_executable, resolve_output_dir
+
+
+class _Array:
+ def __init__(self, values):
+ self._values = np.asarray(values, dtype=np.float32)
+
+ def numpy(self):
+ return self._values
+
+
+def _owner(frames=(), **recording):
+ state = SimpleNamespace(body_q=_Array([[0, 0, 1, 0, 0, 0, 1]]), joint_q=_Array([0.5, -0.5]))
+ frames = iter(frames)
+ viewer = SimpleNamespace(get_frame=lambda render_ui=False: _Array(next(frames)))
+ return SimpleNamespace(
+ _update_state=lambda: state,
+ _viewer=viewer,
+ _sim_time=0.0,
+ cfg=SimpleNamespace(
+ window=SimpleNamespace(fps=10.0), backend=SimpleNamespace(recording=NewtonRecordingCfg(**recording))
+ ),
+ )
+
+
+def test_checkpoint_writes_through_the_runs_saver_into_numbered_files(tmp_path):
+ panel = NewtonRecordingPanel(_owner(output_dir=str(tmp_path)))
+ panel.save_checkpoint()
+ assert "no policy" in panel._message # Nothing is written until the run offers a saver.
+
+ panel.set_checkpoint_saver(lambda path: Path(path).write_text("policy"))
+ panel.save_checkpoint()
+ panel.save_checkpoint()
+
+ folder = tmp_path / "checkpoint"
+ assert sorted(file.name for file in folder.iterdir()) == ["newton_0001.pt", "newton_0002.pt"]
+ assert panel.checkpoint_path == str(folder / "newton_0002.pt")
+
+
+def test_checkpoint_failure_is_reported_without_raising(tmp_path):
+ def broken(path):
+ raise OSError("disk full")
+
+ panel = NewtonRecordingPanel(_owner(output_dir=str(tmp_path)))
+ panel.set_checkpoint_saver(broken)
+
+ panel.save_checkpoint()
+
+ assert "disk full" in panel._message and not panel.checkpoint_path
+
+
+def test_output_paths_number_stamp_or_overwrite(tmp_path):
+ panel = NewtonRecordingPanel(_owner(output_dir=str(tmp_path), filename_prefix="run"))
+
+ first = panel._output_path("video", ".mp4")
+ first.touch()
+ assert [first.name, panel._output_path("video", ".mp4").name] == ["run_0001.mp4", "run_0002.mp4"]
+
+ panel.auto_increment = False
+ assert panel._output_path("video", ".mp4").name == "run.mp4"
+
+ panel.timestamp = True
+ assert re.fullmatch(r"run_\d{8}-\d{6}\.mp4", panel._output_path("scene", ".mp4").name)
+ assert (tmp_path / "scene").is_dir()
+
+
+@pytest.mark.skipif(_ffmpeg_executable() is None, reason="ffmpeg is not installed")
+def test_video_streams_frames_and_ignores_resized_ones(tmp_path):
+ frames = [np.full((16, 24, 3), 10 * i, np.uint8) for i in range(3)] + [np.zeros((8, 8, 3), np.uint8)]
+ panel = NewtonRecordingPanel(_owner(frames, output_dir=str(tmp_path)))
+
+ panel.start_video()
+ for _ in frames:
+ panel.capture()
+ panel.stop_video()
+ panel.save_video()
+
+ assert panel._video_frames == 3
+ assert (tmp_path / "video" / "newton_0001.mp4").stat().st_size > 0
+ assert not panel.recording_video
+
+
+@pytest.mark.skipif(_ffmpeg_executable() is None, reason="ffmpeg is not installed")
+def test_stopped_video_is_kept_only_when_saved(tmp_path):
+ frames = [np.zeros((16, 24, 3), np.uint8)] * 6
+ panel = NewtonRecordingPanel(_owner(frames, output_dir=str(tmp_path)))
+ video_dir = tmp_path / "video"
+
+ panel.start_video()
+ panel.capture()
+ panel.capture()
+ panel.stop_video()
+
+ assert panel.unsaved_video and not panel.recording_video
+ assert [file.name for file in video_dir.iterdir()] == [".unsaved_video.mp4"] # Nothing numbered yet.
+
+ panel.start_video() # Starting again replaces the unsaved clip.
+ assert not panel.unsaved_video
+ panel.capture()
+ panel.stop_video()
+ panel.save_video()
+
+ assert not panel.unsaved_video
+ assert [file.name for file in video_dir.iterdir()] == ["newton_0001.mp4"]
+
+
+@pytest.mark.skipif(_ffmpeg_executable() is None, reason="ffmpeg is not installed")
+def test_video_with_a_length_saves_itself(tmp_path):
+ frames = [np.zeros((16, 24, 3), np.uint8)] * 10
+ panel = NewtonRecordingPanel(_owner(frames, output_dir=str(tmp_path), video_fps=4, video_length=1.0))
+
+ panel.start_video()
+ for _ in frames:
+ panel.capture()
+
+ assert not panel.recording_video and not panel.unsaved_video
+ assert panel._video_frames == 4 # 1 s at 4 Hz
+ assert "Saved 4 frames" in panel._message
+ assert (tmp_path / "video" / "newton_0001.mp4").exists()
+
+
+@pytest.mark.skipif(_ffmpeg_executable() is None, reason="ffmpeg is not installed")
+def test_closing_keeps_a_running_video(tmp_path):
+ panel = NewtonRecordingPanel(_owner([np.zeros((16, 24, 3), np.uint8)] * 2, output_dir=str(tmp_path)))
+
+ panel.start_video()
+ panel.capture()
+ panel.close()
+
+ assert (tmp_path / "video" / "newton_0001.mp4").exists()
+
+
+def test_relative_output_folder_lands_in_the_repository_not_the_working_directory(tmp_path, monkeypatch):
+ repo, elsewhere = tmp_path / "repo", tmp_path / "elsewhere"
+ (repo / "source").mkdir(parents=True)
+ elsewhere.mkdir()
+ monkeypatch.setattr(newton_recording, "ISAACLAB_ROOT", repo)
+ monkeypatch.chdir(elsewhere)
+
+ assert resolve_output_dir("recording") == repo / "recording"
+ assert resolve_output_dir(str(tmp_path / "absolute")) == tmp_path / "absolute"
+
+
+def test_relative_output_folder_uses_the_working_directory_without_a_source_checkout(tmp_path, monkeypatch):
+ package, cwd = tmp_path / "site-packages" / "isaaclab", tmp_path / "cwd"
+ package.mkdir(parents=True)
+ cwd.mkdir()
+ monkeypatch.setattr(newton_recording, "ISAACLAB_ROOT", package)
+ monkeypatch.chdir(cwd)
+
+ assert resolve_output_dir("recording") == cwd / "recording"
+
+
+class _StrictImgui:
+ """Imgui double that clicks one button and fails like imgui does on an unbalanced disabled scope."""
+
+ class HoveredFlags_:
+ allow_when_disabled = 1
+
+ def __init__(self, click: str):
+ self.click, self.disabled_depth = click, 0
+
+ def ImVec4(self, *values): # noqa: N802
+ return values
+
+ def button(self, label):
+ return label == self.click
+
+ def begin_disabled(self):
+ self.disabled_depth += 1
+
+ def end_disabled(self):
+ assert self.disabled_depth > 0, "Calling EndDisabled() too many times!"
+ self.disabled_depth -= 1
+
+ def __getattr__(self, _name):
+ return lambda *args, **kwargs: False
+
+
+def test_saving_a_video_keeps_the_disabled_scopes_balanced(tmp_path):
+ frames = [np.zeros((16, 24, 3), np.uint8)] * 3
+ panel = NewtonRecordingPanel(_owner(frames, output_dir=str(tmp_path)))
+ panel.start_video()
+ panel.capture()
+ panel.stop_video()
+ imgui = _StrictImgui(click="Save##video")
+
+ panel._draw_video(imgui) # Saving clears the unsaved video partway through the frame.
+
+ assert not panel.unsaved_video and imgui.disabled_depth == 0
+
+
+def test_screenshot_writes_the_next_frame_as_a_numbered_png(tmp_path):
+ frame = np.zeros((4, 6, 3), np.uint8)
+ frame[..., 0] = 200
+ panel = NewtonRecordingPanel(_owner(frames=[frame, frame], output_dir=str(tmp_path)))
+
+ panel.request_screenshot()
+ panel.capture()
+ panel.capture() # Nothing is pending, so no second file.
+ panel.request_screenshot()
+ panel.capture()
+
+ from PIL import Image
+
+ folder = tmp_path / "screenshot"
+ assert sorted(file.name for file in folder.iterdir()) == ["newton_0001.png", "newton_0002.png"]
+ assert np.array(Image.open(folder / "newton_0001.png"))[0, 0].tolist() == [200, 0, 0]
+ assert panel.screenshot_path == str(folder / "newton_0002.png")
+
+
+class _Encoder:
+ """Stand-in for the ffmpeg process whose input pipe can break."""
+
+ def __init__(self, broken=False):
+ self.broken, self.waited, self.written = broken, False, 0
+ self.stdin = SimpleNamespace(write=self._write, close=self._close)
+
+ def _write(self, data):
+ if self.broken:
+ raise BrokenPipeError
+ self.written += 1
+
+ def _close(self):
+ if self.broken:
+ raise BrokenPipeError
+
+ def wait(self):
+ self.waited = True
+
+
+def _recording_to(tmp_path, encoder, **recording):
+ panel = NewtonRecordingPanel(_owner(output_dir=str(tmp_path), **recording))
+ panel._video, panel._video_shape, panel._video_limit = encoder, (4, 4), None
+ panel._video_temp = tmp_path / ".unsaved_video.mp4"
+ panel._video_temp.write_bytes(b"partial")
+ return panel
+
+
+def test_a_broken_encoder_pipe_ends_the_recording_and_keeps_the_partial_clip(tmp_path):
+ encoder = _Encoder(broken=True)
+ panel = _recording_to(tmp_path, encoder)
+
+ panel._write_video_frame(np.zeros((4, 4, 3), np.uint8))
+
+ assert not panel.recording_video and encoder.waited # The dead process is reaped, not left as a zombie.
+ assert panel.unsaved_video # The partial clip can still be saved or discarded.
+ assert "ffmpeg stopped unexpectedly" in panel._message
+
+
+def test_a_failed_save_is_reported_as_a_save_error_and_can_be_retried(tmp_path, monkeypatch):
+ panel = _recording_to(tmp_path, _Encoder(), video_length=0.0)
+ panel.stop_video()
+ assert panel.unsaved_video
+
+ monkeypatch.setattr("os.replace", Mock(side_effect=OSError("disk full")))
+ panel.save_video()
+
+ assert panel.unsaved_video and "disk full" in panel._message and "ffmpeg" not in panel._message
+ monkeypatch.undo()
+ panel.save_video()
+ assert not panel.unsaved_video and (tmp_path / "video" / "newton_0001.mp4").exists()
From fdfa8c71e1e592b63dbdb96c2f03b2af75c62a46 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 18 Nov 2026 18:59:04 +0000
Subject: [PATCH 066/140] Name the viewer camera path consistently after
restacking
---
source/isaaclab/isaaclab/sim/simulation_context.py | 2 +-
.../test/test_newton_task_views.py | 11 -----------
2 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index 6859c4a633a5..8a631893bc84 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -451,7 +451,7 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
# A sensor without the requested channels still shows its own, such as depth only.
if resolve_display_channels(visualizer.cfg.streaming_gt_types, camera.cfg.data_types):
cameras.append(camera)
- rtx_path = getattr(visualizer.cfg.backend, "rtx_camera_prim_path", None)
+ rtx_path = getattr(visualizer.cfg.backend, "rtx_camera_path", None)
if rtx_path is not None and not (visualizer.cfg.cameras is None or tracking_only):
# Explicit cameras skip discovery; the Renderer switch still needs this window's RTX camera.
cameras.append(SceneCameraCfg(prim_path=rtx_path))
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index 394b969c7538..74d9029f4b1c 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -206,17 +206,6 @@ def test_rtx_rendering_needs_the_viewer_camera_declared_at_launch():
viz.set_rtx_rendering(True)
-def test_each_window_selects_the_rtx_camera_declared_for_it():
- cams = [
- _View("a", camera=SimpleNamespace(cfg=SimpleNamespace(prim_path=f"/World/viewer_camera_{i}_rtx")))
- for i in range(2)
- ]
- viz = _switchable([_view(PerspectiveCameraCfg()), *cams])
- viz.cfg = SimpleNamespace(backend=SimpleNamespace(rtx_camera_prim_path="/World/viewer_camera_1_rtx"))
-
- assert viz.rtx_view_index == 2
-
-
def test_the_shared_renderer_hides_environments_only_while_the_rtx_view_is_shown():
calls = []
renderer = SimpleNamespace(
From 9de11b0491571e8ea1cacb129a2e67da5f221d12 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 12 Nov 2026 04:56:31 +0000
Subject: [PATCH 067/140] Add Include HUD options for video and screenshots
Co-Authored-By: Claude Sonnet 5.5
---
docs/source/concepts/visualization.rst | 5 +++--
.../newton-recording-include-hud.added.rst | 2 ++
.../changelog.d/newton-screenshot.added.rst | 2 +-
.../newton/newton_recording.py | 17 +++++++++++++----
.../test/test_newton_recording.py | 18 ++++++++++++++++++
5 files changed, 37 insertions(+), 7 deletions(-)
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-recording-include-hud.added.rst
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index e889274cbddb..f808d87d3240 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -655,8 +655,9 @@ Newton Window Recording
~~~~~~~~~~~~~~~~~~~~~~~
The **Recording** section of the Newton visualizer saves three things: an ``mp4`` video of the window, a ``.png``
-screenshot of the window without the HUD, and a ``.pt`` checkpoint of the policy being played. Files go to the output
-folder set by :class:`~isaaclab_visualizers.newton.NewtonRecordingCfg`.
+screenshot of the window, and a ``.pt`` checkpoint of the policy being played. Files go to the output
+folder set by :class:`~isaaclab_visualizers.newton.NewtonRecordingCfg`. Video and screenshots can include the HUD
+panels with their **Include HUD** options.
.. _record_video_cli:
diff --git a/source/isaaclab_visualizers/changelog.d/newton-recording-include-hud.added.rst b/source/isaaclab_visualizers/changelog.d/newton-recording-include-hud.added.rst
new file mode 100644
index 000000000000..9aa7d0dc73f2
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-recording-include-hud.added.rst
@@ -0,0 +1,2 @@
+* Added an "Include HUD" checkbox for video and for screenshots to the Recording section of the Newton visualizer. Both are
+ off by default, so recordings still show only the scene.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-screenshot.added.rst b/source/isaaclab_visualizers/changelog.d/newton-screenshot.added.rst
index fe7a665eec61..189c18e7a805 100644
--- a/source/isaaclab_visualizers/changelog.d/newton-screenshot.added.rst
+++ b/source/isaaclab_visualizers/changelog.d/newton-screenshot.added.rst
@@ -1,2 +1,2 @@
* Added a Screenshot (``.png``) button to the Recording section of the Newton visualizer that saves the current
- window frame without the HUD.
+ window frame.
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
index 92ea13e485b5..5e2447734dae 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
@@ -97,6 +97,10 @@ def __init__(self, owner: NewtonGLVisualizer):
self._video_shape: tuple[int, int] | None = None
self.screenshot_path = ""
"""File written by the latest screenshot."""
+ self.video_include_hud = False
+ """Whether recorded video frames include the HUD panels."""
+ self.screenshot_include_hud = False
+ """Whether screenshots include the HUD panels."""
self._screenshot_pending = False
self._message = ""
@@ -154,6 +158,8 @@ def _draw_video(self, imgui: Any) -> None:
imgui.end_disabled()
if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
imgui.set_tooltip("Keep the stopped video in the output folder")
+ _c, self.video_include_hud = imgui.checkbox("Include HUD##video", self.video_include_hud)
+ hover_tooltip(imgui, "Draw the HUD panels into the recorded frames")
elapsed = f"{self._video_frames / max(self._video_rate, 1):.2f} s ({self._video_frames} frames)"
if self.recording_video:
imgui.text_colored(imgui.ImVec4(*_RED), f"REC {elapsed}")
@@ -166,7 +172,10 @@ def _draw_screenshot(self, imgui: Any) -> None:
imgui.text("Screenshot (.png)")
if imgui.button("Capture##screenshot"):
self.request_screenshot()
- hover_tooltip(imgui, "Save the window image without the panels to the output folder")
+ hover_tooltip(imgui, "Save the window image to the output folder")
+ imgui.same_line()
+ _c, self.screenshot_include_hud = imgui.checkbox("Include HUD##screenshot", self.screenshot_include_hud)
+ hover_tooltip(imgui, "Draw the HUD panels into the screenshot")
imgui.separator()
def _draw_checkpoint(self, imgui: Any) -> None:
@@ -354,13 +363,13 @@ def capture(self) -> None:
"""Record the frame that was just rendered; call once per window update, outside the frame."""
owner = self._owner
if self._video is not None:
- self._write_video_frame(owner._viewer.get_frame(render_ui=False).numpy())
+ self._write_video_frame(owner._viewer.get_frame(render_ui=self.video_include_hud).numpy())
if self._screenshot_pending:
self._screenshot_pending = False
- self._write_screenshot(owner._viewer.get_frame(render_ui=False).numpy())
+ self._write_screenshot(owner._viewer.get_frame(render_ui=self.screenshot_include_hud).numpy())
def request_screenshot(self) -> None:
- """Save the next rendered window frame, without the HUD, as a numbered PNG in the output folder."""
+ """Save the next rendered window frame, as a numbered PNG in the output folder."""
self._screenshot_pending = True
def _write_screenshot(self, frame: np.ndarray) -> None:
diff --git a/source/isaaclab_visualizers/test/test_newton_recording.py b/source/isaaclab_visualizers/test/test_newton_recording.py
index d4810feb663e..4c8601e3d82f 100644
--- a/source/isaaclab_visualizers/test/test_newton_recording.py
+++ b/source/isaaclab_visualizers/test/test_newton_recording.py
@@ -181,6 +181,9 @@ def ImVec4(self, *values): # noqa: N802
def button(self, label):
return label == self.click
+ def checkbox(self, _label, value):
+ return False, value
+
def begin_disabled(self):
self.disabled_depth += 1
@@ -275,3 +278,18 @@ def test_a_failed_save_is_reported_as_a_save_error_and_can_be_retried(tmp_path,
monkeypatch.undo()
panel.save_video()
assert not panel.unsaved_video and (tmp_path / "video" / "newton_0001.mp4").exists()
+
+
+def test_hud_is_captured_only_when_the_toggle_asks_for_it(tmp_path):
+ requested = []
+ owner = _owner(frames=[np.zeros((4, 6, 3), np.uint8)] * 2, output_dir=str(tmp_path))
+ owner._viewer.get_frame = lambda render_ui=False: requested.append(render_ui) or _Array(np.zeros((4, 6, 3)))
+ panel = NewtonRecordingPanel(owner)
+
+ panel.request_screenshot()
+ panel.capture()
+ panel.screenshot_include_hud = True
+ panel.request_screenshot()
+ panel.capture()
+
+ assert requested == [False, True]
From 84577bd5c69b7135babd15aade9c128c2aa4dd0e Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 12 Nov 2026 23:51:56 +0000
Subject: [PATCH 068/140] Address review feedback on recording
Give each panel its own temporary clip, reap the encoder when its pipe breaks and keep a clip only when it exits cleanly, keep the file prefix inside its folder, stamp a video with its start time, take screenshots while paused, release picking even if closing the recording fails, and correct the output documentation.
Co-Authored-By: Claude Sonnet 5.5
---
.../newton/newton_recording.py | 67 ++++++++++++-------
.../newton/newton_visualizer.py | 16 +++--
.../newton/newton_visualizer_cfg.py | 8 +--
.../test/test_newton_recording.py | 53 ++++++++++++---
4 files changed, 101 insertions(+), 43 deletions(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
index 5e2447734dae..f1d3497aedd6 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
@@ -92,7 +92,9 @@ def __init__(self, owner: NewtonGLVisualizer):
self._video_temp: Path | None = None
self._video_unsaved: Path | None = None
"""Finished clip that stays in a temporary file until :meth:`save_video` keeps it."""
- self._video: subprocess.Popen | None = None
+ self._video: subprocess.Popen | bool | None = None
+ """The encoder, ``True`` while recording has started but the first frame has not arrived, or None."""
+ self._video_started: datetime | None = None
self._video_frames = 0
self._video_shape: tuple[int, int] | None = None
self.screenshot_path = ""
@@ -228,13 +230,13 @@ def _draw_message(self, imgui: Any) -> None:
imgui.text_wrapped(self._message)
imgui.pop_style_color()
- def _output_path(self, kind: str, suffix: str) -> Path:
+ def _output_path(self, kind: str, suffix: str, when: datetime | None = None) -> Path:
"""Return the next file of ``kind`` from the output settings, creating its folder."""
folder = resolve_output_dir(self.output_dir) / kind
folder.mkdir(parents=True, exist_ok=True)
- name = self.filename_prefix or "newton"
+ name = Path(self.filename_prefix).name or "newton" # The prefix names a file, never a folder.
if self.timestamp:
- name = f"{name}_{datetime.now():%Y%m%d-%H%M%S}"
+ name = f"{name}_{(when or datetime.now()):%Y%m%d-%H%M%S}"
if not self.auto_increment:
return folder / f"{name}{suffix}"
pattern = re.compile(rf"^{re.escape(name)}_(\d+){re.escape(suffix)}$")
@@ -258,7 +260,8 @@ def start_video(self) -> None:
self._discard_unsaved_video()
folder = resolve_output_dir(self.output_dir) / "video"
folder.mkdir(parents=True, exist_ok=True)
- self._video_temp = folder / ".unsaved_video.mp4"
+ self._video_temp = folder / f".unsaved_video_{os.getpid()}_{id(self):x}.mp4" # One file per panel.
+ self._video_started = datetime.now()
self._video = True # Opened on the first frame, once the framebuffer size is known.
self._message = "Recording video. Stop, then Save to keep it."
@@ -268,14 +271,19 @@ def _write_video_frame(self, frame: np.ndarray) -> None:
path = self._video_temp
fps = self._video_rate
self._video_shape = (height, width)
- self._video = subprocess.Popen( # noqa: S603
- [
- _ffmpeg_executable(), "-y", "-loglevel", "error", "-f", "rawvideo", "-pix_fmt", "rgb24",
- "-s", f"{width}x{height}", "-r", str(fps), "-i", "-", "-vf", "pad=ceil(iw/2)*2:ceil(ih/2)*2",
- "-c:v", "libx264", "-pix_fmt", "yuv420p", str(path),
- ],
- stdin=subprocess.PIPE,
- ) # fmt: skip
+ try:
+ self._video = subprocess.Popen( # noqa: S603
+ [
+ _ffmpeg_executable(), "-y", "-loglevel", "error", "-f", "rawvideo", "-pix_fmt", "rgb24",
+ "-s", f"{width}x{height}", "-r", str(fps), "-i", "-", "-vf", "pad=ceil(iw/2)*2:ceil(ih/2)*2",
+ "-c:v", "libx264", "-pix_fmt", "yuv420p", str(path),
+ ],
+ stdin=subprocess.PIPE,
+ ) # fmt: skip
+ except OSError as exc:
+ self._video = None
+ self._message = f"Could not start ffmpeg: {exc}"
+ return
if frame.shape[:2] != self._video_shape:
return # The window was resized mid-recording; skip frames the encoder cannot accept.
video = self._video
@@ -283,10 +291,7 @@ def _write_video_frame(self, frame: np.ndarray) -> None:
video.stdin.write(np.ascontiguousarray(frame).tobytes())
except OSError: # Includes a broken pipe, which means ffmpeg has exited.
self._video = None
- with contextlib.suppress(OSError):
- video.stdin.close()
- video.wait()
- self._video_unsaved = self._video_temp if self._video_temp.exists() else None
+ self._finish_encoder(video)
self._message = "ffmpeg stopped unexpectedly; video recording ended."
return
self._video_frames += 1
@@ -294,6 +299,16 @@ def _write_video_frame(self, frame: np.ndarray) -> None:
self.stop_video()
self.save_video() # A fixed length is meant to need no further clicks.
+ def _finish_encoder(self, video: subprocess.Popen) -> bool:
+ """Close the encoder, wait for it, and keep its clip only when it exited cleanly; returns whether it did."""
+ with contextlib.suppress(OSError): # A pipe the encoder already closed.
+ video.stdin.close()
+ succeeded = video.wait() == 0
+ self._video_unsaved = self._video_temp if succeeded and self._video_temp.exists() else None
+ if not succeeded:
+ self._video_temp.unlink(missing_ok=True)
+ return succeeded
+
def stop_video(self) -> None:
"""End the capture. The clip stays in a temporary file until :meth:`save_video` keeps it."""
video, self._video = self._video, None
@@ -302,9 +317,9 @@ def stop_video(self) -> None:
if video is True:
self._message = "No frame was recorded."
return
- video.stdin.close()
- video.wait()
- self._video_unsaved = self._video_temp
+ if not self._finish_encoder(video):
+ self._message = "ffmpeg failed; the video was discarded."
+ return
self._message = f"Stopped after {self._video_frames} frames. Press Save to keep the video."
def save_video(self) -> None:
@@ -312,7 +327,7 @@ def save_video(self) -> None:
temp = self._video_unsaved
if temp is None:
return
- path = self._output_path("video", ".mp4")
+ path = self._output_path("video", ".mp4", self._video_started)
try:
os.replace(temp, path)
except OSError as exc: # The clip stays in its temporary file, so Save can be pressed again.
@@ -359,10 +374,14 @@ def save_checkpoint(self) -> None:
# Per-frame capture
# ------------------------------------------------------------------
- def capture(self) -> None:
- """Record the frame that was just rendered; call once per window update, outside the frame."""
+ def capture(self, paused: bool = False) -> None:
+ """Record the frame that was just rendered; call once per window update, outside the frame.
+
+ Args:
+ paused: Whether rendering is paused, when a video gets no new frames but a screenshot is still taken.
+ """
owner = self._owner
- if self._video is not None:
+ if self._video is not None and not paused:
self._write_video_frame(owner._viewer.get_frame(render_ui=self.video_include_hud).numpy())
if self._screenshot_pending:
self._screenshot_pending = False
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index dd044c11f613..af49d0983c2e 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -2088,8 +2088,8 @@ def _render_frame(self) -> None:
viewer.end_frame()
if not viewer.is_running():
self._viewer_picking_binding.deactivate()
- if self._recording is not None and not viewer.is_paused():
- self._recording.capture()
+ if self._recording is not None:
+ self._recording.capture(paused=viewer.is_paused())
self._last_render_step = self._sim.get_physics_step_count()
if self.current_image_view.camera is None:
self.current_image_view.invalidate()
@@ -2349,11 +2349,13 @@ def close(self) -> None:
return
self._close_key_event_source()
try:
- if self._recording is not None:
- self._recording.close()
- if self._picking_enabled:
- # Captured graphs retain neutral picking inputs until their last replay.
- self._viewer_picking_binding.deactivate()
+ try:
+ if self._recording is not None:
+ self._recording.close()
+ finally:
+ if self._picking_enabled:
+ # Captured graphs retain neutral picking inputs until their last replay.
+ self._viewer_picking_binding.deactivate()
finally:
self._viewer = self.backend = self._transform_mapping = None
super().close()
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
index a31119317e37..95cfbb4a7725 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
@@ -22,13 +22,13 @@
class NewtonRecordingCfg:
"""Output settings of the Recording section in the Newton GL HUD.
- Every output lands in ``//``, where ``kind`` is ``video``, ``scene``, or ``checkpoint``.
+ Every output lands in ``//``, where ``kind`` is ``video``, ``screenshot``, or ``checkpoint``.
The HUD edits a copy of these values while the window is open.
"""
output_dir: str = "recording"
- """Root folder of all recordings. Relative paths resolve against the working directory, which is the repository
- folder when the run starts there."""
+ """Root folder of all recordings. Relative paths resolve against the repository folder when running from a source
+ checkout, and against the working directory otherwise."""
filename_prefix: str = "newton"
"""Start of every recording's file name."""
@@ -37,7 +37,7 @@ class NewtonRecordingCfg:
"""Append a counter (``_0001``, ``_0002``, ...) so a new recording never overwrites an earlier one."""
timestamp: bool = False
- """Append the start date and time (``YYYYmmdd-HHMMSS``) to the file name."""
+ """Append the date and time (``YYYYmmdd-HHMMSS``) to the file name; a video uses the time its recording started."""
video_fps: int | None = None
"""Frame rate of the encoded video [Hz]. ``None`` uses the window's update rate (:attr:`WindowCfg.fps`)."""
diff --git a/source/isaaclab_visualizers/test/test_newton_recording.py b/source/isaaclab_visualizers/test/test_newton_recording.py
index 4c8601e3d82f..bdec5cff8331 100644
--- a/source/isaaclab_visualizers/test/test_newton_recording.py
+++ b/source/isaaclab_visualizers/test/test_newton_recording.py
@@ -15,10 +15,12 @@
from isaaclab_visualizers.newton import NewtonRecordingCfg, newton_recording
from isaaclab_visualizers.newton.newton_recording import NewtonRecordingPanel, _ffmpeg_executable, resolve_output_dir
+pytestmark = pytest.mark.kitless
+
class _Array:
def __init__(self, values):
- self._values = np.asarray(values, dtype=np.float32)
+ self._values = np.asarray(values)
def numpy(self):
return self._values
@@ -107,7 +109,7 @@ def test_stopped_video_is_kept_only_when_saved(tmp_path):
panel.stop_video()
assert panel.unsaved_video and not panel.recording_video
- assert [file.name for file in video_dir.iterdir()] == [".unsaved_video.mp4"] # Nothing numbered yet.
+ assert [file.name for file in video_dir.iterdir()] == [panel._video_temp.name] # Nothing numbered yet.
panel.start_video() # Starting again replaces the unsaved clip.
assert not panel.unsaved_video
@@ -230,8 +232,8 @@ def test_screenshot_writes_the_next_frame_as_a_numbered_png(tmp_path):
class _Encoder:
"""Stand-in for the ffmpeg process whose input pipe can break."""
- def __init__(self, broken=False):
- self.broken, self.waited, self.written = broken, False, 0
+ def __init__(self, broken=False, returncode=0):
+ self.broken, self.returncode, self.waited, self.written = broken, returncode, False, 0
self.stdin = SimpleNamespace(write=self._write, close=self._close)
def _write(self, data):
@@ -245,27 +247,60 @@ def _close(self):
def wait(self):
self.waited = True
+ return self.returncode
def _recording_to(tmp_path, encoder, **recording):
panel = NewtonRecordingPanel(_owner(output_dir=str(tmp_path), **recording))
panel._video, panel._video_shape, panel._video_limit = encoder, (4, 4), None
panel._video_temp = tmp_path / ".unsaved_video.mp4"
+ panel._video_started = None
panel._video_temp.write_bytes(b"partial")
return panel
-def test_a_broken_encoder_pipe_ends_the_recording_and_keeps_the_partial_clip(tmp_path):
- encoder = _Encoder(broken=True)
+def test_a_broken_encoder_pipe_ends_the_recording_and_reaps_the_process(tmp_path):
+ encoder = _Encoder(broken=True, returncode=1)
panel = _recording_to(tmp_path, encoder)
panel._write_video_frame(np.zeros((4, 4, 3), np.uint8))
assert not panel.recording_video and encoder.waited # The dead process is reaped, not left as a zombie.
- assert panel.unsaved_video # The partial clip can still be saved or discarded.
+ assert not panel.unsaved_video and not panel._video_temp.exists() # A failed encode is not offered for saving.
assert "ffmpeg stopped unexpectedly" in panel._message
+def test_an_encoder_that_exits_with_an_error_leaves_nothing_to_save(tmp_path):
+ panel = _recording_to(tmp_path, _Encoder(returncode=1))
+
+ panel.stop_video()
+
+ assert not panel.unsaved_video and "ffmpeg failed" in panel._message
+
+
+def test_each_panel_encodes_to_its_own_temporary_file_and_a_prefix_cannot_leave_the_folder(tmp_path, monkeypatch):
+ monkeypatch.setattr(newton_recording, "_ffmpeg_executable", lambda: "ffmpeg")
+ first = NewtonRecordingPanel(_owner(output_dir=str(tmp_path), filename_prefix="../outside"))
+ second = NewtonRecordingPanel(_owner(output_dir=str(tmp_path)))
+ first.start_video()
+ second.start_video()
+
+ assert first._video_temp != second._video_temp
+ assert first._output_path("video", ".mp4").parent == tmp_path / "video"
+ assert first._output_path("video", ".mp4").name == "outside_0001.mp4"
+
+
+def test_a_screenshot_is_taken_while_rendering_is_paused_but_a_video_gets_no_frame(tmp_path):
+ panel = NewtonRecordingPanel(_owner(frames=[np.zeros((4, 6, 3), np.uint8)], output_dir=str(tmp_path)))
+ encoder = _Encoder()
+ panel._video, panel._video_shape = encoder, (4, 6)
+
+ panel.request_screenshot()
+ panel.capture(paused=True)
+
+ assert encoder.written == 0 and (tmp_path / "screenshot" / "newton_0001.png").exists()
+
+
def test_a_failed_save_is_reported_as_a_save_error_and_can_be_retried(tmp_path, monkeypatch):
panel = _recording_to(tmp_path, _Encoder(), video_length=0.0)
panel.stop_video()
@@ -283,7 +318,9 @@ def test_a_failed_save_is_reported_as_a_save_error_and_can_be_retried(tmp_path,
def test_hud_is_captured_only_when_the_toggle_asks_for_it(tmp_path):
requested = []
owner = _owner(frames=[np.zeros((4, 6, 3), np.uint8)] * 2, output_dir=str(tmp_path))
- owner._viewer.get_frame = lambda render_ui=False: requested.append(render_ui) or _Array(np.zeros((4, 6, 3)))
+ owner._viewer.get_frame = lambda render_ui=False: (
+ requested.append(render_ui) or _Array(np.zeros((4, 6, 3), np.uint8))
+ )
panel = NewtonRecordingPanel(owner)
panel.request_screenshot()
From b16f50f312776b554ed1b76377c7ffb1fc199d71 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 12 Nov 2026 23:59:13 +0000
Subject: [PATCH 069/140] Report an unwritable recording folder instead of
raising
Co-Authored-By: Claude Sonnet 5.5
---
.../newton/newton_recording.py | 12 ++++++++----
.../test/test_newton_recording.py | 14 ++++++++++++++
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
index f1d3497aedd6..9f4085b3a0b2 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
@@ -259,7 +259,11 @@ def start_video(self) -> None:
self._video_limit = round(self.video_length * self._video_rate) if self.video_length > 0 else None
self._discard_unsaved_video()
folder = resolve_output_dir(self.output_dir) / "video"
- folder.mkdir(parents=True, exist_ok=True)
+ try:
+ folder.mkdir(parents=True, exist_ok=True)
+ except OSError as exc:
+ self._message = f"Could not create the video folder: {exc}"
+ return
self._video_temp = folder / f".unsaved_video_{os.getpid()}_{id(self):x}.mp4" # One file per panel.
self._video_started = datetime.now()
self._video = True # Opened on the first frame, once the framebuffer size is known.
@@ -327,8 +331,8 @@ def save_video(self) -> None:
temp = self._video_unsaved
if temp is None:
return
- path = self._output_path("video", ".mp4", self._video_started)
try:
+ path = self._output_path("video", ".mp4", self._video_started)
os.replace(temp, path)
except OSError as exc: # The clip stays in its temporary file, so Save can be pressed again.
self._message = f"Could not save the video: {exc}"
@@ -360,8 +364,8 @@ def save_checkpoint(self) -> None:
if self._checkpoint_saver is None:
self._message = "This run has no policy to save."
return
- path = self._output_path("checkpoint", ".pt")
try:
+ path = self._output_path("checkpoint", ".pt")
self._checkpoint_saver(str(path))
except Exception as exc:
logger.exception("[NewtonRecording] Could not save the policy checkpoint.")
@@ -395,8 +399,8 @@ def _write_screenshot(self, frame: np.ndarray) -> None:
"""Write one frame to the next screenshot file."""
from PIL import Image # noqa: PLC0415
- path = self._output_path("screenshot", ".png")
try:
+ path = self._output_path("screenshot", ".png")
Image.fromarray(np.ascontiguousarray(frame[..., :3], dtype=np.uint8)).save(path)
except Exception as exc:
logger.exception("[NewtonRecording] Could not save the screenshot.")
diff --git a/source/isaaclab_visualizers/test/test_newton_recording.py b/source/isaaclab_visualizers/test/test_newton_recording.py
index bdec5cff8331..a94915fa8c27 100644
--- a/source/isaaclab_visualizers/test/test_newton_recording.py
+++ b/source/isaaclab_visualizers/test/test_newton_recording.py
@@ -278,6 +278,20 @@ def test_an_encoder_that_exits_with_an_error_leaves_nothing_to_save(tmp_path):
assert not panel.unsaved_video and "ffmpeg failed" in panel._message
+def test_an_unwritable_output_folder_is_reported_instead_of_raised(tmp_path):
+ blocker = tmp_path / "file"
+ blocker.write_text("not a folder")
+ panel = NewtonRecordingPanel(_owner(frames=[np.zeros((4, 6, 3), np.uint8)], output_dir=str(blocker)))
+
+ panel.request_screenshot()
+ panel.capture()
+ assert "Screenshot failed" in panel._message
+
+ panel.set_checkpoint_saver(lambda path: None)
+ panel.save_checkpoint()
+ assert "Checkpoint failed" in panel._message
+
+
def test_each_panel_encodes_to_its_own_temporary_file_and_a_prefix_cannot_leave_the_folder(tmp_path, monkeypatch):
monkeypatch.setattr(newton_recording, "_ffmpeg_executable", lambda: "ffmpeg")
first = NewtonRecordingPanel(_owner(output_dir=str(tmp_path), filename_prefix="../outside"))
From 702e56d2b8cd3fe977a650a01c58e5019af50916 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Fri, 13 Nov 2026 00:17:52 +0000
Subject: [PATCH 070/140] Save a video to a folder on another filesystem
Co-Authored-By: Claude Sonnet 5.5
---
.../isaaclab_visualizers/newton/newton_recording.py | 2 +-
source/isaaclab_visualizers/test/test_newton_recording.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
index 9f4085b3a0b2..23f5a5162606 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
@@ -333,7 +333,7 @@ def save_video(self) -> None:
return
try:
path = self._output_path("video", ".mp4", self._video_started)
- os.replace(temp, path)
+ shutil.move(temp, path) # Also works when the folder is on another filesystem.
except OSError as exc: # The clip stays in its temporary file, so Save can be pressed again.
self._message = f"Could not save the video: {exc}"
return
diff --git a/source/isaaclab_visualizers/test/test_newton_recording.py b/source/isaaclab_visualizers/test/test_newton_recording.py
index a94915fa8c27..e2fc50cbd5f2 100644
--- a/source/isaaclab_visualizers/test/test_newton_recording.py
+++ b/source/isaaclab_visualizers/test/test_newton_recording.py
@@ -320,7 +320,7 @@ def test_a_failed_save_is_reported_as_a_save_error_and_can_be_retried(tmp_path,
panel.stop_video()
assert panel.unsaved_video
- monkeypatch.setattr("os.replace", Mock(side_effect=OSError("disk full")))
+ monkeypatch.setattr("shutil.move", Mock(side_effect=OSError("disk full")))
panel.save_video()
assert panel.unsaved_video and "disk full" in panel._message and "ffmpeg" not in panel._message
From 8db8887c1ff28d4556d80123071f73986f02ba79 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Mon, 16 Nov 2026 06:45:50 +0000
Subject: [PATCH 071/140] Put the video Include HUD option beside Start and
Stop
Co-Authored-By: Claude Sonnet 5.5
---
.../isaaclab_visualizers/newton/newton_recording.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
index 23f5a5162606..21478ad9c774 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
@@ -160,6 +160,7 @@ def _draw_video(self, imgui: Any) -> None:
imgui.end_disabled()
if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
imgui.set_tooltip("Keep the stopped video in the output folder")
+ imgui.same_line()
_c, self.video_include_hud = imgui.checkbox("Include HUD##video", self.video_include_hud)
hover_tooltip(imgui, "Draw the HUD panels into the recorded frames")
elapsed = f"{self._video_frames / max(self._video_rate, 1):.2f} s ({self._video_frames} frames)"
From 16165a55dab33ff0642502185c8828a7d70f1663 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Mon, 16 Nov 2026 07:32:55 +0000
Subject: [PATCH 072/140] Remove the policy checkpoint saver from the Newton
recording section
Co-Authored-By: Claude Sonnet 5.5
---
docs/source/concepts/visualization.rst | 4 +-
.../recording-checkpoint-saver.added.rst | 2 -
.../entrypoints/backends/play_rsl_rl.py | 3 -
.../entrypoints/backends/train_rsl_rl.py | 2 -
.../isaaclab_rl/entrypoints/common.py | 12 ----
.../newton-gl-recording-section.added.rst | 4 +-
.../newton/newton_recording.py | 59 ++-----------------
.../newton/newton_visualizer.py | 11 +---
.../newton/newton_visualizer_cfg.py | 2 +-
.../test/test_newton_recording.py | 31 ----------
10 files changed, 11 insertions(+), 119 deletions(-)
delete mode 100644 source/isaaclab_rl/changelog.d/recording-checkpoint-saver.added.rst
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index f808d87d3240..753a8d71e604 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -654,8 +654,8 @@ streaming views, and renderer-based sensor data capture.
Newton Window Recording
~~~~~~~~~~~~~~~~~~~~~~~
-The **Recording** section of the Newton visualizer saves three things: an ``mp4`` video of the window, a ``.png``
-screenshot of the window, and a ``.pt`` checkpoint of the policy being played. Files go to the output
+The **Recording** section of the Newton visualizer saves two things: an ``mp4`` video of the window and a ``.png``
+screenshot of the window. Files go to the output
folder set by :class:`~isaaclab_visualizers.newton.NewtonRecordingCfg`. Video and screenshots can include the HUD
panels with their **Include HUD** options.
diff --git a/source/isaaclab_rl/changelog.d/recording-checkpoint-saver.added.rst b/source/isaaclab_rl/changelog.d/recording-checkpoint-saver.added.rst
deleted file mode 100644
index bc821bc42126..000000000000
--- a/source/isaaclab_rl/changelog.d/recording-checkpoint-saver.added.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-* Added ``offer_checkpoint_saver`` to the RSL-RL play and train entrypoints so the Newton GL HUD's Checkpoint button
- saves the policy of the run.
diff --git a/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/play_rsl_rl.py b/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/play_rsl_rl.py
index e27b5d03bc96..f84087b0f1ae 100644
--- a/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/play_rsl_rl.py
+++ b/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/play_rsl_rl.py
@@ -11,7 +11,6 @@
import contextlib
import logging
import os
-import shutil
from rsl_rl.runners import DistillationRunner, OnPolicyRunner
@@ -37,7 +36,6 @@
describe_run,
enable_cameras_for_video,
normalize_task_name,
- offer_checkpoint_saver,
pre_launch_video_config,
resolve_checkpoint_selector,
resolve_published_checkpoint,
@@ -149,7 +147,6 @@ def run(argv: list[str]) -> None:
if args_cli.deterministic:
configure_seed(env_cfg.seed, torch_deterministic=True)
runner.load(resume_path)
- offer_checkpoint_saver(env, lambda path: shutil.copy2(resume_path, path))
policy = runner.get_inference_policy(device=env.unwrapped.device)
export_model_dir = os.path.join(log_dir, "exported")
diff --git a/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/train_rsl_rl.py b/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/train_rsl_rl.py
index 423b50bcba8b..9fdf33ad287d 100644
--- a/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/train_rsl_rl.py
+++ b/source/isaaclab_rl/isaaclab_rl/entrypoints/backends/train_rsl_rl.py
@@ -39,7 +39,6 @@
describe_run,
dump_train_configs,
enable_cameras_for_video,
- offer_checkpoint_saver,
pre_launch_video_config,
resolve_checkpoint_selector,
scoped_torch_backend_flags,
@@ -197,7 +196,6 @@ def _run(args_cli: argparse.Namespace) -> None:
map_location=agent_cfg.device,
)
dump_train_configs(rank_dir, env_cfg, agent_cfg)
- offer_checkpoint_saver(env, runner.save)
if agent_cfg.logger == "wandb":
announce_new_run(agent_cfg.wandb_project, resolve_wandb_entity())
diff --git a/source/isaaclab_rl/isaaclab_rl/entrypoints/common.py b/source/isaaclab_rl/isaaclab_rl/entrypoints/common.py
index 136e1f2dc8f4..4336811c89bd 100644
--- a/source/isaaclab_rl/isaaclab_rl/entrypoints/common.py
+++ b/source/isaaclab_rl/isaaclab_rl/entrypoints/common.py
@@ -555,18 +555,6 @@ def describe_run(env: gym.Env, task: str, mode: str, log_dir: str | None) -> Non
visualizer.set_run_info(task, mode, os.path.basename(log_dir) if log_dir else None)
-def offer_checkpoint_saver(env: gym.Env, save: Callable[[str], None]) -> None:
- """Enable the Checkpoint button in the HUD of every visualizer that has one.
-
- Args:
- env: Environment, possibly wrapped, whose simulation owns the visualizers.
- save: Callable that writes the run's policy checkpoint to the given path.
- """
- for visualizer in env.unwrapped.sim.visualizers:
- if hasattr(visualizer, "attach_checkpoint_saver"):
- visualizer.attach_checkpoint_saver(save)
-
-
def close_env(env: gym.Env) -> None:
"""Close the outermost environment wrapper; another SIGINT forces exit.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-gl-recording-section.added.rst b/source/isaaclab_visualizers/changelog.d/newton-gl-recording-section.added.rst
index 6346dc6e3589..4bccabec7b88 100644
--- a/source/isaaclab_visualizers/changelog.d/newton-gl-recording-section.added.rst
+++ b/source/isaaclab_visualizers/changelog.d/newton-gl-recording-section.added.rst
@@ -1,5 +1,5 @@
-* Added a Recording section to the Newton GL HUD that records the window to an ``mp4`` video and the policy being played
- or trained to a ``.pt`` checkpoint. A video stays in a temporary file when stopped and is kept with Save.
+* Added a Recording section to the Newton GL HUD that records the window to an ``mp4`` video and takes screenshots.
+ A video stays in a temporary file when stopped and is kept with Save.
* Added :class:`~isaaclab_visualizers.newton.NewtonRecordingCfg` (``NewtonGLBackendCfg.recording``) with the
output folder, file prefix, auto-numbering, and timestamp options shared by all recordings, plus the video frame
rate and a video length after which recording stops by itself.
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
index 21478ad9c774..bd0fd0bb37f9 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
@@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause
-"""Recording section of the Newton GL HUD: video, screenshots, and policy checkpoints."""
+"""Recording section of the Newton GL HUD: video and screenshots."""
from __future__ import annotations
@@ -13,7 +13,6 @@
import re
import shutil
import subprocess
-from collections.abc import Callable
from datetime import datetime
from pathlib import Path
from typing import TYPE_CHECKING, Any
@@ -65,7 +64,6 @@ class NewtonRecordingPanel:
"""Records the Newton GL window while the HUD asks for it.
* **Video** streams the displayed frames (OpenGL or RTX) to an ``mp4`` through ffmpeg, like ``--video``.
- * **Checkpoint** saves the policy being played or trained to a ``.pt`` file with one button press.
"""
def __init__(self, owner: NewtonGLVisualizer):
@@ -84,11 +82,10 @@ def __init__(self, owner: NewtonGLVisualizer):
"""Encoded frame rate [Hz]; ``0`` follows the window update rate."""
self.video_length = cfg.video_length or 0.0
"""Video duration [s] after which recording stops by itself; ``0`` records until stopped."""
- self.video_path = self.checkpoint_path = ""
- """Files written by the latest recording of each kind."""
+ self.video_path = ""
+ """File written by the latest video recording."""
self._video_rate = 0
self._video_limit: int | None = None
- self._checkpoint_saver: Callable[[str], None] | None = None
self._video_temp: Path | None = None
self._video_unsaved: Path | None = None
"""Finished clip that stays in a temporary file until :meth:`save_video` keeps it."""
@@ -127,14 +124,13 @@ def draw(self, imgui: Any) -> None:
imgui.pop_style_color()
hover_tooltip(
imgui,
- "Record a video, take a screenshot, or save a policy checkpoint",
+ "Record a video or take a screenshot",
)
if not expanded:
return
imgui.separator()
self._draw_video(imgui)
self._draw_screenshot(imgui)
- self._draw_checkpoint(imgui)
self._draw_output(imgui)
self._draw_message(imgui)
@@ -181,24 +177,6 @@ def _draw_screenshot(self, imgui: Any) -> None:
hover_tooltip(imgui, "Draw the HUD panels into the screenshot")
imgui.separator()
- def _draw_checkpoint(self, imgui: Any) -> None:
- """Draw the policy checkpoint group."""
- imgui.text("Checkpoint (.pt)")
- available = self._checkpoint_saver is not None
- if not available:
- imgui.begin_disabled()
- if imgui.button("Save##checkpoint"):
- self.save_checkpoint()
- if not available:
- imgui.end_disabled()
- if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
- imgui.set_tooltip(
- "Save the policy being played or trained to the output folder"
- if available
- else "Not available in this run: it has no policy to save"
- )
- imgui.separator()
-
def _draw_output(self, imgui: Any) -> None:
"""Draw the output folder, file prefix, and numbering options."""
imgui.text("Output")
@@ -206,7 +184,7 @@ def _draw_output(self, imgui: Any) -> None:
if imgui.is_item_hovered():
imgui.set_tooltip(
f"Root folder, currently {resolve_output_dir(self.output_dir)}."
- " Files go to /video, /screenshot, and /checkpoint"
+ " Files go to /video and /screenshot"
)
_c, self.filename_prefix = imgui.input_text("Prefix##recording", self.filename_prefix)
_c, self.auto_increment = imgui.checkbox("Auto-number", self.auto_increment)
@@ -348,33 +326,6 @@ def _discard_unsaved_video(self) -> None:
if temp is not None:
temp.unlink(missing_ok=True)
- # ------------------------------------------------------------------
- # Checkpoint
- # ------------------------------------------------------------------
-
- def set_checkpoint_saver(self, save: Callable[[str], None] | None) -> None:
- """Offer the policy of this run to the Checkpoint button.
-
- Args:
- save: Callable that writes the policy checkpoint to the given path, or None when the run has no policy.
- """
- self._checkpoint_saver = save
-
- def save_checkpoint(self) -> None:
- """Write the run's policy checkpoint to a numbered file in the output folder."""
- if self._checkpoint_saver is None:
- self._message = "This run has no policy to save."
- return
- try:
- path = self._output_path("checkpoint", ".pt")
- self._checkpoint_saver(str(path))
- except Exception as exc:
- logger.exception("[NewtonRecording] Could not save the policy checkpoint.")
- self._message = f"Checkpoint failed: {exc}"
- return
- self.checkpoint_path = str(path)
- self._message = f"Saved policy checkpoint to {self.checkpoint_path}"
-
# ------------------------------------------------------------------
# Per-frame capture
# ------------------------------------------------------------------
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index af49d0983c2e..dccafcd92f25 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -330,7 +330,7 @@ def _patch_viewer_panel(self) -> None:
2. **Camera View** (closed) — renderer (OpenGL or RTX), camera source, and renderer-specific options.
3. **Scene** (closed) — visible environments, visualization markers (a toggle per marker group, shared with Kit
and Viser), and visual overlays.
- 4. **Recording** (closed) — video, screenshot, policy checkpoint, and their output settings.
+ 4. **Recording** (closed) — video, screenshot, and their output settings.
5. **Live Plots** (closed) — injected when :meth:`~NewtonGLVisualizer.add_live_plots` is called.
6. **Articulation Inspector** (closed) — Newton's articulation selection panel.
7. **Control Bindings** (closed) — the camera, keyboard, and mouse controls and what each one does.
@@ -2229,15 +2229,6 @@ def set_run_info(self, task: str | None = None, mode: str | None = None, run: st
if self._viewer is not None:
self._viewer.set_run_info(task, mode, run)
- def attach_checkpoint_saver(self, save: Callable[[str], None]) -> None:
- """Enable the HUD's Checkpoint button for a run that has a policy.
-
- Args:
- save: Callable that writes the policy checkpoint to the given path.
- """
- if self._recording is not None:
- self._recording.set_checkpoint_saver(save)
-
@property
def visible_env_limit(self) -> int:
"""Largest value of the visible-environment count: the environments the cfg allows, else all."""
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
index 95cfbb4a7725..22baf1ff0378 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
@@ -22,7 +22,7 @@
class NewtonRecordingCfg:
"""Output settings of the Recording section in the Newton GL HUD.
- Every output lands in ``//``, where ``kind`` is ``video``, ``screenshot``, or ``checkpoint``.
+ Every output lands in ``//``, where ``kind`` is ``video`` or ``screenshot``.
The HUD edits a copy of these values while the window is open.
"""
diff --git a/source/isaaclab_visualizers/test/test_newton_recording.py b/source/isaaclab_visualizers/test/test_newton_recording.py
index e2fc50cbd5f2..1e1a1482635f 100644
--- a/source/isaaclab_visualizers/test/test_newton_recording.py
+++ b/source/isaaclab_visualizers/test/test_newton_recording.py
@@ -6,7 +6,6 @@
"""Tests for the Newton GL HUD recording panel without a window."""
import re
-from pathlib import Path
from types import SimpleNamespace
from unittest.mock import Mock
@@ -40,32 +39,6 @@ def _owner(frames=(), **recording):
)
-def test_checkpoint_writes_through_the_runs_saver_into_numbered_files(tmp_path):
- panel = NewtonRecordingPanel(_owner(output_dir=str(tmp_path)))
- panel.save_checkpoint()
- assert "no policy" in panel._message # Nothing is written until the run offers a saver.
-
- panel.set_checkpoint_saver(lambda path: Path(path).write_text("policy"))
- panel.save_checkpoint()
- panel.save_checkpoint()
-
- folder = tmp_path / "checkpoint"
- assert sorted(file.name for file in folder.iterdir()) == ["newton_0001.pt", "newton_0002.pt"]
- assert panel.checkpoint_path == str(folder / "newton_0002.pt")
-
-
-def test_checkpoint_failure_is_reported_without_raising(tmp_path):
- def broken(path):
- raise OSError("disk full")
-
- panel = NewtonRecordingPanel(_owner(output_dir=str(tmp_path)))
- panel.set_checkpoint_saver(broken)
-
- panel.save_checkpoint()
-
- assert "disk full" in panel._message and not panel.checkpoint_path
-
-
def test_output_paths_number_stamp_or_overwrite(tmp_path):
panel = NewtonRecordingPanel(_owner(output_dir=str(tmp_path), filename_prefix="run"))
@@ -287,10 +260,6 @@ def test_an_unwritable_output_folder_is_reported_instead_of_raised(tmp_path):
panel.capture()
assert "Screenshot failed" in panel._message
- panel.set_checkpoint_saver(lambda path: None)
- panel.save_checkpoint()
- assert "Checkpoint failed" in panel._message
-
def test_each_panel_encodes_to_its_own_temporary_file_and_a_prefix_cannot_leave_the_folder(tmp_path, monkeypatch):
monkeypatch.setattr(newton_recording, "_ffmpeg_executable", lambda: "ffmpeg")
From 92f4785c9b66d7ec5531c3487c4febf762ca2e1e Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Mon, 16 Nov 2026 07:59:21 +0000
Subject: [PATCH 073/140] Merge the two output folder resolution tests
Co-Authored-By: Claude Sonnet 5.5
---
.../test/test_newton_recording.py | 25 +++++++------------
1 file changed, 9 insertions(+), 16 deletions(-)
diff --git a/source/isaaclab_visualizers/test/test_newton_recording.py b/source/isaaclab_visualizers/test/test_newton_recording.py
index 1e1a1482635f..4769fa16925d 100644
--- a/source/isaaclab_visualizers/test/test_newton_recording.py
+++ b/source/isaaclab_visualizers/test/test_newton_recording.py
@@ -120,25 +120,18 @@ def test_closing_keeps_a_running_video(tmp_path):
assert (tmp_path / "video" / "newton_0001.mp4").exists()
-def test_relative_output_folder_lands_in_the_repository_not_the_working_directory(tmp_path, monkeypatch):
- repo, elsewhere = tmp_path / "repo", tmp_path / "elsewhere"
- (repo / "source").mkdir(parents=True)
- elsewhere.mkdir()
- monkeypatch.setattr(newton_recording, "ISAACLAB_ROOT", repo)
- monkeypatch.chdir(elsewhere)
-
- assert resolve_output_dir("recording") == repo / "recording"
- assert resolve_output_dir(str(tmp_path / "absolute")) == tmp_path / "absolute"
-
-
-def test_relative_output_folder_uses_the_working_directory_without_a_source_checkout(tmp_path, monkeypatch):
- package, cwd = tmp_path / "site-packages" / "isaaclab", tmp_path / "cwd"
- package.mkdir(parents=True)
+@pytest.mark.parametrize("source_checkout", [True, False])
+def test_relative_output_folder_follows_the_repository_only_in_a_source_checkout(
+ tmp_path, monkeypatch, source_checkout
+):
+ root, cwd = tmp_path / "root", tmp_path / "cwd"
+ (root / "source" if source_checkout else root).mkdir(parents=True)
cwd.mkdir()
- monkeypatch.setattr(newton_recording, "ISAACLAB_ROOT", package)
+ monkeypatch.setattr(newton_recording, "ISAACLAB_ROOT", root)
monkeypatch.chdir(cwd)
- assert resolve_output_dir("recording") == cwd / "recording"
+ assert resolve_output_dir("recording") == (root if source_checkout else cwd) / "recording"
+ assert resolve_output_dir(str(tmp_path / "absolute")) == tmp_path / "absolute"
class _StrictImgui:
From dc4f287ac646d19b61ad3269903391c57205b151 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 18 Nov 2026 23:14:04 +0000
Subject: [PATCH 074/140] Start the Newton window in RTX when newton_rtx is
selected
---
.../newton-visualizer-name.changed.rst | 6 +++---
source/isaaclab/isaaclab/app/sim_launcher.py | 15 ++++++++++++++-
.../isaaclab/visualizers/visualizer_cfg.py | 7 +++++--
.../app/test_launch_simulation_require_kit.py | 1 +
4 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/source/isaaclab/changelog.d/newton-visualizer-name.changed.rst b/source/isaaclab/changelog.d/newton-visualizer-name.changed.rst
index 2a2ec848b0f9..14824c0270cf 100644
--- a/source/isaaclab/changelog.d/newton-visualizer-name.changed.rst
+++ b/source/isaaclab/changelog.d/newton-visualizer-name.changed.rst
@@ -1,4 +1,4 @@
* **Breaking:** Renamed the ``newton_gl`` visualizer selector to ``newton``. ``newton_gl`` still selects it, and
- ``newton_rtx`` is a deprecated alias that launches ``newton``, which supports RTX rendering, with a
- :class:`FutureWarning` saying the option is removed in the next release. The same applies to ``viz:`` video
- sources and to ``visualizer=newton_rtx`` presets.
+ ``newton_rtx`` is a deprecated alias that launches ``newton`` with ``initial_renderer="rtx"``, so the window opens
+ in RTX rendering, with a :class:`FutureWarning` saying the option is removed in the next release. ``viz:``
+ video sources and ``visualizer=newton_rtx`` presets select ``newton`` with the default OpenGL renderer.
diff --git a/source/isaaclab/isaaclab/app/sim_launcher.py b/source/isaaclab/isaaclab/app/sim_launcher.py
index d3e07f625cc4..2d0cd03bc7ee 100644
--- a/source/isaaclab/isaaclab/app/sim_launcher.py
+++ b/source/isaaclab/isaaclab/app/sim_launcher.py
@@ -41,7 +41,12 @@
from ..utils.math import create_rotation_matrix_from_view, quat_from_matrix
from ..utils.string import string_to_callable
from ..visualizers import ImageViewCfg, VisualizerBackendCfg, VisualizerCfg
-from ..visualizers.visualizer_cfg import VISUALIZER_ALIASES, migrate_visualizer_cfgs, warn_deprecated_visualizer
+from ..visualizers.visualizer_cfg import (
+ VISUALIZER_ALIAS_OPTIONS,
+ VISUALIZER_ALIASES,
+ migrate_visualizer_cfgs,
+ warn_deprecated_visualizer,
+)
from .logging_utils import apply_python_logging_level, ensure_console_handlers, resolve_python_logging_level
from .settings_manager import get_settings_manager
@@ -255,6 +260,9 @@ def validate_launch( # noqa: C901
if selection is not None:
for name in selection:
warn_deprecated_visualizer(name, stacklevel=3)
+ alias_options = {}
+ for name in selection:
+ alias_options.update(VISUALIZER_ALIAS_OPTIONS.get(name, {}))
selection = list(dict.fromkeys(VISUALIZER_ALIASES.get(name, name) for name in selection))
if selection == ["none"]:
selection = []
@@ -297,6 +305,11 @@ def validate_launch( # noqa: C901
or [viewer.replace(backend=visualizer_types[name]()) for viewer in declarations]
)
node.visualizer_cfgs = viewers
+ if alias_options: # a deprecated name that also chose how the window starts, such as newton_rtx
+ for viewer in node.visualizer_cfgs:
+ if isinstance(viewer.backend, NewtonGLBackendCfg):
+ for option, value in alias_options.items():
+ setattr(viewer.backend, option, value)
if livestream or launcher_args.get("xr", False):
if not any(isinstance(viewer.backend, KitBackendCfg) for viewer in node.visualizer_cfgs):
node.visualizer_cfgs.append(
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index 5383a93f1c60..764e135e8631 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -28,11 +28,14 @@
VISUALIZER_ALIASES = {"newton_gl": "newton", "newton_rtx": "newton"}
"""Alternative ``--visualizer`` names and the identifiers they select."""
+VISUALIZER_ALIAS_OPTIONS = {"newton_rtx": {"initial_renderer": "rtx"}}
+"""Backend options an alias in :data:`VISUALIZER_ALIASES` sets on the visualizer it selects."""
+
DEPRECATED_VISUALIZER_ALIASES = {
"newton_rtx": (
"The 'newton_rtx' visualizer option is deprecated and will be removed in the next release; launching the"
- " 'newton' visualizer instead. It supports RTX rendering: switch the Renderer to RTX in its window, or set"
- " NewtonGLBackendCfg.initial_renderer='rtx' to start in RTX."
+ " 'newton' visualizer instead, started with RTX rendering. Use 'newton' and switch the Renderer to RTX in its"
+ " window, or set NewtonGLBackendCfg.initial_renderer='rtx' to start in RTX."
)
}
"""Names in :data:`VISUALIZER_ALIASES` that are deprecated, each with the warning that says what happens instead."""
diff --git a/source/isaaclab/test/app/test_launch_simulation_require_kit.py b/source/isaaclab/test/app/test_launch_simulation_require_kit.py
index 32100ea1140a..f7cf780c353d 100644
--- a/source/isaaclab/test/app/test_launch_simulation_require_kit.py
+++ b/source/isaaclab/test/app/test_launch_simulation_require_kit.py
@@ -110,6 +110,7 @@ def test_newton_rtx_selection_launches_newton_with_a_deprecation_warning():
with pytest.warns(FutureWarning, match="'newton_rtx' visualizer option is deprecated.*next release"):
sim_launcher.validate_launch(cfg, {"visualizer": ["newton_rtx"]})
assert [viz.backend.visualizer_type for viz in cfg.visualizer_cfgs] == ["newton"]
+ assert [viz.backend.initial_renderer for viz in cfg.visualizer_cfgs] == ["rtx"]
def test_newton_gl_alias_selects_newton_without_a_warning():
From ccf600c38e2628563a5cf162b6129898dab085d2 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Wed, 18 Nov 2026 23:57:33 +0000
Subject: [PATCH 075/140] Replace the remaining Rerun examples in the
visualization docs with Viser
---
docs/source/concepts/visualization.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index 1bcda65f3748..71d58c67def4 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -197,7 +197,7 @@ Backend-specific options are available when needed, but ordinary configuration u
Use a list of ``VisualizerCfg`` declarations for different views or window sizes. Backend selection
applies to each declaration independently. For example, a task with these two views opens four
-windows with ``--viz=newton,rerun``: one Newton and one Rerun window per view.
+windows with ``--viz=newton,viser``: one Newton and one Viser window per view.
.. code-block:: python
@@ -850,9 +850,9 @@ only needed for independently configured views, such as a different camera angle
* - no ``--viz``
- ``VisualizerCfg(backend=MultiBackendVisualizerCfg())``
- No visualizer launches; backend alternatives remain inactive until selected.
- * - ``visualizer=rerun,newton``
+ * - ``visualizer=viser,newton``
- ``VisualizerCfg(max_visible_envs=16, backend=MultiBackendVisualizerCfg())``
- - Launch Rerun and Newton, both showing at most 16 environments.
+ - Launch Viser and Newton, both showing at most 16 environments.
For migration context, see :doc:`/source/isaaclab/migrating`.
From 7200706e9dc38e004b1cec289ecfdf1470173e68 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 00:01:23 +0000
Subject: [PATCH 076/140] Leave the shared OVRTX renderer alone in OpenGL, keep
a dome light turned off, and respect explicit stream environments
---
.../isaaclab/isaaclab/sim/simulation_context.py | 3 ++-
.../newton/newton_rtx_appearance.py | 3 ++-
.../newton/newton_visualizer.py | 10 ++++++++--
.../test/test_newton_rtx_appearance.py | 16 ++++++++++++++++
.../test/test_newton_task_views.py | 7 +++++--
5 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index 8ae781985c00..d25a9c8b9988 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -458,7 +458,8 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
if resolve_display_channels(visualizer.cfg.streaming_gt_types, camera.cfg.data_types):
cameras.append(camera)
rtx_path = getattr(visualizer.cfg.backend, "rtx_camera_prim_path", None)
- if rtx_path is not None and not (visualizer.cfg.cameras is None or tracking_only):
+ rgb_requested = "rgb" in visualizer.cfg.streaming_gt_types # the viewer camera provides only RGBA
+ if rgb_requested and rtx_path is not None and not (visualizer.cfg.cameras is None or tracking_only):
# Explicit cameras skip discovery; the Renderer switch still needs this window's RTX camera.
cameras.append(SceneCameraCfg(prim_path=rtx_path))
for index, source in enumerate(cameras):
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
index 06b383c1d94c..0b8705a449dc 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
@@ -257,6 +257,8 @@ def set_dome_texture(self, source: str) -> None:
"""
self.dome_texture = source
self._texture_result = None # a download that finished for an earlier choice must not be applied
+ if source:
+ self.dome_enabled = True # choosing a sky turns the dome on; a later off choice must survive the download
if not source:
self._dome_texture_file, self.texture_status = "", ""
self._apply_texture()
@@ -295,7 +297,6 @@ def _apply_texture(self) -> bool:
self._renderer.backend.renderer.remove_usd(reference)
except Exception:
logger.debug("[NewtonRtxAppearance] The dome light was already removed.", exc_info=True)
- self.dome_enabled = True if self._dome_texture_file else self.dome_enabled
return self.apply_lights()
def use_sky(self, source: str) -> None:
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 9d7f430aacbf..f92595e83f0e 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -744,7 +744,9 @@ class NewtonVisualizerBase(BaseVisualizer):
_overlay_publisher: OverlayMeshPublisher | None = None
_rtx_arrows_pending = False
+ _rtx_visibility_limited = False
_rtx_overlay_flags: tuple | None = None
+ _rtx_visibility_limited = False
# The OpenGL window overrides these; the standalone RTX window has no OpenGL view to switch to.
rtx_view_index: int | None = None
@@ -1792,7 +1794,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
if camera is not None and camera.num_instances > 1 and view is not self._rtx_view():
# Tile the first environments unless the view chose its own; the HUD changes how many.
self._sensor_tiles[view] = camera.num_instances
- if self.cfg.view is None and view.cfg.envs == (0,):
+ if self.cfg.view is None and not isinstance(self.cfg.streaming_envs, list) and view.cfg.envs == (0,):
view.cfg.envs = tuple(range(min(DEFAULT_TILED_ENVS, camera.num_instances)))
self._select_camera(0)
if self.cfg.enable_markers and self.rtx_view_index is not None:
@@ -2084,12 +2086,16 @@ def _apply_rtx_visible_envs(self) -> None:
renderer = self._sim.get_or_create_backend(self._image_views[index].camera.cfg.renderer_cfg)
num_envs = len(renderer._env_paths)
if num_envs:
- # The renderer is shared with scene cameras, so the limit applies only while the RTX view is shown.
+ # The renderer is shared with scene cameras, so the limit applies only while the RTX view is shown, and
+ # OpenGL leaves the renderer alone unless an earlier limit has to be lifted.
limited = self._env_ids is not None and self.rtx_rendering
+ if not limited and not self._rtx_visibility_limited:
+ return
visible = np.zeros(num_envs, dtype=bool) if limited else np.ones(num_envs, dtype=bool)
if limited:
visible[np.asarray(list(self._env_ids), dtype=int)] = True
renderer.set_environment_visibility(visible)
+ self._rtx_visibility_limited = limited
self._image_views[index].invalidate()
def reset(self, soft: bool = False) -> None:
diff --git a/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py b/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
index c9a71401062b..9226ecfe1269 100644
--- a/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
+++ b/source/isaaclab_visualizers/test/test_newton_rtx_appearance.py
@@ -208,6 +208,22 @@ def test_a_sky_texture_is_loaded_in_the_background_and_adds_the_dome_light_again
assert appearance.texture_status == ""
+def test_turning_the_dome_off_while_a_sky_downloads_keeps_it_off(monkeypatch):
+ monkeypatch.setattr(module, "retrieve_file_path", lambda source: "/cache/sky.hdr")
+ appearance, _ = _appearance()
+
+ appearance.use_sky("https://assets/skies/lakeside.hdr")
+ assert appearance.dome_enabled # choosing a sky turns the dome on
+ appearance.dome_enabled = False # the user turns it off before the download finishes
+ deadline = time.time() + 5
+ while appearance._texture_thread.is_alive():
+ assert time.time() < deadline
+ time.sleep(0.01)
+ appearance.poll()
+
+ assert not appearance.dome_enabled
+
+
def test_a_sky_download_superseded_by_another_choice_is_not_applied(monkeypatch):
import threading
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index a7761ab26f25..3a4d539e8d55 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -218,11 +218,14 @@ def test_the_shared_renderer_hides_environments_only_while_the_rtx_view_is_shown
viz._sim.get_or_create_backend = lambda cfg: renderer
viz._env_ids = [0]
- viz._apply_rtx_visible_envs() # OpenGL is shown, so the sensors keep every environment
+ viz._apply_rtx_visible_envs() # OpenGL is shown, so the renderer the sensors share is left alone
+ assert calls == []
viz.current_image_view = rtx
viz._apply_rtx_visible_envs()
+ viz.current_image_view = viz._image_views[0]
+ viz._apply_rtx_visible_envs() # leaving RTX lifts the limit once
- assert calls == [[True, True, True], [True, False, False]]
+ assert calls == [[True, False, False], [True, True, True]]
def test_the_standalone_rtx_window_has_no_opengl_view_state():
From 244f465fb7791365bf92d112e05a45f2fdf743cf Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 00:04:34 +0000
Subject: [PATCH 077/140] Fix the renderer switch pose, standalone RTX meshes,
RTX overlay docs, and add the RTX lighting note
---
docs/source/concepts/visualization.rst | 8 ++--
.../changelog.d/newton-rtx-overlays.added.rst | 5 +--
.../newton/newton_visualizer.py | 38 +++++++++++++++----
.../test/test_newton_task_views.py | 15 ++++++++
4 files changed, 52 insertions(+), 14 deletions(-)
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index 71d58c67def4..d5549da2993b 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -307,8 +307,8 @@ Visualizer Overview
staircase sub-terrain
Picking, visualization markers, camera selection, pause controls, Visible Envs, and headless recording work in
- the RTX view, and picking draws the drag arrow there. Joint, contact, spring, center-of-mass, and inertia overlays are drawn in the RTX view too; the collision,
- visual, edge, and wireframe overlays apply to the OpenGL view only.
+ the RTX view, and picking draws the drag arrow there. The model overlays (joint, contact, spring,
+ center-of-mass, inertia, collision, visual, edge, and wireframe) apply to the OpenGL view only.
.. warning::
@@ -977,8 +977,8 @@ Limitations
- ✗
- ✓
-In Newton's RTX view, the collision, visual, edge, and wireframe overlays are not available; joint, contact, spring,
-center-of-mass, and inertia overlays are.
+In Newton's RTX view, only the picking drag arrow is drawn; the model overlays (joint, contact, spring,
+center-of-mass, inertia, collision, visual, edge, and wireframe) are not available.
**Lighting differences across visualizers**
diff --git a/source/isaaclab_visualizers/changelog.d/newton-rtx-overlays.added.rst b/source/isaaclab_visualizers/changelog.d/newton-rtx-overlays.added.rst
index cd82d101d617..5dfe467762a6 100644
--- a/source/isaaclab_visualizers/changelog.d/newton-rtx-overlays.added.rst
+++ b/source/isaaclab_visualizers/changelog.d/newton-rtx-overlays.added.rst
@@ -1,3 +1,2 @@
-* Added joint, contact, spring, center-of-mass, and inertia-box overlays to the Newton visualizer's RTX view. Newton's
- line and arrow overlays are republished as thin meshes in the OVRTX scene. Collision shapes, visual meshes, edges,
- and the gap and margin wireframes remain OpenGL only.
+* Added the picking drag arrow to the Newton visualizer's RTX view, drawn as thin meshes in the OVRTX scene. The model
+ overlays, such as joints, contacts, collision shapes, and wireframes, remain OpenGL only.
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 4da596bd340c..68b1586dbcfa 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -892,6 +892,11 @@ def _log_particles(self, state):
)
+def _is_ovrtx(renderer_cfg) -> bool:
+ """Whether a camera's renderer config selects the OVRTX renderer."""
+ return getattr(renderer_cfg, "renderer_type", None) == "ovrtx"
+
+
class NewtonVisualizerBase(BaseVisualizer):
"""Own Newton resource bindings, frame cadence, and camera selection for both renderers."""
@@ -1042,19 +1047,31 @@ def log_mesh(
f"Viewer_{id(self)}/{name.lstrip('/')}", points, indices, normals, uvs, texture, hidden,
backface_culling, color, roughness, metallic, dynamic, opacity,
) # fmt: skip
- if renderers and self.rtx_rendering:
+ view = self.current_image_view
+ camera = getattr(view, "camera", None)
+ if renderers and camera is not None and (self.rtx_rendering or _is_ovrtx(camera.cfg.renderer_cfg)):
# The cached RTX image predates the mesh, which matters while paused or between renders.
- view = self._image_views[self.rtx_view_index]
view.camera._invalidate_buffers()
view.invalidate()
@property
def _rtx_renderers(self) -> tuple:
- """OVRTX renderers of the viewer camera; empty when the scene has none."""
- index = getattr(self, "rtx_view_index", None)
- if index is None or self._sim is None:
+ """OVRTX renderers of the viewer camera and of the scene camera the window displays; empty when neither is."""
+ if self._sim is None:
return ()
- return (self._sim.get_or_create_backend(self._image_views[index].camera.cfg.renderer_cfg),)
+ index = getattr(self, "rtx_view_index", None)
+ views = [] if index is None else [self._image_views[index]]
+ current = getattr(self, "current_image_view", None)
+ if current is not None and all(current is not view for view in views):
+ views.append(current)
+ renderers = {}
+ for view in views:
+ camera = getattr(view, "camera", None)
+ cfg = None if camera is None else camera.cfg.renderer_cfg
+ if cfg is not None and (index is not None and view is self._image_views[index] or _is_ovrtx(cfg)):
+ renderer = self._sim.get_or_create_backend(cfg)
+ renderers[id(renderer)] = renderer
+ return tuple(renderers.values())
@staticmethod
def _is_tracking_view(view) -> bool:
@@ -1199,6 +1216,11 @@ def light_changed(changed: bool) -> bool:
def intensity(label: str, value: float, high: float) -> tuple[bool, float]:
return imgui.slider_float(label, value, 0.0, high, "%.0f", imgui.SliderFlags_.logarithmic)
+ imgui.push_style_color(imgui.Col_.text, imgui.ImVec4(0.55, 0.7, 0.95, 0.85))
+ imgui.text_wrapped(
+ "In RTX mode, changing the lighting edits the scene itself, so cameras that share its renderer see it too."
+ )
+ imgui.pop_style_color()
imgui.separator_text("Lights")
if appearance.lights:
changed, appearance.scene_enabled = imgui.checkbox("Scene Lights", appearance.scene_enabled)
@@ -2211,7 +2233,9 @@ def set_rtx_rendering(self, enabled: bool) -> None:
self._overlay_publisher.hide_all(self._rtx_renderers)
back = self._rtx_pose_view # _select_camera clears it after the outgoing pose is saved
fallback = free[0] if free else next(i for i in range(len(self._image_views)) if i != rtx_index)
- self._select_camera(self._image_views.index(back) if back is not None else fallback, keep_pose=True)
+ target = self._image_views.index(back) if back is not None else fallback
+ # Only a perspective view continues from the viewer's pose; a scene sensor keeps the task's own placement.
+ self._select_camera(target, keep_pose=self._image_views[target].camera is None)
self._apply_rtx_visible_envs() # restore every environment to the sensors that share the renderer
def set_run_info(self, task: str | None = None, mode: str | None = None, run: str | None = None) -> None:
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index fbd658759537..6bc351753d1b 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -168,7 +168,10 @@ def _switchable(views):
viz._sim.get_or_create_backend = lambda cfg: cfg
viz.hidden, viz.current_image_view = [], views[0]
+ viz.keep_pose = []
+
def select(index, keep_pose=False):
+ viz.keep_pose.append(keep_pose)
viz.current_image_view = viz._image_views[index]
viz._select_camera = select
@@ -197,6 +200,18 @@ def test_leaving_rtx_without_a_free_perspective_view_shows_the_first_other_sourc
viz.set_rtx_rendering(False)
assert viz.current_image_view is sensor
+ assert viz.keep_pose == [False] # A scene sensor is not moved to the viewer's pose.
+
+
+def test_meshes_reach_the_ovrtx_scene_camera_a_standalone_window_displays():
+ ovrtx = SimpleNamespace(renderer_type="ovrtx")
+ sensor = _View("sensor", camera=SimpleNamespace(cfg=SimpleNamespace(prim_path="/World/Camera", renderer_cfg=ovrtx)))
+ other = _View("other", camera=SimpleNamespace(cfg=SimpleNamespace(prim_path="/World/Other", renderer_cfg=ovrtx)))
+ viz = _switchable([sensor, other])
+ viz._sim.get_or_create_backend = lambda cfg: cfg
+
+ assert viz.rtx_view_index is None
+ assert viz._rtx_renderers == (ovrtx,) # only the displayed sensor, not every scene camera
def test_rtx_rendering_needs_the_viewer_camera_declared_at_launch():
From b15a58923f9817f3f05d12277049cafbbd62b790 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 00:04:56 +0000
Subject: [PATCH 078/140] Record the RTX window for a free view while the
window shows RTX
---
.../isaaclab_visualizers/newton/newton_visualizer.py | 3 ++-
.../test/test_newton_task_views.py | 10 ++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 68b1586dbcfa..80d05404c5cb 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -1738,7 +1738,8 @@ def _navigate_scene_camera(self) -> None:
def _capture_view(self, view, output: wp.array | None) -> wp.array:
"""Capture a perspective *view*, borrowing the viewer camera when the window shows another one."""
current = self.current_image_view
- if view is current:
+ if view is current or (self.rtx_rendering and not self._is_tracking_view(view)):
+ # While the window shows RTX, a free view records what the window shows instead of an OpenGL render.
return self._capture_frame(output)
camera = self._viewer.camera
saved = (PygletVec3(camera.pos.x, camera.pos.y, camera.pos.z), camera.pitch, camera.yaw, camera.fov)
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index 6bc351753d1b..b167119831e3 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -247,3 +247,13 @@ def test_the_standalone_rtx_window_has_no_opengl_view_state():
viz = NewtonVisualizerBase.__new__(NewtonVisualizerBase)
assert viz.rtx_view_index is None and not viz.rtx_rendering and not viz.sensor_view_selected
+
+
+def test_a_free_view_records_the_rtx_window_instead_of_an_opengl_render():
+ free, rtx = _view(PerspectiveCameraCfg()), _rtx_view()
+ viz = _switchable([free, rtx])
+ viz.current_image_view = rtx
+ viz._capture_frame = lambda output: "window frame"
+
+ assert viz._capture_view(free, None) == "window frame"
+ assert viz.current_image_view is rtx
From efb59b179e7d549ef4381f01c70cd8f27f8b4f26 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 00:06:16 +0000
Subject: [PATCH 079/140] Reserve numbered recording names and keep other-view
captures out of the HUD recording
---
.../newton/newton_recording.py | 22 +++++++++++++++++--
.../newton/newton_visualizer.py | 5 ++++-
.../test/test_newton_recording.py | 14 ++++++++++--
.../test/test_newton_task_views.py | 14 ++++++++++++
4 files changed, 50 insertions(+), 5 deletions(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
index bd0fd0bb37f9..48f1d18f01dc 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_recording.py
@@ -210,7 +210,10 @@ def _draw_message(self, imgui: Any) -> None:
imgui.pop_style_color()
def _output_path(self, kind: str, suffix: str, when: datetime | None = None) -> Path:
- """Return the next file of ``kind`` from the output settings, creating its folder."""
+ """Return the next file of ``kind`` from the output settings, creating its folder.
+
+ A numbered file is created empty, which reserves its name until the recording replaces it.
+ """
folder = resolve_output_dir(self.output_dir) / kind
folder.mkdir(parents=True, exist_ok=True)
name = Path(self.filename_prefix).name or "newton" # The prefix names a file, never a folder.
@@ -220,7 +223,16 @@ def _output_path(self, kind: str, suffix: str, when: datetime | None = None) ->
return folder / f"{name}{suffix}"
pattern = re.compile(rf"^{re.escape(name)}_(\d+){re.escape(suffix)}$")
indices = [int(match.group(1)) for file in folder.iterdir() if (match := pattern.match(file.name))]
- return folder / f"{name}_{max(indices, default=0) + 1:04d}{suffix}"
+ index = max(indices, default=0) + 1
+ while True:
+ path = folder / f"{name}_{index:04d}{suffix}"
+ try:
+ with path.open("xb"): # Reserve the name, so another process cannot choose the same number.
+ pass
+ except FileExistsError:
+ index += 1
+ continue
+ return path
# ------------------------------------------------------------------
# Video
@@ -310,10 +322,13 @@ def save_video(self) -> None:
temp = self._video_unsaved
if temp is None:
return
+ path = None
try:
path = self._output_path("video", ".mp4", self._video_started)
shutil.move(temp, path) # Also works when the folder is on another filesystem.
except OSError as exc: # The clip stays in its temporary file, so Save can be pressed again.
+ if path is not None and self.auto_increment:
+ path.unlink(missing_ok=True) # Release the reserved name.
self._message = f"Could not save the video: {exc}"
return
self._video_unsaved = None
@@ -351,10 +366,13 @@ def _write_screenshot(self, frame: np.ndarray) -> None:
"""Write one frame to the next screenshot file."""
from PIL import Image # noqa: PLC0415
+ path = None
try:
path = self._output_path("screenshot", ".png")
Image.fromarray(np.ascontiguousarray(frame[..., :3], dtype=np.uint8)).save(path)
except Exception as exc:
+ if path is not None and self.auto_increment:
+ path.unlink(missing_ok=True) # Release the reserved name.
logger.exception("[NewtonRecording] Could not save the screenshot.")
self._message = f"Screenshot failed: {exc}"
return
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index abeba9d3834b..f4d8abcfb622 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -906,6 +906,7 @@ class NewtonVisualizerBase(BaseVisualizer):
"""Prim path of the viewer camera launch declared for this window; None accepts any viewer camera."""
_rtx_arrows_pending = False
_rtx_visibility_limited = False
+ _capturing_another_view = False
# The OpenGL window overrides these; the standalone RTX window has no OpenGL view to switch to.
rtx_view_index: int | None = None
@@ -1746,6 +1747,7 @@ def _capture_view(self, view, output: wp.array | None) -> wp.array:
saved = (PygletVec3(camera.pos.x, camera.pos.y, camera.pos.z), camera.pitch, camera.yaw, camera.fov)
try:
self.current_image_view = view
+ self._capturing_another_view = True # the HUD recording keeps the frames the window itself shows
if not self._is_tracking_view(view): # a free view renders from its declared pose and optics
source = view.cfg.source
camera.pos = PygletVec3(*source.eye)
@@ -1755,6 +1757,7 @@ def _capture_view(self, view, output: wp.array | None) -> wp.array:
self._last_render_step = -1
return self._capture_frame(output)
finally:
+ self._capturing_another_view = False
self.current_image_view = current
camera.fov = saved[3]
self._viewer.set_camera(*saved[:3])
@@ -2113,7 +2116,7 @@ def _render_frame(self) -> None:
viewer.end_frame()
if not viewer.is_running():
self._viewer_picking_binding.deactivate()
- if self._recording is not None:
+ if self._recording is not None and not self._capturing_another_view:
self._recording.capture(paused=viewer.is_paused())
self._last_render_step = self._sim.get_physics_step_count()
if self.current_image_view.camera is None:
diff --git a/source/isaaclab_visualizers/test/test_newton_recording.py b/source/isaaclab_visualizers/test/test_newton_recording.py
index 4769fa16925d..e4a777a875e0 100644
--- a/source/isaaclab_visualizers/test/test_newton_recording.py
+++ b/source/isaaclab_visualizers/test/test_newton_recording.py
@@ -54,6 +54,15 @@ def test_output_paths_number_stamp_or_overwrite(tmp_path):
assert (tmp_path / "scene").is_dir()
+def test_numbered_files_are_reserved_so_two_savers_never_pick_the_same_name(tmp_path):
+ first = NewtonRecordingPanel(_owner(output_dir=str(tmp_path), filename_prefix="run"))
+ second = NewtonRecordingPanel(_owner(output_dir=str(tmp_path), filename_prefix="run"))
+
+ names = [first._output_path("video", ".mp4").name, second._output_path("video", ".mp4").name]
+
+ assert names == ["run_0001.mp4", "run_0002.mp4"] # the first name was taken before it was written
+
+
@pytest.mark.skipif(_ffmpeg_executable() is None, reason="ffmpeg is not installed")
def test_video_streams_frames_and_ignores_resized_ones(tmp_path):
frames = [np.full((16, 24, 3), 10 * i, np.uint8) for i in range(3)] + [np.zeros((8, 8, 3), np.uint8)]
@@ -262,8 +271,9 @@ def test_each_panel_encodes_to_its_own_temporary_file_and_a_prefix_cannot_leave_
second.start_video()
assert first._video_temp != second._video_temp
- assert first._output_path("video", ".mp4").parent == tmp_path / "video"
- assert first._output_path("video", ".mp4").name == "outside_0001.mp4"
+ path = first._output_path("video", ".mp4")
+ assert path.parent == tmp_path / "video"
+ assert path.name == "outside_0001.mp4"
def test_a_screenshot_is_taken_while_rendering_is_paused_but_a_video_gets_no_frame(tmp_path):
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index b167119831e3..506974b715bb 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -257,3 +257,17 @@ def test_a_free_view_records_the_rtx_window_instead_of_an_opengl_render():
assert viz._capture_view(free, None) == "window frame"
assert viz.current_image_view is rtx
+
+
+def test_capturing_a_view_the_window_does_not_show_stays_out_of_the_hud_recording():
+ shown, other = _view(TrackingCameraCfg(env_index=0)), _view(TrackingCameraCfg(env_index=1))
+ viz = _switchable([shown, other])
+ viz._viewer.camera.pos = Vec3(0.0, 0.0, 0.0)
+ viz._viewer.camera.pitch = viz._viewer.camera.yaw = 0.0
+ viz._viewer.set_camera = lambda *args: None
+ seen = []
+ viz._capture_frame = lambda output: seen.append(viz._capturing_another_view)
+
+ viz._capture_view(other, None)
+
+ assert seen == [True] and not viz._capturing_another_view
From ff23bade0fdc474945865b1e8699d9196a114c79 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 00:06:22 +0000
Subject: [PATCH 080/140] Remove a duplicated class attribute
---
.../isaaclab_visualizers/newton/newton_visualizer.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index f92595e83f0e..5d8662a44784 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -744,7 +744,6 @@ class NewtonVisualizerBase(BaseVisualizer):
_overlay_publisher: OverlayMeshPublisher | None = None
_rtx_arrows_pending = False
- _rtx_visibility_limited = False
_rtx_overlay_flags: tuple | None = None
_rtx_visibility_limited = False
From c5d98139034ac422bb0394c080f72f6091ac46aa Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 00:45:32 +0000
Subject: [PATCH 081/140] Render the RTX viewer camera on demand, allow it with
OVPhysX, hide overlays when leaving RTX, poll sky downloads every frame, and
note shared-scene effects in the HUD
---
.../camera-render-on-demand.added.rst | 1 +
source/isaaclab/isaaclab/app/sim_launcher.py | 5 ++--
.../isaaclab/scene/interactive_scene.py | 4 +++-
.../isaaclab/sensors/camera/camera_cfg.py | 6 +++++
.../isaaclab/sim/simulation_context.py | 4 ++--
.../test/app/test_rtx_viewer_camera.py | 16 ++++++++++++-
.../newton/newton_visualizer.py | 23 +++++++++++++++++++
7 files changed, 53 insertions(+), 6 deletions(-)
create mode 100644 source/isaaclab/changelog.d/camera-render-on-demand.added.rst
diff --git a/source/isaaclab/changelog.d/camera-render-on-demand.added.rst b/source/isaaclab/changelog.d/camera-render-on-demand.added.rst
new file mode 100644
index 000000000000..54414d92619c
--- /dev/null
+++ b/source/isaaclab/changelog.d/camera-render-on-demand.added.rst
@@ -0,0 +1 @@
+* Added :attr:`~isaaclab.sensors.camera.CameraCfg.render_on_demand`, which keeps a camera out of eager sensor updates so it renders only when its data is read. The visualizer's OVRTX viewer camera uses it.
diff --git a/source/isaaclab/isaaclab/app/sim_launcher.py b/source/isaaclab/isaaclab/app/sim_launcher.py
index 3b56d252103e..7f8000093be0 100644
--- a/source/isaaclab/isaaclab/app/sim_launcher.py
+++ b/source/isaaclab/isaaclab/app/sim_launcher.py
@@ -172,8 +172,8 @@ def _wants_rtx_viewer_camera(visualizer: VisualizerCfg, simulations: list[Simula
return False
if backend.rtx_camera is not None:
return backend.rtx_camera
- on_physx = any(isinstance(sim.physics, (PhysxCfg, PhysxAutoCfg, OvPhysxCfg)) for sim in simulations)
- return importlib.util.find_spec("ovrtx") is not None and not on_physx
+ on_kit_physx = any(isinstance(sim.physics, (PhysxCfg, PhysxAutoCfg)) for sim in simulations) # OVPhysX is kitless
+ return importlib.util.find_spec("ovrtx") is not None and not on_kit_physx
def _declare_viewer_camera(
@@ -201,6 +201,7 @@ def _declare_viewer_camera(
),
offset=CameraCfg.OffsetCfg(pos=visualizer.eye, rot=tuple(rotation), convention="opengl"),
renderer_cfg=visualizer.backend.rtx_renderer_cfg, background_color=visualizer.background_color,
+ render_on_demand=True,
render_settings={"omni:rtx:quality": ("Int", 0), **visualizer.backend.rtx_render_settings},
) # fmt: skip
visualizer.streaming_view = True # The window lists scene cameras, including this one, as view sources.
diff --git a/source/isaaclab/isaaclab/scene/interactive_scene.py b/source/isaaclab/isaaclab/scene/interactive_scene.py
index 65f80c5accaa..34fb054d6a2a 100644
--- a/source/isaaclab/isaaclab/scene/interactive_scene.py
+++ b/source/isaaclab/isaaclab/scene/interactive_scene.py
@@ -540,7 +540,9 @@ def update(self, dt: float) -> None:
force_recompute = not self.cfg.lazy_sensor_update
batched_sensors: list[SensorBase] = []
for sensor in self._sensors.values():
- if force_recompute and sensor.supports_batch_update:
+ if force_recompute and getattr(sensor.cfg, "render_on_demand", False):
+ sensor.update(dt, force_recompute=False) # rendered when its data is read, not on every update
+ elif force_recompute and sensor.supports_batch_update:
# Defer buffer refresh until all sensors have advanced.
sensor.update(dt, force_recompute=False)
batched_sensors.append(sensor)
diff --git a/source/isaaclab/isaaclab/sensors/camera/camera_cfg.py b/source/isaaclab/isaaclab/sensors/camera/camera_cfg.py
index d787c961764c..83af6e9daf7f 100644
--- a/source/isaaclab/isaaclab/sensors/camera/camera_cfg.py
+++ b/source/isaaclab/isaaclab/sensors/camera/camera_cfg.py
@@ -86,6 +86,12 @@ class OffsetCfg:
on :attr:`renderer_cfg` instead.
"""
+ render_on_demand: bool = False
+ """Whether the camera renders only when its data is read, even when the scene updates its sensors eagerly.
+
+ Defaults to False. A visualizer's viewer camera sets it, so that it renders only while its view is shown.
+ """
+
data_types: list[str] = ["rgb"]
"""List of sensor names/types to enable for the camera. Defaults to ["rgb"].
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index d25a9c8b9988..df6bbaa66a34 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -458,8 +458,8 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
if resolve_display_channels(visualizer.cfg.streaming_gt_types, camera.cfg.data_types):
cameras.append(camera)
rtx_path = getattr(visualizer.cfg.backend, "rtx_camera_prim_path", None)
- rgb_requested = "rgb" in visualizer.cfg.streaming_gt_types # the viewer camera provides only RGBA
- if rgb_requested and rtx_path is not None and not (visualizer.cfg.cameras is None or tracking_only):
+ rgb_only = set(visualizer.cfg.streaming_gt_types) == {"rgb"} # the viewer camera provides only RGBA
+ if rgb_only and rtx_path is not None and not (visualizer.cfg.cameras is None or tracking_only):
# Explicit cameras skip discovery; the Renderer switch still needs this window's RTX camera.
cameras.append(SceneCameraCfg(prim_path=rtx_path))
for index, source in enumerate(cameras):
diff --git a/source/isaaclab/test/app/test_rtx_viewer_camera.py b/source/isaaclab/test/app/test_rtx_viewer_camera.py
index 617d2d0f771c..b113511f692a 100644
--- a/source/isaaclab/test/app/test_rtx_viewer_camera.py
+++ b/source/isaaclab/test/app/test_rtx_viewer_camera.py
@@ -10,6 +10,7 @@
import types
import pytest
+from isaaclab_ov.physics import OvPhysxCfg
from isaaclab_physx.physics import PhysxCfg
from isaaclab_visualizers.newton import NewtonGLBackendCfg
@@ -57,10 +58,11 @@ def test_window_size_is_unchanged_without_a_display_to_query(monkeypatch: pytest
(False, False, None, True, False),
(None, True, None, True, False),
(None, False, PhysxCfg(), True, False),
+ (None, False, OvPhysxCfg(), True, True),
(None, False, None, False, False),
(None, False, None, True, True),
],
- ids=["explicit-on", "explicit-off", "recording-only-window", "physx", "no-ovrtx-package", "auto"],
+ ids=["explicit-on", "explicit-off", "recording-only-window", "physx", "ovphysx", "no-ovrtx-package", "auto"],
)
def test_viewer_camera_is_declared_only_where_it_can_be_used(
monkeypatch: pytest.MonkeyPatch, rtx_camera, headless, physics, ovrtx_installed, expected
@@ -70,3 +72,15 @@ def test_viewer_camera_is_declared_only_where_it_can_be_used(
simulations = [types.SimpleNamespace(physics=physics)]
assert sim_launcher._wants_rtx_viewer_camera(visualizer, simulations) is expected
+
+
+def test_the_declared_viewer_camera_renders_only_when_its_view_is_shown() -> None:
+ from isaaclab.scene import InteractiveSceneCfg
+
+ scene_cfg = InteractiveSceneCfg(num_envs=1, env_spacing=1.0)
+ visualizer = VisualizerCfg(backend=NewtonGLBackendCfg())
+
+ name, *_ = sim_launcher._declare_viewer_camera(scene_cfg, 0, visualizer)
+
+ assert vars(scene_cfg)[name].render_on_demand
+ assert visualizer.backend.rtx_camera_prim_path == f"/World/{name}"
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 5d8662a44784..2ebbaa8a831d 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -103,6 +103,13 @@
"""What each marker group shows, by the last component of its prim path."""
+def hud_note(imgui: Any, text: str) -> None:
+ """Draw a short muted-blue note that the user should know about the control above or below it."""
+ imgui.push_style_color(imgui.Col_.text, imgui.ImVec4(0.55, 0.7, 0.95, 0.85))
+ imgui.text_wrapped(text)
+ imgui.pop_style_color()
+
+
def hover_tooltip(imgui: Any, text: str) -> None:
"""Show ``text`` while the last item is hovered, including when it is disabled."""
if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
@@ -460,6 +467,12 @@ def _render_environment_controls(self, imgui) -> None:
owner.set_visible_env_count(new_count)
if imgui.is_item_hovered():
imgui.set_tooltip("Number of environments drawn in the viewer; simulation is unaffected")
+ if getattr(owner, "rtx_rendering", False):
+ hud_note(
+ imgui,
+ "In RTX mode, hidden environments are also hidden for other cameras that share the scene."
+ " Soft objects stay visible.",
+ )
def _draw_marker_controls(self, imgui) -> None:
"""Draw one toggle per visualization marker group the task registers."""
@@ -1443,6 +1456,8 @@ def _select_camera(self, index: int, *, keep_pose: bool = False) -> None:
"""
if getattr(self, "_pose_started", True): # the viewer camera holds no pose of its own before the first source
self._remember_perspective_pose()
+ if self._overlay_publisher is not None and self.rtx_rendering and index != self.rtx_view_index:
+ self._overlay_publisher.hide_all(self._rtx_renderers) # sensors sharing the renderer must not keep them
self.current_image_view = self._image_views[index]
if index != getattr(self, "rtx_view_index", None):
self._rtx_pose_view = None
@@ -1837,6 +1852,9 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
def _render_frame(self) -> None:
"""Render one GL frame for the window or an on-demand capture."""
viewer = self._viewer
+ appearance = self._rtx_appearance
+ if appearance is not None and self.rtx_rendering and appearance.available and appearance.poll():
+ self.current_image_view.invalidate() # a sky finished downloading, whether or not its panel is open
viewer.begin_frame(self._sim_time)
try:
viewer.image_matches_camera = self.rtx_rendering
@@ -2125,6 +2143,11 @@ def close(self) -> None:
return
self._close_key_event_source()
try:
+ if self._overlay_publisher is not None:
+ try:
+ self._overlay_publisher.hide_all(self._rtx_renderers)
+ except Exception:
+ logger.debug("[NewtonVisualizer] The overlay meshes could not be hidden.", exc_info=True)
if self._picking_enabled:
# Captured graphs retain neutral picking inputs until their last replay.
self._viewer_picking_binding.deactivate()
From 444ab314526f89b5b339a289e2de8598d6179453 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 01:24:15 +0000
Subject: [PATCH 082/140] Share one short note about hidden environments in the
RTX view
---
.../newton/newton_visualizer.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 66855b32de99..5107fadb36b0 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -106,6 +106,12 @@
"""What each marker group shows, by the last component of its prim path."""
+RTX_SHARED_SCENE_NOTE = (
+ "In RTX, hidden environments also disappear for other cameras that share the scene. Soft objects stay visible."
+)
+"""Shown beside the controls that hide environments while the RTX view is selected."""
+
+
def hud_note(imgui: Any, text: str) -> None:
"""Draw a short muted-blue note that the user should know about the control above or below it."""
imgui.push_style_color(imgui.Col_.text, imgui.ImVec4(0.55, 0.7, 0.95, 0.85))
@@ -528,11 +534,7 @@ def _render_environment_controls(self, imgui) -> None:
if imgui.is_item_hovered():
imgui.set_tooltip("Number of environments drawn in the viewer; simulation is unaffected")
if getattr(owner, "rtx_rendering", False):
- hud_note(
- imgui,
- "In RTX mode, hidden environments are also hidden for other cameras that share the scene."
- " Soft objects stay visible.",
- )
+ hud_note(imgui, RTX_SHARED_SCENE_NOTE)
def _draw_scene_controls(self, imgui) -> None:
"""Draw what can be shown in the scene: environments, visualization markers, and visual overlays."""
@@ -1477,6 +1479,8 @@ def tip(text: str) -> None:
edited |= self._set_tracking_path(follower, f"{asset_name}/{bodies[index]}" if index else asset_name)
changed, only = imgui.checkbox("Show Only This Env", self._track_env_only)
tip("Draw only the camera's environment, following it when the environment changes")
+ if self.rtx_rendering:
+ hud_note(imgui, RTX_SHARED_SCENE_NOTE)
if changed:
self._track_env_only = only
self._apply_visible_worlds()
From c7265e4a73309eba5b13aa1854e35131db28c115 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 01:24:45 +0000
Subject: [PATCH 083/140] Fix the render-on-demand check for mock sensors and
the explicit streaming environments test
---
source/isaaclab/isaaclab/scene/interactive_scene.py | 2 +-
source/isaaclab_visualizers/test/test_newton_adapter.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/source/isaaclab/isaaclab/scene/interactive_scene.py b/source/isaaclab/isaaclab/scene/interactive_scene.py
index 34fb054d6a2a..61abdf881c9f 100644
--- a/source/isaaclab/isaaclab/scene/interactive_scene.py
+++ b/source/isaaclab/isaaclab/scene/interactive_scene.py
@@ -540,7 +540,7 @@ def update(self, dt: float) -> None:
force_recompute = not self.cfg.lazy_sensor_update
batched_sensors: list[SensorBase] = []
for sensor in self._sensors.values():
- if force_recompute and getattr(sensor.cfg, "render_on_demand", False):
+ if force_recompute and getattr(sensor.cfg, "render_on_demand", False) is True:
sensor.update(dt, force_recompute=False) # rendered when its data is read, not on every update
elif force_recompute and sensor.supports_batch_update:
# Defer buffer refresh until all sensors have advanced.
diff --git a/source/isaaclab_visualizers/test/test_newton_adapter.py b/source/isaaclab_visualizers/test/test_newton_adapter.py
index 32a4ecf213dc..f8f5b71a254e 100644
--- a/source/isaaclab_visualizers/test/test_newton_adapter.py
+++ b/source/isaaclab_visualizers/test/test_newton_adapter.py
@@ -967,7 +967,7 @@ def test_newton_scene_camera_controls_apply_uniformly_to_active_copies(monkeypat
assert visualizer._image_views[1].cfg.channels == ("depth",)
visualizer._select_camera(2)
- assert visualizer._image_views[2].cfg.envs == (0, 1) # Both environments are tiled by default.
+ assert visualizer._image_views[2].cfg.envs == (0,) # An explicit streaming_envs=[0] is kept as chosen.
visualizer._image_views[2].cfg.envs = (0,)
torch.testing.assert_close(color.frame.torch, color_frame)
image = visualizer.render_tiled_rgb_array()
From 3ee43c2f29b7534ff041287fc91cc3d8c52c774f Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 20:29:11 +0000
Subject: [PATCH 084/140] Keep the tracking camera turning in one direction,
hold the tracking recording while paused, and update the wording
---
docs/source/concepts/visualization.rst | 4 ++-
.../tracking-camera-tracking.added.rst | 3 +--
.../isaaclab/envs/utils/video_recorder.py | 4 +--
.../isaaclab/envs/utils/video_recorder_cfg.py | 5 ++--
.../isaaclab/visualizers/camera_follower.py | 22 +++++++++++----
.../isaaclab/visualizers/visualizer_cfg.py | 3 ++-
.../test/visualizers/test_camera_follower.py | 11 ++++++++
.../newton/newton_visualizer.py | 27 ++++++++++++-------
.../test/test_newton_tracking_cameras.py | 15 +++++++++--
9 files changed, 69 insertions(+), 25 deletions(-)
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index d9258e53828a..04034b7c7ac7 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -802,7 +802,9 @@ Watch training live in Kit while recording from a separate headless Newton GL an
**Following a moving robot**
-Declare a *tracking camera* instead of updating ``eye``/``lookat`` every step; see :ref:`how-to-visualizer-tracking-cameras`:
+Declare a *tracking camera* instead of updating ``eye``/``lookat`` every step; see :ref:`how-to-visualizer-tracking-cameras`.
+This is Newton GL only. Kit ignores a ``TrackingCameraCfg`` and follows an asset with
+``KitBackendCfg(origin_type="asset", origin_track_path="robot")`` instead. For Newton GL:
.. code-block:: python
diff --git a/source/isaaclab/changelog.d/tracking-camera-tracking.added.rst b/source/isaaclab/changelog.d/tracking-camera-tracking.added.rst
index 39b7a1cbd926..c1c58a11ae9c 100644
--- a/source/isaaclab/changelog.d/tracking-camera-tracking.added.rst
+++ b/source/isaaclab/changelog.d/tracking-camera-tracking.added.rst
@@ -1,4 +1,3 @@
* Added :class:`~isaaclab.visualizers.TrackingCameraCfg`, a perspective camera that frames an environment or follows
- an asset with optional smoothed heading, and :class:`~isaaclab.visualizers.camera_follower.CameraFollower`, which
- can switch the followed asset while running. Added the ``viz::tracking`` video source, which records the first
+ an asset with optional smoothed heading. Added the ``viz::tracking`` video source, which records the first
tracking camera whichever view the window shows, for Newton GL.
diff --git a/source/isaaclab/isaaclab/envs/utils/video_recorder.py b/source/isaaclab/isaaclab/envs/utils/video_recorder.py
index 36b34a8a57a3..3bc74554eb12 100644
--- a/source/isaaclab/isaaclab/envs/utils/video_recorder.py
+++ b/source/isaaclab/isaaclab/envs/utils/video_recorder.py
@@ -78,8 +78,8 @@ def __init__(self, cfg: VideoRecorderCfg, env: object):
)
if not viz.has_tracking_view:
raise RuntimeError(
- "The newton_gl visualizer declares no tracking camera to record. Add "
- "TrackingCameraCfg(env_index=..., track_path=...) to its cameras."
+ "The newton_gl visualizer declares no tracking camera to record. Add a TrackingCameraCfg to "
+ "its cameras."
)
self._capture = viz.render_tracking_rgb_array
else:
diff --git a/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py b/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
index c2d9d45d05c9..4cf870760c91 100644
--- a/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
+++ b/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
@@ -78,9 +78,8 @@ class VideoRecorderCfg:
camera: the one ``--viz`` selected, else a headless one added for the recording.
* ``"viz::streaming_view"`` – the streaming camera panel of that visualizer (requires
``streaming_view=True`` on its :class:`~isaaclab.visualizers.VisualizerCfg`).
- * ``"viz::tracking"`` – the first perspective view of that visualizer that is tied to an
- environment or an asset (:class:`~isaaclab.visualizers.TrackingCameraCfg` with ``env_index`` or
- ``track_path``), whichever view its window shows. Only Newton GL supports it.
+ * ``"viz::tracking"`` – the first :class:`~isaaclab.visualizers.TrackingCameraCfg` of
+ that visualizer, whichever view its window shows. Only Newton GL supports it.
* ``"sensor:"`` – scene sensor, RGB channel (default); no visualizer is added.
* ``"sensor::"`` – scene sensor channel: ``rgb``, ``depth`` (colorized via the turbo
colormap), ``segmentation`` or ``normals`` (colorized).
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
index 5956dab9d19c..d778fc6b64a6 100644
--- a/source/isaaclab/isaaclab/visualizers/camera_follower.py
+++ b/source/isaaclab/isaaclab/visualizers/camera_follower.py
@@ -25,6 +25,9 @@
A fixed angle, unlike a rate, does not misfire when two updates are a few milliseconds apart."""
+_CATCH_UP_LAG = math.pi / 2
+"""Lag [rad] behind the robot heading beyond which the camera heading catches up faster."""
+
class CameraFollower:
"""Turns a :class:`~isaaclab.visualizers.TrackingCameraCfg` tied to an environment into world poses.
@@ -154,21 +157,30 @@ def pose(self, time: float) -> tuple[tuple[float, float, float], tuple[float, fl
return tuple(eye), tuple(target)
def _filtered_yaw(self, quat: list[float], position: list[float], dt: float) -> float:
- """Return the yaw of the xyzw *quat*, filtered along the shortest rotation.
+ """Return the yaw of the xyzw *quat*, filtered so the camera follows the turn in the direction it happened.
- The first sample, and the sample after an environment resets, is not filtered.
+ The heading is tracked unwrapped, so a camera that falls more than half a turn behind keeps turning the same
+ way instead of reversing, and it catches up faster the further it lags. The first sample, and the sample after
+ an environment resets, is not filtered.
"""
x, y, z, w = quat
yaw = math.atan2(2.0 * (w * z + x * y), 1.0 - 2.0 * (y * y + z * z))
last, self._last_position = self._last_position, position
reset = self._yaw is None or last is None or math.dist(position, last) > _RESET_JUMP
+ step = 0.0 if reset else math.remainder(yaw - self._raw_yaw, math.tau)
if not reset:
# an environment can reset in place with a new heading; the raw heading is compared, since the filtered
# one lags behind a steady turn
- reset = abs(math.remainder(yaw - self._raw_yaw, math.tau)) > _RESET_YAW_JUMP
- self._raw_yaw = yaw
+ reset = abs(step) > _RESET_YAW_JUMP
+ # signed heading changes add up, so the target keeps the direction of the turn
+ self._raw_yaw = yaw if reset else self._raw_yaw + step
tau = self.cfg.heading_smoothing_time_constant
if tau > 0.0 and not reset:
- yaw = self._yaw + -math.expm1(-dt / tau) * math.remainder(yaw - self._yaw, math.tau)
+ lag = self._raw_yaw - self._yaw
+ if abs(lag) > _CATCH_UP_LAG:
+ tau *= _CATCH_UP_LAG / abs(lag)
+ yaw = self._yaw + -math.expm1(-dt / tau) * lag
+ else:
+ yaw = self._raw_yaw
self._yaw = yaw
return yaw
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index 8527ab52c3e5..92c2c339d135 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -229,7 +229,8 @@ class VisualizerCfg:
PerspectiveCameraCfg configures the interactive view, TrackingCameraCfg a view that frames an environment
or follows an asset, and SceneCameraCfg refers to an existing scene sensor.
- Newton GL and RTX display the first source and offer a dropdown for switching sources.
+ Newton GL and RTX display the first source and offer a dropdown for switching sources. Newton GL adds a free
+ view in front of a leading TrackingCameraCfg (see ``with_free_view``) and shows that one first.
Kit, Rerun, and Viser display the first scene source in their camera panel.
None uses eye/lookat/focal_length and the streaming settings below.
Every explicit scene source must provide all requested streaming_gt_types channels.
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
index fd935e29a073..92ac4a49669b 100644
--- a/source/isaaclab/test/visualizers/test_camera_follower.py
+++ b/source/isaaclab/test/visualizers/test_camera_follower.py
@@ -191,6 +191,17 @@ def test_a_steady_turn_with_heavy_smoothing_is_not_mistaken_for_an_environment_r
previous = yaw
+def test_a_camera_lagging_more_than_half_a_turn_keeps_turning_the_same_way():
+ cfg = TrackingCameraCfg(env_index=0, track_path="robot", follow_heading=True, heading_smoothing_time_constant=50.0)
+ follower = CameraFollower(cfg, _NamedScene())
+ yaws = []
+ for step in range(100): # a robot spinning at 2 rad/s, far faster than the filter follows
+ raw = 0.2 * step
+ yaws.append(follower._filtered_yaw([0.0, 0.0, math.sin(raw / 2), math.cos(raw / 2)], [0.0, 0.0, 0.5], 0.1))
+ assert all(later >= earlier for earlier, later in zip(yaws, yaws[1:]))
+ assert yaws[-1] > yaws[0]
+
+
def test_the_heading_filter_starts_afresh_after_a_reset():
cfg = TrackingCameraCfg(env_index=0, track_path="robot", follow_heading=True, heading_smoothing_time_constant=1.0)
follower = CameraFollower(cfg, _NamedScene())
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 766ff5741109..c279caa7d457 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -502,6 +502,7 @@ def __init__(self, cfg):
self._runtime_headless = cfg.headless
self._last_present_time = -math.inf
self._last_render_step = -1
+ self._borrowing_view = False
self._pending_mesh_submissions: dict[str, dict[str, Any]] = {}
self._camera_keys_enabled = True
self._followers: dict[object, CameraFollower] = {}
@@ -609,7 +610,7 @@ def log_mesh(
@staticmethod
def _is_tracking_view(view) -> bool:
- """Whether *view* is a perspective view tied to an environment or an asset."""
+ """Whether *view* is a tracking camera."""
return isinstance(view.cfg.source, TrackingCameraCfg)
def _view_labels(self) -> list[str]:
@@ -630,6 +631,8 @@ def _view_labels(self) -> list[str]:
def _draw_streaming_view_controls(self, imgui) -> None:
"""Choose one declared display source without reading the other sensors."""
+ if self._borrowing_view: # an off-screen capture swapped the view; the window controls must not act on it
+ return
imgui.set_next_item_open(True, imgui.Cond_.appearing)
if not imgui.collapsing_header("Camera View"):
return
@@ -790,7 +793,7 @@ def _remember_tracking_defaults(self, view, follower: CameraFollower) -> None:
}
def _apply_view_pose(self, view) -> bool:
- """Point the viewer camera where a task *view* looks, leaving the configured poses untouched.
+ """Point the viewer camera where a tracking camera looks, leaving the configured poses untouched.
Returns:
Whether the view had a pose yet; a view that follows an asset has none until the asset is ready.
@@ -815,6 +818,7 @@ def _capture_view(self, view, output: wp.array | None) -> wp.array:
camera = self._viewer.camera
saved = (PygletVec3(camera.pos.x, camera.pos.y, camera.pos.z), camera.pitch, camera.yaw, camera.fov)
try:
+ self._borrowing_view = True
self.current_image_view = view
if not self._is_tracking_view(view): # a free view renders from its declared pose and optics
source = view.cfg.source
@@ -825,6 +829,7 @@ def _capture_view(self, view, output: wp.array | None) -> wp.array:
self._last_render_step = -1
return self._capture_frame(output)
finally:
+ self._borrowing_view = False
self.current_image_view = current
camera.fov = saved[3]
self._viewer.set_camera(*saved[:3])
@@ -960,18 +965,22 @@ def render_rgb_array(self) -> np.ndarray:
@property
def has_tracking_view(self) -> bool:
- """Whether a perspective view is tied to an environment or an asset."""
+ """Whether a tracking camera is declared."""
return any(self._is_tracking_view(view) for view in self._image_views)
def render_tracking_rgb_array(self) -> np.ndarray:
- """Download the first perspective view that is tied to an environment or an asset, whatever the window shows."""
+ """Download the first tracking camera view, whatever the window shows."""
view = next((v for v in self._image_views if self._is_tracking_view(v)), None)
if view is None:
- raise RuntimeError(
- "No perspective view is tied to an environment or an asset. Declare "
- "TrackingCameraCfg(env_index=..., track_path=...) in the visualizer's cameras."
- )
- return view.read_rgb(self._sim.get_physics_step_count())
+ raise RuntimeError("The visualizer declares no tracking camera. Add a TrackingCameraCfg to its cameras.")
+ frame = view.frame
+ # while rendering is paused the tracking view keeps its last frame, instead of picking up the window's view
+ frame_id = (
+ frame.timestamp
+ if self._viewer is not None and self._viewer.is_paused() and frame.data is not None
+ else self._sim.get_physics_step_count()
+ )
+ return view.read_rgb(frame_id)
class NewtonGLVisualizer(NewtonVisualizerBase):
diff --git a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
index e41ee0d3608d..42d807e01590 100644
--- a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
+++ b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
@@ -51,7 +51,7 @@ def _visualizer(views) -> NewtonVisualizerBase:
def set_camera(pos, pitch, yaw):
camera.pos, camera.pitch, camera.yaw = pos, pitch, yaw
- viz._viewer = SimpleNamespace(camera=camera, set_camera=set_camera)
+ viz._viewer = SimpleNamespace(camera=camera, set_camera=set_camera, is_paused=lambda: False)
viz._sim = SimpleNamespace(
get_scene_data_provider=lambda: SimpleNamespace(get_interactive_scene=lambda: _Scene()),
get_physics_step_count=lambda: 10,
@@ -74,6 +74,7 @@ class _View:
def __init__(self, cfg: PerspectiveCameraCfg):
self.cfg = SimpleNamespace(source=cfg)
+ self.frame = SimpleNamespace(data=None, timestamp=-1)
def _view(cfg: PerspectiveCameraCfg) -> _View:
@@ -120,7 +121,7 @@ def test_the_tracking_camera_recording_picks_the_first_tied_view():
def test_the_tracking_camera_recording_reports_a_visualizer_without_one():
- with pytest.raises(RuntimeError, match="tied to an environment or an asset"):
+ with pytest.raises(RuntimeError, match="declares no tracking camera"):
_visualizer([_view(PerspectiveCameraCfg())]).render_tracking_rgb_array()
@@ -169,3 +170,13 @@ def test_a_visualizer_reports_whether_it_declares_a_tracking_view():
free, task = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=1))
assert not _visualizer([free]).has_tracking_view
assert _visualizer([free, task]).has_tracking_view
+
+
+def test_the_tracking_camera_recording_keeps_its_last_frame_while_rendering_is_paused():
+ tracking = _view(TrackingCameraCfg(track_path="robot"))
+ viz = _visualizer([_view(PerspectiveCameraCfg()), tracking])
+ viz._sim.get_physics_step_count = lambda: 9
+ viz._viewer.is_paused = lambda: True
+ tracking.frame = SimpleNamespace(data=object(), timestamp=4)
+ tracking.read_rgb = lambda step: step
+ assert viz.render_tracking_rgb_array() == 4
From 6e1b1edd5dc0a189abf7f470f4d035448941ac6b Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 20:30:23 +0000
Subject: [PATCH 085/140] Update the Newton visualizer docs and changelogs for
the Camera Source rename and the RTX view
---
docs/source/concepts/visualization.rst | 16 +++++++++-------
docs/source/how-to/record_video.rst | 2 +-
.../visualizer_streaming_camera_view.rst | 18 ++++++++++--------
.../isaaclab/visualizers/visualizer_cfg.py | 3 +--
.../newton-gl-camera-sources.added.rst | 9 +++++----
.../newton-gl-rtx-renderer-toggle.added.rst | 4 ++++
.../newton-rtx-drag-arrow.fixed.rst | 2 --
.../newton-rtx-paused-render.fixed.rst | 2 --
.../newton-rtx-tracking-reset.fixed.rst | 3 ---
.../newton-sensor-channels.added.rst | 4 ++--
.../tracking-camera-tracking.added.rst | 2 +-
11 files changed, 33 insertions(+), 32 deletions(-)
delete mode 100644 source/isaaclab_visualizers/changelog.d/newton-rtx-drag-arrow.fixed.rst
delete mode 100644 source/isaaclab_visualizers/changelog.d/newton-rtx-paused-render.fixed.rst
delete mode 100644 source/isaaclab_visualizers/changelog.d/newton-rtx-tracking-reset.fixed.rst
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index 3e0aa72eff68..e11f316e8807 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -296,7 +296,7 @@ Visualizer Overview
The **Renderer** selector in the Rendering Options section switches the main view to the OVRTX path tracer for
photorealistic rendering without a Kit process. It appears when the scene has the OVRTX viewer camera, which launch
- declares when ``ovrtx`` is installed and the physics is not PhysX. RTX rendering is slightly slower than OpenGL.
+ declares when ``ovrtx`` is installed and the physics is not Kit-based PhysX. RTX rendering is slightly slower than OpenGL.
.. raw:: html
@@ -306,15 +306,15 @@ Visualizer Overview
Isaac-Velocity-Rough-H1 in the Newton Visualizer with RTX rendering Each H1 humanoid climbs a
staircase sub-terrain
- Picking, visualization markers, camera selection, pause controls, Visible Envs, and headless recording work in
- the RTX view, and picking draws the drag arrow there. Joint, contact, spring, center-of-mass, and inertia overlays are drawn in the RTX view too; the collision,
+ Picking, visualization markers, camera selection, pause controls, Visible Envs, and recording work in
+ the RTX view of a windowed Newton GL visualizer, and picking draws the drag arrow there. Joint, contact, spring, center-of-mass, and inertia overlays are drawn in the RTX view too; the collision,
visual, edge, and wireframe overlays apply to the OpenGL view only.
.. warning::
OVRTX is a kitless renderer and cannot be used in the same process as Kit
(``presets=isaacsim_physx``). ``presets=ovphysx`` is itself kitless and works fine with
- RTX rendering. Use ``presets=newton_mjwarp,ovrtx`` or ``presets=ovphysx,ovrtx`` with
+ RTX rendering. Use ``presets=newton_mjwarp`` or ``presets=ovphysx`` with
``--viz newton_gl``, or switch to ``--viz viser``, ``--viz rerun``,
or ``--viz kit`` with a Kit-compatible physics backend.
@@ -597,10 +597,10 @@ Attach a camera to a robot body to follow its motion, or select an existing view
task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton GL, Newton RTX,
Rerun, and Viser visualizers. **Kit** opens it as a separate **Streaming View** viewport, which can
sit side by side with the default viewport for dual monitoring. **Newton GL** and **Newton RTX**
-provide a **Camera View** selector in the sidebar for switching between perspective and scene-camera
+provide a **Camera Source** selector in the sidebar for switching between perspective and scene-camera
views. A perspective view can also be a *tracking camera* that follows a robot or frames an environment; only Newton GL
supports it.
-Selecting a scene sensor in **Camera View** shows its channel: the **Channel** selector lists the
+Selecting a scene sensor in **Camera Source** shows its channel: the **Channel** selector lists the
sensor's outputs (RGB, depth, normals, or segmentation), and depth, normals, and segmentation are
converted to colors for display. When the sensor is declared once per environment, **Tiled Envs**
sets how many of its feeds are tiled into the window.
@@ -872,7 +872,9 @@ share button in the native UI.
**Choosing how many environments are drawn**
Every Newton viewer has a **Visible Envs** slider in its left panel that sets how many
-environments are drawn. It changes only what is rendered, not the simulation.
+environments are drawn. It changes only what is rendered, not the simulation. In the RTX view the OVRTX renderer is
+shared with scene cameras, so the hidden environments also drop out of their images while the RTX view is shown;
+the HUD notes this next to the slider.
Resolution Rules
~~~~~~~~~~~~~~~~
diff --git a/docs/source/how-to/record_video.rst b/docs/source/how-to/record_video.rst
index b875c2a294df..4304d62f58a8 100644
--- a/docs/source/how-to/record_video.rst
+++ b/docs/source/how-to/record_video.rst
@@ -283,7 +283,7 @@ The ``source`` string selects what to capture:
* - ``"viz:kit:streaming_view"``
- Kit streaming camera panel, requires ``streaming_view=True``
* - ``"viz:newton_gl"``
- - Newton GL visualizer viewport
+ - Newton GL visualizer viewport, in whichever renderer the window shows (OpenGL or RTX). A headless Newton GL has no RTX view
* - ``"viz:newton_rtx"``
- Newton OVRTX path-traced viewport
* - ``"viz:newton_gl:streaming_view"``
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index 5c27460c22ab..fc3231759f2c 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -123,7 +123,7 @@ Choose and control displayed views
the Viewport tabs; it can also be placed side by side with the default interactive viewport
for dual monitoring.
-**Newton GL and Newton RTX** have a **Camera View** selector in the sidebar. Selecting a scene camera displays
+**Newton GL and Newton RTX** have a **Camera Source** selector in the sidebar. Selecting a scene camera displays
its tiled output in the main viewport instead of rendering a perspective view behind it.
Selecting a perspective camera restores interactive scene rendering. Newton GL also restores picking.
A tracking camera is listed as **Tracking Camera**; see :ref:`how-to-visualizer-tracking-cameras`.
@@ -255,8 +255,9 @@ Tracking cameras that follow a robot
A ``TrackingCameraCfg`` frames an environment or follows an asset in it. Its ``eye`` and ``lookat`` are
offsets [m] from the environment origin, or from the tracked asset, so it frames the robot wherever the scene puts
-it. The visualizer renders it from its own camera: nothing is added to the scene, and the view keeps the
-viewport's markers and shadows.
+it. In the OpenGL renderer the visualizer renders it from its own camera, so nothing is added to the scene and the view
+keeps the viewport's markers and shadows. In RTX the window follows it by moving the OVRTX viewer camera, which is a
+camera in the scene, and OpenGL shadows do not apply.
.. code-block:: python
@@ -283,10 +284,11 @@ viewport's markers and shadows.
A free view at the visualizer's own ``eye`` and ``lookat`` is added before the first tracking camera, so the
interactive camera stays free.
-* **Newton GL:** **Camera View** lists the tracking camera as **Tracking Camera** beside **Perspective**. A
- **Tracking Camera** group edits its environment, asset, body, eye, look-at, focal length and heading settings
- while it runs; **Reset to Task Default** restores the declaration. Record it with
- ``--video viz:newton_gl:tracking``, whichever view the window shows.
+* **Newton GL:** **Camera Source** lists the tracking camera as **Tracking Camera** beside **Perspective**, and the
+ window follows it in both the OpenGL and RTX renderers. A **Tracking Camera** group edits its environment, asset,
+ body, eye, look-at, focal length and heading settings while it runs; **Reset to Task Default** restores the
+ declaration. Record it with ``--video viz:newton_gl:tracking``, whichever view the window shows. Plain
+ ``--video viz:newton_gl`` records whichever renderer the window shows.
* **Kit**, **Newton RTX**, **Viser** and **Rerun** ignore tracking cameras.
@@ -389,7 +391,7 @@ Then choose what to display in ``VisualizerCfg``:
* For other viewers, ``streaming_sensor_prim_path`` selects a scene :class:`~isaaclab.sensors.Camera` by its configured
prim path. The ``{ENV_REGEX_NS}`` macro uses the scene's environment template.
If omitted, Newton GL starts in perspective mode and offers compatible scene cameras
- in the Camera View dropdown. Kit and web viewers select the first compatible scene camera;
+ in the Camera Source dropdown. Kit and web viewers select the first compatible scene camera;
without one, their panel stays empty.
* ``streaming_envs`` controls how many environment tiles are shown. Pass an ``int`` to randomly
sample that many environments, or a ``list[int]`` to pin specific environment indices.
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index 4314a5aa67e8..72b91ff18d14 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -70,8 +70,7 @@ class PerspectiveCameraCfg:
class TrackingCameraCfg(PerspectiveCameraCfg):
"""A camera that frames an environment or follows an asset in it, however the scene is laid out.
- The visualizer renders it from the viewer camera, so nothing is created in the scene. Only Newton GL
- supports it; other visualizers ignore it.
+ The Newton GL window shows it in either renderer. Only Newton GL supports it; other visualizers ignore it.
"""
eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
diff --git a/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst b/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst
index b7b6454b9bfd..16ac8cdbfecc 100644
--- a/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst
+++ b/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst
@@ -1,8 +1,9 @@
* The Newton GL Camera Source list now reads Perspective, Tracking Camera, then the scene cameras by their own names
- (for example "Camera (sensor)"). A scene camera with one image per environment shows one environment at a time, with
- an Environment field to switch it and a Tile Environments option for the previous side-by-side layout.
-* Added an RTX Appearance section to the Newton GL Camera View, shown instead of the OpenGL Appearance options while
- the Renderer is RTX. It changes the OVRTX view's lights while
+ (for example "Camera (RGB sensor)"). A scene camera with one image per environment tiles up to ``streaming_envs``
+ random environments (32 by default); "Tiled Envs" sets how many are shown, and "Environment" picks the one shown when
+ it is 1.
+* Added a Lighting & Appearance section to the Newton GL Camera Source, with RTX options instead of the OpenGL ones
+ while the Renderer is RTX. It changes the OVRTX view's lights while
running: the scene's own lights (on by default) with an intensity scale and a color tint, a dome light with an
intensity, a color, and a sky texture chosen from the HDR skies tasks already use or a file, and a distant light with
an intensity, a color, an angle, an elevation, and an azimuth. The dome and distant lights are off by default. The
diff --git a/source/isaaclab_visualizers/changelog.d/newton-gl-rtx-renderer-toggle.added.rst b/source/isaaclab_visualizers/changelog.d/newton-gl-rtx-renderer-toggle.added.rst
index f23adbf2b82f..f88bbb9344a4 100644
--- a/source/isaaclab_visualizers/changelog.d/newton-gl-rtx-renderer-toggle.added.rst
+++ b/source/isaaclab_visualizers/changelog.d/newton-gl-rtx-renderer-toggle.added.rst
@@ -4,3 +4,7 @@
* Added right-click picking, visualization markers, and a window-filling image to the OVRTX view of the Newton GL
window, so switching renderers no longer leaves thin black bars.
* Added Visible Envs support to the OVRTX view of the Newton GL window.
+* The OVRTX view keeps updating while the simulation is paused, so the drag arrow and camera moves show in it, and the
+ drag arrow appears without a visual overlay being enabled.
+* "Reset to Task Default" works for a Tracking Camera while RTX is selected, and the window remembers the free
+ Perspective camera's pose and focal length while another camera source is shown.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-rtx-drag-arrow.fixed.rst b/source/isaaclab_visualizers/changelog.d/newton-rtx-drag-arrow.fixed.rst
deleted file mode 100644
index 45d62740e2d5..000000000000
--- a/source/isaaclab_visualizers/changelog.d/newton-rtx-drag-arrow.fixed.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-* Fixed the drag arrow of the Newton visualizer not appearing in the OVRTX view unless a visual overlay such as contacts
- was enabled.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-rtx-paused-render.fixed.rst b/source/isaaclab_visualizers/changelog.d/newton-rtx-paused-render.fixed.rst
deleted file mode 100644
index 0b4a10d73c90..000000000000
--- a/source/isaaclab_visualizers/changelog.d/newton-rtx-paused-render.fixed.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-* Fixed the OVRTX view of the Newton visualizer not updating while the simulation is paused, so that the drag arrow and
- moving the camera now show in it.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-rtx-tracking-reset.fixed.rst b/source/isaaclab_visualizers/changelog.d/newton-rtx-tracking-reset.fixed.rst
deleted file mode 100644
index ce65c993dd7a..000000000000
--- a/source/isaaclab_visualizers/changelog.d/newton-rtx-tracking-reset.fixed.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-* Fixed "Reset to Task Default" doing nothing for a Tracking Camera while the RTX renderer is selected, and made the
- Newton window remember the free Perspective camera's pose and focal length while another camera source is shown, so
- switching back restores them instead of the task's initial pose.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-sensor-channels.added.rst b/source/isaaclab_visualizers/changelog.d/newton-sensor-channels.added.rst
index b9e34910b278..0d915c59d4c7 100644
--- a/source/isaaclab_visualizers/changelog.d/newton-sensor-channels.added.rst
+++ b/source/isaaclab_visualizers/changelog.d/newton-sensor-channels.added.rst
@@ -4,5 +4,5 @@
``Camera (depth sensor)``, so depth-only and segmentation-only sensors can be viewed.
The Renderer selector is greyed out while a scene camera is selected, since the sensor is rendered by its own
renderer.
- A multi-environment scene camera now tiles its first 16 environments by default, and "Tiled Envs" sets how many are
- shown side by side (1 shows the single environment chosen with "Environment").
+ A multi-environment scene camera tiles up to ``streaming_envs`` random environments (32 by default), and "Tiled Envs"
+ sets how many are shown side by side (1 shows the single environment chosen with "Environment").
diff --git a/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.added.rst b/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.added.rst
index ac4d5c735959..fa5cbeac6b0c 100644
--- a/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.added.rst
+++ b/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.added.rst
@@ -1,3 +1,3 @@
-* Added tracking camera support to the Newton GL visualizer. **Camera View** lists it as "Tracking Camera" beside the
+* Added tracking camera support to the Newton GL visualizer. **Camera Source** lists it as "Tracking Camera" beside the
free "Perspective" view, and a Tracking Camera group edits its environment, asset, body, eye, look-at, focal length
and heading settings, with a reset to the task's declaration.
From 4d7541c6fea673ca9e029304904c5515aebeba93 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 20:34:30 +0000
Subject: [PATCH 086/140] Restore shared scene state when leaving RTX, keep the
viewer RTX camera in explicit camera lists, and record the RTX tracking view
as shown
---
source/isaaclab/isaaclab/app/sim_launcher.py | 8 +++--
.../isaaclab/sim/simulation_context.py | 11 +++----
.../isaaclab/visualizers/base_visualizer.py | 10 +++----
.../isaaclab/visualizers/visualizer_cfg.py | 7 ++++-
.../test/app/test_rtx_viewer_camera.py | 15 +++++++++-
.../newton/newton_rtx_appearance.py | 30 +++++++++++++------
.../newton/newton_visualizer.py | 22 ++++++++++----
.../test/test_newton_adapter.py | 2 ++
.../test/test_newton_task_views.py | 1 +
9 files changed, 75 insertions(+), 31 deletions(-)
diff --git a/source/isaaclab/isaaclab/app/sim_launcher.py b/source/isaaclab/isaaclab/app/sim_launcher.py
index 7f8000093be0..f6d2e91cdd6d 100644
--- a/source/isaaclab/isaaclab/app/sim_launcher.py
+++ b/source/isaaclab/isaaclab/app/sim_launcher.py
@@ -172,7 +172,11 @@ def _wants_rtx_viewer_camera(visualizer: VisualizerCfg, simulations: list[Simula
return False
if backend.rtx_camera is not None:
return backend.rtx_camera
- on_kit_physx = any(isinstance(sim.physics, (PhysxCfg, PhysxAutoCfg)) for sim in simulations) # OVPhysX is kitless
+ # an automatic PhysX selection with OVPhysX available resolves to kitless OVPhysX, like the Kit check below
+ on_kit_physx = any(
+ isinstance(sim.physics, PhysxCfg) or (isinstance(sim.physics, PhysxAutoCfg) and sim.physics.ovphysx is None)
+ for sim in simulations
+ )
return importlib.util.find_spec("ovrtx") is not None and not on_kit_physx
@@ -374,7 +378,7 @@ def validate_launch( # noqa: C901
raise ValueError("A tracking camera cannot be the image source of an RTX viewer.")
sources = [visualizer.view.source]
else:
- # Tracking cameras follow the viewer camera, which an RTX scene camera cannot do, so RTX leaves them out.
+ # The Newton RTX visualizer does not support tracking cameras.
sources = [camera for camera in visualizer.cameras or [] if not (isinstance(camera, TrackingCameraCfg))]
if not sources:
sources = [
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index df6bbaa66a34..b558b7c1f6b6 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -434,7 +434,7 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
)
]) # fmt: skip
if visualizer.cfg.backend.visualizer_type == "newton_rtx":
- # An RTX window shows scene cameras, so tracking cameras have nothing to follow there.
+ # The Newton RTX visualizer does not support tracking cameras.
cameras = [camera for camera in cameras if not (isinstance(camera, TrackingCameraCfg))]
else:
cameras = with_free_view(
@@ -446,10 +446,8 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
for gt_type in visualizer.cfg.streaming_gt_types:
sensor_key_for_gt_type(gt_type)
# tracking cameras only add to the scene cameras the visualizer would find on its own
- tracking_only = bool(visualizer.cfg.cameras) and all(
- isinstance(camera, TrackingCameraCfg) for camera in visualizer.cfg.cameras
- )
- if visualizer.cfg.cameras is None or tracking_only:
+ discovered = visualizer.cfg.cameras is None or visualizer.cfg.tracking_cameras_only
+ if discovered:
if visualizer.cfg.streaming_sensor_prim_path is not None:
cameras.insert(0, SceneCameraCfg(prim_path=visualizer.cfg.streaming_sensor_prim_path))
else:
@@ -458,8 +456,7 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
if resolve_display_channels(visualizer.cfg.streaming_gt_types, camera.cfg.data_types):
cameras.append(camera)
rtx_path = getattr(visualizer.cfg.backend, "rtx_camera_prim_path", None)
- rgb_only = set(visualizer.cfg.streaming_gt_types) == {"rgb"} # the viewer camera provides only RGBA
- if rgb_only and rtx_path is not None and not (visualizer.cfg.cameras is None or tracking_only):
+ if rtx_path is not None and (not discovered or visualizer.cfg.streaming_sensor_prim_path is not None):
# Explicit cameras skip discovery; the Renderer switch still needs this window's RTX camera.
cameras.append(SceneCameraCfg(prim_path=rtx_path))
for index, source in enumerate(cameras):
diff --git a/source/isaaclab/isaaclab/visualizers/base_visualizer.py b/source/isaaclab/isaaclab/visualizers/base_visualizer.py
index e6e01102550a..2e03aa825c0f 100644
--- a/source/isaaclab/isaaclab/visualizers/base_visualizer.py
+++ b/source/isaaclab/isaaclab/visualizers/base_visualizer.py
@@ -27,7 +27,6 @@
from .visualizer_cfg import (
ImageViewCfg,
PerspectiveCameraCfg,
- TrackingCameraCfg,
VisualizerBackendCfg,
VisualizerCfg,
migrate_visualizer_cfgs,
@@ -124,12 +123,10 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
pool = self._env_ids if self._env_ids is not None else range(num_envs)
num_tiles = min(int(self.cfg.streaming_envs), _VISUALIZER_MAX_TILES, len(pool))
env_ids = sorted(random.sample(pool, num_tiles))
- task_views_only = bool(self.cfg.cameras) and all(
- isinstance(camera, TrackingCameraCfg) for camera in self.cfg.cameras
- )
automatic_sources = (
- self.cfg.cameras is None or task_views_only
+ self.cfg.cameras is None or self.cfg.tracking_cameras_only
) and self.cfg.streaming_sensor_prim_path is None
+ rtx_path = getattr(self.cfg.backend, "rtx_camera_prim_path", None)
for camera in cameras:
if isinstance(camera, PerspectiveCameraCfg):
if self.cfg.backend.visualizer_type not in ("newton_gl", "newton_rtx"):
@@ -137,7 +134,8 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
view = sim.get_or_create_backend(ImageViewCfg(source=camera))
else:
channels = tuple(self.cfg.streaming_gt_types)
- if automatic_sources: # Explicitly named sensors must provide what was requested.
+ # Explicitly named sensors must provide what was requested; the window's own RTX camera is RGB only.
+ if automatic_sources or camera.cfg.prim_path == rtx_path:
channels = resolve_display_channels(channels, camera.cfg.data_types)
view_cfg = ImageViewCfg(
source=camera.cfg.prim_path, envs=(0,) if camera.num_instances == 1 else tuple(map(int, env_ids)),
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index 72b91ff18d14..aa391ac50cf5 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -356,6 +356,11 @@ def validate_config(self) -> None:
if self.cameras is not None or self.streaming_sensor_prim_path is not None:
raise ValueError("Choose view or legacy cameras/streaming_sensor_prim_path, not both.")
+ @property
+ def tracking_cameras_only(self) -> bool:
+ """Whether every declared camera is a :class:`TrackingCameraCfg`, so scene cameras are still discovered."""
+ return bool(self.cameras) and all(isinstance(camera, TrackingCameraCfg) for camera in self.cameras)
+
def __post_init__(self) -> None:
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):
@@ -366,7 +371,7 @@ def __post_init__(self) -> None:
if not self.cameras:
raise ValueError("cameras must contain at least one display source.")
# tracking cameras only add to the cameras the visualizer finds, so they leave the streaming choice alone
- if not all(isinstance(camera, TrackingCameraCfg) for camera in self.cameras):
+ if not self.tracking_cameras_only:
self.streaming_view = any(isinstance(camera, SceneCameraCfg) for camera in self.cameras)
if isinstance(camera := self.cameras[0], PerspectiveCameraCfg) and not isinstance(
camera, TrackingCameraCfg
diff --git a/source/isaaclab/test/app/test_rtx_viewer_camera.py b/source/isaaclab/test/app/test_rtx_viewer_camera.py
index b113511f692a..91023b9f4003 100644
--- a/source/isaaclab/test/app/test_rtx_viewer_camera.py
+++ b/source/isaaclab/test/app/test_rtx_viewer_camera.py
@@ -15,6 +15,7 @@
from isaaclab_visualizers.newton import NewtonGLBackendCfg
import isaaclab.app.sim_launcher as sim_launcher
+from isaaclab.physics.physics_manager_cfg import PhysxAutoCfg
from isaaclab.visualizers import VisualizerCfg, WindowCfg
@@ -59,10 +60,22 @@ def test_window_size_is_unchanged_without_a_display_to_query(monkeypatch: pytest
(None, True, None, True, False),
(None, False, PhysxCfg(), True, False),
(None, False, OvPhysxCfg(), True, True),
+ (None, False, PhysxAutoCfg(isaacsim_physx=PhysxCfg(), ovphysx=OvPhysxCfg()), True, True),
+ (None, False, PhysxAutoCfg(isaacsim_physx=PhysxCfg()), True, False),
(None, False, None, False, False),
(None, False, None, True, True),
],
- ids=["explicit-on", "explicit-off", "recording-only-window", "physx", "ovphysx", "no-ovrtx-package", "auto"],
+ ids=[
+ "explicit-on",
+ "explicit-off",
+ "recording-only-window",
+ "physx",
+ "ovphysx",
+ "physx-auto-with-ovphysx",
+ "physx-auto-kit-only",
+ "no-ovrtx-package",
+ "auto",
+ ],
)
def test_viewer_camera_is_declared_only_where_it_can_be_used(
monkeypatch: pytest.MonkeyPatch, rtx_camera, headless, physics, ovrtx_installed, expected
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
index 0b8705a449dc..f2e96bff5981 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_rtx_appearance.py
@@ -189,19 +189,31 @@ def _ensure_lights(self) -> bool:
not self.sun_enabled or self._sun_reference is not None
)
- def apply_lights(self) -> bool:
- """Show the enabled lights with their own intensity and color, hide the rest, and aim the distant light."""
- if not self._ensure_lights():
+ def suspend(self) -> bool:
+ """Give the scene its own lights back and hide the viewer's, since scene cameras share this stage."""
+ return self.apply_lights(active=False)
+
+ def apply_lights(self, active: bool = True) -> bool:
+ """Show the enabled lights with their own intensity and color, hide the rest, and aim the distant light.
+
+ Args:
+ active: ``False`` writes the scene's authored lights and hides the viewer's, so the stage is as the
+ scene left it.
+ """
+ if active and not self._ensure_lights():
return False
from ovrtx import Semantic
+ scene_enabled, scale, tint = (self.scene_enabled, self.scene_scale, self.scene_tint) if active else (
+ True, 1.0, (1.0, 1.0, 1.0)
+ ) # fmt: skip
paths = [light.path for light in self.lights]
- intensities = [light.intensity * self.scene_scale for light in self.lights]
- colors = [np.multiply(light.color, self.scene_tint) for light in self.lights]
- visible = [self.scene_enabled] * len(paths)
+ intensities = [light.intensity * scale for light in self.lights]
+ colors = [np.multiply(light.color, tint) for light in self.lights]
+ visible = [scene_enabled] * len(paths)
for reference, path, enabled, intensity, color in (
- (self._dome_reference, _DOME_PATH, self.dome_enabled, self.dome_intensity, self.dome_color),
- (self._sun_reference, _SUN_PATH, self.sun_enabled, self.sun_intensity, self.sun_color),
+ (self._dome_reference, _DOME_PATH, self.dome_enabled and active, self.dome_intensity, self.dome_color),
+ (self._sun_reference, _SUN_PATH, self.sun_enabled and active, self.sun_intensity, self.sun_color),
):
if reference is not None:
paths.append(path)
@@ -216,7 +228,7 @@ def apply_lights(self) -> bool:
and self._write(paths, "inputs:intensity", np.array(intensities, np.float32))
and self._write(paths, "inputs:color", np.array(colors, np.float32))
)
- if wrote and self._sun_reference is not None:
+ if wrote and active and self._sun_reference is not None:
wrote = self._write([_SUN_PATH], "inputs:angle", np.array([self.sun_angle], np.float32)) and self._write(
[_SUN_PATH],
"omni:xform",
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 8e3128c4e269..fcc3b821c58b 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -759,6 +759,7 @@ class NewtonVisualizerBase(BaseVisualizer):
_rtx_arrows_pending = False
_rtx_overlay_flags: tuple | None = None
_rtx_visibility_limited = False
+ _rtx_appearance: RtxAppearance | None = None
# The OpenGL window overrides these; the standalone RTX window has no OpenGL view to switch to.
rtx_view_index: int | None = None
@@ -1528,7 +1529,8 @@ def _navigate_scene_camera(self) -> None:
def _capture_view(self, view, output: wp.array | None) -> wp.array:
"""Capture a perspective *view*, borrowing the viewer camera when the window shows another one."""
current = self.current_image_view
- if view is current:
+ # the RTX view that follows this tracking camera already shows it, so it is recorded as displayed
+ if view is current or (self.rtx_rendering and view is self._rtx_pose_view):
return self._capture_frame(output)
camera = self._viewer.camera
saved = (PygletVec3(camera.pos.x, camera.pos.y, camera.pos.z), camera.pitch, camera.yaw, camera.fov)
@@ -1600,6 +1602,8 @@ def close(self) -> None:
self._perspective_poses.clear()
self._sensor_tiles.clear()
if self._rtx_appearance is not None:
+ if self._rtx_appearance.available:
+ self._rtx_appearance.suspend()
self._rtx_appearance.close()
self._rtx_appearance = None
for view in self._image_views:
@@ -2004,11 +2008,12 @@ def _rtx_view(self):
def rtx_view_index(self) -> int | None:
"""Index of the OVRTX viewer camera among the image views, or None when the scene has none."""
declared = getattr(getattr(getattr(self, "cfg", None), "backend", None), "rtx_camera_prim_path", None)
+ if (
+ declared is None
+ ): # another visualizer's cameras share the viewer_camera_ prefix, so only a declared one counts
+ return None
for index, view in enumerate(self._image_views):
- if view.camera is None:
- continue
- prim_path = getattr(view.camera.cfg, "prim_path", "")
- if prim_path == declared if declared is not None else prim_path.startswith("/World/viewer_camera_"):
+ if view.camera is not None and getattr(view.camera.cfg, "prim_path", "") == declared:
return index
return None
@@ -2050,9 +2055,13 @@ def set_rtx_rendering(self, enabled: bool) -> None:
self._rtx_pose_view = current if self._is_tracking_view(current) else None
self._select_camera(rtx_index, keep_pose=True)
self._apply_rtx_visible_envs()
+ if self._rtx_appearance is not None and self._rtx_appearance.available:
+ self._rtx_appearance.apply_lights()
else:
if self._overlay_publisher is not None:
self._overlay_publisher.hide_all(self._rtx_renderers)
+ if self._rtx_appearance is not None and self._rtx_appearance.available:
+ self._rtx_appearance.suspend() # scene cameras share the stage, so they get its own lights back
back = self._rtx_pose_view # _select_camera clears it after the outgoing pose is saved
self._select_camera(self._image_views.index(back) if back is not None else free[0], keep_pose=True)
self._apply_rtx_visible_envs() # restore every environment to the sensors that share the renderer
@@ -2157,6 +2166,9 @@ def close(self) -> None:
return
self._close_key_event_source()
try:
+ if self._rtx_visibility_limited: # the shared renderer must not keep hiding environments from sensors
+ self.rtx_rendering = False
+ self._apply_rtx_visible_envs()
if self._overlay_publisher is not None:
try:
self._overlay_publisher.hide_all(self._rtx_renderers)
diff --git a/source/isaaclab_visualizers/test/test_newton_adapter.py b/source/isaaclab_visualizers/test/test_newton_adapter.py
index 7876d8b4eb1e..5f2ce2d88b3b 100644
--- a/source/isaaclab_visualizers/test/test_newton_adapter.py
+++ b/source/isaaclab_visualizers/test/test_newton_adapter.py
@@ -1460,6 +1460,7 @@ def view(source, camera=None):
)
visualizer = object.__new__(NewtonGLVisualizer)
visualizer._image_views = [free, rtx, tracking]
+ visualizer.cfg = SimpleNamespace(backend=SimpleNamespace(rtx_camera_prim_path="/World/viewer_camera_0"))
visualizer.current_image_view = tracking
visualizer._rtx_pose_view = None
@@ -1503,6 +1504,7 @@ def test_a_scene_sensor_view_is_not_an_opengl_or_rtx_view():
)
rtx = SimpleNamespace(camera=SimpleNamespace(cfg=SimpleNamespace(prim_path="/World/viewer_camera_0_rtx")))
visualizer._image_views = [free, sensor, rtx]
+ visualizer.cfg = SimpleNamespace(backend=SimpleNamespace(rtx_camera_prim_path="/World/viewer_camera_0_rtx"))
for view, selected in ((free, False), (sensor, True), (rtx, False)):
visualizer.current_image_view = view
assert visualizer.sensor_view_selected is selected
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index 3a4d539e8d55..976df8913da4 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -164,6 +164,7 @@ def _switchable(views):
base = _visualizer(views)
viz = NewtonGLVisualizer.__new__(NewtonGLVisualizer)
viz.__dict__.update(base.__dict__)
+ viz.cfg = SimpleNamespace(backend=SimpleNamespace(rtx_camera_prim_path="/World/viewer_camera_0"))
viz._overlay_publisher = SimpleNamespace(hide_all=lambda renderers: viz.hidden.append(renderers))
viz._sim.get_or_create_backend = lambda cfg: cfg
viz.hidden, viz.current_image_view = [], views[0]
From 8297fce5aa2d85d8b1ba10e718ef4827611782ee Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 20:34:54 +0000
Subject: [PATCH 087/140] Say the first RTX switch can take a minute
---
.../isaaclab_visualizers/newton/newton_visualizer.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index fcc3b821c58b..09d9918e7140 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -924,7 +924,7 @@ def _draw_streaming_view_controls(self, imgui) -> None:
self.set_rtx_rendering(True)
if imgui.is_item_hovered(imgui.HoveredFlags_.allow_when_disabled):
imgui.set_tooltip(
- "OVRTX path-traced rendering of the scene; slower than OpenGL"
+ "OVRTX path-traced rendering of the scene; slower than OpenGL. The first switch can take a minute"
if not sensor
else "A scene sensor is rendered by its own renderer. This applies to the free and tracking cameras"
)
From 1a27ee1d09c00df0f2c5ea63fe366b0972581e74 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 20:41:24 +0000
Subject: [PATCH 088/140] Offset the tracking camera by the viewer's world
offsets, skip live plots during captures, and keep the shared task view
settings
---
.../isaaclab/visualizers/camera_follower.py | 11 ++++++++---
.../contrib/franka_pour/pour_env_cfg.py | 7 +++++++
.../ur10_particle_push_env_cfg.py | 6 ++++++
.../newton/newton_visualizer.py | 16 ++++++++++++----
.../test/test_newton_tracking_cameras.py | 12 +++++++++++-
5 files changed, 44 insertions(+), 8 deletions(-)
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
index d778fc6b64a6..eb94fdfd2da1 100644
--- a/source/isaaclab/isaaclab/visualizers/camera_follower.py
+++ b/source/isaaclab/isaaclab/visualizers/camera_follower.py
@@ -127,8 +127,8 @@ def pose(self, time: float) -> tuple[tuple[float, float, float], tuple[float, fl
"""
cfg = self.cfg
origin = self._scene.env_origins[self._env]
- offsets = torch.tensor((cfg.eye, cfg.lookat), dtype=torch.float32, device=origin.device)
if self._asset is None:
+ offsets = torch.tensor((cfg.eye, cfg.lookat), dtype=torch.float32, device=origin.device)
eye, target = (origin + offsets).tolist()
return tuple(eye), tuple(target)
asset = self._asset
@@ -151,8 +151,13 @@ def pose(self, time: float) -> tuple[tuple[float, float, float], tuple[float, fl
dt, self._time = (0.0 if self._time is None else max(time - self._time, 0.0)), time
yaw = self._filtered_yaw(state[3:], state[:3], dt)
cos, sin = math.cos(yaw), math.sin(yaw)
- rotation = torch.tensor(((cos, -sin, 0.0), (sin, cos, 0.0), (0.0, 0.0, 1.0)), device=offsets.device)
- offsets = offsets @ rotation.T
+ # the state is already on the host, so the offsets turn there without another device round trip
+ eye, target = (
+ (state[0] + cos * x - sin * y, state[1] + sin * x + cos * y, state[2] + z)
+ for x, y, z in (cfg.eye, cfg.lookat)
+ )
+ return eye, target
+ offsets = torch.tensor((cfg.eye, cfg.lookat), dtype=torch.float32, device=position.device)
eye, target = (position + offsets).tolist()
return tuple(eye), tuple(target)
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
index 10c7600fd777..0e655a72dc9e 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
@@ -21,6 +21,7 @@
from isaaclab_newton.sim.schemas import MujocoJointCfg, NewtonArticulationCfg
from isaaclab_newton.sim.spawners.mpm import MPMParticleMaterialCfg
from isaaclab_physx.sim.schemas import PhysxArticulationCfg
+from isaaclab_visualizers.kit import KitBackendCfg
import isaaclab.sim as sim_utils
from isaaclab.assets import AssetBaseCfg, RigidObjectCfg
@@ -40,6 +41,8 @@
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, ISAACLAB_NUCLEUS_DIR
from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab_tasks.utils.presets import MultiBackendVisualizerCfg
+
from isaaclab_assets.robots.franka import FRANKA_PANDA_CFG
from . import mdp
@@ -530,6 +533,9 @@ class FrankaPourResetDatasetEnvCfg(ManagerBasedRLEnvCfg):
scene: PourSceneCfg = PourSceneCfg(num_envs=2, env_spacing=2.5)
sim: sim_utils.SimulationCfg = sim_utils.SimulationCfg(
visualizer_cfgs=VisualizerCfg(
+ eye=(1.4, 1.4, 0.9),
+ lookat=(0.5, 0.0, 0.1),
+ backend=MultiBackendVisualizerCfg(kit=KitBackendCfg(origin_type="env", origin_env_index=0)),
cameras=[TrackingCameraCfg(eye=(1.4, 1.4, 0.9), lookat=(0.5, 0.0, 0.1))],
)
)
@@ -807,6 +813,7 @@ def play_mode(self) -> None:
"""Configure frozen single-world dataset playback."""
super().play_mode()
self.scene.num_envs = 1
+ self.sim.visualizer_cfgs.eye = (0.9, 0.65, 0.5)
self.sim.visualizer_cfgs.cameras[0].eye = (0.9, 0.65, 0.5)
self.curriculum_freeze = True
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
index 0de9b2b2dae8..6ba02a584c6c 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
@@ -18,6 +18,7 @@
from isaaclab_newton.physics.coupling import CouplerEntryCfg, CouplerProxyCfg, CouplerProxyMappingCfg
from isaaclab_newton.sim.schemas import MujocoJointCfg, NewtonCollisionCfg
from isaaclab_newton.sim.spawners.mpm import MPMGridCfg, MPMParticleMaterialCfg
+from isaaclab_visualizers.kit import KitBackendCfg
import isaaclab.sim as sim_utils
from isaaclab.assets import AssetBaseCfg, RigidObjectCfg
@@ -37,6 +38,8 @@
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab_tasks.utils.presets import MultiBackendVisualizerCfg
+
from isaaclab_assets.robots.universal_robots import UR10_CFG
from . import mdp
@@ -614,6 +617,9 @@ class UR10ParticlePushEnvCfg(ManagerBasedRLEnvCfg):
dt=1.0 / 120.0,
render_interval=decimation,
visualizer_cfgs=VisualizerCfg(
+ eye=(1.7, 1.5, 1.0),
+ lookat=(0.55, 0.0, 0.0),
+ backend=MultiBackendVisualizerCfg(kit=KitBackendCfg(origin_type="env", origin_env_index=0)),
cameras=[TrackingCameraCfg(eye=(1.7, 1.5, 1.0), lookat=(0.55, 0.0, 0.0))],
),
)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index c279caa7d457..7207a065cd16 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -803,9 +803,15 @@ def _apply_view_pose(self, view) -> bool:
pose = follower and follower.pose(self._sim.get_physics_step_count() * self._sim.get_physics_dt())
if pose is None or follower is None:
return False
+ eye, target = pose
+ offsets = self._viewer.world_offsets
+ if offsets is not None: # the viewer draws each environment at its world offset
+ shift = wp.to_torch(offsets)[follower.env].tolist()
+ eye = tuple(a + b for a, b in zip(eye, shift))
+ target = tuple(a + b for a, b in zip(target, shift))
camera = self._viewer.camera
- camera.pos = PygletVec3(*pose[0])
- camera.look_at(pose[1])
+ camera.pos = PygletVec3(*eye)
+ camera.look_at(target)
self._viewer.set_camera(camera.pos, camera.pitch, camera.yaw)
camera.fov = self._focal_length_to_vertical_fov_degrees(source.focal_length)
return True
@@ -820,7 +826,9 @@ def _capture_view(self, view, output: wp.array | None) -> wp.array:
try:
self._borrowing_view = True
self.current_image_view = view
- if not self._is_tracking_view(view): # a free view renders from its declared pose and optics
+ if self._is_tracking_view(view): # rendering may be paused, which leaves the camera where it was
+ self._apply_view_pose(view)
+ else: # a free view renders from its declared pose and optics
source = view.cfg.source
camera.pos = PygletVec3(*source.eye)
camera.look_at(source.lookat)
@@ -1149,7 +1157,7 @@ def _render_frame(self) -> None:
for name, arguments in self._pending_mesh_submissions.items():
viewer.log_mesh(name, **arguments)
self._pending_mesh_submissions.clear()
- if not viewer.is_paused():
+ if not viewer.is_paused() and not self._borrowing_view: # a capture must not add plot samples
self._render_live_plots()
finally:
viewer.end_frame()
diff --git a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
index 42d807e01590..0355a4ee6d1e 100644
--- a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
+++ b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
@@ -11,6 +11,7 @@
import pytest
import torch
+import warp as wp
pytest.importorskip("newton")
from isaaclab_visualizers.newton.newton_visualizer import NewtonVisualizerBase
@@ -51,7 +52,7 @@ def _visualizer(views) -> NewtonVisualizerBase:
def set_camera(pos, pitch, yaw):
camera.pos, camera.pitch, camera.yaw = pos, pitch, yaw
- viz._viewer = SimpleNamespace(camera=camera, set_camera=set_camera, is_paused=lambda: False)
+ viz._viewer = SimpleNamespace(camera=camera, set_camera=set_camera, is_paused=lambda: False, world_offsets=None)
viz._sim = SimpleNamespace(
get_scene_data_provider=lambda: SimpleNamespace(get_interactive_scene=lambda: _Scene()),
get_physics_step_count=lambda: 10,
@@ -180,3 +181,12 @@ def test_the_tracking_camera_recording_keeps_its_last_frame_while_rendering_is_p
tracking.frame = SimpleNamespace(data=object(), timestamp=4)
tracking.read_rgb = lambda step: step
assert viz.render_tracking_rgb_array() == 4
+
+
+def test_a_tracking_camera_follows_the_world_offset_the_viewer_draws_its_environment_at():
+ task = _view(TrackingCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0)))
+ viz = _visualizer([task])
+ viz._viewer.world_offsets = wp.array([[0.0, 0.0, 0.0], [5.0, 0.0, 0.0]], dtype=wp.vec3)
+ assert viz._apply_view_pose(task)
+ camera = viz._viewer.camera
+ assert (camera.pos.x, camera.pos.y, camera.pos.z) == (16.0, 2.0, 3.0)
From 48ebbca7b87ff3e31804619aad15b00ae122e7cb Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 20:45:09 +0000
Subject: [PATCH 089/140] Use the capture flag name from the recording PR for
the live-plot guard
---
.../isaaclab_visualizers/newton/newton_visualizer.py | 2 +-
source/isaaclab_visualizers/test/test_newton_task_views.py | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 8c2675102042..16ddffed2548 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -2159,7 +2159,7 @@ def _render_frame(self) -> None:
for name, arguments in self._pending_mesh_submissions.items():
viewer.log_mesh(name, **arguments)
self._pending_mesh_submissions.clear()
- if not viewer.is_paused() and not self._borrowing_view: # a capture must not add plot samples
+ if not viewer.is_paused() and not self._capturing_another_view: # a capture must not add plot samples
self._render_live_plots()
finally:
viewer.end_frame()
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index 8b392b5a5b7c..6c7fba69117e 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -266,6 +266,7 @@ def test_capturing_a_view_the_window_does_not_show_stays_out_of_the_hud_recordin
viz._viewer.camera.pos = Vec3(0.0, 0.0, 0.0)
viz._viewer.camera.pitch = viz._viewer.camera.yaw = 0.0
viz._viewer.set_camera = lambda *args: None
+ viz._viewer.world_offsets = None
seen = []
viz._capture_frame = lambda output: seen.append(viz._capturing_another_view)
From ef5ec9a224b30fd91ab4f86e2ffdcde1a32c2c5f Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 20:48:38 +0000
Subject: [PATCH 090/140] Add Camera Speed and Shift Boost sliders to the
Newton camera controls
---
.../changelog.d/newton-camera-speed.added.rst | 1 +
.../newton/newton_visualizer.py | 23 ++++++++++++++++++-
.../test/test_newton_task_views.py | 20 ++++++++++++++++
3 files changed, 43 insertions(+), 1 deletion(-)
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-camera-speed.added.rst
diff --git a/source/isaaclab_visualizers/changelog.d/newton-camera-speed.added.rst b/source/isaaclab_visualizers/changelog.d/newton-camera-speed.added.rst
new file mode 100644
index 000000000000..c082dfa5fe02
--- /dev/null
+++ b/source/isaaclab_visualizers/changelog.d/newton-camera-speed.added.rst
@@ -0,0 +1 @@
+* Added **Camera Speed** and **Shift Boost** sliders to the Newton visualizer's camera controls, which set how fast the keyboard moves the free camera and how much faster it moves while Shift is held.
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 2bc67c1400ad..e99604dc3826 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -317,7 +317,10 @@ def camera_speed(self) -> float:
from pyglet.window import key
boosted = self.is_key_down(key.LSHIFT) or self.is_key_down(key.RSHIFT)
- return self._camera_speed * (self.CAMERA_SPEED_BOOST_MULTIPLIER if boosted else 1.0)
+ return self._camera_speed * (self.camera_speed_boost if boosted else 1.0)
+
+ camera_speed_boost: float = CAMERA_SPEED_BOOST_MULTIPLIER
+ """Factor applied to the camera speed while Shift is held."""
@camera_speed.setter
def camera_speed(self, value: float) -> None:
@@ -1128,6 +1131,7 @@ def _draw_streaming_view_controls(self, imgui) -> None:
imgui.end_disabled()
self._draw_appearance(imgui)
self._draw_focal_length(imgui)
+ self._draw_camera_speed(imgui)
# The OVRTX camera is chosen with the Renderer toggle, so the list holds only the other sources.
indices = sorted(
(i for i in range(len(self._image_views)) if i != rtx_index),
@@ -1454,6 +1458,23 @@ def _draw_focal_length(self, imgui) -> None:
view.invalidate()
self._last_render_step = -1
+ def _draw_camera_speed(self, imgui) -> None:
+ """Draw the keyboard speed of the free camera; tracking cameras and sensors do not move with the keys."""
+ view = self._pose_source_view()
+ if view.camera is not None or self._is_tracking_view(view):
+ return
+ speed = float(self._viewer._camera_speed)
+ changed, speed = imgui.slider_float(
+ "Camera Speed", speed, 0.1, 50.0, "%.1f m/s", imgui.SliderFlags_.logarithmic
+ )
+ hover_tooltip(imgui, "How fast the WASD keys move the camera")
+ if changed:
+ self._viewer.camera_speed = speed
+ changed, boost = imgui.slider_float("Shift Boost", float(self._viewer.camera_speed_boost), 1.0, 10.0, "%.1fx")
+ hover_tooltip(imgui, "How much faster the camera moves while Shift is held")
+ if changed:
+ self._viewer.camera_speed_boost = boost
+
def _draw_tracking_camera_controls(self, imgui, follower: CameraFollower) -> None:
"""Edit the selected Tracking Camera: what it follows, where it sits, and where it looks."""
cfg = follower.cfg
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index 0f95215da950..cb0a508977da 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -258,3 +258,23 @@ def test_a_free_view_records_the_rtx_window_instead_of_an_opengl_render():
assert viz._capture_view(free, None) == "window frame"
assert viz.current_image_view is rtx
+
+
+def test_the_camera_speed_slider_sets_the_free_cameras_keyboard_speed():
+ free, tracking = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=0))
+ viz = _switchable([free, tracking])
+ viz._viewer = SimpleNamespace(_camera_speed=5.0, camera_speed=5.0, camera_speed_boost=2.0)
+ viz._pose_source_view = lambda: viz.current_image_view
+ imgui = SimpleNamespace(
+ slider_float=lambda *args: (True, 12.0),
+ SliderFlags_=SimpleNamespace(logarithmic=0),
+ is_item_hovered=lambda *args: False,
+ HoveredFlags_=SimpleNamespace(allow_when_disabled=0),
+ )
+ viz.current_image_view = tracking
+ viz._draw_camera_speed(imgui)
+ assert viz._viewer.camera_speed == 5.0 # a tracking camera does not move with the keys
+
+ viz.current_image_view = free
+ viz._draw_camera_speed(imgui)
+ assert viz._viewer.camera_speed == 12.0 and viz._viewer.camera_speed_boost == 12.0
From 0936e31ff63749d2504e83f0c969d4dece784683 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 21:04:11 +0000
Subject: [PATCH 091/140] Put the camera speed sliders above the camera readout
---
.../isaaclab_visualizers/newton/newton_visualizer.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index e99604dc3826..5b2dcba1629d 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -1131,7 +1131,6 @@ def _draw_streaming_view_controls(self, imgui) -> None:
imgui.end_disabled()
self._draw_appearance(imgui)
self._draw_focal_length(imgui)
- self._draw_camera_speed(imgui)
# The OVRTX camera is chosen with the Renderer toggle, so the list holds only the other sources.
indices = sorted(
(i for i in range(len(self._image_views)) if i != rtx_index),
@@ -1178,6 +1177,7 @@ def _draw_camera_info(self, imgui) -> None:
if camera is None or self.sensor_view_selected: # A sensor draws its own image, not this camera's view.
return
imgui.separator()
+ self._draw_camera_speed(imgui)
pos = camera.pos
imgui.text_disabled(f"Position: ({pos[0]:.2f}, {pos[1]:.2f}, {pos[2]:.2f})")
hover_tooltip(imgui, "World position of the camera [m]")
From 8b7aa7cf7ca8787b9b0bd253aaebec0ce1f98ae5 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 21:11:02 +0000
Subject: [PATCH 092/140] Reword the Shift speed binding now that the boost is
adjustable
---
.../isaaclab_visualizers/newton/newton_visualizer.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 5b2dcba1629d..3dd5501d47ed 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -442,7 +442,7 @@ def _render_left_panel(_g=gui):
"Camera",
[
"WASD - Move",
- "Shift + WASD - Move 2x faster",
+ "Shift + WASD - Move faster (Shift Boost)",
"QE - Up / down",
"Left Click - Look around",
"Middle Click - Orbit",
From 825d05340a176d562a111b767a3bbb0875f11114 Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Thu, 19 Nov 2026 22:33:42 +0000
Subject: [PATCH 093/140] Fix closing the Newton window while RTX limits
environments, release the RTX scene when selecting a sensor, and make
tracking_cameras_only a method
---
.../isaaclab/sim/simulation_context.py | 2 +-
.../isaaclab/visualizers/base_visualizer.py | 2 +-
.../isaaclab/visualizers/visualizer_cfg.py | 3 +--
.../newton/newton_visualizer.py | 26 ++++++++++++-------
.../test/test_newton_task_views.py | 11 +++++++-
.../test_newton_visualizer_viewer_release.py | 14 ++++++++++
6 files changed, 44 insertions(+), 14 deletions(-)
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index b558b7c1f6b6..b2455f766bd1 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -446,7 +446,7 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
for gt_type in visualizer.cfg.streaming_gt_types:
sensor_key_for_gt_type(gt_type)
# tracking cameras only add to the scene cameras the visualizer would find on its own
- discovered = visualizer.cfg.cameras is None or visualizer.cfg.tracking_cameras_only
+ discovered = visualizer.cfg.cameras is None or visualizer.cfg.tracking_cameras_only()
if discovered:
if visualizer.cfg.streaming_sensor_prim_path is not None:
cameras.insert(0, SceneCameraCfg(prim_path=visualizer.cfg.streaming_sensor_prim_path))
diff --git a/source/isaaclab/isaaclab/visualizers/base_visualizer.py b/source/isaaclab/isaaclab/visualizers/base_visualizer.py
index 2e03aa825c0f..3ef38ad9689b 100644
--- a/source/isaaclab/isaaclab/visualizers/base_visualizer.py
+++ b/source/isaaclab/isaaclab/visualizers/base_visualizer.py
@@ -124,7 +124,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
num_tiles = min(int(self.cfg.streaming_envs), _VISUALIZER_MAX_TILES, len(pool))
env_ids = sorted(random.sample(pool, num_tiles))
automatic_sources = (
- self.cfg.cameras is None or self.cfg.tracking_cameras_only
+ self.cfg.cameras is None or self.cfg.tracking_cameras_only()
) and self.cfg.streaming_sensor_prim_path is None
rtx_path = getattr(self.cfg.backend, "rtx_camera_prim_path", None)
for camera in cameras:
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index aa391ac50cf5..3e6ff1084c59 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -356,7 +356,6 @@ def validate_config(self) -> None:
if self.cameras is not None or self.streaming_sensor_prim_path is not None:
raise ValueError("Choose view or legacy cameras/streaming_sensor_prim_path, not both.")
- @property
def tracking_cameras_only(self) -> bool:
"""Whether every declared camera is a :class:`TrackingCameraCfg`, so scene cameras are still discovered."""
return bool(self.cameras) and all(isinstance(camera, TrackingCameraCfg) for camera in self.cameras)
@@ -371,7 +370,7 @@ def __post_init__(self) -> None:
if not self.cameras:
raise ValueError("cameras must contain at least one display source.")
# tracking cameras only add to the cameras the visualizer finds, so they leave the streaming choice alone
- if not self.tracking_cameras_only:
+ if not self.tracking_cameras_only():
self.streaming_view = any(isinstance(camera, SceneCameraCfg) for camera in self.cameras)
if isinstance(camera := self.cameras[0], PerspectiveCameraCfg) and not isinstance(
camera, TrackingCameraCfg
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 8a03073af4b4..6212ccb967bc 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -1457,6 +1457,13 @@ def _apply_view_pose(self, view) -> bool:
camera.fov = self._focal_length_to_vertical_fov_degrees(view.cfg.source.focal_length)
return True
+ def _release_rtx_scene(self) -> None:
+ """Give the scene cameras that share the OVRTX renderer back the overlays and lights the viewer added."""
+ if self._overlay_publisher is not None:
+ self._overlay_publisher.hide_all(self._rtx_renderers)
+ if self._rtx_appearance is not None and self._rtx_appearance.available:
+ self._rtx_appearance.suspend()
+
def _select_camera(self, index: int, *, keep_pose: bool = False) -> None:
"""Bind the selected source; all scene cameras retain their normal lazy-data lifecycle.
@@ -1466,9 +1473,12 @@ def _select_camera(self, index: int, *, keep_pose: bool = False) -> None:
"""
if getattr(self, "_pose_started", True): # the viewer camera holds no pose of its own before the first source
self._remember_perspective_pose()
- if self._overlay_publisher is not None and self.rtx_rendering and index != self.rtx_view_index:
- self._overlay_publisher.hide_all(self._rtx_renderers) # sensors sharing the renderer must not keep them
+ leaving_rtx = self.rtx_rendering and index != self.rtx_view_index
+ if leaving_rtx:
+ self._release_rtx_scene()
self.current_image_view = self._image_views[index]
+ if leaving_rtx:
+ self._apply_rtx_visible_envs() # restore every environment to the sensors that share the renderer
if index != getattr(self, "rtx_view_index", None):
self._rtx_pose_view = None
camera = self.current_image_view.cfg.source
@@ -2066,13 +2076,8 @@ def set_rtx_rendering(self, enabled: bool) -> None:
if self._rtx_appearance is not None and self._rtx_appearance.available:
self._rtx_appearance.apply_lights()
else:
- if self._overlay_publisher is not None:
- self._overlay_publisher.hide_all(self._rtx_renderers)
- if self._rtx_appearance is not None and self._rtx_appearance.available:
- self._rtx_appearance.suspend() # scene cameras share the stage, so they get its own lights back
back = self._rtx_pose_view # _select_camera clears it after the outgoing pose is saved
self._select_camera(self._image_views.index(back) if back is not None else free[0], keep_pose=True)
- self._apply_rtx_visible_envs() # restore every environment to the sensors that share the renderer
@property
def visible_env_limit(self) -> int:
@@ -2175,8 +2180,11 @@ def close(self) -> None:
self._close_key_event_source()
try:
if self._rtx_visibility_limited: # the shared renderer must not keep hiding environments from sensors
- self.rtx_rendering = False
- self._apply_rtx_visible_envs()
+ try:
+ self._env_ids = None
+ self._apply_rtx_visible_envs()
+ except Exception:
+ logger.debug("[NewtonVisualizer] The environment visibility could not be restored.", exc_info=True)
if self._overlay_publisher is not None:
try:
self._overlay_publisher.hide_all(self._rtx_renderers)
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index 976df8913da4..8008cc8a9344 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -186,7 +186,16 @@ def test_switching_to_rtx_and_back_returns_to_the_perspective_view():
viz.set_rtx_rendering(False)
assert viz.current_image_view is free and not viz.rtx_rendering
- assert viz.hidden == [("ovrtx",)] # The overlay meshes are hidden when OVRTX stops drawing.
+
+
+def test_leaving_rtx_hides_the_overlays_and_suspends_the_viewer_lights():
+ viz = _switchable([_view(PerspectiveCameraCfg()), _rtx_view()])
+ suspended = []
+ viz._rtx_appearance = SimpleNamespace(available=True, suspend=lambda: suspended.append(True))
+
+ NewtonGLVisualizer._release_rtx_scene(viz)
+
+ assert viz.hidden == [("ovrtx",)] and suspended == [True]
def test_rtx_rendering_needs_the_viewer_camera_declared_at_launch():
diff --git a/source/isaaclab_visualizers/test/test_newton_visualizer_viewer_release.py b/source/isaaclab_visualizers/test/test_newton_visualizer_viewer_release.py
index 552554c5dc4f..0367687e85e6 100644
--- a/source/isaaclab_visualizers/test/test_newton_visualizer_viewer_release.py
+++ b/source/isaaclab_visualizers/test/test_newton_visualizer_viewer_release.py
@@ -115,3 +115,17 @@ def test_keyboard_camera_movement_can_be_disabled(monkeypatch):
visualizer.set_camera_keys_enabled(True)
viewer._update_camera(0.2)
assert moved == [0.2]
+
+
+def test_close_lifts_the_visible_environment_limit_of_the_shared_renderer():
+ """Closing while RTX limits the environments restores them for the scene cameras and still finishes."""
+ visualizer = NewtonGLVisualizer(VisualizerCfg(backend=NewtonGLBackendCfg()))
+ visualizer._viewer = Mock()
+ visualizer._rtx_visibility_limited = True
+ visualizer._env_ids = [0]
+ seen = []
+ visualizer._apply_rtx_visible_envs = lambda: seen.append(visualizer._env_ids)
+
+ visualizer.close()
+
+ assert seen == [None] and visualizer._is_closed
From a53076830b4e217a9023bb4d697b7ca384561c7d Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Fri, 20 Nov 2026 00:33:25 +0000
Subject: [PATCH 094/140] Split the tracking camera out of the RTX toggle
---
docs/source/api/lab/isaaclab.visualizers.rst | 4 -
docs/source/concepts/visualization.rst | 26 +-
docs/source/how-to/record_video.rst | 2 -
.../visualizer_streaming_camera_view.rst | 50 +---
.../tracking-camera-tracking.added.rst | 3 -
.../tracking-camera-tracking.minor | 0
source/isaaclab/isaaclab/app/sim_launcher.py | 27 +-
.../isaaclab/envs/utils/video_recorder.py | 15 +-
.../isaaclab/envs/utils/video_recorder_cfg.py | 20 +-
.../isaaclab/sim/simulation_context.py | 23 +-
.../isaaclab/visualizers/__init__.pyi | 2 -
.../isaaclab/visualizers/base_visualizer.py | 4 +-
.../isaaclab/visualizers/camera_follower.py | 191 ------------
.../isaaclab/visualizers/visualizer_cfg.py | 82 +----
.../isaaclab/test/envs/test_video_recorder.py | 28 --
.../test/visualizers/test_camera_follower.py | 222 --------------
.../tracking-camera-tracking.added.rst | 2 -
.../tracking-camera-tracking.minor | 0
.../contrib/franka_pour/pour_env_cfg.py | 4 +-
.../multitask_env_cfg.py | 2 +-
.../ur10_particle_push_env_cfg.py | 3 +-
.../core/cabinet/cabinet_env_cfg.py | 8 +-
.../cartpole_direct_camera_env_cfg.py | 5 +-
.../core/cartpole/cartpole_direct_env_cfg.py | 13 +-
.../cartpole_manager_camera_env_cfg.py | 6 +-
.../core/cartpole/cartpole_manager_env_cfg.py | 13 +-
.../fourbar_pole_manager_env_cfg.py | 14 +-
.../core/handover/handover_common.py | 9 +-
.../config/franka_soft/franka_soft_env_cfg.py | 8 +-
.../isaaclab_tasks/core/lift/lift_env_cfg.py | 14 +-
.../core/locomotion/ant/ant_common.py | 15 -
.../core/locomotion/ant/ant_direct_env_cfg.py | 8 +-
.../locomotion/ant/ant_manager_env_cfg.py | 2 -
.../locomotion/humanoid/humanoid_common.py | 15 -
.../humanoid/humanoid_direct_env_cfg.py | 16 +-
.../humanoid/humanoid_manager_env_cfg.py | 2 -
.../core/pendulum/pendulum_marl_env_cfg.py | 16 +-
.../reach/config/ur_10/joint_pos_env_cfg.py | 2 -
.../core/reach/reach_env_cfg.py | 13 +-
.../allegro_hand_direct_env_cfg.py | 1 -
.../shadow_hand_camera_manager_env_cfg.py | 1 -
.../shadow_hand_direct_camera_env_cfg.py | 1 -
.../shadow_hand/shadow_hand_direct_env_cfg.py | 1 -
.../core/reorient/reorient_manager_env_cfg.py | 1 -
.../isaaclab_tasks/core/reorient/utils.py | 16 +-
.../velocity/config/anymal_d/rough_env_cfg.py | 1 -
.../velocity/config/cassie/rough_env_cfg.py | 1 -
.../core/velocity/config/go2/rough_env_cfg.py | 1 -
.../core/velocity/config/h1/rough_env_cfg.py | 1 -
.../core/velocity/velocity_env_cfg.py | 13 -
.../newton-gl-camera-sources.added.rst | 2 +-
.../newton-gl-rtx-renderer-toggle.added.rst | 3 +-
.../tracking-camera-tracking.added.rst | 3 -
.../tracking-camera-tracking.minor | 0
.../newton/newton_visualizer.py | 283 ++----------------
.../test/test_newton_adapter.py | 45 +--
.../test/test_newton_task_views.py | 78 ++---
.../test/test_newton_tracking_cameras.py | 193 ------------
58 files changed, 124 insertions(+), 1410 deletions(-)
delete mode 100644 source/isaaclab/changelog.d/tracking-camera-tracking.added.rst
delete mode 100644 source/isaaclab/changelog.d/tracking-camera-tracking.minor
delete mode 100644 source/isaaclab/isaaclab/visualizers/camera_follower.py
delete mode 100644 source/isaaclab/test/visualizers/test_camera_follower.py
delete mode 100644 source/isaaclab_tasks/changelog.d/tracking-camera-tracking.added.rst
delete mode 100644 source/isaaclab_tasks/changelog.d/tracking-camera-tracking.minor
delete mode 100644 source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.added.rst
delete mode 100644 source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.minor
delete mode 100644 source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
diff --git a/docs/source/api/lab/isaaclab.visualizers.rst b/docs/source/api/lab/isaaclab.visualizers.rst
index 07b406c12768..f18253c6f9de 100644
--- a/docs/source/api/lab/isaaclab.visualizers.rst
+++ b/docs/source/api/lab/isaaclab.visualizers.rst
@@ -27,7 +27,6 @@ The following classes are part of the public :mod:`isaaclab.visualizers` API.
VisualizerBackendCfg
WindowCfg
PerspectiveCameraCfg
- TrackingCameraCfg
SceneCameraCfg
ImageViewCfg
ImageView
@@ -52,9 +51,6 @@ The following classes are part of the public :mod:`isaaclab.visualizers` API.
.. autoclass:: PerspectiveCameraCfg
:show-inheritance:
-.. autoclass:: TrackingCameraCfg
- :show-inheritance:
-
.. autoclass:: SceneCameraCfg
:show-inheritance:
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index e11f316e8807..de3607c35bea 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -598,15 +598,14 @@ task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton G
Rerun, and Viser visualizers. **Kit** opens it as a separate **Streaming View** viewport, which can
sit side by side with the default viewport for dual monitoring. **Newton GL** and **Newton RTX**
provide a **Camera Source** selector in the sidebar for switching between perspective and scene-camera
-views. A perspective view can also be a *tracking camera* that follows a robot or frames an environment; only Newton GL
-supports it.
+views.
Selecting a scene sensor in **Camera Source** shows its channel: the **Channel** selector lists the
sensor's outputs (RGB, depth, normals, or segmentation), and depth, normals, and segmentation are
converted to colors for display. When the sensor is declared once per environment, **Tiled Envs**
sets how many of its feeds are tiled into the window.
See :doc:`/source/how-to/visualizer_streaming_camera_view` for the ``VisualizerCfg`` options, display
-sources, tracking cameras that follow a robot, troubleshooting, migration from generated cameras, and step-by-step examples.
+sources, troubleshooting, migration from generated cameras, and step-by-step examples.
Visualization Markers
@@ -830,23 +829,22 @@ Watch training live in Kit while recording from a separate headless Newton GL an
``--viz kit --video viz:newton_gl`` and giving each visualizer its own camera. See
:ref:`Recording from an independent camera angle ` for the configuration.
-**Following a moving robot**
+**Following a moving robot (Kit)**
-Declare a *tracking camera* instead of updating ``eye``/``lookat`` every step; see :ref:`how-to-visualizer-tracking-cameras`.
-This is Newton GL only. Kit ignores a ``TrackingCameraCfg`` and follows an asset with
-``KitBackendCfg(origin_type="asset", origin_track_path="robot")`` instead. For Newton GL:
+Lock the Kit camera to a moving asset instead of updating ``eye``/``lookat`` yourself every
+step, running with ``--viz kit``:
.. code-block:: python
- from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+ from isaaclab_visualizers.kit import KitBackendCfg
+
+ from isaaclab.visualizers import VisualizerCfg
+
+ from isaaclab_tasks.utils.presets import MultiBackendVisualizerCfg
sim_cfg.visualizer_cfgs = VisualizerCfg(
- cameras=[
- TrackingCameraCfg(
- track_path="robot", # or "robot/panda_hand" to track a specific body
- eye=(4.0, 4.0, 2.0), # offset from the tracked asset
- ),
- ],
+ eye=(4.0, 4.0, 2.0),
+ backend=MultiBackendVisualizerCfg(kit=KitBackendCfg(origin_type="asset", origin_track_path="robot")),
)
**Sharing a live view with a remote teammate**
diff --git a/docs/source/how-to/record_video.rst b/docs/source/how-to/record_video.rst
index 4304d62f58a8..edd415d5b43a 100644
--- a/docs/source/how-to/record_video.rst
+++ b/docs/source/how-to/record_video.rst
@@ -288,8 +288,6 @@ The ``source`` string selects what to capture:
- Newton OVRTX path-traced viewport
* - ``"viz:newton_gl:streaming_view"``
- Newton GL streaming camera panel, requires ``streaming_view=True``
- * - ``"viz:newton_gl:tracking"``
- - First ``TrackingCameraCfg`` of the visualizer, whichever view the window shows; see :ref:`how-to-visualizer-tracking-cameras`
* - ``"sensor:"``
- ``env.scene.sensors[name]``, RGB (default)
* - ``"sensor::rgb"``
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index fc3231759f2c..daba74128391 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -7,9 +7,8 @@ Streaming a camera view in a visualizer
.. currentmodule:: isaaclab
-This guide shows how to show ground-truth camera frames from many environments in one live
-panel of a visualizer, and how to add a view that follows a robot (see :ref:`how-to-visualizer-tracking-cameras`).
-For how the view works and which visualizers support it, see :ref:`visualization-streaming-camera-view`.
+Display ground-truth camera frames from many environments in one live visualizer panel. For how the view works and which visualizers support it, see
+:ref:`visualization-streaming-camera-view`.
Sharing a view with recording
@@ -126,7 +125,6 @@ for dual monitoring.
**Newton GL and Newton RTX** have a **Camera Source** selector in the sidebar. Selecting a scene camera displays
its tiled output in the main viewport instead of rendering a perspective view behind it.
Selecting a perspective camera restores interactive scene rendering. Newton GL also restores picking.
-A tracking camera is listed as **Tracking Camera**; see :ref:`how-to-visualizer-tracking-cameras`.
Without an explicit ``cameras`` list, Newton GL starts in perspective and offers scene cameras
that provide every requested ``streaming_gt_types`` channel. An explicit
@@ -248,50 +246,6 @@ Unselected cameras are still allocated and may render if another consumer reads
scene uses eager sensor updates. ``streaming_envs`` selects displayed tiles, not capture work.
-.. _how-to-visualizer-tracking-cameras:
-
-Tracking cameras that follow a robot
-------------------------------------
-
-A ``TrackingCameraCfg`` frames an environment or follows an asset in it. Its ``eye`` and ``lookat`` are
-offsets [m] from the environment origin, or from the tracked asset, so it frames the robot wherever the scene puts
-it. In the OpenGL renderer the visualizer renders it from its own camera, so nothing is added to the scene and the view
-keeps the viewport's markers and shadows. In RTX the window follows it by moving the OVRTX viewer camera, which is a
-camera in the scene, and OpenGL shadows do not apply.
-
-.. code-block:: python
-
- from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
-
- env_cfg.sim.visualizer_cfgs = VisualizerCfg(
- cameras=[
- TrackingCameraCfg(
- eye=(1.8, -3.0, 1.1),
- lookat=(0.15, 0.0, 0.0),
- track_path="robot",
- follow_heading=True,
- heading_smoothing_time_constant=0.2,
- )
- ],
- )
-
-* ``env_index``: the environment to frame or follow; defaults to the middle one.
-* ``track_path``: a scene asset (``"robot"``) or one of its bodies (``"robot/base"``). Without it, the view stays
- fixed in the environment.
-* ``follow_heading``: rotate the offsets with the asset's yaw, keeping the horizon level.
- ``heading_smoothing_time_constant`` [s] damps rapid turns.
-
-A free view at the visualizer's own ``eye`` and ``lookat`` is added before the first tracking camera, so the
-interactive camera stays free.
-
-* **Newton GL:** **Camera Source** lists the tracking camera as **Tracking Camera** beside **Perspective**, and the
- window follows it in both the OpenGL and RTX renderers. A **Tracking Camera** group edits its environment, asset,
- body, eye, look-at, focal length and heading settings while it runs; **Reset to Task Default** restores the
- declaration. Record it with ``--video viz:newton_gl:tracking``, whichever view the window shows. Plain
- ``--video viz:newton_gl`` records whichever renderer the window shows.
-* **Kit**, **Newton RTX**, **Viser** and **Rerun** ignore tracking cameras.
-
-
Examples
--------
diff --git a/source/isaaclab/changelog.d/tracking-camera-tracking.added.rst b/source/isaaclab/changelog.d/tracking-camera-tracking.added.rst
deleted file mode 100644
index c1c58a11ae9c..000000000000
--- a/source/isaaclab/changelog.d/tracking-camera-tracking.added.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-* Added :class:`~isaaclab.visualizers.TrackingCameraCfg`, a perspective camera that frames an environment or follows
- an asset with optional smoothed heading. Added the ``viz::tracking`` video source, which records the first
- tracking camera whichever view the window shows, for Newton GL.
diff --git a/source/isaaclab/changelog.d/tracking-camera-tracking.minor b/source/isaaclab/changelog.d/tracking-camera-tracking.minor
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/source/isaaclab/isaaclab/app/sim_launcher.py b/source/isaaclab/isaaclab/app/sim_launcher.py
index f6d2e91cdd6d..3aa20e23d8ee 100644
--- a/source/isaaclab/isaaclab/app/sim_launcher.py
+++ b/source/isaaclab/isaaclab/app/sim_launcher.py
@@ -42,14 +42,7 @@
from ..utils.images import sensor_key_for_gt_type
from ..utils.math import create_rotation_matrix_from_view, quat_from_matrix
from ..utils.string import string_to_callable
-from ..visualizers import (
- ImageViewCfg,
- PerspectiveCameraCfg,
- SceneCameraCfg,
- TrackingCameraCfg,
- VisualizerBackendCfg,
- VisualizerCfg,
-)
+from ..visualizers import ImageViewCfg, PerspectiveCameraCfg, SceneCameraCfg, VisualizerBackendCfg, VisualizerCfg
from ..visualizers.visualizer_cfg import VISUALIZER_ALIASES, migrate_visualizer_cfgs
from .logging_utils import apply_python_logging_level, ensure_console_handlers, resolve_python_logging_level
from .settings_manager import get_settings_manager
@@ -373,19 +366,11 @@ def validate_launch( # noqa: C901
for viewer_index, visualizer in enumerate(viewers):
if not isinstance(visualizer.backend, NewtonRTXBackendCfg) or scene_cfg is None:
continue
- if visualizer.view is not None:
- if isinstance(visualizer.view.source, TrackingCameraCfg):
- raise ValueError("A tracking camera cannot be the image source of an RTX viewer.")
- sources = [visualizer.view.source]
- else:
- # The Newton RTX visualizer does not support tracking cameras.
- sources = [camera for camera in visualizer.cameras or [] if not (isinstance(camera, TrackingCameraCfg))]
- if not sources:
- sources = [
- PerspectiveCameraCfg(
- eye=visualizer.eye, lookat=visualizer.lookat, focal_length=visualizer.focal_length
- )
- ]
+ sources = (
+ [visualizer.view.source] if visualizer.view is not None else list(visualizer.cameras or [
+ PerspectiveCameraCfg(eye=visualizer.eye, lookat=visualizer.lookat, focal_length=visualizer.focal_length)
+ ])
+ ) # fmt: skip
for camera_index, source in enumerate(sources):
if not isinstance(source, PerspectiveCameraCfg):
continue
diff --git a/source/isaaclab/isaaclab/envs/utils/video_recorder.py b/source/isaaclab/isaaclab/envs/utils/video_recorder.py
index 3bc74554eb12..ab2590fc7499 100644
--- a/source/isaaclab/isaaclab/envs/utils/video_recorder.py
+++ b/source/isaaclab/isaaclab/envs/utils/video_recorder.py
@@ -70,20 +70,7 @@ def __init__(self, cfg: VideoRecorderCfg, env: object):
f"Enable streaming_view on {viz.cfg.backend.visualizer_type!r} to record its sensor view."
)
# Legacy recording follows camera selection in the window.
- if channel == "tracking":
- if viz.cfg.backend.visualizer_type != "newton_gl":
- raise RuntimeError(
- f"The {viz.cfg.backend.visualizer_type!r} visualizer cannot record a tracking view. Use "
- "'viz:newton_gl:tracking'."
- )
- if not viz.has_tracking_view:
- raise RuntimeError(
- "The newton_gl visualizer declares no tracking camera to record. Add a TrackingCameraCfg to "
- "its cameras."
- )
- self._capture = viz.render_tracking_rgb_array
- else:
- self._capture = viz.render_tiled_rgb_array if channel == "streaming_view" else viz.render_rgb_array
+ self._capture = viz.render_tiled_rgb_array if channel == "streaming_view" else viz.render_rgb_array
self.cfg = cfg
self._env = env
diff --git a/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py b/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
index 4cf870760c91..a6da03a82344 100644
--- a/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
+++ b/source/isaaclab/isaaclab/envs/utils/video_recorder_cfg.py
@@ -23,9 +23,9 @@ def parse_video_source(source: str) -> tuple[str, str, str]:
"""Split a string :attr:`VideoRecorderCfg.source` into ``(kind, name, sub)``.
``kind`` is ``"viz"`` or ``"sensor"``; ``name`` is the canonical visualizer type (``""`` for a bare
- ``"viz"``) or the sensor name; ``sub`` is ``"streaming_view"``, ``"tracking"``, a sensor channel, or ``""``.
- The prefix ``visualizer`` is the long form of ``viz``, as ``--visualizer`` is of ``--viz``; the deprecated
- ``newton`` type is mapped to ``newton_gl`` with a :class:`DeprecationWarning`.
+ ``"viz"``) or the sensor name; ``sub`` is ``"streaming_view"``, a sensor channel, or ``""``. The prefix
+ ``visualizer`` is the long form of ``viz``, as ``--visualizer`` is of ``--viz``; the deprecated ``newton``
+ type is mapped to ``newton_gl`` with a :class:`DeprecationWarning`.
A bare visualizer type is shorthand for ``viz:``.
Raises:
@@ -38,11 +38,7 @@ def parse_video_source(source: str) -> tuple[str, str, str]:
name, sub = (*parts, "", "")[:2]
if kind == "viz" and not parts:
return kind, "", ""
- if (
- kind == "viz"
- and parts[1:] in ([], ["streaming_view"], ["tracking"])
- and name in (*VISUALIZER_TYPES, *VISUALIZER_ALIASES)
- ):
+ if kind == "viz" and parts[1:] in ([], ["streaming_view"]) and name in (*VISUALIZER_TYPES, *VISUALIZER_ALIASES):
if name in VISUALIZER_ALIASES:
warnings.warn(
f"Video source type {name!r} is deprecated. Use {VISUALIZER_ALIASES[name]!r} instead.",
@@ -53,9 +49,9 @@ def parse_video_source(source: str) -> tuple[str, str, str]:
if kind == "sensor" and 1 <= len(parts) <= 2 and name and sub in ("", *SENSOR_CHANNELS):
return kind, name, sub
raise ValueError(
- f"Invalid video source {source!r}: expected '', 'viz', 'viz:', 'viz::streaming_view', "
- f"'viz::tracking' or 'sensor:[:]', with one of "
- f"{', '.join(VISUALIZER_TYPES)} and one of {', '.join(SENSOR_CHANNELS)}."
+ f"Invalid video source {source!r}: expected '', 'viz', 'viz:', 'viz::streaming_view' or "
+ f"'sensor:[:]', with one of {', '.join(VISUALIZER_TYPES)} and one of "
+ f"{', '.join(SENSOR_CHANNELS)}."
)
@@ -78,8 +74,6 @@ class VideoRecorderCfg:
camera: the one ``--viz`` selected, else a headless one added for the recording.
* ``"viz::streaming_view"`` – the streaming camera panel of that visualizer (requires
``streaming_view=True`` on its :class:`~isaaclab.visualizers.VisualizerCfg`).
- * ``"viz::tracking"`` – the first :class:`~isaaclab.visualizers.TrackingCameraCfg` of
- that visualizer, whichever view its window shows. Only Newton GL supports it.
* ``"sensor:"`` – scene sensor, RGB channel (default); no visualizer is added.
* ``"sensor::"`` – scene sensor channel: ``rgb``, ``depth`` (colorized via the turbo
colormap), ``segmentation`` or ``normals`` (colorized).
diff --git a/source/isaaclab/isaaclab/sim/simulation_context.py b/source/isaaclab/isaaclab/sim/simulation_context.py
index b2455f766bd1..092de3801d6f 100644
--- a/source/isaaclab/isaaclab/sim/simulation_context.py
+++ b/source/isaaclab/isaaclab/sim/simulation_context.py
@@ -36,14 +36,7 @@
from ..utils.version import has_kit
from ..visualizers.base_visualizer import BaseVisualizer
from ..visualizers.image_view import ImageView
-from ..visualizers.visualizer_cfg import (
- PerspectiveCameraCfg,
- SceneCameraCfg,
- TrackingCameraCfg,
- VisualizerCfg,
- migrate_visualizer_cfgs,
- with_free_view,
-)
+from ..visualizers.visualizer_cfg import PerspectiveCameraCfg, SceneCameraCfg, VisualizerCfg, migrate_visualizer_cfgs
from .utils import create_new_stage
from .utils import stage as stage_utils
@@ -433,21 +426,12 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
eye=visualizer.cfg.eye, lookat=visualizer.cfg.lookat, focal_length=visualizer.cfg.focal_length
)
]) # fmt: skip
- if visualizer.cfg.backend.visualizer_type == "newton_rtx":
- # The Newton RTX visualizer does not support tracking cameras.
- cameras = [camera for camera in cameras if not (isinstance(camera, TrackingCameraCfg))]
- else:
- cameras = with_free_view(
- cameras, visualizer.cfg.eye, visualizer.cfg.lookat, visualizer.cfg.focal_length
- )
if visualizer.cfg.view is None and visualizer.cfg.streaming_view:
sensors = self._scene_data_provider.get_camera_sensors()
env_template = self._clone_plan.env_template if self._clone_plan is not None else DEFAULT_ENV_TEMPLATE
for gt_type in visualizer.cfg.streaming_gt_types:
sensor_key_for_gt_type(gt_type)
- # tracking cameras only add to the scene cameras the visualizer would find on its own
- discovered = visualizer.cfg.cameras is None or visualizer.cfg.tracking_cameras_only()
- if discovered:
+ if visualizer.cfg.cameras is None:
if visualizer.cfg.streaming_sensor_prim_path is not None:
cameras.insert(0, SceneCameraCfg(prim_path=visualizer.cfg.streaming_sensor_prim_path))
else:
@@ -456,7 +440,8 @@ def initialize_visualizers(self, config_filter: Callable[[Any], bool] | None = N
if resolve_display_channels(visualizer.cfg.streaming_gt_types, camera.cfg.data_types):
cameras.append(camera)
rtx_path = getattr(visualizer.cfg.backend, "rtx_camera_prim_path", None)
- if rtx_path is not None and (not discovered or visualizer.cfg.streaming_sensor_prim_path is not None):
+ explicit = visualizer.cfg.cameras is not None or visualizer.cfg.streaming_sensor_prim_path is not None
+ if rtx_path is not None and explicit:
# Explicit cameras skip discovery; the Renderer switch still needs this window's RTX camera.
cameras.append(SceneCameraCfg(prim_path=rtx_path))
for index, source in enumerate(cameras):
diff --git a/source/isaaclab/isaaclab/visualizers/__init__.pyi b/source/isaaclab/isaaclab/visualizers/__init__.pyi
index f170d6c27475..a230550c4afe 100644
--- a/source/isaaclab/isaaclab/visualizers/__init__.pyi
+++ b/source/isaaclab/isaaclab/visualizers/__init__.pyi
@@ -10,7 +10,6 @@ __all__ = [
"KeyEventSource",
"KeyboardSubscription",
"PerspectiveCameraCfg",
- "TrackingCameraCfg",
"SceneCameraCfg",
"VisualizerCfg",
"VisualizerBackendCfg",
@@ -25,7 +24,6 @@ from .visualizer_cfg import (
ImageViewCfg,
PerspectiveCameraCfg,
SceneCameraCfg,
- TrackingCameraCfg,
VisualizerBackendCfg,
VisualizerCfg,
WindowCfg,
diff --git a/source/isaaclab/isaaclab/visualizers/base_visualizer.py b/source/isaaclab/isaaclab/visualizers/base_visualizer.py
index 3ef38ad9689b..7691a5df4cf4 100644
--- a/source/isaaclab/isaaclab/visualizers/base_visualizer.py
+++ b/source/isaaclab/isaaclab/visualizers/base_visualizer.py
@@ -123,9 +123,7 @@ def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraC
pool = self._env_ids if self._env_ids is not None else range(num_envs)
num_tiles = min(int(self.cfg.streaming_envs), _VISUALIZER_MAX_TILES, len(pool))
env_ids = sorted(random.sample(pool, num_tiles))
- automatic_sources = (
- self.cfg.cameras is None or self.cfg.tracking_cameras_only()
- ) and self.cfg.streaming_sensor_prim_path is None
+ automatic_sources = self.cfg.cameras is None and self.cfg.streaming_sensor_prim_path is None
rtx_path = getattr(self.cfg.backend, "rtx_camera_prim_path", None)
for camera in cameras:
if isinstance(camera, PerspectiveCameraCfg):
diff --git a/source/isaaclab/isaaclab/visualizers/camera_follower.py b/source/isaaclab/isaaclab/visualizers/camera_follower.py
deleted file mode 100644
index eb94fdfd2da1..000000000000
--- a/source/isaaclab/isaaclab/visualizers/camera_follower.py
+++ /dev/null
@@ -1,191 +0,0 @@
-# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
-# All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-"""World poses for perspective views tied to an environment or an asset."""
-
-from __future__ import annotations
-
-import math
-from collections.abc import Sequence
-from typing import TYPE_CHECKING
-
-import torch
-
-if TYPE_CHECKING:
- from ..scene import InteractiveScene
- from .visualizer_cfg import TrackingCameraCfg
-
-_RESET_JUMP = 1.0
-"""Distance [m] an asset moves between two updates only when its environment resets."""
-
-_RESET_YAW_JUMP = 1.5
-"""Heading change [rad] between two updates that a robot only makes when its environment resets.
-
-A fixed angle, unlike a rate, does not misfire when two updates are a few milliseconds apart."""
-
-_CATCH_UP_LAG = math.pi / 2
-"""Lag [rad] behind the robot heading beyond which the camera heading catches up faster."""
-
-
-class CameraFollower:
- """Turns a :class:`~isaaclab.visualizers.TrackingCameraCfg` tied to an environment into world poses.
-
- A view that only has :attr:`~isaaclab.visualizers.TrackingCameraCfg.env_index` stays fixed relative to that
- environment's origin. A view with :attr:`~isaaclab.visualizers.TrackingCameraCfg.track_path` follows the
- asset's position, and its yaw when ``follow_heading`` is set, with the heading filtered over time.
- """
-
- def __init__(self, cfg: TrackingCameraCfg, scene: InteractiveScene, env_ids: Sequence[int] | None = None) -> None:
- """Bind *cfg* to *scene*.
-
- Args:
- cfg: The tracking camera. Its ``env_index`` None selects the middle environment.
- scene: The scene to read environment origins and assets from.
- env_ids: The visible environments, or None when all are; the middle one is picked from these.
- """
- self.cfg = cfg
- self._scene = scene
- self._env = 0
- self._yaw: float | None = None
- self._raw_yaw: float | None = None
- self._last_position: list[float] | None = None
- self._time: float | None = None
- if cfg.env_index is not None:
- self.set_env(cfg.env_index)
- else:
- ids = list(env_ids) if env_ids else range(scene.num_envs)
- self.set_env(ids[(len(ids) - 1) // 2])
- self._asset = None
- self._body_index: int | None = None
- self._body_name = ""
- if cfg.track_path:
- self.set_track_path(cfg.track_path)
-
- @property
- def env(self) -> int:
- """Environment whose origin or asset the view follows."""
- return self._env
-
- def set_track_path(self, track_path: str | None) -> None:
- """Follow another asset or body, or only the environment origin when *track_path* is empty.
-
- Args:
- track_path: ``"asset"`` for an asset root or ``"asset/body"`` for one of its bodies; None or an empty
- string stops following an asset.
-
- Raises:
- ValueError: If the asset is unknown, or the body does not match exactly one body of an initialized asset.
- """
- asset, body_name = None, ""
- if track_path:
- asset_name, _, body_name = track_path.partition("/")
- try:
- asset = self._scene[asset_name]
- except KeyError as exc:
- raise ValueError(f"track_path refers to an unknown scene asset: {asset_name!r}.") from exc
- if body_name and asset.is_initialized and len(asset.find_bodies(body_name)[0]) != 1:
- raise ValueError(f"track_path must match exactly one body: {track_path!r}.")
- self.cfg.track_path = track_path or None
- self._asset, self._body_name, self._body_index = asset, body_name, None
- self._yaw = self._raw_yaw = self._last_position = self._time = None
-
- def reset(self) -> None:
- """Forget the heading history, so the next pose is not smoothed against the previous episode."""
- self._yaw = self._raw_yaw = self._last_position = self._time = None
-
- def asset_names(self) -> list[str]:
- """Return the names of the scene assets the view can follow."""
- scene = self._scene
- return [*getattr(scene, "articulations", {}), *getattr(scene, "rigid_objects", {})]
-
- def body_names(self, asset_name: str) -> list[str]:
- """Return the body names of the scene asset *asset_name*, or an empty list when it has none."""
- try:
- return list(getattr(self._scene[asset_name], "body_names", []))
- except KeyError:
- return []
-
- def set_env(self, index: int) -> None:
- """Follow environment *index* from now on, with the heading filter starting afresh.
-
- Raises:
- ValueError: If *index* is outside the scene's environments.
- """
- if not 0 <= index < self._scene.num_envs:
- raise ValueError(f"env_index {index} is outside the {self._scene.num_envs} environments of the scene.")
- self._env = int(index)
- self.cfg.env_index = self._env
- self._yaw = self._raw_yaw = self._last_position = self._time = None
-
- def pose(self, time: float) -> tuple[tuple[float, float, float], tuple[float, float, float]] | None:
- """Return the world eye and look-at target at simulation *time*, or None until the asset is ready.
-
- Args:
- time: Simulation time [s]. Only the heading filter uses it, through the time since the previous call.
- """
- cfg = self.cfg
- origin = self._scene.env_origins[self._env]
- if self._asset is None:
- offsets = torch.tensor((cfg.eye, cfg.lookat), dtype=torch.float32, device=origin.device)
- eye, target = (origin + offsets).tolist()
- return tuple(eye), tuple(target)
- asset = self._asset
- if not asset.is_initialized:
- return None
- data = asset.data
- if self._body_name:
- if self._body_index is None:
- body_ids, _ = asset.find_bodies(self._body_name)
- if len(body_ids) != 1:
- raise ValueError(f"track_path must match exactly one body: {cfg.track_path!r}.")
- self._body_index = body_ids[0]
- position = data.body_pos_w.torch[self._env, self._body_index]
- quat = data.body_quat_w.torch[self._env, self._body_index]
- else:
- position, quat = data.root_pos_w.torch[self._env], data.root_quat_w.torch[self._env]
- if cfg.follow_heading:
- # one device-to-host copy per frame
- state = torch.cat((position, quat)).tolist()
- dt, self._time = (0.0 if self._time is None else max(time - self._time, 0.0)), time
- yaw = self._filtered_yaw(state[3:], state[:3], dt)
- cos, sin = math.cos(yaw), math.sin(yaw)
- # the state is already on the host, so the offsets turn there without another device round trip
- eye, target = (
- (state[0] + cos * x - sin * y, state[1] + sin * x + cos * y, state[2] + z)
- for x, y, z in (cfg.eye, cfg.lookat)
- )
- return eye, target
- offsets = torch.tensor((cfg.eye, cfg.lookat), dtype=torch.float32, device=position.device)
- eye, target = (position + offsets).tolist()
- return tuple(eye), tuple(target)
-
- def _filtered_yaw(self, quat: list[float], position: list[float], dt: float) -> float:
- """Return the yaw of the xyzw *quat*, filtered so the camera follows the turn in the direction it happened.
-
- The heading is tracked unwrapped, so a camera that falls more than half a turn behind keeps turning the same
- way instead of reversing, and it catches up faster the further it lags. The first sample, and the sample after
- an environment resets, is not filtered.
- """
- x, y, z, w = quat
- yaw = math.atan2(2.0 * (w * z + x * y), 1.0 - 2.0 * (y * y + z * z))
- last, self._last_position = self._last_position, position
- reset = self._yaw is None or last is None or math.dist(position, last) > _RESET_JUMP
- step = 0.0 if reset else math.remainder(yaw - self._raw_yaw, math.tau)
- if not reset:
- # an environment can reset in place with a new heading; the raw heading is compared, since the filtered
- # one lags behind a steady turn
- reset = abs(step) > _RESET_YAW_JUMP
- # signed heading changes add up, so the target keeps the direction of the turn
- self._raw_yaw = yaw if reset else self._raw_yaw + step
- tau = self.cfg.heading_smoothing_time_constant
- if tau > 0.0 and not reset:
- lag = self._raw_yaw - self._yaw
- if abs(lag) > _CATCH_UP_LAG:
- tau *= _CATCH_UP_LAG / abs(lag)
- yaw = self._yaw + -math.expm1(-dt / tau) * lag
- else:
- yaw = self._raw_yaw
- self._yaw = yaw
- return yaw
diff --git a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
index 3e6ff1084c59..ca47d3bd5789 100644
--- a/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
+++ b/source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
@@ -29,26 +29,6 @@
"""Deprecated ``--visualizer`` names and their replacements."""
-def with_free_view(
- cameras: list[PerspectiveCameraCfg | SceneCameraCfg],
- eye: tuple[float, float, float],
- lookat: tuple[float, float, float],
- focal_length: float,
-) -> list[PerspectiveCameraCfg | SceneCameraCfg]:
- """Return *cameras* with a free perspective view added when it has tracking cameras but no free view of its own.
-
- A tracking camera follows a robot or frames an environment, so the interactive view that a user moves stays
- available beside it, at the visualizer's own ``eye``, ``lookat`` and ``focal_length``. The free view goes
- right before the first tracking camera, so scene cameras declared ahead of it stay first.
- """
- perspective = [camera for camera in cameras if isinstance(camera, PerspectiveCameraCfg)]
- if perspective and all(isinstance(camera, TrackingCameraCfg) for camera in perspective):
- free = PerspectiveCameraCfg(eye=eye, lookat=lookat, focal_length=focal_length)
- first_tracking = next(i for i, camera in enumerate(cameras) if isinstance(camera, PerspectiveCameraCfg))
- return [*cameras[:first_tracking], free, *cameras[first_tracking:]]
- return cameras
-
-
@configclass
class PerspectiveCameraCfg:
"""Initial pose and optics for an interactive perspective camera.
@@ -66,48 +46,6 @@ class PerspectiveCameraCfg:
"""Perspective camera focal length [mm]."""
-@configclass
-class TrackingCameraCfg(PerspectiveCameraCfg):
- """A camera that frames an environment or follows an asset in it, however the scene is laid out.
-
- The Newton GL window shows it in either renderer. Only Newton GL supports it; other visualizers ignore it.
- """
-
- eye: tuple[float, float, float] = (4.0, -4.0, 3.0)
- """Eye position [m], as an offset from the tracked asset, or from the origin of :attr:`env_index`."""
-
- lookat: tuple[float, float, float] = (0.0, 0.0, 0.0)
- """Look-at target [m], in the same frame as :attr:`eye`."""
-
- env_index: int | None = None
- """Environment to frame, or the one holding the tracked asset; None picks the middle one of the visible
- environments."""
-
- track_path: str | None = None
- """Scene asset to follow, or None for a view fixed relative to the environment origin.
-
- Use ``"robot"`` for an asset root or ``"robot/base"`` for a named body, which must match exactly one body.
- """
-
- follow_heading: bool = False
- """Rotate :attr:`eye` and :attr:`lookat` with the tracked asset's yaw, keeping the horizon level.
-
- Without it the offsets stay aligned with the world axes. Only used with :attr:`track_path`.
- """
-
- heading_smoothing_time_constant: float = 0.0
- """Exponential heading-filter time constant [s]; zero follows the heading immediately.
-
- Larger values damp rapid turns more, with more lag. Only used with :attr:`follow_heading`.
- """
-
- def __post_init__(self) -> None:
- if self.env_index is not None and self.env_index < 0:
- raise ValueError("env_index must be non-negative.")
- if not math.isfinite(self.heading_smoothing_time_constant) or self.heading_smoothing_time_constant < 0.0:
- raise ValueError("heading_smoothing_time_constant must be finite and non-negative.")
-
-
@configclass
class SceneCameraCfg:
"""Select an existing scene camera's output as the visualizer's main view.
@@ -245,13 +183,11 @@ class VisualizerCfg:
"""Render on demand without opening a native viewer window."""
# Primary interactive camera settings
- cameras: list[PerspectiveCameraCfg | TrackingCameraCfg | SceneCameraCfg] | None = None
+ cameras: list[PerspectiveCameraCfg | SceneCameraCfg] | None = None
"""Camera sources available to the visualizer.
- PerspectiveCameraCfg configures the interactive view, TrackingCameraCfg a view that frames an environment
- or follows an asset, and SceneCameraCfg refers to an existing scene sensor.
- Newton GL and RTX display the first source and offer a dropdown for switching sources. Newton GL adds a free
- view in front of a leading TrackingCameraCfg (see ``with_free_view``) and shows that one first.
+ PerspectiveCameraCfg configures the interactive view; SceneCameraCfg refers to an existing scene
+ sensor. Newton GL and RTX display the first source and offer a dropdown for switching sources.
Kit, Rerun, and Viser display the first scene source in their camera panel.
None uses eye/lookat/focal_length and the streaming settings below.
Every explicit scene source must provide all requested streaming_gt_types channels.
@@ -356,10 +292,6 @@ def validate_config(self) -> None:
if self.cameras is not None or self.streaming_sensor_prim_path is not None:
raise ValueError("Choose view or legacy cameras/streaming_sensor_prim_path, not both.")
- def tracking_cameras_only(self) -> bool:
- """Whether every declared camera is a :class:`TrackingCameraCfg`, so scene cameras are still discovered."""
- return bool(self.cameras) and all(isinstance(camera, TrackingCameraCfg) for camera in self.cameras)
-
def __post_init__(self) -> None:
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):
@@ -369,12 +301,8 @@ def __post_init__(self) -> None:
if self.cameras is not None:
if not self.cameras:
raise ValueError("cameras must contain at least one display source.")
- # tracking cameras only add to the cameras the visualizer finds, so they leave the streaming choice alone
- if not self.tracking_cameras_only():
- self.streaming_view = any(isinstance(camera, SceneCameraCfg) for camera in self.cameras)
- if isinstance(camera := self.cameras[0], PerspectiveCameraCfg) and not isinstance(
- camera, TrackingCameraCfg
- ):
+ self.streaming_view = any(isinstance(camera, SceneCameraCfg) for camera in self.cameras)
+ if isinstance(camera := self.cameras[0], PerspectiveCameraCfg):
self.eye, self.lookat, self.focal_length = camera.eye, camera.lookat, camera.focal_length
diff --git a/source/isaaclab/test/envs/test_video_recorder.py b/source/isaaclab/test/envs/test_video_recorder.py
index 00caa781f55d..2c8a190422e7 100644
--- a/source/isaaclab/test/envs/test_video_recorder.py
+++ b/source/isaaclab/test/envs/test_video_recorder.py
@@ -58,7 +58,6 @@ def __init__(self, viz_type: str, frame: np.ndarray | None = None):
self.cfg = VisualizerCfg(backend=VisualizerBackendCfg(visualizer_type=viz_type))
self._frame = frame if frame is not None else _FRAME.copy()
self.render_calls = 0
- self.has_tracking_view = True
def render_rgb_array(self) -> np.ndarray:
self.render_calls += 1
@@ -68,11 +67,6 @@ def supports_markers(self) -> bool:
return True
-def _without_tracking_view(viz: _FakeViz) -> _FakeViz:
- viz.has_tracking_view = False
- return viz
-
-
def _make_env(visualizers=(), sensors: dict | None = None):
env = SimpleNamespace(sim=MagicMock(), scene=SimpleNamespace(), step_dt=0.02)
env.sim.visualizers = list(visualizers)
@@ -103,7 +97,6 @@ def _make_env(visualizers=(), sensors: dict | None = None):
("viser", ("viz", "viser", "")),
("rerun", ("viz", "rerun", "")),
("viz:newton_gl:streaming_view", ("viz", "newton_gl", "streaming_view")),
- ("viz:newton_gl:tracking", ("viz", "newton_gl", "tracking")),
("sensor:tiled_camera", ("sensor", "tiled_camera", "")),
("sensor:tiled_camera:depth", ("sensor", "tiled_camera", "depth")),
# ``visualizer`` is the long form of ``viz``
@@ -265,15 +258,6 @@ def test_source_resolves_frame(source, make_env, caplog):
assert not caplog.records
-def test_a_tracking_source_records_the_tracking_camera_not_the_selected_one():
- viz = _FakeViz("newton_gl")
- task_frame = np.full_like(_FRAME, 7)
- viz.render_tracking_rgb_array = lambda: task_frame
- recorder = VideoRecorder(_cfg(source="viz:newton_gl:tracking"), _make_env(visualizers=[viz]))
- assert recorder._capture() is task_frame
- assert viz.render_calls == 0
-
-
@pytest.mark.parametrize(
"source,make_env,error,message",
[
@@ -285,18 +269,6 @@ def test_a_tracking_source_records_the_tracking_camera_not_the_selected_one():
RuntimeError,
"Enable streaming_view",
),
- (
- "viz:newton_gl:tracking",
- lambda: _make_env(visualizers=[_without_tracking_view(_FakeViz("newton_gl"))]),
- RuntimeError,
- "declares no tracking camera",
- ),
- (
- "viz:kit:tracking",
- lambda: _make_env(visualizers=[_FakeViz("kit")]),
- RuntimeError,
- "cannot record a tracking view",
- ),
("sensor:missing", lambda: _make_env(sensors={"tiled_camera": MagicMock()}), ValueError, "missing"),
("sensor:tiled_camera:depth", lambda: _make_env(sensors={"tiled_camera": _rgb_sensor()}), KeyError, "depth"),
],
diff --git a/source/isaaclab/test/visualizers/test_camera_follower.py b/source/isaaclab/test/visualizers/test_camera_follower.py
deleted file mode 100644
index 92ac4a49669b..000000000000
--- a/source/isaaclab/test/visualizers/test_camera_follower.py
+++ /dev/null
@@ -1,222 +0,0 @@
-# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
-# All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-"""Unit tests for perspective views tied to an environment or an asset."""
-
-from __future__ import annotations
-
-import math
-from types import SimpleNamespace
-
-import pytest
-import torch
-
-from isaaclab.visualizers import PerspectiveCameraCfg, SceneCameraCfg, TrackingCameraCfg, VisualizerCfg
-from isaaclab.visualizers.camera_follower import CameraFollower
-from isaaclab.visualizers.visualizer_cfg import with_free_view
-
-pytestmark = pytest.mark.kitless
-
-
-def _quat_z(yaw: float) -> list[float]:
- """Quaternion (x, y, z, w) of a rotation of *yaw* about +Z."""
- return [0.0, 0.0, math.sin(yaw / 2), math.cos(yaw / 2)]
-
-
-class _Scene:
- """Two environments, 10 m apart, with a robot at the origin of the second."""
-
- num_envs = 2
- env_origins = torch.tensor([[0.0, 0.0, 0.0], [10.0, 0.0, 0.0]])
-
- def __init__(self, ready: bool = True):
- data = SimpleNamespace(
- root_pos_w=SimpleNamespace(torch=torch.tensor([[0.0, 0.0, 0.5], [10.0, 0.0, 0.5]])),
- root_quat_w=SimpleNamespace(torch=torch.tensor([[0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 0.0, 1.0]])),
- )
- self.robot = SimpleNamespace(is_initialized=ready, data=data)
-
- def __getitem__(self, name):
- return self.robot
-
-
-def _eye(follower: CameraFollower, time: float = 0.1) -> torch.Tensor:
- return torch.tensor(follower.pose(time)[0])
-
-
-def test_a_view_with_an_environment_stays_fixed_relative_to_its_origin():
- cfg = TrackingCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0))
- eye, target = CameraFollower(cfg, _Scene()).pose(0.1)
- assert eye == (11.0, 2.0, 3.0)
- assert target == (10.0, 0.0, 1.0)
-
-
-def test_a_tracked_view_follows_the_asset_and_rotates_with_its_heading():
- scene = _Scene()
- cfg = TrackingCameraCfg(env_index=1, track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
- follower = CameraFollower(cfg, scene)
- torch.testing.assert_close(_eye(follower), torch.tensor([7.0, 0.0, 1.5]))
- # turned a quarter turn, the robot's back is at -y
- scene.robot.data.root_quat_w.torch[1] = torch.tensor(_quat_z(math.pi / 2))
- torch.testing.assert_close(_eye(follower), torch.tensor([10.0, -3.0, 1.5]), atol=1e-5, rtol=0)
- # without heading the offsets stay aligned with the world axes
- cfg.follow_heading = False
- torch.testing.assert_close(_eye(follower), torch.tensor([7.0, 0.0, 1.5]))
-
-
-def test_smoothing_lags_a_turn_but_not_a_reset():
- def run(jump: float) -> torch.Tensor:
- scene = _Scene()
- cfg = TrackingCameraCfg(track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
- cfg.heading_smoothing_time_constant = 0.5
- follower = CameraFollower(cfg, scene)
- follower.pose(0.0)
- scene.robot.data.root_quat_w.torch[0] = torch.tensor(_quat_z(0.2)) # 2 rad/s
- scene.robot.data.root_pos_w.torch[0, 0] += jump # an environment reset also moves the asset
- return _eye(follower)
-
- smooth, reset = run(0.0), run(5.0)
- assert smooth[1] > -0.3 # filtered toward the new heading
- torch.testing.assert_close(reset[1], torch.tensor(-3.0 * math.sin(0.2)), atol=1e-4, rtol=0) # the new one at once
-
-
-def test_a_reset_in_place_with_a_new_heading_is_not_smoothed_but_a_real_turn_is():
- def run(yaw: float) -> torch.Tensor:
- scene = _Scene()
- cfg = TrackingCameraCfg(track_path="robot", eye=(-3.0, 0.0, 1.0), follow_heading=True)
- cfg.heading_smoothing_time_constant = 0.5
- follower = CameraFollower(cfg, scene)
- follower.pose(0.0)
- scene.robot.data.root_quat_w.torch[0] = torch.tensor(_quat_z(yaw)) # the position does not change
- return torch.tensor(follower.pose(0.02)[0])
-
- torch.testing.assert_close(run(math.pi / 2)[1], torch.tensor(-3.0), atol=1e-4, rtol=0) # 78 rad/s: a reset
- assert run(0.05)[1] > -0.05 # 2.5 rad/s: a turn; unfiltered it would be -0.15
-
-
-def test_a_view_waits_for_its_asset_and_rejects_bad_targets():
- assert CameraFollower(TrackingCameraCfg(track_path="robot"), _Scene(ready=False)).pose(0.1) is None
- with pytest.raises(ValueError, match="outside"):
- CameraFollower(TrackingCameraCfg(env_index=2), _Scene())
- with pytest.raises(ValueError, match="non-negative"):
- TrackingCameraCfg(env_index=-1)
- with pytest.raises(ValueError, match="non-negative"):
- TrackingCameraCfg(heading_smoothing_time_constant=-1.0)
-
-
-def test_tracking_cameras_get_a_free_view_beside_them():
- free, task = PerspectiveCameraCfg(), TrackingCameraCfg(env_index=0)
- args = ((1.0, 2.0, 3.0), (0.0, 0.0, 0.0), 30.0)
- assert with_free_view([task], *args)[0].eye == (1.0, 2.0, 3.0)
- assert len(with_free_view([task], *args)) == 2
- assert with_free_view([free, task], *args) == [free, task]
- # scene cameras declared ahead of the tracking camera stay first
- sensor = SceneCameraCfg(prim_path="/cam")
- views = with_free_view([sensor, task], *args)
- assert views[0] is sensor and views[1].eye == (1.0, 2.0, 3.0) and views[2] is task
- assert with_free_view([SceneCameraCfg(prim_path="/cam")], *args) == [SceneCameraCfg(prim_path="/cam")]
- # a tracking camera first does not replace the visualizer's own pose or its streaming choice
- cfg = VisualizerCfg(eye=(7.0, 0.0, 0.0), streaming_view=True, cameras=[task])
- assert cfg.eye == (7.0, 0.0, 0.0) and cfg.streaming_view
- assert not VisualizerCfg(streaming_view=True, cameras=[free]).streaming_view
-
-
-class _NamedScene(_Scene):
- """A scene that knows its assets by name, as an interactive scene does."""
-
- def __init__(self):
- super().__init__()
- self.robot.body_names = ["base", "LF_FOOT"]
- self.robot.find_bodies = lambda name: (
- [self.robot.body_names.index(name)] if name in self.robot.body_names else [],
- [],
- )
- self.articulations, self.rigid_objects = {"robot": self.robot}, {"cube": SimpleNamespace(is_initialized=True)}
-
- def __getitem__(self, name):
- try:
- return {**self.articulations, **self.rigid_objects}[name]
- except KeyError:
- raise KeyError(name) from None
-
-
-def test_the_followed_asset_can_be_switched_and_cleared_while_running():
- cfg = TrackingCameraCfg(env_index=1, eye=(1.0, 0.0, 0.0), lookat=(0.0, 0.0, 0.0))
- follower = CameraFollower(cfg, _NamedScene())
- assert _eye(follower).tolist() == [11.0, 0.0, 0.0] # Fixed relative to the environment origin.
-
- follower.set_track_path("robot")
- assert cfg.track_path == "robot"
- assert _eye(follower).tolist() == [11.0, 0.0, 0.5] # Offset from the robot at (10, 0, 0.5).
-
- follower.set_track_path(None)
- assert cfg.track_path is None
- assert _eye(follower).tolist() == [11.0, 0.0, 0.0]
-
-
-def test_an_unknown_asset_or_ambiguous_body_is_rejected_and_keeps_the_current_target():
- cfg = TrackingCameraCfg(env_index=0, track_path="robot")
- follower = CameraFollower(cfg, _NamedScene())
-
- with pytest.raises(ValueError, match="unknown scene asset"):
- follower.set_track_path("ghost")
- with pytest.raises(ValueError, match="exactly one body"):
- follower.set_track_path("robot/no_such_body")
-
- assert cfg.track_path == "robot"
- follower.set_track_path("robot/LF_FOOT")
- assert cfg.track_path == "robot/LF_FOOT"
-
-
-def test_the_followable_assets_and_bodies_are_listed():
- follower = CameraFollower(TrackingCameraCfg(env_index=0), _NamedScene())
-
- assert follower.asset_names() == ["robot", "cube"]
- assert follower.body_names("robot") == ["base", "LF_FOOT"]
- assert follower.body_names("cube") == []
- assert follower.body_names("missing") == []
-
-
-def test_a_steady_turn_with_heavy_smoothing_is_not_mistaken_for_an_environment_reset():
- cfg = TrackingCameraCfg(env_index=0, track_path="robot", follow_heading=True, heading_smoothing_time_constant=2.0)
- follower = CameraFollower(cfg, _NamedScene())
- previous = None
- for step in range(120): # one radian per second sampled at 10 Hz, so the filter lags by more than a reset jump
- raw = 0.1 * step
- yaw = follower._filtered_yaw([0.0, 0.0, math.sin(raw / 2), math.cos(raw / 2)], [0.0, 0.0, 0.5], 0.1)
- if previous is not None:
- assert abs(math.remainder(yaw - previous, math.tau)) < 0.2
- previous = yaw
-
-
-def test_a_camera_lagging_more_than_half_a_turn_keeps_turning_the_same_way():
- cfg = TrackingCameraCfg(env_index=0, track_path="robot", follow_heading=True, heading_smoothing_time_constant=50.0)
- follower = CameraFollower(cfg, _NamedScene())
- yaws = []
- for step in range(100): # a robot spinning at 2 rad/s, far faster than the filter follows
- raw = 0.2 * step
- yaws.append(follower._filtered_yaw([0.0, 0.0, math.sin(raw / 2), math.cos(raw / 2)], [0.0, 0.0, 0.5], 0.1))
- assert all(later >= earlier for earlier, later in zip(yaws, yaws[1:]))
- assert yaws[-1] > yaws[0]
-
-
-def test_the_heading_filter_starts_afresh_after_a_reset():
- cfg = TrackingCameraCfg(env_index=0, track_path="robot", follow_heading=True, heading_smoothing_time_constant=1.0)
- follower = CameraFollower(cfg, _NamedScene())
- follower._filtered_yaw([0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 0.5], 0.1)
-
- follower.reset()
-
- assert follower._filtered_yaw([0.0, 0.0, 0.2, 0.98], [0.0, 0.0, 0.5], 0.1) == pytest.approx(0.4027, abs=1e-3)
-
-
-def test_without_an_env_index_the_middle_visible_environment_is_followed():
- class _Many(_Scene):
- num_envs = 256
- env_origins = torch.zeros(256, 3)
-
- assert CameraFollower(TrackingCameraCfg(), _Many()).env == 127
- assert CameraFollower(TrackingCameraCfg(), _Many(), env_ids=[3, 10, 40]).env == 10
- assert CameraFollower(TrackingCameraCfg(env_index=5), _Many()).env == 5
diff --git a/source/isaaclab_tasks/changelog.d/tracking-camera-tracking.added.rst b/source/isaaclab_tasks/changelog.d/tracking-camera-tracking.added.rst
deleted file mode 100644
index ef2cc7e525f7..000000000000
--- a/source/isaaclab_tasks/changelog.d/tracking-camera-tracking.added.rst
+++ /dev/null
@@ -1,2 +0,0 @@
-* Added tracking cameras to the core tasks: a fixed view of the environment, or a view that follows the robot for
- locomotion tasks. Record them with ``--video viz:newton_gl:tracking``.
diff --git a/source/isaaclab_tasks/changelog.d/tracking-camera-tracking.minor b/source/isaaclab_tasks/changelog.d/tracking-camera-tracking.minor
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
index 0e655a72dc9e..988dd5a8b2c9 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/franka_pour/pour_env_cfg.py
@@ -39,7 +39,7 @@
from isaaclab.sim.spawners.materials import RigidBodyMaterialBaseCfg
from isaaclab.utils import configclass, replace
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, ISAACLAB_NUCLEUS_DIR
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab.visualizers import VisualizerCfg
from isaaclab_tasks.utils.presets import MultiBackendVisualizerCfg
@@ -536,7 +536,6 @@ class FrankaPourResetDatasetEnvCfg(ManagerBasedRLEnvCfg):
eye=(1.4, 1.4, 0.9),
lookat=(0.5, 0.0, 0.1),
backend=MultiBackendVisualizerCfg(kit=KitBackendCfg(origin_type="env", origin_env_index=0)),
- cameras=[TrackingCameraCfg(eye=(1.4, 1.4, 0.9), lookat=(0.5, 0.0, 0.1))],
)
)
observations: ResetDatasetObservationsCfg = ResetDatasetObservationsCfg()
@@ -814,7 +813,6 @@ def play_mode(self) -> None:
super().play_mode()
self.scene.num_envs = 1
self.sim.visualizer_cfgs.eye = (0.9, 0.65, 0.5)
- self.sim.visualizer_cfgs.cameras[0].eye = (0.9, 0.65, 0.5)
self.curriculum_freeze = True
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/multitask_manipulation/multitask_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/multitask_manipulation/multitask_env_cfg.py
index 5cd892c82c47..cf9aa466f9ec 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/multitask_manipulation/multitask_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/multitask_manipulation/multitask_env_cfg.py
@@ -491,7 +491,7 @@ def __post_init__(self):
self.sim.visualizer_cfgs = VisualizerCfg(eye=(-3.0, 3.0, 2.5), lookat=(0.0, 0.0, 0.5))
def validate_config(self) -> None:
- """Validate the minimum batch size: one environment per task."""
+ """Validate the minimum batch size required to instantiate all task views."""
if self.scene.num_envs < 3:
raise ValueError("IsaacContrib-Multitask-Manipulation requires at least three environments, one per task.")
diff --git a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
index 6ba02a584c6c..cffef958df4c 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/contrib/ur10_particle_push/ur10_particle_push_env_cfg.py
@@ -36,7 +36,7 @@
from isaaclab.sim.spawners.materials import RigidBodyMaterialBaseCfg
from isaaclab.utils import configclass, replace
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab.visualizers import VisualizerCfg
from isaaclab_tasks.utils.presets import MultiBackendVisualizerCfg
@@ -620,7 +620,6 @@ class UR10ParticlePushEnvCfg(ManagerBasedRLEnvCfg):
eye=(1.7, 1.5, 1.0),
lookat=(0.55, 0.0, 0.0),
backend=MultiBackendVisualizerCfg(kit=KitBackendCfg(origin_type="env", origin_env_index=0)),
- cameras=[TrackingCameraCfg(eye=(1.7, 1.5, 1.0), lookat=(0.55, 0.0, 0.0))],
),
)
actions: ActionsCfg = ActionsCfg()
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py
index 87d6b6b35f6d..b015d106d733 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cabinet/cabinet_env_cfg.py
@@ -29,7 +29,7 @@
from isaaclab.sim import SimulationCfg
from isaaclab.utils import clone, configclass, replace
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab.visualizers import VisualizerCfg
from isaaclab_tasks.utils import PresetCfg, preset
@@ -119,11 +119,7 @@ class CabinetPhysicsCfg(PresetCfg):
CABINET_SIM_CFG = SimulationCfg(
dt=preset(default=1 / 600, isaacsim_physx=1 / 60, ovphysx=1 / 60, physx=1 / 60, newton_steel=1 / 60),
render_interval=1,
- visualizer_cfgs=VisualizerCfg(
- eye=(-2.0, 2.0, 2.0),
- lookat=(0.8, 0.0, 0.5),
- cameras=[TrackingCameraCfg(eye=(-1.8, 2.0, 1.6), lookat=(0.55, 0.0, 0.5), focal_length=28.0)],
- ),
+ visualizer_cfgs=VisualizerCfg(eye=(-2.0, 2.0, 2.0), lookat=(0.8, 0.0, 0.5)),
physics=CabinetPhysicsCfg(),
)
"""Shared simulation configuration for manager-based and direct cabinet tasks."""
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_camera_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_camera_env_cfg.py
index 532189c5a08c..81b5ae82b470 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_camera_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_camera_env_cfg.py
@@ -10,6 +10,7 @@
import math
from isaaclab.utils import configclass
+from isaaclab.visualizers import VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -59,8 +60,8 @@ class BaseCartpoleCameraEnvCfg(CartpoleEnvCfg):
def __post_init__(self):
super().__post_init__()
- # widen the viewport to see the camera environments; the tracking camera stays as the base declares it
- self.sim.visualizer_cfgs.eye = (20.0, 20.0, 20.0)
+ # the base sets the proprioceptive camera view; widen it to see the camera environments
+ self.sim.visualizer_cfgs = VisualizerCfg(eye=(20.0, 20.0, 20.0))
default = BaseCartpoleCameraEnvCfg()
depth = BaseCartpoleCameraEnvCfg(observation_space=[1, 96, 96])
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py
index 01e01bcfdb39..5f28fecd51e4 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_direct_env_cfg.py
@@ -15,7 +15,7 @@
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.sim import SimulationCfg
from isaaclab.utils import configclass, replace
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab.visualizers import VisualizerCfg
from isaaclab_assets.robots.cartpole import CARTPOLE_CFG
@@ -70,13 +70,4 @@ class CartpoleEnvCfg(DirectRLEnvCfg):
rew_scale_pole_vel = -0.005
def __post_init__(self):
- self.sim.visualizer_cfgs = VisualizerCfg(
- eye=(8.0, 0.0, 5.0),
- cameras=[
- TrackingCameraCfg(
- eye=(8.0, 0.0, 2.5),
- lookat=(0.0, 0.0, 2.5),
- focal_length=24.0,
- ),
- ],
- )
+ self.sim.visualizer_cfgs = VisualizerCfg(eye=(8.0, 0.0, 5.0))
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_camera_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_camera_env_cfg.py
index e52f91d5f0a9..58fb025eb12d 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_camera_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_camera_env_cfg.py
@@ -12,6 +12,7 @@
from isaaclab.managers import SceneEntityCfg
from isaaclab.utils import configclass
from isaaclab.utils.images import is_depth_like
+from isaaclab.visualizers import VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -144,9 +145,8 @@ def __post_init__(self):
self.scene.ground = None
# reset: smaller initial pole angle than the proprioceptive task
self.events.reset_pole_position.params["position_range"] = (-0.125 * math.pi, 0.125 * math.pi)
- # widen the viewport to see the camera environments; the tracking camera stays as the base declares it
- self.sim.visualizer_cfgs.eye = (20.0, 20.0, 20.0)
- self.sim.visualizer_cfgs.lookat = (0.0, 0.0, 0.0)
+ # visualizer settings
+ self.sim.visualizer_cfgs = VisualizerCfg(eye=(20.0, 20.0, 20.0), lookat=(0.0, 0.0, 0.0))
rgb = BaseCartpoleCameraEnvCfg(observations=image_observations_cfg("rgb"))
depth = BaseCartpoleCameraEnvCfg(observations=image_observations_cfg("depth"))
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py
index ed2242fbb67d..959a3ab8919a 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/cartpole/cartpole_manager_env_cfg.py
@@ -18,7 +18,7 @@
from isaaclab.managers import TerminationTermCfg as DoneTerm
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.utils import configclass, replace
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab.visualizers import VisualizerCfg
from isaaclab_assets.robots.cartpole import CARTPOLE_CFG
@@ -181,13 +181,4 @@ def __post_init__(self):
self.sim.render_interval = self.decimation
self.sim.physics = CartpolePhysicsCfg()
# visualizer settings
- self.sim.visualizer_cfgs = VisualizerCfg(
- eye=(8.0, 0.0, 5.0),
- cameras=[
- TrackingCameraCfg(
- eye=(8.0, 0.0, 2.5),
- lookat=(0.0, 0.0, 2.5),
- focal_length=24.0,
- ),
- ],
- )
+ self.sim.visualizer_cfgs = VisualizerCfg(eye=(8.0, 0.0, 5.0))
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
index e0b62e0345d6..c5294085dc75 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/fourbar_pole/fourbar_pole_manager_env_cfg.py
@@ -24,7 +24,7 @@
from isaaclab.managers import TerminationTermCfg as DoneTerm
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.utils import configclass, replace
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab.visualizers import VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -239,16 +239,8 @@ def __post_init__(self) -> None:
# general settings
self.decimation = 2
self.episode_length_s = 5
- self.sim.visualizer_cfgs = VisualizerCfg(
- eye=(12.0, 0.0, 4.0),
- cameras=[
- TrackingCameraCfg(
- eye=(4.5, 0.0, 1.8),
- lookat=(0.0, 0.0, 1.8),
- focal_length=24.0,
- ),
- ],
- )
+ # Match Newton GL / --video camera to the task viewport when --viz newton creates the visualizer.
+ self.sim.visualizer_cfgs = VisualizerCfg(eye=(12.0, 0.0, 4.0))
# simulation settings
self.sim.dt = 1 / 120
self.sim.render_interval = self.decimation
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py b/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py
index 75fc56fe7f8e..2a5aa63d41a4 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/handover/handover_common.py
@@ -13,7 +13,7 @@
from isaaclab.markers import VisualizationMarkersCfg
from isaaclab.utils import index_fill_
from isaaclab.utils.math import quat_apply
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab.visualizers import VisualizerCfg
from isaaclab_tasks.core.reorient.utils import SuccessTracker
@@ -35,12 +35,7 @@
# The camera is world-framed, so this aims at the environment nearest the grid center for the
# default 2048 environments (x = 0.75 m); other counts shift the grid.
-VISUALIZER_CFG = VisualizerCfg(
- eye=(2.35, -0.5, 1.1),
- lookat=(0.75, -0.5, 0.55),
- focal_length=35.0,
- cameras=[TrackingCameraCfg(eye=(1.15, -1.65, 1.15), lookat=(0.0, -0.5, 0.55), focal_length=35.0)],
-)
+VISUALIZER_CFG = VisualizerCfg(eye=(2.35, -0.5, 1.1), lookat=(0.75, -0.5, 0.55), focal_length=35.0)
"""Recording view facing one hand pair from the side, with both hands and the object between them."""
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py
index 26304d243957..f77fbd430c6e 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/config/franka_soft/franka_soft_env_cfg.py
@@ -40,7 +40,7 @@
from isaaclab.sim.spawners.from_files.from_files_cfg import GroundPlaneCfg
from isaaclab.utils import configclass, replace
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab.visualizers import VisualizerCfg
from isaaclab_tasks.utils import PresetCfg, preset
from isaaclab_tasks.utils.presets import MultiBackendRendererCfg
@@ -632,11 +632,7 @@ def __post_init__(self):
self.sim.render_interval = self.decimation
self.sim.physics = PhysicsCfg()
# visualizer settings
- self.sim.visualizer_cfgs = VisualizerCfg(
- eye=(0.75, 0.25, 0.65),
- lookat=(0.0, 0.75, 0.4),
- cameras=[TrackingCameraCfg(eye=(1.8, -1.8, 1.5), lookat=(0.35, 0.0, 0.35), focal_length=28.0)],
- )
+ self.sim.visualizer_cfgs = VisualizerCfg(eye=(0.75, 0.25, 0.65), lookat=(0.0, 0.75, 0.4))
def play_mode(self):
super().play_mode()
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py
index 1fd91d8cad7c..5c6e219c8f3a 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/lift/lift_env_cfg.py
@@ -34,7 +34,7 @@
from isaaclab.utils import configclass
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR
from isaaclab.utils.noise import UniformNoiseCfg as Unoise
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab.visualizers import VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -586,17 +586,7 @@ def __post_init__(self):
self.sim.render_interval = self.decimation
self.sim.physics = PhysicsCfg()
# visualizer settings
- self.sim.visualizer_cfgs = VisualizerCfg(
- eye=(-2.25, 0.0, 0.75),
- lookat=(0.0, 0.0, 0.45),
- cameras=[
- TrackingCameraCfg(
- eye=(-1.8, -1.8, 1.45),
- lookat=(-0.3, 0.0, 0.45),
- focal_length=28.0,
- ),
- ],
- )
+ self.sim.visualizer_cfgs = VisualizerCfg(eye=(-2.25, 0.0, 0.75), lookat=(0.0, 0.0, 0.45))
def play_mode(self):
super().play_mode()
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_common.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_common.py
index 58ecce6873fd..ab7c9ea3f6c4 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_common.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_common.py
@@ -13,24 +13,9 @@
from isaaclab.physics import PhysxAutoCfg
from isaaclab.terrains import TerrainImporterCfg
from isaaclab.utils import configclass
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
-VISUALIZER_CFG = VisualizerCfg(
- cameras=[
- TrackingCameraCfg(
- eye=(3.5, -1.0, 2.8),
- lookat=(0.0, 0.0, 0.0),
- focal_length=26.0,
- track_path="robot",
- follow_heading=True,
- heading_smoothing_time_constant=0.5,
- ),
- ],
-)
-"""Recording view following the Ant with smoothed heading."""
-
TERRAIN_CFG = TerrainImporterCfg(
prim_path="/World/ground",
terrain_type="plane",
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_direct_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_direct_env_cfg.py
index 990052b295f5..6528ef1497e2 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_direct_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_direct_env_cfg.py
@@ -21,7 +21,6 @@
FEET_BODY_NAMES,
JOINT_GEARS,
TERRAIN_CFG,
- VISUALIZER_CFG,
WALK_TARGET_POS,
AntPhysicsCfg,
)
@@ -52,12 +51,7 @@ class AntEnvCfg(DirectRLEnvCfg):
state_space = 0
# simulation
- sim: SimulationCfg = SimulationCfg(
- dt=1 / 120,
- render_interval=decimation,
- physics=AntPhysicsCfg(),
- visualizer_cfgs=VISUALIZER_CFG.copy(),
- )
+ sim: SimulationCfg = SimulationCfg(dt=1 / 120, render_interval=decimation, physics=AntPhysicsCfg())
# scene
scene: AntDirectSceneCfg = AntDirectSceneCfg(num_envs=4096, env_spacing=5.0)
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_manager_env_cfg.py
index 4a5d85704e96..39ff41505502 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/ant/ant_manager_env_cfg.py
@@ -25,7 +25,6 @@
FEET_BODY_NAMES,
JOINT_GEARS,
TERRAIN_CFG,
- VISUALIZER_CFG,
WALK_TARGET_POS,
AntPhysicsCfg,
)
@@ -187,7 +186,6 @@ def __post_init__(self):
self.sim.dt = 1 / 120
self.sim.render_interval = self.decimation
self.sim.physics = AntPhysicsCfg()
- self.sim.visualizer_cfgs = VISUALIZER_CFG.copy()
self.sim.physics_material.static_friction = 1.0
self.sim.physics_material.dynamic_friction = 1.0
self.sim.physics_material.restitution = 0.0
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_common.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_common.py
index 6f68d872c3e0..4707de4cb149 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_common.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_common.py
@@ -13,24 +13,9 @@
from isaaclab.physics import PhysxAutoCfg
from isaaclab.terrains import TerrainImporterCfg
from isaaclab.utils import configclass
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
-VISUALIZER_CFG = VisualizerCfg(
- cameras=[
- TrackingCameraCfg(
- eye=(2.5, -3.5, 0.9),
- lookat=(0.0, 0.0, -0.5),
- focal_length=26.0,
- track_path="robot",
- follow_heading=True,
- heading_smoothing_time_constant=0.5,
- ),
- ],
-)
-"""Recording view following the Humanoid with smoothed heading."""
-
TERRAIN_CFG = TerrainImporterCfg(
prim_path="/World/ground",
terrain_type="plane",
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_direct_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_direct_env_cfg.py
index 58d256d01127..a790078d7302 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_direct_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_direct_env_cfg.py
@@ -17,14 +17,7 @@
from isaaclab_assets.robots.humanoid import HUMANOID_CFG
-from .humanoid_common import (
- FEET_BODY_NAMES,
- JOINT_GEARS,
- TERRAIN_CFG,
- VISUALIZER_CFG,
- WALK_TARGET_POS,
- HumanoidPhysicsCfg,
-)
+from .humanoid_common import FEET_BODY_NAMES, JOINT_GEARS, TERRAIN_CFG, WALK_TARGET_POS, HumanoidPhysicsCfg
@configclass
@@ -52,12 +45,7 @@ class HumanoidEnvCfg(DirectRLEnvCfg):
state_space = 0
# simulation
- sim: SimulationCfg = SimulationCfg(
- dt=1 / 120,
- render_interval=decimation,
- physics=HumanoidPhysicsCfg(),
- visualizer_cfgs=VISUALIZER_CFG.copy(),
- )
+ sim: SimulationCfg = SimulationCfg(dt=1 / 120, render_interval=decimation, physics=HumanoidPhysicsCfg())
# scene
scene: HumanoidDirectSceneCfg = HumanoidDirectSceneCfg(num_envs=4096, env_spacing=5.0)
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_manager_env_cfg.py
index ec15bc82c12a..e3656ac32dd5 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/locomotion/humanoid/humanoid_manager_env_cfg.py
@@ -26,7 +26,6 @@
FEET_BODY_NAMES,
JOINT_EFFORT_LIMITS,
JOINT_GEARS,
- VISUALIZER_CFG,
WALK_TARGET_POS,
HumanoidPhysicsCfg,
)
@@ -198,7 +197,6 @@ def __post_init__(self):
self.sim.dt = 1 / 120
self.sim.render_interval = self.decimation
self.sim.physics = HumanoidPhysicsCfg()
- self.sim.visualizer_cfgs = VISUALIZER_CFG.copy()
self.sim.physics_material.static_friction = 1.0
self.sim.physics_material.dynamic_friction = 1.0
self.sim.physics_material.restitution = 0.0
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py
index dcee034e78c3..b61c2bb022e5 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/pendulum/pendulum_marl_env_cfg.py
@@ -18,7 +18,6 @@
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.sim import SimulationCfg
from isaaclab.utils import configclass, replace
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -77,20 +76,7 @@ class PendulumMARLEnvCfg(DirectMARLEnvCfg):
state_space = -1
# simulation
- sim: SimulationCfg = SimulationCfg(
- dt=1 / 120,
- render_interval=decimation,
- physics=PendulumPhysicsCfg(),
- visualizer_cfgs=VisualizerCfg(
- cameras=[
- TrackingCameraCfg(
- eye=(8.0, 0.0, 2.3),
- lookat=(0.0, 0.0, 2.3),
- focal_length=24.0,
- ),
- ],
- ),
- )
+ sim: SimulationCfg = SimulationCfg(dt=1 / 120, render_interval=decimation, physics=PendulumPhysicsCfg())
cart_dof_name = "slider_to_cart"
pole_dof_name = "cart_to_pole"
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reach/config/ur_10/joint_pos_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reach/config/ur_10/joint_pos_env_cfg.py
index 821a994e3abd..5a28372278b8 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reach/config/ur_10/joint_pos_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reach/config/ur_10/joint_pos_env_cfg.py
@@ -25,8 +25,6 @@ class UR10ReachEnvCfg(ReachEnvCfg):
def __post_init__(self):
super().__post_init__()
- self.sim.visualizer_cfgs.cameras[0].eye = (2.2, -2.2, 1.6)
- self.sim.visualizer_cfgs.cameras[0].lookat = (0.3, 0.0, 0.45)
# switch robot to ur10
self.scene.robot = replace(UR10_CFG, prim_path="{ENV_REGEX_NS}/Robot")
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py
index 0fa3220e1c87..8439aabd9f35 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reach/reach_env_cfg.py
@@ -27,7 +27,7 @@
from isaaclab.scene import InteractiveSceneCfg
from isaaclab.utils import configclass
from isaaclab.utils.noise import UniformNoiseCfg as Unoise
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab.visualizers import VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -259,13 +259,4 @@ def __post_init__(self):
self.sim.render_interval = self.decimation
self.sim.physics = ReachPhysicsCfg()
# visualizer settings
- self.sim.visualizer_cfgs = VisualizerCfg(
- eye=(3.5, 3.5, 3.5),
- cameras=[
- TrackingCameraCfg(
- eye=(1.8, -1.8, 1.5),
- lookat=(0.3, 0.0, 0.4),
- focal_length=28.0,
- ),
- ],
- )
+ self.sim.visualizer_cfgs = VisualizerCfg(eye=(3.5, 3.5, 3.5))
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/allegro_hand/allegro_hand_direct_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/allegro_hand/allegro_hand_direct_env_cfg.py
index 73119ddcf4ff..5a41dc14a01f 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/allegro_hand/allegro_hand_direct_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/allegro_hand/allegro_hand_direct_env_cfg.py
@@ -102,4 +102,3 @@ def play_mode(self) -> None:
viewer.eye = VISUALIZER_CFG.eye
viewer.lookat = VISUALIZER_CFG.lookat
viewer.focal_length = VISUALIZER_CFG.focal_length
- viewer.cameras = [camera.replace() for camera in VISUALIZER_CFG.cameras]
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_camera_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_camera_manager_env_cfg.py
index 34c612297a5b..a9d1f1c1fe4f 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_camera_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_camera_manager_env_cfg.py
@@ -131,7 +131,6 @@ def play_mode(self):
viewer.eye = CAMERA_VISUALIZER_CFG.eye
viewer.lookat = CAMERA_VISUALIZER_CFG.lookat
viewer.focal_length = CAMERA_VISUALIZER_CFG.focal_length
- viewer.cameras = [camera.replace() for camera in CAMERA_VISUALIZER_CFG.cameras]
# mutate rather than replace: subclasses may have disabled the CNN
self.feature_extractor.train = False
self.feature_extractor.load_checkpoint = True
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_camera_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_camera_env_cfg.py
index a1d080ae0131..5fb3962efe8f 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_camera_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_camera_env_cfg.py
@@ -203,7 +203,6 @@ def play_mode(self):
viewer.eye = CAMERA_VISUALIZER_CFG.eye
viewer.lookat = CAMERA_VISUALIZER_CFG.lookat
viewer.focal_length = CAMERA_VISUALIZER_CFG.focal_length
- viewer.cameras = [camera.replace() for camera in CAMERA_VISUALIZER_CFG.cameras]
# inference for CNN
self.feature_extractor.train = False
self.feature_extractor.load_checkpoint = True
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_env_cfg.py
index 207579fd7fa2..9d95e79fbde4 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/config/shadow_hand/shadow_hand_direct_env_cfg.py
@@ -104,4 +104,3 @@ def play_mode(self) -> None:
viewer.eye = VISUALIZER_CFG.eye
viewer.lookat = VISUALIZER_CFG.lookat
viewer.focal_length = VISUALIZER_CFG.focal_length
- viewer.cameras = [camera.replace() for camera in VISUALIZER_CFG.cameras]
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/reorient_manager_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/reorient_manager_env_cfg.py
index ce88521ff421..e95d7a261f83 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/reorient_manager_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/reorient_manager_env_cfg.py
@@ -241,4 +241,3 @@ def play_mode(self) -> None:
viewer.eye = VISUALIZER_CFG.eye
viewer.lookat = VISUALIZER_CFG.lookat
viewer.focal_length = VISUALIZER_CFG.focal_length
- viewer.cameras = [camera.replace() for camera in VISUALIZER_CFG.cameras]
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py
index 92b11eb96a24..6d6c12b2ff18 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/reorient/utils.py
@@ -19,7 +19,7 @@
import isaaclab.utils.math as math_utils
from isaaclab.utils import index_fill_
from isaaclab.utils.math import quat_from_angle_axis, quat_mul
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
+from isaaclab.visualizers import VisualizerCfg
if TYPE_CHECKING:
from isaaclab.assets import Articulation
@@ -28,20 +28,10 @@
GOAL_MARKER_OFFSET = (-0.08, -0.09, 0.06)
"""Goal-cube display offset from the in-hand position [m], beside the hand in the recording view."""
-VISUALIZER_CFG = VisualizerCfg(
- eye=(0.995, -0.80, 0.85),
- lookat=(0.375, -0.28, 0.53),
- focal_length=35.0,
- cameras=[TrackingCameraCfg(eye=(0.62, -0.80, 0.85), lookat=(0.0, -0.28, 0.53), focal_length=35.0)],
-)
+VISUALIZER_CFG = VisualizerCfg(eye=(0.995, -0.80, 0.85), lookat=(0.375, -0.28, 0.53), focal_length=35.0)
"""Recording view of an environment in the 50-environment play grid."""
-CAMERA_VISUALIZER_CFG = VisualizerCfg(
- eye=(1.62, -1.80, 0.85),
- lookat=(1.0, -1.28, 0.53),
- focal_length=35.0,
- cameras=[TrackingCameraCfg(eye=(0.62, -0.80, 0.85), lookat=(0.0, -0.28, 0.53), focal_length=35.0)],
-)
+CAMERA_VISUALIZER_CFG = VisualizerCfg(eye=(1.62, -1.80, 0.85), lookat=(1.0, -1.28, 0.53), focal_length=35.0)
"""Recording view of an environment in the camera tasks' 64-environment play grid."""
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py
index 581f4bfcea77..d04c2c15c7f0 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/anymal_d/rough_env_cfg.py
@@ -18,7 +18,6 @@ class AnymalDRoughEnvCfg(LocomotionVelocityRoughEnvCfg):
def __post_init__(self):
super().__post_init__()
- self.sim.visualizer_cfgs.cameras[0].eye = (2.0, -3.0, 1.4)
self.sim.physics.newton_steel.solver_cfg.iterations = 16
# scene
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/rough_env_cfg.py
index 356aaa0ff2ef..1c4b565934bb 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/rough_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/cassie/rough_env_cfg.py
@@ -67,7 +67,6 @@ class CassieRoughEnvCfg(LocomotionVelocityRoughEnvCfg):
def __post_init__(self):
super().__post_init__()
- self.sim.visualizer_cfgs.cameras[0].lookat = (0.15, 0.0, -0.25)
# scene
self.scene.robot = replace(CASSIE_CFG, prim_path="{ENV_REGEX_NS}/Robot")
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/go2/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/go2/rough_env_cfg.py
index 41ef67f8b79d..ee2b37439d81 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/go2/rough_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/go2/rough_env_cfg.py
@@ -43,7 +43,6 @@ class UnitreeGo2RoughEnvCfg(LocomotionVelocityRoughEnvCfg):
def __post_init__(self):
super().__post_init__()
- self.sim.visualizer_cfgs.cameras[0].eye = (1.5, -2.5, 1.1)
# simulation
# execute the DC motor actuators through the backend-native path
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/h1/rough_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/h1/rough_env_cfg.py
index 3d562536643c..304f0fc6f57a 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/h1/rough_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/config/h1/rough_env_cfg.py
@@ -77,7 +77,6 @@ class H1RoughEnvCfg(LocomotionVelocityRoughEnvCfg):
def __post_init__(self):
super().__post_init__()
- self.sim.visualizer_cfgs.cameras[0].eye = (2.5, -3.5, 1.3)
# scene
self.scene.robot = replace(H1_MINIMAL_CFG, prim_path="{ENV_REGEX_NS}/Robot")
diff --git a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py
index d3a32079b908..f52448d0e1fa 100644
--- a/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py
+++ b/source/isaaclab_tasks/isaaclab_tasks/core/velocity/velocity_env_cfg.py
@@ -38,7 +38,6 @@
from isaaclab.utils import configclass
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, ISAACLAB_NUCLEUS_DIR
from isaaclab.utils.noise import UniformNoiseCfg as Unoise
-from isaaclab.visualizers import TrackingCameraCfg, VisualizerCfg
from isaaclab_tasks.utils import PresetCfg
@@ -371,18 +370,6 @@ def __post_init__(self):
# simulation settings
self.sim.dt = 0.005
self.sim.render_interval = self.decimation
- self.sim.visualizer_cfgs = VisualizerCfg(
- cameras=[
- TrackingCameraCfg(
- eye=(1.8, -3.0, 1.1),
- lookat=(0.15, 0.0, 0.0),
- focal_length=26.0,
- track_path="robot",
- follow_heading=True,
- heading_smoothing_time_constant=0.2,
- ),
- ],
- )
self.sim.physics_material = self.scene.terrain.physics_material
# update sensor update periods
# we tick all the sensors based on the smallest update period (physics update period)
diff --git a/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst b/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst
index 16ac8cdbfecc..c7d87d1544c3 100644
--- a/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst
+++ b/source/isaaclab_visualizers/changelog.d/newton-gl-camera-sources.added.rst
@@ -1,4 +1,4 @@
-* The Newton GL Camera Source list now reads Perspective, Tracking Camera, then the scene cameras by their own names
+* The Newton GL Camera Source list now reads Perspective, then the scene cameras by their own names
(for example "Camera (RGB sensor)"). A scene camera with one image per environment tiles up to ``streaming_envs``
random environments (32 by default); "Tiled Envs" sets how many are shown, and "Environment" picks the one shown when
it is 1.
diff --git a/source/isaaclab_visualizers/changelog.d/newton-gl-rtx-renderer-toggle.added.rst b/source/isaaclab_visualizers/changelog.d/newton-gl-rtx-renderer-toggle.added.rst
index f88bbb9344a4..cc9381e4d784 100644
--- a/source/isaaclab_visualizers/changelog.d/newton-gl-rtx-renderer-toggle.added.rst
+++ b/source/isaaclab_visualizers/changelog.d/newton-gl-rtx-renderer-toggle.added.rst
@@ -6,5 +6,4 @@
* Added Visible Envs support to the OVRTX view of the Newton GL window.
* The OVRTX view keeps updating while the simulation is paused, so the drag arrow and camera moves show in it, and the
drag arrow appears without a visual overlay being enabled.
-* "Reset to Task Default" works for a Tracking Camera while RTX is selected, and the window remembers the free
- Perspective camera's pose and focal length while another camera source is shown.
+* The window remembers the free Perspective camera's pose and focal length while another camera source is shown.
diff --git a/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.added.rst b/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.added.rst
deleted file mode 100644
index fa5cbeac6b0c..000000000000
--- a/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.added.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-* Added tracking camera support to the Newton GL visualizer. **Camera Source** lists it as "Tracking Camera" beside the
- free "Perspective" view, and a Tracking Camera group edits its environment, asset, body, eye, look-at, focal length
- and heading settings, with a reset to the task's declaration.
diff --git a/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.minor b/source/isaaclab_visualizers/changelog.d/tracking-camera-tracking.minor
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
index 6212ccb967bc..66f6ba546f00 100644
--- a/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
+++ b/source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer.py
@@ -15,7 +15,6 @@
import sys
import time
from collections.abc import Callable
-from functools import partial
from pathlib import Path
from typing import Any
@@ -52,8 +51,7 @@
from isaaclab.utils.math import quat_apply, quat_from_matrix, quat_mul
from isaaclab.visualizers.base_visualizer import _VISUALIZER_MAX_TILES as MAX_TILED_ENVS
from isaaclab.visualizers.base_visualizer import BaseVisualizer
-from isaaclab.visualizers.camera_follower import CameraFollower
-from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg, TrackingCameraCfg, WindowCfg
+from isaaclab.visualizers.visualizer_cfg import PerspectiveCameraCfg, WindowCfg
from isaaclab_visualizers.desktop_entry import write_desktop_entry
from isaaclab_visualizers.newton.newton_overlay_meshes import OverlayMeshPublisher
@@ -773,19 +771,11 @@ def __init__(self, cfg):
self._runtime_headless = cfg.headless
self._last_present_time = -math.inf
self._last_render_step = -1
- self._borrowing_view = False
self._pending_mesh_submissions: dict[str, dict[str, Any]] = {}
self._camera_keys_enabled = True
self._overlay_publisher = None
self._pose_started = False
self._marker_revision = -1
- self._followers: dict[object, CameraFollower] = {}
- """Followers of the tracking cameras, by image view."""
- self._rtx_pose_view = None
- """Tracking Camera view that moves the OVRTX camera, or None when the free camera drives it."""
- self._tracking_defaults: dict[object, dict] = {}
- """What the task declared for each tracking camera, for Reset to Task Default."""
- self._tracking_error = ""
self._perspective_poses: dict[object, tuple] = {}
"""Last pose and focal length of each free Perspective view, kept while another source is shown."""
self._sensor_tiles: dict[object, int] = {}
@@ -798,28 +788,6 @@ def __init__(self, cfg):
def initialize(self, sim: SimulationContext, *, cameras: list[PerspectiveCameraCfg | Camera]) -> None:
"""Bind camera sources and the display mode shared by both windows."""
super().initialize(sim, cameras=cameras)
- # each perspective view renders itself, so a recorder can capture one the window does not show
- scene = self._sim.get_scene_data_provider().get_interactive_scene()
- for view in self._image_views:
- if view.camera is not None:
- continue
- if view.render is not None:
- raise ValueError("A perspective image view must have exactly one rendering owner.")
- view.render = partial(self._capture_view, view)
- source = view.cfg.source
- if self._is_tracking_view(view):
- if scene is None:
- raise ValueError("A tracking camera needs an interactive scene to follow.")
- # fail at initialization, not on a frame: a bad env_index or track_path raises here
- self._followers[view] = follower = CameraFollower(source, scene, self._env_ids)
- self._remember_tracking_defaults(view, follower)
- if self._env_ids is not None and follower.env not in self._env_ids:
- logger.warning(
- "[NewtonVisualizer] A tracking camera frames environment %d, which is not among the visible "
- "environments %s, so it will show an empty scene.",
- follower.env,
- list(self._env_ids),
- )
self._runtime_headless = self.cfg.headless or (
sys.platform not in ("win32", "darwin") and not os.environ.get("DISPLAY")
)
@@ -894,11 +862,6 @@ def log_mesh(
roughness=roughness, metallic=metallic, dynamic=dynamic, opacity=opacity,
) # fmt: skip
- @staticmethod
- def _is_tracking_view(view) -> bool:
- """Whether *view* is a tracking camera."""
- return isinstance(view.cfg.source, TrackingCameraCfg)
-
def _draw_streaming_view_controls(self, imgui) -> None:
"""Choose one declared display source without reading the other sensors."""
if self._borrowing_view: # an off-screen capture swapped the view; the window controls must not act on it
@@ -917,7 +880,7 @@ def _draw_streaming_view_controls(self, imgui) -> None:
imgui.set_tooltip(
"Fast rasterizer with visual overlays and markers"
if not sensor
- else "A scene sensor is rendered by its own renderer. This applies to the free and tracking cameras"
+ else "A scene sensor is rendered by its own renderer. This applies to the free camera"
)
imgui.same_line()
if imgui.radio_button("RTX", rtx_on) and not rtx_on:
@@ -926,7 +889,7 @@ def _draw_streaming_view_controls(self, imgui) -> None:
imgui.set_tooltip(
"OVRTX path-traced rendering of the scene; slower than OpenGL. The first switch can take a minute"
if not sensor
- else "A scene sensor is rendered by its own renderer. This applies to the free and tracking cameras"
+ else "A scene sensor is rendered by its own renderer. This applies to the free camera"
)
if sensor:
imgui.end_disabled()
@@ -939,27 +902,15 @@ def _draw_streaming_view_controls(self, imgui) -> None:
)
labels = self._view_labels(indices)
current = self._image_views.index(self.current_image_view)
- if current == rtx_index: # RTX renders the free perspective source or follows a Tracking Camera.
- pose_view = self._rtx_pose_view
- current = (
- self._image_views.index(pose_view)
- if pose_view is not None
- else next(
- i
- for i in indices
- if self._image_views[i].camera is None and not self._is_tracking_view(self._image_views[i])
- )
- )
+ if current == rtx_index: # RTX renders the free perspective source.
+ current = next(i for i in indices if self._image_views[i].camera is None)
position = indices.index(current)
changed, chosen = imgui.combo("Camera Source", position, labels)
if changed:
self._choose_camera_source(indices[chosen])
if imgui.is_item_hovered():
imgui.set_tooltip(labels[position])
- follower = self._followers.get(self._pose_source_view())
- if follower is not None:
- self._draw_tracking_camera_controls(imgui, follower)
- elif self.sensor_view_selected:
+ if self.sensor_view_selected:
self._draw_sensor_controls(imgui, self.current_image_view)
self._draw_camera_info(imgui)
@@ -1145,10 +1096,8 @@ def _draw_sky_texture(self, imgui, appearance: RtxAppearance) -> bool:
return edited
def _source_rank(self, view) -> int:
- """Order the Camera Source list: the free Perspective, then Tracking Cameras, then scene sensors."""
- if view.camera is not None:
- return 2
- return 1 if self._is_tracking_view(view) else 0
+ """Order the Camera Source list: the free Perspective, then scene sensors."""
+ return 0 if view.camera is None else 1
def _draw_sensor_controls(self, imgui, view) -> None:
"""Choose which channel of a sensor is shown, and which environment, or tile several environments."""
@@ -1228,14 +1177,13 @@ def _invalidate_sensor_view(self, view) -> None:
self._last_render_step = -1
def _draw_focal_length(self, imgui) -> None:
- """Draw the focal length of the free camera or the Tracking Camera; sensors have fixed intrinsics."""
- view = self._pose_source_view()
+ """Draw the focal length of the free camera; sensors have fixed intrinsics."""
+ view = self.current_image_view
rtx_index = getattr(self, "rtx_view_index", None)
rtx_view = self._image_views[rtx_index] if rtx_index is not None else None
if view.camera is not None and view is not rtx_view:
return
- task = self._is_tracking_view(view)
- source = view.cfg.source if task else self.cfg
+ source = self.cfg
changed, focal = imgui.slider_float("Focal Length", float(source.focal_length), 5.0, 64.0, "%.0f mm")
hover_tooltip(imgui, "Lens focal length of the camera; smaller values see a wider area")
if changed:
@@ -1244,97 +1192,14 @@ def _draw_focal_length(self, imgui) -> None:
view.invalidate()
self._last_render_step = -1
- def _draw_tracking_camera_controls(self, imgui, follower: CameraFollower) -> None:
- """Edit the selected Tracking Camera: what it follows, where it sits, and where it looks."""
- cfg = follower.cfg
- edited = False
-
- def tip(text: str) -> None:
- hover_tooltip(imgui, text)
-
- imgui.separator_text("Tracking Camera")
- changed, env = imgui.input_int("Environment", follower.env)
- tip("Environment the camera follows")
- if changed and 0 <= env < self._sim.get_scene_data_provider().num_envs:
- follower.set_env(env)
- edited = True
- asset_name, _, body_name = (cfg.track_path or "").partition("/")
- assets = ["None (fixed in environment)", *follower.asset_names()]
- changed, index = imgui.combo("Asset", assets.index(asset_name) if asset_name in assets else 0, assets)
- tip("Scene asset the camera follows. None keeps it fixed relative to the environment")
- if changed:
- edited |= self._set_tracking_path(follower, assets[index] if index else None)
- if asset_name:
- bodies = ["Root", *follower.body_names(asset_name)]
- changed, index = imgui.combo("Body", bodies.index(body_name) if body_name in bodies else 0, bodies)
- tip("Body of the asset the camera follows. Root follows the asset itself")
- if changed:
- edited |= self._set_tracking_path(follower, f"{asset_name}/{bodies[index]}" if index else asset_name)
- changed, eye = imgui.input_float3("Eye (m)", list(cfg.eye))
- tip("Camera position, as an offset from the followed asset or the environment origin")
- if changed:
- cfg.eye, edited = tuple(float(v) for v in eye), True
- changed, lookat = imgui.input_float3("Look At (m)", list(cfg.lookat))
- tip("Point the camera looks at, as an offset from the followed asset or the environment origin")
- if changed:
- cfg.lookat, edited = tuple(float(v) for v in lookat), True
- if asset_name:
- changed, cfg.follow_heading = imgui.checkbox("Follow Heading", cfg.follow_heading)
- tip("Turn with the asset's heading, so the camera stays behind it and level")
- edited |= changed
- if cfg.follow_heading:
- changed, smoothing = imgui.slider_float(
- "Smoothing", cfg.heading_smoothing_time_constant, 0.0, 2.0, "%.2f s"
- )
- tip("Heading filter time constant; larger values damp turns more but lag")
- if changed:
- cfg.heading_smoothing_time_constant, edited = smoothing, True
- if imgui.button("Reset to Task Default"):
- edited |= self._reset_tracking_camera(follower)
- tip("Restore what the task declared for this camera")
- if self._tracking_error:
- imgui.push_style_color(imgui.Col_.text, imgui.ImVec4(1.0, 0.35, 0.35, 1.0))
- imgui.text_wrapped(self._tracking_error)
- imgui.pop_style_color()
- if edited:
- self.current_image_view.invalidate()
- self._last_render_step = -1
-
- def _set_tracking_path(self, follower: CameraFollower, track_path: str | None) -> bool:
- """Follow ``track_path``, reporting an unknown asset or ambiguous body instead of raising."""
- try:
- follower.set_track_path(track_path)
- except ValueError as exc:
- self._tracking_error = str(exc)
- return False
- self._tracking_error = ""
- return True
-
- def _reset_tracking_camera(self, follower: CameraFollower) -> bool:
- """Restore the camera's declared pose, optics, and target; returns whether anything changed."""
- defaults = self._tracking_defaults.get(self._pose_source_view()) # In RTX the Tracking view is not current.
- if defaults is None:
- return False
- cfg = follower.cfg
- cfg.eye, cfg.lookat, cfg.focal_length = defaults["eye"], defaults["lookat"], defaults["focal_length"]
- cfg.follow_heading = defaults["follow_heading"]
- cfg.heading_smoothing_time_constant = defaults["heading_smoothing_time_constant"]
- follower.set_env(defaults["env"])
- return self._set_tracking_path(follower, defaults["track_path"]) or True
-
def _view_labels(self, indices: list[int] | None = None) -> list[str]:
- """Name the listed image views: a task view is the Tracking Camera, a free view is the Perspective."""
+ """Name the listed image views: a free view is the Perspective."""
views = self._image_views if indices is None else [self._image_views[i] for i in indices]
- free = [v for v in views if v.camera is None and not self._is_tracking_view(v)]
- tracking = [v for v in views if self._is_tracking_view(v)]
+ free = [v for v in views if v.camera is None]
labels = []
for view in views:
if view.camera is not None:
labels.append(self._sensor_label(view.cfg.source, view.camera.cfg.data_types))
- elif self._is_tracking_view(view):
- labels.append(
- "Tracking Camera" if len(tracking) == 1 else f"Tracking Camera {tracking.index(view) + 1}"
- )
else:
labels.append("Perspective" if len(free) == 1 else f"Perspective {free.index(view) + 1}")
return labels
@@ -1367,33 +1232,23 @@ def _sensor_label(prim_path: str, data_types=()) -> str:
kind = " + ".join(outputs[:3]) + " " if outputs else ""
return f"{prim_path.rstrip('/').rsplit('/', 1)[-1]} ({kind}sensor)"
- def _pose_source_view(self):
- """Return the view whose camera settings are shown: the one driving the OVRTX camera, or the current view."""
- if getattr(self, "rtx_rendering", False) and self._rtx_pose_view is not None:
- return self._rtx_pose_view
- return self.current_image_view
-
def _choose_camera_source(self, index: int) -> None:
- """Switch the camera source; a free or Tracking Camera source keeps the OVRTX renderer when it is on."""
+ """Switch the camera source; a free source keeps the OVRTX renderer when it is on."""
view = self._image_views[index]
if self.rtx_rendering and view.camera is None:
self._remember_perspective_pose()
- self._rtx_pose_view = view if self._is_tracking_view(view) else None
- if self._rtx_pose_view is not None:
- self._apply_view_pose(view)
- else:
- self._restore_perspective_pose(view)
+ self._restore_perspective_pose(view)
self.current_image_view.invalidate()
return
self._select_camera(index)
def _free_view_in_use(self):
"""Return the free Perspective view whose pose the viewer camera holds, or None when another source has it."""
- view = self._pose_source_view()
+ view = self.current_image_view
if view is not None and view.camera is not None and getattr(self, "rtx_rendering", False):
- # The OVRTX camera follows the free view when no Tracking Camera drives it.
- view = next((v for v in self._image_views if v.camera is None and not self._is_tracking_view(v)), None)
- if view is None or view.camera is not None or self._is_tracking_view(view):
+ # The OVRTX camera follows the free view.
+ view = next((v for v in self._image_views if v.camera is None), None)
+ if view is None or view.camera is not None:
return None
return view
@@ -1421,42 +1276,6 @@ def _restore_perspective_pose(self, view) -> bool:
self._viewer.camera.fov = self._focal_length_to_vertical_fov_degrees(focal)
return True
- def _remember_tracking_defaults(self, view, follower: CameraFollower) -> None:
- """Keep what the task declared for a tracking *view*, which its reset control restores."""
- source = view.cfg.source
- self._tracking_defaults[view] = {
- "eye": source.eye,
- "lookat": source.lookat,
- "focal_length": source.focal_length,
- "track_path": source.track_path,
- "follow_heading": source.follow_heading,
- "heading_smoothing_time_constant": source.heading_smoothing_time_constant,
- "env": follower.env,
- }
-
- def _apply_view_pose(self, view) -> bool:
- """Point the viewer camera where a tracking camera looks, leaving the configured poses untouched.
-
- Returns:
- Whether the view had a pose yet; a view that follows an asset has none until the asset is ready.
- """
- follower = self._followers.get(view)
- pose = follower and follower.pose(self._sim.get_physics_step_count() * self._sim.get_physics_dt())
- if pose is None or follower is None:
- return False
- eye, target = pose
- offsets = self._viewer.world_offsets
- if offsets is not None: # the viewer draws each environment at its world offset
- shift = wp.to_torch(offsets)[follower.env].tolist()
- eye = tuple(a + b for a, b in zip(eye, shift))
- target = tuple(a + b for a, b in zip(target, shift))
- camera = self._viewer.camera
- camera.pos = PygletVec3(*eye)
- camera.look_at(target)
- self._viewer.set_camera(camera.pos, camera.pitch, camera.yaw)
- camera.fov = self._focal_length_to_vertical_fov_degrees(view.cfg.source.focal_length)
- return True
-
def _release_rtx_scene(self) -> None:
"""Give the scene cameras that share the OVRTX renderer back the overlays and lights the viewer added."""
if self._overlay_publisher is not None:
@@ -1479,14 +1298,10 @@ def _select_camera(self, index: int, *, keep_pose: bool = False) -> None:
self.current_image_view = self._image_views[index]
if leaving_rtx:
self._apply_rtx_visible_envs() # restore every environment to the sensors that share the renderer
- if index != getattr(self, "rtx_view_index", None):
- self._rtx_pose_view = None
camera = self.current_image_view.cfg.source
self.current_image_view.invalidate()
if isinstance(camera, PerspectiveCameraCfg):
- if isinstance(camera, TrackingCameraCfg):
- self._apply_view_pose(self.current_image_view)
- elif not keep_pose and not self._restore_perspective_pose(self.current_image_view):
+ if not keep_pose and not self._restore_perspective_pose(self.current_image_view):
self.set_camera_view(camera.eye, camera.lookat)
self.cfg.focal_length = camera.focal_length
self._viewer.camera.fov = self._focal_length_to_vertical_fov_degrees()
@@ -1545,22 +1360,18 @@ def _navigate_scene_camera(self) -> None:
def _capture_view(self, view, output: wp.array | None) -> wp.array:
"""Capture a perspective *view*, borrowing the viewer camera when the window shows another one."""
current = self.current_image_view
- # the RTX view that follows this tracking camera already shows it, so it is recorded as displayed
- if view is current or (self.rtx_rendering and view is self._rtx_pose_view):
+ if view is current:
return self._capture_frame(output)
camera = self._viewer.camera
saved = (PygletVec3(camera.pos.x, camera.pos.y, camera.pos.z), camera.pitch, camera.yaw, camera.fov)
try:
self._borrowing_view = True
self.current_image_view = view
- if self._is_tracking_view(view): # rendering may be paused, which leaves the camera where it was
- self._apply_view_pose(view)
- else: # a free view renders from its declared pose and optics
- source = view.cfg.source
- camera.pos = PygletVec3(*source.eye)
- camera.look_at(source.lookat)
- self._viewer.set_camera(camera.pos, camera.pitch, camera.yaw)
- camera.fov = self._focal_length_to_vertical_fov_degrees(source.focal_length)
+ source = view.cfg.source # a free view renders from its declared pose and optics
+ camera.pos = PygletVec3(*source.eye)
+ camera.look_at(source.lookat)
+ self._viewer.set_camera(camera.pos, camera.pitch, camera.yaw)
+ camera.fov = self._focal_length_to_vertical_fov_degrees(source.focal_length)
self._last_render_step = -1
return self._capture_frame(output)
finally:
@@ -1609,14 +1420,10 @@ def reset(self, soft: bool = False) -> None:
"""Invalidate the displayed frame after a simulation reset."""
super().reset(soft)
self._last_render_step = -1
- for follower in self._followers.values():
- follower.reset() # the heading filter must not carry the previous episode over
def close(self) -> None:
"""Detach perspective producers before releasing the visualizer's borrowed views."""
self._pending_mesh_submissions.clear()
- self._followers.clear()
- self._tracking_defaults.clear()
self._perspective_poses.clear()
self._sensor_tiles.clear()
if self._rtx_appearance is not None:
@@ -1625,8 +1432,7 @@ def close(self) -> None:
self._rtx_appearance.close()
self._rtx_appearance = None
for view in self._image_views:
- owned = isinstance(view.render, partial) and view.render.func == self._capture_view
- if owned:
+ if view.render == self._capture_frame:
view.render = None
view.invalidate()
super().close()
@@ -1705,25 +1511,6 @@ def render_rgb_array(self) -> np.ndarray:
)
return self.current_image_view.read_rgb(frame_id)
- @property
- def has_tracking_view(self) -> bool:
- """Whether a tracking camera is declared."""
- return any(self._is_tracking_view(view) for view in self._image_views)
-
- def render_tracking_rgb_array(self) -> np.ndarray:
- """Download the first tracking camera view, whatever the window shows."""
- view = next((v for v in self._image_views if self._is_tracking_view(v)), None)
- if view is None:
- raise RuntimeError("The visualizer declares no tracking camera. Add a TrackingCameraCfg to its cameras.")
- frame = view.frame
- # while rendering is paused the tracking view keeps its last frame, instead of picking up the window's view
- frame_id = (
- frame.timestamp
- if self._viewer is not None and self._viewer.is_paused() and frame.data is not None
- else self._sim.get_physics_step_count()
- )
- return view.read_rgb(frame_id)
-
class NewtonGLVisualizer(NewtonVisualizerBase):
"""Newton model rendering, picking, and contact overlays used by the GL visualizer."""
@@ -1890,10 +1677,6 @@ def _render_frame(self) -> None:
viewer.begin_frame(self._sim_time)
try:
viewer.image_matches_camera = self.rtx_rendering
- pose_view = self._pose_source_view()
- # a paused scene is frozen, and so is its camera
- if self._is_tracking_view(pose_view) and not viewer.is_paused():
- self._apply_view_pose(pose_view)
if self.current_image_view.camera is not None:
self._navigate_scene_camera()
self._refresh_rtx_markers()
@@ -1916,7 +1699,7 @@ def _render_frame(self) -> None:
for name, arguments in self._pending_mesh_submissions.items():
viewer.log_mesh(name, **arguments)
self._pending_mesh_submissions.clear()
- if not viewer.is_paused() and not self._borrowing_view: # a capture must not add plot samples
+ if not viewer.is_paused():
self._render_live_plots()
finally:
viewer.end_frame()
@@ -2064,20 +1847,14 @@ def set_rtx_rendering(self, enabled: bool) -> None:
rtx_index = self.rtx_view_index
if rtx_index is None:
raise RuntimeError("The scene has no OVRTX viewer camera; see NewtonGLBackendCfg.rtx_camera.")
- free = [
- i for i, view in enumerate(self._image_views) if view.camera is None and not self._is_tracking_view(view)
- ]
+ free = [i for i, view in enumerate(self._image_views) if view.camera is None]
if enabled:
- # A Tracking Camera keeps moving the OVRTX camera, which has no pose of its own.
- current = self.current_image_view
- self._rtx_pose_view = current if self._is_tracking_view(current) else None
self._select_camera(rtx_index, keep_pose=True)
self._apply_rtx_visible_envs()
if self._rtx_appearance is not None and self._rtx_appearance.available:
self._rtx_appearance.apply_lights()
else:
- back = self._rtx_pose_view # _select_camera clears it after the outgoing pose is saved
- self._select_camera(self._image_views.index(back) if back is not None else free[0], keep_pose=True)
+ self._select_camera(free[0], keep_pose=True)
@property
def visible_env_limit(self) -> int:
diff --git a/source/isaaclab_visualizers/test/test_newton_adapter.py b/source/isaaclab_visualizers/test/test_newton_adapter.py
index 5f2ce2d88b3b..dd8535c0de6d 100644
--- a/source/isaaclab_visualizers/test/test_newton_adapter.py
+++ b/source/isaaclab_visualizers/test/test_newton_adapter.py
@@ -12,7 +12,6 @@
import sys
import textwrap
from contextlib import nullcontext
-from functools import partial
from types import SimpleNamespace
from unittest.mock import Mock, call
@@ -42,7 +41,7 @@
from isaaclab.test.utils import DeviceScope, test_devices
from isaaclab.utils import validate
from isaaclab.utils.warp import ProxyArray
-from isaaclab.visualizers import PerspectiveCameraCfg, SceneCameraCfg, TrackingCameraCfg, VisualizerCfg, WindowCfg
+from isaaclab.visualizers import PerspectiveCameraCfg, SceneCameraCfg, VisualizerCfg, WindowCfg
from isaaclab.visualizers.base_visualizer import BaseVisualizer
@@ -683,7 +682,7 @@ def _make_newton_visualizer(viewer, scene_data_provider=None, state=None, *, cfg
from isaaclab.visualizers import ImageView, ImageViewCfg
view = ImageView(ImageViewCfg(source=PerspectiveCameraCfg()))
- view.render = partial(visualizer._capture_view, view)
+ view.render = visualizer._capture_frame
visualizer.current_image_view, visualizer._image_views = view, [view]
if viewer is not None and isinstance(visualizer, NewtonGLVisualizer):
visualizer._viewer_picking_binding.bind(viewer)
@@ -1446,46 +1445,6 @@ def get_term_cfg(self, name):
assert term_summary(object(), "anything") == "" # Managers without a term accessor.
-def test_the_rtx_view_keeps_following_the_tracking_camera_and_returns_to_it():
- from isaaclab.visualizers import PerspectiveCameraCfg
-
- def view(source, camera=None):
- return SimpleNamespace(camera=camera, cfg=SimpleNamespace(source=source), invalidate=Mock())
-
- rtx_camera = SimpleNamespace(cfg=SimpleNamespace(prim_path="/World/viewer_camera_0"))
- free, rtx, tracking = (
- view(PerspectiveCameraCfg()),
- view(PerspectiveCameraCfg(), rtx_camera),
- view(TrackingCameraCfg(env_index=0)),
- )
- visualizer = object.__new__(NewtonGLVisualizer)
- visualizer._image_views = [free, rtx, tracking]
- visualizer.cfg = SimpleNamespace(backend=SimpleNamespace(rtx_camera_prim_path="/World/viewer_camera_0"))
- visualizer.current_image_view = tracking
- visualizer._rtx_pose_view = None
-
- pose_view_when_selecting = []
-
- def select(index, keep_pose=False):
- pose_view_when_selecting.append(visualizer._rtx_pose_view)
- visualizer.current_image_view = visualizer._image_views[index]
- if index != visualizer.rtx_view_index:
- visualizer._rtx_pose_view = None
-
- visualizer._select_camera = select
- visualizer._apply_rtx_visible_envs = lambda: None
-
- visualizer.set_rtx_rendering(True)
-
- assert visualizer.rtx_rendering and visualizer._pose_source_view() is tracking
-
- visualizer.set_rtx_rendering(False)
-
- assert visualizer.current_image_view is tracking and visualizer._rtx_pose_view is None
- # Selecting away saves the outgoing pose first, which must still see the Tracking Camera driving the viewer.
- assert pose_view_when_selecting[-1] is tracking
-
-
def test_sensor_labels_name_the_outputs_of_the_sensor():
label = NewtonGLVisualizer._sensor_label
assert label("/World/envs/env_[^/]+/Camera", ["rgb", "depth"]) == "Camera (RGB + depth sensor)"
diff --git a/source/isaaclab_visualizers/test/test_newton_task_views.py b/source/isaaclab_visualizers/test/test_newton_task_views.py
index 8008cc8a9344..fa3887e8db47 100644
--- a/source/isaaclab_visualizers/test/test_newton_task_views.py
+++ b/source/isaaclab_visualizers/test/test_newton_task_views.py
@@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: BSD-3-Clause
-"""Unit tests for the Tracking Camera views of the Newton GL window."""
+"""Unit tests for the camera sources of the Newton GL window."""
from __future__ import annotations
@@ -16,8 +16,7 @@
from isaaclab_visualizers.newton.newton_visualizer import NewtonGLVisualizer, NewtonVisualizerBase
from pyglet.math import Vec3
-from isaaclab.visualizers import PerspectiveCameraCfg, TrackingCameraCfg
-from isaaclab.visualizers.camera_follower import CameraFollower
+from isaaclab.visualizers import PerspectiveCameraCfg
pytestmark = pytest.mark.kitless
@@ -42,7 +41,7 @@ def __getitem__(self, name):
class _View:
- """An image view; a class, not a namespace, so that it can key the follower dictionary."""
+ """An image view; a class, not a namespace, so that it can key the pose dictionary."""
def __init__(self, source, camera=None):
self.cfg, self.camera = SimpleNamespace(source=source), camera
@@ -63,30 +62,20 @@ def set_camera(pos, pitch, yaw):
viz._viewer = SimpleNamespace(camera=camera, set_camera=set_camera)
viz._sim = SimpleNamespace(get_physics_step_count=lambda: 10, get_physics_dt=lambda: 0.1)
viz._image_views = list(views)
- viz._followers = {view: CameraFollower(view.cfg.source, _Scene()) for view in views if viz._is_tracking_view(view)}
- viz.rtx_rendering, viz._rtx_pose_view, viz._perspective_poses = False, None, {}
+ viz.rtx_rendering, viz._perspective_poses = False, {}
return viz
-def test_a_lone_free_view_is_called_perspective_and_a_task_view_the_tracking_camera():
- free, task = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=0, eye=(2.0, 0.0, 1.0)))
- viz = _visualizer([free, task])
+def test_a_lone_free_view_is_called_perspective():
+ viz = _visualizer([_view(PerspectiveCameraCfg())])
- assert viz._view_labels([0, 1]) == ["Perspective", "Tracking Camera"]
- assert [viz._is_tracking_view(view) for view in viz._image_views] == [False, True]
+ assert viz._view_labels([0]) == ["Perspective"]
def test_views_are_numbered_only_when_several_share_a_name():
- views = [_view(PerspectiveCameraCfg()), _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=0))]
- views += [_view(TrackingCameraCfg(env_index=1))]
- viz = _visualizer(views)
-
- assert viz._view_labels([0, 1, 2, 3]) == [
- "Perspective 1",
- "Perspective 2",
- "Tracking Camera 1",
- "Tracking Camera 2",
- ]
+ viz = _visualizer([_view(PerspectiveCameraCfg()), _view(PerspectiveCameraCfg())])
+
+ assert viz._view_labels([0, 1]) == ["Perspective 1", "Perspective 2"]
def test_scene_cameras_are_named_by_their_prim_without_the_environment_pattern():
@@ -97,19 +86,19 @@ def test_scene_cameras_are_named_by_their_prim_without_the_environment_pattern()
assert viz._view_labels([0, 1]) == ["Perspective", "wrist_camera (RGB sensor)"]
-def test_the_camera_list_puts_perspective_first_then_tracking_cameras_then_sensors():
+def test_the_camera_list_puts_perspective_first_then_sensors():
sensor = _View("/World/envs/env_[^/]+/Camera", camera=object())
- tracking, free = _view(TrackingCameraCfg(env_index=0)), _view(PerspectiveCameraCfg())
- viz = _visualizer([sensor, tracking, free])
+ free = _view(PerspectiveCameraCfg())
+ viz = _visualizer([sensor, free])
- order = sorted(range(3), key=lambda i: viz._source_rank(viz._image_views[i]))
+ order = sorted(range(2), key=lambda i: viz._source_rank(viz._image_views[i]))
- assert order == [2, 1, 0]
+ assert order == [1, 0]
def test_the_free_perspective_pose_is_kept_while_another_source_is_shown():
- free, task = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=0))
- viz = _visualizer([free, task])
+ free, other = _view(PerspectiveCameraCfg()), _view(PerspectiveCameraCfg())
+ viz = _visualizer([free, other])
viz._focal_length_to_vertical_fov_degrees = lambda focal=None: 40.0
viz.current_image_view = free
viz._viewer.camera.fov = 0.0
@@ -117,41 +106,12 @@ def test_the_free_perspective_pose_is_kept_while_another_source_is_shown():
camera.pos, camera.pitch, camera.yaw = (1.0, 2.0, 3.0), -10.0, 45.0
viz._remember_perspective_pose()
- camera.pos, camera.pitch, camera.yaw = (9.0, 9.0, 9.0), 0.0, 0.0 # A Tracking Camera or sensor moved it.
+ camera.pos, camera.pitch, camera.yaw = (9.0, 9.0, 9.0), 0.0, 0.0 # A sensor moved it.
viz.cfg.focal_length = 50.0
assert viz._restore_perspective_pose(free)
assert (tuple(camera.pos), camera.pitch, camera.yaw, viz.cfg.focal_length) == ((1.0, 2.0, 3.0), -10.0, 45.0, 12.0)
- assert not viz._restore_perspective_pose(task) # A view that was never left has nothing to restore.
-
-
-def test_resetting_the_tracking_camera_works_while_the_rtx_view_is_current():
- view = _view(TrackingCameraCfg(env_index=0, eye=(2.0, 0.0, 1.0), lookat=(0.0, 0.0, 0.5), focal_length=24.0))
- rtx = _View("/World/viewer_camera_0_rtx", camera=object())
- viz = _visualizer([view])
- cfg = view.cfg.source
- viz._tracking_defaults = {
- view: {
- "eye": cfg.eye,
- "lookat": cfg.lookat,
- "focal_length": cfg.focal_length,
- "track_path": cfg.track_path,
- "follow_heading": cfg.follow_heading,
- "heading_smoothing_time_constant": cfg.heading_smoothing_time_constant,
- "env": 0,
- }
- }
- viz.current_image_view, viz.rtx_rendering, viz._rtx_pose_view = (
- rtx,
- True,
- view,
- ) # RTX is showing the Tracking Camera.
- viz._tracking_error = ""
-
- cfg.eye = (9.0, 9.0, 9.0)
- assert viz._reset_tracking_camera(viz._followers[view])
-
- assert cfg.eye == (2.0, 0.0, 1.0)
+ assert not viz._restore_perspective_pose(other) # A view that was never left has nothing to restore.
def _rtx_view():
diff --git a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py b/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
deleted file mode 100644
index 017674a61ded..000000000000
--- a/source/isaaclab_visualizers/test/test_newton_tracking_cameras.py
+++ /dev/null
@@ -1,193 +0,0 @@
-# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
-# All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-
-"""Unit tests for Newton viewer perspective views that follow an asset or frame an environment."""
-
-from __future__ import annotations
-
-from types import SimpleNamespace
-
-import pytest
-import torch
-import warp as wp
-
-pytest.importorskip("newton")
-from isaaclab_visualizers.newton.newton_visualizer import NewtonVisualizerBase
-from pyglet.math import Vec3
-
-from isaaclab.visualizers import PerspectiveCameraCfg, TrackingCameraCfg
-from isaaclab.visualizers.camera_follower import CameraFollower
-
-pytestmark = pytest.mark.kitless
-
-
-class _Camera:
- """The viewer camera: a position, a look-at target stored as angles, and a field of view."""
-
- def __init__(self):
- self.pos, self.pitch, self.yaw, self.fov = Vec3(1.0, 1.0, 1.0), 0.1, 0.2, 40.0
- self.target = None
-
- def look_at(self, target):
- self.target = tuple(target)
-
-
-class _Scene:
- num_envs = 2
- env_origins = torch.tensor([[0.0, 0.0, 0.0], [10.0, 0.0, 0.0]])
-
- def __getitem__(self, name):
- return SimpleNamespace(is_initialized=False)
-
-
-def _visualizer(views) -> NewtonVisualizerBase:
- viz = NewtonVisualizerBase.__new__(NewtonVisualizerBase)
- viz.cfg = SimpleNamespace(focal_length=12.0, eye=(4.0, -4.0, 3.0), lookat=(0.0, 0.0, 0.0))
- viz._followers, viz._last_render_step = {}, 5
- viz._tracking_defaults, viz._tracking_error = {}, ""
- camera = _Camera()
-
- def set_camera(pos, pitch, yaw):
- camera.pos, camera.pitch, camera.yaw = pos, pitch, yaw
-
- viz._viewer = SimpleNamespace(camera=camera, set_camera=set_camera, is_paused=lambda: False, world_offsets=None)
- viz._sim = SimpleNamespace(
- get_scene_data_provider=lambda: SimpleNamespace(get_interactive_scene=lambda: _Scene()),
- get_physics_step_count=lambda: 10,
- get_physics_dt=lambda: 0.1,
- )
- viz._image_views = list(views)
- viz._followers = {
- view: CameraFollower(view.cfg.source, _Scene())
- for view in views
- if isinstance(view.cfg.source, TrackingCameraCfg)
- }
- viz.current_image_view = viz._image_views[0]
- return viz
-
-
-class _View:
- """A perspective image view: hashable like the real one, with no scene camera."""
-
- camera, render = None, None
-
- def __init__(self, cfg: PerspectiveCameraCfg):
- self.cfg = SimpleNamespace(source=cfg)
- self.frame = SimpleNamespace(data=None, timestamp=-1)
-
-
-def _view(cfg: PerspectiveCameraCfg) -> _View:
- return _View(cfg)
-
-
-def test_a_tracking_camera_points_the_viewer_without_changing_the_configured_pose():
- task = _view(TrackingCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0), focal_length=24.0))
- viz = _visualizer([task])
- assert viz._apply_view_pose(task)
- camera = viz._viewer.camera
- assert (camera.pos.x, camera.pos.y, camera.pos.z) == (11.0, 2.0, 3.0)
- assert camera.target == (10.0, 0.0, 1.0)
- assert camera.fov == pytest.approx(viz._focal_length_to_vertical_fov_degrees(24.0))
- assert viz.cfg.eye == (4.0, -4.0, 3.0) and viz.cfg.focal_length == 12.0
-
-
-def test_capturing_another_view_hands_the_viewer_camera_back():
- free, task = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0)))
- viz = _visualizer([free, task])
- seen = {}
-
- def capture(output):
- # the window's own view is borrowed for the capture, and the camera moves while it renders
- seen["view"] = viz.current_image_view
- viz._viewer.camera.pos, viz._viewer.camera.fov = Vec3(11.0, 2.0, 3.0), 20.0
- return "frame"
-
- viz._capture_frame = capture
- assert viz._capture_view(task, None) == "frame"
- assert seen["view"] is task
- camera = viz._viewer.camera
- assert (camera.pos.x, camera.pos.y, camera.pos.z, camera.fov) == (1.0, 1.0, 1.0, 40.0)
- assert viz.current_image_view is free and viz._last_render_step == -1
-
-
-def test_the_tracking_camera_recording_picks_the_first_tied_view():
- free = _view(PerspectiveCameraCfg())
- first, second = _view(TrackingCameraCfg(track_path="robot")), _view(TrackingCameraCfg(env_index=1))
- viz = _visualizer([free, first, second])
- viz._sim.get_physics_step_count = lambda: 3
- first.read_rgb, second.read_rgb = (lambda step: ("first", step)), (lambda step: ("second", step))
- assert viz.render_tracking_rgb_array() == ("first", 3)
-
-
-def test_the_tracking_camera_recording_reports_a_visualizer_without_one():
- with pytest.raises(RuntimeError, match="declares no tracking camera"):
- _visualizer([_view(PerspectiveCameraCfg())]).render_tracking_rgb_array()
-
-
-def test_the_selector_names_the_tracking_camera_and_the_free_perspective():
- camera = SimpleNamespace(cfg=SimpleNamespace(data_types=["rgba"]))
- sensor = SimpleNamespace(camera=camera, cfg=SimpleNamespace(source="/World/envs/env_0/cam"))
- viz = _visualizer([_view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=1))])
- viz._image_views.append(sensor)
- assert viz._view_labels() == ["Perspective", "Tracking Camera", "cam (RGB sensor)"]
-
- viz = _visualizer([_view(TrackingCameraCfg(env_index=0)), _view(TrackingCameraCfg(track_path="robot"))])
- assert viz._view_labels() == ["Tracking Camera 1", "Tracking Camera 2"]
-
-
-def test_resetting_the_tracking_camera_restores_what_the_task_declared():
- task = _view(TrackingCameraCfg(env_index=0, eye=(1.0, 0.0, 0.0), track_path="robot", follow_heading=True))
- viz = _visualizer([task])
- cfg, follower = task.cfg.source, viz._followers[task]
- viz._remember_tracking_defaults(task, follower)
- cfg.eye, cfg.follow_heading = (5.0, 5.0, 5.0), False
- follower.set_env(1)
- follower.set_track_path(None)
-
- assert viz._reset_tracking_camera(follower)
- assert (cfg.eye, cfg.track_path, cfg.follow_heading, follower.env) == ((1.0, 0.0, 0.0), "robot", True, 0)
-
-
-def test_an_unknown_asset_is_reported_and_the_camera_keeps_following_its_target():
- task = _view(TrackingCameraCfg(env_index=0, track_path="robot"))
- viz = _visualizer([task])
- viz._tracking_error = ""
- follower = viz._followers[task]
-
- class _Scene2(_Scene):
- def __getitem__(self, name):
- if name != "robot":
- raise KeyError(name)
- return super().__getitem__(name)
-
- follower._scene = _Scene2()
- assert not viz._set_tracking_path(follower, "ghost")
- assert "unknown scene asset" in viz._tracking_error and task.cfg.source.track_path == "robot"
- assert viz._set_tracking_path(follower, "robot") and viz._tracking_error == ""
-
-
-def test_a_visualizer_reports_whether_it_declares_a_tracking_view():
- free, task = _view(PerspectiveCameraCfg()), _view(TrackingCameraCfg(env_index=1))
- assert not _visualizer([free]).has_tracking_view
- assert _visualizer([free, task]).has_tracking_view
-
-
-def test_the_tracking_camera_recording_keeps_its_last_frame_while_rendering_is_paused():
- tracking = _view(TrackingCameraCfg(track_path="robot"))
- viz = _visualizer([_view(PerspectiveCameraCfg()), tracking])
- viz._sim.get_physics_step_count = lambda: 9
- viz._viewer.is_paused = lambda: True
- tracking.frame = SimpleNamespace(data=object(), timestamp=4)
- tracking.read_rgb = lambda step: step
- assert viz.render_tracking_rgb_array() == 4
-
-
-def test_a_tracking_camera_follows_the_world_offset_the_viewer_draws_its_environment_at():
- task = _view(TrackingCameraCfg(env_index=1, eye=(1.0, 2.0, 3.0), lookat=(0.0, 0.0, 1.0)))
- viz = _visualizer([task])
- viz._viewer.world_offsets = wp.array([[0.0, 0.0, 0.0], [5.0, 0.0, 0.0]], dtype=wp.vec3)
- assert viz._apply_view_pose(task)
- camera = viz._viewer.camera
- assert (camera.pos.x, camera.pos.y, camera.pos.z) == (16.0, 2.0, 3.0)
From f55439b584b4837f40564cca0439ee0d0e612fcc Mon Sep 17 00:00:00 2001
From: mtrepte
Date: Fri, 20 Nov 2026 00:34:44 +0000
Subject: [PATCH 095/140] Reorganize the Newton HUD and remove the Newton RTX
visualizer
---
docs/source/_static/css/demo-browser.js | 5 +-
docs/source/concepts/backends_and_presets.rst | 2 +-
.../concepts/reinforcement_learning.rst | 2 +-
docs/source/concepts/renderers.rst | 4 +-
docs/source/concepts/using_mpm.rst | 16 +-
docs/source/concepts/visualization.rst | 201 ++----
.../developer-tools/template_generator.rst | 4 +-
docs/source/features/isaac_teleop.rst | 6 +-
.../how-to/create_visualization_markers.rst | 2 +-
docs/source/how-to/import_new_asset.rst | 4 +-
docs/source/how-to/mpm_tutorials.rst | 8 +-
docs/source/how-to/multi_asset_spawning.rst | 2 +-
.../source/how-to/policy_inference_in_usd.rst | 8 +-
docs/source/how-to/record_video.rst | 42 +-
docs/source/how-to/run_rl_training.rst | 2 +-
docs/source/how-to/run_state_machines.rst | 4 +-
docs/source/how-to/solver_tuning_kamino.rst | 2 +-
.../visualizer_streaming_camera_view.rst | 68 +--
docs/source/isaaclab/demos.rst | 43 +-
docs/source/isaaclab/installation.rst | 23 +-
docs/source/isaaclab/migrating.rst | 90 +--
docs/source/isaaclab/quickstart.rst | 14 +-
...deploying_exported_policies_with_leapp.rst | 10 +-
.../exporting_policies_with_leapp.rst | 2 +-
examples/cables.py | 2 +-
examples/deformables.py | 2 +-
examples/demos/h1_locomotion.py | 4 +-
examples/demos/microduck_warehouse.py | 2 +-
.../demos/newton_viewer_block_and_tackle.py | 2 +-
examples/demos/nist.py | 5 +-
examples/demos/rizon_sharpa_coffee.py | 29 +-
examples/demos/snowball_smash.py | 4 +-
examples/demos/sonic.py | 4 +-
examples/demos/teapot_fill.py | 6 +-
examples/demos/zoo.py | 2 +-
examples/haply_teleoperation.py | 2 +-
examples/mpm/newton_mpm_granular.py | 4 +-
examples/mpm/newton_mpm_twoway_coupling.py | 4 +-
examples/multi_asset.py | 2 +-
examples/newton_viewer_dominoes.py | 2 +-
examples/sensors/contact_sensor.py | 2 +-
examples/sensors/multi_mesh_raycaster.py | 2 +-
examples/sensors/newton_raycast.py | 2 +-
examples/sharpa_rj45.py | 2 +-
examples/tablecloth.py | 2 +-
examples/visual_color_randomization.py | 14 +-
.../state_machine/lift_franka_soft.py | 2 +-
scripts/tools/convert_mjcf.py | 2 +-
scripts/tools/convert_urdf.py | 2 +-
.../run_tiled_camera_visualizer.py | 4 +-
.../07_visualizers/run_video_recording.py | 4 +-
.../08_mpm/surface_reconstruction.py | 30 +-
.../test/rendering/test_visualizers_rtx.py | 35 +-
.../newton-visualizer-name.changed.rst | 4 +
source/isaaclab/isaaclab/app/app_launcher.py | 4 -
source/isaaclab/isaaclab/app/sim_launcher.py | 92 ++-
.../isaaclab/envs/mdp/visual_events.py | 2 +-
.../isaaclab/envs/utils/video_recorder.py | 2 +-
.../isaaclab/envs/utils/video_recorder_cfg.py | 33 +-
.../isaaclab/markers/visualization_markers.py | 2 +-
.../isaaclab/physics/physics_manager.py | 2 +-
source/isaaclab/isaaclab/program_browser.py | 2 +-
source/isaaclab/isaaclab/programs.py | 2 +-
.../scene_data/scene_data_provider.py | 2 -
.../isaaclab/sim/simulation_context.py | 7 +-
.../isaaclab/visualizers/base_visualizer.py | 6 +-
.../isaaclab/visualizers/visualizer_cfg.py | 36 +-
.../test/app/standalone_script_cases.py | 51 +-
.../app/test_launch_simulation_require_kit.py | 81 ++-
.../test/app/test_rtx_viewer_camera.py | 25 +-
.../test/app/test_standalone_scripts.py | 33 +-
.../test_installed_workflow_entrypoints.py | 8 +-
.../test/cli/test_teleop_entrypoints.py | 4 +-
.../test/envs/test_event_requirements.py | 2 +-
.../isaaclab/test/envs/test_video_recorder.py | 35 +-
.../markers/test_visualization_markers.py | 4 +-
.../test_simulation_context_visualizers.py | 32 +-
.../test/visualizers/test_visualizer.py | 5 +-
.../newton-visualizer-type-name.changed.rst | 2 +
.../isaaclab_newton/physics/newton_manager.py | 2 +-
...auncher-newton-visualizer-help.changed.rst | 2 +
.../isaaclab_physx/app/kit_launcher.py | 6 +-
.../test/app/test_kit_launcher.py | 8 +-
.../changelog.d/hud-run-info.added.rst | 1 +
.../entrypoints/backends/play_rsl_rl.py | 2 +
.../entrypoints/backends/train_rsl_rl.py | 2 +
.../isaaclab_rl/entrypoints/common.py | 16 +-
.../test/test_apply_video_recording.py | 22 +-
.../newton-gl-alias-quiet.changed.rst | 2 +
.../contrib/gb300_sharpa_insertion/README.md | 2 +-
.../gb300_sharpa_insertion/visual_scene.py | 7 +-
.../contrib/rizon_sharpa_coffee/README.md | 16 +-
.../rizon_sharpa_coffee/demo_env_cfg.py | 13 +-
.../contrib/rizon_sharpa_coffee/rendering.py | 28 +-
.../isaaclab_tasks/utils/hydra.py | 54 +-
.../isaaclab_tasks/utils/presets.py | 13 +-
.../test/core/test_preset_cli.py | 2 +-
.../test_sim_launcher_visualizer_intent.py | 41 +-
.../test/core/test_video_recording.py | 8 +-
.../newton-camera-readout.changed.rst | 1 +
.../changelog.d/newton-camera-speed.added.rst | 1 +
.../changelog.d/newton-hud-layout.changed.rst | 9 +
.../changelog.d/newton-pause-keys.changed.rst | 3 +
.../changelog.d/newton-rtx-overlays.added.rst | 5 +-
.../newton-rtx-visualizer-removed.removed.rst | 6 +
.../isaaclab_visualizers/newton/__init__.py | 25 +-
.../newton/newton_overlay_meshes.py | 9 +-
.../newton/newton_visualizer.py | 576 +++++++++++-------
.../newton/newton_visualizer_cfg.py | 70 +--
.../newton/particle_surface.py | 6 +-
.../test/test_newton_adapter.py | 119 +++-
.../test/test_newton_task_views.py | 68 ++-
.../test_newton_visualizer_viewer_release.py | 72 +--
tools/docs/media/capture_quickstart.py | 10 +-
.../media/capture_reinforcement_learning.py | 6 +-
tools/docs/media/generate_quickstart.sh | 2 +-
.../media/generate_reinforcement_learning.sh | 2 +-
.../media/visualizers/capture_visualizer.py | 279 ++-------
118 files changed, 1362 insertions(+), 1375 deletions(-)
create mode 100644 source/isaaclab/changelog.d/newton-visualizer-name.changed.rst
create mode 100644 source/isaaclab_newton/changelog.d/newton-visualizer-type-name.changed.rst
create mode 100644 source/isaaclab_physx/changelog.d/kit-launcher-newton-visualizer-help.changed.rst
create mode 100644 source/isaaclab_rl/changelog.d/hud-run-info.added.rst
create mode 100644 source/isaaclab_tasks/changelog.d/newton-gl-alias-quiet.changed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-camera-readout.changed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-camera-speed.added.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-hud-layout.changed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-pause-keys.changed.rst
create mode 100644 source/isaaclab_visualizers/changelog.d/newton-rtx-visualizer-removed.removed.rst
diff --git a/docs/source/_static/css/demo-browser.js b/docs/source/_static/css/demo-browser.js
index f351f17c2004..e8bea6389197 100644
--- a/docs/source/_static/css/demo-browser.js
+++ b/docs/source/_static/css/demo-browser.js
@@ -51,9 +51,6 @@
if (fields.physics.value === "ovphysx") {
requiredExtras.add("ovphysx");
}
- if (fields.visualizer.value === "newton_rtx") {
- requiredExtras.add("ovrtx");
- }
if (["rerun", "viser"].includes(fields.visualizer.value)) {
requiredExtras.add(fields.visualizer.value);
}
@@ -86,7 +83,7 @@
const updateVisualizer = () => {
const preferredVisualizers = fields.physics.value.startsWith("newton")
- ? ["newton_gl", "kit"]
+ ? ["newton", "kit"]
: ["kit"];
populateSelect(fields.visualizer, compatibleVisualizers(), preferredVisualizers);
updateCommand();
diff --git a/docs/source/concepts/backends_and_presets.rst b/docs/source/concepts/backends_and_presets.rst
index dc846e4410b1..5858bb9f6cbd 100644
--- a/docs/source/concepts/backends_and_presets.rst
+++ b/docs/source/concepts/backends_and_presets.rst
@@ -91,7 +91,7 @@ Choose a selector
- ``renderer=newton_warp``
- Selects a renderer configuration for tasks that produce camera data.
* - ``visualizer=NAME[,NAME,...]``
- - ``visualizer=newton_gl``
+ - ``visualizer=newton``
- Selects interactive viewers; ``visualizer=none`` disables them.
* - ``presets=NAME[,NAME,...]``
- ``presets=rgb``
diff --git a/docs/source/concepts/reinforcement_learning.rst b/docs/source/concepts/reinforcement_learning.rst
index 09fdf7174c68..417f1057cba6 100644
--- a/docs/source/concepts/reinforcement_learning.rst
+++ b/docs/source/concepts/reinforcement_learning.rst
@@ -27,7 +27,7 @@ To evaluate the latest compatible checkpoint in the interactive visualizer:
.. code-block:: bash
uv run isaaclab play --rl_library rsl_rl --task Isaac-Cartpole \
- --checkpoint latest --num_envs 32 --viz newton_gl
+ --checkpoint latest --num_envs 32 --viz newton
The ``train`` and ``play`` commands work across the supported RL libraries.
diff --git a/docs/source/concepts/renderers.rst b/docs/source/concepts/renderers.rst
index 8603028caad0..633cb07048ce 100644
--- a/docs/source/concepts/renderers.rst
+++ b/docs/source/concepts/renderers.rst
@@ -304,8 +304,8 @@ motion vectors, while Newton Warp does not. The :ref:`renderer visual comparison
.. note::
Visualization markers are debug overlays provided by visualizers, not camera outputs. Their
- support is independent of the camera renderer: the Kit, Newton GL, Rerun, and Viser visualizers
- support markers, while the experimental Newton RTX visualizer does not. See
+ support is independent of the camera renderer: the Kit, Newton, Rerun, and Viser visualizers
+ support markers, in both OpenGL and RTX rendering for Newton. See
:doc:`/source/concepts/visualization` for the visualizer support matrix.
.. note::
diff --git a/docs/source/concepts/using_mpm.rst b/docs/source/concepts/using_mpm.rst
index 4d3b52d3f222..b6c5298e4311 100644
--- a/docs/source/concepts/using_mpm.rst
+++ b/docs/source/concepts/using_mpm.rst
@@ -16,7 +16,7 @@ Examples and tasks
------------------
These examples and demos introduce MPM construction and interaction. They
-default to Newton GL for interactive viewing. The launcher uses ``cuda:0`` by
+default to the Newton visualizer for interactive viewing. The launcher uses ``cuda:0`` by
default. Pass ``--device cuda:N`` to select a different GPU.
.. grid:: 1 1 2 2
@@ -310,23 +310,23 @@ material behavior. Run the teapot demo to compare the available modes:
# Reconstructed surface
uv run isaaclab demo teapot-fill \
- --visualizer newton_gl --fluid_render_mode surface
+ --visualizer newton --fluid_render_mode surface
# Surface and source particles together
uv run isaaclab demo teapot-fill \
- --visualizer newton_gl --fluid_render_mode both
+ --visualizer newton --fluid_render_mode both
-The teapot demo uses Newton GL and defaults to the reconstructed surface. Select
+The teapot demo uses the Newton visualizer and defaults to the reconstructed surface. Select
``particles`` or ``both`` to inspect the source MPM state. Its ``--visualizer`` / ``--viz``
-option accepts only ``newton_gl``; omit the option to use that default.
+option accepts only ``newton``; omit the option to use that default.
-For a path-traced surface, use the surface-reconstruction tutorial:
+For a path-traced surface, use the surface-reconstruction tutorial, which starts the Newton window in RTX:
.. code-block:: bash
uv run --extra ovrtx python scripts/tutorials/08_mpm/surface_reconstruction.py \
- --visualizer newton_rtx --fluid_render_mode surface
+ --visualizer newton --initial_renderer rtx --fluid_render_mode surface
-Surface rendering is available in the Kit, Newton GL, and Newton RTX visualizers.
+Surface rendering is available in the Kit and Newton visualizers, with OpenGL or RTX rendering in the latter.
.. raw:: html
diff --git a/docs/source/concepts/visualization.rst b/docs/source/concepts/visualization.rst
index de3607c35bea..81383539326f 100644
--- a/docs/source/concepts/visualization.rst
+++ b/docs/source/concepts/visualization.rst
@@ -60,7 +60,7 @@ the end effector in Manual mode.
-
Newton GL
+
Newton (OpenGL)
@@ -74,7 +74,7 @@ the end effector in Manual mode.
-
Newton RTX
+
Newton (RTX)
@@ -105,7 +105,7 @@ the end effector in Manual mode.
});
-
Note: Newton RTX has no velocity arrows, since it doesn't yet support visualization markers.
+
Note: the Newton (RTX) clip was recorded without visualization markers, so it shows no velocity arrows.
Quick Start
@@ -120,8 +120,8 @@ alias.
.. code-block:: bash
- # Newton GL: lightweight OpenGL viewport
- uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz newton_gl
+ # Newton: lightweight OpenGL viewport, switchable to RTX rendering
+ uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz newton
# Viser: browser-based viewer
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz viser
@@ -130,7 +130,7 @@ alias.
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 viser,newton_rtx
+ uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz viser,newton
.. note::
@@ -148,8 +148,8 @@ For combining visualizers, running headless, and other common use cases, see `Us
Visualizer presets
~~~~~~~~~~~~~~~~~~
-Task commands accept ``visualizer=newton_gl``, ``visualizer=kit``, or
-``visualizer=viser,newton_gl``. ``--viz`` and ``--visualizer`` are aliases for the same
+Task commands accept ``visualizer=newton``, ``visualizer=kit``, or
+``visualizer=viser,newton``. ``--viz`` and ``--visualizer`` are aliases for the same
selection. ``visualizer=none`` disables viewers. Selection happens during configuration
composition, before choosing process runtimes or creating the scene.
@@ -191,13 +191,13 @@ Compose standalone declarations during initial configuration, then call the core
...
One ``VisualizerCfg`` supplies the common settings for every selected backend. Selecting
-``viser,newton_gl`` creates both viewers; no outer list or repeated common settings is needed.
+``viser,newton`` creates both viewers; no outer list or repeated common settings is needed.
Backend-specific options are available when needed, but ordinary configuration uses the unchanged
``MultiBackendVisualizerCfg()`` declaration.
Use a list of ``VisualizerCfg`` declarations for different views or window sizes. Backend selection
applies to each declaration independently. For example, a task with these two views opens four
-windows with ``--viz=newton_gl,newton_rtx``: one GL and one RTX window per view.
+windows with ``--viz=newton,viser``: one Newton and one Viser window per view.
.. code-block:: python
@@ -217,13 +217,13 @@ Task entry points perform this selection through ``resolve_task_config``:
.. code-block:: bash
- uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole visualizer=viser,newton_gl
+ uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole visualizer=viser,newton
-``--viz viser,newton_gl`` is equivalent. Task composition selects the backends inside
+``--viz viser,newton`` is equivalent. Task composition selects the backends inside
``VisualizerCfg.backend`` before launch; launch creates each viewer with the shared settings.
Viewer implementations are imported only when constructed.
-For ``--video`` without a selected capture-capable viewer, launch selects a headless Newton GL
+For ``--video`` without a selected capture-capable viewer, launch selects a headless Newton
producer. ``visualizer=none`` disables windows; recording still runs its producer on demand.
Use ``--video sensor:`` to record a scene camera without a visualizer producer.
@@ -238,12 +238,10 @@ Visualizer Overview
* - Visualizer
- Description
- * - **Newton GL**
- - Lightweight, strong feature support; Recommended
+ * - **Newton**
+ - Lightweight, strong feature support, OpenGL or RTX rendering; Recommended
* - **Viser**
- Web-based, supports recording and replay; Recommended
- * - **Newton RTX**
- - High-quality RTX rendering; experimental, missing some features
* - **Rerun**
- Deprecated in Isaac Lab 3.2 and removed in 3.3; use Viser instead
* - **Kit**
@@ -251,16 +249,17 @@ Visualizer Overview
.. tab-set::
- .. tab-item:: Newton GL
+ .. tab-item:: Newton
- The Newton GL visualizer is a lightweight OpenGL window with minimal startup overhead.
+ The Newton visualizer is a lightweight OpenGL window with minimal startup overhead. Its **Renderer**
+ selector switches the view to RTX (see below). ``newton_gl`` is an accepted alias of ``newton``.
.. raw:: html
-
Isaac-Reorient-Cube-Allegro in Newton GL Visualizer Each Allegro hand reorients
+
Isaac-Reorient-Cube-Allegro in Newton Visualizer Each Allegro hand reorients
its cube to match the target shown by the marker above it
.. raw:: html
@@ -296,7 +295,8 @@ Visualizer Overview
The **Renderer** selector in the Rendering Options section switches the main view to the OVRTX path tracer for
photorealistic rendering without a Kit process. It appears when the scene has the OVRTX viewer camera, which launch
- declares when ``ovrtx`` is installed and the physics is not Kit-based PhysX. RTX rendering is slightly slower than OpenGL.
+ declares when ``ovrtx`` is installed and the physics is not Kit-based PhysX. Set
+ ``NewtonGLBackendCfg(initial_renderer="rtx")`` to start in RTX. RTX rendering is slightly slower than OpenGL.
.. raw:: html
@@ -307,15 +307,16 @@ Visualizer Overview
staircase sub-terrain
Picking, visualization markers, camera selection, pause controls, Visible Envs, and recording work in
- the RTX view of a windowed Newton GL visualizer, and picking draws the drag arrow there. Joint, contact, spring, center-of-mass, and inertia overlays are drawn in the RTX view too; the collision,
- visual, edge, and wireframe overlays apply to the OpenGL view only.
+ the RTX view of a windowed Newton visualizer, and picking draws the drag arrow there. The model overlays
+ (joint, contact, spring, center-of-mass, inertia, collision, visual, edge, and wireframe) apply to the OpenGL
+ view only.
.. warning::
OVRTX is a kitless renderer and cannot be used in the same process as Kit
(``presets=isaacsim_physx``). ``presets=ovphysx`` is itself kitless and works fine with
RTX rendering. Use ``presets=newton_mjwarp`` or ``presets=ovphysx`` with
- ``--viz newton_gl``, or switch to ``--viz viser``, ``--viz rerun``,
+ ``--viz newton``, or switch to ``--viz viser``, ``--viz rerun``,
or ``--viz kit`` with a Kit-compatible physics backend.
.. dropdown:: NewtonGLBackendCfg source
@@ -397,59 +398,6 @@ Visualizer Overview
:language: python
:pyobject: VisualizerCfg
- .. tab-item:: Newton RTX
-
- The **experimental** Newton RTX visualizer, launched with ``--viz newton_rtx``, uses the
- OVRTX path-tracer for photorealistic rendering without a Kit process. It is slightly
- slower than the Newton GL visualizer due to the cost of high-quality RTX rendering.
-
- .. raw:: html
-
-
-
-
-
Isaac-Velocity-Rough-H1 in Newton RTX Visualizer Each H1 humanoid climbs a
- staircase sub-terrain
-
- **Visualizer-specific features:**
-
- - OVRTX path-traced rendering for photorealistic, physically-based lighting
-
- .. note::
-
- The following features are not yet supported and will be added in a future release:
- live plots and rigid-body dragging. Visualization markers, camera selection, scene-camera
- display, pause controls, and headless recording are supported.
-
- .. dropdown:: NewtonRTXBackendCfg source
- :icon: code
-
- .. literalinclude:: ../../../source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
- :language: python
- :pyobject: NewtonRTXBackendCfg
-
- .. dropdown:: Shared window options
- :icon: code
-
- .. literalinclude:: ../../../source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
- :language: python
- :pyobject: WindowCfg
-
- .. dropdown:: VisualizerCfg source (shared settings)
- :icon: code
-
- .. literalinclude:: ../../../source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
- :language: python
- :pyobject: VisualizerCfg
-
- .. warning::
-
- Newton RTX (OVRTX) is a kitless renderer and cannot be used in the same process as Kit
- (``presets=isaacsim_physx``). ``presets=ovphysx`` is itself kitless and works fine with
- Newton RTX. Use ``presets=newton_mjwarp,ovrtx`` or ``presets=ovphysx,ovrtx`` with
- ``--viz newton_rtx``, or switch to ``--viz newton_gl``, ``--viz viser``,
- or ``--viz kit`` with a Kit-compatible physics backend.
-
.. tab-item:: Rerun
.. deprecated:: 3.2.0
@@ -594,10 +542,10 @@ Multiple visualizers can display the same sensor with different tile selections.
Attach a camera to a robot body to follow its motion, or select an existing view such as the Galbot
-task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton GL, Newton RTX,
+task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton,
Rerun, and Viser visualizers. **Kit** opens it as a separate **Streaming View** viewport, which can
-sit side by side with the default viewport for dual monitoring. **Newton GL** and **Newton RTX**
-provide a **Camera Source** selector in the sidebar for switching between perspective and scene-camera
+sit side by side with the default viewport for dual monitoring. **Newton**
+provides a **Camera Source** selector in the sidebar for switching between perspective and scene-camera
views.
Selecting a scene sensor in **Camera Source** shows its channel: the **Channel** selector lists the
sensor's outputs (RGB, depth, normals, or segmentation), and depth, normals, and segmentation are
@@ -640,7 +588,7 @@ There are 2 types of visualization markers:
- Goal shapes: cuboid, sphere, and multi-state position-goal markers
- Center of mass markers
-In the Newton GL visualizer's HUD, built-in marker types that aren't currently active are
+In the Newton visualizer's HUD, built-in marker types that aren't currently active are
shown greyed out.
**Custom Markers:**
@@ -653,7 +601,7 @@ shown greyed out.
.. note::
- Visualization markers are supported on Kit, Newton GL, Newton RTX, Rerun, and Viser.
+ Visualization markers are supported on Kit, Newton (OpenGL and RTX), Rerun, and Viser.
Live Plots
@@ -668,7 +616,7 @@ Live plots stream per-step scalar data into the visualizer.
-
Newton GL visualizer, with 3 plots opened
+
Newton visualizer, with 3 plots opened
@@ -679,8 +627,7 @@ Live plots stream per-step scalar data into the visualizer.
Live Plot windows start hidden or collapsed, except for Rerun, where the Live Plots can be
-collapsed by selecting the "eye" icon. Supported on Kit, Newton GL, Rerun, and Viser; not
-yet supported on Newton RTX (experimental).
+collapsed by selecting the "eye" icon. Supported on Kit, Newton, Rerun, and Viser.
**What's plotted:** per-episode total reward and episode length, plus any active manager
term for manager-based environments (e.g. ``joint_pos``).
@@ -722,20 +669,16 @@ visualizers open a window; a visualizer that only records runs headless:
- Records from
* - ``--video`` (same as ``--video viz``)
- the first capture-capable visualizer ``--viz`` selected, in its window; if none is selected, or only
- streaming ones such as ``viser`` or ``rerun``, a headless ``newton_gl``
- * - ``--video viz:newton_rtx``
- - a ``newton_rtx``: the ``--viz``-selected one if selected, else an extra headless one
- * - ``--video --viz newton_rtx``
- - the selected ``newton_rtx`` window
- * - ``--video viz:newton_gl --viz viser``
- - ``viser`` runs; an extra headless ``newton_gl`` is added only for recording
+ streaming ones such as ``viser`` or ``rerun``, a headless ``newton``
+ * - ``--video viz:newton --viz viser``
+ - ``viser`` runs; an extra headless ``newton`` is added only for recording
* - ``--video sensor:wrist_camera[:rgb|depth|...]``
- that scene sensor; no visualizer is added
A Hydra override after ``--video`` is never taken as its source: ``--video presets=newton_mjwarp``
records from ``viz`` and applies the preset.
-Kit, Newton GL, and Newton RTX visualizers can be recorded from; the web-based visualizers Viser and
+The Kit and Newton visualizers can be recorded from; the web-based visualizers Viser and
Rerun cannot.
See :doc:`/source/how-to/record_video` for the full guide and tutorial.
@@ -750,8 +693,7 @@ the keyboard. Each key press and release arrives as a W3C ``KeyboardEvent.code``
- :class:`~isaaclab_visualizers.kit.KitVisualizer` reports physical key positions, independent of
the keyboard layout. Keys typed into Kit's own UI, such as a text field, are reported too.
-- :class:`~isaaclab_visualizers.newton.NewtonGLVisualizer` and
- :class:`~isaaclab_visualizers.newton.NewtonRTXVisualizer` report layout-mapped keys: a code names
+- :class:`~isaaclab_visualizers.newton.NewtonGLVisualizer` reports layout-mapped keys: a code names
the key that types the same character on a US layout. Presses typed into the window's UI are
withheld. Presses and releases pair up reliably on a US layout; on other layouts, changing Shift
while holding a digit or punctuation key can leave it held until the window loses focus.
@@ -808,7 +750,7 @@ Common Recipes
**Headless training with video recording**
-Run without a window and record clips from a headless Newton GL visualizer, or name another
+Run without a window and record clips from a headless Newton visualizer, or name another
capture source, e.g. ``--video viz:kit``:
.. tab-set::
@@ -825,8 +767,8 @@ See :doc:`/source/how-to/record_video` for clip length, interval, and multi-sour
**Combining an interactive view with a headless recording source**
-Watch training live in Kit while recording from a separate headless Newton GL angle by running with
-``--viz kit --video viz:newton_gl`` and giving each visualizer its own camera. See
+Watch training live in Kit while recording from a separate headless Newton angle by running with
+``--viz kit --video viz:newton`` and giving each visualizer its own camera. See
:ref:`Recording from an independent camera angle ` for the configuration.
**Following a moving robot (Kit)**
@@ -877,7 +819,7 @@ the HUD notes this next to the slider.
Resolution Rules
~~~~~~~~~~~~~~~~
-``--viz`` (comma-separated, e.g. ``--viz kit,newton_gl``) selects which visualizers run, and
+``--viz`` (comma-separated, e.g. ``--viz kit,newton``) selects which visualizers run, and
``SimulationCfg.visualizer_cfgs`` configures them. Each selected type uses its configured settings,
or else that type's default config. Concrete visualizer configs run as given when no CLI selection
is supplied. ``SimulationCfg.visualizer_cfgs`` defaults to ``VisualizerCfg(backend=[])``;
@@ -903,18 +845,18 @@ only needed for independently configured views, such as a different camera angle
* - no ``--viz``
- ``VisualizerCfg()`` (the default)
- No visualizer launches; no window, no capture source.
- * - ``--viz kit,newton_gl``
+ * - ``--viz kit,newton``
- ``VisualizerCfg(max_visible_envs=16)``
- - Launch Kit and Newton GL, both showing at most 16 environments.
+ - Launch Kit and Newton, both showing at most 16 environments.
* - ``--video`` without ``--viz``
- ``VisualizerCfg()``
- - Launch Newton GL without a window, only as the ``--video`` recording source.
+ - Launch Newton without a window, only as the ``--video`` recording source.
* - no ``--viz``
- ``VisualizerCfg(backend=MultiBackendVisualizerCfg())``
- No visualizer launches; backend alternatives remain inactive until selected.
- * - ``visualizer=rerun,newton_gl``
+ * - ``visualizer=viser,newton``
- ``VisualizerCfg(max_visible_envs=16, backend=MultiBackendVisualizerCfg())``
- - Launch Rerun and Newton GL, both showing at most 16 environments.
+ - Launch Viser and Newton, both showing at most 16 environments.
For migration context, see :doc:`/source/isaaclab/migrating`.
@@ -945,7 +887,7 @@ Also, there is a CLI arg ``--max_visible_envs`` that overrides ``VisualizerCfg.m
Scene Background
~~~~~~~~~~~~~~~~
-Kit and Newton RTX use the scene's authored lights and HDR background by default. Configure the
+Kit and the Newton visualizer in RTX mode use the scene's authored lights and HDR background by default. Configure the
environment once on the scene, without repeating its HDR path or intensity in the visualizer:
.. code-block:: python
@@ -955,7 +897,7 @@ environment once on the scene, without repeating its HDR path or intensity in th
``VisualizerCfg.background_color`` defaults to ``None``. An explicit normalized RGB color changes
only the visible background; the scene lights continue to illuminate objects and contribute
-reflections. Newton GL uses its procedural sky when no color override is supplied:
+reflections. The Newton OpenGL view uses its procedural sky when no color override is supplied:
.. code-block:: python
@@ -977,14 +919,11 @@ Performance
* - Visualizer
- Tips
- * - Newton GL
- - Lowest overhead; lower ``window.fps`` to limit wall-clock render frequency.
+ * - Newton
+ - Lowest overhead in OpenGL; lower ``window.fps`` to limit wall-clock render frequency.
* - Viser
- Newton Warp renderer; use ``max_visible_envs`` to limit the number of rendered
environments (see :ref:`visualization-partial-visualization`).
- * - Newton RTX
- - Native Newton RTX rendering; reduce configured perspective resolution or lower ``window.fps``.
- Environment selection limits sensor display tiles; the perspective view shows the full scene.
* - Rerun
- Web viewer may slow down with many environments; use ``--num_envs`` to reduce load.
* - Kit
@@ -998,12 +937,11 @@ Limitations
**Backend feature support:**
.. list-table::
- :widths: 34 11 11 12 11 11
+ :widths: 40 15 15 15 15
:header-rows: 1
* - Feature
- - Newton GL
- - Newton RTX
+ - Newton
- Viser
- Rerun
- Kit
@@ -1012,28 +950,23 @@ Limitations
- ✓
- ✓
- ✓
- - ✓
* - Live plots
- ✓
- - ✗
- ✓
- ✓
- ✓
* - Streaming camera panel
- ✓
- - ✗
- ✓
- ✓
- ✓
* - Video recording, ``--video``
- - ✓
- ✓
- ✗
- ✗
- ✓
* - Pause rendering
- ✓
- - ✗
- ✓
- ✓
- ✓
@@ -1042,26 +975,24 @@ Limitations
- ✓
- ✓
- ✓
- - ✓
* - Keyboard input, ``key_event_source``
- ✓
- ✓
- ✗
- - ✗
- ✓
-In Newton's RTX view, the collision, visual, edge, and wireframe overlays are not available; joint, contact, spring,
-center-of-mass, and inertia overlays are.
+In Newton's RTX view, only the picking drag arrow is drawn; the model overlays (joint, contact, spring,
+center-of-mass, inertia, collision, visual, edge, and wireframe) are not available.
**Lighting differences across visualizers**
Each backend lights the scene differently, so the same environment can look noticeably
-different across visualizers. Kit renders the scene's actual authored USD lights. Newton GL
+different across visualizers. Kit renders the scene's actual authored USD lights. The Newton OpenGL view
uses a fixed sky-gradient and single directional light color
(:attr:`~isaaclab_visualizers.newton.NewtonGLBackendCfg.sky_upper_color`,
-``sky_lower_color``, ``light_color``), independent of scene USD lights. Newton RTX renders the
+``sky_lower_color``, ``light_color``), independent of scene USD lights. The Newton RTX view renders the
authored scene through Isaac Lab's OVRTX renderer, shared with cameras using the same
-``OVRTXRendererCfg``. Newton GL displays the rendered GPU image and handles window controls;
+``OVRTXRendererCfg``. The Newton window displays the rendered GPU image and handles window controls;
Newton's ``ViewerRTX`` is not constructed. Scene transforms, deformable geometry, and material
updates follow the camera renderer's normal synchronization. Perspective resolution stays
fixed when the window is resized; the window scales the image for presentation.
@@ -1075,16 +1006,16 @@ Rerun uses fixed built-in viewer shading with no scene-driven lighting.
**Kit: incompatible with ovphysx / ovrtx presets**
``--viz kit`` cannot be used with ``presets=ovphysx`` or ``presets=ovrtx`` in the same process.
-Use ``--viz newton_gl`` or ``--viz viser`` with those presets, or omit
+Use ``--viz newton`` or ``--viz viser`` with those presets, or omit
``--viz`` for headless execution.
-**Newton RTX: incompatible with Kit**
+**Newton RTX rendering: incompatible with Kit**
-``--viz newton_rtx`` raises a ``RuntimeError`` at startup if the active physics backend is
+Starting Newton in RTX (``initial_renderer="rtx"``) raises a ``RuntimeError`` at startup if the active physics backend is
``isaacsim_physx`` (i.e. ``presets=isaacsim_physx``), since OVRTX is a kitless renderer and cannot share
a process with Kit. ``presets=ovphysx`` is itself kitless and remains supported. Use
-``presets=newton_mjwarp,ovrtx`` or ``presets=ovphysx,ovrtx`` with ``--viz newton_rtx``, or switch
-to ``--viz newton_gl``, ``--viz viser``, or ``--viz kit`` with a Kit-compatible
+``presets=newton_mjwarp,ovrtx`` or ``presets=ovphysx,ovrtx`` with ``--viz newton``, or switch
+to ``--viz viser`` or ``--viz kit`` with a Kit-compatible
physics backend.
**Rerun: large environment performance**
@@ -1105,9 +1036,9 @@ The Rerun web viewer may slow down or crash with many environments. Reduce load
Rerun may show a blank browser tab for up to about 10 seconds while it connects
and receives scene data. Wait for the first frame; no action is needed.
-**Newton GL: CUDA/OpenGL interoperability warnings**
+**Newton: CUDA/OpenGL interoperability warnings**
-In some configurations, the Newton GL visualizer emits warnings about CUDA/OpenGL
+In some configurations, the Newton visualizer emits warnings about CUDA/OpenGL
interoperability:
.. code-block:: text
@@ -1119,12 +1050,12 @@ interoperability:
The visualizer still functions correctly but falls back to CPU copy operations, which reduces
performance.
-**Newton GL: OpenGL context failures**
+**Newton: OpenGL context failures**
If pyglet reports that ``glCreateShader`` is not exported or that OpenGL 2.0 is required, the
process is running without a GPU-backed display context (for example, in a service session or
a remote desktop without GPU acceleration). Run from a GPU-backed interactive display session,
-or omit ``--viz newton_gl`` for headless execution.
+or omit ``--viz newton`` for headless execution.
.. raw:: html
diff --git a/docs/source/developer-tools/template_generator.rst b/docs/source/developer-tools/template_generator.rst
index 73c2b6f46a16..b92732ea9fe4 100644
--- a/docs/source/developer-tools/template_generator.rst
+++ b/docs/source/developer-tools/template_generator.rst
@@ -246,7 +246,7 @@ Copy the task name from the output, then run a quick smoke test:
.. code-block:: bash
- uv run isaaclab random_agent --task --num_envs 16 --viz newton_gl
+ uv run isaaclab random_agent --task --num_envs 16 --viz newton
If the environment launches and the cart moves, the project is ready to edit.
You can then train and play a policy with the same command surface used by
@@ -255,7 +255,7 @@ Isaac Lab itself:
.. code-block:: bash
uv run isaaclab train --rl_library rsl_rl --task
- uv run isaaclab play --rl_library rsl_rl --task --checkpoint latest --viz newton_gl
+ uv run isaaclab play --rl_library rsl_rl --task --checkpoint latest --viz newton
Choose optional features and a simulation backend
-------------------------------------------------
diff --git a/docs/source/features/isaac_teleop.rst b/docs/source/features/isaac_teleop.rst
index 9299547c0ac8..a41057ba5425 100644
--- a/docs/source/features/isaac_teleop.rst
+++ b/docs/source/features/isaac_teleop.rst
@@ -797,8 +797,8 @@ For direct use of :func:`~isaaclab_teleop.create_isaac_teleop_device` or
window input explicitly. The session keeps this live sequence so later windows can join;
omitting it creates a session without window input. ``teleop_se3_agent.py`` and
``record_demos.py`` start Kit only when ``--xr`` or the task needs it, so
-``--viz newton_rtx`` works with a Newton-physics task, e.g.
-``--task Isaac-Reach-Franka --viz newton_rtx physics=newton_mjwarp presets=diffik``.
+``--viz newton`` works with a Newton-physics task, e.g.
+``--task Isaac-Reach-Franka --viz newton physics=newton_mjwarp presets=diffik``.
.. list-table::
:header-rows: 1
@@ -808,7 +808,7 @@ omitting it creates a session without window input. ``teleop_se3_agent.py`` and
- Keyboard input
* - ``--viz kit``
- Keys typed into the Kit window, including keys typed into Kit's own UI (e.g. a text field).
- * - ``--viz newton_gl`` / ``--viz newton_rtx``
+ * - ``--viz newton``
- Keys typed into the Newton viewer window, except keys typed into its UI. While a keyboard
pipeline runs, the viewer's WASD/QE and arrow-key camera movement is turned off; the mouse
still moves the camera.
diff --git a/docs/source/how-to/create_visualization_markers.rst b/docs/source/how-to/create_visualization_markers.rst
index 50193ede4796..db62a9731978 100644
--- a/docs/source/how-to/create_visualization_markers.rst
+++ b/docs/source/how-to/create_visualization_markers.rst
@@ -14,7 +14,7 @@ display-only: they carry no physics and do not affect the simulation.
For plain points, lines, and splines, Isaac Sim's own :mod:`isaacsim.util.debug_draw` extension
is lighter-weight. Use ``VisualizationMarkers`` when you need more complex shapes.
-Markers are supported on Kit, Newton GL, Rerun, and Viser, but not yet on Newton RTX. See
+Markers are supported on Kit, Newton (OpenGL and RTX), Rerun, and Viser. See
:doc:`/source/concepts/visualization` for how to enable them on a given visualizer.
diff --git a/docs/source/how-to/import_new_asset.rst b/docs/source/how-to/import_new_asset.rst
index 5a50b3e21034..f7fb7b6eee6b 100644
--- a/docs/source/how-to/import_new_asset.rst
+++ b/docs/source/how-to/import_new_asset.rst
@@ -32,7 +32,7 @@ Standalone URDF/MJCF importers
The URDF and MJCF converter scripts run without Isaac Sim. The standalone
importers are optional; install them with the ``isaaclab[importers]`` command in
:ref:`installation-importers-extra` before running these scripts.
-Optionally pass ``--viz newton_gl`` (or ``viser``) to preview the converted asset in a
+Optionally pass ``--viz newton`` (or ``viser``) to preview the converted asset in a
kit-less Isaac Lab visualizer:
.. code-block:: bash
@@ -258,7 +258,7 @@ is derived automatically from the robot name in the URDF):
.. _import-new-asset-preview:
The examples pass ``--viz kit`` to open the converted asset in the Isaac Sim viewport, which
-requires a full Isaac Sim installation. Use ``--viz newton_gl`` or ``--viz viser``
+requires a full Isaac Sim installation. Use ``--viz newton`` or ``--viz viser``
for a kit-less preview instead. Omit ``--viz`` to exit as soon as the conversion completes.
Inspect the converted geometry and articulation in the viewer, then validate dynamics in the
diff --git a/docs/source/how-to/mpm_tutorials.rst b/docs/source/how-to/mpm_tutorials.rst
index 7cf96b854eaa..cc3f7e2ec19d 100644
--- a/docs/source/how-to/mpm_tutorials.rst
+++ b/docs/source/how-to/mpm_tutorials.rst
@@ -30,8 +30,8 @@ Running the tutorials
---------------------
The material and rigid-body tutorials launch Kit by default, requiring the
-``isaacsim`` extra. The surface-reconstruction tutorial launches Newton GL by
-default. Use ``--viz`` to select another visualizer; Newton RTX also requires
+``isaacsim`` extra. The surface-reconstruction tutorial launches Newton by
+default. Use ``--viz`` to select another visualizer; the Newton RTX view also requires
``uv run --extra ovrtx``.
@@ -172,7 +172,7 @@ for rendering, while leaving the particle simulation unchanged.
.. code-block:: bash
uv run python scripts/tutorials/08_mpm/surface_reconstruction.py \
- --surface_preset balanced --viz newton_gl
+ --surface_preset balanced --viz newton
Run the same scene again with another ``--surface_preset``:
@@ -205,7 +205,7 @@ receive the mesh for the current particle state. See
.. note::
- This tutorial selects Newton GL or Newton RTX for surface reconstruction.
+ This tutorial selects Newton, with OpenGL or RTX rendering, for surface reconstruction.
Select ``--fluid_render_mode particles`` for Kit, Viser, or Rerun.
The shared ``ParticleSurfaceRenderer`` also supports Kit; see the teapot
example in :ref:`newton-using-mpm`.
diff --git a/docs/source/how-to/multi_asset_spawning.rst b/docs/source/how-to/multi_asset_spawning.rst
index f9f9a134bc9d..3fd7258f06b3 100644
--- a/docs/source/how-to/multi_asset_spawning.rst
+++ b/docs/source/how-to/multi_asset_spawning.rst
@@ -171,7 +171,7 @@ The physics backend and visualizer are selected independently. Run one of these
uv run --extra isaacsim isaaclab example multi-asset \
--physics newton_mjwarp --visualizer kit --num_envs 2048
- .. tab-item:: Newton MJWarp with Newton GL
+ .. tab-item:: Newton MJWarp with Newton
.. code-block:: bash
diff --git a/docs/source/how-to/policy_inference_in_usd.rst b/docs/source/how-to/policy_inference_in_usd.rst
index b3f49c51d787..3dfab6851c5f 100644
--- a/docs/source/how-to/policy_inference_in_usd.rst
+++ b/docs/source/how-to/policy_inference_in_usd.rst
@@ -40,9 +40,9 @@ when ``--device cpu`` is explicitly selected.
The height scanner starts below the warehouse roof so its downward rays measure the floor.
Keep the same physics preset for training, export, and inference. The commands below use
-Newton MJWarp with the ``newton_gl`` visualizer and do not require Isaac Sim. For a PhysX
+Newton MJWarp with the ``newton`` visualizer and do not require Isaac Sim. For a PhysX
checkpoint trained with Isaac Sim, use ``physics=isaacsim_physx`` throughout and install Isaac Sim;
-the Newton GL viewer can still be used.
+the Newton viewer can still be used.
Cross-backend policy transfer needs additional validation; see
:doc:`transfer_policies_between_physx_and_newton`.
@@ -70,7 +70,7 @@ where you started the simulation.
.. code-block:: bash
- uv run isaaclab play --rl_library rsl_rl --task Isaac-Velocity-Rough-H1 physics=newton_mjwarp --num_envs 64 --checkpoint logs/rsl_rl/h1_rough/EXPERIMENT_NAME/POLICY_FILE.pt --viz newton_gl
+ uv run isaaclab play --rl_library rsl_rl --task Isaac-Velocity-Rough-H1 physics=newton_mjwarp --num_envs 64 --checkpoint logs/rsl_rl/h1_rough/EXPERIMENT_NAME/POLICY_FILE.pt --viz newton
After running the play script, the policy will be exported to jit and onnx files under the experiment logs directory.
@@ -87,7 +87,7 @@ We can then load the warehouse asset and run inference on the H1 robot using the
.. code-block:: bash
- uv run python scripts/tutorials/03_envs/policy_inference_in_usd.py --checkpoint logs/rsl_rl/h1_rough/EXPERIMENT_NAME/exported/policy.pt physics=newton_mjwarp --viz newton_gl
+ uv run python scripts/tutorials/03_envs/policy_inference_in_usd.py --checkpoint logs/rsl_rl/h1_rough/EXPERIMENT_NAME/exported/policy.pt physics=newton_mjwarp --viz newton
.. figure:: ../_static/tutorials/tutorial_policy_inference_in_usd.jpg
diff --git a/docs/source/how-to/record_video.rst b/docs/source/how-to/record_video.rst
index edd415d5b43a..6e7b2cebb34b 100644
--- a/docs/source/how-to/record_video.rst
+++ b/docs/source/how-to/record_video.rst
@@ -160,7 +160,7 @@ Four independent clips are written to ``videos/recording_tutorial/example_3/``:
* ``kit_viewport_0000.mp4``: Kit interactive viewport (RTX renderer)
* ``tiled_kit_viewport_0000.mp4``: Kit tiled-camera grid (per-environment views)
-* ``newton_viewport_0000.mp4``: Newton GL viewer framebuffer
+* ``newton_viewport_0000.mp4``: Newton viewer framebuffer
* ``sensor_0000.mp4``: scene tiled-camera sensor (offline render)
.. raw:: html
@@ -172,7 +172,7 @@ Four independent clips are written to ``videos/recording_tutorial/example_3/``:
-
Newton GL visualizer
+
Newton visualizer
@@ -201,7 +201,7 @@ Record a short clip at regular intervals while training, without opening a windo
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --video \
--video_length 200 --video_interval 2000
-With no ``--viz``, ``--video`` records from a headless Newton GL visualizer. This writes a
+With no ``--viz``, ``--video`` records from a headless Newton visualizer. This writes a
200-step clip every 2,000 steps. The ``train`` and ``play`` entrypoints put clips in ``videos/``
under the run's log directory unless a recorder sets ``output_dir``; a script that builds its own
recorders writes to ``output_dir`` (default ``videos``). Add ``--viz kit`` to watch the run in a
@@ -231,7 +231,7 @@ recorded. Pair them with a capture-capable visualizer that runs headless next to
.. code-block:: bash
- uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz viser --video viz:newton_gl
+ uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz viser --video viz:newton
Alternatively, record directly from a scene camera with ``source="sensor:"``, which needs no
visualizer.
@@ -257,7 +257,7 @@ configure both; the recorder adds the Newton visualizer, headless:
VisualizerCfg(eye=(12.0, 0.0, 6.0), backend=NewtonGLBackendCfg()),
]
env_cfg.video_recorders = [
- VideoRecorderCfg(source="viz:newton_gl", output_dir="videos/"),
+ VideoRecorderCfg(source="viz:newton", output_dir="videos/"),
]
Alternatively, use a :class:`~isaaclab.sensors.CameraCfg` sensor in the scene and record
@@ -277,17 +277,15 @@ The ``source`` string selects what to capture:
* - Source string
- Captures from
* - ``"viz"`` (default)
- - First capture-capable visualizer ``--viz`` selected, else a headless Newton GL visualizer
+ - First capture-capable visualizer ``--viz`` selected, else a headless Newton visualizer
* - ``"viz:kit"``
- Kit visualizer viewport
* - ``"viz:kit:streaming_view"``
- Kit streaming camera panel, requires ``streaming_view=True``
- * - ``"viz:newton_gl"``
- - Newton GL visualizer viewport, in whichever renderer the window shows (OpenGL or RTX). A headless Newton GL has no RTX view
- * - ``"viz:newton_rtx"``
- - Newton OVRTX path-traced viewport
- * - ``"viz:newton_gl:streaming_view"``
- - Newton GL streaming camera panel, requires ``streaming_view=True``
+ * - ``"viz:newton"``
+ - Newton visualizer viewport, in whichever renderer the window shows (OpenGL or RTX). A headless Newton has no RTX view
+ * - ``"viz:newton:streaming_view"``
+ - Newton streaming camera panel, requires ``streaming_view=True``
* - ``"sensor:"``
- ``env.scene.sensors[name]``, RGB (default)
* - ``"sensor::rgb"``
@@ -304,13 +302,13 @@ visualizer config, not on the recorder. A ``viz:`` visualizer that ``--viz
headless, only for the recording, with the settings of its config in ``sim.visualizer_cfgs``.
``visualizer`` is accepted as the long form of the ``viz`` prefix (``"visualizer:kit"`` is ``"viz:kit"``). The
-deprecated ``newton`` type (``"viz:newton"``) still works with a warning; use ``newton_gl``. Bare visualizer
-types are accepted here too, e.g. ``VideoRecorderCfg(source="newton_gl")`` is equivalent to
-``VideoRecorderCfg(source="viz:newton_gl")``.
+``newton_gl`` type (``"viz:newton_gl"``) is still accepted as an alias for ``newton``. Bare visualizer
+types are accepted here too, e.g. ``VideoRecorderCfg(source="newton")`` is equivalent to
+``VideoRecorderCfg(source="viz:newton")``.
.. note::
- The Newton RTX viewer framebuffer can be recorded with ``"viz:newton_rtx"``, but
+ The Newton viewport can be recorded with ``"viz:newton"`` while it renders with RTX, but
recording its streaming view is not supported.
@@ -366,7 +364,7 @@ Clip control
Limitations
-----------
-* ``source="viz:newton_gl:streaming_view"`` and ``source="viz:kit:streaming_view"``
+* ``source="viz:newton:streaming_view"`` and ``source="viz:kit:streaming_view"``
require ``streaming_view=True`` on the corresponding visualizer cfg. A
:class:`~RuntimeError` is raised when the recorder is constructed if it is not set.
@@ -383,22 +381,18 @@ Limitations
* - ``kit``
- ✓
- Launches Isaac Sim; the launch enables camera rendering for the recording.
- * - ``newton_gl``
+ * - ``newton``
- ✓
- Uses pyglet's EGL backend when headless; the default for ``--video`` without a
capture-capable ``--viz``.
- * - ``newton_rtx``
- - ✓
- - Starts the OVRTX runtime; capture performs a GPU-to-CPU readback of the path-traced
- framebuffer.
* - ``rerun``
- ✗
- Remote streaming tool; no local frame-capture API. ``viz:rerun`` is an error;
- ``--video --viz rerun`` records from a headless ``newton_gl``.
+ ``--video --viz rerun`` records from a headless ``newton``.
* - ``viser``
- ✗
- Browser streaming tool; no local frame-capture API. ``viz:viser`` is an error;
- ``--video --viz viser`` records from a headless ``newton_gl``.
+ ``--video --viz viser`` records from a headless ``newton``.
To record video while streaming with Rerun or Viser, see `Recording while streaming with Viser or
Rerun`_.
diff --git a/docs/source/how-to/run_rl_training.rst b/docs/source/how-to/run_rl_training.rst
index 9dc2a8a171ec..d16f09470648 100644
--- a/docs/source/how-to/run_rl_training.rst
+++ b/docs/source/how-to/run_rl_training.rst
@@ -86,7 +86,7 @@ Headless execution with off-screen render
"""""""""""""""""""""""""""""""""""""""""
To inspect behavior from a training run without an interactive window, pass ``--video``.
-By default, it records the scene from a headless Newton GL visualizer. See
+By default, it records the scene from a headless Newton visualizer. See
:doc:`/source/how-to/record_video` to choose a different visualizer or a camera-sensor output.
.. tab-set::
diff --git a/docs/source/how-to/run_state_machines.rst b/docs/source/how-to/run_state_machines.rst
index 50ab0056d32b..e7540f2f2a39 100644
--- a/docs/source/how-to/run_state_machines.rst
+++ b/docs/source/how-to/run_state_machines.rst
@@ -29,12 +29,12 @@ Lift a deformable object
------------------------
This example uses the Newton backend to grasp and lift a soft object. Pass
-``--viz newton_gl`` to open the Newton visualizer:
+``--viz newton`` to open the Newton visualizer:
.. code-block:: bash
uv run --extra tetrahedralization python scripts/environments/state_machine/lift_franka_soft.py \
- --num_envs 1 --viz newton_gl
+ --num_envs 1 --viz newton
Open a cabinet drawer
---------------------
diff --git a/docs/source/how-to/solver_tuning_kamino.rst b/docs/source/how-to/solver_tuning_kamino.rst
index 7e0e616fe3af..ba013a8db554 100644
--- a/docs/source/how-to/solver_tuning_kamino.rst
+++ b/docs/source/how-to/solver_tuning_kamino.rst
@@ -35,7 +35,7 @@ Run one small visual smoke test before training or benchmarking:
.. code-block:: bash
- uv run python scripts/environments/zero_agent.py --task Isaac-Cartpole-Direct --num_envs 4 --viz newton_gl physics=newton_kamino
+ uv run python scripts/environments/zero_agent.py --task Isaac-Cartpole-Direct --num_envs 4 --viz newton physics=newton_kamino
Then fix the initial state, seed, action sequence, and reset distribution. For
that reproduction, record penetration, slip, energy, a task metric, a
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index daba74128391..5a7983815efe 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -32,7 +32,7 @@ controls presentation independently through ``VisualizerCfg.window``. ``Visualiz
)
env_cfg.video_recorders = [VideoRecorderCfg(source=view, output_dir="videos")]
-Use ``--viz newton_gl`` (or ``--viz newton_rtx`` for the RTX example) to display the window.
+Use ``--viz newton`` to display the window.
Omit ``--viz`` for recording alone. The scene must declare ``front_camera`` with both requested outputs.
The view preserves environment order and native tile dimensions, placing channels beside each other.
``channels`` selects existing outputs; ``depth_range`` only maps depth values to display colors.
@@ -50,7 +50,7 @@ selection. Reading the shared view twice in one physics step reuses its frame an
Changing the view's selection rebuilds composition state; captured composition graphs must then be
recreated. This does not resize the sensor's render product.
-For Newton RTX, a perspective declaration is expanded into an ordinary scene camera before launch:
+A perspective declaration is displayed by the Newton window's own free camera:
.. code-block:: python
@@ -62,15 +62,15 @@ For Newton RTX, a perspective declaration is expanded into an ordinary scene cam
)
env_cfg.video_recorders = [VideoRecorderCfg(source=view)]
-Select ``visualizer=newton_rtx`` or ``visualizer=newton_gl`` at the task entry point.
-Newton RTX fixes perspective render resolution at the initial ``WindowCfg.size``; resizing the window
-scales its image. Newton GL perspective rendering follows its window framebuffer dimensions.
+Select ``visualizer=newton`` at the task entry point. With OpenGL rendering, perspective images follow the window
+framebuffer dimensions. With RTX rendering, they keep the initial ``WindowCfg.size`` and resizing the window
+scales the image.
The recorder reads the completed native render without requesting a second render for that step.
Perspective views currently provide one RGB image, so keep ``envs=(0,)`` and ``channels=("rgb",)``.
A recorded perspective view requires exactly one configured rendering visualizer. In headless runs,
the launcher retains that producer without opening a window; recording a sensor view needs no visualizer.
-``VisualizerCfg.view`` is supported by Newton GL and RTX. Existing ``cameras`` and
+``VisualizerCfg.view`` is supported by the Newton visualizer. Existing ``cameras`` and
``streaming_*`` configurations and CLI recording source strings remain supported; they are translated
at initialization. Use ``view`` instead of combining it with legacy camera selection fields.
@@ -122,11 +122,11 @@ Choose and control displayed views
the Viewport tabs; it can also be placed side by side with the default interactive viewport
for dual monitoring.
-**Newton GL and Newton RTX** have a **Camera Source** selector in the sidebar. Selecting a scene camera displays
+The **Newton** visualizer has a **Camera Source** selector in the sidebar. Selecting a scene camera displays
its tiled output in the main viewport instead of rendering a perspective view behind it.
-Selecting a perspective camera restores interactive scene rendering. Newton GL also restores picking.
+Selecting a perspective camera restores interactive scene rendering and picking.
-Without an explicit ``cameras`` list, Newton GL starts in perspective and offers scene cameras
+Without an explicit ``cameras`` list, Newton starts in perspective and offers scene cameras
that provide every requested ``streaming_gt_types`` channel. An explicit
``streaming_sensor_prim_path`` starts with that scene camera selected. For example, set
``streaming_gt_types=("depth",)`` to offer depth-only cameras. The RGB view accepts RGB or RGBA
@@ -134,8 +134,10 @@ outputs; the display uses opaque alpha. No images are captured to
build the selector. Explicitly configured scene-camera choices must support the requested channels;
incompatible choices raise a configuration error during initialization, including inactive choices.
-Newton RTX displays only the sources declared in ``view`` or ``cameras``. With neither set, launch
-preparation declares one perspective camera. Scene sensors are never added to its selector automatically.
+A **Renderer** selector switches the main perspective view between OpenGL and RTX when the scene has the OVRTX
+viewer camera, which launch declares when ``ovrtx`` is installed and the physics is not PhysX. Set
+``NewtonGLBackendCfg.initial_renderer="rtx"`` to start in RTX. The RTX view follows the OpenGL camera pose and
+renders only while selected.
Use ``cameras`` to declare a list of selectable views; the first starts active:
@@ -156,23 +158,20 @@ Use ``cameras`` to declare a list of selectable views; the first starts active:
)
The ``cameras`` field is shared across visualizers. Kit, Rerun, and Viser use the first scene
-camera for their image panel; Newton GL and RTX provide the source dropdown shown above.
+camera for their image panel; Newton provides the source dropdown shown above.
``SceneCameraCfg`` selects an existing sensor; ``PerspectiveCameraCfg`` configures the viewer's
-interactive camera. For Newton RTX, ``launch_simulation(env_cfg, ...)`` adds a ``CameraCfg``
-to the scene before any scene objects are constructed and selects it through ``SceneCameraCfg``.
-Newton GL retains its native perspective camera. Newton RTX keeps its perspective
-render resolution fixed at the initial ``WindowCfg.size``; resizing
-its window scales the displayed image. Sensor resolution remains controlled by ``CameraCfg``.
-Window resizing does not reallocate sensor or RTX perspective image buffers. Newton GL perspective
-images follow its framebuffer dimensions.
+interactive camera. Newton retains its native perspective camera, and ``launch_simulation(env_cfg, ...)``
+adds the OVRTX viewer ``CameraCfg`` to the scene before any scene objects are constructed. The RTX view keeps
+its render resolution fixed at the initial ``WindowCfg.size``; resizing its window scales the displayed image.
+Sensor resolution remains controlled by ``CameraCfg``. Window resizing does not reallocate sensor or RTX
+perspective image buffers. OpenGL perspective images follow the framebuffer dimensions.
Newton windows present at up to ``WindowCfg.fps`` (30 by default), measured in wall-clock time.
Changing the simulation timestep does not change that limit. Headless on-demand capture is
independent of the window update rate; Kit uses its application's update cadence.
-Newton RTX displays ordinary camera output in a Newton GL window. Equal ``OVRTXRendererCfg``
-configurations share one renderer and its scene. ``NewtonRTXBackendCfg.renderer_cfg`` selects
-the renderer for generated perspective cameras; explicitly selected scene cameras retain their
-own renderer. Newton's ``ViewerRTX`` and its borrowed-stage interface are not used.
+The Newton window displays ordinary camera output, including RTX. Equal ``OVRTXRendererCfg``
+configurations share one renderer and its scene. ``NewtonGLBackendCfg.rtx_renderer_cfg`` selects
+the renderer of the viewer camera; explicitly selected scene cameras retain their own renderer. Newton's ``ViewerRTX`` and its borrowed-stage interface are not used.
``isaaclab_ov.stage.OvstageBackend`` remains available for downstream consumers that need an
independent native stage. Its ``populate(usda)`` method imports an exported USD scene and applies
the prepared clone operations.
@@ -195,7 +194,7 @@ spawning assets and cameras, including for a single environment:
from isaaclab.utils import instantiate
from isaaclab.visualizers import SceneCameraCfg, VisualizerCfg
from isaaclab_ov.renderers import OVRTXRendererCfg
- from isaaclab_visualizers.newton import NewtonRTXBackendCfg
+ from isaaclab_visualizers.newton import NewtonGLBackendCfg
camera_cfg = CameraCfg(
prim_path="/World/PerspectiveCamera", width=960, height=540,
@@ -206,13 +205,13 @@ spawning assets and cameras, including for a single environment:
sim_cfg = SimulationCfg(
visualizer_cfgs=[
VisualizerCfg(
- backend=NewtonRTXBackendCfg(), cameras=[SceneCameraCfg(prim_path=camera_cfg.prim_path)]
+ cameras=[SceneCameraCfg(prim_path=camera_cfg.prim_path)], backend=NewtonGLBackendCfg()
)
]
)
target_cfg = AssetBaseCfg(prim_path="/World/Target", spawn=CuboidCfg(size=(1.0, 1.0, 1.0)))
light_cfg = AssetBaseCfg(prim_path="/World/Light", spawn=DomeLightCfg(intensity=1000.0))
- with launch_simulation(sim_cfg, {"physics": "ovphysx", "visualizer": ["newton_rtx"]}):
+ with launch_simulation(sim_cfg, {"physics": "ovphysx", "visualizer": ["newton"]}):
sim = SimulationContext(sim_cfg)
with ReplicateSession((target_cfg, light_cfg, camera_cfg), num_clones=1, env_spacing=0.0):
instantiate(target_cfg)
@@ -227,8 +226,7 @@ The script retains the camera and advances its sensor timing, just as it does fo
spawned sensors. ``SceneCameraCfg`` discovers it by prim path without an ``InteractiveScene``.
Display layout and channel mappings are compiled when the source, selection, resolution, or
-color settings change. Composition writes into reusable device RGBA storage. Newton GL, Newton
-RTX, and Kit present CUDA images without downloading pixels. Recording through
+color settings change. Composition writes into reusable device RGBA storage. Newton and Kit present CUDA images without downloading pixels. Recording through
``render_tiled_rgb_array()`` and the Rerun/Viser transports explicitly read back the composed
image. The GPU API, ``render_tiled_rgba_array()``, returns borrowed storage that is reused on the next
composition; consumers must copy it if they need to retain a frame.
@@ -306,7 +304,7 @@ Example 2: Streaming from Robot-Mounted Cameras
.. code-block:: bash
uv run --extra teleop python scripts/tutorials/07_visualizers/run_tiled_camera_visualizer.py \
- --task IsaacContrib-Stack-Cube-Galbot-Left-Arm-Gripper-Visuomotor --num_envs 25 --viz newton_gl
+ --task IsaacContrib-Stack-Cube-Galbot-Left-Arm-Gripper-Visuomotor --num_envs 25 --viz newton
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
@@ -314,7 +312,7 @@ Example 2: Streaming from Robot-Mounted Cameras
.. code-block:: batch
uv run --extra teleop python scripts/tutorials/07_visualizers/run_tiled_camera_visualizer.py ^
- --task IsaacContrib-Stack-Cube-Galbot-Left-Arm-Gripper-Visuomotor --num_envs 25 --viz newton_gl
+ --task IsaacContrib-Stack-Cube-Galbot-Left-Arm-Gripper-Visuomotor --num_envs 25 --viz newton
The Galbot cube-stacking environment ships with wrist-mounted cameras giving an egocentric
view of the gripper, table, and cubes. The script streams from the scene's first ``CameraCfg``,
@@ -341,10 +339,10 @@ Declare camera resolution, pose, renderer, and output types on ``CameraCfg`` in
Then choose what to display in ``VisualizerCfg``:
* ``cameras=[SceneCameraCfg(prim_path=...)]`` selects a scene camera; ``view=ImageViewCfg(source="name")``
- selects a named sensor and its image layout. Newton RTX uses these explicit declarations.
+ selects a named sensor and its image layout.
* For other viewers, ``streaming_sensor_prim_path`` selects a scene :class:`~isaaclab.sensors.Camera` by its configured
prim path. The ``{ENV_REGEX_NS}`` macro uses the scene's environment template.
- If omitted, Newton GL starts in perspective mode and offers compatible scene cameras
+ If omitted, Newton starts in perspective mode and offers compatible scene cameras
in the Camera Source dropdown. Kit and web viewers select the first compatible scene camera;
without one, their panel stays empty.
* ``streaming_envs`` controls how many environment tiles are shown. Pass an ``int`` to randomly
@@ -363,7 +361,7 @@ Display sources
``VisualizerCfg.cameras`` accepts ``PerspectiveCameraCfg`` for the interactive view and
``SceneCameraCfg(prim_path=...)`` for a camera sensor already declared in the scene.
-Newton GL and RTX provide a source dropdown; Kit, Rerun, and Viser use the first scene source
+Newton provides a source dropdown; Kit, Rerun, and Viser use the first scene source
in their camera panel. Every explicit scene source must provide the requested
``streaming_gt_types`` channels.
@@ -371,8 +369,8 @@ in their camera panel. Every explicit scene source must provide the requested
Troubleshooting
---------------
-``--video viz:newton_gl:streaming_view`` records the selected scene-camera tiles, not a network
-stream. Without ``--viz``, capture runs on demand without opening a window. Adding ``--viz newton_gl``
+``--video viz:newton:streaming_view`` records the selected scene-camera tiles, not a network
+stream. Without ``--viz``, capture runs on demand without opening a window. Adding ``--viz newton``
displays the visualizer; it is not required to advance recorded frames. A new physics step refreshes
the image, while repeated captures within the same step reuse it.
diff --git a/docs/source/isaaclab/demos.rst b/docs/source/isaaclab/demos.rst
index cc3a864b4f20..cea82bbf7fcc 100644
--- a/docs/source/isaaclab/demos.rst
+++ b/docs/source/isaaclab/demos.rst
@@ -46,9 +46,9 @@ No source checkout is required.
Zoo
@@ -56,7 +56,7 @@ No source checkout is required.
@@ -65,9 +65,9 @@ No source checkout is required.
H1 Locomotion
@@ -75,9 +75,9 @@ No source checkout is required.
SONIC
@@ -85,7 +85,8 @@ No source checkout is required.
NIST
@@ -100,7 +101,7 @@ No source checkout is required.
Newton Block and Tackle
@@ -108,7 +109,7 @@ No source checkout is required.
@@ -117,7 +118,7 @@ No source checkout is required.
@@ -126,7 +127,7 @@ No source checkout is required.
H1 locomotion
H1 locomotion uses a published policy. For autonomous H1 task playback, use isaaclab play.
-
In the Newton viewer, press N to select a robot,
+
In the Newton viewer, press N to select a robot,
I/J/L to walk forward or turn, K to stop, and C to toggle the follow camera.
@@ -74,7 +74,7 @@ the end effector in Manual mode.
-
Newton RTX
+
Newton (RTX)
@@ -105,7 +105,7 @@ the end effector in Manual mode.
});
-
Note: Newton RTX has no velocity arrows, since it doesn't yet support visualization markers.
+
Note: the Newton (RTX) clip was recorded without visualization markers, so it shows no velocity arrows.
Quick Start
@@ -120,8 +120,8 @@ alias.
.. code-block:: bash
- # Newton GL: lightweight OpenGL viewport
- uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz newton_gl
+ # Newton: lightweight OpenGL viewport, switchable to RTX rendering
+ uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz newton
# Viser: browser-based viewer
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz viser
@@ -130,7 +130,7 @@ alias.
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 viser,newton_rtx
+ uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz viser,newton
.. note::
@@ -148,8 +148,8 @@ For combining visualizers, running headless, and other common use cases, see `Us
Visualizer presets
~~~~~~~~~~~~~~~~~~
-Task commands accept ``visualizer=newton_gl``, ``visualizer=kit``, or
-``visualizer=viser,newton_gl``. ``--viz`` and ``--visualizer`` are aliases for the same
+Task commands accept ``visualizer=newton``, ``visualizer=kit``, or
+``visualizer=viser,newton``. ``--viz`` and ``--visualizer`` are aliases for the same
selection. ``visualizer=none`` disables viewers. Selection happens during configuration
composition, before choosing process runtimes or creating the scene.
@@ -191,13 +191,13 @@ Compose standalone declarations during initial configuration, then call the core
...
One ``VisualizerCfg`` supplies the common settings for every selected backend. Selecting
-``viser,newton_gl`` creates both viewers; no outer list or repeated common settings is needed.
+``viser,newton`` creates both viewers; no outer list or repeated common settings is needed.
Backend-specific options are available when needed, but ordinary configuration uses the unchanged
``MultiBackendVisualizerCfg()`` declaration.
Use a list of ``VisualizerCfg`` declarations for different views or window sizes. Backend selection
applies to each declaration independently. For example, a task with these two views opens four
-windows with ``--viz=newton_gl,newton_rtx``: one GL and one RTX window per view.
+windows with ``--viz=newton,viser``: one Newton and one Viser window per view.
.. code-block:: python
@@ -217,13 +217,13 @@ Task entry points perform this selection through ``resolve_task_config``:
.. code-block:: bash
- uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole visualizer=viser,newton_gl
+ uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole visualizer=viser,newton
-``--viz viser,newton_gl`` is equivalent. Task composition selects the backends inside
+``--viz viser,newton`` is equivalent. Task composition selects the backends inside
``VisualizerCfg.backend`` before launch; launch creates each viewer with the shared settings.
Viewer implementations are imported only when constructed.
-For ``--video`` without a selected capture-capable viewer, launch selects a headless Newton GL
+For ``--video`` without a selected capture-capable viewer, launch selects a headless Newton
producer. ``visualizer=none`` disables windows; recording still runs its producer on demand.
Use ``--video sensor:`` to record a scene camera without a visualizer producer.
@@ -238,12 +238,10 @@ Visualizer Overview
* - Visualizer
- Description
- * - **Newton GL**
- - Lightweight, strong feature support; Recommended
+ * - **Newton**
+ - Lightweight, strong feature support, OpenGL or RTX rendering; Recommended
* - **Viser**
- Web-based, supports recording and replay; Recommended
- * - **Newton RTX**
- - High-quality RTX rendering; experimental, missing some features
* - **Rerun**
- Deprecated in Isaac Lab 3.2 and removed in 3.3; use Viser instead
* - **Kit**
@@ -251,16 +249,17 @@ Visualizer Overview
.. tab-set::
- .. tab-item:: Newton GL
+ .. tab-item:: Newton
- The Newton GL visualizer is a lightweight OpenGL window with minimal startup overhead.
+ The Newton visualizer is a lightweight OpenGL window with minimal startup overhead. Its **Renderer**
+ selector switches the view to RTX (see below). ``newton_gl`` is an accepted alias of ``newton``.
.. raw:: html
-
Isaac-Reorient-Cube-Allegro in Newton GL Visualizer Each Allegro hand reorients
+
Isaac-Reorient-Cube-Allegro in Newton Visualizer Each Allegro hand reorients
its cube to match the target shown by the marker above it
.. raw:: html
@@ -296,7 +295,8 @@ Visualizer Overview
The **Renderer** selector in the Rendering Options section switches the main view to the OVRTX path tracer for
photorealistic rendering without a Kit process. It appears when the scene has the OVRTX viewer camera, which launch
- declares when ``ovrtx`` is installed and the physics is not Kit-based PhysX. RTX rendering is slightly slower than OpenGL.
+ declares when ``ovrtx`` is installed and the physics is not Kit-based PhysX. Set
+ ``NewtonGLBackendCfg(initial_renderer="rtx")`` to start in RTX. RTX rendering is slightly slower than OpenGL.
.. raw:: html
@@ -307,15 +307,16 @@ Visualizer Overview
staircase sub-terrain
Picking, visualization markers, camera selection, pause controls, Visible Envs, and recording work in
- the RTX view of a windowed Newton GL visualizer, and picking draws the drag arrow there. Joint, contact, spring, center-of-mass, and inertia overlays are drawn in the RTX view too; the collision,
- visual, edge, and wireframe overlays apply to the OpenGL view only.
+ the RTX view of a windowed Newton visualizer, and picking draws the drag arrow there. Joint, contact, spring,
+ center-of-mass, and inertia overlays are drawn in the RTX view too; the collision, visual, edge, and wireframe
+ overlays apply to the OpenGL view only.
.. warning::
OVRTX is a kitless renderer and cannot be used in the same process as Kit
(``presets=isaacsim_physx``). ``presets=ovphysx`` is itself kitless and works fine with
RTX rendering. Use ``presets=newton_mjwarp`` or ``presets=ovphysx`` with
- ``--viz newton_gl``, or switch to ``--viz viser``, ``--viz rerun``,
+ ``--viz newton``, or switch to ``--viz viser``, ``--viz rerun``,
or ``--viz kit`` with a Kit-compatible physics backend.
.. dropdown:: NewtonGLBackendCfg source
@@ -397,59 +398,6 @@ Visualizer Overview
:language: python
:pyobject: VisualizerCfg
- .. tab-item:: Newton RTX
-
- The **experimental** Newton RTX visualizer, launched with ``--viz newton_rtx``, uses the
- OVRTX path-tracer for photorealistic rendering without a Kit process. It is slightly
- slower than the Newton GL visualizer due to the cost of high-quality RTX rendering.
-
- .. raw:: html
-
-
-
-
-
Isaac-Velocity-Rough-H1 in Newton RTX Visualizer Each H1 humanoid climbs a
- staircase sub-terrain
-
- **Visualizer-specific features:**
-
- - OVRTX path-traced rendering for photorealistic, physically-based lighting
-
- .. note::
-
- The following features are not yet supported and will be added in a future release:
- live plots and rigid-body dragging. Visualization markers, camera selection, scene-camera
- display, pause controls, and headless recording are supported.
-
- .. dropdown:: NewtonRTXBackendCfg source
- :icon: code
-
- .. literalinclude:: ../../../source/isaaclab_visualizers/isaaclab_visualizers/newton/newton_visualizer_cfg.py
- :language: python
- :pyobject: NewtonRTXBackendCfg
-
- .. dropdown:: Shared window options
- :icon: code
-
- .. literalinclude:: ../../../source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
- :language: python
- :pyobject: WindowCfg
-
- .. dropdown:: VisualizerCfg source (shared settings)
- :icon: code
-
- .. literalinclude:: ../../../source/isaaclab/isaaclab/visualizers/visualizer_cfg.py
- :language: python
- :pyobject: VisualizerCfg
-
- .. warning::
-
- Newton RTX (OVRTX) is a kitless renderer and cannot be used in the same process as Kit
- (``presets=isaacsim_physx``). ``presets=ovphysx`` is itself kitless and works fine with
- Newton RTX. Use ``presets=newton_mjwarp,ovrtx`` or ``presets=ovphysx,ovrtx`` with
- ``--viz newton_rtx``, or switch to ``--viz newton_gl``, ``--viz viser``,
- or ``--viz kit`` with a Kit-compatible physics backend.
-
.. tab-item:: Rerun
.. deprecated:: 3.2.0
@@ -594,10 +542,10 @@ Multiple visualizers can display the same sensor with different tile selections.
Attach a camera to a robot body to follow its motion, or select an existing view such as the Galbot
-task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton GL, Newton RTX,
+task's wrist-mounted and ego cameras. The view is supported in the Kit, Newton,
Rerun, and Viser visualizers. **Kit** opens it as a separate **Streaming View** viewport, which can
-sit side by side with the default viewport for dual monitoring. **Newton GL** and **Newton RTX**
-provide a **Camera Source** selector in the sidebar for switching between perspective and scene-camera
+sit side by side with the default viewport for dual monitoring. **Newton**
+provides a **Camera Source** selector in the sidebar for switching between perspective and scene-camera
views.
Selecting a scene sensor in **Camera Source** shows its channel: the **Channel** selector lists the
sensor's outputs (RGB, depth, normals, or segmentation), and depth, normals, and segmentation are
@@ -640,7 +588,7 @@ There are 2 types of visualization markers:
- Goal shapes: cuboid, sphere, and multi-state position-goal markers
- Center of mass markers
-In the Newton GL visualizer's HUD, built-in marker types that aren't currently active are
+In the Newton visualizer's HUD, built-in marker types that aren't currently active are
shown greyed out.
**Custom Markers:**
@@ -653,7 +601,7 @@ shown greyed out.
.. note::
- Visualization markers are supported on Kit, Newton GL, Newton RTX, Rerun, and Viser.
+ Visualization markers are supported on Kit, Newton (OpenGL and RTX), Rerun, and Viser.
Live Plots
@@ -668,7 +616,7 @@ Live plots stream per-step scalar data into the visualizer.
-
Newton GL visualizer, with 3 plots opened
+
Newton visualizer, with 3 plots opened
@@ -679,8 +627,7 @@ Live plots stream per-step scalar data into the visualizer.
Live Plot windows start hidden or collapsed, except for Rerun, where the Live Plots can be
-collapsed by selecting the "eye" icon. Supported on Kit, Newton GL, Rerun, and Viser; not
-yet supported on Newton RTX (experimental).
+collapsed by selecting the "eye" icon. Supported on Kit, Newton, Rerun, and Viser.
**What's plotted:** per-episode total reward and episode length, plus any active manager
term for manager-based environments (e.g. ``joint_pos``).
@@ -722,20 +669,16 @@ visualizers open a window; a visualizer that only records runs headless:
- Records from
* - ``--video`` (same as ``--video viz``)
- the first capture-capable visualizer ``--viz`` selected, in its window; if none is selected, or only
- streaming ones such as ``viser`` or ``rerun``, a headless ``newton_gl``
- * - ``--video viz:newton_rtx``
- - a ``newton_rtx``: the ``--viz``-selected one if selected, else an extra headless one
- * - ``--video --viz newton_rtx``
- - the selected ``newton_rtx`` window
- * - ``--video viz:newton_gl --viz viser``
- - ``viser`` runs; an extra headless ``newton_gl`` is added only for recording
+ streaming ones such as ``viser`` or ``rerun``, a headless ``newton``
+ * - ``--video viz:newton --viz viser``
+ - ``viser`` runs; an extra headless ``newton`` is added only for recording
* - ``--video sensor:wrist_camera[:rgb|depth|...]``
- that scene sensor; no visualizer is added
A Hydra override after ``--video`` is never taken as its source: ``--video presets=newton_mjwarp``
records from ``viz`` and applies the preset.
-Kit, Newton GL, and Newton RTX visualizers can be recorded from; the web-based visualizers Viser and
+The Kit and Newton visualizers can be recorded from; the web-based visualizers Viser and
Rerun cannot.
See :doc:`/source/how-to/record_video` for the full guide and tutorial.
@@ -750,8 +693,7 @@ the keyboard. Each key press and release arrives as a W3C ``KeyboardEvent.code``
- :class:`~isaaclab_visualizers.kit.KitVisualizer` reports physical key positions, independent of
the keyboard layout. Keys typed into Kit's own UI, such as a text field, are reported too.
-- :class:`~isaaclab_visualizers.newton.NewtonGLVisualizer` and
- :class:`~isaaclab_visualizers.newton.NewtonRTXVisualizer` report layout-mapped keys: a code names
+- :class:`~isaaclab_visualizers.newton.NewtonGLVisualizer` reports layout-mapped keys: a code names
the key that types the same character on a US layout. Presses typed into the window's UI are
withheld. Presses and releases pair up reliably on a US layout; on other layouts, changing Shift
while holding a digit or punctuation key can leave it held until the window loses focus.
@@ -808,7 +750,7 @@ Common Recipes
**Headless training with video recording**
-Run without a window and record clips from a headless Newton GL visualizer, or name another
+Run without a window and record clips from a headless Newton visualizer, or name another
capture source, e.g. ``--video viz:kit``:
.. tab-set::
@@ -825,8 +767,8 @@ See :doc:`/source/how-to/record_video` for clip length, interval, and multi-sour
**Combining an interactive view with a headless recording source**
-Watch training live in Kit while recording from a separate headless Newton GL angle by running with
-``--viz kit --video viz:newton_gl`` and giving each visualizer its own camera. See
+Watch training live in Kit while recording from a separate headless Newton angle by running with
+``--viz kit --video viz:newton`` and giving each visualizer its own camera. See
:ref:`Recording from an independent camera angle ` for the configuration.
**Following a moving robot (Kit)**
@@ -877,7 +819,7 @@ the HUD notes this next to the slider.
Resolution Rules
~~~~~~~~~~~~~~~~
-``--viz`` (comma-separated, e.g. ``--viz kit,newton_gl``) selects which visualizers run, and
+``--viz`` (comma-separated, e.g. ``--viz kit,newton``) selects which visualizers run, and
``SimulationCfg.visualizer_cfgs`` configures them. Each selected type uses its configured settings,
or else that type's default config. Concrete visualizer configs run as given when no CLI selection
is supplied. ``SimulationCfg.visualizer_cfgs`` defaults to ``VisualizerCfg(backend=[])``;
@@ -903,18 +845,18 @@ only needed for independently configured views, such as a different camera angle
* - no ``--viz``
- ``VisualizerCfg()`` (the default)
- No visualizer launches; no window, no capture source.
- * - ``--viz kit,newton_gl``
+ * - ``--viz kit,newton``
- ``VisualizerCfg(max_visible_envs=16)``
- - Launch Kit and Newton GL, both showing at most 16 environments.
+ - Launch Kit and Newton, both showing at most 16 environments.
* - ``--video`` without ``--viz``
- ``VisualizerCfg()``
- - Launch Newton GL without a window, only as the ``--video`` recording source.
+ - Launch Newton without a window, only as the ``--video`` recording source.
* - no ``--viz``
- ``VisualizerCfg(backend=MultiBackendVisualizerCfg())``
- No visualizer launches; backend alternatives remain inactive until selected.
- * - ``visualizer=rerun,newton_gl``
+ * - ``visualizer=viser,newton``
- ``VisualizerCfg(max_visible_envs=16, backend=MultiBackendVisualizerCfg())``
- - Launch Rerun and Newton GL, both showing at most 16 environments.
+ - Launch Viser and Newton, both showing at most 16 environments.
For migration context, see :doc:`/source/isaaclab/migrating`.
@@ -945,7 +887,7 @@ Also, there is a CLI arg ``--max_visible_envs`` that overrides ``VisualizerCfg.m
Scene Background
~~~~~~~~~~~~~~~~
-Kit and Newton RTX use the scene's authored lights and HDR background by default. Configure the
+Kit and the Newton visualizer in RTX mode use the scene's authored lights and HDR background by default. Configure the
environment once on the scene, without repeating its HDR path or intensity in the visualizer:
.. code-block:: python
@@ -955,7 +897,7 @@ environment once on the scene, without repeating its HDR path or intensity in th
``VisualizerCfg.background_color`` defaults to ``None``. An explicit normalized RGB color changes
only the visible background; the scene lights continue to illuminate objects and contribute
-reflections. Newton GL uses its procedural sky when no color override is supplied:
+reflections. The Newton OpenGL view uses its procedural sky when no color override is supplied:
.. code-block:: python
@@ -977,14 +919,11 @@ Performance
* - Visualizer
- Tips
- * - Newton GL
- - Lowest overhead; lower ``window.fps`` to limit wall-clock render frequency.
+ * - Newton
+ - Lowest overhead in OpenGL; lower ``window.fps`` to limit wall-clock render frequency.
* - Viser
- Newton Warp renderer; use ``max_visible_envs`` to limit the number of rendered
environments (see :ref:`visualization-partial-visualization`).
- * - Newton RTX
- - Native Newton RTX rendering; reduce configured perspective resolution or lower ``window.fps``.
- Environment selection limits sensor display tiles; the perspective view shows the full scene.
* - Rerun
- Web viewer may slow down with many environments; use ``--num_envs`` to reduce load.
* - Kit
@@ -998,12 +937,11 @@ Limitations
**Backend feature support:**
.. list-table::
- :widths: 34 11 11 12 11 11
+ :widths: 40 15 15 15 15
:header-rows: 1
* - Feature
- - Newton GL
- - Newton RTX
+ - Newton
- Viser
- Rerun
- Kit
@@ -1012,28 +950,23 @@ Limitations
- ✓
- ✓
- ✓
- - ✓
* - Live plots
- ✓
- - ✗
- ✓
- ✓
- ✓
* - Streaming camera panel
- ✓
- - ✗
- ✓
- ✓
- ✓
* - Video recording, ``--video``
- - ✓
- ✓
- ✗
- ✗
- ✓
* - Pause rendering
- ✓
- - ✗
- ✓
- ✓
- ✓
@@ -1042,12 +975,10 @@ Limitations
- ✓
- ✓
- ✓
- - ✓
* - Keyboard input, ``key_event_source``
- ✓
- ✓
- ✗
- - ✗
- ✓
In Newton's RTX view, the collision, visual, edge, and wireframe overlays are not available; joint, contact, spring,
@@ -1056,12 +987,12 @@ center-of-mass, and inertia overlays are.
**Lighting differences across visualizers**
Each backend lights the scene differently, so the same environment can look noticeably
-different across visualizers. Kit renders the scene's actual authored USD lights. Newton GL
+different across visualizers. Kit renders the scene's actual authored USD lights. The Newton OpenGL view
uses a fixed sky-gradient and single directional light color
(:attr:`~isaaclab_visualizers.newton.NewtonGLBackendCfg.sky_upper_color`,
-``sky_lower_color``, ``light_color``), independent of scene USD lights. Newton RTX renders the
+``sky_lower_color``, ``light_color``), independent of scene USD lights. The Newton RTX view renders the
authored scene through Isaac Lab's OVRTX renderer, shared with cameras using the same
-``OVRTXRendererCfg``. Newton GL displays the rendered GPU image and handles window controls;
+``OVRTXRendererCfg``. The Newton window displays the rendered GPU image and handles window controls;
Newton's ``ViewerRTX`` is not constructed. Scene transforms, deformable geometry, and material
updates follow the camera renderer's normal synchronization. Perspective resolution stays
fixed when the window is resized; the window scales the image for presentation.
@@ -1075,16 +1006,16 @@ Rerun uses fixed built-in viewer shading with no scene-driven lighting.
**Kit: incompatible with ovphysx / ovrtx presets**
``--viz kit`` cannot be used with ``presets=ovphysx`` or ``presets=ovrtx`` in the same process.
-Use ``--viz newton_gl`` or ``--viz viser`` with those presets, or omit
+Use ``--viz newton`` or ``--viz viser`` with those presets, or omit
``--viz`` for headless execution.
-**Newton RTX: incompatible with Kit**
+**Newton RTX rendering: incompatible with Kit**
-``--viz newton_rtx`` raises a ``RuntimeError`` at startup if the active physics backend is
+Starting Newton in RTX (``initial_renderer="rtx"``) raises a ``RuntimeError`` at startup if the active physics backend is
``isaacsim_physx`` (i.e. ``presets=isaacsim_physx``), since OVRTX is a kitless renderer and cannot share
a process with Kit. ``presets=ovphysx`` is itself kitless and remains supported. Use
-``presets=newton_mjwarp,ovrtx`` or ``presets=ovphysx,ovrtx`` with ``--viz newton_rtx``, or switch
-to ``--viz newton_gl``, ``--viz viser``, or ``--viz kit`` with a Kit-compatible
+``presets=newton_mjwarp,ovrtx`` or ``presets=ovphysx,ovrtx`` with ``--viz newton``, or switch
+to ``--viz viser`` or ``--viz kit`` with a Kit-compatible
physics backend.
**Rerun: large environment performance**
@@ -1105,9 +1036,9 @@ The Rerun web viewer may slow down or crash with many environments. Reduce load
Rerun may show a blank browser tab for up to about 10 seconds while it connects
and receives scene data. Wait for the first frame; no action is needed.
-**Newton GL: CUDA/OpenGL interoperability warnings**
+**Newton: CUDA/OpenGL interoperability warnings**
-In some configurations, the Newton GL visualizer emits warnings about CUDA/OpenGL
+In some configurations, the Newton visualizer emits warnings about CUDA/OpenGL
interoperability:
.. code-block:: text
@@ -1119,12 +1050,12 @@ interoperability:
The visualizer still functions correctly but falls back to CPU copy operations, which reduces
performance.
-**Newton GL: OpenGL context failures**
+**Newton: OpenGL context failures**
If pyglet reports that ``glCreateShader`` is not exported or that OpenGL 2.0 is required, the
process is running without a GPU-backed display context (for example, in a service session or
a remote desktop without GPU acceleration). Run from a GPU-backed interactive display session,
-or omit ``--viz newton_gl`` for headless execution.
+or omit ``--viz newton`` for headless execution.
.. raw:: html
diff --git a/docs/source/developer-tools/template_generator.rst b/docs/source/developer-tools/template_generator.rst
index 73c2b6f46a16..b92732ea9fe4 100644
--- a/docs/source/developer-tools/template_generator.rst
+++ b/docs/source/developer-tools/template_generator.rst
@@ -246,7 +246,7 @@ Copy the task name from the output, then run a quick smoke test:
.. code-block:: bash
- uv run isaaclab random_agent --task --num_envs 16 --viz newton_gl
+ uv run isaaclab random_agent --task --num_envs 16 --viz newton
If the environment launches and the cart moves, the project is ready to edit.
You can then train and play a policy with the same command surface used by
@@ -255,7 +255,7 @@ Isaac Lab itself:
.. code-block:: bash
uv run isaaclab train --rl_library rsl_rl --task
- uv run isaaclab play --rl_library rsl_rl --task --checkpoint latest --viz newton_gl
+ uv run isaaclab play --rl_library rsl_rl --task --checkpoint latest --viz newton
Choose optional features and a simulation backend
-------------------------------------------------
diff --git a/docs/source/features/isaac_teleop.rst b/docs/source/features/isaac_teleop.rst
index 9299547c0ac8..a41057ba5425 100644
--- a/docs/source/features/isaac_teleop.rst
+++ b/docs/source/features/isaac_teleop.rst
@@ -797,8 +797,8 @@ For direct use of :func:`~isaaclab_teleop.create_isaac_teleop_device` or
window input explicitly. The session keeps this live sequence so later windows can join;
omitting it creates a session without window input. ``teleop_se3_agent.py`` and
``record_demos.py`` start Kit only when ``--xr`` or the task needs it, so
-``--viz newton_rtx`` works with a Newton-physics task, e.g.
-``--task Isaac-Reach-Franka --viz newton_rtx physics=newton_mjwarp presets=diffik``.
+``--viz newton`` works with a Newton-physics task, e.g.
+``--task Isaac-Reach-Franka --viz newton physics=newton_mjwarp presets=diffik``.
.. list-table::
:header-rows: 1
@@ -808,7 +808,7 @@ omitting it creates a session without window input. ``teleop_se3_agent.py`` and
- Keyboard input
* - ``--viz kit``
- Keys typed into the Kit window, including keys typed into Kit's own UI (e.g. a text field).
- * - ``--viz newton_gl`` / ``--viz newton_rtx``
+ * - ``--viz newton``
- Keys typed into the Newton viewer window, except keys typed into its UI. While a keyboard
pipeline runs, the viewer's WASD/QE and arrow-key camera movement is turned off; the mouse
still moves the camera.
diff --git a/docs/source/how-to/create_visualization_markers.rst b/docs/source/how-to/create_visualization_markers.rst
index 50193ede4796..db62a9731978 100644
--- a/docs/source/how-to/create_visualization_markers.rst
+++ b/docs/source/how-to/create_visualization_markers.rst
@@ -14,7 +14,7 @@ display-only: they carry no physics and do not affect the simulation.
For plain points, lines, and splines, Isaac Sim's own :mod:`isaacsim.util.debug_draw` extension
is lighter-weight. Use ``VisualizationMarkers`` when you need more complex shapes.
-Markers are supported on Kit, Newton GL, Rerun, and Viser, but not yet on Newton RTX. See
+Markers are supported on Kit, Newton (OpenGL and RTX), Rerun, and Viser. See
:doc:`/source/concepts/visualization` for how to enable them on a given visualizer.
diff --git a/docs/source/how-to/import_new_asset.rst b/docs/source/how-to/import_new_asset.rst
index 5a50b3e21034..f7fb7b6eee6b 100644
--- a/docs/source/how-to/import_new_asset.rst
+++ b/docs/source/how-to/import_new_asset.rst
@@ -32,7 +32,7 @@ Standalone URDF/MJCF importers
The URDF and MJCF converter scripts run without Isaac Sim. The standalone
importers are optional; install them with the ``isaaclab[importers]`` command in
:ref:`installation-importers-extra` before running these scripts.
-Optionally pass ``--viz newton_gl`` (or ``viser``) to preview the converted asset in a
+Optionally pass ``--viz newton`` (or ``viser``) to preview the converted asset in a
kit-less Isaac Lab visualizer:
.. code-block:: bash
@@ -258,7 +258,7 @@ is derived automatically from the robot name in the URDF):
.. _import-new-asset-preview:
The examples pass ``--viz kit`` to open the converted asset in the Isaac Sim viewport, which
-requires a full Isaac Sim installation. Use ``--viz newton_gl`` or ``--viz viser``
+requires a full Isaac Sim installation. Use ``--viz newton`` or ``--viz viser``
for a kit-less preview instead. Omit ``--viz`` to exit as soon as the conversion completes.
Inspect the converted geometry and articulation in the viewer, then validate dynamics in the
diff --git a/docs/source/how-to/mpm_tutorials.rst b/docs/source/how-to/mpm_tutorials.rst
index 7cf96b854eaa..cc3f7e2ec19d 100644
--- a/docs/source/how-to/mpm_tutorials.rst
+++ b/docs/source/how-to/mpm_tutorials.rst
@@ -30,8 +30,8 @@ Running the tutorials
---------------------
The material and rigid-body tutorials launch Kit by default, requiring the
-``isaacsim`` extra. The surface-reconstruction tutorial launches Newton GL by
-default. Use ``--viz`` to select another visualizer; Newton RTX also requires
+``isaacsim`` extra. The surface-reconstruction tutorial launches Newton by
+default. Use ``--viz`` to select another visualizer; the Newton RTX view also requires
``uv run --extra ovrtx``.
@@ -172,7 +172,7 @@ for rendering, while leaving the particle simulation unchanged.
.. code-block:: bash
uv run python scripts/tutorials/08_mpm/surface_reconstruction.py \
- --surface_preset balanced --viz newton_gl
+ --surface_preset balanced --viz newton
Run the same scene again with another ``--surface_preset``:
@@ -205,7 +205,7 @@ receive the mesh for the current particle state. See
.. note::
- This tutorial selects Newton GL or Newton RTX for surface reconstruction.
+ This tutorial selects Newton, with OpenGL or RTX rendering, for surface reconstruction.
Select ``--fluid_render_mode particles`` for Kit, Viser, or Rerun.
The shared ``ParticleSurfaceRenderer`` also supports Kit; see the teapot
example in :ref:`newton-using-mpm`.
diff --git a/docs/source/how-to/multi_asset_spawning.rst b/docs/source/how-to/multi_asset_spawning.rst
index f9f9a134bc9d..3fd7258f06b3 100644
--- a/docs/source/how-to/multi_asset_spawning.rst
+++ b/docs/source/how-to/multi_asset_spawning.rst
@@ -171,7 +171,7 @@ The physics backend and visualizer are selected independently. Run one of these
uv run --extra isaacsim isaaclab example multi-asset \
--physics newton_mjwarp --visualizer kit --num_envs 2048
- .. tab-item:: Newton MJWarp with Newton GL
+ .. tab-item:: Newton MJWarp with Newton
.. code-block:: bash
diff --git a/docs/source/how-to/policy_inference_in_usd.rst b/docs/source/how-to/policy_inference_in_usd.rst
index b3f49c51d787..3dfab6851c5f 100644
--- a/docs/source/how-to/policy_inference_in_usd.rst
+++ b/docs/source/how-to/policy_inference_in_usd.rst
@@ -40,9 +40,9 @@ when ``--device cpu`` is explicitly selected.
The height scanner starts below the warehouse roof so its downward rays measure the floor.
Keep the same physics preset for training, export, and inference. The commands below use
-Newton MJWarp with the ``newton_gl`` visualizer and do not require Isaac Sim. For a PhysX
+Newton MJWarp with the ``newton`` visualizer and do not require Isaac Sim. For a PhysX
checkpoint trained with Isaac Sim, use ``physics=isaacsim_physx`` throughout and install Isaac Sim;
-the Newton GL viewer can still be used.
+the Newton viewer can still be used.
Cross-backend policy transfer needs additional validation; see
:doc:`transfer_policies_between_physx_and_newton`.
@@ -70,7 +70,7 @@ where you started the simulation.
.. code-block:: bash
- uv run isaaclab play --rl_library rsl_rl --task Isaac-Velocity-Rough-H1 physics=newton_mjwarp --num_envs 64 --checkpoint logs/rsl_rl/h1_rough/EXPERIMENT_NAME/POLICY_FILE.pt --viz newton_gl
+ uv run isaaclab play --rl_library rsl_rl --task Isaac-Velocity-Rough-H1 physics=newton_mjwarp --num_envs 64 --checkpoint logs/rsl_rl/h1_rough/EXPERIMENT_NAME/POLICY_FILE.pt --viz newton
After running the play script, the policy will be exported to jit and onnx files under the experiment logs directory.
@@ -87,7 +87,7 @@ We can then load the warehouse asset and run inference on the H1 robot using the
.. code-block:: bash
- uv run python scripts/tutorials/03_envs/policy_inference_in_usd.py --checkpoint logs/rsl_rl/h1_rough/EXPERIMENT_NAME/exported/policy.pt physics=newton_mjwarp --viz newton_gl
+ uv run python scripts/tutorials/03_envs/policy_inference_in_usd.py --checkpoint logs/rsl_rl/h1_rough/EXPERIMENT_NAME/exported/policy.pt physics=newton_mjwarp --viz newton
.. figure:: ../_static/tutorials/tutorial_policy_inference_in_usd.jpg
diff --git a/docs/source/how-to/record_video.rst b/docs/source/how-to/record_video.rst
index edd415d5b43a..6e7b2cebb34b 100644
--- a/docs/source/how-to/record_video.rst
+++ b/docs/source/how-to/record_video.rst
@@ -160,7 +160,7 @@ Four independent clips are written to ``videos/recording_tutorial/example_3/``:
* ``kit_viewport_0000.mp4``: Kit interactive viewport (RTX renderer)
* ``tiled_kit_viewport_0000.mp4``: Kit tiled-camera grid (per-environment views)
-* ``newton_viewport_0000.mp4``: Newton GL viewer framebuffer
+* ``newton_viewport_0000.mp4``: Newton viewer framebuffer
* ``sensor_0000.mp4``: scene tiled-camera sensor (offline render)
.. raw:: html
@@ -172,7 +172,7 @@ Four independent clips are written to ``videos/recording_tutorial/example_3/``:
-
Newton GL visualizer
+
Newton visualizer
@@ -201,7 +201,7 @@ Record a short clip at regular intervals while training, without opening a windo
uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --video \
--video_length 200 --video_interval 2000
-With no ``--viz``, ``--video`` records from a headless Newton GL visualizer. This writes a
+With no ``--viz``, ``--video`` records from a headless Newton visualizer. This writes a
200-step clip every 2,000 steps. The ``train`` and ``play`` entrypoints put clips in ``videos/``
under the run's log directory unless a recorder sets ``output_dir``; a script that builds its own
recorders writes to ``output_dir`` (default ``videos``). Add ``--viz kit`` to watch the run in a
@@ -231,7 +231,7 @@ recorded. Pair them with a capture-capable visualizer that runs headless next to
.. code-block:: bash
- uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz viser --video viz:newton_gl
+ uv run isaaclab train --rl_library rsl_rl --task Isaac-Cartpole --viz viser --video viz:newton
Alternatively, record directly from a scene camera with ``source="sensor:"``, which needs no
visualizer.
@@ -257,7 +257,7 @@ configure both; the recorder adds the Newton visualizer, headless:
VisualizerCfg(eye=(12.0, 0.0, 6.0), backend=NewtonGLBackendCfg()),
]
env_cfg.video_recorders = [
- VideoRecorderCfg(source="viz:newton_gl", output_dir="videos/"),
+ VideoRecorderCfg(source="viz:newton", output_dir="videos/"),
]
Alternatively, use a :class:`~isaaclab.sensors.CameraCfg` sensor in the scene and record
@@ -277,17 +277,15 @@ The ``source`` string selects what to capture:
* - Source string
- Captures from
* - ``"viz"`` (default)
- - First capture-capable visualizer ``--viz`` selected, else a headless Newton GL visualizer
+ - First capture-capable visualizer ``--viz`` selected, else a headless Newton visualizer
* - ``"viz:kit"``
- Kit visualizer viewport
* - ``"viz:kit:streaming_view"``
- Kit streaming camera panel, requires ``streaming_view=True``
- * - ``"viz:newton_gl"``
- - Newton GL visualizer viewport, in whichever renderer the window shows (OpenGL or RTX). A headless Newton GL has no RTX view
- * - ``"viz:newton_rtx"``
- - Newton OVRTX path-traced viewport
- * - ``"viz:newton_gl:streaming_view"``
- - Newton GL streaming camera panel, requires ``streaming_view=True``
+ * - ``"viz:newton"``
+ - Newton visualizer viewport, in whichever renderer the window shows (OpenGL or RTX). A headless Newton has no RTX view
+ * - ``"viz:newton:streaming_view"``
+ - Newton streaming camera panel, requires ``streaming_view=True``
* - ``"sensor:"``
- ``env.scene.sensors[name]``, RGB (default)
* - ``"sensor::rgb"``
@@ -304,13 +302,13 @@ visualizer config, not on the recorder. A ``viz:`` visualizer that ``--viz
headless, only for the recording, with the settings of its config in ``sim.visualizer_cfgs``.
``visualizer`` is accepted as the long form of the ``viz`` prefix (``"visualizer:kit"`` is ``"viz:kit"``). The
-deprecated ``newton`` type (``"viz:newton"``) still works with a warning; use ``newton_gl``. Bare visualizer
-types are accepted here too, e.g. ``VideoRecorderCfg(source="newton_gl")`` is equivalent to
-``VideoRecorderCfg(source="viz:newton_gl")``.
+``newton_gl`` type (``"viz:newton_gl"``) is still accepted as an alias for ``newton``. Bare visualizer
+types are accepted here too, e.g. ``VideoRecorderCfg(source="newton")`` is equivalent to
+``VideoRecorderCfg(source="viz:newton")``.
.. note::
- The Newton RTX viewer framebuffer can be recorded with ``"viz:newton_rtx"``, but
+ The Newton viewport can be recorded with ``"viz:newton"`` while it renders with RTX, but
recording its streaming view is not supported.
@@ -366,7 +364,7 @@ Clip control
Limitations
-----------
-* ``source="viz:newton_gl:streaming_view"`` and ``source="viz:kit:streaming_view"``
+* ``source="viz:newton:streaming_view"`` and ``source="viz:kit:streaming_view"``
require ``streaming_view=True`` on the corresponding visualizer cfg. A
:class:`~RuntimeError` is raised when the recorder is constructed if it is not set.
@@ -383,22 +381,18 @@ Limitations
* - ``kit``
- ✓
- Launches Isaac Sim; the launch enables camera rendering for the recording.
- * - ``newton_gl``
+ * - ``newton``
- ✓
- Uses pyglet's EGL backend when headless; the default for ``--video`` without a
capture-capable ``--viz``.
- * - ``newton_rtx``
- - ✓
- - Starts the OVRTX runtime; capture performs a GPU-to-CPU readback of the path-traced
- framebuffer.
* - ``rerun``
- ✗
- Remote streaming tool; no local frame-capture API. ``viz:rerun`` is an error;
- ``--video --viz rerun`` records from a headless ``newton_gl``.
+ ``--video --viz rerun`` records from a headless ``newton``.
* - ``viser``
- ✗
- Browser streaming tool; no local frame-capture API. ``viz:viser`` is an error;
- ``--video --viz viser`` records from a headless ``newton_gl``.
+ ``--video --viz viser`` records from a headless ``newton``.
To record video while streaming with Rerun or Viser, see `Recording while streaming with Viser or
Rerun`_.
diff --git a/docs/source/how-to/run_rl_training.rst b/docs/source/how-to/run_rl_training.rst
index 9dc2a8a171ec..d16f09470648 100644
--- a/docs/source/how-to/run_rl_training.rst
+++ b/docs/source/how-to/run_rl_training.rst
@@ -86,7 +86,7 @@ Headless execution with off-screen render
"""""""""""""""""""""""""""""""""""""""""
To inspect behavior from a training run without an interactive window, pass ``--video``.
-By default, it records the scene from a headless Newton GL visualizer. See
+By default, it records the scene from a headless Newton visualizer. See
:doc:`/source/how-to/record_video` to choose a different visualizer or a camera-sensor output.
.. tab-set::
diff --git a/docs/source/how-to/run_state_machines.rst b/docs/source/how-to/run_state_machines.rst
index 50ab0056d32b..e7540f2f2a39 100644
--- a/docs/source/how-to/run_state_machines.rst
+++ b/docs/source/how-to/run_state_machines.rst
@@ -29,12 +29,12 @@ Lift a deformable object
------------------------
This example uses the Newton backend to grasp and lift a soft object. Pass
-``--viz newton_gl`` to open the Newton visualizer:
+``--viz newton`` to open the Newton visualizer:
.. code-block:: bash
uv run --extra tetrahedralization python scripts/environments/state_machine/lift_franka_soft.py \
- --num_envs 1 --viz newton_gl
+ --num_envs 1 --viz newton
Open a cabinet drawer
---------------------
diff --git a/docs/source/how-to/solver_tuning_kamino.rst b/docs/source/how-to/solver_tuning_kamino.rst
index 7e0e616fe3af..ba013a8db554 100644
--- a/docs/source/how-to/solver_tuning_kamino.rst
+++ b/docs/source/how-to/solver_tuning_kamino.rst
@@ -35,7 +35,7 @@ Run one small visual smoke test before training or benchmarking:
.. code-block:: bash
- uv run python scripts/environments/zero_agent.py --task Isaac-Cartpole-Direct --num_envs 4 --viz newton_gl physics=newton_kamino
+ uv run python scripts/environments/zero_agent.py --task Isaac-Cartpole-Direct --num_envs 4 --viz newton physics=newton_kamino
Then fix the initial state, seed, action sequence, and reset distribution. For
that reproduction, record penetration, slip, energy, a task metric, a
diff --git a/docs/source/how-to/visualizer_streaming_camera_view.rst b/docs/source/how-to/visualizer_streaming_camera_view.rst
index daba74128391..5a7983815efe 100644
--- a/docs/source/how-to/visualizer_streaming_camera_view.rst
+++ b/docs/source/how-to/visualizer_streaming_camera_view.rst
@@ -32,7 +32,7 @@ controls presentation independently through ``VisualizerCfg.window``. ``Visualiz
)
env_cfg.video_recorders = [VideoRecorderCfg(source=view, output_dir="videos")]
-Use ``--viz newton_gl`` (or ``--viz newton_rtx`` for the RTX example) to display the window.
+Use ``--viz newton`` to display the window.
Omit ``--viz`` for recording alone. The scene must declare ``front_camera`` with both requested outputs.
The view preserves environment order and native tile dimensions, placing channels beside each other.
``channels`` selects existing outputs; ``depth_range`` only maps depth values to display colors.
@@ -50,7 +50,7 @@ selection. Reading the shared view twice in one physics step reuses its frame an
Changing the view's selection rebuilds composition state; captured composition graphs must then be
recreated. This does not resize the sensor's render product.
-For Newton RTX, a perspective declaration is expanded into an ordinary scene camera before launch:
+A perspective declaration is displayed by the Newton window's own free camera:
.. code-block:: python
@@ -62,15 +62,15 @@ For Newton RTX, a perspective declaration is expanded into an ordinary scene cam
)
env_cfg.video_recorders = [VideoRecorderCfg(source=view)]
-Select ``visualizer=newton_rtx`` or ``visualizer=newton_gl`` at the task entry point.
-Newton RTX fixes perspective render resolution at the initial ``WindowCfg.size``; resizing the window
-scales its image. Newton GL perspective rendering follows its window framebuffer dimensions.
+Select ``visualizer=newton`` at the task entry point. With OpenGL rendering, perspective images follow the window
+framebuffer dimensions. With RTX rendering, they keep the initial ``WindowCfg.size`` and resizing the window
+scales the image.
The recorder reads the completed native render without requesting a second render for that step.
Perspective views currently provide one RGB image, so keep ``envs=(0,)`` and ``channels=("rgb",)``.
A recorded perspective view requires exactly one configured rendering visualizer. In headless runs,
the launcher retains that producer without opening a window; recording a sensor view needs no visualizer.
-``VisualizerCfg.view`` is supported by Newton GL and RTX. Existing ``cameras`` and
+``VisualizerCfg.view`` is supported by the Newton visualizer. Existing ``cameras`` and
``streaming_*`` configurations and CLI recording source strings remain supported; they are translated
at initialization. Use ``view`` instead of combining it with legacy camera selection fields.
@@ -122,11 +122,11 @@ Choose and control displayed views
the Viewport tabs; it can also be placed side by side with the default interactive viewport
for dual monitoring.
-**Newton GL and Newton RTX** have a **Camera Source** selector in the sidebar. Selecting a scene camera displays
+The **Newton** visualizer has a **Camera Source** selector in the sidebar. Selecting a scene camera displays
its tiled output in the main viewport instead of rendering a perspective view behind it.
-Selecting a perspective camera restores interactive scene rendering. Newton GL also restores picking.
+Selecting a perspective camera restores interactive scene rendering and picking.
-Without an explicit ``cameras`` list, Newton GL starts in perspective and offers scene cameras
+Without an explicit ``cameras`` list, Newton starts in perspective and offers scene cameras
that provide every requested ``streaming_gt_types`` channel. An explicit
``streaming_sensor_prim_path`` starts with that scene camera selected. For example, set
``streaming_gt_types=("depth",)`` to offer depth-only cameras. The RGB view accepts RGB or RGBA
@@ -134,8 +134,10 @@ outputs; the display uses opaque alpha. No images are captured to
build the selector. Explicitly configured scene-camera choices must support the requested channels;
incompatible choices raise a configuration error during initialization, including inactive choices.
-Newton RTX displays only the sources declared in ``view`` or ``cameras``. With neither set, launch
-preparation declares one perspective camera. Scene sensors are never added to its selector automatically.
+A **Renderer** selector switches the main perspective view between OpenGL and RTX when the scene has the OVRTX
+viewer camera, which launch declares when ``ovrtx`` is installed and the physics is not PhysX. Set
+``NewtonGLBackendCfg.initial_renderer="rtx"`` to start in RTX. The RTX view follows the OpenGL camera pose and
+renders only while selected.
Use ``cameras`` to declare a list of selectable views; the first starts active:
@@ -156,23 +158,20 @@ Use ``cameras`` to declare a list of selectable views; the first starts active:
)
The ``cameras`` field is shared across visualizers. Kit, Rerun, and Viser use the first scene
-camera for their image panel; Newton GL and RTX provide the source dropdown shown above.
+camera for their image panel; Newton provides the source dropdown shown above.
``SceneCameraCfg`` selects an existing sensor; ``PerspectiveCameraCfg`` configures the viewer's
-interactive camera. For Newton RTX, ``launch_simulation(env_cfg, ...)`` adds a ``CameraCfg``
-to the scene before any scene objects are constructed and selects it through ``SceneCameraCfg``.
-Newton GL retains its native perspective camera. Newton RTX keeps its perspective
-render resolution fixed at the initial ``WindowCfg.size``; resizing
-its window scales the displayed image. Sensor resolution remains controlled by ``CameraCfg``.
-Window resizing does not reallocate sensor or RTX perspective image buffers. Newton GL perspective
-images follow its framebuffer dimensions.
+interactive camera. Newton retains its native perspective camera, and ``launch_simulation(env_cfg, ...)``
+adds the OVRTX viewer ``CameraCfg`` to the scene before any scene objects are constructed. The RTX view keeps
+its render resolution fixed at the initial ``WindowCfg.size``; resizing its window scales the displayed image.
+Sensor resolution remains controlled by ``CameraCfg``. Window resizing does not reallocate sensor or RTX
+perspective image buffers. OpenGL perspective images follow the framebuffer dimensions.
Newton windows present at up to ``WindowCfg.fps`` (30 by default), measured in wall-clock time.
Changing the simulation timestep does not change that limit. Headless on-demand capture is
independent of the window update rate; Kit uses its application's update cadence.
-Newton RTX displays ordinary camera output in a Newton GL window. Equal ``OVRTXRendererCfg``
-configurations share one renderer and its scene. ``NewtonRTXBackendCfg.renderer_cfg`` selects
-the renderer for generated perspective cameras; explicitly selected scene cameras retain their
-own renderer. Newton's ``ViewerRTX`` and its borrowed-stage interface are not used.
+The Newton window displays ordinary camera output, including RTX. Equal ``OVRTXRendererCfg``
+configurations share one renderer and its scene. ``NewtonGLBackendCfg.rtx_renderer_cfg`` selects
+the renderer of the viewer camera; explicitly selected scene cameras retain their own renderer. Newton's ``ViewerRTX`` and its borrowed-stage interface are not used.
``isaaclab_ov.stage.OvstageBackend`` remains available for downstream consumers that need an
independent native stage. Its ``populate(usda)`` method imports an exported USD scene and applies
the prepared clone operations.
@@ -195,7 +194,7 @@ spawning assets and cameras, including for a single environment:
from isaaclab.utils import instantiate
from isaaclab.visualizers import SceneCameraCfg, VisualizerCfg
from isaaclab_ov.renderers import OVRTXRendererCfg
- from isaaclab_visualizers.newton import NewtonRTXBackendCfg
+ from isaaclab_visualizers.newton import NewtonGLBackendCfg
camera_cfg = CameraCfg(
prim_path="/World/PerspectiveCamera", width=960, height=540,
@@ -206,13 +205,13 @@ spawning assets and cameras, including for a single environment:
sim_cfg = SimulationCfg(
visualizer_cfgs=[
VisualizerCfg(
- backend=NewtonRTXBackendCfg(), cameras=[SceneCameraCfg(prim_path=camera_cfg.prim_path)]
+ cameras=[SceneCameraCfg(prim_path=camera_cfg.prim_path)], backend=NewtonGLBackendCfg()
)
]
)
target_cfg = AssetBaseCfg(prim_path="/World/Target", spawn=CuboidCfg(size=(1.0, 1.0, 1.0)))
light_cfg = AssetBaseCfg(prim_path="/World/Light", spawn=DomeLightCfg(intensity=1000.0))
- with launch_simulation(sim_cfg, {"physics": "ovphysx", "visualizer": ["newton_rtx"]}):
+ with launch_simulation(sim_cfg, {"physics": "ovphysx", "visualizer": ["newton"]}):
sim = SimulationContext(sim_cfg)
with ReplicateSession((target_cfg, light_cfg, camera_cfg), num_clones=1, env_spacing=0.0):
instantiate(target_cfg)
@@ -227,8 +226,7 @@ The script retains the camera and advances its sensor timing, just as it does fo
spawned sensors. ``SceneCameraCfg`` discovers it by prim path without an ``InteractiveScene``.
Display layout and channel mappings are compiled when the source, selection, resolution, or
-color settings change. Composition writes into reusable device RGBA storage. Newton GL, Newton
-RTX, and Kit present CUDA images without downloading pixels. Recording through
+color settings change. Composition writes into reusable device RGBA storage. Newton and Kit present CUDA images without downloading pixels. Recording through
``render_tiled_rgb_array()`` and the Rerun/Viser transports explicitly read back the composed
image. The GPU API, ``render_tiled_rgba_array()``, returns borrowed storage that is reused on the next
composition; consumers must copy it if they need to retain a frame.
@@ -306,7 +304,7 @@ Example 2: Streaming from Robot-Mounted Cameras
.. code-block:: bash
uv run --extra teleop python scripts/tutorials/07_visualizers/run_tiled_camera_visualizer.py \
- --task IsaacContrib-Stack-Cube-Galbot-Left-Arm-Gripper-Visuomotor --num_envs 25 --viz newton_gl
+ --task IsaacContrib-Stack-Cube-Galbot-Left-Arm-Gripper-Visuomotor --num_envs 25 --viz newton
.. tab-item:: :icon:`fa-brands fa-windows` Windows
:sync: windows
@@ -314,7 +312,7 @@ Example 2: Streaming from Robot-Mounted Cameras
.. code-block:: batch
uv run --extra teleop python scripts/tutorials/07_visualizers/run_tiled_camera_visualizer.py ^
- --task IsaacContrib-Stack-Cube-Galbot-Left-Arm-Gripper-Visuomotor --num_envs 25 --viz newton_gl
+ --task IsaacContrib-Stack-Cube-Galbot-Left-Arm-Gripper-Visuomotor --num_envs 25 --viz newton
The Galbot cube-stacking environment ships with wrist-mounted cameras giving an egocentric
view of the gripper, table, and cubes. The script streams from the scene's first ``CameraCfg``,
@@ -341,10 +339,10 @@ Declare camera resolution, pose, renderer, and output types on ``CameraCfg`` in
Then choose what to display in ``VisualizerCfg``:
* ``cameras=[SceneCameraCfg(prim_path=...)]`` selects a scene camera; ``view=ImageViewCfg(source="name")``
- selects a named sensor and its image layout. Newton RTX uses these explicit declarations.
+ selects a named sensor and its image layout.
* For other viewers, ``streaming_sensor_prim_path`` selects a scene :class:`~isaaclab.sensors.Camera` by its configured
prim path. The ``{ENV_REGEX_NS}`` macro uses the scene's environment template.
- If omitted, Newton GL starts in perspective mode and offers compatible scene cameras
+ If omitted, Newton starts in perspective mode and offers compatible scene cameras
in the Camera Source dropdown. Kit and web viewers select the first compatible scene camera;
without one, their panel stays empty.
* ``streaming_envs`` controls how many environment tiles are shown. Pass an ``int`` to randomly
@@ -363,7 +361,7 @@ Display sources
``VisualizerCfg.cameras`` accepts ``PerspectiveCameraCfg`` for the interactive view and
``SceneCameraCfg(prim_path=...)`` for a camera sensor already declared in the scene.
-Newton GL and RTX provide a source dropdown; Kit, Rerun, and Viser use the first scene source
+Newton provides a source dropdown; Kit, Rerun, and Viser use the first scene source
in their camera panel. Every explicit scene source must provide the requested
``streaming_gt_types`` channels.
@@ -371,8 +369,8 @@ in their camera panel. Every explicit scene source must provide the requested
Troubleshooting
---------------
-``--video viz:newton_gl:streaming_view`` records the selected scene-camera tiles, not a network
-stream. Without ``--viz``, capture runs on demand without opening a window. Adding ``--viz newton_gl``
+``--video viz:newton:streaming_view`` records the selected scene-camera tiles, not a network
+stream. Without ``--viz``, capture runs on demand without opening a window. Adding ``--viz newton``
displays the visualizer; it is not required to advance recorded frames. A new physics step refreshes
the image, while repeated captures within the same step reuse it.
diff --git a/docs/source/isaaclab/demos.rst b/docs/source/isaaclab/demos.rst
index cc3a864b4f20..cea82bbf7fcc 100644
--- a/docs/source/isaaclab/demos.rst
+++ b/docs/source/isaaclab/demos.rst
@@ -46,9 +46,9 @@ No source checkout is required.
Zoo
@@ -56,7 +56,7 @@ No source checkout is required.
@@ -65,9 +65,9 @@ No source checkout is required.
H1 Locomotion
@@ -75,9 +75,9 @@ No source checkout is required.
SONIC
@@ -85,7 +85,8 @@ No source checkout is required.
NIST
@@ -100,7 +101,7 @@ No source checkout is required.
Newton Block and Tackle
@@ -108,7 +109,7 @@ No source checkout is required.
@@ -117,7 +118,7 @@ No source checkout is required.
@@ -126,7 +127,7 @@ No source checkout is required.
H1 locomotion
H1 locomotion uses a published policy. For autonomous H1 task playback, use isaaclab play.
-
In the Newton viewer, press N to select a robot,
+
In the Newton viewer, press N to select a robot,
I/J/L to walk forward or turn, K to stop, and C to toggle the follow camera.