This section provides a detailed explanation of the first stage of SSDP. The core idea is to use iterative polygon offsetting operations to generate an optimal coverage path for all target regions, whether convex or non-convex. The following subsections discuss the principles of generating shrinking rings through polygon offset, strategies for evenly distributing waypoints, and methods for orderly connection of waypoints between rings. These steps lay a solid foundation for the subsequent path segmentation and allocation processes.
3.1. Shrinking Ring Generation
First, we take the boundary of the region as the initial shrinking ring. Using the polygon offset method, the first ring is shifted inward by a distance of – to generate the second shrinking ring. The same method is then applied to generate the third shrinking ring. In certain cases, offsetting the previous shrinking ring may result in multiple new shrinking rings. We use a depth-first search strategy to continue generating these rings. The search process continues until a UAV flying along a specific shrinking ring can fully observe all of the information within the ring, at which point that shrinking ring is considered the final one.
The polygon offset method we employ here is our improvement of the work by Lee et al. [
26]. The polygon offset method generates offset vertices by using the vertices of the previous shrinking ring and organizes them into an offset vertex list
. Next, adjacent offset vertices in
are connected to form offset edges, which are then organized into an offset edge list
. By comparing the directional and positional information, each offset edge is assigned an
and
attribute;
= 0 indicates that the direction is invalid, meaning that the offset edge formed by the two offset vertices is oriented oppositely to the original edge created by the corresponding two original vertices, while
= 0 indicates that the entire offset edge lies within the scanning area of a UAV flying along the previous shrinking ring, and as such contributes nothing to the current shrinking ring. On the other hand,
= 1 and
= 1 respectively signify that the direction and position attributes are valid.
We then begin traversing the from the start. We set the first offset edge with both and equal to 1 as the backward edge and set the second offset edge with both and equal to 1 as the forward edge. The and attributes are used to record the invalid direction and position information of the offset edges between the backward and forward edges. The core of the polygon offset method consists of applying corresponding procedures based on and to extract the required vertices from the offset vertices. In the subsequent process, the current forward edge is set as the backward edge and the next offset edge with both and equal to 1 is set as the forward edge. This loop continues until all offset edges have been considered as potential backward edges. All extracted vertices are then organized into an extracted vertex list .
Lee et al. [
26] classified the possible distributions of
and
into five categories: CASE 1.1, CASE 1.2, CASE 2, CASE 3.1, and CASE 3.2; however, through extensive exploration, we found that the existing cases do not encompass all possible situations. For instance, CASE 3.2 was designed to address scenarios where more than two directionally invalid offset edges occur during the offset process, but it only handles cases where the backward edge and forward edge are parallel. In practice, the backward and forward edges are often not parallel. Even when the backward and forward edges are parallel, the method used in CASE 3.2 can still result in incomplete coverage. As shown in
Figure 3a, the vertices of the previous shrinking ring are labeled as
to
. Among these, the edges
and
are parallel. The offset vertices corresponding to these are labeled as
to
. When
is the backward edge and
is the forward edge,
and
are the intersection points chosen by the CASE 3.2 strategy. In
Figure 3b, the current shrinking ring consists of vertices
to
. By flying along these two shrinking rings, the UAV is unable to fully cover the intermediate area.
Based on these observations, we have reorganized the cases into CASE 1, CASE 2, CASE 3.1, CASE 3.2, and CASE 3.3, improving the algorithm to address all scenarios during the offset process.
CASE 1:
and
. There are no invalid offset edges in terms of direction or position between the backward edge and the forward edge. For this case, it is sufficient to include the terminal offset vertex of the backward edge in
. As illustrated in
Figure 4a,
represents the backward edge and
represents the forward edge; therefore, only
should be added to
.
CASE 2:
and
. All offset edges between the backward edge and the forward edge are valid in terms of direction, but there is at least one positionally invalid offset edge. In this case, these offset edges result in globally invalid loops. We begin by sequentially adding the terminal offset vertex of the backward edge, all intermediate offset vertices, and the initial offset vertex of the forward edge to the
. Trimming is performed subsequently. As depicted in
Figure 4b,
represents the backward edge and
represents the forward edge; thus,
and
are added to
in sequence.
Figure 4c shows the globally invalid loop generated by
,
,
, and
.
CASE 3.1:
. There is only one directionally invalid offset edge between the backward edge and the forward edge. The strategy for handling this case is to determine the intersection point between the backward edge and the forward edge and add it to
. As shown in the
Figure 4d,
represents the backward edge and
represents the forward edge. Because
is a directionally invalid edge, the intersection point
between
and
is added to
.
CASE 3.2:
and the backward edge intersects the forward edge. The approach for this scenario is the same as in CASE 3.1.
Figure 4e illustrates that
is the backward edge and
is the forward edge. The edges
and
situated between them are directionally invalid. We calculate the intersection point
of
and
and add it to
.
CASE 3.3:
and the backward edge does not intersect the forward edge. The method here involves first sequentially traversing the directionally invalid offset edges between the backward and forward edges, then calculating their intersection point
with the backward edge. Subsequently, the minimum distance
between
and all original edges is calculated. Then,
is added to the preselected list only if it lies inside the shrinking ring and
. The shortest distance from the points in the preselected list to the original edges is expressed as
. Finally, the
corresponding to
from the preselected list is selected and added to
. The intersection point
with the forward edge is then added to
using the same procedure. As shown in
Figure 4f,
represents the backward edge and
represents the forward edge. The intersection points of
,
, and
with
are
,
,
, respectively. Given that
and
,
is set as
and added to
. Similarly,
from the intersection points with
is added to
.
According to CASE 2, may form globally invalid loops. These loops fall entirely within the UAV’s photography range as it follows the previous shrinking ring. This results in no improvement in coverage and increases the path length. To eliminate these globally invalid loops, we identify the self-intersection points within the overall loop formed by . Based on these points, we trim the line segments and ultimately extract the shrinking rings.
To facilitate a clearer understanding of the process of generating shrinking rings, the full pseudocode of the algorithm is provided in Algorithm 1.
Algorithm 1 Generate the Shrinking Ring List for the Region |
Input: Region , the longitudinal scanning length , the overlap length in the longitudinal direction Output: The shrinking ring list = , where denotes the number of shrinking rings, varying by region.
- 1:
- 2:
Initialize the list to store the shrinking rings to be offset: - 3:
whiledo - 4:
Set the previous shrinking ring: the head of - 5:
Append to the tail of - 6:
Generate from - 7:
Generate from - 8:
Set the and attributes for each offset edge in - 9:
Iterate through and extract based on different cases. - 10:
Connect adjacent vertices in to form extracted edge list . - 11:
Insert intersection points into the based on the intersections of the edges in the . - 12:
Reconstruct based on the new . - 13:
Remove edges from the that are within a minimum distance of less than from each edge of - 14:
Initialize the list to store the offset edges: - 15:
for to size of do - 16:
Append to the tail of - 17:
size of - 18:
- 19:
while do - 20:
if the start vertex of = the end vertex of then - 21:
Form by extracting the start vertices of edges indexed from to - 22:
Append to the head of - 23:
Remove edges in with indices from to - 24:
- 25:
else - 26:
- 27:
end if - 28:
end while - 29:
end for - 30:
end while
|
3.3. Connecting Waypoints
To obtain the optimal coverage path, the first step is to determine the regional access order. A widely-used strategy involves treating the center of each region as a representative point and optimizing the visit sequence of these centers using a TSP solver [
17,
18,
19,
20,
27]. Therefore, we utilize the Self-Organizing Map (SOM) [
28] algorithm to establish the visiting order of regions, which is a well-documented method used in previous studies [
29,
30]. After the visit order of the regions is determined, the corresponding
is arranged accordingly. Then, the optimal coverage path can be formed by sequentially connecting the waypoints in each shrinking ring
of
.
For
,
represents the number of waypoints in the shrinking ring, while
denotes the
-th waypoint of the
-th shrinking ring generated by region
. Thus, there are
possible ways to integrate
into the optimal coverage path:
. Suppose that in the
-th sub-path of
, the first waypoint is denoted as
and the last waypoint is denoted as
. Then, the cost of
is computed based on the waypoint
and
using the following formula:
where
refers to the backward reference point, typically the last waypoint of the previous-level shrinking ring. However, for the first-level shrinking ring,
corresponds to the warehouse. This indicates that when forming the optimal coverage path, the connection between
and
in the current shrinking ring
is broken and
is connected to
, resulting in new distance and turning costs. Thus, the connection way is determined as follows:
Based on this, the pseudocode for the first stage of SSDP is presented in Algorithm 2.
Algorithm 2 Generate the Optimal Coverage Path |
Input: Region set , the longitudinal and lateral scanning length , the overlap length in the longitudinal and lateral direction , warehouse , the weights for distance and turning in energy consumption and Output: A optimal coverage path - 1:
for to M do - 2:
Generate by using Algorithm 1 - 3:
for do - 4:
Traverse each edge of and insert waypoints - 5:
end for - 6:
end for - 7:
Determine the region visitation order using a TSP solver (SOM) - 8:
- 9:
for to M do - 10:
Retrieve the corresponding to the m-th region in the visitation order - 11:
for do - 12:
Merge into the tail of according to , calculated by Equation ( 12) - 13:
end for - 14:
end for
|