CN116795098A - Spherical amphibious robot path planning method based on improved sparrow search algorithm - Google Patents

Spherical amphibious robot path planning method based on improved sparrow search algorithm Download PDF

Info

Publication number
CN116795098A
CN116795098A CN202310425448.7A CN202310425448A CN116795098A CN 116795098 A CN116795098 A CN 116795098A CN 202310425448 A CN202310425448 A CN 202310425448A CN 116795098 A CN116795098 A CN 116795098A
Authority
CN
China
Prior art keywords
sparrow
fitness
value
formula
optimal solution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310425448.7A
Other languages
Chinese (zh)
Inventor
郭健
郭书祥
李琛琦
付强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin University of Technology
Original Assignee
Tianjin University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin University of Technology filed Critical Tianjin University of Technology
Priority to CN202310425448.7A priority Critical patent/CN116795098A/en
Publication of CN116795098A publication Critical patent/CN116795098A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a spherical amphibious robot path planning method based on an improved sparrow search algorithm, which is characterized in that the sum of the path lengths of a robot is modeled as a corresponding fitness function based on the sparrow search algorithm, the reciprocal of the fitness function is modeled as a fitness value function, the sparrow is divided into discoverers, followers and alerters, nonlinear sine factors are introduced in the position update of the discoverers, and the diversity of the search algorithm is increased; introducing a Levy flight strategy in the follower position updating stage, improving the global searching capability and avoiding the algorithm from sinking into a local optimal solution; and finally, carrying out local search on the global optimal solution by introducing a local search strategy, and improving the adaptability of the global optimal solution. And through continuous iterative optimization, the final global optimal solution is the optimal path. The algorithm has the characteristics of high convergence speed and high optimization capacity, solves the problem that the traditional algorithm is easy to fall into local optimization, and can provide a shorter path for the spherical amphibious robot.

Description

