carla-simulator / carla

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

Carla Simulator is not responding #7118

Closed eyabesbes closed 6 months ago

eyabesbes commented 7 months ago

Hi everyone, I don't know why every time I try to execute this code on jupyter notebook it works but then Carla doesn't respond anymore delta = 0.05 settings.fixed_delta_seconds = delta settings.synchronous_mode = True settings.no_rendering_mode = False # You can set this based on your needs world.apply_settings(settings)

image

image

PatrickPromitzer commented 7 months ago

That is normal because carla is in synchronous_mode

If you activate synchronous_mode, carla will wait until it gets a world.tick() from the Python API (for your example)

You can make a simple loop that makes carla run again

delta = 0.05
frequenz = 1 / delta  # the number of steps in one second
for _ in range(frequenz * 10):  # 10 simulation seconds
    world.tick()

If you set synchronous_mode to False, you don't have to use world.tick() because carla will do that for you, but it is less consistent with the time you get data from carla.

eyabesbes commented 6 months ago

thanks a lot