smarts.p3d.renderer module
- class smarts.p3d.renderer.P3DOffscreenCamera(renderer: RendererBase, camera_np: NodePath, buffer: GraphicsOutput, tex: Texture)[source]
A camera used for rendering images to a graphics buffer.
- buffer: GraphicsOutput
- camera_np: NodePath
- property position: Tuple[float, float, float]
The position of the camera.
- tex: Texture
- class smarts.p3d.renderer.P3DShaderStep(renderer: RendererBase, shader_file: str, camera_dependencies: Collection[OffscreenCamera], buffer_dependencies: Collection[ShaderStepBufferDependency], camera_np: NodePath, buffer: GraphicsOutput, tex: Texture, fullscreen_quad_node: NodePath)[source]
A camera used for rendering images using a shader and a full-screen quad.
- fullscreen_quad_node: NodePath
- property position: Tuple[float, float, float]
The position of the camera.
- update(pose: Pose | None = None, height: float | None = None, observation: Observation | None = None, **kwargs)[source]
Update the location of the shader directional values. :param pose: The pose of the camera target. :param height: The height of the camera above the camera target.
- class smarts.p3d.renderer.Renderer(simid: str, debug_mode: DEBUG_MODE = DEBUG_MODE.ERROR, rendering_backend: Literal['pandagl', 'pandadx9', 'pandagles', 'pandagles2', 'p3headlessgl', 'p3tinydisplay'] = 'pandagl')[source]
The utility used to render simulation geometry.
- build_offscreen_camera(name: str, mask: int, width: int, height: int, resolution: float) None [source]
Generates a new off-screen camera.
- build_shader_step(name: str, fshader_path: str | Path, dependencies: Collection[ShaderStepDependencyBase], priority: int, height: int, width: int) None [source]
Generates a new shader camera.
- camera_for_id(camera_id: str) P3DOffscreenCamera | P3DShaderStep [source]
Get a camera by its id.
- create_signal_node(sig_id: str, position: Point, color: Colors | SceneColors)[source]
Create a signal node.
- create_vehicle_node(glb_model: str | Path, vid: str, color: Colors | SceneColors, pose: Pose)[source]
Create a vehicle node.
- property id
The id of the simulation rendered.
- property is_setup: bool
If the renderer has been fully initialized.
- property log: Logger
The rendering logger.
- set_interest(interest_filter: Pattern, interest_color: Colors)[source]
Sets the color of all vehicles that have ids that match the given pattern.
- Parameters:
interest_filter (re.Pattern) – The regular expression pattern to match.
interest_color (Colors) – The color that the vehicle should show as.
- sync(sim_frame: SimulationFrame)[source]
Update the current state of the vehicles and signals within the renderer.
- update_signal_node(sig_id: str, position: Point, color: Colors | SceneColors)[source]
Move the specified signal node.