Check out synchronous mode
Carla can simulate in different modes, see link here: https://carla.readthedocs.io/en/latest/adv_synchrony_timestep/
If I understand correctly its best if we use synchronous mode with a fixed timestep which is 1/unreal_framerate This ensures repeatibility and the simulation will be 'real time'.
There are 2 challenges in this method:
-
One is that we have to ENSURE that unreal will always maintain this framerate. This can be done by introducing a framerate limitation in unreal project settings. However this also means you have to make sure you dont drop the framerate (for example if you add a ton of big complicated meshes with transparent materials, flats and such) -
Two is that we have to call world.tick() inside python. But this needs to be done quickly and looped. The annoying thing is with our current structure is that this world.tick() function can only be called after get_ready (in the loop) which means you cannot spawn anything out of running. This needs to be fixed.