百度Apollo搭建步骤

##一、安装ubuntu16.04

无需多说,安装完成打开命令行。

##二、下载Apollo镜像

git clone https://github.com/ApolloAuto/apollo

若提示未安装git,则安装git。

##三、安装docker-ce

如果你过去安装过其他版本的docker,先删掉:

sudo apt-get remove docker docker-engine docker.io

首先安装依赖:

sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common

信任 Docker 的 GPG 公钥:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

对于 amd64 架构的计算机,添加软件仓库:

sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable"

如果你是树莓派或其它ARM架构计算机,请运行:

echo "deb [arch=armhf] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list

最后安装

sudo apt-get update
sudo apt-get install docker-ce

把当前用户加到docker用户组中:
######添加docker用户组

sudo groupadd docker

######把自己加到docker用户组中

sudo gpasswd -a myusername docker

myusername是指你的用户名
######重启docker后台服务

sudo service docker restart

######切换当前用户到新group

newgrp - docker

######确认docker可以非sudo运行

docker ps

##四、安装ros(apollo里集成ros,就不用安装ros了)

参见:https://www.cnblogs.com/mohuishou-love/p/10079922.html

##五、.安装apollo-kernel(未安装,跳过)

######(1)在Apollo github下载百度编译好的内核
https://github.com/ApolloAuto/apollo-kernel/releases

安装参见:百度无人车ApolloAuto使用入门

https://blog.csdn.net/ss910/article/details/74998172

https://github.com/ApolloAuto/apollo-kernel
为运行Apollo软件提供了kernel层面的支持。
从这里下载linux-4.4.32-apollo-1.0.0.tar.gz:
https://github.com/ApolloAuto/apollo-kernel/releases
解压安装:
tar zxvf linux-4.4.32-apollo-1.0.0.tar.gz
cd install
sudo ./install_kernel.sh
重启系统。

##六、    安装apollo-platform (ubuntu14.04 ,跳过)

https://github.com/ApolloAuto/apollo-platform
相对于原版ROS,做出了如下改进:
。增强了ROS的去中心化特性;
。基于共享内存的更高效的通信;
。支持Protobuf;
下载apollo-platform并解压:
https://github.com/ApolloAuto/apollo-platform/releases

解压缩:
tar zxvf ros-indigo-apollo-1.0.0.x86_64.tar.gz

将文件夹中的ros拷贝到apollo工程中:

rsync -av ros/ ~/apollo/third_party/ros_x86_64
cd apollo
source ./third_party/ros_x86_64/setup.bash

##七、    Apollo编译

执行 service docker start 命令
######1.设置docker环境

cd apollo
bash docker/scripts/dev_start.sh -C #-C表示从中国镜像服务器下载,速度较快(很长时间5个小时)

bash docker/scripts/dev_into.sh

######2.编译Apollo

bash apollo.sh build  #若提示权限不足,则sudo su  (小时)

######3.启动人机交互界面(HMI)

bash scripts/bootstrap.sh

打开chrome浏览器,输入地址“localhost:8888”即可访问dreamview。

重新打开apollo,演示代码如下:

cd apollo
bash docker/scripts/dev_start.sh -C bash docker/scripts/dev_into.sh bash scripts/bootstrap.sh rosbag play demo_2.0.bag --loop #--loop设置循环回放 localhost:

##八、    Apollo演示(出错)

######1.启动docker的release环境

bash docker/scripts/release_start.sh

######2.进入release环境

bash docker/scripts/release_into.sh

######3.回放rosbag

python docs/demo_guide/rosbag_helper.py demo_1.5.bag #下载rosbag

下载测试数据包demo_2.0.bag      参见:https://blog.csdn.net/SingingFisher/article/details/81536096

输入 python docs/demo_guide/rosbag_helper.py demo_2.0.bag 来下载demo_2.0.bag数据包,不过由于资源在github上,所以很大可能是下载不下来的。来这里下载吧:https://pan.baidu.com/s/1jQwavKBzTvHHVnSlwxM1ZQ 密码:1nz8

此时你还在docker环境下:root@in_dev_docker:/apollo,把下载的demo_2.0.bag复制到此处。

