rohanpsingh / mujoco-python-viewer

Simple renderer for use with MuJoCo (>=2.1.2) Python Bindings.
BSD 2-Clause "Simplified" License
163 stars 24 forks source link

Not able to get view to render in real time. #30

Closed Robokan closed 1 year ago

Robokan commented 1 year ago

I am running a simulation with a time step of 0.001 and gravity of -9.8. My model isn't very tall just 0.4m. When I use your viewer it puts everything into slow motion. If I turn off help it gets faster but still in slow motion. Pressing D seems to make it just go faster than real life. Why is it not moving at the same rate it would in real life? How do I get it to render in real time?

rohanpsingh commented 1 year ago

Hi @Robokan The viewer does not ensure real time simulation speed. If it is faster than real-time, you need to introduce a time delay by yourself in your code after each call to render.

Robokan commented 1 year ago

I am having the opposite problem it is rendering too slowly. Pressing D speeds it up but skips frames.

Robokan commented 1 year ago

Ok I figured it out. Somehow I was calling render twice. It works now.

Robokan commented 1 year ago

This is a great viewer BTW. Thanks for creating it!

rohanpsingh commented 1 year ago

Nice!