carla
carla copied to clipboard
how to understand fps and delta seconds
CARLA version: 0.9.14 Platform/OS: Ubuntu 20.04 hardware: Intel 11th gen cpu and Nvidia 3060 gpu
This is how I start carla:
. CarlaUE4.sh -quality-level=Low
then, add some vehicles:
python3 generate_traffic.py
then, I set the fps by this script:
python3 config.py --delta-seconds 0.02
I am confused about the speed. Why every car in the simulation runs slower with 0.02 / 50fps, compared to 0.07 / 14fps ?
Btw, is there a way to show the server fps on the server window (like computer games) ?
Thank you in advance!
Hi, delta-seconds is describing the time between each simulation step. For example: delta-seconds=0.1 (10 Hz) camera picture per second = 1/delta-seconds (10Hz) You will get a picture for each simulation step, and 10 picture each simulation second. The simulation has to do more work if decease the delta-seconds because it has to send more pictures. delta-seconds=0.1 = 10 pictures each simulation second delta-seconds=0.05= 20 pictures each simulation second
The simulation is running faster than RL time if possible. You could run a 10 simulation seconds in 5 seconds. The sames goes the other way around if the simulation can't keep up, and you could have 10 simulation seconds in 20 seconds.
The fps you are talking about is frames per (real life) seconds. If the simulation in running 2 simulation second in 1 real life second, you would get 10 camera pictures per simulation second * (simulation second / real life seconds) = frames per second 10 * (2/1) = 20 fps (simulation is running faster) 10 * (1/2) = 5 fps (simulation is running slower)
The simulation is not synchronized with the real life time without you writing a code to make it do so. It is more important that you get the sensor data and the simulation is running as fast as possible, than having it synchronized to real time.
I hope that answers your question.