Research on an Obstacle Avoidance Method for UAV

With the continuous development of UAV technology, UAV has been widely used in various industries. In the flight process of UAV, UAV often changes the given path because of obstacles (including static nonliving body and moving living body). According to the properties of obstacles and the characteristics of UAV, standard Kalman filter is used for nonmaneuvering targets, and sigma point Kalman filter is used for maneuvering targets. In the aspect of obstacle avoidance, the minimum search method is used to get the initial population of local programming. .en, the improved genetic algorithm is run. Combined with the predicted obstacle features, the local planning path can be obtained. Finally, the local planning path and global planning path are combined to generate the planning path with new obstacles. At the end of the paper, the obstacle avoidance strategies of static and moving obstacles are simulated. .e simulation results show that this method has fast convergence speed and good feasibility and can flexibly deal with the obstacle avoidance and local path planning of various new obstacles.


Introduction
In recent years, with the continuous development of UAV and computer technology, UAV technology is widely used in power, agriculture, film, and other industries. In high temperature, cold, dangerous, and other environments [1], UAV technology can help people work. With the continuous expansion of the application field of UAV, the performance requirements of UAV are higher and higher, especially for the key technologies of UAV, such as endurance, shooting, and obstacle avoidance [1,2]. e obstacle avoidance technology of UAV is related to the safety of UAV, so it is a hot issue in the research of UAV.
At present, many research studies on UAV obstacle avoidance are to obtain the two-dimensional position information of UAV height through UAV airborne radar and construct an artificial potential field model to guide UAV to quickly track targets and avoid air obstacles. Similar to this obstacle avoidance method, it is more suitable for obstacle avoidance of stationary objects and does not predict dynamic objects [1,2]. In the subsequent path planning, the optimal path cannot be obtained. In this study, the obstacles are classified, the standard Kalman filter prediction algorithm is used for nonmaneuvering targets, and the sigma point Kalman filter method is used for maneuvering targets. Better results can be obtained in path planning.
ere are two common methods for obstacle avoidance planning of UAV [3]; one is to adjust the UAV flight speed to avoid obstacles according to the relative position and speed between UAV and target; the other is to change the UAV heading to avoid obstacles. Considering that the outdoor environment is mostly static obstacles, it is difficult to meet the obstacle avoidance requirements only by adjusting the UAV speed, so the second method is considered.
In this paper, according to the characteristics of obstacles, obstacles are divided into nonmaneuvering targets and maneuvering targets. e standard Kalman filter is used to predict the maneuvering target, and the sigma point Kalman filter is used to predict the maneuvering target.
rough the study of these two parts, we can effectively predict the characteristics and location of obstacles. en, for the predicted obstacles, the minimum search method is used to obtain the initial population of local programming and run the improved genetic algorithm. Combined with the predicted obstacle characteristics, the local planning path can be obtained. Finally, the planning path with new obstacles is generated by combining the local planning path and the global planning path. e simulation results show that this method has fast convergence speed and good feasibility and can flexibly deal with obstacle avoidance and local path planning of various new obstacles.

Decision of Obstacle Avoidance Algorithm
e sensors used for real-time obstacle avoidance in UAV are mainly lidar, and many scholars have done a lot of research on the use of lidar [1,4]. However, the main starting point of these research results is to avoid obstacles, which is not fully based on the attributes of obstacles and the characteristics of UAV, so as to organically combine safety obstacle avoidance and path planning. In this paper, based on the information obtained by UAV, combined with the characteristics of obstacles, UAV, and preplanned global path, local planning path is generated near the global planning path on the basis of safe obstacle avoidance, so as to achieve the unity of global and local path planning [5]. e obstacle avoidance decision algorithm is shown in Figure 1. Target recognition is based on the information obtained by lidar. If obstacles are found beyond the safe distance, obstacle avoidance will not be initiated. On the contrary, obstacle avoidance is based on the results of target recognition.

Standard Kalman Filter
Algorithm. e filtering process of the standard Kalman filter is calculated in a recursive way of "prediction-revision." First, the prediction value is calculated, and then, the observed value is modified according to the new information and Kalman gain (weighting term). e predicted value can be obtained from the filtered value, and the filtered value can be obtained from the predicted value.
e interaction between the filtering and the prediction does not require any observation data to be stored, and it can be processed in real time. e system structure block diagram is shown in Figure 2.
Assume that the state equation and measurement equation of the system are, respectively, where X k is the n-dimensional state vector at time k. at is to say, the estimated vector A k/k−1 is n * n-dimensional state transition matrix. X k−1 is the n-dimensional state vector at time k-1. B k is the dynamic noise matrix n * n. W k is ndimensional dynamic noise. Z k is the observation vector at time K. C k is k-time measurement matrix n * n. e mdimensional observation noise at time V k is k. And, dynamic noise W and observation noise K are uncorrelated zero mean white noise sequences.
at is to say, for all k and j, EW k � 0, EV k � 0. en, where δ kj is Kronecker symbolic function, and Q k is the variance of dynamic noise. In the Kalman filter, it is required to be a known nonnegative fixed array. R k is the observation noise variance matrix. In the Kalman filter, it is required to be a known nonnegative fixed array. at is to say, there is noise in each measurement component.
Using the minimum variance to deduce the Kalman filter, we can obtain the following.
Forecast estimate X k/k−1 is Filter estimation X k is where K k is the best gain matrix. Measured prediction Z k/k−1 is New information prediction ε k is Prediction error covariance matrix P k/k−1 is Filtering error covariance matrix P k is Optimal gain matrix K k is

