# Evaluation and Testing System for Automotive LiDAR Sensors
## 4 System Implementation
### Point Cloud Filtering for Target Detection  
The evaluation and testing platform aims to support any COTS LiDAR sensor as well as Bosch prototypes under development. Regarding the supported tests, e.g., FoV, target detection can be challenging because not all sensors provide the point's intensity values along with their coordinate data. Therefore, and in order to support all sensors' outputs, we have created a set of filters that can be used to detect targets without relying on the point intensity values, including distance and clustering filters. Distance Filter (DF):Because the target is placed at a known distance from the sensor, the output of this filter is a new point cloud (published to the _filtered_point_cloud_ topic) containing points that are, at this distance, \(\pm\) a threshold value (used to avoid removal of points that actually belong to the target). The result after applying the distance filter is shown in Figure 9(a). This procedure removes undesired points, and can help to reduce the computational costs of subsequent tasks. Clustering Filter (CF):The cluster filter algorithm groups the points that are present in the point cloud and evaluates whether the target is within the clusters created. Because the target's distance and size and the sensor's resolution can have an effect on the clustering results, this algorithm must be tuned afterwards. Figure 9(b) depicts the output of the CF algorithm without tuning its parameters; it can be seen that two clusters were identified, represented by the yellow and red points. The points present inside the yellow cluster result from points that are at the same distance as the target, which must be removed during the next step. To detect whether the resulting clusters represent the target, a Euclidean clustering filter is applied. Because the point density within the target's cluster is higher than in other objects at the same distance, this filter analyzes the neighbour points of each point within a defined search radius \(R1\). If a neighbor point is inside this search radius \(R1\), it belongs to the same cluster and is retained in the point cloud; otherwise, it is removed. This task is performed by resorting to the _EuclideanClusterExtraction.extract_ method presented in the point cloud library (PCL) [36]. The parameters used to configure this method are:  
* _Cluster Tolerance:_ Defines the search radius \(R1\); if the chosen value is too small, the same target can be divided into multiple clusters. On the other hand, multiple objects can be set as just one cluster if this value is too high. This parameter permits an interval value between 0.01 and 1 m.
* _Minimum Cluster Size:_ This parameter is used to define the minimum number of points required to form a cluster. It permits values between 1 and 10,000 points. * _Maximum Cluster Size:_ This parameter defines the maximum number of points used to form a cluster. It supports a minimum of 2 and a maximum of 50,000 points. Figure 10c depicts the point cloud output after applying the tuned Euclidean clustering filter. When the target's cluster is found, this filter publishes a message to the _target_detected_ topic using the _TargetInfo_ message type, which contains a boolean variable (True if the target is being detected and False otherwise) and the number of points inside the cluster. The new point cloud, which now contains only the target's cluster, is published in the _clustered_point_cloud_ topic, which can finally be used in testing the sensor parameters, e.g., FoV and AR. _FoV software filter (FoVSF):_ The purpose of this filter is to enable support for any LiDAR sensor on the market, including the rotation-based COTS LiDAR sensors widely used in automotive applications, which usually provide a 360\({}^{\circ}\) horizontal FoV. Notwithstanding this, for the purposes of testing and validating the platform, which must support additionally LiDAR sensors with a limited FoV, the FoV software filter allows the point cloud to be cropped to a desired horizontal and vertical FoV.