5,337
edits
No edit summary |
|||
Line 43: | Line 43: | ||
However for simulations, you will want to fix the time between frames to a constant value. This allows faster-than-realtime simulations on more powerful hardware and slower-than-realtime simulations on slower hardware. | However for simulations, you will want to fix the time between frames to a constant value. This allows faster-than-realtime simulations on more powerful hardware and slower-than-realtime simulations on slower hardware. | ||
Below sets the timestep to <code>1/30</code> seconds per frame. | Below sets the timestep to <code>1/30</code> seconds per frame on the server. | ||
<pre> | <pre> | ||
./CarlaUE4.sh -benchmark -fps=30 | ./CarlaUE4.sh -benchmark -fps=30 | ||
</pre> | |||
Alternatively, you can do this on the client by modifying the time step. | |||
<pre> | |||
settings = world.get_settings() | |||
settings.fixed_delta_seconds = 0.05 | |||
world.apply_settings(settings) | |||
</pre> | |||
If your client needs to record data every frame, you may want to use synchronous mode | |||
<pre> | |||
settings = world.get_settings() | |||
settings.synchronous_mode = True # Enables synchronous mode | |||
world.apply_settings(settings) | |||
</pre> | </pre> |