visualizers.viser_app.gui#

Module Contents#

visualizers.viser_app.gui.DEFAULT_SLIDER_STEP_FLOAT = 0.01#
visualizers.viser_app.gui.DEFAULT_SLIDER_STEP_INT = 1#
visualizers.viser_app.gui.GOAL_RADIUS = 0.05#
visualizers.viser_app.gui.slider(parameter_name: str, min: int | float, max: int | float, step: int | float | None = None) Callable#

Decorator that adds slider metadata to desired dataclass fields.

Parameters:
  • parameter_name (str) – target parameter to annotate.

  • min (int | float) – minimum value for slider (int or float, must match dtypes of other variables).

  • max (int | float) – maximum value for slider (int or float).

  • step (int | float | None) – (optional) step for slider handle. If not set, defaults to constant 0.01 for floats and 1 for ints.

Return type:

Callable

visualizers.viser_app.gui.create_gui_elements(server: viser.ViserServer, config: Any, config_dict: multiprocessing.managers.DictProxy, config_updated_event: multiprocessing.synchronize.Event, config_lock: multiprocessing.synchronize.Lock) List[viser.GuiInputHandle]#

Recursively iterates through a dataclass, adding GUI elements / callbacks for its fields to a Viser server.

Parameters:
  • server (viser.ViserServer) – current ViserServer to which the GUI elements are added.

  • config (Any) – dataclass containing params which we want to update via viser.

  • config_dict (multiprocessing.managers.DictProxy) – multiprocessing.DictProxy where param values are shared between threads.

  • config_updated_event (multiprocessing.synchronize.Event) – multiprocessing.Event that flags when config params are updated.

  • config_lock (multiprocessing.synchronize.Lock) – multiprocessing.Lock that prevents multiple processes from accessing the same param.

Return type:

List[viser.GuiInputHandle]

Returns a list of GuiHandles that can be used to remove all elements created here on destruction.