Updates NativeViewer instantiations in sample scripts to pass a ViewerConfig object
PiperOrigin-RevId: 940654165 Change-Id: I984cb296593e992dd0d99ca44b43c54de4c3e96d
This commit is contained in:
committed by
Copybara-Service
parent
3a623aaf33
commit
f4b2f76def
@@ -63,13 +63,13 @@ def view(
|
|||||||
data = mujoco.MjData(first_msg.model)
|
data = mujoco.MjData(first_msg.model)
|
||||||
app = studio_app.StudioApp(first_msg.model, data)
|
app = studio_app.StudioApp(first_msg.model, data)
|
||||||
send_rate = 60.0
|
send_rate = 60.0
|
||||||
viewer = _viewer.NativeViewer(
|
config = vp.ViewerConfig(
|
||||||
app.model,
|
|
||||||
title=title,
|
title=title,
|
||||||
width=_WIDTH.value,
|
width=_WIDTH.value,
|
||||||
height=_HEIGHT.value,
|
height=_HEIGHT.value,
|
||||||
gfx=_GFX.value,
|
gfx=_GFX.value,
|
||||||
)
|
)
|
||||||
|
viewer = _viewer.NativeViewer(config)
|
||||||
|
|
||||||
while viewer.is_running() and app.is_running():
|
while viewer.is_running() and app.is_running():
|
||||||
|
|
||||||
|
|||||||
@@ -63,13 +63,13 @@ def view(
|
|||||||
|
|
||||||
data = mujoco.MjData(first_msg.model)
|
data = mujoco.MjData(first_msg.model)
|
||||||
app = studio_app.StudioApp(first_msg.model, data)
|
app = studio_app.StudioApp(first_msg.model, data)
|
||||||
viewer = _viewer.NativeViewer(
|
config = vp.ViewerConfig(
|
||||||
app.model,
|
|
||||||
title=title,
|
title=title,
|
||||||
width=_WIDTH.value,
|
width=_WIDTH.value,
|
||||||
height=_HEIGHT.value,
|
height=_HEIGHT.value,
|
||||||
gfx=_GFX.value,
|
gfx=_GFX.value,
|
||||||
)
|
)
|
||||||
|
viewer = _viewer.NativeViewer(config)
|
||||||
|
|
||||||
while viewer.is_running() and app.is_running():
|
while viewer.is_running() and app.is_running():
|
||||||
|
|
||||||
|
|||||||
@@ -106,14 +106,13 @@ def main(argv: list[str]) -> None:
|
|||||||
app = studio_app.StudioApp.from_argv(argv)
|
app = studio_app.StudioApp.from_argv(argv)
|
||||||
title = os.path.basename(sys.argv[0])
|
title = os.path.basename(sys.argv[0])
|
||||||
|
|
||||||
# Initialize the viewer.
|
config = viewer_protocol.ViewerConfig(
|
||||||
viewer = _viewer.NativeViewer(
|
|
||||||
app.model,
|
|
||||||
title=title,
|
title=title,
|
||||||
width=_WIDTH.value,
|
width=_WIDTH.value,
|
||||||
height=_HEIGHT.value,
|
height=_HEIGHT.value,
|
||||||
gfx=_GFX.value,
|
gfx=_GFX.value,
|
||||||
)
|
)
|
||||||
|
viewer = _viewer.NativeViewer(config)
|
||||||
|
|
||||||
# Variables for the custom UI.
|
# Variables for the custom UI.
|
||||||
centroid = [np.zeros(3) for _ in range(_N_HISTORY)]
|
centroid = [np.zeros(3) for _ in range(_N_HISTORY)]
|
||||||
|
|||||||
Reference in New Issue
Block a user