# A Framework for Coverage Path Planning Optimization Based on Point Cloud for Structural Inspection
## 2 Proposed Framework
### Dynamic Identification  
For the coupling of 3D reconstructions and analysis of them, some landmarks must have great prominence on the surface. These regions need closer flights to create a dense cloud of top-quality points. If the entire mission uses this approach, the UAV's flight time will last a long time, and the possibility of covering large surfaces will be limited. Thus, a mini local mission was thought of when an object of interest was identified. For identifying objects, the most various algorithms can be used, some using OPENCV [50; 51].  
After the object is identified, it is necessary to create a local mini-mission. This mini-mission consists of an approximation of one meter from the surface, using a camera or proximity sensors. Nine points are made in a vertical mission, ranging from 0.5 m from the UAV's current height and 0.7 m in the horizontal direction. After completing the task, the UAV returns to the waypoint and continues its mission. Figure 9 shows an example of the local mini-mission when a blue object is identified on the surface.  
Therefore, the flight plan is divided into several horizontal planes. At the end of each horizontal plan, optimization is performed again, considering the remaining flight time and the space to be surveyed. The remaining time is calculated using the maximum mission time minus the time elapsed until the end of the horizontal plane. On the other hand, the remaining area is the horizontal plane's height below the drone to a height of one meter from the ground. The objective of performing the optimization again is to allow the algorithm to adapt to the dynamic identification missions and possible losses during the flight.  
\begin{table}
\begin{tabular}{c c c} \hline
**Constant** & **Explain** & **Dimension** \\ \hline \(vel_{UAV}\) & Average UAV speed during the mission. & m/s \\ \hline \(T_{mission}\) & Total mission time & s \\ \hline \(G_{intersection}\) & Intersection Angle Gain & \([0,1]\) \\ \hline \(Dif_{Ang}\) & Intersection angle & \(\circ\) \\ \hline \(T_{shot}\) & Image capture time & s \\ \hline \end{tabular}
\end{table}
Table 1: \(Cont.\)  
Figure 9: Mini-mission.  
Algorithm 1 demonstrates the decision process of the presented methodology. DATA, filtered_DATA, \(T_{Mission}\), \(T_{Max}\) are the surface data, the filtered data, the available mission time, and the maximum mission time, respectively. The support variables \(Mission_{End}\) and \(Horizontal_{End}\) represent whether the mission was completed globally or in horizontal expeditions. The filters, Optimizer, and Identification_function functions represent the filtering of the surface data, optimizing missions based on metaheuristics, and identifying objects of interest.  
```
DATA \(\leftarrow\) Import structure data ; iltered_DATA = Filters(DATA); \(T\_Mission\gets T\_Max\) \(Mission\_End\gets 0\) whileMission_End = 0 do  Waypoints = Optimizer(Filtered_DATA,\(T\_Mission\));  i \(\gets 0\) ; \(Horizontal\_End\gets 0\); whileHorizontal_End = 0 do  Drone goes to the next waypoint;  i\(\leftarrow\) i+1 ;  Point_of_Interest = Identification_function(Camera_image); ifPoint_of_Interest = 1 then  Perform local mini mission;  end ifWaypoints[i] = Last of the Horizontal Missionthen  Horizontal_End \(\gets 1\); \(T\_Mission\gets T\_Max\) = Elapsed time; \(Filtered\_DATA\gets Filtered\_DATA\)\(-\)Heights already visited;  end if  end ifWaypoints[i] = Last of the Global Missionthen  Mission\({}_{End}\gets 1\)  Return the drone to the takeoff point.  end if  end while
```  
**Algorithm 1**Decision process of the proposed methodology.