Skip to content

Commit

Permalink
Add show_left_ui parameter to MujocoVisualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Jan 10, 2025
1 parent 849d37e commit 6094752
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/jaxsim/mujoco/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,18 @@ def sync(
viewer.sync()

def open_viewer(
self, model: mj.MjModel | None = None, data: mj.MjData | None = None
self,
model: mj.MjModel | None = None,
data: mj.MjData | None = None,
show_left_ui: bool = False,
) -> mj.viewer.Handle:
"""Open a viewer."""

data = data if data is not None else self.data
model = model if model is not None else self.model

handle = mj.viewer.launch_passive(
model, data, show_left_ui=False, show_right_ui=False
model, data, show_left_ui=show_left_ui, show_right_ui=False
)

return handle
Expand All @@ -171,6 +174,7 @@ def open(
model: mj.MjModel | None = None,
data: mj.MjData | None = None,
*,
show_left_ui: bool = False,
close_on_exit: bool = True,
lookat: Sequence[float | int] | npt.NDArray | None = None,
distance: float | int | npt.NDArray | None = None,
Expand All @@ -185,7 +189,7 @@ def open(
https://mujoco.readthedocs.io/en/stable/XMLreference.html#visual-global
"""

handle = self.open_viewer(model=model, data=data)
handle = self.open_viewer(model=model, data=data, show_left_ui=show_left_ui)

handle = MujocoVisualizer.setup_viewer_camera(
viewer=handle,
Expand Down

0 comments on commit 6094752

Please sign in to comment.