Professional Documents
Culture Documents
Ant Colony
Ant Colony
Ant Colony
Journal of Robotics
Volume 2022, Article ID 2168964, 9 pages
https://doi.org/10.1155/2022/2168964
Research Article
Path Planning of Multirotor UAV Based on the Improved Ant
Colony Algorithm
1
Aviation Swarm Technology and Operational Application Laboratory, Air Traffic Control and Navigation College,
Air Force Engineering University, Xi’an, China
2
Shaanxi Province Laboratory of Meta-Synthesis for Electronic and Information System, Xi’an, China
3
Unit 93525 of PLA, Rikaze City, Xizang Province, China
Received 29 November 2021; Revised 18 April 2022; Accepted 23 May 2022; Published 9 June 2022
Copyright © 2022 Duo Qi et al. This is an open access article distributed under the Creative Commons Attribution License, which
permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Path planning is an important part of the unmanned aerial vehicle (UAV) to realize its autonomous capabilities. Aiming at the
shortcomings of the traditional ant colony algorithm-based trajectory planning method, which has slow convergence speed and
easy to fall into the local optimum, a path planning method based on the improved ant colony algorithm is proposed. First, a
dynamic adjusting factor is added into the heuristic function to improve the directivity of path selection and search speed. Then,
the state transition strategy is improved to solve the problem of slow convergence in the initial stage and easy to fall into local
optimum in the later stage. Finally, the path inflection point is smoothly optimized through the cubic B-spline curve. Simulation
results show that the improved ant colony algorithm can quickly converge to the optimal path and well adapt to the flight
requirements of multirotor UAV.
the improved algorithm is improved, and the optimal path is electronic map are shown in Figure 1. The map is numbered
shorter, but the search results are not stable. Wu et al. [13] from left to right and top to bottom. The grid serial number
adopted the method of integrating the current optimal track corresponds to coordinates one by one, and the expression
pheromone and the historical optimal track update, intro- of the relationship between them is shown in equation (1).
duced the pheromone rollback clearing mechanism, and The result obtained is the center point of the grid.
carried out offline calculation, which improved the search
xi � r × mod(i, R) − 0.5,
efficiency, but did not significantly reduce the number of (1)
iterations. Wang et al. [14] used the artificial potential field yi � r ×(R + 0.5 − ceil(i, R)) − 0.5,
method to improve the heuristic function of the ant colony
algorithm, allocated pheromones reasonably when the al- where r is the grid size, i represents the number of the grid, R
gorithm is not running, and improved the volatilization is the number of rows of the grid matrix, mod () is the
coefficient to find the optimal path of the algorithm. remainder operation function, and ceil () is the rounding up
It can be seen that many research studies are all based on operation function.
the traditional ant colony algorithm and have achieved In order to prevent the collision between UAV and
certain results. However, the traditional ant colony algo- obstacles, when the obstacle is less than one grid, it is filled
rithm has the shortcomings of slow convergence speed and into a complete grid. At this time, the UAV is treated as a
easy to fall into local optimum, which is not applicable to the particle.
real flight environment. Aiming at the defects of the basic ant The flight rules of UAV are as follows: it can only appear
colony algorithm, an improved ant colony algorithm is in the white grid and cannot pass through the black grid, but
proposed in this study to make it suitable for path planning it can pass through the four corners of the black grid; it is
of multirotor UAV. First, a dynamic adjusting factor is forbidden to repeat the same grid; and in unit time, it can
added into the heuristic function to improve the directivity only move between two adjacent grids. We use Euclidean
of path selection and search speed. Then, the state transition distance to measure the length of the flight path. For ex-
strategy is improved to solve the problem of slow conver- ample, if moving up, down, left, and right, the path length is
gence in the initial stage and easy to fall into local optimum 1 unit and if moving to the four corners of the grid, the path
in the later stage. At the same time, combined with the length is 1.41 units.
existing pheromone volatilization factor update strategy, the
overall performance of the algorithm is improved. Finally, 3. Basic Ant Colony Algorithm
the path inflection point is smoothly optimized through the
cubic B-spline curve, so that the path planning of multirotor Ant colony algorithms are inspired by the foraging behavior
UAV is more in line with the flight reality. of ant populations, in which each ant in the colony leaves
The study is organized as follows: Section 2 describes the pheromones in its movement path to communicate infor-
environment in which the UAV performs its mission. mation to the colony. The shorter the moving path is, the
Section 3 introduces the basic principle and deficiency of the higher the pheromone concentration is, and the probability
ant colony algorithm. Section 4 improves the shortcomings that the path is selected by ants, which forms the positive
of the ant colony algorithm and proposes the UAV track feedback mechanism for ants to find the shortest path. The
planning method and smoothing method. In Section 5, the basic principle of the ant colony algorithm is as follows.
proposed algorithm is simulated and analyzed, which ver- Ants select paths according to pheromone concentration
ifies the effectiveness of the proposed algorithm. Finally, the and heuristic function, and the probability of ant k moving
full text work is summarized and the next research direction from grid i to grid j can be expressed as
is pointed out.
⎪
⎧
⎪
⎪
⎨⎛⎝τ α (t)ηβ (t)/ τ α (t)ηβ (t)⎞
⎠, s ∈ Ak ,
2. Environmental Model Pkij � ⎪ ij ij
s∈A
is is
(2)
⎪
⎪ k
⎩
In order to accurately describe the path planning process of 0, s ∉ Ak ,
UAV, its two-dimensional environment map [15, 16] needs
to be modeled. The conventional environment modeling where α is the pheromone heuristic factor and β is the
methods include the grid method [17, 18], geometric in- distance expectation function factor, which affect the im-
formation method, and view method. Considering that the portance of pheromone and distance heuristic function,
grid method has the advantages of simple drawing, clear data respectively, Ak indicates the next destinations ants can
structure, and easy implementation, we select the grid reach, τ ij (t) is the pheromone concentration on the moving
method to complete the UAV flight environment modeling. path at time t, and ηij (t) represents the distance heuristic
The grid method decomposes the plane map into a series of function. Here,
grids to facilitate the analysis of map information. The grid
1
map is composed of 0 and 1 matrices with binary values. In ηij (t) � ,
the matrix, 0 stands for free grid, in which the UAV can enter dij
and exit freely, represented by white grid, and 1 stands for ����������������� (3)
obstacle grid, in which the UAV needs to move around, and 2
dij � xi − xj + yi − y2j .
represented by black grid. The grid environment and the
Journal of Robotics 3
10
0 0 0 0 0 0 0 0 0 0
9
0 0 1 1 0 0 0 0 0 0
8
0 0 1 1 0 0 0 0 0 0
7
6 0 0 0 0 0 0 1 1 1 0
5 0 0 0 0 0 0 1 1 1 0
4 0 1 1 1 0 0 1 1 1 0
3
0 1 1 1 0 0 1 1 1 0
2
0 1 1 1 0 0 0 0 0 0
1
0 1 1 1 0 0 0 0 0 0
0
0 2 4 6 8 10
0 0 0 0 0 0 0 0 0 0
Each ant will leave a certain amount of pheromone when where djE is the Euclidean distance between j and the target
moving. Therefore, when the algorithm iterates continu- point, iter is the current number of iterations, and itermax is
ously, the pheromone content in the path gradually accu- maximum number of iterations.
mulates and volatilizes at the same time. When all ants in the
population complete each round of iteration, the pheromone
content on the path will be updated according to the fol- 4.2. The Improved State Transition Rule. In the basic ant
lowing rules: colony algorithm, ants mainly rely on the probability
τ ij (t + 1) � (1 − ρ)τ ij (t) + Δτ ij (t), function to select the next node. However, in the early stage
of the algorithm, the difference between the pheromone
m
concentrations of the path is very small, which cannot ef-
τ ij (t) � Δτ kij (t),
k�1 (4) fectively guide the ant to choose the path. Based on the initial
transition probability, the convergence speed of the algo-
Q/Lk , rithm is guaranteed by introducing pseudorandom rules.
Δτ kij �
0, The ant will select the next node j according to the following
formula.
where ρ is the pheromone volatilization coefficient,
Δτ ij represents the sum of pheromones released on the path ⎪
⎧ α
⎨ max τ is ∗ ηjE β, q < q0 ,
between the two nodes, Δτ kij denotes the pheromone in- Pkij (t) �⎪ k (6)
crement, Lk is the path length of ant k, and Q is the ⎩P , q ≥ q0 ,
ij
pheromone enhancement coefficient.
where q represents a random number between (0, 1), and q0
is a design parameter, which is usually determined by
4. The Improved Ant Colony Algorithm previous experience and repeated experiments. Its value
4.1. The Improved Heuristic Function. When using the basic determines the path selection mode. If the value of q0 is too
algorithm to plan the path, the ant colony has not left large, the path shift is more likely to be a deterministic
pheromone in the initial stage. At this time, the pheromone pattern, and the convergence speed is faster, but the global
on the path is scarce. The ant cannot select the next grid search capability is reduced. On the contrary, if the value of
according to the pheromone concentration. The search has q0 is very small, the path shift is more inclined to the roulette
no purpose and cannot quickly search the feasible path. On mode, which not only increases the randomness of the global
the basis of the heuristic function in [19], we add a dynamic search but also reduces the convergence speed. Therefore,
regulation factor ξ. The new expressions of heuristic func- setting a reasonable value of q0 has an important influence
tion and ξ are shown as on the convergence process. In order to better improve the
problem of slow convergence in the initial stage and easy to
1 fall into local optimization in the later stage, we designed it as
nij � 2 ∗ ξ,
dij + djE a dynamical parameter adjusted with the number of itera-
tions. The details expression is as follows:
(5)
⎨ exp −5 ∗ iter/itermax ,
⎪
⎧ iter ≠ itermax ,
−1
ξ �⎪ 1
⎩ 1/iter q0 � 0.25 ∗ exp− . (7)
max , iter � itermax , iter
4 Journal of Robotics
0.9 3
0.8 2.5
0.7 2
0.6 1.5
0.5 1
0.4 0.5
0.3 0
0.2 -0.5
0 20 40 60 80 100 -4 -3 -2 -1 0 1 2 3 4
4.3. Pheromone Volatilization Factor Update Strategy. The basis function in cubic B-spline curve equation is
Due to the particularity of path planning, different volatil- m
1 k−i ⎝ ⎠(t + k − m − j)k .
ization coefficients are required in different stages: if ρ is too Fi,k (t) � (−1)m ⎛ ⎞ (10)
large, ants cannot complete path search according to the k! m�0 k+1
pheromone information, resulting in slow convergence
speed; if ρ is too small, the pheromone will accumulate Furthermore, the mathematical expression of the basis
excessively, easily make the path search fall into local op- function of cubic B-spline curve is
timization. Referring to the research ideas of [19], the ⎪
⎧ 1
adaptive updating strategies of pheromone volatile factors
⎪
⎪
⎪ F0,3 (t) � (1 − t)3 ,
⎪
⎪ 6
are designed as follows: ⎪
⎪
⎪
⎪
⎪
⎪
itermax 1 ⎪
⎪ 1 3 2
ρ(t + 1) � ∗ . (8) ⎪
⎪ F1,3 (t) � 3t − 6t + 4,
itermax + iter exp(1 − ρ(t)) ⎪
⎪ 6
⎨
⎪ (11)
In order to search as many paths as possible, the ⎪
⎪
⎪
⎪ 1
pheromone content should be controlled at a low level at the ⎪
⎪
⎪ F2,3 (t) � −3t3 + 3t2 − 3t + 1,
initial stage of algorithm optimization. Therefore, the value ⎪
⎪ 6
⎪
⎪
of the initial volatile factor ρ should not be too small. At this ⎪
⎪
⎪
⎪
time, pheromone concentration has little interference in the ⎪
⎪ 1
⎩ F3,3 (t) � t3 .
process of path exploration, and ants can search more 6
possible paths. With algorithm iteration step by step, the The cubic B-spline curve equation can be converted by
value of ρ gradually decreases, and the negative feedback bringing the basis function into the general equation:
effect is weakened. The pheromone content on the moving
path is increased, and the guiding effect of pheromone P(t) � P0 ∗ F0,3 (t) + P1 ∗ F1,3 (t) + P2 ∗ F2,3 (t) + P3 ∗ F3,3 (t).
concentration on ant colony is enhanced. When the number (12)
of iterations increases to a certain number, ant colony will
converge to the path with a higher pheromone content. Based on the above cubic B-spline curve equation, the
Therefore, the improved algorithm can expand the searching flight path can be smoothed. Figure 3 shows the simulation
range of ant colony and improve the convergence speed. The of local path smoothing results. The red line is the path to be
changing curve of ρ is shown in Figure 2 (initial ρ � 0.8). smoothed, and the blue dotted line is the smoothing result.
The goal of this strategy is to replace the broken line with a
curve near the inflection point, so that the obtained path is
4.4. Path Smoothing Method. The optimal path generated by smoother and more in line with the reality of UAV flight.
the improved ant colony algorithm is not smooth enough The flow of the improved ant colony algorithm is shown
and has sharp inflection point. Therefore, cubic B-spline in Figure 4.
smoothing is introduced to optimize the path at the in-
flection point. The total equation of the B-spline curve is
[20, 21]
5. Simulation Analysis
n The simulation hardware environment is the Huawei
P(t) � Pi Fi,k (t). (9) MateBook Pro laptop equipped with Intel Core I7-8565U
i�0 processor. Software environment is the Win10 operating
Journal of Robotics 5
Start
Environmental model
system, installed with MATLAB 2017B simulation test en- achievable minimum value of both functions is 0. The two
vironment. BACA, GA (genetic algorithm), and IACA al- function expressions are as follows, respectively:
gorithms are implemented in the simulation tests. The basic
n
parameter settings of three algorithms are given in Tables 1
and 2. f1 (x) � x2i ,
i�1
n
(13)
f2 (x) � xi sin xi + 0.1xi .
5.1. Performance Test. In order to verify the optimization i�1
ability of the improved ant colony algorithm in this study,
first, the typical single-mode test function Sphere and The basic ant colony algorithm (BACA) and the im-
multimode test function Alpine are used for the optimiza- proved ant colony algorithm (IACA) are independently run
tion comparison test. The dimension value of the two for 20 times on each test function, and the common pa-
functions is 30, the value range of Sphere is [−100, 100], the rameters of the algorithm remained consistent. The results
value range of Alpine is [−10, 10], and the theoretically are given in Table 3.
6 Journal of Robotics
18
50
16
14
40
y 10 30
6 20
4
10
2
0 0
0 5 10 15 20 0 20 40 60 80 100
x
The number of iterations
(a) (b)
Figure 5: Path planning of BACA. (a) Optimal path. (b) Convergence curve.
According to the test results in the above table, the IACA study are used to plan the flight path of UAV, respectively,
algorithm proposed in this study has a good optimization with the maximum iteration times of 100. Path planning
effect. The theoretical global optimal value can be obtained diagram and iterative convergence curve are shown in
by searching for Sphere function and Alpine function. Figures 5–7. The experimental results are given in Table 4.
It can be seen from the above table that the shortest path
length obtained by applying the IACA algorithm proposed
5.2. Comparison Test of Path Planning. In order to verify the
in this study is 15.4% shorter than that obtained by applying
effectiveness of IACA in UAV path planning, BACA and GA
the BACA algorithm, and the running time is reduced by
(genetic algorithm) are used as a comparison to conduct
14.1%. Compared with GA, IACA is 22.8% shorter, and the
simulation comparison tests in 20 × 20 and 30 × 30 envi-
running time is reduced by 14.6%.
ronment maps.
5.2.1. 20 × 20 Simulation Environment. The simulation test is 5.2.2. 30 × 30 Simulation Environment. When the flight
first carried out in a 20 × 20 grid map, with the starting point environment is large and obstacles are densely distributed,
at the upper left corner of the map and the target point at the the 100 iteration times of 20 × 20 map cannot be effectively
lower right corner. BACA, GA, and IACA proposed in this converged to the shortest path. We increase the maximum
Journal of Robotics 7
18
50
16
14
40
y 10 30
8
20
6
4
10
2
0 0
0 2 4 6 8 10 12 14 16 18 20 0 10 20 30 40 50 60 70 80 90 100
x The number of iterations
(a) (b)
Figure 6: Path planning of GA. (a) Optimal path. (b) Convergence curve.
48 40
16 35
14
Minimum path length
30
12
25
y 10
20
8
15
6
10
4
2 5
0 0
0 5 10 15 20 0 20 40 60 80 100
x The number of iterations
(a) (b)
Figure 7: Path planning of IACA. (a) Optimal path. (b) Convergence curve.
80
25
70
Minimum path length
20 60
50
y 15
40
10 30
20
5
10
0 0
0 5 10 15 20 25 30 0 50 100 150 200 250 300
x The number of iterations
(a) (b)
Figure 8: Path planning of BACA. (a) Optimal path. (b) Convergence curve.
8 Journal of Robotics
25 120
100
20
10
40
5
20
0 0
0 5 10 15 20 25 30 0 20 40 60 80 100 120 140 160 180 200
x
The number of iterations
(a) (b)
Figure 9: Path planning of GA. (a) Optimal path. (b) Convergence curve.
90
25
80
70
Minimum path length
20
60
y 15 50
40
10
30
20
5
10
0 0
0 5 10 15 20 25 30 0 50 100 150 200 250 300
x The number of iterations
(a) (b)
Figure 10: Path planning of IACA. (a) Optimal path. (b) Convergence curve.
iteration times to 300. Path planning diagram and iterative Through the comparison of MATLAB simulation
convergence curve are shown in Figures 8–10. As given in experiments, it can be seen that the improved
Table 5, the shortest path obtained by IACA is 14.2% algorithm has more advantages than the basic algorithm
shorter than that obtained by BACA, and the system in the optimization effect and reflects the effectiveness
running time is reduced by 8.7%, respectively. Compared of the algorithm in the operation time and the shortest
with GA, though the system running time is added by 6.4%, path.
the shortest path obtained by IACA is 13.8% shorter than In practical applications, UAVs usually perform tasks in
that obtained by GA. a swarm. Therefore, how to complete the coordinated tra-
jectory planning of UAV swarms on the basis of this study
6. Conclusion will become the focus of our next research.