Quickstart
Installation
First, install CARLA.
Download the CARLA release of version 0.9.14 as we experimented with this version.
Set the following environment variables:
export CARLA_ROOT=/path/to/carla
export PYTHONPATH="$CARLA_ROOT/PythonAPI/carla/":"$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.14-py3.7-linux-x86_64.egg":${PYTHONPATH}
To verify that CARLA has been correctly installed, run the following commands:
cd carla/
./CarlaUE4.sh
Second, setup the environment for EI-Drive.
Clone the repository:
git clone https://github.com/ucd-dare/EI-Drive
cd EI-Drive
Create the EI-Drive environment using Conda:
conda env create -f environment.yml
conda activate EI-Drive
cd EI-Drive
python setup.py develop
.setup.sh
To run EI-Drive, ensure that CARLA is running. You may use two terminals:
Terminal 1 for Carla:
cd carla/
./CarlaUE4.sh
Terminal 2 for EI-Drive script:
cd EI-Drive/
python EI_Drive.py
Running a scenario
Scenarios
To run a specific scenario, use:
python EI_Drive.py test_scenario=coop_perception_1
The command runs the script coop_perception_1.py, following the configuration file in the folder scenario_testing/config_yaml/config.yaml. The configuration files in EI-Drive are structured hierarchically:
config.yaml/
├── test_scenario/ (Designate the scenario)
│ ├── common_params
│ ├── vehicle_perception (Perception method)
│ ├── vehicle_localization (Localization method)
│ ├── game_map
│ ├── behavior
│ ├── controller
│ ├── traffic_manager
│ └── scenario
└── world/ (Designate the weather)
├── sunny.yaml
└── ...
The default perception method is oracle with blue bounding boxes. To enable object detection by YOLOv5, use:
python EI_Drive.py test_scenario=coop_perception_1 test_scenario.vehicle_perception.perception.activate=true test_scenario.vehicle_perception.perception.model=yolo
To simplify the usage of lengthy commands, common configurations are packaged as modules. It is recommended to utilize these modules in the configuration file for specific scenarios. For example, to achieve the same outcome as the command mentioned above, set vehicle_perception: perception_true in the config file coop_perception_1.yaml, where the config module perception_true.yaml is applied.
Cooperative Perception
To enable cooperative perception, open the config file in test_scenario/scenario/coop_perception_1.yaml that defines the details of the scenario. Set coop_perception: true for the ego vehicle with id=0 and the participant (RSU in this scenario) with id=-1. To disable it, set coop_perception: false for the ego vehicle.
Then run the simulation:
python EI_Drive.py test_scenario=coop_perception_1
Note
This config file is different from test_scenario/coop_perception_1.yaml mentioned above, even though they share the same name.
Communication Latency and Errors
To enable latency and errors, open the config file in test_scenario/scenario/coop_perception_1.yaml that defines the details of the scenario. Set transmission_latency: true and errors: true for the ego vehicle with id=0 and the participant (RSU in this scenario) with id=-1.
Then run the simulation:
python EI_Drive.py test_scenario=coop_perception_1
Note
Ensure that coop_perception: true has been set for both the RSU and the ego vehicle, as latency and errors only work when data communication exists.