9.4 Speed/Performance
9.4.1 Why is Webots slow on my computer?
You should verify your graphics driver installation. Please find instructions here section 1.4.
On Ubuntu (or other Linux) we do also recommend to deactivate compiz (System > Preferences > Appearance > Visual Effects = None). Depending on the graphics hardware, there may be a huge performance drop of the rendering system (up to 10x) when compiz is on.
9.4.2 How can I change the speed of the simulation?
There are several ways to increase the simulation speed:
-
Use the Run button (Webots PRO only). This button runs the simulation as fast as possible using all the available CPU power. Otherwise, using the Real-Time running mode, Webots may not be using all the available CPU power in order to obtain a simulation speed that is close to the speed of the real world's phenomena.
-
Use the Fast button (Webots PRO only). This button runs the simulation as fast as possible using all the available CPU power. In this mode the simulation speed is increased further by leaving out the graphics rendering, hence the 3d window is black.
-
Increase the value of WorldInfo.basicTimeStep. This parameter sets the granularity of the physics simulation. With a higher WorldInfo.basicTimeStep, the simulation becomes faster but less accurate. With a lower WorldInfo.basicTimeStep, the simulation becomes slower but more accurate. There is an additional restriction: WorldInfo.basicTimeStep must be chosen such as to be an integer divisor of the control step which is the value passed as parameter to the wb_robot_step() (or equivalent) function.
-
Increase the value of WorldInfo.displayRefresh. This parameter specifies how many WorldInfo.basicTimeStep there must be between two consecutive refresh of the 3D scene. With a higher value, the simulation becomes faster but more flickering. With a lower value, the simulation becomes slower but less flickering.
-
Disable unnecessary shadows. Webots uses a lot of CPU/GPU power to compute how and where the objects shadows are cast. But shadows are irrelevant for most simulation unless they should explicitly be seen by Cameras. Unnecessary shadows can be disabled by unchecking the castShadows field of light nodes: PointLight, SpotLight, or DirectionalLight.
-
Simplify your simulation by removing unnecessary objects. In particular, try to minimize the number of Physics nodes. Avoid using a Solid nodes when a Transform or a Shape would do the trick.
-
Simplify the boundingObjects to increase the speed of the collision detection. Replace complex primitives, like Cylinder, IndexedFaceSet and ElevationGrid by simpler primitives, like Sphere, Capsule, Box and Plane. Avoid using a composition of primitives (in a Group or a Transform) when a single primitive would do the trick.
9.4.3 How can I make movies that play at real-time (faster/slower)?
All movies created with Webots have a frame rate of 25 images per second. However it is possible to control the playback speed of these movies by choosing at what intervals (of simulated time) the images should be generated by Webots. The time interval between two generated images is the product of the basicTimeStep and displayRefresh fields (in the WorldInfo node). If you need a video that plays back in real-time, the chosen time interval must be 40 ms, because 25 images per second corresponds to an interval of 40 ms between two images. So you can choose for example 10 ms for basicTimeStep and 4 for displayRefresh, so the interval will be 10 * 4 = 40 ms, and hence the movie will play back at real-time. Similarly any combination of basicTimeStep and displayRefresh which multiplies to 40, will yield real-time. The movie will be faster or slower than real-time if the product is respectively greater or less than 40. Note that modifying the basicTimeStep may have side effect on your simulation so it is usually safer to change only displayRefresh if possible.