Installation and Configuration Instructions¶
This section provides detailed instructions on how to install and configure the necessary tools for running CARLA, SUMO, and their co-simulation.
System Requirements¶
Before starting the installation, ensure your system meets the following requirements:
Operating System: Ubuntu 20.04 or later is recommended.
CPU: Multi-core processor (Intel i5 or better).
RAM: At least 16 GB of RAM.
Graphics: NVIDIA GPU with CUDA support (for CARLA).
Disk Space: At least 50 GB of free disk space.
Installing CARLA¶
Download CARLA:
Visit the CARLA official website. Download the latest release compatible with your operating system.
Extract CARLA:
Extract the downloaded file to a desired directory.
Example:
tar -xvf CARLA_0.9.13.tar.gz -C ~/carla
Install Dependencies:
CARLA requires several dependencies, which can be installed with the following command:
sudo apt-get update sudo apt-get install clang-8 lld-8 python3-pip python3-dev pip3 install --user pygame numpy
Running CARLA:
Navigate to the CARLA directory and run the simulator:
cd ~/carla ./CarlaUE4.sh
Installing SUMO¶
Add SUMO PPA:
Add the SUMO PPA to your package manager and update:
sudo add-apt-repository ppa:sumo/stable sudo apt-get update
Install SUMO:
Install SUMO and its dependencies:
sudo apt-get install sumo sumo-tools sumo-doc
Verify Installation:
Check if SUMO is correctly installed by running:
sumo --versionThis should display the installed version of SUMO.
Setting Up Co-Simulation¶
Clone Co-Simulation Repository:
Clone the repository that contains the co-simulation setup:
git clone https://github.com/example/sumo-carla-co-simulation.git cd sumo-carla-co-simulation
Install Python Dependencies:
Install the required Python packages:
pip3 install -r requirements.txt
Configure Environment:
Ensure that the paths to CARLA and SUMO are correctly set in the environment variables. You can add the following to your ~/.bashrc file:
export CARLA_ROOT=~/carla export SUMO_HOME=/usr/share/sumo export PYTHONPATH=$PYTHONPATH:~/carla/PythonAPI/carla
Run Co-Simulation:
Navigate to the co-simulation directory and run the script to start the co-simulation:
python3 run_co_simulation.py