Skip to content
Merged
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
1 change: 1 addition & 0 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The following modules are available in the ``isaaclab`` extension:
physics
renderers
scene
scene_data
sensors
sim
terrains
Expand Down
33 changes: 33 additions & 0 deletions docs/source/api/lab/isaaclab.scene_data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
isaaclab.scene_data
===================

.. automodule:: isaaclab.scene_data

.. rubric:: Classes

.. autosummary::

SceneDataProvider
SceneDataBackend
SceneDataFormat

Scene Data Provider
-------------------

.. autoclass:: SceneDataProvider
:members:
:undoc-members:
:show-inheritance:

Scene Data Backend
------------------

.. autoclass:: SceneDataBackend
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: SceneDataFormat
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/source/features/visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ Currently, live plots are only available in the Kit Visualizer.
**Viser Visualizer Renderer Requirement**

The Viser visualizer requires a Newton model, which is provided automatically by
:class:`~isaaclab.scene.scene_data_provider.SceneDataProvider` regardless of the active physics
:class:`~isaaclab.scene_data.SceneDataProvider` regardless of the active physics
backend or renderer. It is compatible with all rendering backends (RTX, Newton Warp, OVRTX).


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This pattern applies to all simulation components:
- :class:`~isaaclab_physx.renderers.IsaacRtxRenderer`
- :class:`~isaaclab_newton.renderers.NewtonWarpRenderer`
* - Scene Data Backend
- :class:`~isaaclab.physics.SceneDataBackend`
- :class:`~isaaclab.scene_data.SceneDataBackend`
- ``PhysxSceneDataBackend`` (in :mod:`isaaclab_physx.physics`)
- ``NewtonSceneDataBackend`` (in :mod:`isaaclab_newton.physics`)
* - Cloner
Expand Down Expand Up @@ -272,14 +272,15 @@ the established conventions:

**2. Implement the physics manager:**

The manager must expose a :class:`~isaaclab.physics.SceneDataBackend` so that
:class:`~isaaclab.scene.scene_data_provider.SceneDataProvider` can read your backend's body
The manager must expose a :class:`~isaaclab.scene_data.SceneDataBackend` so that
:class:`~isaaclab.scene_data.SceneDataProvider` can read your backend's body
transforms in a Warp-native format that renderers and visualizers consume directly.

.. code-block:: python

# isaaclab_mybackend/physics/mybackend_manager.py
from isaaclab.physics import PhysicsManager, SceneDataBackend, SceneDataFormat
from isaaclab.physics import PhysicsManager
from isaaclab.scene_data import SceneDataBackend, SceneDataFormat


class MyBackendSceneDataBackend(SceneDataBackend):
Expand Down
10 changes: 5 additions & 5 deletions docs/source/overview/core-concepts/scene_data_providers.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Scene Data Provider
===================

The :class:`~isaaclab.scene.scene_data_provider.SceneDataProvider` bridges physics simulation
The :class:`~isaaclab.scene_data.SceneDataProvider` bridges physics simulation
backends and the visualizers/renderers that consume scene data. It exposes a single Warp-native
read path for body transforms regardless of which physics backend (PhysX or Newton) is active,
so renderers and visualizers can stay backend-agnostic.
Expand All @@ -12,7 +12,7 @@ Overview
Isaac Lab supports multiple physics backends (PhysX and Newton) and multiple visualizers
(Omniverse Kit, Newton, Rerun, Viser). Each combination needs scene data to flow from the
physics engine into the renderer or visualizer. The :class:`SceneDataProvider` owns this flow:
the physics manager provides a :class:`~isaaclab.physics.SceneDataBackend` that wraps its
the physics manager provides a :class:`~isaaclab.scene_data.SceneDataBackend` that wraps its
native tensor views, and the provider handles format conversion and re-mapping on top of it.

.. code-block:: python
Expand All @@ -28,9 +28,9 @@ Architecture

The system has three layers:

1. :class:`~isaaclab.physics.SceneDataBackend` — small interface implemented by each physics
1. :class:`~isaaclab.scene_data.SceneDataBackend` — small interface implemented by each physics
manager. It exposes the backend's transform array directly as one of the
:class:`~isaaclab.physics.SceneDataFormat` Warp structs, plus the per-transform prim paths
:class:`~isaaclab.scene_data.SceneDataFormat` Warp structs, plus the per-transform prim paths
and total count. There is no per-frame "update" call — the property accessors return live
views into the underlying tensor each time they're read.

