Farama-Foundation / Shimmy

An API conversion tool for popular external reinforcement learning environments
https://shimmy.farama.org
MIT License
129 stars 18 forks source link

Reasoning for rendering FPS for dm_control environments #118

Open realquantumcookie opened 5 months ago

realquantumcookie commented 5 months ago

Hello Shimmy Contributors,

I just wanted to ask about the reason behind the metadata['render_fps'] setting for dm_control environments. In dm_control_compatibility.py#81, it seems like the render_fps is set to the environment's control_timestep converted to millisecond, but I think it is more natural to have it set to int(round((1/control_timestep))? I'm more than happy to submit a PR for this.

pseudo-rnd-thoughts commented 5 months ago

Looking and thinking about it again.

The dm-control control_timestep docstring says that it is the interval in seconds between actions. Therefore, 1/control_timesteps correctly computes the frames per second equivalent to the environment's equivalent actions per second. I'm not sure we want to include the int(round(X)) (1 // X is equivalent as well), maybe, round(X, 3) such that the value is rounded to a reasonable number without losing too much accuracy to the original env.