smarts.core.renderer_base module

class smarts.core.renderer_base.DEBUG_MODE(value)[source]

The rendering debug information level.

DEBUG = 2
ERROR = 5
INFO = 3
SPAM = 1
WARNING = 4
class smarts.core.renderer_base.OffscreenCamera(renderer: RendererBase)[source]

A camera used for rendering images to a graphics buffer.

abstract property heading: float

The heading of this camera.

abstract property image_dimensions: Tuple[int, int]

The dimensions of the output camera image.

abstract property position: Tuple[float, float, float]

The position of the camera.

renderer: RendererBase
abstract teardown()[source]

Clean up internal resources.

abstract update(*args, **kwargs)[source]

Update the location of the camera. :param pose: The pose of the camera target. :param height: The height of the camera above the camera target.

abstract wait_for_ram_image(img_format: str, retries=100)[source]

Attempt to acquire a graphics buffer.

class smarts.core.renderer_base.RendererBase[source]

The base class for rendering

Return type:

RendererBase

abstract begin_rendering_vehicle(vid: str, is_agent: bool)[source]

Add the vehicle node to the scene graph

abstract build_offscreen_camera(name: str, mask: int, width: int, height: int, resolution: float) None[source]

Generates a new off-screen camera.

abstract build_shader_step(name: str, fshader_path: str | Path, dependencies: Collection[ShaderStepCameraDependency | ShaderStepVariableDependency], priority: int, height: int, width: int) None[source]

Generates a new shader camera.

abstract camera_for_id(camera_id) OffscreenCamera[source]

Get a camera by its id.

abstract create_vehicle_node(glb_model: str, vid: str, color, pose: Pose)[source]

Create a vehicle node.

abstract destroy()[source]

Destroy the renderer. Cleans up all remaining renderer resources.

abstract property id

The id of the simulation rendered.

abstract property is_setup: bool

If the renderer has been fully initialized.

abstract property log: Logger

The rendering logger.

abstract remove_buffer(buffer)[source]

Remove the rendering buffer.

abstract remove_vehicle_node(vid: str)[source]

Remove a vehicle node

abstract render()[source]

Render the scene graph of the simulation.

abstract reset()[source]

Reset the render back to initialized state.

abstract setup(scenario)[source]

Initialize this renderer.

abstract step()[source]

provided for non-SMARTS uses; normally not used by SMARTS.

abstract sync(sim_frame)[source]

Update the current state of the vehicles within the renderer.

abstract teardown()[source]

Clean up internal resources.

abstract update_vehicle_node(vid: str, pose: Pose)[source]

Move the specified vehicle node.

exception smarts.core.renderer_base.RendererNotSetUpWarning[source]

This occurs if a renderer is used without being set up.

class smarts.core.renderer_base.ShaderStep(renderer: RendererBase, shader_file: str, camera_dependencies: Collection[OffscreenCamera], buffer_dependencies: Collection[ShaderStepBufferDependency])[source]

A camera used for rendering images using a shader and a full-screen quad.

buffer_dependencies: Collection[ShaderStepBufferDependency]
camera_dependencies: Collection[OffscreenCamera]
shader_file: str
class smarts.core.renderer_base.ShaderStepBufferDependency(buffer_id: BufferID, script_uniform_name: str)[source]

The base for shader dependencies.

buffer_id: BufferID
script_uniform_name: str
class smarts.core.renderer_base.ShaderStepCameraDependency(camera_id: str, script_variable_name: str)[source]

Forwards the texture from a given camera to the

camera_id: str
script_variable_name: str
class smarts.core.renderer_base.ShaderStepDependencyBase[source]

The base for shader dependencies.

class smarts.core.renderer_base.ShaderStepVariableDependency(value: int | float | bool | ndarray | list | tuple, script_variable_name: str)[source]

The base for shader dependencies.

script_variable_name: str
value: int | float | bool | ndarray | list | tuple