Prediction of Uniform Linear Motion with Standard
Kalman. In this paper, the target mathematical model and v are the velocity component of the target in x and y coordinate axes, which are constant parameters. x 0 and y 0 are the displacement of the target at the initial time, and they are also constant parameters: where the state variable X k is 2 Mathematical Problems in Engineering e state transition matrix A and dynamic noise matrix B are Sampling time T � 1 s. W k is the mean value, its value is zero, and the dynamic variance is the dynamic noise of Q. e value of dynamic variance Q is as follows: e observation equation of the system is as follows: where C is the observation matrix, and V k is the mean value, its value is 0, and the dynamic variance is the dynamic noise of R. e value of dynamic variance R is as follows: e initial state X 0 and the initial covariance matrix P 0 are as follows: e standard Kalman filter can achieve good results in predicting the state of nonmaneuvering target. For maneuvering target, its motion is unknown, so the standard Kalman filter cannot accurately describe its motion state. In this paper, the sigma point Kalman filter is used to realize the state estimation of the maneuvering target. Its core idea is unscented transformation, which propagates a finite number of sigma points by using nonlinear state and observation equations. en, weighted sum is used to get the mean and variance of the state probability distribution.

Sigma Point Kalman Filtering
Algorithm. UKF, the sigma point Kalman filter algorithm, is based on UT transformation and adopts the Kalman filter framework. e specific sampling form is deterministic sampling. e number of discrete points (called sigma points) sampled by UKF is small, and the specific number depends on the selected sampling strategy. e most commonly used is 2n + 1 sigma point symmetric sampling.
According to the state estimates x k−1 and P k−1 at time k−1, the realization process of obtaining the state estimates x k−1 and P k−1 at time k is given.

Maneuvering Target Prediction Simulation.
In order to verify the prediction of the movement of obstacles with mobility by the sigma point Kalman filter method, this paper constructs the state equation and observation equation of obstacle movement: x � 0.2x + 0.01x 2 + 8 cos(1.2 * (k + 1)) + sqrt(10) * randn, Take the initial state of x as x � 1, the estimated value of the initial state is x � 0.5, the process state covariance Qis Q � 10, the measurement noise covariance R is R � 0.01, and the initial estimated variance P is P � 1000. e prediction of maneuverable obstacle motion using the sigma point Kalman filter is shown in Figures 5 and 6. From the simulation results, it can be seen that the method has achieved good prediction effect on the mobility movement.

Obstacle Avoidance Operator in Local Planning Based on the Minimal Search Method
For local path planning, fast obstacle avoidance is the primary issue under the condition of safety assurance, so it is necessary to consider how to improve the planning speed. Perform local planning between the abovementioned starting point and ending point. First of all, it is necessary to find the initial population that can be used for fast local planning, so this paper designs an obstacle avoidance operator. Obstacle avoidance operator: by performing obstacle avoidance operations on the starting point and ending point of the path through the obstacle, a new local initial path can be obtained. en, the local path is planned through genetic algorithm and then returned to the originally planned path. If the new obstacle is a triangle ABC, extrapolate the intersection of the global planning path and the obstacle to a safe distance and get the starting and ending points of the local path as P and Q. As shown in Figure 7. e ABC threepoint coordinates can be substituted into PQ line equation, and the point with one end (such as point a) can be determined by symbols, and R point is generated near point a, where r-point coordinate is one of (x a + Δx, y a + Δy), (x a − Δx, y a + Δy), (x a + Δx, y a − Δy), and (x a − Δx, y a − Δy). If neither PR line nor QR line segment intersects with triangle ABC, the r-point coordinate is accepted as a point in the path. Such a problem can be reduced to the solution of the minimum value. e most common algorithm is the steepest descent method. e steepest descent method searches according to the inverse direction of the gradient of the multivariate function. It still needs to find the partial derivative and select a step size. e convergence rate  Mathematical Problems in Engineering of this method is linear and becomes very slow after the first few steps.
In this paper, a minimum search method is proposed to find the minimum extremum of R point. e minimum search method is a simplified model, which can solve the problem of n-dimensional space in practice. In order to illustrate the problem conveniently, take two-dimensional space as an example.
In this paper, the symmetry axis of conic is used to estimate the minimum extremum value of R point. First of all, the problem can be attributed to a function of one variable f(x). We consider the minimal value problem of f(x a − Δx), f(x a ), and f(x a + Δx) on a diagonal. Since these three points can determine a conic curve, the minimum value R point can be estimated by using the known f(x a − Δx), f(x a ), and f(x a + Δx).
Suppose the quadratic function is h(x) � ax 2 + bx + c, and it coincides with f(x) at three known points; according to the undetermined coefficient method, the equations are obtained: For the symmetric axis of h(x) at −b/(2a), the equation system can be solved: Δx.

