# ASRLab AVL Team Training Note ( Autoware on Board: Enabling Autonomous Vehicles with Embedded Systems & Autoware Overview)
contributed by < `qwe661234` >
###### tags: `asrlab`
## Autoware
[Autoware](https://github.com/autowarefoundation/autoware) 是世界上第一款用於自動駕駛汽車的"一體化"的 Open Source。 Autoware 的功能主要適用於城市,但也可以涵蓋高速公路等其他範圍。
## Autoware Procedure
* Input:
Sensors 所紀錄的環境資訊, 提供外部資訊可以增加 localization 和 detection 的精準度。
* Output:
直線速度與角速度的值, 用來控制煞車和方向盤
* Procedure:
Sensing(接收感應器傳來的訊息) → Perception (定位處理、偵測障礙物) → Decision (以 sensor 的 data 決定自駕車的狀態) → Planning → Actuation (取得自駕車狀態並下指令)
## Module
### Sensing:
* LiDAR scanners: Measure the distance, point cloud data from LiDAR scanners can be used to generate digital 3D representations of the scanned objects
* Cameras: recognize traffic lights and extract additional features of the scanned objects.
### Computing:
#### 1. Perception:
Calculate the accurate position of the vehicle inside a 3D map, and recognize objects in the surrounding scene and the status of traffic signals.
#### 2. Localization:
Use the NDT algorithm to match between 3D maps and LiDAR scanners
#### 3. Detection:
Support deep learning and traditional machine learning approaches for object detection, using Caffe and OpenCV
#### 4. Prediction:
Object detection algorithms are computed on each synchronized camera frame and point cloud scan. These results must be associated among the time, so the trajectories of moving objects can be estimated for the mission and motion planning modules
#### 5. Decision:
When the obstacles and traffic signals are detected, the trajectories of other moving objects can be estimated. Mission planning and decision making modules use these estimated results to determine an appropriate direction.
#### 6. Planning:
The planning module generates trajectories following the output from the decision-making module, the planning module can be divided into misson planning and motion planning.
* Mission planning: Depending on the driving states and uses a rule-based system to determine path trajectories
* Motion planing: The motion planner is in charge of generating local feasible trajectories along with the given global trajectories, taking into account the vehicle states, the drivable areas indicated by the 3D map, the surrounding objects, the traffic rules, and the desired goal
### Actuation:
Once local trajectories are determined, autonomous vehicles need to follow them
* Path following:
The algorithm searches for the next closest waypoint in the vehicle’s heading direction.
* Vehicle control:
To actuate the steering and throttle (油門) based on the velocity and angle commands, a PID controller is often applied.
## Conclusion
### 目的: 比較 Autoware 的 performance on different platform
1. laptop
2. DRIVE PX2 with ARM-based embedded processing cores and Tegra-based embedded graphics processing units (GPUs)
### 實驗結果分析:
#### Voxel Leaf Size
For Points localizer, the larger leaf sizes reduce the execution time on both the DRIVE PX2 platform and the laptop computer. But, the leaf size can not be too large for the NDT algorithm to converge.
#### The presence of the GPU
For clustering, the presence of the GPU helped to reduce the execution time. But, In some cases, the execution time was not influenced significantly by the presence of the GPU on the laptop. We conjecture that the overhead for using the GPU was equivalent to the extra computation time required without the GPU. Therefore, in some cases, the GPU is not really desired to reduce the execution time.
#### GPU core
For Image detector, using more GPU cores reduces the execution time, so the execution time on the DRIVE PX2 platform could be improved by load balancing.
### 結論:
the DRIVE PX2 platform provides the acceptable level of performance for Autoware installed to real autonomous vehicles.
## Keyword
* Point Cloud Library (PCL): 是一個開源的算法庫,用於處理點雲和計算機視覺中的三維幾何過程
* CUDA: CUDA 是用於 GPU 的平行運算平台和程式設計模型。透過 CUDA,使與者可以利用 GPU 的運算能力加速應用程式。
* Caffe: Caffe(快速特徵嵌入的卷積結構,Convolutional Architecture for Fast Feature Embedding)是一個深度學習框架,最初開發於加利福尼亞大學柏克萊分校,可以支援基於 GPU 和 CPU 的加速計算核心庫。
* OpenCV: OpenCV (Open Source Computer Vision) 是一個跨平台的電腦視覺庫,包含許多電腦視覺相關演算處理的 Open Source Library,而且支援多種開法語言,同時 OpenCV 也可以在手機APP (Android、iOS) 上開發
* MPPA: 大規模並行處理機(Massively Parallel Processor)是由多個由微處理器、局部存儲器及網絡接口電路構成的節點組成的並行計算體系;節點間以定製的高速網絡互聯。大規模並行處理機是一種異步的多指令流多數據流,因為其 program 有多個 process,它們分布在各個微處理器上,每個 process 有自己獨立的地址空間,process 之間以消息傳遞進行相互通信。
* DRIVE PX2: DRIVE PX2 是一個開放式人工智慧車輛計算平台,為自駕車和駕駛員輔助功能的深度學習演算法提供硬體基礎。
* Tegra: Tegra 是一種採用單片機系統設計(system-on-a-chip)晶片,它集成了 ARM 架構處理器和 NVIDIA 的GeforceGPU,並內置了其它功能,產品主要面向小型設備。
* GNSS: 全球導航衛星系統(Global Navigation Satellite System),包含美國的全球定位系統(GPS)、俄羅斯的格洛納斯系統(GLONASS)和中國的北斗衛星導航系統(BDS)
* IMU: 慣性測量單元(Inertial measurement unit) 用來測量物體三軸姿態角(或角速率)以及加速度的裝置
* ADAS: 先進駕駛輔助系統 ( ADAS :Advanced Driver Assistance Systems),主要功能是利用車上感測器接收的資料為駕駛人提供車輛的工作狀況與車外的行駛環境變化等資訊。
* PID controller: PID控制器(比例-積分-微分控制器),由比例單元(Proportional)、積分單元(Integral)和微分單元(Derivative)組成。可以透過調整這三個單元的增益來調定其特性。PID控制器主要適用於基本上線性,且動態特性不隨時間變化的系統。
* voxel: 體素,體積像素(Volume Pixel)的簡稱。概念上類似二維空間的最小單位——像素,像素用在二維電腦圖像的影像資料上。 體積像素是數位資料於三維空間分割上的最小單位,應用於三維成像、科學資料與醫學影像等領域。如同像素,體素本身並不含有空間中位置的資料(即它們的座標),然而卻可以從它們相對於其他體素的位置來推敲,意即它們在構成單一張體積影像的資料結構中的位置。