Apollo本地安装踩坑

官方安装教程:nav_ic_arrowicon-default.png?t=N7T8https://apollo.baidu.com/community/Apollo-Homepage-Document?doc=BYFxAcGcC4HpYIbgPYBtXIHQCMEEsATAV0wGNkBbWA5UyRFdZWVBEAU0hFgoIH0adPgCY%2BADwCiAVnEBBCeIAcATnETFcgMxKZkgGxKAwkoDsa3YoAi45WdH7xAIVk2ADGrNjZ7sYoCM5nIKvqqkenrCwgjY7MpSmsqartjCfrYI7OEEAGauCFJ%2BBKQEmKAUqEA

开局之重装UBuntu:之前把home分很大,根目录只留了40G,根本就不够用,这次分了200G给根目录

安装 Docker Engine

通过 Apollo 提供的安装脚本直接安装:

wget http://apollo-pkg-beta.bj.bcebos.com/docker_install.sh
bash docker_install.sh

下载安装 Apollo 源码

下载Apollo源码

GitHub - ApolloAuto/apollo: An open autonomous driving platform

直接到Github下载

注意一定要下载最新版,github上9.0.0版本的Apollo进入容器会遇到下面这个问题

ERROR: Skipping '//modules/map/pnc_map:cuda_util_test': no such package 'modules/map/pnc_map': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package. - /apollo/modules/map/pnc_map (06:24:58) ERROR: no such package 'modules/map/pnc_map': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package. - /apollo/modules/map/pnc_map

启动Apollo环境容器

bash docker/scripts/dev_start.sh

这里虽然打印出了成功启动环境容器,但是倒数第五行有一条报错bash: /apollo/scripts/docker_start_user.sh: Permission denied 如果不处理的话,在下一步进入Apollo环境容器会出现错误unable to find user test: no matching entries in passwd file

bash: /apollo/scripts/docker_start_user.sh: Permission denied
[ OK ] Congratulations! You have successfully finished setting up Apollo Dev Environment.
[ OK ] To login into the newly created apollo_dev_test container, please run the following command:
[ OK ]   bash docker/scripts/dev_into.sh
[ OK ] Enjoy!

bash: /apollo/scripts/docker_start_user.sh: Permission denied 说明没有权限访问,加一下权限再启动

chmod 777 /scripts/docker_start_user.sh

进入 Apollo 环境容器

输入以下命令进入容器

bash docker/scripts/dev_into.sh

编译

在Apollo目录下编译

# 优化模式编译(GPU)
bash apollo.sh build_opt_gpu
# 优化模式编译(CPU)
bash apollo.sh build_cpu

第一次编译比较漫长

由于我这里swap只分了4G,编译过程中报错

Server terminated abruptly (error code: 14, error message: ‘Socket closed’

错误原因是内存或者CPU设置过高导致编译出现内存不足

参考下面文章把swap重新分配了16G,重新编译就好了

如何增加Ubuntu上的Swap大小?-腾讯云开发者社区-腾讯云

启动 Apollo 进行播包验证

在Docker环境下启动Dreamview进行测试: 

bash scripts/bootstrap.sh

启动成功后可以在浏览器中打开链接进行查看Dreamview:https://localhost:8888

播放record数据

重新打开一个终端

cd apollo
wget https://apollo-system.cdn.bcebos.com/dataset/6.0_edu/demo_3.5.record

在启动dreamview的终端输入如下命令,就可以看到dreamview中demo的运行

cyber_recorder play -f demo_3.5.record --loop 

参考文章:

虚拟机下安装Ubuntu以及apollo(细节避坑和处理方案)_虚拟机可以编译apollo吗-优快云博客

【Apollo Auto踩坑】解决启动百度 Apollo报错 unable to find user test: no matching entries in passwd file_unable to find user no matching entries in passwd -优快云博客

-bash: ./*.sh: Permission denied_bash: ./1.sh: permission denied-优快云博客

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值