AutowareAuto 基础

Autoware 是由 The Autoware Foundation 维护的软件堆栈,其目标是支持将实现自动驾驶移动性(mobility)的开源项目。它有许多来自工业和学术环境的成员。在 2020 年,已经有 Autoware 项目:

  • Autoware.AI: 它基于 ROS1。这是第一个 Autoware 项目,其目标是成为自动驾驶的研发平台。它的主要用途是在学术界。
  • Autoware.IO: Autoware 的接口,可以使用专有软件和第三方库进行扩展。它包含传感器驱动程序( sensor drivers),有线控制器(by-wire controllers),片上系统(hardware-dependent programs for System on Chip,简写 SoC)板的硬件相关程序等。
  • Autoware.Auto: 它基于 ROS 2,提供实时(Real-Time,简称 RT)功能和更多安全措施,从而使它对于现实世界中的关键应用程序更加可信。它是为确保使用最佳开发实践而进行的最新开发,因此可以快速适应Autoware.ai。有关如何完成从 ROS1 到 ROS2 的迁移的更多详细信息,请参见 here

2020年5月,Autoware.Auto 具有使用 LIDAR 和 GPS 的全面定位功能,对 2D 和 3D 中其他交通参与者的完整感知(可以分类,推断其速度和预期路径),相对简单的动作运动计划以及有关 在分段语义图中突出显示环境,例如,突出显示车道,人行横道,交通信号灯等。

相对于 ROS1,ROS2 的一些优点是:

  • Quality of desing and implementation.
  • System reliability.
  • Real-time control and deterministic execution.
  • Validation, verification and certification.
  • Flexibiliity in communication.
  • Support for small embedded systems.

1 开发环境

使用的开发环境是 ADE,它是 Docker 的包装器,它允许与 Docker 交互(例如启动/停止 docker),轻松配置和 docker 卷版本控制。

# ADE Installation
$ cd ${HOME}
$ mkdir adehome # Create a persistent environment to store the things that must persist between ADE sessions
$ cd adehome
$ wget https://gitlab.com/ApexAI/ade-cli/uploads/85a5af81339fe55555ee412f9a3a734b/ade+x86_64 # Fetch ADE binary from GitLab
$ mv ade+x86_64 ade # Rename it to "ade"
$ chmod +x ade # Give execution rights
$ mv ade ~/.local/bin # Move it to a proper location
$ which ade # Check its location

adehome 可以自定义名称,主要用于创建一个持久性环境来存储在 ADE 会话之间必须持久化的事物。

如果主机系统安装了 NVIDIA GPU(其驱动程序),则必须安装 NVIDIA Docker,如其官方资料库所述。要在Ubuntu / Debian系统中安装它的命令如下:

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 update
sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker

最后,要设置 ADE 环境,应遵循以下步骤:

# ADE Setup
$ touch .adehome # Create an empty configuration file
$ git clone --recurse-submodules https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto.git # Clone Autoware.Auto
$ cd AutowareAuto/
$ ade start
$ ade enter

2 安装 ROS 2Autoware.Auto

Autoware.Auto 使用 ROS2 Dashing,它已经安装在 ADE 中(安装在 /opt/ros/dashing/ 中)。可以通过运行 ade$ ros2 -h 来确认安装,并且可以使用以下命令执行基本的 talker / listener 示例:

ade$ ros2 run demo_nodes_cpp talker

ade$ ros2 run demo_nodes_cpp listener

可以使用 apt 软件包管理器将一些其他系统软件包安装在 ADE 中,如下所示:

ade$ sudo apt update
ade$ sudo apt install ros-dashing-turtlesim
ade$ sudo apt install ros-dashing-rqt-*
ade$ sudo apt install byobu

注意:在 ade stopade start 之间,这些安装将丢失。如果其持久性很重要,则应将其放置在 adehome 中。

关于 Autoware.Auto,它也已经安装在 Docker 映像中。 安装位于 /opt/Autoware.Auto/ 中,该目录构造为 docker 卷。要从源代码安装它,可以使用以前克隆的版本以及以下命令序列:

ade$ cd AutowareAuto
ade$ colcon build
ade$ colcon test
ade$ colcon test-result

3 目标检测演示

这是一个基于 LIDAR 的目标检测演示。首先要做的是下载预先记录的 pcap file,它是在 Palo Alto 中行驶时记录的 UDP 软件包的集合。该文件应移到 adehome 目录中名为 data/ 的文件夹中。接下来,应从以下 ApexAI 存储库(从 ADE 环境内部)克隆配置文件:

ade$ git clone https://gitlab.com/ApexAI/autowareclass2020.git ~/autowareclass2020

下一步是将指定的每个命令之前获取 Autoware.Auto 工作区。这是通过在 ADE 终端中执行以下操作来完成的:

ade$ source /opt/AutowareAuto/setup.bash

设置完所有内容后,可以“重放数据并启动 ROS 2 节点” **,后者将处理输入点云以在检测到的对象周围创建 3D 边界框。这些是要执行的命令:

# Replay and broadcast the UDP data from the pcap file (adding "-r -1" will replay it in a loop)
ade$ udpreplay ~/data/route_small_loop_rw-127.0.0.1.pcap

# Launch RViz 2 to visualize the data
ade$ rviz2 -d /home/${USER}/autowareclass2020/code/src/01_DevelopmentEnvironment/aw_class2020.rviz

# Launch the Velodyne driver to convert the raw LIDAR data into pointclouds
ade$ ros2 run velodyne_node velodyne_cloud_node_exe __ns:=/lidar_front __params:=/home/${USER}/autowareclass2020/code/src/01_DevelopmentEnvironment/velodyne_node.param.yaml

# Robot State Publisher. Publishes the transforms between the coordinate system of the car and the one of the LIDARs on the roof
ade$ ros2 run robot_state_publisher robot_state_publisher /opt/AutowareAuto/share/lexus_rx_450h_description/urdf/lexus_rx_450h.urdf

# Point Cloud Transformer. Will transform the pointlouds (in the LIDARs' coordinate frames) to the base coordinate frame of the car
ade$ ros2 run point_cloud_filter_transform_nodes  point_cloud_filter_transform_node_exe __ns:=/lidar_front __params:=/opt/AutowareAuto/share/point_cloud_filter_transform_nodes/param/vlp16_sim_lexus_filter_transform.param.yaml __node:=filter_transform_vlp16_front

# Ray Ground Classifier differenciates the data corresponding to the ground from the one corresponding to objetcs
ade$ ros2 run ray_ground_classifier_nodes ray_ground_classifier_cloud_node_exe __ns:=/perception __params:=/opt/AutowareAuto/share/autoware_auto_avp_demo/param/ray_ground_classifier.param.yaml

# Convert the non-ground points into obstacles to be avoided
ade$ ros2 run  euclidean_cluster_nodes euclidean_cluster_exe __ns:=/perception __params:=/opt/AutowareAuto/share/autoware_auto_avp_demo/param/euclidean_cluster.param.yaml
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容