cambrian.renderer.overlays

Defines utilities for overlays in the Mujoco viewer.

Classes

MjCambrianViewerOverlay

This class is used to add an overlay to the viewer.

MjCambrianTextViewerOverlay

This class is used to add text to the viewer.

MjCambrianImageViewerOverlay

This class is used to add an image to the viewer.

MjCambrianSiteViewerOverlay

This class is used to add a site to the viewer.

Module Contents

class MjCambrianViewerOverlay(obj, cursor=None)[source]

This class is used to add an overlay to the viewer.

Note

This is applied only to the passed scene, so other scenes (i.e. ones for the eyes) will not be affected.

draw_before_render(scene)[source]

Called before rendering the scene.

draw_after_render(mjr_context, viewport)[source]

Called after rendering the scene.

place(cursor)[source]

Places the cursor at the given location. Won’t overwrite the current cursor, if it exists.

Parameters:

cursor – The cursor to place.

static create_text_overlay(text, *, cursor=None)[source]

Creates a text overlay.

static create_image_overlay(obj, *, cursor=None)[source]

Creates an image overlay.

static create_site_overlay(pos, rgba, size, geom_kwargs=dict(emission=0.25))[source]

Creates a site overlay.

class MjCambrianTextViewerOverlay(obj, cursor=None)[source]

Bases: MjCambrianViewerOverlay

This class is used to add text to the viewer.

draw_after_render(mjr_context, viewport)[source]

Called after rendering the scene.

place(cursor)[source]

Places the cursor at the given location. Won’t overwrite the current cursor, if it exists.

Parameters:

cursor – The cursor to place.

class MjCambrianImageViewerOverlay(obj, cursor=None)[source]

Bases: MjCambrianViewerOverlay

This class is used to add an image to the viewer.

draw_after_render(mjr_context, viewport)[source]

Called after rendering the scene.

place(cursor)[source]

Places the cursor at the given location. Won’t overwrite the current cursor, if it exists.

Parameters:

cursor – The cursor to place.

class MjCambrianSiteViewerOverlay(pos, rgba, size, geom_kwargs=dict(emission=0.25))[source]

Bases: MjCambrianViewerOverlay

This class is used to add a site to the viewer.

Todo

Make this an image overlay where the pos is converted to pixel coordinates.

draw_before_render(scene)[source]

Called before rendering the scene.