Expand All @@ -40,7 +40,7 @@ The system has three layers:
- :attr:`SceneDataBackend.transform_count` — number of transforms.
- :attr:`SceneDataBackend.transform_paths` — list of USD prim paths, one per transform.

2. :class:`~isaaclab.scene.scene_data_provider.SceneDataProvider` — wraps a backend and offers
2. :class:`~isaaclab.scene_data.SceneDataProvider` — wraps a backend and offers
format conversion plus index re-mapping:

- :meth:`SceneDataProvider.get_transforms` — write the backend's transforms into a
Expand Down
23 changes: 23 additions & 0 deletions source/isaaclab/changelog.d/daniela-move-scene-data.major.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Added
^^^^^

* Added :mod:`isaaclab.scene_data` sub-package consolidating
:class:`~isaaclab.scene_data.SceneDataProvider`,
:class:`~isaaclab.scene_data.SceneDataBackend`, and
:class:`~isaaclab.scene_data.SceneDataFormat` in a single import location.

Changed
^^^^^^^

* **Breaking:** Moved :class:`~isaaclab.scene_data.SceneDataProvider` from
:mod:`isaaclab.scene.scene_data_provider` and
:class:`~isaaclab.scene_data.SceneDataBackend` /
:class:`~isaaclab.scene_data.SceneDataFormat` from :mod:`isaaclab.physics`
to the new :mod:`isaaclab.scene_data` sub-package. Update imports::

# before
from isaaclab.scene.scene_data_provider import SceneDataProvider
from isaaclab.physics import SceneDataBackend, SceneDataFormat

# after
from isaaclab.scene_data import SceneDataProvider, SceneDataBackend, SceneDataFormat
12 changes: 6 additions & 6 deletions source/isaaclab/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ Added
``JointTypeFloatingBase``, OCS2's ``generalizedCoordinatesNum =
6 + actuatedJointsNum``, iDynTree's ``getFreeFloatingMassMatrix``
returning ``(6 + dofs, 6 + dofs)``).
* Added :attr:`~isaaclab.scene.scene_data_provider.SceneDataProvider.usd_stage`,
:attr:`~isaaclab.scene.scene_data_provider.SceneDataProvider.num_envs`, and
:meth:`~isaaclab.scene.scene_data_provider.SceneDataProvider.get_camera_transforms`
* Added :attr:`~isaaclab.scene_data.SceneDataProvider.usd_stage`,
:attr:`~isaaclab.scene_data.SceneDataProvider.num_envs`, and
:meth:`~isaaclab.scene_data.SceneDataProvider.get_camera_transforms`
so visualizers and renderers can pull stage-derived data through the same
Warp-native provider that already exposes transforms.

Expand Down Expand Up @@ -309,12 +309,12 @@ Changed
COM-referenced form can read :attr:`body_com_jacobian_w`.
* **Breaking:** :class:`~isaaclab.visualizers.base_visualizer.BaseVisualizer`
subclasses now receive a
:class:`~isaaclab.scene.scene_data_provider.SceneDataProvider` in
:class:`~isaaclab.scene_data.SceneDataProvider` in
:meth:`~isaaclab.visualizers.base_visualizer.BaseVisualizer.initialize`
instead of the removed ``BaseSceneDataProvider``. Read environment count
from :attr:`~isaaclab.scene.scene_data_provider.SceneDataProvider.num_envs`
from :attr:`~isaaclab.scene_data.SceneDataProvider.num_envs`
and call
:meth:`~isaaclab.scene.scene_data_provider.SceneDataProvider.get_camera_transforms`
:meth:`~isaaclab.scene_data.SceneDataProvider.get_camera_transforms`
on the new provider; both replace the previous ``get_metadata()`` /
``get_camera_transforms()`` calls on the legacy interface.

Expand Down
3 changes: 0 additions & 3 deletions source/isaaclab/isaaclab/physics/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ __all__ = [
"PhysicsEvent",
"PhysicsManager",
"PhysicsCfg",
"SceneDataBackend",
"SceneDataFormat",
]

from .physics_manager import CallbackHandle, PhysicsEvent, PhysicsManager
from .physics_manager_cfg import PhysicsCfg
from .scene_data_backend import SceneDataBackend, SceneDataFormat
2 changes: 1 addition & 1 deletion source/isaaclab/isaaclab/physics/physics_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from typing import TYPE_CHECKING, Any, ClassVar

if TYPE_CHECKING:
from isaaclab.physics.scene_data_backend import SceneDataBackend
from isaaclab.scene_data import SceneDataBackend
from isaaclab.sim.simulation_context import SimulationContext

