毕设利用carla做实验全记录(1)——安装carla(2023.4)

Windows系统

主要根据carla.org网站的documentation安装

参考:

windows10 下源码编译安装 CARLA0.9.13_carla windows_coke_9527的博客-CSDN博客

安装时有一些问题:

1. Two TCP ports and good internet connection. 2000 and 2001 by default. Make sure that these ports are not blocked by firewalls or any other applications.

检查2000和2001端口是否被占用:命令行窗口输入netstat -ano|findstr "2000"  如果什么也没有显示,就代表没有被占用。

2. 安装虚拟引擎时,命令行输入git clone --depth 1 -b carla https://github.com/CarlaUnreal/UnrealEngine.git

这一步可能报错: Support for password authentication was removed on August 13, 2021. 需要在github 的个人账户里添加token用作密码(百度怎么添加)

3. 安装visual studio2019的时候,正常安装的是2022版,2019要在旧版本里面找

windows kits文件夹是安装时带的,最好不要删 !

4. make pythonAPI时,发现\carla\PythonAPI\carla中没有dependencies这个文件夹,命令行中有以下报错:

fatal error C1083:无法打开 包括文件:“carla/version.h”:No such file or directory

将\carla\LibCarla\source\carla中的version.h.in重命名,把.in去掉,然后重新运行make pythonAPI,此时dependencies文件夹就出现了。

5. make pythonAPI时,发现\carla\PythonAPI\carla中没有dist这个文件夹,

首先,在下面这个网址中下载xerces-c-3.2.3-ha925a31_0.tar.bz2并解压缩;

https://anaconda.org/conda-forge/xerces-c/files?version=3.2.3

然后,把Library文件夹中的东西全部复制到\carla\Build\xerces-c-3.2.3-install;

Next,把D:\carla\Build\xerces-c-3.2.3-install\lib中的xerces-c_3.lib文件复制到D:\carla\PythonAPI\carla\dependencies\lib中;

删除D:\carla\Build\osm2odr-visualstudio,再运行make pythonAPI;

dist文件夹就出现了!

6. 用pythonAPI\examples中的代码测试时,

        # Terminal A 
        cd PythonAPI\examples
        pip3 install -r requirements.txt
        python3 generate_traffic.py  

        # Terminal B
        cd PythonAPI\examples
        python3 dynamic_weather.py 

就是这个时候,报错了:

ImportError: DLL load failed while importing libcarla: The specified module was not found.

解决方法:利用anaconda创建一个新的python虚拟环境,python设置为3.7版本的,在该虚拟环境中运行即可解决上述报错。

Over.

PS:查看carla版本和需要的pyhon版本——carla\PythonAPI\carla\dist,我的carla版本是0.9.14,需要的python版本是3.7。

  • 5
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值