# Robotic Coverage Path Planning for Ultrasonic Inspection
## 6 Coverage Path Planning  
A conventional approach for coverage path planning is to move the sensor over the surface along a set of evenly spaced parallel lines. Those lines are often traversed in such a way that a meander-shaped path is formed. However, by more accurate modeling of the inspection process, it is possible to generate shorter inspection paths as the distance between scan lines can be chosen according to the local specimen's geometry (e.g., flat regions allow larger gaps between scan lines because the sensor is able to capture a larger region at once). To achieve a more reasonable placement of scan lines, we formulate a process model which addresses both the problem of (a) mapping surface points to sensor orientations and positions and (b) determining the inspected volume of the specimen for a certain sensor pose. Figure 4: Visualization of reflected rays on the geometry of a complex beam. The PA sensor is positioned at a working distance to a streamline that follows the edge of the part. To reduce clutter in the visualization, the depicted phased array sensor consists of only 21 transducers. Only 5 co-planar rays are emitted by each transducer. The rays highlighted in orange are emitted by the same transducer near the center of the ultrasound sensor. Some rays are reflected at the front wall and some at the back wall of the specimen. Figure 3: Illustration of coverage calculation via ray tracing. Two rays that are emitted by the sensor are shown. At any surface, transmission and reflection occur. Hence, each ray spans a tree. Voxels that are traversed by rays are shown in color. Red voxels correspond to a tree of rays that do not return to the sensor—at least not within the first four levels of the tree. Blue voxels are covered by rays that return back to the sensor. In contrast to red voxels, we consider blue voxels to be covered. When determining the sensor pose for a given point on the surface, the following constraints need to be considered:  
1. To maximize the signal strength, the sensor has to be placed such that the main direction of emission (the sensor's z-axis) is parallel to the surface normal, and the center of the sensor is positioned along that normal. 2. The inspection distance should be equal to the optimal working distance of the sensor. 3. To maximize coverage, the long edge of the sensor (the sensors y-axis) has to be perpendicular to the scanning direction. That is, the sensor needs to be positioned as show in Figure 4, where the phased array travels along the streamline, which is depicted as a black line on the mesh surface. 4. For every point of a curved surface, the sensor should be orientated such that the direction of the largest curvature is parallel to the sensor's y-axis. This tends to maximize the strength of the captured signals. Note that the PA sensor is invariant under a 180\({}^{\circ}\) rotation around its z-axis. Thus, for every point on a curved surface, we can consider the sensor pose as fully defined by the aforementioned constraints. Our coverage path planning approach can be divided into two separate phases: (a) a Cartesian coverage path planning phase (see Algorithm 1) that uses the described process model, and (b) a greedy search to derive a robot path that scans each point on the Cartesian path exactly once while considering the limitations of the robot kinematics. The Cartesian coverage path planning algorithm uses the specimen's CAD data to plan a path on the outer surface of the specimen. To keep track of the inspected volume, the algorithm simulates the ultrasonic data acquisition. The volumetric information is then projected back onto the surface. This allows to generate a coverage path that includes information about the actual covered volume.