carla-simulator / carla

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

How to make autopilot vehicle take the same route at intersection every time? #5729

Closed snehanjalikalamkar closed 2 years ago

snehanjalikalamkar commented 2 years ago

I am required to capture 15-minute simulation images using 6 RGB cameras at 24fps. Many frames (~10%) are lost if I attach all 6 RGB cameras and record from them simultaneously. So, I spawned the autopilot vehicle at the same position each time and captured it from 2 cameras at a time. I ran the simulation thrice to get images from all 6 cameras. Since the paths of the vehicle are non-deterministic, the 3 simulations produce different results.

I looked into set_random_device_seed using the traffic manager to solve this problem, but it didn't work.

  1. How could we make the car take the same route in every simulation?
  2. How to use set_random_device_seed ? What are the expected values of seed_value?
RaviBeagle commented 2 years ago

One possible solution: you can run the simulation in synchronous mode to capture from all cameras at 24fps: https://carla.readthedocs.io/en/latest/adv_synchrony_timestep/#possible-configurations

Sync mode with fixed-time step.

glopezdiest commented 2 years ago

Hey @snehanjalikalamkar. What version of CARLA are you using? I don't remember if this was added before or after 0.9.13, but the traffic manager has a set_path function, that can help you do that. Here are the docs on how to do it.

Closing the issue, but feel free to reopen it if this doesn't fully solve your question