mujoco-python-viewer
mujoco-python-viewer copied to clipboard
Frame rate?
Is there any way to set the Framerate(FPS) of the simulation or limit the render speed?
I believe a logic like this could work
import time
import mujoco
fps = 50
for _ in range(10000):
if viewer.is_alive:
last_t = time.time()
mujoco.mj_step(model, data)
viewer.render()
dt = time.time() - last_t
while dt < (1 / fps):
time.sleep(0.001)
dt = time.time() - last_t
else:
break