carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.32k stars 3.66k forks source link

maximum fps of Carla simulator for DVS realism #6549

Open qhaas opened 1 year ago

qhaas commented 1 year ago

CARLA version: 0.9.14 Platform/OS: Ubuntu 22.04 Problem you have experienced: fixed_delta_seconds values lower than 1/1000 results in WARNING: World::ApplySettings: After 30 attemps, the settings were not correctly set. Please check that everything is consistent. What you expected to happen: The ability to set fixed_delta_seconds to 1/1000000 or less without error Steps to reproduce: Run snippet below with FPS = 10000 and FPS = 1000

Inverse of #3697. The answer for 0.9.14 appears to be 1000 for synchronous mode... my question, can we go higher? An unreal engine discussion implies we can go higher, but an examination of the UE4 code appears to cap it.

The reason I am interested in getting a high number of ticks per simulation second (i.e. frames per simulation second) is to make the DVS camera more accurate since 'intermediate' events are sparse for apparent (to the camera) fast moving objects in a scene. My interpretation of the DVS camera model as implemented in carla is that it takes 'diffs' between sequential 'frames' and performs interpolation to generate 'intermediate' events (forgive terminology abuse). As the fixed_delta_seconds approaches zero, less interpolation should be needed, and more 'intermediate' events should be generated for objects traveling at high apparent speeds.

In CARLA 0.9.14, setting fixed_delta_seconds to values below 1/1000 appears to crash the simulation, per this snippet:

$ cat carla_high_speed.py
import carla

FPS = 10000
TIMEOUT=10

client = carla.Client('localhost', 2000)
client.load_world('Town01')
world = client.get_world()

# set sync
settings = world.get_settings()
settings.fixed_delta_seconds = 1/FPS
settings.synchronous_mode = True
world.apply_settings(settings)
world.tick(TIMEOUT)

$ python carla_high_speed.py
WARNING: World::ApplySettings: After 30  attemps, the settings were not correctly set. Please check that everything is consistent

Thanks

qhaas commented 9 months ago

Still occurs in CARLA 0.9.15

kkssgg114514 commented 8 months ago

I am setting synchronous mode in my cpp client, and it occurs too. It didn't happen when it run with asynchronous mode. How to correct the synchronous mode settings?