repo_id
stringlengths 19
138
| file_path
stringlengths 32
200
| content
stringlengths 1
12.9M
| __index_level_0__
int64 0
0
|
|---|---|---|---|
apollo_public_repos/apollo/docker/build
|
apollo_public_repos/apollo/docker/build/installers/install_openh264.sh
|
#!/usr/bin/env bash
###############################################################################
# Copyright 2019 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
# Fail on first error.
set -e
cd "$(dirname "${BASH_SOURCE[0]}")"
. ./installer_base.sh
apt_get_update_and_install nasm
VERSION="2.1.1"
PKG_NAME="openh264-${VERSION}.tar.gz"
CHECKSUM="af173e90fce65f80722fa894e1af0d6b07572292e76de7b65273df4c0a8be678"
DOWNLOAD_LINK="https://github.com/cisco/openh264/archive/v${VERSION}.tar.gz"
# Prepare
download_if_not_cached "$PKG_NAME" "$CHECKSUM" "$DOWNLOAD_LINK"
tar xzf ${PKG_NAME}
# Build and install.
pushd openh264-${VERSION}
make \
BUILDTYPE=Release \
PREFIX="${SYSROOT_DIR}" \
-j$(nproc) install
popd
ldconfig
apt_get_remove nasm
# Clean
rm -fr "${PKG_NAME}" "openh264-${VERSION}"
| 0
|
apollo_public_repos/apollo/docker/build
|
apollo_public_repos/apollo/docker/build/installers/install_paddle_deps.sh
|
#!/usr/bin/env bash
###############################################################################
# Copyright 2020 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
# Fail on first error.
set -e
cd "$(dirname "${BASH_SOURCE[0]}")"
. ./installer_base.sh
apt_get_update_and_install \
libsnappy-dev \
libleveldb-dev \
libffi-dev \
libssl-dev
# Clean up cache to reduce layer size.
apt-get clean && \
rm -rf /var/lib/apt/lists/*
| 0
|
apollo_public_repos/apollo/docker/build
|
apollo_public_repos/apollo/docker/build/installers/install_boost.sh
|
#!/usr/bin/env bash
###############################################################################
# Copyright 2020 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
# Fail on first error.
set -e
cd "$(dirname "${BASH_SOURCE[0]}")"
. ./installer_base.sh
if ldconfig -p | grep -q "libboost_system.so" ; then
info "Found existing Boost installation. Reinstallation skipped."
exit 0
fi
# PreReq for Unicode support for Boost.Regex
# icu-devtools \
# libicu-dev
apt_get_update_and_install \
liblzma-dev \
libbz2-dev \
libzstd-dev
# Ref: https://www.boost.org/
VERSION="1_74_0"
PKG_NAME="boost_${VERSION}.tar.bz2"
DOWNLOAD_LINK="https://boostorg.jfrog.io/artifactory/main/release/${VERSION//_/.}/source/boost_${VERSION}.tar.bz2"
CHECKSUM="83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1"
download_if_not_cached "${PKG_NAME}" "${CHECKSUM}" "${DOWNLOAD_LINK}"
tar xjf "${PKG_NAME}"
py3_ver="$(py3_version)"
# Ref: https://www.boost.org/doc/libs/1_73_0/doc/html/mpi/getting_started.html
pushd "boost_${VERSION}"
# A) For mpi built from source
# echo "using mpi : ${SYSROOT_DIR}/bin/mpicc ;" > user-config.jam
# B) For mpi installed via apt
# echo "using mpi ;" > user-config.jam
./bootstrap.sh \
--with-python-version=${py3_ver} \
--prefix="${SYSROOT_DIR}" \
--without-icu
./b2 -d+2 -q -j$(nproc) \
--without-graph_parallel \
--without-mpi \
variant=release \
link=shared \
threading=multi \
install
#--user-config=user-config.jam
popd
ldconfig
# Clean up
rm -rf "boost_${VERSION}" "${PKG_NAME}"
if [[ -n "${CLEAN_DEPS}" ]]; then
apt_get_remove \
liblzma-dev \
libbz2-dev \
libzstd-dev
fi
| 0
|
apollo_public_repos/apollo/docker/build
|
apollo_public_repos/apollo/docker/build/installers/install_release_deps.sh
|
#!/usr/bin/env bash
###############################################################################
# Copyright 2020 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
# Fail on first error.
set -e
CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
. ${CURR_DIR}/installer_base.sh
apt_get_update_and_install \
git \
vim \
silversearcher-ag
# More:
# lrzsz
# Note(storypku):
# patchelf was required for release build. We choose to build patchelf
# from source, as the apt-provided version 0.9-1 will create holes in
# binaries which causes size bloating. Will revisit this once the
# apt-provided patchelf get updated.
#
bash ${CURR_DIR}/install_patchelf.sh
# Clean up cache to reduce layer size.
apt-get clean && \
rm -rf /var/lib/apt/lists/*
| 0
|
apollo_public_repos/apollo/docker/build
|
apollo_public_repos/apollo/docker/build/installers/install_patchelf.sh
|
#!/usr/bin/env bash
###############################################################################
# Copyright 2021 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
# Fail on first error.
set -e
cd "$(dirname "${BASH_SOURCE[0]}")"
# shellcheck source=./installer_base.sh
. ./installer_base.sh
# Note(storypku):
# Build patchelf from source to avoid the patchelf-creating-holes-in-binaries-
# thus-causing-size-bloating problem.
VERSION="0.12"
PKG_NAME="patchelf-${VERSION}.tar.gz"
CHECKSUM="3dca33fb862213b3541350e1da262249959595903f559eae0fbc68966e9c3f56"
DOWNLOAD_LINK="https://github.com/NixOS/patchelf/archive/${VERSION}.tar.gz"
download_if_not_cached "${PKG_NAME}" "${CHECKSUM}" "${DOWNLOAD_LINK}"
tar xzf "${PKG_NAME}"
pushd "patchelf-${VERSION}" >/dev/null
./bootstrap.sh
./configure --prefix="${SYSROOT_DIR}"
make -j "$(nproc)"
make install
popd
rm -rf "${PKG_NAME}" "patchelf-${VERSION}"
ok "Done installing patchelf-${VERSION}"
| 0
|
apollo_public_repos/apollo/docker
|
apollo_public_repos/apollo/docker/setup_host/install_docker.sh
|
#!/usr/bin/env bash
###############################################################################
# Copyright 2018 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
ARCH="$(uname -m)"
##==============================================================##
## Note(storypku): DRY broken for this self-contained script.
##==============================================================##
BOLD='\033[1m'
RED='\033[0;31m'
WHITE='\033[34m'
NO_COLOR='\033[0m'
function info() {
(echo >&2 -e "[${WHITE}${BOLD}INFO${NO_COLOR}] $*")
}
function error() {
(echo >&2 -e "[${RED}ERROR${NO_COLOR}] $*")
}
##==============================================================##
function install_filesystem_support() {
local kernel_version="$(uname -r)"
if [ "$kernel_version" == "4.4.32-apollo-2-RT" ]; then
info "Apollo realtime kernel ${kernel_version} found."
sudo modprobe overlay
else
local kernel_version_major=${kernel_version:0:1}
local overlay_ko_path="/lib/modules/$kernel_version/kernel/fs/overlayfs/overlay.ko"
if [ "${kernel_version_major}" -ge 4 ] && [ -f "${overlay_ko_path}" ] ; then
info "Linux kernel ${kernel_version} has builtin overlay2 support."
sudo modprobe overlay
elif [ ${kernel_version_major} -ge 4 ]; then
error "Overlay kernel module not found at ${overlay_ko_path}." \
"Are you running on a customized Linux kernel? "
exit 1
else
error "Linux kernel version >= 4 expected. Got ${kernel_version}"
exit 1
fi
fi
}
function install_prereq_packages() {
sudo apt-get -y update
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
}
function setup_docker_repo_and_install() {
local issues_link="https://github.com/ApolloAuto/apollo/issues"
local arch_alias=
if [ "${ARCH}" == "x86_64" ]; then
arch_alias="amd64"
elif [ "${ARCH}" == "aarch64" ]; then
arch_alias="arm64"
else
error "Currently, ${ARCH} support has not been implemented yet." \
"You can create an issue at ${issues_link}."
exit 1
fi
curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=${arch_alias}] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -y docker-ce \
docker-ce-cli \
containerd.io
}
function post_install_settings() {
sudo usermod -aG docker $USER
sudo systemctl restart docker
# sudo groupadd docker
# sudo gpasswd -a $USER docker
# newgrp docker
}
function install_docker() {
# Architecture support, currently: x86_64, aarch64
install_filesystem_support
install_prereq_packages
setup_docker_repo_and_install
post_install_settings
}
function uninstall_docker() {
sudo apt-get -y remove docker docker-engine docker.io
sudo apt-get purge docker-ce
sudo sed -i '/download.docker.com/d' /etc/apt/sources.list
sudo apt-key del 0EBFCD88
}
function main() {
case $1 in
install)
install_docker
;;
uninstall)
uninstall_docker
;;
*)
install_docker
;;
esac
}
main "$@"
| 0
|
apollo_public_repos/apollo/docker
|
apollo_public_repos/apollo/docker/setup_host/setup_host.sh
|
#!/usr/bin/env bash
###############################################################################
# Copyright 2018 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
APOLLO_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"
# Setup core dump format.
if [ -e /proc/sys/kernel ]; then
echo "${APOLLO_ROOT_DIR}/data/core/core_%e.%p" | \
sudo tee /proc/sys/kernel/core_pattern
fi
# Setup ntpdate to run once per minute. Log at /var/log/syslog.
grep -q ntpdate /etc/crontab
if [ $? -ne 0 ]; then
echo "*/1 * * * * root ntpdate -v -u us.pool.ntp.org" | \
sudo tee -a /etc/crontab
fi
# Add udev rules.
sudo cp -r ${APOLLO_ROOT_DIR}/docker/setup_host/etc/* /etc/
# Add uvcvideo clock config.
grep -q uvcvideo /etc/modules
if [ $? -ne 0 ]; then
echo "uvcvideo clock=realtime" | sudo tee -a /etc/modules
fi
| 0
|
apollo_public_repos/apollo/docker
|
apollo_public_repos/apollo/docker/setup_host/README.md
|
# Host Setup
**It is strongly recommended that you run _setup_host.sh_ on your host machine before installing Apollo.**
## UDEV rules
All udev rule files under `etc/udev/rules.d` in the current folder are examples to show your how to map the specific devices to standard device names that Apollo recognizes below:
* 99-usbtty.rules: it maps 3 USB devices to novatel devices that Apollo uses to receive GPS signals.
* 99-webcam.rules (**deprecated in Apollo 3.5 and later versions**): it maps 3 USB camera devices with different names to what Apollo uses for different perception tasks: obstacle, traffic light and lane mark detections. All 3 cameras are front facing cameras, and wide angle cameras are normally used for obstacle and lane mark detection. Long focal lens camera is used for traffic light detection.
* 99-asucam.rules (**available in Apollo 3.5 and later versions**): it maps all FPD-Link cameras attached to ASU to what Apollo uses for different perception tasks at different positions. Please modify this file after you check your camera attributes and connect the cameras whose attributes correspond to the correct devices to be mapped.
## Identifying camera attributes
Please use the following command to check the device (_e.g. video0_) attributes:
`udevadm info --attribute-walk --name /dev/video0`
| 0
|
apollo_public_repos/apollo/docker
|
apollo_public_repos/apollo/docker/setup_host/cleanup_resources.sh
|
#!/usr/bin/env bash
###############################################################################
# Copyright 2018 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
if [ -f /.dockerenv ]; then
echo "Oops, this script is expected to run on host rather than from within container."
exit 1
fi
# Credit to https://gist.github.com/bastman/5b57ddb3c11942094f8d0a97d461b430
exited_containers="$(docker ps -qa --no-trunc --filter "status=exited")"
if [ -z "${exited_containers}" ]; then
echo "Congrats, no exited docker containers found."
else
echo "Exited containers found, cleanup ..."
docker rm ${exited_containers}
fi
dangling_images="$(docker images --filter "dangling=true" -q --no-trunc)"
if [ -z "${dangling_images}" ]; then
echo "Congrats, no dangling docker images found."
else
echo "Dangling images found, cleanup ..."
docker rmi ${dangling_images}
fi
dangling_volumes="$(docker volume ls -qf dangling=true)"
if [ -z "${dangling_volumes}" ]; then
echo "Congrats, no dangling docker volumes found."
else
echo "Dangling volumes found, cleanup ..."
docker volume rm ${dangling_volumes}
fi
echo "Docker cleaning up finished."
| 0
|
apollo_public_repos/apollo/docker/setup_host/etc/udev
|
apollo_public_repos/apollo/docker/setup_host/etc/udev/rules.d/99-usbtty.rules
|
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="novatel_gps", ATTRS{port_number}=="0", MODE="0666", SYMLINK+="novatel0", OWNER="apollo", GROUP="apollo"
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="novatel_gps", ATTRS{port_number}=="1", MODE="0666", SYMLINK+="novatel1", OWNER="apollo", GROUP="apollo"
SUBSYSTEM=="tty", SUBSYSTEMS=="usb-serial", DRIVERS=="novatel_gps", ATTRS{port_number}=="2", MODE="0666", SYMLINK+="novatel2", OWNER="apollo", GROUP="apollo"
| 0
|
apollo_public_repos/apollo/docker/setup_host/etc/udev
|
apollo_public_repos/apollo/docker/setup_host/etc/udev/rules.d/99-asucam.rules
|
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
SUBSYSTEM=="video4linux", SUBSYSTEMS=="pci", ATTR{name}=="FPD5-0106", MODE="0666", SYMLINK+="camera/front_6mm", OWNER="apollo", GROUP="apollo"
SUBSYSTEM=="video4linux", SUBSYSTEMS=="pci", ATTR{name}=="FPD5-0106", MODE="0666", SYMLINK+="camera/obstacle", OWNER="apollo", GROUP="apollo"
SUBSYSTEM=="video4linux", SUBSYSTEMS=="pci", ATTR{name}=="FPD5-0106", MODE="0666", SYMLINK+="camera/lanemark", OWNER="apollo", GROUP="apollo"
SUBSYSTEM=="video4linux", SUBSYSTEMS=="pci", ATTR{name}=="FPD4-0101", MODE="0666", SYMLINK+="camera/front_12mm", OWNER="apollo", GROUP="apollo"
SUBSYSTEM=="video4linux", SUBSYSTEMS=="pci", ATTR{name}=="FPD4-0101", MODE="0666", SYMLINK+="camera/trafficlights", OWNER="apollo", GROUP="apollo"
SUBSYSTEM=="video4linux", SUBSYSTEMS=="pci", ATTR{name}=="FPD1-0002", MODE="0666", SYMLINK+="camera/left_front", OWNER="apollo", GROUP="apollo"
SUBSYSTEM=="video4linux", SUBSYSTEMS=="pci", ATTR{name}=="FPD2-0103", MODE="0666", SYMLINK+="camera/right_front", OWNER="apollo", GROUP="apollo"
SUBSYSTEM=="video4linux", SUBSYSTEMS=="pci", ATTR{name}=="FPD3-0002", MODE="0666", SYMLINK+="camera/rear_6mm", OWNER="apollo", GROUP="apollo"
| 0
|
apollo_public_repos/apollo
|
apollo_public_repos/apollo/docs/README.md
|
# Apollo documents
## Quick Start Guide
[README](./02_Quick%20Start/README.md) - A hardware and software guide to setting up Apollo, segregated by versions
## Technical Tutorial
[README](technical_tutorial/README.md) - Everything you need to know about Apollo. Written as individual versions with links to every document related to that version.
## Cyber
[README](./CyberRT/README.md) - All you need to know about Apollo Cyber
## Specs
[README](./10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Lidar/README.md) - A Deep dive into Apollo's Hardware and Software specifications (only recommended for expert level developers that have successfully installed and launched Apollo)
## Howto Guides
[README](howto/README.md) - Brief technical solutions to common problems that developers face during the installation and use of the Apollo platform
## FAQs
[README](FAQS/README.md) - Commonly asked questions about Apollo's setup and modules
## Technical Documents
[README](technical_documents/README.md) - Some documents helping developers on code reading and algorithm understanding
| 0
|
apollo_public_repos/apollo
|
apollo_public_repos/apollo/docs/BUILD
|
load("//tools/install:install.bzl", "install")
package(
default_visibility = ["//visibility:public"],
)
install(
name = "install",
data = [
":run_files",
],
)
filegroup(
name = "run_files",
srcs = glob([
"demo_guide/*.py",
]),
)
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/how_to_install_apollo_kernel_cn.md
|
# 如何为 Apollo 安装低时延/实时内核
本文档描述了在 Ubuntu 18.04 上安装低时延 (Low-Latency) 或实时 (Realtime)内核及
Nvidia 驱动的步骤。
## 在开始之前
仅在实车上运行 Apollo 软件栈才需要低时延或实时内核。 如果您的目的只是基于 Apollo
平台开发/测试您的算法,或者运行仿真软件(如 Lgsvl 模拟器),则可能您根本不需要安
装这里描述的低时延或实时内核。
## Ubuntu 自带的低时延内核
Ubuntu 软件仓库中的低时延内核足以为实车上运行 Apollo 提供低(或者零)时延。在其
内核配置中,任务抢占式 (PREEMPT)优化是开启了的,时延可低至 0.1 毫秒。
下面是安装 Ubuntu 低时延内核的步骤:
1. 安装最新的低时延内核及其头文件
```bash
sudo apt-get update
sudo apt-get install linux-image-$(uname -r)-lowlatency linux-headers-$(uname -r)-lowlatency
```
**注意**:
> 如果在执行了`sudo apt-get update`后通过`apt list --upgradable`查看有新版本内核
> ,请将上述命令中的`$(uname -r)`改为 Ubuntu 软件仓库中最新的内核版本号。截至本
> 文写作时(2020 年 12 月 2 日),Ubuntu 软件仓库中的最新内核是`5.4.0-56`。
2. 重启系统以启动低时延内核。
```bash
sudo reboot
```
## 安装实时内核
请按
照[ROS2:构建实时 Linux](https://index.ros.org/doc/ros2/Tutorials/Building-Realtime-rt_preempt-kernel-for-ROS-2)
中描述的步骤来构建和安装最新的稳定版实时内核。虽然该文档是按照 Ubuntu 20.04 来讲
的,但其中的步骤完全适用于 Ubuntu 18.04。
## 安装 Nvidia 驱动
### 在低时延内核上安装 Nvidia 驱动
对 Ubuntu 低时延内核而言,安装 Nvidia 驱动的步骤比较简单:
1. 从[CUDA Toolkit 下载](https://developer.nvidia.com/cuda-downloads?target_os=Linux)
页下载并安装 Nvidia 最新驱动。
在选择安装类型(Installer Type)时,建议选择 **本地安装(deb[local])** 或者 **网络
安装(deb(network])** 模式。


**注意**:
> 可能需要注册并签署 CUDA 最终用户使用协议(EULA) 才可以下载 Nvidia 驱动及 CUDA
> 安装包。
比如,如下是在 x86_64 架构的 Ubuntu 18.04.5 上通过 **本地安装 Deb 软件包**的方式
安装 Nvidia 驱动:
```bash
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda-repo-ubuntu1804-11-1-local_11.1.1-455.32.00-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-11-1-local_11.1.1-455.32.00-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu1804-11-1-local/7fa2af80.pub
sudo apt-get update
sudo apt-get install nvidia-driver-455
```
**注意**:
> `nvidia-driver-XXX` 的数字应该与 CUDA 本地安装包中的数字一致。本例中是`455`。
2. 重启系统。
3. 运行`nvidia-smi` 检查是否生效。
### 在实时 (PREEMPT_RT) 内核上安装 Nvidia 驱动
请先按照低时延内核 Nvidia 驱动的安装方法完成 Nvidia 驱动的初步安装。请注意,由于
Nvidia 驱动不支持实时内核,所以在上面执
行`sudo apt-get install nvidia-driver-455` 的步骤时会报如下错误消息:
```text
The kernel you are installing for is a PREEMPT_RT kernel!
The NVIDIA driver does not support real-time kernels. If you
are using a stock distribution kernel, please install
a variant of this kernel that does not have the PREEMPT_RT
patch set applied; if this is a custom kernel, please
install a standard Linux kernel. Then try installing the
NVIDIA kernel module again.
*** Failed PREEMPT_RT sanity check. Bailing out! ***
```
我们可以通过在编译 Nvidia 驱动的时候设置 `IGNORE_PREEMPT_RT_PRESENCE=1` 来绕过这
一点。
步骤如下:
1. 运行如下命令来编译 Nvidia 驱动:
```bash
# 切换到Nvidia 驱动的源码目录
cd "$(dpkg -L nvidia-kernel-source-455 | grep -m 1 "nvidia-drm" | xargs dirname)"
# 设置 IGNORE_PREEMPT_RT_PRESENCE=1 来编译Nvidia 驱动
sudo env NV_VERBOSE=1 \
make -j8 NV_EXCLUDE_BUILD_MODULES='' \
KERNEL_UNAME=$(uname -r) \
IGNORE_XEN_PRESENCE=1 \
IGNORE_CC_MISMATCH=1 \
IGNORE_PREEMPT_RT_PRESENCE=1 \
SYSSRC=/lib/modules/$(uname -r)/build \
LD=/usr/bin/ld.bfd \
modules
sudo mv *.ko /lib/modules/$(uname -r)/updates/dkms/
sudo depmod -a
```
2. 重启系统
3. 运行 `nvidia-smi` 来检查 Nvidia 驱动是否正常工作。
## (可选)安装 ESD-CAN 内核驱动
如有需要,可按照
[ESD-CAN 安装说明](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)
来编译安装 ESD-CAN 驱动。
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/apollo_software_installation_guide_cn.md
|
# Apollo软件安装指南
本文档介绍了在Ubuntu 18.04.5 LTS(Bionic Beaver)(建议用于Apollo 6.0的Ubuntu版本)上安装Apollo软件所需的步骤。
## 前期准备
在开始之前,请确保已按照[必备软件安装指南](./prerequisite_software_installation_guide.md)中的说明完成了所有必备步骤。
同时也要确保Docker正在运行。键入`systemctl status docker`以检查Docker守护进程的运行状态,并根据需要键入`systemctl start docker`以启动 Docker。
## 下载Apollo源文件
运行以下命令克隆[Apollo的GitHub仓库](https://github.com/ApolloAuto/apollo.git)。
```bash
# 使用 SSH 的方式
git clone git@github.com:ApolloAuto/apollo.git
# 使用 HTTPS 的方式
git clone https://github.com/ApolloAuto/apollo.git
```
切换到`master`分支:
```bash
cd apollo
git checkout master
```
对于中国用户, 如果从GitHub克隆仓库有困难,可参考[国内环境下如何克隆Apollo仓库](./how_to_clone_apollo_repo_from_china_cn.md)。
(可选)为方便起见,可以在Apollo的根目录运行以下命令来设置指向该目录的环境变量`APOLLO_ROOT_DIR`:
```bash
echo "export APOLLO_ROOT_DIR=$(pwd)" >> ~/.bashrc && source ~/.bashrc
```
 在下面的章节中,我们会把Apollo的根目录称为`$APOLLO_ROOT_DIR`。
## 启动Docker容器
在`${APOLLO_ROOT_DIR}`目录, 输入:
```bash
bash docker/scripts/dev_start.sh
```
来启动Apollo的Docker开发容器。
如果成功,你将在屏幕下方看到以下信息:
```bash
[ OK ] Congratulations! You have successfully finished setting up Apollo Dev Environment.
[ OK ] To login into the newly created apollo_dev_michael container, please run the following command:
[ OK ] bash docker/scripts/dev_into.sh
[ OK ] Enjoy!
```
## 进入Apollo的Docker容器
运行以下命令以登录到新启动的容器:
```bash
bash docker/scripts/dev_into.sh
```
## 在容器内构建Apollo
在Docker容器的`/apollo`目录中, 输入:
```bash
./apollo.sh build
```
以构建整个Apollo工程。或者输入
```bash
./apollo.sh build_opt
```
来进行优化模式的构建。可以参考[Apollo构建和测试说明](./apollo_build_and_test_explained.md)来全面了解Apollo的构建和测试。
## 启动并运行Apollo
请参考[如何启动并运行Apollo](./how_to_launch_and_run_apollo.md)中的[运行Apollo](./how_to_launch_and_run_apollo.md#run-apollo)部分。
## (可选)在Dreamview中支持新的车型
为了在Dreamview中支持新的车型,请按照以下步骤操作:
1. 在`modules/calibration/data`目录下为你的车型创建一个新文件夹。
2. 在`modules/calibration/data`文件夹中已经有一个叫作`mkz_example`的示例文件夹。请参考此结构,并以此结构包含所有必需的配置文件。如果需要的话,请记得使用自己的参数更新配置文件。
3. 重启Dreamview,你将能够在可选车型列表中看到你的新车型(名称与你创建的文件夹相同)。
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/apollo_software_installation_guide_package_method.md
|
# Installation - Package Method
This article introduces how to install Apollo using the package (deb package) method. The package method is faster and requires no compilation. However, there is only one environment supported, so if you want to install in a custom environment, please refer to source installation method.
This article assumes that the user has a basic working knowledge of Linux.
## Step 1: Install the base software
### 1. Install Ubuntu Linux
For steps to install Ubuntu 18.04+, see the [official installation guide][official_installation_guide]
> Note: While other distributions of Linux may be fine, we have only tested Apollo on a pure Ubuntu System, Ubuntu 18.0.5 LTS (Bionic Beaver), so we recommend that you use Ubuntu 18.04.5 as the host OS.
To update the software after installation:
```shell
sudo apt-get update
sudo apt-get upgrade
```
> Note: To complete the update, you need to ensure that you can access the network.
### 2. Install Docker Engine
Apollo relies on Docker 19.03+. To install the Docker engine, see [install Docker Engine on Ubuntu][install_docker_engine_on_ubuntu]
## Step 2: Install Apollo environment manager tool
The Apollo environemnt manager tool is a command line tool for developers to manage and launch apollo environment containers.
### 1. Add apt source
Add apt source and key:
```
sudo bash -c "echo 'deb https://apollo-pkg-beta.cdn.bcebos.com/neo/beta bionic main' >> /etc/apt/sources.list"
wget -O - https://apollo-pkg-beta.cdn.bcebos.com/neo/beta/key/deb.gpg.key | sudo apt-key add -
sudo apt update
```
### 2. Install apollo-env-manager
Run the following command to install apollo environment manager tool:
```shell
sudo apt install apollo-neo-env-manager-dev
```
If successful, you can use it directly
```shell
aem -h
```
For more detailed usage of `aem`, please refer to the [Apollo Environment Manager](../03_Package%20Management/apollo_env_manager.md) documentation.
## Step 3: Start and enter apollo env container
### 1. Create workspace
Create a directory as a workspace
```shell
mkdir application-demo
cd application-demo
```
### 2. Start apollo env container
```shell
aem start
```
> Note: The default environment image contains gpu-related dependencies. If you want to start the container as a gpu, you can use the `start_gpu` subcommand.
If everything works, you will see a prompt similar to the one below:
![container started][container_started.png]
### 3. Enter apollo env container
```shell
aem enter
```
After successful execution of the command, the following message will be displayed and you will be in the Apollo runtime container.
```shell
user_name@in-dev-docker:/apollo_workspace$
```
The workspace folder will be mounted to path `/apollo_workspace` of container.
### 4. Initialize workspace
```shell
aem init
```
Now, the apollo environment manager tool installed and apollo env container launched, please follow the [Launch and run Apollo](../03_Package%20Management/launch_and_run_apollo_package_method.md) documentation to run apollo or follow the [QuickStart](../02_Quick%20Start/apollo_8_0_quick_start.md) documentation to install different modules as needed for different usage scenarios
[official_installation_guide]: <https://ubuntu.com/tutorials/install-ubuntu-desktop>
[install_docker_engine_on_ubuntu]: <https://docs.docker.com/engine/install/ubuntu/>
[quickstart_project]: <https://apollo-pkg-beta.cdn.bcebos.com/e2e/apollo_v8.0.tar.gz>
[pass_request.png]: <https://bce.bdstatic.com/doc/Apollo-Homepage-Document/Apollo_Doc_CN_8_0/pass_request_b228e30.png>
[container_started.png]: <https://bce.bdstatic.com/doc/Apollo-Homepage-Document/Apollo_Doc_CN_8_0/container_started_4ee24d4.png>
[install_core.png]: <https://bce.bdstatic.com/doc/Apollo-Homepage-Document/Apollo_Doc_CN_8_0/install_core_0b0d533.png>
[feedback_collection_page]: <https://studio.apollo.auto/community/article/163>
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/how_to_setup_dual_ipc.md
|
# How to set up Apollo 3.5's software on Dual-IPCs
The modules of Apollo 3.5 are separately launched from two industrial PCs. This guide introduces the hardware/software setup on two parallel IPCs.
## Software
- Apollo 3.5
- Linux precision time protocol
## Runtime Framework
- CyberRT
## Installation
There are two steps in the installation process:
- Clone and install linux PTP code on both of IPCs
- Clone Apollo 3.5 Github code on both of IPCs
### Clone and install linux PTP
Install PTP utility and synchorize the system time on both of IPCs.
```sh
git clone https://github.com/richardcochran/linuxptp.git
cd linuxptp
make
# on IPC1:
sudo ./ptp4l -i eth0 -m &
# on IPC2:
sudo ./ptp4l -i eth0 -m -s &
sudo ./phc2sys -a -r &
```
### Clone Apollo 3.5
Install Apollo 3.5 on local ubuntu machine
```sh
git clone https://github.com/ApolloAuto/apollo.git
```
### Build Docker environment
Refer to the [How to build docker environment](./apollo_software_installation_guide.md)
### Run CyberRT on both of IPCs
1. Change directory to apollo
```sh
cd apollo
```
2. Start docker environment
```sh
bash docker/scripts/dev_start.sh
```
3. Enter docker environment
```sh
bash docker/scripts/dev_into.sh
```
4. Build Apollo in the Container:
```sh
bash apollo.sh build_opt_gpu
```
5. Change CYBER_IP in cyber/setup.bash to IPC1's ip address:
```sh
source cyber/setup.bash
```
6. Start CyberRT and Dreamview:
```sh
bash scripts/bootstrap.sh
```
7. Open Chrome and go to localhost:8888 to access Apollo Dreamview:
- on IPC1
The header has 3 drop-downs, mode selector, vehicle selector and map selector.

Select mode, for example "ipc1 Mkz Standard Debug"

Select vehicle, for example "Mkz Example"

Select map, for example "Sunnyvale Big Loop"

All the tasks that you could perform in DreamView, in general, setup button turns on all the modules.

All the hardware components should be connected to IPC1 and the modules, localization, perception, routing, recorder, traffic light and transform, are allocated on IPC1 also.
Module Control on sidebar panel is used to check the modules on IPC1

In order to open dreamview on IPC2, user must stop it on IPC1 by using the below command:
```sh
# Stop dreamview on IPC1
bash scripts/bootstrap.sh stop
```
- on IPC2
Change CYBER_IP in cyber/setup.bash to IPC2's ip address:
```sh
source cyber/setup.bash
```
Start dreamview on IPC2 by using the below command:
```sh
# Start dremview on IPC2
bash scripts/bootstrap.sh
```
Select mode, vehicle and map on dreamview as the same operations on IPC1

The modules - planning, prediction and control are assigned on IPC2.
Module Control on sidebar panel is used to check the modules on IPC2

[See Dreamview user's guide](../13_Apollo%20Tool/%E5%8F%AF%E8%A7%86%E5%8C%96%E4%BA%A4%E4%BA%92%E5%B7%A5%E5%85%B7Dremview/dreamview_usage_table.md)
8. How to start/stop Dreamview:
The current version of Dreamview shouldn't run on the different IPCs simultaneously, so the user must perform it alternatively on IPC1 or IPC2.
The code below can be used to stop Dreamview on IPC2 and start it on IPC1.
```sh
# Stop Dreamview on IPC2
bash scripts/bootstrap.sh stop
# Start Dreamview on IPC1
bash scripts/bootstrap.sh
```
9. Cyber monitor
Cyber monitor is CyberRT's tool used to check the status of all of the modules on local and remote machines. The User may observe the activity status of all the hardware and software components and ensure that they are working correctly.
## Future work (To Do)
- Multiple Dreamviews may run simultaneously
- Fix a bug that modules are still greyed-out after clicking the setup button. Users may check each modules' status by using the command
```sh
ps aux | grep mainboard
```
# License
[Apache license](../../LICENSE)
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/prerequisite_software_installation_guide.md
|
# Pre-requisite Software Installation Guide
This article describes all the pre-requisite steps needed before installing
Apollo.
- Installing Ubuntu Linux
- Installing NVIDIA GPU Driver
- Installing Docker Engine
- Installing NVIDIA Container Toolkit
 Working knowledge of Linux is assumed for
successful software installation in this guide.
## Installing Ubuntu Linux
Although other Linux distributions may be OK, we have only tested Apollo on
Ubuntu systems. To be specific,
[Ubuntu 18.04.5 LTS (Bionic Beaver)](https://releases.ubuntu.com/18.04.5/). So
we would recommend using Ubuntu 18.04.5+ (including Ubuntu 20.04) as the host
system.
The steps required to install Ubuntu 18.04+ are available at
[Tutorial from ubuntu.com on How to Install Ubuntu](https://ubuntu.com/tutorials/install-ubuntu-desktop).
Please follow the guide there for a successful Ubuntu installation.
Don't forget to perform software updates after the installation is done:
```shell
sudo apt-get update
sudo apt-get upgrade
```
 Internet access is needed for successful software
updates. Make sure either WiFi or Ethernet cable is connected to a network with
Internet access. You might need to configure the network for your host if the
connected network is not using the Dynamic Host Configuration Protocol (DHCP).
## Installing NVIDIA GPU Driver for Nvidia GPU
The Apollo runtime in the vehicle requires NVIDIA GPU Driver.
According to
[How to Install NVIDIA Driver](https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#how-do-i-install-the-nvidia-driver),
the recommended way for Ubuntu is to use the `apt-get` commands, or use an
official "runfile" from
[www.nvidia.com/en-us/drivers/unix/](https://www.nvidia.com/en-us/drivers/unix/)
For Ubuntu 18.04+, you can simply run:
```
sudo apt-get update
sudo apt-add-repository multiverse
sudo apt-get update
sudo apt-get install nvidia-driver-455
```
You can type `nvidia-smi` to check if NVIDIA GPU works fine on your host. (You
may restart your host for the changes to take effect.) On success, the following
message will be shown.
```
Prompt> nvidia-smi
Mon Jan 25 15:51:08 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.27.04 Driver Version: 460.27.04 CUDA Version: 11.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 GeForce RTX 3090 On | 00000000:65:00.0 On | N/A |
| 32% 29C P8 18W / 350W | 682MiB / 24234MiB | 7% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1286 G /usr/lib/xorg/Xorg 40MiB |
| 0 N/A N/A 1517 G /usr/bin/gnome-shell 120MiB |
| 0 N/A N/A 1899 G /usr/lib/xorg/Xorg 342MiB |
| 0 N/A N/A 2037 G /usr/bin/gnome-shell 69MiB |
| 0 N/A N/A 4148 G ...gAAAAAAAAA --shared-files 105MiB |
+-----------------------------------------------------------------------------+
```
## Installing ROCm for AMD GPU
- Follow instructions at [ROCm
v5.1](https://docs.amd.com/bundle/ROCm-Installation-Guide-v5.1/page/Prerequisite_Actions.html) or above upto running `amdgpu-install`.
- When running `amdgpu-install` command use `--usecase=hiplibsdk,rocm,dkms`
- Add user to the `render` group: `sudo usermod -a -G render $USER`.
- Now you should be able to run `rocminfo` and `rocm-smi`
```bash
$ rocminfo
ROCk module is loaded
=====================
HSA System Attributes
=====================
Runtime Version: 1.1
System Timestamp Freq.: 1000.000000MHz
Sig. Max Wait Duration: 18446744073709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)
Machine Model: LARGE
System Endianness: LITTLE
==========
HSA Agents
==========
*******
Agent 1
*******
Name: AMD EPYC Embedded 7292P 16-Core Processor
Uuid: CPU-XX
Marketing Name: AMD EPYC Embedded 7292P 16-Core Processor
Vendor Name: CPU
Feature: None specified
Profile: FULL_PROFILE
Float Round Mode: NEAR
Max Queue Number: 0(0x0)
Queue Min Size: 0(0x0)
Queue Max Size: 0(0x0)
Queue Type: MULTI
Node: 0
Device Type: CPU
...
*******
Agent 2
*******
Name: gfx90a
Uuid: GPU-4e8d8d5c57524677
Marketing Name:
Vendor Name: AMD
Feature: KERNEL_DISPATCH
Profile: BASE_PROFILE
Float Round Mode: NEAR
Max Queue Number: 128(0x80)
Queue Min Size: 64(0x40)
Queue Max Size: 131072(0x20000)
Queue Type: MULTI
Node: 1
Device Type: GPU
...
*** Done ***
$ rocm-smi
======================= ROCm System Management Interface =======================
================================= Concise Info =================================
GPU Temp AvgPwr SCLK MCLK Fan Perf PwrCap VRAM% GPU%
0 31.0c 34.0W 800Mhz 1600Mhz 0% auto 300.0W 0% 0%
================================================================================
============================= End of ROCm SMI Log ==============================
```
## Installing Docker Engine
Apollo 6.0+ requires Docker 19.03+ to work properly. Just follow the
[Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)
doc to install docker engine.
Docker-CE on Ubuntu can also be setup using Docker’s official convenience
script:
```bash
curl https://get.docker.com | sh
sudo usermod -a -G docker $USER
sudo systemctl start docker && sudo systemctl enable docker
```
You can choose whichever method you would prefer. Just don't forget the
[Post-installation Actions for Linux](https://docs.docker.com/engine/install/linux-postinstall/),
esp. the section on
[Manage Docker as Non-root User](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)
and
[Configure Docker to Start on Boot](https://docs.docker.com/engine/install/linux-postinstall/#configure-docker-to-start-on-boot).
There is also a
[dedicated bash script](../../docker/setup_host/install_docker.sh) Apollo
provides to ease Docker installation, which works both for X86_64 and AArch64
platforms.
## Installing NVIDIA Container Toolkit for Nvidia GPU
The NVIDIA Container Toolkit for Docker is required to run Apollo's CUDA based
Docker images.
You can run the following to install NVIDIA Container Toolkit:
```
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get -y update
sudo apt-get install -y nvidia-docker2
```
 Don't forget to restart the Docker daemon for
the changes above to take effect.
```
sudo systemctl restart docker
```
Refer to
[NVIDIA Container Toolkit Installation Guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html)
for more.
## What's Next
With successful installation of the pre-requisites above, you can now move to
"Git Clone Apollo Repo" section now.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/how_to_document_code.md
|
# How to Document Source Code in Apollo
Apollo uses [Doxygen](https://www.doxygen.nl/index.html) for source code
documentation. Developers who are not familiar with Doxygen can refer to
official Doxygen Manual(https://www.doxygen.nl/manual/index.html) for an
in-depth knowledge on documenting code with Doxygen. This document serves as a
brief version of
[Doxygen Manual: Documenting the code](https://www.doxygen.nl/manual/docblocks.html))
focusing specificly on C/C++ and Python.
We will take
[modules/common/math/kalman_filter.h](../../modules/common/math/kalman_filter.h)
as an example to show you how to document code the Doxygen way. Note that
Javadoc style is preferred rather than Qt style for comment blocks.
### File
```c++
/**
* @file
* @brief Defines the templated KalmanFilter class.
*/
```
### Namespace
```
/**
* @namespace apollo::common::math
* @brief apollo::common::math
*/
namespace apollo {
namespace common {
namespace math {
```
### Class
```
/**
* @class KalmanFilter
*
* @brief Implements a discrete-time Kalman filter.
*
* @param XN dimension of state
* @param ZN dimension of observations
* @param UN dimension of controls
*/
template <typename T, unsigned int XN, unsigned int ZN, unsigned int UN>
class KalmanFilter {
public:
...
```
### Function
```
/**
* @brief Sets the initial state belief distribution.
*
* @param x Mean of the state belief distribution
* @param P Covariance of the state belief distribution
*/
void SetStateEstimate(const Eigen::Matrix<T, XN, 1> &x,
const Eigen::Matrix<T, XN, XN> &P) {
...
}
/**
* @brief Get initialization state of the filter
* @return True if the filter is initialized
*/
bool IsInitialized() const { return is_initialized_; }
```
### Public / protected class member variables
```
protected:
/// Mean of current state belief distribution
Eigen::Matrix<T, XN, 1> x_;
```
> Note: There is no public/protected member variables for `KalmanFilter`. The
> code above serves for illustration purpose only.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/apollo_secure_upgrade_user_guide.md
|
# Apollo Secure Upgrade SDK
Currently, most software upgrade solutions are not securely protected.
Therefore, devices are exposed to various security threats during the upgrade
procedure. Apollo secure upgrade SDK provides secure upgrade capabilities, and
can be easily integrated to make the upgrade process more secure and robust.
## Features
1. Packages are encrypted and signature protected in storing and transmitting
phases.
2. Server and device can authenticate each other.
3. Cryptographic resources are protected properly.
4. Server provides customized authorizations to different devices.
5. Prevent attackers utilizing the server’s response to replay attack devices.
6. Multiple platforms (Ubuntu 14, Centos 6, Centos 7 and Andorid) are supported.
## Upgrade Procedure
A typical upgrade procedure is shown below:

1. The upgrade server generates the upgrade package.
2. Packages are uploaded to the storage server.
3. Storage server sends the package URL to upgrade server.
4. Device sends the upgrade request to upgrade server.
5. Upgrade server replies package URL to the device.
6. Device requests package from the storage server.
7. Packages are downloaded to device.
8. Device installs the package.
After integrating secure upgrade SDK, the upgrade procedure is modified as
follows:

1. The upgrade server generates the secure package and package token.
2. Secure packages and the package token are uploaded to the storage server.
3. The storage server sends secure package and package token URLs to the upgrade
server.
4. The device generates the device token and sends to the upgrade server with
the upgrade request.
5. The upgrade server generates authorization token and sends the token to the
device with a replied secure package URL.
6. Device requests secure package from the storage server.
7. Secure packages are downloaded to device.
8. Device verifies the secure package with the authorization token, and
generates the original package.
9. Device installs the package.
## User Guide
### 1. SDK Layout
SDK contains four directories:
1. python API: python interface.
2. config: SDK root configuration file, log file.
3. certificate: certificate file.
4. depend_lib: dependency libraries.
### 2. Interfaces
#### a) Initialize
This function should be called before using secure upgrade APIs.
```
init_secure_upgrade(root_config_path)
input para:
root_config_path root configuration file path
```
#### b) Device Token Generation
This function is used to generate the device token.
```
sec_upgrade_get_device_token()
Output para:
return code: true generating device token successfully
false generating device token failed
Device_token: device token (string format)
```
#### c) Package Generation
This function is used to generate the secure upgrade package and package token.
```
sec_upgrade_get_package(original_package_path,
secure_package_path,
package_token_path)
input para:
original_package_path original upgrade package file path
secure_package_path secure upgrade package file path
package_token_path secure package token file
output para:
return code:
true generating secure upgrade package successfully
false generating secure upgrade package failed
```
#### d) Authorization Token Generation
This function is used to generate a device’s authorization token, based on
device token and package token.
```
sec_upgrade_get_authorization_token(package_token_path,
device_token_path)
input para:
package_token_path secure package token file path
device_token_path device token file path
output_para:
return code:
true generating authorization token successfully
false generating authorization token failed
authorization_token authorization token buffer(string formate)
```
#### e) Authorization Token and Package Verification
This function is used to verify the downloaded secure package with the
authorization token and generate the original package.
```
sec_upgrade_verify_package(authorization_token_buffer,
secure_package_path)
input para:
authorization_token_buffer authorization token buffer(string format)
secure_package_path secure upgrade package file path
output para:
original_package_path original upgrade package file path
```
### 3. Additional Information
1. SDK uses standard PEM certificates.
2. Before using SDK, users need to generate two seperate chains of certificate
for server and device.
3. Certificates from the server certificate chain are deployed to server and
make sure they cannot sign other certificates.
4. Certificates from the device certificate chain are deployed to device and
make sure they cannot sign other certificates.
5. Root private key should not be deployed to server or devices.
6. Users need to be assigned the read and write permissions of the `config`
directory and the read permission of the `certificate` directory.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/apollo_build_and_test_explained.md
|
# Apollo Build and Test Explained
This document focuses on how to build and test Apollo in different ways.
## Pre-requisites
You are supposed to have followed
[Apollo Software Installation Guide](./apollo_software_installation_guide.md).
Make sure you are in Apollo development Docker container before you proceed.
## Overview
Apollo uses [Bazel](https://bazel.build) as its underlying build system. Bazel
is an open-source build and test tool with a human-readable, high-level build
language suitable for medium and large projects. Basically, the better you know
about Bazel, the better you know about Apollo Build.
## Building Apollo
### Subcommands in `apollo.sh`
Let's first take a look at the usage of `apollo.sh`.

From this message, we can see subcommands that starts with "build\_", like
`build_dbg`, `build_cpu`, and `build_opt_gpu`, etc. As you may figure out, they
are all variants for their basic form: `apollo.sh build`.
### Building Apollo using `apollo.sh build`
You can use `./apollo.sh build` to build individual modules, or the whole Apollo
project.
Type the following command to build, say, Cyber RT:
```bash
bash apollo.sh build cyber
```
To build the whole Planning module (all
[targets](https://docs.bazel.build/versions/master/guide.html#target-patterns)
under the `modules/planning` directory):
```bash
bash apollo.sh build planning
```
To build everything,
```bash
bash apollo.sh build
```
 For simplicty, Apollo 6.0 introduces the notion
of `bash apollo.sh build [module]` to replace the notion of `build_cyber`,
`build_planning`, etc in previous Apollo releases.
### Variants of `apollo.sh build`
There are mainly four variants of `apollo.sh build`, namely, `build_dbg`,
`build_opt`, `build_cpu` and `build_gpu`.
You may ask, what's the differences among them?
Good question. Let me try to make this clear.
#### Debug v.s. Optimized Build: `build_dbg/build_opt`
By default, Apollo uses the
[fastbuild compilation mode](https://docs.bazel.build/versions/master/user-manual.html#flag--compilation_mode)
. So when you type `bash apollo.sh build planning`, you are indicating Bazel to
run:
```bash
bazel build [other options] -c fastbuild //modules/planning/...
```
for you.
When you type `bash apollo.sh build_dbg planning`, you are running
```bash
bazel build [other options] --config=dbg //modules/planning/...
```
Please note that `--config=dbg` implies `-c dbg`, as can be seen from the
following section from `tools/bazelrc`:
```
build:dbg -c dbg
build:opt -c opt
```
Now you can understand the `build_opt` variant. Basically,
```bash
bash apollo.sh build_opt cyber
```
means
```bash
bazel build [other options] -c opt //cyber/...
```
#### CPU v.s. GPU Build: `build_cpu/build_gpu`
By now, you can easily figure out that `build_cpu` and `build_gpu` are just
another form of running
```bash
bazel build --config=cpu
```
and
```bash
bazel build --config=gpu
```
respectively under the hood.
However, things are a bit complicated compared to the `build_dbg/build_gpu`
case.
Here is a snapshot showing the log messages on my screen when running
`apollo.sh build`:

There are three `USE_GPU`: `USE_GPU_HOST`, `USE_GPU_TARGET` and `USE_GPU`.
- `USE_GPU_HOST` is an environment variable determined by
`docker/scripts/dev_start.sh` to pass to Apollo Docker container, which
indicates whether the host machine (where Docker is running) is GPU capable.
- `USE_GPU_TARGET` is an environment variable determined by
`scripts/apollo.bashrc` inside Docker container to indicate whether the
container is GPU capable.
- `USE_GPU` is a variable indicating whether to perform CPU build or GPU build.
When you type `bash apollo.sh build --config=cpu` or
`apollo.sh build --config=gpu`, the
[build script](../../scripts/apollo_build.sh)
will check the GPU capability of the Docker container and determines whether the
build you specified can succeed.
 If you didn't specify whether to perform CPU or
GPU build, the build script will determine it automatically according to GPU
capability of your Docker environment.
 It's OK to run CPU build in a **GPU capable**
Apollo container, whereas running GPU build in a CPU-only container will fail.
 By design, `--config=cpu` and `--config=gpu`
are mutually exclusive. You should specify at most one of them when running
`apollo.sh build`.
#### Optimized GPU Build with `build_opt_gpu`
`build_opt_gpu` is just the combination of `build_opt` and `build_gpu`.
```
bash apollo.sh build_opt_gpu
```
is equivalent to
```
bazel build --config=opt --config=gpu //...
```
## Running Unit Tests: `apollo.sh test`
Since `bazel test` inherits all options from `bazel build` (Ref:
[Bazel Docs:Test Options](https://docs.bazel.build/versions/master/command-line-reference.html#test-options)),
the discussions above are applicable to `apollo.sh test`.
```bash
# Each of the following pairs are basically equivalent:
# Run unit tests under the `cyber` directory
bash apollo.sh test cyber
bazel test [--config=cpu|--config=gpu] //cyber/...
# Run unit tests for all in CPU mode
bash apollo.sh test --config=cpu
bazel test --config=cpu //...
# Run unit tests for the Planning module in GPU mode
bash apollo.sh test --config=gpu planning
bazel test --config=gpu //modules/planning/...
```
 Actually, `apollo.sh test` is equivalent to
```bash
bazel test --config=unit_test
```
All the `cpplint` targets was excluded, since there is an independent
`apollo.sh lint` command.
## Running Code Coverage using `apollo.sh coverage`
Since `bazel coverage` inherits all options from `bazel test`(See
[Bazel Docs: Coverage Options](https://docs.bazel.build/versions/master/command-line-reference.html#coverage-options)),
all the discussions about `apollo.sh test` applies to `apollo.sh coverage`.
## Build/Test/Coverage: An Insider's View
Under the hood, `apollo.sh build/test/coverage` makes use of
[scripts/apollo_build.sh](../../scripts/apollo_build.sh),
[scripts/apollo_test.sh](../../scripts/apollo_test.sh),
and
[scripts/apollo_coverage.sh](../../scripts/apollo_coverage.sh)
respectively.
If you are familiar with Bazel, you can build/test any fine-grained target(s).
For example,
```bash
bazel test -c dbg //cyber/common:file_test
bazel build --config=opt //modules/dreamview/backend
bazel test --config=gpu //modules/localization/...
```
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/how_to_launch_and_run_apollo.md
|
# How to Launch and Run Apollo
## Build Apollo
First check to make sure you are in development docker container before you
proceed. Make sure nVidia/AMD GPU is available and that you have installed the
appropriate nVidia/ROCm driver if you want to run the entire system. You could still
proceed with the next few steps if no GPU is available, the system will
run without perception as it was CUDA/HIP-based.
```
# Make sure you start up clean
./apollo.sh clean
# This will build the full system and requires nVidia/AMD GPU with nVidia/AMD
# drivers loaded. If no GPU is availabe, please run "./apollo.sh build_opt" instead.
./apollo.sh build_opt_gpu
```
**Note**:
> Please run `./apollo.sh build_fe` before `./apollo.sh build_opt` if you made
> any modifications to the Dreamview frontend.
## Run Apollo
Once you have finished building Apollo, follow the steps below to launch it.
Note that although `bootstrap.sh` may succeed, the Web UI won't be ready if the
former building step was skipped.
### Start Apollo
Running `scripts/bootstrap.sh` will start Dreamview backend with the monitor
module enabled.
```
# Startup modules monitor and dreamview, the default option is start.
./scripts/bootstrap.sh [start | stop | restart]
```
### Access Dreamview Web UI
Open [http://localhost:8888](http://localhost:8888) in your favorite browser,
e.g. Chrome, and you should see this screen. However, no module(s) except
monitor is running in the background at this moment.

### Select Drive Mode and Map
From the dropdown box of Mode Setup, select "Mkz Standard Debug" mode. From the
dropdown box of Map, select "Sunnyvale with Two Offices".

### Replay Demo Record
To see if the system works, use the demo record to "feed" the system.
```
# You need to download the demo record using the following commands
cd docs/demo_guide/
python3 record_helper.py demo_3.5.record
# You can now replay this demo "record" in a loop with the '-l' flag
cyber_recorder play -f docs/demo_guide/demo_3.5.record -l
```
Dreamview should show a running vehicle now. (The following image might be
different due to frontend code changes.)

### Congrats!
You have successfully built Apollo! Now you can revisit
[Apollo Readme](../../README.md) for additional guidelines on the neccessary
hardware setup.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/apollo_software_installation_guide.md
|
# Apollo Software Installation Guide
This document describes the steps required to install Apollo on Ubuntu 18.04.5
LTS (Bionic Beaver), the recommended Ubuntu release for Apollo 6.0.
## Pre-requisites
Before getting started, please make sure all the pre-requisite steps were
finished as described in the
[Pre-requisite Software Installation Guide](./prerequisite_software_installation_guide.md).
Please also make sure Docker is running. Type `systemctl status docker` to check
the running status of Docker daemon, and type `systemctl start docker` to start
Docker if needed.
## Download Apollo Sources
Run the following commands to clone
[Apollo's GitHub Repo](https://github.com/ApolloAuto/apollo.git).
```bash
# Using SSH
git clone git@github.com:ApolloAuto/apollo.git
# Using HTTPS
git clone https://github.com/ApolloAuto/apollo.git
```
And checkout the latest branch:
```bash
cd apollo
git checkout master
```
For CN users, please refer to
[How to Clone Apollo Repository from China](./how_to_clone_apollo_repo_from_china.md)
if your have difficulty cloning from GitHub.
(Optional) For convenience, you can set up environment variable
`APOLLO_ROOT_DIR` to refer to Apollo root directory by running:
```bash
echo "export APOLLO_ROOT_DIR=$(pwd)" >> ~/.bashrc && source ~/.bashrc
```
 In the following sections, we will refer to Apollo
root directory as `$APOLLO_ROOT_DIR`
## Start Apollo Development Docker Container
From the `${APOLLO_ROOT_DIR}` directory, type
```bash
bash docker/scripts/dev_start.sh
```
to start Apollo development Docker container.
If successful, you will see the following messages at the bottom of your screen:
```bash
[ OK ] Congratulations! You have successfully finished setting up Apollo Dev Environment.
[ OK ] To login into the newly created apollo_dev_michael container, please run the following command:
[ OK ] bash docker/scripts/dev_into.sh
[ OK ] Enjoy!
```
## Enter Apollo Development Docker Container
Run the following command to login into the newly started container:
```bash
bash docker/scripts/dev_into.sh
```
## Build Apollo inside Container
From the `/apollo` directory inside Apollo Docker container, type:
```bash
./apollo.sh build
```
to build the whole Apollo project.
Or type
```bash
./apollo.sh build_opt
```
for an optimized build.
You can refer to
[Apollo Build and Test Explained](./apollo_build_and_test_explained.md)
for a thorough understanding of Apollo builds and tests.
## Launch and Run Apollo
Please refer to the
[Run Apollo](./how_to_launch_and_run_apollo.md#run-apollo) section of
[How to Launch And Run Apollo](./how_to_launch_and_run_apollo.md).
## (Optional) Support a new Vehicle in DreamView
In order to support a new vehicle in DreamView, please follow the steps below:
1. Create a new folder for your vehicle under `modules/calibration/data`
2. There is already a sample file in the `modules/calibration/data` folder named
`mkz_example`. Refer to this structure and include all necessary
configuration files in the same file structure as “mkz_example”. Remember to
update the configuration files with your own parameters if needed.
3. Restart DreamView and you will be able to see your new vehicle (name is the
same as your newly created folder) in the selected vehicle.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/how_to_solve_slow_pull_from_cn.md
|
# 国内环境 GitHub 拉取仓库速度慢的缓解方案
## 第一步: 浏览器打开如下两个网址,找到对应 IP 地址:
1. http://github.com.ipaddress.com/
2. http://github.global.ssl.fastly.net.ipaddress.com/
假设对应 IP 地址分别为 140.82.xx.xxx 和 199.232.yy.yyy
## 第二步: 编辑 hosts 文件
```
sudo vim /etc/hosts
```
加入如下两行:
```
140.82.xx.xxx github.com
199.232.yy.yyy github.global.ssl.fastly.net
```
## 第三步:更新 DNS 缓存(仅限 Mac 用户)
Linux 用户请忽略此步骤。
```
sudo dscacheutil -flushcache
```
大功告成!
现在,您可以尝试从 GitHub 重新拉取代码了,是不是变快了一些?
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/apollo_updated_hardware_system_installation_guide.md
|
# Apollo Upgraded Hardware and System Installation Guide
- [Apollo Upgraded Hardware and System Installation Guide](#apollo-upgraded-hardware-and-system-installation-guide)
- [About This Guide](#about-this-guide)
- [Document Conventions](#document-conventions)
- [Introduction](#introduction)
- [Documentation](#documentation)
- [Key Hardware Components](#key-hardware-components)
- [Additional Components Required](#additional-components-required)
- [Steps for the Installation Tasks](#steps-for-the-installation-tasks)
- [At the Office](#at-the-office)
- [In the Vehicle](#in-the-vehicle)
- [Prerequisites](#prerequisites)
- [Diagrams of the Major Component Installations](#diagrams-of-the-major-component-installations)
- [Additional Tasks Required](#additional-tasks-required)
- [Time Sync Script Setup [Optional]](#time-sync-script-setup-optional)
- [Next Steps](#next-steps)
## About This Guide
The *Apollo upgraded Hardware and System Installation Guide* provides the instructions to install all of the hardware components and system software for the **Apollo Project**. The system installation information included pertains to the procedures to download and install the Apollo Linux Kernel.
### Document Conventions
The following table lists the conventions that are used in this document:
| **Icon** | **Description** |
| ----------------------------------- | ---------------------------------------- |
| **Bold** | Emphasis |
| `Mono-space font` | Code, typed data |
| _Italic_ | Titles of documents, sections, and headings Terms used |
|  | **Info** Contains information that might be useful. Ignoring the Info icon has no negative consequences. |
|  | **Tip**. Includes helpful hints or a shortcut that might assist you in completing a task. |
|  | **Online**. Provides a link to a particular web site where you can get more information. |
|  | **Warning**. Contains information that must **not** be ignored or you risk failure when you perform a certain task or step. |
## Introduction
The **Apollo Project** is an initiative that provides an open, complete, and reliable software platform for Apollo partners in the automotive and autonomous driving industries. The aim of this project is to enable these entities to develop their own self-driving systems based on the Apollo software stack.
### Documentation
The following set of documentation describes Apollo 3.0:
- ***<u>[Apollo Hardware and System Installation Guide]</u>*** ─ Links to the Hardware Development Platform Documentation in Specs
- **Vehicle**:
- [Industrial PC (IPC)](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/IPC/Nuvo-6108GC_Installation_Guide.md)
- [Global Positioning System (GPS)](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Navigation/README.md)
- [Inertial Measurement Unit (IMU)](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Navigation/README.md)
- Controller Area Network (CAN) card
- GPS Antenna
- GPS Receiver
- [Light Detection and Ranging System (LiDAR)](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Lidar/README.md)
- [Camera](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Camera/README.md)
- [Radar](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Radar/README.md)
- [Apollo Sensor Unit (ASU)](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Apollo_Sensor_Unit/Apollo_Sensor_Unit_Installation_Guide.md)
- Apollo Extension Unit (AXU)
- **Software**: Refer to the [Software Installation Guide](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Software_and_Kernel_Installation_guide.md) for information on the following:
- Ubuntu Linux
- Apollo Linux Kernel
- NVIDIA GPU Driver
- ***<u>[Apollo Quick Start Guide]</u>*** ─ The combination of a tutorial and a roadmap that provides the complete set of end-to-end instructions. The Quick Start Guide also provides links to additional documents that describe the conversion of a regular car to an autonomous-driving vehicle.
## Key Hardware Components
The key hardware components to install include:
- Onboard computer system ─ Neousys Nuvo-6108GC (2)
- Controller Area Network (CAN) Card ─ ESD CAN-PCIe/402-B4
- Global Positioning System (GPS) and Inertial Measurement Unit (IMU) ─
You can select one of the following options:
- NovAtel SPAN-IGM-A1
- NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
- NovAtel SPAN® PwrPak7™
- Navtech NV-GI120
- Light Detection and Ranging System (LiDAR) ─ You can select one of the following options, please note Apollo upgrade uses VLS-128 LiDAR:
- [Velodyne VLS-128](../11_Hardware%20Integration%20and%20Calibration/车辆集成/传感器安装 sensor installation/Lidar/VLS_128_Installation_Guide.md)
- Velodyne HDL-64E S3
- Velodyne Puck series
- Innovusion LiDAR
- Hesai's Pandora
- Cameras — You can select one of the following options:
- Leopard Imaging LI-USB30-AR023ZWDR with USB 3.0 case
- Argus Camera (FPD-Link)
- Wissen Camera
- Radar — You can select one of the following options:
- Continental ARS408-21
- Racobit B01HC
### Additional Components Required
You need to provide these additional components for the Additional Tasks Required:
- Apollo Sensor Unit (ASU)
- Apollo Extension Unit (AXU)
- A 4G router for Internet access
- A USB hub for extra USB ports
- A monitor, keyboard, and mouse for debugging at the car onsite
- Cables: a Digital Visual Interface (DVI) cable (optional), a customized cable for GPS-LiDAR time synchronization
- Apple iPad Pro: 9.7-inch, Wi-Fi (optional)
The features of the key hardware components are presented in the subsequent sections.
## Steps for the Installation Tasks
This section describes the steps to install:
- The key hardware and software components
- The hardware in the vehicle
### At the Office
Perform the following tasks:
- Prepare the IPC:
- Install the CAN card
- Install or replace the hard drive
- Prepare the IPC for powering up
- Install the software for the IPC:
- Ubuntu Linux
- Apollo Kernel
- Nvidia GPU Driver
The IPC is now ready to be mounted on the vehicle.
### In the Vehicle
Perform these tasks:
- Make the necessary modifications to the vehicle as specified in the list of prerequisites
- Install the major components:
- GPS Antenna
- IPC
- GPS Receiver and IMU
- LiDAR
- Cameras
- Radar
#### Prerequisites
**WARNING**: Prior to mounting the major components (GPS Antenna, IPC, and GPS Receiver) in the vehicle, perform certain modifications as specified in the list of prerequisites. The instructions for making the mandatory changes in the list are outside the scope of this document.
The list of prerequisites are as follows:
- The vehicle must be modified for “drive-by-wire” technology by a professional service company. Also, a CAN interface hookup must be provided in the trunk where the IPC will be mounted.
- A power panel must be installed in the trunk to provide power to the IPC and the GPS-IMU. The power panel would also service other devices in the vehicle such as a 4G LTE router. The power panel should be hooked up to the power system in the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU Antenna, the cameras and the LiDAR's on top of the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU in the trunk.
- A custom-made rack must be installed in front of the vehicle to mount the front-facing radar.
- A 4G LTE router must be mounted in the trunk to provide Internet access for the IPC. The router must have built-in Wi-Fi access point (AP) capability to connect to other devices, such as an iPad, to interface with the autonomous driving (AD) system. A user would be able to use the mobile device to start AD mode or monitor AD status, for example.
#### Diagrams of the Major Component Installations
The following two diagrams indicate the locations of where the three major components (GPS Antenna, IPC, GPS Receiver and LiDAR) should be installed on the vehicle:


## Additional Tasks Required
Use the components that you were required to provide to perform the following tasks:
1. Connect a monitor using the DVI or the HDMI cables and connect the keyboard and mouse to perform debugging tasks at the car onsite.
2. Establish a Wi-Fi connection on the Apple iPad Pro to access the HMI and control the Apollo ADS that is running on the IPC.
## Time Sync Script Setup [Optional]
In order to, sync the computer time to the NTP server on the internet, you could use the [Time Sync script](https://github.com/ApolloAuto/apollo/blob/master/scripts/time_sync.sh)
## Next Steps
After you complete the hardware installation in the vehicle, see the [Apollo Quick Start](../02_Quick%20Start/apollo_3_5_quick_start.md) for the steps to complete the software installation.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/how_to_prepare_bazel_dist_dir_cn.md
|
# 如何准备 Bazel 的依赖缓存目录
本文档描述了在 Apollo 项目中准备 Bazel 的依赖缓存目录
([Distribution Directory](https://docs.bazel.build/versions/master/guide.html#distribution-files-directories))
的方法。
## Introduction
根
据[Bazel 官方指南:在封闭环境中运行 Bazel](https://docs.bazel.build/versions/master/guide.html#running-bazel-in-an-airgapped-environment)
的说明,Bazel 的隐式依赖项是在 Bazel 初次运行的时候从网络上拉取的。然而,即使所
有在 WORKSPACE 中指定的依赖项均已到位,这在封闭环境或者网络连接不稳定的状况下依
然会造成问题。
为便利国内开发者,对 Apollo 中使用到的各 Bazel 版本,Apollo 均提供**与之对应**的
Bazel 隐式依赖压缩包文件。请注意,对不同版本的 Bazel 来说,其隐式依赖项不尽相同
。当 Bazel 版本更新后,请务必按照本文档描述的方法,**重新**执行一遍。
接下来,我们先熟悉把 Apollo 提供的 Bazel 隐式依赖压缩包解压到依赖缓存目录的流程
。
## 如何利用 Apollo 提供的 Bazel 隐式依赖压缩包
1. 在 Apollo 容器中执行`bazel version`确定 Bazel 版本:
```bash
$ bazel version
Build label: 3.5.0
Build target: bazel-out/aarch64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Sep 2 21:11:43 2020 (1599081103)
Build timestamp: 1599081103
Build timestamp as int: 1599081103
```
在本示例中的 Bazel 版本为`3.5.0`。在以下行文中,我们将以`BAZEL_VERSION`指代之。
2. 运行如下命令以下载对应的 Bazel 隐式依赖压缩包
```bash
wget https://apollo-system.cdn.bcebos.com/archive/bazel_deps/bazel-dependencies-${BAZEL_VERSION}.tar.gz
```
3. 将压缩包解压到由环境变量`${APOLLO_BAZEL_DIST_DIR}`指代的 Bazel 依赖缓存目录
```bash
tar xzf bazel-dependencies-${BAZEL_VERSION}.tar.gz
source ${APOLLO_ROOT_DIR}/cyber/setup.bash
mv bazel-dependencies-${BAZEL_VERSION}/* "${APOLLO_BAZEL_DIST_DIR}"
```
## 自己动手构建 Bazel 的隐式依赖项的方法
如果您需要的 Bazel 版本 Apollo 未能提供,除了
在[GitHub Issues 页](https://github.com/ApolloAuto/apollo/issues) 提交 Issue 外
,您还可以通过如下方法在一台网络连接良好的机器上自己动手构建:
```bash
# 克隆对应分支的Bazel源码
git clone --depth=1 -b "${BAZEL_VERSION}" https://github.com/bazelbuild/bazel bazel.git
cd bazel.git
# 构建对应的Bazel隐式依赖压缩文件
bazel build @additional_distfiles//:archives.tar
# 确保${APOLLO_BAZEL_DIST_DIR} 变量已定义,且对应的目录存在
source ${APOLLO_ROOT_DIR}/cyber/setup.bash
[[ -d "${APOLLO_BAZEL_DIST_DIR}" ]] || mkdir -p "${APOLLO_BAZEL_DIST_DIR}"
# 将与该Bazel版本对应的各隐式依赖项全部解压到Bazel依赖缓存目录中
tar xvf bazel-bin/external/additional_distfiles/archives.tar \
-C "${APOLLO_BAZEL_DIST_DIR}" --strip-components=3
```
然后,你就可以在 Apollo 容器中顺利执行`./apollo.sh build`,`./apollo.sh test` 等
命令而无需担心依赖项拉不下来的问题了。
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/how_to_save_and_load_docker_image.md
|
# How to Save and Load Apollo Docker Images
Considering that Apollo Docker images are usually serveral Gigabytes in size,
you can pull them over WIFI or other stable Internet connections, and then
copy the relavant images to vehicle.
## Save Docker Images
After you have pulled the relavant Docker image, you can save it as a tarball
by running the following command:
```bash
# docker save -o <path/to/saved/image/tar> <repo:tag>
docker save -o apollo_dev.tar apolloauto/apollo:dev-x86_64-18.04-20200823_0534
```
## Load the Docker Image
With the taballs copied to vehicle, you can reload the relavant Apollo
Docker image by running:
```bash
# docker load -i <path/to/docker/tarball>
docker load -i apollo_dev.tar
```
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/how_to_install_apollo_kernel.md
|
# How to Install Low-Latency / Realtime Kernel
This document describes the steps to install low-latency/realtime kernels with
Nvidia driver on Ubuntu 18.04.
## Before You Begin
Low-Latency/Realtime kernel is only required for running Apollo software stack
in the vehicle. If your sole purpose was to develop/test your algorithms or to
run simulation software (e.g., LGSVL simulator) on top of Apollo, then maybe you
don't need to install low-latency/real-time kernels described here at all.
## Ubuntu Low-Latency Kernel
Ubuntu low-latency kernel (availabe in Ubuntu repository) is completely capable
of low- to no- latency for running Apollo in the vehicle. Preempt optimization
is enabled in its kernel configuration, and latency as low as 0.1 millisecond
can and has been achieved using it.
The steps required to install Ubuntu low-latency kernel are described below:
1. Install the latest low-latency kernel and its headers.
```bash
sudo apt-get update
# Install the latest low-latency kernel & headers.
sudo apt-get install linux-image-$(uname -r)-lowlatency linux-headers-$(uname -r)-lowlatency
```
**Note**:
> Please change `$(uname -r)` to the latest kernel should there be newer kernel
> packages available. (You can view newer packages availabe with
> `apt list --upgradable`.) The latest kernel version on Ubuntu 18.04 as of this
> writing (Dec 02, 2020) is `5.4.0-56`.
2. Reboot to start the low-latency kernel.
```bash
sudo reboot
```
## Install Realtime Kernel
There is a community-contributed
[Building Realtime Linux for ROS2](https://index.ros.org/doc/ros2/Tutorials/Building-Realtime-rt_preempt-kernel-for-ROS-2)
document for building/installing PREEMPT_RT kernel on Ubuntu 20.04, which is
applicable to Ubuntu 18.04 also. Please follow the instructions there to install
the latest stable realtime kernel first.
## Install Nvidia Driver
### Install Nvidia Driver for Low-Latency Kernel
For Ubuntu low-latency kernel, the steps to install Nvidia driver is relatively
straightforward.
1. Download and install the latest Nvidia driver from the
[CUDA Toolkit Downloads](https://developer.nvidia.com/cuda-downloads?target_os=Linux)
Page.
Choose either **Local Installer**("deb[local]") or **Network
Installer**("deb[network]") for **Installer Type** and follow the
instructions there.


**Note**
> You may need to regist and sign CUDA EULA to download Nvidia packages.
For example, below is the instructions installing Nvidia driver on x86_64 Ubuntu
18.04.5 with the "deb[local]" approach:
```bash
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda-repo-ubuntu1804-11-1-local_11.1.1-455.32.00-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-11-1-local_11.1.1-455.32.00-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu1804-11-1-local/7fa2af80.pub
sudo apt-get update
sudo apt-get install nvidia-driver-455
```
**Note**:
> The number in `nvidia-driver-XXX` should match that in the local installer
> (455 in the example above).
2. Reboot for the changes to make effect.
3. Run `nvidia-smi` to check if everything is OK.
### Install Nvidia Driver for Realtime Kernel
Please follow the first step listed above first. However, as the Nvidia driver
does not support real-time kernels, running
`sudo apt-get install nvidia-driver-455` on a PREEMPT_RT kernel should partially
fail with the following error message:
```text
The kernel you are installing for is a PREEMPT_RT kernel!
The NVIDIA driver does not support real-time kernels. If you
are using a stock distribution kernel, please install
a variant of this kernel that does not have the PREEMPT_RT
patch set applied; if this is a custom kernel, please
install a standard Linux kernel. Then try installing the
NVIDIA kernel module again.
*** Failed PREEMPT_RT sanity check. Bailing out! ***
```
We can set `IGNORE_PREEMPT_RT_PRESENCE=1` when build Nvidia driver as a
workaround:
1. Run the following commands to build Nvidia driver:
```bash
# Change to Nvidia driver source directory
cd "$(dpkg -L nvidia-kernel-source-455 | grep -m 1 "nvidia-drm" | xargs dirname)"
# Build Nvidia driver with IGNORE_PREEMPT_RT_PRESENCE=1
sudo env NV_VERBOSE=1 \
make -j8 NV_EXCLUDE_BUILD_MODULES='' \
KERNEL_UNAME=$(uname -r) \
IGNORE_XEN_PRESENCE=1 \
IGNORE_CC_MISMATCH=1 \
IGNORE_PREEMPT_RT_PRESENCE=1 \
SYSSRC=/lib/modules/$(uname -r)/build \
LD=/usr/bin/ld.bfd \
modules
sudo mv *.ko /lib/modules/$(uname -r)/updates/dkms/
sudo depmod -a
```
2. Reboot the system
3. Run `nvidia-smi` to check if everything is OK.
## Install ESD-CAN Driver (Optional)
You should follow the
[instructions](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)
to build ESD-CAN driver if necessary.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/how_to_prepare_bazel_dist_dir.md
|
# How to Prepare Bazel Distribution Directory
This document describes the steps to prepare Bazel
[distribution directory](https://docs.bazel.build/versions/master/guide.html#distribution-files-directories)
for Apollo.
## Introduction
According to
[Bazel Docs: Running Bazel in an airgapped environment](https://docs.bazel.build/versions/master/guide.html#running-bazel-in-an-airgapped-environment),
Bazel’s implicit dependencies are fetched over the network while running for the
first time. However, this may cause problems when running Bazel in an airgapped
environment or with unstable Internet access, even if you have vendored all of
your WORKSPACE dependencies.
To solve that, the Apollo team decided to provide these dependencies for every
Bazel binary version used in Apollo. Please do remember to do this once for
every new Bazel binary version, since the implicit dependencies can be different
for every Bazel release.
The section below describes the steps to prepare distribution directory using
Apollo-provided tarballs.
## Prepare Distribution Directory using Apollo-provided tarballs
1. Check Bazel version used by Apollo by running `bazel version` from inside
Apollo container.
```bash
$ bazel version
Build label: 3.5.0
Build target: bazel-out/aarch64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Sep 2 21:11:43 2020 (1599081103)
Build timestamp: 1599081103
Build timestamp as int: 1599081103
```
Here the Bazel version used is `3.5.0`. In the sections below, we will refer to
it as `BAZEL_VERSION`.
2. Download corresponding bazel-dependencies tarball by running:
```bash
wget https://apollo-system.cdn.bcebos.com/archive/bazel_deps/bazel-dependencies-${BAZEL_VERSION}.tar.gz
```
3. Uncompress the tarball and move the dependencies into the distribution
directory defined by the `${APOLLO_BAZEL_DIST_DIR}` environment variable:
```bash
tar xzf bazel-dependencies-${BAZEL_VERSION}.tar.gz
source ${APOLLO_ROOT_DIR}/cyber/setup.bash
mv bazel-dependencies-${BAZEL_VERSION}/* "${APOLLO_BAZEL_DIST_DIR}"
```
In case that bazel-dependencies for the Bazel version you used were not provided
by the Apollo team, you can build it on your own following the recipe below.
## Recipe to build Bazel's implicit dependencies
The following is the recipe to produce Bazel's implicit dependencies:
```bash
# Checkout Bazel-${BAZEL_VERSION} branch
git clone --depth=1 -b "${BAZEL_VERSION}" https://github.com/bazelbuild/bazel bazel.git
cd bazel.git
# Build Bazel's implicit dependencies for that Bazel version
bazel build @additional_distfiles//:archives.tar
# Make sure ${APOLLO_BAZEL_DIST_DIR} is defined
source ${APOLLO_ROOT_DIR}/cyber/setup.bash
# Uncompress the tarball to the distribution directory for Apollo
tar xvf bazel-bin/external/additional_distfiles/archives.tar \
-C "${APOLLO_BAZEL_DIST_DIR}" --strip-components=3
```
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/how_to_clone_apollo_repo_from_china_cn.md
|
# 国内环境下如何克隆 Apollo 仓库
本文档描述了在国内环境下既快又好地克隆Apollo 仓库的方法。
## 必要前提/准备
- 假设你已经 「fork」 了GitHub上的Apollo 代码库。这可以通过点击[GitHub上的 Apollo](https://github.com/ApolloAuto/apollo.git) 页面右上角的「Fork」按钮并遵照随后的提示来完成。
## 首先,从码云上克隆 Apollo 仓库
[码云上的 Apollo仓库](https://gitee.com/ApolloAuto/apollo.git) 通常比[GitHub上的 Apollo仓库](https://github.com/ApolloAuto/apollo.git) 更新晚一天。
我们可以以它为起点,克隆码云上的Apollo 仓库。
执行命令:
```bash
git clone https://gitee.com/ApolloAuto/apollo.git
```
这一步通常很快,只需十数分钟。在本文作者所在的百度内部,下载速度可达 10 多 MiB/s,终端输出如下:
```text
Cloning into 'apollo'...
remote: Enumerating objects: 313277, done.
remote: Counting objects: 100% (313277/313277), done.
remote: Compressing objects: 100% (66199/66199), done.
remote: Total 313277 (delta 245822), reused 310653 (delta 243198), pack-reused 0
Receiving objects: 100% (313277/313277), 2.19 GiB | 11.10 MiB/s, done.
Resolving deltas: 100% (245822/245822), done.
Checking out files: 100% (9124/9124), done.
```
**注意:** 以下步骤可选。
## 重置远程分支origin
上述步骤完成后,就可以「过河拆桥」,将远程分支 origin 重置为你刚 「fork」的GitHub 分支。
```bash
git remote set-url origin git@github.com:<你的GitHub 用户名>/apollo.git
```
## 将 GitHub 上的 Apollo 仓库设为远程分支upstream
```bash
# 采用SSH的方式
git remote add upstream git@github.com:ApolloAuto/apollo.git
# 采用HTTPS的方式
git remote add upstream https://github.com/ApolloAuto/apollo.git
```
你可以运行如下命令来确认远程分支 origin 和 upstream 已被正确设置:
```bash
git remote -v
```
如果之前的操作正确,它将列出如下的远端分支:
```text
origin git@github.com:<你的GitHub 用户名>/apollo.git (fetch)
origin git@github.com:<你的GitHub 用户名>/apollo.git (push)
upstream git@github.com:ApolloAuto/apollo.git (fetch)
upstream git@github.com:ApolloAuto/apollo.git (push)
```
## 现在,从 GitHub 远程分支upstream 拉取最新的「增量」代码
```bash
git pull --rebase upstream master
```
如果遇到问题,你可以参考这篇文档:[国内环境拉取GitHub仓库慢的缓解方案](./how_to_solve_slow_pull_from_cn.md).
## 结语
恭喜你成功地克隆了 Apollo Gitee/GitHub 仓库,并由此开启你的 Apollo 自动驾驶之旅!
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/apollo_secure_upgrade_user_guide_cn.md
|
# Apollo安全更新SDK
当前大部分的软件更新过程并没有被安全的保护起来,因此在更新过程中设备将被暴露在诸多的安全威胁下。Apollo安全更新SDK提供了多种保护更新安全的特性,并且能够很容易的被集成以使更新流程更加安全可靠。
## 特性
1. 在储存和传输阶段,更新包被加密和签名保护。
2. 服务器和设备可以互相鉴定
3. 加密信息被安全合理的保护
4. 服务器针对不同的设备提供不同的授权
5. 防止攻击者利用服务器的应答对设备实施重传攻击
6. 支持多个平台(Ubuntu 14, Centos 6, Centos 7 and Andorid)
## 更新流程
一种典型的更新流程如下图所示:

1. 更新服务器生成更新包
2. 更新包上传至存储服务器
3. 存储服务器将更新包的url地址发送给更新服务器
4. 设备发送更新请求到更新服务器
5. 更新服务器将更新包的url回复给设备
6. 设备从存储服务器请求下载更新包
7. 更新包下载到设备上
8. 设备安装更新包
在集成Apollo安全更新SDK后,更新流程修改为:

1. 更新服务器生成安全更新包和更新包的token
2. 安全更新包和更新包token上传至存储服务器
3. 存储服务器将安全更新包的url和更新包token的url发送给更新服务器
4. 设备生成设备token并发送到更新服务器
5. 更新服务器生成授权token并将该token连同安全更新包的url一起发送给设备
6. 设备向存储服务器请求安全更新包
7. 安全更新包下载到设备上
8. 设备使用授权token验证安全更新包,并生成原始更新包
9. 设备安装更新包
## 用户指南
### 1. SDK文件布局
SDK包含4个目录:
1. python API: python接口
2. config: SDK根配置文件,日志文件
3. certificate: 证书文件
4. depend_lib: 依赖库
### 2. 接口
#### a) 初始化
该函数应当在使用安全更新API前调用
```
init_secure_upgrade(root_config_path)
input para:
root_config_path root configuration file path
```
#### b) 设备token生成
该函数用于生成设备token
```
sec_upgrade_get_device_token()
Output para:
return code: true generating device token successfully
false generating device token failed
Device_token: device token (string format)
```
#### c) 更新包生成
该函数用于生成安全更新包和更新包token
```
sec_upgrade_get_package(original_package_path,
secure_package_path,
package_token_path)
input para:
original_package_path original upgrade package file path
secure_package_path secure upgrade package file path
package_token_path secure package token file
output para:
return code:
true generating secure upgrade package successfully
false generating secure upgrade package failed
```
#### d) 授权token生成
该函数基于设备token和更新包token生成设备的授权token
```
sec_upgrade_get_authorization_token(package_token_path,
device_token_path)
input para:
package_token_path secure package token file path
device_token_path device token file path
output_para:
return code:
true generating authorization token successfully
false generating authorization token failed
authorization_token authorization token buffer(string formate)
```
#### e) 授权token和更新包检验
该函数使用授权token检验下载的安全更新包并生成原始更新包
```
sec_upgrade_verify_package(authorization_token_buffer,
secure_package_path)
input para:
authorization_token_buffer authorization token buffer(string format)
secure_package_path secure upgrade package file path
output para:
original_package_path original upgrade package file path
```
### 3. 附加信息
1. SDK使用标准的PEM证书
2. 在使用SDK前,使用者需要为服务器和设备生成两个不同的证书串
3. 服务器证书串中的证书配置给服务器,请确保其不能对其他证书进行签名
4. 设备证书串中的证书配置给设备,请确保其不能对其他证书进行签名
5. 根密钥不应当配置给服务器和设备
6. 使用者应当具有`config`文件夹的读写权限和`certificate`文件夹的读权限
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/01_Installation Instructions/how_to_clone_apollo_repo_from_china.md
|
# How to Clone Apollo Repository from China
This document describes a smarter approach to clone Apollo repository for users
from China.
## Pre-requisites
- Suppose you have forked Apollo Repository on GitHub. This is done by clicking
the "Fork" button on the top-right of
[Apollo's Github Page](https://github.com/ApolloAuto/apollo.git) and follow
the instructions there.
## First, clone Apollo from Gitee
Apollo on Gitee was one day later than Apollo on GitHub. We can use it
as a good start.
```bash
git clone https://gitee.com/ApolloAuto/apollo.git
```
This step takes only serveral minutes, as the download rate can reach up-to >
10MiB/s tested on my machine with
the following console log:
```text
Cloning into 'apollo'...
remote: Enumerating objects: 313277, done.
remote: Counting objects: 100% (313277/313277), done.
remote: Compressing objects: 100% (66199/66199), done.
remote: Total 313277 (delta 245822), reused 310653 (delta 243198), pack-reused 0
Receiving objects: 100% (313277/313277), 2.19 GiB | 11.10 MiB/s, done.
Resolving deltas: 100% (245822/245822), done.
Checking out files: 100% (9124/9124), done.
```
## Reset origin to your GitHub fork
```bash
git remote set-url origin git@github.com:YOUR_GITHUB_USERNAME/apollo.git
```
## Set Apollo GitHub repo as upstream
```bash
# Using SSH
git remote add upstream git@github.com:ApolloAuto/apollo.git
# Using HTTPS
git remote add upstream https://github.com/ApolloAuto/apollo.git
```
You can confirm that the origin/upstream has been setup correctly by running:
```bash
git remote -v
```
It will show the list of remotes similar to the following:
```text
origin git@github.com:YOUR_GITHUB_USERNAME/apollo.git (fetch)
origin git@github.com:YOUR_GITHUB_USERNAME/apollo.git (push)
upstream git@github.com:ApolloAuto/apollo.git (fetch)
upstream git@github.com:ApolloAuto/apollo.git (push)
```
## Pull latest code from GitHub upstream
```bash
git pull --rebase upstream master
```
You can follow this guide on
[How to Workaround Slow Pull from CN](./how_to_solve_slow_pull_from_cn.md).
## Congrats!
You have successfully cloned Apollo repository. Good luck to your journey of
autonomous driving with Apollo!
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/parking_scenario.md
|
# PARKING SCENARIO
# Introduction
Apollo planning is scenario based, where each driving use case is treated as a different driving scenario.
There are three scenairos, park and go, pull over and valet parking, which related to park planning.
1. park and go: the park and go scenario was designed to handle curb side parking, planning a new trajectory to the next destination and then driving along that trajectory. This scenario is extremely useful in situations like curb-side delivery or passenger pickup or drop-off.
2. pull over: the pull over scenario was designed especially for maneuvering to the side of the road upon reaching your destination like for curb-side parallel parking.
3. valet parking: the valet parking scenario was designed to safely park your ego car in a targeted parking spot.
# Where is the code
Please refer [park](https://github.com/ApolloAuto/apollo/modules/planning/scenarios/park/) & [park and go](https://github.com/ApolloAuto/apollo/modules/planning/scenarios/park_and_go/).
# Code Reading
All three scenarios contain specific stages, the function of scenarios are realized through the conversion of stages. Thus, figure out the process of stages conversion is the key to understand this code.
## PARK AND GO SCENARIO
1. This scenario consists of four stages, check stage, adjust stage, pre cruise stage and cruise stage.
2. check stage:
1. In check stage, by calling ```checkadcreadytocruise()```to check whether ADC's gear info, ADC's velocity, obstacle position, ADC's heading and ADC's lateral station meet the requirements.
```cpp
bool CheckADCReadyToCruise(
const common::VehicleStateProvider* vehicle_state_provider, Frame* frame,
const ScenarioParkAndGoConfig& scenario_config);
```
2. If ADC is ready to cruise, check stage is finished and we switch to cruise stage. Otherwise we switch to adjust stage.
3. adjust stage:
1. In adjust stage, we run open space planning algorithms to adjust ADC position.
```cpp
bool ExecuteTaskOnOpenSpace(Frame* frame);
```
2. Once position adjustment is done, we check whether ADC reaches the end of trajectory.
3. Then we check whether ADC is ready to cruise by calling ```CheckADCReadyToCruise()```.
4. If ADC is ready to cruise and reaches the end of trajectory, adjust stage is finished.
1. If steering percentage within the threshold, we switch to cruise stage.
2. Otherwise we reset init position of ADC and switch to pre cruise stage.
```cpp
void ResetInitPostion();
```
5. Otherwise ADC stay in adjust stage to adjust ADC position.
4. pre cruise stage:
1. In pre cruise stage, we run open space planning algorithms to adjust ADC with the init position.
2. Then we check whether the steering percentage within the threshold.
3. If so, pre cruise stage is finished and we switch to cruise stage.
4. Otherwise ADC stay in pre cruise stage.
5. cruise stage:
1. We run an on lane planning algorithms to adjust ADC position.
```cpp
bool ExecuteTaskOnReferenceLine(
const common::TrajectoryPoint& planning_start_point, Frame* frame);
```
2. Then we check whether the lateral distacne between ADC and target line within the threshold.
```cpp
ParkAndGoStatus CheckADCParkAndGoCruiseCompleted(
const ReferenceLineInfo& reference_line_info);
```
3. If so, cruise stage is finished and quit park and go scenario is done.
4. Otherwise ADC stay in cruise stage until ADC cruises to a desired position.
5. The conversion of stages can be seen in
.
## PULL OVER SCENARIO
1. This scenario consists of three stages, approach stage, retry approach parking stage and retry parking stage.
2. approach stage:
1. We run an on lane planning algorithms to approach pull over target position.
2. At first, we check path points data to see whether the s, l and theta error between ADC and the target path point within the threshold.
1. If so, the pull over status is set to PARK_COMPLETE.
2. Otherwise we add a stop fence for adc to pause at a better position.
3. However, if we can't find a suitable new stop fence, approach stage is finished and we switch to retry appoach parking stage.
```cpp
PullOverStatus CheckADCPullOverPathPoint(
const ReferenceLineInfo& reference_line_info,
const ScenarioPullOverConfig& scenario_config,
const common::PathPoint& path_point,
const PlanningContext* planning_context);
```
3. Then we check whether adc parked properly.
1. If ADC pass the destination or park properly, approach stage is finished and pull over scenario is done.
2. If adc park failed, approach stage is finished and we switch to retry appoach parking stage.
```cpp
PullOverStatus CheckADCPullOver(
const common::VehicleStateProvider* vehicle_state_provider,
const ReferenceLineInfo& reference_line_info,
const ScenarioPullOverConfig& scenario_config,
const PlanningContext* planning_context);
```
3. retry approach parking stage:
1. We run an on lane planning algorithms to reach the stop line of open space planner.
2. Check whether ADC stop properly.
```cpp
bool CheckADCStop(const Frame& frame);
```
3. If so, retry approach parking stage is finished and switch to retry parking stage.
4. retry parking stage:
1. We run an open space planning algorithms to park.
2. Check whether ADC park properly(check distance and theta diff).
```cpp
bool CheckADCPullOverOpenSpace();
```
3. If so, retry parking stage is finished and pull over scenario is done.
4. Otherwise ADC stay in the stage until ADC park properly.
5. The conversion of stages can be seen in
.
## VALET PARKING SCENARIO
1. This scenario consists of two stages, approach parking spot stage and parking stage.
2. approach parking spot stage:
1. We run an on lane planning algorithms to approach the designated parking spot.
2. ADC cruises to a halt once it has found the right stopping point required in order to reverse into the parking spot.
```cpp
bool CheckADCStop(const Frame& frame);
```
3. If stop properly, approach parking spot stage is finished and switch to parking stage.
4. Otherwise ADC stay in the stage until it approaches to desired parking spot.
3. parking stage:
1. Open Space Planner algorithm is used to generate a zig-zag trajectory which involves both forward and reverse driving (gear changes) in order to safely park the ego car.
2. The conversion of stages can be seen in
.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/planning_speed_bounds_decider.md
|
# Planning Speed Bounds Decider Introduction
# Introduction
This document describes the process of speed bounds decider. Speed bounds decider contains three main parts: 1.Map obstacles into st graph 2.Create speed limit along path 3.Get path_length & time_duration as search bound in st graph. After these three steps, generated st_graph is loaded back to the frame.
# Where is the code
Please refer [code](https://github.com/ApolloAuto/apollo/blob/master/modules/planning/tasks/deciders/speed_bounds_decider/speed_bounds_decider.cc)
# Code Reading

SpeedBoundsDecider is a derived class whose base class is Decider. Thus, when task::Execute() is called in the task list, the Process() in SpeedBoundsDecider is actually doing the processing.
1. Input.
While the input params of the unified api are frame and reference_line_info, the information needed to caculate st_graph includes PathData/ReferenceLine/PathDecision and PlanningStartPoint from frame.
2. Process.
- 2.1 Map obstacles into st graph
`if (boundary_mapper.ComputeSTBoundary(path_decision).code() == ErrorCode::PLANNING_ERROR) {}` Here it goes through every obstacle to generate ST graph. Specifically, this function will fine-tune boundary if longitudinal decision has been made. After that each st_boundary of obstacles is pushed in to a boundaries vector.
- 2.2 Create speed limit along path
`if (!speed_limit_decider.GetSpeedLimits(path_decision->obstacles(), &speed_limit).ok())` Here it goes through every discretized path point and find a speed_limit for it. In every cycle, the basic speed are limited by map/path_curvature/nudge obstacles. For nudge obstacles, each item is went through to find the closest obstacle.
- 2.3 Get path_length and time_duration as search bound in st_graph
The time duration is from speed bound config.
3. Output.
`st_graph_data->LoadData()` The boundaries/speed_limit are stored in st_graph_data of reference_line_info.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/open_space_trajectory_partition.md
|
# OPEN SPACE TRAJECTORY PARTITION
# Introduction
Apollo planning is scenario based, where each driving use case is treated as a different driving scenario.
Open space trajectory partition task is used to partition and optimize stiched trajectroy obtained from open space trajectory provider task.
# Where is the code
Please refer [open space trajectory parition](https://github.com/ApolloAuto/apollo/modules/planning/tasks/optimizers/open_space_trajectory_partition/open_space_trajectory_partition.cc).
# Code Reading
1. Input : stitched trajectory(without optimization) / vehicle position info.
2. The interpolated trajectory is obtained by calling ```InterpolateTrajectory()``` to increase stitched trajectory points.
```cpp
void InterpolateTrajectory(
const DiscretizedTrajectory& stitched_trajectory_result,
DiscretizedTrajectory* interpolated_trajectory);
```
3. According to the heading angle and traking angle, the gear shift point can be determined.
Use ```std::vector<TrajGearPair>``` to store gear infomation and trajectory points, then partition trajectory into a group of trajectories from the gear shift point.
```cpp
void PartitionTrajectory(const DiscretizedTrajectory& trajectory,
std::vector<TrajGearPair>* partitioned_trajectories);
```
4. If replan due to fallback stop, the position init staus will be set to false.
When replan success, we use ```AdjustRelativeTimeAndS()``` to adjust partitioned trajectories obtained from step 3.
```cpp
void AdjustRelativeTimeAndS(
const std::vector<TrajGearPair>& partitioned_trajectories,
const size_t current_trajectory_index,
const size_t closest_trajectory_point_index,
DiscretizedTrajectory* stitched_trajectory_result,
TrajGearPair* current_partitioned_trajectory);
```
5. When fallback is not required, choose the closest partitioned trajectory to follow.
1. Base on ADC position, heading, body size and velocity info, we get vehicle center point info and moving direction.
```cpp
void UpdateVehicleInfo();
```
2. Encode partitioned trajectories;
```cpp
bool EncodeTrajectory(const DiscretizedTrajectory& trajectory,
std::string* const encoding);
```
3. To find the closest point on trajectory, a search range needed to be determined. It requires the distance between path end point and ADC enter point, the heading search difference and the head track difference all within the threshold.
Base on ADC box and path point box, the IOU(intersection over union) is computed for each path point in the search range.
If the IOU of the trajectory end point is bigger than threshold and partitioned trajectories group has other trajectory can be used, it means ADC reach the end of a trajectory, another trajectory to be used.
Then update trajectory history to store which trajectory has been used.
```cpp
bool CheckReachTrajectoryEnd(const DiscretizedTrajectory& trajectory,
const canbus::Chassis::GearPosition& gear,
const size_t trajectories_size,
const size_t trajectories_index,
size_t* current_trajectory_index,
size_t* current_trajectory_point_index);
```
```cpp
bool CheckTrajTraversed(const std::string& trajectory_encoding_to_check);
```
```cpp
void UpdateTrajHistory(const std::string& chosen_trajectory_encoding);
```
4. When there is no need for ADC to switch to next trajectory, use IOU info mentioned above to find the closest trajectory point(the biggest IOU point) to follow.
5. If the closest trajectory point doesn't belong to current trajectory or couldn't find closest trajectory point due to some unnormal cases, we use ```UseFailSafeSearch()``` to get a safe trajectory to follow.
When using this function, we only care about distance between path end point and ADC enter point to find the search range, no more limitation on angle difference.
```cpp
bool UseFailSafeSearch(
const std::vector<TrajGearPair>& partitioned_trajectories,
const std::vector<std::string>& trajectories_encodings,
size_t* current_trajectory_index, size_t* current_trajectory_point_index);
```
6. If ```FLAGS_use_gear_shift_trajectory()``` set to be true, a small part trajectory obtained by calling ```GenerateGearShiftTrajectory()``` will be added to make vehicle moving smoothly during gear shifting.
Otherwise we use ```AdjustRelativeTimeAndS()``` to adjust partitioned trajectory.
```cpp
bool InsertGearShiftTrajectory(
const bool flag_change_to_next, const size_t current_trajectory_index,
const std::vector<TrajGearPair>& partitioned_trajectories,
TrajGearPair* gear_switch_idle_time_trajectory);
```
```cpp
void GenerateGearShiftTrajectory(
const canbus::Chassis::GearPosition& gear_position,
TrajGearPair* gear_switch_idle_time_trajectory);
```
```cpp
void AdjustRelativeTimeAndS(
const std::vector<TrajGearPair>& partitioned_trajectories,
const size_t current_trajectory_index,
const size_t closest_trajectory_point_index,
DiscretizedTrajectory* stitched_trajectory_result,
TrajGearPair* current_partitioned_trajectory);
```
6. Return process status.
7. Output: partitioned trajectories.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/hybrid_a_star_en.md
|
# GENERATE COARSE TRAJECTORY IN THE OPEN SPACE
# Introduction
The goal of htbrid_a_star is to generate the coarse trajectory in the open space. Hybrid_a_star contains node3d, grid_search, reeds_shepp_path and hybrid_a_star. hybrid_a_star is the most important component generating the coarse trajectory and call the grid_search and reeds_shepp_path.
# Where is the code
Please refer to [hybrid a star.cc](https://github.com/ApolloAuto/apollo/tree/master/modules/planning/open_space/coarse_trajectory_generator/hybrid_a_star.cc)
# Code Reading
1. Input: current point(planned start point), goal point(planned end point), ROI_xy_boundary(the maximum and minimum boundary value of x and y), obstacles vertices vector(the corner position information). The function is follow:
``` cpp
bool HybridAStar::Plan(double sx, double sy, double sphi,
double ex, double ey, double ephi,
const std::vector<double>& XYbounds,
const std::vector<std::vector<common::math::Vec2d>>& obstacles_vertices_vec,HybridAStartResult* result)
```
The input HybridAStar::Plan() is called by the open_space_trajectory_provider.cc, please refer to [open_space_trajectory_provider.cc](https://github.com/ApolloAuto/apollo/blob/master/modules/planning/tasks/optimizers/open_space_trajectory_generation/open_space_trajectory_provider.cc)
2. Construct obstacles_linesegment_vector. The main method is to form a line segment from a single obstacle point in order; then, each obstacle line segment is stored in obstacles_linesegment_vector that will be used to generate the DP map.
``` cpp
std::vector<std::vector<common::math::LineSegment2d>>
obstacles_linesegments_vec;
for (const auto& obstacle_vertices : obstacles_vertices_vec) {
size_t vertices_num = obstacle_vertices.size();
std::vector<common::math::LineSegment2d> obstacle_linesegments;
for (size_t i = 0; i < vertices_num - 1; ++i) {
common::math::LineSegment2d line_segment = common::math::LineSegment2d(
obstacle_vertices[i], obstacle_vertices[i + 1]);
obstacle_linesegments.emplace_back(line_segment);
}
obstacles_linesegments_vec.emplace_back(obstacle_linesegments);
}
obstacles_linesegments_vec_ = std::move(obstacles_linesegments_vec);
```
3. Construct the planned point same as Node3d, please refer to [node3d.h](https://github.com/ApolloAuto/apollo/blob/master/modules/planning/open_space/coarse_trajectory_generator/node3d.h). The planned starting point and the ending point are constructed in the form of Node3d that will be save to open set and will be checked by the ValidityCheck() function.
``` cpp
start_node_.reset(
new Node3d({sx}, {sy}, {sphi}, XYbounds_, planner_open_space_config_));
end_node_.reset(
new Node3d({ex}, {ey}, {ephi}, XYbounds_, planner_open_space_config_));
```
4. Enter the main while loop to get a set of nodes.
1. Exit trajectory generation when open_pq_ is empty. The open_pq_ is a std::priority_queue type that the first element represents the order of nodes in the open set, the second element represents the cost of nodes which storage in descending order.
2. Use AnalyticExpansion() function to determine whether there is a collision free trajectory that based on the reeds_shepp_path from current point to target end point. if it exists, exit the while loop search.
``` cpp
if (AnalyticExpansion(current_node)) {
break;
}
```
3. Store the current point in the close set and Expand the next node according to the bicycle kinematics model. The number of nodes is a parameter. Generate the next node by Next_node_generator() function and use ValidityCheck() function to detect this node.
5. Generate the coarse trajectory by nodes. The GetResult() function is used to generate the coarse trajectory.
``` cpp
bool HybridAStar::GetResult(HybridAStartResult* result)
```
6. Output: The optput is partial trajectory information, which include x,y,phi,v,a,steer,s.
# Algorithm Detail
``` cpp
bool HybridAStar::ValidityCheck(std::shared_ptr<Node3d> node)
```
The detection method is based on boundary range judgment and boundary overlap judgment.
1. Parameter: the input parameter is node which same as node3d.
2. Introduction: the function is used to check for collisions.
3. Process detail:
1. Boundary range judgment. If the x and y of node exceed the range of the corresponding x and y of boundary, then return false, reprents invalid.
2. Boundary overlap judgment. If the bounding box of vehicle overlaps any line segment, then return false. Judge the overlap by whether the line and box intersect.
``` cpp
bool GridSearch::GenerateDpMap(const double ex, const double ey,
const std::vector<double>& XYbounds,
const std::vector<std::vector<common::math::LineSegment2d>> &obstacles_linesegments_vec)
```
the function is used to generate dp map by dynamic programming, please refer (https://github.com/ApolloAuto/apollo/blob/master/modules/planning/open_space/coarse_trajectory_generator/grid_search.cc)
1. Parameter: ex and ey are the postion of goal point, XYbounds_ is the boundary of x and y, obstacles_linesegments_ is the line segments which is composed of boundary point.
2. Introduction: the function is used to generate the dp map
3. Process detail:
1. Grid the XYbounds_ according to grid resolution, then get the max grid.
2. Dp map store the cost of node.
``` cpp
bool HybridAStar::AnalyticExpansion(std::shared_ptr<Node3d> current_node)
```
The function is used to check if an analystic curve could be connected from current configuration to the end configuration without collision. if so, search ends.
1. Parameter: current node is start point of planning.
2. introduction: the function based on the reeds shepp method which is a geometric algorithm composed of arc and line. Reeds shepp is used for search acceleration.
3. Process detail:
1. Generate the reeds shepps path by the ShortestRSP() function. The length is optimal and shortest.
2. Check the path is collision free by the RSPCheck() function which call the ValidityCheck() function.
3. Load the whole reeds shepp path as nodes and add nodes to the close set.
``` cpp
bool HybridAStar::AnalyticExpansion(std::shared_ptr<Node3d> current_node)
```
The funtion is used to generate next node based on the current node.
1. Parameter: the current node of the search and the next node serial number
2. Introduction: the next node is calculated based on steering wheel uniform sampling and vehicle kinematics.
3. Process detail:
1. The steering angle is calculated according to the number and order of sampling points.
2. Generate the next node according to the kinematic model.
3. Check if the next node runs outside of XY boundary.
``` cpp
void HybridAStar::CalculateNodeCost(std::shared_ptr<Node3d> current_node,
std::shared_ptr<Node3d> next_node)
```
The function is used to calculate the cost of node.
1. Parameter: current node(vehicle position) and next node.
2. Introduction: the calculated cost include trajectory cost and heuristic cost considering obstacles based on holonomic.
3. Process detail:
1. the trajectory cost include the current node's trajectory cost and the trajectory cost from current node to next node.
2. trajectory cost is determined by the sampling distance, the gear change between them and the steering change rate.
3. heuristic cost is get from the dp map.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/qp_spline_st_speed_optimizer.md
|
# QP-Spline-ST-Speed Optimizer
_**Tip**: to read the equations in the document, you are recommended to use Chrome with [a plugin](https://chrome.google.com/webstore/detail/tex-all-the-things/cbimabofgmfdkicghcadidpemeenbffn) or copy the latex equation to [an online editor](http://www.hostmath.com/)_
## 1 Definition
After finding a path in QP-Spline-Path, Apollo converts all obstacles on the path and the ADV (autonomous driving vehicle) into an path-time (S-T) graph, which represents that the station changes over time along the path. The speed optimization task is to find a path on the S-T graph that is collision-free and comfortable.
Apollo uses splines to represent speed profiles, which are lists of S-T points in S-T graph. Apollo leverages Quadratic programming to find the best profile. The standard form of QP problem is defined as:
```
$$
minimize \frac{1}{2} \cdot x^T \cdot H \cdot x + f^T \cdot x
\\
s.t. LB \leq x \leq UB
\\
A_{eq}x = b_{eq}
\\
Ax \leq b
$$
```
## 2 Objective function
### 2.1 Get spline segments
Split the S-T profile into **n** segments. Each segment trajectory is defined by a polynomial.
### 2.2 Define function for each spline segment
Each segment ***i*** has an accumulated distance $d_i$ along a reference line. And the trajectory for the segment is defined as a polynomial of degree five by default. The degree of the polynomials are adjustable by configuration parameters.
```
$$
s = f_i(t)
= a_{0i} + a_{1i} \cdot t + a_{2i} \cdot t^2 + a_{3i} \cdot t^3 + a_{4i} \cdot t^4 + a_{5i} \cdot t^5
$$
```
### 2.3 Define objective function of optimization for each segment
Apollo first defines $cost_1$ to make the trajectory smooth:
```
$$
cost_1 = \sum_{i=1}^{n} \Big( w_1 \cdot \int\limits_{0}^{d_i} (f_i')^2(s) ds + w_2 \cdot \int\limits_{0}^{d_i} (f_i'')^2(s) ds + w_3 \cdot \int\limits_{0}^{d_i} (f_i^{\prime\prime\prime})^2(s) ds \Big)
$$
```
Then Apollo defines $cost_2$ as the difference between the final S-T trajectory and the cruise S-T trajectory (with given speed limits — m points):
```
$$
cost_2 = \sum_{i=1}^{n}\sum_{j=1}^{m}\Big(f_i(t_j)- s_j\Big)^2
$$
```
Similarly, Apollo defines $cost_3$ that is the difference between the first S-T path and the follow S-T path (o points):
```
$$
cost_3 = \sum_{i=1}^{n}\sum_{j=1}^{o}\Big(f_i(t_j)- s_j\Big)^2
$$
```
Finally, the objective function is defined as:
```
$$
cost = cost_1 + cost_2 + cost_3
$$
```
## 3 Constraints
### 3.1 The init point constraints
Given the assumption that the first point is ($t0$, $s0$), and $s0$ is on the planned path $f_i(t)$, $f'i(t)$, and $f_i(t)''$ (position, velocity, acceleration). Apollo converts those constraint into QP equality constraints:
```
$$
A_{eq}x = b_{eq}
$$
```
### 3.2 Monotone constraint
The path must be monotone, e.g., the vehicle can only drive forward.
Sample **m** points on the path, for each $j$ and $j-1$ point pairs ($j\in[1,...,m]$):
If the two points on the same spline $k$:
```
$$
\begin{vmatrix} 1 & t_j & t_j^2 & t_j^3 & t_j^4&t_j^5 \\ \end{vmatrix}
\cdot
\begin{vmatrix} a_k \\ b_k \\ c_k \\ d_k \\ e_k \\ f_k \end{vmatrix}
>
\begin{vmatrix} 1 & t_{j-1} & t_{j-1}^2 & t_{j-1}^3 & t_{j-1}^4&t_{j-1}^5 \\ \end{vmatrix}
\cdot
\begin{vmatrix} a_{k} \\ b_{k} \\ c_{k} \\ d_{k} \\ e_{k} \\ f_{k} \end{vmatrix}
$$
```
If the two points on the different spline $k$ and $l$:
```
$$
\begin{vmatrix} 1 & t_j & t_j^2 & t_j^3 & t_j^4&t_j^5 \\ \end{vmatrix}
\cdot
\begin{vmatrix} a_k \\ b_k \\ c_k \\ d_k \\ e_k \\ f_k \end{vmatrix}
>
\begin{vmatrix} 1 & t_{j-1} & t_{j-1}^2 & t_{j-1}^3 & t_{j-1}^4&t_{j-1}^5 \\ \end{vmatrix}
\cdot
\begin{vmatrix} a_{l} \\ b_{l} \\ c_{l} \\ d_{l} \\ e_{l} \\ f_{l} \end{vmatrix}
$$
```
### 3.3 Joint smoothness constraints
This constraint is designed to smooth the spline joint. Given the assumption that two segments, $seg_k$ and $seg_{k+1}$, are connected, and the accumulated **s** of segment $seg_k$ is $s_k$, Apollo calculates the constraint equation as:
```
$$
f_k(t_k) = f_{k+1} (t_0)
$$
```
Namely:
```
$$
\begin{vmatrix}
1 & t_k & t_k^2 & t_k^3 & t_k^4&t_k^5 \\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_{k0} \\ a_{k1} \\ a_{k2} \\ a_{k3} \\ a_{k4} \\ a_{k5}
\end{vmatrix}
=
\begin{vmatrix}
1 & t_{0} & t_{0}^2 & t_{0}^3 & t_{0}^4&t_{0}^5 \\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_{k+1,0} \\ a_{k+1,1} \\ a_{k+1,2} \\ a_{k+1,3} \\ a_{k+1,4} \\ a_{k+1,5}
\end{vmatrix}
$$
```
Then
```
$$
\begin{vmatrix}
1 & t_k & t_k^2 & t_k^3 & t_k^4&t_k^5 & -1 & -t_{0} & -t_{0}^2 & -t_{0}^3 & -t_{0}^4&-t_{0}^5\\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_{k0} \\ a_{k1} \\ a_{k2} \\ a_{k3} \\ a_{k4} \\ a_{k5} \\ a_{k+1,0} \\ a_{k+1,1} \\ a_{k+1,2} \\ a_{k+1,3} \\ a_{k+1,4} \\ a_{k+1,5}
\end{vmatrix}
= 0
$$
```
The result is $t_0$ = 0 in the equation.
Similarly calculate the equality constraints for
```
$$
f'_k(t_k) = f'_{k+1} (t_0)
\\
f''_k(t_k) = f''_{k+1} (t_0)
\\
f'''_k(t_k) = f'''_{k+1} (t_0)
$$
```
### 3.4 Sampled points for boundary constraint
Evenly sample **m** points along the path, and check the obstacle boundary at those points. Convert the constraint into QP inequality constraints, using:
```
$$
Ax \leq b
$$
```
Apollo first finds the lower boundary $l_{lb,j}$ at those points ($s_j$, $l_j$) and $j\in[0, m]$ based on the road width and surrounding obstacles. Then it calculates the inequality constraints as:
```
$$
\begin{vmatrix}
1 & t_0 & t_0^2 & t_0^3 & t_0^4&t_0^5 \\
1 & t_1 & t_1^2 & t_1^3 & t_1^4&t_1^5 \\
...&...&...&...&...&... \\
1 & t_m & t_m^2 & t_m^3 & t_m^4&t_m^5 \\
\end{vmatrix} \cdot \begin{vmatrix} a_i \\ b_i \\ c_i \\ d_i \\ e_i \\ f_i \end{vmatrix}
\leq
\begin{vmatrix}
l_{lb,0}\\
l_{lb,1}\\
...\\
l_{lb,m}\\
\end{vmatrix}
$$
```
Similarly, for upper boundary $l_{ub,j}$, Apollo calculates the inequality constraints as:
```
$$
\begin{vmatrix}
1 & t_0 & t_0^2 & t_0^3 & t_0^4&t_0^5 \\
1 & t_1 & t_1^2 & t_1^3 & t_1^4&t_1^5 \\
...&...&...&...&...&... \\
1 & t_m & t_m^2 & t_m^3 & t_m^4&t_m^5 \\
\end{vmatrix} \cdot \begin{vmatrix} a_i \\ b_i \\ c_i \\ d_i \\ e_i \\ f_i \end{vmatrix}
\leq
-1 \cdot
\begin{vmatrix}
l_{ub,0}\\
l_{ub,1}\\
...\\
l_{ub,m}\\
\end{vmatrix}
$$
```
### 3.5 Speed Boundary constraint
Apollo establishes a speed limit boundary as well.
Sample **m** points on the st curve, and get speed limits defined as an upper boundary and a lower boundary for each point $j$, e.g., $v{ub,j}$ and $v{lb,j}$ . The constraints are defined as:
```
$$
f'(t_j) \geq v_{lb,j}
$$
```
Namely
```
$$
\begin{vmatrix}
0& 1 & t_0 & t_0^2 & t_0^3 & t_0^4 \\
0 & 1 & t_1 & t_1^2 & t_1^3 & t_1^4 \\
...&...&...&...&...&... \\
0& 1 & t_m & t_m^2 & t_m^3 & t_m^4 \\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_i \\ b_i \\ c_i \\ d_i \\ e_i \\ f_i
\end{vmatrix}
\geq
\begin{vmatrix} v_{lb,0}\\ v_{lb,1}\\ ...\\ v_{lb,m}\\ \end{vmatrix}
$$
```
And
```
$$
f'(t_j) \leq v_{ub,j}
$$
```
Namely
```
$$
\begin{vmatrix}
0& 1 & t_0 & t_0^2 & t_0^3 & t_0^4 \\
0 & 1 & t_1 & t_1^2 & t_1^3 & t_1^4 \\
...&...&...&...&...&... \\
0 &1 & t_m & t_m^2 & t_m^3 & t_m^4 \\
\end{vmatrix} \cdot \begin{vmatrix} a_i \\ b_i \\ c_i \\ d_i \\ e_i \\ f_i \end{vmatrix}
\leq
\begin{vmatrix}
v_{ub,0}\\
v_{ub,1}\\
...\\
v_{ub,m}\\
\end{vmatrix}
$$
```
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/qp_spline_path_optimizer_cn.md
|
# 二次规划(QP)样条路径优化
_**Tip**: 为了更好的展示本文档中的等式,我们建议使用者使用带有[插件](https://chrome.google.com/webstore/detail/tex-all-the-things/cbimabofgmfdkicghcadidpemeenbffn)的Chrome浏览器,或者将Latex等式拷贝到[在线编辑公式网站](http://www.hostmath.com/)进行浏览。_
二次规划(QP)+样条插值
## 1. 目标函数
### 1.1 获得路径长度
路径定义在station-lateral坐标系中。**s**的变化区间为从车辆当前位置点到默认路径的长度。
### 1.2 获得样条段
将路径划分为**n**段,每段路径用一个多项式来表示。
### 1.3 定义样条段函数
每个样条段 ***i*** 都有沿着参考线的累加距离$d_i$。每段的路径默认用5介多项式表示。
```
$$
l = f_i(s)
= a_{i0} + a_{i1} \cdot s + a_{i2} \cdot s^2 + a_{i3} \cdot s^3 + a_{i4} \cdot s^4 + a_{i5} \cdot s^5 (0 \leq s \leq d_{i})
$$
```
### 1.4 定义每个样条段优化目标函数
```
$$
cost = \sum_{i=1}^{n} \Big( w_1 \cdot \int\limits_{0}^{d_i} (f_i')^2(s) ds + w_2 \cdot \int\limits_{0}^{d_i} (f_i'')^2(s) ds + w_3 \cdot \int\limits_{0}^{d_i} (f_i^{\prime\prime\prime})^2(s) ds \Big)
$$
```
### 1.5 将开销(cost)函数转换为QP公式
QP公式:
```
$$
\begin{aligned}
minimize & \frac{1}{2} \cdot x^T \cdot H \cdot x + f^T \cdot x \\
s.t. \qquad & LB \leq x \leq UB \\
& A_{eq}x = b_{eq} \\
& Ax \geq b
\end{aligned}
$$
```
下面是将开销(cost)函数转换为QP公式的例子:
```
$$
f_i(s) =
\begin{vmatrix} 1 & s & s^2 & s^3 & s^4 & s^5 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
$$
```
且
```
$$
f_i'(s) =
\begin{vmatrix} 0 & 1 & 2s & 3s^2 & 4s^3 & 5s^4 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
$$
```
且
```
$$
f_i'(s)^2 =
\begin{vmatrix} a_{i0} & a_{i1} & a_{i2} & a_{i3} & a_{i4} & a_{i5} \end{vmatrix}
\cdot
\begin{vmatrix} 0 \\ 1 \\ 2s \\ 3s^2 \\ 4s^3 \\ 5s^4 \end{vmatrix}
\cdot
\begin{vmatrix} 0 & 1 & 2s & 3s^2 & 4s^3 & 5s^4 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
$$
```
然后得到,
```
$$
\int\limits_{0}^{d_i} f_i'(s)^2 ds =
\int\limits_{0}^{d_i}
\begin{vmatrix} a_{i0} & a_{i1} & a_{i2} & a_{i3} & a_{i4} & a_{i5} \end{vmatrix}
\cdot
\begin{vmatrix} 0 \\ 1 \\ 2s \\ 3s^2 \\ 4s^3 \\ 5s^4 \end{vmatrix}
\cdot
\begin{vmatrix} 0 & 1 & 2s & 3s^2 & 4s^3 & 5s^4 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix} ds
$$
```
从聚合函数中提取出常量得到,
```
$$
\int\limits_{0}^{d_i} f'(s)^2 ds =
\begin{vmatrix} a_{i0} & a_{i1} & a_{i2} & a_{i3} & a_{i4} & a_{i5} \end{vmatrix}
\cdot
\int\limits_{0}^{d_i}
\begin{vmatrix} 0 \\ 1 \\ 2s \\ 3s^2 \\ 4s^3 \\ 5s^4 \end{vmatrix}
\cdot
\begin{vmatrix} 0 & 1 & 2s & 3s^2 & 4s^3 & 5s^4 \end{vmatrix} ds
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
$$
$$
=\begin{vmatrix} a_{i0} & a_{i1} & a_{i2} & a_{i3} & a_{i4} & a_{i5} \end{vmatrix}
\cdot \int\limits_{0}^{d_i}
\begin{vmatrix}
0 & 0 &0&0&0&0\\
0 & 1 & 2s & 3s^2 & 4s^3 & 5s^4\\
0 & 2s & 4s^2 & 6s^3 & 8s^4 & 10s^5\\
0 & 3s^2 & 6s^3 & 9s^4 & 12s^5&15s^6 \\
0 & 4s^3 & 8s^4 &12s^5 &16s^6&20s^7 \\
0 & 5s^4 & 10s^5 & 15s^6 & 20s^7 & 25s^8
\end{vmatrix} ds
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
$$
```
最后得到,
```
$$
\int\limits_{0}^{d_i}
f'_i(s)^2 ds =\begin{vmatrix} a_{i0} & a_{i1} & a_{i2} & a_{i3} & a_{i4} & a_{i5} \end{vmatrix}
\cdot \begin{vmatrix}
0 & 0 & 0 & 0 &0&0\\
0 & d_i & d_i^2 & d_i^3 & d_i^4&d_i^5\\
0& d_i^2 & \frac{4}{3}d_i^3& \frac{6}{4}d_i^4 & \frac{8}{5}d_i^5&\frac{10}{6}d_i^6\\
0& d_i^3 & \frac{6}{4}d_i^4 & \frac{9}{5}d_i^5 & \frac{12}{6}d_i^6&\frac{15}{7}d_i^7\\
0& d_i^4 & \frac{8}{5}d_i^5 & \frac{12}{6}d_i^6 & \frac{16}{7}d_i^7&\frac{20}{8}d_i^8\\
0& d_i^5 & \frac{10}{6}d_i^6 & \frac{15}{7}d_i^7 & \frac{20}{8}d_i^8&\frac{25}{9}d_i^9
\end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
$$
```
请注意我们最后得到一个6介的矩阵来表示5介样条插值的衍生开销。
应用同样的推理方法可以得到2介,3介样条插值的衍生开销。
## 2 约束条件
### 2.1 初始点约束
假设第一个点为 ($s_0$, $l_0$), ($s_0$, $l'_0$) and ($s_0$, $l''_0$),其中$l_0$ , $l'_0$ and $l''_0$表示横向的偏移,并且规划路径的起始点的第一,第二个点的衍生开销可以从$f_i(s)$, $f'_i(s)$, $f_i(s)''$计算得到。
将上述约束转换为QP约束等式,使用等式:
```
$$
A_{eq}x = b_{eq}
$$
```
下面是转换的具体步骤:
```
$$
f_i(s_0) =
\begin{vmatrix} 1 & s_0 & s_0^2 & s_0^3 & s_0^4&s_0^5 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5}\end{vmatrix} = l_0
$$
```
且
```
$$
f'_i(s_0) =
\begin{vmatrix} 0& 1 & 2s_0 & 3s_0^2 & 4s_0^3 &5 s_0^4 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix} = l'_0
$$
```
且
```
$$
f''_i(s_0) =
\begin{vmatrix} 0&0& 2 & 3\times2s_0 & 4\times3s_0^2 & 5\times4s_0^3 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix} = l''_0
$$
```
其中,i是包含$s_0$的样条段的索引值。
### 2.2 终点约束
和起始点相同,终点$(s_e, l_e)$ 也应当按照起始点的计算方法生成约束条件。
将起始点和终点组合在一起,得出约束等式为:
```
$$
\begin{vmatrix}
1 & s_0 & s_0^2 & s_0^3 & s_0^4&s_0^5 \\
0&1 & 2s_0 & 3s_0^2 & 4s_0^3 & 5s_0^4 \\
0& 0&2 & 3\times2s_0 & 4\times3s_0^2 & 5\times4s_0^3 \\
1 & s_e & s_e^2 & s_e^3 & s_e^4&s_e^5 \\
0&1 & 2s_e & 3s_e^2 & 4s_e^3 & 5s_e^4 \\
0& 0&2 & 3\times2s_e & 4\times3s_e^2 & 5\times4s_e^3
\end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
=
\begin{vmatrix}
l_0\\
l'_0\\
l''_0\\
l_e\\
l'_e\\
l''_e\\
\end{vmatrix}
$$
```
### 2.3 平滑节点约束
该约束的目的是使样条的节点更加平滑。假设两个段$seg_k$ 和$seg_{k+1}$互相连接,且$seg_k$的累计值s为$s_k$。计算约束的等式为:
```
$$
f_k(s_k) = f_{k+1} (s_0)
$$
```
下面是计算的具体步骤:
```
$$
\begin{vmatrix}
1 & s_k & s_k^2 & s_k^3 & s_k^4&s_k^5 \\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_{k0} \\ a_{k1} \\ a_{k2} \\ a_{k3} \\ a_{k4} \\ a_{k5}
\end{vmatrix}
=
\begin{vmatrix}
1 & s_{0} & s_{0}^2 & s_{0}^3 & s_{0}^4&s_{0}^5 \\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_{k+1,0} \\ a_{k+1,1} \\ a_{k+1,2} \\ a_{k+1,3} \\ a_{k+1,4} \\ a_{k+1,5}
\end{vmatrix}
$$
```
然后
```
$$
\begin{vmatrix}
1 & s_k & s_k^2 & s_k^3 & s_k^4&s_k^5 & -1 & -s_{0} & -s_{0}^2 & -s_{0}^3 & -s_{0}^4&-s_{0}^5\\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_{k0} \\ a_{k1} \\ a_{k2} \\ a_{k3} \\ a_{k4} \\ a_{k5} \\ a_{k+1,0} \\ a_{k+1,1} \\ a_{k+1,2} \\ a_{k+1,3} \\ a_{k+1,4} \\ a_{k+1,5}
\end{vmatrix}
= 0
$$
```
将$s_0$ = 0代入等式。
同样地,可以为下述等式计算约束等式:
```
$$
f'_k(s_k) = f'_{k+1} (s_0)
\\
f''_k(s_k) = f''_{k+1} (s_0)
\\
f'''_k(s_k) = f'''_{k+1} (s_0)
$$
```
### 2.4 点采样边界约束
在路径上均匀的取样**m**个点,检查这些点上的障碍物边界。将这些约束转换为QP约束不等式,使用不等式:
```
$$
Ax \geq b
$$
```
首先基于道路宽度和周围的障碍物找到点 $(s_j, l_j)$的下边界$l_{lb,j}$,且$j\in[0, m]$。计算约束的不等式为:
```
$$
\begin{vmatrix}
1 & s_0 & s_0^2 & s_0^3 & s_0^4&s_0^5 \\
1 & s_1 & s_1^2 & s_1^3 & s_1^4&s_1^5 \\
...&...&...&...&...&... \\
1 & s_m & s_m^2 & s_m^3 & s_m^4&s_m^5 \\
\end{vmatrix} \cdot \begin{vmatrix}a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
\geq
\begin{vmatrix}
l_{lb,0}\\
l_{lb,1}\\
...\\
l_{lb,m}\\
\end{vmatrix}
$$
```
同样地,对上边界$l_{ub,j}$,计算约束的不等式为:
```
$$
\begin{vmatrix}
-1 & -s_0 & -s_0^2 & -s_0^3 & -s_0^4&-s_0^5 \\
-1 & -s_1 & -s_1^2 & -s_1^3 & -s_1^4&-s_1^5 \\
...&...-&...&...&...&... \\
-1 & -s_m & -s_m^2 & -s_m^3 & -s_m^4&-s_m^5 \\
\end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
\geq
-1 \cdot
\begin{vmatrix}
l_{ub,0}\\
l_{ub,1}\\
...\\
l_{ub,m}\\
\end{vmatrix}
$$
```
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/planning_and_control_simulation.md
|
## Introduction
Apollo provides developers with a cloud-terminal integrated simulation platform for Autopilot. Apollo studio provides a variety of typical traffic flow scenarios and vehicle dynamics models. Developers can use Scenario management, Scenario editing, dynamics models and other operations. Apollo's local Visualization Tool Dreamview can download scenarios and dynamics models from cloud through Studio Profile, Thus, the debugging of Apollo open source code (planning&decision&control) is realized based on the local PNC Simulation container. In addition, Apollo Studio also provides a simulation evaluation function based on safety rules and somatosensory characteristics to help users improve the efficiency of automatic driving development.
## Steps to use PNC Simulation
### Prerequisites:
Please ensure your apollo version is 8.0.
### Step1. Add a Scenario Set
1. Sign in [Apollo Studio](https://studio.apollo.auto/login?url=/).
2. Click **Simulation** > **Scenario Management**.
3. In **Scenario Management**, select **Scenario Set**, and click **Add a Scenario Set.**

4. Edit the information of your new scenario, choose **Offline simulation** type, and click **NEXT**.
5. Select the required scenario to complete the scenario Set Adding.

### Step 2 Install the Dreamview Plug-in
1. Click **Persional Information** in the upper right corner on Apollo Studio.

2. Choose **Service Rights** > **Simulation**.
3. Click **Generate** in the **Plugin Installation** to generate the Dreamview plug-in.

4. Copy the link of the plug-in and install it to the local environment.

### Step 3. Download Sencario Set to the Local Environment
1. Start Dreamview in your local environmen [http://localhost:8888](http://localhost:8888).
2. Enable **Sim Control** in **Tasks**.

### Step 4. Choose a Scenario
Download your Scenario Set in **Profile** and choose a Scenario Set in **Scenario Profiles**.

### Step 5. Choose a Dynamic Model
Click **Profile** to go to the Profile interface and select the required dynamic model. The dynamic model characteristics are as follows:
*Simulation Perfect Control: perfect control, no dynamic model,
*MKZ Modell: kinematics model, applicable to MKZ models,
*Point Mass Model: kinematics model, applicable to all models.

### Step 6. Enable Modules
Enable **Planning, Control**, and **Routing** in **Module Controller**.
The Routing module searches the feasible path in the map. The planning module guides the vehicle to plan, make decisions, and move forward. The red line is the path searched by the routing module in the map, and the blue track is the local path planned by the planning module.

### Step 7. Add Point of Interest
Let us add point of interest and send routing request to set the route.
1. In Dreamview,click **Routing Editing**.
2. Click **Add Point of Interest**, and select a starting point in the map.
3. Select an **End Point** on the lane.
4. Click **Send Routing Request** to send the added routing point.

### Step 8. Start Auto
Before you select Mkz Model or Point Mass Model, go to the **Tasks** interface to check whether the mode is **AUTO**.

If not, click **Start Auto**, and you can see the vehicle running effect under the dynamic model in the interface.

| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/planning_component.md
|
# Planning Component Introduction
# Introduction
This article describes the architecture of planning module. It mainly consists of the following parts:
1. Cyber component related knowledge
2. How the messages are received and sent
3. How the trajectory is arranged and made up
# Where is the code
Please refer to [code](https://github.com/ApolloAuto/apollo/blob/master/modules/planning/planning_component.h).
# Code Reading
## Cyber component related knowledge
Please refer to [Cyber](../04_CyberRT/CyberRT_Terms.md).
## How the messages are received and sent

1. Input
Messages are partially input from readers, which are defined in PlanningComponent::Init(). For Planning component, readers receive message types of RoutingResponse/TrafficLightDetection/PadMessage/Stories/MapMsg and store them in local for processing afterward.
Another part of input messages are defined in PlanningComponent::Proc(), where the planning process is called when new messages arrives.
2. Process. PlanningComponent::Proc() function works like Reader's callback function. Each time there are new messages of prediction::PredictionObstacles/canbus::Chassis/localization::LocalizationEstimate, this process is implemented till the end of this function.
3. Output. PlanningComponent output the message by the following line `planning_writer_->Write(adc_trajectory_pb)`, in which the writer send the final adc_trajectory_pb message to the cyber system. The writer is initialized in PlanningComponent::Init(), just after the readers are initialized.
## How the trajectory as planning component output is produced
Now we know how messages are input to and output from the planning component. The work of planning module is basically processing the input messages and producing an appropriate trajectory for the ADC. The final goal of this is to ensure safety, comfort and passability. And different algorithms are explored in Apollo in order to achieve or get closer to this goal.
- The basic and more mature algorithm is rule-based planning, where we use a two-layer state machine to manage the path in different scenarios. For details, please refer [scenarios](https://github.com/ApolloAuto/apollo/tree/master/modules/planning/conf/scenario).
- The learning based algorithms including Hybrid Mode are under exploration, which can be enabled in [planning_config](https://github.com/ApolloAuto/apollo/blob/master/modules/planning/conf/planning_config.pb.txt). The E2E mode outputs a planning trajectory when inputting a birdview image centered by the vehicle pose and current velocity. Note E2E methods are not tested on road, while it's encouraged to do experiments in simulation for research purposes.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/reference_line_smoother.md
|
# Reference Line Smoother
_**Tip**: to read the equations in the document, you are recommended to use Chrome with [a plugin](https://chrome.google.com/webstore/detail/tex-all-the-things/cbimabofgmfdkicghcadidpemeenbffn) or copy the latex equation to [an online editor](http://www.hostmath.com/)_
Quadratic programming + Spline interpolation
## 1. Objective function
### 1.1 Segment routing path
Segment routing path into **n** segments. each segment trajectory is defined by two polynomials:
```
$$
x = f_i(t)
= a_{i0} + a_{i1} * t + a_{i2} * t^2 + a_{i3} * t^3 + a_{i4} * t^4 + a_{i5} * t^5
$$
```
```
$$
y = g_i(t) = b_{i0} + b_{i1} * t + b_{i2} * t^2 + b_{i3} * t^3 + b_{i4} * t^4 + b_{i5} * t^5
$$
```
### 1.2 Define objective function of optimization for each segment
```
$$
cost =
\sum_{i=1}^{n}
\Big(
\int\limits_{0}^{t_i} (f_i''')^2(t) dt
+ \int\limits_{0}^{t_i} (g_i''')^2(t) dt
\Big)
$$
```
### 1.3 Convert the cost function to QP formulation
QP formulation:
```
$$
\frac{1}{2} \cdot x^T \cdot H \cdot x + f^T \cdot x
\\
s.t. LB \leq x \leq UB
\\
A_{eq}x = b_{eq}
\\
Ax \leq b
$$
```
## 2 Constraints
### 2.1 Joint smoothness constraints
This constraint smoothes the spline joint. Let's assume two segments, $seg_k$ and $seg_{k+1}$, are connected and the accumulated **s** of segment $seg_k$ is $s_k$. Calculate the constraint equation as:
```
$$
f_k(s_k) = f_{k+1} (s_0)
$$
```
Similarly the formula works for the equality constraints, such as:
```
$$
f'_k(s_k) = f'_{k+1} (s_0)
\\
f''_k(s_k) = f''_{k+1} (s_0)
\\
f'''_k(s_k) = f'''_{k+1} (s_0)
\\
g_k(s_k) = g_{k+1} (s_0)
\\
g'_k(s_k) = g'_{k+1} (s_0)
\\
g''_k(s_k) = g''_{k+1} (s_0)
\\
g'''_k(s_k) = g'''_{k+1} (s_0)
$$
```
### 2.2 Sampled points for boundary constraint
Evenly sample **m** points along the path and check the predefined boundaries at those points.
```
$$
f_i(t_l) - x_l< boundary
\\
g_i(t_l) - y_l< boundary
$$
```
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/reference_line_smoother_cn.md
|
# 参考线平滑设定
_**Tip**: 为了更好的展示本文档中的等式,我们建议使用者使用带有[插件](https://chrome.google.com/webstore/detail/tex-all-the-things/cbimabofgmfdkicghcadidpemeenbffn)的Chrome浏览器,或者将Latex等式拷贝到[在线编辑公式网站](http://www.hostmath.com/)进行浏览。_
二次规划(QP)+样条插值
## 1. 目标函数
### 1.1 分段寻路路径
将寻路路径划分为 **n** 段,每段用2个多项式表示:
```
$$
x = f_i(t)
= a_{i0} + a_{i1} * t + a_{i2} * t^2 + a_{i3} * t^3 + a_{i4} * t^4 + a_{i5} * t^5
$$
```
```
$$
y = g_i(t) = b_{i0} + b_{i1} * t + b_{i2} * t^2 + b_{i3} * t^3 + b_{i4} * t^4 + b_{i5} * t^5
$$
```
### 1.2 定义样条段优化目标函数
```
$$
cost =
\sum_{i=1}^{n}
\Big(
\int\limits_{0}^{t_i} (f_i''')^2(t) dt
+ \int\limits_{0}^{t_i} (g_i''')^2(t) dt
\Big)
$$
```
### 1.3 将开销(cost)函数转换为QP公式
QP公式:
```
$$
\frac{1}{2} \cdot x^T \cdot H \cdot x + f^T \cdot x
\\
s.t. LB \leq x \leq UB
\\
A_{eq}x = b_{eq}
\\
Ax \leq b
$$
```
## 2 约束条件
### 2.1 平滑节点约束
该约束的目的是使样条的节点更加平滑。假设两个段$seg_k$ 和$seg_{k+1}$互相连接,且$seg_k$的累计值 **s** 为$s_k$。计算约束的等式为:
```
$$
f_k(s_k) = f_{k+1} (s_0)
$$
```
同样地,该公式也适用于下述等式:
```
$$
f'_k(s_k) = f'_{k+1} (s_0)
\\
f''_k(s_k) = f''_{k+1} (s_0)
\\
f'''_k(s_k) = f'''_{k+1} (s_0)
\\
g_k(s_k) = g_{k+1} (s_0)
\\
g'_k(s_k) = g'_{k+1} (s_0)
\\
g''_k(s_k) = g''_{k+1} (s_0)
\\
g'''_k(s_k) = g'''_{k+1} (s_0)
$$
```
### 2.2 点采样边界约束
在路径上均匀的取样 **m** 个点并检查这些点的预定义边界。
```
$$
f_i(t_l) - x_l< boundary
\\
g_i(t_l) - y_l< boundary
$$
```
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/qp_spline_path_optimizer.md
|
# QP-Spline-Path Optimizer
_**Tip**: to read the equations in the document, you are recommended to use Chrome with [a plugin](https://chrome.google.com/webstore/detail/tex-all-the-things/cbimabofgmfdkicghcadidpemeenbffn) or copy the latex equation to [an online editor](http://www.hostmath.com/)_
Quadratic programming + Spline interpolation
## 1. Objective function
### 1.1 Get path length
Path is defined in station-lateral coordination system. The **s** range from vehicle's current position to default planning path length.
### 1.2 Get spline segments
Split the path into **n** segments. each segment trajectory is defined by a polynomial.
### 1.3 Define function for each spline segment
Each segment ***i*** has accumulated distance $d_i$ along reference line. The trajectory for the segment is defined as a polynomial of degree five by default.
```
$$
l = f_i(s)
= a_{i0} + a_{i1} \cdot s + a_{i2} \cdot s^2 + a_{i3} \cdot s^3 + a_{i4} \cdot s^4 + a_{i5} \cdot s^5 (0 \leq s \leq d_{i})
$$
```
### 1.4 Define objective function of optimization for each segment
```
$$
cost = \sum_{i=1}^{n} \Big( w_1 \cdot \int\limits_{0}^{d_i} (f_i')^2(s) ds + w_2 \cdot \int\limits_{0}^{d_i} (f_i'')^2(s) ds + w_3 \cdot \int\limits_{0}^{d_i} (f_i^{\prime\prime\prime})^2(s) ds \Big)
$$
```
### 1.5 Convert the cost function to QP formulation
QP formulation:
```
$$
\begin{aligned}
minimize & \frac{1}{2} \cdot x^T \cdot H \cdot x + f^T \cdot x \\
s.t. \qquad & LB \leq x \leq UB \\
& A_{eq}x = b_{eq} \\
& Ax \geq b
\end{aligned}
$$
```
Below is the example for converting the cost function into the QP formulation.
```
$$
f_i(s) =
\begin{vmatrix} 1 & s & s^2 & s^3 & s^4 & s^5 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
$$
```
And
```
$$
f_i'(s) =
\begin{vmatrix} 0 & 1 & 2s & 3s^2 & 4s^3 & 5s^4 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
$$
```
And
```
$$
f_i'(s)^2 =
\begin{vmatrix} a_{i0} & a_{i1} & a_{i2} & a_{i3} & a_{i4} & a_{i5} \end{vmatrix}
\cdot
\begin{vmatrix} 0 \\ 1 \\ 2s \\ 3s^2 \\ 4s^3 \\ 5s^4 \end{vmatrix}
\cdot
\begin{vmatrix} 0 & 1 & 2s & 3s^2 & 4s^3 & 5s^4 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
$$
```
then we have,
```
$$
\int\limits_{0}^{d_i} f_i'(s)^2 ds =
\int\limits_{0}^{d_i}
\begin{vmatrix} a_{i0} & a_{i1} & a_{i2} & a_{i3} & a_{i4} & a_{i5} \end{vmatrix}
\cdot
\begin{vmatrix} 0 \\ 1 \\ 2s \\ 3s^2 \\ 4s^3 \\ 5s^4 \end{vmatrix}
\cdot
\begin{vmatrix} 0 & 1 & 2s & 3s^2 & 4s^3 & 5s^4 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix} ds
$$
```
extract the const outside the integration, we have,
```
$$
\int\limits_{0}^{d_i} f'(s)^2 ds =
\begin{vmatrix} a_{i0} & a_{i1} & a_{i2} & a_{i3} & a_{i4} & a_{i5} \end{vmatrix}
\cdot
\int\limits_{0}^{d_i}
\begin{vmatrix} 0 \\ 1 \\ 2s \\ 3s^2 \\ 4s^3 \\ 5s^4 \end{vmatrix}
\cdot
\begin{vmatrix} 0 & 1 & 2s & 3s^2 & 4s^3 & 5s^4 \end{vmatrix} ds
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
$$
$$
=\begin{vmatrix} a_{i0} & a_{i1} & a_{i2} & a_{i3} & a_{i4} & a_{i5} \end{vmatrix}
\cdot \int\limits_{0}^{d_i}
\begin{vmatrix}
0 & 0 &0&0&0&0\\
0 & 1 & 2s & 3s^2 & 4s^3 & 5s^4\\
0 & 2s & 4s^2 & 6s^3 & 8s^4 & 10s^5\\
0 & 3s^2 & 6s^3 & 9s^4 & 12s^5&15s^6 \\
0 & 4s^3 & 8s^4 &12s^5 &16s^6&20s^7 \\
0 & 5s^4 & 10s^5 & 15s^6 & 20s^7 & 25s^8
\end{vmatrix} ds
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
$$
```
Finally, we have
```
$$
\int\limits_{0}^{d_i}
f'_i(s)^2 ds =\begin{vmatrix} a_{i0} & a_{i1} & a_{i2} & a_{i3} & a_{i4} & a_{i5} \end{vmatrix}
\cdot \begin{vmatrix}
0 & 0 & 0 & 0 &0&0\\
0 & d_i & d_i^2 & d_i^3 & d_i^4&d_i^5\\
0& d_i^2 & \frac{4}{3}d_i^3& \frac{6}{4}d_i^4 & \frac{8}{5}d_i^5&\frac{10}{6}d_i^6\\
0& d_i^3 & \frac{6}{4}d_i^4 & \frac{9}{5}d_i^5 & \frac{12}{6}d_i^6&\frac{15}{7}d_i^7\\
0& d_i^4 & \frac{8}{5}d_i^5 & \frac{12}{6}d_i^6 & \frac{16}{7}d_i^7&\frac{20}{8}d_i^8\\
0& d_i^5 & \frac{10}{6}d_i^6 & \frac{15}{7}d_i^7 & \frac{20}{8}d_i^8&\frac{25}{9}d_i^9
\end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
$$
```
Please notice that we got a 6 x 6 matrix to represent the derivative cost of 5th order spline.
Similar deduction can also be used to calculate the cost of second and third order derivatives.
## 2 Constraints
### 2.1 The init point constraints
Assume that the first point is ($s_0$, $l_0$), ($s_0$, $l'_0$) and ($s_0$, $l''_0$), where $l_0$ , $l'_0$ and $l''_0$ is the lateral offset and its first and second derivatives on the init point of planned path, and are calculated from $f_i(s)$, $f'_i(s)$, and $f_i(s)''$.
Convert those constraints into QP equality constraints, using:
```
$$
A_{eq}x = b_{eq}
$$
```
Below are the steps of conversion.
```
$$
f_i(s_0) =
\begin{vmatrix} 1 & s_0 & s_0^2 & s_0^3 & s_0^4&s_0^5 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5}\end{vmatrix} = l_0
$$
```
And
```
$$
f'_i(s_0) =
\begin{vmatrix} 0& 1 & 2s_0 & 3s_0^2 & 4s_0^3 &5 s_0^4 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix} = l'_0
$$
```
And
```
$$
f''_i(s_0) =
\begin{vmatrix} 0&0& 2 & 3\times2s_0 & 4\times3s_0^2 & 5\times4s_0^3 \end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix} = l''_0
$$
```
where i is the index of the segment that contains the $s_0$.
### 2.2 The end point constraints
Similar to the init point, the end point $(s_e, l_e)$ is known and should produce the same constraint as described in the init point calculations.
Combine the init point and end point, and show the equality constraint as:
```
$$
\begin{vmatrix}
1 & s_0 & s_0^2 & s_0^3 & s_0^4&s_0^5 \\
0&1 & 2s_0 & 3s_0^2 & 4s_0^3 & 5s_0^4 \\
0& 0&2 & 3\times2s_0 & 4\times3s_0^2 & 5\times4s_0^3 \\
1 & s_e & s_e^2 & s_e^3 & s_e^4&s_e^5 \\
0&1 & 2s_e & 3s_e^2 & 4s_e^3 & 5s_e^4 \\
0& 0&2 & 3\times2s_e & 4\times3s_e^2 & 5\times4s_e^3
\end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
=
\begin{vmatrix}
l_0\\
l'_0\\
l''_0\\
l_e\\
l'_e\\
l''_e\\
\end{vmatrix}
$$
```
### 2.3 Joint smoothness constraints
This constraint is designed to smooth the spline joint. Assume two segments $seg_k$ and $seg_{k+1}$ are connected, and the accumulated **s** of segment $seg_k$ is $s_k$. Calculate the constraint equation as:
```
$$
f_k(s_k) = f_{k+1} (s_0)
$$
```
Below are the steps of the calculation.
```
$$
\begin{vmatrix}
1 & s_k & s_k^2 & s_k^3 & s_k^4&s_k^5 \\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_{k0} \\ a_{k1} \\ a_{k2} \\ a_{k3} \\ a_{k4} \\ a_{k5}
\end{vmatrix}
=
\begin{vmatrix}
1 & s_{0} & s_{0}^2 & s_{0}^3 & s_{0}^4&s_{0}^5 \\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_{k+1,0} \\ a_{k+1,1} \\ a_{k+1,2} \\ a_{k+1,3} \\ a_{k+1,4} \\ a_{k+1,5}
\end{vmatrix}
$$
```
Then
```
$$
\begin{vmatrix}
1 & s_k & s_k^2 & s_k^3 & s_k^4&s_k^5 & -1 & -s_{0} & -s_{0}^2 & -s_{0}^3 & -s_{0}^4&-s_{0}^5\\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_{k0} \\ a_{k1} \\ a_{k2} \\ a_{k3} \\ a_{k4} \\ a_{k5} \\ a_{k+1,0} \\ a_{k+1,1} \\ a_{k+1,2} \\ a_{k+1,3} \\ a_{k+1,4} \\ a_{k+1,5}
\end{vmatrix}
= 0
$$
```
Use $s_0$ = 0 in the equation.
Similarly calculate the equality constraints for:
```
$$
f'_k(s_k) = f'_{k+1} (s_0)
\\
f''_k(s_k) = f''_{k+1} (s_0)
\\
f'''_k(s_k) = f'''_{k+1} (s_0)
$$
```
### 2.4 Sampled points for boundary constraint
Evenly sample **m** points along the path, and check the obstacle boundary at those points. Convert the constraint into QP inequality constraints, using:
```
$$
Ax \geq b
$$
```
First find the lower boundary $l_{lb,j}$ at those points $(s_j, l_j)$ and $j\in[0, m]$ based on the road width and surrounding obstacles. Calculate the inequality constraints as:
```
$$
\begin{vmatrix}
1 & s_0 & s_0^2 & s_0^3 & s_0^4&s_0^5 \\
1 & s_1 & s_1^2 & s_1^3 & s_1^4&s_1^5 \\
...&...&...&...&...&... \\
1 & s_m & s_m^2 & s_m^3 & s_m^4&s_m^5 \\
\end{vmatrix} \cdot \begin{vmatrix}a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
\geq
\begin{vmatrix}
l_{lb,0}\\
l_{lb,1}\\
...\\
l_{lb,m}\\
\end{vmatrix}
$$
```
Similarly, for the upper boundary $l_{ub,j}$, calculate the inequality constraints as:
```
$$
\begin{vmatrix}
-1 & -s_0 & -s_0^2 & -s_0^3 & -s_0^4&-s_0^5 \\
-1 & -s_1 & -s_1^2 & -s_1^3 & -s_1^4&-s_1^5 \\
...&...-&...&...&...&... \\
-1 & -s_m & -s_m^2 & -s_m^3 & -s_m^4&-s_m^5 \\
\end{vmatrix}
\cdot
\begin{vmatrix} a_{i0} \\ a_{i1} \\ a_{i2} \\ a_{i3} \\ a_{i4} \\ a_{i5} \end{vmatrix}
\geq
-1 \cdot
\begin{vmatrix}
l_{ub,0}\\
l_{ub,1}\\
...\\
l_{ub,m}\\
\end{vmatrix}
$$
```
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/open_space_trajectory_provider_en.md
|
# GENERATE FINAL TRAJECTORY
# Introduction
The goal of this part is to generate the final trajectory in the open space. Open_space_trajectory_provider is very important to control the flow and call the hybrid a star and trajectory smoothing algorithm.
# Where is the code
Please refer to [open_space_trajectory_provider.cc](https://github.com/ApolloAuto/apollo/tree/master/modules/planning/tasks/optimizers/open_space_trajectory_generation/open_space_trajectory_provider.cc)
# Code Reading
1. Input: open_space_trajectory_provider::Process() is called by the OPEN_SPACE_TRAJECTORY_PROVIDER task of VALET_PARKING_PARKING stage, please refer to [valet_parking_config.pb.txt](https://github.com/ApolloAuto/apollo/blob/master/modules/planning/conf/scenario/valet_parking_config.pb.txt).
2. There is a stop trajectory which generated in the park and go check stage. In order to ensure safety, it is necessary in this case.
``` cpp
if (injector_->planning_context()
->mutable_planning_status()
->mutable_park_and_go()
->in_check_stage()) {
ADEBUG << "ParkAndGo Stage Check.";
GenerateStopTrajectory(trajectory_data);
return Status::OK();
}
```
3. Start thread when getting in Process() for the first time. This will call the GenerateTrajectoryThread() function to plan the first trajectory and will update three kinds of trajectory state: trajectory_updated_, trajectory_skipped_, trajectory_error_.
``` cpp
if (FLAGS_enable_open_space_planner_thread && !thread_init_flag_) {
task_future_ = cyber::Async(&OpenSpaceTrajectoryProvider::GenerateTrajectoryThread, this);
thread_init_flag_ = true;
}
```
4. Whether vehicle is stoped due to fallback is determined by the IsVehicleStopDueToFallBack() function. This determines the final trajectory planning.
5. If vehicle is stopped due to fallback, replan stitching trajectory by ComputeReinitStitchingTrajectory() function. If not, replan stitching trajectory by ComputeStitchingTrajectory(), please refer to [trajectory_stitcher.cc](https://github.com/ApolloAuto/apollo/blob/master/modules/planning/common/trajectory_stitcher.cc).
6. Generate trajectory depends on the FLAGS_enable_open_space_planner_thread. A stop trajectory is generated in the following cases:
1. Planning thread is stopped.
2. The vehicle arrives near the destination.
3. trajectory_error_ is triggered for more than 10 seconds.
4. Previous frame planning failed.
5. If the trajectory can be updated normally, the optimized trajectory is output normally.
7. Output: the optput is final trajectory information.
# Algorithm Detail
``` cpp
bool OpenSpaceTrajectoryProvider::IsVehicleStopDueToFallBack(const bool is_on_fallback,
const common::VehicleState& vehicle_state)
```
The function is used to judge whether the vehicle is stopped due to fallback.
1. Parameter: The input parameter is fallback flag of previous frame and vehicle states.
2. Introduction: The flag and vehicle state can be used to design the logic.
3. Process detail:
1. Fallback flag judgment: if the flag is false, then return false.
2. When the vehicle speed and acceleration are less than the threshold, the result is true, indicating that it is caused by fall back.
``` cpp
std::vector<TrajectoryPoint> TrajectoryStitcher::ComputeStitchingTrajectory(const VehicleState& vehicle_state,
const double current_timestamp,
const double planning_cycle_time,
const size_t preserved_points_num,
const bool replan_by_offset,
const PublishableTrajectory* prev_trajectory,
std::string* replan_reason)
```
The function is used to stitch trajectory and is used to replan based on some unreasonable case.
1. Parameter: Vehicle state, current_timestamp, planning cycle time, replan_by_offset, previous trajectory and the reason of replanning.
2. Introduction: Handle some unreasonable case by replanning, stitch trajectory and post process.
3. Process detail:
1. It will re-plan the trajectory in following cases:
1. Stitching trajectory is disabled by gflag.
2. There is no previous trajectory.
3. Not in autopilot mode.
4. The number of points in the previous frame is zero.
5. The current time is less than the trajectory start time of the previous frame.
6. The current time is more than the trajetory end time of the previous frame.
7. The matching path point is empty.
8. The horizontal and vertical deviation of the projection point is greater than the threshold.
2. Stitch trajectory according to the planning period and the position of the projection point.
3. Determine whether each trajectory point of the stitching trajectory is empty, and if it is empty, it will replan.
``` cpp
std::vector<TrajectoryPoint>TrajectoryStitcher::ComputeReinitStitchingTrajectory(const double planning_cycle_time,
const VehicleState& vehicle_state)
```
The function is used to initialize stitching trajectory and get the initial point.
1. Parameter: The planned cycle time and vehicle state
2. Introduction: The function can get the diffrent initial point based on the different logic.
3. Process detail:
1. When the vehicle speed and acceleration are less than the threshold, the message of initial point is from vehicle state. 2. When the vehicle speed and acceleration satisfy the threshold, the vehicle state is calculated based on the kinematics model.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/open_space_trajectory_optimizer_en.md
|
# OPTIMIZE COARSE TRAJECTORY
# Introduction
The goal of this part is to optimizes the initial trajectory in the open space. Open_space_trajectory_optimizer is able to call a variety of different optimization algorithms.
# Where is the code
Please refer [open_space_trajectory_optimizer.cc](https://github.com/ApolloAuto/apollo/tree/master/modules/planning/tasks/optimizers/open_space_trajectory_generation/open_space_trajectory_optimizer.cc)
# Code Reading
1. Input: stitching trajectory is provided by the open_space_trajectory_provider, planned target point, boundary of x and y, rotation angle relative to the corner of parking space, the reference origin point, line segment of boundary.
``` cpp
Status OpenSpaceTrajectoryOptimizer::Plan(const std::vector<common::TrajectoryPoint>& stitching_trajectory,
const std::vector<double>& end_pose,
const std::vector<double>& XYbounds,
double rotate_angle,
const Vec2d& translate_origin,
const Eigen::MatrixXi& obstacles_edges_num,
const Eigen::MatrixXd& obstacles_A,
const Eigen::MatrixXd& obstacles_b,
const std::vector<std::vector<Vec2d>>& obstacles_vertices_vec,
double* time_latency)
```
2. Before optimization, some unreasonable cases are exited from the optimization process and implement some preprocessing.
1. The unreasonable case is below:
1. Input data is empty.
``` cpp
if (XYbounds.empty() || end_pose.empty() || obstacles_edges_num.cols() == 0 ||
obstacles_A.cols() == 0 || obstacles_b.cols() == 0) {
ADEBUG << "OpenSpaceTrajectoryOptimizer input data not ready";
return Status(ErrorCode::PLANNING_ERROR, "OpenSpaceTrajectoryOptimizer input data not ready");
}
```
2. Starting point of planning is near the end point.
``` cpp
if (IsInitPointNearDestination(stitching_trajectory.back(), end_pose,
rotate_angle, translate_origin)) {
ADEBUG << "Planning init point is close to destination, skip new "
"trajectory generation";
return Status(ErrorCode::OK,
"Planning init point is close to destination, skip new "
"trajectory generation");
}
```
3. End of the stitching trajectory is rotated and translated, and the trajectory information is converted according to the corner of the parking space.
``` cpp
PathPointNormalizing(rotate_angle, translate_origin, &init_x, &init_y,
&init_phi)
```
3. Generate the coarse trajectory based on the warm start technology which is Hybrid A* algorithm.
``` cpp
if (warm_start_->Plan(init_x, init_y, init_phi, end_pose[0], end_pose[1],
end_pose[2], XYbounds, obstacles_vertices_vec,
&result)) {
ADEBUG << "State warm start problem solved successfully!";
} else {
ADEBUG << "State warm start problem failed to solve";
return Status(ErrorCode::PLANNING_ERROR,
"State warm start problem failed to solve");
}
```
4. According to FLAGS_enable_parallel_trajectory_smoothing to achieve different optimization process. When FLAGS_enable_parallel_trajectory_smoothing is false, the optimization process is as follows:
1. (x, y, phi, V) and (ster, a) of initial trajectory points in hybrid_a_star are stored into xws and UWS respectively through LoadHybridAstarResultInEigen() function, and xws and UWS are used to generate the subsequent smooth trajectory.
2. Generate the smooth trajectory by the GenerateDistanceApproachTraj() function.
``` cpp
LoadHybridAstarResultInEigen(&result, &xWS, &uWS);
const double init_steer = trajectory_stitching_point.steer();
const double init_a = trajectory_stitching_point.a();
Eigen::MatrixXd last_time_u(2, 1);
last_time_u << init_steer, init_a;
const double init_v = trajectory_stitching_point.v();
if (!GenerateDistanceApproachTraj(
xWS, uWS, XYbounds, obstacles_edges_num, obstacles_A, obstacles_b,
obstacles_vertices_vec, last_time_u, init_v, &state_result_ds,
&control_result_ds, &time_result_ds, &l_warm_up, &n_warm_up,
&dual_l_result_ds, &dual_n_result_ds)) {
return Status(ErrorCode::PLANNING_ERROR,
"distance approach smoothing problem failed to solve");
}
```
5. When FLAGS_enable_parallel_trajectory_smoothing is true, the optimization process is as follows:
1. Trajectorypartition() function is used to segment the initial trajectory.
2. Use loadhybridastarresultineigen() function to store the partitioned trajetory into xws and UWS respectively.
3. Set the initial information(a,V) of each trajectory.
4. the initial information of the first trajectory is the end point of the stitching trajectory.
5. In the next trajectory, the initial information is set to zero. At the start of the trajectory, the vehicle is stationary.
``` cpp
if (!warm_start_->TrajectoryPartition(result, &partition_trajectories)) {
return Status(ErrorCode::PLANNING_ERROR, "Hybrid Astar partition failed");
}
```
6. Use combinetrajectories() function to integrate the parameter information after segmented optimization.
``` cpp
CombineTrajectories(xWS_vec, uWS_vec, state_result_ds_vec,
control_result_ds_vec, time_result_ds_vec,
l_warm_up_vec, n_warm_up_vec, dual_l_result_ds_vec,
dual_n_result_ds_vec, &xWS, &uWS, &state_result_ds,
&control_result_ds, &time_result_ds, &l_warm_up,
&n_warm_up, &dual_l_result_ds, &dual_n_result_ds)
```
7. Converting trajectory information to world coordinate system.
``` cpp
for (size_t i = 0; i < state_size; ++i) {
PathPointDeNormalizing(rotate_angle, translate_origin,
&(state_result_ds(0, i)),
&(state_result_ds(1, i)),
&(state_result_ds(2, i)));
}
```
8. The trajectory information is loaded by loadtrajectory() function. Because the current optimization does not consider the end point control state, the end-point control state of the trajectory is processed (Steer = 0, a = 0).
``` cpp
LoadTrajectory(state_result_ds, control_result_ds, time_result_ds)
```
9. Output: Optput is optimized trajectory information.
# Algorithm Detail
```cpp
LoadHybridAstarResultInEigen(&partition_trajectories[i], &xWS_vec[i],&uWS_vec[i])
```
The function is to transform the initial trajectory information into the form needed for optimization.
1. Parameter: the initial trajectory and parameter matrix.
2. Introduction: the trajectory information is transformed into matrix form.
3. Process detail:
1. Transform the x,y,phi,v,steer to the matrix combined with horizon.
2. Store the transformed information to the matrix.
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/planning_piecewise_jerk_nonlinear_speed_optimizer.md
|
# Planning Piecewise Jerk Nonlinear Speed Optimizer Introduction
# Introduction
This is an introduction of piecewise jerk nonlinear speed optimizer. For trajectory planning problems, the following three aspects need to be considered: 1)Task accomplishment. 2)Safety. 3)Comfort.
After a smooth driving guide line is generated, the trajectory is under the constraints of velocity bounds, acceleration bounds, jerk bounds, etc. Here, we formulate this problem as a quadratic programming problem.
# Where is the code
Please refer [code](https://github.com/ApolloAuto/apollo/blob/master/modules/planning/tasks/optimizers/piecewise_jerk_speed/piecewise_jerk_speed_nonlinear_optimizer.cc)
# Code Reading

PiecewiseJerkSpeedNonlinearOptimizer is a derived class whose base class is SpeedOptimizer. Thus, when task::Execute() is called in the task list, the Process() in PiecewiseJerkSpeedNonlinearOptimizer is actually doing the processing.
1. Input.
The input includes PathData and initial TrajectoryPoint.
2. Process.
- Snaity Check. This ensures speed_data is not null and Speed Optimizer does not receive empty path data.
- `const auto problem_setups_status = SetUpStatesAndBounds(path_data, *speed_data);` The qp problem is initialized here. The next code line will clear speed_data if it fails.
- `const auto qp_smooth_status = OptimizeByQP(speed_data, &distance, &velocity, &acceleration);` It sloves the QP problem and the distance/velocity/acceleration are achieved. Still, speed_data is cleared if it fails.
- `const bool speed_limit_check_status = CheckSpeedLimitFeasibility();` It checks first point of speed limit. Then the following four steps are processed: 1)Smooth Path Curvature 2)SmoothSpeedLimit 3)Optimize By NLP 4)Record speed_constraint
- Add s/t/v/a/jerk into speed_data and add enough zeros to avoid fallback
3. Output.
The output is SpeedData, which includes s/t/v/a/jerk of the trajectory.
# Algorithm Detail
Paper Reference:
- Optimal Trajectory Generation for Autonomous Vehicles UnderCentripetal Acceleration Constraints for In-lane Driving Scenarios
- DL-IAPS and PJSO: A Path/Speed Decoupled Trajectory Optimization and its Application in Autonomous Driving

| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/qp_spline_st_speed_optimizer_cn.md
|
# 二次规划ST速度优化
_**Tip**: 为了更好的展示本文档中的等式,我们建议使用者使用带有[插件](https://chrome.google.com/webstore/detail/tex-all-the-things/cbimabofgmfdkicghcadidpemeenbffn)的Chrome浏览器,或者将Latex等式拷贝到[在线编辑公式网站](http://www.hostmath.com/)进行浏览。_
## 1 定义
从二次规划样条路径中选取一条路径后,Apollo将路线上的所有障碍物和自动驾驶车辆(ADV)展现在一个时间-路径图上(path-time ST),该路径图表示了路径上的站点变化。速度优化的任务是在ST图上找到一条合理的,无障碍的路径。
Apollo使用多个样条来表示速度参数,在ST图上表示为一系列的ST点。Apollo会对二次规划的结果做再次的平衡以获得最佳的速度参数。QP问题的标准类型定义为:
```
$$
minimize \frac{1}{2} \cdot x^T \cdot H \cdot x + f^T \cdot x
\\
s.t. LB \leq x \leq UB
\\
A_{eq}x = b_{eq}
\\
Ax \leq b
$$
```
## 2 目标函数
### 2.1 获取样条段
将路ST速度参数分为 **n** 段,每段路径用一个多项式来表示。
### 2.2 定义样条段函数
每个样条段 ***i*** 都有沿着参考线的累加距离$d_i$。每段的路径默认用5介多项式表示。多项式介数可以通过配置参数进行调整。
```
$$
s = f_i(t)
= a_{0i} + a_{1i} \cdot t + a_{2i} \cdot t^2 + a_{3i} \cdot t^3 + a_{4i} \cdot t^4 + a_{5i} \cdot t^5
$$
```
### 2.3 定义样条段优化函数
Apollo首先定义$cost_1$以使路径更加平滑:
```
$$
cost_1 = \sum_{i=1}^{n} \Big( w_1 \cdot \int\limits_{0}^{d_i} (f_i')^2(s) ds + w_2 \cdot \int\limits_{0}^{d_i} (f_i'')^2(s) ds + w_3 \cdot \int\limits_{0}^{d_i} (f_i^{\prime\prime\prime})^2(s) ds \Big)
$$
```
然后,Apollo定义$cost_2$表示最后的S-T路径和S-T巡航路径(有速度限制且m个点)的差值:
```
$$
cost_2 = \sum_{i=1}^{n}\sum_{j=1}^{m}\Big(f_i(t_j)- s_j\Big)^2
$$
```
同样地,Apollo定义了$cost_3$表示第一个S-T路径和随后的S-T路径(o个点)的差值:
```
$$
cost_3 = \sum_{i=1}^{n}\sum_{j=1}^{o}\Big(f_i(t_j)- s_j\Big)^2
$$
```
最后得出的目标函数为:
```
$$
cost = cost_1 + cost_2 + cost_3
$$
```
## 3 约束条件
### 3.1 初始点约束
假设第一个点是($t0$, $s0$),且$s0$在路径$f_i(t)$, $f'i(t)$, 和$f_i(t)''$上(位置、速率、加速度)。Apollo将这些约束转换为QP约束的等式为:
```
$$
A_{eq}x = b_{eq}
$$
```
### 3.2 单调约束
路线必须是单调的,比如车辆只能往前开。
在路径上采样 **m** 个点,对每一个 $j$和$j-1$ 的点对,且($j\in[1,...,m]$),如果两个点都处在同一个样条$k$上,则:
```
$$
\begin{vmatrix} 1 & t_j & t_j^2 & t_j^3 & t_j^4&t_j^5 \\ \end{vmatrix}
\cdot
\begin{vmatrix} a_k \\ b_k \\ c_k \\ d_k \\ e_k \\ f_k \end{vmatrix}
>
\begin{vmatrix} 1 & t_{j-1} & t_{j-1}^2 & t_{j-1}^3 & t_{j-1}^4&t_{j-1}^5 \\ \end{vmatrix}
\cdot
\begin{vmatrix} a_{k} \\ b_{k} \\ c_{k} \\ d_{k} \\ e_{k} \\ f_{k} \end{vmatrix}
$$
```
如两个点分别处在不同的样条$k$和$l$上,则:
```
$$
\begin{vmatrix} 1 & t_j & t_j^2 & t_j^3 & t_j^4&t_j^5 \\ \end{vmatrix}
\cdot
\begin{vmatrix} a_k \\ b_k \\ c_k \\ d_k \\ e_k \\ f_k \end{vmatrix}
>
\begin{vmatrix} 1 & t_{j-1} & t_{j-1}^2 & t_{j-1}^3 & t_{j-1}^4&t_{j-1}^5 \\ \end{vmatrix}
\cdot
\begin{vmatrix} a_{l} \\ b_{l} \\ c_{l} \\ d_{l} \\ e_{l} \\ f_{l} \end{vmatrix}
$$
```
### 3.3 平滑节点约束
该约束的目的是使样条的节点更加平滑。假设两个段$seg_k$ 和$seg_{k+1}$互相连接,且$seg_k$的累计值 **s** 为$s_k$。计算约束的等式为:
```
$$
f_k(t_k) = f_{k+1} (t_0)
$$
```
即:
```
$$
\begin{vmatrix}
1 & t_k & t_k^2 & t_k^3 & t_k^4&t_k^5 \\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_{k0} \\ a_{k1} \\ a_{k2} \\ a_{k3} \\ a_{k4} \\ a_{k5}
\end{vmatrix}
=
\begin{vmatrix}
1 & t_{0} & t_{0}^2 & t_{0}^3 & t_{0}^4&t_{0}^5 \\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_{k+1,0} \\ a_{k+1,1} \\ a_{k+1,2} \\ a_{k+1,3} \\ a_{k+1,4} \\ a_{k+1,5}
\end{vmatrix}
$$
```
然后,
```
$$
\begin{vmatrix}
1 & t_k & t_k^2 & t_k^3 & t_k^4&t_k^5 & -1 & -t_{0} & -t_{0}^2 & -t_{0}^3 & -t_{0}^4&-t_{0}^5\\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_{k0} \\ a_{k1} \\ a_{k2} \\ a_{k3} \\ a_{k4} \\ a_{k5} \\ a_{k+1,0} \\ a_{k+1,1} \\ a_{k+1,2} \\ a_{k+1,3} \\ a_{k+1,4} \\ a_{k+1,5}
\end{vmatrix}
= 0
$$
```
等式中得出的结果为$t_0$ = 0。
同样地,为下述等式计算约束等式:
```
$$
f'_k(t_k) = f'_{k+1} (t_0)
\\
f''_k(t_k) = f''_{k+1} (t_0)
\\
f'''_k(t_k) = f'''_{k+1} (t_0)
$$
```
### 3.4 点采样边界约束
在路径上均匀的取样 **m** 个点,检查这些点上的障碍物边界。将这些约束转换为QP约束不等式,使用不等式:
```
$$
Ax \leq b
$$
```
首先基于道路宽度和周围的障碍物找到点 $(s_j, l_j)$的下边界$l_{lb,j}$,且$j\in[0, m]$。计算约束的不等式为:
```
$$
\begin{vmatrix}
1 & t_0 & t_0^2 & t_0^3 & t_0^4&t_0^5 \\
1 & t_1 & t_1^2 & t_1^3 & t_1^4&t_1^5 \\
...&...&...&...&...&... \\
1 & t_m & t_m^2 & t_m^3 & t_m^4&t_m^5 \\
\end{vmatrix} \cdot \begin{vmatrix} a_i \\ b_i \\ c_i \\ d_i \\ e_i \\ f_i \end{vmatrix}
\leq
\begin{vmatrix}
l_{lb,0}\\
l_{lb,1}\\
...\\
l_{lb,m}\\
\end{vmatrix}
$$
```
同样地,对上边界$l_{ub,j}$,计算约束的不等式为:
```
$$
\begin{vmatrix}
1 & t_0 & t_0^2 & t_0^3 & t_0^4&t_0^5 \\
1 & t_1 & t_1^2 & t_1^3 & t_1^4&t_1^5 \\
...&...&...&...&...&... \\
1 & t_m & t_m^2 & t_m^3 & t_m^4&t_m^5 \\
\end{vmatrix} \cdot \begin{vmatrix} a_i \\ b_i \\ c_i \\ d_i \\ e_i \\ f_i \end{vmatrix}
\leq
-1 \cdot
\begin{vmatrix}
l_{ub,0}\\
l_{ub,1}\\
...\\
l_{ub,m}\\
\end{vmatrix}
$$
```
### 3.5 速度边界优化
Apollo同样需要建立速度限制边界。
在st曲线上取样 **m** 个点,为每个点$j$获取速度限制的上边界和下边界,例如$v{ub,j}$ 和 $v{lb,j}$,约束定义为:
```
$$
f'(t_j) \geq v_{lb,j}
$$
```
即:
```
$$
\begin{vmatrix}
0& 1 & t_0 & t_0^2 & t_0^3 & t_0^4 \\
0 & 1 & t_1 & t_1^2 & t_1^3 & t_1^4 \\
...&...&...&...&...&... \\
0& 1 & t_m & t_m^2 & t_m^3 & t_m^4 \\
\end{vmatrix}
\cdot
\begin{vmatrix}
a_i \\ b_i \\ c_i \\ d_i \\ e_i \\ f_i
\end{vmatrix}
\geq
\begin{vmatrix} v_{lb,0}\\ v_{lb,1}\\ ...\\ v_{lb,m}\\ \end{vmatrix}
$$
```
且,
```
$$
f'(t_j) \leq v_{ub,j}
$$
```
即:
```
$$
\begin{vmatrix}
0& 1 & t_0 & t_0^2 & t_0^3 & t_0^4 \\
0 & 1 & t_1 & t_1^2 & t_1^3 & t_1^4 \\
...&...&...&...&...&... \\
0 &1 & t_m & t_m^2 & t_m^3 & t_m^4 \\
\end{vmatrix} \cdot \begin{vmatrix} a_i \\ b_i \\ c_i \\ d_i \\ e_i \\ f_i \end{vmatrix}
\leq
\begin{vmatrix}
v_{ub,0}\\
v_{ub,1}\\
...\\
v_{ub,m}\\
\end{vmatrix}
$$
```
| 0
|
apollo_public_repos/apollo/docs
|
apollo_public_repos/apollo/docs/08_Planning/Open_Space_Planner.md
|
# Open Space Planner Algorithm
## Introduction
As the Planning module introduced a major change with the launch of Scenario-based planning, we realized the need to have scenario specific algorithms that can be fine-tuned to enhance the trajectory of the ego-car for that particular scenario. The Open Space Planner is one such algorithm in development targeted towards reverse parking and sharp U-turns.
This algorithm was initially inspired by several papers<cite>[1]</cite><cite>[2]</cite><cite>[3]</cite>.
## Algorithm Flow

This algorithm takes in input from two different sources:
- Perception data which includes but is not limited to obstacles
- The Region of Interest (ROI) which is obtained via HD Map
Once the data is in place, Open Space planner is triggered as seen in the image above. The algorithm itself is comprised of two stages:
### Searching - Based Planning
In step 1, a raw trajectory is generated for the ego-car. This stage applies vehicle kinemetic model in algorithm to create the raw trajectory with a series of distance equidistant points as seen in the image below.
The red line represents the raw trajectory output from Hybrid A*, which is sent to the next step, Optimization to calculate the green smoothened line.

### Optimization
This step involves two major tasks,
- Smooth the trajectory to get better riding comfort experience and to make it easier for the control module to track
- Ensure collision avoidance
The received raw trajectory is taken as an initial guess for optimization to iterate on. The generated result is a set of points that are not distributed evenly but are closer to each other near the turning while those on a linear path are more spread-out.
This not only ensures better turns, but as time/space is fixed, the nearer the points, the slower the speed of the ego-car. Which also means that velocity tracking in this step is possible but more reasonable acceleration, braking and steering.

Once this stage is complete, the output is directly sent to the Control module to have it sent to the ego-car.

## Use Cases
Currently Open Space Planner is used for 2 parking scenarios in the planning stage namely:
### Valet
This scenario is designed to park the ego car in a designated parking spot using a zig-zag trajectory.
### Pull Over
This scenario is designed to park the ego car along the curb, either normally or requiring parallel parking.
To learn more about the existing planning scenarios, please refer to the [Planning README](https://github.com/ApolloAuto/apollo/tree/master/modules/planning)
## Future Applications
As the algorithm is currently in development, it is currently used for reverse and/or parallel parking, but can also be implemented in scenarios that involve tight U-turns or for curb-side parking when an emergency vehicle passes by. The main aim of scenario-based planning is to ensure efficient planning of the car's trajectory using targeted algorithms for individual scenarios just like with Open Space Planning for reverse parking.
## References
[1]: Dolgov, Dmitri, et al. "Path Planning for Autonomous Vehicles in Unknown Semi-Structured Environments." The International Journal of Robotics Research, vol. 29, no. 5, 2010, pp. 485-501., doi:10.1177/0278364909359210.
[2]: Prodan, Ionela, et al. "Mixed-integer representations in control design: Mathematical foundations and applications."" Springer, 2015.
[3]: Xiaojing Zhang, et al. "Optimization-Based Collision Avoidance" (arXiv:1711.03449).
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆标定/how_to_update_vehicle_calibration.md
|
# How to Update Vehicle Calibration for Throttle and Brakes
## Introduction
The purpose of vehicle calibration is to find the throttle and brake commands that accurately produce the amount of acceleration requested from the control module.
## Preparation
Preparation consists of the following task sequence:
- Gain access to the relevant code.
- Change the driving mode.
- Select the testing site.
### Gain Access to the Relevant Code
* Canbus, which includes modules for:
* GPS Driver
* Localization
### Change the Driving Mode
Set the driving mode in `modules/canbus/conf/canbus_conf.pb.txt` to `AUTO_SPEED_ONLY`.
### Select the Testing Site
The preferred testing site is a long flat road.
## Update the Vehicle Calibration
After preparation, complete the following task sequence from `modules/tools/vehicle_calibration`:
- Collect data.
- Process data.
- Plot results.
- Convert results to `protobuf`.
### Collect Data
1. Run `python data_collector.py` for different commands, commands like x y z, where x is acceleration command, y is speed limit(mps), z is decceleration command,Positive number for throttle and negative number for brake.Run each command multiple times.
2. Adjust the command script based on the vehicle response.
3. Run `python plot_data.py ` to open recorded data and visualize collected data.
like `15 5.2 -10`, will create and record a file named `t15b-10r0.csv`.
### Process Data
Run `process_data.sh` on each recorded log individually. data log is processed to `t15b-10r0.csv.result`.
### Plot Results
Run `python plot_results.py t15b-10r0.csv.result` to visualize final results. Check for any abnormality.
### Convert Results to `Protobuf`
If everything looks good, run `result2pb.sh` to move calibration results to `protobuf` defined for the control module.
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆标定/how_to_update_vehicle_calibration_cn.md
|
# 如何标定车辆油门和制动
## 介绍
车辆校准的目的是找到准确产生从控制模块请求的加速量的油门和制动命令
## 准备
按如下顺序完成准备工作:
- 访问相关代码
- 改变驾驶模式
- 选择测试地点
### 访问相关代码
* Canbus, 包括以下模块:
* GPS 驱动
* 定位
### 改变驾驶模式
在`modules/canbus/conf/canbus_conf.pb.txt`中,设置驾驶模式为 `AUTO_SPEED_ONLY`.
### 选择测试地点
理想的测试地点是平坦的长直路
## 更新车辆标定
以上准备工作完成后, 在`modules/tools/vehicle_calibration`中按顺序完成如下工作
- 采集数据
- 处理数据
- 绘制结果
- 转换结果为`protobuf`格式
### 采集数据
1. 运行 `python data_collector.py`,参数如 x y z, x 代表了加速的控制指令, y 代表了限制速度(mps), z 是减速指令,正值标识油门量,负值标识刹车量.且每条命令运行多次,其中 `data_collector.py`在modules/tools/vehicle_calibration/
2. 根据车辆反应情况,调整命令脚本
3. 运行 `python plot_data.py ` 使采集到的数据可视化
比如输出指令 `15 5.2 -10`,将会生成名为`t15b-10r0.csv`的文件。
### 处理数据
对每个记录的日志分别运行`process_data.sh {dir}`,其中dir为`t15b-10r0.csv`所在的目录。每个数据日志被处理成`t15b-10r0.csv.result`。
### 绘制结果
通过运行`python plot_results.py t15b-10r0.csv`得到可视化最终结果,检查是否有异常
### 转换结果为`protobuf`格式
如果一切正常,运行`result2pb.sh`,把校准结果result.csv转换成控制模块定义的`protobuf`格式
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆适配/apollo_vehicle_adaption_tutorial_cn.md
|
# Apollo车辆适配教程
## 引言
本文所介绍的Apollo新车适配方法,可以帮助开发者快速接入新车辆,以方便开发者在Apollo上进行软件开发。文中所介绍的车辆线控信号标准和要求均源自Apollo开放车辆认证平台,目前车辆认证平台已经有Lincoln,Lexus,GE3,WEY等车型,有意愿把车加入Apollo车辆认证平台的车企、车辆提供商,可以按照文档内对线控的具体要求,熟悉和准备车辆底层控制协议,节省前期准备时间,欢迎有兴趣的开发者移步至[Apollo开放车辆认证平台](http://apollo.auto/vehicle/certificate_cn.html)(http://apollo.auto/vehicle/certificate_cn.html) 了解更多详细内容。
## 适配一辆符合Apollo标准的车辆
- 本文主要介绍如何在Apollo内添加一辆符合Apollo标准的新车,方便开发者设计符合Apollo线控要求的底盘系统,开发适配Apollo软件的底盘适配代码,构建快速接入Apollo软件的能力。
- 开发者在适配一辆新车的CAN通信时,首先需要设计完成符合Apollo线控要求的底盘通信协议,这一部分就是根据Apollo线控列表构建一个车辆底盘信号的DBC文件,设计底盘相关接口定义、报文和信号与DBC一一对应。在完成了DBC文件设计后,根据Apollo提供的DBC转化代码工具,得到初版的canbus底层适配代码,然后添加相关车辆的控制逻辑,在Apollo搭建车辆底层chassis信号及控制车辆信号。最后通过canbus调试工具进行信号调试和验证,确保车辆的底盘信号与Apollo上层通信完全无问题。
## 一、符合Apollo线控标准的车辆
### 车辆DBC
开发一台搭载Apollo系统的车辆,首先的工作就是建立Apollo与车辆底层之间的通信,整车是通过CAN总线(CAN bus, Controller Area Network)进行各个控制器(ECU, electronic control units)之间的通信,因此Apollo控制系统在接入车辆系统时,也通过CAN总线通信方式对车辆进行控制。车辆需要开放一部分底盘信号,将这些信号配置成符合Apollo的线控标准要求的DBC文件(Database file, 是一中用于描述CAN总线上数据的专用文件,能够方便用户快速构建车辆CAN通信的网络结构,定义CAN总线上的信号、报文等相关信息)。这里推荐开发者使用canoe软件的CANdb++编辑生成的文件,Apollo软件处理底盘DBC文件生成底盘适配代码模板,开发者通过简单的编程开发,即可将车辆开放的底盘信号适配至Apollo的软件中,实现Apollo与车辆底盘间的通信。
### DBC线控标准详解
- 开发者在开发车辆底盘控制信号时,需要参照Apollo官网车辆认证平台(http://apollo.auto/docs/procedure_cn.html) 发布的车辆线控标准,
乘用车标准:http://apollo-homepage.bj.bcebos.com/Apollo_by_wire_requirement.xlsx ;
微型车标准:https://apollohomepage.bj.bcebos.com/Apollo_by_wire_requirement_micro_car.xlsx
车辆线控标准规定了车辆底盘信号的需求,也规定了每一帧控制信号在底盘的响应时间要求。车辆底盘信号不仅需要在功能上符合要求,也需要在性能上符合控制要求,这样才能满足符合Apollo线控标准的车辆控制底盘。
- 开发者在改造车辆底盘为线控底盘时,要参考车辆线控标准满足控制的性能要求,如转向信号要求响应时间在100ms内,最大超调量满足满足具体要求等。请开发者仔细阅读线控列表内的性能要求,在Apollo车辆认证时,也会对底盘的性能进行相应测试。
在实际开发DBC的过程中,每个信号定义的细节也有具体的要求,这样做为了节省开发者时间,同时提高车辆认证的效率,需要开发者对每个信号要重点理解和注意。下面是Apollo对车辆底盘信号的需求如下表所示:



车辆的底盘控制是Apollo与底盘通信的基础,每一个控制信号都需要可靠和准确。人工接管和越界处理是保证在测试和使用时随时接管,确保突发情况发生时的行车安全。除了线控列表内对信号的详细要求外,**开发者还需要格外注意横向和纵向使能信号的独立**,**底盘接管逻辑等特殊要求**,下面对信号的功能特殊要求做详细说明。
#### 线控转向
1. 转向使能信号
(1)转向使能信号是控制车辆进入或退出转向自动驾驶模式,该使能信号必须是通过**上升沿触发**方式的信号,使能信号原则上是1个信号;有些开发者若有不同信号同时控制,才能使能转向进入自动驾驶状态,需要开发者在底层自己集成相关使能信号的逻辑控制,给Apollo使能信号原则上必须只有1个。
(2)转向自动驾驶模式必须独立,使能信号必须独立,不与纵向的其他模块(如驱动、制动、档位、驻车等)使能信号相关联,需要满足:单独使能进入转向自动驾驶模式,纵向所处驾驶模式不发生变化,下发方向盘转角或转速控制信号,车辆能够响应相应的转角和转速;单独使能退出转向自动驾驶模式,纵向所处驾驶模式不发生变化,下发方向盘转角或转速控制信号,车辆不响应;
(3)如果横向被接管,再次进入自动驾驶模式时,需要通过上升沿触发信号进入自动驾驶。
2. 转向控制信号
目标方向盘转角:控制方向盘转角的信号,单位是度(deg),控制方向盘(逆时针)左转为正值,控制方向盘(顺时针)右转为负值。
目标方向盘转速:多数车辆无法开放次控制信号接口,建议将方向盘转速设置为最大值,提高系统响应时间。
3. 转向反馈信号
方向盘实际转角反馈:反馈方向盘实际转角,要求反馈准确,左转反馈为正值,右转反馈为负值。
转向驾驶模式反馈:反馈车辆当前所处的转向驾驶模式,至少需要3种模式:自动驾驶模式,手动驾驶模式,被人工接管模式。
故障信息反馈:反馈转向控制系统是否存在故障。
4. 人工接管处理
(1)对于乘用车/商用车,当人为施加的方向盘扭矩大于其接管门限时,车辆各个模块均退出自动驾驶,此时转向驾驶模式反馈被接管;对于底盘小车等,当小车底盘接收到遥控器控制车辆转向的指令时,车辆各个模块均退出自动驾驶;转向接管需要独立,此时转向驾驶模式反馈被人工接管模式,驱动驾驶模式、制动驾驶模式此时应反馈手动驾驶模式;
(2)当转向自动驾驶被人工接管时,所有模块都退出自动驾驶模式。
5. 越界处理
越界处理的原则是越界拒绝执行,并退出自动驾驶模式。
当Apollo下发控制指令超过原控制指令的定义范围时,此时称为越界。发生越界时,转向需要退出自动驾驶模式。
如定义目标方向盘转角最大范围为-500deg~500deg,若Apollo下发的转角指令不在此范围时,底盘需要对此越界拒绝执行,并退出自动驾驶模式。
#### 线控驱动
1. 驱动使能:
(1)驱动使能信号是控制车辆进入或退出驱动自动驾驶模式,该使能信号必须是通过**上升沿触发**方式的信号,**使能信号原则上是1个信号**;有些开发者若有不同信号同时控制,才能使能转向进入自动驾驶状态,需要开发者在底层自己集成相关使能信号的逻辑控制,给Apollo使能信号原则上必须只有1个。
(2)驱动使能信号必须独立,不与转向模块使能信号相关联,需要满足:单独使能进入纵向自动驾驶模式,转向所处驾驶模式不发生变化,下发驱动控制信号,车辆能够响应相应的控制命令;单独使能退出驱动自动驾驶模式,转向所处驾驶模式不发生变化,下发驱动控制信号,车辆不响应;
(3)**原则上驱动使能信号与制动、档位、驻车使能相互独立根据以往的实际经验**,有些车辆在纵向驱动和制动使能信号归为一个信号,这样的特殊情况需要开发者额外注意,确保纵向的使能一定要与横向使能分开并独立,纵向各模块如果相互关联,则使能需要驱动、制动、档位、驻车一同进去自动驾驶模式,不使能一同退出自动驾驶模式。
(4)如果横向被接管,再次进入自动驾驶模式时,需要通过上升沿触发信号进入自动驾驶。
2. 驱动控制信号:
目标加速踏板位置:控制量是加速踏板的位置百分比,范围是0~100%,100%代表加速踏板踩到最大位置。
车辆目标纵向加速度和车辆目标驱动扭矩是车辆控制信号可选项。
3. 驱动反馈信号:
驾驶模式:反馈车辆当前所处的驱动驾驶模式,至少需要3种模式:自动驾驶模式,手动驾驶模式,被人工接管模式。
加速踏板位置:需准确反馈当前车辆实际踏板位置。
纵向加速度:需准确反馈当前车辆的纵向加速度。
车速:需准确反馈当前车辆车速,Apollo需求的车速是m/s,**一般车辆反馈的车速单位是km/h,此时需要在DBC转换为适配代码后单独进行单位转化**。
轮速:对于乘用车,需提供相关轮速信号,轮速大小,单位km/h。如果有条件,可提供车轮运动方向反馈,Value Description按照以下顺序`0x00,FORWARD;0x01,BACKWARD;0x02,STANDSTILL;0x03,INVALID`。
发动机/电机转速:需准确反馈当前发动机或电机转速,单位r/min。
故障信息:反馈驱动系统是否存在故障。
4. 人工接管:
(1)当车辆底盘接收到人工干预的加速踏板指令(或对于底盘小车,接收到遥控器下发的加速信号)时,车辆各个模块均退出自动驾驶。转向接管需要独立,此时驱动驾驶模式反馈被人工接管模式,转向驾驶模式、制动驾驶模式此时应反馈手动驾驶模式;
(2)驱动自动驾驶被人工接管时,所有模块都退出自动驾驶模式。
5. 越界处理
发生越界时,转向需要退出自动驾驶模式。如定义目标加速踏板位置范围为0~100%,若Apollo下发的控制踏板指令不在此范围时,底盘需要对此越界拒绝执行,并退出自动驾驶模式。
#### 线控制动
1. 制动使能:
(1)制动使能信号是控制车辆进入或退出驱动自动驾驶模式,该使能信号必须是通过**上升沿触发**方式的信号,使能信号原则上是1个信号;有些开发者若有不同信号同时控制,才能使能转向进入自动驾驶状态,需要开发者在底层自己集成相关使能信号的逻辑控制,给Apollo使能信号原则上必须只有1个。
(2)制动使能信号必须独立,不能与转向模块使能信号相关联,需要满足:单独使能进入纵向自动驾驶模式,转向所处驾驶模式不发生变化,下发制动控制信号,车辆能够响应相应的控制命令;单独使能退出驱动自动驾驶模式,转向所处驾驶模式不发生变化,下发制动控制信号,车辆不响应;
(3)原则上驱动使能信号与驱动、档位、驻车使能相互独立。根据以往的实际经验,有些车辆在纵向驱动和制动使能信号归为一个信号,这样的特殊情况需要开发者额外注意,确保纵向的使能一定要与横向使能分开并独立,纵向各模块如果相互关联,则使能需要驱动、制动、档位、驻车一同进去自动驾驶模式,不使能一同退出自动驾驶模式。
(4)如果横向被接管,再次进入自动驾驶模式时,需要通过上升沿触发信号进入自动驾驶。
2. 制动控制信号
制动踏板目标位置:控制量是加速踏板的位置百分比,范围是0~100%,100%代表制动踏板踩到最大位置。
目标减速度:可选项,控制量是车辆的目标减速度大小。
制动灯控制:可选项,控制制动灯是否点亮,一般车辆的底盘会在制动时默认点亮制动灯。
3. 制动反馈信号
驾驶模式:反馈车辆当前所处的制动驾驶模式,至少需要3种模式:自动驾驶模式,手动驾驶模式,被人工接管模式。
制动踏板位置:制动踏板位置,百分比。
刹车灯状态:反馈刹车灯是否点亮。
故障信息:反馈制动系统是否有故障。
4. 人工接管
(1)当车辆底盘接收到人工干预的制动踏板指令(或对于底盘小车,接收到遥控器下发的减速信号)时,车辆各个模块均退出自动驾驶。转向接管需要独立,此时驱动驾驶模式反馈被人工接管模式,转向驾驶模式、制动驾驶模式此时应反馈手动驾驶模式;
(2)驱动自动驾驶被人工接管时,所有模块都退出自动驾驶模式。
5. 越界处理
发生越界时,转向需要退出自动驾驶模式。如定义目标制动踏板位置范围为0~100%,若Apollo下发的控制踏板指令不在此范围时,底盘需要对此越界拒绝执行,并使所有模式退出自动驾驶模式。
#### 线控档位
1. 档位使能
使能独立,不与横向控制相关联。可以与纵向使能信号关联,也可独立使能。档位使能信号必须是通过上升沿触发方式的信号,使能信号原则上是1个信号。
2. 档位控制
控制档位信号,档位信号必须按照以下顺序:`0x00:N档;0x01:D;0x02:R;0x03:P;0x04:NONE`。多余的不必再增加。
3. 档位反馈
档位信息:反馈当前档位信号,反馈顺序与控制档位信号顺序一致:`0x00:N档;0x01:D;0x02:R;0x03:P;0x04:NONE`。多余的不必再增加。
故障信息:反馈换挡系统是否存在故障。
#### 线控驻车
1. 驻车使能
使能独立,不与横向控制相关联。可以与纵向使能信号关联,也可独立使能。驻车使能信号必须是通过上升沿触发方式的信号,使能信号原则上是1个信号。
2. 驻车控制
驻车信号有效,电子手刹抱死,车辆驻车;驻车信号无效,电子手刹松开,车辆不驻车。
3. 驻车反馈
EPB开关状态:反馈当前电子手刹是否抱死或松开。
驻车状态反馈:反馈当前驻车是自动驾驶模式还是手动控制模式。至少需要2种模式:`自动驾驶模式`,`手动驾驶模式`,`被人工接管模式`。
驻车系统故障反馈:反馈驻车系统故障。
#### 其他车身功能
包括线控灯光,主要控制远、近光灯、转向灯、危险警报灯的打开和关闭,已经相应的状态反馈信号。
还有雨刮和喇叭控制,作为可选项。
#### 车辆VIN码
VIN码一般17位,按照ASCII码格式,每一个ASCII占1字节,需要3帧报文连续发出,但是VIN码不需要实时更新,所以在系统请求进入自动驾驶时,VIN码通过CAN总线发出,并一直保持该值不再更新,也可减少总线的负载。
### DBC文件要求
熟悉了上述Apollo对车辆底盘信号的要求,第二步是进行车辆底盘信号database(DBC)文件进行编辑,设置通信的网络结构,每个信号的初值、符号类型,精度,大小范围,取值等,进而组合成相应的CAN通信报文(message)与Apollo进行通信。下面使用CANdb++软件对DBC文件进行编辑,有较好的可视化界面,该软件目前只适用于Windows系统。
因为DBC文件后面会根据Apollo的转译脚本工具,将底盘定义的报文(message)、信号(signal)转化为C++程序代码,因此在编辑DBC时,对信号的名称定义、注释、赋值等就要符合C++语言定义规范,这样以确保在后期调试时不会因为DBC文件的问题无法调通CANBUS通信。根据Apollo代码要求,我们总结了以下注意事项:
#### 1. 控制信号名称建议为 ACU
在定义网络上ECU名称时,建议定义Apollo端的控制器名称为ACU(Apollo Control Unit)。

#### 2. CAN信号ID建议不大于2048
目前乘用车CAN通信建议采用标准帧格式(CAN Standard 2.0),Apollo可支持扩展帧。

#### 3. 注释不能有回车符和换行符,comment(注释)必须为英文
每帧报文(message)如果有注释,注释内不要有换行,不能写中文,必须为英文格式。

##### 4. VAL_(枚举值)(Value Description)需要使用英文,且不能有相同定义名称,必须为字母或字母和数字组合,不能有符号。
对于大部分状态反馈信号和控制信号,如档位反馈,驾驶模式反馈等,需要对信号进行定义,在信号定义的Value Description项内进行定义,定义的名称要遵循C++命名规范,要求使用英文,且不能有相同定义名称,必须为字母或字母和数字组合,不能有符号。如下图是的档位反馈信号的Value Description定义。

##### 5. 反馈信号和控制信号中如车速,轮速,加速度,踏板位置(百分比)等double类型的反馈和控制信号在DBC中Value Description项中必须为空。
对于实时数值反馈信号和数值控制信号,如车速(实际车速)、轮速反馈(实际轮速),踏板控制(百分比),转角控制(实际转角值)等,此类信号在定义Value Description项中不能加任何内容。

##### 6. 转向信号的范围,在定义时要填写准确的取值范围,注意控制转角的精度一般不高于0.05deg,踏板百分比精度(factor)不高于0.1。
对于所有报文的Byte Order,一个DBC内的信号只能统一定义,全部是Motorola格式或者全部是Intel格式。

## 二、适配CANBUS代码
### 1. DBC文件转换成canbus模板代码
Canbus适配代码可以使用apollo的工具生成,在转换代码前,要保证DBC按照上述的DBC文件要求完成,并通过gedit打开dbc文件,另存转码为UTF-8格式保存。
(1)将DBC文件放置指定目录下,目录`apollo/modules/tools/gen_vehicle_protocol`内。
(2)修改DBC转换脚本的配置文件:下面以GE3车型添加为例,在`apollo/modules/tools/gen_vehicle_protocol`目录下,复制默认存在的`mkz_conf.yml`文件并重命名为`ge3_conf.yml`,修改该配置文件,如下图所示:

`dbc_file`:填写对应你的DBC文件名称,DBC文件名称一般以车型名称命名,并以`.dbc`结束;
`protocol_conf`:与上述DBC文件名称命名相同,填写`ge3.yml`;
`car_type`:填入车型名称;
`sender_list:[ ] `:发送列表,这里默认为空;
`sender`:此处修改为与DBC内定义的Apollo的名称一致,ge3的DBC内定义Apollo名称为SCU。
(3)完成`ge3_conf.yml`配置文件设置,启动docker,进入Apollo的容器后,在`apollo/modules/tools/gen_vehicle_protocol`目录下,找到DBC转化工具`gen.py`,执行代码:
```
cd modules/tools/gen_vehicle_protocol
python gen.py ge3_conf.ymal
```
执行完成上述脚本后,在终端内会显示生成了控制协议5个,反馈协议11个。

这时在`apollo/modules/tools/gen_vehicle_protocol`目录下,会生成一个`output`文件夹,文件夹内有2个文件夹,一个是`proto`文件夹,一个是`vehicle`文件夹;这两个文件内的代码内容就是我们要适配canbus的基本代码模板了。我们需要把文件内的代码**拷贝**到apollo的canbus层内,进行代码适配添加。

**注意**:把这个output文件夹内生成的代码模板拷贝至相应的apollo目录后,要删除该文件夹,如果不删除该文件夹,后期编译apollo时会报错。该文件夹有保护权限,请在apollo的docker内执行删除代码:
```
rm -rf output/
```
### 2. 适配代码合入apollo文件内
下面以添加ge3车型为例,将该代码添加至apollo内:

(1)将`apollo/modules/tools/gen_vehicle_protocol/output/proto` 文件夹内`ge3.proto`文件拷贝至`apollo/modules/canbus/proto` 文件夹内,并在该文件夹内修改chassis_detail.proto,在该文件头部添加头文件`import "modules/canbus/proto/ge3.proto"`

在`message ChassisDetail{}` 结构体内的最后一行添加要增加的新车型变量定义: `Ge3 ge3 = 21`;

在`pollo/modules/canbus/proto`目录的`BUILD`文件内添加上述新`proto`的依赖:`"ge3.proto"`;

(2)将`apollo/modules/tools/gen_vehicle_protocol/output/vehicle/` 内的ge3文件夹拷贝至`apollo/modules/canbus/vehicle/` 文件夹下;

### 3.实现新的车辆控制逻辑
实现新的车辆控制逻辑,在`apollo/modules/canbus/vehicle/ge3/ge3_controller.cc` 文件编写控制逻辑代码,主要包含将解析的底盘反馈报文的信息,通过`chassis`和`chassis_detail`广播出车辆底盘信息。`chassis`主要包括获取底盘的车速、轮速、发动机转速、踏板反馈、转角反馈等信息, `chassis_detail`是每一帧报文的实际信息,这一部分编写的代码如下所示:
```
// 3
chassis_.set_engine_started(true);
// check if there is not ge3, no chassis detail can be retrieved and return
if (!chassis_detail.has_ge3()) {
AERROR << "NO GE3 chassis information!";
return chassis_;
}
Ge3 ge3 = chassis_detail.ge3();
// 5
if (ge3.has_scu_bcs_3_308()) {
Scu_bcs_3_308 scu_bcs_3_308 = ge3.scu_bcs_3_308();
if (scu_bcs_3_308.has_bcs_rrwheelspd()) {
if (chassis_.has_wheel_speed()) {
chassis_.mutable_wheel_speed()->set_is_wheel_spd_rr_valid(
scu_bcs_3_308.bcs_rrwheelspdvd());
chassis_.mutable_wheel_speed()->set_wheel_direction_rr(
(WheelSpeed::WheelSpeedType)scu_bcs_3_308.bcs_rrwheeldirection());
chassis_.mutable_wheel_speed()->set_wheel_spd_rr(
scu_bcs_3_308.bcs_rrwheelspd());
}
}
if (scu_bcs_3_308.has_bcs_rlwheelspd()) {
if (chassis_.has_wheel_speed()) {
chassis_.mutable_wheel_speed()->set_is_wheel_spd_rl_valid(
scu_bcs_3_308.bcs_rlwheelspdvd());
chassis_.mutable_wheel_speed()->set_wheel_direction_rl(
(WheelSpeed::WheelSpeedType)scu_bcs_3_308.bcs_rlwheeldirection());
chassis_.mutable_wheel_speed()->set_wheel_spd_rl(
scu_bcs_3_308.bcs_rlwheelspd());
}
}
if (scu_bcs_3_308.has_bcs_frwheelspd()) {
if (chassis_.has_wheel_speed()) {
chassis_.mutable_wheel_speed()->set_is_wheel_spd_fr_valid(
scu_bcs_3_308.bcs_frwheelspdvd());
chassis_.mutable_wheel_speed()->set_wheel_direction_fr(
(WheelSpeed::WheelSpeedType)scu_bcs_3_308.bcs_frwheeldirection());
chassis_.mutable_wheel_speed()->set_wheel_spd_fr(
scu_bcs_3_308.bcs_frwheelspd());
}
}
if (scu_bcs_3_308.has_bcs_flwheelspd()) {
if (chassis_.has_wheel_speed()) {
chassis_.mutable_wheel_speed()->set_is_wheel_spd_fl_valid(
scu_bcs_3_308.bcs_flwheelspdvd());
chassis_.mutable_wheel_speed()->set_wheel_direction_fl(
(WheelSpeed::WheelSpeedType)scu_bcs_3_308.bcs_flwheeldirection());
chassis_.mutable_wheel_speed()->set_wheel_spd_fl(
scu_bcs_3_308.bcs_flwheelspd());
}
}
}
if (ge3.has_scu_bcs_2_307() && ge3.scu_bcs_2_307().has_bcs_vehspd()) {
chassis_.set_speed_mps(
static_cast<float>(ge3.scu_bcs_2_307().bcs_vehspd()));
} else {
chassis_.set_speed_mps(0);
}
// 7
// ge3 only has fuel percentage
// to avoid confusing, just don't set
chassis_.set_fuel_range_m(0);
if (ge3.has_scu_vcu_1_312() && ge3.scu_vcu_1_312().has_vcu_accpedact()) {
chassis_.set_throttle_percentage(
static_cast<float>(ge3.scu_vcu_1_312().vcu_accpedact()));
} else {
chassis_.set_throttle_percentage(0);
}
// 9
if (ge3.has_scu_bcs_1_306() && ge3.scu_bcs_1_306().has_bcs_brkpedact()) {
chassis_.set_brake_percentage(
static_cast<float>(ge3.scu_bcs_1_306().bcs_brkpedact()));
} else {
chassis_.set_brake_percentage(0);
}
// 23, previously 10
if (ge3.has_scu_vcu_1_312() && ge3.scu_vcu_1_312().has_vcu_gearact()) {
switch (ge3.scu_vcu_1_312().vcu_gearact()) {
case Scu_vcu_1_312::VCU_GEARACT_INVALID: {
chassis_.set_gear_location(Chassis::GEAR_INVALID);
} break;
case Scu_vcu_1_312::VCU_GEARACT_DRIVE: {
chassis_.set_gear_location(Chassis::GEAR_DRIVE);
} break;
case Scu_vcu_1_312::VCU_GEARACT_NEUTRAL: {
chassis_.set_gear_location(Chassis::GEAR_NEUTRAL);
} break;
case Scu_vcu_1_312::VCU_GEARACT_REVERSE: {
chassis_.set_gear_location(Chassis::GEAR_REVERSE);
} break;
case Scu_vcu_1_312::VCU_GEARACT_PARK: {
chassis_.set_gear_location(Chassis::GEAR_PARKING);
} break;
default:
chassis_.set_gear_location(Chassis::GEAR_INVALID);
break;
}
} else {
chassis_.set_gear_location(Chassis::GEAR_INVALID);
}
// 11
if (ge3.has_scu_eps_311() && ge3.scu_eps_311().has_eps_steerangle()) {
chassis_.set_steering_percentage(
static_cast<float>(ge3.scu_eps_311().eps_steerangle() /
vehicle_params_.max_steer_angle() * M_PI / 1.80));
} else {
chassis_.set_steering_percentage(0);
}
// 13
if (ge3.has_scu_epb_310() && ge3.scu_epb_310().has_epb_sysst()) {
chassis_.set_parking_brake(ge3.scu_epb_310().epb_sysst() ==
Scu_epb_310::EPB_SYSST_APPLIED);
} else {
chassis_.set_parking_brake(false);
}
// 14, 15: ge3 light control
if (ge3.has_scu_bcm_304() && ge3.scu_bcm_304().has_bcm_highbeamst() &&
Scu_bcm_304::BCM_HIGHBEAMST_ACTIVE ==
ge3.scu_bcm_304().bcm_highbeamst()) {
if (chassis_.has_signal()) {
chassis_.mutable_signal()->set_high_beam(true);
}
} else {
if (chassis_.has_signal()) {
chassis_.mutable_signal()->set_high_beam(false);
}
}
// 16, 17
if (ge3.has_scu_bcm_304()) {
Scu_bcm_304 scu_bcm_304 = ge3.scu_bcm_304();
if (scu_bcm_304.has_bcm_leftturnlampst() &&
Scu_bcm_304::BCM_LEFTTURNLAMPST_ACTIVE ==
scu_bcm_304.bcm_leftturnlampst()) {
chassis_.mutable_signal()->set_turn_signal(
common::VehicleSignal::TURN_LEFT);
} else if (scu_bcm_304.has_bcm_rightturnlampst() &&
Scu_bcm_304::BCM_RIGHTTURNLAMPST_ACTIVE ==
scu_bcm_304.bcm_rightturnlampst()) {
chassis_.mutable_signal()->set_turn_signal(
common::VehicleSignal::TURN_RIGHT);
} else {
chassis_.mutable_signal()->set_turn_signal(
common::VehicleSignal::TURN_NONE);
}
} else {
chassis_.mutable_signal()->set_turn_signal(
common::VehicleSignal::TURN_NONE);
}
// 18
if (ge3.has_scu_bcm_304() && ge3.scu_bcm_304().has_bcm_hornst() &&
Scu_bcm_304::BCM_HORNST_ACTIVE == ge3.scu_bcm_304().bcm_hornst()) {
chassis_.mutable_signal()->set_horn(true);
} else {
chassis_.mutable_signal()->set_horn(false);
}
// vin number will be written into KVDB once.
chassis_.mutable_vehicle_id()->set_vin("");
if (ge3.has_scu_1_301() && ge3.has_scu_2_302() && ge3.has_scu_3_303()) {
Scu_1_301 scu_1_301 = ge3.scu_1_301();
Scu_2_302 scu_2_302 = ge3.scu_2_302();
Scu_3_303 scu_3_303 = ge3.scu_3_303();
if (scu_2_302.has_vin00() && scu_2_302.has_vin01() &&
scu_2_302.has_vin02() && scu_2_302.has_vin03() &&
scu_2_302.has_vin04() && scu_2_302.has_vin05() &&
scu_2_302.has_vin06() && scu_2_302.has_vin07() &&
scu_3_303.has_vin08() && scu_3_303.has_vin09() &&
scu_3_303.has_vin10() && scu_3_303.has_vin11() &&
scu_3_303.has_vin12() && scu_3_303.has_vin13() &&
scu_3_303.has_vin14() && scu_3_303.has_vin15() &&
scu_1_301.has_vin16()) {
int n[17];
n[0] = scu_2_302.vin00();
n[1] = scu_2_302.vin01();
n[2] = scu_2_302.vin02();
n[3] = scu_2_302.vin03();
n[4] = scu_2_302.vin04();
n[5] = scu_2_302.vin05();
n[6] = scu_2_302.vin06();
n[7] = scu_2_302.vin07();
n[8] = scu_3_303.vin08();
n[9] = scu_3_303.vin09();
n[10] = scu_3_303.vin10();
n[11] = scu_3_303.vin11();
n[12] = scu_3_303.vin12();
n[13] = scu_3_303.vin13();
n[14] = scu_3_303.vin14();
n[15] = scu_3_303.vin15();
n[16] = scu_1_301.vin16();
char ch[17];
memset(&ch, '\0', sizeof(ch));
for (int i = 0; i < 17; i++) {
ch[i] = static_cast<char>(n[i]);
}
if (chassis_.has_vehicle_id()) {
chassis_.mutable_vehicle_id()->set_vin(ch);
}
}
}
// give engage_advice based on error_code and canbus feedback
if (chassis_error_mask_) {
if (chassis_.has_engage_advice()) {
chassis_.mutable_engage_advice()->set_advice(
apollo::common::EngageAdvice::DISALLOW_ENGAGE);
chassis_.mutable_engage_advice()->set_reason("Chassis error!");
}
} else if (chassis_.parking_brake() || CheckSafetyError(chassis_detail)) {
if (chassis_.has_engage_advice()) {
chassis_.mutable_engage_advice()->set_advice(
apollo::common::EngageAdvice::DISALLOW_ENGAGE);
chassis_.mutable_engage_advice()->set_reason(
"Vehicle is not in a safe state to engage!");
}
} else {
if (chassis_.has_engage_advice()) {
chassis_.mutable_engage_advice()->set_advice(
apollo::common::EngageAdvice::READY_TO_ENGAGE);
}
}
```
设置自动驾驶模式,编辑相关使能逻辑,在Apollo中,车辆的驾驶模式主要包含:
完全自动驾驶模式(`COMPLETE_AUTO_DRIVE`):横向、纵向都使能;
横向自动驾驶模式(`AUTO_STEER_ONLY`):横向使能,纵向不使能;
纵向自动驾驶模式(`AUTO_SPEED_ONLY`):横向不使能,纵向使能;
车辆使能控制信号控制逻辑如下所示:
```
ErrorCode Ge3Controller::EnableAutoMode() {
if (driving_mode() == Chassis::COMPLETE_AUTO_DRIVE) {
AINFO << "already in COMPLETE_AUTO_DRIVE mode";
return ErrorCode::OK;
}
pc_bcs_202_->set_pc_brkpedenable(Pc_bcs_202::PC_BRKPEDENABLE_ENABLE);
pc_vcu_205_->set_pc_accpedenable(Pc_vcu_205::PC_ACCPEDENABLE_ENABLE);
pc_vcu_205_->set_pc_gearenable(Pc_vcu_205::PC_GEARENABLE_ENABLE);
pc_epb_203_->set_pc_epbenable(Pc_epb_203::PC_EPBENABLE_ENABLE);
pc_eps_204_->set_pc_steerenable(Pc_eps_204::PC_STEERENABLE_ENABLE);
can_sender_->Update();
const int32_t flag =
CHECK_RESPONSE_STEER_UNIT_FLAG | CHECK_RESPONSE_SPEED_UNIT_FLAG;
if (!CheckResponse(flag, true)) {
AERROR << "Failed to switch to COMPLETE_AUTO_DRIVE mode.";
Emergency();
set_chassis_error_code(Chassis::CHASSIS_ERROR);
return ErrorCode::CANBUS_ERROR;
}
set_driving_mode(Chassis::COMPLETE_AUTO_DRIVE);
// If the auto mode can be set normally, the harzad lamp should be off.
pc_bcm_201_->set_pc_hazardlampreq(Pc_bcm_201::PC_HAZARDLAMPREQ_NOREQ);
AINFO << "Switch to COMPLETE_AUTO_DRIVE mode ok.";
return ErrorCode::OK;
}
ErrorCode Ge3Controller::DisableAutoMode() {
ResetProtocol();
can_sender_->Update();
set_driving_mode(Chassis::COMPLETE_MANUAL);
set_chassis_error_code(Chassis::NO_ERROR);
AINFO << "Switch to COMPLETE_MANUAL OK.";
return ErrorCode::OK;
}
ErrorCode Ge3Controller::EnableSteeringOnlyMode() {
if (driving_mode() == Chassis::COMPLETE_AUTO_DRIVE ||
driving_mode() == Chassis::AUTO_STEER_ONLY) {
set_driving_mode(Chassis::AUTO_STEER_ONLY);
AINFO << "Already in AUTO_STEER_ONLY mode";
return ErrorCode::OK;
}
pc_bcs_202_->set_pc_brkpedenable(Pc_bcs_202::PC_BRKPEDENABLE_DISABLE);
pc_vcu_205_->set_pc_accpedenable(Pc_vcu_205::PC_ACCPEDENABLE_DISABLE);
pc_vcu_205_->set_pc_gearenable(Pc_vcu_205::PC_GEARENABLE_DISABLE);
pc_epb_203_->set_pc_epbenable(Pc_epb_203::PC_EPBENABLE_DISABLE);
pc_eps_204_->set_pc_steerenable(Pc_eps_204::PC_STEERENABLE_ENABLE);
can_sender_->Update();
if (!CheckResponse(CHECK_RESPONSE_STEER_UNIT_FLAG, true)) {
AERROR << "Failed to switch to AUTO_STEER_ONLY mode.";
Emergency();
set_chassis_error_code(Chassis::CHASSIS_ERROR);
return ErrorCode::CANBUS_ERROR;
}
set_driving_mode(Chassis::AUTO_STEER_ONLY);
// If the auto mode can be set normally, the harzad lamp should be off.
pc_bcm_201_->set_pc_hazardlampreq(Pc_bcm_201::PC_HAZARDLAMPREQ_NOREQ);
AINFO << "Switch to AUTO_STEER_ONLY mode ok.";
return ErrorCode::OK;
}
ErrorCode Ge3Controller::EnableSpeedOnlyMode() {
if (driving_mode() == Chassis::COMPLETE_AUTO_DRIVE ||
driving_mode() == Chassis::AUTO_SPEED_ONLY) {
set_driving_mode(Chassis::AUTO_SPEED_ONLY);
AINFO << "Already in AUTO_SPEED_ONLY mode";
return ErrorCode::OK;
}
pc_bcs_202_->set_pc_brkpedenable(Pc_bcs_202::PC_BRKPEDENABLE_ENABLE);
pc_vcu_205_->set_pc_accpedenable(Pc_vcu_205::PC_ACCPEDENABLE_ENABLE);
pc_vcu_205_->set_pc_gearenable(Pc_vcu_205::PC_GEARENABLE_ENABLE);
pc_epb_203_->set_pc_epbenable(Pc_epb_203::PC_EPBENABLE_ENABLE);
pc_eps_204_->set_pc_steerenable(Pc_eps_204::PC_STEERENABLE_DISABLE);
can_sender_->Update();
if (!CheckResponse(CHECK_RESPONSE_SPEED_UNIT_FLAG, true)) {
AERROR << "Failed to switch to AUTO_STEER_ONLY mode.";
Emergency();
set_chassis_error_code(Chassis::CHASSIS_ERROR);
return ErrorCode::CANBUS_ERROR;
}
set_driving_mode(Chassis::AUTO_SPEED_ONLY);
// If the auto mode can be set normally, the harzad lamp should be off.
pc_bcm_201_->set_pc_hazardlampreq(Pc_bcm_201::PC_HAZARDLAMPREQ_NOREQ);
AINFO << "Switch to AUTO_SPEED_ONLY mode ok.";
return ErrorCode::OK;
}
```
添加控制信号的相关功能,必须要添加的控制信号包括车辆的油门、刹车踏板控制,转向控制,和档位控制;其它控制信号包括车大灯控制、喇叭控制、转向灯控制、电子手刹控制。代码如下所示:
```
// NEUTRAL, REVERSE, DRIVE
void Ge3Controller::Gear(Chassis::GearPosition gear_position) {
if (driving_mode() != Chassis::COMPLETE_AUTO_DRIVE &&
driving_mode() != Chassis::AUTO_SPEED_ONLY) {
AINFO << "This drive mode no need to set gear.";
return;
}
switch (gear_position) {
case Chassis::GEAR_NEUTRAL: {
pc_vcu_205_->set_pc_gearreq(Pc_vcu_205::PC_GEARREQ_NEUTRAL);
break;
}
case Chassis::GEAR_REVERSE: {
pc_vcu_205_->set_pc_gearreq(Pc_vcu_205::PC_GEARREQ_REVERSE);
break;
}
case Chassis::GEAR_DRIVE: {
pc_vcu_205_->set_pc_gearreq(Pc_vcu_205::PC_GEARREQ_DRIVE);
break;
}
case Chassis::GEAR_PARKING: {
pc_vcu_205_->set_pc_gearreq(Pc_vcu_205::PC_GEARREQ_PARK);
break;
}
case Chassis::GEAR_LOW: {
pc_vcu_205_->set_pc_gearreq(Pc_vcu_205::PC_GEARREQ_INVALID);
break;
}
case Chassis::GEAR_NONE: {
pc_vcu_205_->set_pc_gearreq(Pc_vcu_205::PC_GEARREQ_INVALID);
break;
}
case Chassis::GEAR_INVALID: {
AERROR << "Gear command is invalid!";
pc_vcu_205_->set_pc_gearreq(Pc_vcu_205::PC_GEARREQ_INVALID);
break;
}
default: {
pc_vcu_205_->set_pc_gearreq(Pc_vcu_205::PC_GEARREQ_INVALID);
break;
}
}
}
// brake with new acceleration
// acceleration:0.00~99.99, unit:
// acceleration:0.0 ~ 7.0, unit:m/s^2
// acceleration_spd:60 ~ 100, suggest: 90
// -> pedal
void Ge3Controller::Brake(double pedal) {
// Update brake value based on mode
if (driving_mode() != Chassis::COMPLETE_AUTO_DRIVE &&
driving_mode() != Chassis::AUTO_SPEED_ONLY) {
AINFO << "The current drive mode does not need to set acceleration.";
return;
}
pc_bcs_202_->set_pc_brkpedreq(pedal);
}
// drive with old acceleration
// gas:0.00~99.99 unit:
void Ge3Controller::Throttle(double pedal) {
if (driving_mode() != Chassis::COMPLETE_AUTO_DRIVE &&
driving_mode() != Chassis::AUTO_SPEED_ONLY) {
AINFO << "The current drive mode does not need to set acceleration.";
return;
}
pc_vcu_205_->set_pc_accpedreq(pedal);
}
// ge3 default, -470 ~ 470, left:+, right:-
// need to be compatible with control module, so reverse
// steering with old angle speed
// angle:-99.99~0.00~99.99, unit:, left:-, right:+
void Ge3Controller::Steer(double angle) {
if (!(driving_mode() == Chassis::COMPLETE_AUTO_DRIVE ||
driving_mode() == Chassis::AUTO_STEER_ONLY)) {
AINFO << "The current driving mode does not need to set steer.";
return;
}
const double real_angle =
vehicle_params_.max_steer_angle() / M_PI * 180 * angle / 100.0;
pc_eps_204_->set_pc_steerangreq(real_angle)->set_pc_steerspdreq(500);
}
// drive with acceleration/deceleration
// acc:-7.0 ~ 5.0, unit:m/s^2
void Ge3Controller::Acceleration(double acc) {
if (driving_mode() != Chassis::COMPLETE_AUTO_DRIVE &&
driving_mode() != Chassis::AUTO_SPEED_ONLY) {
AINFO << "The current drive mode does not need to set acceleration.";
return;
}
// None
}
// steering with new angle speed
// angle:-99.99~0.00~99.99, unit:, left:-, right:+
// angle_spd:0.00~99.99, unit:deg/s
void Ge3Controller::Steer(double angle, double angle_spd) {
if (driving_mode() != Chassis::COMPLETE_AUTO_DRIVE &&
driving_mode() != Chassis::AUTO_STEER_ONLY) {
AINFO << "The current driving mode does not need to set steer.";
return;
}
const double real_angle =
vehicle_params_.max_steer_angle() / M_PI * 180 * angle / 100.0;
const double real_angle_spd =
ProtocolData<::apollo::canbus::ChassisDetail>::BoundedValue(
vehicle_params_.min_steer_angle_rate() / M_PI * 180,
vehicle_params_.max_steer_angle_rate() / M_PI * 180,
vehicle_params_.max_steer_angle_rate() / M_PI * 180 * angle_spd /
100.0);
pc_eps_204_->set_pc_steerangreq(real_angle)
->set_pc_steerspdreq(static_cast<int>(real_angle_spd));
}
void Ge3Controller::SetEpbBreak(const ControlCommand& command) {
if (command.parking_brake()) {
pc_epb_203_->set_pc_epbreq(Pc_epb_203::PC_EPBREQ_APPLY);
} else {
pc_epb_203_->set_pc_epbreq(Pc_epb_203::PC_EPBREQ_RELEASE);
}
}
void Ge3Controller::SetBeam(const ControlCommand& command) {
if (command.signal().high_beam()) {
pc_bcm_201_->set_pc_lowbeamreq(Pc_bcm_201::PC_LOWBEAMREQ_NOREQ);
pc_bcm_201_->set_pc_highbeamreq(Pc_bcm_201::PC_HIGHBEAMREQ_REQ);
} else if (command.signal().low_beam()) {
pc_bcm_201_->set_pc_lowbeamreq(Pc_bcm_201::PC_LOWBEAMREQ_REQ);
pc_bcm_201_->set_pc_highbeamreq(Pc_bcm_201::PC_HIGHBEAMREQ_NOREQ);
} else {
pc_bcm_201_->set_pc_lowbeamreq(Pc_bcm_201::PC_LOWBEAMREQ_NOREQ);
pc_bcm_201_->set_pc_highbeamreq(Pc_bcm_201::PC_HIGHBEAMREQ_NOREQ);
}
}
void Ge3Controller::SetHorn(const ControlCommand& command) {
if (command.signal().horn()) {
pc_bcm_201_->set_pc_hornreq(Pc_bcm_201::PC_HORNREQ_REQ);
} else {
pc_bcm_201_->set_pc_hornreq(Pc_bcm_201::PC_HORNREQ_NOREQ);
}
}
void Ge3Controller::SetTurningSignal(const ControlCommand& command) {
// Set Turn Signal
auto signal = command.signal().turn_signal();
if (signal == common::VehicleSignal::TURN_LEFT) {
pc_bcm_201_->set_pc_leftturnlampreq(Pc_bcm_201::PC_LEFTTURNLAMPREQ_REQ);
pc_bcm_201_->set_pc_rightturnlampreq(Pc_bcm_201::PC_RIGHTTURNLAMPREQ_NOREQ);
} else if (signal == common::VehicleSignal::TURN_RIGHT) {
pc_bcm_201_->set_pc_leftturnlampreq(Pc_bcm_201::PC_LEFTTURNLAMPREQ_NOREQ);
pc_bcm_201_->set_pc_rightturnlampreq(Pc_bcm_201::PC_RIGHTTURNLAMPREQ_REQ);
} else {
pc_bcm_201_->set_pc_leftturnlampreq(Pc_bcm_201::PC_LEFTTURNLAMPREQ_NOREQ);
pc_bcm_201_->set_pc_rightturnlampreq(Pc_bcm_201::PC_RIGHTTURNLAMPREQ_NOREQ);
}
}
```
添加`CheckResponse`逻辑,Apollo程序内增加了对车辆底层是否在自动驾驶模式的监控,即车辆横向、驱动、制动模块的驾驶模式反馈是否处于自动驾驶状态,如果在一个`CheckResponse`周期内,车辆某个模块驾驶模块反馈处于接管或者手动驾驶模式,则Apollo会控制车辆使能为紧急停车模式(`Emergency`),即各模块均控制为手动模式,确保控制车辆时的安全。不同的车辆`CheckResponse`周期可能不同,需要开发者根据情况通过设置`retry_num`设定`check`周期。
开发者可以不改原check代码方案,将3个驾驶模式反馈报文与apollo内`chassis_detail`做映射:
`is_eps_online->转向模式反馈信号`
`is_vcu_online->驱动模式反馈信号`
`is_esp_online->制动模式反馈信号`
在`apollo/modules/canbus/vehicle/ge3/protocol/scu_eps_311.cc`文件内,增加以下代码:
```
chassis->mutable_check_response()->set_is_eps_online(eps_drvmode(bytes, length) == 3);
```
在`apollo/modules/canbus/vehicle/ge3/protocol/scu_vcu_1_312.cc`文件内,增加以下代码:
```
chassis->mutable_check_response()->set_is_vcu_online(vcu_drvmode(bytes, length) == 3);
```
在`apollo/modules/canbus/vehicle/ge3/protocol/scu_bcs_1_306.cc`文件内,增加以下代码:
```
chassis->mutable_check_response()->set_is_esp_online(bcs_drvmode(bytes, length) == 3);
```
`CheckResponse`实现代码如下:
```
bool Ge3Controller::CheckResponse(const int32_t flags, bool need_wait) {
int32_t retry_num = 20;
ChassisDetail chassis_detail;
bool is_eps_online = false;
bool is_vcu_online = false;
bool is_esp_online = false;
do {
if (message_manager_->GetSensorData(&chassis_detail) != ErrorCode::OK) {
AERROR_EVERY(100) << "get chassis detail failed.";
return false;
}
bool check_ok = true;
if (flags & CHECK_RESPONSE_STEER_UNIT_FLAG) {
is_eps_online = chassis_detail.has_check_response() &&
chassis_detail.check_response().has_is_eps_online() &&
chassis_detail.check_response().is_eps_online();
check_ok = check_ok && is_eps_online;
}
if (flags & CHECK_RESPONSE_SPEED_UNIT_FLAG) {
is_vcu_online = chassis_detail.has_check_response() &&
chassis_detail.check_response().has_is_vcu_online() &&
chassis_detail.check_response().is_vcu_online();
is_esp_online = chassis_detail.has_check_response() &&
chassis_detail.check_response().has_is_esp_online() &&
chassis_detail.check_response().is_esp_online();
check_ok = check_ok && is_vcu_online && is_esp_online;
}
if (check_ok) {
return true;
}
AINFO << "Need to check response again.";
if (need_wait) {
--retry_num;
std::this_thread::sleep_for(
std::chrono::duration<double, std::milli>(20));
}
} while (need_wait && retry_num);
AINFO << "check_response fail: is_eps_online:" << is_eps_online
<< ", is_vcu_online:" << is_vcu_online
<< ", is_esp_online:" << is_esp_online;
return false;
}
```
### 4.修改底盘车速反馈协议,将车速反馈单位由km/h转化为m/s
Apollo系统内默认使用车速反馈量为`m/s`,底盘车速信息对Apollo非常重要,在车辆标定、控制、规划等都需要采集该数据,所以开发者要在开发适配代码时,重点检查车速反馈的单位。车速由`km/h`转化为`m/s`时,在反馈车速的信号除以`3.6`即可。
找到Ge3车辆反馈车速的报文在文件`apollo/modules/canbus/vehicle/ge3/protocol/scu_bcs_2_307.cc` 下,反馈车速消息为`Scubcs2307::bcs_vehspd{}`,如下图所示:

### 5.注册新车辆
在`modules/canbus/vehicle/vehicle_factory.cc`里注册新的车辆,在该文件内新建如下类:

添加头文件

添加BUILD依赖库
在`apollo/modules/canbus/vehicle/BUILD` 文件内添加`ge3_vehicle_factory`依赖库。

### 6.更新配置文件
在`modules/canbus/proto/vehicle_parameter.proto` 文件内添加GE3车辆分支。

在`modules/canbus/conf/canbus_conf.pb.txt` 更新配置,改为ge3的canbus通信程序。

## 三、车辆底盘开环验证DBC的方法
### 1、开环测试
在确定了车辆底盘DBC后,对DBC内定义的信号进行开环测试。开环测试的主要目的是测试车辆线控信号与车辆的实际功能是否相符,测试车辆的转向、加减速性能响应是否满足车辆的线控需求,测试车辆接管逻辑是否满足要求。
底盘的开环单侧中,开发者要针对前文所述的DBC重点要求进行测试,如车辆横纵向使能独立性,横纵向接管的独立性,每个控制信号是否满足控制要求和控制边界,反馈信号是否反馈正确。在性能上,控制信号的转向和加减速延迟是否满足apollo控制性能要求,超调误差是否在线控列表范围内。请开发者根据线控列表内的性能要求,对控制信号进行测试。
### 2、teleop底盘联调测试
底盘联调测试就是通过将Apollo与车辆进行canbus通信后,测试Apollo下发控制信号(如加速/减速/转向/使能等)是否能够准确控制车辆,测试车辆的底盘反馈信号(如当前踏板百分比反馈/当前转角反馈/使能反馈/接管反馈等)是否与反馈了车辆的实际状态,验证Apollo下发的控制指令,车辆底盘能够准确执行。
#### teleop测试工具介绍
apollo里为开发者提供了一个teleop的测试工具,在`apollo/modules/canbus/tools/teleop.cc`,在term内输入
```
bash scripts/canbus_teleop.sh
```
即可进入teleop界面,如下图所示:

按`h`键,可以调出上图所示的帮助界面,可以查询Teleop工具的使用方法,下面简单对teleop各个控制指令介绍下。
##### Set Action 执行Apollo对车辆的使能控制:
按`m`和`0`键组合,表示执行reset指令,车辆退出自动驾驶模式;
按`m`和`1`键组合,表示执行start指令,车辆进入自动驾驶模式。
##### Set Gear 表示设置档位,按`g`和`数字`组合,进行相应档位设置:
按`g`+`0`挂入N档(空挡);
按`g`+`1`挂入D档(前进挡);
按`g`+`2`挂入R档(倒车档);
按`g`+`3`挂入P档(驻车档);
其它档位控制指令暂不需要,根据我们DBC要求,一般车辆控制档位指令就这几个。
##### Throttle/Speed up 表示每次增加油门踏板量2%,车辆加速
按 `w` 键增加油门踏板2%,使车辆加速。如果当前已经执行brake刹车指令,按`w`表示减少刹车踏板量2%。
油门踏板量的控制范围是0~100%,即100%时相当于油门踏板全部踩下。默认每按`w`键一次,油门踏板量增加2%,这个值开发者可以根据实车测试,进行修改,根据经验,每次变化2%比较合适。
`注意:请先用teleop执行挂D档后再执行加油命令,请在开放场地测试,注意安全`!
##### Set Throttle 设置油门踏板百分比
按`t`+`数字`可以直接设置具体的油门踏板百分比,油门踏板可设置的百分比数为0~100。如执行t20,表示直接设置当前油门踏板量为20%,并将刹车踏板百分比置为0,这一点与实际开车逻辑一致,如果踩下油门踏板,就不能踩刹车踏板。
`注意:直接设置油门踏板百分比时,注意每次不要设置太大,开放场地测试,注意安全!请在车辆为D档状态下执行该命令`。
##### Brake/Speed down 表示每次增加油门踏板量2%,车辆加速
按`s`键增加刹车踏板百分比,使车辆减速。如当前已经执行throttle加速指令,按`s`键表示减少油门踏板百分比。
`注意:请先用teleop执行挂D档后再执行加油命令,请在开放场地测试,注意安全`!
##### Set Brake 设置刹车踏板百分比
按`b`+`数字`可以直接设置具体的刹车踏板百分比,刹车踏板可设置的百分比数为0~100。如执行b20,表示直接设置当前刹车踏板量为20%,并将油门踏板百分比置为0,这一点与实际开车逻辑一致,如果踩下刹车踏板,就不能踩油门踏板。
`注意:直接设置油门踏板百分比时,注意每次不要设置太大,开放场地测试,注意安全!请在车辆为D档状态下执行该命令`。
##### Steer LEFT 表示方向盘每次向左转2%
按`a`键表示每次向左转2%的方向盘最大转角,具体转动角度应根据车辆设置的最大方向盘转角乘以2%进行换算。
该指令执行可以在车辆静止时执行,也可以在车辆启动后执行。
##### Steer RIGHT表示方向盘每次向右转2%
按`s`键表示每次向右转2%的方向盘最大转角,具体转动角度应根据车辆设置的最大方向盘转角乘以2%进行换算。
该指令执行可以在车辆静止时执行,也可以在车辆启动后执行。
##### Parking Brake 打开电子手刹
按`P`键(注意是大写P)可以手动控制车辆电子手刹开关。这个功能根据车辆的是否提供了电子手刹的控制接口而实现。
`注意:执行电子手刹开启或释放时,请将车辆用teleop设置为P档状态`。
##### Emergency Stop 紧急停车
按`E`键(注意是大写E)可以进行车辆紧急停车,默认执行50%刹车。
建议开发者在测试时尽量少用此功能,体感差,调试车辆时多注意周围情况。发生突发情况时及时用外接踩刹车踏板的方式进行手动接管车辆。
### 诊断工具介绍
了解了teleop的基本操作后,开发者根据相应的指令,对车辆执行具体的控制命令,然后通过Apollo的可视化监控工具`diagnostic.sh(Apollo3.0及以前版本)/cyber_monitor` 进行查看车辆当前的反馈信号,确认控制下发后车辆的执行结果是否正确。
在Apollo里提供了一个可视化的监控工具,可以用来监控底盘`chassis`和`chassis_detail`信息,通过执行
```
bash scripts/diagnostic.sh //Apollo3.0及以前版本
cyber_monitor //Apollo3.5版本
```
在`apollo/modules/canbus/conf/canbus.conf`文件内:
修改配置`--noenable_chassis_detail_pub`为`--enable_chassis_detail_pub`,表示在打开`chassis_detail`底盘详细信息,即可以查看底盘反馈信号的每一帧报文原始信息。
修改配置`--receive_guardian`为`--noreceive_guardian`,即可以关闭guardian模式,进入canbus的调试模式,这样teleop时就能够控制车辆了。如下图所示是修改`canbus_conf`配置文件。

打开`diagnostic`或`cyber_monitor`界面如下

可以看到`chassis`和`chassis_detail`均有数据,频率约100Hz。`chassis`下数据主要是车辆的实际转速、实际踏板百分比的反馈,实际方向盘转角百分比,实际档位反馈等信息,在`chassis_detail`是底盘上传给apollo的反馈报文(即apollo接收底盘全部报文)的全部信息。
如下图所示为`chassis`信息

如下图所示为`chassis_detail`信息


| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆适配/how_to_add_a_new_vehicle_cn.md
|
# 如何在Apollo中添加新的车辆
## 简介
本文描述了如何向Apollo中添加新的车辆。
```
注意: Apollo控制算法将林肯MKZ配置为默认车辆
```
添加新的车辆时,如果您的车辆需要不同于Apollo控制算法提供的属性,请参考:
- 使用适合您的车辆的其它控制算法。
- 修改现有算法的参数以获得更好的结果。
## 增加新车辆
添加新车辆需要完成以下任务:
* 实现新的车辆控制器
* 实现新的消息管理器
* 实现新的车辆工厂类
* 更新配置文件
### 实现新的车辆控制器
新的车辆控制器是从 `VehicleController`类继承的。 下面提供了一个头文件示例。
```cpp
/**
* @class NewVehicleController
*
* @brief this class implements the vehicle controller for a new vehicle.
*/
class NewVehicleController final : public VehicleController {
public:
/**
* @brief initialize the new vehicle controller.
* @return init error_code
*/
::apollo::common::ErrorCode Init(
const VehicleParameter& params, CanSender* const can_sender,
MessageManager* const message_manager) override;
/**
* @brief start the new vehicle controller.
* @return true if successfully started.
*/
bool Start() override;
/**
* @brief stop the new vehicle controller.
*/
void Stop() override;
/**
* @brief calculate and return the chassis.
* @returns a copy of chassis. Use copy here to avoid multi-thread issues.
*/
Chassis chassis() override;
// more functions implemented here
...
};
```
### 实现新的消息管理器
新的消息管理器是从 `MessageManager` 类继承的。 下面提供了一个头文件示例。
```cpp
/**
* @class NewVehicleMessageManager
*
* @brief implementation of MessageManager for the new vehicle
*/
class NewVehicleMessageManager : public MessageManager {
public:
/**
* @brief construct a lincoln message manager. protocol data for send and
* receive are added in the construction.
*/
NewVehicleMessageManager();
virtual ~NewVehicleMessageManager();
// define more functions here.
...
};
```
### 实现新的车辆工厂类
新的车辆工厂是从 `AbstractVehicleFactory` 类继承的。下面提供了一个头文件示例。
```cpp
/**
* @class NewVehicleFactory
*
* @brief this class is inherited from AbstractVehicleFactory. It can be used to
* create controller and message manager for lincoln vehicle.
*/
class NewVehicleFactory : public AbstractVehicleFactory {
public:
/**
* @brief destructor
*/
virtual ~NewVehicleFactory() = default;
/**
* @brief create lincoln vehicle controller
* @returns a unique_ptr that points to the created controller
*/
std::unique_ptr<VehicleController> CreateVehicleController() override;
/**
* @brief create lincoln message manager
* @returns a unique_ptr that points to the created message manager
*/
std::unique_ptr<MessageManager> CreateMessageManager() override;
};
```
一个.cc示例文件如下:
```cpp
std::unique_ptr<VehicleController>
NewVehicleFactory::CreateVehicleController() {
return std::unique_ptr<VehicleController>(new lincoln::LincolnController());
}
std::unique_ptr<MessageManager> NewVehicleFactory::CreateMessageManager() {
return std::unique_ptr<MessageManager>(new lincoln::LincolnMessageManager());
}
```
Apollo提供可以用于实现新的车辆协议的基类 `ProtocolData`。
### 更新配置文件
在`modules/canbus/vehicle/vehicle_factory.cc`里注册新的车辆。 下面提供了一个头文件示例。
```cpp
void VehicleFactory::RegisterVehicleFactory() {
Register(VehicleParameter::LINCOLN_MKZ, []() -> AbstractVehicleFactory* {
return new LincolnVehicleFactory();
});
// register the new vehicle here.
Register(VehicleParameter::NEW_VEHICLE_BRAND, []() -> AbstractVehicleFactory* {
return new NewVehicleFactory();
});
}
```
### 更新配置文件
在 `modules/canbus/conf/canbus_conf.pb.txt` 中更新配置,在Apollo系统中激活车辆。
```config
vehicle_parameter {
brand: NEW_VEHICLE_BRAND
// put other parameters below
...
}
```
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆适配/how_to_add_a_new_vehicle.md
|
# How to Add a New Vehicle to Apollo
## Introduction
The instructions below demonstrate how to add a new vehicle to Apollo.
```
Note: The Apollo control algorithm is configured for the default vehicle, which is a Lincoln MKZ.
```
When adding a new vehicle, if your vehicle requires different attributes from those offered by the Apollo control algorithm, consider:
- Using a different control algorithm that is appropriate for your vehicle.
- Modifying the existing algorithm's parameters to achieve better results.
## Adding a New Vehicle
Complete the following task sequence to add a new vehicle:
* Implement the new vehicle controller.
* Implement the new message manager.
* Implement the new vehicle factory.
* Update the configuration file.
### Implement the New Vehicle Controller
The new vehicle controller is inherited from the `VehicleController` class. An example header file is provided below.
```cpp
/**
* @class NewVehicleController
*
* @brief this class implements the vehicle controller for a new vehicle.
*/
class NewVehicleController final : public VehicleController {
public:
/**
* @brief initialize the new vehicle controller.
* @return init error_code
*/
::apollo::common::ErrorCode Init(
const VehicleParameter& params, CanSender* const can_sender,
MessageManager* const message_manager) override;
/**
* @brief start the new vehicle controller.
* @return true if successfully started.
*/
bool Start() override;
/**
* @brief stop the new vehicle controller.
*/
void Stop() override;
/**
* @brief calculate and return the chassis.
* @returns a copy of chassis. Use copy here to avoid multi-thread issues.
*/
Chassis chassis() override;
// more functions implemented here
...
};
```
### Implement the New Message Manager
The new message manager is inherited from the `MessageManager` class. An example header file is provided below.
```cpp
/**
* @class NewVehicleMessageManager
*
* @brief implementation of MessageManager for the new vehicle
*/
class NewVehicleMessageManager : public MessageManager {
public:
/**
* @brief construct a lincoln message manager. protocol data for send and
* receive are added in the construction.
*/
NewVehicleMessageManager();
virtual ~NewVehicleMessageManager();
// define more functions here.
...
};
```
### Implement the New Vehicle Factory Class.
The new vehicle factory class is inherited from the `AbstractVehicleFactory` class. An example header file is provided below.
```cpp
/**
* @class NewVehicleFactory
*
* @brief this class is inherited from AbstractVehicleFactory. It can be used to
* create controller and message manager for lincoln vehicle.
*/
class NewVehicleFactory : public AbstractVehicleFactory {
public:
/**
* @brief destructor
*/
virtual ~NewVehicleFactory() = default;
/**
* @brief create lincoln vehicle controller
* @returns a unique_ptr that points to the created controller
*/
std::unique_ptr<VehicleController> CreateVehicleController() override;
/**
* @brief create lincoln message manager
* @returns a unique_ptr that points to the created message manager
*/
std::unique_ptr<MessageManager> CreateMessageManager() override;
};
```
An example .cc file is provided below.
```cpp
std::unique_ptr<VehicleController>
NewVehicleFactory::CreateVehicleController() {
return std::unique_ptr<VehicleController>(new lincoln::LincolnController());
}
std::unique_ptr<MessageManager> NewVehicleFactory::CreateMessageManager() {
return std::unique_ptr<MessageManager>(new lincoln::LincolnMessageManager());
}
```
Apollo provides the base class `ProtocolData` that can be used to implement the protocols of the new vehicle.
### Register the New Vehicle
Register the new vehicle in `modules/canbus/vehicle/vehicle_factory.cc`. An example header file is provided below.
```cpp
void VehicleFactory::RegisterVehicleFactory() {
Register(VehicleParameter::LINCOLN_MKZ, []() -> AbstractVehicleFactory* {
return new LincolnVehicleFactory();
});
// register the new vehicle here.
Register(VehicleParameter::NEW_VEHICLE_BRAND, []() -> AbstractVehicleFactory* {
return new NewVehicleFactory();
});
}
```
### Update the config File
Update the config file `modules/canbus/conf/canbus_conf.pb.txt` to activate the new vehicle in the Apollo system.
```config
vehicle_parameter {
brand: NEW_VEHICLE_BRAND
// put other parameters below
...
}
```
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/硬件安装hardware installation/apollo_3_0_hardware_system_installation_guide.md
|
# Apollo 3.0 Hardware and System Installation Guide
- [Apollo 3.0 Hardware and System Installation Guide](#apollo-30-hardware-and-system-installation-guide)
- [About This Guide](#about-this-guide)
- [Document Conventions](#document-conventions)
- [Introduction](#introduction)
- [Documentation](#documentation)
- [Key Hardware Components](#key-hardware-components)
- [Additional Components Required](#additional-components-required)
- [Steps for the Installation Tasks](#steps-for-the-installation-tasks)
- [At the Office](#at-the-office)
- [In the Vehicle](#in-the-vehicle)
- [Prerequisites](#prerequisites)
- [Diagrams of the Major Component Installations](#diagrams-of-the-major-component-installations)
- [Additional Tasks Required](#additional-tasks-required)
- [Time Sync Script Setup [Optional]](#time-sync-script-setup-optional)
- [Next Steps](#next-steps)
## About This Guide
The *Apollo 3.0 Hardware and System Installation Guide* provides the instructions to install all of the hardware components and system software for the **Apollo Project**. The system installation information included pertains to the procedures to download and install the Apollo Linux Kernel.
### Document Conventions
The following table lists the conventions that are used in this document:
| **Icon** | **Description** |
| ----------------------------------- | ---------------------------------------- |
| **Bold** | Emphasis |
| `Mono-space font` | Code, typed data |
| _Italic_ | Titles of documents, sections, and headings Terms used |
|  | **Info** Contains information that might be useful. Ignoring the Info icon has no negative consequences. |
|  | **Tip**. Includes helpful hints or a shortcut that might assist you in completing a task. |
|  | **Online**. Provides a link to a particular web site where you can get more information. |
|  | **Warning**. Contains information that must **not** be ignored or you risk failure when you perform a certain task or step. |
## Introduction
The **Apollo Project** is an initiative that provides an open, complete, and reliable software platform for Apollo partners in the automotive and autonomous driving industries. The aim of this project is to enable these entities to develop their own self-driving systems based on the Apollo software stack.
### Documentation
The following set of documentation describes Apollo 3.0:
- ***<u>[Apollo Hardware and System Installation Guide]</u>*** ─ Links to the Hardware Development Platform Documentation in Specs
- **Vehicle**:
- [Industrial PC (IPC)](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/IPC/Nuvo-6108GC_Installation_Guide.md)
- [Global Positioning System (GPS)](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Navigation/README.md)
- [Inertial Measurement Unit (IMU)](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Navigation/README.md)
- Controller Area Network (CAN) card
- GPS Antenna
- GPS Receiver
- [Light Detection and Ranging System (LiDAR)](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Lidar/README.md)
- [Camera](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Camera/README.md)
- [Radar](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Radar/README.md)
- [Apollo Sensor Unit (ASU)](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Apollo_Sensor_Unit/Apollo_Sensor_Unit_Installation_Guide.md)
- **Software**: Refer to the [Software Installation Guide](https://github.com/ApolloAuto/apollo/blob/r3.0.0/docs/specs/Software_and_Kernel_Installation_guide.md) for information on the following:
- Ubuntu Linux
- Apollo Linux Kernel
- NVIDIA GPU Driver
- ***<u>[Apollo Quick Start Guide]</u>*** ─ The combination of a tutorial and a roadmap that provides the complete set of end-to-end instructions. The Quick Start Guide also provides links to additional documents that describe the conversion of a regular car to an autonomous-driving vehicle.
## Key Hardware Components
The key hardware components to install include:
- Onboard computer system ─ Neousys Nuvo-6108GC
- Controller Area Network (CAN) Card ─ ESD CAN-PCIe/402-B4
- Global Positioning System (GPS) and Inertial Measurement Unit (IMU) ─
You can select one of the following options:
- NovAtel SPAN-IGM-A1
- NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
- Navtech NV-GI120
- Light Detection and Ranging System (LiDAR) ─ You can select one of the following options:
- Velodyne HDL-64E S3
- Velodyne Puck series
- Innovusion LiDAR
- Hesai's Pandora
- Cameras — You can select one of the following options:
- Leopard Imaging LI-USB30-AR023ZWDR with USB 3.0 case
- Argus Camera
- Wissen Camera
- Radar — You can select one of the following options:
- Continental ARS408-21
- Delphi ESR 2.5
- Racobit B01HC
### Additional Components Required
You need to provide these additional components for the Additional Tasks Required:
- Apollo Sensor Unit (ASU)
- A 4G router for Internet access
- A USB hub for extra USB ports
- A monitor, keyboard, and mouse for debugging at the car onsite
- Cables: a Digital Visual Interface (DVI) cable (optional), a customized cable for GPS-LiDAR time synchronization
- Apple iPad Pro: 9.7-inch, Wi-Fi (optional)
The features of the key hardware components are presented in the subsequent sections.
## Steps for the Installation Tasks
This section describes the steps to install:
- The key hardware and software components
- The hardware in the vehicle
### At the Office
Perform the following tasks:
- Prepare the IPC:
- Install the CAN card
- Install or replace the hard drive
- Prepare the IPC for powering up
- Install the software for the IPC:
- Ubuntu Linux
- Apollo Kernel
- Nvidia GPU Driver
The IPC is now ready to be mounted on the vehicle.
### In the Vehicle
Perform these tasks:
- Make the necessary modifications to the vehicle as specified in the list of prerequisites
- Install the major components:
- GPS Antenna
- IPC
- GPS Receiver and IMU
- LiDAR's
- Cameras
- Radar
#### Prerequisites
**WARNING**: Prior to mounting the major components (GPS Antenna, IPC, and GPS Receiver) in the vehicle, perform certain modifications as specified in the list of prerequisites. The instructions for making the mandatory changes in the list are outside the scope of this document.
The list of prerequisites are as follows:
- The vehicle must be modified for “drive-by-wire” technology by a professional service company. Also, a CAN interface hookup must be provided in the trunk where the IPC will be mounted.
- A power panel must be installed in the trunk to provide power to the IPC and the GPS-IMU. The power panel would also service other devices in the vehicle such as a 4G LTE router. The power panel should be hooked up to the power system in the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU Antenna, the cameras and the LiDAR's on top of the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU in the trunk.
- A custom-made rack must be installed in front of the vehicle to mount the front-facing radar.
- A 4G LTE router must be mounted in the trunk to provide Internet access for the IPC. The router must have built-in Wi-Fi access point (AP) capability to connect to other devices, such as an iPad, to interface with the autonomous driving (AD) system. A user would be able to use the mobile device to start AD mode or monitor AD status, for example.
#### Diagrams of the Major Component Installations
The following two diagrams indicate the locations of where the three major components (GPS Antenna, IPC, GPS Receiver and LiDAR) should be installed on the vehicle:


## Additional Tasks Required
Use the components that you were required to provide to perform the following tasks:
1. Connect a monitor using the DVI or the HDMI cables and connect the keyboard and mouse to perform debugging tasks at the car onsite.
2. Establish a Wi-Fi connection on the Apple iPad Pro to access the HMI and control the Apollo ADS that is running on the IPC.
## Time Sync Script Setup [Optional]
In order to, sync the computer time to the NTP server on the internet, you could use the [Time Sync script](https://github.com/ApolloAuto/apollo/blob/master/scripts/time_sync.sh)
## Next Steps
After you complete the hardware installation in the vehicle, see the [Apollo Quick Start](../../../02_Quick%20Start/apollo_3_0_quick_start.md) for the steps to complete the software installation.
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/硬件安装hardware installation/apollo_2_5_hardware_system_installation_guide_v1_cn.md
|
# Apollo 2.5 硬件与系统安装指南
- [关于本篇指南](#关于本篇指南)
- [文档编写规则](#文档编写规则)
- [引言](#引言)
- [文档说明](#文档说明)
- [核心硬件](#核心硬件)
- [附加组件](#附加组件)
- [车载计算机系统 - IPC](#车载计算机系统---ipc)
- [IPC的配置](#ipc的配置)
- [IPC前侧视图](#ipc前侧视图)
- [控制器局域网络(CAN)卡](#控制器局域网络can卡)
- [全球定位系统(GPS)和惯性测量装置(IMU)](#全球定位系统gps和惯性测量装置imu)
- [选项1: NovAtel SPAN-IGM-A1](#选项1-novatel-span-igm-a1)
- [选项2: NovAtel SPAN ProPak6和NovAtel IMU-IGM-A1](#选项2-novatel-span-propak6和novatel-imu-igm-a1)
- [The GPS Receiver/Antenna](#the-gps-receiverantenna)
- [选项 1: NovAtel GPS-703-GGG-HV](#选项-1-novatel-gps-703-ggg-hv)
- [选项 2: Dual NovAtel GNSS-502](#选项-2-dual-novatel-gnss-502)
- [激光雷达 (LiDAR)](#激光雷达-lidar)
- [摄像头](#摄像头)
- [雷达](#雷达)
- [安装任务概览](#安装任务概览)
- [安装任务步骤](#安装任务步骤)
- [上车前的准备工作](#上车前的准备工作)
- [IPC的准备工作](#ipc的准备工作)
- [为IPC安装软件](#为ipc安装软件)
- [上车安装](#上车安装)
- [前提条件](#前提条件)
- [主要部件安装图](#主要部件安装图)
- [安装GPS的接收器和天线](#安装gps的接收器和天线)
- [选项1:安装NovAtel SPAN-IGM-A1](#选项1安装novatel-span-igm-a1)
- [选项2:NovAtel SPAN® ProPak6™ 和 NovAtel IMU-IGM-A1](#选项2novatel-span®-propak6™-和-novatel-imu-igm-a1)
- [安装激光雷达(LiDAR)](#安装激光雷达lidar)
- [安装摄像头](#安装摄像头)
- [安装雷达](#安装雷达)
- [建立网络](#建立网络)
- [推荐配置](#推荐配置)
- [额外任务](#额外任务)
- [下一步](#下一步)
# 关于本篇指南
本篇指南提供了所有 **Apollo项目**需要的的安装硬件部分和软件系统教程。系统安装信息包括下载和安装Apollo Linux内核的过程。
## 文档编写规则
下表列出了本文使用的编写规则:
| **图标** | **描述** |
| ----------------------------------- | ---------------------------------------- |
| **加粗** | 强调。 |
| `Mono-space 字体` | 代码, 类型数据。 |
| _斜体_ | 文件、段落和标题中术语的用法。 |
|  | **信息** 提供了可能有用的信息。忽略此信息可能会产生不可预知的后果。 |
|  | **提醒** 包含有用的提示或者可以帮助你完成安装的快捷步骤。 |
|  | **在线** 提供指向特定网站的链接,您可以在其中获取更多信息。 |
|  | **警告** 包含 **不能** 被忽略的内容,如果忽略,当前安装步骤可能会失败。 |
# 引言
**Apollo项目**旨在为汽车和自动驾驶行业的合作伙伴提供开放,完整和可靠的软件平台。该项目的目的是使这些企业能够开发基于Apollo软件栈的自动驾驶系统。
## 文档说明
以下文档适用于Apollo 2.5:
- ***<u>[Apollo Hardware and System Installation Guide]</u>*** ─ 提供用于安装车辆的硬件部件和系统软件的教程:
- **车辆**:
- 工业用计算机 (IPC)
- 全球定位系统 (GPS)
- 惯性测量单元 (IMU)
- 控制器局域网络 (CAN) 卡
- GPS 天线
- GPS 接收器
- 安装激光雷达 (LiDAR)
- 摄像头
- 雷达
- **软件**:
- Ubuntu Linux 操作系统
- Apollo Linux 内核
- Nvidia GPU 驱动
- ***<u>[Apollo Quick Start Guide]</u>*** ─ 文档和产品蓝图提供了完整的端到端教程。本文还提供了一些其它链接用于将一辆普通汽车改装成一辆自动驾驶车辆。
# 核心硬件
需要安装的关键的硬件组件包括:
- 车载计算机系统 ─ Neousys Nuvo-6108GC
- CAN卡 ─ ESD CAN-PCIe/402-B4
- 全球定位系统(GPS)和惯性测量装置(IMU) ─ 您可从如下选项中任选其一:
- NovAtel SPN-IGM-A1
- NovAtel SPAN® ProPak6™ 和 NovAtel IMU-IGM-A1
- 激光雷达 (LiDAR) - Velodyne HDL-64E S3
- 摄像头 — 采用 USB 3.0 的Leopard Imaging LI-USB30-AR023ZWDR
- 雷达 — Continental ARS408-21
## 附加组件
- 提供网络接入的4G路由器
- 提供额外USB接口的USB集线器
- 供在车辆现场调试使用的显示器,键盘,鼠标
- 连接线:数字可视接口(DVI)线(可选),用于GPS和LiDAR时间同步的定制线
- 苹果iPad Pro:9.7寸, WiFi(可选)
关键硬件组件的特性将在后续部分中介绍。
## 车载计算机系统 - IPC
车载计算机系统是用于自动驾驶车辆的工业PC(IPC),并使用由第六代Intel Xeon E3 1275 V5 CPU强力驱动的 **NeousysNuvo-6108GC**。
Neousys Nuvo-6108GC是自动驾驶系统(ADS)的中心单元。
### IPC的配置
IPC配置如下:
- ASUS GTX1080 GPU-A8G-Gaming GPU Card
- 32GB DDR4 RAM
- PO-280W-OW 280W 交流、直流电源适配器
- 2.5" SATA 硬盘 1TB 7200rpm
### IPC前侧视图
安装了GPU的IPC前后视图如下:
Nuvo-6108GC的前视图:

Nuvo-6108GC的侧视图:

想要了解更多有关 Nuvo-6108GC的资料, 请参考:

Neousys Nuvo-6108GC 产品页:
[http://www.neousys-tech.com/en/product/application/rugged-embedded/nuvo-6108gc-gpu-computing](http://www.neousys-tech.com/en/product/application/rugged-embedded/nuvo-6108gc-gpu-computing)

Neousys Nuvo-6108GC 手册:还不可用。
## 控制器局域网络(CAN)卡
IPC中使用的CAN卡型号为 **ESD** **CAN-PCIe/402-B4**.

想要了解更多有关CAN-PCIe/402-B4的资料, 请参考:
 ESD CAN-PCIe/402 产品主页:
[https://esd.eu/en/products/can-pcie402](https://esd.eu/en/products/can-pcie402)
## 全球定位系统(GPS)和惯性测量装置(IMU)
有 **两种** GPS-IMU的 **可选方案**,您只需根据您的需求进行选择:
- 选项1:NovAtel SPAN-IGM-A1
- 选项2:NovAtel SPAN® ProPak6™ 和 NovAtel IMU-IGM-A1
### 选项1: NovAtel SPAN-IGM-A1
NovAtel SPAN-IGM-A1 是一个集成的,单盒的解决方案,提供紧密耦合的全球导航卫星系统(GNSS)定位和具有NovAtel OEM615接收机的惯性导航功能。

想要了解更多有关NovAtel SPAN-IGM-A1的资料, 请参考:
 NovAtel SPAN-IGM-A1 产品页:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
### 选项2: NovAtel SPAN ProPak6和NovAtel IMU-IGM-A1
NovAtel ProPak6是独立的GNSS接收机,它与NovAtel提供的独立IMU(本例中为NovAtel IMU-IGM-A1)相融合以提供定位。
ProPak6提供由NovAtel生产的最新最先进的外壳产品。
IMU-IGM-A1是与支持SPAN的GNSS接收器(如SPAN ProPak6)配对的IMU。

想要了解更多有关NovAtel SPAN ProPak6 and the IMU-IGM-A1, 请参考:
 NovAtel ProPak6 安装操作手册
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel IMU-IGM-A1 产品页:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
## The GPS Receiver/Antenna
GPS-IMU组件的GPS接收器、天线可使用选项有:
### 选项 1: **NovAtel GPS-703-GGG-HV**.
**NOTE:**GPS NovAtelGPS-703-GGG-HV与上文中提到的两个GPS-IMU选项的任一型号配合使用。

更多关于 NovAtel GPS-703-GGG-HV的信息, 请参考:
 NovAtel GPS-703-GGG-HV Product Page:
[https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/](https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/)
### 选项 2: **Dual NovAtel GNSS-502**
**NOTE:**NovAtel GNSS-502与上文中提到的两个GPS-IMU选项的任一型号配合使用。通过使用2个天线,双天线接收器(如ProPak6)得以利用更高质量的航向信息。

更多有关 NovAtel GNSS-502的信息, 请参考:
 NovAtel GNSS-502 产品页:
[https://www.novatel.com/products/gnss-antennas/vexxis-series-antennas/vexxis-gnss-500-series-antennas/](https://www.novatel.com/products/gnss-antennas/vexxis-series-antennas/vexxis-gnss-500-series-antennas/)
## 激光雷达 (LiDAR)
由Velodyne LiDAR公司提供的64线激光雷达系统 **HDL-64E S3** 。

**主要特点:**
- 线数:64
- 探测距离:120m
- 220万点每秒
- 水平视场角:360°
- 垂直视场角:26.9°
- 水平角分辨率:0.08°(方位角)
- 精度:<2cm
- 垂直角分辨率: ~0.4°
- 用户可选帧速率
- 坚固耐用
Velodyne HDL-64E S3的官网:
[http://velodynelidar.com/hdl-64e.html](http://velodynelidar.com/hdl-64e.html)
由Velodyne LiDAR公司提供的16线激光雷达系统 **VLP-16**。

**主要特点:**
- 线数:16
- 探测距离:100m
- 600,000点每秒
- 水平视场角:360°
- 垂直视场角:±15°
- 低功耗
- 保护性设计
Velodyne VLP-16官网:
[http://velodynelidar.com/vlp-16.html](http://velodynelidar.com/vlp-16.html)
## 摄像头
所使用的相机是Leopard Imaging公司制造的标准USB 3.0接口的LI-USB30-AR023ZWDR,我们建议分别使用两个6毫米和一个25毫米镜头的摄像头来实现所需的性能。

您可以从 Leopard Imaging公司的官网上获得更多信息:
[https://leopardimaging.com/product/li-usb30-ar023zwdr/](https://leopardimaging.com/product/li-usb30-ar023zwdr/)
## 雷达
所用雷达是Continental集团制造的ARS408-21。

您可以在产品页上找到更多信息:
[https://www.continental-automotive.com/Landing-Pages/Industrial-Sensors/Products/ARS-408-21](https://www.continental-automotive.com/Landing-Pages/Industrial-Sensors/Products/ARS-408-21)
# 安装任务概览
安装硬件和软件组件涉及以下任务:
**室内:**
1. 在将CAN卡插入插槽之前,先重新定位CAN卡终端跳线。
准备IPC:
- 检查图形处理单元(GPU)磁带,以确定是否需要卸下GPU卡(如果已预安装)
- 在将卡插入插槽之前,首先重新定位CAN卡端接跳线,准备并安装控制器局域网(CAN)卡。
2. 如果未预装硬盘,请先在IPC安装硬盘
您也可以选择更换预装的硬盘。
**推荐**:
- 为了更好的可靠性,安装固态硬盘(SSD);
- 如果需要收集驾驶数据,需要使用大容量硬盘;
3. 准备IPC加电:
a. 将电源线连接到电源连接器(接线端子)
b. 将显示器,以太网,键盘和鼠标连接到IPC
c. 将IPC连接到电源
4. 在IPC安装软件(需要部分Linux经验):
a. 安装Ubuntu Linux.
b. 安装Apollo Linux 内核.
**上车安装:**
- 确保所有在前提条件中列出的对车辆的修改,都已执行。
- 安装主要的组件:
- GPS 天线
- IPC
- GPS 接收器和 IMU
- LiDAR
- 摄像头
- 雷达
安装所有硬件和软件组件的实际步骤详见安装任务步骤。
# 安装任务步骤
该部分包含:
- 核心硬件和软件的安装
- 车辆硬件的安装
## 上车前的准备工作
- 准备IPC:
- 安装CAN卡
- 安装或者替换硬盘
- 准备为IPC供电
- 为IPC安装软件:
- Ubuntu Linux
- Apollo内核
- Nvidia GPU 驱动
### IPC的准备工作
有如下步骤:
1. 准备安装CAN卡:在Neousys Nuvo-6108GC中,ASUS®GTX-1080GPU-A8G-GAMING GPU卡预先安装占用了一个PCI插槽,将CAN卡安装到剩余两个PCI插槽其一即可。
a. 找到并拧下计算机侧面的八个螺丝(棕色方块所示或棕色箭头指示):

b. 从IPC上拆下盖子。基座有3个PCI插槽(由显卡占据一个):


c. 通过从其默认位置移除红色跳线帽(以黄色圆圈显示)并将其放置在其终止位置,设置CAN卡端接跳线:

**WARNING**: 如果端接跳线设置不正确,CAN卡将无法正常工作。
d. 将CAN卡插入IPC的插槽:

e. 安装IPC盖子:

2. 准备IPC启动:
a. 将电源线连接到IPC的电源连接器(接线端子):
**WARNING**: 确保电源线的正极(红色用 **R**表示)和负极(黑色用 **B**表示)正确的插入电源端子块上的插孔中。

b. 连接显示器,以太网线,键盘和鼠标到IPC上:
3. 
如果有一张或多张卡已经加入进系统里,推荐您将风扇速度通过BIOS配置:
- 当启动电脑时,按F2键进入BIOS设置菜单
- 进入 [Advanced] => [Smart Fan Setting]
- 将 [Fan Max. Trip Temp] 设置为 50
- 将 [Fan Start Trip Temp] 设置为 20
建议您用DVI连接GPU和显示器。以下是在主卡上将DVI端口设置为显示器连接端口的步骤:
- 当启动电脑时,按F2键进入BIOS设置菜单
- 进入 [Advanced]=>[System Agent (SA) Configuration]=>[Graphics Configuration]=>[Primary Display]=> 设置为 "PEG"
推荐您将IPC设置为一直处于最佳性能模式(maximum performance mode):
- 当启动电脑时,按F2键进入BIOS设置菜单
- 进入 [Power] => [SKU POWER CONFIG] => 设置为 "MAX. TDP"
c. 连接电源:

### 为IPC安装软件
这部分主要描述以下的安装步骤:
- Ubuntu Linux
- Apollo 内核
- Nvidia GPU 驱动
您最好具有使用Linux成功安装软件的经验。
#### 安装Ubuntu Linux
步骤如下:
1. 创建一个可以引导启动的Ubantu Linux USB闪存驱动器:
下载Ubuntu(或Xubuntu等分支版本),并按照在线说明创建可引导启动的USB闪存驱动器。
 推荐使用 **Ubuntu 14.04.3**.
开机按 F2 进入 BIOS 设置菜单,建议禁用BIOS中的快速启动和静默启动,以便捕捉引导启动过程中的问题。 建议您在BIOS中禁用“快速启动”和“安静启动”,以便了解启动过程中遇到的问题。
获取更多Ubuntu信息,可访问:
 Ubuntu 桌面站点:
[https://www.ubuntu.com/desktop](https://www.ubuntu.com/desktop)
2. 安装 Ubuntu Linux:
a. 将Ubuntu安装驱动器插入USB端口并启动IPC。
b. 按照屏幕上的说明安装Linux。
3. 执行软件更新与安装:
a. 安装完成,重启进入Linux。
b. 执行软件更新器(Software Updater)更新最新软件包,或在终端执行以下命令完成更新。
```shell
sudo apt-get update;
sudo apt-get upgrade
```
c. 打开终端,输入以下命令,安装Linux 4.4 内核:
```shell
sudo apt-get install linux-generic-lts-xenial
```
IPC必须接入网络以便更新与安装软件,所以请确认网线插入并连接,如果连接网络没有使用动态分配(DHCP),需要更改网络配置。
#### 安装Apollo内核
车上运行Apollo需要 [Apollo Kernel](https://github.com/ApolloAuto/apollo-kernel). 强烈建议安装预编译内核。
##### 使用预编译的 Apollo 内核
你可以依照如下步骤获取、安装预编译的内核。
1. 从realease文件夹下载发布的包
```
https://github.com/ApolloAuto/apollo-kernel/releases
```
2. 安装内核
下载完release安装包以后:
```
tar zxvf linux-4.4.32-apollo-1.0.0.tar.gz
cd install
sudo bash install_kernel.sh
```
3. 使用 `reboot`命令重启系统;
4. 根据[ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)编译ESD CAN驱动器源代码
##### 构建你自己的内核
如果内核被改动过,或预编译内核不是你最佳的平台,你可以通过如下方法构建你自己的内核:
1. 从代码仓库克隆代码:
```
git clone https://github.com/ApolloAuto/apollo-kernel.git
cd apollo-kernel
```
2. 根据 [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)添加 ESD CAN 驱动源代码。
3. 按照如下指令编译:
```
bash build.sh
```
4. 使用同样的方式安装内核。
#### 安装 NVIDIA GPU 驱动
车辆中的Apollo运行需要[NVIDIA GPU 驱动](http://www.nvidia.com/download/driverResults.aspx/114708/en-us)。您必须安装具有特定选项的NVIDIA GPU驱动程序。
1. 下载安装文件
```
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/375.39/NVIDIA-Linux-x86_64-375.39.run
```
2. 开始安装
```
sudo bash ./NVIDIA-Linux-x86_64-375.39.run --no-x-check -a -s --no-kernel-module
```
##### 可选:测试ESD CAN设备端
在重启有新内核的IPC以后:
a. 使用以下指令创建CAN硬件节点:
```shell
cd /dev; sudo mknod –-mode=a+rw can0 c 52 0
```
b. 使用从ESD Electronics获取到得的ESD CAN软件包的一部分的测试程序来测试CAN设备节点。
至此,IPC就可以被装载到车辆上了。
## 上车安装
执行以下任务:
- 根据先决条件列表中的所述,对车辆进行必要的修改
- 安装主要的组件:Install the major components:
- GPS 天线
- IPC
- GPS 接收器
- LiDAR
- 摄像头
- 雷达
### 前提条件
**WARNING**: 在将主要部件(GPS天线,IPC和GPS接收器)安装在车辆之前,必须按照先决条件列表所述执行必要修改。 列表中所述强制性更改的部分,不属于本文档的范围。
安装的前提条件如下:
- 车辆必须由专业服务公司修改为“线控”技术。 此外,必须在要安装IPC的中继线上提供CAN接口连接。
- 必须在后备箱中安装电源插板,为IPC和GPS-IMU提供电源。电源插板还需要服务于车上的其他硬件,比如4G的路由器。电源插板应连接到车辆的电源系统。
- 必须安装定制的机架,将GPS-IMU天线安装在车辆的顶部。
- 必须安装定制的机架,以便将GPS-IMU安装在后背箱中。
- 必须将4G LTE路由器安装在后备箱中才能为IPC提供Internet访问。路由器必须具有内置Wi-Fi接入点(AP)功能,以连接到其他设备(如iPad),以与自主驾驶(AD)系统相连接。例如,用户将能够使用移动设备来启动AD模式或监视AD状态。
### 主要部件安装图
以下两图显示车辆上应安装三个主要组件(GPS天线,IPC,GPS接收机和LiDAR)的位置: 示例图:

车辆与后备箱侧视图

车辆与后备箱后视图
### 安装GPS的接收器和天线
以下组件 **二选一**:
- **选项 1:** GPS-IMU: **NovAtel SPAN-IGM-A1**
- **选项 2:** GPS-IMU: **NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1**
#### 选项1:安装NovAtel SPAN-IGM-A1
安装说明描述了安装,连接和采取GPS-IMU NovAtel SPAN-IGM-A1的杠杆臂测量的过程。
##### 安装
可以将GPS-IMU NovAtel SPAN-IGM-A1放置在车辆的大部分地方,但建议您遵循以下建议:
- 将NovAtel SPAN-IGM-A1放置并固定在后备箱内,Y轴指向前方。
- 将NovAtel GPS-703-GGG-HV天线安装在位于车辆顶部的视野范围内。
##### 接线
您必须连接的两根电缆:
- 天线电缆 - 将GNSS天线连接到SPAN-IGM-A1的天线端口
- 主电缆:
- 将其15针端连接到SPAN-IGM-A1
- 将其电源线连接到10至30V直流电源
- 将其串行端口连接到IPC。如果电源来自车载电池,请添加辅助电池(推荐)。

主电缆连接
更多信息参见 *SPAN-IGM™ 快速入门指南*, 第三页, 详细图:
SPAN-IGM™ 快速入门指南
[http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf)
##### 采取杠杆臂测量
当SPAN-IGM-A1和GPS天线就位时,必须测量从SPAN-IGM-A1到GPS天线的距离。 该距离标识为:X偏移,Y偏移和Z偏移。
偏移误差必须在1厘米以内才能实现高精度。 有关详细信息,请参阅 * SPAN-IGM™快速入门指南*,第5页,详细图。
更多有关SPAN-IGM-A1的信息参见:
SPAN-IGM™ 用户手册:
[http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf](http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf)
#### 选项2:NovAtel SPAN® ProPak6™ 和 NovAtel IMU-IGM-A1
安装说明描述了安装,连接和采取GPS NovAtelSPAN®ProPak6™**和** NovAtel IMU-IGM-A1的杠杆臂测量的步骤。
##### 组件
安装所需的组件包括:
- NovAtel GPS SPAN ProPak6
- NovAtel IMU-IGM-A1
- NovAtel GPS-703-GGG-HV天线
- NovAtel GPS-C006电缆(将天线连接到GPS)
- NovAtel 01019014主电缆(将GPS连接到IPC的串行端口)
- 数据传输单元(DTU) - 类似于4G路由器
- 磁性适配器(用于天线和DTU)
- DB9直通电缆
##### 安装
你可以将 ProPak6 和 IMU 放置在车辆以下建议的位置:
- 将ProPak6和IMU并排固定在行李箱内,Y轴指向前方。
- 将NovAtel GPS-703-GGG-HV天线安装在车辆顶部或后备箱盖顶部,如图所示:

- 使用磁性适配器将天线紧固到后备箱盖上。
- 通过打开后备箱并将电缆放置在后备箱中,将天线也安装在后备箱中。
##### 接线
按照以下步骤将ProPak6 GNSS接收器和IMU连接到Apollo系统:
1. 使用IMU-IGM-A1附带的分接电缆连接IMU主端口和ProPak6 COM3/IMU端口。
2. 使用USB-MicroUSB转换线,连接IPC的USB端口和ProPak6的MicroUSB端口。
3. 将IMU-IGM-A1分离电缆的另一端连接到车辆电源。
4. 将GNSS天线连接到Propak6。
5. 连接Propak6电源线。

更多有关 NovAtel SPAN ProPak6的信息, 参见:
NovAtel ProPak6安装操作手册:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
### 安装激光雷达(LiDAR)
本部分描述了安装HDL-64E S3 LiDAR的步骤。
#### 安装
您需要一种定制的特定安装结构来成功地将HDL-64E S3激光雷达安装在车辆的顶部。这种结构必须向激光雷达系统提供刚性支撑,同时将激光雷达提高到地面以上的一定高度。这个高度避免了激光雷达的激光束被车辆的前部以及后部阻挡。激光雷达所需的实际高度取决于车辆的设计和激光雷达相对于车辆的安装点。激光器的垂直倾角通常与视距为2~24.8度。为了充分利用探测范围,在林肯MKZ上,建议将激光雷达安装在1.8米(从地面到激光雷达的底部)的最小高度。
#### 接线
每个HDL-64E S3 激光雷达包括一个将LiDAR连接到电源的电缆组件,计算机(用于数据传输的以太网和用于LiDAR配置的串行端口)和GPS时间同步源。

1. 连接到LiDAR
将电源和信号电缆连接到LiDAR上的匹配端口

2. 连接到电源
两根AWG 16线为HDL-64E S3提供所需电力。 所需电压/电流:12V/3A。 要连接电源,请与电线完全接触并拧紧螺丝。

3. 连接到IPC
与IPC的连接是通过以太网线。将电缆束中的以太网线水晶头插入IPC上的以太网端口。
4. 连接到 GPS:
HDL64E S3 推荐最小特定GPS/传输数据(GPRMC)和每秒脉冲(PPS)信号与GPS时间同步。需要定制连接来建立GPS接收机和LiDAR之间的通信:
>HDL64E S3 LiDAR requires the Recommended minimum specific GPS/Transit data (GPRMC) and pulse per second (PPS)signal to synchronize to the GPS time.
a. SPAN-IGM-A1
如果您配置了[配置GPS和IMU](#配置gps和imu)中指定的SPAN-IGM-A1,GPRMC信号将通过用户端口电缆从主端口从GPS接收器发送。 PPS信号通过Aux端口上标有“PPS”和“PPS dgnd”的电缆发送。 下图中的虚线框是HDL64E S3 LiDAR和SPAN-IGM-A1 GPS接收机附带的可用连接。 剩余的连接需要由用户进行。

b. Propak 6 和 IMU-IGM-A1
如果您配置了[配置GPS和IMU](#configuration-the-gps-and-imu)中指定的Propak 6,GPRMC信号将通过COM2端口从GPS接收器发送。PPS信号通过IO端口发送。
下图中的虚线框是HDL-64E S3 LiDAR和Propak 6 GPS接收机附带的可用连接。 剩余的连接需要由用户进行。

5. 通过串口连接进行LiDAR配置
一些低级的参数可以通过串口进行配置。
在Velodyne提供的电缆束内,有两对红色/黑色电缆,如下表所示。 较厚的一对(AWG 16)用于为LiDAR系统供电。 较薄的一对用于串行连接。 将黑线(串行输入)连接到RX,将红线连接到串行电缆的地线。 将串行电缆与USB串行适配器连接至所选择的计算机。

#### 配置
默认情况下,HDL-64E S3的网络IP地址设置为192.168.0.1。 但是,当我们配置Apollo时,我们应该将网络IP地址改为192.168.20.13。 可以使用终端应用程序Terminalite 3.2,进入网络设置命令。可以按照以下步骤配置HDL-64E S3的IP地址:
1. 将串行电缆的一面连接到笔记本电脑
2. 将串行电缆的另一端连接到HDL-64E S3的串行线
3. COM 端口默认程序
Baudrate: 9600
Parity: None
Data bits: 8
Stop bits: 1
4. COM端口程序,从如下链接下载 Termite3.2 并安装
[http://www.compuphase.com/software_termite.htm](http://www.compuphase.com/software_termite.htm)
5. HDL-64E S3和笔记本电脑之间的COM端口连接

6. 在笔记本运行 **Termite 3.2**
7. 发出串行命令,通过串口“\#HDLIPA192168020013192168020255”设置HDL-64E S3的IP地址
8. 本机必须重新上电才能采用新的IP地址

HDL-64E S3 手册可见:
[http://velodynelidar.com/hdl-64e.html](http://velodynelidar.com/hdl-64e.html)
#### 安装 VLP-16 lidar (可选)
Apollo 2.5的地图制作服务已经向公众开放。为了获得地图创建所需的数据,需要在车辆上安装附加的VLP-16激光雷达。LiDAR的目的是收集HDL-64 S3 激光雷达FOV上方的物体的点云信息,例如交通信号灯和标志。它需要一个定制的机架安装VLP-16激光雷达在车辆顶部。下图显示了可以选择的配置之一。
In this specific configuration, the VLP-16 LiDAR is mounted with an upward tilt of 20±2°. The power cable of the VLP-16 is connected to the DataSpeed power panel. The ethernet connection is connected to the IPC (possibly through an ethernet switch). Similar to HDL-64 S3 LiDAR, the VLP-16 GPRMC and PPS input from the GPS receiver. Ideally, additional hardware should be installed to duplicate the GPRMC and PPS signal from the GPS receiver send to HDL-64 and VLP-16 respectively. However, a simple Y-split cable may also provide adequate signal for both LiDAR's. To distingush from the HDL-64 S3 LiDAR, please follow the VLP-16 manual and use the webpage interface to configure the IP of VLP-16 to 192.168.20.14, the data port to 2369, and the telemetry port to 8309. The pinout for the signal input from GPS receiver can also be found in the manual if you need customized cable.
VLP-16 Manual can be found on this webpage:
[http://velodynelidar.com/vlp-16.html](http://velodynelidar.com/vlp-16.htmll)
### 安装摄像头
本部分描述了安装摄像头的过程。
Apollo参考设计建议使用三个不同焦距的摄像头:两个6毫米镜头,一个25毫米镜头。这三个摄像头的摆放位置非常灵活,它们可以放置在LiDAR的旁边或前车窗的里。摄像机的安装可以为系统的实际设计量身定做。
- 这两个摄像机都应该朝着前进方向。视场(FOV)应尽量远离障碍物。
- 
- 25毫米焦距的照相机应该向上倾斜大约两度。调整后,25毫米相机应该能够观察到100米外有红路灯的交叉路口的停车线。
- 新出厂的摄像头的镜片不在最好的聚焦位置。通过调整镜片的焦距来找到正确的位置,找到远处目标物体的清晰图像。一个好的图像目标是交通标志或街道标志内的FOV。调整焦点后,使用锁紧螺丝来固定镜头的位置。

- 使用USB 3.0连接相机(USB 3.0 Micro-B)和IPC(USB 3.0 type A),并用螺钉来加固连接。
### 安装雷达
本部分介绍了Continental雷达的安装过程。
雷达需要一个匹配的机械机架安装在前保险杠上。安装后,要求雷达朝向驱动方向,稍微向上倾斜不超过2度。

带有雷达的电缆需要被路由到汽车的后部,并连接到ESD CAN卡的CAN1信道。
#### 安装IPC
步骤如下:
1. 使用电压转换器/调节器,将车辆的12 VDC输出转换为所需的电压。根据Neousys的建议,使用12 VDC至19 VDC转换器,最大输出电流为20 A.

a. 首先,将两条19 VDC输出线连接到IPC的电源连接器(绿色如下图所示)。

b. 将12 VDC输入的两条电缆连接到车辆的电源面板。 如果导线的尺寸太厚,则电线应分开成几根线,并分别连接到相应的端口。
这一步非常有必要。 如果输入电压低于所需极限。 很可能导致系统故障。
2. 将板载计算机系统6108GC放在后备箱内(推荐)。
例如,Apollo 2.5使用4x4螺钉将6108GC螺栓固定在后备箱的箱板上。 
3. 安装IPC,使其前后两侧(所有端口位于)面对右侧(乘客)或左侧(驱动器)的主干。
这种定位使得连接所有电缆更容易。
有关更多信息,请参见:
Neousys Nuvo-6108GC – 手册:
**[链接暂不可用]**
4. 连接所有电缆,其中包括:
- 电力电缆
- 控制器局域网(CAN)电缆
- 从4G路由器到IPC的以太网电缆
- 监视器、键盘、鼠标(可选)
a. 将电源线连接到工控机(如图所示):
b. 将电源线的另一端连接到车辆电池(如图所示):

c. 连接DB9电缆工控机和可(如图所示):

d. 连接:
- 从4G路由器到IPC的以太网电缆
- IPC的GPS接收器
- 监视器(可选):

#### 杠杆臂测量
步骤如下:
1. 在接受测量之前,打开IPC。
2. 当IMU和GPS天线就位时,必须测量从IMU到GPS天线的距离。距离测量应为:X偏移,Y偏移,和Z偏移。偏移误差必须在一厘米以内,以达到定位和定位的高精度。
更多信息,参见:
NovAtel ProPak6 安装与操作手册:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel SPAN-IGM-A1 产品主页:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
#### 配置GPS、IMU
GPS 和IMU 配置如下:
```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew
log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15
log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged
SAVECONFIG
```
ProPak6配置如下:
```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
CONNECTIMU COM3 IMU_ADIS16488
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew
log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15
log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged
SAVECONFIG
```
**WARNING:** 基于真实的测量值(GPS天线、IMU的偏移量)修改 **<u>SETIMUTOANTOFFSE</u>T** 行。
示例:
```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```
# 建立网络
本节提供了一种建立网络的建议。
运行Apollo软件的IPC必须访问互联网获取实时运动学(RTK)数据,以便精确定位。移动设备还需要连接到IPC来运行Apollo软件。
## 推荐配置
建议您根据下图设置网络:

步骤如下:
- 安装并配置4G网络,
- 通过以太网线连接IPC到路由器
- 配置路由器使用LTE蜂窝网络接入互联网
- 配置LTE路由器的AP功能,使iPad Pro或其他移动设备可以连接到路由器,然后连接到IPC。
建议您配置一个固定的IP,而不是在IPC上使用DHCP,以使它更容易从移动终端被连接。
# 额外任务
需要使用自己提供的组件来执行以下任务:
- 使用DVI或HDMI电缆连接显示器,并连接键盘和鼠标,以便在现场的汽车上执行调试任务。
- 在Apple iPad Pro上建立Wi-Fi连接,以访问HMI并控制IPC上运行的Apollo ADS。
# 下一步
完成硬件部分的安装之后,可以参考快速入门的教程 [Apollo Quick Start](../../../02_Quick%20Start/apollo_2_5_quick_start_cn.md)完成软件部分的安装。
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/硬件安装hardware installation/apollo_3_5_hardware_system_installation_guide.md
|
# Apollo 3.5 Hardware and System Installation Guide
- [Apollo 3.5 Hardware and System Installation Guide](#apollo-35-hardware-and-system-installation-guide)
- [About This Guide](#about-this-guide)
- [Document Conventions](#document-conventions)
- [Introduction](#introduction)
- [Documentation](#documentation)
- [Key Hardware Components](#key-hardware-components)
- [Additional Components Required](#additional-components-required)
- [Steps for the Installation Tasks](#steps-for-the-installation-tasks)
- [At the Office](#at-the-office)
- [In the Vehicle](#in-the-vehicle)
- [Prerequisites](#prerequisites)
- [Diagrams of the Major Component Installations](#diagrams-of-the-major-component-installations)
- [Additional Tasks Required](#additional-tasks-required)
- [Time Sync Script Setup [Optional]](#time-sync-script-setup-optional)
- [Next Steps](#next-steps)
## About This Guide
The _Apollo master Hardware and System Installation Guide_ provides the
instructions to install all of the hardware components and system software for
the **Apollo Project**. The system installation information included pertains to
the procedures to download and install the Apollo Linux Kernel.
### Document Conventions
The following table lists the conventions that are used in this document:
| **Icon** | **Description** |
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **Bold** | Emphasis |
| `Mono-space font` | Code, typed data |
| _Italic_ | Titles of documents, sections, and headings Terms used |
|  | **Info** Contains information that might be useful. Ignoring the Info icon has no negative consequences. |
|  | **Tip**. Includes helpful hints or a shortcut that might assist you in completing a task. |
|  | **Online**. Provides a link to a particular web site where you can get more information. |
|  | **Warning**. Contains information that must **not** be ignored or you risk failure when you perform a certain task or step. |
## Introduction
The **Apollo Project** is an initiative that provides an open, complete, and
reliable software platform for Apollo partners in the automotive and autonomous
driving industries. The aim of this project is to enable these entities to
develop their own self-driving systems based on the Apollo software stack.
### Documentation
The following set of documentation describes Apollo 3.0:
- **_</u>[Apollo Hardware and System Installation Guide]</u>_** ─ Links to the
Hardware Development Platform Documentation in Specs
- **Vehicle**:
- [Industrial PC (IPC)](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/IPC/Nuvo-6108GC_Installation_Guide.md)
- [Global Positioning System (GPS)](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Navigation/README.md)
- [Inertial Measurement Unit (IMU)](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Navigation/README.md)
- Controller Area Network (CAN) card
- GPS Antenna
- GPS Receiver
- [Light Detection and Ranging System (LiDAR)](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Lidar/README.md)
- [Camera](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Camera/README.md)
- [Radar](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Radar/README.md)
- [Apollo Sensor Unit (ASU)](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Apollo_Sensor_Unit/Apollo_Sensor_Unit_Installation_Guide.md)
- Apollo Extension Unit (AXU)
- **Software**: Refer to the
[Software Installation Guide](../../../01_Installation%20Instructions/apollo_software_installation_guide.md)
for information on the following:
- Ubuntu Linux
- Apollo Linux Kernel
- NVIDIA GPU Driver
- **_</u>[Apollo Quick Start Guide]</u>_** ─ The combination of a tutorial and a
roadmap that provides the complete set of end-to-end instructions. The Quick
Start Guide also provides links to additional documents that describe the
conversion of a regular car to an autonomous-driving vehicle.
## Key Hardware Components
The key hardware components to install include:
- Onboard computer system ─ Neousys Nuvo-6108GC (2)
- Controller Area Network (CAN) Card ─ ESD CAN-PCIe/402-B4
- Global Positioning System (GPS) and Inertial Measurement Unit (IMU) ─ You can
select one of the following options:
- NovAtel SPAN-IGM-A1
- NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
- NovAtel SPAN® PwrPak7™
- Navtech NV-GI120
- Light Detection and Ranging System (LiDAR) ─ You can select one of the
following options, please note Apollo master uses VLS-128 LiDAR:
- [Velodyne VLS-128](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installationLidar/VLS_128_Installation_Guide.md)
- Velodyne HDL-64E S3
- Velodyne Puck series
- Innovusion LiDAR
- Hesai's Pandora
- Cameras — You can select one of the following options:
- Leopard Imaging LI-USB30-AR023ZWDR with USB 3.0 case
- Argus Camera (FPD-Link)
- Wissen Camera
- Radar — You can select one of the following options:
- Continental ARS408-21
- Racobit B01HC
### Additional Components Required
You need to provide these additional components for the Additional Tasks
Required:
- Apollo Sensor Unit (ASU)
- Apollo Extension Unit (AXU)
- A 4G router for Internet access
- A USB hub for extra USB ports
- A monitor, keyboard, and mouse for debugging at the car onsite
- Cables: a Digital Visual Interface (DVI) cable (optional), a customized cable
for GPS-LiDAR time synchronization
- Apple iPad Pro: 9.7-inch, Wi-Fi (optional)
The features of the key hardware components are presented in the subsequent
sections.
## Steps for the Installation Tasks
This section describes the steps to install:
- The key hardware and software components
- The hardware in the vehicle
### At the Office
Perform the following tasks:
- Prepare the IPC:
- Install the CAN card
- Install or replace the hard drive
- Prepare the IPC for powering up
- Install the software for the IPC:
- Ubuntu Linux
- Apollo Kernel
- Nvidia GPU Driver
The IPC is now ready to be mounted on the vehicle.
### In the Vehicle
Perform these tasks:
- Make the necessary modifications to the vehicle as specified in the list of
prerequisites
- Install the major components:
- GPS Antenna
- IPC
- GPS Receiver and IMU
- LiDAR
- Cameras
- Radar
#### Prerequisites
**WARNING**: Prior to mounting the major
components (GPS Antenna, IPC, and GPS Receiver) in the vehicle, perform certain
modifications as specified in the list of prerequisites. The instructions for
making the mandatory changes in the list are outside the scope of this document.
The list of prerequisites are as follows:
- The vehicle must be modified for “drive-by-wire” technology by a professional
service company. Also, a CAN interface hookup must be provided in the trunk
where the IPC will be mounted.
- A power panel must be installed in the trunk to provide power to the IPC and
the GPS-IMU. The power panel would also service other devices in the vehicle
such as a 4G LTE router. The power panel should be hooked up to the power
system in the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU Antenna, the cameras
and the LiDAR's on top of the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU in the trunk.
- A custom-made rack must be installed in front of the vehicle to mount the
front-facing radar.
- A 4G LTE router must be mounted in the trunk to provide Internet access for
the IPC. The router must have built-in Wi-Fi access point (AP) capability to
connect to other devices, such as an iPad, to interface with the autonomous
driving (AD) system. A user would be able to use the mobile device to start AD
mode or monitor AD status, for example.
#### Diagrams of the Major Component Installations
The following two diagrams indicate the locations of where the three major
components (GPS Antenna, IPC, GPS Receiver and LiDAR) should be installed on the
vehicle:


## Additional Tasks Required
Use the components that you were required to provide to perform the following
tasks:
1. Connect a monitor using the DVI or the HDMI cables and connect the keyboard
and mouse to perform debugging tasks at the car onsite.
2. Establish a Wi-Fi connection on the Apple iPad Pro to access the HMI and
control the Apollo ADS that is running on the IPC.
## Time Sync Script Setup [Optional]
In order to sync the computer time with NTP servers on the internet, you could
use the
[Time Sync script](https://github.com/ApolloAuto/apollo/blob/master/scripts/time_sync.sh)
## Next Steps
After you complete the hardware installation in the vehicle, see the
[Apollo Quick Start](../../../02_Quick%20Start/apollo_3_5_quick_start.md) for the steps to complete the
software installation.
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/硬件安装hardware installation/apollo_2_0_hardware_system_installation_guide_v1_cn.md
|
# Apollo 2.0 Hardware and System Installation Guide
- [关于本篇指南](#关于本篇指南)
- [文档编写规则](#文档编写规则)
- [引言](#引言)
- [文档说明](#文档说明)
- [核心硬件](#核心硬件)
- [附加组件](#附加组件)
- [车载计算机系统 - IPC](#车载计算机系统---ipc)
- [IPC的配置](#ipc的配置)
- [IPC前后视图](#ipc前后视图)
- [控制器局域网络(CAN)卡](#控制器局域网络can卡)
- [全球定位系统(GPS)和惯性测量装置(IMU)](#全球定位系统gps和惯性测量装置imu)
- [选项1: NovAtel SPAN-IGM-A1](#选项1-novatel-span-igm-a1)
- [选项2: NovAtel SPAN ProPak6和NovAtel IMU-IGM-A1](#选项2-novatel-span-propak6和novatel-imu-igm-a1)
- [GPS接收器和天线](#gps接收器和天线)
- [激光雷达(LiDAR)](#激光雷达lidar)
- [选项 1: Velodyne HDL-64E S3](#选项-1-velodyne-hdl-64e-s3)
- [选项 2: Hesai Pandora](#选项-2-hesai-pandora)
- [摄像头](#摄像头)
- [雷达](#雷达)
- [安装任务概览](#安装任务概览)
- [安装任务步骤](#安装任务步骤)
- [上车前的准备工作](#上车前的准备工作)
- [IPC的准备工作](#ipc的准备工作)
- [为IPC安装软件](#为ipc安装软件)
- [上车安装](#上车安装)
- [前提条件](#前提条件)
- [主要部件安装图](#主要部件安装图)
- [安装GPS的接收器和天线](#安装gps的接收器和天线)
- [选项1:安装NovAtel SPAN-IGM-A1](#选项1安装novatel-span-igm-a1)
- [选项2: NovAtel SPAN ProPak6和NovAtel IMU-IGM-A1](#选项2-novatel-span-propak6和novatel-imu-igm-a1)
- [安装激光雷达(LiDAR) (LiDAR)](#安装激光雷达lidar-lidar)
- [选项 1: 安装 Velodyne HDL-64E S3](#选项-1-安装-velodyne-hdl-64e-s3)
- [选项 2: 安装 Hesai Pandora](#选项-2-安装-hesai-pandora)
- [安装摄像头](#安装摄像头)
- [安装雷达](#安装雷达)
- [建立网络](#建立网络)
- [推荐配置](#推荐配置)
- [额外任务](#额外任务)
- [下一步](#下一步)
# 关于本篇指南
本篇指南提供了所有 **Apollo项目**需要的的安装硬件部分和软件系统教程。系统安装信息包括下载和安装Apollo Linux内核的过程。
## 文档编写规则
下表列出了本文使用的编写规则:
| **图标** | **描述** |
| ----------------------------------- | ---------------------------------------- |
| **加粗** | 强调。 |
| `Mono-space 字体` | 代码, 类型数据。 |
| _斜体_ | 文件、段落和标题中术语的用法。 |
|  | **信息** 提供了可能有用的信息。忽略此信息可能会产生不可预知的后果。 |
|  | **提醒** 包含有用的提示或者可以帮助你完成安装的快捷步骤。 |
|  | **在线** 提供指向特定网站的链接,您可以在其中获取更多信息。 |
|  | **警告** 包含 **不能** 被忽略的内容,如果忽略,当前安装步骤可能会失败。 |
# 引言
**Apollo项目**旨在为汽车和自动驾驶行业的合作伙伴提供开放,完整和可靠的软件平台。该项目的目的是使这些企业能够开发基于Apollo软件栈的自动驾驶系统。
## 文档说明
以下文档适用于Apollo 2.0:
- ***<u>[Apollo Hardware and System Installation Guide]</u>*** ─ 提供用于安装车辆的硬件部件和系统软件的教程:
- **车辆**:
- 工业用计算机 (IPC)
- 全球定位系统 (GPS)
- 惯性测量单元 (IMU)
- 控制器局域网络 (CAN) 卡
- GPS 天线
- GPS 接收器
- 安装激光雷达 (LiDAR)
- 摄像头
- 雷达
- **软件**:
- Ubuntu Linux 操作系统
- Apollo Linux 内核
- Nvidia GPU 驱动
- ***<u>[Apollo Quick Start Guide]</u>*** ─ 文档和产品蓝图提供了完整的端到端教程。本文还提供了一些其它链接用于将一辆普通汽车改装成一辆自动驾驶车辆。
# 核心硬件
需要安装的关键的硬件组件包括:
- 车载计算机系统 ─ Neousys Nuvo-6108GC
- CAN卡 ─ ESD CAN-PCIe/402-B4
- 全球定位系统(GPS)和惯性测量装置(IMU) ─ 您可从如下选项中任选其一:
- NovAtel SPN-IGM-A1
- NovAtel SPAN® ProPak6™ 和 NovAtel IMU-IGM-A1
- 安装激光雷达 (LiDAR) ─ 您可从如下选项中任选其一:
- Velodyne HDL-64E S3
- Hesai Pandora
- 摄像头 — 带 USB 3.0 接口的Leopard Imaging LI-USB30-AR023ZWDR
- 雷达 — Continental ARS408-21
## 附加组件
- 提供网络接入的4G路由器
- 提供额外USB接口的USB集线器
- 供在车辆现场调试使用的显示器,键盘,鼠标
- 连接线:数字可视接口(DVI)线(可选),用于GPS和LiDAR时间同步的定制线
- 苹果iPad Pro:9.7寸, WiFi(可选)
关键硬件组件的特性将在后续部分中介绍。
## 车载计算机系统 - IPC
车载计算机系统是用于自动驾驶车辆的工业PC(IPC),并使用由第六代Intel Xeon E3 1275 V5 CPU强力驱动的 **NeousysNuvo-6108GC**。
Neousys Nuvo-6108GC是自动驾驶系统(ADS)的中心单元。
### IPC的配置
IPC配置如下:
- ASUS GTX1080 GPU-A8G-Gaming GPU Card
- 32GB DDR4 RAM
- PO-280W-OW 280W 交流、直流电源适配器
- 2.5" SATA 硬盘 1TB 7200rpm
### IPC前后视图
安装了GPU的IPC前后视图如下:
Nuvo-6108GC的前视图:

Nuvo-6108GC的侧视图:

想要了解更多有关 Nuvo-6108GC的资料, 请参考:

Neousys Nuvo-6108GC 产品页:
[http://www.neousys-tech.com/en/product/application/rugged-embedded/nuvo-6108gc-gpu-computing](http://www.neousys-tech.com/en/product/application/rugged-embedded/nuvo-6108gc-gpu-computing)

Neousys Nuvo-6108GC 手册:还不可用。
## 控制器局域网络(CAN)卡
IPC中使用的CAN卡型号为 **ESD** **CAN-PCIe/402-B4**.

想要了解更多有关CAN-PCIe/402-B4的资料, 请参考:
 ESD CAN-PCIe/402 产品主页:
[https://esd.eu/en/products/can-pcie402](https://esd.eu/en/products/can-pcie402)
## 全球定位系统(GPS)和惯性测量装置(IMU)
有 **两种** GPS-IMU的 **可选方案**,您只需根据您的需求进行选择:
- 选项1:NovAtel SPAN-IGM-A1
- 选项2:NovAtel SPAN® ProPak6™ 和 NovAtel IMU-IGM-A1
### 选项1: NovAtel SPAN-IGM-A1
NovAtel SPAN-IGM-A1 是一个集成的,单盒的解决方案,提供紧密耦合的全球导航卫星系统(GNSS)定位和具有NovAtel OEM615接收机的惯性导航功能。

想要了解更多有关NovAtel SPAN-IGM-A1的资料, 请参考:
 NovAtel SPAN-IGM-A1 产品页:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
### 选项2: NovAtel SPAN ProPak6和NovAtel IMU-IGM-A1
NovAtel ProPak6是独立的GNSS接收机,它与NovAtel提供的独立IMU(本例中为NovAtel IMU-IGM-A1)相融合以提供定位。
ProPak6提供由NovAtel生产的最新最先进的外壳产品。
IMU-IGM-A1是与支持SPAN的GNSS接收器(如SPAN ProPak6)配对的IMU。

想要了解更多有关NovAtel SPAN ProPak6 and the IMU-IGM-A1, 请参考:
 NovAtel ProPak6 安装操作手册
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel IMU-IGM-A1 产品页:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview](https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview)
## GPS接收器和天线
GPS-IMU组件的GPS接收器、天线使用的是 **NovAtel GPS-703-GGG-HV**。
**注意:** GPS NovAtelGPS-703-GGG-HV与上文中提到的两个GPS-IMU选项的任一型号配合使用。

更多关于 NovAtel GPS-703-GGG-HV的信息,请参考:
 NovAtel GPS-703-GGG-HV 产品页:
[https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/](https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/)
## 激光雷达(LiDAR)
有 **两种** GPS-IMU的 **可选方案** ,您可根据需求选择最适合您的方案:
- **选项 1: Velodyne HDL-64E S3**
- **选项 2: Hesai Pandora**
### 选项 1: Velodyne HDL-64E S3
使用来自Velodyne激光雷达公司的64线激光雷达系统**HDL-64E S3**。

**主要特点:**
- 线数:64
- 探测距离:120m
- 220万点每秒
- 水平视场角:360°
- 垂直视场角:26.9°
- 水平角分辨率:0.08°(方位角)
- 精度:<2cm
- 垂直角分辨率: ~0.4°
- 用户可选帧速率
- 坚固耐用
Webpage for Velodyne HDL-64E S3:
[http://velodynelidar.com/hdl-64e.html](http://velodynelidar.com/hdl-64e.html)
### 选项 2: Hesai Pandora
使用来自Hesai Photonics科技有限公司的潘多拉40线激光雷达系统。

**主要特点:**
- 线数:40
- 探测距离:200米 (20% 反射率)
- 测量频率:720 kHz
- 水平视场角:360°
- 垂直视场角:23° (-16° to 7°)
- 水平角分辨率:0.2° (方位角)
- 精度:<2cm
- 垂直角分辨率: 0.33° (-6°到+2°范围);1° (-16°到-6°,+2°到+7°范围)
- 用户可选帧速率
- 可由4个单摄像机提供360°环绕视野,由1个彩色摄像机提供长距离前视图
 Hesai Pandora的官网:
[http://www.hesaitech.com/pandora.html](http://www.hesaitech.com/pandora.html)
## 摄像头
所使用的相机是Leopard Imaging公司制造的标准USB 3.0接口的LI-USB30-AR023ZWDR,我们建议分别使用6毫米和25毫米镜头的两个相机来实现所需的性能。

您可以从 Leopard Imaging公司的官网上获得更多信息:
[https://www.leopardimaging.com/LI-USB30-AR230WDR.html](https://www.leopardimaging.com/LI-USB30-AR230WDR.html)
## 雷达
所用雷达是Continental集团制造的ARS408-21。

您可以在产品页上找到更多信息:
[https://www.continental-automotive.com/Landing-Pages/Industrial-Sensors/Products/ARS-408-21](https://www.continental-automotive.com/Landing-Pages/Industrial-Sensors/Products/ARS-408-21)
# 安装任务概览
安装硬件和软件组件涉及以下任务:
**室内:**
1. 在将CAN卡插入插槽之前,先重新定位CAN卡终端跳线。
准备IPC:
- 检查图形处理单元(GPU)磁带,以确定是否需要卸下GPU卡(如果已预安装)
- 在将卡插入插槽之前,首先重新定位CAN卡端接跳线,准备并安装控制器局域网(CAN)卡。
2. 如果未预装硬盘,请先在IPC安装硬盘
您也可以选择更换预装的硬盘。
**推荐**:
- 为了更好的可靠性,安装固态硬盘(SSD);
- 如果需要收集驾驶数据,需要使用大容量硬盘;
3. 准备IPC加电:
a. 将电源线连接到电源连接器(接线端子)
b. 将显示器,以太网,键盘和鼠标连接到IPC
c. 将IPC连接到电源
4. 在IPC安装软件(需要部分Linux经验):
a. 安装Ubuntu Linux.
b. 安装Apollo Linux 内核.
**上车安装:**
- 确保所有在前提条件中列出的对车辆的修改,都已执行。
- 安装主要的组件:
- GPS 天线
- IPC
- GPS 接收器和 IMU
- LiDAR
- 摄像头
- 雷达
安装所有硬件和软件组件的实际步骤详见安装任务步骤。
# 安装任务步骤
该部分包含:
- 核心硬件和软件的安装
- 车辆硬件的安装
## 上车前的准备工作
- 准备IPC:
- 安装CAN卡
- 安装或者替换硬盘
- 准备为IPC供电
- 为IPC安装软件:
- Ubuntu Linux
- Apollo内核
- Nvidia GPU 驱动
### IPC的准备工作
有如下步骤:
1. 准备安装CAN卡:在Neousys Nuvo-6108GC中,ASUS®GTX-1080GPU-A8G-GAMING GPU卡预先安装占用了一个PCI插槽,将CAN卡安装到剩余两个PCI插槽其一即可。
a. 找到并拧下计算机侧面的八个螺丝(棕色方块所示或棕色箭头指示):

b. 从IPC上拆下盖子。基座有3个PCI插槽(由显卡占据一个):


c. 通过从其默认位置移除红色跳线帽(以黄色圆圈显示)并将其放置在其终止位置,设置CAN卡端接跳线:

**WARNING**: 如果端接跳线设置不正确,CAN卡将无法正常工作。
d. 将CAN卡插入IPC的插槽:

e. 安装IPC盖子:

2. 准备IPC启动:
a. 将电源线连接到IPC的电源连接器(接线端子):
**WARNING**: 确保电源线的正极(红色用 **R**表示)和负极(黑色用 **B**表示)正确的插入电源端子块上的插孔中。

b. 连接显示器,以太网线,键盘和鼠标到IPC上:
3. 
如果有一张或多张卡已经加入进系统里,推荐您将风扇速度通过BIOS配置:
- 当启动电脑时,按F2键进入BIOS设置菜单
- 进入 [Advanced] => [Smart Fan Setting]
- 将 [Fan Max. Trip Temp] 设置为 50
- 将 [Fan Start Trip Temp] 设置为 20
建议您用DVI连接GPU和显示器。以下是在主卡上将DVI端口设置为显示器连接端口的步骤:
- 当启动电脑时,按F2键进入BIOS设置菜单
- 进入 [Advanced]=>[System Agent (SA) Configuration]=>[Graphics Configuration]=>[Primary Display]=> 设置为 "PEG"
推荐您将IPC设置为一直处于最佳性能模式(maximum performance mode):
- 当启动电脑时,按F2键进入BIOS设置菜单
- 进入 [Power] => [SKU POWER CONFIG] => 设置为 "MAX. TDP"
c. 连接电源:

### 为IPC安装软件
这部分主要描述以下的安装步骤:
- Ubuntu Linux
- Apollo 内核
- Nvidia GPU 驱动
您最好具有使用Linux成功安装软件的经验。
#### 安装Ubuntu Linux
步骤如下:
1. 创建一个可以引导启动的Ubantu Linux USB闪存驱动器:
下载Ubuntu(或Xubuntu等分支版本),并按照在线说明创建可引导启动的USB闪存驱动器。
 推荐使用 **Ubuntu 14.04.3**.
开机按 F2 进入 BIOS 设置菜单,建议禁用BIOS中的快速启动和静默启动,以便捕捉引导启动过程中的问题。 建议您在BIOS中禁用“快速启动”和“安静启动”,以便了解启动过程中遇到的问题。
获取更多Ubuntu信息,可访问:
 Ubuntu 桌面站点:
[https://www.ubuntu.com/desktop](https://www.ubuntu.com/desktop)
2. 安装 Ubuntu Linux:
a. 将Ubuntu安装驱动器插入USB端口并启动IPC。
b. 按照屏幕上的说明安装Linux。
3. 执行软件更新与安装:
a. 安装完成,重启进入Linux。
b. 执行软件更新器(Software Updater)更新最新软件包,或在终端执行以下命令完成更新。
```shell
sudo apt-get update;
sudo apt-get upgrade
```
c. 打开终端,输入以下命令,安装Linux 4.4 内核:
```shell
sudo apt-get install linux-generic-lts-xenial
```
IPC必须接入网络以便更新与安装软件,所以请确认网线插入并连接,如果连接网络没有使用动态分配(DHCP),需要更改网络配置。
#### 安装Apollo内核
车上运行Apollo需要 [Apollo Kernel](https://github.com/ApolloAuto/apollo-kernel). 强烈建议安装预编译内核。
##### 使用预编译的 Apollo 内核
你可以依照如下步骤获取、安装预编译的内核。
1. 从realease文件夹下载发布的包
```
https://github.com/ApolloAuto/apollo-kernel/releases
```
2. 安装内核
下载完release安装包以后:
```
tar zxvf linux-4.4.32-apollo-1.0.0.tar.gz
cd install
sudo bash install_kernel.sh
```
3. 使用 `reboot`命令重启系统;
4. 根据[ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)编译ESD CAN驱动器源代码
##### 构建你自己的内核
如果内核被改动过,或预编译内核不是你最佳的平台,你可以通过如下方法构建你自己的内核:
1. 从代码仓库克隆代码:
```
git clone https://github.com/ApolloAuto/apollo-kernel.git
cd apollo-kernel
```
2. 根据 [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)添加 ESD CAN 驱动源代码。
3. 按照如下指令编译:
```
bash build.sh
```
4. 使用同样的方式安装内核。
#### 安装 NVIDIA GPU 驱动
车辆中的Apollo运行需要[NVIDIA GPU 驱动](http://www.nvidia.com/download/driverResults.aspx/114708/en-us)。您必须安装具有特定选项的NVIDIA GPU驱动程序。
1. 下载安装文件
```
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/375.39/NVIDIA-Linux-x86_64-375.39.run
```
2. 开始安装
```
sudo bash ./NVIDIA-Linux-x86_64-375.39.run --no-x-check -a -s --no-kernel-module
```
##### 可选:测试ESD CAN设备端
在重启有新内核的IPC以后:
a. 使用以下指令创建CAN硬件节点:
```shell
cd /dev; sudo mknod –-mode=a+rw can0 c 52 0
```
b. 使用从ESD Electronics获取到得的ESD CAN软件包的一部分的测试程序来测试CAN设备节点。
至此,IPC就可以被装载到车辆上了。
## 上车安装
执行以下任务:
- 根据先决条件列表中的所述,对车辆进行必要的修改
- 安装主要的组件:Install the major components:
- GPS 天线
- IPC
- GPS 接收器
- LiDAR
- 摄像头
- 雷达
### 前提条件
**WARNING**: 在将主要部件(GPS天线,IPC和GPS接收器)安装在车辆之前,必须按照先决条件列表所述执行必要修改。 列表中所述强制性更改的部分,不属于本文档的范围。
安装的前提条件如下:
- 车辆必须由专业服务公司修改为“线控”技术。 此外,必须在要安装IPC的中继线上提供CAN接口连接。
- 必须在后备箱中安装电源插板,为IPC和GPS-IMU提供电源。电源插板还需要服务于车上的其他硬件,比如4G的路由器。电源插板应连接到车辆的电源系统。
- 必须安装定制的机架,将GPS-IMU天线安装在车辆的顶部。
- 必须安装定制的机架,以便将GPS-IMU安装在后背箱中。
- 必须将4G LTE路由器安装在后备箱中才能为IPC提供Internet访问。路由器必须具有内置Wi-Fi接入点(AP)功能,以连接到其他设备(如iPad),以与自主驾驶(AD)系统相连接。例如,用户将能够使用移动设备来启动AD模式或监视AD状态。
### 主要部件安装图
以下两图显示车辆上应安装三个主要组件(GPS天线,IPC,GPS接收机和LiDAR)的位置: 示例图:

车辆与后备箱侧视图

车辆与后备箱后视图
### 安装GPS的接收器和天线
以下组件 **二选一**:
- **选项 1:** GPS-IMU: **NovAtel SPAN-IGM-A1**
- **选项 2:** GPS-IMU: **NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1**
#### 选项1:安装NovAtel SPAN-IGM-A1
安装说明描述了安装,连接和采取GPS-IMU NovAtel SPAN-IGM-A1的杠杆臂测量的过程。
##### 安装
可以将GPS-IMU NovAtel SPAN-IGM-A1放置在车辆的大部分地方,但建议您遵循以下建议:
- 将NovAtel SPAN-IGM-A1放置并固定在后备箱内,Y轴指向前方。
- 将NovAtel GPS-703-GGG-HV天线安装在位于车辆顶部的视野范围内。
##### 接线
您必须连接的两根电缆:
- 天线电缆 - 将GNSS天线连接到SPAN-IGM-A1的天线端口
- 主电缆:
- 将其15针端连接到SPAN-IGM-A1
- 将其电源线连接到10至30V直流电源
- 将其串行端口连接到IPC。如果电源来自车载电池,请添加辅助电池(推荐)。

主电缆连接
更多信息参见 *SPAN-IGM™ 快速入门指南*, 第三页, 详细图:
SPAN-IGM™ 快速入门指南
[http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf)
##### 采取杠杆臂测量
当SPAN-IGM-A1和GPS天线就位时,必须测量从SPAN-IGM-A1到GPS天线的距离。 该距离标识为:X偏移,Y偏移和Z偏移。
偏移误差必须在1厘米以内才能实现高精度。 有关详细信息,请参阅 * SPAN-IGM™快速入门指南*,第5页,详细图。
更多有关SPAN-IGM-A1的信息参见:
SPAN-IGM™ 用户手册:
[http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf](http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf)
#### 选项2:NovAtel SPAN® ProPak6™ 和 NovAtel IMU-IGM-A1
安装说明描述了安装,连接和采取GPS NovAtelSPAN®ProPak6™**和** NovAtel IMU-IGM-A1的杠杆臂测量的步骤。
##### 组件
安装所需的组件包括:
- NovAtel GPS SPAN ProPak6
- NovAtel IMU-IGM-A1
- NovAtel GPS-703-GGG-HV天线
- NovAtel GPS-C006电缆(将天线连接到GPS)
- NovAtel 01019014主电缆(将GPS连接到IPC的串行端口)
- 数据传输单元(DTU) - 类似于4G路由器
- 磁性适配器(用于天线和DTU)
- DB9直通电缆
##### 安装
你可以将 ProPak6 和 IMU 放置在车辆以下建议的位置:
- 将ProPak6和IMU并排固定在行李箱内,Y轴指向前方。
- 将NovAtel GPS-703-GGG-HV天线安装在车辆顶部或后备箱盖顶部,如图所示:

- 使用磁性适配器将天线紧固到后备箱盖上。
- 通过打开后备箱并将电缆放置在后备箱中,将天线也安装在后备箱中。
##### 接线
按照以下步骤将ProPak6 GNSS接收器和IMU连接到Apollo系统:
1. 使用IMU-IGM-A1附带的分接电缆连接IMU主端口和ProPak6 COM3/IMU端口。
2. 使用USB-MicroUSB转换线,连接IPC的USB端口和ProPak6的MicroUSB端口。
3. 将IMU-IGM-A1分离电缆的另一端连接到车辆电源。
4. 将GNSS天线连接到Propak6。
5. 连接Propak6电源线。

更多有关 NovAtel SPAN ProPak6的信息, 参见:
NovAtel ProPak6安装操作手册:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
### 安装激光雷达(LiDAR)
您可从如下两种方案中选择**其一**进行安装:
- **Option 1:** LiDAR: **Velodyne HDL-64E S3**
- **Option 2:** LiDAR: **Hesai Pandora**
#### 选项 1: 安装 Velodyne HDL-64E S3
本部分描述了HDL-64E S3激光雷达的安装过程。
##### 安装
将HDL64E S3 LiDAR成功安装在车辆的顶部,需要一个定制的安装结构。
这种结构需要为LiDAR提供刚性支撑,同时将LiDAR提升到地面以上的某个高度,避免来自liDAR的激光束被车辆前部或后部阻挡。
LiDAR所需的实际高度取决于车辆的设计和LiDAR相对于车辆的安装点。激光器的垂直倾斜角度通常在相对于地平线的±2〜-24.8度的范围内。为了充分利用检测角度范围,在林肯MKZ上,我们建议将LiDAR安装在1.8米的最小高度(从地面到LiDAR的底部)。
##### 接线
每个HDL-64E S3 LiDAR包括一个将LiDAR连接到电源的电缆组件,计算机(用于数据传输的以太网和用于LiDAR配置的串行端口)和GPS时间同步源。

1. 连接到LiDAR
将电源和信号电缆连接到LiDAR上的匹配端口

2. 连接到电源
两根AWG 16线为HDL-64E S3提供所需电力。 所需电压/电流:12V/3A。 要连接电源,请与电线完全接触并拧紧螺丝。

3. 连接到IPC
与IPC的连接是通过以太网线。将电缆束中的以太网线水晶头插入IPC上的以太网端口。
4. 连接到 GPS:
HDL64E S3 推荐最小特定GPS/传输数据(GPRMC)和每秒脉冲(PPS)信号与GPS时间同步。需要定制连接来建立GPS接收机和LiDAR之间的通信:
>HDL64E S3 LiDAR requires the Recommended minimum specific GPS/Transit data (GPRMC) and pulse per second (PPS)signal to synchronize to the GPS time.
a. SPAN-IGM-A1
如果您配置了[配置GPS和IMU](#配置gps和imu)中指定的SPAN-IGM-A1,GPRMC信号将通过用户端口电缆从主端口从GPS接收器发送。 PPS信号通过Aux端口上标有“PPS”和“PPS dgnd”的电缆发送。 下图中的虚线框是HDL64E S3 LiDAR和SPAN-IGM-A1 GPS接收机附带的可用连接。 剩余的连接需要由用户进行。

b. Propak 6 和 IMU-IGM-A1
如果您配置了[配置GPS和IMU](#configuration-the-gps-and-imu)中指定的Propak 6,GPRMC信号将通过COM2端口从GPS接收器发送。PPS信号通过IO端口发送。
下图中的虚线框是HDL-64E S3 LiDAR和Propak 6 GPS接收机附带的可用连接。 剩余的连接需要由用户进行。

5. 通过串口连接进行LiDAR配置
一些低级的参数可以通过串口进行配置。
在Velodyne提供的电缆束内,有两对红色/黑色电缆,如下表所示。 较厚的一对(AWG 16)用于为LiDAR系统供电。 较薄的一对用于串行连接。 将黑线(串行输入)连接到RX,将红线连接到串行电缆的地线。 将串行电缆与USB串行适配器连接至所选择的计算机。

##### 配置
默认情况下,HDL-64E S3的网络IP地址设置为192.168.0.1。 但是,当我们配置Apollo时,我们应该将网络IP地址改为192.168.20.13。 可以使用终端应用程序Terminalite 3.2,进入网络设置命令。可以按照以下步骤配置HDL-64E S3的IP地址:
1. 将串行电缆的一面连接到笔记本电脑
2. 将串行电缆的另一端连接到HDL-64E S3的串行线
3. COM 端口默认程序
Baudrate: 9600
Parity: None
Data bits: 8
Stop bits: 1
4. COM端口程序,从如下链接下载 Termite3.2 并安装
[http://www.compuphase.com/software_termite.htm](http://www.compuphase.com/software_termite.htm)
5. HDL-64E S3和笔记本电脑之间的COM端口连接

6. 在笔记本运行 **Termite 3.2**
7. 发出串行命令,通过串口“\#HDLIPA192168020013192168020255”设置HDL-64E S3的IP地址
8. 本机必须重新上电才能采用新的IP地址

HDL-64E S3 手册可见:
[http://velodynelidar.com/hdl-64e.html](http://velodynelidar.com/hdl-64e.html)
#### 选项 2: 安装 Hesai Pandora
本部分描述了Hesai Pandora激光雷达的安装过程。
##### 安装
将Hesai Pandora 成功安装在车辆的顶部,需要一个定制的安装结构。
这种结构需要为LiDAR提供刚性支撑,同时将LiDAR提升到地面以上的某个高度,避免来自liDAR的激光束被车辆前部或后部阻挡。
LiDAR所需的实际高度取决于车辆的设计和LiDAR相对于车辆的安装点。激光器的垂直倾斜角度通常在相对于地平线的+7~-16度的范围内。为了充分利用检测角度范围,在林肯MKZ上,我们建议将LiDAR安装在1.7米的最小高度(从地面到LiDAR的底部)。
##### 接线
每个Pandora包括一个将LiDAR连接到电源的电缆组件,计算机(用于数据传输的以太网)和GPS时间同步源。

1. 连接到Pandora
将电源和信号电缆连接到LiDAR上的匹配端口

2. 连接到电源
两根AWG 16线为HDL-64E S3提供所需电力。 所需电压/电流:12V/3A。 要连接电源,请与电线完全接触并拧紧螺丝。

3. 连接到IPC
与IPC的连接是通过以太网线。将电缆束中的以太网线水晶头插入IPC上的以太网端口。
4. 连接到 GPS:
Pandora推荐最小特定GPS/传输数据(GPRMC)和每秒脉冲(PPS)信号与GPS时间同步。需要定制连接来建立GPS接收机和LiDAR之间的通信:
a. SPAN-IGM-A1
如果您配置了[配置GPS和IMU](#configuration-the-gps-and-imu)中指定的SPAN-IGM-A1,GPRMC信号将通过用户端口电缆从主端口从GPS接收器发送。PPS信号通过Aux端口上标有“PPS”和“PPS dgnd”的电缆发送。下图中的虚线框是Pandora和SPAN-IGM-A1 GPS接收机附带的可用连接。剩余的连接需要由用户进行。

b. Propak 6 和 IMU-IGM-A1
如果您配置了[配置GPS和IMU](#configuration-the-gps-and-imu)中指定的Propak 6,GPRMC信号将通过COM2端口从GPS接收器发送。PPS信号通过IO端口发送。下图中的虚线框是Pandora和Propak 6 GPS接收机附带的可用连接。剩余的连接需要由用户进行。

Pandora的引脚表如下所示。

Pandora手册可以从如下网页中看到:
[http://www.hesaitech.com/pandora.html](http://www.hesaitech.com/pandora.html)
### 安装摄像头
本部分描述了安装摄像头的过程。
Apollo参考设计建议使用两个不同焦距的相机,一个6毫米,另一个25毫米。摄像机的安装可以为系统的实际设计量身定做。
- 这两个摄像机都应该朝着前进方向。视场(FOV)应尽量远离障碍物。
- 
- 25毫米焦距的照相机应该向上倾斜大约两度。调整后,25毫米相机应该能够观察到100米外有红路灯的交叉路口的停车线。
- 新出厂的摄像头的镜片不在最好的聚焦位置。通过调整镜片的焦距来找到正确的位置,找到远处目标物体的清晰图像。一个好的图像目标是交通标志或街道标志内的FOV。调整焦点后,使用锁紧螺丝来固定镜头的位置。

- 使用USB 3.0连接相机(USB 3.0 Micro-B)和IPC(USB 3.0 type A),并用螺钉来加固连接。
### 安装雷达
本部分介绍了Continental雷达的安装过程。
雷达需要一个匹配的机械机架安装在前保险杠上。安装后,要求雷达朝向驱动方向,稍微向上倾斜不超过2度。

带有雷达的电缆需要被路由到汽车的后部,并连接到ESD CAN卡的CAN1信道。
#### 安装IPC
步骤如下:
1. 使用电压转换器/调节器,将车辆的12 VDC输出转换为所需的电压。根据Neousys的建议,使用12 VDC至19 VDC转换器,最大输出电流为20 A.

首先,将两条19 VDC输出线连接到IPC的电源连接器(绿色如下图所示)。

其次,将12 VDC输入的两条电缆连接到车辆的电源面板。 如果导线的尺寸太厚,则电线应分开成几根线,并分别连接到相应的端口。
这一步非常有必要。 如果输入电压低于所需极限。 很可能导致系统故障。
2. 将板载计算机系统6108GC放在后备箱内(推荐)。
例如,Apollo 2.0使用4x4螺钉将6108GC螺栓固定在后备箱的箱板上。 
3. 安装IPC,使其前后两侧(所有端口位于)面对右侧(乘客)或左侧(驱动器)的后备箱中。
这种定位使得连接所有电缆更容易。
有关更多信息,请参见:
Neousys Nuvo-6108GC – 手册:
**[链接暂不可用]**
4. 连接所有电缆,其中包括:
- 电力电缆
- 控制器局域网(CAN)电缆
- 从4G路由器到IPC的以太网电缆
- 监视器、键盘、鼠标(可选)
a. 将电源线连接到工控机(如图所示):
b. 将电源线的另一端连接到车辆电池(如图所示):

c. 连接DB9电缆工控机和可(如图所示):

d. 连接:
- 从4G路由器到IPC的以太网电缆
- IPC的GPS接收器
- 监视器(可选):

#### 杠杆臂测量
步骤如下:
1. 在接受测量之前,打开IPC。
2. 当IMU和GPS天线就位时,必须测量从IMU到GPS天线的距离。距离测量应为:X偏移,Y偏移,和Z偏移。偏移误差必须在一厘米以内,以达到定位和定位的高精度。
更多信息,参见:
NovAtel ProPak6 安装与操作手册:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel SPAN-IGM-A1 产品主页:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
#### 配置GPS和IMU
GPS 和IMU 配置如下:
```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew
log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15
log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged
SAVECONFIG
```
ProPak6配置如下:
```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
CONNECTIMU COM3 IMU_ADIS16488
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG GPGGA ONTIME 1.0
log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew
log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15
log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged
SAVECONFIG
```
** WARNING:**基于真实的测量值(GPS天线、IMU的偏移量)修改 **<u>SETIMUTOANTOFFSE</u>T** 行。
示例:
```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```
# 建立网络
本节提供了一种建立网络的建议。
运行Apollo软件的IPC必须访问互联网获取实时运动学(RTK)数据,以便精确定位。移动设备还需要连接到IPC来运行Apollo软件。
## 推荐配置
建议您根据下图设置网络:

步骤如下:
- 安装并配置4G网络,
- 通过以太网线连接IPC到路由器
- 配置路由器使用LTE蜂窝网络接入互联网
- 配置LTE路由器的AP功能,使iPad Pro或其他移动设备可以连接到路由器,然后连接到IPC。
建议您配置一个固定的IP,而不是在IPC上使用DHCP,以使它更容易从移动终端被连接。
# 额外任务
需要使用自己提供的组件来执行以下任务:
- 使用DVI或HDMI电缆连接显示器,并连接键盘和鼠标,以便在现场的汽车上执行调试任务。
- 在Apple iPad Pro上建立Wi-Fi连接,以访问HMI并控制IPC上运行的Apollo ADS。
# 下一步
完成硬件部分的安装之后,可以参考快速入门的教程 [Apollo Quick Start](../../../02_Quick%20Start/apollo_1_5_quick_start.md) 完成软件部分的安装。
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/硬件安装hardware installation/apollo_2_5_hardware_system_installation_guide_v1.md
|
# Apollo 2.5 Hardware and System Installation Guide
* [About This Guide](#about-this-guide)
* [Document Conventions](#document-conventions)
* [Introduction](#introduction)
* [Documentation](#documentation)
* [Key Hardware Components](#key-hardware-components)
* [Additional Components Required](#additional-components-required)
* [Onboard Computer System - IPC](#onboard-computer-system---ipc)
* [IPC Configuration](#ipc-configuration)
* [IPC Front and Side Views](#ipc-front-and-side-views)
* [Controller Area Network (CAN) Card](#controller-area-network-can-card)
* [Global Positioning System (GPS) and Inertial Measurement Unit (IMU)](#global-positioning-system-gps-and-inertial-measurement-unit-imu)
* [Option 1: The NovAtel SPAN-IGM-A1](#option-1-the-novatel-span-igm-a1)
* [Option 2: The NovAtel SPAN ProPak6 and NovAtel IMU-IGM-A1](#option-2-the-novatel-span-propak6-and-novatel-imu-igm-a1)
* [The GPS Receiver/Antenna](#the-gps-receiverantenna)
* [Overview of the Installation Tasks](#overview-of-the-installation-tasks)
* [Steps for the Installation Tasks](#steps-for-the-installation-tasks)
* [At the Office](#at-the-office)
* [Preparing the IPC](#preparing-the-ipc)
* [Installing the Software for the IPC](#installing-the-software-for-the-ipc)
* [In the Vehicle](#in-the-vehicle)
* [Prerequisites](#prerequisites)
* [Diagrams of the Major Component Installations](#diagrams-of-the-major-component-installations)
* [Installing the GPS Receiver and Antenna](#installing-the-gps-receiver-and-antenna)
* [Installing the Light Detection and Ranging System (LiDAR)](#installing-the-light-detection-and-ranging-system-lidar)
* [Installing the Cameras](#installing-the-cameras)
* [Installing the Radar](#installing-the-radar)
* [Installing the IPC](#installing-the-ipc)
* [Configuring the GPS and IMU](#configuring-the-gps-and-imu)
* [Setting up the Network](#setting-up-the-network)
* [Recommendations](#recommendations)
* [Additional Tasks Required](#additional-tasks-required)
* [Next Steps](#next-steps)
# About This Guide
The *Apollo 2.5 Hardware and System Installation Guide* provides the instructions to install all of the hardware components and system software for the **Apollo Project**. The system installation information included pertains to the procedures to download and install the Apollo Linux Kernel.
## Document Conventions
The following table lists the conventions that are used in this document:
| **Icon** | **Description** |
| ----------------------------------- | ---------------------------------------- |
| **Bold** | Emphasis |
| `Mono-space font` | Code, typed data |
| _Italic_ | Titles of documents, sections, and headings Terms used |
|  | **Info** Contains information that might be useful. Ignoring the Info icon has no negative consequences. |
|  | **Tip**. Includes helpful hints or a shortcut that might assist you in completing a task. |
|  | **Online**. Provides a link to a particular web site where you can get more information. |
|  | **Warning**. Contains information that must **not** be ignored or you risk failure when you perform a certain task or step. |
# Introduction
The **Apollo Project** is an initiative that provides an open, complete, and reliable software platform for Apollo partners in the automotive and autonomous driving industries. The aim of this project is to enable these entities to develop their own self-driving systems based on Apollo software stack.
## Documentation
The following set of documentation describes Apollo 2.5:
- ***<u>[Apollo Hardware and System Installation Guide]</u>*** ─ Provides the instructions to install the hardware components and the system software for the vehicle:
- **Vehicle**:
- Industrial PC (IPC)
- Global Positioning System (GPS)
- Inertial Measurement Unit (IMU)
- Controller Area Network (CAN) card
- GPS Antenna
- GPS Receiver
- Light Detection and Ranging System (LiDAR)
- Camera
- Radar
- **Software**:
- Ubuntu Linux
- Apollo Linux Kernel
- NVIDIA GPU Driver
- ***<u>[Apollo Quick Start Guide]</u>*** ─ A combination of tutorial and roadmap that provides the complete set of end-to-end instructions. The Quick Start Guide also provides links to additional documents that describe the conversion of a regular car to an autonomous-driving vehicle.
# Key Hardware Components
The key hardware components to install include:
- Onboard computer system ─ Neousys Nuvo-6108GC
- Controller Area Network (CAN) Card ─ ESD CAN-PCIe/402-B4
- General Positioning System (GPS) and Inertial Measurement Unit (IMU) ─
You can select one of the following options:
- NovAtel SPAN-IGM-A1
- NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
- Light Detection and Ranging System (LiDAR) ─ Velodyne HDL-64E S3
- Cameras — Leopard Imaging LI-USB30-AR023ZWDR with USB 3.0 case
- Radar — Continental ARS408-21
## Additional Components Required
You need to provide these additional components for the Additional Tasks Required:
- A 4G router for Internet access
- A USB hub for extra USB ports
- A monitor, keyboard, and mouse for debugging at the car onsite
- Cables:a Digital Visual Interface (DVI) cable (optional), a customized cable for GPS-LiDAR time synchronization
- Apple iPad Pro: 9.7-inch, Wi-Fi (optional)
The features of the key hardware components are presented in the subsequent sections.
## Onboard Computer System - IPC
The onboard computer system is an industrial PC (IPC) for the autonomous vehicle and uses the **NeousysNuvo-6108GC** that is powered by a sixth-generation Intel Xeon E3 1275 V5 CPU.
The Neousys Nuvo-6108GC is the central unit of the autonomous driving system (ADS).
### IPC Configuration
Configure the IPC as follows:
- ASUS GTX1080 GPU-A8G-Gaming GPU Card
- 32GB DDR4 RAM
- PO-280W-OW 280W AC/DC power adapter
- 2.5" SATA Hard Disk 1TB 7200rpm
### IPC Front and Side Views
The front and side views of the IPC are shown with the Graphics Processing Unit (GPU) installed in the following pictures:
The front view of the Nuvo-6108GC:

The side view of the Nuvo-6108GC:

For more information about the Nuvo-6108GC, see:

Neousys Nuvo-6108GC Product Page:
[http://www.neousys-tech.com/en/product/application/rugged-embedded/nuvo-6108gc-gpu-computing](http://www.neousys-tech.com/en/product/application/rugged-embedded/nuvo-6108gc-gpu-computing)

Neousys Nuvo-6108GC-Manual:
**[Link unavailable yet]**
## Controller Area Network (CAN) Card
The CAN card to use with the IPC is **ESD** **CAN-PCIe/402-B4**.

For more information about the CAN-PCIe/402-B4, see:
 ESD CAN-PCIe/402 Product Page:
[https://esd.eu/en/products/can-pcie402](https://esd.eu/en/products/can-pcie402)
## Global Positioning System (GPS) and Inertial Measurement Unit (IMU)
There are **two** GPS-IMU **options** available and the choice depends upon the one that most fits your needs:
- **Option 1: NovAtel SPAN-IGM-A1**
- **Option 2: NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1**
### Option 1: The NovAtel SPAN-IGM-A1
The NovAtel SPAN-IGM-A1 is an integrated, single-box solution that offers tightly coupled Global Navigation Satellite System (GNSS) positioning and inertial navigation featuring the NovAtel OEM615 receiver.

For more information about the NovAtel SPAN-IGM-A1, see:
 NovAtel SPAN-IGM-A1 Product Page:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
### Option 2: The NovAtel SPAN ProPak6 and NovAtel IMU-IGM-A1
NovAtel ProPak6 is a standalone GNSS receiver. It works with a separate NovAtel- supported IMU (in this case, the NovAtel IMU-IGM-A1)to provide localization.
The ProPak6 provides the latest and most sophisticated enclosure product manufactured by NovAtel.
The IMU-IGM-A1 is an IMU that pairs with a SPAN-enabled GNSS receiver such as the SPAN ProPak6.

For more information about the NovAtel SPAN ProPak6 and the IMU-IGM-A1, see:
 NovAtel ProPak6 Installation & Operation Manual:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel IMU-IGM-A1 Product Page:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview](https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview)
## The GPS Receiver/Antenna
The GPS Receiver/Antenna used with the GPS-IMU component is:
### Option 1: The **NovAtel GPS-703-GGG-HV**.
**NOTE:**The GPS NovAtelGPS-703-GGG-HV works with either model of the two GPS-IMU options that are described in the previous section, Global Positioning System (GPS) and Inertial Measurement Unit (IMU).

For more information about the NovAtel GPS-703-GGG-HV, see:
 NovAtel GPS-703-GGG-HV Product Page:
[https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/](https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/)
### Option 2: **Dual NovAtel GNSS-502**
**NOTE:**The NovAtel GNSS-502 works with either model of the two GPS-IMU options that are described in the previous section, Global Positioning System (GPS) and Inertial Measurement Unit (IMU). Dual antenna receivers, such as the ProPak6 can take advantage of better quality heading information, by using 2 antennas.

For more information about the NovAtel GNSS-502, see:
 NovAtel GNSS-502 Product Page:
[https://www.novatel.com/products/gnss-antennas/vexxis-series-antennas/vexxis-gnss-500-series-antennas/](https://www.novatel.com/products/gnss-antennas/vexxis-series-antennas/vexxis-gnss-500-series-antennas/)
## Light Detection and Ranging System (LiDAR)
The 64 line LiDAR system **HDL-64E S3** is available from Velodyne LiDAR, Inc.

**Key Features:**
- 64 Channels
- 120m range
- 2.2 Million Points per Second
- 360° Horizontal FOV
- 26.9° Vertical FOV
- 0.08° angular resolution (azimuth)
- <2cm accuracy
- ~0.4° Vertical Resolution
- User selectable frame rate
- Rugged Design
Webpage for Velodyne HDL-64E S3:
[http://velodynelidar.com/hdl-64e.html](http://velodynelidar.com/hdl-64e.html)
The 16 line LiDAR system VLP-16 is available from Velodyne LiDAR, Inc.

**Key Features:**
- 16 Channels
- 100m range
- 600,000 Points per Second
- 360° Horizontal FOV
- ±15° Vertical FOV
- Low Power Consumption
- Protective Design
Webpage for Velodyne VLP-16:
[http://velodynelidar.com/vlp-16.html](http://velodynelidar.com/vlp-16.html)
## Cameras
The cameras used are LI-USB30-AR023ZWDR with standard USB 3.0 case manufactured by Leopard Imaging Inc. We recommend using two cameras with 6 mm lens and one with 25 mm lens to achieve the required performance.

You can find more information at Leopard Imaging Inc. website:
[https://leopardimaging.com/product/li-usb30-ar023zwdr/](https://leopardimaging.com/product/li-usb30-ar023zwdr/)
## Radar
The Radar used is ARS408-21 manufactured by Continental AG.

You can find more information can be found on the product page:
[https://www.continental-automotive.com/Landing-Pages/Industrial-Sensors/Products/ARS-408-21](https://www.continental-automotive.com/Landing-Pages/Industrial-Sensors/Products/ARS-408-21)
# Overview of the Installation Tasks
Installing the hardware and the software components involves these tasks:
**AT THE OFFICE:**
1. Prepare and install the Controller Area Network (CAN) card by first repositioning the CAN card termination jumper before you insert the card into the slot.
2. Install the hard drive (if none was pre-installed) in the IPC.
You can also choose to replace a pre-installed hard drive if you prefer.
**Recommendations** :
- Install a Solid-State Drive (SSD) for better reliability.
- Use a high-capacity drive if you need to collect driving data.
3. Prepare the IPC for powering up:
a. Attach the power cable to the power connector (terminal block).
b. Connect the monitor, Ethernet, keyboard, and mouse to the IPC.
c. Connect the IPC to a power source.
4. Install the software on the IPC (some Linux experience is required):
a. Install Ubuntu Linux.
b. Install the Apollo Linux kernel.
**IN THE VEHICLE:**
- Make sure that all the modifications for the vehicle, which are listed in the section Prerequisites, have been performed.
- Install the major components (according to the illustrations and the instructions included in this document):
- GPS Antenna
- IPC
- GPS Receiver and IMU
- LiDAR
- Cameras
- Radar
The actual steps to install all of the hardware and software components are detailed in the section, Steps for the Installation Tasks.
# Steps for the Installation Tasks
This section describes the steps to install:
- The key hardware and software components
- The hardware in the vehicle
## At the Office
Perform the following tasks:
- Prepare the IPC:
- Install the CAN card
- Install or replace the hard drive
- Prepare the IPC for powering up
- Install the software for the IPC:
- Ubuntu Linux
- Apollo Kernel
- Nvidia GPU Driver
### Preparing the IPC
Follow these steps:
1. Prepare and install the Controller Area Network (CAN) card:
In the Neousys Nuvo-6108GC, ASUS® GTX-1080GPU-A8G-GAMING GPU card is pre-installed into one of the three PCI slots. We still need to install a CAN card into a PCI slot.
a. Locate and unscrew the eight screws (shown in the brown squares or pointed by brown arrows) on the side of computer:
b. Remove the cover from the IPC. 3 PCI slots (one occupied by the graphic card) locate on the base:


c. Set the CAN card termination jumper by removing the red jumper cap (shown in yellow circles) from its default location and placing it at its termination position:

**WARNING**: The CAN card will not work if the termination jumper is not set correctly.
d. Insert the CAN card into the slot in the IPC:

e. Reinstall the cover for the IPC

2. Prepare the IPC for powering up:
a. Attach the power cable to the power connector (terminal block) that comes with the IPC:
**WARNING**: Make sure that the positive(labeled **R** for red) and the negative(labeled **B** for black) wires of the power cable are inserted into the correct holes on the power terminal block.

b. Connect the monitor, Ethernet cable, keyboard, and mouse to the IPC:
3. 
It is recommended to configure the fan speed through BIOS settings, if one or more plugin card is added to the system
- While starting up the computer, press F2 to enter BIOS setup menu.
- Go to [Advanced] => [Smart Fan Setting]
- Set [Fan Max. Trip Temp] to 50
- Set [Fan Start Trip Temp] to 20
It is recommended that you use a Digital Visual Interface (DVI) connector on the graphic card for the monitor. To set the display to the DVI port on the motherboard, following is the setting procedure:
- While starting up the computer, press F2 to enter BIOS setup menu.
- Go to [Advanced]=>[System Agent (SA) Configuration]=>[Graphics Configuration]=>[Primary Display]=> Set to "PEG"
It is recommended to configure the IPC to run at maximum performance mode at all time:
- While starting up the computer, press F2 to enter BIOS setup menu.
- Go to [Power] => [SKU POWER CONFIG] => set to "MAX. TDP"
c. Connect the power:

### Installing the Software for the IPC
This section describes the steps to install:
- Ubuntu Linux
- Apollo Kernel
- Nvidia GPU Driver
It is assumed that you have experience working with Linux to successfully perform the software installation.
#### Installing Ubuntu Linux
Follow these steps:
1. Create a bootable Ubuntu Linux USB flash drive:
Download Ubuntu (or a variant such as Xubuntu) and follow the online instructions to create a bootable USB flash drive.
It is recommended that you use **Ubuntu 14.04.3**.
You can type F2 during the system boot process to enter the BIOS settings. It is recommended that you disable Quick Boot and Quiet Boot in the BIOS to make it easier to catch any issues in the boot process.
For more information about Ubuntu, see:
 Ubuntu for Desktop web site:
[https://www.ubuntu.com/desktop](https://www.ubuntu.com/desktop)
2. Install Ubuntu Linux:
a. Insert the Ubuntu installation drive into a USB port and turn on the system.
b. Install Linux by following the on-screen instructions.
3. Perform a software update and the installation:
a. Reboot into Linux after the installation is done.
b. Launch the Software Updater to update to the latest software packages (for the installed distribution) or type the following commands in a terminal program such as GNOME Terminal.
```shell
sudo apt-get update; sudo apt-get upgrade
```
c. Launch a terminal program such as GNOME Terminal and type the following command to install the Linux 4.4 kernel:
```shell
sudo apt-get install linux-generic-lts-xenial
```
The IPC must have Internet access to update and install software. Make sure that the Ethernet cable is connected to a network with Internet access. You might need to configure the network for the IPC if the network that it is connected to is not using the Dynamic Host Configuration Protocol (DHCP).
#### Installing the Apollo Kernel
The Apollo runtime in the vehicle requires the [Apollo Kernel](https://github.com/ApolloAuto/apollo-kernel). It is strongly recommended to install the pre-built kernel.
##### Use the pre-built Apollo Kernel.
You get access to and install the pre-built kernel using the following commands.
1. Download the release packages from the release section on GitHub:
```
https://github.com/ApolloAuto/apollo-kernel/releases
```
2. Install the kernel after having downloading the release package:
```
tar zxvf linux-4.4.32-apollo-1.5.0.tar.gz
cd install
sudo bash install_kernel.sh
```
3. Reboot your system using the `reboot` command.
4. Build the ESD CAN driver source code, according to [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)
##### Build your own kernel.
If have modified the kernel, or the pre-built kernel is not the best for your platform, you can build your own kernel using the following steps.
1. Clone the code from the repository
```
git clone https://github.com/ApolloAuto/apollo-kernel.git
cd apollo-kernel
```
2. Add the ESD CAN driver source code according to [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)
3. Build the kernel using the following command.
```
bash build.sh
```
4. Install the kernel using the steps for a pre-built Apollo Kernel as described in the previous section.
#### Installing NVIDIA GPU Driver
The Apollo runtime in the vehicle requires the [NVIDIA GPU Driver](http://www.nvidia.com/download/driverResults.aspx/114708/en-us). You must install the NVIDIA GPU driver with specific options.
1. Download the installation files
```
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/375.39/NVIDIA-Linux-x86_64-375.39.run
```
2. Start the installation
```
sudo bash ./NVIDIA-Linux-x86_64-375.39.run --no-x-check -a -s --no-kernel-module
```
##### Optional: Test the ESD CAN device node
After rebooting the IPC with the new kernel:
a. Create the CAN device node by issuing the following commands in a terminal:
```shell
cd /dev
sudo mknod –-mode=a+rw can0 c 52 0
sudo mknod –-mode=a+rw can1 c 52 1
```
b. Test the CAN device node using the test program that is part of the ESD CAN software package that you have acquired from ESD Electronics.
The IPC is now ready to be mounted on the vehicle.
## In the Vehicle
Perform these tasks:
- Make the necessary modifications to the vehicle as specified in the list of prerequisites
- Install the major components:
- GPS Antenna
- IPC
- GPS Receiver and IMU
- LiDAR's
- Cameras
- Radar
### Prerequisites
**WARNING**: Prior to mounting the major components (GPS Antenna, IPC, and GPS Receiver) in the vehicle, perform certain modifications as specified in the list of prerequisites. The instructions for making the mandatory changes in the list are outside the scope of this document.
The list of prerequisites are as follows:
- The vehicle must be modified for “drive-by-wire” technology by a professional service company. Also, a CAN interface hookup must be provided in the trunk where the IPC will be mounted.
- A power panel must be installed in the trunk to provide power to the IPC and the GPS-IMU. The power panel would also service other devices in the vehicle such as a 4G LTE router. The power panel should be hooked up to the power system in the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU Antenna, the cameras and the LiDAR's on top of the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU in the trunk.
- A custom-made rack must be installed in front of the vehicle to mount the front-facing radar.
- A 4G LTE router must be mounted in the trunk to provide Internet access for the IPC. The router must have built-in Wi-Fi access point (AP) capability to connect to other devices, such as an iPad, to interface with the autonomous driving (AD) system. A user would be able to use the mobile device to start AD mode or monitor AD status, for example.
### Diagrams of the Major Component Installations
The following two diagrams indicate the locations of where the three major components (GPS Antenna, IPC, GPS Receiver and LiDAR) should be installed on the vehicle:


### Installing the GPS Receiver and Antenna
This section provides general information about installing **one** of two choices:
- **Option 1:** GPS-IMU: **NovAtel SPAN-IGM-A1**
- **Option 2:** GPS-IMU: **NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1**
#### Option 1: Installing the NovAtel SPAN-IGM-A1
The installation instructions describe the procedures to mount, connect, and take the lever arm measurements for the GPS-IMU NovAtel SPAN-IGM-A1.
##### Mounting
You can place the GPS-IMU NovAtel SPAN-IGM-A1 in most places in the vehicle but it is suggested that you follow these recommendations:
- Place and secure the NovAtel SPAN-IGM-A1 inside the trunk with the Y-axis pointing forward.
- Mount the NovAtel GPS-703-GGG-HV antenna in an unobscured location on top of the vehicle.
##### Wiring
You must connect two cables:
- The antenna cable connects the GNSS antenna to the antenna port of the SPAN-IGM-A1
- The main cable:
- Connects its 15-pin end to the SPAN-IGM-A1
- Connects its power wires to a power supply of 10-to-30V DC
- Connects its serial port to the IPC. If the power comes from a vehicle battery, add an auxiliary battery (recommended).

Main Cable Connections
For more information, see the *SPAN-IGM™ Quick Start Guide*, page 3, for a detailed diagram:
SPAN-IGM™ Quick Start Guide
[http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf)
##### Taking the Lever Arm Measurement
When the SPAN-IGM-A1 and the GPS Antenna are in position, the distance from the SPAN-IGM-A1 to the GPS Antenna must be measured. The distance should be measured as: X offset, Y offset, and Z offset.
The error of offset must be within one centimeter to achieve high accuracy. For more information, see the *SPAN-IGM™ Quick Start Guide*, page 5, for a detailed diagram.
For an additional information about the SPAN-IGM-A1, see:
SPAN-IGM™ User Manual:
[http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf](http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf)
#### Option 2: Installing NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
The installation instructions describe the procedures to mount, connect, and take the lever arm measurements for the GPS NovAtel SPAN® ProPak6™ **and** the NovAtel IMU-IGM-A1.
##### Components for the Installation
The components that are required for the installation include:
- NovAtel GPS SPAN ProPak6
- NovAtel IMU-IGM-A1
- NovAtel GPS-703-GGG-HV Antenna
- NovAtel GPS-C006 Cable (to connect antenna to GPS)
- NovAtel 01019014 Main Cable (to connect GPS to a serial port the IPC)
- Data Transport Unit (DTU) – similar to a 4G router
- Magnetic adapters (for antenna and DTU)
- DB9 Straight Through Cable
##### Mounting
You can place the two devices, the ProPak6 and the IMU in most places in the vehicle, but it is suggested that you follow these recommendations:
- Place and secure the ProPak6 and the IMU side-by-side inside the trunk with the Y-axis pointing forward.
- Mount the NovAtel GPS-703-GGG-HV antenna on top of the vehicle or on top of the trunk lid as shown:

- Use a magnetic adapter to tightly attach the antenna to the trunk lid.
- Install the antenna cable in the trunk by opening the trunk and placing the cable in the space between the trunk lid and the body of the car.
##### Wiring
Follow these steps to connect the ProPak6 GNSS Receiver and the IMU to the Apollo system:
1. Use the split cable that comes with IMU-IGM-A1 to connect the IMU Main port and theProPak6 COM3/IMU port.
2. Use a USB-A-to-MicroUSB cable to connect the USB port of the IPC and the MicroUSB port of the ProPak6.
3. Connect the other end of the IMU-IGM-A1 split cable to the vehicle power.
4. Connect the GNSS antenna to Propak6.
5. Connect the Propak6 power cable.

For more information about the NovAtel SPAN ProPak6, see:
NovAtel ProPak6 Installation& Operation Manual:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
### Installing the Light Detection and Ranging System (LiDAR)
This section provides descriptions on the installation procedure of HDL-64E S3 LiDAR.
#### Mounting
A customized mounting structure is required to successfully mount an HDL64E S3 LiDAR on top of a vehicle. This structure must provide rigid support to the LiDAR system while raising the LiDAR to a certain height above the ground. This height avoids the laser beams from the LiDAR being blocked by the front and/or rear of the vehicle. The actual height needed for the LiDAR depends on the design of the vehicle and the mounting point of the LiDAR relative to the vehicle. The vertical tilt angle of the lasers normally ranges from +2~-24.8 degrees relative to the horizon. To fully use the angle range for detection, on a Lincoln MKZ, it is recommended that you mount the LiDAR at a minimum height of 1.8 meters (from ground to the base of the LiDAR).
#### Wiring
Each HDL-64E S3 LiDAR includes a cable bundle to connect the LiDAR to the power supply, the computer (Ethernet for data transfer, and serial port for LiDAR configuration) and the GPS timesync source.

1. Connection to the LiDAR
Connect the power and signal cable to the matching ports on the LiDAR

2. Connection to Power Source
The two AWG 16 wires are used to power HDL-64E S3 LiDAR. It requires about 3A at 12V. To connect the power source, make full contact with the wires and tighten the screws.

3. Conection to IPC
The connection to the IPC is through an ethernet cable. Plug the ethernet connector in the cable bundle into an ethernet port on the IPC
4. Connection to GPS:
The HDL64E S3 LiDAR requires the recommended minimum specific GPS/Transit data (GPRMC) and pulse per second (PPS) signal to synchronize to the GPS time. A customized connection is needed to establish the communication between the GPS receiver and the LiDAR:
a. SPAN-IGM-A1
If you configured the SPAN-IGM-A1 as specified in [Configuring the GPS and IMU](#configuring-the-gps-and-imu), the GPRMC signal is sent from the GPS receiver via the User Port cable from the Main port. The PPS signal is sent through the wire cables labeled as “PPS” and “PPS dgnd” from the Aux port. The dash-line boxes in the figure below show the available connections that come with the HDL64E S3 LiDAR and the SPAN-IGM-A1 GPS receiver. The remaining connections must be made by the user.

b. Propak 6 and IMU-IGM-A1
If you configured the Propak 6 as specified in [Configuring the GPS and IMU](#configuring-the-gps-and-imu), the GPRMC signal is sent from the GPS receiver via COM2 port. The PPS signal is sent through the IO port. The dash-line boxes in the figure below are available connections that comes with the HDL-64E S3 LiDAR and the Propak 6 GPS receiver. The remaining connections need to be made by the user.

5. Connection through serial port for LiDAR configuration
You can configure some of the low-level parameters through serial port. Within the cable bundle provided by Velodyne LiDAR, Inc., there are two pairs of red/black cables as shown in the pinout table below. The thicker pair (AWG 16) is used to power the LiDAR system. The thinner pair is used for serial connection. Connect the black wire (Serial In) to RX, the red wire to the Ground wire of a serial cable. Connect the serial cable with a USB-serial adapter to your selected computer.

#### Configuration
By default, the HDL-64E S3 has the network IP address setting as 192.168.0.1. However, when you set up for Apollo, change the network IP address to 192.168.20.13 . You can use the terminal application with Termite3.2 and enter the network setting command. The IP address of the HDL-64E S3 can be configured using the following steps:
1. Connect one side of the serial cable to your laptop
2. Connect the other side of the serial cable to HDL-64E S3’s serial wires
3. Use the following COM port default setting:
Baudrate: 9600
Parity: None
Data bits: 8
Stop bits: 1
4. Use the COM port application:
Download Termite3.2 from the link below and install it on your laptop (Windows):
[http://www.compuphase.com/software_termite.htm](http://www.compuphase.com/software_termite.htm)
5. Use the serial cable connection for COM port between the HDL-64E S3 and the laptop:

6. Launch **Termite 3.2** from laptop
7. Issue a serial command for setting up the HDL-64E S3’s IP addresses over serial port "\#HDLIPA192168020013192168020255"
8. The unit must be power cycled to adopt the new IP addresses

HDL-64E S3 Manual can be found on this webpage:
[http://velodynelidar.com/hdl-64e.html](http://velodynelidar.com/hdl-64e.html)
#### (Optional) Installation of VLP-16 lidar
In Apollo 2.5, map creation service has been opened to the public. To acquire the data necessary for map creation, one would need to install an additional VLP-16 LiDAR on the vehicle. The purpose of this LiDAR is to collect point cloud information for objects above the FOV of the HDL-64 S3 Lidar, such as traffic lights and signs. It requires a customized rack to mount the VLP-16 Lidar on top of the vehicle. The figure below shows one of the possible configurations. 
In this specific configuration, the VLP-16 LiDAR is mounted with an upward tilt of 20±2°. The power cable of the VLP-16 is connected to the DataSpeed power panel. The ethernet connection is connected to the IPC (possibly through an ethernet switch). Similar to HDL-64 S3 LiDAR, the VLP-16 GPRMC and PPS input from the GPS receiver. Ideally, additional hardware should be installed to duplicate the GPRMC and PPS signal from the GPS receiver send to HDL-64 and VLP-16 respectively. However, a simple Y-split cable may also provide adequate signal for both LiDAR's. To distinguish from the HDL-64 S3 LiDAR, please follow the VLP-16 manual and use the webpage interface to configure the IP of VLP-16 to 192.168.20.14, the data port to 2369, and the telemetry port to 8309. The pinout for the signal input from GPS receiver can also be found in the manual if you need customized cable.
VLP-16 Manual can be found on this webpage:
[http://velodynelidar.com/vlp-16.html](http://velodynelidar.com/vlp-16.htmll)
### Installing the Cameras
This section provides guidelines for the camera installation procedure.
The Apollo reference design recommends using three cameras with different focal lengths: two with 6 mm lens and one with 25 mm lens. The location of these cameras are very flexible, they can be placed on the side of LiDAR or inside of the front windshield. The mounting of the cameras can be tailored to the actual design of the system.
- All the cameras should face forward to the driving direction. The field of view (FOV) should be kept free from obstructions as much as possible.
- 
- The camera with the 25 mm focal length should be tilted up by about two degrees. After you make this adjustment, the 25 mm camera should be able to observe the traffic light from 100 m away to the stop line at the intersection.
- The lenses of the cameras, out of the package, are not in the optimal position. Set up the correct position by adjusting the focus of the lens to form a sharp image of a target object at a distance. A good target to image is a traffic sign or a street sign within the FOV. After adjusting the focus, use the lock screw to secure the position of the lens.

- Use USB 3.0 Cables to connect the cameras (USB 3.0 Micro-B) and the IPC(USB 3.0 type A), and then use screws to secure the connection.
### Installing the Radar
This section provides descriptions of the installation procedure of Continental Radar.
The radar requires a matching mechanical rack to mount on the front bumper. After the installation, it is required that the radar faces towards the driving direction and slightly tilts up by no more than two degrees.

The cable that comes with the radar needs to be routed to the back of the car and connected to the CAN1 channel of the ESD CAN card.
### Installing the IPC
Follow these steps:
1. Use a voltage converter/regulator to convert the 12 VDC output from the vehicle to desired voltage to power IPC.
As recommended by Neousys, use a 12 VDC to 19 VDC converter with maximal output current of 20 A.

a. Connect the two 19 VDC output wires to IPC's power connector (Green as shown below).

b. Connect the two cables of 12 VDC input to the power panel in the vehicle. If the size of the wire is too thick, the wire should be split to several wires and connect to corresponding ports, respectively.
This step is required. If the input voltage goes below the required limit, it can cause system failure.
2. Place the onboard computer system, the 6108GC, inside the trunk (recommended).
For example, Apollo 2.5 uses 4x4 self-tapping screws to bolt the 6108GC to the carpeted floor of the trunk. 
3. Mount the IPC so that its front and back sides(where all ports are located) face the right side (passenger) or the left side(driver) of the trunk.
This positioning makes it easier to connect all of the cables.
For more information, see:
Neousys Nuvo-6108GC – Manual:
**[Link Unavailable]**
4. Connect all cables, which include:
- Power cable
- Controller Area Network (CAN) cable
- Ethernet cable from the 4G router to the IPC
- GPS Receiver to the IPC
- (Optional) Monitor, keyboard, mouse
a. Connect the power cable to the IPC (as shown):
b. Connect the other end of the power cable to the vehicle battery (as shown):

c. Connect the DB9 cable to the IPC to talk to the CAN (as shown):

d. Connect:
- the Ethernet cable from the 4G router to the IPC
- the GPS Receiver to the IPC
- (optional) the monitor:

#### Taking the Lever Arm Measurement
Follow these steps:
1. Before taking the measurement, turn on the IPC.
2. When the IMU and the GPS Antenna are in position, the distance from the IMU to the GPS Antenna must be measured. The distance should be measured as: X offset, Y offset, and Z offset. The error of offset must be within one centimeter to achieve high accuracy in positioning and localization.
For an additional information, see:
NovAtel ProPak6 Installation & Operation Manual:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel SPAN-IGM-A1 Product Page:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
### Configuring the GPS and IMU
Configure the GPS and IMU as shown:
```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew
log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15
log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged
SAVECONFIG
```
For ProPak6:
```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
CONNECTIMU COM3 IMU_ADIS16488
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew
log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15
log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged
SAVECONFIG
```
** WARNING:** Modify the **<u>SETIMUTOANTOFFSE</u>T** line based on the actual measurement (of the antenna and the IMU offset).
For example:
```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```
# Setting up the Network
This section provides recommendations for setting up the network.
The IPC that is running the Apollo software must access the Internet to acquire the Real Time Kinematic (RTK) data for accurate localization. A mobile device also needs to connect to the IPC to run the Apollo software.
## Recommendations
It is recommended that you set up your network according to the following diagram:

Follow these steps:
1. Install and configure a 4G LTE router with Wi-Fi Access Point (AP) capability and Gigabit Ethernet ports.
2. Connect the IPC to the LTE router using an Ethernet cable.
3. Configure the LTE router to access the Internet using the LTE cellular network.
4. Configure the AP capability of the LTE router so that the iPad Pro or another mobile device can connect to the router, and, in turn, connect to the IPC.
It is recommended that you configure a fixed IP instead of using DHCP on the IPC to make it easier to connect to it from a mobile terminal.
# Additional Tasks Required
Use the components that you were required to provide to perform the following tasks:
1. Connect a monitor using the DVI or the HDMI cables and connect the keyboard and mouse to perform debugging tasks at the car onsite.
2. Establish a Wi-Fi connection on the Apple iPad Pro to access the HMI and control the Apollo ADS that is running on the IPC.
# Time Sync Script Setup [Optional]
In order to, sync the computer time to the NTP server on the internet, you could use the [Time Sync script](https://github.com/ApolloAuto/apollo/blob/master/scripts/time_sync.sh)
# Next Steps
After you complete the hardware installation in the vehicle, see the [Apollo Quick Start](../../../02_Quick%20Start/apollo_2_5_quick_start.md) for the steps to complete the software installation.
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/硬件安装hardware installation/apollo_1_5_hardware_system_installation_guide.md
|
# Apollo 1.5 Hardware and System Installation Guide
* [About This Guide](#about-this-guide)
* [Document Conventions](#document-conventions)
* [Introduction](#introduction)
* [Documentation](#documentation)
* [Key Hardware Components](#key-hardware-components)
* [Additional Components Required](#additional-components-required)
* [Onboard Computer System - IPC](#onboard-computer-system---ipc)
* [IPC Configuration](#ipc-configuration)
* [IPC Front and Rear Views](#ipc-front-and-rear-views)
* [Controller Area Network (CAN) Card](#controller-area-network-(can)-card)
* [Global Positioning System (GPS) and Inertial Measurement Unit (IMU)](#global-positioning-system-(gps)-and-inertial-measurement-unit-(imu))
* [Option 1: The NovAtel SPAN-IGM-A1](#option-1:-the-novatel-span-igm-a1)
* [Option 2: The NovAtel SPAN ProPak6 and NovAtel IMU-IGM-A1](#option-2:-the-novatel-span-propak6-and-novatel-imu-igm-a1)
* [The GPS Receiver/Antenna](#the-gps-receiver/antenna)
* [Overview of the Installation Tasks](#overview-of-the-installation-tasks)
* [Steps for the Installation Tasks](#steps-for-the-installation-tasks)
* [At the Office](#at-the-office)
* [Preparing the IPC](#preparing-the-ipc)
* [Installing the Software for the IPC](#installing-the-software-for-the-ipc)
* [In the Vehicle](#in-the-vehicle)
* [Prerequisites](#prerequisites)
* [Diagrams of the Major Component Installations](#diagrams-of-the-major-component-installations)
* [Installing the GPS Receiver and Antenna](#installing-the-gps-receiver-and-antenna)
* [Installing the Light Detection and Ranging System (LiDAR)](#installing-the-light-detection-and-ranging-system-(lidar))
* [Installing the IPC](#installing-the-ipc)
* [Configuring the GPS and IMU](#configuring-the-gps-and-imu)
* [Setting up the Network](#setting-up-the-network)
* [Recommendations](#recommendations)
* [Additional Tasks Required](#additional-tasks-required)
* [Next Steps](#next-steps)
# About This Guide
The *Apollo 1.5 Hardware and System Installation Guide* provides the instructions to install all of the hardware components and system software for the **Apollo Project **. The system installation information included pertains to the procedures to download and install the Apollo Linux Kernel.
## Document Conventions
The following table lists the conventions that are used in this document:
| **Icon** | **Description** |
| ----------------------------------- | ---------------------------------------- |
| **Bold** | Emphasis |
| `Mono-space font` | Code, typed data |
| _Italic_ | Titles of documents, sections, and headings Terms used |
|  | **Info** Contains information that might be useful. Ignoring the Info icon has no negative consequences. |
|  | **Tip**. Includes helpful hints or a shortcut that might assist you in completing a task. |
|  | **Online**. Provides a link to a particular web site where you can get more information. |
|  | **Warning**. Contains information that must **not** be ignored or you risk failure when you perform a certain task or step. |
# Introduction
The **Apollo Project** is an initiative that provides an open, complete, and reliable software platform for Apollo partners in the automotive and autonomous driving industries. The aim of this project is to enable these entities to develop their own self-driving systems based on Apollo software stack.
## Documentation
The following set of documentation describes Apollo 1.5:
- ***<u>[Apollo Hardware and System Installation Guide]</u>*** ─ Provides the instructions to install the hardware components and the system software for the vehicle:
- **Vehicle**:
- Industrial PC (IPC)
- Global Positioning System (GPS)
- Inertial Measurement Unit (IMU)
- Controller Area Network (CAN) card
- GPS Antenna
- GPS Receiver
- Light Detection and Ranging System (LiDAR)
- **Software**:
- Ubuntu Linux
- Apollo Linux Kernel
- Nvidia GPU Driver
- ***<u>[Apollo Quick Start Guide]</u>*** ─ A combination tutorial and roadmap that provide the complete set of end-to-end instructions. The Quick Start Guide also provides links to additional documents that describe the conversion of a regular car to an autonomous-driving vehicle.
# Key Hardware Components
The key hardware components to install include:
- Onboard computer system ─ Neousys Nuvo-6108GC
- Controller Area Network (CAN) Card ─ ESD CAN-PCIe/402-1
- General Positioning System (GPS) and Inertial Measurement Unit (IMU) ─
You can select one of the following options:
- NovAtel SPAN-IGM-A1
- NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
- Light Detection and Ranging System (LiDAR) ─ Velodyne HDL-64E S3
## Additional Components Required
You need to provide these additional components for the Additional Tasks Required:
- A 4G router for Internet access
- A monitor, keyboard, and mouse for debugging at the car onsite
- Cables:a Digital Visual Interface (DVI) cable (optional), a customized cable for GPS-LiDAR time synchronization
- Apple iPad Pro: 9.7-inch, Wi-Fi (optional)
The features of the key hardware components are presented in the subsequent sections.
## Onboard Computer System - IPC
The onboard computer system is an industrial PC (IPC) for the autonomous vehicle and uses the **NeousysNuvo-6108GC** that is powered by a sixth-generation Intel Xeon E3 1275 V5 CPU.
The Neousys Nuvo-6108GC is the central unit of the autonomous driving system (ADS).
### IPC Configuration
Configure the IPC as follows:
- ASUS GTX1080 GPU-A8G-Gaming GPU Card
- 32GB DDR4 RAM
- PO-280W-OW 280W AC/DC power adapter
- 2.5" SATA Hard Disk 1TB 7200rpm
### IPC Front and Side Views
The front and rear views of the IPC are shown with the Graphics Processing Unit (GPU) installed in the following pictures:
The front view of the Nuvo-6108GC:

The side view of the Nuvo-6108GC:

For more information about the Nuvo-6108GC, see:

Neousys Nuvo-6108GC Product Page:
[http://www.neousys-tech.com/en/product/application/rugged-embedded/nuvo-6108gc-gpu-computing](http://www.neousys-tech.com/en/product/application/rugged-embedded/nuvo-6108gc-gpu-computing)

Neousys Nuvo-6108GC-Manual:
**[Link Unavailable yet]**
## Controller Area Network (CAN) Card
The CAN card to use with the IPC is **ESD** **CAN-PCIe/402**.

For more information about the CAN-PCIe/402, see:
 ESD CAN-PCIe/402 Product Page:
[https://esd.eu/en/products/can-pcie402](https://esd.eu/en/products/can-pcie402)
## Global Positioning System (GPS) and Inertial Measurement Unit (IMU)
There are **two** GPS-IMU **options** available,and the choice depends upon the one that most fits your needs:
- **Option 1: NovAtel SPAN-IGM-A1**
- **Option 2: NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1**
### Option 1: The NovAtel SPAN-IGM-A1
The NovAtel SPAN-IGM-A1 is an integrated, single-box solution that offers tightly coupled Global Navigation Satellite System (GNSS) positioning and inertial navigation featuring the NovAtel OEM615 receiver.

For more information about the NovAtel SPAN-IGM-A1, see:
 NovAtel SPAN-IGM-A1 Product Page:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
### Option 2: The NovAtel SPAN ProPak6 and NovAtel IMU-IGM-A1
NovAtel ProPak6 is a standalone GNSS receiver. It works with a separate NovAtel- supported IMU (in this case, the NovAtel IMU-IGM-A1)to provide localization.
The ProPak6 provides the latest and most sophisticated enclosure product manufactured by NovAtel.
The IMU-IGM-A1 is an IMU that pairs with a SPAN-enabled GNSS receiver such as the SPAN ProPak6.

For more information about the NovAtel SPAN ProPak6 and the IMU-IGM-A1, see:
 NovAtel ProPak6 Installation & Operation Manual:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel IMU-IGM-A1 Product Page:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview](https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview)
## The GPS Receiver/Antenna
The GPS Receiver/Antenna used with the GPS-IMU component is the **NovAtel GPS-703-GGG-HV**.
**NOTE: **The GPS NovAtelGPS-703-GGG-HV works with either model of the two GPS-IMU options that are described in the previous section, Global Positioning System (GPS) and Inertial Measurement Unit (IMU).

For more information about the NovAtel GPS-703-GGG-HV, see:
 NovAtel GPS-703-GGG-HV Product Page:
[https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/](https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/)
## Light Detection and Ranging System (LiDAR)
The 64 line LiDAR system **HDL-64E S3** is available from Velodyne Lidars, Inc.

**Key Features:**
- 64 Channels
- 120m range
- 2.2 Million Points per Second
- 360° Horizontal FOV
- 26.9° Vertical FOV
- 0.08° angular resolution (azimuth)
- <2cm accuracy
- ~0.4° Vertical Resolution
- User selectable frame rate
- Rugged Design
Webpage for Velodyne HDL-64E S3:
http://velodynelidar.com/hdl-64e.html
# Overview of the Installation Tasks
Installing the hardware and the software components involves these tasks:
**AT THE OFFICE:**
1. Prepare and then install the Controller Area Network (CAN) card by first repositioning the CAN card termination jumper before you insert the card into the slot.
2. Install the hard drive (if none was pre-installed) in the IPC.
You can also choose to replace a pre-installed hard drive if you prefer.
**Recommendations** :
- Install a Solid-State Drive (SSD) for better reliability.
- Use a high-capacity drive if you need to collect driving data.
3. Prepare the IPC for powering up:
a. Attach the power cable to the power connector (terminal block).
b. Connect the monitor, Ethernet, keyboard, and mouse to the IPC.
c. Connect the IPC to a power source.
4. Install the software on the IPC (some Linux experience is required):
a. Install Ubuntu Linux.
b. Install the Apollo Linux kernel.
**IN THE VEHICLE:**
- Make sure that all the modifications for the vehicle, which are listed in the section Prerequisites, have been performed.
- Install the major components (according to the illustrations and the instructions included in this document):
- GPS Antenna
- IPC
- GPS Receiver
- LiDAR
The actual steps to install all of the hardware and software components are detailed in the section, Steps for the Installation Tasks.
# Steps for the Installation Tasks
This section describes the steps to install:
- The key hardware and software components
- The hardware in the vehicle
## At the Office
Perform these tasks:
- Prepare the IPC:
- Install the CAN card
- Install or replace the hard drive
- Prepare the IPC for powering up
- Install the software for the IPC:
- Ubuntu Linux
- Apollo Kernel
- Nvidia GPU Driver
### Preparing the IPC
Follow these steps:
1. Prepare and install the Controller Area Network (CAN) card:
In the Neousys Nuvo-6108GC, ASUS® GTX-1080GPU-A8G-GAMING GPU card is pre-installed into one of the three PCI slots. We still need to install a CAN card into a PCI slot.
a. Locate and unscrew the eight screws (shown in the brown squares or pointed by brown arrows) on the side of computer:
b. Remove the cover from the IPC. 3 PCI slots (one occupied by the graphic card) locate on the base:


c. Set the CAN card termination jumper by removing the red jumper cap (shown in yellow circles) from its default location and placing it at its termination position:

**WARNING**: The CAN card will not work if the termination jumper is not set correctly.
d. Insert the CAN card into the slot in the IPC:

e. Reinstall the cover for the IPC

2. Prepare the IPC for powering up:
a. Attach the power cable to the power connector (terminal block) that comes with the IPC:
**WARNING**: Make sure that the positive(labeled **R** for red) and the negative(labeled **B** for black) wires of the power cable are inserted into the correct holes on the power terminal block.
3. 
b. Connect the monitor, Ethernet cable, keyboard, and mouse to the IPC:
4. 
It is recommended to configure the fan speed through BIOS settings, if one or more plugin card is added to the system
- While starting up the computer, press F2 to enter BIOS setup menu.
- Go to [Advanced] => [Smart Fan Setting]
- Set [Fan Max. Trip Temp] to 50
- Set [Fan Start Trip Temp] to 20
It is recommended that you use a Digital Visual Interface (DVI) connector on the graphic card for the monitor. To set the display to the DVI port on the motherboard, following is the setting procedure:
- While starting up the computer, press F2 to enter BIOS setup menu.
- Go to [Advanced]=>[System Agent (SA) Configuration]=>[Graphics Configuration]=>[Primary Display]=> Set the setting to "PEG"
It is recommended to configure the IPC to run at maximum performance mode at all time:
- While starting up the computer, press F2 to enter BIOS setup menu.
- Go to [Power] => [SKU POWER CONFIG] => set the setting to "MAX. TDP"
c. Connect the power:

### Installing the Software for the IPC
This section describes the steps to install:
- Ubuntu Linux
- Apollo Kernel
- Nvidia GPU Driver
It is assumed that you have experience working with Linux to successfully perform the software installation.
#### Installing Ubuntu Linux
Follow these steps:
1. Create a bootable Ubuntu Linux USB flash drive:
Download Ubuntu (or a variant such as Xubuntu) and follow the online instructions to create a bootable USB flash drive.
It is recommended that you use **Ubuntu 14.04.3**.
You can type F2 during the system boot process to enter the BIOS settings. It is recommended that you disable Quick Boot and Quiet Boot in the BIOS to make it easier to catch any issues in the boot process.
For more information about Ubuntu, see:
 Ubuntu for Desktop web site:
[https://www.ubuntu.com/desktop](https://www.ubuntu.com/desktop)
2. Install Ubuntu Linux:
a. Insert the Ubuntu installation drive into a USB port and turn on the system.
b. Install Linux by following the on-screen instructions.
3. Perform a software update and the installation:
a. Reboot into Linux after the installation is done.
b. Launch the Software Updater to update to the latest software packages (for the installed distribution) or type the following commands in a terminal program such as GNOME Terminal.
```shell
sudo apt-get update; sudo apt-get upgrade
```
c. Launch a terminal program such as GNOME Terminal and type the following command to install the Linux 4.4 kernel:
```shell
sudo apt-get install linux-generic-lts-xenial
```
The IPC must have Internet access to update and install software. Make sure that the Ethernet cable is connected to a network with Internet access. You might need to configure the network for the IPC if the network that it is connected to is not using the Dynamic Host Configuration Protocol (DHCP).
#### Installing the Apollo Kernel
The Apollo runtime in the vehicle requires the [Apollo Kernel](https://github.com/ApolloAuto/apollo-kernel). You are strongly recommended to install the pre-built kernel.
##### Use pre-built Apollo Kernel.
You get access and install the pre-built kernel with the following commands.
1. Download the release packages from the release section on github
```
https://github.com/ApolloAuto/apollo-kernel/releases
```
2. Install the kernel
After having the release package downloaded:
```
tar zxvf linux-4.4.32-apollo-1.5.0.tar.gz
cd install
sudo bash install_kernel.sh
```
3. Reboot your system by the `reboot` command
4. Build the ESD CAN driver source code
Now you need to build the ESD CAN driver source code according to [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)
##### Build your own kernel.
If have modified the kernel, or the pre-built kernel is not the best for your platform, you can build your own kernel with the following steps.
1. Clone the code from repository
```
git clone https://github.com/ApolloAuto/apollo-kernel.git
cd apollo-kernel
```
2. Add the ESD CAN driver source code according to [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)
3. Build the kernel with the following command.
```
bash build.sh
```
4. Install the kernel the same way as using a pre-built Apollo Kernel.
#### Installing Nvidia GPU Driver
The Apollo runtime in the vehicle requires the [Nvidia GPU Driver](http://www.nvidia.com/download/driverResults.aspx/114708/en-us). You are required to install the Nvidia GPU driver with specific options.
1. Download the installation files
```
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/375.39/NVIDIA-Linux-x86_64-375.39.run
```
2. Start the installation
```
sudo bash ./NVIDIA-Linux-x86_64-375.39.run --no-x-check -a -s --no-kernel-module
```
##### Optional: Test the ESD CAN device node
After rebooting the IPC with the new kernel:
a. Create the CAN device node by issuing the following commands in a terminal:
```shell
cd /dev; sudo mknod –-mode=a+rw can0 c 52 0
```
b. Test the CAN device node using the test program that is part of the ESD CAN software package that you have acquired from ESD Electronics.
The IPC is now ready to be mounted on the vehicle.
## In the Vehicle
Perform these tasks:
- Make the necessary modifications to the vehicle as specified in the list of prerequisites
- Install the major components:
- GPS Antenna
- IPC
- GPS Receiver
- LiDAR
### Prerequisites
**WARNING**: Prior to mounting the major components (GPS Antenna, IPC, and GPS Receiver) in the vehicle, certain modifications must be performed as specified in the list of prerequisites. The instructions for making the mandatory changes in the list are outside the scope of this document.
The list of prerequisites are as follows:
- The vehicle must be modified for “drive-by-wire” technology by a professional service company. Also, a CAN interface hookup must be provided in the trunk where the IPC will be mounted.
- A power panel must be installed in the trunk to provide power to the IPC and the GPS-IMU. The power panel would also service other devices in the vehicle such as a 4G LTE router. The power panel should be hooked up to the power system in the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU Antenna and the LiDAR on top of the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU in the trunk.
- A 4G LTE router must be mounted in the trunk to provide Internet access for the IPC. The router must have built-in Wi-Fi access point (AP) capability to connect to other devices, such as an iPad, to interface with the autonomous driving (AD) system. A user would be able to use the mobile device to start AD mode or monitor AD status, for example.
### Diagrams of the Major Component Installations
The following two diagrams indicate the locations of where the three major components (GPS Antenna, IPC, GPS Receiver and LiDAR) should be installed on the vehicle:


### Installing the GPS Receiver and Antenna
This section provides general information about installing **one** of two choices:
- **Option 1:** GPS-IMU: **NovAtel SPAN-IGM-A1**
- **Option 2:** GPS-IMU: **NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1**
#### Option 1: Installing the NovAtel SPAN-IGM-A1
The installation instructions describe the procedures to mount, connect, and take the lever arm measurements for the GPS-IMU NovAtel SPAN-IGM-A1.
##### Mounting
You can place the GPS-IMU NovAtel SPAN-IGM-A1 in most places in the vehicle but it is suggested that you follow these recommendations:
- Place and secure the NovAtel SPAN-IGM-A1 inside the trunk with the Y-axis pointing forward.
- Mount the NovAtel GPS-703-GGG-HV antenna in an unobscured location on top of the vehicle.
##### Wiring
You must connect two cables:
- The antenna cable ─ Connects the GNSS antenna to the antenna port of the SPAN-IGM-A1
- The main cable:
- Connects its 15-pin end to the SPAN-IGM-A1
- Connects its power wires to a power supply of 10-to-30V DC
- Connects its serial port to the IPC. If the power comes from a vehicle battery, add an auxiliary battery (recommended).

Main Cable Connections
For more information, see the *SPAN-IGM™ Quick Start Guide*, page 3, for a detailed diagram:
SPAN-IGM™ Quick Start Guide
[http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf)
##### Taking the Lever Arm Measurement
When the SPAN-IGM-A1 and the GPS Antenna are in position,the distance from the SPAN-IGM-A1 to the GPS Antenna must be measured. The distance should be measured as: X offset, Y offset, and Z offset.
The error of offset must be within one centimeter to achieve high accuracy. For more information, see the *SPAN-IGM™ Quick Start Guide*, page 5, for a detailed diagram.
For an additional information about the SPAN-IGM-A1, see:
SPAN-IGM™ User Manual:
[http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf](http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf)
#### Option 2: Installing NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
The installation instructions describe the procedures to mount, connect, and take the lever arm measurements for the GPS NovAtel SPAN® ProPak6™ **and** the NovAtel IMU-IGM-A1.
##### Components for the Installation
The components that are required for the installation include:
- NovAtel GPS SPAN ProPak6
- NovAtel IMU-IGM-A1
- NovAtel GPS-703-GGG-HV Antenna
- NovAtel GPS-C006 Cable (to connect antenna to GPS)
- NovAtel 01019014 Main Cable (to connect GPS to a serial port the IPC)
- Data Transport Unit (DTU) – similar to a 4G router
- Magnetic adapters (for antenna and DTU)
- DB9 Straight Through Cable
##### Mounting
You can place the two devices, the ProPak6 and the IMU in most places in the vehicle, but it is suggested that you follow these recommendations:
- Place and secure the ProPak6 and the IMU side-by-side inside the trunk with the Y-axis pointing forward.
- Mount the NovAtel GPS-703-GGG-HV antenna on top of the vehicle or on top of the trunk lid as shown:

- Use a magnetic adapter to tightly attach the antenna to the trunk lid.
- Install the antenna cable in the trunk by opening the trunk and placing the cable in the space between the trunk lid and the body of the car.
##### Wiring
Follow these steps to connect the ProPak6 GNSS Receiver and the IMU to the Apollo system:
1. Use the split cable that comes with IMU-IGM-A1 to connect the IMU Main port and theProPak6 COM3/IMU port.
2. Use a USB-A-to-MicroUSB cable to connect the USB port of the IPC and the MicroUSB port of the ProPak6.
3. Connect the other end of the IMU-IGM-A1 split cable to the vehicle power.
4. Connect the GNSS antenna to Propak6.
5. Connect the Propak6 power cable.

For more information about the NovAtel SPAN ProPak6, see:
NovAtel ProPak6 Installation& Operation Manual:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
### Installing the Light Detection and Ranging System (LiDAR)
This section provides descriptions on the installation procedure of HDL-64E S3 LiDAR
#### Mounting
A customized mounting structure is required to successfully mount an HDL64E S3 LiDAR on top of a vehicle. This structure needs to provide rigid support to the LiDAR system while raising the LiDAR to certain height above the ground to avoid the laser beams from the liDAR being blocked by the front and/or rear of the vehicle. The actual height needed for the LiDAR depends on the design of the vehicle and the mounting point of the LiDAR relative to the vehicle. The vertical tilt angle of the lasers normally ranges from +2~-24.8 degrees relative to the horizon. To fully utilize the angle range for detection, on a Lincoln MKZ, we recommend mounting the LiDAR at a minimum height of 1.8 meters (from ground to the base of the LiDAR).
#### Wiring
Each HDL-64E S3 LiDAR includes a cablebundle to connect the LiDAR to power supply, computer (Ethernet for data transfer, and serial port for LiDAR configuration) and GPS timesync source.

1. Connection to the LiDAR
Connect the power and signal cable to the matching ports on the LiDAR

2. Connection to Power Source
The two AWG 16 wires are used to power HDL-64E S3 Lidar. It requires about 3A at 12V. To make connection to the power source, make full contact with the wires and tighten the screws.

3. Conection to IPC
The connection to IPC is through an ethernet cable. Plug the ethernet connector in the cable bundle into an ethernet port on the IPC
4. Connection to GPS:
HDL64E S3 LiDAR requires the Recommended minimum specific GPS/Transit data (GPRMC) and pulse per second (PPS)signal to synchronize to the GPS time. Customized connection is needed to establish the communication between the GPS receiver and the LiDAR:
a. SPAN-IGM-A1
If you configured the SPAN-IGM-A1 as specified in [Configuring the GPS and IMU](#configuring-the-gps-and-imu), the GPRMC signal is sent from the GPS receiver via the User Port cable from the Main port. The PPS signal is sent through the wire cables labeled as “PPS” and “PPS dgnd” from the Aux port. The dash-line boxes in the figure below are available connections that comes with the HDL64E S3 LiDAR and the SPAN-IGM-A1 GPS receiver. The remaining connections need to be made by the user.

b. Propak 6 and IMU-IGM-A1
If you configured the Propak 6 as specified in [Configuring the GPS and IMU](#configuring-the-gps-and-imu), the GPRMC signal is sent from the GPS receiver via COM2 port. The PPS signal is sent through the IO port. The dash-line boxes in the figure below are available connections that comes with the HDL-64E S3 LiDAR and the Propak 6 GPS receiver. The remaining connections need to be made by the user.

5. Connection through serial port for LiDAR configuration
Some of the low-level parameters can be configured through serial port. Within the cable bundle provided by Velodyne Lidar, Inc., there are two pairs of red/black cables as shown in the pinout table below. The thicker pair (AWG 16) is used to power the LiDAR system. The thinner pair is used for serial connection. Connect the black wire (Serial In) to RX, the red wire to Ground of a serial cable. Connect the serial cable with a USB-serial adapter to a computer of choice.

#### Configuration
By default HDL-64E S3 has the network IP address setting as 192.168.0.1. However, when we set up for Apollo, we should to change network IP address to 192.168.20.13 . We can use terminal application with termite3.2 and enter the network setting command. The IP address of HDL-64E S3 can be configured following the steps below:
1. Connect one side of serial cable to your laptop
2. Connect the other side of serial cable to HDL-64E S3’s serial wires
3. COM port default setting
Baudrate: 9600
Parity: None
Data bits: 8
Stop bits: 1
4. COM port application
Download termite3.2 from the link below and install it on your laptop (Windows)
[http://www.compuphase.com/software_termite.htm](http://www.compuphase.com/software_termite.htm)
5. Serial cable connection for COM port between HDL-64E S3 and Laptop

6. Launch **Termite 3.2** from laptop
7. Issue a serial command for setting up HDL-64E S3’s IP addresses over serial port "\#HDLIPA192168020013192168020255"
8. The unit must be power cycled to adopt the new IP addresses

HDL-64E S3 Manual can be found on this webpage:
[http://velodynelidar.com/hdl-64e.html](http://velodynelidar.com/hdl-64e.html)
### Installing the IPC
Follow these steps:
1. Use a voltage converter/regulator to convert the 12 VDC output from the vehicle to desired voltage to power IPC.
As recommended by Neousys, use a 12 VDC to 19 VDC converter with maximal output current of 20 A.

First, connect the two 19 VDC output wires to IPC's power connector (Green as shown below).

Secondly, connect the two cables of 12 VDC input to the power panel in the vehicle. If the size of the wire is too thick, the wire should be splitted to several wires and connect to corresponding ports, respectively.
This step is necessary. If the input voltage goes below the required limit. It is highly probable to cause system failure.
2. Place the onboard computer system, the 6108GC, inside the trunk (recommended).
For example, Apollo 1.5 uses 4x4 self-tapping screws to bolt the 6108GC to the carpeted floor of the trunk. 
3. Mount the IPC so that its front and back sides(where all ports are located) face the right side (passenger) or the left side(driver) of the trunk.
This positioning makes it easier to connect all of the cables.
For more information, see:
Neousys Nuvo-6108GC – Manual:
**[Link Unavailable]**
4. Connect all cables, which include:
- Power cable
- Controller Area Network (CAN) cable
- Ethernet cable from the 4G router to the IPC
- GPS Receiver to the IPC
- (Optional) Monitor, keyboard, mouse
a. Connect the power cable to the IPC (as shown):
b. Connect the other end of the power cable to the vehicle battery (as shown):

c. Connect the DB9 cable to the IPC to talk to the CAN (as shown):

d. Connect:
- the Ethernet cable from the 4G router to the IPC
- the GPS Receiver to the IPC
- (optional) the monitor:

#### Taking the Lever Arm Measurement
Follow these steps:
1. Before taking the measurement, turn on the IPC.
2. When the IMU and the GPS Antenna are in position, the distance from the IMU to the GPS Antenna must be measured. The distance should be measured as: X offset, Yoffset, and Z offset. The error of offset must be within one centimeter to achieve high accuracy in positioning and localization.
For an additional information, see:
NovAtel ProPak6 Installation & Operation Manual:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel SPAN-IGM-A1 Product Page:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
### Configuring the GPS and IMU
Configure the GPS and IMU as shown:
```
WIFICONFIGSTATE OFF
UNLOGALLTHISPORT
SETIMUTOANTOFFSET0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET0 0 0
LOGCOM2 GPRMC ONTIME 1.0 0.25
EVENTOUTCONTROLMARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROLMARK1 ENABLE POSITIVE 500000000 500000000
LOGNCOM1 GPGGA ONTIME 1.0
logbestgnssposb ontime 0.5
logbestgnssvelb ontime 0.5
logbestposb ontime 0.5
logINSPVASB ontime 0.01
logCORRIMUDATASB ontime 0.01
logINSCOVSB ontime 1
logmark1pvab onnew
logimutoantoffsetsb once
logvehiclebodyrotationb onchanged
SAVECONFIG
```
For ProPak6:
```
WIFICONFIG STATE OFF
CONNECTIMU COM3 IMU_ADIS16488
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL OFF
LOG COM2 GPRMC ONTIME 1 0.25
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SAVECONFIG
```
** WARNING:** Modify the **<u>SETIMUTOANTOFFSE</u>T** line based on the actual measurement (of the antenna and the IMU offset).
For example:
```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```
# Setting up the Network
This section provides recommendations for setting up the network.
The IPC that is running the Apollo software must access the Internet to acquire the Real Time Kinematic (RTK) data for accurate localization. A mobile device also needs to connect to the IPC to run the Apollo software.
## Recommendations
Itis recommended that you set up your network according to the following diagram:

Follow these steps:
1. Install and configure a 4G LTE router with Wi-Fi Access Point (AP) capability and Gigabit Ethernet ports.
2. Connect the IPC to the LTE router using an Ethernet cable.
3. Configure the LTE router to access the Internet using the LTE cellular network.
4. Configure the AP capability of the LTE router so that the iPad Pro or another mobile device can connect to the router, and, in turn, connect to the IPC.
It is recommended that you configure a fixed IP instead of using DHCP on the IPC to make it easier to connect to it from a mobile terminal.
# Additional Tasks Required
Youwill use the components that you were required to provide to perform the following tasks:
1. Connect a monitor using the DVI or the HDMI cables and connect the keyboard and mouse to perform debugging tasks at the car onsite.
2. Establish a Wi-Fi connection on the Apple iPad Pro to access the HMI and control the Apollo ADS that is running on the IPC.
# Next Steps
After you complete the hardware installation in the vehicle, see the [Apollo Quick Start](../../../02_Quick%20Start/apollo_1_5_quick_start.md) for the steps to complete the software installation.
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/硬件安装hardware installation/apollo_1_0_hardware_system_installation_guide.md
|
# Apollo 1.0 Hardware and System Installation Guide
* [About This Guide](#about-this-guide)
* [Document Conventions](#document-conventions)
* [Introduction](#introduction)
* [Documentation](#documentation)
* [Key Hardware Components](#key-hardware-components)
* [Additional Components Required](#additional-components-required)
* [Onboard Computer System - IPC](#onboard-computer-system---ipc)
* [IPC Configuration](#ipc-configuration)
* [IPC Front and Rear Views](#ipc-front-and-rear-views)
* [Controller Area Network (CAN) Card](#controller-area-network-(can)-card)
* [Global Positioning System (GPS) and Inertial Measurement Unit (IMU)](#global-positioning-system-(gps)-and-inertial-measurement-unit-(imu))
* [Option 1: The NovAtel SPAN-IGM-A1](#option-1:-the-novatel-span-igm-a1)
* [Option 2: The NovAtel SPAN ProPak6 and NovAtel IMU-IGM-A1](#option-2:-the-novatel-span-propak6-and-novatel-imu-igm-a1)
* [The GPS Receiver/Antenna](#the-gps-receiver/antenna)
* [Overview of the Installation Tasks](#overview-of-the-installation-tasks)
* [Steps for the Installation Tasks](#steps-for-the-installation-tasks)
* [At the Office](#at-the-office)
* [Preparing the IPC](#preparing-the-ipc)
* [Installing the Software for the IPC](#installing-the-software-for-the-ipc)
* [In the Vehicle](#in-the-vehicle)
* [Prerequisites](#prerequisites)
* [Diagrams of the Major Component Installations](#diagrams-of-the-major-component-installations)
* [Installing the GPS Receiver and Antenna](#installing-the-gps-receiver-and-antenna)
* [Installing the IPC](#installing-the-ipc)
* [Configuring the GPS and IMU](#configuring-the-gps-and-imu)
* [Setting up the Network](#setting-up-the-network)
* [Recommendations](#recommendations)
* [Additional Tasks Required](#additional-tasks-required)
* [Next Steps](#next-steps)
# About This Guide
The *Apollo 1.0 Hardware and System Installation Guide* provides the instructions to install all of the hardware components and system software for the **Apollo Project **. The system installation information included pertains to the procedures to download and install the Apollo Linux Kernel.
## Document Conventions
The following table lists the conventions that are used in this document:
| **Icon** | **Description** |
| ----------------------------------- | ---------------------------------------- |
| **Bold** | Emphasis |
| `Mono-space font` | Code, typed data |
| _Italic_ | Titles of documents, sections, and headings Terms used |
|  | **Info** Contains information that might be useful. Ignoring the Info icon has no negative consequences. |
|  | **Tip**. Includes helpful hints or a shortcut that might assist you in completing a task. |
|  | **Online**. Provides a link to a particular web site where you can get more information. |
|  | **Warning**. Contains information that must **not** be ignored or you risk failure when you perform a certain task or step. |
# Introduction
The **Apollo Project** is an initiative that provides an open, complete, and reliable software platform for Apollo partners in the automotive and autonomous driving industries. The aim of this project is to enable these entities to develop their own self-driving systems based on Apollo software stack.
## Documentation
The following set of documentation describes Apollo 1.0:
- ***<u>[Apollo Hardware and System Installation Guide]</u>*** ─ Provides the instructions to install the hardware components and the system software for the vehicle:
- **Vehicle**:
- Industrial PC (IPC)
- Global Positioning System (GPS)
- Inertial Measurement Unit (IMU)
- Controller Area Network (CAN) card
- Hard drive
- GPS Antenna
- GPS Receiver
- **Software**:
- Ubuntu Linux
- Apollo Linux Kernel
- ***<u>[Apollo Quick Start Guide]</u>*** ─ A combination tutorial and roadmap that provide the complete set of end-to-end instructions. The Quick Start Guide also provides links to additional documents that describe the conversion of a regular car to an autonomous-driving vehicle.
# Key Hardware Components
The key hardware components to install include:
- Onboard computer system ─ Neousys Nuvo-5095GC
- Controller Area Network (CAN) Card ─ ESD CAN-PCIe/402-1
- General Positioning System (GPS) and Inertial Measurement Unit (IMU) ─
You can select one of the following options:
- NovAtel SPAN-IGM-A1
- NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
## Additional Components Required
You need to provide these additional components for the Additional Tasks Required:
- A 4G router for Internet access
- A monitor, keyboard, and mouse for debugging at the car onsite
- Cables: Video Graphics Array (VGA) connector, a Digital Visual Interface (DVI) cable (optional)
- Apple iPad Pro: 9.7-inch, Wi-Fi (optional)
The features of the key hardware components are presented in the subsequent sections.
## Onboard Computer System - IPC
The onboard computer system is an industrial PC (IPC) for the autonomous vehicle and uses the **NeousysNuvo-5095GC** that is powered by a sixth-generation Intel Skylake core i7-6700 CPU.
The Neousys Nuvo-5095GC is the central unit of the autonomous driving system (ADS).
### IPC Configuration
Configure the IPC as follows:
- 32GB DDR4 RAM
- MezIO-V20-EP module (with ignition control for in-vehicle usage)
- PO-160W-OW 160W AC/DC power adapter
- CSM2 module (x16 PCIe expansion Gen3 8-lane cassette)
### IPC Front and Rear Views
The front and rear views of the IPC are shown with the Graphics Processing Unit (GPU) installed in the following pictures:
The front view of the Nuvo-5095GC:

The rear view of the Nuvo-5095GC:

For more information about the Nuvo-5095GC, see:

Neousys Nuvo-5095GC Product Page:
[http://www.neousys-tech.com/en/product/application/gpu-computing/product/nuvo-5095gc-gpu-computer](http://www.neousys-tech.com/en/product/application/gpu-computing/product/nuvo-5095gc-gpu-computer)

Neousys Nuvo-5095GC-Manual:
[http://www.neousys-tech.com/en/support/resources/category/162-manual](http://www.neousys-tech.com/en/support/resources/category/162-manual)
## Controller Area Network (CAN) Card
The CAN card to use with the IPC is **ESD** **CAN-PCIe/402**.

For more information about the CAN-PCIe/402, see:
 ESD CAN-PCIe/402 Product Page:
[https://esd.eu/en/products/can-pcie402](https://esd.eu/en/products/can-pcie402)
## Global Positioning System (GPS) and Inertial Measurement Unit (IMU)
There are **two** GPS-IMU **options** available,and the choice depends upon the one that most fits your needs:
- **Option 1: NovAtel SPAN-IGM-A1**
- **Option 2: NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1**
### Option 1: The NovAtel SPAN-IGM-A1
The NovAtel SPAN-IGM-A1 is an integrated, single-box solution that offers tightly coupled Global Navigation Satellite System (GNSS) positioning and inertial navigation featuring the NovAtel OEM615 receiver.

For more information about the NovAtel SPAN-IGM-A1, see:
 NovAtel SPAN-IGM-A1 Product Page:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
### Option 2: The NovAtel SPAN ProPak6 and NovAtel IMU-IGM-A1
NovAtel ProPak6 is a standalone GNSS receiver. It works with a separate NovAtel- supported IMU (in this case, the NovAtel IMU-IGM-A1)to provide localization.
The ProPak6 provides the latest and most sophisticated enclosure product manufactured by NovAtel.
The IMU-IGM-A1 is an IMU that pairs with a SPAN-enabled GNSS receiver such as the SPAN ProPak6.

For more information about the NovAtel SPAN ProPak6 and the IMU-IGM-A1, see:
 NovAtel ProPak6 Installation & Operation Manual:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel IMU-IGM-A1 Product Page:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview](https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview)
## The GPS Receiver/Antenna
The GPS Receiver/Antenna used with the GPS-IMU component is the **NovAtel GPS-703-GGG-HV**.
**NOTE: **The GPS NovAtelGPS-703-GGG-HV works with either model of the two GPS-IMU options that are described in the previous section, Global Positioning System (GPS) and Inertial Measurement Unit (IMU).

For more information about the NovAtel GPS-703-GGG-HV, see:
 NovAtel GPS-703-GGG-HV Product Page:
[https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/](https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/)
# Overview of the Installation Tasks
Installing the hardware and the software components involves these tasks:
**AT THE OFFICE:**
1. Prepare the IPC:
a. Examine the Graphics Processing Unit (GPU) cassette to determine if you need to remove the GPU card (if it was pre-installed).
b. Prepare and then install the Controller Area Network (CAN) card by first repositioning the CAN card termination jumper before you insert the card into the slot.
2. Install the hard drive (if none was pre-installed) in the IPC.
You can also choose to replace a pre-installed hard drive if you prefer.
**Recommendations** :
- Install a Solid-State Drive (SSD) for better reliability.
- Use a high-capacity drive if you need to collect driving data.
3. Prepare the IPC for powering up:
a. Attach the power cable to the power connector (terminal block).
b. Connect the monitor, Ethernet, keyboard, and mouse to the IPC.
c. Connect the IPC to a power source.
4. Install the software on the IPC (some Linux experience is required):
a. Install Ubuntu Linux.
b. Install the Apollo Linux kernel.
**IN THE VEHICLE:**
- Make sure that all the modifications for the vehicle, which are listed in the section Prerequisites, have been performed.
- Install the major components (according to the illustrations and the instructions included in this document):
- GPS Antenna
- IPC
- GPS Receiver
The actual steps to install all of the hardware and software components are detailed in the section, Steps for the Installation Tasks.
# Steps for the Installation Tasks
This section describes the steps to install:
- The key hardware and software components
- The hardware in the vehicle
## At the Office
Perform these tasks:
- Prepare the IPC:
- Install the CAN card
- Install or replace the hard drive
- Prepare the IPC for powering up
- Install the software for the IPC:
- Ubuntu Linux
- Apollo Kernel
### Preparing the IPC
Follow these steps:
1. In the IPC, examine the GPU cassette to determine if there is a pre-installed GPU card, which you need to remove:
a. Turn over the IPC to unscrew the four screws (shown in the purple squares) on the bottom of computer that are holding the GPU cassette in place:

b. Remove the GPU cassette from the IPC:

c. Remove the GPU cassette from the IPC: Unscrew three additional screws (shown in the purple circles) on the bottom of the GPU cassette to open the cover:

d. Remove the GPU card (if installed):

2. Prepare and install the CAN card:
a. Set the CAN card termination jumper by removing the red jumper cap (shown in yellow circles) from its default location and placing it at its termination position:

**WARNING**: The CAN card will not work if the termination jumper is not set correctly.
b. Insert the CAN card into the slot in the IPC:

c. Reinstall the GPU cassette in the IPC:

3. Install or replace the hard drive.
You need to install one or two 2.5” SSD or hard drives if none have been pre-installed. As an alternative, you might want to replace a pre-installed hard drive with one of your own (say, an SSD).
 An SSD drive is highly recommended for better reliability. Also consider using a high-capacity drive if you need to collect driving data.
To install the hard drive:
a. Unscrew the three screws (shown in the purple circles) to open the hard drive cover (caddy):

b. Install the drive in the caddy (as shown with an Intel SSD):
 Observe the way the hard drive is situated in the caddy for the installation.
The Serial Advanced Technology Attachment (SATA) and the power connectors should be placed in the caddy facing the end that has the **two** screw holes showing.

The hard drive in the caddy is now connected:

c. Reinstall the SSD caddy in the IPC:

4. Prepare the IPC for powering up:
a. Attach the power cable to the power connector(terminal block) that comes with the IPC:
**WARNING**: Make sure that the positive(labeled **R** for red) and the negative(labeled **B** for black) wires of the power cable are inserted into the correct holes on the power terminal block.

b. Connect the monitor, Ethernet cable, keyboard, and mouse to the IPC:

It is recommended that you use a Video Graphics Array (VGA) connector for the monitor for these reasons:
- If you do not see any screen display when the IPC boots up, switch to the VGA input. The Neousys Nuvo-5095GC IPC **always** outputs to a **VGA port** even if there is no monitor connected. Consequently, the Linux installer might “elect” to output to a VGA port instead of a DVI port.
- If you do not see a dialog window during the installation process when using a dual-monitor setup, try switching between VGA and DVI to find it. The Linux installer might detect two monitors and use them both.
For better display quality, you have the option to:
- Connect to another monitor using a DVI cable, or a High-Definition Multimedia Interface (HMI) with DVI-HMI adapter
- Use the DVI/HDMI port on the same monitor
c. Connect the power:

### Installing the Software for the IPC
This section describes the steps to install:
- Ubuntu Linux
- Apollo Kernel
It is assumed that you have experience working with Linux to successfully perform the software installation.
#### Installing Ubuntu Linux
Follow these steps:
1. Create a bootable Ubuntu Linux USB flash drive:
Download Ubuntu (or a variant such as Xubuntu) and follow the online instructions to create a bootable USB flash drive.
It is recommended that you use **Ubuntu 14.04.3**.
You can type F2 during the system boot process to enter the BIOS settings. It is recommended that you disable Quick Boot and Quiet Boot in the BIOS to make it easier to catch any issues in the boot process.
For more information about Ubuntu, see:
 Ubuntu for Desktop web site:
[https://www.ubuntu.com/desktop](https://www.ubuntu.com/desktop)
2. Install Ubuntu Linux:
a. Insert the Ubuntu installation drive into a USB port and turn on the system.
b. Install Linux by following the on-screen instructions.
3. Perform a software update and the installation:
a. Reboot into Linux after the installation is done.
b. Launch the Software Updater to update to the latest software packages (for the installed distribution) or type the following commands in a terminal program such as GNOME Terminal.
```shell
sudo apt-get update; sudo apt-get upgrade
```
c. Launch a terminal program such as GNOME Terminal and type the following command to install the Linux 4.4 kernel:
```shell
sudo apt-get install linux-generic-lts-xenial
```
The IPC must have Internet access to update and install software. Make sure that the Ethernet cable is connected to a network with Internet access. You might need to configure the network for the IPC if the network that it is connected to is not using the Dynamic Host Configuration Protocol (DHCP).
#### Installing the Apollo Kernel
The Apollo runtime in the vehicle requires the [Apollo Kernel](https://github.com/ApolloAuto/apollo-kernel). You are strongly recommended to install the pre-built kernel.
##### Use pre-built Apollo Kernel.
You get access and install the pre-built kernel with the following commands.
1. Download the release packages from the release section on github
```
https://github.com/ApolloAuto/apollo-kernel/releases
```
2. Install the kernel
After having the release package downloaded:
```
tar zxvf linux-4.4.32-apollo-1.0.0.tar.gz
cd install
sudo bash install_kernel.sh
```
3. Reboot your system by the `reboot` command
4. Build the ESD CAN driver source code
Now you need to build the ESD CAN driver source code according to [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)
##### Build your own kernel.
If have modified the kernel, or the pre-built kernel is not the best for your platform, you can build your own kernel with the following steps.
1. Clone the code from repository
```
git clone https://github.com/ApolloAuto/apollo-kernel.git
cd apollo-kernel
```
2. Add the ESD CAN driver source code according to [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)
3. Build the kernel with the following command.
```
bash build.sh
```
4. Install the kernel the same way as using a pre-built Apollo Kernel.
##### Optional: Test the ESD CAN device node
After rebooting the IPC with the new kernel:
a. Create the CAN device node by issuing the following commands in a terminal:
```shell
cd /dev; sudo mknod –-mode=a+rw can0 c 52 0
```
b. Test the CAN device node using the test program that is part of the ESD CAN software package that you have acquired from ESD Electronics.
The IPC is now ready to be mounted on the vehicle.
## In the Vehicle
Perform these tasks:
- Make the necessary modifications to the vehicle as specified in the list of prerequisites
- Install the major components:
- GPS Antenna
- IPC
- GPS Receiver
### Prerequisites
**WARNING**: Prior to mounting the major components (GPS Antenna, IPC, and GPS Receiver) in the vehicle, certain modifications must be performed as specified in the list of prerequisites. The instructions for making the mandatory changes in the list are outside the scope of this document.
The list of prerequisites are as follows:
- The vehicle must be modified for “drive-by-wire” technology by a professional service company. Also, a CAN interface hookup must be provided in the trunk where the IPC will be mounted.
- A power panel must be installed in the trunk to provide power to the IPC and the GPS-IMU. The power panel would also service other devices in the vehicle such as a 4G LTE router. The power panel should be hooked up to the power system in the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU Antenna on top of the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU in the trunk.
- A 4G LTE router must be mounted in the trunk to provide Internet access for the IPC. The router must have built-in Wi-Fi access point (AP) capability to connect to other devices, such as an iPad, to interface with the autonomous driving (AD) system. A user would be able to use the mobile device to start AD mode or monitor AD status, for example.
### Diagrams of the Major Component Installations
The following two diagrams indicate the locations of where the three major components (GPS Antenna, IPC, and GPS Receiver) should be installed on the vehicle:


### Installing the GPS Receiver and Antenna
This section provides general information about installing **one** of two choices:
- **Option 1:** GPS-IMU: **NovAtel SPAN-IGM-A1**
- **Option 2:** GPS-IMU: **NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1**
#### Option 1: Installing the NovAtel SPAN-IGM-A1
The installation instructions describe the procedures to mount, connect, and take the lever arm measurements for the GPS-IMU NovAtel SPAN-IGM-A1.
##### Mounting
You can place the GPS-IMU NovAtel SPAN-IGM-A1 in most places in the vehicle but it is suggested that you follow these recommendations:
- Place and secure the NovAtel SPAN-IGM-A1 inside the trunk with the Y-axis pointing forward.
- Mount the NovAtel GPS-703-GGG-HV antenna in an unobscured location on top of the vehicle.
##### Wiring
You must connect two cables:
- The antenna cable ─ Connects the GNSS antenna to the antenna port of the SPAN-IGM-A1
- The main cable:
- Connects its 15-pin end to the SPAN-IGM-A1
- Connects its power wires to a power supply of 10-to-30V DC
- Connects its serial port to the IPC. If the power comes from a vehicle battery, add an auxiliary battery (recommended).

Main Cable Connections
For more information, see the *SPAN-IGM™ Quick Start Guide*, page 3, for a detailed diagram:
SPAN-IGM™ Quick Start Guide
[http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf)
##### Taking the Lever Arm Measurement
When the SPAN-IGM-A1 and the GPS Antenna are in position,the distance from the SPAN-IGM-A1 to the GPS Antenna must be measured. The distance should be measured as: X offset, Y offset, and Z offset.
The error of offset must be within one centimeter to achieve high accuracy. For more information, see the *SPAN-IGM™ Quick Start Guide*, page 5, for a detailed diagram.
For an additional information about the SPAN-IGM-A1, see:
SPAN-IGM™ User Manual:
[http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf](http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf)
#### Option 2: Installing NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
The installation instructions describe the procedures to mount, connect, and take the lever arm measurements for the GPS NovAtel SPAN® ProPak6™ **and** the NovAtel IMU-IGM-A1.
##### Components for the Installation
The components that are required for the installation include:
- NovAtel GPS SPAN ProPak6
- NovAtel IMU-IGM-A1
- NovAtel GPS-703-GGG-HV Antenna
- NovAtel GPS-C006 Cable (to connect antenna to GPS)
- NovAtel 01019014 Main Cable (to connect GPS to a serial port the IPC)
- Data Transport Unit (DTU) – similar to a 4G router
- Magnetic adapters (for antenna and DTU)
- DB9 Straight Through Cable
##### Mounting
You can place the two devices, the ProPak6 and the IMU, inmost places in the vehicle but it is suggested that you follow these recommendations:
- Place and secure the ProPak6 and the IMU side-by-side inside the trunk with the Y-axis pointing forward.
- Mount the NovAtel GPS-703-GGG-HV antenna on top of the vehicle or on top of the trunk lid as shown:

- Use a magnetic adapter to tightly attach the antenna to the trunk lid.
- Install the antenna cable in the trunk by opening the trunk and placing the cable in the space between the trunk lid and the body of the car.
##### Wiring
Follow these steps to connect the ProPak6 GNSS Receiver and the IMU to the Apollo system:
1. Use the split cable that comes with IMU-IGM-A1 to connect the IMU Main port and theProPak6 COM3/IMU port.
2. Use a USB-A-to-MicroUSB cable to connect the USB port of the IPC and the MicroUSB port of the ProPak6.
3. Connect the other end of the IMU-IGM-A1 split cable to the vehicle power.
4. Connect the GNSS antenna to Propak6.
5. Connect the Propak6 power cable.

For more information about the NovAtel SPAN ProPak6, see:
NovAtel ProPak6 Installation& Operation Manual:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
### Installingthe IPC
Follow these steps:
1. Use a power cable to connect the vehicle power source to the IPC:
Use its power connector as one end  , and connect the other end to the power panel in the vehicle(see the section, Prerequisites).
2. Place the onboard computer system, the 5059GC,inside the trunk (recommended).
For example, Apollo 1.0 uses 4x4 self-tapping screws to bolt the 5059GC to the carpeted floor of the trunk. 
3. Mount the IPC so that its front and back sides(where all ports are located) face the right side (passenger) and the left side(driver) of the trunk.
This positioning makes it easier to connect all of the cables.
For more information, see:
Neousys Nuvo-5095GC – Manual:
[http://www.neousys-tech.com/en/support/resources/category/162-manual](http://www.neousys-tech.com/en/support/resources/category/162-manual)
4. Connect all cables, which include:
- Power cable
- Controller Area Network (CAN) cable
- Ethernet cable from the 4G router to the IPC
- GPS Receiver to the IPC
- (Optional) Monitor, keyboard, mouse
a. Connect the power cable to the IPC (as shown):

b. Connect the other end of the power cable to the vehicle battery (as shown):

c. Connect the DB9 cable to the IPC to talk to the CAN (as shown):

d. Connect:
- the Ethernet cable from the 4G router to the IPC (labeled as Router)
- the GPS Receiver to the IPC (labeled as GPSIMU)
- (optional) the monitor (labeled as Monitor):

#### Taking the Lever Arm Measurement
Follow these steps:
1. Before taking the measurement, turn on the IPC.
2. When the IMU and the GPS Antenna are in position, the distance from the IMU to the GPS Antenna must be measured. The distance should be measured as: X offset, Yoffset, and Z offset.
The error of offset must be within one centimeter to achieve high accuracy in positioning and localization.
For an additional information, see:
NovAtel ProPak6 Installation & Operation Manual:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel SPAN-IGM-A1 Product Page:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
### Configuring the GPS and IMU
Configure the GPS and IMU as shown:
```
WIFICONFIGSTATE OFF
UNLOGALLTHISPORT
SETIMUTOANTOFFSET0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET0 0 0
LOGCOM2 GPRMC ONTIME 1.0 0.25
EVENTOUTCONTROLMARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROLMARK1 ENABLE POSITIVE 500000000 500000000
LOGNCOM1 GPGGA ONTIME 1.0
logbestgnssposb ontime 0.5
logbestgnssvelb ontime 0.5
logbestposb ontime 0.5
logINSPVASB ontime 0.01
logCORRIMUDATASB ontime 0.01
logINSCOVSB ontime 1
logmark1pvab onnew
logimutoantoffsetsb once
logvehiclebodyrotationb onchanged
SAVECONFIG
```
For ProPak6:
```
WIFICONFIG STATE OFF
CONNECTIMU COM3 IMU_ADIS16488
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL OFF
LOG COM2 GPRMC ONTIME 1 0.25
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SAVECONFIG
```
** WARNING:** Modify the **<u>SETIMUTOANTOFFSE</u>T** line based on the actual measurement (of the antenna and the IMU offset).
For example:
```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```
# Setting up the Network
This section provides recommendations for setting up the network.
The IPC that is running the Apollo software must access the Internet to acquire the Real Time Kinematic (RTK) data for accurate localization. A mobile device also needs to connect to the IPC to run the Apollo software.
## Recommendations
Itis recommended that you set up your network according to the following diagram:

Follow these steps:
1. Install and configure a 4G LTE router with Wi-Fi Access Point (AP) capability and Gigabit Ethernet ports.
2. Connect the IPC to the LTE router using an Ethernet cable.
3. Configure the LTE router to access the Internet using the LTE cellular network.
4. Configure the AP capability of the LTE router so that the iPad Pro or another mobile device can connect to the router, and, in turn, connect to the IPC.
It is recommended that you configure a fixed IP instead of using DHCP on the IPC to make it easier to connect to it from a mobile terminal.
# Additional Tasks Required
Youwill use the components that you were required to provide to perform the following tasks:
1. Connect a monitor using the DVI or the HDMI cables and connect the keyboard and mouse to perform debugging tasks at the car onsite.
2. Establish a Wi-Fi connection on the Apple iPad Pro to access the HMI and control the Apollo ADS that is running on the IPC.
# Next Steps
After you complete the hardware installation in the vehicle, see the [Apollo Quick Start](../../../02_Quick%20Start/apollo_1_0_quick_start.md) for the steps to complete the software installation.
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/硬件安装hardware installation/apollo_3_0_hardware_system_installation_guide_cn.md
|
# Apollo 3.0 硬件与系统安装指南
* [关于本指南](#关于本指南)
* [文档约定](#文档约定)
* [引言](#引言)
* [软硬件信息](#软硬件信息)
* [关键硬件](#关键硬件)
* [附加组件](#附加组件)
* [安装步骤](#安装步骤)
* [实验室安装](#实验室安装)
* [车辆安装](#车辆安装)
* [先决条件](#先决条件)
* [主要组件安装示意图](#主要组件安装示意图)
* [附加组件](#附加组件)
* [后续步骤](#后续步骤)
## 关于本指南
*Apollo3.0硬件与系统安装指南*详细介绍了Apollo计划的硬件组件、系统软件安装,安装过程包含下载和安装Apollo Linux内核。
### 文档约定
下述表格列举了在本文档中使用的标识符约定:
| **图标** | **描述** |
| ----------------------------------- | ---------------------------------------- |
| **粗体** | 重点强调 |
| `等宽字体` | 代码,类型数据 |
| _斜体_ | 标题、章节和标题使用的术语 |
|  | **Info** 包含可能有用的信息。忽略信息图标没有消极的后果。 |
|  | **Tip**. 包括有用的提示或可能有助于完成任务的快捷方式。 |
|  | **Online**. 提供指向特定网站的链接,您可以在其中获取更多信息。 |
|  | **Warning**. 包含**不能忽略**的信息,否则在执行某个任务或步骤时,您将面临失败的风险。 |
## 引言
**Apollo Project** 是为汽车和自主驾驶行业的合作伙伴提供开放,完整和可靠的软件平台。该项目的目的是使合作伙伴能够基于Apollo软件套件开发自己的自动驾驶系统。
### 软硬件信息
- ***<u>【Apollo硬件与系统安装指南】</u>*** ─ 链接到Specs中的硬件开发平台文档
- **车辆**:
- [工业级PC](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/IPC/Nuvo-6108GC_Installation_Guide_cn.md)
- [全球定位系统(GPS)](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Navigation/README_cn.md)
- [惯性计算单元(IMU)](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Navigation/README_cn.md)
- 区域网络控制卡(CAN)
- GPS天线
- GPS接收器
- [激光雷达(LiDAR)](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Lidar/README.md)
- [摄像机](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Camera/README.md)
- [雷达](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Radar/README.md)
- [Apollo传感器单元(ASU)](../../../10Hardware%20Integration%20and%20Calibration/%E8%BD%A6%E8%BE%86%E9%9B%86%E6%88%90/%E4%BC%A0%E6%84%9F%E5%99%A8%E5%AE%89%E8%A3%85%20sensor%20installation/Apollo_Sensor_Unit/Apollo_Sensor_Unit_Installation_Guide_cn.md)
- **Software**:
- Ubuntu Linux
- Apollo Linux 内核
- NVIDIA GPU 驱动
- ***<u>【Apollo快速入门指南】</u>*** ─ 包含了教程和提供有从头至尾完整指令序列的执行路径图的文档。快速入门指南同时链接到描述将普通车辆改装成自动驾驶车辆的操作步骤的文档。
## 关键硬件
需要安装的关键硬件包括:
- 车载计算机系统 ─ Neousys Nuvo-6108GC
- 区域网络控制卡(CAN) ─ ESD CAN-PCIe/402-B4
- 全球定位系统(GPS)和惯性计算单元(IMU) ─ 使用者可以从下述选择中任选一种:
- NovAtel SPAN-IGM-A1
- NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
- Navtech NV-GI120
- 激光雷达 ─ 使用者可以从下述选择中任选一种:
- Velodyne HDL-64E S3
- Velodyne Puck series
- Innovusion LiDAR
- Hesai's Pandora
- 摄像机 — 使用者可以从下述选择中任选一种:
- Leopard Imaging LI-USB30-AR023ZWDR with USB 3.0 case
- Argus Camera
- Wissen Camera
- 雷达 — 使用者可以从下述选择中任选一种:
- Continental ARS408-21
- Delphi ESR 2.5
- Racobit B01HC
### 附加组件
使用者需要提供附加组件以完成额外的安装任务:
- Apollo传感器单元(ASU)
- 提供网络接入的4G路由器
- 提供额外USB接口的USB集线器
- 供在车辆现场调试使用的显示器、键盘和鼠标
- 数据线:数字视频接口线(DVI)(可选),供GPS和激光雷达进行时间同步的定制数据线
- 苹果iPad Pro:9.7寸(可选)
这些关键硬件的特性将在后续章节中介绍。
## 安装步骤
本章节介绍的安装步骤包括:
- 关键软硬件组件
- 车辆中的硬件
### 实验室安装
执行如下安装步骤:
- 准备IPC
- 安装CAN卡
- 安装或替换硬盘驱动器
- 安装为IPC加电的组件
- 为IPC安装软件:
- Unbuntu Linux
- Apollo内核
- NVIDIA GPU驱动
至此,可以将IPC挂载到车辆上。
### 车辆安装
执行如下安装步骤:
- 确保所有在先决条件中列出的对车辆的修改都已执行
- 安装主要组件
- GPS天线
- IPC
- GPS接收器和IMU
- 激光雷达
- 摄像机
- 雷达
#### 先决条件
**注意**:在将主要部件(GPS天线,IPC和GPS接收器)安装在车辆之前,必须按照先决条件列表所述执行必要修改。 列表中所述强制性更改的部分,不属于本文档的范围。
先决条件为:
- 车辆必须由专业服务公司修改为“线控”技术。 此外,必须在要安装IPC的中继线上提供CAN接口连接。
- 必须在后备箱中安装电源插板,为IPC和GPS-IMU提供电源。电源插板还需要服务于车上的其他硬件,比如4G的路由器。电源插板应连接到车辆的电源系统。
- 必须安装定制的机架,将GPS-IMU天线安装在车辆的顶部。
- 必须安装定制的机架,以便将GPS-IMU安装在后背箱中。
- 必须安装定制的机架,以便将前向雷达安装在车辆前部。
- 必须将4G LTE路由器安装在后备箱中才能为IPC提供Internet访问。路由器必须具有内置Wi-Fi接入点(AP)功能,以连接到其他设备(如iPad),以与自主驾驶(AD)系统相连接。例如,用户将能够使用移动设备来启动AD模式或监视AD状态。
#### 主要组件安装示意图
以下两图中标明了三个主要组件(GPS天线,IPC,GPS接收器和LiDAR)在车辆上的安装位置:


## 额外安装任务
使用者使用已提供的额外组件实现如下的安装任务:
1. 使用DVI线或HDMI线连接显示器,并连接鼠标和键盘实现车辆现场调试功能。
1. 在Apple iPad Pro上建立一个Wi-Fi连接以访问HMI和控制在IPC上运行的Apollo自动驾驶系统(ADS)。
## 后续步骤
当完成车辆的的硬件安装后,参考[Apollo 快速入门指南](../../../02_Quick%20Start/apollo_3_0_quick_start_cn.md)以获取完整的软件安装步骤。
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/硬件安装hardware installation/apollo_1_0_hardware_system_installation_guide_cn.md
|
# Apollo 1.0 Hardware and System Installation Guide
- [关于本篇指南](#关于本篇指南)
- [文档编写规则](#文档编写规则)
- [引言](#引言)
- [文档说明](#文档说明)
- [核心硬件部件](#核心硬件部件)
- [额外的部件](#额外的部件)
- [车载计算机系统-IPC](#车载计算机系统-ipc)
- [IPC 的配置](#ipc的配置)
- [IPC 前后视图](#ipc前后视图)
- [控制器局域网络(CAN)卡](#控制器局域网络(-can)卡)
- [全球定位系统(GPS)和惯性测量装置(IMU)](<#全球定位系统(gps)和惯性测量装置(imu)>)
- [选项 1: NovAtel SPAN-IGM-A1](#选项1:nocatel-span--igm--a1)
- [选项 2: NovAtel SPAN ProPak6 和 NovAtel IMU-IGM-A1](#选项2:novatel-span-propak6和-imu--igm--a1)
- [GPS 接收器和天线](#gps接收器和天线)
- [安装任务概览](#安装任务概览)
- [安装任务步骤](#安装任务步骤)
- [上车前的准备工作](#上车前的准备工作)
- [IPC 的准备工作](#ipc的准备工作)
- [为 IPC 安装软件](#为ipc安装软件)
- [上车安装](#上车安装)
- [前提条件](#前提条件)
- [主要部件安装图](#主要部件安装图)
- [安装 GPS 的接收器和天线](#安装gps的接收器和天线)
- [安装 IPC](#安装ipc)
- [配置 GPS 和 IMU](#配置gps和imu)
- [配置网络](#配置网络)
- [一些建议](#一些建议)
- [其它安装任务](#其它安装任务)
- [下一步](#下一步)
# 关于本篇指南
本篇指南提供了所有安装硬件部分和 Apollo 项目所需的教程。系统安装信息包括下载和安
装 Apollo Linux 内核的过程。
## 文档编写规则
下表列出了本文使用的编写规则:
| **图标** | **描述** |
| -------------------------------- | ----------------------------------------------------------------------- |
| **加粗** | 强调。 |
| `Mono-space 字体` | 代码, 类型数据。 |
| _斜体_ | 文件、段落和标题中术语的用法。 |
|  | **信息** 提供了可能有用的信息。忽略此信息可能会产生不可预知的后果。 |
|  | **提醒** 包含有用的提示或者可以帮助你完成安装的快捷步骤。 |
|  | **在线** 提供指向特定网站的链接,您可以在其中获取更多信息。 |
|  | **警告** 包含 **不能** 被忽略的内容,如果忽略,当前安装步骤可能会失败。 |
# 引言
**Apollo**项目旨在为汽车和自动驾驶行业的合作伙伴提供开放,完整和可靠的软件平台。
该项目的目的是使这些企业能够开发基于 Apollo 软件栈的自动驾驶系统。
## 文档说明
以下文档适用于 Apollo 1.0:
- **_<u>[Apollo Hardware and System Installation Guide]</u>_** ─ 提供用于安装车
辆的硬件部件和系统软件的教程:
- **车辆**:
- 工业用计算机 (IPC)
- 全球定位系统 (GPS)
- 惯性测量单元 (IMU)
- 控制器局域网络 (CAN) 卡
- 硬盘
- GPS 天线
- GPS 接收器
- **软件**:
- Ubuntu Linux
- Apollo Linux Kernel
- **_<u>[Apollo Quick Start Guide]</u>_** ─ 文档和蓝图的组合提供了完整的端到端教
程。本文还提供了一些其它文档链接描述了如何将一辆普通汽车改装成一辆自动驾驶车辆
。
# 核心硬件部件
需要安装的核心硬件部件包括:
- 车载计算机系统 ─ Neousys Nuvo-5095GC
- CAN 卡 ─ ESD CAN-PCIe/402-1
- GPS 和 IMU ─ 可选项如下:
- NovAtel SPN-IGM-A1
- NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
## 额外的部件
你需要额外的部件支持以下任务:
- 联网需要 4G 路由器
- 在车上调试需要显示器,键盘和鼠标
- VGA 连接器,DVI 线(可选)
- 苹果 iPad Pro: 9.7 寸, Wi-Fi (可选)
核心硬件部件的功能将在后续章节中介绍。
## 车载计算机系统-IPC
车载计算机系统是用于自动驾驶车辆的工业 PC(IPC),并使用由第六代 Intel Skylake
core i7-6700 CPU 强力驱动的 **NeousysNuvo-5095GC**。
Neousys Nuvo-5095GC 是自动驾驶系统(ADS)的中心单元。
### IPC 的配置
IPC 配置如下:
- 32GB DDR4 RAM
- MezIO-V20-EP module (具有车用点火装置)
- PO-160W-OW 160W 交流、直流电源适配器
- CSM2 module (x16 PCIe expansion Gen3 8-lane cassette)
### IPC 前后视图
安装了 GPU 的 IPC 前后视图如下:
Nuvo-5095GC 的前视图:

Nuvo-5095GC 的后视图:

更多关于 Nuvo-5095GC 的信息,请参考:
 Neousys Nuvo-5095GC 的产品页:
[http://www.neousys-tech.com/en/product/application/gpu-computing/product/nuvo-5095gc-gpu-computer](http://www.neousys-tech.com/en/product/application/gpu-computing/product/nuvo-5095gc-gpu-computer)
 Neousys Nuvo-5095GC-手册:
[http://www.neousys-tech.com/en/support/resources/category/162-manual](http://www.neousys-tech.com/en/support/resources/category/162-manual)
## 控制器局域网络(CAN)卡
IPC 中使用的 CAN 卡型号是 **ESD** **CAN-PCIe/402**.

更多 CAN-PCIe/402 的信息,请参考:
 ESD CAN-PCIe/402 产品页:
[https://esd.eu/en/products/can-pcie402](https://esd.eu/en/products/can-pcie402)
##全球定位系统(GPS)和惯性测量装置(IMU)
有 **两种** GPS-IMU **选择** ,您只需根据您的需求进行选择:
- **选项 1: NovAtel SPAN-IGM-A1**
- **选项 2: NovAtel SPAN® ProPak6™ 和 NovAtel IMU-IGM-A1**
###选项 1: NovAtel SPAN-IGM-A1
NovAtel SPAN-IGM-A1 是一个集成的,单盒的解决方案,提供紧密耦合的全球导航卫星系统
(GNSS)定位和具有 NovAtel OEM615 接收机的惯性导航功能。

更多关于 NovAtel SPAN-IGM-A1 的信息,请参考:
 NovAtel SPAN-IGM-A1 产品页:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
###选项 2: NovAtel SPAN ProPak6 和 NovAtel IMU-IGM-A1
NovAtel ProPak6 是独立的 GNSS 接收机,它与 NovAtel 提供的独立 IMU(本例中为
NovAtel IMU-IGM-A1)相融合以提供定位。
ProPak6 提供由 NovAtel 生产的最新最先进的外壳产品。
IMU-IGM-A1 是与支持 SPAN 的 GNSS 接收器(如 SPAN ProPak6)配对的 IMU。

更多关于 NovAtel SPAN ProPak6 和 the IMU-IGM-A1 的信息,请参考:
 NovAtel ProPak6 安装与操作手册:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
 NovAtel IMU-IGM-A1 产品页:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview](https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview)
## GPS 接收器和天线
GPS-IMU 组件的 GPS 接收器、天线使用的是 **NovAtel GPS-703-GGG-HV**。
**注意:** GPS NovAtelGPS-703-GGG-HV 与上文中提到的两个 GPS-IMU 选项的任一型号配
合使用。

更多关于 NovAtel GPS-703-GGG-HV 的信息,请参考:
 NovAtel GPS-703-GGG-HV 产品页:
[https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/](https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/)
# 安装任务概览
安装硬件和软件组件涉及以下任务:
**上车前的准备工作**
1. 准备 IPC: a. 检查图形处理单元(GPU)磁带,以确定是否需要卸下 GPU 卡(如果已
预安装) b. 在将卡插入插槽之前,首先重新定位 CAN 卡端接跳线,准备并安装控制器
局域网(CAN)卡。
2. IPC(如果未预装)安装硬盘,推荐安装固态硬盘; 如果你愿意,也可以更换预装的硬
盘;
**推荐** :
- 为了更好的可靠性,安装固态硬盘;
- 如果需要收集驾驶数据,需要使用大容量硬盘;
3. 准备 IPC 加电: a. 将电源线连接到电源连接器(接线端子) b. 将显示器,以太网,
键盘和鼠标连接到 IPC c. 将 IPC 连接到电源
4. 在 IPC 安装软件(需要部分 Linux 经验): a. 安装 Ubuntu Linux. b. 安装 Apollo
Linux kernel.
**上车安装:**
- 确保所有在前提条件中列出的对车辆的修改,都已执行。
- 安装主要的组件:
- GPS 天线
- IPC
- GPS 接收器
安装所有硬件和软件组件的实际步骤详见安装任务步骤。
# 安装任务步骤
该部分包含:
- 关键组件的安装
- 车辆硬件的安装
## 上车前的准备工作
有如下任务:
- 准备 IPC:
- 安装 CAN 卡
- 安装或者替换硬盘
- 准备为 IPC 供电
- 为 IPC 安装软件:
- Ubuntu Linux
- Apollo Kernel
### IPC 的准备工作
有如下步骤:
1. 在 IPC 中,检查 GPU 卡槽,如果有预先装好的 GPU 卡,需要先把它移除:
a. 在 IPC 底部找到四个固定 GPU 卡槽的螺丝并拧下来(如图中紫框内所示):

b. 把 GPU 卡槽从 IPC 上取出:

c. 把 GPU 卡槽从 IPC 上取下来:拧下底部其它三个螺丝以打开盒盖(如图中紫框所示
):

d. 取下 GPU 卡(如果安装了):

2. 准备并安装 CAN 卡
a. 通过从其默认位置移除红色跳线帽(以黄色圆圈显示)并将其放置在其终止位置,设
置 CAN 卡端接跳线: 
**WARNING**: 如果端接跳线设置不正确,CAN
卡将无法正常工作。
b. 将 CAN 卡插入 IPC 的插槽:

c. 把 GPU 卡槽重新装回 IPC:

3. 安装或替换硬盘
IPC(如果未预装)安装硬盘,您需要安装 1 至 2 个 2.5”的 SSD 或硬盘。推荐安装固
态硬盘; 如果您愿意,也可以更换预装的硬盘;
 为了更好的可靠性,强烈推荐您安装 SSD。如果您
需要手机数据,建议您使用大容量硬盘。
安装硬盘:
a. 拧下三个螺丝(如图紫框内所示),打开盖子

b. 把硬盘装上(图内为 Intel SSD):
 观察把硬盘装进盒子里的方式,串行高级技术附件
(SATA)和电源连接器应放置在面向有 **两个**螺孔的那端。

现在硬盘就装好了:

c. 把 SSD 重新装入 IPC 中:

4. 准备 IPC 启动:
a. 将电源线连接到 IPC 的电源连接器(接线端子):
**WARNING**: 确保电源线的正极(红色用
**R**表示)和负极(黑色用 **B**表示)正确的插入电源端子块上的插孔中。

b. 连接显示器,以太网线,键盘和鼠标到 IPC 上:

出于以下原因,建议您为显示器使用视频图形阵列
(VGA)连接器:
- 如果在 IPC 启动时没有看到任何屏幕显示,请切换到 VGA 输入。 即使没有连接显示器
,Neousys Nuvo-5095GC IPC 也 **总是**输出到 VGA 端口。 因此,Linux 安装程序可
能“选择”输出到 **VGA 端口**而不是 DVI 端口。
- 如果在使用双显示器设置时在安装过程中没有看到对话窗口,请尝试在 VGA 和 DVI 之间
切换以找到它。 Linux 安装程序可能会检测到两个监视器并同时使用它们。
为了获得更好的显示质量,您可以选择:
- 使用 DVI 线或带 DVI-HMI 适配器的高清晰度多媒体接口(HMI)连接到另一台显示器
- 使用同一台显示器上的 DVI / HDMI 端口
c. 连接电源:

### 为 IPC 安装软件
这部分主要描述以下的安装步骤:
- Ubuntu Linux
- Apollo 内核
您最好具有使用 Linux 成功安装软件的经验,如果这
是您的第一次安装,有可能会失败。
#### 安装 Ubuntu Linux
步骤如下:
1. 创建一个可以引导启动的 Ubantu Linux USB 闪存驱动器:
下载 Ubuntu(或 Xubuntu 等分支版本),并按照在线说明创建可引导启动的 USB 闪存
驱动器。
 推荐使用 **Ubuntu 14.04.3**.
开机按 F2 进入 BIOS 设置菜单,建议禁用 BIOS 中的
快速启动和静默启动,以便捕捉引导启动过程中的问题。 建议您在 BIOS 中禁用“快速启动
”和“安静启动”,以便了解启动过程中遇到的问题。
获取更多 Ubuntu 信息,可访问:  Ubuntu 桌面
站点:
[https://www.ubuntu.com/desktop](https://www.ubuntu.com/desktop)
2. 安装 Ubuntu Linux:
a. 将 Ubuntu 安装驱动器插入 USB 端口并启动 IPC。 b. 按照屏幕上的说明安装
Linux。
3. 执行软件更新与安装: a. 安装完成,重启进入 Linux。 b. 执行软件更新器(Software
Updater)更新最新软件包,或在终端执行以下命令完成更新。
```shell
sudo apt-get update; sudo apt-get upgrade
```
c. 打开终端,输入以下命令,安装 Linux 4.4 内核:
```shell
sudo apt-get install linux-generic-lts-xenial
```
IPC 必须接入网络以便更新与安装软件,所以请确认网
线插入并连接,如果连接网络没有使用动态分配(DHCP),需要更改网络配置。
#### 安装 Apollo 内核
车上运行 Apollo 需要
[Apollo Kernel](https://github.com/ApolloAuto/apollo-kernel). 强烈建议安装预编译
内核。
##### 使用预编译的 Apollo 内核
你可以依照如下步骤获取、安装预编译的内核。
1. 从 realease 文件夹下载发布的包
```
https://github.com/ApolloAuto/apollo-kernel/releases
```
2. 安装内核 After having the release package downloaded:
```
tar zxvf linux-4.4.32-apollo-1.0.0.tar.gz
cd install
sudo bash install_kernel.sh
```
3. 使用 `reboot`命令重启系统;
4. 根
据[ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)编
译 ESD CAN 驱动器源代码
##### 构建你自己的内核
如果内核被改动过,或预编译内核不是你最佳的平台,你可以通过如下方法构建你自己的内
核:
1. 从代码仓库克隆代码:
```
git clone https://github.com/ApolloAuto/apollo-kernel.git
cd apollo-kernel
```
2. 根据
[ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)添
加 ESD CAN 驱动源代码。
3. 按照如下指令编译:
```
bash build.sh
```
4. 使用同样的方式安装内核。
##### 可选:测试 ESD CAN 设备端
在重启有新内核的 IPC 以后:
a. 使用以下指令创建 CAN 硬件节点:
```shell
cd /dev; sudo mknod –-mode=a+rw can0 c 52 0
```
b. 使用从 ESD Electronics 获取到得的 ESD CAN 软件包的一部分的测试程序来测试 CAN
设备节点。
至此,IPC 就可以被装载到车辆上了。
## 上车安装
执行以下任务:
- 根据先决条件列表中的所述,对车辆进行必要的修改
- 安装主要的组件:Install the major components:
- GPS 天线
- IPC
- GPS 接收器
### 前提条件
**WARNING**: 在将主要部件(GPS 天线,IPC
和 GPS 接收器)安装在车辆之前,必须按照先决条件列表所述执行必要修改。 列表中所述
强制性更改的部分,不属于本文档的范围。
安装的前提条件如下:
- 车辆必须由专业服务公司修改为“线控”技术。 此外,必须在要安装 IPC 的中继线上提供
CAN 接口连接。
- 必须在后备箱中安装电源插板,为 IPC 和 GPS-IMU 提供电源。电源插板还需要服务于车
上的其他硬件,比如 4G 的路由器。电源插板应连接到车辆的电源系统。
- 必须安装定制的机架,将 GPS-IMU 天线安装在车辆的顶部。
- 必须安装定制的机架,以便将 GPS-IMU 安装在后背箱中。
- 必须将 4G LTE 路由器安装在后备箱中才能为 IPC 提供 Internet 访问。路由器必须具
有内置 Wi-Fi 接入点(AP)功能,以连接到其他设备(如 iPad),以与自主驾驶(AD)
系统相连接。例如,用户将能够使用移动设备来启动 AD 模式或监视 AD 状态。
### 主要部件安装图
以下两图显示车辆上应安装三个主要组件(GPS 天线,IPC,GPS 接收机和 LiDAR)的位置
: 示例图:

车辆与后备箱侧视图

车辆与后备箱后视图
### 安装 GPS 的接收器与天线
以下组件 **二选一**:
- **选项 1:** GPS-IMU: **NovAtel SPAN-IGM-A1**
- **选项 2:** GPS-IMU: **NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1**
#### 选项 1:安装 NovAtel SPAN-IGM-A1
安装说明描述了安装,连接和采取 GPS-IMU NovAtel SPAN-IGM-A1 的杠杆臂测量的过程。
##### 安装
可以将 GPS-IMU NovAtel SPAN-IGM-A1 放置在车辆的大部分地方,但建议您遵循以下建议
:
- 将 NovAtel SPAN-IGM-A1 放置并固定在行李箱内,Y 轴指向前方。
- 将 NovAtel GPS-703-GGG-HV 天线安装在位于车辆顶部的视野范围内。
##### 接线
您必须连接的两根电缆:
- 天线电缆 - 将 GNSS 天线连接到 SPAN-IGM-A1 的天线端口
- 主电缆:
- 将其 15 针端连接到 SPAN-IGM-A1
- 将其电源线连接到 10 至 30V 直流电源
- 将其串行端口连接到 IPC。如果电源来自车载电池,请添加辅助电池(推荐)。

主电缆连接
更多信息参见 _SPAN-IGM™ 快速入门指南_, 第三页, 详细图:
SPAN-IGM™ 快速入门指南
[http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf)
##### 采取杠杆臂测量
当 SPAN-IGM-A1 和 GPS 天线就位时,必须测量从 SPAN-IGM-A1 到 GPS 天线的距离。 该
距离标识为:X 偏移,Y 偏移和 Z 偏移。
偏移误差必须在 1 厘米以内才能实现高精度。 有关详细信息,请参阅 _ SPAN-IGM™ 快速
入门指南_,第 5 页,详细图。
更多有关 SPAN-IGM-A1 的信息参见:
SPAN-IGM™ 用户手册:
[http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf](http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf)
#### 选项 2:NovAtel SPAN® ProPak6™ 和 NovAtel IMU-IGM-A1
安装说明描述了安装,连接和采取 GPS NovAtelSPAN®ProPak6™**和** NovAtel IMU-IGM-A1
的杠杆臂测量的步骤。
##### 组件
安装所需的组件包括:
- NovAtel GPS SPAN ProPak6
- NovAtel IMU-IGM-A1
- NovAtel GPS-703-GGG-HV 天线
- NovAtel GPS-C006 电缆(将天线连接到 GPS)
- NovAtel 01019014 主电缆(将 GPS 连接到 IPC 的串行端口)
- 数据传输单元(DTU) - 类似于 4G 路由器
- 磁性适配器(用于天线和 DTU)
- DB9 直通电缆
##### 安装
你可以将 ProPak6 和 IMU 放置在车辆以下建议的位置:
- 将 ProPak6 和 IMU 并排固定在行李箱内,Y 轴指向前方。
- 将 NovAtel GPS-703-GGG-HV 天线安装在车辆顶部或行李箱盖顶部,如图所示:

- 使用磁性适配器将天线紧固到行李箱盖上。
- 通过打开主干并将电缆放置在行李箱盖和车身之间的空间中,将天线电缆安装在主干箱中
。
##### 接线
按照以下步骤将 ProPak6 GNSS 接收器和 IMU 连接到 Apollo 系统:
1. 使用 IMU-IGM-A1 附带的分接电缆连接 IMU 主端口和 ProPak6 COM3/IMU 端口。
2. 使用 USB-MicroUSB 转换线,连接 IPC 的 USB 端口和 ProPak6 的 MicroUSB 端口。
3. 将 IMU-IGM-A1 分离电缆的另一端连接到车辆电源。
4. 将 GNSS 天线连接到 Propak6。
5. 连接 Propak6 电源线。

更多有关 NovAtel SPAN ProPak6 的信息, 参见:
NovAtel ProPak6 安装操作手册:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
### 安装 IPC
步骤如下:
1. 用电源线把 IPC 连接到车辆电源上:
将其电源连接器作为一端,另一端连接至车上
的电源板面(参见前提条件部分)。
2. 把 5059GC 车载计算系统放在车上(推荐)。
例如,Apollo 1.0 使用 4x4 自攻螺钉将 5059GC 固定在后备箱里。

3. 安装 IPC,使其正面和背面(所有端口都在背面)面向后备箱的右侧(乘客那侧)和左
侧(驾驶员那侧)。
这样放置更容易连接所有电缆线。
如需更多信息,请参考
Neousys Nuvo-5095GC – 手册:
[http://www.neousys-tech.com/en/support/resources/category/162-manual](http://www.neousys-tech.com/en/support/resources/category/162-manual)
4. 连接所有线,包括:
- 电源线
- CAN 线
- 用以太网线将 4G 路由器连接到 IPC
- 将 GPS 接收器连接到 IPC
- (可选)显示器,键盘,鼠标
a. 将电源线连接至 IPC(如图所示):

b. 将电源线的另一端连至车辆电池(如图所示):

c. 将 DB9 线连接到 IPC,使它可以与 CAN 交流:

d. 连接:
- 从 4G 路由器到 IPC 的以太网电缆(标签上写着“Router”)
- 从 GPS 接收器到 IPC 的线缆(标签上写着“GPSIMU”)
- (可选)显示器(标签上写着“Monitor”)

#### 杠杆臂测量
步骤如下:
1. 在接受测量之前,打开 IPC。
2. 当 IMU 和 GPS 天线就位时,必须测量从 IMU 到 GPS 天线的距离。距离测量应为:X
偏移,yoffset,和 Z 偏移。
偏移误差必须在一厘米以内,以达到定位和定位的高精度。
更多信息,参见:
 NovAtel ProPak6 安装操作手册:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
 NovAtel SPAN-IGM-A1 产品页:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
### 配置 GPS 和 IMU
GPS 和 IMU 配置如下:
```
WIFICONFIGSTATE OFF
UNLOGALLTHISPORT
SETIMUTOANTOFFSET0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET0 0 0
LOGCOM2 GPRMC ONTIME 1.0 0.25
EVENTOUTCONTROLMARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROLMARK1 ENABLE POSITIVE 500000000 500000000
LOGNCOM1 GPGGA ONTIME 1.0
logbestgnssposb ontime 0.5
logbestgnssvelb ontime 0.5
logbestposb ontime 0.5
logINSPVASB ontime 0.01
logCORRIMUDATASB ontime 0.01
logINSCOVSB ontime 1
logmark1pvab onnew
logimutoantoffsetsb once
logvehiclebodyrotationb onchanged
SAVECONFIG
```
ProPak6 配置如下:
```
WIFICONFIG STATE OFF
CONNECTIMU COM3 IMU_ADIS16488
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL OFF
LOG COM2 GPRMC ONTIME 1 0.25
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SAVECONFIG
```
** 警告:** 基于真实的测量值(GPS 天线
、IMU 的偏移量)修改 **<u>SETIMUTOANTOFFSE</u>T** 行
例如:
```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```
# 配置网络
本节提供了一种建立网络的建议。
运行 Apollo 软件的 IPC 必须访问互联网获取实时运动学(RTK)数据,以便精确定位。移
动设备还需要连接到 IPC 来运行 Apollo 软件。
## 推荐配置
建议您根据下图设置网络:

步骤如下:
1. 安装并配置 4G 网络
2. 通过以太网线连接 IPC 到路由器
3. 配置路由器使用 LTE 蜂窝网络接入互联网
4. 配置 LTE 路由器的 AP 功能,使 iPad Pro 或其他移动设备可以连接到路由器,然后
连接到 IPC
 建议您配置一个固定的 IP,而不是在 IPC 上使用
DHCP,以使它更容易从移动终端被连接。
# 其它安装任务
需要使用自己提供的组件来执行以下任务:
1. 使用 DVI 或 HDMI 电缆连接显示器,并连接键盘和鼠标,以便在现场的汽车上执行调
试任务。
2. 在 Apple iPad Pro 上建立 Wi-Fi 连接,以访问 HMI 并控制 IPC 上运行的 Apollo
ADS。
# 下一步
完成硬件部分的安装之后,可以参考快速入门的教程
[Apollo Quick Start](../../../02_Quick%20Start/apollo_1_0_quick_start.md) 完成软件部分的安装。
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/硬件安装hardware installation/apollo_2_0_hardware_system_installation_guide_v1.md
|
# Apollo 2.0 Hardware and System Installation Guide
* [About This Guide](#about-this-guide)
* [Document Conventions](#document-conventions)
* [Introduction](#introduction)
* [Documentation](#documentation)
* [Key Hardware Components](#key-hardware-components)
* [Additional Components Required](#additional-components-required)
* [Onboard Computer System - IPC](#onboard-computer-system---ipc)
* [IPC Configuration](#ipc-configuration)
* [IPC Front and Rear Views](#ipc-front-and-rear-views)
* [Controller Area Network (CAN) Card](#controller-area-network-(can)-card)
* [Global Positioning System (GPS) and Inertial Measurement Unit (IMU)](#global-positioning-system-(gps)-and-inertial-measurement-unit-(imu))
* [Option 1: The NovAtel SPAN-IGM-A1](#option-1-the-novatel-span-igm-a1)
* [Option 2: The NovAtel SPAN ProPak6 and NovAtel IMU-IGM-A1](#option-2-the-novatel-span-propak6-and-novatel-imu-igm-a1)
* [The GPS Receiver/Antenna](#the-gps-receiver/antenna)
* [Light Detection and Ranging System (LiDAR)](#light-detection-and-ranging-system-(lidar)-)
* [Option 1: Velodyne HDL-64E S3](#option-1-velodyne-hdl-64e-s3)
* [Option 2: Hesai Pandora](#option-2-hesai-pandora)
* [Overview of the Installation Tasks](#overview-of-the-installation-tasks)
* [Steps for the Installation Tasks](#steps-for-the-installation-tasks)
* [At the Office](#at-the-office)
* [Preparing the IPC](#preparing-the-ipc)
* [Installing the Software for the IPC](#installing-the-software-for-the-ipc)
* [In the Vehicle](#in-the-vehicle)
* [Prerequisites](#prerequisites)
* [Diagrams of the Major Component Installations](#diagrams-of-the-major-component-installations)
* [Installing the GPS Receiver and Antenna](#installing-the-gps-receiver-and-antenna)
* [Installing the Light Detection and Ranging System (LiDAR)](#installing-the-light-detection-and-ranging-system-(lidar))
* [Installing the Cameras](#installing-the-cameras)
* [Installing the Radar](#installing-the-radar)
* [Installing the IPC](#installing-the-ipc)
* [Configuring the GPS and IMU](#configuring-the-gps-and-imu)
* [Setting up the Network](#setting-up-the-network)
* [Recommendations](#recommendations)
* [Additional Tasks Required](#additional-tasks-required)
* [Next Steps](#next-steps)
# About This Guide
The *Apollo 2.0 Hardware and System Installation Guide* provides the instructions to install all of the hardware components and system software for the **Apollo Project**. The system installation information included pertains to the procedures to download and install the Apollo Linux Kernel.
## Document Conventions
The following table lists the conventions that are used in this document:
| **Icon** | **Description** |
| ----------------------------------- | ---------------------------------------- |
| **Bold** | Emphasis |
| `Mono-space font` | Code, typed data |
| _Italic_ | Titles of documents, sections, and headings Terms used |
|  | **Info** Contains information that might be useful. Ignoring the Info icon has no negative consequences. |
|  | **Tip**. Includes helpful hints or a shortcut that might assist you in completing a task. |
|  | **Online**. Provides a link to a particular web site where you can get more information. |
|  | **Warning**. Contains information that must **not** be ignored or you risk failure when you perform a certain task or step. |
# Introduction
The **Apollo Project** is an initiative that provides an open, complete, and reliable software platform for Apollo partners in the automotive and autonomous driving industries. The aim of this project is to enable these entities to develop their own self-driving systems based on Apollo software stack.
## Documentation
The following set of documentation describes Apollo 2.0:
- ***<u>[Apollo Hardware and System Installation Guide]</u>*** ─ Provides the instructions to install the hardware components and the system software for the vehicle:
- **Vehicle**:
- Industrial PC (IPC)
- Global Positioning System (GPS)
- Inertial Measurement Unit (IMU)
- Controller Area Network (CAN) card
- GPS Antenna
- GPS Receiver
- Light Detection and Ranging System (LiDAR)
- Camera
- Radar
- **Software**:
- Ubuntu Linux
- Apollo Linux Kernel
- NVIDIA GPU Driver
- ***<u>[Apollo Quick Start Guide]</u>*** ─ A combination tutorial and roadmap that provide the complete set of end-to-end instructions. The Quick Start Guide also provides links to additional documents that describe the conversion of a regular car to an autonomous-driving vehicle.
# Key Hardware Components
The key hardware components to install include:
- Onboard computer system ─ Neousys Nuvo-6108GC
- Controller Area Network (CAN) Card ─ ESD CAN-PCIe/402-B4
- General Positioning System (GPS) and Inertial Measurement Unit (IMU) ─
You can select one of the following options:
- NovAtel SPAN-IGM-A1
- NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
- Light Detection and Ranging System (LiDAR) ─ You can select one of the following options:
- Velodyne HDL-64E S3
- Hesai Pandora
- Cameras — Leopard Imaging LI-USB30-AR023ZWDR with USB 3.0 case
- Radar — Continental ARS408-21
## Additional Components Required
You need to provide these additional components for the Additional Tasks Required:
- A 4G router for Internet access
- A USB hub for extra USB ports
- A monitor, keyboard, and mouse for debugging at the car onsite
- Cables:a Digital Visual Interface (DVI) cable (optional), a customized cable for GPS-LiDAR time synchronization
- Apple iPad Pro: 9.7-inch, Wi-Fi (optional)
The features of the key hardware components are presented in the subsequent sections.
## Onboard Computer System - IPC
The onboard computer system is an industrial PC (IPC) for the autonomous vehicle and uses the **NeousysNuvo-6108GC** that is powered by a sixth-generation Intel Xeon E3 1275 V5 CPU.
The Neousys Nuvo-6108GC is the central unit of the autonomous driving system (ADS).
### IPC Configuration
Configure the IPC as follows:
- ASUS GTX1080 GPU-A8G-Gaming GPU Card
- 32GB DDR4 RAM
- PO-280W-OW 280W AC/DC power adapter
- 2.5" SATA Hard Disk 1TB 7200rpm
### IPC Front and Side Views
The front and rear views of the IPC are shown with the Graphics Processing Unit (GPU) installed in the following pictures:
The front view of the Nuvo-6108GC:

The side view of the Nuvo-6108GC:

For more information about the Nuvo-6108GC, see:

Neousys Nuvo-6108GC Product Page:
[http://www.neousys-tech.com/en/product/application/rugged-embedded/nuvo-6108gc-gpu-computing](http://www.neousys-tech.com/en/product/application/rugged-embedded/nuvo-6108gc-gpu-computing)

Neousys Nuvo-6108GC-Manual:
**[Link unavailable yet]**
## Controller Area Network (CAN) Card
The CAN card to use with the IPC is **ESD** **CAN-PCIe/402-B4**.

For more information about the CAN-PCIe/402-B4, see:
 ESD CAN-PCIe/402 Product Page:
[https://esd.eu/en/products/can-pcie402](https://esd.eu/en/products/can-pcie402)
## Global Positioning System (GPS) and Inertial Measurement Unit (IMU)
There are **two** GPS-IMU **options** available and the choice depends upon the one that most fits your needs:
- **Option 1: NovAtel SPAN-IGM-A1**
- **Option 2: NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1**
### Option 1: The NovAtel SPAN-IGM-A1
The NovAtel SPAN-IGM-A1 is an integrated, single-box solution that offers tightly coupled Global Navigation Satellite System (GNSS) positioning and inertial navigation featuring the NovAtel OEM615 receiver.

For more information about the NovAtel SPAN-IGM-A1, see:
 NovAtel SPAN-IGM-A1 Product Page:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
### Option 2: The NovAtel SPAN ProPak6 and NovAtel IMU-IGM-A1
NovAtel ProPak6 is a standalone GNSS receiver. It works with a separate NovAtel- supported IMU (in this case, the NovAtel IMU-IGM-A1)to provide localization.
The ProPak6 provides the latest and most sophisticated enclosure product manufactured by NovAtel.
The IMU-IGM-A1 is an IMU that pairs with a SPAN-enabled GNSS receiver such as the SPAN ProPak6.

For more information about the NovAtel SPAN ProPak6 and the IMU-IGM-A1, see:
 NovAtel ProPak6 Installation & Operation Manual:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel IMU-IGM-A1 Product Page:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview](https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview)
## The GPS Receiver/Antenna
The GPS Receiver/Antenna used with the GPS-IMU component is the **NovAtel GPS-703-GGG-HV**.
**NOTE:**The GPS NovAtelGPS-703-GGG-HV works with either model of the two GPS-IMU options that are described in the previous section, Global Positioning System (GPS) and Inertial Measurement Unit (IMU).

For more information about the NovAtel GPS-703-GGG-HV, see:
 NovAtel GPS-703-GGG-HV Product Page:
[https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/](https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/)
## Light Detection and Ranging System (LiDAR)
There are **two** LiDAR **options** available and the choice depends upon the one that most fits your needs:
- **Option 1: Velodyne HDL-64E S3**
- **Option 2: Hesai Pandora**
### Option 1: Velodyne HDL-64E S3
The 64 line LiDAR system **HDL-64E S3** is available from Velodyne LiDAR, Inc.

**Key Features:**
- 64 Channels
- 120m range
- 2.2 Million Points per Second
- 360° Horizontal FOV
- 26.9° Vertical FOV
- 0.08° angular resolution (azimuth)
- <2cm accuracy
- ~0.4° Vertical Resolution
- User selectable frame rate
- Rugged Design
Webpage for Velodyne HDL-64E S3:
[http://velodynelidar.com/hdl-64e.html](http://velodynelidar.com/hdl-64e.html)
### Option 2: Hesai Pandora
The 40 line LiDAR system **Pandora** is available from Hesai Photonics Technology Co., Ltd.

**Key Features:**
- 40 Channels
- 200m range (20% reflectivity)
- 720 kHz measuring frequency
- 360° Horizontal FOV
- 23° Vertical FOV (-16° to 7°)
- 0.2° angular resolution (azimuth)
- <2cm accuracy
- Vertical Resolution: 0.33° ( from -6° to +2°); 1° (from -16° to -6°, +2° to +7°)
- User selectable frame rate
- 360° surrounding view with 4 mono cameras and long disatance front view with 1 color camera
Webpage for Hesai Pandora:
[http://www.hesaitech.com/pandora.html](http://www.hesaitech.com/pandora.html)
## Cameras
The cameras used are LI-USB30-AR023ZWDR with standard USB 3.0 case manufactured by Leopard Imaging Inc. We recommend using two cameras with 6 mm and 25 mm lens respectively to achieve the required performance.

You can find more information at Leopard Imaging Inc. website:
[https://www.leopardimaging.com/LI-USB30-AR230WDR.html](https://www.leopardimaging.com/LI-USB30-AR230WDR.html)
## Radar
The Radar used is ARS408-21 manufactured by Continental AG.

You can find more information can be found on the product page:
[https://www.continental-automotive.com/Landing-Pages/Industrial-Sensors/Products/ARS-408-21](https://www.continental-automotive.com/Landing-Pages/Industrial-Sensors/Products/ARS-408-21)
# Overview of the Installation Tasks
Installing the hardware and the software components involves these tasks:
**AT THE OFFICE:**
1. Prepare and install the Controller Area Network (CAN) card by first repositioning the CAN card termination jumper before you insert the card into the slot.
2. Install the hard drive (if none was pre-installed) in the IPC.
You can also choose to replace a pre-installed hard drive if you prefer.
**Recommendations** :
- Install a Solid-State Drive (SSD) for better reliability.
- Use a high-capacity drive if you need to collect driving data.
3. Prepare the IPC for powering up:
a. Attach the power cable to the power connector (terminal block).
b. Connect the monitor, Ethernet, keyboard, and mouse to the IPC.
c. Connect the IPC to a power source.
4. Install the software on the IPC (some Linux experience is required):
a. Install Ubuntu Linux.
b. Install the Apollo Linux kernel.
**IN THE VEHICLE:**
- Make sure that all the modifications for the vehicle, which are listed in the section Prerequisites, have been performed.
- Install the major components (according to the illustrations and the instructions included in this document):
- GPS Antenna
- IPC
- GPS Receiver and IMU
- LiDAR
- Camera
- Radar
The actual steps to install all of the hardware and software components are detailed in the section, Steps for the Installation Tasks.
# Steps for the Installation Tasks
This section describes the steps to install:
- The key hardware and software components
- The hardware in the vehicle
## At the Office
Perform the following tasks:
- Prepare the IPC:
- Install the CAN card
- Install or replace the hard drive
- Prepare the IPC for powering up
- Install the software for the IPC:
- Ubuntu Linux
- Apollo Kernel
- Nvidia GPU Driver
### Prepare the IPC
Follow these steps:
1. Prepare and install the Controller Area Network (CAN) card:
In the Neousys Nuvo-6108GC, ASUS® GTX-1080GPU-A8G-GAMING GPU card is pre-installed into one of the three PCI slots. We still need to install a CAN card into a PCI slot.
a. Locate and unscrew the eight screws (shown in the brown squares or pointed by brown arrows) on the side of computer:
b. Remove the cover from the IPC. 3 PCI slots (one occupied by the graphic card) locate on the base:


c. Set the CAN card termination jumper by removing the red jumper cap (shown in yellow circles) from its default location and placing it at its termination position:

**WARNING**: The CAN card will not work if the termination jumper is not set correctly.
d. Insert the CAN card into the slot in the IPC:

e. Reinstall the cover for the IPC

2. Prepare the IPC for powering up:
a. Attach the power cable to the power connector (terminal block) that comes with the IPC:
**WARNING**: Make sure that the positive(labeled **R** for red) and the negative(labeled **B** for black) wires of the power cable are inserted into the correct holes on the power terminal block.

b. Connect the monitor, Ethernet cable, keyboard, and mouse to the IPC:
3. 
It is recommended to configure the fan speed through BIOS settings, if one or more plugin card is added to the system
- While starting up the computer, press F2 to enter BIOS setup menu.
- Go to [Advanced] => [Smart Fan Setting]
- Set [Fan Max. Trip Temp] to 50
- Set [Fan Start Trip Temp] to 20
It is recommended that you use a Digital Visual Interface (DVI) connector on the graphic card for the monitor. To set the display to the DVI port on the motherboard, following is the setting procedure:
- While starting up the computer, press F2 to enter BIOS setup menu.
- Go to [Advanced]=>[System Agent (SA) Configuration]=>[Graphics Configuration]=>[Primary Display]=> Set to "PEG"
It is recommended to configure the IPC to run at maximum performance mode at all time:
- While starting up the computer, press F2 to enter BIOS setup menu.
- Go to [Power] => [SKU POWER CONFIG] => set to "MAX. TDP"
c. Connect the power:

### Installing the Software for the IPC
This section describes the steps to install:
- Ubuntu Linux
- Apollo Kernel
- Nvidia GPU Driver
It is assumed that you have experience working with Linux to successfully perform the software installation.
#### Installing Ubuntu Linux
Follow these steps:
1. Create a bootable Ubuntu Linux USB flash drive:
Download Ubuntu (or a variant such as Xubuntu) and follow the online instructions to create a bootable USB flash drive.
It is recommended that you use **Ubuntu 14.04.3**.
You can type F2 during the system boot process to enter the BIOS settings. It is recommended that you disable Quick Boot and Quiet Boot in the BIOS to make it easier to catch any issues in the boot process.
For more information about Ubuntu, see:
 Ubuntu for Desktop web site:
[https://www.ubuntu.com/desktop](https://www.ubuntu.com/desktop)
2. Install Ubuntu Linux:
a. Insert the Ubuntu installation drive into a USB port and turn on the system.
b. Install Linux by following the on-screen instructions.
3. Perform a software update and the installation:
a. Reboot into Linux after the installation is done.
b. Launch the Software Updater to update to the latest software packages (for the installed distribution) or type the following commands in a terminal program such as GNOME Terminal.
```shell
sudo apt-get update; sudo apt-get upgrade
```
c. Launch a terminal program such as GNOME Terminal and type the following command to install the Linux 4.4 kernel:
```shell
sudo apt-get install linux-generic-lts-xenial
```
The IPC must have Internet access to update and install software. Make sure that the Ethernet cable is connected to a network with Internet access. You might need to configure the network for the IPC if the network that it is connected to is not using the Dynamic Host Configuration Protocol (DHCP).
#### Installing the Apollo Kernel
The Apollo runtime in the vehicle requires the [Apollo Kernel](https://github.com/ApolloAuto/apollo-kernel). It is strongly recommended to install the pre-built kernel.
##### Use the pre-built Apollo Kernel.
You get access to and install the pre-built kernel using the following commands.
1. Download the release packages from the release section on GitHub:
```
https://github.com/ApolloAuto/apollo-kernel/releases
```
2. Install the kernel after having downloading the release package:
```
tar zxvf linux-4.4.32-apollo-1.5.0.tar.gz
cd install
sudo bash install_kernel.sh
```
3. Reboot your system using the `reboot` command.
4. Build the ESD CAN driver source code, according to [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)
##### Build your own kernel.
If have modified the kernel, or the pre-built kernel is not the best for your platform, you can build your own kernel using the following steps.
1. Clone the code from the repository
```
git clone https://github.com/ApolloAuto/apollo-kernel.git
cd apollo-kernel
```
2. Add the ESD CAN driver source code according to [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)
3. Build the kernel using the following command.
```
bash build.sh
```
4. Install the kernel using the steps for a pre-built Apollo Kernel as described in the previous section.
#### Installing NVIDIA GPU Driver
The Apollo runtime in the vehicle requires the [NVIDIA GPU Driver](http://www.nvidia.com/download/driverResults.aspx/114708/en-us). You must install the NVIDIA GPU driver with specific options.
1. Download the installation files
```
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/375.39/NVIDIA-Linux-x86_64-375.39.run
```
2. Start the installation
```
sudo bash ./NVIDIA-Linux-x86_64-375.39.run --no-x-check -a -s --no-kernel-module
```
##### Optional: Test the ESD CAN device node
After rebooting the IPC with the new kernel:
a. Create the CAN device node by issuing the following commands in a terminal:
```shell
cd /dev
sudo mknod –-mode=a+rw can0 c 52 0
sudo mknod –-mode=a+rw can1 c 52 1
```
b. Test the CAN device node using the test program that is part of the ESD CAN software package that you have acquired from ESD Electronics.
The IPC is now ready to be mounted on the vehicle.
## In the Vehicle
Perform these tasks:
- Make the necessary modifications to the vehicle as specified in the list of prerequisites
- Install the major components:
- GPS Antenna
- IPC
- GPS Receiver and IMU
- LiDAR
- Cameras
- Radar
### Prerequisites
**WARNING**: Prior to mounting the major components (GPS Antenna, IPC, and GPS Receiver) in the vehicle, perform certain modifications as specified in the list of prerequisites. The instructions for making the mandatory changes in the list are outside the scope of this document.
The list of prerequisites are as follows:
- The vehicle must be modified for “drive-by-wire” technology by a professional service company. Also, a CAN interface hookup must be provided in the trunk where the IPC will be mounted.
- A power panel must be installed in the trunk to provide power to the IPC and the GPS-IMU. The power panel would also service other devices in the vehicle such as a 4G LTE router. The power panel should be hooked up to the power system in the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU Antenna, the cameras and the LiDAR on top of the vehicle.
- A custom-made rack must be installed to mount the GPS-IMU in the trunk.
- A custom-made rack must be installed in front of the vehicle to mount the front-facing radar.
- A 4G LTE router must be mounted in the trunk to provide Internet access for the IPC. The router must have built-in Wi-Fi access point (AP) capability to connect to other devices, such as an iPad, to interface with the autonomous driving (AD) system. A user would be able to use the mobile device to start AD mode or monitor AD status, for example.
### Diagrams of the Major Component Installations
The following two diagrams indicate the locations of where the three major components (GPS Antenna, IPC, GPS Receiver and LiDAR) should be installed on the vehicle:


### Installing the GPS Receiver and Antenna
This section provides general information about installing **one** of two choices:
- **Option 1:** GPS-IMU: **NovAtel SPAN-IGM-A1**
- **Option 2:** GPS-IMU: **NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1**
#### Option 1: Installing the NovAtel SPAN-IGM-A1
The installation instructions describe the procedures to mount, connect, and take the lever arm measurements for the GPS-IMU NovAtel SPAN-IGM-A1.
##### Mounting
You can place the GPS-IMU NovAtel SPAN-IGM-A1 in most places in the vehicle but it is suggested that you follow these recommendations:
- Place and secure the NovAtel SPAN-IGM-A1 inside the trunk with the Y-axis pointing forward.
- Mount the NovAtel GPS-703-GGG-HV antenna in an unobscured location on top of the vehicle.
##### Wiring
You must connect two cables:
- The antenna cable connects the GNSS antenna to the antenna port of the SPAN-IGM-A1
- The main cable:
- Connects its 15-pin end to the SPAN-IGM-A1
- Connects its power wires to a power supply of 10-to-30V DC
- Connects its serial port to the IPC. If the power comes from a vehicle battery, add an auxiliary battery (recommended).

Main Cable Connections
For more information, see the *SPAN-IGM™ Quick Start Guide*, page 3, for a detailed diagram:
SPAN-IGM™ Quick Start Guide
[http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf)
##### Taking the Lever Arm Measurement
When the SPAN-IGM-A1 and the GPS Antenna are in position, the distance from the SPAN-IGM-A1 to the GPS Antenna must be measured. The distance should be measured as: X offset, Y offset, and Z offset.
The error of offset must be within one centimeter to achieve high accuracy. For more information, see the *SPAN-IGM™ Quick Start Guide*, page 5, for a detailed diagram.
For an additional information about the SPAN-IGM-A1, see:
SPAN-IGM™ User Manual:
[http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf](http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf)
#### Option 2: Installing NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
The installation instructions describe the procedures to mount, connect, and take the lever arm measurements for the GPS NovAtel SPAN® ProPak6™ **and** the NovAtel IMU-IGM-A1.
##### Components for the Installation
The components that are required for the installation include:
- NovAtel GPS SPAN ProPak6
- NovAtel IMU-IGM-A1
- NovAtel GPS-703-GGG-HV Antenna
- NovAtel GPS-C006 Cable (to connect antenna to GPS)
- NovAtel 01019014 Main Cable (to connect GPS to a serial port the IPC)
- Data Transport Unit (DTU) – similar to a 4G router
- Magnetic adapters (for antenna and DTU)
- DB9 Straight Through Cable
##### Mounting
You can place the two devices, the ProPak6 and the IMU in most places in the vehicle, but it is suggested that you follow these recommendations:
- Place and secure the ProPak6 and the IMU side-by-side inside the trunk with the Y-axis pointing forward.
- Mount the NovAtel GPS-703-GGG-HV antenna on top of the vehicle or on top of the trunk lid as shown:

- Use a magnetic adapter to tightly attach the antenna to the trunk lid.
- Install the antenna cable in the trunk by opening the trunk and placing the cable in the space between the trunk lid and the body of the car.
##### Wiring
Follow these steps to connect the ProPak6 GNSS Receiver and the IMU to the Apollo system:
1. Use the split cable that comes with IMU-IGM-A1 to connect the IMU Main port and theProPak6 COM3/IMU port.
2. Use a USB-A-to-MicroUSB cable to connect the USB port of the IPC and the MicroUSB port of the ProPak6.
3. Connect the other end of the IMU-IGM-A1 split cable to the vehicle power.
4. Connect the GNSS antenna to Propak6.
5. Connect the Propak6 power cable.

For more information about the NovAtel SPAN ProPak6, see:
NovAtel ProPak6 Installation& Operation Manual:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
### Installing the Light Detection and Ranging System (LiDAR)
This section provides general information about installing **one** of two choices:
- **Option 1:** LiDAR: **Velodyne HDL-64E S3**
- **Option 2:** LiDAR: **Hesai Pandora**
#### Option 1: Installing Velodyne HDL-64E S3
This section provides descriptions on the installation procedure of HDL-64E S3 LiDAR
##### Mounting
A customized mounting structure is required to successfully mount an HDL64E S3 LiDAR on top of a vehicle. This structure must provide rigid support to the LiDAR system while raising the LiDAR to a certain height above the ground. This height avoids the laser beams from the LiDAR being blocked by the front and/or rear of the vehicle. The actual height needed for the LiDAR depends on the design of the vehicle and the mounting point of the LiDAR relative to the vehicle. The vertical tilt angle of the lasers normally ranges from +2~-24.8 degrees relative to the horizon. To fully use the angle range for detection, on a Lincoln MKZ, it is recommended that you mount the LiDAR at a minimum height of 1.8 meters (from ground to the base of the LiDAR).
##### Wiring
Each HDL-64E S3 LiDAR includes a cable bundle to connect the LiDAR to the power supply, the computer (Ethernet for data transfer, and serial port for LiDAR configuration) and the GPS timesync source.

1. Connection to the LiDAR
Connect the power and signal cable to the matching ports on the LiDAR

2. Connection to Power Source
The two AWG 16 wires are used to power HDL-64E S3 LiDAR. It requires about 3A at 12V. To connect the power source, make full contact with the wires and tighten the screws.

3. Conection to IPC
The connection to the IPC is through an ethernet cable. Plug the ethernet connector in the cable bundle into an ethernet port on the IPC.
4. Connection to GPS:
The HDL64E S3 LiDAR requires the Recommended minimum specific GPS/Transit data (GPRMC) and pulse per second (PPS)signal to synchronize to the GPS time. A customized connection is needed to establish the communication between the GPS receiver and the LiDAR:
a. SPAN-IGM-A1
If you configured the SPAN-IGM-A1 as specified in [Configuring the GPS and IMU](#configuring-the-gps-and-imu), the GPRMC signal is sent from the GPS receiver via the User Port cable from the Main port. The PPS signal is sent through the wire cables labeled as “PPS” and “PPS dgnd” from the Aux port. The dash-line boxes in the figure below show the available connections that come with the HDL64E S3 LiDAR and the SPAN-IGM-A1 GPS receiver. The remaining connections must be made by the user.

b. Propak 6 and IMU-IGM-A1
If you configured the Propak 6 as specified in [Configuring the GPS and IMU](#configuring-the-gps-and-imu), the GPRMC signal is sent from the GPS receiver via COM2 port. The PPS signal is sent through the IO port. The dash-line boxes in the figure below are available connections that comes with the HDL-64E S3 LiDAR and the Propak 6 GPS receiver. The remaining connections need to be made by the user.

5. Connection through serial port for LiDAR configuration
You can configure some of the low-level parameters through serial port. Within the cable bundle provided by Velodyne LiDAR, Inc., there are two pairs of red/black cables as shown in the pinout table below. The thicker pair (AWG 16) is used to power the LiDAR system. The thinner pair is used for serial connection. Connect the black wire (Serial In) to RX, the red wire to the Ground wire of a serial cable. Connect the serial cable with a USB-serial adapter to your selected computer.

##### Configuration
By default, the HDL-64E S3 has the network IP address setting as 192.168.0.1. However, when you set up for Apollo, change the network IP address to 192.168.20.13 . You can use the terminal application with Termite3.2 and enter the network setting command. The IP address of the HDL-64E S3 can be configured using the following steps:
1. Connect one side of the serial cable to your laptop
2. Connect the other side of the serial cable to HDL-64E S3’s serial wires
3. Use the following COM port default setting:
Baudrate: 9600
Parity: None
Data bits: 8
Stop bits: 1
4. Use the COM port application:
Download Termite3.2 from the link below and install it on your laptop (Windows):
[http://www.compuphase.com/software_termite.htm](http://www.compuphase.com/software_termite.htm)
5. Use the serial cable connection for COM port between the HDL-64E S3 and the laptop:

6. Launch **Termite 3.2** from laptop
7. Issue a serial command for setting up the HDL-64E S3’s IP addresses over serial port "\#HDLIPA192168020013192168020255"
8. The unit must be power cycled to adopt the new IP addresses

HDL-64E S3 Manual can be found on this webpage:
[http://velodynelidar.com/hdl-64e.html](http://velodynelidar.com/hdl-64e.html)
#### Option 2: Installing Hesai Pandora
This section provides descriptions on the installation procedure of Hesai Pandora
##### Mounting
A customized mounting structure is required to successfully mount an Hesai Pandora on top of a vehicle. This structure must provide rigid support to the LiDAR system while raising the LiDAR to a certain height above the ground. This height avoids the laser beams from the LiDAR being blocked by the front and/or rear of the vehicle. The actual height needed for the LiDAR depends on the design of the vehicle and the mounting point of the LiDAR relative to the vehicle. The vertical tilt angle of the lasers normally ranges from +7~-16 degrees relative to the horizon. To fully use the angle range for detection, on a Lincoln MKZ, it is recommended that you mount the LiDAR at a minimum height of 1.7 meters (from ground to the base of the LiDAR).
##### Wiring
Each Pandora includes a cable bundle to connect the LiDAR to the power supply, the computer (Ethernet for data transfer) and the GPS timesync source.

1. Connection to the Pandora
Connect the power and signal cable to the matching ports on the Pandora interface box.

2. Connection to Power Source
The Pandora requires about 3A at 12V. To connect the power source, make full contact with the wires and tighten the screws.

3. Conection to IPC
The connection to the IPC is through an ethernet cable. Plug the ethernet connector in the cable bundle into an ethernet port on the IPC.
4. Connection to GPS:
The Pandora requires the Recommended minimum specific GPS/Transit data (GPRMC) and pulse per second (PPS)signal to synchronize to the GPS time. A customized connection is needed to establish the communication between the GPS receiver and the LiDAR:
a. SPAN-IGM-A1
If you configured the SPAN-IGM-A1 as specified in [Configuring the GPS and IMU](#configuring-the-gps-and-imu), the GPRMC signal is sent from the GPS receiver via the User Port cable from the Main port. The PPS signal is sent through the wire cables labeled as “PPS” and “PPS dgnd” from the Aux port. The dash-line boxes in the figure below show the available connections that come with the Pandora and the SPAN-IGM-A1 GPS receiver. The remaining connections must be made by the user.

b. Propak 6 and IMU-IGM-A1
If you configured the Propak 6 as specified in [Configuring the GPS and IMU](#configuring-the-gps-and-imu), the GPRMC signal is sent from the GPS receiver via COM2 port. The PPS signal is sent through the IO port. The dash-line boxes in the figure below are available connections that comes with the Pandora and the Propak 6 GPS receiver. The remaining connections need to be made by the user.

The pinout table for Pandora is shown below.

Pandora Manual can be found on this webpage:
[http://www.hesaitech.com/pandora.html](http://www.hesaitech.com/pandora.html)
### Installing the Cameras
This section provides guidelines for the camera installation procedure.
The Apollo reference design recommends using two cameras with different focal lengths, 6 mm and 25 mm. The mounting of the cameras can be tailored to the actual design of the system.
- Both of the cameras should face forward to the driving direction. The field of view (FOV) should be kept free from obstructions as much as possible.
- 
- The camera with the 25 mm focal length should be tilted up by about two degrees. After you make this adjustment, the 25 mm camera should be able to observe the traffic light from 100 m away to the stop line at the intersection.
- The lenses of the cameras, out of the package, are not in the optimal position. Set up the correct position by adjusting the focus of the lens to form a sharp image of a target object at a distance. A good target to image is a traffic sign or a street sign within the FOV. After adjusting the focus, use the lock screw to secure the position of the lens.

- Use USB 3.0 Cables to connect the cameras (USB 3.0 Micro-B) and the IPC(USB 3.0 type A), and use the screws to secure the connection.
### Installing the Radar
This section provides descriptions of the installation procedure of Continental Radar.
The radar requires a matching mechanical rack to mount on the front bumper. After the installation, it is required that the radar faces towards the driving direction and slightly tilts up by no more than two degrees.

The cable that comes with the radar needs to be routed to the back of the car and connected to the CAN1 channel of the ESD CAN card.
### Installing the IPC
Follow these steps:
1. Use a voltage converter/regulator to convert the 12 VDC output from the vehicle to desired voltage to power IPC.
As recommended by Neousys, use a 12 VDC to 19 VDC converter with maximal output current of 20 A.

a. Connect the two 19 VDC output wires to IPC's power connector (Green as shown below).

b. Connect the two cables of 12 VDC input to the power panel in the vehicle. If the size of the wire is too thick, the wire should be split to several wires and connect to corresponding ports, respectively.
This step is required. If the input voltage goes below the required limit, it can cause system failure.
2. Place the onboard computer system, the 6108GC, inside the trunk (recommended).
For example, Apollo 2.0 uses 4x4 self-tapping screws to bolt the 6108GC to the carpeted floor of the trunk. 
3. Mount the IPC so that its front and back sides(where all ports are located) face the right side (passenger) or the left side(driver) of the trunk.
This positioning makes it easier to connect all of the cables.
For more information, see:
Neousys Nuvo-6108GC – Manual:
**[Link Unavailable]**
4. Connect all cables, which include:
- Power cable
- Controller Area Network (CAN) cable
- Ethernet cable from the 4G router to the IPC
- GPS Receiver to the IPC
- (Optional) Monitor, keyboard, mouse
a. Connect the power cable to the IPC (as shown):
b. Connect the other end of the power cable to the vehicle battery (as shown):

c. Connect the DB9 cable to the IPC to talk to the CAN (as shown):

d. Connect:
- the Ethernet cable from the 4G router to the IPC
- the GPS Receiver to the IPC
- (optional) the monitor:

#### Taking the Lever Arm Measurement
Follow these steps:
1. Before taking the measurement, turn on the IPC.
2. When the IMU and the GPS Antenna are in position, the distance from the IMU to the GPS Antenna must be measured. The distance should be measured as: X offset, Y offset, and Z offset. The error of offset must be within one centimeter to achieve high accuracy in positioning and localization.
For an additional information, see:
NovAtel ProPak6 Installation & Operation Manual:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel SPAN-IGM-A1 Product Page:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
### Configuring the GPS and IMU
Configure the GPS and IMU as shown:
```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew
log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15
log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged
SAVECONFIG
```
For ProPak6:
```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
CONNECTIMU COM3 IMU_ADIS16488
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew
log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15
log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged
SAVECONFIG
```
** WARNING:** Modify the **<u>SETIMUTOANTOFFSE</u>T** line based on the actual measurement (of the antenna and the IMU offset).
For example:
```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```
# Setting up the Network
This section provides recommendations for setting up the network.
The IPC that is running the Apollo software must access the Internet to acquire the Real Time Kinematic (RTK) data for accurate localization. A mobile device also needs to connect to the IPC to run the Apollo software.
## Recommendations
It is recommended that you set up your network according to the following diagram:

Follow these steps:
1. Install and configure a 4G LTE router with Wi-Fi Access Point (AP) capability and Gigabit Ethernet ports.
2. Connect the IPC to the LTE router using an Ethernet cable.
3. Configure the LTE router to access the Internet using the LTE cellular network.
4. Configure the AP capability of the LTE router so that the iPad Pro or another mobile device can connect to the router, and, in turn, connect to the IPC.
It is recommended that you configure a fixed IP instead of using DHCP on the IPC to make it easier to connect to it from a mobile terminal.
# Additional Tasks Required
Use the components that you were required to provide to perform the following tasks:
1. Connect a monitor using the DVI or the HDMI cables and connect the keyboard and mouse to perform debugging tasks at the car onsite.
2. Establish a Wi-Fi connection on the Apple iPad Pro to access the HMI and control the Apollo ADS that is running on the IPC.
# Time Sync Script Setup [Optional]
In order to, sync the computer time to the NTP server on the internet, you could use the [Time Sync script](https://github.com/ApolloAuto/apollo/blob/master/scripts/time_sync.sh)
# Next Steps
After you complete the hardware installation in the vehicle, see the [Apollo Quick Start](../../../02_Quick%20Start/apollo_1_5_quick_start.md) for the steps to complete the software installation.
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/硬件安装hardware installation/apollo_1_5_hardware_system_installation_guide_cn.md
|
# 关于本指南
*Apollo1.5硬件与系统安装指南* 详细介绍了Apollo计划的硬件组件、系统软件安装,安装过程包含下载和安装Apollo Linux内核。
相比1.0的版本,1.5版本的参考硬件中,主要有以下区别:
- IPC使用了另外一个型号 6108GC代替5095GC;
- 增加了激光雷达传感器,用以实现障碍物感知;
## 文档约定
本文档使用约定如下表:
| **图标** | **描述** |
| ----------------------------------- | ---------------------------------------- |
| **粗体** | 重点强调 |
| `等宽字体` | 代码,类型数据 |
| _斜体_ | 文件,部分和标题的标题使用的术语 |
|  | **Info** 包含可能有用的信息。忽略信息图标没有消极的后果。 |
|  | **Tip**. 包括有用的提示或可能有助于完成任务的快捷方式。 |
|  | **Online**. 提供指向特定网站的链接,您可以在其中获取更多信息。 |
|  | **Warning**. 包含**不能忽略**的信息,否则执行某个任务或步骤时,您将面临风险。 |
## 引言
阿波罗计划是为汽车和自主驾驶行业的合作伙伴提供开放,完整和可靠的软件平台。该项目的目的是使合作伙伴能够基于Apollo软件堆栈开发自己的自动驾驶系统。
### 文档
车辆:
- 工业计算机
- GPS
- IMU
- CAN 卡
- 硬盘
- GPS 天线
- GPS 接收器
- 激光雷达
软件:
- Ubuntu Linux 操作系统
- Apollo Linux 内核
- Nvidia GPU 驱动
## 关键硬件
需要安装的关键的硬件组件包括:
- 车载计算机系统,Neousys Nuvo-6108GC
- CAN 卡 ESD CAN-PCIe/402-1
- GPS IMU,可以从下面选择其一:
- NovAtel SPN-IGM-A1
- NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
- 激光雷达,Velodyne HDL-64E S3
### 附加组件
- 提供网络接入的4G路由器
- 调试使用的显示器,键盘,鼠标
- 连接线:VGA连接线,DVI连接线
- 苹果iPad Pro:9.7寸
关键硬件组件的特性将在后续部分中介绍。
### 车载计算机系统,IPC
车载计算机系统是用于自动驾驶车辆的工业PC(IPC),并使用由第六代Intel Xeon E3 1275 V5 CPU强力驱动的NeousysNuvo-6108GC。
Neousys Nuvo-6108GC是自动驾驶系统(ADS)的中心单元。
#### IPC的配置
IPC配置如下:
- ASUS GTX1080 GPU-A8G-Gaming GPU Card
- 32GB DDR4 RAM
- PO-280W-OW 280W 交流、直流电源适配器
- 2.5" SATA Hard Disk 1TB 7200rpm
#### IPC前后视图
Nuvo-6108GC前视图:
<img src="images/IPC-6108GC-front-side.jpg" width="90%">
Nuvo-6108GC后视图:
<img src="images/IPC-6108GC-left-side.jpg" width="90%">
中文介绍:http://www.neousys-tech.com/cn/product/application/rugged-embedded/nuvo-6108gc-gpu-computing
Neousys Nuvo-6108GC 手册:还不可用。
#### CAN 卡
IPC中使用的CAN卡型号为ESD CAN-PCIe/402。
<img src="images/can_card.png" width="50%">
产品主页:https://esd.eu/en/products/can-pcie402
#### GPS与IMU
对于GPS-IMU,有两个选择,取决于满足你的需求:
- 可选项1:NovAtel SPAN-IGM-A1
- 可选项2:NovAtel SPAN® ProPak6™ and NovAtel IMU-IGM-A1
##### NovAtel SPAN-IGM-A1
NovAtel SPAN-IGM-A1是一个集成的,单盒的解决方案,提供紧密耦合的全球导航卫星系统(GNSS)定位和具有NovAtel OEM615接收机的惯性导航功能。
<img src="images/Novatel_imu.png" width="60%">
 产品主页:
https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/
##### NovAtel SPAN ProPak6 and NovAtel IMU-IGM-A1
NovAtel ProPak6是独立的GNSS接收机,它与NovAtel提供的独立IMU(本例中为NovAtel IMU-IGM-A1)相融合以提供定位。
ProPak6提供由NovAtel生产的最新最先进的外壳产品。
IMU-IGM-A1是与支持SPAN的GNSS接收器(如SPAN ProPak6)配对的IMU。
<img src="images/Novatel_pp6.png" width="60%">
 NovAtel ProPak6 安装与操作手册:
https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf
onlineNovAtel IMU-IGM-A1 产品主页:
https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview
#### GPS天线、接收器
GPS-IMU组件的GPS接收器、天线使用的是NovAtel GPS-703-GGG-HV。
**注意**:GPS NovAtelGPS-703-GGG-HV与上文中提到的两个GPS-IMU选项的任一型号配合使用。
<img src="images/gps_receiver.png" width="60%">
 NovAtel GPS-703-GGG-HV 产品主页:
https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/
#### 激光雷达
使用来自Velodyne激光雷达公司的64线激光雷达系统HDL-64E S3。
<img src="images/lidar_pic.png" width="90%">
主要特点:
- 64 Channels
- 120m range
- 2.2 Million Points per Second
- 360° Horizontal FOV
- 26.9° Vertical FOV
- 0.08° angular resolution (azimuth)
- <2cm accuracy
- ~0.4° Vertical Resolution
- User selectable frame rate
- Rugged Design
 Velodyne HDL-64E S3介绍: http://velodynelidar.com/hdl-64e.html
## 安装任务概览
安装硬件和软件组件涉及以下任务:
**室内:**
1. 准备IPC:
- 检查图形处理单元(GPU)磁带,以确定是否需要卸下GPU卡(如果已预安装)
- 在将卡插入插槽之前,首先重新定位CAN卡端接跳线,准备并安装控制器局域网(CAN)卡。
2. IPC(如果未预装)安装硬盘,推荐安装固态硬盘;
如果你愿意,也可以更换预装的硬盘;
**推荐**:
- 为了更好的可靠性,安装固态硬盘;
- 如果需要收集驾驶数据,需要使用大容量硬盘;
3. 准备IPC加电:
- 将电源线连接到电源连接器(接线端子)
- 将显示器,以太网,键盘和鼠标连接到IPC
- 将IPC连接到电源
4. 在IPC安装软件(需要部分Linux经验):
- 安装Ubuntu
- 安装Apollo Linux内核
**车辆:**
- 确保所有在前提条件中列出的对车辆的修改,都已执行。
- 安装主要的组件:
- GPS 天线
- IPC
- GPS接收器
安装所有硬件和软件组件的实际步骤详见安装任务步骤。
## 安装任务步骤
该部分包含:
- 关键组件的安装
- 车辆硬件的安装
### 室内
- 准备IPC:
- 安装CAN卡
- 安装或者替换硬盘
- 准备为IPC供电
- 为IPC安装软件:
- Ubuntu Linux
- Apollo内核
- Nvidia GPU Driver
#### 准备IPC
有如下步骤:
1. 准备安装CAN卡:在Neousys Nuvo-6108GC中,ASUS®GTX-1080GPU-A8G-GAMING GPU卡预先安装占用了一个PCI插槽,将CAN卡安装到剩余两个PCI插槽其一即可。
a. 找到并拧下计算机侧面的八个螺丝(棕色方块所示或棕色箭头指示):
<img src="images/IPC-6108GC-Screw-Positions_labeled.png" width="99%">
b. 从IPC上拆下盖子。基座有3个PCI插槽(由显卡占据一个):
<img src="images/Removing_the_cover.jpg" width="99%">

c. 通过从其默认位置移除红色跳线帽(以黄色圆圈显示)并将其放置在其终止位置,设置CAN卡端接跳线:
<img src="images/prepare_can_card.png" width="99%">
**WARNING**: 如果端接跳线设置不正确,CAN卡将无法正常工作。
d. 将CAN卡插入IPC的插槽:

e. 安装IPC盖子:
<img src="images/IPC-6108GC-Screw-Positions.png" width="99%">
2. 准备给IPC加电:
a. 将电源线连接到IPC:
**注意**: 确保电源电缆的正极(红色标记为**R**)和负极(黑色标记为** B **)导线插入电源端子块上的正确孔中。
3. 
b. 将显示器,网线,键盘和鼠标连接到IPC:
4. 

如果将一个或多个插件卡添加到系统中,建议通过BIOS设置来配置风扇速度
```
- 计算机启动,按 F2 进入 BIOS 设置菜单
- 选择[Advanced] => [Smart Fan Setting]
- 设置 [Fan Max. Trip Temp] 为 50
- 设置 [Fan Start Trip Temp] 为 20
```
建议在显卡的图形卡上使用DVI连接器。 要将显示设置为主板上的DVI端口,请执行以下设置步骤:
```
- 开机按 F2 进入 BIOS 设置菜单
- 依次选择 [Advanced]=>[System Agent (SA) Configuration]=>[Graphics Configuration]=>[Primary Display]=> 设置为 "PEG"
```
建议将IPC配置为始终以最高性能模式运行:
```
- 开机按 F2 进入 BIOS 设置菜单
- 选择 [Power] => [SKU POWER CONFIG] => 设置为 "MAX. TDP"
```
c. 连接电源:

#### 为IPC安装软件
这部分主要描述以下的安装步骤:
- Ubuntu Linux
- Apollo 内核
- Nvidia GPU 驱动
假设您有使用Linux的经验来成功执行软件安装。
##### 安装Ubuntu Linux
步骤如下:
1. 下载Ubuntu(或Xubuntu等分支版本),并按照在线说明创建可启动的USB闪存驱动器。
>推荐使用Ubuntu 14.04.3
开机按 F2 进入 BIOS 设置菜单,建议禁用BIOS中的快速启动和静默启动,以便捕捉引导启动过程中的问题。
获取更多Ubuntu信息,可访问:
 Ubuntu 桌面站点:
[https://www.ubuntu.com/desktop](https://www.ubuntu.com/desktop)
2. 安装 Ubuntu Linux:
a. 将Ubuntu安装驱动器插入USB端口并启动IPC。
b. 按照屏幕上的说明安装Linux。
3. 执行软件更新与安装:
a. 安装完成,重启进入Linux。
b. 执行软件更新器(Software Updater)更新最新软件包,或在终端执行以下命令完成更新。
```shell
sudo apt-get update; sudo apt-get upgrade
```
c. 打开终端,输入以下命令,安装Linux 4.4 内核:
```shell
sudo apt-get install linux-generic-lts-xenial
```
IPC必须接入网络以便更新与安装软件,所以请确认网线插入并连接,如果连接网络没有使用动态分配(DHCP),需要更改网络配置。
#### 安装Apollo内核
车上运行Apollo需要[Apollo 内核](https://github.com/ApolloAuto/apollo-kernel)。强烈建议安装预编译内核。
##### 使用预编译的 Apollo 内核
你可以依照如下步骤获取、安装预编译的内核。
1. 下载发布的最新包
https://github.com/ApolloAuto/apollo-kernel/releases
2. 解压与安装
```bash
tar zxvf linux-4.4.32-apollo-1.0.0.tar.gz
cd install
sudo bash install_kernel.sh
```
3. 使用`reboot`命令重启系统;
4. 根据[ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)编译ESD CAN驱动器源代码
##### 构建你自己的内核
如果你有修改内核,或者预编译内核不是你的最佳平台,你可以按照如下步骤构建自己的:
1. 从代码仓库克隆代码
```
git clone https://github.com/ApolloAuto/apollo-kernel.git
cd apollo-kernel
```
2. 根据 [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)添加 ESD CAN 驱动源代码
3. 按照如下指令编译:
```
bash build.sh
```
4. 使用同样的方式安装内核。
#### 安装 Nvidia GPU 驱动
车辆运行Apollo还需要[Nvidia GPU 驱动](http://www.nvidia.com/download/driverResults.aspx/114708/en-us)。需要安装特定型号的Nvidia GPU 驱动。
1. 下载安装文件
```
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/375.39/NVIDIA-Linux-x86_64-375.39.run
```
2. 开始安装
```
sudo bash ./NVIDIA-Linux-x86_64-375.39.run --no-x-check -a -s --no-kernel-module
```
##### 可选项: 测试ESD CAN硬件节点
重启安装新内核的IPC之后:
a. 使用以下指令创建CAN硬件节点:
```shell
cd /dev; sudo mknod –-mode=a+rw can0 c 52 0
```
b. 使用从ESD Electronics获取到得的ESD CAN软件包的一部分的测试程序来测试CAN设备节点。
至此,IPC就可以被装载到车辆上了。
### 车辆
执行以下任务:
- 根据先决条件列表中的所述,对车辆进行必要的修改
- 安装主要的组件:
- GPS 天线
- IPC
- GPS 接收器
- 激光雷达
#### 先决条件
**注意**: 在将主要部件(GPS天线,IPC和GPS接收器)安装在车辆之前,必须按照先决条件列表所述执行必要修改。 列表中所述强制性更改的部分,不属于本文档的范围。
- 车辆必须由专业服务公司修改为“线控”技术。 此外,必须在要安装IPC的中继线上提供CAN接口连接。
- 必须在后备箱中安装电源插板,为IPC和GPS-IMU提供电源。电源插板还需要服务于车上的其他硬件,比如4G的路由器。电源插板应连接到车辆的电源系统。
- 必须安装定制的机架,将GPS-IMU天线安装在车辆的顶部。
- 必须安装定制的机架,以便将GPS-IMU安装在后背箱中。
- 必须将4G LTE路由器安装在后备箱中才能为IPC提供Internet访问。路由器必须具有内置Wi-Fi接入点(AP)功能,以连接到其他设备(如iPad),以与自主驾驶(AD)系统相连接。例如,用户将能够使用移动设备来启动AD模式或监视AD状态。
#### 主要组件安装视图
以下两图显示车辆上应安装三个主要组件(GPS天线,IPC,GPS接收机和LiDAR)的位置:
示例图:
<img src="images/Car_Sideview.png" width="99%">
车辆与后备箱侧视图
<img src="images/Car_Rearview.png" width="99%">
车辆与后备箱后视图
#### 安装GPS接收器与天线
以下组件**二选一**:
- **可选1 :** GPS-IMU: **NovAtel SPAN-IGM-A1**
- **可选2 :** GPS-IMU: **NovAtel SPAN® ProPak6™ 和 NovAtel IMU-IGM-A1**
##### 可选1:安装NovAtel SPAN-IGM-A1
安装说明描述了安装,连接和采取GPS-IMU NovAtel SPAN-IGM-A1的杠杆臂测量的过程。
**安装**
您可以将GPS-IMU NovAtel SPAN-IGM-A1放置在车辆的大部分地方,但建议您遵循以下建议:
- 将NovAtel SPAN-IGM-A1放置并固定在行李箱内,Y轴指向前方。
- 将NovAtel GPS-703-GGG-HV天线安装在位于车辆顶部的视野范围内。
**接线**
你必须连接的两根电缆:
- 天线电缆 - 将GNSS天线连接到SPAN-IGM-A1的天线端口
- 主电缆:
- 将其15针端连接到SPAN-IGM-A1
- 将其电源线连接到10至30V直流电源
- 将其串行端口连接到IPC。如果电源来自车载电池,请添加辅助电池(推荐)。

主电缆连接
更多信息参见 *SPAN-IGM™ 快速入门指南*, 第三页, 详细图:
SPAN-IGM™ 快速入门指南
[http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf)
##### 采取杠杆臂测量
当SPAN-IGM-A1和GPS天线就位时,必须测量从SPAN-IGM-A1到GPS天线的距离。 该距离标识为:X偏移,Y偏移和Z偏移。
偏移误差必须在1厘米以内才能实现高精度。 有关详细信息,请参阅* SPAN-IGM™快速入门指南*,第5页,详细图。
更多有关SPAN-IGM-A1的信息参见:
SPAN-IGM™ 用户手册:
[http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf](http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf)
#### 可选2:NovAtel SPAN® ProPak6™ 和 NovAtel IMU-IGM-A1
安装说明描述了安装,连接和采取GPS NovAtelSPAN®ProPak6™**和** NovAtel IMU-IGM-A1的杠杆臂测量的步骤。
##### 组件
安装所需的组件包括:
- NovAtel GPS SPAN ProPak6
- NovAtel IMU-IGM-A1
- NovAtel GPS-703-GGG-HV天线
- NovAtel GPS-C006电缆(将天线连接到GPS)
- NovAtel 01019014主电缆(将GPS连接到IPC的串行端口)
- 数据传输单元(DTU) - 类似于4G路由器
- 磁性适配器(用于天线和DTU)
- DB9直通电缆
##### 安装
你可以将 ProPak6 和 IMU 放置在车辆以下建议的位置:
- 将ProPak6和IMU并排固定在行李箱内,Y轴指向前方。
- 将NovAtel GPS-703-GGG-HV天线安装在车辆顶部或行李箱盖顶部,如图所示:

- 使用磁性适配器将天线紧固到行李箱盖上。
- 通过打开主干并将电缆放置在行李箱盖和车身之间的空间中,将天线电缆安装在主干箱中。
##### 接线
按照以下步骤将ProPak6 GNSS接收器和IMU连接到Apollo系统:
1.使用IMU-IGM-A1附带的分接电缆连接IMU主端口和ProPak6 COM3/IMU端口。
2.使用USB-MicroUSB转换线,连接IPC的USB端口和ProPak6的MicroUSB端口。
3.将IMU-IGM-A1分离电缆的另一端连接到车辆电源。
4.将GNSS天线连接到Propak6。
5.连接Propak6电源线。

更多有关 NovAtel SPAN ProPak6的信息, 参见:
NovAtel ProPak6 安装操作手册:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
### 安装激光雷达(LiDAR)
本部分描述了HDL-64E S3激光雷达的安装过程。
#### 安装
将HDL64E S3 LiDAR成功安装在车辆的顶部,需要一个定制的安装结构。
这种结构需要为LiDAR提供刚性支撑,同时将LiDAR提升到地面以上的某个高度,避免来自liDAR的激光束被车辆前部或后部阻挡。
LiDAR所需的实际高度取决于车辆的设计和LiDAR相对于车辆的安装点。激光器的垂直倾斜角度通常在相对于地平线的±2〜-24.8度的范围内。为了充分利用检测角度范围,在林肯MKZ上,我们建议将LiDAR安装在1.8米的最小高度(从地面到LiDAR的底部)。
#### 接线
每个HDL-64E S3 LiDAR包括一个将LiDAR连接到电源的电缆组件,计算机(用于数据传输的以太网和用于LiDAR配置的串行端口)和GPS时间同步源。

1. 连接到LiDAR
将电源和信号电缆连接到LiDAR上的匹配端口

2. 连接到电源
两根AWG 16线为HDL-64E S3提供所需电力。 所需电压/电流:12V/3A。 要连接电源,请与电线完全接触并拧紧螺丝。

3. 连接到IPC
与IPC的连接是通过以太网线。将电缆束中的以太网线水晶头插入IPC上的以太网端口。
4. 连接到 GPS:
HDL64E S3 推荐最小特定GPS/传输数据(GPRMC)和每秒脉冲(PPS)信号与GPS时间同步。需要定制连接来建立GPS接收机和LiDAR之间的通信:
>HDL64E S3 LiDAR requires the Recommended minimum specific GPS/Transit data (GPRMC) and pulse per second (PPS)signal to synchronize to the GPS time.
a. SPAN-IGM-A1
如果您配置了[配置GPS和IMU](#configuration-the-gps-and-imu)中指定的SPAN-IGM-A1,GPRMC信号将通过用户端口电缆从主端口从GPS接收器发送。 PPS信号通过Aux端口上标有“PPS”和“PPS dgnd”的电缆发送。 下图中的虚线框是HDL64E S3 LiDAR和SPAN-IGM-A1 GPS接收机附带的可用连接。 剩余的连接需要由用户进行。

b. Propak 6 和 IMU-IGM-A1
如果您配置了[配置GPS和IMU](#configuration-the-gps-and-imu)中指定的Propak 6,GPRMC信号将通过COM2端口从GPS接收器发送。PPS信号通过IO端口发送。
下图中的虚线框是HDL-64E S3 LiDAR和Propak 6 GPS接收机附带的可用连接。 剩余的连接需要由用户进行。

5. 通过串口连接进行LiDAR配置
一些低级的参数可以通过串口进行配置。
在Velodyne提供的电缆束内,有两对红色/黑色电缆,如下表所示。 较厚的一对(AWG 16)用于为LiDAR系统供电。 较薄的一对用于串行连接。 将黑线(串行输入)连接到RX,将红线连接到串行电缆的地线。 将串行电缆与USB串行适配器连接至所选择的计算机。

#### 配置
默认情况下,HDL-64E S3的网络IP地址设置为192.168.0.1。 但是,当我们配置Apollo时,我们应该将网络IP地址改为192.168.20.13。 可以使用终端应用程序Terminalite 3.2,进入网络设置命令。可以按照以下步骤配置HDL-64E S3的IP地址:
1. 将串行电缆的一面连接到笔记本电脑
2. 将串行电缆的另一端连接到HDL-64E S3的串行线
3. COM 端口默认程序
Baudrate: 9600
Parity: None
Data bits: 8
Stop bits: 1
4. COM端口程序,从如下链接下载 Termite3.2 并安装
[http://www.compuphase.com/software_termite.htm](http://www.compuphase.com/software_termite.htm)
5. HDL-64E S3和笔记本电脑之间的COM端口连接

6. 在笔记本运行 **Termite 3.2**
7. 发出串行命令,通过串口“\#HDLIPA192168020013192168020255”设置HDL-64E S3的IP地址
8. 本机必须重新上电才能采用新的IP地址

HDL-64E S3 手册可见:
[http://velodynelidar.com/hdl-64e.html](http://velodynelidar.com/hdl-64e.html)
#### 安装IPC
步骤如下:
1. 使用电压转换器/调节器,将车辆的12 VDC输出转换为所需的电压。根据Neousys的建议,使用12 VDC至19 VDC转换器,最大输出电流为20 A.

首先,将两条19 VDC输出线连接到IPC的电源连接器(绿色如下图所示)。

其次,将12 VDC输入的两条电缆连接到车辆的电源面板。 如果导线的尺寸太厚,则电线应分开成几根线,并分别连接到相应的端口。
这一步非常有必要。 如果输入电压低于所需极限。 很可能导致系统故障。
2. 将板载计算机系统6108GC放在主干箱内(推荐)。
例如,阿波罗1.5使用4x4螺钉将6108GC螺栓固定在后备箱的箱板上。 
3. 安装IPC,使其前后两侧(所有端口位于)面对右侧(乘客)或左侧(驱动器)的主干。
这种定位使得连接所有电缆更容易。
有关更多信息,请参见:
Neousys Nuvo-6108GC – 手册:
**[链接暂不可用]**
4. 连接所有电缆,其中包括:
- 电力电缆
- 控制器局域网(CAN)电缆
- 从4G路由器到IPC的以太网电缆
-(可选)监视器、键盘、鼠标
a. 将电源线连接到工控机(如图所示):
b. 将电源线的另一端连接到车辆电池(如图所示):

c. 连接DB9电缆工控机和可(如图所示):

d. 连接:
- 从4G路由器到IPC的以太网电缆
- 全球定位系统接收机
-(可选)监视器:

#### 杠杆臂测量
步骤如下:
1. 在接受测量之前,打开IPC。
2. 当IMU和GPS天线就位时,必须测量从IMU到GPS天线的距离。距离测量应为:X偏移,yoffset,和Z偏移。偏移误差必须在一厘米以内,以达到定位和定位的高精度。
更多信息,参见:
NovAtel ProPak6 安装与操作手册:
[https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
NovAtel SPAN-IGM-A1 产品主页:
[https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
#### 配置GPS、IMU
GPS 和IMU 配置如下:
```conf
WIFICONFIGSTATE OFF
UNLOGALLTHISPORT
SETIMUTOANTOFFSET0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET0 0 0
LOGCOM2 GPRMC ONTIME 1.0 0.25
EVENTOUTCONTROLMARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROLMARK1 ENABLE POSITIVE 500000000 500000000
LOGNCOM1 GPGGA ONTIME 1.0
logbestgnssposb ontime 0.5
logbestgnssvelb ontime 0.5
logbestposb ontime 0.5
logINSPVASB ontime 0.01
logCORRIMUDATASB ontime 0.01
logINSCOVSB ontime 1
logmark1pvab onnew
logimutoantoffsetsb once
logvehiclebodyrotationb onchanged
SAVECONFIG
```
ProPak6配置如下:
```conf
WIFICONFIG STATE OFF
CONNECTIMU COM3 IMU_ADIS16488
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL OFF
LOG COM2 GPRMC ONTIME 1 0.25
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SAVECONFIG
```
** WARNING:基于真实的测量值(GPS天线、IMU的偏移量)** 修改 **<u>SETIMUTOANTOFFSE</u>T** 行。
示例:
```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```
### 建立网络
本节提供了一种建立网络的建议。
运行Apollo软件的IPC必须访问互联网获取实时运动学(RTK)数据,以便精确定位。移动设备还需要连接到IPC来运行Apollo软件。
#### 推荐配置
建议您根据下图设置网络:
<img src="images/4G-LTE-setup-6108GC.png" width="99%">
步骤如下:
- 安装并配置4G网络,
- 通过以太网线连接IPC到路由器
- 配置路由器使用LTE蜂窝网络接入互联网
- 配置LTE路由器的AP功能,使iPad Pro或其他移动设备可以连接到路由器,然后连接到IPC。
### 额外任务
需要使用自己提供的组件来执行以下任务:
- 使用DVI或HDMI电缆连接显示器,并连接键盘和鼠标,以便在现场的汽车上执行调试任务。
- 在Apple iPad Pro上建立Wi-Fi连接,以访问HMI并控制IPC上运行的Apollo ADS。
### 下一步
完成硬件部分的安装之后,可以参考快速入门的教程,完成软件部分的安装。
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Guideline_sensor_Installation_apollo_3.0_cn.md
|
# Apollo 3.0传感器安装指南
## 需要的硬件

外部设备

## 坐标系
单位:毫米(mm)
原点:车辆后轮轴中心

**Figure 1. 原点和坐标系**

**Figure 2. 卡车坐标系和安装摄像机与雷达的示意图**
## 传感器安装指南
### IMU/GPS
IMU/GPS需要安装在靠近后车轮毂的位置。GPS天线需要安装在车辆顶部。
### Radar
远程雷达需要安装在车辆前保险杠上,请参考Figure 1 and Figure 2展示的信息。
### Camera
一个6mm镜头的摄像机应该面向车辆的前方。前向摄像机应当安装在车辆前部的中心位置,离地面高度为1600mm到2000mm(Camera 1),或者安装在车辆挡风玻璃上(Camera 2)。

**Figure 3. 安装摄像机的示例图**
摄像机安装完成后,摄像机w、r、t的物理坐标x、y、z应该被记录在校准文件里。
#### 安装摄像机后的检验
三个摄像机的方位应当全部设置为0。摄像机安装后,需要车辆在公路以直线开动一段距离并记录一个rosbag,通过rosbag的回放,摄像机的方位需要重新调整以设置间距、偏航角并将角度转置为0度。如果摄像机被正确的安装,地平线应该在画面高度方向上的正中间并且不倾斜。灭点同样应该在画面的正中间。请参考下述图片以将摄像机设置为最佳状态:

**Figure 4. 摄像机安装后的画面示例。地平线应该在画面高度方向上的正中间并且不倾斜。灭点同样应该在画面的正中间。 红色线段显示了画面高度和宽度方向上的中点。**
估测的平移参数的示例如下所示:
```
header:
seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: white_mkz
child_frame_id: onsemi_obstacle
transform:
rotation:
x: 0.5
y: -0.5
z: 0.5
w: -0.5
translation:
x: 1.895
y: -0.235
z: 1.256
```
如果角度不为0,则上述数据需要重新校准并在四元数中表示(参考上例中的transform->rotation )
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Guideline_sensor_Installation_apollo_2.5.md
|
# Guideline of sensor Installation for Apollo 2.5
April 19, 2018
## Required Hardware

Peripherals

## Coordinate system
Unit: millimeter (mm)
Origin: The center of the rear wheel Axle

**Figure 1. The origin and the coordinate of the system**

**Figure 2. Coordinates and Installation of cameras and a radar for truck**
## Sensor installation Guideline
### IMU/GPS
IMU/GPS need to be installed near the rear wheel axle. GPS antenna needs to install at the top of the vehicle.
### Radar
The long-range Radar needs to be installed at the front bumper of the vehicle as shown in Figure 1 and Figure 2.
### Camera
One camera with 6mm-lens should face the front of ego-vehicle. The front-facing camera needs to be installed at the center of the front of a vehicle the height between 1,600mm and 2,000mm from the ground (Camera_1) or at the windshield of a vehicle (Camera_2).

**Figure 3. Example setup of cameras**
After installation of cameras, The physical x, y, z location of camera w.r.t. origin should be saved in the calibration file.
#### Verification of camera Setups
The orientation of all three cameras should be all zeros. When the camera is installed, it is required to record a rosbag by driving a straight highway. By the replay of rosbag, the camera orientation should be re-adjusted to have pitch, yaw, and roll angles to be zero degree. When the camera is correctly installed, the horizon should be at the half of image width and not tilted. The vanishing point should be also at the center of the image. Please see the image below for the ideal camera setup.

**Figure 4. An example of an image after camera installation. The horizon should be at the half of image height and not tilted. The vanishing point should be also at the center of the image. The red lines show the center of the width and the height of the image.**
The example of estimated translation parameters is shown below.
```
header:
seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: white_mkz
child_frame_id: onsemi_obstacle
transform:
rotation:
x: 0.5
y: -0.5
z: 0.5
w: -0.5
translation:
x: 1.895
y: -0.235
z: 1.256
```
If angles are not zero, they need to be calibrated and represented in quaternion (see above stransformation->rotation).
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Guideline_sensor_Installation_apollo_3.0.md
|
# Guideline of sensor Installation for Apollo 3.0
June 27, 2018
## Required Hardware

Peripherals

## Coordinate system
Unit: millimeter (mm)
Origin: The center of the rear wheel Axle

**Figure 1. The origin and the coordinate of the system**

**Figure 2. Coordinates and Installation of cameras and a radar for truck**
## Sensor installation Guideline
### IMU/GPS
IMU/GPS need to be installed near the rear wheel axle. GPS antenna needs to install at the top of the vehicle.
### Radar
The long-range Radar needs to be installed at the front bumper of the vehicle as shown in Figure 1 and Figure 2.
### Camera
One camera with 6mm-lens should face the front of ego-vehicle. The front-facing camera needs to be installed at the center of the front of a vehicle the height between 1,600mm and 2,000mm from the ground (Camera_1) or at the windshield of a vehicle (Camera_2).

**Figure 3. Example setup of cameras**
After installation of cameras, The physical x, y, z location of camera w.r.t. origin should be saved in the calibration file.
#### Verification of camera Setups
The orientation of all three cameras should be all zeros. When the camera is installed, it is required to record a rosbag by driving a straight highway. By the replay of rosbag, the camera orientation should be re-adjusted to have pitch, yaw, and roll angles to be zero degree. When the camera is correctly installed, the horizon should be at the half of image height and not tilted. The vanishing point should be also at the center of the image. Please see the image below for the ideal camera setup.

**Figure 4. An example of an image after camera installation. The horizon should be at the half of image height and not tilted. The vanishing point should be also at the center of the image. The red lines show the center of the width and the height of the image.**
The example of estimated translation parameters is shown below.
```
header:
seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: white_mkz
child_frame_id: onsemi_obstacle
transform:
rotation:
x: 0.5
y: -0.5
z: 0.5
w: -0.5
translation:
x: 1.895
y: -0.235
z: 1.256
```
If angles are not zero, they need to be calibrated and represented in quaternion (see above transform->rotation).
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Microphone/Re_Speaker_USB_Mic_Array_Guide.md
|
# Apollo 6.0 Microphone Installation
### Supported Devices
The Re-Speaker USB Mic Array
https://wiki.seeedstudio.com/ReSpeaker-USB-Mic-Array/

### Connection
Use the provided USB cable and connect the microphone to a USB port on the machine which is running Apollo. A USB extension cable may be needed depending on the application.
### Setup
Follow the instructions provided [here](https://wiki.seeedstudio.com/ReSpeaker-USB-Mic-Array/#update-firmware) to update the firmware on the ReSpeaker to `48k_6_channels_firmware.bin`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Camera/Truly_Argus_Camera_Installation_Guide.md
|
# Guide for Argus Camera
Argus camera is a joint development venture product of Truly Seminconductors Ltd. and Baidu. The Argus camera features high dynamic range (HDR 120dB), internal/external trigger and OTA firmware update. It is well supported by the Apollo Sensor Unit. This line of product is based on ON Semiconductor MARS.
We recommend using ```three cameras```, one with **6 mm** lens, one with **12 mm** lens and the last one with **2.33 mm** to achieve the required performance for the traffic light detection application.

This camera can be connected to the Apollo Sensor Unit via the FAKRA connector for data transfer, trigger and OTA firmware update.
## Product specifications

## Disclaimer
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Camera/Wissen_Camera_Installation_Guide_cn.md
|
# Wissen摄像头指南
Wissen摄像头是Wissen Technologies和百度的联合投资开发的产品。该系列相机具有高动态范围(HDR 120dB),内部/外部触发和OTA固件更新。它能很好的匹配Apollo传感器单元。该系列产品基于安森美半导体的AR230传感器(1080P)和AP0202 ISP。
我们建议采用```3个摄像头```,两个带有 **6mm**镜头和一个带有 **25mm**镜头,以达到交通灯检测应用所需的性能。

该摄像头可通过FAKRA连接器连接到Apollo传感器单元,以进行数据传输、触发和OTA固件更新。
## 免责声明
该设备由`Apollo硬件开发平台提供支持`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Camera/Wissen_Camera_Installation_Guide.md
|
# Guide for Wissen Camera
Wissen's camera is a joint development venture product of Wissen Technologies and Baidu. This line of camera features high dynamic range (HDR 120dB), internal/external trigger and OTA firmware update. It is well supported by the Apollo Sensor Unit. This line of product is based on AR230 sensor (1080P) and AP0202 ISP from ON Semiconductor.
We recommend using ```three cameras```, two with **6 mm** lens and one with **25 mm** lens to achieve the required performance for the traffic light detection application.

This camera can be connected to the Apollo Sensor Unit via the FAKRA connector for data transfer, trigger and OTA firmware update.
## Disclaimer
This device is `Apollo Hardware Development Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Camera/Leopard_Camera_LI-USB30-AZ023WDR__Installation_Guide_cn.md
|
# LI-USB30-AZ023WDRB指南
摄像头LI-USB30-AR023ZWDR采用标准USB 3.0。由Leopard Imaging Inc.制造。该系列产品基于AZ023Z 1080P传感器和安森美半导体的AP0202 ISP。它支持外部触发和软件触发。
我们建议使用两个带 **6mm**镜头的摄像头和一个带 **25mm**镜头的摄像头,以达到交通灯检测应用所需的性能。

该摄像头可通过USB 3.0电缆连接到IPC,用于电源和数据通信。外部触发信号可通过HR25-7TP-8P(72)连接器发送到摄像头。固件也需要更改以启用外部触发。有关外部触发器的更多详细信息,请联系Leopard Imaging Inc.获取更多说明。
## 参考资料
您可以在其[官网](https://leopardimaging.com/product/li-usb30-ar023zwdrb/)上找到有关Leopard Imaging Inc.摄像头的更多信息
* [数据表](https://www.leopardimaging.com/LI-USB30-AR023ZWDRB_datasheet.pdf)
* [触发电缆](https://leopardimaging.com/product/li-usb3-trig_cable/)
## 免责声明
该设备由`Apollo平台提供支持`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Camera/README.md
|
# Apollo Cameras
You could integrate 3 types of Camera's with Apollo. Refer to their individual Installation guides for more information. If you currently use the ASU, you could integrate any of the camera's below, if not, only the Leopard Camera would work with Apollo.
1. [Leopard Imaging Inc's Camera - LI-USB30-AZ023WDRB](./Leopard_Camera_LI-USB30-AZ023WDR__Installation_Guide.md)
2. [Truly Camera](./Truly_Argus_Camera_Installation_Guide.md)
3. [Wissen Camera](./Wissen_Camera_Installation_Guide.md)
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Camera/README_cn.md
|
# Apollo摄像头
您可以将3种类型的摄像头与Apollo集成。更多信息,请参阅各自的安装指南。如果您目前使用的是ASU,您可以集成下面的任何一种,否则,只能使用Leopard Camera。
1. [Leopard Imaging Inc's Camera - LI-USB30-AZ023WDRB](./Leopard_Camera_LI-USB30-AZ023WDR__Installation_Guide_cn.md)
2. [Truly Camera](./Truly_Argus_Camera_Installation_Guide_cn.md)
3. [Wissen Camera](./Wissen_Camera_Installation_Guide_cn.md)
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Camera/Truly_Argus_Camera_Installation_Guide_cn.md
|
## Argus摄像头指南
Argus摄像头是由Truly Seminconductors Itd和百度联合投资开发的产品。Argus摄像头具有高动态范围(HDR 120dB),内部/外部触发和OTA固件更新。它能很好的匹配Apollo传感器单元。该系列产品基于安森美半导体的AR230 1080P传感器和AP0202 ISP。
我们建议采用```3个摄像头```,两个带有 **6mm**镜头和一个带有 **25mm**镜头,以达到交通灯检测应用所需的性能。

该摄像机可通过FAKRA连接器连接到Apollo传感器单元,以进行数据传输、触发和OTA固件更新。
## 产品规格

## 免责声明
该设备由`Apollo平台提供支持`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Camera/Leopard_Camera_LI-USB30-AZ023WDR__Installation_Guide.md
|
# Guide for LI-USB30-AZ023WDRB
The cameras used are LI-USB30-AR023ZWDR with standard USB 3.0 case manufactured by Leopard Imaging Inc. This line of product is based on AZ023Z 1080P sensor and AP0202 ISP from ON Semiconductor. It supports external trigger and software trigger.
We recommend using two cameras with 6 mm lens and one with 25 mm lens to achieve the required performance for traffic light detection application.

This camera can be connected to the IPC through USB 3.0 cable for power and data communication. External trigger signal can be sent into the camera via the HR25-7TP-8P(72) connector. A firmware change would also be needed to enable external trigger. For more detail on external triggers, please contact Leopard Imaging Inc. for more instructions.
## Reference
You can find additional information regarding the Leopard Imaging Inc. cameras on their [website](https://leopardimaging.com/product/li-usb30-ar023zwdrb/)
* [Data Sheet](https://www.leopardimaging.com/LI-USB30-AR023ZWDRB_datasheet.pdf)
* [Trigger Cable](https://leopardimaging.com/product/li-usb3-trig_cable/)
## Disclaimer
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Navigation/Propak_6_IMU-IGM-A1_Installation_Guide_cn.md
|
## NovAtel Propak6 和 NovAtel IMU-IGM-A1 安装指南
NovAtel ProPak6 是一个独立的GNSS接收器。它和一个单独的 NovAtel-supported IMU 协同工作提供定位功能。
IMU-IGM-A1是一个IMU(惯性计算单元)并与一个SPAN-enabled GNSS接收器例如SPAN ProPak6相互配对进行工作。

和GPS-IMU一同使用的GPS接收器/天线是 **NovAtel GPS-703-GGG-HV**。

### 安装GPS接收器和天线
本安装指令描述了挂载、连接和为 **GPS NovAtel SPAN® ProPak6™** 与 **NovAtel IMU-IGM-A1** 量取和设置控制杆尺寸的步骤
##### 安装需要的组件
在安装过程中需要的组件包括:
- NovAtel GPS SPAN ProPak6
- NovAtel IMU-IGM-A1
- NovAtel GPS-703-GGG-HV Antenna
- NovAtel GPS-C006 Cable (将天线连接到GPS)
- NovAtel 01019014 Main Cable (连接GPS到IPC上的串口)
- Data Transport Unit (DTU) – 和4G路由器相同
- 磁性适配器 (固定天线和DTU)
- DB9 直通网线
##### 挂载
使用者可以将装置 ProPak6 和IMU放置在车辆上的大部分位置,但是我们建议使用者采用下述的建议方案:
- 将ProPak6和IMU 并列放置并固定在车辆内部,同时使Y轴指向前方。
- 将NovAtel GPS-703-GGG-HV 天线挂载在车辆上方,或者车辆盖子的上面 ,如下图所示:

- 使用一个磁性适配器将天线牢固的固定在车辆盖子上。
- 打开车辆盖子,将天线的数据线放置在车辆盖子和车身之间的空闲区域。
##### 配线
执行如下步骤将ProPak6 GNSS接收器和IMU连接到Apollo系统:
* 使用为IMU-IGM-A1设备分配的分股数据线连接IMU Main端口和ProPak6 COM3/IMU端口。
* 使用一个USB-A-to-MicroUSB数据线连接IPC的USB端口和ProPak6的MicroUSB端口。
* 将IMU-IGM-A1分股数据线的其他端接口连接到车辆的电源系统。
* 连接GNSS天线到Propak6。
* 连接Propak6的电源线。

#### 量取控制臂长度
参考下述步骤:
* 在量取尺寸前需要启动IPC
* 当IMU和GPS天线处在正确位置时量取IMU到GPS天线的距离。IMU 的中点和天线的中点标记在设备的外部。
* 距离被测量并记录为X轴偏移、Y轴偏移和Z轴偏移。 坐标轴由IMU的位置确定。偏移量的误差应该被控制在一厘米以内以获取高精度的定位信息。
### 配置GPS和IMU
下面展现了配置GPS和IMU的方法。该配置过程可以通过键入命令或从NovAtel Connect下载批量配置文件完成。
```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
CONNECTIMU COM3 IMU_ADIS16488
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew
log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15
log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged
SAVECONFIG
```
** WARNING:** 基于对IMU和天线偏移值的实际测量数据修改 **<u>SETIMUTOANTOFFSET</u>** 行对应的参数
例如:
```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```
前3个数字表示控制杆的测距结果。后3个数字表示测量的不确定性(误差)
### 参考资料
获取更多关于NovAtel SPAN ProPak6和IMU-IGM-A1的信息,请参考:
* [NovAtel ProPak6 Installation & Operation Manual](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
* [NovAtel IMU-IGM-A1 Product Page](https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview)
* [NovAtel GPS-703-GGG-HV](https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/)
## 免责声明
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Navigation/Navtech_NV-GI120_Installation_Guide_cn.md
|
## Navtech_NV-GI120安装指南
```
NV-GI120 is a position and orientation system for automatic drive of NAV Technology. With the
high-precision GNSS board card and high-precision MEMS gyro, it has the real-time attitude
and position resolving ability while transmitting the original data of the sensor and board card
for post-processing high-precision resolution.
----Navtech official brochure
```

NV-GI120将GNSS接收器和MEMS IMU设备集成进一个小型的紧凑装置中,以提供高精度的定位结果。它支持双重天线配置和多频段频率的接收。
### 安装

1. 可以通过SMA连接方式将天线和该设备进行连接
2. 一个数据线捆和该设备一起提供。该数据线捆可以分出多个连接器以处理通讯和配置工作
3. 配置工作和对Novatel设备的操作相同。请联系设备供应商获取详细的配置指令
4. 数据线上的标签和相对应的解释/翻译在下表中展示:
| Labels | Explanations |
| -------------- | ------------------------------------------------ |
| PPS | Pulse per second(每秒脉冲数) |
| 导航 | navigation output (replaceable by the ethernet) |
| 板卡 | ------- |
| 里程 | Odometer connection |
| 调试 | configuration |
| 网口 | ethernet |
| Two naked wire | Power (red and blue) |
| 扩展 | Extension |
## 免责声明
This device is `Apollo Hardware Development Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Navigation/README.md
|
# Apollo Navigation
You could integrate 2 types of Navigation Hardware with Apollo. Refer to their individual Installation guides for more information.
1. Novatel
- [NovAtel Propak6 with NovAtel IMU-IGM-A1](Propak_6_IMU-IGM-A1_Installation_Guide.md)
- [SPAN-IGM-A1](SPAN-IGM-A1_Installation_Guide.md)
3. [Navtech NV-GI120](Navtech_NV-GI120_Installation_Guide.md)
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Navigation/README_cn.md
|
# Apollo导航
使用者可以使用两种不同类型的导航硬件和Apollo集成。参考导航硬件的安装指南以获取更多信息。
1. Novatel
- [NovAtel Propak6 和 NovAtel IMU-IGM-A1 安装指南](Propak_6_IMU-IGM-A1_Installation_Guide_cn.md)
- [SPAN-IGM-A1安装指南](SPAN-IGM-A1_Installation_Guide_cn.md)
3. [Navtech_NV-GI120安装指南](Navtech_NV-GI120_Installation_Guide_cn.md)
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Navigation/Propak_6_IMU-IGM-A1_Installation_Guide.md
|
## Installation Guide of NovAtel Propak6 and NovAtel IMU-IGM-A1
NovAtel ProPak6 is a standalone GNSS receiver. It works with a separate NovAtel-supported IMU (in this case, the NovAtel IMU-IGM-A1)to provide localization functionality.
The IMU-IGM-A1 is an IMU that pairs with a SPAN-enabled GNSS receiver such as the SPAN ProPak6.

The GPS Receiver/Antenna used with the GPS-IMU component is the **NovAtel GPS-703-GGG-HV**.

### Installing the GPS Receiver and Antenna
The installation instructions describe the procedure to mount, connect, and take the lever arm measurements for the GPS NovAtel SPAN® ProPak6™ **and** the NovAtel IMU-IGM-A1.
##### Components for the Installation
The components that are required for the installation include:
- NovAtel GPS SPAN ProPak6
- NovAtel IMU-IGM-A1
- NovAtel GPS-703-GGG-HV Antenna
- NovAtel GPS-C006 Cable (to connect antenna to GPS)
- NovAtel 01019014 Main Cable (to connect GPS to a serial port on the IPC)
- Data Transport Unit (DTU) – similar to a 4G router
- Magnetic adapters (for antenna and DTU)
- DB9 straight through cable
##### Mounting
You can place the two devices, the ProPak6 and the IMU in most places in the vehicle, but it is suggested that you follow these recommendations:
- Place and secure the ProPak6 and the IMU side-by-side inside the trunk with the Y-axis pointing forward.
- Mount the NovAtel GPS-703-GGG-HV antenna on top of the vehicle or on top of the trunk lid as shown:

- Use a magnetic adapter to tightly attach the antenna to the trunk lid.
- Install the antenna cable in the trunk by opening the trunk and placing the cable in the space between the trunk lid and the body of the car.
##### Wiring
Follow these steps to connect the ProPak6 GNSS Receiver and the IMU to the Apollo system:
* Use the split cable that comes with IMU-IGM-A1 to connect the IMU Main port and theProPak6 COM3/IMU port.
* Use a USB-A-to-MicroUSB cable to connect the USB port of the IPC and the MicroUSB port of the ProPak6.
* Connect the other end of the IMU-IGM-A1 split cable to the vehicle power.
* Connect the GNSS antenna to Propak6.
* Connect the Propak6 power cable.

#### Taking the Lever Arm Measurement
Follow these steps:
* Before taking the measurement, turn on the IPC.
* When the IMU and the GPS Antenna are in position, the distance from the IMU to the GPS Antenna must be measured. The center of the IMU and the center of the antenna are labeled on the exterior of the devices.
* The distance should be measured as: X offset, Y offset, and Z offset. The axis should be determined by the IMU. The error of offset must be within one centimeter to achieve high accuracy in positioning and localization.
### Configuring the GPS and IMU
Configure the GPS and IMU as shown below. This process can be done either by keying in the commands, or by loading batch configuraion file in NovAtel Connect.
```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
CONNECTIMU COM3 IMU_ADIS16488
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew
log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15
log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged
SAVECONFIG
```
** WARNING:** Modify the **<u>SETIMUTOANTOFFSET</u>** line based on the actual measurement (of the antenna and the IMU offset).
For example:
```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```
The first 3 numbers indicate the result of the lever arm distance measurement. The last 3 numbers are the uncertainty of the measurement.
### References
For more information about the NovAtel SPAN ProPak6 and the IMU-IGM-A1, see:
* [NovAtel ProPak6 Installation & Operation Manual](https://www.novatel.com/assets/Documents/Manuals/OM-20000148.pdf)
* [NovAtel IMU-IGM-A1 Product Page](https://www.novatel.com/products/span-gnss-inertial-systems/span-imus/span-mems-imus/imu-igm-a1/#overview)
* [NovAtel GPS-703-GGG-HV](https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/)
## Disclaimer
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Navigation/PwrPak7_installation_Guide_cn.md
|
## NovAtel PwrPak7 安装指南
NovAtel PwrPak7是一款集成的INS接收器,该设备中包含GNSS接收器和IMU。

### 安装GPS接收器
Novatel PwrPak7的概述如下所示。

要给接收器的上电,请将电源扩展电缆上的+VIN_A和+VIN_B连接到电源(即12VDC)正极,并将-VIN都连接到负极。详情请参阅以下有关PwrPak7电源线的链接。
* [NovAtel ProPak7 Power Cable](https://docs.novatel.com/OEM7/Content/Technical_Specs_Receiver/PwrPak7_Power_Cable.htm)
PwrPak7接收器支持双天线,ANT1是上方的天线接口,作为主天线(Apollo系统必需)。 ANT2是下方的天线接口,作为辅助天线(可选)。
与Novatel ProPak6类似,要发送RTK校正和日志数据,我们可以使用USB线把PwrPak7上的MicroUSB端口与和车辆上的IPC相连接。
可以通过延长电缆把PwrPak7上的26针连接器与Lidar系统相连。
连接到Lidar系统需要COM2端口和PPS信号。有关延长电缆的详细信息,请参阅下面的网站。
* [NovAtel ProPak7 All I/O Cable](https://docs.novatel.com/OEM7/Content/Technical_Specs_Receiver/PwrPak7_All_IO_Cable.htm?tocpath=Specifications%7CPwrPak7%20Technical%20Specifications%7C_____11)
您可以将PwrPak7放置在车辆的大多数位置,但是建议您遵循以下建议:
- 将PwrPak7放置并固定在后备箱内,Y轴指向正前方。
- 使用磁性适配器将天线牢固地连接到后备箱盖。
- 打开后备箱盖子,将天线的数据线放置在后备箱盖和车身之间的空闲区域。
### 进行杠杆臂测量
按以下步骤进行杆臂值测量:
* 进行测量之前,请打开IPC。
* 当PwrPak7和GPS天线就位后,必须测量从PwrPak7到GPS天线的距离。PwrPak7 IMU的中心和天线的中心标记在设备的外部。
* 距离应测量为:X方向偏移,Y方向偏移和Z方向偏移。轴应由IMU确定。偏移误差必须在1厘米以内,以实现高精度的定位。
### 配置PwrPak7
请按照如下所示配置GPS和IMU。可以通过键入命令或在NovAtel Connect中加载批处理配置文件来完成此过程。
对于PwrPak7:
```
WIFICONFIG OFF
UNLOGALL THISPORT
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
SERIALCONFIG COM1 9600 N 8 1 N OFF
SERIALCONFIG COM2 9600 N 8 1 N OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
INTERFACEMODE COM2 NOVATEL NOVATEL ON
INTERFACEMODE USB2 RTCMV3 NONE OFF
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
RTKSOURCE AUTO ANY
PSRDIFFSOURCE AUTO ANY
SETINSTRANSLATION ANT1 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSTRANSLATION ANT2 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSTRANSLATION USER 0.00 0.00 0.00
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
LOG USB1 BESTGNSSPOSB ONTIME 1
LOG USB1 BESTGNSSVELB ONTIME 1
LOG USB1 BESTPOSB ONTIME 1
LOG USB1 INSPVAXB ONTIME 1
LOG USB1 INSPVASB ONTIME 0.01
LOG USB1 CORRIMUDATASB ONTIME 0.01
LOG USB1 RAWIMUSXB ONNEW 0 0
LOG USB1 MARK1PVAB ONNEW
LOG USB1 RANGEB ONTIME 1
LOG USB1 BDSEPHEMERISB ONTIME 15
LOG USB1 GPSEPHEMB ONTIME 15
LOG USB1 GLOEPHEMERISB ONTIME 15
LOG USB1 INSCONFIGB ONCE
LOG USB1 VEHICLEBODYROTATIONB ONCHANGED
SAVECONFIG
```
** WARNING:** 请根据实际测量值修改 **<u>SETINSTRANSLATION</u>** 行的内容。ANT1用于必需的主天线,而ANT2用于辅助天线,它是可选的。
例如:
```
SETINSTRANSLATION ANT1 -0.05 0.5 0.8 0.05 0.05 0.08
```
前三个数字表示杠杆臂距离的测量结果。后三个数字是测量的不确定度。
### 参考
有关NovAtel PwrPak7的更多信息,请参考:
* [NovAtel PwrPak7 Installation & Operation User Manual](https://docs.novatel.com/OEM7/Content/PDFs/PwrPak7_Install_Ops_Manual.pdf)
* [NovAtel PwrPak7 Installation Overview](https://docs.novatel.com/OEM7/Content/PwrPak_Install/PwrPak7_Install_Overview.htm?TocPath=Installation%7CPwrPak7%20Installation%7C_____4)
## 免责声明
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Navigation/Npos320_guide.md
|
## Npos320 Guide
BDStar Navigation NPOS is an integrated INS receiver, which has GNSS receiver and IMU included in the device.

### Installation

### Data Protocol Parse
Typical data protocols commonly used is `INSPVAXA` ,more detail about data protocol please see NovAtel《[OEM7 Commands and Logs Reference Manual](https://docs.novatel.com/OEM7/Content/PDFs/OEM7_Commands_Logs_Manual.pdf)》
Npos320 Configration:
```
SETIMUEVENT IN EVENT1
CONNECTIMU SPI INVENSENSE_IAM20680
SETINSPROFILE LAND_PLUS
SETINSTRANSLATION ANT1 0.742 0.660 -0.759 0.05 0.05 0.05
SETINSTRANSLATION ANT2 -0.398 0.660 -0.759 0.05 0.05 0.05
SETINSROTATION RBV 0 180 0 5 5 5
SETINSROTATION RBV 0 0 0 5 5 5
SETINSTRANSLATION USER 0 0 0
ALIGNMENTMODE AIDED_TRANSFER
ALIGNMENTMODE UNAIDED
SETINITAZIMUTH 180 5
SAVECONFIG
```
** WARNING:** Modify the **<u>SETINSTRANSLATION</u>T** line based on the actual measurement (of the antenna and the IMU offset). ANT1 is for primary antenna which is required, and ANT2 is for secondary antenna and it is optional.
For example:
```
SETINSTRANSLATION ANT1 -0.05 0.5 0.8 0.05 0.05 0.08
```
The first 3 numbers indicate the result of the lever arm distance measurement. The last 3 numbers are the uncertainty of the measurement.
## Disclaimer
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Navigation/Navtech_NV-GI120_Installation_Guide.md
|
## Guide for Navtech NV-GI120
```
NV-GI120 is a position and orientation system for automatic drive of NAV Technology. With the
high-precision GNSS board card and high-precision MEMS gyro, it has the real-time attitude
and position resolving ability while transmitting the original data of the sensor and board card
for post-processing high-precision resolution.
----Navtech official brochure
```

NV-GI120 integrates the GNSS receiver and MEMS IMU device into a compact package to provide high precision localization results. It supports dual antenna configuration and multi-frequency reception.
### Installation

1. The antennas(antennae) can be connected to the module via SMA connection.
2. A cable bundle is provided with the navigation module. One cable breaks out to multiple connectors to handle communication and configuration.
3. The configuration is similar to what can be done on Novatel devices. Please contact the vendor for detailed instructions.
4. The table for the labels on the break out cable bundle and the corresponding explanations/translations is shown below:
| Labels | Explanations |
| -------------- | ------------------------------------------------ |
| PPS | Pulse per second |
| 导航 | navigation output (replaceable by the ethernet) |
| 板卡 | ------- |
| 里程 | Odometer connection |
| 调试 | configuration |
| 网口 | ethernet |
| Two naked wire | Power (red and blue) |
| 扩展 | Extension |
## Disclaimer
This device is `Apollo Hardware Development Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Navigation/PwrPak7_Installation_Guide.md
|
## Installation Guide of NovAtel PwrPak7
NovAtel PwrPak7 is an integrated INS receiver, which has GNSS receiver and IMU included in the device.

### Installing the GPS Receiver
The overview of Novatel PwrPak7 is shown as below.

To power on the receiver, connect +VIN_A and +VIN_B from power extension cable to power source (i.e., 12VDC) positive side, and connect both -VIN to negative side. Refer to link below about PwrPak7 power cable.
* [NovAtel ProPak7 Power Cable](https://docs.novatel.com/OEM7/Content/Technical_Specs_Receiver/PwrPak7_Power_Cable.htm)
The PwrPak7 receiver supports dual antenna, ANT1 is the port on top and considered as primary antenna, which is required by Apollo system. ANT2 is the port on bottom and considered as secondary antenna, and this is optional.
To send RTK correction and log data, similar as Novatel ProPak6, we can use a USB cable and connect to the MicroUSB port on PwrPak7, and the other side to the IPC on the vehicle.
The COM2 port and PPS signal are required to connect to Lidar system, which needs an extension cable of the 26-pin connector on PwrPak7. For detail information about the extension cable, refer to Novatel PwrPak All I/O Cable website below.
* [NovAtel ProPak7 All I/O Cable](https://docs.novatel.com/OEM7/Content/Technical_Specs_Receiver/PwrPak7_All_IO_Cable.htm?tocpath=Specifications%7CPwrPak7%20Technical%20Specifications%7C_____11)
You can place the PwrPak7 in most places in the vehicle, but it is suggested that you follow these recommendations:
- Place and secure the PwrPak7 inside the trunk with the Y-axis pointing forward.
- Use a magnetic adapter to tightly attach the antenna to the trunk lid.
- Install the antenna cable in the trunk by opening the trunk and placing the cable in the space between the trunk lid and the body of the car.
#### Taking the Lever Arm Measurement
Follow these steps:
* Before taking the measurement, turn on the IPC.
* When the PwrPak7 and the GPS Antenna are in position, the distance from the PwrPak7 to the GPS Antenna must be measured. The center of the PwrPak7 IMU and the center of the antenna are labeled on the exterior of the devices.
* The distance should be measured as: X offset, Y offset, and Z offset. The axis should be determined by the IMU. The error of offset must be within one centimeter to achieve high accuracy in positioning and localization.
### Configuring the PwrPak7
Configure the GPS and IMU as shown below. This process can be done either by keying in the commands, or by loading batch configuraion file in NovAtel Connect.
For PwrPak7:
```
WIFICONFIG OFF
UNLOGALL THISPORT
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
SERIALCONFIG COM1 9600 N 8 1 N OFF
SERIALCONFIG COM2 9600 N 8 1 N OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
INTERFACEMODE COM2 NOVATEL NOVATEL ON
INTERFACEMODE USB2 RTCMV3 NONE OFF
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
RTKSOURCE AUTO ANY
PSRDIFFSOURCE AUTO ANY
SETINSTRANSLATION ANT1 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSTRANSLATION ANT2 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSTRANSLATION USER 0.00 0.00 0.00
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
LOG USB1 BESTGNSSPOSB ONTIME 1
LOG USB1 BESTGNSSVELB ONTIME 1
LOG USB1 BESTPOSB ONTIME 1
LOG USB1 INSPVAXB ONTIME 1
LOG USB1 INSPVASB ONTIME 0.01
LOG USB1 CORRIMUDATASB ONTIME 0.01
LOG USB1 RAWIMUSXB ONNEW 0 0
LOG USB1 MARK1PVAB ONNEW
LOG USB1 RANGEB ONTIME 1
LOG USB1 BDSEPHEMERISB ONTIME 15
LOG USB1 GPSEPHEMB ONTIME 15
LOG USB1 GLOEPHEMERISB ONTIME 15
LOG USB1 INSCONFIGB ONCE
LOG USB1 VEHICLEBODYROTATIONB ONCHANGED
SAVECONFIG
```
** WARNING:** Modify the **<u>SETINSTRANSLATION</u>T** line based on the actual measurement (of the antenna and the IMU offset). ANT1 is for primary antenna which is required, and ANT2 is for secondary antenna and it is optional.
For example:
```
SETINSTRANSLATION ANT1 -0.05 0.5 0.8 0.05 0.05 0.08
```
The first 3 numbers indicate the result of the lever arm distance measurement. The last 3 numbers are the uncertainty of the measurement.
### References
For more information about the NovAtel PwrPak7, see:
* [NovAtel PwrPak7 Installation & Operation User Manual](https://docs.novatel.com/OEM7/Content/PDFs/PwrPak7_Install_Ops_Manual.pdf)
* [NovAtel PwrPak7 Installation Overview](https://docs.novatel.com/OEM7/Content/PwrPak_Install/PwrPak7_Install_Overview.htm?TocPath=Installation%7CPwrPak7%20Installation%7C_____4)
## Disclaimer
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Navigation/SPAN-IGM-A1_Installation_Guide_cn.md
|
## SPAN-IGM-A1安装指南
NovAtel SPAN-IGM-A1是一个集成的单盒的并且紧密耦合了全球卫星导航系统和惯性导航系统,以NovAtel OEM615接收器为本身特点的方案。

和GPS-IMU一同使用的GPS接收器/天线是 **NovAtel GPS-703-GGG-HV**.
```
GPS NovAtelGPS-703-GGG-HV必须和两种GPS-IMU选择的任一模型(SPAN-IGM-A1 和 Propak6), 全球定位系统(GPS)和惯性计算单元(IMU)协同工作。
```

### 安装GPS接收器和天线
本安装指令描述了挂载、连接和为GPS-IMU NovAtel SPAN-IGM-A1量取和设置控制杆尺寸的步骤。
##### 挂载
使用者可以将装置GPS-IMU NovAtel SPAN-IGM-A1放置在车辆上的大部分位置,但是我们建议使用者采用下述的建议方案:
- 将GPS-IMU NovAtel SPAN-IGM-A1放置并固定在车辆内部,同时使Y轴指向前方。
- 将NovAtel GPS-703-GGG-HV 天线挂载在车辆上方无遮挡的区域。
##### 配线
有三个需要连接的数据线
- 天线数据线将GNSS天线连接到SPAN-IGM-A1天线端口
- 主数据线:
- 将15-pin端连接到SPAN-IGM-A1
- 连接电源线到一个10-to-30V DC电源
- 连接用户端口到IPC.
- 如果电源供应来自于车辆的电池,则需要额外增加一个辅助电池(推荐)。
- AUX线:
- 连接AUX数据线到15-pin AUX端口
- 如果USB端口用于数据传输,则连接USB数据线到IPC
请参考下述图片:

如果需要了解更多信息,请访问[the SPAN-IGM™ Quick Start Guide](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf)第3页获取更多详细的图片。
##### 量取控制臂长度
当SPAN-IGM-A1和GPS天线处在正确位置时量取SPAN-IGM-A1到GPS天线的距离。距离被测量并记录为X轴偏移、 Y轴偏移、 和Z轴偏移。设备的中点标记在设备的外部。
如果需要了解更多信息,请访问[the SPAN-IGM™ Quick Start Guide](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf)第5页获取更多详细的图片。
### 配置GPS和SPAN-IGM-A1
下面展现了配置GPS和SPAN-IGM-A1的方法。该配置过程可以通过键入命令或从NovAtel Connect下载批量配置文件完成。
```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew
log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15
log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged
SAVECONFIG
```
** WARNING:** 基于对 SPAN-IGM-A1和天线偏移值的实际测量数据修改 **<u>SETIMUTOANTOFFSE</u>T** 行对应的参数
例如:
```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```
前3个数字表示控制杆的测距结果。后3个数字表示测量的不确定性(误差)。
### 资料参考
获取更多关于NovAtel SPAN-IGM-A1的信息,请参考:
* [NovAtel SPAN-IGM-A1 Product Page](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
* [NovAtel GPS-703-GGG-HV Product page](https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/)
* [SPAN-IGM™ Quick Start Guide](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf)
* [SPAN-IGM™ User Manual](http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf)
## 免责声明
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Navigation/SPAN-IGM-A1_Installation_Guide.md
|
## Installation Guide of SPAN-IGM-A1
The NovAtel SPAN-IGM-A1 is an integrated, single-box solution that offers tightly coupled Global Navigation Satellite System (GNSS) positioning and inertial navigation featuring the NovAtel OEM615 receiver.

The GPS Receiver/Antenna used with the GPS-IMU component is the **NovAtel GPS-703-GGG-HV**.
```
The GPS NovAtelGPS-703-GGG-HV works with either model of the two GPS-IMU options (SPAN-IGM-A1 and Propak6), Global Positioning System (GPS) and Inertial Measurement Unit (IMU).
```

### Installing the GPS Receiver and Antenna
The installation instructions describe the procedure to mount, connect, and take the lever arm measurements for the GPS-IMU NovAtel SPAN-IGM-A1.
##### Mounting
You can place the GPS-IMU NovAtel SPAN-IGM-A1 in most places in the vehicle but it is suggested that you follow these recommendations:
- Place and secure the NovAtel SPAN-IGM-A1 inside the trunk with the Y-axis pointing forward.
- Mount the NovAtel GPS-703-GGG-HV antenna in an unobstructed location on top of the vehicle.
##### Wiring
There are three cables that need to be connected
- The antenna cable connects the GNSS antenna to the antenna port of the SPAN-IGM-A1
- The main cable:
- Connect the 15-pin end to the SPAN-IGM-A1
- Connect the power wires to a power supply of 10-to-30V DC
- Connects the user port to the IPC.
- If the power comes from a vehicle battery, add an auxiliary battery (recommended).
- The AUX cable:
- Connect the AUX cable to the 15-pin Aux port
- Connect the USB cable to the IPC, if the USB port is used for data transferring.
Refer to the diagram below for reference:

For additional information, visit Page 3 of [the SPAN-IGM™ Quick Start Guide](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf) to view the detailed diagram.
##### Taking the Lever Arm Measurement
When the SPAN-IGM-A1 and the GPS Antenna are in position, the distance from the SPAN-IGM-A1 to the GPS Antenna must be measured. The distance should be measured as: X offset, Y offset, and Z offset.
The center of the IMU and the center of the antenna are labeled on the exterior of the devices.
For additional information, visit Page 5 of [the SPAN-IGM™ Quick Start Guide](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf) to view the detailed diagram.
### Configuring the GPS and IMU
Configure the SPAN-IGM-A1 as shown below. The setting can be configured by keying in the following command or loading a batch file in Novatel Connect:
```
WIFICONFIG STATE OFF
UNLOGALL THISPORT
INSCOMMAND ENABLE
SETIMUORIENTATION 5
ALIGNMENTMODE AUTOMATIC
VEHICLEBODYROTATION 0 0 0
COM COM1 9600 N 8 1 N OFF OFF
COM COM2 9600 N 8 1 N OFF OFF
INTERFACEMODE COM1 NOVATEL NOVATEL ON
PPSCONTROL ENABLE POSITIVE 1.0 10000
MARKCONTROL MARK1 ENABLE POSITIVE
EVENTINCONTROL MARK1 ENABLE POSITIVE 0 2
interfacemode usb2 rtcmv3 none off
rtksource auto any
psrdiffsource auto any
SETIMUTOANTOFFSET 0.00 1.10866 1.14165 0.05 0.05 0.08
SETINSOFFSET 0 0 0
EVENTOUTCONTROL MARK2 ENABLE POSITIVE 999999990 10
EVENTOUTCONTROL MARK1 ENABLE POSITIVE 500000000 500000000
LOG COM2 GPRMC ONTIME 1.0 0.25
LOG USB1 GPGGA ONTIME 1.0
log USB1 bestgnssposb ontime 1
log USB1 bestgnssvelb ontime 1
log USB1 bestposb ontime 1
log USB1 INSPVAXB ontime 1
log USB1 INSPVASB ontime 0.01
log USB1 CORRIMUDATASB ontime 0.01
log USB1 RAWIMUSXB onnew 0 0
log USB1 mark1pvab onnew
log USB1 rangeb ontime 1
log USB1 bdsephemerisb
log USB1 gpsephemb
log USB1 gloephemerisb
log USB1 bdsephemerisb ontime 15
log USB1 gpsephemb ontime 15
log USB1 gloephemerisb ontime 15
log USB1 imutoantoffsetsb once
log USB1 vehiclebodyrotationb onchanged
SAVECONFIG
```
** WARNING:** Modify the **<u>SETIMUTOANTOFFSET</u>** line based on the actual measurement (of the antenna and the SPAN-IGM-A1 offset).
For example:
```
SETIMUTOANTOFFSET -0.05 0.5 0.8 0.05 0.05 0.08
```
The first 3 numbers indicate the result of the lever arm distance measurement. The last 3 numbers are the uncertainty of the measurement.
### References
For additional information on the NovAtel SPAN-IGM-A1:
* [NovAtel SPAN-IGM-A1 Product Page](https://www.novatel.com/products/span-gnss-inertial-systems/span-combined-systems/span-igm-a1/)
* [NovAtel GPS-703-GGG-HV Product page](https://www.novatel.com/products/gnss-antennas/high-performance-gnss-antennas/gps-703-ggg-hv/)
* [SPAN-IGM™ Quick Start Guide](http://www.novatel.com/assets/Documents/Manuals/GM-14915114.pdf)
* [SPAN-IGM™ User Manual](http://www.novatel.com/assets/Documents/Manuals/OM-20000141.pdf)
## Disclaimer
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Lidar/Hesai_Pandora_Installation_Guide.md
|
## Installation guide of Pandora
Pandora is an all-in-one sensor kit for environmental sensing for self-driving cars. It integrates cameras, LiDAR and data processing ability into the same module, with synchronization and calibration solutions.

#### Mounting
A customized mounting structure is required to successfully mount a Pandora kit on top of a vehicle. This structure must provide rigid support to the LiDAR system while raising the LiDAR to a certain height above the ground under driving conditions. This height should prevent the laser beams from the LiDAR being blocked by the front and/or rear of the vehicle. The actual height needed for the LiDAR depends on the design of the vehicle and the mounting point of the LiDAR relative to the vehicle. While planning the mounting height and angle, please read through the manual for additional details.
```
If for some reason, the LiDAR beam has to be blocked by the vehicle, it might be necessary to apply a filter to remove these points while processing the data received.
```
#### Wiring
Each Pandora includes a cable connection box and a corresponding cable bundle to connect to the power supply, the computer (ethernet) and the GPS timesync source.

* **Connection to the Power Source**
Please connect the power cable to a proper power source. Typically, a **9~32VDC**, **40W** power supply should be sufficient to power the LiDAR
2. **Connection to the IPC**
Connect the interface box to the IPC using the ethernet cable provided in the cable bundle.
3. **Connection to the GPS**
The Pandora kit requires the recommended minimum specific GPS/Transit data (GPRMC) and pulse per second (PPS) signal to synchronize to GPS time. A customized connection is needed to establish the communication between the GPS receiver and the LiDAR. Please read your GPS manual for information on how to collect the output of those signals.
On the interface box, a GPS port (SM06B-SRSS-TB) is provided to send the GPS signals as an input to the LiDAR. The detailed pinout is shown in the image below.
| Pin # | Input/output | Comment |
| ----- | ------------ | ----------------------------------------------- |
| 1 | Input | PPS signal (3.3V) |
| 2 | Output | 5V power supply to power the GPS Unit if needed |
| 3 | Output | GND for external GPS unit |
| 4 | Input | RX serial port for GPRMC signal (RS232) |
| 5 | Output | GND for external GPS unit |
| 6 | Output | TX serial port for external GPS unit |
#### Configuration
The detailed configuration steps can be found in the manual provided on Hesai Technologies official website.
* [Chinese version](https://hsdown.blob.core.chinacloudapi.cn/upload/Pandar40%2040%E7%BA%BF%E6%9C%BA%E6%A2%B0%E5%BC%8F%E6%BF%80%E5%85%89%E9%9B%B7%E8%BE%BE%20%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E%E4%B9%A6.pdf)
* [English version ](https://drive.google.com/file/d/1THtxhlrzmyVpV_IZufRsYUBudmHTd8Ge/view)
#### References
* A Detailed Specification sheet on Pandora can be found at the following [website link](http://www.hesaitech.com/en/pandora.html)
* Additional information about Pandora - Hesai can be found [here](https://drive.google.com/file/d/1THtxhlrzmyVpV_IZufRsYUBudmHTd8Ge/view)
## Disclaimer
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Lidar/Hesai_Pandora_Installation_Guide_cn.md
|
## Pandora安装指南
Pandora是一款用于自动驾驶汽车环境感应的一体化传感器套件。 它将摄像头,LiDAR和数据处理能力集成到同一模块中,具有同步和校准解决方案。

#### 安装
Pandora套件需定制的结构才能安装在车辆顶部。该结构必须能为Pandora系统提供刚性支撑,同时在驾驶条件下将Pandora升高到地面以上的某个高度。该高度应保证来自Pandora的激光束不被车辆的前部和/或后部阻挡。Pandora所需的实际高度取决于车辆的设计和其相对于车辆的安装点。在规划安装高度和角度时,请仔细阅读手册以获取更多详细信息。
```
如果由于某种原因,LiDAR光束必须被车辆阻挡,则在处理接收的数据时可能需要应用滤波器来移除这些点。
```
#### 布线
每个Pandora都包括一个电缆连接盒和一个相应的电缆束,用于连接电源、计算机(以太网)和GPS时间同步源。

* **连接电源**
请将电源线连接到合适的电源。通常,**9~32VDC**, **40W** 电源应足以为LiDAR供电
2. **连接IPC**
使用电缆束中提供的以太网电缆将接口盒连接到IPC。
3. **连接 GPS**
Pandora套件需要建议的最小特定GPS /传输数据(GPRMC)和每秒脉冲数(PPS)信号才能与GPS时间同步。需要定制连接以建立GPS接收器和LiDAR之间的通信。有关如何收集这些信号输出的信息,请阅读GPS手册。
在接口盒上,提供GPS端口(SM06B-SRSS-TB)以将GPS信号作为输入发送到LiDAR。 详细的引脚排列如下图所示。
| Pin # | Input/output | Comment |
| ----- | ------------ | ----------------------------------------------- |
| 1 | Input | PPS signal (3.3V) |
| 2 | Output | 5V power supply to power the GPS Unit if needed |
| 3 | Output | GND for external GPS unit |
| 4 | Input | RX serial port for GPRMC signal (RS232) |
| 5 | Output | GND for external GPS unit |
| 6 | Output | TX serial port for external GPS unit |
#### 配置
详细的配置步骤可以在Hesai Technologies官方网站上提供的手册中找到。
* [中文版](https://hsdown.blob.core.chinacloudapi.cn/upload/Pandar40%2040%E7%BA%BF%E6%9C%BA%E6%A2%B0%E5%BC%8F%E6%BF%80%E5%85%89%E9%9B%B7%E8%BE%BE%20%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E%E4%B9%A6.pdf)
* [英文版](https://drive.google.com/file/d/1THtxhlrzmyVpV_IZufRsYUBudmHTd8Ge/view)
#### 参考资料
* Pandora的详细规格表可在 [这里](http://www.hesaitech.com/en/pandora.html)找到
* 更多关于Pandora - Hesai的信息,可以在[这里](https://drive.google.com/file/d/1THtxhlrzmyVpV_IZufRsYUBudmHTd8Ge/view)找到
## 免责声明
该设备由`Apollo提供支持`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Lidar/README.md
|
# Apollo LiDAR
You could integrate 3 types of LiDAR's with Apollo. Refer to their individual Installation guides for more information.
1. **Velodyne** - Apollo 3.0 provides support to 2 types of Velodyne LiDARs
- [HDL64E-S3](HDL64E_S3_Installation_Guide.md)
- [VLP Series](VLP_Series_Installation_Guide.md)
- [VLS-128](VLS_128_Installation_Guide.md)
2. [Hesai](Hesai_Pandora_Installation_Guide.md)
3. [Innovusion](Innovusion_Note.md)
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Lidar/README_cn.md
|
# Apollo激光雷达
您可以将3种类型的LiDAR与Apollo集成。 有关更多信息,请参阅各自的安装指南。
1. **Velodyne** - Apollo 3.0为2种Velodyne LiDAR提供支持
- [HDL64E-S3](HDL64E_S3_Installation_Guide_cn.md)
- [VLP Series](VLP_Series_Installation_Guide_cn.md)
2. [Hesai](Hesai_Pandora_Installation_Guide_cn.md)
3. [Innovusion](Innovusion_Note_cn.md)
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Lidar/Innovusion_Note.md
|
## Installation guide of Innovusion
Please note,
Innovusion's lidar product currently has to be installed by a trained engineer. For more information, please contact Yimin Li via his email Yimin.li@innovusion.com.
### Product Information
1. **Resolution**: provides near picture quality with over 300 lines of resolution and several hundred pixels in both the vertical and horizontal dimensions.
2. **Range**: detects both light and dark objects at distances up to 150 meters away which allows cars to react and make decisions at freeway speeds and during complex driving situations.
3. **Sensor fusion**: fuses LiDAR raw data with camera video in the hardware layer which dramatically reduces latency, increases computing efficiency and creates a superior sensor experience.
4. **Accessibility**: enables a compact design which allows for easy and flexible integration without impairing vehicle aerodynamics. Innovusion’s products leverage components available from mature supply chain partners, enabling fast time-to-market, affordable pricing and mass production.
## Disclaimer
This device is `Apollo Hardware Development Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Lidar/HDL64E_S3_Installation_Guide_cn.md
|
## Velodyne HDL64E-S3安装指南
Apollo使用来自Velodyne LiDAR, Inc.的64线激光雷达系统 **HDL-64E S3**。

### 主要特性:
- 64频道
- 120米范围
- 每秒2.2百万点
- 360°水平视场
- 26.9°垂直视场
- 0.08°角分辨率(方位角)
- 精确度<2cm
- ~0.4°垂直分辨率
- 用户可选择的帧速率
- 坚固耐用的DesignLidar / Velodyne / HDL64E-S3 /
#### 安装
HDL64E S3 LiDAR需要定制的结构才能安装在车辆顶部。该结构必须能为LiDAR系统提供刚性支撑,同时在驾驶条件下将LiDAR升高到地面以上的某个高度。该高度应保证来自LiDAR的激光束不被车辆的前部和/或后部阻挡。 LiDAR所需的实际高度取决于车辆的设计,并且LiDAR的安装点取决于所使用的车辆。激光器的垂直倾斜角通常在相对于地平线+2~-24.8度范围内。
对于标准的林肯MKZ,建议您将LiDAR安装在1.8米的最小高度(从地面到激光雷达底座),以便有效地使用角度范围进行探测。
```
如果由于某种原因,LiDAR光束必须被车辆阻挡,则在处理接收的数据时可能需要应用滤波器来移除这些点。
```
#### 布线
每个HDL-64E S3 LiDAR都包含一个电缆束,用于将LiDAR连接到电源、GPS时间同步源和计算机(用于数据传输的以太网和用于LiDAR配置的串行端口)。

* **连接LiDAR**
将电源线和信号线连接到LiDAR上的匹配端口

* **连接电源**
两根AWG 16线用于为HDL-64E S3 LiDAR供电。 它需要大约3A的电流12V电压。连接电源时,请完全接触电线并拧紧螺钉。

* **连接IPC**
与IPC的连接是通过以太网电缆进行的。将以太网连接器插入电缆束中,连接到IPC上的以太网端口。
* **连接GPS**:
HDL64E S3 LiDAR需要建议的最小特定GPS /传输数据(GPRMC)和每秒脉冲数(PPS)信号才能与GPS时间同步。需要定制连接以建立GPS接收器和LiDAR之间的通信,如下所示:
- **SPAN-IGM-A1**
如果您按照[配置GPS和IMU](#configuration-the-gps-and-imu)中的说明配置了SPAN-IGM-A1,GPS接收器通过“用户端口”电缆发送GPRMC信号到“主要”端口。PPS信号通过标记为“PPS”和“PPS dgnd”的线缆从AUX端口发送。下图中的虚线框显示了HDL64E S3 LiDAR和SPAN-IGM-A1 GPS接收器的可用连接。其余连接必须由用户进行。

- **Propak 6 and IMU-IGM-A1**
如果您按照[配置GPS和IMU](#configuration-the-gps-and-imu)中的说明配置了Propak 6,GPS接收器通过COM2端口发送GPRMC信号。 PPS信号通过IO端口发送。 下图中的虚线框是HDL-64E S3 LiDAR和Propak 6 GPS接收器附带的可用连接。其余连接需要由用户进行。

* **通过串口连接计算机以进行LiDAR配置**
可通过串行端口配置一些低层参数。 在Velodyne LiDAR,Inc. 提供的电缆束中,有两对红/黑电缆,如下面的引脚表所示。较厚的一对(AWG 16)用于为LiDAR系统供电。较薄的一对用于串行连接。将黑线(串行输入)连接到RX,红线连接到串行电缆的地线。将串行电缆与USB串行适配器连接到所选计算机。

#### 配置
默认情况下,HDL-64E S3的网络IP地址为192.168.0.1。 但是,在设置Apollo时,请将网络IP地址更改为 **192.168.20.13** 。 您可以将终端应用程序与Termite3.2一起使用。可以使用以下步骤配置HDL-64E S3的IP地址:
* 将串行电缆的一侧连接到笔记本电脑
* 将串行电缆的另一端连接到HDL-64E S3的串行线
* 使用以下默认COM端口设置:
- 波特率: 9600
- 奇偶校验: None
- 数据位: 8
- 停止位: 1
* 使用COM端口应用程序:从以下链接下载Termite3.2并将其安装在您的笔记本电脑上(Windows) - [安装连接](http://www.compuphase.com/software_termite.htm)
* 使用HDL-64E S3和笔记本电脑之间COM端口的串行电缆连接:

* 从笔记本电脑启动 **Termite 3.2**
* 发出串行命令,通过串口"\#HDLIPA192168020013192168020255"设置HDL-64E S3的IP地址
* 重启设备以启用新的IP地址

#### 参考资料
有关Velodyne HDL-64E S3的更多信息,请参阅他们的[官网](http://velodynelidar.com/hdl-64e.html).
## 免责声明
该设备由`Apollo平台提供支持`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Lidar/Innovusion_Note_cn.md
|
## Innovusion安装指南
请注意,Innovusion的激光雷达产品目前必须由经过培训的工程师安装。 欲了解更多信息,请通过电子邮件Yimin.li@innovusion.com与Yimin Li联系。
### 产品简介
1. **解决方案**: 提供接近图像质量,在垂直和水平尺寸上具有超过300行分辨率和数百个像素。
2. **探测范围**: 在距离最远150米处检测到明暗物体,这使得汽车能够在高速公路上以及在复杂的驾驶情况下做出反应并做出决定。
3. **传感器融合**: 将LiDAR原始数据与硬件层中的摄像头视频融合在一起,可显著减少延迟,提高计算效率并创建出色的传感器体验。
4. **易用性**: 设计紧凑,可以轻松灵活地集成,而不会影响车辆的空气动力学性能。 Innovusion的产品利用成熟供应链合作伙伴提供的组件,实现快速上市和批量生产,且定价合理。
## 免责声明
该设备由`Apollo硬件开发平台提供支持`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Lidar/VLS_128_Installation_Guide.md
|
# Installation guide of Velodyne VLS-128
Apollo master uses the latest 128 line LiDAR system **VLS-128** from Velodyne LiDAR, Inc.

## Key Features:
- 360° Horizontal FOV
- +15° to -25° Vertical FOV
- Up to 300m Range
- Minimum Angular Resolution: 0.11°
- Up to 4 Return Modes
- Up to ~9.6 Million Points per Second
- Environmental Protection: IP67
- Connectors: RJ45 / M12
- High Volume, Automotive Grade Contract Pricing
## Mounting
A customized mounting structure is required to successfully mount an VLS-128 LiDAR on top of a vehicle. This structure must provide rigid support to the LiDAR system while raising the LiDAR to a certain height above the ground under driving conditions. This mounted height should prevent the laser beams from the LiDAR being blocked by the front and/or rear of the vehicle. The actual height needed for the LiDAR depends on the design of the vehicle and the mounting point of the LiDAR is relative to the vehicle being used. The LiDAR must be mounted straight without tilting.
For a standard Lincoln MKZ, it is recommended that you mount the LiDAR at a minimum height of **1.8 meters** (from ground to the base of the LiDAR), to use the angle range for detection effectively.
```
If for some reason, the LiDAR beam has to be blocked by the vehicle, it might be necessary to apply a filter to remove these points while processing the data received.
```
## Wiring
Each VLS-128 LiDAR includes a cable bundle to connect the LiDAR to the power supply, and the GPS timesync source.

* **Connecting the LiDAR**
Connect the power and signal cable to the matching ports on the LiDAR

## References
For additional information on Velodyne VLS-128, please refer to their
[website here](https://velodynelidar.com/vls-128.html).
## Disclaimer
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Lidar/VLP_Series_Installation_Guide.md
|
## Installation guide of the Puck Series LiDAR (and HDL32)


This guide covers the installation procedure of Puck(VLP16), Puck LITE, Puck High-Res, Ultra Puck(VLP-32c) and HDL32.
You can connect to the LiDAR via an interface box which is included in the package.
Since the interface box was first introduced with the **HDL32** product line, this installation guide also works for HDL32 Lidars alongwith the following [modification](https://github.com/ApolloAuto/apollo/commit/df37d2c79129434fb90353950a65671278a4229e#diff-cb9767ab272f7dc5b3e0d870a324be51). However, please note that you would need to change the intrinsics for HDL32.
#### Mounting
A customized mounting structure(s) is required to successfully mount a Puck Series LiDAR on top of a vehicle. This structure must provide rigid support to the LiDAR system. If only one LiDAR is used in the system, the mount needs to raise the LiDAR to a certain height to avoid the laser beams being blocked by the vehicle's body. If multiple LiDAR's are to be installed, the mounting structure(s) needs to provide suitable LiDAR configurations including positioning and tilting of the LiDARs as required by your system. Please find the detailed tilt angle of each laser beam on the individual LiDAR's manual when deciding the mounting of the LiDARs. Or you could also consult with Apollo engineers for the configurations that we have used and tested successfully.
#### Wiring
* **Connection to the Power Source**
An AC/DC adapter with PJ-102A connector is provided to power the LiDAR. You can use it directly or make your own power cable to connect to your power source.
* **Connection to the IPC**
Connect the interface box to the IPC using the ethernet cable provided in the cable bundle.
* **Connectionto the GPS**
The LiDARs in the PUCK series require the recommended minimum specific GPS/Transit data (GPRMC) and Pulse Per Second (PPS) signal to synchronize to the GPS time. A customized connection is needed to establish the communication between the GPS receiver and the LiDAR. Please read your GPS manual for information on how to output those signals.
On the interface box, a GPS port (SM06B-SRSS-TB) is provided to send the GPS signals as an input to the LiDAR. The detailed pinout is shown in the image below. The GPRMC signal should be sent to **GPS_RXD_CNT** (pin4), while the PPS pulse train should be sent to **GPS_PULSE_CNT**. The ground of both signals should be shorted and sent to one of the **GND** pins.

#### Configuration
By default, the LiDAR has the network IP address of 192.168.0.201. However, when you setting up Apollo, you might need to change the IP address to **192.168.20.14**.
* Power the LiDAR and connect it to your laptop via an ethernet cable.
* Configure your laptop's IP address to be on the same network as the LiDAR
* Open a web browser and connect to the LiDAR's IP address. A webpage should show up in the browser.
* Configure the IP address, Host, Gateway, port numbers on this webpage. Click on set for each change.
* After the changes, click **save config**. Then, power cycle the LiDAR.
* [Optional] Configure your laptop again to connect to the LiDAR (if IP changed) to confirm that the changes have taken effect.
#### [Optional] Installation of VLP-16 for Mapping
In Apollo 2.5, map creation service has been made available. To acquire the data necessary for map creation, you would need to install an additional VLP-16 LiDAR on the vehicle. The purpose of this LiDAR is to collect point cloud information for objects above the FOV of the HDL-64 S3 LiDAR, such as traffic lights and signs. It requires a customized rack to mount the VLP-16 LiDAR on top of the vehicle. The figure below shows one of the possible configurations.

In this specific configuration, the VLP-16 LiDAR is mounted with an upward tilt of 20±2°. The power cable of the VLP-16 is connected to the DataSpeed power panel. The ethernet connection is connected to the IPC (possibly through an ethernet switch). Similar to HDL-64E S3 LiDAR, the VLP-16's GPRMC and PPS receive input from the same GPS receiver. Ideally, additional hardware should be installed to duplicate the GPRMC and PPS signals from the GPS receiver and sent to HDL-64 and VLP-16 respectively. However, a simple Y-split cable may also provide adequate signal for both LiDARs. To help distinguish from the HDL-64 S3 LiDAR, please follow the VLP-16 manual and use the webpage interface to configure the IP of VLP-16 to **192.168.20.14**, its data port to **2369**, and its telemetry port to **8309**. The pinout for the signal input from GPS receiver can also be found in the manual if you need customized cable. Please connect the VLP-16 to the same network as the HDL-64E and configure the ethernet switch to do port forwarding.
#### References
For additional information, please refer to:
* VLP - 16: [http://velodynelidar.com/vlp-16.html](http://velodynelidar.com/vlp-16.html)
* VLP - 32: [http://velodynelidar.com/vlp-32c.html](http://velodynelidar.com/vlp-32c.html)
* VLP - 16 Hi-Res: [http://velodynelidar.com/vlp-16-hi-res.html](http://velodynelidar.com/vlp-16-hi-res.html)
* VLP - 16 Lite: [http://velodynelidar.com/vlp-16-lite.html](http://velodynelidar.com/vlp-16-lite.html)
* HDL - 32E: [http://velodynelidar.com/hdl-32e.html](http://velodynelidar.com/hdl-32e.html)
## Disclaimer
This device is `Apollo Hardware Development Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Lidar/VLP_Series_Installation_Guide_cn.md
|
## Puck系列LiDAR (和HDL32)安装指南


本指南介绍了Puck(VLP16),Puck LITE,Puck High-Res,Ultra Puck(VLP-32c)和HDL32的安装流程。
您可以通过包中包含的接口盒连接到LiDAR。
```
由于接口盒最初是与HDL32产品系列一起引入的,因此本安装指南也适用于HDL32激光雷达。
```
#### 安装
Puck系列LiDAR需要定制结构才能安装在车辆顶部。该结构必须能为LiDAR系统提供刚性支撑。如果系统中仅使用一个LiDAR,则安装座需要将LiDAR升高到一定高度,以避免激光束被车身阻挡。如果要安装多个LiDAR,安装结构需要提供合适的LiDAR配置,包括系统要求的LiDAR定位和倾斜。在决定安装激光雷达时,请在各个激光雷达手册中找到每个激光束的详细倾斜角度。 或者您也可以咨询Apollo工程师,了解我们已成功使用和测试的配置。
#### 布线
* **连接电源**
LiDAR可使用带有PJ-102A连接器的AC/DC适配器作为供电的电源。 您可以直接使用它或使用自己的电源线连接电源。
* **连接IPC**
使用电缆束中提供的以太网电缆将接口盒连接到IPC。
* **连接GPS**
PUCK系列中的LiDAR需要建议的最小特定GPS/传输数据(GPRMC)和每秒脉冲(PPS)信号才能与GPS时间同步。需要定制连接以建立GPS接收器和LiDAR之间的通信。有关如何输出这些信号的信息,请阅读GPS手册。
在接口盒上,GPS信号通过GPS端口(SM06B-SRSS-TB)作为输入发送到LiDAR。详细的引脚排列如下图所示。GPRMC信号应发送到 **GPS_RXD_CNT**(引脚4),而PPS脉冲串应发送到 **GPS_PULSE_CNT**。两个信号的接地应短路并发送到 **GND**引脚之一。

#### Configuration
默认情况下,LiDAR的网络IP地址为192.168.0.201。 但是,在设置Apollo时,可能需要将IP地址更改为 **192.168.20.14**。
* 接通Lidar电源,并将其连接到电脑。
* 配置电脑IP地址,使其于LiDAR在同一网络。
* 打开Web浏览器并连接到LiDAR的IP地址。 网页应显示在浏览器中。
* 在此网页上配置IP地址、主机、网关、端口号。 单击相应条目更改设置。
* 设置完成后,单击 **save config**。 然后,重新启动LiDAR。
* [可选] 再次配置笔记本电脑以连接到LiDAR(如果IP已更改)以确认更改已生效。
#### [可选] 安装VLP-16进行地图绘制
在Apollo 2.5中,地图创建服务已经可用。要获取地图创建所需的数据,您需要在车辆上安装额外的VLP-16 LiDAR。该LiDAR的目的是收集HDL-64 S3 LiDAR FOV之上的物体的点云信息,例如交通信号灯和标志。它需要一个定制的机架将VLP-16 LiDAR安装在车辆顶部。下图显示了一种可能的配置。

在这种特定配置中,VLP-16 LiDAR的安装向上倾斜20±2°。VLP-16的电源线连接到DataSpeed电源面板。以太网连接连接到IPC(可能通过以太网交换机)。与HDL-64E S3 LiDAR类似,VLP-16的GPRMC和PPS接收来自同一GPS接收器的输入。理想情况下,应安装额外的硬件以复制来自GPS接收器的GPRMC和PPS信号,并分别发送到HDL-64和VLP-16。然而,简单的Y型分裂电缆也可以为两个LiDAR提供足够的信号。为帮助区分HDL-64 S3 LiDAR,请按照VLP-16手册并使用网页界面将VLP-16的IP配置为 **192.168.20.14**,其数据端口为 **2369**,和它的遥测端口 **8309**。如果您需要定制电缆,也可以在手册中找到GPS接收器输入信号的引脚分配。请将VLP-16连接到与HDL-64E相同的网络,并配置以太网交换机进行端口转发。
#### 参考资料
更多信息请参考:
* VLP - 16: [http://velodynelidar.com/vlp-16.html](http://velodynelidar.com/vlp-16.html)
* VLP - 32: [http://velodynelidar.com/vlp-32c.html](http://velodynelidar.com/vlp-32c.html)
* VLP - 16 Hi-Res: [http://velodynelidar.com/vlp-16-hi-res.html](http://velodynelidar.com/vlp-16-hi-res.html)
* VLP - 16 Lite: [http://velodynelidar.com/vlp-16-lite.html](http://velodynelidar.com/vlp-16-lite.html)
* HDL - 32E: [http://velodynelidar.com/hdl-32e.html](http://velodynelidar.com/hdl-32e.html)
## 免责声明
该设备由`Apollo硬件开发平台提供指`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Lidar/HDL64E_S3_Installation_Guide.md
|
## Installation guide of Velodyne HDL64E-S3
Apollo uses the 64 line LiDar system **HDL-64E S3** from Velodyne LiDAR, Inc.

### Key Features:
- 64 Channels
- 120m range
- 2.2 Million Points per Second
- 360° Horizontal FOV
- 26.9° Vertical FOV
- 0.08° angular resolution (azimuth)
- <2cm accuracy
- ~0.4° Vertical Resolution
- User selectable frame rate
- Rugged DesignLidar/Velodyne/HDL64E-S3/
#### Mounting
A customized mounting structure is required to successfully mount an HDL64E S3 LiDAR on top of a vehicle. This structure must provide rigid support to the LiDAR system while raising the LiDAR to a certain height above the ground under driving conditions. This mounted height should prevent the laser beams from the LiDAR being blocked by the front and/or rear of the vehicle. The actual height needed for the LiDAR depends on the design of the vehicle and the mounting point of the LiDAR is relative to the vehicle being used. The vertical tilt angle of the lasers normally ranges from **+2~-24.8 degrees relative to the horizon**.
For a standard Lincoln MKZ, it is recommended that you mount the LiDAR at a minimum height of 1.8 meters (from ground to the base of the LiDAR), to use the angle range for detection effectively.
```
If for some reason, the LiDAR beam has to be blocked by the vehicle, it might be necessary to apply a filter to remove these points while processing the data received.
```
#### Wiring
Each HDL-64E S3 LiDAR includes a cable bundle to connect the LiDAR to the power supply, the GPS timesync source and the computer (Ethernet for data transfer and a serial port for LiDAR configuration).

* **Connecting the LiDAR**
Connect the power and signal cable to the matching ports on the LiDAR

* **Connecting the Power Source**
Two AWG 16 wires are used to power the HDL-64E S3 LiDAR. It requires about 3A at 12V. To connect the power source, make full contact with the wires and tighten the screws.

* **Connecting the IPC**
The connection to the IPC is through an ethernet cable. Plug the ethernet connector in the cable bundle, to an ethernet port on the IPC.
* **Connecting the GPS**:
The HDL64E S3 LiDAR requires the recommended minimum specific GPS/Transit data (GPRMC) and pulse per second (PPS) signal to synchronize to the GPS time. A customized connection is needed to establish the communication between the GPS receiver and the LiDAR, as follows:
- **SPAN-IGM-A1**
If you configured the SPAN-IGM-A1 as specified in [Configuring the GPS and IMU](#configuring-the-gps-and-imu), the GPRMC signal is sent from the GPS receiver via the "User Port" cable from the "Main" port. The PPS signal is sent through the wire cables labeled as “PPS” and “PPS dgnd” from the AUX port. The dash-line boxes in the figure below show the available connections that come with the HDL64E S3 LiDAR and the SPAN-IGM-A1 GPS receiver. The remaining connections must be made by the user.

- **Propak 6 and IMU-IGM-A1**
If you configured the Propak 6 as specified in [Configuring the GPS and IMU](#configuring-the-gps-and-imu), the GPRMC signal is sent from the GPS receiver via COM2 port. The PPS signal is sent through the IO port. The dash-line boxes in the figure below are available connections that comes with the HDL-64E S3 LiDAR and the Propak 6 GPS receiver. The remaining connections need to be made by the user.

* **Connection with a computer through serial port for LiDAR configuration**
You can configure some of the low-level parameters through the serial port. Within the cable bundle provided by Velodyne LiDAR, Inc., there are two pairs of red/black cables as shown in the pinout table below. The thicker pair (AWG 16) is used to power the LiDAR system. The thinner pair is used for serial connection. Connect the black wire (Serial In) to RX, the red wire to the Ground wire of a serial cable. Connect the serial cable with a USB-serial adapter to your selected computer.

#### Configuration
By default, the HDL-64E S3 has the network IP address of 192.168.0.1. However, when you are setting up Apollo, change the network IP address to **192.168.20.13**. You can use the terminal application with Termite3.2 for this purpose. The IP address of the HDL-64E S3 can be configured using the following steps:
* Connect one side of the serial cable to your laptop
* Connect the other side of the serial cable to HDL-64E S3’s serial wires
* Use the following default COM port settings:
- Baudrate: 9600
- Parity: None
- Data bits: 8
- Stop bits: 1
* Use the COM port application: Download Termite3.2 from the link below and install it on your laptop (Windows) - [Installation link](http://www.compuphase.com/software_termite.htm)
* Use the serial cable connection for the COM port between the HDL-64E S3 and the laptop:

* Launch **Termite 3.2** from your laptop
* Issue a serial command for setting up the HDL-64E S3’s IP addresses over serial port "\#HDLIPA192168020013192168020255"
* The unit must be power cycled to adopt the new IP addresses

#### References
For additional information on Velodyne HDL-64E S3, please refer to their
[website here](http://velodynelidar.com/hdl-64e.html).
## Disclaimer
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Apollo_Sensor_Unit/Apollo_Sensor_Unit_Installation_Guide.md
|
## Guide for Apollo Sensor Unit
Apollo Sensor Unit (ASU) is designed to work with Industrial PC (IPC) to implement sensor fusion, vehicle control and network access in Apollo's autonomous driving platform.
The ASU system provides sensor interfaces to collect data from various sensors, including cameras, Lidars, Radars, and Ultrasonic Sensors. The system also utilizes pulse per second (PPS) and GPRMC signals from GNSS receiver to implement data collection synchronization for the camera and LiDAR sensors.
The communication between the ASU and the IPC is through PCI Express Interface. ASU collects sensor data and passes to IPC via PCI Express Interface, and the IPC uses the ASU to send out Vehicle Control commands in the Controller Area Network (CAN) protocol.
In addition, Lidar connectivity via Ethernet, WWAN gateway via 4G LTE module, and WiFi access point via WiFi module will be enabled in the future releases.

### System Connectors
#### Front Panel Connectors
1. External GPS PPS / GPRMC Input Port
2. FAKRA Camera Data Input Port (5 ports)
3. 100 Base-TX/1000 Base-T Ethernet Port (2 Ports)
4. KL-15 (AKA Car Ignition) Signal Input Port
#### Rear Panel Connectors
1. General purpose UART port(reserved)
2. External PCI Express Port (Support X4 or X8) For connections to IPC, please use EXTN port.
3. GPS PPS/GPRMC Output Rectangular Port (3 Ports) for LiDAR
4. Power and PPS/GPRMC Cylindrical Output Port for Stereo Camera/LiDAR
5. CAN Bus (4 Ports)
6. Main Power Input Connector
### Purchase Channels
The Apollo Sensor Unit is currently only provided to our Partners and certain developers. Questions regarding the availability and access to ASU should be directed to apollo-hw@baidu.com
### Installation
1. Power Cable
The main power is from vehicle battery, 9V ~ 36V, 120W.

|MFR|MPN|Description|
|---------------|--------|-----------|
|TE Connectivity|DTF13-2P|DT RECP ASM|
| PIN # | NAME | I/O | Description |
| ----- | ---- | ---- | ------------------ |
| 1 | 12V | PWR | 12V (9V~36V, 120W) |
| 2 | GND | PWR | GROUND |
2. FPD-Link III cameras.
There are 5 FAKRA connectors for FPD Link III cameras in ASU Front Panel labeled with 1~5, respectively, from right to left. The ASU can support up to 5 cameras by enabling Camera 1 ~ 5 whose deserializers (TI, DS90UB914ATRHSTQ1) convert FPD Link III signals into parallel data signals.
|Camera #| I2C Address | Deserializer|
| -------- | ----------- | ------------------------- |
| 1 | 0x60 | DS90UB914ATRHSTQ1 |
| 2 | 0x61 | DS90UB914ATRHSTQ1 |
| 3 | 0x62 | DS90UB914ATRHSTQ1 |
| 4 | 0x63 | DS90UB914ATRHSTQ1 |
| 5 | 0x64 | DS90UB914ATRHSTQ1 |
3. GPS synchronization input channel
GPS synchronization input channel is using 1565749-1 from TE Connectivity as the connector. The connector information and the pinout are shown in the tables below.

| MFR | MPN | Description |
| :-------------- | --------- | ----------------------------------------- |
| TE Connectivity | 1565749-1 | Automotive Connectors 025 CAP ASSY, 4 Pin |
| PIN # | NAME | I/O | Description |
| ----- | ----- | ----- | ------------------------------------------------------------ |
| 1 | GPRMC | INPUT | GPRMC TX |
| 2 | NC | NC | NO CIRCUIT |
| 3 | GND | PWR | GROUND (the ground for PPS and GPRMC should be shorted on ground) |
| 4 | PPS | INPUT | Pulse per Second from GPS transceiver, 3.3V CMOS Signal |
4. GPS synchronization output channels
ASU forwards the duplicated GPS PPS/GPRMC from external GPS to the customized 8 Pin connector. This connector provides 3 sets of PPS/GPRMC output for sensors that need to be synchronized, such as LiDARs, etc.

|MFR| MPN| Description|
| --------------- | --------- | ------------------------------------------------- |
| TE Connectivity | 1376350-2 | Automotive Connectors 025 I/O CAP HSG ASSY, 8 Pin |
| PIN # | NAME | I/O | Description |
| ----- | ------ | ------ | ------------------------------------------------------- |
| 1 | GPRMC0 | OUTPUT | Channel 0, GPRMC OUTPUT, RS-232 Signal |
| 2 | PPS0 | OUTPUT | Pulse per Second from GPS transceiver, 3.3V CMOS Signal |
| 3 | GPRMC1 | OUTPUT | Channel 1, GPRMC OUTPUT, RS-232 Signal |
| 4 | PPS1 | OUTPUT | Pulse per Second from GPS transceiver, 3.3V CMOS Signal |
| 5 | GPRMC2 | OUTPUT | Channel 2, GPRMC OUTPUT, RS-232 Signal |
| 6 | GND | PWR | GROUND |
| 7 | GND | PWR | GROUND |
| 8 | PPS2 | OUTPUT | Pulse per Second from GPS transceiver, 3.3V CMOS Signal |
5. CAN interface
The ASU provides 4 CAN Bus ports, the datapath is :

| MFR | MPN | Description |
| --------------- | --------- | -------------------------------------------------- |
| TE Connectivity | 1318772-2 | Automotive Connectors 025 I/O CAP HSG ASSY, 12 Pin |
| PIN # | NAME | I/O | Description |
| ----- | ------ | ----- | --------------- |
| 1 | CANH-0 | INOUT | Channel 0, CANH |
| 2 | CANL-0 | INOUT | Channel 0, CANL |
| 3 | GND | PWR | Ground |
| 4 | CANH-1 | INOUT | Channel 1, CANH |
| 5 | CANL-1 | INOUT | Channel 1, CANL |
| 6 | GND | PWR | Ground |
| 7 | CANH-2 | INOUT | Channel 2, CANH |
| 8 | CANL-2 | INOUT | Channel 2, CANL |
| 9 | GND | PWR | Ground |
| 10 | CANH-3 | INOUT | Channel 3, CANH |
| 11 | CANL-3 | INOUT | Channel 3, CANL |
| 12 | GND | PWR | Ground |
6. GPS PPS / GPRMC Output Rectangular Port
The Connector provides 8 ports for 3 LiDARs

| MFR | MPN | Description |
| --------------- | --------- | -------------------------------------------------- |
| Digi-Key | A121343-ND | 025 I/O PLUG HSG ASSY 8P |
|
| PIN # | NAME | I/O | Description |
| ----- | ------ | ----- | --------------- |
| 1 | GPRMC | OUT | GPRMC (ASU) -> Pin4 GPS_RXD_CNT (LiDAR 1) |
| 2 | PPS | OUT | PPS (ASU) -> Pin1 GPS_PULSE_CNT (LiDAR 1)|
| 3 | GPRMC | OUT | GPRMC (ASU) -> Pin4 GPS_RXD_CNT (LiDAR 2) |
| 4 | PPS| OUT | PPS (ASU) -> Pin1 GPS_PULSE_CNT (LiDAR 2)|
| 5 | GPRMC | OUT | GPRMC (ASU) -> Pin4 GPS_RXD_CNT (LiDAR 3) |
| 6 | GND | PWR | Ground (ASU) -> Pin3 GND (LiDAR 1,3) |
| 7 | GND | PWR | Ground (ASU) -> Pin3 GND (LiDAR 2) |
| 8 | PPS | OUT | PPS (ASU) -> Pin1 GPS_PULSE_CNT (LiDAR 3)|
7. PPS/GPRMC Cylindrical Output Port for Stereo Camera/ LiDAR
The Connector provides 8 ports but we currently use only 3

| MFR | MPN | Description |
| --------------- | --------- | -------------------------------------------------- |
| Digi-Key | APC1735-ND | CONN RCPT FMALE 8POS SOLDER CUP |
| PIN # | NAME | I/O | Description |
| ----- | ------ | ----- | --------------- |
| 6 | PPS | OUT | PPS (ASU) -> Pin1 GPS_PULSE_CNT (LiDAR)
| 7 | GPRMC | OUT | GPRMC (ASU) -> Pin4 GPS_RXD_CNT (LiDAR) |
| 8 | GND | PWR | Ground (ASU) -> Pin3 GND (LiDAR) |
## Disclaimer
This device is `Apollo Platform Supported`
| 0
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation
|
apollo_public_repos/apollo/docs/11_Hardware Integration and Calibration/车辆集成/传感器安装 sensor installation/Apollo_Sensor_Unit/Apollo_Sensor_Unit_Installation_Guide_cn.md
|
## Apollo传感器单元(ASU)安装指南
Apollo传感器单元(ASU)被设计为和工业级PC(IPC)协同工作以实现在Apollo自动驾驶平台上的传感器数据融合、车辆控制和网络访问。
ASU系统提供多种接口以收集来自不同传感器的数据,包括摄像机、激光雷达、雷达和超声波传感器。该系统同样使用GNSS接收器的秒脉冲(PPS)和GPRMC信号实现摄像机和激光雷达的数据收集同步。
ASU和IPC的通讯通过PCI Express接口。ASU收集传感器数据并通过PCI Express接口传输给IPC,IPC通过ASU发送车辆控制指令,该指令基于区域网络控制协议(CAN协议)。
另外,应用以太网的激光雷达连接,应用4G LTE模块的WWAN网关和应用WiFi模块的WiFi访问将在未来的版本中发布。

### 系统接口
#### 前面板接口
1. 外部GPS PPS / GPRMC输入接口
2. FAKRA摄像机数据输入接口(5个接口)
3. 10/100/1000M Base-T以太网接口(2个接口)
4. KL-15 (AKA Car Ignite)信号输入接口
#### 后面板接口
1. 通用UART接口(保留)
2. 外部PCI Express接口(支持X4或X8)连接IPC请使用EXTN
3. GPS PPS / GPRMC输出接口(3个接口)
4. 连接Stereo Camera的电源和PPS/GPRMC输出接口
5. CAN Bus(4个接口)
6. 主电源输入接口
### 购买渠道
Apollo传感器单元(ASU)目前只提供给Apollo合作伙伴和特定的开发者。关于使用和获取ASU的问题可通过Apollo官方渠道获得更多信息。
### 安装
1. 电源线
主电源来自于车辆电池9V ~ 36V, 120W

|MFR|MPN|Description|
|---------------|--------|-----------|
|TE Connectivity|DTF13-2P|DT RECP ASM|
| PIN # | NAME | I/O | Description |
| ----- | ---- | ---- | ------------------ |
| 1 | 12V | PWR | 12V (9V~36V, 120W) |
| 2 | GND | PWR | GROUND |
2. FPD-Link III摄像机
在ASU的前面板上有5个从右至左分别标记为1~5的FAKRA接头连接FPD Link III摄像机。ASU可以支持多达5个摄像机,摄像机的解串行单元(TI, DS90UB914ATRHSTQ1) 将FPD Link III的信号转换为并行的数据信号。
|Camera #| I2C Address | Deserializer|
| -------- | ----------- | ------------------------- |
| 1 | 0x60 | DS90UB914ATRHSTQ1 |
| 2 | 0x61 | DS90UB914ATRHSTQ1 |
| 3 | 0x62 | DS90UB914ATRHSTQ1 |
| 4 | 0x63 | DS90UB914ATRHSTQ1 |
| 5 | 0x64 | DS90UB914ATRHSTQ1 |
3. GPS同步输入通道
GPS同步输入通道使用 接头是TE Connectivity的1565749-1。接头和引脚的信息在下图中展示。

| MFR | MPN | Description |
| :-------------- | --------- | ----------------------------------------- |
| TE Connectivity | 1565749-1 | Automotive Connectors 025 CAP ASSY, 4 Pin |
| PIN # | NAME | I/O | Description |
| ----- | ----- | ----- | ------------------------------------------------------------ |
| 1 | NC | NC | NO CIRCUIT |
| 2 | GPRMC | INPUT | GPS Specific information contains time, date, position, track made good and speed data provided by GPS navigation receiver. RS-232 Signal level. |
| 3 | GND | PWR | GROUND (the ground for PPS and GPRMC should be shorted on ground) |
| 4 | PPS | INPUT | Pulse per Second from GPS transceiver, 3.3V CMOS Signal |
4. GPS同步输出通道
定制的8 Pin接头为需要同步输出的传感器例如激光雷达、摄像机等提供了3种PPS/GPRMC输出序列。

|MFR| MPN| Description|
| --------------- | --------- | ------------------------------------------------- |
| TE Connectivity | 1376350-2 | Automotive Connectors 025 I/O CAP HSG ASSY, 8 Pin |
| PIN # | NAME | I/O | Description |
| ----- | ------ | ------ | ------------------------------------------------------- |
| 1 | GPRMC0 | OUTPUT | Channel 0, GPRMC OUTPUT, RS-232 Signal |
| 2 | PPS0 | OUTPUT | Pulse per Second from GPS transceiver, 3.3V CMOS Signal |
| 3 | GPRMC1 | OUTPUT | Channel 1, GPRMC OUTPUT, RS-232 Signal |
| 4 | PPS1 | OUTPUT | Pulse per Second from GPS transceiver, 3.3V CMOS Signal |
| 5 | GPRMC2 | OUTPUT | Channel 2, GPRMC OUTPUT, RS-232 Signal |
| 6 | GND | PWR | GROUND |
| 7 | GND | PWR | GROUND |
| 8 | PPS2 | OUTPUT | Pulse per Second from GPS transceiver, 3.3V CMOS Signal |
5. CAN卡接口
CAN卡提供了4种车辆接口,数据通路(传输路径)为:

| MFR | MPN | Description |
| --------------- | --------- | -------------------------------------------------- |
| TE Connectivity | 1318772-2 | Automotive Connectors 025 I/O CAP HSG ASSY, 12 Pin |
| PIN # | NAME | I/O | Description |
| ----- | ------ | ----- | --------------- |
| 1 | CANH-0 | INOUT | Channel 0, CANH |
| 2 | CANL-0 | INOUT | Channel 0, CANL |
| 3 | GND | PWR | Ground |
| 4 | CANH-1 | INOUT | Channel 1, CANH |
| 5 | CANL-1 | INOUT | Channel 1, CANL |
| 6 | GND | PWR | Ground |
| 7 | CANH-1 | INOUT | Channel 2, CANH |
| 8 | CANL-1 | INOUT | Channel 2, CANL |
| 9 | GND | PWR | Ground |
| 10 | CANH-2 | INOUT | Channel 3, CANH |
| 11 | CANL-2 | INOUT | Channel 3, CANL |
| 12 | GND | PWR | Ground |
## 免责声明
This device is `Apollo Platform Supported`
| 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.