pybullet-gym icon indicating copy to clipboard operation
pybullet-gym copied to clipboard

Stopping render - relation between the simulation and rendering

Open misterguick opened this issue 3 years ago • 1 comments

Hello !

I just discovered your package. I would like to use it as a drop in replacement in my implementation but I am facing some issues regarding rendering.

My first question is naive but https://github.com/bulletphysics/bullet3/issues/2306 suggests that rendering and the actual physical state simulation are related. Let's say I want to use InvertedPendulumPyBulletEnv-v0. Will rendering change the way the physics is simulated ?

My second question follows the first one. I would like to render only at evaluation time. Is that a good idea ? It seems rendering is to be opened once for all and is not intended to be opened and closed many times.

Thank you in advance !

misterguick avatar Feb 23 '21 16:02 misterguick

Hi!

No, simulation and physics are not related in that sense. The thing is that if you require a camera image as your input, then the renderer differs depending on whether you have a GUI open or closed. For rendering, the renderer requires 3D models, about which the physics engine does not know anything. So for the camera image, it has to quickly create these 3D models, take the image and then drop this again, while in the GUI case it just can snap the image from the GUI buffer. If you are not using the camera image as input feature, you can easily render only at evaluation time. Does that answer your question?

benelot avatar Feb 25 '21 08:02 benelot