isaaclab.renderers#
Sub-package for renderer configurations and implementations.
This sub-package contains configuration classes and implementations for different renderer backends that can be used with Isaac Lab.
Classes
Abstract base class for renderer implementations. |
|
Factory for creating renderer instances. |
|
Configuration for a renderer. |
Base Renderer#
- class isaaclab.renderers.BaseRenderer[source]#
Bases:
ABCAbstract base class for renderer implementations.
Methods:
prepare_stage(stage, num_envs)Prepare the stage for rendering before create_render_data is called.
create_render_data(sensor)Create render data for the given sensor.
set_outputs(render_data, output_data)Store reference to output buffers for writing during render.
Update scene transforms before rendering.
update_camera(render_data, positions, ...)Update camera poses and intrinsics for the next render.
render(render_data)Perform rendering and write to output buffers.
write_output(render_data, output_name, ...)Write a specific output type to the given buffer.
cleanup(render_data)Release renderer resources associated with the given render data.
- abstractmethod prepare_stage(stage: Any, num_envs: int) None[source]#
Prepare the stage for rendering before create_render_data is called.
Some renderers need to export or preprocess the USD stage before creating render data. This method is called after the renderer is instantiated and before create_render_data.
- Parameters:
stage – USD stage to prepare, or None if not applicable.
num_envs – Number of environments.
- abstractmethod create_render_data(sensor: SensorBase) Any[source]#
Create render data for the given sensor.
The returned object is opaque to the interface: callers pass it to other renderer methods without inspecting its contents. Its structure is implementation-specific (each renderer defines its own type).
- Parameters:
sensor – The camera sensor to create render data for.
- Returns:
Renderer-specific data object holding resources needed for rendering. Passed to subsequent render calls.
- abstractmethod set_outputs(render_data: Any, output_data: dict[str, torch.Tensor]) None[source]#
Store reference to output buffers for writing during render.
- Parameters:
render_data – The render data object from
create_render_data().output_data – Dictionary mapping output names (e.g.
"rgb","depth") to pre-allocated tensors where rendered data will be written.
- abstractmethod update_transforms() None[source]#
Update scene transforms before rendering.
Called to sync physics/asset state into the renderer’s scene representation.
- abstractmethod update_camera(render_data: Any, positions: torch.Tensor, orientations: torch.Tensor, intrinsics: torch.Tensor) None[source]#
Update camera poses and intrinsics for the next render.
- Parameters:
render_data – The render data object from
create_render_data().positions – Camera positions in world frame, shape
(N, 3).orientations – Camera orientations as quaternions (x, y, z, w), shape
(N, 4).intrinsics – Camera intrinsic matrices, shape
(N, 3, 3).
- abstractmethod render(render_data: Any) None[source]#
Perform rendering and write to output buffers.
- Parameters:
render_data – The render data object from
create_render_data().
- abstractmethod write_output(render_data: Any, output_name: str, output_data: torch.Tensor) None[source]#
Write a specific output type to the given buffer.
- Parameters:
render_data – The render data object from
create_render_data().output_name – Name of the output (e.g.
"rgba","depth").output_data – Pre-allocated tensor to write the output into.
Renderer Factory#
- class isaaclab.renderers.Renderer[source]#
Bases:
FactoryBase,BaseRendererFactory for creating renderer instances.
Methods:
__new__(cls, cfg, *args, **kwargs)Create a new instance of a renderer based on the backend.
- static __new__(cls, cfg: RendererCfg, *args, **kwargs) BaseRenderer[source]#
Create a new instance of a renderer based on the backend.