【Running latest Apollo with SVL Simulator 使用 SVL 模拟器运行最新的 Apollo】

Running latest Apollo with SVL Simulator 使用 SVL 模拟器运行最新的 Apollo
These instructions are tested after the last commit enabling SVL Simulator with latest Apollo master. Commits after that are assumed to work as well, but not guaranteed.

这些指令在最后一次提交后使用最新的 Apollo 主机启用 SVL 模拟器进行测试。之后的提交假定也能正常工作,但不能保证。

Big changes have recently been introduced in Apollo master; camera perception may not be working yet, and LiDAR perception is recently able to build but still unstable (and uses a lot of GPU memory making it challenging for Apollo to share an 8GB GPU with the SVL Simulator). Because of this we will be using the modular testing features of the SVL Simulator which allows the simulator to directly publish perception and traffic light messages.

最近,Apollo master 发生了巨大的变化; 相机感知功能可能还不能正常工作,而 LiDAR 感知功能最近已经能够构建,但仍然不稳定(并且使用了大量的 GPU 内存,这使得 Apollo 与 SVL Simulator 共享一个8GB 的 GPU 具有挑战性)。因此,我们将使用 SVL 模拟器的模块化测试功能,它允许模拟器直接发布感知和交通灯信息。

For those who used our fork of Apollo 5.0 before: please note the new step to select the correct setup mode in Dreamview.

对于那些曾经使用过我们的阿波罗5.0分支的人,请注意在 Dreamview 选择正确安装模式的新步骤。

Table of Contents
目录
Getting Started 开始
Prerequisites 先决条件
Setup 设置
Docker 多克
Installing Docker CE 安装 Docker CE
Installing the NVIDIA Container Toolkit 安装 NVIDIA 容器工具包
Cloning the Repository 克隆仓库
Building Apollo and bridge 建造阿波罗和桥梁
Adding a Vehicle 添加车辆
Adding an HD Map 添加高清地图
Setting Clock Mode in Apollo 设置阿波罗时钟模式
Launching Apollo alongisde the Simulator 和模拟器一起发射阿波罗
Adding a Vehicle 添加车辆
Adding an HD Map 添加高清地图
Getting Started 开始top 头儿
This guide outlines the steps required to setup Apollo for use with the SVL Simulator. If you have not already set up the simulator, please do so first by following the instructions in Installing the SVL Simulator.

本指南概述了设置用于 SVL 模拟器的 Apollo 所需的步骤。如果您还没有设置模拟器,请首先按照安装 SVL 模拟器中的说明进行安装。

Prerequisites 先决条件top 头儿
Ubuntu 18.04 or later Ubuntu 18.04或更高版本
NVIDIA graphics card (required for Perception) NVIDIA 显卡(感知所需)
NVIDIA proprietary driver (>=410.48) must be installed
必须安装 NVIDIA 专有驱动程序(> = 410.48)
Setup 设置top 头儿
Docker 多克top 头儿
Apollo is designed to run out of Docker containers. The image will mount this repository as a volume so the image will not need to be rebuilt each time a modification is made.

阿波罗计划用完码头集装箱。映像将以卷的形式挂载该存储库,因此每次进行修改时不需要重新构建映像。

Installing Docker CE 安装 Docker CEtop 头儿
To install Docker CE please refer to the official documentation.

要安装 Docker CE,请参考官方文档。

NOTE Apollo does not work if the docker is started with sudo. We suggest following through with the post installation steps.

注意,如果使用 sudo 启动 Docker,Apollo 将无法工作。我们建议按照后期安装步骤。

Installing the NVIDIA Container Toolkit 安装 NVIDIA 容器工具包top 头儿
Before installing the NVIDIA Container Toolkit, make sure that you have the appropriate NVIDIA drivers installed. To test if the NVIDIA drivers are properly installed enter nvidia-smi in a terminal. If the drivers are installed properly an output similar to the following should appear.

在安装 NVIDIA 容器工具包之前,请确保安装了适当的 NVIDIA 驱动程序。要测试 NVIDIA 驱动程序是否正确安装,请在终端中输入 NVIDIA-smi。如果驱动程序安装正确,则应显示类似于下面的输出。

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.39       Driver Version: 460.39       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 GTX 1080    Off  | 00000000:02:00.0  On |                  N/A |
| 35%   54C    P0    44W / 180W |   3048MiB /  8116MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+

