unilab.visualization.viser_scene.MujocoViserScene

class unilab.visualization.viser_scene.MujocoViserScene[source]

Bases: object

Bridges a mujoco.MjModel to a viser.ViserServer scene graph.

Call build() once to populate the scene with geometry handles, then call update() each frame to sync body transforms from MjData.

Parameters:

Methods

__init__(server, model, *[, name_prefix, ...])

close()

Remove all scene handles owned by this adapter.

reset(model, *[, position_offset, render_plane])

Rebuild the viser scene for a new MuJoCo model.

update(data)

Sync all geom transforms from data into the viser scene.

__init__(server, model, *, name_prefix='/mujoco', position_offset=(0.0, 0.0, 0.0), render_plane=True)[source]
Parameters:
reset(model, *, position_offset=None, render_plane=None)[source]

Rebuild the viser scene for a new MuJoCo model.

Parameters:
  • model (MjModel) – MuJoCo model whose geoms should populate the scene.

  • position_offset (tuple[float, float, float] | None) – Optional XYZ offset applied to all geoms.

  • render_plane (bool | None) – Optional override for whether plane geoms should be built.

Return type:

None

Returns:

None.

close()[source]

Remove all scene handles owned by this adapter.

Return type:

None

update(data)[source]

Sync all geom transforms from data into the viser scene.

Parameters:

data (MjData)

Return type:

None