An artificial intelligence robot path planning method based on improved ant colony algorithm
By screening and analyzing paths in the raster map, determining the optimal starting point and applying it to the ant colony algorithm, the problems of low path planning efficiency and waste of resources in the existing technology are solved, and the scientific nature of path planning and ant colony algorithm are improved. efficiency.
Patent Information
- Application Number
- CN202411171061.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-08-26
AI Technical Summary
The existing artificial intelligence robot path planning technology based on ant colony algorithm has problems such as low efficiency, waste of resources and many iterations, and it is impossible to effectively find the optimal path.
Preselect multiple paths through the raster map, analyze and filter out paths with key parameters such as energy consumption, safety, time efficiency and path complexity, set threshold standards, select the optimal path to determine the optimal starting point, and Initialization in the ant colony algorithm to improve search efficiency.
It significantly improves the convergence speed and efficiency of the ant colony algorithm, ensures the scientificity and accuracy of path planning, reduces resource waste, and improves the reliability and effectiveness of the optimal starting point.
Smart Images

Figure CN118687576B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of robot path planning, and in particular to an artificial intelligence robot path planning method based on an improved ant colony algorithm. Background Art
[0002] In the field of artificial intelligence robots, path planning technology is the key to ensure that robots can navigate autonomously in complex environments. Traditional path planning methods often rely on a single algorithm model, such as the Dijkstra algorithm, Although these algorithms can theoretically guarantee the shortest path, they may face problems such as low computational efficiency and inability to adapt to dynamically changing environments in practical applications. In recent years, the ant colony algorithm, as a heuristic search algorithm, has attracted widespread attention because it simulates the behavior of ants in nature in finding food paths. It can better handle large-scale and complex problems, and is particularly suitable for solving path planning problems.
[0003] Existing path planning technologies based on ant colony algorithms usually directly apply the ant colony algorithm to the entire search space, that is, searching from a random or predefined starting point to the target point. Although this method can find a feasible path, it still has several obvious defects:
[0004] First, the random starting point means that the algorithm will start searching from a less efficient position, which will lead to a lot of ineffective exploration. The algorithm will over-search in some areas and ignore other areas that may contain better paths. This not only wastes computing resources, but also may miss the potential best path. At the same time, due to the uncertainty of the starting point, the algorithm needs more iterations to accumulate enough pheromones to guide subsequent searches, which directly affects the convergence speed of the algorithm.
[0005] Second, the predefined starting point will cause the algorithm to over-search certain areas and ignore other areas that may contain better paths. Even in an unchanged environment, if the starting point is not chosen properly, it will waste resources and reduce the possibility of finding the optimal solution.
[0006] Therefore, the prior art urgently needs a technical solution for an artificial intelligence robot path planning method based on an improved ant colony algorithm. Summary of the invention
[0007] In order to solve the above technical problems, the present invention provides an artificial intelligence robot path planning method based on an improved ant colony algorithm, which is characterized by comprising the following steps:
[0008] Step S1, using a grid method to form a grid map for robot movement, including setting multiple groups of starting point grids, a target point grid, multiple groups of obstacle grids, and multiple groups of terrain type grids;
[0009] The obstacle grid represents an inaccessible area and includes obstacle information;
[0010] The terrain type grid represents different terrain types, including terrain type information, wherein the terrain type information includes terrain condition information;
[0011] Step S2, analyzing multiple groups of starting point grids to obtain the optimal starting point grid;
[0012] Step S2a, randomly predetermining at least two paths according to multiple groups of starting point grids, one target point grid, multiple groups of obstacle grids, and multiple groups of terrain type grids;
[0013] Step S2b, analyzing at least two predetermined paths to obtain a predetermined optimal path;
[0014] Step S2b1, obtaining parameters for path analysis, analyzing the importance of each parameter, ranking each parameter according to the analysis result, and obtaining the top four parameters as key parameters;
[0015] The key parameters are energy consumption, safety, time efficiency, and path complexity;
[0016] Step S2b2, selecting one of the at least two predetermined paths, and analyzing the key parameters on the current path to obtain the total energy consumption, safety factor, total time, and comprehensive complexity value respectively; and setting a first threshold for the total energy consumption; setting a second threshold for the safety factor; setting a third threshold for the total time; and setting a fourth threshold for the comprehensive complexity value;
[0017] Step S2b21, analyzing the energy consumption of the current path to obtain the total energy consumption of the current path;
[0018] Step S2b21.1, assigning an energy consumption value to each grid on the current path based on the terrain type information of the grid;
[0019] Step S2b21.2, counting and obtaining the total number of grids on the current path;
[0020] Step S2b21.3, according to the energy consumption value of each grid on the current path and the number of grids on the current path, the total energy consumption of the current path is obtained;
[0021] The calculation formula for the total energy consumption of the current path is:
[0022] ;
[0023] Where E represents the total energy consumption of the current path; e i represents the energy consumption value of the i-th grid on the current path; n represents the total number of grids on the current path.
[0024] Step S2b22, analyzing the safety of the current path to obtain a safety factor of the current path;
[0025] Step S2b22.1, counting and obtaining the total number of obstacle grids passed on the current path;
[0026] Step S2b22.2, calculate and obtain the shortest distance between each obstacle grid within a preset range passed on the current path and the current path;
[0027] Step S2b22.3: evaluate each obstacle grid within the preset range passed by the current path according to the shortest distance between each obstacle grid within the preset range and the current path, and assign a risk value to each obstacle grid according to the evaluation result;
[0028] Step S2b22.4, obtaining the safety factor of the current path according to the total number of obstacle grids passed on the current path, the closest distance between each obstacle grid within a preset range and the current path, and the risk value of each obstacle grid;
[0029] The calculation formula for the safety factor of the current path is:
[0030] ;
[0031] Among them, S represents the safety factor of the current path; r m Represents the risk value of the mth obstacle grid on the current path; d m Represents the shortest distance between the mth obstacle grid and the current path; M represents the total number of obstacle grids passed on the current path.
[0032] Step S2b23, analyzing the time efficiency of the current path to obtain the total time of the current path;
[0033] Step S2b23.1, based on the terrain condition information of the grid, obtaining the actual length of each grid on the current path;
[0034] Step S2b23.2, assigning a speed value to each grid on the current path based on the terrain type information of the grid;
[0035] Step S2b23.3, according to the actual length of each grid on the current path and the speed value of each grid on the current path, the total time of the current path is obtained;
[0036] The calculation formula for the total time of the current path is:
[0037] ;
[0038] Where T represents the total time of the current path; L i Represents the actual length of the i-th grid on the current path; V i Represents the speed value of the i-th grid on the current path; n represents the total number of grids on the current path.
[0039] Step S2b24, analyzing the path complexity of the current path, wherein the path complexity includes geometric complexity and terrain type complexity, and obtaining a comprehensive complexity value of the current path;
[0040] Step S2b24a, analyzing the geometric complexity of the current path to obtain a geometric complexity value of the current path;
[0041] Step S2b24a.1, based on the actual length of each grid on the current path, determine the total length of the current path;
[0042] Step S2b24a.2, based on the terrain condition information of the grid, obtain the direction vector of each grid on the current path and the direction vector of the next grid of each grid on the current path, and then use the vector dot product method to obtain the angle between the direction vector of each grid and the direction vector of the next grid of each grid;
[0043] Step S2b24a.3, based on each grid on the current path and the next grid of each grid, determine the number of grid segments of the current path;
[0044] Step S2b24a.4, obtain the geometric complexity value of the current path according to the total length of the current path, the angle between the direction vector of each grid and the direction vector of the next grid of each grid, and the number of grid segments of the current path.
[0045] Step S2b24b, analyzing the terrain type complexity of the current path to obtain the terrain type complexity value of the current path;
[0046] Step S2b24b.1, based on the terrain type information included in the terrain type grid, count the terrain types on the current path to obtain the total number of terrain types;
[0047] Step S2b24b.2, counting the number of occurrences of each terrain type on the current path to obtain the frequency of occurrence of each terrain type;
[0048] Step S2b24b.3, evaluate the movement difficulty of the robot under each terrain type on the current path, and sort each terrain type according to the evaluation result, and assign a weight to each terrain type based on the sorting result;
[0049] Step S2b24b.4: Obtain the terrain type complexity value of the current path according to the total number of terrain types on the current path, the frequency of occurrence of each terrain type on the current path, and the weight of each terrain type on the current path.
[0050] Step S2b24c, obtaining a comprehensive complexity value of the current path according to the geometric complexity value of the current path and the terrain type complexity value of the current path;
[0051] The calculation formula for the comprehensive complexity value of the current path is:
[0052] ;
[0053] Among them, p represents the comprehensive complexity value of the current path; α represents the weight coefficient of the geometric complexity value of the current path; β represents the weight coefficient of the terrain type complexity value of the current path; n represents the total number of grids on the current path; n-1 represents the number of grid segments on the current path; represents the angle between the qth grid segment and the q+1th grid segment on the current path; L total represents the total length of the current path; y represents the total number of terrain types on the current path; W u Represents the weight of the u-th terrain type on the current path; f u Represents the frequency of occurrence of the u-th terrain type on the current path; Represents the geometric complexity value of the current path; Represents the terrain type complexity value of the current path.
[0054] Step S2b3: when the total energy consumption is less than or equal to the first threshold, the safety factor is greater than or equal to the second threshold, the total time is greater than or equal to the third threshold, and the comprehensive complexity value is less than or equal to the fourth threshold, the current path is output as the predetermined optimal path; when any of the above conditions is not met, the current path is marked as a non-predetermined optimal path, the next path is reselected, and step S2b2 is executed again until the predetermined optimal path is obtained;
[0055] Step S2c: Obtain an optimal starting point grid according to the predetermined optimal path.
[0056] Step S3, initializing the basic parameters of the ant colony algorithm and initializing the ant colony at the optimal starting point grid;
[0057] Step S4: select a candidate grid according to the improved state transition probability. After the ant reaches the next grid, update the taboo table and add the current grid to the taboo table.
[0058] Step S5, determine whether the ant has reached the target point grid, if so, stop searching and one iteration ends, otherwise, continue to execute step S4 until the target node is found;
[0059] Step S6, determine whether the number of iterations reaches the maximum number of iterations. If so, end and output the optimal path. If not, continue to execute step S3 until the number of iterations reaches the maximum number of iterations.
[0060] The embodiments of the present invention have the following technical effects:
[0061] The present invention preselects at least two paths in a grid map, analyzes each path to obtain a predetermined optimal path, and then obtains an optimal starting point through the predetermined optimal path. The optimal starting point obtained by this analysis method can be effectively used as the starting solution of the ant colony algorithm, which effectively narrows the search range of the ant colony algorithm and greatly reduces the number of iterations of the ant colony algorithm, thereby significantly improving the convergence speed and efficiency of the ant colony algorithm.
[0062] In addition, in the process of analyzing the pre-selected path, the present invention deeply considers the influence of key parameters such as energy consumption, safety, time efficiency and path complexity, obtains the quantified value of each key parameter through a series of analysis and calculation, and then sets a series of strict threshold standards for the quantified value of the key parameter, and only when each quantified value meets the threshold standard can the pre-selected path be output as a predetermined optimal path, and finally the optimal starting point of the ant colony algorithm can be obtained according to the predetermined optimal path, which means that the optimal starting point obtained through a series of data-driven analysis has a high degree of scientificity and accuracy, so that this optimal starting point has excellent reliability and effectiveness when applied to the ant colony algorithm;
[0063] Moreover, in order to further improve the scientificity and accuracy of obtaining the optimal starting point, the present invention further focuses on the geometric complexity and terrain type complexity when analyzing and calculating the path complexity in the key parameters. This can make the quantitative value of the path complexity obtained by the analysis and calculation, that is, the comprehensive complexity value, more representative, thereby further effectively improving the scientificity and accuracy of obtaining the optimal starting point, and at the same time further improving the reliability and effectiveness of this optimal starting point when applied to the ant colony algorithm;
[0064] In summary, the present invention has not only made significant progress in the efficiency of the ant colony algorithm, but also made important contributions to the scientificity and accuracy of path planning, laying a solid foundation for the efficient operation of artificial intelligence robots in various application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0066] Figure 1 It is a flow chart of an artificial intelligence robot path planning method based on an improved ant colony algorithm provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0068] Embodiment 1: Figure 1 As shown, the present invention provides an artificial intelligence robot path planning method based on an improved ant colony algorithm, comprising the following steps:
[0069] Step S1, using a grid method to form a grid map for robot movement, including setting multiple groups of starting point grids, a target point grid, multiple groups of obstacle grids, and multiple groups of terrain type grids;
[0070] The obstacle grid represents an inaccessible area and includes obstacle information;
[0071] Furthermore, the obstacle information includes but is not limited to: walls, furniture, vegetation, buildings, etc.;
[0072] The terrain type grid represents different terrain types, including terrain type information, wherein the terrain type information includes terrain condition information;
[0073] Furthermore, the terrain type information includes, but is not limited to, grass, cement, muddy ground, sand, water, etc., and also includes uphill grass, downhill grass, etc.;
[0074] Furthermore, the terrain condition information includes, but is not limited to, terrain flatness, slope, friction coefficient, slippery degree, etc. based on terrain type information.
[0075] Step S2, analyzing multiple groups of starting point grids to obtain the optimal starting point grid;
[0076] Step S2a, randomly predetermining at least two paths according to multiple groups of starting point grids, one target point grid, multiple groups of obstacle grids, and multiple groups of terrain type grids;
[0077] Step S2b, analyzing at least two predetermined paths to obtain a predetermined optimal path;
[0078] Step S2b1, obtaining parameters for path analysis, analyzing the importance of each parameter, ranking each parameter according to the analysis result, and obtaining the top four parameters as key parameters;
[0079] The key parameters are energy consumption, safety, time efficiency, and path complexity;
[0080] Further, parameters for path evaluation are obtained, including but not limited to: energy consumption, representing the total energy required for the robot to travel on the path; environmental adaptability, representing the impact of terrain changes on the path on the robot's performance; safety, representing the probability of encountering obstacles or other dangers on the path; time efficiency, representing the time required to complete the path; repeatability, representing whether the path can be repeatedly executed by the robot without adjustment; path complexity, representing the degree of tortuosity and the number of turns on the path; visibility, representing the clarity of vision on the path, affecting the robot's navigation and obstacle avoidance capabilities; task completion, representing the contribution of the path to the completion of a specific task goal;
[0081] The importance of the above parameters is analyzed. During the analysis, the hierarchical analysis method or the expert scoring method can be used. The following is the analysis result of the above parameters:
[0082] Energy consumption: Energy efficiency is a key factor in robot operation, especially in battery-powered robots. Lower energy consumption means that the robot can perform tasks for longer periods of time, reducing the need to recharge or replace batteries, emphasizing the importance of considering energy consumption when planning paths.
[0083] Environmental adaptability: Environmental adaptability takes into account the robot's performance in various terrains and environmental conditions. On different terrains, the robot's mobility may be limited, but in certain specific environments, such as rugged terrain or extreme climatic conditions, environmental adaptability becomes extremely critical.
[0084] Safety: Safety is one of the most important parameters in path planning. It ensures that the robot does not collide with obstacles or other entities while performing its tasks, avoiding damage to itself or the surrounding environment, indicating that avoiding hazards and keeping the robot safe is crucial when planning a path.
[0085] Time efficiency: Time efficiency refers to the time required to complete a path. In many application scenarios, time is a precious resource. Quick response or timely delivery directly affects the success of the task. When planning a path, reducing execution time is an important consideration.
[0086] Repeatability: Repeatability refers to whether a path can be repeatedly executed by a robot without adjustment. In automation and logistics applications, repeatability is important because it improves efficiency and reliability. In some cases, consistency and predictability of a path are valuable.
[0087] Path complexity: Path complexity assesses how tortuous a path is and how many turns it has. Complex paths increase the robot’s energy consumption, reduce its speed, and increase the risk of execution errors, which means simple paths are preferred because they are easier to predict and control.
[0088] Visibility: Visibility affects the robot’s ability to use visual sensors, such as cameras, and while not the most critical factor, it becomes important in applications that require visual navigation or detection of specific objects.
[0089] Task Completion: Task completion assesses the extent to which a path contributes to the achievement of a specific task goal. In task-oriented applications, it is necessary to ensure that the path directly supports the task goal.
[0090] Based on the above analysis results, all current parameters are scored and sorted according to the scores; the following is the sorting result of all current parameters:
[0091] Safety: 4.7; Energy consumption: 4.5; Time efficiency: 4.3; Path complexity: 4.0; Environmental adaptability: 3.8; Repeatability: 3.0; Visibility: 2.8; Task completion: 2.5; Based on the above ranking results, the key parameters that can be obtained are safety, energy consumption, time efficiency and path complexity.
[0092] Step S2b2, selecting one of the at least two predetermined paths, and analyzing the key parameters on the current path to obtain the total energy consumption, safety factor, total time, and comprehensive complexity value respectively; and setting a first threshold for the total energy consumption; setting a second threshold for the safety factor; setting a third threshold for the total time; and setting a fourth threshold for the comprehensive complexity value;
[0093] Step S2b21, analyzing the energy consumption of the current path to obtain the total energy consumption of the current path;
[0094] Step S2b21.1, assigning an energy consumption value to each grid on the current path based on the terrain type information of the grid;
[0095] Further, regarding the terrain type information, after combining the friction coefficient in the terrain condition information, the energy consumption level under each terrain type is:
[0096] Grass: When the friction is low, it is suitable for fast movement, but there are hidden potholes or unevenness, and the energy consumption is moderate; Concrete ground: A hard surface with moderate friction, suitable for high-speed movement, and low energy consumption; Muddy ground: High friction, which can easily cause the robot to sink, and the energy consumption is large; Sand: High friction, additional energy is required to overcome the resistance of sand particles, and the energy consumption is relatively large; Water: Impassable unless the robot has the ability to travel on water; Uphill grass: A variation of grass, which requires additional energy to overcome gravity and has a relatively large energy consumption; Downhill grass: A variation of grass, which requires less energy to control deceleration and has a low energy consumption.
[0097] Among them, the impact of terrain condition information on energy consumption is specifically as follows: Terrain flatness: affects the stability of the robot, uneven terrain will increase energy consumption; slope: uphill increases energy consumption, downhill reduces energy consumption, but requires energy control to decelerate; friction coefficient: terrain with a high friction coefficient requires more energy to move; slippery degree: slippery terrain increases energy consumption because more energy is required to maintain stability and directional control.
[0098] First, a basic energy consumption value is set for each terrain type, for example, a cement ground has a lower basic energy consumption value, while a muddy ground has a higher basic energy consumption value; then, the basic energy consumption value is adjusted according to the terrain condition information, for example, an uphill grass field has a higher energy consumption value than a flat grass field, and the specific adjustment value is based on the slope, and the adjustment value includes but is not limited to a slope adjustment value, a wetness adjustment value, etc.; then, the basic energy consumption value of the terrain type is combined with each adjustment value of the terrain condition to obtain the final energy consumption value, and for each grid on the path, the corresponding terrain type and condition are found, and the above calculation method is applied to obtain the energy consumption value of the grid;
[0099] Step S2b21.2, counting and obtaining the total number of grids on the current path;
[0100] Step S2b21.3, according to the energy consumption value of each grid on the current path and the number of grids on the current path, the total energy consumption of the current path is obtained;
[0101] The calculation formula for the total energy consumption of the current path is:
[0102] ;
[0103] Where E represents the total energy consumption of the current path; e i represents the energy consumption value of the i-th grid on the current path; n represents the total number of grids on the current path.
[0104] Step S2b22, analyzing the safety of the current path to obtain a safety factor of the current path;
[0105] Step S2b22.1, counting and obtaining the total number of obstacle grids passed on the current path;
[0106] Step S2b22.2, calculate and obtain the shortest distance between each obstacle grid within a preset range passed on the current path and the current path;
[0107] Furthermore, to obtain the closest distance:
[0108] First, it is clear that the path is composed of a series of continuous grid points, which constitute the robot's route from the starting point to the end point;
[0109] Then, in the grid map, mark all grids representing obstacles, which can be walls, furniture, vegetation or buildings;
[0110] For each grid on the current path, calculate its distance to all obstacle grids within a preset range, where the preset range is preferably an obstacle grid within a circular area with a radius of 5 grids;
[0111] The coordinates of each grid on the current path are marked, and the coordinates of each obstacle grid within the preset range are marked. For example, the coordinates of one grid are Q (X Q , Y Q ), where the coordinates of an obstacle grid within a preset range are O (X O , Y O ), then the distance between the two coordinates can be calculated using the Euclidean distance formula:
[0112] ;
[0113] The distance between this grid Q and the other obstacle grids within the preset range is calculated using the above formula. Then, among all the obstacle grids within the preset range, the one closest to Q is selected, that is, the closest distance D min Of course, the calculation and selection of the shortest distance between the remaining grids and obstacles within the preset range is also carried out in the above manner.
[0114] Step S2b22.3: evaluate each obstacle grid within the preset range passed by the current path according to the shortest distance between each obstacle grid within the preset range and the current path, and assign a risk value to each obstacle grid according to the evaluation result;
[0115] It is worth noting that, in the above, the closer the nearest distance is to the current path, the higher the risk value is assigned, and vice versa;
[0116] Step S2b22.4, obtaining the safety factor of the current path according to the total number of obstacle grids passed on the current path, the closest distance between each obstacle grid within a preset range and the current path, and the risk value of each obstacle grid;
[0117] The calculation formula for the safety factor of the current path is:
[0118] ;
[0119] Among them, S represents the safety factor of the current path; r m Represents the risk value of the mth obstacle grid on the current path; d m Represents the shortest distance between the mth obstacle grid and the current path; M represents the total number of obstacle grids passed on the current path.
[0120] Step S2b23, analyzing the time efficiency of the current path to obtain the total time of the current path;
[0121] Step S2b23.1, based on the terrain condition information of the grid, obtaining the actual length of each grid on the current path;
[0122] It is worth noting that although the size of each grid in the grid map is fixed, usually L×L units, which means that the side length of each grid is the same, so the length of each grid is basically unaffected, but considering the influence of the slope in the terrain condition information, the actual length of each grid is not exactly the same, therefore, when calculating the actual length of each grid, it is as follows:
[0123] For each grid on the path, the actual length of each grid is calculated according to its terrain conditions, mainly the slope. This actual length takes into account the actual length of the grid when going uphill and the actual length of the grid when going downhill. Since the calculation principles of these two cases are the same, only the actual length of the grid when going uphill is demonstrated:
[0124] The actual length of the grid when going uphill: First, define the side length of the grid as the conventional L, that is, the standard length of a grid that the robot passes on flat terrain; when the robot goes uphill, in addition to horizontal movement, there will be a part of vertical movement, which increases the length of the grid. The increase is measured as the actual length of the grid when going uphill. When the slope of the uphill grid is , then the actual length of the grid when going uphill It can be calculated using the Pythagorean theorem:
[0125] ;
[0126] The actual length of the grid when it is flat is also included. Since there is no slope, its actual length is equal to the side length L of the grid. Of course, the calculation principle of the actual length of the grid when it is downhill is the same as that of the actual length of the grid when it is uphill, so it will not be described in detail here.
[0127] Step S2b23.2, assigning a speed value to each grid on the current path based on the terrain type information of the grid;
[0128] Further, based on the terrain condition information included in the terrain type information, a speed value is assigned to each terrain type and condition, and recorded in a table;
[0129] For grass terrain, set the average speed to V g ; For cement terrain, set the average speed to V c ; For muddy terrain, set the average speed to V m ; For sandy terrain, set the average speed to V s ; For uphill grass terrain, set the average speed to V ug ; For downhill grass terrain, set the average speed to V dg ; Of course, it also includes the average speed setting value of terrain types under various other terrain conditions, not limited to the above; for example, when a grid is an uphill grassland, its speed value is found in the corresponding table and is V ug ;
[0130] Step S2b23.3, obtaining the total time of the current path according to the length of each grid on the current path and the speed value of each grid on the current path;
[0131] The calculation formula for the total time of the current path is:
[0132] ;
[0133] Where T represents the total time of the current path; L i Represents the actual length of the i-th grid on the current path; V iRepresents the speed value of the i-th grid on the current path; n represents the total number of grids on the current path.
[0134] Step S2b24, analyzing the path complexity of the current path, wherein the path complexity includes geometric complexity and terrain type complexity, and obtaining a comprehensive complexity value of the current path;
[0135] Step S2b24a, analyzing the geometric complexity of the current path to obtain a geometric complexity value of the current path;
[0136] Step S2b24a.1, based on the actual length of each grid on the current path, determine the total length of the current path;
[0137] Step S2b24a.2, based on the terrain condition information of the grid, obtain the direction vector of each grid on the current path and the direction vector of the next grid of each grid on the current path, and then use the vector dot product method to obtain the angle between the direction vector of each grid and the direction vector of the next grid of each grid;
[0138] It is worth noting that in a grid map, the slope in the terrain condition information has an important influence on path planning, especially when calculating the turning angle of the path. This embodiment will explain in detail how to obtain the direction vector of each grid on the path based on the terrain condition information, especially the slope, and how to calculate the angle between these vectors using the vector dot product method;
[0139] For each grid on the path, its direction vector needs to be determined. This will help understand the direction of the robot's movement in each grid. The direction vector can be determined based on the direction the robot moves from the current grid to the next grid.
[0140] When the robot is off the grid Move to Grid , then the direction vector It can be expressed as arrive The displacement vector of is: ;
[0141] Based on the above, after obtaining the direction vector of each grid and its next grid on the current path, the direction vector of each grid is , the direction vector of the next grid is , then use the vector dot product method to calculate the angle between these vectors ,
[0142] The dot product expression of two vectors is:
[0143] ;
[0144] in represents the angle between two vectors, and They are vectors and vector The module length;
[0145] By calculation, we can get the angle between the two vectors mentioned above The specific value of
[0146] Step S2b24a.3, based on each grid on the current path and the next grid of each grid, determine the number of grid segments of the current path;
[0147] Step S2b24a.4, obtain the geometric complexity value of the current path according to the total length of the current path, the angle between the direction vector of each grid and the direction vector of the next grid of each grid, and the number of grid segments of the current path.
[0148] Step S2b24b, analyzing the terrain type complexity of the current path to obtain the terrain type complexity value of the current path;
[0149] Step S2b24b.1, based on the terrain type information included in the terrain type grid, count the terrain types on the current path to obtain the total number of terrain types;
[0150] Step S2b24b.2, counting the number of occurrences of each terrain type on the current path to obtain the frequency of occurrence of each terrain type;
[0151] Step S2b24b.3, evaluate the movement difficulty of the robot under each terrain type on the current path, and sort each terrain type according to the evaluation result, and assign a weight to each terrain type based on the sorting result;
[0152] Step S2b24b.4: Obtain the terrain type complexity value of the current path according to the total number of terrain types on the current path, the frequency of occurrence of each terrain type on the current path, and the weight of each terrain type on the current path.
[0153] Step S2b24c, obtaining a comprehensive complexity value of the current path according to the geometric complexity value of the current path and the terrain type complexity value of the current path;
[0154] The calculation formula for the comprehensive complexity value of the current path is:
[0155] ;
[0156] Among them, p represents the comprehensive complexity value of the current path; α represents the weight coefficient of the geometric complexity value of the current path; β represents the weight coefficient of the terrain type complexity value of the current path; n represents the total number of grids on the current path; n-1 represents the number of grid segments on the current path; represents the angle between the qth grid segment and the q+1th grid segment on the current path; L total represents the total length of the current path; y represents the total number of terrain types on the current path; W u Represents the weight of the u-th terrain type on the current path; f u Represents the frequency of occurrence of the u-th terrain type on the current path; Represents the geometric complexity value of the current path; Represents the terrain type complexity value of the current path.
[0157] Step S2b3: when the total energy consumption is less than or equal to the first threshold, the safety factor is greater than or equal to the second threshold, the total time is greater than or equal to the third threshold, and the comprehensive complexity value is less than or equal to the fourth threshold, the current path is output as the predetermined optimal path; when any of the above conditions is not met, the current path is marked as a non-predetermined optimal path, the next path is reselected, and step S2b2 is executed again until the predetermined optimal path is obtained;
[0158] Step S2c: Obtain an optimal starting point grid according to the predetermined optimal path.
[0159] Step S3, initializing the basic parameters of the ant colony algorithm and initializing the ant colony at the optimal starting point grid;
[0160] Step S4: select a candidate grid according to the improved state transition probability. After the ant reaches the next grid, update the taboo table and add the current grid to the taboo table.
[0161] Step S5: determine whether the ant has reached the target grid. If so, stop searching and one iteration ends. Otherwise, continue to execute step S4 until the target node is found.
[0162] Step S6, determine whether the number of iterations reaches the maximum number of iterations. If so, end and output the optimal path. If not, continue to execute step S3 until the number of iterations reaches the maximum number of iterations.
[0163] It should be noted that the terms used in the present invention are only for describing specific embodiments, rather than limiting the scope of the present application. As shown in the present specification, unless the context clearly indicates an exception, the words "one", "a", "a kind of" and / or "the" do not specifically refer to the singular, but may also include the plural. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method or device. In the absence of more restrictions, the elements defined by the sentence "include one..." do not exclude the presence of other identical elements in the process, method or device including the elements.
[0164] It should also be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", etc. should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0165] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present invention.
Claims
1. An artificial intelligence robot path planning method based on an improved ant colony algorithm, characterized in that: The following steps are involved: Step S1, using a grid method to form a grid map for robot movement, including setting multiple groups of starting point grids, a target point grid, multiple groups of obstacle grids, and multiple groups of terrain type grids; The obstacle grid represents an inaccessible area and includes obstacle information; The terrain type grid represents different terrain types, including terrain type information, wherein the terrain type information includes terrain condition information; Step S2, analyzing multiple groups of starting point grids to obtain the optimal starting point grid; Step S2a, randomly predetermining at least two paths according to multiple groups of starting point grids, one target point grid, multiple groups of obstacle grids, and multiple groups of terrain type grids; Step S2b, analyzing at least two predetermined paths to obtain a predetermined optimal path; Step S2b1, obtaining parameters for path analysis, analyzing the importance of each parameter, ranking each parameter according to the analysis result, and obtaining the top four parameters as key parameters; The key parameters are energy consumption, safety, time efficiency, and path complexity; Step S2b2, selecting one of the at least two predetermined paths, and analyzing the key parameters on the current path to obtain the total energy consumption, safety factor, total time, and comprehensive complexity value respectively; and setting a first threshold for the total energy consumption; setting a second threshold for the safety factor; setting a third threshold for the total time; and setting a fourth threshold for the comprehensive complexity value; Step S2b3: when the total energy consumption is less than or equal to the first threshold, the safety factor is greater than or equal to the second threshold, the total time is greater than or equal to the third threshold, and the comprehensive complexity value is less than or equal to the fourth threshold, the current path is output as the predetermined optimal path; when any of the above conditions is not met, the current path is marked as a non-predetermined optimal path, the next path is reselected, and step S2b2 is executed again until the predetermined optimal path is obtained; Step S2c, obtaining an optimal starting point grid according to a predetermined optimal path; Step S3, initializing the basic parameters of the ant colony algorithm and initializing the ant colony at the optimal starting point grid; Step S4: select a candidate grid according to the improved state transition probability. After the ant reaches the next grid, update the taboo table and add the current grid to the taboo table. Step S5, determine whether the ant has reached the target point grid, if so, stop searching and one iteration ends, otherwise, continue to execute step S4 until the target node is found; Step S6, determine whether the number of iterations reaches the maximum number of iterations. If so, end and output the optimal path. If not, continue to execute step S3 until the number of iterations reaches the maximum number of iterations.
2. The artificial intelligence robot path planning method based on improved ant colony algorithm according to claim 1 is characterized in that: The step S2b2 selects one of the at least two predetermined paths and analyzes the key parameters on the current path to obtain the total energy consumption, safety factor, total time, and comprehensive complexity value, including: Step S2b21, analyzing the energy consumption of the current path to obtain the total energy consumption of the current path; Step S2b22, analyzing the safety of the current path to obtain a safety factor of the current path; Step S2b23, analyzing the time efficiency of the current path to obtain the total time of the current path; Step S2b24: Analyze the path complexity of the current path, where the path complexity includes geometric complexity and terrain type complexity, to obtain a comprehensive complexity value of the current path.
3. The artificial intelligence robot path planning method based on improved ant colony algorithm according to claim 2 is characterized in that: The step S2b21, analyzing the energy consumption of the current path to obtain the total energy consumption of the current path, includes: Step S2b21.1, assigning an energy consumption value to each grid on the current path based on the terrain type information of the grid; Step S2b21.2, counting and obtaining the total number of grids on the current path; Step S2b21.3, according to the energy consumption value of each grid on the current path and the number of grids on the current path, the total energy consumption of the current path is obtained; The calculation formula for the total energy consumption of the current path is: ; Where E represents the total energy consumption of the current path; e i represents the energy consumption value of the i-th grid on the current path; n represents the total number of grids on the current path.
4. The artificial intelligence robot path planning method based on improved ant colony algorithm according to claim 2 is characterized in that: The step S2b22, analyzing the safety of the current path to obtain the safety factor of the current path, includes: Step S2b22.1, counting and obtaining the total number of obstacle grids passed on the current path; Step S2b22.2, calculate and obtain the shortest distance between each obstacle grid within a preset range passed on the current path and the current path; Step S2b22.3, evaluating each obstacle grid within the preset range passed by the current path according to the shortest distance between each obstacle grid within the preset range and the current path, and assigning a risk value to each obstacle grid according to the evaluation result; Step S2b22.4, obtaining the safety factor of the current path according to the total number of obstacle grids passed on the current path, the closest distance between each obstacle grid within a preset range and the current path, and the risk value of each obstacle grid; Among them, the calculation formula for the safety factor of the current path is: ; Among them, S represents the safety factor of the current path; r m Represents the risk value of the mth obstacle grid on the current path; d m Represents the shortest distance between the mth obstacle grid and the current path; M represents the total number of obstacle grids passed on the current path.
5. The artificial intelligence robot path planning method based on improved ant colony algorithm according to claim 2 is characterized in that: The step S2b23, analyzing the time efficiency of the current path to obtain the total time of the current path, includes: Step S2b23.1, based on the terrain condition information of the grid, obtaining the actual length of each grid on the current path; Step S2b23.2, assigning a speed value to each grid on the current path based on the terrain type information of the grid; Step S2b23.3, according to the actual length of each grid on the current path and the speed value of each grid on the current path, the total time of the current path is obtained; The calculation formula for the total time of the current path is: ; Where T represents the total time of the current path; L i Represents the actual length of the i-th grid on the current path; V i Represents the speed value of the i-th grid on the current path; n represents the total number of grids on the current path.
6. The artificial intelligence robot path planning method based on improved ant colony algorithm according to claim 2 is characterized in that: The step S2b24 analyzes the path complexity of the current path, wherein the path complexity includes geometric complexity and terrain type complexity, and obtains a comprehensive complexity value of the current path, including: Step S2b24a, analyzing the geometric complexity of the current path to obtain a geometric complexity value of the current path; Step S2b24b, analyzing the terrain type complexity of the current path to obtain the terrain type complexity value of the current path; Step S2b24c, obtaining the comprehensive complexity value of the current path according to the geometric complexity value of the current path and the terrain type complexity value of the current path.
7. The artificial intelligence robot path planning method based on improved ant colony algorithm according to claim 6, characterized in that: The step S2b24a, analyzing the geometric complexity of the current path to obtain the geometric complexity value of the current path, includes: Step S2b24a.1, based on the actual length of each grid on the current path, determine the total length of the current path; Step S2b24a.2, based on the terrain condition information of the grid, obtain the direction vector of each grid on the current path and the direction vector of the next grid of each grid on the current path, and then use the vector dot product method to obtain the angle between the direction vector of each grid and the direction vector of the next grid of each grid; Step S2b24a.3, based on each grid on the current path and the next grid of each grid, determine the number of grid segments of the current path; Step S2b24a.4, obtain the geometric complexity value of the current path according to the total length of the current path, the angle between the direction vector of each grid and the direction vector of the next grid of each grid, and the number of grid segments of the current path.
8. The artificial intelligence robot path planning method based on improved ant colony algorithm according to claim 6, characterized in that: The step S2b24b, analyzing the terrain type complexity of the current path to obtain the terrain type complexity value of the current path, includes: Step S2b24b.1, based on the terrain type information included in the terrain type grid, count the terrain types on the current path to obtain the total number of terrain types; Step S2b24b.2, counting the number of occurrences of each terrain type on the current path to obtain the frequency of occurrence of each terrain type; Step S2b24b.3, evaluate the movement difficulty of the robot under each terrain type on the current path, and sort each terrain type according to the evaluation result, and assign a weight to each terrain type based on the sorting result; Step S2b24b.4: Obtain the terrain type complexity value of the current path according to the total number of terrain types on the current path, the frequency of occurrence of each terrain type on the current path, and the weight of each terrain type on the current path.
9. The artificial intelligence robot path planning method based on improved ant colony algorithm according to claim 6, characterized in that: The calculation formula for the comprehensive complexity value of the current path is: ; Among them, p represents the comprehensive complexity value of the current path; α represents the weight coefficient of the geometric complexity value of the current path; β represents the weight coefficient of the terrain type complexity value of the current path; n represents the total number of grids on the current path; n-1 represents the number of grid segments on the current path; represents the angle between the qth grid segment and the q+1th grid segment on the current path; L total represents the total length of the current path; y represents the total number of terrain types on the current path; W u Represents the weight of the u-th terrain type on the current path; f u Represents the frequency of occurrence of the u-th terrain type on the current path; Represents the geometric complexity value of the current path; Represents the terrain type complexity value of the current path.
