Global path optimization method and system
By determining the straight line path and the straight line subpath in the global path planning algorithm, the problem of high path tortuousness in the existing technology is solved, and a smoother and more efficient path planning is achieved.
Patent Information
- Application Number
- CN202510435606.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-05-09
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The paths generated by the existing global path planning algorithm are highly tortuous, resulting in lengthy paths in complex environments, increasing the energy consumption and time delay of the robot or agent during actual movement.
The initial path is obtained by a preset global path planning algorithm, and the straight path between the initial starting point and the end point is determined as the target path. If there are obstacles, the straight sub-path is determined based on the path point until there are no obstacles, and the final target path is combined.
It effectively reduces the tortuousness of the generated target path, reduces the calculation amount and number of path points in path planning, and improves the smoothness and efficiency of the path.
Smart Images

Figure CN119958573A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of path planning, and in particular, to a global path optimization method and system. Background Art
[0002] As an important part of the path planning field, global path planning has gone through several stages of development. Early global path planning mainly relied on theoretical exploration and preliminary practice. Researchers used mathematical models and geometric methods to find the optimal path from the starting point to the target point. However, due to the limitations of computing power and data processing capabilities, these methods have many limitations in practical applications. With the rapid development of computer technology, global path planning has entered the initial development stage of algorithms, and there have been many algorithms such as Dijkstra algorithm, A Algorithms and other classic algorithms can effectively search for the optimal path in a static environment, laying the foundation for subsequent development. After entering the modern intelligent stage, the global path planning algorithm continues to integrate new technologies and concepts, such as intelligent optimization algorithms (ant colony algorithms, genetic algorithms, etc.), machine learning, and environmental perception technologies, which significantly improves the performance of global path planning in dynamic and complex environments and can better adapt to the diverse needs of practical applications.
[0003] The global path planning algorithm plays a vital role in global path planning. It can search for an optimal path that meets specific requirements from the starting point to the target point based on the pre-set environmental map information. Among them, the Dijkstra algorithm is a classic breadth-first search algorithm. It continuously expands the nodes closest to the starting point and eventually finds the global shortest path. However, the algorithm needs to traverse a large number of nodes during the calculation process, resulting in a large amount of calculation and a long time consumption. The algorithm introduces a heuristic function based on the Dijkstra algorithm, which prioritizes the search direction by estimating the cost from the current node to the target node, thereby improving the search efficiency. However, the path obtained is not an absolute global optimum. The RRT algorithm (rapid random tree algorithm) uses random sampling to gradually build a search tree in the environment space. It has the advantages of not requiring precise modeling of the environment and fast search speed. It is especially suitable for path planning in high-dimensional space and complex environments, but the path it generates may be uneven.
[0004] Although the above global path planning algorithms have achieved certain results in their respective application scenarios, they still have some shortcomings in practical applications, among which the most prominent problem is that the generated paths are highly tortuous. For example, the Dijkstra algorithm is prone to generate lengthy paths in complex environments due to its breadth-first nature; Although the algorithm improves the search efficiency through the heuristic function, its path planning results may still be affected by the design of the heuristic function, resulting in an unsmooth path; due to the characteristics of random sampling, the paths generated by the RRT algorithm often present tortuous and irregular characteristics. These problems not only affect the quality of the path, but may also cause unnecessary energy consumption and time delays in the actual movement of robots or other intelligent agents, limiting the effectiveness and efficiency of global path planning in practical applications. Summary of the invention
[0005] The embodiments of the present invention provide a global path optimization method and system to at least solve the problem of high tortuosity of the path generated by the global path planning algorithm in the related art.
[0006] According to one embodiment of the present invention, a global path optimization method is provided, comprising: obtaining an initial path based on a preset global path planning algorithm; wherein the initial path comprises: an initial starting point, an initial end point, and at least one way point; determining a straight path between the initial starting point and the initial end point as a first path, and in the case where there are no obstacles in the first path, determining the first path as a target path; in the case where there are obstacles in the first path, determining at least two straight sub-paths based on the way points, until there are no obstacles in the straight sub-paths, determining the straight sub-path as a sub-path of the target path to obtain the target path.
[0007] According to another embodiment of the present invention, a global path optimization system is also provided, including: an acquisition module, which obtains an initial path based on a preset global path planning algorithm; wherein the initial path includes: an initial starting point, an initial end point, and at least one way point; an optimization module, which is used to determine that a straight path between the initial starting point and the initial end point is a first path, and when there are no obstacles in the first path, the first path is determined to be a target path; or, when there are obstacles in the first path, at least two straight sub-paths are determined based on the way points, until there are no obstacles in the straight sub-paths, and the straight sub-path is determined as a sub-path of the target path to obtain the target path.
[0008] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, wherein the computer program executes the steps in any of the above method embodiments when executed by a processor.
[0009] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0010] According to yet another embodiment of the present invention, a computer program product is provided, comprising computer instructions, which implement the steps in any of the above method embodiments when executed by a processor.
[0011] Through one of the embodiments of the present invention, by finding and confirming one or more straight line sub-paths between the initial starting point and the initial end point, a target path is obtained when there are no obstacles in all the straight line sub-paths in the obtained target path, and the path planning between the initial starting point and the initial end point is completed. First, for the path generated based on the global path planning algorithm in the related art, the embodiment of the present invention can use a global path planning algorithm with less computational complexity to obtain an initial path, and the initial path may not be the optimal path between the initial starting point and the initial end point, reducing the number of iterations of the algorithm, thereby reducing the amount of computation. Secondly, since the straight line path between the starting point and the end point (including: the starting point and the end point of the initial path, the starting point and the end point of the sub-path) is determined each time, the waypoints between the starting point and the end point can be effectively reduced (for example, there may be multiple waypoints between the starting point and the end point before executing the method of the embodiment of the present invention, and the path formed by the multiple waypoints may need to change the path direction at each waypoint, so the tortuosity is high). Therefore, the problem of high tortuosity of the path generated based on the global path planning algorithm in the related art is solved, thereby achieving the effect of reducing the tortuosity of the generated target path. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0013] Figure 1 is a structural schematic diagram of a computer terminal for executing a global path optimization method according to an embodiment of the present invention;
[0014] Figure 2 is a flow chart of a global path optimization method according to an embodiment of the present invention;
[0015] Figure 3 is a flowchart of a method for determining at least two straight line sub-paths based on waypoints according to an embodiment of the present invention;
[0016] Figure 4is a schematic diagram of determining a target waypoint according to an embodiment of the present invention;
[0017] Figure 5 is a schematic diagram of another method for determining a target waypoint according to an embodiment of the present invention;
[0018] Figure 6 is a flow chart of a method for successively determining sub-paths of a target path in a direction from an initial starting point to an initial end point according to an embodiment of the present invention;
[0019] Figure 7 is a schematic diagram of continuing to confirm a sub-path of a target path when an obstacle exists in a third straight line sub-path according to an embodiment of the present invention;
[0020] Figure 8 is a schematic diagram of the structure of a global path optimization system according to an embodiment of the present invention;
[0021] Fig. 9 Based on RRT Schematic diagram of the target path obtained by the path planning algorithm;
[0022] Fig.10 is a schematic diagram of a target path obtained based on a global path optimization method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0025] The method embodiments provided in the embodiments of the present invention can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 is a schematic diagram of the structure of a computer terminal for executing a global path optimization method according to an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0026] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the global path optimization method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0027] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a gateway so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0028] In this embodiment, a global path optimization method is provided. Figure 2 is a flow chart of a global path optimization method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0029] Step S201, obtaining an initial path based on a preset global path planning algorithm; wherein the initial path includes: an initial starting point, an initial end point, and at least one waypoint;
[0030] In an exemplary implementation, the global path planning algorithm of the related art may generally adopt methods such as increasing the number of iterations to plan the optimal path between the specified starting point and the end point. However, as the number of iterations increases, the amount of computation may increase exponentially, and the computational cost is high. Therefore, the embodiment of the present invention may first use a preset global path planning algorithm to obtain an initial path (for example, by reducing the number of iterations, etc.), and the initial path may not be the optimal path between the initial starting point and the initial end point. The preset global path planning algorithm may be the Dijkstra algorithm, A Algorithms, RRT One or more of algorithm, ant colony algorithm, and genetic algorithm.
[0031] Step S202, determining a straight path between an initial starting point and an initial end point as a first path, and if there are no obstacles in the first path, determining the first path as a target path;
[0032] In an exemplary implementation, the initial starting point and the initial end point in the initial path are first identified, a straight path is determined between the initial starting point and the initial end point, and whether there is interference from obstacles in the straight path is identified. For example, image recognition and other methods can be used to determine whether there are obstacles in the straight path between the initial starting point and the initial end point. If it is identified that there are no obstacles in the straight path between the initial starting point and the initial end point, it means that the straight path can be the target path, and the straight path can be determined as the target path.
[0033] Step S203, when there are obstacles in the first path, at least two straight line sub-paths are determined based on the waypoints, until there are no obstacles in the straight line sub-paths, and the straight line sub-paths are determined as sub-paths of the target path to obtain the target path.
[0034] In an exemplary embodiment, if it is identified that there is an obstacle in a straight path between the initial starting point and the initial end point, it means that this straight path is not the target path and needs to be replanned. For example, the waypoints in the initial path are sampled, and two continuous straight sub-paths are determined each time using the starting point, the waypoints, and the end point, such as straight sub-path one and straight sub-path two. Among them, straight sub-path one is a straight path close to the starting point, and straight sub-path two is a straight path close to the starting end point. First, confirm whether there is an obstacle in straight sub-path one. If there is no obstacle in straight sub-path one, it means that straight sub-path one meets the requirements and is determined as a sub-path of the target path. Then determine whether there is an obstacle in straight sub-path two. If there is no obstacle in straight sub-path two, it means that straight sub-path two meets the requirements and is determined as a sub-path of the target path. Then straight sub-path one and straight sub-path two can be determined as the target path.
[0035] If there is an obstacle in the straight sub-path 2, it means that the straight sub-path 2 does not meet the requirements, and the waypoints in the original initial path are continued to be sampled in the straight sub-path 2, and the path after the straight sub-path 1 is divided into straight sub-path 3 and straight sub-path 4 based on the waypoints. Among them, the end point of the straight sub-path 1 is determined to be the starting point of the straight sub-path 3, and the waypoint is the end point of the straight sub-path 3. The starting point of the straight sub-path 4 is the waypoint, and the initial end point is the end point of the straight sub-path 4. Continue to judge whether there are obstacles in the straight sub-path 3 and the straight sub-path 4, and repeat the above process until there are no obstacles in the straight sub-path with the initial end point as the end point. Then, multiple straight sub-paths can be obtained, and there are no obstacles in each straight sub-path. The multiple straight sub-paths are connected in sequence according to the order of the sub-paths determined as the target path to obtain the final target path.
[0036] Through the above steps S201 to S203, by searching and confirming one or more straight line sub-paths between the initial starting point and the initial end point, a target path is obtained when there are no obstacles in all the straight line sub-paths in the obtained target path, and the path planning between the initial starting point and the initial end point is completed. First, for the path generated based on the global path planning algorithm in the related art, the embodiment of the present invention can use a global path planning algorithm with less computational complexity to obtain an initial path, and the initial path may not be the optimal path between the initial starting point and the initial end point, reducing the number of iterations of the algorithm, thereby reducing the amount of computation. Secondly, since the straight line path between the starting point and the end point (including: the starting point and the end point of the initial path, the starting point and the end point of the sub-path) is determined each time, the waypoints between the starting point and the end point can be effectively reduced (for example, there may be multiple waypoints between the starting point and the end point before executing the method of the embodiment of the present invention, and the path formed by the multiple waypoints may need to change the path direction at each waypoint, so the tortuosity is high). Therefore, the problem of high tortuosity of the path generated based on the global path planning algorithm in the related art is solved, thereby achieving the effect of reducing the tortuosity of the generated target path.
[0037] Figure 3 is a flow chart of a method for determining at least two straight line sub-paths based on waypoints according to an embodiment of the present invention. Figure 3 As shown, in one embodiment, determining at least two straight line sub-paths based on the waypoints includes:
[0038] Step S301, determining one of the waypoints in the initial path as the target waypoint;
[0039] In an exemplary embodiment, for the first straight line sub-path that needs to be determined, a waypoint in the initial path may be selected as the target waypoint.
[0040] Step S302, determining a second straight line sub-path and a third straight line sub-path based on the target waypoint; wherein, in the second straight line sub-path: the initial starting point is the first starting point, and the target waypoint is the first end point; in the third straight line sub-path: the target waypoint is the first starting point, and the initial end point is the first end point;
[0041] In an exemplary embodiment, based on the target waypoint, two continuous straight line sub-paths (e.g., a second straight line sub-path and a third straight line sub-path) can be determined, wherein the second straight line sub-path starts from the initial starting point and ends at the target waypoint, and the third straight line sub-path starts from the target waypoint and ends at the initial end point.
[0042] Step S303, when there is no obstacle in the second straight line sub-path, determining the second straight line sub-path as a sub-path of the target path;
[0043] In an exemplary implementation, it is first determined whether there is an obstacle in the second straight line sub-path based on an algorithm such as image recognition. If there is no obstacle in the second straight line sub-path, the second straight line sub-path meets the requirements, and the second straight line sub-path can be determined as a sub-path of the target path. That is, the first straight line sub-path is determined.
[0044] Step S304: if there is no obstacle in the third straight line sub-path, determine the third straight line sub-path as a sub-path of the target path;
[0045] In an exemplary embodiment, since the third straight line sub-path is continuous with the second straight line sub-path, after the second straight line sub-path is determined as a sub-path of the target path, it is necessary to verify whether the third straight line sub-path meets the requirements. Based on algorithms such as image recognition, if there are no obstacles in the third straight line sub-path, the third straight line sub-path meets the requirements, and the third straight line sub-path can be determined as a sub-path of the target path. That is, the second straight line sub-path is determined.
[0046] Step S305: obtaining a target path based on the second straight line sub-path and the third straight line sub-path.
[0047] In an exemplary embodiment, since the second straight line sub-path and the third straight line sub-path are continuous, and the second straight line sub-path starts from the initial starting point, and the third straight line sub-path ends at the initial end point, when there are no obstacles in the second straight line sub-path and there are no obstacles in the third straight line sub-path, that is, the second straight line sub-path and the third straight line sub-path both meet the requirements, then the path formed by the combination of the continuous second straight line sub-path and the third straight line sub-path can be determined as the final target path.
[0048] In one embodiment, determining one of the waypoints in the initial path as the target waypoint includes: determining one of the waypoints in the initial path as the target waypoint along the direction from the initial end point to the initial starting point.
[0049] In one embodiment, one of the waypoints in the initial path is determined as the target waypoint along the direction from the initial end point to the initial starting point, including: along the direction from the initial end point to the initial starting point, the waypoints that are a preset number of times away from the initial end point are determined as the target waypoints in sequence until there are no obstacles in the second straight line sub-path; wherein the preset number increases with the number of times the target waypoint is re-determined.
[0050] In an exemplary embodiment, the determination of the target waypoints needs to be selected and verified in sequence from the initial end point to the direction close to the initial start point. Figure 4 is a schematic diagram of determining a target waypoint according to an embodiment of the present invention. Figure 4 As shown, for example, the initial path includes an initial starting point A, an initial end point B, and multiple waypoints C, D, E, F, G, H, I, J, K, etc. In the process of determining the second linear sub-path and the third linear sub-path for the first time, the waypoint J that is one waypoint away from the initial end point B can be used as the target waypoint to obtain the second linear sub-path AJ and the third linear sub-path JB. Since there is an obstacle in the second linear sub-path AJ, it is necessary to re-determine the target waypoint. In the process of determining the second linear sub-path and the third linear sub-path for the second time, the waypoint H that is three waypoints away from the initial end point B can be used as the target waypoint to obtain the second linear sub-path AH and the third linear sub-path HB. Since there is no obstacle in the second linear sub-path AH, the second linear sub-path AH can be determined as a sub-path of the target path. Then confirm whether there is an obstacle in the third linear sub-path HB. If there is no obstacle in the third linear sub-path HB, the third linear sub-path HB can be used as a sub-path of the target path. Therefore, the second linear sub-path AH and the third linear sub-path HB can be determined as the final target path.
[0051] It should be noted that, in this embodiment Figure 4 In the description, only the initial value of the preset number is 1, and the initial value of the preset number can also be 2, 3, 4, etc., and can be set based on actual circumstances.
[0052] In one embodiment, one of the waypoints in the initial path is determined as a target waypoint along the direction from the initial end point to the initial starting point, including: along the direction from the initial end point to the initial starting point, one by one, the waypoints close to the initial end point are determined as target waypoints until there are no obstacles in the second straight line sub-path.
[0053] In an exemplary embodiment, Figure 5 is a schematic diagram of another method for determining a target waypoint according to an embodiment of the present invention. Figure 5As shown, for example, the initial path includes an initial starting point A, an initial end point B, and multiple waypoints C, D, E, F, G, H, I, J, K, etc. In the process of determining the second linear sub-path and the third linear sub-path for the first time, a waypoint K closest to the initial end point B can be used as a target waypoint to obtain the second linear sub-path AK and the third linear sub-path KB. Since there is an obstacle in the second linear sub-path AK, it is necessary to re-determine the target waypoint. In the process of determining the second linear sub-path and the third linear sub-path for the second time, the waypoint J can be sequentially used as the target waypoint to obtain the second linear sub-path AJ and the third linear sub-path JB. Since there is no obstacle in the second linear sub-path AJ, the second linear sub-path AJ can be determined as a sub-path of the target path. Then confirm whether there is an obstacle in the third linear sub-path JB. If there is no obstacle in the third linear sub-path JB, the third linear sub-path JB can be determined as a sub-path of the target path. Therefore, the second linear sub-path AJ and the third linear sub-path JB can be determined as the final target path.
[0054] Figure 6 is a flow chart of a method for successively determining sub-paths of a target path in a direction from an initial starting point to an initial end point according to an embodiment of the present invention. Figure 6 As shown, in one embodiment, the method further includes:
[0055] Step S601: when there is an obstacle in the third straight line sub-path, determine the second straight line sub-path as the first sub-path of the target path;
[0056] In an exemplary embodiment, Figure 7 is a schematic diagram of continuing to confirm the sub-path of the target path when there is an obstacle in the third straight line sub-path according to an embodiment of the present invention, such as Figure 7 As shown, for example, if there is no obstacle in the second straight line sub-path AH, the second straight line sub-path AH can be determined as the first sub-path of the target path (ie, a sub-path of the target path).
[0057] Step S602, taking the end point of the first sub-path as a new first starting point;
[0058] In an exemplary embodiment, Figure 7 As shown, the end point of the first sub-path (the second straight line sub-path AH) is the waypoint H in the initial path, and the waypoint H can be used as the new first starting point.
[0059] Step S603, in the initial path, determining one of the waypoints between the new first starting point and the initial end point as the target waypoint;
[0060] In an exemplary embodiment, Figure 7 As shown, in order to further confirm the sub-path of the new target path, it is necessary to determine a new target waypoint (such as waypoint K) between the first starting point (waypoint H) and the initial end point B to continue to confirm the sub-path of the new target path based on the new target waypoint (waypoint K).
[0061] Step S604, determining a fourth straight line sub-path and a fifth straight line sub-path based on the target waypoint; wherein, in the fourth straight line sub-path: the new first starting point is the first starting point, and the target waypoint is the first end point; in the fifth straight line sub-path: the target waypoint is the first starting point, and the initial end point is the first end point;
[0062] In an exemplary embodiment, Figure 7 As shown, based on the target waypoint (waypoint K), a fourth straight line sub-path HK and a fifth straight line sub-path KB can be determined.
[0063] Step S605: if there is no obstacle in the fourth straight line sub-path, determine the fourth straight line sub-path as a sub-path of the target path;
[0064] In an exemplary embodiment, Figure 7 As shown, for example, based on an image recognition algorithm, when there is no obstacle in the fourth straight line sub-path HK, the fourth straight line sub-path HK can be determined as a sub-path of the target path.
[0065] Step S606, when there is no obstacle in the fifth straight line sub-path, determining the fifth straight line sub-path as a sub-path of the target path;
[0066] In an exemplary embodiment, Figure 7 As shown, for example, based on an image recognition algorithm, when there is no obstacle in the fifth straight line sub-path KB, the fifth straight line sub-path KB can be determined as a sub-path of the target path.
[0067] Step S607, obtaining a target path based on the second straight line sub-path, the fourth straight line sub-path, and the fifth straight line sub-path.
[0068] In an exemplary embodiment, Figure 7As shown, for example, when there is no obstacle in the second linear sub-path AH, and when there is no obstacle in the fourth linear sub-path HK, and when there is no obstacle in the fifth linear sub-path KB, it is determined that the second linear sub-path AH, the fourth linear sub-path HK, and the fifth linear sub-path KB are all sub-paths of the target path. Since the second linear sub-path AH, the fourth linear sub-path HK, and the fifth linear sub-path KB are continuous, the path formed by the second linear sub-path AH, the fourth linear sub-path HK, and the fifth linear sub-path KB can be determined as the target path.
[0069] In an exemplary embodiment, for example, when there are no obstacles in the fourth straight line sub-path, but there may be obstacles in the fifth straight line sub-path, therefore, the second straight line sub-path and the fourth straight line sub-path can be determined as sub-paths of the target path, and the end point of the fourth straight line sub-path is continued to be used as the new first starting point, and a new target waypoint is determined between the new first starting point and the initial end point, so as to continue to verify the sub-path of the new target path based on the new target waypoint, until the sub-path of the target path after verification ends at the initial end point (there is no obstacle in the sub-path), then the above process can be terminated, and the sub-paths of the target path obtained above can be connected sequentially based on the order of successful verification to obtain a continuous target path.
[0070] It should be noted that the above method can be applied to the application scenario of path planning for a sweeping robot.
[0071] The following will be based on RRT The test results of the target path obtained by the path planning algorithm and the test results of the target path obtained by the global path optimization method according to an embodiment of the present invention are compared and illustrated in conjunction with the accompanying drawings: Fig. 9 Based on RRT Schematic diagram of the target path obtained by the path planning algorithm, Fig.10 is a schematic diagram of a target path obtained based on a global path optimization method according to an embodiment of the present invention, combined with Fig. 9 and Fig.10 Table 1 can be obtained.
[0072] Table 1 Global path optimization algorithm test conclusion
[0073]
[0074] According to another embodiment of the present invention, a global path optimization system is also provided. Figure 8 is a schematic diagram of the structure of a global path optimization system according to an embodiment of the present invention. Figure 8 As shown, the system includes:
[0075] The acquisition module 81 obtains an initial path based on a preset global path planning algorithm; wherein the initial path includes: an initial starting point, an initial end point, and at least one waypoint;
[0076] An optimization module 82 is used to determine a straight path between an initial starting point and an initial end point as a first path, and if there are no obstacles in the first path, determine the first path as a target path;
[0077] Alternatively, when there are obstacles in the first path, at least two straight line sub-paths are determined based on the waypoints, until there are no obstacles in the straight line sub-paths, and the straight line sub-paths are determined as sub-paths of the target path to obtain the target path.
[0078] By adopting the above technical solution, the acquisition module 81 obtains the initial path based on the preset global path planning algorithm, and the initial path includes an initial starting point, an initial end point and at least one waypoint. Different from the method of increasing the number of iterations in order to obtain the optimal path in the related art, the embodiment of the present invention can reduce the amount of algorithm calculation by reducing the number of iterations when obtaining the initial path. For example, the preset global path planning algorithm can be the Dijkstra algorithm, A Algorithms, RRT In this way, the acquisition module 81 can obtain an initial path with less computational effort. Although the initial path may not be the optimal path between the initial starting point and the initial end point, it provides a basis for subsequent path optimization.
[0079] The optimization module 82 first determines that the straight path between the initial starting point and the initial end point is the first path, and determines whether there are obstacles in the first path. In an exemplary embodiment, the obstacles can be identified by image recognition or other methods. If there are no obstacles in the first path, the optimization module 82 directly determines the first path as the target path. This method takes advantage of the simplicity of the straight path and avoids complex path planning when there are no obstacles, thereby effectively reducing the tortuosity of the path.
[0080] When there are obstacles in the first path, the optimization module 82 determines at least two straight sub-paths based on the waypoints in the initial path. For example, two continuous straight sub-paths, namely straight sub-path one and straight sub-path two, are determined each time using the starting point, waypoints, and end point. The optimization module 82 determines whether there are obstacles in these straight sub-paths in turn. If there are no obstacles in a straight sub-path, it is determined as a sub-path of the target path. If an obstacle is found in a straight sub-path during the judgment process, the waypoints in the original initial path are continued to be sampled in the sub-path, and new straight sub-paths are further divided, and the above judgment process is repeated until there are no obstacles in the straight sub-path with the initial end point as the end point. Finally, multiple straight sub-paths that meet the conditions are connected in sequence to obtain the final target path.
[0081] Through the above process, the optimization module 82 finds a target path composed of multiple straight sub-paths without obstacles by continuously subdividing and judging the straight sub-paths in the presence of obstacles. This method not only reduces the amount of algorithm calculations, but also effectively reduces the tortuosity of the path, because each time the straight path between the starting point and the end point (including the starting point and the end point of the initial path and the starting point and the end point of the sub-path) is determined, thereby reducing the number of waypoints and the tortuosity of the path.
[0082] In summary, the global path optimization system of the present invention first obtains an initial path with less computational effort through the collaborative work of the acquisition module 81 and the optimization module 82, and then optimizes the initial path through the optimization module 82, finds and confirms one or more straight line sub-paths between the initial starting point and the initial end point, and finally obtains a target path. All straight line sub-paths in the target path do not have obstacles, and by reducing the number of waypoints, the tortuosity of the path is effectively reduced, solving the problem of high tortuosity of the path generated by the path planning algorithm in the related art.
[0083] In one embodiment, the optimization module 82 is further configured to:
[0084] Determine one of the waypoints in the initial path as the target waypoint;
[0085] Determine a second straight line sub-path and a third straight line sub-path based on the target waypoint; wherein, in the second straight line sub-path: the initial starting point is the first starting point, and the target waypoint is the first end point; in the third straight line sub-path: the target waypoint is the first starting point, and the initial end point is the first end point;
[0086] In the case where there is no obstacle in the second straight line sub-path, determining the second straight line sub-path as a sub-path of the target path;
[0087] In the case where there is no obstacle in the third straight line sub-path, determining the third straight line sub-path as a sub-path of the target path;
[0088] A target path is obtained based on the second straight line sub-path and the third straight line sub-path.
[0089] In one embodiment, the optimization module 82 is further configured to: determine one of the waypoints in the initial path as the target waypoint along the direction from the initial end point to the initial starting point.
[0090] In one embodiment, the optimization module 82 is also used to: determine the waypoints that are a preset number of times apart from the initial end point as target waypoints in sequence along the direction approaching the initial starting point until there are no obstacles in the second straight line sub-path; wherein the preset number increases with the number of times the target waypoints are re-determined.
[0091] In one embodiment, the optimization module 82 is further used to: determine the waypoints close to the initial end point as target waypoints one by one along the direction from the initial end point to the initial starting point, until there are no obstacles in the second straight line sub-path.
[0092] In one embodiment, the optimization module 82 is further configured to: determine the second straight line sub-path as the first sub-path of the target path when there is an obstacle in the third straight line sub-path;
[0093] The end point of the first subpath is used as the new first starting point;
[0094] In the initial path, one of the waypoints between the new first starting point and the initial end point is determined as the target waypoint;
[0095] Determine a fourth straight line sub-path and a fifth straight line sub-path based on the target waypoint; wherein, in the fourth straight line sub-path: the new first starting point is the first starting point, and the target waypoint is the first end point; and in the fifth straight line sub-path: the target waypoint is the first starting point, and the initial end point is the first end point;
[0096] In the case where there is no obstacle in the fourth straight line sub-path, determining the fourth straight line sub-path as a sub-path of the target path;
[0097] In the case where there is no obstacle in the fifth straight line sub-path, determining the fifth straight line sub-path as a sub-path of the target path;
[0098] A target path is obtained based on the second straight line sub-path, the fourth straight line sub-path, and the fifth straight line sub-path.
[0099] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0100] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above method embodiments are executed.
[0101] In one implementation, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0102] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0103] An embodiment of the present invention further provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the method described in each embodiment of the present invention.
[0104] In one implementation manner, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment will not be described in detail herein.
[0105] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0106] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A global path optimization method, characterized in that: include: Obtaining an initial path based on a preset global path planning algorithm; wherein the initial path includes: an initial starting point, an initial end point, and at least one waypoint; Determine a straight path between the initial starting point and the initial end point as a first path, and if there are no obstacles in the first path, determine the first path as a target path; When there are obstacles in the first path, at least two straight sub-paths are determined based on the waypoints, and when there are no obstacles in the straight sub-paths, the straight sub-paths are determined as sub-paths of the target path to obtain the target path.
2. The method according to claim 1, characterized in that Determining at least two straight line sub-paths based on the waypoints includes: Determining one of the waypoints in the initial path as a target waypoint; Determine a second straight line sub-path and a third straight line sub-path based on the target waypoint; wherein, in the second straight line sub-path: the initial starting point is a first starting point, and the target waypoint is a first end point; and in the third straight line sub-path: the target waypoint is a first starting point, and the initial end point is a first end point; In the case where there is no obstacle in the second straight line sub-path, determining the second straight line sub-path as a sub-path of the target path; In a case where there is no obstacle in the third straight line sub-path, determining the third straight line sub-path as a sub-path of the target path; A target path is obtained based on the second straight line sub-path and the third straight line sub-path.
3. The method according to claim 2, characterized in that Determining one of the waypoints in the initial path as a target waypoint includes: Along the direction from the initial end point to the initial starting point, one of the waypoints in the initial path is determined as the target waypoint.
4. The method according to claim 3, characterized in that Determining one of the waypoints in the initial path as the target waypoint along the initial end point toward the initial starting point includes: Along the direction from the initial end point to the initial starting point, the waypoints that are a preset number of times apart from the initial end point are determined as the target waypoints in sequence until there are no obstacles in the second straight line sub-path; wherein the preset number increases as the number of times the target waypoints are re-determined increases.
5. The method according to claim 3, characterized in that: Determining one of the waypoints in the initial path as the target waypoint along the initial end point toward the initial starting point includes: Along the direction from the initial end point to the initial starting point, waypoints close to the initial end point are determined as the target waypoints one by one until no obstacles exist in the second straight line sub-path.
6. The method according to claim 2, characterized in that Also includes: In the case where there is an obstacle in the third straight line sub-path, determining the second straight line sub-path as the first sub-path of the target path; Taking the end point of the first subpath as a new first starting point; In the initial path, determining one of the waypoints between the new first starting point and the initial end point as a target waypoint; Determine a fourth straight line sub-path and a fifth straight line sub-path based on the target waypoint; wherein, in the fourth straight line sub-path: the new first starting point is the first starting point, and the target waypoint is the first end point; and in the fifth straight line sub-path: the target waypoint is the first starting point, and the initial end point is the first end point; In a case where there is no obstacle in the fourth straight line sub-path, determining the fourth straight line sub-path as a sub-path of the target path; In the case where there is no obstacle in the fifth straight line sub-path, determining the fifth straight line sub-path as a sub-path of the target path; A target path is obtained based on the second straight line sub-path, the fourth straight line sub-path, and the fifth straight line sub-path.
7. A global path optimization system, characterized in that: include: An acquisition module, which obtains an initial path based on a preset global path planning algorithm; wherein the initial path includes: an initial starting point, an initial end point, and at least one waypoint; an optimization module, configured to determine a straight path between the initial starting point and the initial end point as a first path, and in the case where there are no obstacles in the first path, determine the first path as a target path; Alternatively, when there are obstacles in the first path, at least two straight sub-paths are determined based on the waypoints, until there are no obstacles in the straight sub-paths, and the straight sub-paths are determined as sub-paths of the target path to obtain the target path.
8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program executes the steps of the method described in any one of claims 1 to 6 when executed by a processor.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps of the method according to any one of claims 1 to 6.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Path planning method and device for mobile machine
CN114690786A
Mining area vehicle driving path planning method and device and computer equipment
CN114812566A
Indoor path planning method and system based on direct connection search
CN116520819A
Unmanned aerial vehicle path planning method for improving lazy theta* in complex environment
CN116893687A
Unmanned ship path planning method based on improved A* and DWA fusion
CN116952239A