(34)
Because the axis of symmetry of h(x) is near x a and Δx is small enough, when f( is a concave function and the minimum value is taken From equation (34), the estimation point R of the ultimate minimum value can be obtained. e search process of R point is shown in Figure 7.
e P and Q points are reserved as the starting and ending points, and the initial population is generated near the PRQ so that the local optimal path can be quickly searched.

Local Planning Path Simulation
As mentioned above, the global planning path is shown in Figure 8(a). In the simulation, the obstacles are represented by multilateral type and segmented by triangles. e starting point of the path is (0, 0), and the target point of the path is (20, 0). If new obstacles appear on the planned path, the type of new obstacles needs to be determined through target identification. Here, we mainly discuss the case that the new obstacle is an inanimate body.
Firstly, the obstacle avoidance operator subroutine is run to obtain the initial population of local planning. en, run the improved genetic algorithm to get the local planning path. Finally, the local planning path is combined with the global planning path to generate the planning path with new obstacles. e simulation is programmed in Matlab platform, and genetic operation is realized by genetic algorithm toolbox function of Sheffield University. e initial cross rate was 0.9, the initial variation rate was 0.2, and the genetic algebra was 1000. e simulated annealing process is set to 100 times and the simulated annealing temperature is set to 1000 by using binary number coding.

e New Obstacles
Are Inanimate Objects at Rest. If the above targets are identified, the new obstacles are inanimate objects at rest (mountains, buildings, etc.), as shown in Figure 8(b). e obstacle coordinates are (11.3, −3.1), (14.2, −2), and (12.1, −0.7). e wind speed is v windy � 0.1 m/s. Figure 8 shows the combination of local path planning and global path planning on the basis of global path planning. As shown in Figure 8(a), if new obstacles are found on the planned path, local planning is carried out by the improved genetic algorithm mentioned above. Combining with the original optimal path, the path planning results of the combination of local path planning and global path planning are obtained. Most of the paths maintain the global path planning results. e new obstacle part is local path planning, as shown in Figure 8 −1), and (20, 0). As can be seen from Figure 8(b), the UAV bypasses the obstacle in the downstream direction. Figure 9 shows the error curve of local programming. e genetic algebra converges at about 200. e simulation results show that the convergence speed of local programming is fast.
If there are large static inanimate obstacles on the original global planning path, as shown in Figure 10 A(x a , y a )

R(x q , y q )
A(x a , y a ) From the simulation results, the local path part is not planned along the wind speed direction because if it is planned along the wind speed direction, the UAV will enter the obstacle dense area, so it is difficult to realize the local path planning. Figure 10(b) shows the error curve of local programming.
e genetic algebra converges about 600 times.
e simulation results show that the convergence speed of local programming is fast.   Figure 7(a), after target recognition, new obstacles of moving inanimate body appear.
If the new obstacle moves at a constant speed, as shown by the dotted line in Figure 11(a), the new obstacle is represented as a triangle. Among the new obstacles, v x � −0.2 m/s and v y � 0. e wind speed is v windy � 0.1 m/s. e motion of the obstacle can be estimated by the Kalman filter.
In Figure 11(a), due to the low speed of the obstacle and the small cross-sectional area of the obstacle, the local planning path completes the local motion planning along the short direction of the obstacle detour path and returns to the global planning path after the local path planning. Figure 11(b) shows the error curve of local programming, and the genetic algebra converges around 150. e simulation results show that the local programming converges fast.
If the new obstacles are uniformly accelerated, as shown by the dotted line in Figure 12 It can be seen from the simulation results in Figure 12(a) (the planned path is represented by a thick line) that the local planned path is divided into two parts: bypassing obstacles and returning. Due to the acceleration of the new obstacles, the part around the obstacles and the return part are both curves. e part around the obstacles starts the obstacle avoidance planning in advance to ensure the safety. e return part quickly returns to the global planning path, achieving the unity of local planning and global planning. Figure 12(b) shows the error curve of local planning. e genetic algebra converges around 400. e simulation results show that the convergence speed of local planning is fast.

Conclusions
When UAV flies on the planned path, new obstacles appear on the planned path. In different cases, the local path planning method will be determined according to the UAV obstacle avoidance decision. On the basis of obstacle target recognition, such as fully considering the type characteristics of obstacles, the influence of wind speed, and the influence of yaw angle change rate, the Kalman filter, prediction, and its improved algorithm are used to estimate the target motion parameters [6][7][8]. e local approximate obstacle avoidance path is planned by the obstacle avoidance operator of minimum search method, and the local initial population is generated. On this basis, the improved genetic algorithm is used to plan the local obstacle avoidance path. e starting point and ending point of local planning are all on the global planning path, which achieves the unity of global path planning and local path planning from the method and implementation.
e simulation results show that the method has fast convergence speed and good feasibility and can flexibly deal with the obstacle avoidance and local path planning of various new obstacles.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that they have no conflicts of interest.