The installation steps for the NVIDIA Container Toolkit are available here.

这里提供了 NVIDIA 容器工具包的安装步骤。

Cloning the Repository 克隆仓库top 头儿
Clone latest Apollo using the following command:

使用以下命令克隆最新的 Apollo:

git clone https://github.com/ApolloAuto/apollo
Building Apollo and bridge 建造阿波罗和桥梁top 头儿
Now everything should be in place to build Apollo. Apollo must be built from the container. To launch the container navigate to the directory where the repository was cloned and enter:

现在一切都应该就绪,建立阿波罗。阿波罗必须从集装箱中建造出来。要启动容器,请导航到克隆存储库的目录并输入:

./docker/scripts/dev_start.sh
This should launch the container and mount a few volumes. It could take a few minutes to pull the latest volumes on the first run.

这将启动容器并挂载一些卷。第一次查阅最新的卷可能需要几分钟的时间。

To get into the container: 进入集装箱:

./docker/scripts/dev_into.sh
Build Apollo (optimized, not debug, with GPU support):

构建 Apollo (优化,而不是调试,使用 GPU 支持) :

./apollo.sh build_opt_gpu
NOTE The Apollo build may fail on machines with less than 1GB of RAM per CPU core due to aggressive parallelization in the build, as discussed in Apollo issue 7719.

注意,正如 Apollo 问题7719中所讨论的那样,由于构建中的并行化过于严重,Apollo 构建可能会在每个 CPU 内核的 RAM 小于1GB 的机器上失败。

If the build fails, either re-start it until it succeeds, but if it continues to fail (especially when running the linker) then you’ll need to address the low memory situation by either adding more memory to your build machine or enabling or increasing available swap space. If your Apollo build is crashing on a 16GB machine with little or no swap, try setting it to 16GB.

如果构建失败,要么重新启动它直到成功,但如果它继续失败(特别是在运行链接器时) ,那么您需要通过向构建机器添加更多内存或启用或增加可用交换空间来解决内存不足的问题。如果您的 Apollo 版本在16GB 的机器上崩溃,只有很少或没有交换空间,请尝试将其设置为16GB。

Adding a Vehicle to Apollo 为阿波罗增加一个飞行器top 头儿
In order to run Apollo with the simulator, the calibration files for the vehicle you use in the simulator must be available in Apollo for perception module to work correctly.
为了使用模拟器运行阿波罗,模拟器中使用的车辆的校准文件必须在阿波罗中提供,以便感知模块正确工作。
Currently, only calibration files for Lincoln 2017 MKZ are included in the latest Apollo. More calibration files may be added later.
目前,只有林肯2017 MKZ 校准文件包括在最新的阿波罗。稍后可能会添加更多的校准文件。
To add a new vehicle to Apollo: 为阿波罗号增加一个新的飞行器:
Create a new folder with the new vehicle’s name under APOLLO_ROOT/modules/calibration/data.
创建一个新文件夹,其中包含 APOLLO _ ROOT/module/ 碰撞/数据项下新车辆的名称。
Copy all calibration files of Lincoln 2017 MKZ to the folder.
将林肯2017 MKZ 的所有校准文件复制到文件夹中。
Update vehicle parameters in vehicle_param.pb.txt if your new vehicle is different from Lincoln 2017 MKZ.
如果您的新车与 Lincoln 2017 MKZ 不同,请在 vehicle _ param.pb.txt 中更新车辆参数。
Update LiDAR calibration files in velodyne_params folder. If you have different configuration for LiDAR with respect to novatel, you need to update LiDAR’s height and extrinsics.
更新 velodyne _ params 文件夹中的 LiDAR 校准文件。如果您有不同的配置 LiDAR 相对于新颖,您需要更新 LiDAR 的高度和外部。
Update camera calibration files in camera_params folder. You need to update camera intrinsics and extrinsics for your own camera and sensor configurations.
更新 Camera _ params 文件夹中的摄像机校准文件。您需要为自己的相机和传感器配置更新相机内部特性和外部特性。
You may also need to update other sensor calibration files if you are using them on your vehicle.
您也可能需要更新其他传感器校准文件,如果您正在使用它们在您的车辆。
After you add the new vehicle, you need to restart dreamview to refresh the vehicle list. 添加新车辆之后,需要重新启动 dream view 来刷新车辆列表
Inside Apollo docker: 阿波罗码头内部:
bootstrap_lgsvl.sh stop && bootstrap_lgsvl.sh
Bootstrap _ lgsvl. sh stop & & bootstrap _ lgsvl. sh
Adding an HD Map to Apollo 向 Apollo 添加高清地图top 头儿
An HD map in Apollo format corresponding to the environment you use in the simulator must be available in Apollo for modules like routing, planning, etc. to work.

