Apollo transplant

Apollo transplant

surroundings

  • Platform ubuntu16.04
  • Apollo_kernel 1.0

Installation Steps

  • Step one: Install ubuntu (the official recommended Ubuntu 14.04.3)

    Steps one and two reference document path

    • Start software update

      The terminal performs the following command (new needs replacing Ubuntu download source, see the detailed steps https://www.cnblogs.com/DXGG-Bond/p/12200597.html)

      sudo apt-get update
      sudo apt-get upgrade
    • Type the following command to install the Linux 4.4 kernel

      sudo apt-get install linux-generic-lts-xenial
  • Step two: Install kernel Apollo

    • Download the distribution from releases section on github

      https://github.com/ApolloAuto/apollo-kernel/releases
    • After downloading the install kernel distributions

      tar zxvf linux-4.4.32-apollo-1.0.0.tar.gz
      cd install
      sudo bash install_kernel.sh
    • By rebootrestarting the system command

    • Confirm whether to start normal kernel Apollo

      Terminal type uname -r to see if the previous step to install the kernel Apollo

      uname -r
    • If the kernel is not what we want, probably because there are multiple cores within the system, you need to modify the order to start the kernel.

      • Run the following command to view the kernel boot sequence:

        grep 'menuentry' /boot/grub/grub.cfg
      • Some of the big red box of items (0,1), which is the bottom of the item (0-11), we want to start is: Linux 4.4.32-apollo-2-RT '--class, corresponding to 1 -> 6

      • Modified system kernel boot sequence / etc / default / grub of:

        • GRUB_DEFAULT = 0 will be amended as follows: "1> 6" as shown below:
      • Run the following command to update the boot sequence:

        sudo update-grub
      • After the restart run: uname -r, we expect this time will be the startup sequence. Results are as follows

        lhx@ubuntu:~$ uname -r
        4.4.32-apollo-1-RT

Note: The following procedure Reference documents: https: //github.com/ApolloAuto/apollo/blob/master/docs/quickstart/apollo_software_installation_guide.md

  • Step three: from github download the source code Apollo source code, and check the correct branch:

    ubuntu terminal execute the following code:

    git clone https://github.com/ApolloAuto/apollo.git
    cd apollo
    git checkout [release_branch_name]
  • Step four: APOLLO_HOMESet the environment variable using the following command:

    ubuntu terminal execute the following code:

    echo "export APOLLO_HOME=$(pwd)" >> ~/.bashrc && source ~/.bashrc
    source ~/.bashrc
  • Step five: Install Docker environment

    Docker容器是为Apollo建立构建环境的最简单方法。

    (详细Docker教程https://docs.docker.com/、官方安装指南https://docs.docker.com/install/linux/docker-ce/ubuntu/)

    具体是安装步骤如下图:

    • 操作系统要求如下(本人用Ubuntu16.04也能成功安装)

      • Disco 19.04
      • Cosmic 18.10
      • Bionic 18.04 (LTS)
      • Xenial 16.04 (LTS)
    • 若系统安装过docker需要卸载旧版本,可使用以下命令

      $ sudo apt-get remove docker docker-engine docker.io containerd runc
    • 安装软件包以允许apt通过HTTPS使用存储库:

      $ sudo apt-get install \
          apt-transport-https \
          ca-certificates \
          curl \
          gnupg-agent \
          software-properties-common
    • 添加Docker的官方GPG密钥:

      $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    • 验证是否成功添加官方密钥

      $ sudo apt-key fingerprint 0EBFCD88
      • 成功添加官方密钥终端将输出如下信息

        pub   rsa4096 2017-02-22 [SCEA]
              9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
        uid           [ unknown] Docker Release (CE deb) <[email protected]>
        sub   rsa4096 2017-02-22 [S]
    • 使用以下命令来设置稳定的存储库

      对于 amd64 架构的计算机,执行以下代码

      sudo add-apt-repository \
         "deb [arch=amd64] https://download.docker.com/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
    • 更新apt包索引

      sudo apt-get update
    • 安装最新版本的Docker Engine-Community和containerd

      $ sudo apt-get install docker-ce docker-ce-cli containerd.io
    • 验证是否成功安装Docker Engine-Community

      sudo docker run hello-world

      成功安装将在终端中打印如下信息

      Hello from Docker!
      This message shows that your installation appears to be working correctly.

注:以下步骤参考文档链接:https://docs.docker.com/install/linux/linux-postinstall/

  • 步骤六:以非root用户身份管理Docker

    • 创建docker组。

      $ sudo groupadd docker
    • 将您的用户添加到该docker组。

      $ sudo usermod -aG docker $USER
    • 重启docker后台服务

      sudo service docker restart
    • 切换当前用户到新group

      newgrp - docker
    • 确认docker可以非sudo运行

      docker p
  • 步骤七

    (可选)如果已经安装了Docker(在安装Apollo内核之前),则在以下行添加/etc/default/docker

DOCKER_OPTS = "-s overlay"
  • 步骤八:按照官方文档安装最新的nvidia-container-toolkit 。

    (此步本人电脑无对应的硬件GPU,无法进行安装)

建立阿波罗

注一下步骤均属于没有硬件下的一种模拟情况

参考:建立Apollo

启动容器

我们提供了一个名为dev-latest的构建映像。容器会将您当地的阿波罗仓库安装到/ apollo

bash docker/scripts/dev_start.sh   

此步骤在家的电脑上一直在下载超时。解决方式参考:解决 Docker pull 出现的 error pulling image configuration:

解决错误信息:Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

注一下为个人的百度云地址中粘贴地址

1. 安装/升级Docker客户端
推荐安装1.10.0以上版本的Docker客户端,参考文档 docker-ce

2. 配置镜像加速器
针对Docker客户端版本大于 1.10.0 的用户

您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://27yrtv95.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

进入容器

bash docker/scripts/dev_into.sh

构建模块

bash apollo.sh build

Note: 如果没有GPU,则可以使用以下脚本代替

bash apollo.sh build_cpu

Note: 如果您的计算机运行缓慢,则可以输入以下命令来限制CPU。

bash apollo.sh build --local_resources 2048,1.0,1.0

如何启动和运行阿波罗

参考:如何启动和运行阿波罗

在继续之前,请先检查并确保您在开发docker容器中。现在,您将需要从源代码构建。如果要运行整个系统,请确保具有nVidia GPU并已安装Linux nVidia驱动程序。即使您缺少Linux nVidia驱动程序,您仍然可以继续执行接下来的几个步骤,因为该系统将运行,但是将使用基于CUDA的感知和其他模块。

# To get a list of build commands
./apollo.sh
# To make sure you start clean
./apollo.sh clean
# This will build the full system and requires that you have an nVidia GPU with nVidia drivers loaded
bash apollo.sh build

如果您没有nVidia GPU,则系统将运行,但是将使用基于CUDA的感知和其他模块。您必须指定dbg调试模式或opt优化代码

./apollo.sh build_no_perception dbg

如果您对Dreamview前端进行了修改,则必须./apollo.sh build_fe 在运行完整版本之前运行。

如果计算机速度很慢,则可以输入以下命令来限制CPU。

bash apollo.sh build --local_resources 2048,1.0,1.0

运行阿波罗

请按照以下步骤启动Apollo。请注意,在运行系统之前,必须先构建系统。请注意,bootstrap.sh实际上会成功,但是如果您跳过构建步骤,则不会显示用户界面。

Start Apollo

运行Apollo将启动ROS核心,然后启动一个称为Dreamview的Web用户界面,这由引导脚本处理,因此,应在docker容器中运行:

# start module monitor
bash scripts/bootstrap.sh

访问Dreamview

通过打开您喜欢的浏览器(例如Chrome)访问Dreamview,请访问http:// localhost:8888,您应该看到此屏幕。实际系统中没有任何运行。

Guess you like

Origin www.cnblogs.com/DXGG-Bond/p/12299278.html