cd ~/apollo
bash scripts/hmi.sh
在浏览器输入http://localhost:8887后回车,在Debug中开启Dreamview,然后点击右上方的Dreamview。
在另一个终端里输入:

rosbag play demo_1.5.bag --loop #--loop设置循环回放

打开chrome浏览器,输入地址“localhost:8888”即可在dreamview中看到demo演示。

问题:

(1) 遇到一个问题,总是 build failed

这时候在docker 环境下执行命令:

bazel query //...

然后再执行 build 那一句,就正常了。

(2) Error response from daemon: Container CONTAINER_NAME is not running

Build in Visual Studio Code

Install VSCode

The easiest way to install for Debian/Ubuntu based distributions is to download from https://code.visualstudio.com and install the .deb package (64-bit) either through the graphical software center if it's available or through the command line with:

sudo dpkg -i <file>.deb
sudo apt-get install -f # Install dependencies

Start VSCode

Start VSCode with the following command:

code

Open the Apollo project in VSCode

Use the keyboard shortcut (Ctrl+K Ctrl+O) to open the Apollo project.

Build the Apollo project in VSCode

Use the keyboard shortcut (Ctrl+Shift+B) to build the Apollo project.

Run all unit tests for the Apollo project in VSCode

Select the "Tasks->Run Tasks..." menu command and click "run all unit tests for the apollo project" from a popup menu to check the code style for the Apollo project.

If you are currently developing on 16.04, you will get a build error. As seen in the image below, 2 perception tests. To avoid this build error, refer to the how to build Apollo using Ubuntu 16.

(虚拟机+ubuntu16.04+vscode 编译没有出现错误)

Run a code style check task for the Apollo project in VSCode

Select the "Tasks->Run Tasks..." menu command and click "code style check for the apollo project" from a popup menu to check the code style for the Apollo project.

Clean the Apollo project in VSCode

Select the "Tasks->Run Tasks..." menu command and click "clean the apollo project" from a popup menu to clean the Apollo project.

Change the building option

You can change the "build" option to another one such as "build_gpu" (refer to the "apollo.sh" file for details) in ".vscode/tasks.json"

Test

bash docker/scripts/release_start.sh [release tag]

The HMI will automatically start and you can control each apollo module through any web browser by inputting IP address and port number, such as localhost:8887. You can get into the release container if quick fix needed.

bash docker/scripts/release_into.sh

参见:

https://github.com/ApolloAuto/apollo/blob/master/docs/howto/how_to_build_and_release.md#open-the-apollo-project-in-vscode

另外参见:

ubuntu16.04 安装 apollo-kernel,apollo-platform以及apollo

http://www.51apollo.com/2018/08/21/ubuntu16-04-安装-apollo-kernel,apollo-platform以及apollo/

百度阿波罗Apollo r3.0完整安装以及常用操作教程

https://blog.csdn.net/SingingFisher/article/details/81536096

https://blog.csdn.net/ss910/article/details/74998172

https://blog.csdn.net/qq_34906391/article/details/81478968     (重要)

https://blog.csdn.net/jinzhuojun/article/details/80210180

Apollo 2.5 安装踩坑指南

https://www.jianshu.com/p/2c287aaf58bc