一个高清地图在阿波罗格式对应的环境中,你使用的模拟器必须在阿波罗模块可用,如路由,规划等工作。

Currently, only HD map files for Borregas Ave are included in the the latest Apollo at this time. More HD maps may be added later.

目前,只有高清地图文件博雷加斯大街包括在最新的阿波罗在这个时候。更多的高清地图可能会在以后添加。

You can also download HD Maps for any map available in the Web UI Store (for example), and manually add them to /apollo/modules/map/data/.

您还可以下载 Web UI Store 中可用的任何地图的 HD Maps (例如) ,并手动将它们添加到/apollo/module/map/data/。

Or you can export your own map file following Export Map Annotations, then generate routing_map and sim_map following these instructions.

或者您可以按照 Export Map Annotions 导出您自己的映射文件,然后按照这些说明生成 routing _ Map 和 sim _ Map。

In our Apollo 5.0 fork, we have a script generate_map.sh to help users generate map files. You can copy that script to APOLLO_ROOT/scripts/ folder to use it. For details, please follow here.

在我们的 Apollo 5.0 fork 中,我们有一个 script gener_ map。帮助用户生成地图文件。您可以将该脚本复制到 APOLLO _ ROOT/script/文件夹来使用它。详情请按此。

After you add the new map, you need to restart Dreamview to refresh the map list.

添加新映射之后,需要重新启动 Dreamview 来刷新映射列表。

Inside Apollo docker: 阿波罗码头内部:
bootstrap_lgsvl.sh stop && bootstrap_lgsvl.sh
Bootstrap _ lgsvl. sh stop & & bootstrap _ lgsvl. sh
Alternatively, you can analyze top while building, and decide how many jobs to enable to avoid running out of memory; then set a specific value in JOB_ARG, e.g. --jobs=6.

或者,您可以在构建时分析 top,并决定要启用多少个作业以避免内存耗尽; 然后在 JOB _ ARG 中设置一个特定的值,例如—— jobs = 6。

Setting Clock Mode in Apollo (Optional) 设置阿波罗时钟模式(可选)top 头儿
SVL Simulator has a clock sensor which outputs a simulated time that can be used as the reference time for Apollo. When used, message lag which may result from transporting large amounts of data between the Simulator and Apollo will not affect Apollo performance. In addition, the clock sensor allows Apollo to run with “simulator time” when used in “stepped simulation” mode as shown in Python API Quickstart Script 33.

SVL 模拟器有一个时钟传感器,输出一个模拟时间,可以用作阿波罗的参考时间。使用时,模拟器和 Apollo 之间传输大量数据可能导致的消息延迟不会影响 Apollo 的性能。此外,时钟传感器允许 Apollo 在“分步模拟”模式下运行,如 Python API Quickstart Script 33所示。

To be able to use the clock sensor (which is part of the Apollo 6.0 (modular testing) sensor configuration), clock_mode must be set to MODE_MOCK in cyber.pb.conf.

为了能够使用时钟传感器(这是 Apollo 6.0(模块化测试)传感器配置的一部分) ,时钟模式必须在 Cyber.pb.conf 中设置为 MODE _ MOCK。

Launching Apollo alongside the Simulator 在模拟器旁发射阿波罗top 头儿

Here we only describe only a simple case of driving from point A to point B using Apollo and the simulator.

在这里,我们只描述了一个简单的情况下驾驶从点 A 到点 B 使用阿波罗和模拟器。

To launch Apollo, first launch and enter a container as described in the previous steps.

要发射 Apollo,首先发射并进入前面步骤中描述的容器。

To start Apollo: 开始阿波罗计划:

Note: you may receive errors about Dreamview not being build if you do not run the script from the /apollo directory.

注意: 如果不从/apollo 目录运行脚本,您可能会收到关于没有构建 Dreamview 的错误。

