base
¶
OnReloadCallback
¶
ViewerControls
¶
ConnectionInfo
dataclass
¶
How to reach a browser based viewer, shown in the Reloaded terminal UI.
Returned by:
-
Reference
mujoco_mojoutilslayersreloadedbackends
-
Reference
mujoco_mojoutilslayersreloadedcontrollerconnection_lines
ViewerBackend
¶
Bases: Protocol
What Reloaded needs from a viewer.
A backend only shows state. It never owns the command loop, so the terminal UI and the unit tests can drive every backend the same way.
Returned by:
Used by:
failure
property
¶
Python
failure: str | None
Why the viewer stopped when it was not the user closing it, or None.
viewer_lock
property
¶
Python
viewer_lock: (
Callable[[], AbstractContextManager[Any]] | None
)
Lock the RuntimeManager holds while mutating model and data, or None if the viewer works on its own copy.
attach
¶
Python
attach(controls: ViewerControls) -> None
Hands the viewer what its own buttons may ask for. Called once, before start.
close
¶
on_reload
¶
Python
on_reload(state: MjState) -> None
Shows a new or refreshed model. Called once the model is generated and again after a run finishes.
sync_hook
¶
Python
sync_hook(
state: MjState,
arrows: list[ArrowConfig],
lines: list[LineConfig],
) -> None
Pushes the current physics state and overlays to the viewer. Called by the RuntimeManager after every step.
Source code in src/mujoco_mojo/utils/layers/reloaded/backends/base.py
pump
¶
connection_info
¶
Python
connection_info() -> ConnectionInfo | None