I was wondering if they is a way to limit the gz GUI fps? It is constantly at 60 FPS and it causes my Laptop to overheat. I would like to lower it to 30 or 20 FPS such that it takes less of my computers resources to run the simulation. How can I do this? Any help would be appreciated!
1 Answer
One thing you can try:
The communication from the simulator backend to the gui frontend, is done by the scene_broadcaster
plugin.
This plugin reads two values from the sdf: dynamic_pose_hertz and state_hertz.
I tried the lights demo world with following change:
<plugin
filename="gz-sim-scene-broadcaster-system"
name="gz::sim::systems::SceneBroadcaster">
<dynamic_pose_hertz>1</dynamic_pose_hertz>
<state_hertz>1</state_hertz>
</plugin>
After which the scene is updated at 1Hz.
But I am not sure if this solves your problem, as the gui update frequency itself remains unchanged (i.e. even if the ball rotates at 1Hz, you can still pan and tilt the view and it will update at full frequency).
I am also not sure if this has side effects (except that it will for sure influence sensors that run on the GUI side).
I tried to dig through the code to find where the rendering frequency is set, but I did not manage to find it. I think that this is done by the minimal_scene
plugin in the gz-gui
library. Or maybe in the MainWindow
or Application
classes.
rviz
is often good enough to understand what is happening in the simulation. $\endgroup$