./scripts/bootstrap_lgsvl.sh
Launch bridge (inside docker container): 下水桥(码头集装箱内) :
./scripts/bridge.sh
Run the SVL Simulator outside of docker. See instructions for 在 docker 外运行 SVL 模拟器Running the Simulator 运行模拟器
Create a Simulation using the Random Traffic runtime template and selecting the BorregasAve map and Lincoln2017MKZ vehicle with the Apollo 6.0 (modular testing) sensor configuration
使用随机交通运行时模板创建一个仿真,并选择 BorregasAve 地图和 Lincoln2017MKZ 车辆与阿波罗6.0(模块化测试)传感器配置
Enter localhost:9090 as the Bridge Connection String (if apollo and the simulator are running on separate machines you will need to enter the IPv4 address of the machine running the bridge instead of localhost)
输入 localhost: 9090作为桥接字符串(如果 Apollo 和模拟器在不同的机器上运行,则需要输入运行桥接的机器的 IPv4地址,而不是 localhost)
(Optional) Enable Traffic and Pedestrians (可选)启用交通及行人
(Optional) Set the Time of Day and weather settings
(可选)设置一天的时间和天气设置
Submit the Simulation 提交模拟
Select the created Simulation and click “Run Simulation”
选择创建的模拟并单击“运行模拟”

Open Apollo Dreamview in a browser by navigating to: 在浏览器中打开 Apollo Dreamview,导航到:localhost:8888
NEW for Apollo Master: Select the Mkz Lgsvl setup mode, from the menu to the left of the vehicle menu.
新的阿波罗主人: 选择 Mkz Lgsvl 设置模式,从菜单到车辆菜单的左侧。
Select the Lincoln2017MKZ LGSVL vehicle and Borregas Ave map in the top right corner.
选择右上角的 lincoln2017MKZ lgSVL 车辆和 Borregas Ave 地图。
Open the Module Controller tap (on the left bar).
打开模块控制器点击(在左栏)。
Enable Localization, Transform, Planning, Prediction, Routing, and Control (there is no need to enable Perception or Traffic Light because the modular testing sensors directly publish perception and traffic light results).
启用定位、转换、规划、预测、路由和控制(不需要启用感知或交通灯,因为模块化测试传感器直接发布感知和交通灯结果)。
Navigate to the Route Editing tab.
导航到“路由编辑”选项卡。
Select a destination by clicking on a lane-line and clicking Submit Route.
通过单击泳道线并单击 Submit Route 来选择目的地。
Watch the vehicle navigate to the destination.
观看车辆导航到目的地。
To stop the docker container run the dev_start.sh stop script in apollo/docker/scripts in a new terminal (not in the docker container).
要停止 docker 容器,请运行 dev _ start。Sh 在 Apollo/docker/script 中的新终端中停止脚本(不在 docker 容器中)。
./dev_start.sh stop
If you are using ufw, it is easiest to completely disable the firewall to allow connections 如果您正在使用 ufw,最简单的方法是完全禁用防火墙以允许连接sudo ufw disable
If that is not possible, add the following rules: 如果不可能,增加以下规则:
These are required even if running the simulator and Apollo on the same machine
即使在同一台机器上运行模拟器和 Apollo,这些也是必需的
sudo ufw allow 8888
sudo ufw allow 9090
Adding a Vehicle 添加车辆top 头儿
Only calibration files for Lincoln 2017 MKZ is included in the latest Apollo at this time. More calibration files map be added later.

只有校准文件的林肯2017 MKZ 是包括在最新的阿波罗在这个时候。稍后将添加更多的校准文件映射。

Adding an HD Map 添加高清地图top 头儿
Only HD map files for Borregas Ave is included in the the latest Apollo at this time. More HD maps may be added later.

只有高清地图文件博雷加斯大街是包括在最新的阿波罗在这个时候。更多的高清地图可能会在以后添加。

You can also download additional maps from here, and manually add them to /apollo/modules/map/data/.

您还可以从这里下载其他地图,并手动将它们添加到/apollo/module/map/data/。

Or you can export your own map from our map annotation tool, name it base_map.bin and then generate routing_map and sim_map following these Apollo map instructions.

或者您可以从我们的地图注释工具导出您自己的地图,命名为 base _ map。然后根据这些 Apollo 映射指令生成 routing _ map 和 sim _ map。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值