benelot / pybullet-gym

Open-source implementations of OpenAI Gym MuJoCo environments for use with the OpenAI Gym Reinforcement Learning Research Platform.
https://pybullet.org/
Other
814 stars 124 forks source link

How to get the timestep of an environment? #58

Closed cookiegg closed 3 years ago

cookiegg commented 3 years ago

Hello, my project needs to use the property timestep which is similar to the property env.env.dt in gym class control environments. I don't see a similar value in something like InvertedPendulumMuJoCoEnv-v0, how do I implement it? Thanks.

benelot commented 3 years ago

Hello!

The timestep of pybullet, which is the base system of these implementations, uses a timestep of 1/240. You can change the timestep using p.setTimeStep(...) as documented here: https://docs.google.com/document/d/10sXEhzFRSnvFcl3XxNGhnD4N2SedqwdAvK3dsihxVUA/edit#heading=h.5h9ku1yf3u1v (wait for the end of the load, it jumps to the right heading). However, as I just read there, it is not advised to change the timestep if not necessary, as the physics solving parameters are tuned to it. In general, this will deal with your environment accuracy, so results may differ if you change it.

cookiegg commented 3 years ago

Hello!

The timestep of pybullet, which is the base system of these implementations, uses a timestep of 1/240. You can change the timestep using p.setTimeStep(...) as documented here: https://docs.google.com/document/d/10sXEhzFRSnvFcl3XxNGhnD4N2SedqwdAvK3dsihxVUA/edit#heading=h.5h9ku1yf3u1v (wait for the end of the load, it jumps to the right heading). However, as I just read there, it is not advised to change the timestep if not necessary, as the physics solving parameters are tuned to it. In general, this will deal with your environment accuracy, so results may differ if you change it.

Thank you for your reply, it's very helpful.