This repository contains comprehensive scripts for CARLA simulator, aimed at evaluating the performance of Forward Collision Warning (FCW) system. You can find an extensive description about CARLA simulator and its various capabilities, along with different methods for doing diverse tasks and their results in test.ipynb file.
To run the simulator, follow the instructions below:
- Open a terminal in the source folder of simulator path
- run
./CarlaUE4.sh
-
Some options to improve performance are as follows:
./CarlaUE4.sh -prefernvidia -renderOffScreen -quality-level=Low
- Open a new terminal in the source of python script path
- run
conda activate [carla_environment]
- For example, if you have installed carla python package in an environment called carla, you should run
conda activate carla
- for running a script you should run
python test.py
in terminal
- Examples can be found in source folder under /PythonAPI/examples
To simulate some predefined scenarios of autonomous vehicles, you should follow the following instructions.
-
Firstly, you should start the simulator's physics engine (same as before):
./CarlaUE4.sh -prefernvidia -renderOffScreen -quality-level=Low
-
Then you should run
python manual_control.py
which has a very comprehensive world set up.
-
remember that if you want to run the said script in synchronous mode, you should add --sync arguments, too.
python manual_control.py --sync
- Afterwards, run the desired scenario script file in another terminal.
-
Scenario 1: Follow an arbitrary car
python test_scenario_1.py
-
Scenario 2: Collision scenario with stationary car
python test_scenario_2.py
- If you want some more traffic around, you can easily generate it by running
python generate_traffic.py -n [number_of_vehicles]