Spherical amphibious robot path planning method based on improved sparrow search algorithm
(one) technical field:
the invention belongs to the related technical field of path planning of spherical amphibious robots, and particularly relates to a path planning method of spherical amphibious robots based on an improved sparrow search algorithm.
(II) background art:
the bionic amphibious robot based on the biological system thought shows better characteristics in adapting to underwater, land and air environments, and is widely applied to aspects of water patrol, military investigation, environment monitoring, resource development and the like. The problem of path planning of the spherical amphibious robot is a popular field in the research direction at present and is also a basic problem. In the path planning problem, the robot is required to optimize an optimal or near optimal path from a starting point to a target point in a given environment according to certain criteria (such as shortest time, lowest power consumption and shortest distance).
At present, the path planning of the robot is quite studied, such as a typical A-algorithm, a genetic algorithm, a manual potential energy method and an ant colony algorithm, and an intelligent optimization algorithm of a new gray wolf algorithm in recent years, but the intelligent optimization algorithm has respective defects, such as early convergence of the genetic algorithm, irregular and irregular problems in encoding, and the ant colony algorithm has the problems of large calculation amount and long time.
The sparrow search algorithm is taken as a novel group intelligent optimization algorithm, has very mature application in solving the optimization problem, and is mainly an algorithm formed by inspiring the foraging behavior and the anti-predation behavior of sparrows, and the bionics principle is as follows: the sparrow foraging process can be abstracted into a finder-follower model, and a reconnaissance early warning mechanism is added; the discoverer has high self-adaptability and wide search range, and guides the population to search and forge; the follower follows the finder to feed in order to obtain a better fitness. Meanwhile, to increase the rate of self predation, some followers monitor discoverers to facilitate food competition or foraging therearound. And when the whole population is threatened or perceived to be dangerous by predators, the anti-predation action is immediately performed. The algorithm has the characteristics of simple parameters and higher search speed, and has stronger advantages in the aspects of path planning and image processing.
When the conventional sparrow algorithm is applied to the path planning problem of a mobile robot, the problems that the algorithm stagnates and is trapped in a local optimal solution easily exist, and the problem is caused by the fact that the population diversity is reduced and the sub-optimal solution is easily trapped in the later period of algorithm searching.
Therefore, the method is easy to solve the problems of slow convergence speed, algorithm operation stagnation and local optimal solution in the research field of path planning of the spherical amphibious robot applied to the existing sparrow search algorithm. An improved sparrow search algorithm is designed, so that the probability of sinking into local optimum is reduced, the optimization capacity is higher than that of other algorithms, and a shorter and more stable path is found in the search process, so that the problem to be solved is needed.
(III) summary of the invention:
the invention aims to provide a spherical amphibious robot path planning method based on an improved sparrow search algorithm, which can solve the problems that the traditional sparrow search algorithm is poor in path planning and easy to fall into a local optimal solution, is a simple and easy algorithm which is easy to implement, and can effectively improve the search performance and the development performance.
The technical scheme of the invention is as follows: a path planning method of a spherical amphibious robot based on an improved sparrow search algorithm is characterized by comprising the following steps:
(1) Acquiring global environment information through a laser radar configured by the spherical amphibious robot to obtain an environment image signal capable of describing operation environment information;
(2) Creating a working environment model of the spherical amphibious robot based on a grid method according to the environment image signals acquired in the step (1), wherein each grid uses N ij Representing, each grid information represents as shown in formula (1):
when N is ij When=0, the current grid position is free space without barrier; when N is ij When the method is=1, the current grid is indicated to have an obstacle, and a starting point and an end point of the robot are set under an environment model of the robot so as to realize path planning in the process of reaching the end point from the starting point on a map;
(3) The spherical amphibious robot exists as particles in a two-dimensional environment, and the motion searching direction is eight directions, namely: upper, lower, left, right, upper left, lower left, upper right, lower right;
(4) Setting the sparrow population scale N and the maximum iteration number T max And a safety threshold, and the number Pd of discoverers is defined to be 10% -20% of the total number of the sparrow population scale N, and the number Sd of alerters is defined to be 10% -20% of the total number of the sparrow population scale N;
(5) Defining a fitness function, and establishing the fitness function as shown in a formula (2):
in the formula (2), n is the number of nodes through which sparrows pass, and Length is the distance from the i+1 grid node to the i grid node of the sparrows;
taking the total length of the sparrow search path as a fitness function value, evaluating the adaptability of each sparrow individual, and if the calculated fitness function value is smaller, indicating that the sparrow search path is shorter, which means that the path planning effect is better;
the step (5) specifically refers to: calculating the fitness function value of each sparrow by using a formula (2), and then calculating the position and the fitness value of each sparrow in the d-dimensional search space according to formulas (3) and (4);
in the d-dimensional search space, assuming that N sparrows exist, the position of the ith sparrow in the d-dimensional space is shown in formula (3):
X i =[X i1 ,…X ij ,…X id ] (3)
in the formula (3), X ij Represents the position of the i-th sparrow in the j-th dimension, and i=1, 2,..n, j=1, 2,., d;
calculating the fitness function value of each sparrow according to the formula (2) and taking the reciprocal to obtain the fitness value of the ith sparrow, wherein the fitness value of the ith sparrow is shown as the formula (4):
the fitness value represents the performance degree of each sparrow individual under the fitness function, and the smaller the fitness function value is, the larger the fitness value is, the shorter the representative path length is, the more excellent the path is, the higher the fitness is, and the sparrow is optimal at the moment; therefore, the fitness function values of all the sparrows are compared, the search path of the sparrow with the smallest fitness function value is selected as the path with the optimal fitness, and the current best fitness sparrow f is recorded b And its position X b Selecting the search path with the largest fitness function value as the path with the worst fitness, and recording the current sparrow f with the worst fitness ω And its position X ω
(6) Sorting the fitness function values of each sparrow obtained in the step (5), selecting Pd sparrows with smaller fitness function values as discoverers, wherein the number of discoverers accounts for 10% -20% of the total number of the sparrow population scale N, using other sparrows as followers, updating the positions of the discoverers according to a discoverer position updating formula, and updating the positions of the followers according to a following position updating formula;
the finder position updating formula in the step (6) refers to an improved formula of guiding the nonlinear sine factor as shown in a formula (5) and a formula (6); the nonlinear sine learning factor is introduced, so that the discoverer in the basic sparrow algorithm can be effectively improved, global exploration is facilitated along with the progress of iteration times, the local development capability can be improved, and the position of the discoverer is updated;
ω=ω min +(ω maxmin )·sin(tπ/T max ) (5)
wherein omega is min Omega is the minimum learning factor max T is the maximum learning factor max For the maximum number of iterations, t is the current iteration, j=1, 2,..d, i represents the i-th sparrow,is the position of the ith sparrow in the jt th dimension, wherein +.>Represents the global optimum position, R 2 For alarm value, ST is alarm threshold value, r 1 Is a random number, r 2 Is a random number;
when R is 2 When ST is less than that of the sparrow, the sparrow is not dangerous, namely, no barrier grid exists, and the discoverer starts searching; when R is 2 And if not less than ST, indicating that sparrows are found dangerous, namely, an obstacle grid is arranged, and all sparrows are transferred to a safe area.
Omega in said formula (5) min The value range of (2) is [0,1]],ω max The value range of (2) is [0,1]]In this embodiment, ω is taken out separately min =0.4,ω max =1;
Alarm value R in said equation (6) 2 The value range of (2) is [0,1]]The value range of the alarm threshold ST is 0.5,1.0]Random number r 1 The value range of (2) is 0,2 pi]Random number r 2 The value range of (2) is [0,2]]。
The following position updating formula in the step (6) means that the following position updating formula after the Levy flight strategy is introduced is shown as a formula (7), so that the risk that the algorithm is trapped into a local optimal solution and the local exploration can be fully executed;
in the method, in the process of the invention,representing the optimal position occupied by the current finder, Q is a random number subject to normal distribution,/->Representation ofThe global worst position, d is vector dimension, n refers to the number of the adding persons, i refers to the ith sparrow;
when i > n/2, it means that the top half of the followers have obtained food, but the second half of the followers have not obtained food, indicating that the energy value of the followers who have not obtained food is low, the fitness is poor, and more food cannot be continuously sought at the current position, so that they need to fly to other places to search for more energy and increase the fitness value; by doing so, the diversity of searches can be increased, and the situation that followers are excessively gathered at certain positions is avoided, so that the global searching capability of the algorithm is improved.
The formula of L ivy (d) in the formula (7) is shown as formula (8):
in the formula (8), r 3 、r 4 And xi and sigma are random numbers.
The value ranges of the random number r3 and the random number r4 in the formula (8) are [0,1] and the value range of the random number ζ is [0,2], and the random number sigma is a normal distribution random number, and the calculation mode is shown in the formula (9):
wherein Γ (d) = (d-1) +.! And xi is a random number of [0,2 ].
(7) Selecting the number Sd of the alerter from the sparrow population scale N, wherein the total number of the sparrow population scale N is 10% -20%, and updating the position of the alerter according to an alerter position updating formula;
in the step (7), the updating mode of the position of the alerter is shown as a formula (10):
in the method, in the process of the invention,representing the global optimum position, beta being the step control parameter, conforming to a normal distribution with a mean value of 0, a variance of 1, k being [ -1,1]Random numbers of (a); f (f) i Is the fitness value of the current sparrow, f g And f ω Respectively the current global optimal and worst fitness values, epsilon is the minimum constant, and zero division errors are avoided;
when f i >f g When the sparrow is at the edge of the population, the sparrow is extremely easy to attack by natural enemies; f (f) i =f g It has been shown that sparrows in the middle of the population are aware of the risk of attack by natural enemies, and need to be close to other sparrows.
(8) After the step (7) is completed, calculating the fitness value of each sparrow, updating the optimal position and the global optimal solution of each sparrow, judging whether iteration needs to be continued or not according to the condition of iteration stopping, and repeating the steps (6) - (7) until the maximum iteration times are reached if iteration needs to be continued; if iteration is not needed to be continued, directly outputting the position and the fitness value of the global optimal solution;
in the step (8), calculating the fitness value of each sparrow and updating the optimal position and the global optimal solution of each sparrow individual specifically means that: the fitness value of each sparrow is calculated using the following formula:
wherein X is ij Represents the position of the i-th sparrow in the j-th dimension, and i=1, 2,..n, j=1, 2,., d; the fitness value of the ith sparrow is F xi
Sorting sparrows according to the calculated fitness value, finding out the sparrow with the largest fitness value, and marking the sparrow as the optimal sparrow; and comparing the fitness value of the individual optimal position of each sparrow with the current position, and if the current position is more optimal, updating the individual optimal position of each sparrow. (Note: each sparrow has an individual optimal position, which is the best position the sparrow finds during the search, when the sparrow finds a new position during the search, it is necessary to compare the fitness value of the new position with the fitness value of the individual optimal position that has been recorded, and if the fitness value of the new position is more excellent, the individual optimal position is updated to the new position.) the fitness value of the optimal sparrow is compared with the fitness value of the previous global optimal solution, and if the fitness value of the optimal sparrow is more excellent, the position of the global optimal solution is updated. At this time, the fitness value of the optimal sparrow is the global optimal solution. (Note: when the optimal sparrow finds a new solution, it is necessary to compare the fitness value of this new solution with the fitness value of the current globally optimal solution. If the new solution of the optimal sparrow is more excellent, the location of the globally optimal solution is updated to the location of the new solution of the optimal sparrow). Meanwhile, calculating the average fitness value of the sparrow population, namely: after the steps are carried out, the individual optimal position and the global optimal solution position of each sparrow are updated, and the next iteration can be carried out.
The condition of iteration stop in the step (8) refers to judging whether the operation reaches the maximum number of times T of selection max By setting a counter, each time the iteration counter is incremented by 1, when the counter reaches T max And stopping iteration and outputting the optimal fitness value and the position of the sparrow, wherein the maximum fitness value is the fitness value of the obtained global optimal solution.
(9) After the step (8) is completed, carrying out local search on the obtained global optimal solution to improve the adaptability value of the global optimal solution, so that the result is more accurate; the global optimal solution refers to a path with the smallest fitness function value among all paths found in the searching process, namely a path with the shortest path length; thus, finding the globally optimal solution represents finding the shortest path.
The specific content of the local search by using the global optimal solution in the step (9) is composed of the following steps:
(9-1) randomly generating new solutions x_ { new } around the globally optimal solution according to the globally optimal solution x_ { global_best }, wherein the number of the generated random solutions ranges from 10 to 50;
(9-2) calculating the fitness value of x_ { new } using formula (4), denoted as f_ { new };
(9-3) comparing the fitness value f_ { new } with the fitness value corresponding to the current global optimal solution outputted in the current step (8), if f_ { new } is larger, setting the corresponding solution x_ { new } as a new global optimal solution, and updating the fitness value f_ { new } to f_ { global_best };
(9_4) repeating the above steps until no more optimal solution can be found, wherein the solution at this time is the global optimal solution, and finding the global optimal solution represents finding the shortest path.
The working principle of the invention is as follows: a path planning method of a spherical amphibious robot based on an improved sparrow searching algorithm is characterized in that the spherical amphibious robot carries out path searching based on the sparrow searching algorithm in a mode of simulating sparrow foraging, namely, a sparrow population starts iterative searching from a starting point to a target point and finishes searching, wherein each sparrow passing position represents a possible track, during foraging, the sparrow is divided into discoverers and followers, the discoverers are responsible for searching food in the population and providing foraging areas and directions for the whole sparrow population, and the followers are used for acquiring food by utilizing the discoverers; the fitness of the sparrow individuals is the objective function value, the optimal position of the sparrow population is obtained through updating and comparing the fitness of discoverers and followers in the sparrow population, and the optimal solution returned after continuous iterative optimization is the optimal path.
The technical scheme comprises 9 steps, wherein step 1 mainly completes data acquisition; step 2 and 3 are mainly to create an environmental model based on a grid method and to consider the robot to ignore the length thereof as the existence of particles for movement; step 4, initializing sparrow searching algorithm parameters; step 5, defining a fitness function and a fitness value function, and step 6, defining the position of sparrows in space and calculating fitness values, separating discoverers and followers according to the sequence of the fitness values, and improving the position update formulas of the discoverers and the followers by adopting two methods respectively; step 7, introducing an alarm position updating formula; step 8, providing iteration conditions to judge whether iteration is finished, if not, repeating the steps 6-7 all the time, continuously updating the position and the fitness value of the sparrow population, and if so, outputting the position and the fitness value of the global optimal solution; and 9, providing a local search strategy to perform local search on the output global optimal solution again to obtain a new global optimal solution (shortest path), so that the result is more accurate, and the global optimal solution obtained after the local search strategy is the optimal path from the starting point to the end point.
The invention has the advantages that: (1) The efficiency of the traditional sparrow search algorithm is improved, the iterative speed of the algorithm is increased, and a shorter path can be provided for the spherical amphibious robot; (2) The nonlinear sine factors are introduced in the finder stage, so that the algorithm is helpful for global exploration in the early search stage, the local development capacity is promoted in the later search stage, the diversity of the search algorithm is increased, the search process is more comprehensive and sufficient, and the search precision and efficiency are further improved; (3) The Levy flight strategy is introduced in the follower stage, so that the global searching capability is improved, the searching process is more comprehensive and sufficient, and meanwhile, the algorithm can be prevented from falling into a local optimal solution; (4) Introducing a local search strategy to perform local search on the global optimal solution so as to improve the adaptability value of the global optimal solution; (5) The algorithm has the characteristics of high convergence speed and high optimization capacity, and solves the problems that the traditional algorithm is easy to fall into local optimization and path planning is poor.
(IV) description of the drawings:
fig. 1 is an algorithm flow diagram of a path planning method of a spherical amphibious robot based on an improved sparrow search algorithm.
Fig. 2 (a) and fig. 2 (b) are graphs comparing the path optimization results of the conventional sparrow search algorithm and the improved sparrow search algorithm according to the embodiment of the present invention.
Fig. 3 is a graph showing a change trend of a convergence curve of a conventional sparrow search algorithm and a modified sparrow search algorithm according to an embodiment of the present invention.
(V) the specific embodiment:
examples:
the technical scheme of the invention is further described in detail below with reference to the accompanying drawings:
the invention relates to an algorithm flow chart of a path planning method of a spherical amphibious robot based on an improved sparrow search algorithm, which is shown in figure 1. The method is characterized by comprising the following steps of:
(1) The global environment information is acquired through the laser radar configured by the spherical amphibious robot, so that an environment image signal capable of describing the operation environment information is obtained.
(2) Creating a working environment model of the spherical amphibious robot based on a grid method according to the environment image signals acquired in the step (1), wherein each grid uses N ij Representing, each grid information is represented as:
wherein N is ij When the value of the grid is=0, the current grid is expressed as a free space without an obstacle; n (N) ij When the number is=1, the current grid is indicated to be provided with an obstacle; setting the starting points [1, 1] of the robot in the environment model of the robot]And end point [19, 19]To achieve path planning in the process of reaching the end point from the start point on the map.
(3) The spherical amphibious robot exists as particles in a two-dimensional environment, and the motion searching direction is eight directions, namely: the step length is 1 in the up, down, left, right, up left, down left, up right and down right directions, and the step length is 1 in the up, down left, up right and down right directions
(4) Setting the sparrow population scale N and the maximum iteration number T max And a safety threshold, and defines a number Pd of discoverers in a range of 10% -20% of the total number N of the sparrow population (in this embodiment, the number Pd of discoverers is 20% of the total number N of the sparrow population, and a number Sd of alerters in a range of 10% -20% of the total number N of the sparrow population (in this embodiment)In the example, the number Sd of the alerter accounts for 20% of the sparrow population scale N;
(5) Defining a fitness function, and establishing the fitness function as shown in a formula (2):
in the formula (2), n is the number of nodes through which sparrows pass, and Length is the distance from the i+1 grid node to the i grid node of the sparrows;
in the d-dimensional search space, assuming that N sparrows exist, the position of the ith sparrow in the d-dimensional space is shown in formula (3):
X i =[X i1 ,…X ij ,…X id ] (3)
in the formula (3), X ij Represents the position of the i-th sparrow in the j-th dimension, and i=1, 2,..n, j=1, 2,., d;
calculating the fitness function value of each sparrow according to the formula (2) and taking the reciprocal to obtain the fitness value of the ith sparrow, wherein the fitness value of the ith sparrow is shown as the formula (4):
the fitness value represents the performance degree of each sparrow individual under the fitness function, and the smaller the fitness function value is, the larger the fitness value is, the shorter the representative path length is, the more excellent the path is, the higher the fitness is, and the sparrow is optimal at the moment; therefore, the fitness function values of all the sparrows are compared, the search path of the sparrow with the smallest fitness function value is selected as the path with the optimal fitness, and the current best fitness sparrow f is recorded b And its position X b Selecting the search path with the largest fitness function value as the path with the worst fitness, and recording the current sparrow f with the worst fitness ω And its position X ω
The fitness function value is more visual and easy to understand, so that the fitness function value is selected and compared, the total length of the sparrow search path is used as the fitness function, the fitness value is defined as the reciprocal of the total length of the sparrow search path, the fitness is an index for evaluating the quality of the search path, and in the embodiment, the fitness and the fitness value are in positive correlation. The fitness value is calculated by taking the reciprocal of the fitness function value, as in formula (4), and the purpose of this is to convert the path with smaller fitness function value into the path with larger fitness value, so as to better optimize and select the sparrow path planning. The fitness function value is calculated according to the search path of each sparrow, that is, the total length obtained by adding the search path lengths of each sparrow is calculated as in the formula (2). The smaller the fitness function value is, the shorter the path length is, the larger the fitness value is, the more excellent the path is, the higher the fitness is, and the sparrow is optimal, namely: and taking the total length of the sparrow search path as a fitness function value, evaluating the adaptability of each sparrow individual, and if the calculated fitness function value is smaller, indicating that the sparrow search path is shorter, which means that the path planning effect is better.
(6) Calculating and sorting fitness values of each sparrow according to the formula of the step (5), selecting Pd sparrows with smaller fitness function values as discoverers, wherein the number of discoverers accounts for 20% of the total number N of the sparrow population scale (the number of discoverers accounts for 10% -20% of the range of the sparrow population scale, 20% of the range is adopted in the embodiment), taking other sparrows as followers, carrying out position update on the discoverers according to the position update formula of the discoverers, and carrying out position update on the followers according to the position update formula of the discoverers. The specific improvement steps are as follows:
the finder position update formula refers to an improved formula for guiding a nonlinear sine factor as shown in a formula (5) and a formula (6); the nonlinear sine learning factor is introduced, so that the discoverer in the basic sparrow algorithm can be effectively improved, global exploration is facilitated along with the progress of iteration times, the local development capability can be improved, and the position of the discoverer is updated;
ω=ω min +(ω maxmin )·sin(tπ/T max ) (5)
wherein omega is min Omega is the minimum learning factor max T is the maximum learning factor max For the maximum number of iterations, t is the current iteration, j=1, 2,..d, i represents the i-th sparrow,is the position of the ith sparrow in the jt th dimension, wherein +.>Represents the global optimum position, R 2 For alarm value, ST is alarm threshold value, r 1 Is a random number, r 2 Is a random number;
when R is 2 When ST is less than that of the sparrow, the sparrow is not dangerous, namely, no barrier grid exists, and the discoverer starts searching; when R is 2 And if not less than ST, indicating that sparrows are found dangerous, namely, an obstacle grid is arranged, and all sparrows are transferred to a safe area.
In this embodiment, ω is taken separately min =0.4,ω max =1; alarm value R 2 =0.8, alarm threshold st=0.8, r 1 =π,r 2 =1。
In addition, the follower position updating formula means that the follower position updating formula after being improved by introducing the Levy flight strategy is shown as formula (7), so that the risk that the algorithm appearing in the traditional sparrow algorithm falls into a local optimal solution can be reduced, and the local exploration can still be fully executed;
in the method, in the process of the invention,representing the optimal position occupied by the current finder, Q is a random number subject to normal distribution,/->The global worst position is represented, d is vector dimension, n is the number of the adding persons, i is the ith sparrow;
wherein the formula of Levy (d) is shown in formula (8):
in the formula (8), r 3 、r 4 The values of xi and sigma are random numbers, r in the embodiment 3 =0.5,r 4 =0.5,ξ=1.5;
The random number sigma is a normal distribution random number, and the calculation mode is shown in a formula (9):
wherein Γ (d) = (d-1) +.! ζ in the examples taken ζ=1.5.
When i > n/2, it means that the top half of the followers have obtained food, but the second half of the followers have not obtained food, indicating that the energy value of the followers who have not obtained food is low, the fitness is poor, and more food cannot be continuously sought at the current position, so that they need to fly to other places to search for more energy and increase the fitness value; by doing so, the diversity of searches can be increased, and the situation that followers are excessively gathered at certain positions is avoided, so that the global searching capability of the algorithm is improved.
The fitness is an index for evaluating whether the search path is good or bad, and in this embodiment, the fitness and the fitness value have a positive correlation. The fitness value is calculated by taking the reciprocal of the fitness function value, as in formula (4), and the purpose of this is to convert the path with smaller fitness function value into the path with larger fitness value, so as to better optimize and select the sparrow path planning. The fitness function value is calculated according to the search path of each sparrow, that is, the total length obtained by adding the search path lengths of each sparrow is calculated as in the formula (2). The smaller the fitness function value is, the shorter the path length is, the larger the fitness value is, the more excellent the path is, the higher the fitness is, and the sparrow is optimal. Dividing according to the size of the fitness value, wherein the highest global fitness value is the optimal sparrow, and the lowest fitness value is the worst sparrow. Therefore, the searching path with the smallest fitness function value is used as the path with the best fitness, the current sparrow with the best fitness and the position thereof are recorded, the searching path with the largest fitness function value is used as the path with the worst fitness, and the current sparrow with the worst fitness and the position thereof are recorded; in this embodiment, the maximum fitness value corresponds to the best sparrow, which is also the sparrow with the smallest current fitness function value, and is also the sparrow with the shortest path length, and coincides with the best path, and they are the same sparrow.
Three improvements are proposed in this embodiment: 1. the nonlinear sine learning factors are introduced into the positions of the discoverers, so that global exploration is facilitated, the local development capacity can be improved, and the positions of the discoverers are updated according to the position updating formulas of the discoverers; 2. the Levy flight strategy is introduced into the follower position updating formula, so that the risk that the algorithm is trapped into a local optimal solution, which occurs in the traditional sparrow algorithm, can be reduced, and the local exploration can still be fully executed, so that the searching efficiency and the searching precision are improved; 3. introducing a local search strategy to perform local search on the global optimal solution so as to improve the adaptability value of the global optimal solution;
(7) Selecting the number Sd of the alerter from the sparrow population scale N, wherein the number Sd of the alerter accounts for 20% of the total sparrow population scale N (the number of the alerter accounts for 10% -20% of the sparrow population scale, and 20% is taken in the embodiment), and updating the position of the alerter according to an alerter position updating formula;
in the step (7), the updating mode of the position of the alerter is shown as a formula (10):
in the method, in the process of the invention,representing the global optimum position, beta being the step control coefficient, conforming to a normal distribution with a mean value of 0, a variance of 1, k being [ -1,1]K=1 in this example; f (f) i Is the fitness value of the current sparrow, f g And f ω Respectively the current global optimal and worst fitness values, epsilon is the minimum constant, and zero division errors are avoided;
when f i >f g When the sparrow is at the edge of the population, the sparrow is extremely easy to attack by natural enemies; f (f) i =f g It has been shown that sparrows in the middle of the population are aware of the risk of attack by natural enemies, and need to be close to other sparrows.
(8) After the step (7) is completed, calculating the fitness value of each sparrow, updating the optimal position and the global optimal solution of each sparrow, judging whether iteration needs to be continued or not according to the condition of iteration stopping, and repeating the step (6) and the step (7) until the maximum iteration times are reached if iteration needs to be continued; if iteration is not needed to be continued, directly outputting the position and the fitness value of the global optimal solution;
the fitness value of each sparrow is calculated using the following formula:
wherein X is ij Represents the position of the i-th sparrow in the j-th dimension, and i=1, 2,..n, j=1, 2,., d; the fitness value of the ith sparrow is F xi
And sorting the sparrows according to the calculated fitness value, finding out the sparrow with the largest fitness value, and marking the sparrow as the optimal sparrow. And comparing the fitness value of the individual optimal position of each sparrow with the current position, and if the current position is more optimal, updating the individual optimal position of each sparrow. And comparing the fitness value of the optimal sparrow with the fitness value of the previous global optimal solution, and if the fitness value of the optimal sparrow is better, updating the position of the global optimal solution. At this time, the fitness value of the optimal sparrow is the global optimal solution. . Meanwhile, calculating the average fitness value of the sparrow population, namely: after the steps are carried out, the individual optimal position and the global optimal solution position of each sparrow are updated, and the next iteration can be carried out.
The condition of iteration stop refers to judging whether the operation reaches the maximum number of times T of selection max (200 in this embodiment) by setting a counter, which is incremented by 1 for each iteration, when the counter reaches T max And stopping iteration and outputting the optimal fitness value and the position of the sparrow, wherein the maximum fitness value is the fitness value of the obtained global optimal solution.
(9) After the step (8) is completed, carrying out local search on the obtained global optimal solution to improve the adaptability value of the global optimal solution, so that the result is more accurate; in the implementation process, the robot walking space is a two-dimensional plane space, and the height of an obstacle is not required to be considered; the size and position of the obstacle are known in advance, and no dynamic obstacle exists in the environment. Therefore, the global optimal solution refers to a path with the smallest fitness function value among all paths found in the searching process, namely, a path with the shortest path length; thus, finding the globally optimal solution represents finding the shortest path. The specific content comprises the following steps:
(9-1) randomly generating new solutions x_ { new } around the globally optimal solution according to the globally optimal solution x_ { global_best }, wherein the number of generated random solutions ranges from [10,50] (in the present embodiment, the number of generated random solutions is 20);
(9-2) Using equation fourCalculating the fitness value of x_ { new } and marking the fitness value as f_ { new };
(9-3) comparing the fitness value f_ { new } with the fitness value corresponding to the current global optimal solution output in the current step eight, if f_ { new } is larger, setting the corresponding solution x_ { new } as a new global optimal solution, and updating the fitness value f_ { new } to f_ { global_best };
(9-4) repeating the above steps until no more optimal solution can be found, wherein the solution at this time is the global optimal solution, and finding the global optimal solution represents finding the shortest path.
To verify the feasibility of improving the sparrow search algorithm, experimental simulation was performed in matlab2016a software, and the comparison of the differences in path search effect of the conventional sparrow search algorithm is shown in fig. 2 (a) and fig. 2 (b). Fig. 2 (a) shows a conventional sparrow search algorithm, and fig. 2 (b) shows a method of the present invention. As can be seen from fig. 2 (a) and fig. 2 (b), the path length of the path which is not optimized is 28.634, however, the optimized path length is 27.6096, and compared with the existing sparrow searching algorithm, the method can effectively shorten the searching path, and further obtain better path planning.
The invention relates to a spherical amphibious robot which comprises a laser radar, a memory, a processor and computer program instructions, wherein the laser radar is used for collecting environmental information, the computer program instructions are stored in the memory and can be run by the processor, and when the processor runs the computer program instructions, the path planning of the robot can be realized.
The comparison graph of the method of the invention and the existing traditional sparrow search algorithm on the change trend of the iterative curve is shown in fig. 3. As can be seen from the figure, compared with the existing sparrow search algorithm, the method can effectively solve the problem of sinking into the local optimal solution, and finally obtains more effective path planning.

Claims (10)

1. A path planning method of a spherical amphibious robot based on an improved sparrow search algorithm is characterized by comprising the following steps:
(1) Acquiring global environment information through a laser radar configured by the spherical amphibious robot to obtain an environment image signal capable of describing operation environment information;
(2) Creating a working environment model of the spherical amphibious robot based on a grid method according to the environment image signals acquired in the step (1), wherein each grid uses N ij Representing, each grid information represents as shown in formula (1):
when N is ij When=0, the current grid position is free space without barrier; when N is ij When the method is=1, the current grid is indicated to have an obstacle, and a starting point and an end point of the robot are set under an environment model of the robot so as to realize path planning in the process of reaching the end point from the starting point on a map;
(3) The spherical amphibious robot exists as particles in a two-dimensional environment, and the motion searching direction is eight directions, namely: upper, lower, left, right, upper left, lower left, upper right, lower right;
(4) Setting the sparrow population scale N and the maximum iteration number T max And a safety threshold, and the number Pd of discoverers is defined to be 10% -20% of the total number of the sparrow population scale N, and the number Sd of alerters is defined to be 10% -20% of the total number of the sparrow population scale N;
(5) Defining a fitness function, and establishing the fitness function as shown in a formula (2):
in the formula (2), n is the number of nodes through which sparrows pass, and Length is the distance from the i+1 grid node to the i grid node of the sparrows;
taking the total length of the sparrow search path as a fitness function value, evaluating the adaptability of each sparrow individual, and if the calculated fitness function value is smaller, indicating that the sparrow search path is shorter, which means that the path planning effect is better;
(6) Sequencing the fitness function values of each sparrow obtained in the step (5), selecting Pd sparrows with smaller fitness function values as discoverers, wherein the number of the discoverers accounts for 10% -20% of the total number of the sparrow population scale N, using other sparrows as followers, updating the positions of the discoverers according to a discoverer position updating formula, and updating the positions of the followers according to a following position updating formula;
(7) Selecting the number Sd of the alerter from the sparrow population scale N, wherein the number Sd accounts for 10% -20% of the total number of the sparrow population scale N, and updating the position of the alerter according to an alerter position updating formula;
(8) After the step (7) is completed, calculating the fitness value of each sparrow, updating the optimal position and the global optimal solution of each sparrow, judging whether iteration needs to be continued or not according to the condition of iteration stopping, and repeating the steps (6) - (7) until the maximum iteration times are reached if iteration needs to be continued; if iteration is not needed to be continued, directly outputting the position and the fitness value of the global optimal solution;
(9) After the step (8) is completed, carrying out local search on the obtained global optimal solution to improve the adaptability value of the global optimal solution, so that the result is more accurate; the global optimal solution refers to a path with the smallest fitness function value among all paths found in the searching process, namely a path with the shortest path length; thus, finding the globally optimal solution represents finding the shortest path.
2. The path planning method of the spherical amphibious robot based on the improved sparrow search algorithm of claim 1, wherein the step (5) specifically refers to: calculating the fitness function value of each sparrow by using a formula (2), and then calculating the position and the fitness value of each sparrow in the d-dimensional search space according to formulas (3) and (4);
in the d-dimensional search space, assuming that N sparrows exist, the position of the ith sparrow in the d-dimensional space is shown in formula (3):
X i =[X i1 ,…X ij ,…X id ] (3)
in the formula (3), X ij Represents the position of the i-th sparrow in the j-th dimension, and i=1, 2,..n, j=1, 2,., d;
calculating the fitness function value of each sparrow according to the formula (2) and taking the reciprocal to obtain the fitness value of the ith sparrow, wherein the fitness value of the ith sparrow is shown as the formula (4):
the fitness value represents the performance degree of each sparrow individual under the fitness function, and the smaller the fitness function value is, the larger the fitness value is, the shorter the representative path length is, the more excellent the path is, the higher the fitness is, and the sparrow is optimal at the moment; therefore, the fitness function values of all the sparrows are compared, the search path of the sparrow with the smallest fitness function value is selected as the path with the optimal fitness, and the current best fitness sparrow f is recorded b And its position X b Selecting the search path with the largest fitness function value as the path with the worst fitness, and recording the current sparrow f with the worst fitness ω And its position X ω
3. The path planning method of the spherical amphibious robot based on the improved sparrow search algorithm according to claim 1, wherein the finder position update formula in the step (6) is an improved formula for guiding a nonlinear sine factor as shown in formula (5) and formula (6); the nonlinear sine learning factor is introduced, so that the discoverer in the basic sparrow algorithm can be effectively improved, global exploration is facilitated along with the progress of iteration times, the local development capability can be improved, and the position of the discoverer is updated;
ω=ω min +(ω maxmin )·sin(tπ/T max ) (5)
wherein omega is min Omega is the minimum learning factor max T is the maximum learning factor max For the maximum number of iterations, t is the current iteration, j=1, 2,..d, i represents the i-th sparrow,is the position of the ith sparrow in the jt th dimension, wherein +.>Represents the global optimum position, R 2 For alarm value, ST is alarm threshold value, r 1 Is a random number, r 2 Is a random number;
when R is 2 When ST is less than that of the sparrow, the sparrow is not dangerous, namely, no barrier grid exists, and the discoverer starts searching; when R is 2 And if not less than ST, indicating that sparrows are found dangerous, namely, an obstacle grid is arranged, and all sparrows are transferred to a safe area.
4. A path planning method of a spherical amphibious robot based on an improved sparrow search algorithm according to claim 3, wherein ω in said formula (5) min The value range of (2) is [0,1]],ω max The value range of (2) is [0,1]]The method comprises the steps of carrying out a first treatment on the surface of the Alarm value R in said equation (6) 2 The value range of (2) is [0,1]]The method comprises the steps of carrying out a first treatment on the surface of the The value range of the alarm threshold ST in the formula (6) is [0.5,1.0]The method comprises the steps of carrying out a first treatment on the surface of the The random number r in the formula (6) 1 The value range of (2) is 0,2 pi]The method comprises the steps of carrying out a first treatment on the surface of the The random number r in the formula (6) 2 The value range of (2) is [0,2]]。
5. The path planning method of spherical amphibious robot based on improved sparrow searching algorithm as claimed in claim 3, wherein the following position updating formula in the step (6) means that the following position updating formula after the improvement of the Levy flight strategy is introduced as shown in formula (7), so that the risk of the algorithm falling into the local optimal solution in the traditional sparrow algorithm can be reduced, and the local exploration can still be fully executed;
in the method, in the process of the invention,representing the optimal position occupied by the current finder, Q is a random number subject to normal distribution,/->The global worst position is represented, d is vector dimension, n is the number of the adding persons, i is the ith sparrow;
when i > n/2, it means that the top half of the followers have obtained food, but the bottom half of the followers have not obtained food, indicating that the energy value of the followers who have not obtained food is low, the fitness is poor, and more food cannot be continuously sought at the current position, so that they need to fly to other places to search for more energy and increase the fitness value; by the method, the diversity of searching can be increased, and the situation that followers are excessively gathered at certain positions is avoided, so that the global searching capability of an algorithm is improved;
the formula of L ivy (d) in the formula (7) is shown as formula (8):
in the formula (8), r 3 、r 4 The xi and sigma are random numbers; wherein, the value ranges of the random number r3 and the random number r4 are 0,1]The method comprises the steps of carrying out a first treatment on the surface of the The value range of the random number xi is 0,2]。
6. The path planning method of the spherical amphibious robot based on the improved sparrow search algorithm according to claim 5, wherein according to the fact that the random number sigma is a normal distribution random number, the calculation mode is as shown in a formula (9):
in the method, in the process of the invention,xi is [0,2]]Is a random number of (a) in the memory.
7. The path planning method of the spherical amphibious robot based on the improved sparrow search algorithm according to claim 1, wherein in the step (7), the position updating mode of the alerter is as shown in the formula (10):
in the method, in the process of the invention,representing the global optimum position, beta being the step control coefficient, conforming to a normal distribution with a mean value of 0, a variance of 1, k being [ -1,1]Random numbers of (a); f (f) i Is the fitness value of the current sparrow, f g And f ω Respectively the current global optimal and worst fitness values, epsilon is the minimum constant, and zero division errors are avoided;
when f i >f g When the sparrow is at the edge of the population, the sparrow is extremely easy to attack by natural enemies; f (f) i =f g It has been shown that sparrows in the middle of the population are aware of the risk of attack by natural enemies, and need to be close to other sparrows.
8. The path planning method of the spherical amphibious robot based on the improved sparrow search algorithm according to claim 1, wherein the calculating of the fitness value of each sparrow and the updating of the optimal position and the global optimal solution of each sparrow in the step (8) specifically means: the fitness value of each sparrow is calculated using the following formula:
wherein X is ij Represents the position of the i-th sparrow in the j-th dimension, and i=1, 2,..n, j=1, 2,., d; the fitness value of the ith sparrow is F xi
Sorting sparrows according to the calculated fitness value, finding out the sparrow with the largest fitness value, and marking the sparrow as the optimal sparrow; for each sparrow, comparing the fitness value of the individual optimal position with the current position, and if the current position is more optimal, updating the individual optimal position; then, comparing the fitness value of the optimal sparrow with the fitness value of the previous global optimal solution, and if the fitness value of the optimal sparrow is better, updating the position of the global optimal solution; the fitness value of the optimal sparrow is the global optimal solution; meanwhile, calculating the average fitness value of the sparrow population, namely: after the steps are carried out, the individual optimal position and the global optimal solution position of each sparrow are updated, and the next iteration can be carried out.
9. The path planning method of spherical amphibious robot based on improved sparrow search algorithm as claimed in claim 1, wherein the condition of iterative stop in step (8) is to judge whether the operation reaches the maximum number of generations T max By setting a counter, each time the iteration counter is incremented by 1, when the counter reaches T max And stopping iteration and outputting the optimal fitness value and the position of the sparrow, wherein the maximum fitness value is the fitness value of the obtained global optimal solution.
10. The path planning method of the spherical amphibious robot based on the improved sparrow search algorithm according to claim 1, wherein the specific content of the local search by using the global optimal solution in the step (9) comprises the following steps:
(9-1) randomly generating new solutions x_ { new } around the global optimal solution according to the global optimal solution x_ { global_best }, wherein the number of the random solutions ranges from 10 to 50;
(9-2) calculating the fitness value of x_ { new } using formula (4), denoted as f_ { new };
(9-3) comparing the fitness value f_ { new } with the fitness value corresponding to the current global optimal solution outputted in the current step (8), if f_ { new } is larger, setting the corresponding solution x_ { new } as a new global optimal solution, and updating the fitness value f_ { new } to f_ { global_best };
(9-4) repeating the above steps until no more optimal solution can be found, wherein the solution at this time is the global optimal solution, and finding the global optimal solution represents finding the shortest path.
CN202310425448.7A 2023-04-20 2023-04-20 Spherical amphibious robot path planning method based on improved sparrow search algorithm Pending CN116795098A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310425448.7A CN116795098A (en) 2023-04-20 2023-04-20 Spherical amphibious robot path planning method based on improved sparrow search algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310425448.7A CN116795098A (en) 2023-04-20 2023-04-20 Spherical amphibious robot path planning method based on improved sparrow search algorithm

