# Mission Planning of UAVs and UGV for Building Inspection in Rural Area
## 2 Establishment of Mathematical Model  
During the inspection task in a specific area, UGV will park at a designated parking point, and the locations of task points are determined. Each task point is assigned to only one UAV, as illustrated in Figure 1 for the collaborative inspection of UAVs. Each rotary-wing UAV only needs to fly to a few task points for operation, with UAVs jointly completing all tasks in the area. Due to the scattered distribution of task points and the limitations of UAV positioning accuracy and safe return requirements, UGV needs to remain stationary and wait for UAVs to complete inspection tasks before departure. UAVs are influenced by their own battery levels; when the battery is low, they need to return to parking points to change batteries before continuing tasks. Simultaneously, considering the synchronicity of multiple UAVs completing tasks, the inspection task at the parking point is only considered to have been completed when the last UAV completes its task and lands on the UGV. To facilitate the quantitative study of this MPP, the following assumptions are made for the MPP model of UAVs from a single parking point:  
1. Each UAV on the UGV possesses uniform characteristics, with identical cruising speeds during flight and equal battery capacities. Figure 1: Single parking point inspection conceptual diagram. 2. UAVs take off with full battery capacity, and when battery levels are low, they return to the UGV for battery replacement, disregarding the time for takeoff, landing, ascent, descent, and battery replacement. 3. Constrained by the distribution of task points and the precision requirements of UAV positioning, the UGV needs to remain stationary at the parking point until all UAVs complete their inspection tasks. 4. During the flight between the start and the destination, the time variations caused by altitude changes have been incorporated into the operational time of each task. These assumptions and settings allow for the establishment of a mathematical model for task planning. For a region with \(n\) task points and m UAVs taking off from parking point \(Q_{\theta}\) to execute inspection tasks at task points in accordance with their respective planned sequences, where the inspection time at task point \(Q_{i}\) is denoted as \(t_{i}\), from the above parameters, the optimization model for this task planning can be formulated. The objective is to minimize the total time spent by all UAVs to complete their respective inspection tasks. Constraints are on UAV battery capacity and the requirement that each task point be inspected by only one UAV, and all task points must be inspected. The decision variables represent the sequence of UAV flights to each task point. They can be expressed using the following formulas. Decision Variables:  
\[x_{k,i,j}=\left\{ \begin{array}{l}1\\ 0\end{array} \right.,\text{while }k=\{1,2,\cdots,m\},i=\{0,1,\cdots,n\},\,j=\{0,1, \cdots,n\}\text{ and }i\
eq j \tag{1}\]  
Constraints:  
\[x_{k,i,0}=\left\{ \begin{array}{l}1,\text{electrical value }w<15\%\text{ or }\sum\limits_{i=0,i\
eq j}^{n}\sum\limits_{j=1,j\
eq i}^{n}x_{k,i,j}=m_{k}-1 \\ 0,\text{others}\end{array} \right.,\text{while}w=\frac{t_{\text{max}}-t_{use}}{t_ {\text{max}}} \tag{2}\]  
\[\sum\limits_{k=1}^{m}\sum\limits_{i=1,j\
eq i}^{n_{k}}x_{k,i,j}=1,j=0,1,2\cdots,n_{k} \tag{3}\]  
\[\sum\limits_{k=1}^{m}\sum\limits_{j=1,j\
eq i}^{n_{k}}x_{k,i,j}=1,i=0,1,2\cdots,n_{k} \tag{4}\]  
\[\sum\limits_{k=1}^{m}\sum\limits_{i=0}^{n}\sum\limits_{j=1,j\
eq i}^{n}x_{k,i, j}=m \tag{5}\]  
Objective Function:  
\[ \begin{array}{l}\text{min}F=\text{max}\{F_{1},F_{2},\cdots F_{m}\}\\ \text{while }F_{k}=\text{min}\left\{\sum\limits_{i=0}^{m_{k}}\sum\limits_{j=0}^{m_{k }}x_{k,i,j}S_{i,j}/v+\sum\limits_{i=1}^{n_{k}}t_{k,i}\right\},k=\{1,2,\cdots,m\} \end{array}  \tag{6}\]  
where \(x_{k,i,j}\) represents the decision variable.