百度Apollo搭建步骤(待更新)的更多相关文章

  1. 百度Apollo安装说明

    前言:最近在和百度Apollo合作,Apollo的人很nice,大家都在全力帮助我们解决问题.但Apollo系统有点难搞,安装起来很费劲,为了避免再次踩坑,留下笔记,流传后人,O(∩_∩)O. 1. ...

  2. Linux vagrant+virtualbox环境搭建步骤

    Linux vagrant+virtualbox环境搭建步骤 Vagrant 是一款用来构建虚拟开发环境的工具,非常适合 php/python/ruby/java 这类语言开发 web 应用. 我们可 ...

  3. 在Android Studio上测试运行,Unity发布成Android包的环境搭建步骤

      我用的是unity5.4.3版本,jdk是1.8.0_131版本,Android-SDK是r24.4.1版本,Android-NDK是r13b版本,作者是刚开始写博客,希望对在unity摸索的人有 ...

  4. Zookeeper集群搭建步骤及相关知识点深入了解

    1.zookeeper概念 zookeeper是一个分布式协调服务:a:zookeeper是为别的分布式程序服务的 b:zookeeper本身就是一个分布式程序(只要半数以上节点存活,zookeepe ...

  5. Java Web 环境搭建步骤(超详细,包括前期安装步骤)

    Java Web 环境搭建步骤 安装对应版本的JDK 配置环境变量 本人安装的路径是C盘,在path中加入C:\Program Files\Java\jdk1.8.0_65\bin 测试配置成功,cm ...

  6. SSH三大框架合辑的搭建步骤

    v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VM ...

  7. cocos2d-lua 3.5 android搭建步骤

    cocos2d-lua 3.5 android搭建步骤 如何安装eclipse,jdk,android sdk,ndk这里都不说了,资料很多,而且以前用eclipse搭建cocos2d-x-c++的时 ...

  8. IIS HTTP文件服务器搭建步骤

    利用IIS搭建HTTP文件服务器,可下载.上传(用户名验证) 1.右键网站,添加应用程序 2.物理路径,选择系统的目录配置,上一层 别名:CAPI3FileService 3.效果如下: 4.(以下步 ...

  9. [转]MonkeyRunner在Windows下的Eclipse开发环境搭建步骤(兼解决网上Jython配置出错的问题)

    MonkeyRunner在Windows下的Eclipse开发环境搭建步骤(兼解决网上Jython配置出错的问题)   网上有一篇shangdong_chu网友写的文章介绍如何在Eclipse上配置M ...

随机推荐

  1. topcoder srm 695 div1 -3

    1.称一个串的子串(连续一段)为$same$当且仅当这个子串所有字符都一样.子串不同当且仅当在原串中的起始位置不同.现在构造一个长度为$n$的只包含字符'a','b'的串$s$,使得$s$满足长度为$ ...

  2. EControl的安装

    EControl提供了运行期在窗体上进行界面设计的能力,手上的控件包是Delphi2010版的,在xe6下安装出现了一系列问题,弄了一晚上,总算搞定. 1.编译zDesign14.bpl包,修改DSN ...

  3. 为静态博客生成器WDTP移植了一款美美哒主题

    前言 关于这个主题的移植后公布,我已经联系了主题作者并取得同意,这个主题是一夜涕所写的Sgreen,预览图见下 关于WDTP 就是一个很方便很便携很快速的cpp编写的带gui跨平台的开源的静态博客生成 ...

  4. nohup 让进程在后台可靠运行的几种方法

    1. nohup nohup 无疑是我们首先想到的办法.顾名思义,nohup 的用途就是让提交的命令忽略 hangup 信号. nohup 的使用是十分方便的,只需在要处理的命令前加上 nohup 即 ...

  5. R dataframe 列名包含减号,列名自动变为点

    d<- data.frame(x = c(0, 1)) d<- data.frame(d, y = c(0,1)) names(d)[2]<- "a.-5" d ...

  6. WinMerge 过滤器用法

    WinMerge是一款开源的文件对比合并工具.http://winmerge.org/WinMerge提供了“过滤器”功能,可以在对比时排除特定的目录或文件. 1.编辑过滤规则工具 -> 过滤器 ...

  7. 谷歌大规模机器学习:模型训练、特征工程和算法选择 (32PPT下载)

    本文转自:http://mp.weixin.qq.com/s/Xe3g2OSkE3BpIC2wdt5J-A 谷歌大规模机器学习:模型训练.特征工程和算法选择 (32PPT下载) 2017-01-26  ...

  8. 【转载】谈谈自己对REST、SOA、SOAP、RPC、ICE、ESB、BPM知识汇总及理解

    转载自:https://blog.csdn.net/tantexian/article/details/48196453 SOA: 维基百科解释:SOA:面向服务的软件架构(Service Orien ...

  9. BMv2 simple_switch 运行时切换P4程序

    参考: [P4-dev] swapping p4 program using load_new_config and swap_configs commands BMv2 运行时切换P4程序 相关演示 ...

  10. A Simple Note on "P4FPGA: A Rapid Prototyping Framework for P4"

    论文:P4FPGA: A Rapid Prototyping Framework for P4 Github:https://github.com/p4fpga Reference: Han Wang ...