logger = logging.getLogger(__name__)
Expand Down
61 changes: 0 additions & 61 deletions source/isaaclab/isaaclab/physics/scene_data_backend.py

This file was deleted.

22 changes: 22 additions & 0 deletions source/isaaclab/isaaclab/scene_data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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

"""Sub-package containing the scene data provider and backend interface.

The :class:`SceneDataProvider` bridges physics simulation backends and the
consumers that read scene transforms (renderers and visualizers). Physics
backends implement :class:`SceneDataBackend` to expose their current
transforms in one of the :class:`SceneDataFormat` Warp struct variants;
the provider converts and remaps them on demand for each consumer.

This package is deliberately separate from :mod:`isaaclab.scene` so that
physics backends (``isaaclab_physx``, ``isaaclab_newton``) can subclass
:class:`SceneDataBackend` without pulling :mod:`isaaclab.scene` into the
``AppLauncher`` pre-launch import chain.
"""

from isaaclab.utils.module import lazy_export

lazy_export()
13 changes: 13 additions & 0 deletions source/isaaclab/isaaclab/scene_data/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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

__all__ = [
"SceneDataBackend",
"SceneDataFormat",
"SceneDataProvider",
]

from .scene_data_backend import SceneDataBackend, SceneDataFormat
from .scene_data_provider import SceneDataProvider
91 changes: 91 additions & 0 deletions source/isaaclab/isaaclab/scene_data/scene_data_backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# 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

"""Backend interface and data formats for the scene data provider.

These types live in :mod:`isaaclab.scene_data` rather than
:mod:`isaaclab.scene` so that physics backends (``isaaclab_physx``,
``isaaclab_newton``) can subclass :class:`SceneDataBackend` without pulling
:mod:`isaaclab.scene` into the ``AppLauncher`` pre-launch import chain.
``AppLauncher._create_app`` pops ``*lab*`` modules from ``sys.modules``
during Kit init and any submodule imported during that window ends up
orphaned from its parent's ``__dict__`` after restoration.
"""

from __future__ import annotations

import warp as wp

# Under Sphinx ``autodoc_mock_imports``, ``wp.struct`` is a ``_MockObject``
# that replaces the decorated class with another mock, hiding its docstring
# and fields from autodoc. Fall back to an identity decorator when warp is
# mocked so the documentation builds from the source classes directly.
if getattr(wp, "__sphinx_mock__", False):

def wp_struct(cls):
return cls
else:
wp_struct = wp.struct


class SceneDataFormat:
"""Warp struct variants describing the transform layouts that a
:class:`SceneDataBackend` may publish to consumers.
"""

@wp_struct
class Vec3_Quat:
"""Separate position and quaternion arrays."""

positions: wp.array(dtype=wp.vec3f) = None
"""Per-transform positions [m]."""

orientations: wp.array(dtype=wp.quatf) = None
"""Per-transform orientations as quaternions."""

@wp_struct
class Vec3_Matrix33:
"""Separate position and rotation-matrix arrays."""

positions: wp.array(dtype=wp.vec3f) = None
"""Per-transform positions [m]."""

orientations: wp.array(dtype=wp.mat33f) = None
"""Per-transform orientations as 3x3 rotation matrices."""

@wp_struct
class Transform:
"""Packed warp transforms (position + quaternion)."""

transforms: wp.array(dtype=wp.transformf) = None
"""Per-transform packed position + orientation transforms [m, -]."""

@wp_struct
class Matrix44:
"""Packed 4x4 homogeneous transform matrices."""

matrices: wp.array(dtype=wp.mat44f) = None
"""Per-transform 4x4 homogeneous transform matrices [m]."""


class SceneDataBackend:
@property
def transforms(
self,
) -> (
SceneDataFormat.Vec3_Quat | SceneDataFormat.Transform | SceneDataFormat.Matrix44 | SceneDataFormat.Vec3_Matrix33
):
"""Return the sim backends transforms as one of the SceneDataFormat structs."""
raise NotImplementedError

@property
def transform_count(self) -> int:
"""Return the number of transforms in the sim backend."""
raise NotImplementedError

@property
def transform_paths(self) -> list[str]:
"""Return the paths for each transform."""
raise NotImplementedError
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import numpy as np
import warp as wp

from isaaclab.physics.scene_data_backend import SceneDataBackend, SceneDataFormat
from .scene_data_backend import SceneDataBackend, SceneDataFormat

if TYPE_CHECKING:
from pxr import Usd
Expand Down
Loading
Loading