https://carla.readthedocs.io/en/0.9.10/build_linux/
方法1 :Debian 安装 1. Set up the Debian repository in the system:sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1AF1527DE64CB8D9 sudo add-apt-repository "deb [arch=amd64] http://dist.carla.org/carla $(lsb_release -sc) main"2.安装carla 并且在 /opt/ 文件夹下可以找到
sudo apt-get update # Update the Debian package index
apt-cache madison carla-simulator # 查看可用版本
sudo apt-get install carla-simulator=0.9.10-1 # 安装相应版本 In this case, "0.9.10" refers to a CARLA version, and "1" to the Debian revision
cd /opt/carla-simulator # Open the folder where CARLA is installed
方法2:源码编译安装
安装依赖
Install dependencies
# Install dependencies sudo apt-get update && sudo apt-get install wget software-properties-common && sudo add-apt-repository ppa:ubuntu-toolchain-r/test && wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - && sudo apt-add-repository "deb http://apt.llvm.org/$(lsb_release -c --short)/ llvm-toolchain-$(lsb_release -c --short)-8 main" && sudo apt-get updateAdditional dependencies for Ubuntu 18.04
sudo apt-get install build-essential clang-8 lld-8 g++-7 cmake ninja-build libvulkan1 python python-pip python-dev python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev libxerces-c-dev && pip2 install --user setuptools && pip3 install --user -Iv setuptools==47.3.1 && pip2 install --user distro && pip3 install --user distroChange default clang version
python -m habitat_sim.utils.datasets_download --uids habitat_test_scenes --data-path ~/documents.... python -m habitat_sim.utils.datasets_download --uids habitat_example_objects --data-path ~/documents....安装虚拟引擎
这是Epic Games公司的私有库,所以要想从Github上下载UE的代码,你需要首先将你的Github账号与Epic Games公司账号绑定。进入EPIC官网,推荐先使用微软的账号先登陆。
然后进入个人中心,再进行关联。
在邮件点击确认,接着fork一下。
然后进入自己的github,就能看到这个私有库了。
克隆 Unreal Engine 4.24
git clone --depth=1 -b 4.24 https://github.com/EpicGames/UnrealEngine.git ~/UnrealEngine_4.24
报错 参考https://blog.csdn.net/weixin_41010198/article/details/119698015 进行token的配置 然后在密码位置输入配置好的token
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
再次克隆
git clone --depth=1 -b 4.24 https://github.com/EpicGames/UnrealEngine.git ~/UnrealEngine_4.24
下载补丁
wget https://carla-releases.s3.eu-west-3.amazonaws.com/Linux/UE_Patch/430667-13636743-patch.txt 430667-13636743-patch.txt patch --strip=4 < 430667-13636743-patch.txt
编译
./Setup.sh && ./GenerateProjectFiles.sh && make
**打开UE **
cd ~/UnrealEngine_4.24/Engine/Binaries/Linux && ./UE4Editor安装CARLA
sudo apt-get install aria2 git clone https://github.com/carla-simulator/carla #进入carla源代码目录 cd carla # 拉取更新远程分支列表 git remote update origin --prune #查看carla版本 git tag --list #签出0.9.10.1版本,UE4.24对应,必须对应,否则使用python会出错 git checkout -b 0.9.10.1 0.9.10.1 # 查看本地分支 git branch -vv ./Update.sh export UE4_ROOT=~/UnrealEngine_4.24
make CARLA
Make sure to run make PythonAPI to prepare the client and make launch for the server.
make launch # 可能要多试几遍
然后漫长的等待
构建PythonAPI
## 创建python 虚拟环境 conda create -n carla python=3.7 conda activate carla make PythonAPI ## 安装依赖包 pip install -r requirements.txt pip install networkx cd PythonAPI/examples python3 automatic_control.py