Publications (1)

Publication Number Publication Date
CN116795098A true CN116795098A (en) 2023-09-22

Family

ID=88045900

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310425448.7A Pending CN116795098A (en) 2023-04-20 2023-04-20 Spherical amphibious robot path planning method based on improved sparrow search algorithm

Country Status (1)

Country Link
CN (1) CN116795098A (en)

Similar Documents

Publication Publication Date Title
CN113110592B (en) Unmanned aerial vehicle obstacle avoidance and path planning method
CN108036790B (en) Robot path planning method and system based on ant-bee algorithm in obstacle environment
CN112461247A (en) Robot path planning method based on self-adaptive sparrow search algorithm
CN110703766B (en) Unmanned aerial vehicle path planning method based on transfer learning strategy deep Q network
CN112036540B (en) Sensor number optimization method based on double-population hybrid artificial bee colony algorithm
CN110544296A (en) intelligent planning method for three-dimensional global flight path of unmanned aerial vehicle in environment with uncertain enemy threat
CN107253195A (en) A kind of carrying machine human arm manipulation ADAPTIVE MIXED study mapping intelligent control method and system
CN106022471A (en) Wavelet neural network model ship rolling real-time prediction method based on particle swarm optimization algorithm
CN111027627A (en) Vibration information terrain classification and identification method based on multilayer perceptron
CN114599069B (en) Underwater wireless sensor network routing method based on energy self-collection
CN113722980A (en) Ocean wave height prediction method, system, computer equipment, storage medium and terminal
CN116382267B (en) Robot dynamic obstacle avoidance method based on multi-mode pulse neural network
CN112469050A (en) WSN three-dimensional coverage enhancement method based on improved wolf optimizer
CN115420294A (en) Unmanned aerial vehicle path planning method and system based on improved artificial bee colony algorithm
CN115933693A (en) Robot path planning method based on adaptive chaotic particle swarm algorithm
CN113467481B (en) Path planning method based on improved Sarsa algorithm
CN114995390A (en) Mobile robot path planning method based on dynamic adaptive parameter adjustment dayflies algorithm
CN115909027B (en) Situation estimation method and device
CN116795098A (en) Spherical amphibious robot path planning method based on improved sparrow search algorithm
Atasever et al. The use of artificial intelligence optimization algorithms in unsupervised classification
Wang et al. Path planning model of mobile robots in the context of crowds
Wei et al. Hybrid artificial fish school algorithm for solving ill-conditioned linear systems of equations
CN117784615B (en) Fire control system fault prediction method based on IMPA-RF
Dongliang Research on coverage holes repair in wireless sensor networks based on an improved artificial fish swarm algorithm
CN113589810B (en) Dynamic autonomous obstacle avoidance movement method and device for intelligent body, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination