写于2020.4.3,此时最新的版本是0.9.8,安装环境为Ubuntu16.04
建议直接参考官网教程,忽略本教程https://carla.readthedocs.io/en/latest/start_quickstart/
一、Carla安装版本简介
Carla 安装分为Quick Start installation 和build installation,也就是快速安装和 编译安装。其中quick installation 是简易版,可以使用API(python、c++),但不包括高级的自定义和开发者选项。但是quick installation的最大好处是安装非常简单,所需的内存也比较小,大概十几个G。相比而言,build installation 需要安装Unreal engine 4(Ubuntu下大概70G) +Carla本身(20G)。所以没事就安装quick installation 版本吧。
二、Quick installation安装
Quick installation安装的命令行摘要。
有两种方法安装:
a). 通过 deb package installation
b). 通过github installaion,具体而言是到https://github.com/carla-simulator/carla/blob/master/Docs/download.md是下载你所 需的版本。
简单的就按照下面的Option A) 即deb package installation 的方法
# Install required modules Pygame and Numpy.
pip install --user pygame numpy
# Option A) deb package installation of CARLA 0.9.8 (only Linux)
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 304F9BC29914A77D &&
sudo add-apt-repository "deb [arch=amd64 trusted=yes] http://dist.carla.org/carla-0.9.8/ all main"
sudo apt-get update
sudo apt-get install carla
cd /opt/carla/bin
./CarlaUE4.sh
# Option B) GitHub repository installation
# Go to: https://github.com/carla-simulator/carla/blob/master/Docs/download.md
# Download the desired package and additional assets.
# Extract the package.
# Extract the additional assets in `/Import`
# Run CARLA (Linux)
./CarlaUE.sh
# Run CARLA (Windows)
> CarlaUE4.exe
# Run a script to test CARLA
cd PythonAPI/examples
python3 spawn_npc.py
三、详细的安装介绍
系统要求:官方建议最少4G的GPU 、8G内存。
1.依赖项: Python modules: Pygame and Numpy
pip install --user pygame numpy
2.添加CARLA 0.9.8 repository到Linux系统
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 304F9BC29914A77D &&
sudo add-apt-repository "deb [arch=amd64 trusted=yes] http://dist.carla.org/carla-0.9.8/ all main"
3.安装CARLA并检查/opt/文件夹中的安装、
sudo apt-get update
sudo apt-get install carla
cd /opt/carla
4.在CARLA 文件夹下,开一个terminal,运行 ./CarlaUE4.sh
补充: ./CarlaUE4.sh在/opt/carla/bin 中
四、参考链接: