Renderer
Rendering API for MuJoCo simulations.
- class myosuite.viz.renderer.RenderMode(value)
Bases:
EnumRendering modes for offscreen rendering.
- RGB = 0
- DEPTH = 1
- SEGMENTATION = 2
- class myosuite.viz.renderer.Renderer(mj_model, mj_data)
Bases:
ABCBase interface for rendering simulations.
- abstract render_to_window()
Renders the simulation to a window.
- abstract refresh_window()
Refreshes the rendered window if one is present.
- abstract render_offscreen(width, height, depth=False, segmentation=False, camera_id=-1, device_id=-1)
Renders the camera view as a numpy array of pixels.
- Parameters:
- Return type:
ndarray- Returns:
A numpy array of the pixels.
- set_free_camera_settings(distance=None, azimuth=None, elevation=None, lookat=None, center=True)
Sets the free camera parameters.
- Parameters:
distance (
Optional[float]) – The distance of the camera from the target.azimuth (
Optional[float]) – Horizontal angle of the camera, in degrees.elevation (
Optional[float]) – Vertical angle of the camera, in degrees.lookat (
Optional[Sequence[float]]) – The (x, y, z) position in world coordinates to target.center (
bool) – If True and lookat is not given, targets the camera at the median position of the simulation geometry.
- set_viewer_settings(render_tendon=None, render_actuator=None)
Sets the viewer parameters.
- class myosuite.viz.mj_renderer.MJRenderer(mj_model, mj_data)
Bases:
RendererRenders Mujoco Physics objects.
- key_callback(keycode)
- setup_renderer(model, height, width)
Select the offscreen renderer for
widthxheight, creating it once.A
mujoco.Rendererhas a fixed image size, so one is kept per size (e.g. video frames and visual observations at different resolutions).
- render_to_window()
Renders the Physics object to a window.
The window continuously renders the Physics in a separate thread.
This function is a no-op if the window was already created.
- refresh_window()
Refreshes the rendered window if one is present.
- render_offscreen(width=640, height=480, rgb=True, depth=False, segmentation=False, camera_id=-1, device_id=-1)
Renders the camera view as a numpy array of pixels.
- Parameters:
- Return type:
ndarray- Returns:
A numpy array of the pixels.