cambrian.renderer.renderer¶
Wrapper around the mujoco viewer for rendering scenes.
Classes¶
The save modes for saving rendered images. |
|
The config for the renderer. Used for type hinting. |
|
The base class for the viewer. This class should not be instantiated directly. |
|
The offscreen viewer for rendering scenes. |
|
The onscreen viewer for rendering scenes. |
|
The renderer for rendering scenes. This is essentially a wrapper around the |
Module Contents¶
- class MjCambrianRendererSaveMode(*args, **kwds)[source]¶
Bases:
enum.Flag
The save modes for saving rendered images.
- class MjCambrianRendererConfig[source]¶
Bases:
hydra_config.HydraContainerConfig
The config for the renderer. Used for type hinting.
A renderer corresponds to a single camera. The renderer can then view the scene in different ways, like offscreen (rgb_array) or onscreen (human).
- Variables:
render_modes (List[str]) – The render modes to use for the renderer. See MjCambrianRenderer.metadata[“render.modes”] for options.
width (Optional[int]) – The width of the rendered image. For onscreen renderers, if this is set, the window cannot be resized. Must be set for offscreen renderers.
height (Optional[int]) – The height of the rendered image. For onscreen renderers, if this is set, the window cannot be resized. Must be set for offscreen renderers.
fullscreen (Optional[bool]) – Whether to render in fullscreen or not. If True, the width and height are ignored and the window is rendered in fullscreen. This is only valid for onscreen renderers.
scene (Type[mj.MjvScene]) – The scene to render.
scene_options (mj.MjvOption) – The options to use for rendering.
camera (mj.MjvCamera) – The camera to use for rendering.
use_shared_context (bool) – Whether to use a shared context or not. If True, the renderer will share a context with other renderers. This is useful for rendering multiple renderers at the same time. If False, the renderer will create its own context. This is computationally expensive if there are many renderers.
save_mode (Optional[MjCambrianRendererSaveMode]) – The save modes to use for saving the rendered images. See MjCambrianRenderer.SaveMode for options. Must be set if save is called without save modes passed directly.
- class MjCambrianViewer(config)[source]¶
Bases:
abc.ABC
The base class for the viewer. This class should not be instantiated directly.
- Parameters:
config (MjCambrianRendererConfig) – The config to use for the viewer.
- class MjCambrianOffscreenViewer(config)[source]¶
Bases:
MjCambrianViewer
The offscreen viewer for rendering scenes.
- class MjCambrianOnscreenViewer(config)[source]¶
Bases:
MjCambrianViewer
The onscreen viewer for rendering scenes.
- class MjCambrianRenderer(config)[source]¶
The renderer for rendering scenes. This is essentially a wrapper around the mujoco viewer/renderer.
- Parameters:
config (MjCambrianRendererConfig) – The config to use for the renderer.
- Variables:
metadata (Dict[str, List[str]]) – The metadata for the renderer. The render modes are stored here.