Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/source/features/hydra.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,37 @@ To set parameters to None, use the ``null`` keyword, which is a special keyword
In the above example, we could also disable the ``joint_pos_rel`` observation by setting it to None with
``env.observations.policy.joint_pos_rel=null``.

TiledCamera renderer type
^^^^^^^^^^^^^^^^^^^^^^^^^

You can select the :class:`~isaaclab.sensors.TiledCamera` backend (RTX vs. Warp) at train time via Hydra by
overriding the camera config's ``renderer_type``.

**Override path:** It must match where the task puts the TiledCamera in the env config:

- **Scene has ``base_camera``:** If the task uses a scene config that exposes the camera as ``scene.base_camera``
(e.g. a scene class like ``KukaAllegroSingleTiledCameraSceneCfg`` with a ``base_camera: TiledCameraCfg`` field),
use:

.. code-block:: shell
env.scene.base_camera.renderer_type=rtx
# or
env.scene.base_camera.renderer_type=warp_renderer
- **Camera on env config:** If the task puts the camera elsewhere (e.g. ``env.tiled_camera`` on the env config),
override that path instead:

.. code-block:: shell
env.tiled_camera.renderer_type=rtx
# or
env.tiled_camera.renderer_type=warp_renderer
**Values:** ``rtx`` selects the Isaac RTX (Replicator) renderer; ``warp_renderer`` selects the Newton Warp renderer
(when the ``isaaclab_newton`` package is available). No change to env or env_cfg code is required—only the
config hierarchy must expose the camera at the path you override.

Dictionaries
^^^^^^^^^^^^
Elements in dictionaries are handled as a parameters in the hierarchy. For example, in the Cartpole environment:
Expand Down
5 changes: 5 additions & 0 deletions docs/source/overview/core-concepts/sensors/camera.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ The Tiled Rendering APIs provide a vectorized interface for collecting data from

Isaac Lab provides tiled rendering APIs for RGB, depth, along with other annotators through the :class:`~sensors.TiledCamera` class. Configurations for the tiled rendering APIs can be defined through the :class:`~sensors.TiledCameraCfg` class, specifying parameters such as the regex expression for all camera paths, the transform for the cameras, the desired data type, the type of cameras to add to the scene, and the camera resolution.

The renderer backend (Isaac RTX vs. Newton Warp) can be selected at run time via the config's ``renderer_type``
(``"rtx"`` or ``"warp_renderer"``). When using Hydra (e.g. in ``train.py``), override the camera config path your
task uses—e.g. ``env.scene.base_camera.renderer_type=rtx`` when the scene exposes ``base_camera``, or
``env.tiled_camera.renderer_type=rtx`` when the camera is on the env config. See **Hydra Configuration System** (Features) for override paths and examples.

.. code-block:: python

tiled_camera: TiledCameraCfg = TiledCameraCfg(
Expand Down
9 changes: 9 additions & 0 deletions source/isaaclab/isaaclab/sensors/camera/camera_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,14 @@ class OffsetCfg:

"""

renderer_type: Literal["rtx", "warp_renderer"] = "rtx"
"""Hydra-friendly renderer selector. When set, overrides :attr:`renderer_cfg` for the backend.

- ``"rtx"``: Use Isaac RTX (Replicator) renderer (default).
- ``"warp_renderer"``: Use Newton Warp renderer (when available).

Can be overridden at train time via e.g. ``env.scene.base_camera.renderer_type=warp_renderer``.
"""

renderer_cfg: RendererCfg = field(default_factory=IsaacRtxRendererCfg)
"""Renderer configuration for camera sensor."""
17 changes: 16 additions & 1 deletion source/isaaclab/isaaclab/sensors/camera/tiled_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ def _initialize_impl(self):
self._sensor_prims.append(UsdGeom.Camera(cam_prim))

# Create renderer after scene is ready (post-cloning) so world_count is correct
self.renderer = Renderer(self.cfg.renderer_cfg)
# Resolve Hydra-friendly renderer_type to concrete renderer_cfg if set
renderer_cfg = self._get_effective_renderer_cfg()
self.renderer = Renderer(renderer_cfg)
logger.info("Using renderer: %s", type(self.renderer).__name__)

self.render_data = self.renderer.create_render_data(self)
Expand Down Expand Up @@ -222,6 +224,19 @@ def _update_buffers_impl(self, env_mask: wp.array):
Private Helpers
"""

def _get_effective_renderer_cfg(self):
"""Resolve renderer_cfg from optional renderer_type (Hydra override)."""
rt = getattr(self.cfg, "renderer_type", None)
if rt == "rtx":
from isaaclab_physx.renderers import IsaacRtxRendererCfg

return IsaacRtxRendererCfg()
if rt == "warp_renderer":
from isaaclab_newton.renderers import NewtonWarpRendererCfg

return NewtonWarpRendererCfg()
Comment on lines +234 to +237
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing error handling if isaaclab_newton not installed—wrap in try/except to raise helpful message like visualizer_cfg.py does for Newton visualizers (lines 88-92)

Suggested change
if rt == "warp_renderer":
from isaaclab_newton.renderers import NewtonWarpRendererCfg
return NewtonWarpRendererCfg()
if rt == "warp_renderer":
try:
from isaaclab_newton.renderers import NewtonWarpRendererCfg
except ImportError:
raise ImportError(
"Renderer 'warp_renderer' requires isaaclab_newton package. "
"Install the Newton backend and retry."
)
return NewtonWarpRendererCfg()

return self.cfg.renderer_cfg

def _check_supported_data_types(self, cfg: TiledCameraCfg):
"""Checks if the data types are supported by the ray-caster camera."""
# check if there is any intersection in unsupported types
Expand Down