Robot path planning method based on bidirectional beetle antennae search
By placing longhorn beetles at the starting point and the end point for bidirectional search, and combining the artificial potential field method and high-order polynomial function fitting to optimize the path, the problem of slow convergence of the longhorn beetle whisker search algorithm was solved, and efficient and smooth path planning was achieved.
Patent Information
- Application Number
- CN202510664635.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-09-23
AI Technical Summary
The existing beetle whisker search algorithm has a slow convergence speed in path planning, resulting in low path planning efficiency and poor practicality.
A bidirectional beetle whisker search method is adopted. A beetle is placed at the starting point and the end point respectively. A bidirectional search is performed using an improved beetle whisker search algorithm. The path is optimized by combining the artificial potential field method and high-order polynomial function fitting to generate a smooth optimal path.
The efficiency and convergence speed of path planning are improved, an efficient and smooth optimal path is generated, and the practicality of path planning is improved.
Smart Images

Figure CN120686809A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of path search, and in particular to a robot path planning method based on bidirectional longhorn beetle whisker search. Background Art
[0002] Currently, robot path planning is a key research area in the fields of automation and intelligent systems. It involves determining whether robots can safely and efficiently navigate complex environments. The development of path planning technology not only promotes advancements in automation but also provides safe and reliable technical support for autonomous robot movement.
[0003] Robot path planning technology typically integrates multiple algorithms and models, including classic graph search algorithms, sampling-based methods, artificial intelligence techniques, and multi-objective optimization. Graph search algorithms include the A-Star Algorithm, sampling-based methods include Rapid Exploration Random Trees (RRT), and artificial intelligence techniques include reinforcement learning and deep learning. The Longicorn Whisker Search Algorithm, with its simplicity, efficiency, adaptability, and optimization performance, has become a powerful tool for solving path planning problems.
[0004] However, the existing beetle whisker search algorithm has a slow convergence speed in path planning, resulting in low efficiency and poor practicality of path planning.
[0005] Therefore, the low efficiency of path planning has become a technical problem that needs to be solved urgently. Summary of the Invention
[0006] The present invention provides a robot path planning method based on bidirectional longhorn beetle whisker search, which solves the technical problem of low path planning efficiency.
[0007] In order to solve the above technical problems, the technical solutions adopted by the present invention are as follows:
[0008] A robot path planning method based on bidirectional beetle whisker search includes the following steps:
[0009] Step S1: Obtain obstacles, feasible areas, starting points and end points to form an environment model;
[0010] Step S2: Place the first day beetle at the starting point and the second day beetle at the end point. Each day beetle always moves towards another day beetle based on the beetle whisker search algorithm to obtain the planned path.
[0011] A further technical solution is that: in step S1, the area to be planned is abstracted into a two-dimensional plane and converted into a grayscale image, and obstacles and feasible areas are distinguished by grayscale values, and obstacles are abstracted into circles or rectangles.
[0012] A further technical solution is that: in step S1, a grayscale value of 0 represents a feasible area, and a grayscale value of 255 represents an obstacle.
[0013] A further technical solution is that in step S2, the direction and length of the two tentacles of each beetle are set to be freely variable, the initial direction of the two tentacles of each beetle is set to be consistent with the direction of the beetle, and can extend to both sides with the direction of the beetle as the center line, the initial length of the two tentacles of each beetle is L, and the initial spacing D=0.
[0014] A further technical solution is: further comprising a search method in step S3, wherein the longicorn beetle whisker search algorithm in step S2 is improved by step S3, and step S3 specifically comprises the following steps:
[0015] Step S31: When both tentacles of each beetle do not touch any obstacle, each beetle moves in the direction of its own current direction with a step length t;
[0016] Step S32: When both of the tentacles of any longhorn beetle collide with an obstacle, the two tentacles of the longhorn beetle extend in both directions with a step length Δd, with the current direction of the longhorn beetle as the center line, until one of the tentacles does not collide with the obstacle, and the longhorn beetle moves in the direction of the tentacle;
[0017] Step S33: After the two tentacles of the longhorn beetle are extended, if neither of them touches the obstacle, the distances from the ends of the two tentacles to the facing longhorn beetle are compared, and the direction of the tentacle with the shorter distance is selected as the moving direction of the longhorn beetle;
[0018] Step S34: After the longicorn beetle moves with a step length of t, the coordinates of the two longicorn beetles after the movement are updated to the new starting point or end point respectively, and it is determined whether there is an obstacle on the line connecting the two longicorn beetles at the current position. If there is no obstacle, the two points between the two longicorn beetles are connected, and step S34 ends; if there is an obstacle, the direction of each longicorn beetle is further adjusted to face the longicorn beetle, and the state of the two tentacles of each longicorn beetle is restored to the initial state, and the initial state of the tentacles includes the initial length and initial spacing;
[0019] Step S35: Continue the next search until the two longhorn beetles meet. The set of all nodes that the two longhorn beetles have passed through is an initial feasible path, and the search algorithm of step S3 ends.
[0020] A further technical solution is: it also includes step S4, using the artificial potential field method to further optimize the initial feasible path obtained in step S3, increasing the attraction to the longhorn beetle with the end point as the center of gravity, and then superimposing the randomly generated direction vector with the direction of gravity, and using the superimposed vector to replace the random vector as the direction of the longhorn beetle's antennae to accelerate the convergence speed of the longhorn beetle antennae search algorithm.
[0021] A further technical solution is: further comprising step S5, using a greedy algorithm to remove redundant points in the initial feasible path to obtain an optimized path.
[0022] A further technical solution is: further comprising step S6, fitting the nodes of the path using a high-order polynomial function to obtain a fitted path.
[0023] The beneficial effects of adopting the above technical solution are:
[0024] A robot path planning method based on bidirectional longhorn beetle search includes the following steps: Step S1: Obstacles, a feasible area, a starting point, and an end point are obtained to form an environmental model; Step S2: A first longhorn beetle is placed at the starting point and a second longhorn beetle is placed at the end point. Each longhorn beetle moves toward the other longhorn beetle based on a longhorn beetle search algorithm to obtain a planned path. By placing a longhorn beetle at each starting point and end point to perform a bidirectional search, the method speeds up the process of finding a feasible solution, thereby improving path planning efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flow chart of this application;
[0026] Figure 2 is a flowchart of generating the initial feasible path in step S3;
[0027] Figure 3 It is an experimental simulation diagram for finding a feasible path. DETAILED DESCRIPTION
[0028] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is in no way intended to limit the present application and its application or use. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0029] In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the present application may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present application. Therefore, the present application is not limited to the specific embodiments disclosed below.
[0030] Example 1:
[0031] like Figure 1 As shown, the present invention discloses a robot path planning method based on bidirectional longhorn beetle whisker search, which includes the following steps.
[0032] Step S1: Obtain obstacles, feasible areas, starting points and end points to form an environment model.
[0033] like Figure 3 Figure 2 shows an experimental simulation of the improved bidirectional longhorn beetle whisker search algorithm for finding a feasible path. For environmental modeling, the planned area is abstracted into a two-dimensional plane. Grayscale values are used to distinguish obstacles from the feasible area, and the starting and ending coordinates are marked. The lower right corner of the figure is the starting point, and the upper left corner is the ending point. Obstacles are abstracted as rectangles.
[0034] In step S1, the planar map to be planned is processed, the search boundary is set and converted into a grayscale image, the grayscale values 0 and 255 are used to distinguish the feasible area and the obstacles, and the starting point P is set. start (x s ,y s ), end point P goal (x g ,y g ).
[0035] Step S2: Place the first day beetle at the starting point and the second day beetle at the end point. Each day beetle always moves towards another day beetle based on the beetle whisker search algorithm to obtain the planned path.
[0036] Placing a longicorn at the starting point and the end point for bidirectional search improves the speed of finding a feasible solution.
[0037] In step S2, the initial length of the antennae of the two longhorn beetles is L, the initial spacing D=0, and they are always facing each other, that is, the two longhorn beetles are always facing each other. The direction and length of the two antennae of each longhorn beetle are set to be freely variable, and the initial direction of the two antennae of each longhorn beetle is set to be consistent with the direction of the longhorn beetle, and can extend to both sides with the direction of the longhorn beetle as the center line.
[0038] Step S3: improving the search method of the two longhorn beetles in step S2 so that the two longhorn beetles can quickly meet and generate an initial feasible path.
[0039] like Figure 2 As shown in FIG, the improved bidirectional longhorn beetle whisker search algorithm generates a basic flow chart of the initial feasible path, the search process. In step S3, the search method for the two longhorn beetles at the starting point and the end point is improved, and the specific search steps are as follows.
[0040] Step S31: When the tentacles of the longhorn beetle do not touch the obstacle, the two longhorn beetles move along the current direction with a certain step length t, and calculate the horizontal coordinates of the two tentacles of the starting longhorn beetle at this time: x ps =Lcosθ+x s , vertical coordinate: y ps=Lsinθ+y s , where θ is the inclination angle of the straight line between the starting point and the end point.
[0041] Step S32: When both tentacles collide with the obstacle, the two tentacles of the longhorn beetle begin to extend to both sides with a step length △d with the current direction of the longhorn beetle as the center line, until one of the tentacles does not collide with the obstacle, and then the longhorn beetle moves in the direction of the tentacle.
[0042] When both antennae touch the obstacle, the distance between the two antennae of the longhorn beetle is D. xu =D+△d, the length of the tentacle at this time Keep the search range as a straight line perpendicular to the starting and ending points. The horizontal coordinate of the end of the left antenna of the longhorn beetle is:
[0043]
[0044] Vertical axis:
[0045]
[0046] In formula 1, k sg is the slope of the straight line between the starting point and the end point, k l is the slope of the straight line where the left whisker is located, k l =tan(θ+α), For the right beetle, it is only necessary to change k l Replace with k r , and k r =tan(θ-α).
[0047] like Figure 3 As shown, the size of △d is continuously adjusted until one of the tentacles no longer touches the obstacle, and the longhorn beetle then moves in the direction of the tentacle.
[0048] Step S33: After the beetle's tentacles are extended, if they no longer touch any obstacles, the distances from the ends of the two tentacles to the facing beetle are compared, and the direction of the tentacle with the shorter distance is selected as the beetle's moving direction.
[0049] Step S34: After the longicorn moves with a step length of t, determine whether there is an obstacle on the line connecting the two longicorns at the current position. If not, connect the two points and end the algorithm. Otherwise, continue to adjust the direction of the longicorn to face the longicorn, restore the length and spacing of the two tentacles, and update the starting point or end point to the coordinates of the two longicorns after moving.
[0050] Restore the length of the two tentacles l xu =L, spacing D = 0, update starting point P start or end point P goalare the coordinates of the two longicorns after they moved.
[0051] Step S35: Continue the next search until the algorithm ends when the two longhorn beetles meet. The set of all nodes that the two longhorn beetles have passed through is an initial feasible path.
[0052] like Figure 3 As shown in the figure, the algorithm test results, the curve on the figure is an initial feasible path.
[0053] Step S4: Optimizing the beetle beetle search algorithm using the artificial potential field method and adjusting the path fitness calculation standard to optimize the initial feasible path.
[0054] In step S4, the artificial potential field method is used to optimize the beetle beetle search algorithm to further optimize the initial feasible path obtained above, and an attraction is added to the beetle with the end point as the gravitational center. The gravitational potential function is: Where α is the gravitational coefficient, D 2 (P s ,P g ) is the square of the Euclidean distance from the starting point to the end point.
[0055] Then, a direction vector d=(x d ,y d ), the generated direction vector is superimposed with the gravity vector, and the superimposed vector is used to replace the random vector as the direction of the beetle's tentacles to speed up the convergence of the algorithm. As the direction vector of the longicorn's left and right whiskers.
[0056] The coordinates of the left and right whiskers of the longicorn are: Where P is the current coordinate of the beetle, L is the length of the beetle's whiskers, and the fitness of the left and right beetles is calculated. The one with the higher fitness value is selected as the beetle's moving direction. Multiple iterations are performed to find the feasible path with the maximum fitness value. The fitness function of the beetle whisker search algorithm is calculated as follows:
[0057]
[0058] In formula 3, W1 and W2 are weight coefficients, d(i,i+1) is the distance from the i-th node to the i+1-th node, and cosθ (l,l+1) is the cosine of the angle between the moving direction of the lth segment and the moving direction of the l+1th segment, sgn(l) is the sign function, which is -1 if the path hits an obstacle and 1 otherwise.
[0059] Step S5: Use the greedy strategy to remove redundant points in the path to shorten the total length of the path.
[0060] In step S5, the redundant path is optimized by combining the greedy algorithm pruning, connecting the remaining nodes with the current node as the starting point, and selecting the link with the most intermediate jump nodes among the links that have not collided with obstacles to optimize the current path.
[0061] Step S6: Using a neural network to fit a high-order function to the path points to make the path smooth.
[0062] In step S6, a high-order polynomial function is used to fit a smooth final path. Considering that the fitted function must pass through the starting point and the end point, the coordinate system is adjusted to use the starting point as the coordinate origin and the line connecting the starting point and the end point as the positive direction of the x-axis. The function to be fitted is:
[0063]
[0064] In Equation 4, a is the horizontal coordinate of the end point. The adjusted function can definitely pass through the starting point (0,0) and the end point (a,0). The coordinates of all nodes on the path and the midpoint coordinates of two adjacent nodes are used as the data set to fit the final smooth path curve.
[0065] The goal of this application is to abstract the area to be planned into a two-dimensional plane through environmental modeling, and process the image to distinguish feasible areas from obstacles. Then, the search method of the longhorn beetle whisker algorithm is improved, and a two-way search is performed from the starting point and the end point, so that the two longhorn beetles can meet quickly, thereby generating a feasible initial path. In addition, the artificial potential field method is used to optimize the longhorn beetle whisker algorithm to further optimize the initial path. Finally, a high-order polynomial function is used to fit the path nodes, and finally a smooth optimal path is generated.
[0066] Due to the adoption of the technical solution of the present application, the beneficial technical effects of the present application are as follows.
[0067] like Figure 1 Figure 2 shows a flow chart of a robot path planning method based on an improved bidirectional beetle whisker search algorithm. Step S2 addresses the technical issue of low path planning efficiency in the original beetle whisker search algorithm. By using the improved bidirectional beetle whisker search algorithm, a bidirectional search is performed starting from both the starting point and the end point, which increases the speed of finding a feasible solution and thereby improves path planning efficiency.
[0068] Step S3 adjusts the tentacles of the longhorn beetle to stretch freely so that the longhorn beetle can avoid obstacles smoothly. The improved algorithm can avoid obstacles and quickly find a feasible path.
[0069] Step S4 addresses the technical issue of slow convergence in path planning with the original longhorn beetle whisker search algorithm. By introducing an artificial potential field method, the algorithm is improved to further optimize the initial path. To further optimize the initial feasible path, this application adjusts the algorithm's fitness calculation method and uses an artificial potential field method to improve the original longhorn beetle whisker search algorithm, significantly increasing its convergence speed.
[0070] Finally, the path nodes are fitted using a function to generate a smooth final path and a final smooth optimal path.
[0071] In summary, the method steps of this application mainly divide path planning into three steps: environment modeling, finding feasible paths, and path optimization. The path planning is efficient, converges quickly, and is practical.
[0072] Example 2:
[0073] The present invention discloses a robot path planning method based on bidirectional longhorn beetle whisker search, comprising steps S1 and S2. Step S1: Obstacles, a feasible area, a starting point, and an end point are obtained to form an environment model. Step S2: A first longhorn beetle is placed at the starting point and a second longhorn beetle is placed at the end point. Each longhorn beetle always moves toward the other longhorn beetle based on the longhorn beetle whisker search algorithm to obtain a planned path. The similarities with Example 1 are not repeated here.
[0074] Placing a longicorn at the starting point and the end point for bidirectional search increases the speed of finding a feasible solution, thereby improving the efficiency of path planning.
[0075] Example 3:
[0076] The present invention discloses a robot path planning method based on bidirectional longhorn beetle search, comprising steps S1 and S2. Step S1: Obtain an obstacle, a feasible area, a starting point, and an end point to form an environment model. Step S2: Place the first longhorn beetle at the starting point and the second longhorn beetle at the end point. Each longhorn beetle always moves toward the other longhorn beetle based on the longhorn beetle search algorithm to obtain the planned path. The similarities with Example 2 are not repeated here. The difference is that in step S1, the obstacle is abstracted as a circle.
Claims
1. A robot path planning method based on bidirectional beetle whisker search, characterized by: The following steps are included: Step S1: Obtain obstacles, feasible areas, starting points and end points to form an environment model; Step S2: Place the first day beetle at the starting point and the second day beetle at the end point. Each day beetle always moves towards another day beetle based on the beetle whisker search algorithm to obtain the planned path.
2. A robot path planning method based on bidirectional longhorn beetle whisker search according to claim 1, characterized in that: In step S1, the area to be planned is abstracted into a two-dimensional plane and converted into a grayscale image. Obstacles and feasible areas are distinguished by grayscale values. Obstacles are abstracted into circles or rectangles.
3. A robot path planning method based on bidirectional longhorn beetle whisker search according to claim 2, characterized in that: In step S1, a grayscale value of 0 represents a feasible area, and a grayscale value of 255 represents an obstacle.
4. The robot path planning method based on bidirectional longhorn beetle whisker search according to claim 1, characterized in that: In step S2, the direction and length of the two tentacles of each beetle are set to be freely variable. The initial direction of the two tentacles of each beetle is set to be consistent with the direction of the beetle, and can extend to both sides with the direction of the beetle as the center line. The initial length of the two tentacles of each beetle is L, and the initial spacing D=0.
5. The robot path planning method based on bidirectional longhorn beetle whisker search according to claim 1, characterized in that: The method further includes step S3, wherein the beetle whisker search algorithm in step S2 is improved by step S3. Step S3 specifically includes the following steps: Step S31: When both tentacles of each beetle do not touch any obstacle, each beetle moves in the direction of its own current direction with a step length t; Step S32: When both of the tentacles of any longhorn beetle collide with an obstacle, the two tentacles of the longhorn beetle extend in both directions with a step length Δd, with the current direction of the longhorn beetle as the center line, until one of the tentacles does not collide with the obstacle, and the longhorn beetle moves in the direction of the tentacle; Step S33: After the two tentacles of the longhorn beetle are extended, if neither of them touches the obstacle, the distances from the ends of the two tentacles to the facing longhorn beetle are compared, and the direction of the tentacle with the shorter distance is selected as the moving direction of the longhorn beetle; Step S34: After the longicorn beetle moves with a step length of t, the coordinates of the two longicorn beetles after the movement are updated to the new starting point or end point respectively, and it is determined whether there is an obstacle on the line connecting the two longicorn beetles at the current position. If there is no obstacle, the two points between the two longicorn beetles are connected, and step S34 ends; if there is an obstacle, the direction of each longicorn beetle is further adjusted to face the longicorn beetle, and the state of the two tentacles of each longicorn beetle is restored to the initial state, and the initial state of the tentacles includes the initial length and initial spacing; Step S35: Continue the next search until the two longhorn beetles meet. The set of all nodes that the two longhorn beetles have passed through is an initial feasible path, and the search algorithm of step S3 ends.
6. A robot path planning method based on bidirectional longhorn beetle whisker search according to claim 5, characterized in that: It also includes step S4, which uses the artificial potential field method to further optimize the initial feasible path obtained in step S3, increases the attraction to the longhorn beetle with the end point as the gravitational center, and then superimposes the randomly generated direction vector with the direction of gravity, and uses the superimposed vector to replace the random vector as the direction of the longhorn beetle's antennae to accelerate the convergence speed of the longhorn beetle antennae search algorithm.
7. A robot path planning method based on bidirectional beetle whisker search according to claim 6, characterized in that: The method further includes step S5, wherein a greedy algorithm is used to remove redundant points in the initial feasible path to obtain an optimized path.
8. The robot path planning method based on bidirectional beetle whisker search according to claim 7, characterized in that: The method further includes step S6 of fitting the nodes of the path using a high-order polynomial function to obtain a fitted path.
Citation Information
Cited By
Local obstacle avoidance path planning method, system and device and storage medium
CN119714335A
A local obstacle avoidance path planning method, system, device and storage medium
CN119714335B