A global path planning method, device, and medium for nautical chart scenarios
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-24
- Publication Date
- 2026-08-14
AI Technical Summary
[0005]本申请的目的在于提供一种面向海图场景的全局路径规划方法、设备及介质,能够有效地解决现有全局路径规划技术在海图场景中计算复杂度高、难以保证规划精度和实时性、路径平滑性差以及采样效率低、搜索过程冗余严重的问题
[0016]由上可知,本申请提供的一种面向海图场景的全局路径规划方法、设备及介质,通过迭代优化的采样式路径规划策略,结合启发式搜索和截断、碰撞检测,提高了路径规划的效率和精度,通过动态调整路径代价上限值和重新采样机制,实现了路径的迭代优化,避免了陷入局部最优,通过拼接最佳边并生成航行轨迹,确保了规划路径的平滑性和安全性,从而提升了海图场景下全局路径规划的整体性能,因此本申请能够有效地解决现有全局路径规划技术在海图场景中计算复杂度高、难以保证规划精度和实时性、路径平滑性差以及采样效率低、搜索过程冗余严重的问题。
Smart Images

Figure CN122566822A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of navigation path planning technology, and more specifically, to a global path planning method, device, and medium for nautical chart scenarios. Background Technology
[0002] Existing global path planning techniques have significant limitations in application to nautical chart scenarios. Traditional grid-based or graph search-based path planning methods face computational efficiency bottlenecks when dealing with large-scale nautical chart environments. Due to the need to process a large number of grid cells or graph nodes, the algorithm's time complexity increases exponentially. This computational complexity not only affects the real-time performance of the planning process but also limits its practical application on resource-constrained shipboard equipment.
[0003] Sampling-based path planning algorithms exhibit significant limitations in adaptability to complex nautical chart environments. When faced with densely distributed reef areas, complex coastlines, or narrow channels, existing random sampling methods tend to generate a large number of invalid sampling points, resulting in a waste of computational resources. Especially in complex scenarios with multiple no-navigation zones, the algorithm may get stuck in local optima or fail to find a feasible path at all.
[0004] There is currently no effective technical solution to the above problems. Summary of the Invention
[0005] The purpose of this application is to provide a global path planning method, device and medium for nautical chart scenarios, which can effectively solve the problems of high computational complexity, difficulty in guaranteeing planning accuracy and real-time performance, poor path smoothness, low sampling efficiency and serious redundancy in the search process of existing global path planning technologies in nautical chart scenarios.
[0006] Firstly, this application provides a global path planning method for nautical chart scenarios, which includes the following steps: S1. Convert the electronic nautical chart data corresponding to the preset target navigation area into a grid map with navigation constraint attributes; S2. Extract multiple sampling points from the grid map, generate multiple edges based on the preset starting position and all sampling points, and then calculate the first total estimated cost corresponding to each edge; each edge starts from the preset starting position and ends at a sampling point; S3. Select the edge with the minimum total estimated cost as the best edge, and perform truncation check and collision detection on the best edge. S4. When the best edge passes the truncation check and collision detection, analyze whether the endpoint of the best edge is the preset target position and the first total estimated cost of the best edge is less than the upper limit of the path cost. If so, then splice all the best edges extracted and stored in this sampling point into a navigation path, then store the navigation path and execute step S5. If not, then execute step S6. S5. Analyze whether the number of sampling points has reached the preset number. If yes, generate the navigation trajectory based on the last stored navigation path. If no, delete all edges, take the first total estimated cost as the new path cost upper limit, and return to step S2. S6. When the endpoint of the best edge is not the preset target position and its first total estimated cost is less than the upper limit of the path cost, store the best edge, then use the endpoint of the best edge as the new starting point, regenerate several edges based on the remaining sampling points, and return to step S3. When the first total estimated cost of the best edge is greater than or equal to the upper limit of the path cost, delete all edges and return to step S2.
[0007] Optionally, the passage constraint attributes include passable areas and restricted areas, and step S1 includes: S11. Obtain electronic chart data corresponding to the preset target navigation area; the electronic chart data includes preset impassable areas, coastlines and reefs; S12. Determine the safety redundancy distance based on the preset size of the vessel to be navigated, and then calculate the safe obstacle avoidance distance based on the safety redundancy distance and the preset minimum safe obstacle avoidance distance. S13. Expand the safe obstacle avoidance distance outward from the shoreline and reef respectively to obtain the shoreline area and reef area; S14. Mark the shoreline area, reef area and impassable area as no-navigation area, and mark the area in the electronic chart data other than the no-navigation area as navigable area, so as to obtain electronic chart data with navigability constraint attributes. S15. Perform coordinate unification and scale transformation on electronic nautical chart data with passage constraint attributes to convert the electronic nautical chart data with passage constraint attributes into a grid map with passage constraint attributes.
[0008] Optionally, step S2 includes: S21. Analyze whether a navigation path exists. If yes, proceed to step S22; otherwise, proceed to step S23. S22. Construct an elliptical sampling region with the preset starting position and preset target position as the focus and the path cost upper limit value as the length of the major axis. Then sample the elliptical sampling region to extract multiple sampling points. S23. Perform full-area sampling on the grid map to extract multiple sampling points.
[0009] Optionally, the passage constraint attribute includes a no-navigation zone, and step S3 includes: S31. Take the edge with the smallest first total estimated cost as the best edge, and calculate the second total estimated cost corresponding to the end point of the best edge based on the total path length from the preset starting position to the end point of the best edge and the Euclidean distance between the end point of the best edge and the preset target position. S32. Analyze whether the second total estimated cost is greater than or equal to the upper limit of the path cost. If yes, the truncation check is considered to have failed and step S33 is executed. If no, the truncation check is considered to have passed and step S35 is executed. S33. Calculate the third total estimated cost corresponding to the endpoint of each edge based on the total path length from the preset starting position to the endpoint of each edge and the Euclidean distance from the endpoint of each edge to the preset target position. Delete the edges corresponding to the third total estimated cost that are greater than the upper limit of the path cost and the first total estimated cost. Analyze whether there are any edges that have not been deleted. If yes, return to step S31. If no, execute step S34. S34. Analyze whether the number of sampling points has reached the preset number. If yes, generate the navigation trajectory based on the last stored navigation path. If no, delete all edges and return to step S2. S35. Analyze whether the best edge passes through the restricted area. If so, the collision detection is considered to have failed. Delete the best edge and its corresponding first total estimated cost, and return to step S31. If not, the collision detection is considered to have passed.
[0010] Optionally, the formula for calculating the first total estimated cost is: ; Among them, f ei Let u represent the first total estimated cost corresponding to the i-th edge. i Let v represent the starting point of the i-th edge. i Let (u) represent the endpoint of the i-th edge. i ,v i ) represents the i-th edge, g(u i ) represents the total path length from the preset starting position to the starting point of the i-th edge, w represents the expansion coefficient, and h(v) represents the total path length from the preset starting position to the starting point of the i-th edge. i (x) represents the Euclidean distance from the endpoint of the i-th edge to the preset target position. G ,y G (x) represents the coordinates of the preset target position. vi ,y vi () represents the coordinates of the endpoint of the i-th edge; The formula for calculating the second total estimated cost is the same as that for the third total estimated cost. The formula for calculating the second total estimated cost is as follows: ; Where f(j) represents the second total estimated cost corresponding to the j-th optimal edge, and v j Let g(v) represent the endpoint of the j-th optimal edge. j h(v) represents the total path length from the preset starting position to the endpoint of the j-th optimal edge. j(x) represents the Euclidean distance from the endpoint of the j-th optimal edge to the preset target position. vj ,y vj ) represents the coordinates of the endpoint of the j-th optimal edge.
[0011] Optionally, step S33 includes: S331. Calculate the third total estimated cost for each edge based on the total path length from the preset starting position to the endpoint of each edge and the Euclidean distance from the endpoint of each edge to the preset target position. Delete the edges with third total estimated costs greater than the upper limit of the path cost and the first total estimated cost. Analyze whether there are any edges that have not been deleted. If yes, return to step S31. If no, update the inflation coefficient based on the number of times the sampling points are extracted and execute step S34. The inflation coefficient is greater than or equal to 1. The greater the number of times the sampling points are extracted, the closer the inflation coefficient is to 1. Step S34 includes: S341. Analyze whether the number of sampling points extracted reaches the preset number or the expansion coefficient is equal to 1. If yes, generate the navigation trajectory based on the last stored navigation path. If no, return to step S2. Step S4 includes: S41. When the best edge passes the truncation check and collision detection, analyze whether the endpoint of the best edge is the preset target position and the first total estimated cost of the best edge is less than the upper limit of the path cost. If so, then all the best edges extracted and stored after this sampling point are spliced into a navigation path, the navigation path is stored, the expansion coefficient is updated according to the number of sampling points, and step S5 is executed. If not, step S6 is executed. S5 includes: S51. Analyze whether the number of sampling points extracted reaches the preset number or the expansion coefficient is equal to 1. If yes, generate the navigation trajectory based on the last stored navigation path. If no, proceed to step S52. S52. Take the first total estimated cost as the new upper limit of the path cost, calculate the fourth total estimated cost corresponding to each sampling point according to the total path length from the preset starting position to each sampling point and the Euclidean distance from each sampling point to the preset target position, delete the sampling points corresponding to the fourth total estimated cost that is greater than the upper limit of the path cost, delete all edges, and return to step S2. Step S6 includes: S61. When the endpoint of the best edge is not the preset target position and its first total estimated cost is less than the upper limit of the path cost, the best edge is stored. Then, the endpoint of the best edge is used as the new starting point. Several edges are regenerated based on the remaining sampling points. The first total estimated cost corresponding to each regenerated edge is calculated respectively, and the process returns to step S3. S62. When the first total estimated cost is greater than or equal to the upper limit of the path cost, delete all edges, update the expansion coefficient according to the number of sampling points extracted, and analyze whether the number of sampling points extracted reaches the preset number or the expansion coefficient is equal to 1. If yes, generate the navigation trajectory according to the last stored navigation path. If no, execute step S63. S63. Calculate the fourth total estimated cost corresponding to each sampling point based on the total path length from the preset starting position to each sampling point and the Euclidean distance from each sampling point to the preset target position. Delete the sampling points corresponding to the fourth total estimated cost that is greater than the upper limit of the path cost, delete all edges, and return to step S2.
[0012] Optionally, the navigation path includes multiple nodes, and the start or end point of the optimal edge corresponds to a node. The process of generating the navigation trajectory based on the last stored navigation path includes: A1. Mark the nodes corresponding to the preset starting position and the nodes corresponding to the preset target position as key control points; A2. For each node other than the node corresponding to the preset starting position and the node corresponding to the preset target position, obtain the angle information between the best edge starting from the node and the best edge ending at the node, and analyze whether the angle information is greater than or equal to the preset threshold. If yes, mark the node as a key control point; otherwise, delete the node. A3. Generate a navigation trajectory based on all key control points.
[0013] Optionally, step A3 includes: A31. Treat all key control points as vertices of the control polygon of the Bézier curve, and use Bernstein polynomials to construct the navigation trajectory based on the vertices of the control polygon.
[0014] Secondly, this application also provides an electronic device, including a processor and a memory, the memory storing computer-readable instructions, which, when executed by the processor, perform the steps of the method provided in the first aspect above.
[0015] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the method provided in the first aspect above.
[0016] As can be seen from the above, the global path planning method, device, and medium provided in this application for nautical chart scenarios improve the efficiency and accuracy of path planning through an iteratively optimized sampling path planning strategy combined with heuristic search, truncation, and collision detection. By dynamically adjusting the upper limit of path cost and a resampling mechanism, iterative optimization of the path is achieved, avoiding getting trapped in local optima. By stitching together the best edges and generating a navigation trajectory, the smoothness and safety of the planned path are ensured, thereby improving the overall performance of global path planning in nautical chart scenarios. Therefore, this application can effectively solve the problems of high computational complexity, difficulty in guaranteeing planning accuracy and real-time performance, poor path smoothness, low sampling efficiency, and serious redundancy in the search process of existing global path planning technologies in nautical chart scenarios. Attached Figure Description
[0017] Figure 1 A flowchart illustrating a global path planning method for nautical chart scenarios provided in this application embodiment.
[0018] Figure 2 This is a schematic diagram of an electronic device structure provided in an embodiment of this application.
[0019] Reference numerals: 101, processor; 102, memory; 103, communication bus. Detailed Implementation
[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0021] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0022] Firstly, such as Figure 1 As shown, this application provides a global path planning method for nautical chart scenarios, which includes the following steps: S1. Convert the electronic nautical chart data corresponding to the preset target navigation area into a grid map with navigation constraint attributes; S2. Extract multiple sampling points from the grid map, generate multiple edges based on the preset starting position and all sampling points, and then calculate the first total estimated cost corresponding to each edge; each edge starts from the preset starting position and ends at a sampling point; S3. Select the edge with the minimum total estimated cost as the best edge, and perform truncation check and collision detection on the best edge. S4. When the best edge passes the truncation check and collision detection, analyze whether the endpoint of the best edge is the preset target position and the first total estimated cost of the best edge is less than the upper limit of the path cost. If so, then splice all the best edges extracted and stored in this sampling point into a navigation path, then store the navigation path and execute step S5. If not, then execute step S6. S5. Analyze whether the number of extractions of the sampling points reaches the preset number or the expansion coefficient is equal to 1. If yes, generate the navigation trajectory based on the last stored navigation path. If no, delete all edges, take the first total estimated cost as the new path cost upper limit, and return to step S2. S6. When the endpoint of the best edge is not the preset target position and its first total estimated cost is less than the upper limit of the path cost, store the best edge, then use the endpoint of the best edge as the new starting point, regenerate several edges based on the remaining sampling points, and return to step S3. When the first total estimated cost of the best edge is greater than or equal to the upper limit of the path cost, delete all edges and return to step S2.
[0023] To facilitate understanding, some key terms in this embodiment are explained below. The global path planning method for nautical chart scenarios provided in this embodiment can generate an optimal navigation trajectory from a starting point to a target point within a navigable area of electronic nautical chart data through iterative optimization, given a starting point (preset starting position) and a target point (preset target position). The electronic nautical chart data in this embodiment refers to digital nautical chart information conforming to the standards of the International Maritime Organization (IMO) and the International Hydrographic Organization (IHO), typically containing multiple layers of information such as geographic coordinates, depth points, isobaths, shorelines, reefs, and no-navigation zones. The navigation constraint attributes in this embodiment refer to the attributes assigned to different areas in a grid map to indicate their navigability, such as navigable areas and no-navigation zones. Navigable areas represent areas where ships can safely navigate, while no-navigation zones represent areas where ships are prohibited from entering (such as shoals, reefs, military zones, etc.). The grid map in this embodiment refers to a map formed by discretizing a continuous geographic space into a series of grid cells (or graticules) of the same size. Each grid cell can store its corresponding access constraint attributes, such as whether it is passable, obstacle information, etc. The sampling points in this embodiment refer to discrete points randomly selected or selected according to a specific strategy in the grid map. These points serve as candidate nodes for constructing path segments in the path planning algorithm. It should be understood that the extraction of sampling points is existing technology, and its working principle and workflow will not be discussed in detail here. The edge in this embodiment refers to a line segment connecting a set starting point (in this embodiment, a preset starting position is set as the initial starting point) and a sampling point. Each edge represents a potential path segment in the path planning. The first total estimated cost in this embodiment refers to a comprehensive index used to evaluate the quality of an edge. This cost is typically a weighted combination of the actual path length from the preset starting position to the edge's starting point (the actual cost from the preset starting position to the edge's starting point) and the heuristically estimated distance from the edge's ending point to the preset target position (preferably the Euclidean distance from the edge's ending point to the preset target position, equivalent to the estimated cost from the edge's ending point to the preset target position). The first total estimated cost can be calculated using the heuristic function in the A* algorithm or Dijkstra's algorithm. The optimal edge in this embodiment refers to the edge with the minimum first total estimated cost when the starting points are the same. The truncation check in this embodiment refers to a validity check performed on the current optimal edge during path planning to determine whether the edge is likely to constitute the final valid path. For example, this can be determined by comparing the total estimated cost of the current path with a known upper limit of path cost. The collision detection in this embodiment refers to checking whether an edge overlaps or intersects with a no-navigation zone in the grid map during path planning to ensure that the planned path is safe and navigable.The path cost upper limit in this embodiment refers to a threshold set during path planning to limit the search range or filter out edges with lower costs. Any edge exceeding this upper limit will be considered a non-optimal solution. The navigation path in this embodiment refers to a complete path from a preset starting position to a preset target position, formed by concatenating a series of best edges connected end-to-end. It consists of multiple nodes (each node corresponding to a sampling point). It should be understood that this embodiment is equivalent to performing multiple iterative optimizations on the navigation path. Each iteration is equivalent to first expanding the nodes using a search tree to obtain multiple nodes and multiple best edges, and then concatenating all the best edges to form the navigation path for the current iteration. Specifically, the node expansion process in this embodiment is as follows: 1. Mark the preset starting position as the first parent node; 2. ... The parent node serves as the starting point, and multiple edges are generated with a sampling point as the ending point. Each edge corresponds to a sampling point. 3. From all edges, find the edge that passes truncation and collision detection, has a first total estimated cost less than the upper limit of the path cost, and has the smallest first total estimated cost. This edge is then selected as the best edge for the current parent node. The best edge is stored, and its endpoint is set as the new parent node. 4. Analyze whether the new parent node is the preset target position. If so, the node expansion is considered complete. All the best edges stored in this node expansion are concatenated to form a navigation path, and the navigation path is stored. If not, return to step 2. The navigation trajectory in this embodiment can be the ship's navigation route obtained after smoothing the last stored navigation path after iterative optimization.
[0024] This embodiment provides a global path planning method for nautical chart scenarios, aiming to solve the problems of high computational complexity, poor real-time performance, poor path smoothness, low sampling efficiency, and serious search redundancy in traditional path planning methods in nautical chart scenarios.
[0025] In step S1, the electronic chart data corresponding to the preset target navigation area is converted into a grid map with navigation constraint attributes. This step is the foundation of path planning, transforming complex geographic information into a discretized model that the algorithm can process. For example, the electronic chart data is subjected to coordinate unification and scale transformation to generate a 3D grid map composed of multiple grid cells. Based on information such as impassable areas, coastlines, reefs, and obstacles in the electronic chart data, each grid cell is labeled as a navigation area or a navigable area (for example, grid cells corresponding to impassable areas, coastlines, reefs, and obstacles are labeled as prohibited areas, and the remaining grid cells are labeled as navigable areas), thus obtaining a grid map with navigation constraint attributes.
[0026] In step S2, multiple sampling points are extracted from the grid map. Multiple edges are generated based on the preset starting position and all sampling points. Then, the first total estimated cost for each edge is calculated. Each edge starts at the preset starting position and ends at a sampling point. This step is the initialization and expansion process of the path search. For example, a certain number of sampling points can be randomly generated in the grid map, or multiple sampling points can be generated in the grid map using existing sampling techniques. Then, the preset starting position is connected to each sampling point to form multiple candidate edges. The first total estimated cost for each edge can be obtained by summing the total path length required from the preset starting position (edge start point) to the corresponding sampling point (edge end point) and the Euclidean distance from the sampling point to the preset target position.
[0027] In step S3, the edge with the smallest first total estimated cost is selected as the optimal edge, and truncation and collision detection are performed on it. This step aims to select the current optimal path segment from numerous candidate edges and verify its optimal solution (truncation check) and feasibility (collision detection). For example, after calculating the first total estimated cost of all edges, the edge with the smallest value is selected as the optimal edge. The truncation check determines whether the optimal edge is likely to constitute the final valid path. For example, if the first total estimated cost corresponding to the optimal edge exceeds a certain threshold (preferably the upper limit of the path cost), the truncation check is considered to have failed. Collision detection checks whether the optimal edge crosses any restricted areas.
[0028] In step S4, when the optimal edge passes the truncation check and collision detection, it is analyzed whether the endpoint of the optimal edge is a preset target position and the first total estimated cost of the optimal edge is less than the upper limit of the path cost. If so, all the optimal edges extracted and stored after this sampling point are concatenated into a navigation path, and then the navigation path is stored, and step S5 is executed. If not, step S6 is executed. This step is the key link in path discovery and storage. For example, if the endpoint of the optimal edge is exactly the preset target position, and its first total estimated cost is lower than the currently set upper limit of the path cost, then a feasible navigation path can be considered to have been found. This navigation path is formed by concatenating all the optimal edges extracted and stored after this sampling point.
[0029] In step S5, it is determined whether the number of sampling point extractions has reached a preset number. If so, a navigation trajectory is generated based on the last stored navigation path. If not, all edges are deleted, the first total estimated cost is used as the new upper limit of the path cost, and the process returns to step S2. This step achieves iterative optimization of the path and adaptive convergence of the search space. Analyzing whether the number of sampling point extractions has reached a preset number is equivalent to analyzing whether the number of iterative optimizations of the navigation path has reached a preset number. If so, the search can be stopped and the final navigation trajectory can be generated based on the last stored navigation path. If the preset number of iterations is not reached, the path cost upper limit is updated and resampled. It should be understood that the path cost upper limit is updated only when the endpoint of the best edge is the preset target position and the first total estimated cost of the best edge (when the endpoint of the best edge is the preset target position, the first total estimated cost of the best edge is equivalent to the total cost of a feasible path from the preset starting position to the preset target position) is less than the path cost upper limit. Therefore, this application is equivalent to finding a better navigation path than the navigation path found in the previous iteration optimization process in the current iteration optimization process, so that the path cost upper limit converges, and the algorithm is expected to find a better navigation path in the next iteration optimization, thereby realizing the gradual optimization of the navigation path.
[0030] In step S6, when the endpoint of the best edge is not the preset target position and its first total estimated cost is less than the upper limit of the path cost, the best edge is stored. Then, the endpoint of the best edge is used as the new starting point, and several edges are regenerated based on the remaining sampling points. The first total estimated cost of each regenerated edge is calculated, and the process returns to step S3. When the first total estimated cost of the best edge is greater than or equal to the upper limit of the path cost, all edges are deleted, and the process returns to step S2. This step handles two cases: one is that the endpoint of the current best edge is not the preset target position and its first total estimated cost is less than the path cost upper limit. Since the first total estimated cost of the best edge is less than the path cost upper limit, the best edge may be the optimal solution for connecting two nodes on a feasible path from the preset starting position to the preset target position. In this case, it is stored and the search continues with its endpoint as the new starting point. The other case is that the cost of the current best edge is too high (the first total estimated cost of the best edge is greater than or equal to the path cost upper limit). It is considered that the current iterative optimization process cannot be better than the previous iterative optimization process. In this case, all edges generated by the current iterative optimization process are deleted and sampling and searching are restarted for a new round of iterative optimization.
[0031] The following example further illustrates the above technical solution: Suppose that in a nautical chart scenario, a ship needs to navigate from a preset starting position A to a preset target position B. Traditional path planning methods often face problems such as high computational complexity, poor real-time performance, poor path smoothness, low sampling efficiency, and severe search redundancy when dealing with such large-scale nautical chart scenarios. To address these issues, this application proposes a global path planning method for nautical chart scenarios.
[0032] First, in step S1, the system acquires electronic nautical chart data corresponding to the preset target navigation area. This data includes information such as preset impassable areas, coastlines, and reefs. The areas where the coastlines are located, the areas where the reefs are located, and the preset impassable areas are all marked as no-navigation areas. The areas in the electronic nautical chart data other than the no-navigation areas are marked as navigable areas, thus obtaining electronic nautical chart data with navigation constraint attributes. Subsequently, the data undergoes coordinate unification and scale transformation to convert it into a grid map with navigation constraint attributes.
[0033] Next, in step S2, the system extracts multiple sampling points from the grid map. If the current iteration is the first iteration (the number of sampling point extractions is 0 or there is no stored navigation path), the system performs global sampling on the grid map to extract, for example, 500 sampling points. If the current iteration is not the first iteration, the system performs local sampling on the grid map. Then, starting from a preset starting position A, the system connects the preset starting position A to each of these 500 sampling points, generating 500 candidate edges. For each edge, the system calculates its corresponding first total estimated cost. For example, for an edge from the preset starting position A to sampling point P1, its first total estimated cost may be calculated as the weighted sum of the actual distance from A to P1 plus the Euclidean distance from P1 to the preset target position B. For an edge from the preset starting position A to sampling point P2, its first total estimated cost is the sum of the actual path length from A to P2 and the weighted Euclidean distance from P1 to the preset target position B.
[0034] Subsequently, in step S3, the system selects the edge with the lowest first total estimated cost among these 500 edges as the optimal edge. For example, if the edge from A to sampling point P1 has the lowest first total estimated cost, it is selected as the optimal edge. Then, the system performs truncation checks and collision detection on this optimal edge. The truncation check evaluates whether the optimal edge is likely to constitute a final valid path. For example, if the total estimated cost of the optimal edge exceeds the currently set path cost upper limit (initially set to a large value), the truncation check is considered to have failed. The collision detection checks whether the optimal edge crosses any restricted areas. For example, if the optimal edge from A to P1 crosses a previously marked reef area, the collision detection is considered to have failed.
[0035] In step S4, the system further analyzes the best edges that have passed the stage check and collision detection to see if the endpoint of the best edge is the preset target position B and the first total estimated cost of the best edge is less than the upper limit of the path cost. If the best edge connects the preset starting position A and the preset target position B, and its cost is lower than the current upper limit of the path cost, it means that all the best edges found in the current iteration optimization process can form a feasible path between the preset starting position A and the preset target position B, and the cost of this path is less than the cost of the navigation path obtained in the previous iteration optimization process (equivalent to finding a better solution than the previous iteration optimization). Therefore, the system needs to concatenate all the best edges extracted and stored after this sampling point into a navigation path, store the navigation path, and then execute step S5. If the endpoint of the best edge is not the preset target position B, or its cost is greater than or equal to the upper limit of the path cost, then step S6 is executed.
[0036] In step S5, the system analyzes whether the number of sampling points extracted has reached the preset number. For example, if the preset number is 10, and the current sampling is the first one, since the preset number has not been reached, the system will delete all edges, use the first total estimated cost of the current best edge as the new upper limit of the path cost, and return to step S2 to perform the next round of sampling and searching. Using the first total estimated cost of the current best edge as the new upper limit of the path cost is equivalent to enabling subsequent iterations to find a better path than the path found in the current iteration. For example, if the cost of the first path found is 100, the upper limit of the path cost will be updated to 100, and in the next iteration, the algorithm will try to find a path with a cost less than 100.
[0037] In step S6, if the endpoint of the best edge is not the preset target location B and its first total estimated cost is less than the upper limit of the path cost, the system stores the best edge, uses the endpoint of the best edge as the new starting point, regenerates several edges based on the remaining sampling points, and returns to step S3 to continue the search. For example, if the current best edge is from A to P1, and P1 is not the preset target location B, the system stores the edge A-P1, uses P1 as the new starting point, connects P1 with the remaining sampling points to generate new candidate edges, calculates the first total estimated cost corresponding to each regenerated candidate edge, and returns to step S3. If the first total estimated cost of the best edge is greater than or equal to the upper limit of the path cost, the system deletes all edges and returns to step S2 to resample and search.
[0038] Through the above iterative process, the system can gradually construct and optimize the navigation path. When the number of sampling points extracted reaches a preset number, the system generates a navigation trajectory based on the last stored navigation path. For example, if the last stored navigation path consists of nodes A, P1, P2, P3, and B, the system will mark the node corresponding to the preset starting position A and the node corresponding to the preset target position B as key control points. For each node other than A and B (P1, P2, P3), the system obtains the angle information between the best edge starting from that node and the best edge ending at that node, and analyzes whether the angle information is greater than or equal to a preset threshold. For example, if the angle at node P2 is greater than the preset threshold (e.g., 150 degrees), then P2 is marked as a key control point; otherwise, P2 is deleted. Finally, a navigation trajectory is generated based on all key control points (e.g., A, P1, P2, B). Specifically, all key control points can be used as vertices of the control polygon of the Bézier curve, and a smooth navigation trajectory can be constructed using Bernstein polynomials based on the vertices of the control polygon.
[0039] This application's global path planning method effectively addresses many challenges faced by traditional methods in nautical chart scenarios through an iterative optimization sampling search strategy. Compared to traditional grid-based or graph-based search methods, this method significantly reduces computational complexity and improves the real-time performance of path planning when handling large-scale nautical chart environments by introducing sampling points and total cost evaluation. Specifically, this application samples the grid map and evaluates the total cost instead of traversing all grid cells, greatly reducing the search space and enabling faster path acquisition with the same computational resources. This method ensures the effectiveness and safety of the planned path by performing truncation checks and collision detection on the best edges, avoiding redundant searches in invalid or dangerous areas. This method introduces dynamic adjustment of the path cost upper limit and control over the number of sampling point extractions, achieving iterative optimization of the path and adaptive convergence of the search space. Specifically, after finding a path, the system attempts to find a path with lower cost and guides subsequent searches by updating the path cost upper limit, allowing the algorithm to gradually approach the optimal solution and improving path quality.
[0040] In some preferred embodiments, the passage constraint attributes include passable areas and no-navigation areas, and step S1 includes: S11. Obtain electronic chart data corresponding to the preset target navigation area; the electronic chart data includes preset impassable areas, coastlines and reefs; S12. Determine the safety redundancy distance based on the preset size of the vessel to be navigated, and then calculate the safe obstacle avoidance distance based on the safety redundancy distance and the preset minimum safe obstacle avoidance distance. S13. Expand the safe obstacle avoidance distance outward from the shoreline and reef respectively to obtain the shoreline area and reef area; S14. Mark the shoreline area, reef area and impassable area as no-navigation area, and mark the area in the electronic chart data other than the no-navigation area as navigable area, so as to obtain electronic chart data with navigability constraint attributes. S15. Perform coordinate unification and scale transformation on electronic nautical chart data with passage constraint attributes to convert the electronic nautical chart data with passage constraint attributes into a grid map with passage constraint attributes.
[0041] The passage constraint attribute is a property that indicates whether each cell in the grid map allows ship passage. Its main purpose is to provide environmental information for the path planning algorithm, distinguishing between safe and passable areas and dangerous or prohibited areas. Passable areas represent waters where ships can navigate safely, while prohibited areas represent waters where ships should not or cannot enter. Step S11 aims to provide basic geographic information for subsequent path planning. Electronic nautical chart data is a digital chart used in ship navigation, containing information such as water depth, channels, and obstacles. Preset impassable areas refer to areas clearly marked on the chart that ships cannot pass through, such as military areas. The shoreline is the boundary between land and water, and reefs are underwater or exposed rock obstacles. Acquiring this data is the first step in building a navigation environment model, ensuring that all potentially dangerous areas are taken into consideration. Step S12 aims to provide personalized safety assurance for ship navigation. The preset dimensions of the ship to be navigated refer to physical parameters such as the ship's length, width, and draft. The safety redundancy distance is an additional safety margin based on the ship's dimensions to cope with uncertainties or operational errors during navigation. The preset minimum obstacle avoidance safety distance is the minimum distance that should be maintained between the ship and the obstacle, as stipulated by navigation rules or experience. By combining the ship's own characteristics (represented by the preset dimensions of the ship to be navigated) and general safety standards (represented by the preset minimum obstacle avoidance safety distance), the safe obstacle avoidance distance is calculated to ensure that the ship can maintain a sufficient safe distance from obstacles (reefs and shorelines) when planning its route. Step S13 aims to transform point-like or linear obstacles into no-navigation zones with a certain width. The expansion operation can be achieved through geometric buffer analysis. For example, using the shoreline or reef as the center line or center point, an area equal to the safe obstacle avoidance distance is extended outward. The resulting shoreline area and reef area are actually virtual obstacles that take into account the ship's dimensions and safety margins, ensuring that no part of the ship enters the actual danger zone. Step S14 aims to clearly delineate navigable and prohibited areas in the navigation environment. By uniformly marking all identified hazardous areas (including the original preset impassable areas and shoreline and reef areas after safety obstacle avoidance distance expansion) as prohibited areas, the navigation boundaries of ships can be clearly defined. The remaining areas not marked as prohibited areas are defined as navigable areas, providing a clear search space for the path planning algorithm. Step S15 aims to convert the original geographic information data into a discretized format suitable for path planning algorithm processing. Coordinate unification ensures that geographic information from different data sources or under different projections can be processed in a unified coordinate system. Scale transformation converts geographic coordinates into cell indices of a grid map, for example, mapping continuous latitude and longitude coordinates to discrete row / column indices. A grid map is a commonly used environmental representation method that divides a continuous space into a series of discrete cells of the same size, each cell carrying a passage constraint attribute, facilitating the search and calculation by the path planning algorithm.
[0042] The proposed solution can accurately define no-navigation zones when generating grid maps, fully considering the actual size of the ship and the necessary safe obstacle avoidance distance. This not only effectively reduces the risk of collisions between ships and obstacles during navigation and significantly improves navigation safety, but also reduces redundant calculations in the path planning algorithm during the search process through standardized and precise environmental modeling, thereby improving the efficiency and accuracy of path planning.
[0043] In some preferred embodiments, step S2 includes: S21. Analyze whether a navigation path exists. If yes, proceed to step S22; otherwise, proceed to step S23. S22. Construct an elliptical sampling region with the preset starting position and preset target position as the focus and the path cost upper limit value as the length of the major axis. Then sample the elliptical sampling region to extract multiple sampling points. S23. Perform full-area sampling on the grid map to extract multiple sampling points.
[0044] Step S21 aims to dynamically select a sampling strategy based on the current system state (whether a stored navigation path exists) to optimize sampling efficiency and path planning quality. By introducing conditional judgment, the limitations of a single sampling method are avoided. Specifically, the system can query whether navigation path data exists in system memory or persistent storage. When historical navigation trajectories exist, the system constructs an elliptical sampling region focused on the area between the starting point and the target point for sampling, thereby limiting the sampling range to the area more likely to contain the optimal path, significantly improving sampling efficiency. Methods for sampling the elliptical sampling region can include: randomly generating points within the elliptical region as sampling points; to ensure a uniform distribution of sampling points, Monte Carlo sampling (existing technology) can be used; or, quasi-random sequences such as Halton sequences or Sobol sequences can be used to generate sampling points within the elliptical region (existing technology) to obtain a more uniform distribution than pure random sampling. When no historical navigation track exists, the system conducts a comprehensive exploration of the passable area in the grid map to avoid missing potential optimal paths and ensure the robustness and completeness of path planning. The method of sampling the entire grid map can include: generating sampling points at the center or vertex of each grid cell according to a preset step size or density within the passable area of the entire grid map, i.e., uniform grid sampling; or, randomly generating a large number of sampling points within the passable area of the entire grid map.
[0045] This embodiment significantly optimizes the sampling point extraction process by introducing a dynamic sampling strategy. Specifically, the method first executes step S21 to analyze whether a historical navigation trajectory exists. This judgment mechanism is the core of the entire dynamic sampling strategy, enabling the system to flexibly adjust its sampling behavior according to the actual situation. When a navigation path is detected, the system constructs an elliptical sampling region with a preset starting position and a preset target position as the focus and the current path cost upper limit as the length of the major axis. This elliptical sampling region construction method cleverly utilizes the heuristic idea of path planning, concentrating the sampling space between the starting point and the target point, and its size is limited by the currently known optimal path cost. By sampling within this elliptical sampling region, multiple sampling points can be efficiently extracted. These sampling points are more likely to be located near the optimal path, thereby significantly reducing the computational overhead of sampling in irrelevant areas. When the system determines that no navigation path exists, this usually means that the first path planning attempt has failed or previous planning attempts have been unsuccessful. In this high-uncertainty scenario, the system performs full-area sampling on the entire grid map to ensure comprehensive exploration of all passable areas. This avoids missing potential optimal paths due to an insufficiently small sampling area, thus ensuring the robustness and completeness of the path planning. Through the aforementioned dynamic sampling strategy, the proposed solution, combined with the basic global path planning method, forms a more efficient and intelligent path planning process. When a navigation path exists, local sampling accelerates path search and reduces unnecessary computation, thereby improving the real-time performance of the planning. When no navigation path exists, full-area sampling ensures the comprehensiveness of the search, increasing the success rate of finding the first feasible navigation path. This mechanism of dynamically adjusting the sampling area based on the presence or absence of a navigation path significantly improves computational efficiency and adaptability while maintaining high planning quality, effectively solving the problems of low sampling efficiency and computational redundancy in traditional methods.
[0046] In some preferred embodiments, the passage constraint attribute includes a no-navigation zone, and step S3 includes: S31. Take the edge with the smallest first total estimated cost as the best edge, and calculate the second total estimated cost corresponding to the end point of the best edge based on the total path length from the preset starting position to the end point of the best edge and the Euclidean distance between the end point of the best edge and the preset target position. S32. Analyze whether the second total estimated cost is greater than or equal to the upper limit of the path cost. If yes, the truncation check is considered to have failed and step S33 is executed. If no, the truncation check is considered to have passed and step S35 is executed. S33. Calculate the third total estimated cost corresponding to the endpoint of each edge based on the total path length from the preset starting position to the endpoint of each edge and the Euclidean distance from the endpoint of each edge to the preset target position. Delete the edges corresponding to the third total estimated cost that are greater than the upper limit of the path cost and the first total estimated cost. Analyze whether there are any edges that have not been deleted. If yes, return to step S31. If no, execute step S34. S34. Analyze whether the number of sampling points has reached the preset number. If yes, generate the navigation trajectory based on the last stored navigation path. If no, delete all edges and return to step S2. S35. Analyze whether the best edge passes through the restricted area. If so, the collision detection is considered to have failed. Delete the best edge and its corresponding first total estimated cost, and return to step S31. If not, the collision detection is considered to have passed.
[0047] The endpoint of the optimal edge is the sampling point connected by the optimal edge, which is the next potential node in the current path search. The total path length in this embodiment is the actual cumulative path length from the preset starting position to the endpoint of the optimal edge. This embodiment calculates the total path length by summing the actual lengths of the stored optimal edges and the actual length of the current optimal edge. The second total estimated cost is a cost evaluation value used for truncation checks. This embodiment obtains the second total estimated cost by adding the actual total path length from the preset starting position to the endpoint of the optimal edge and the Euclidean distance from the endpoint of the optimal edge to the preset target position. The path cost upper limit is a dynamically updated threshold used to avoid considering a path with a cost greater than the path found in previous iterations as a better solution during the current iteration. Initially, it can be set to a large value. During the search, when a potential complete path is found, its first total estimated cost can be used as the new path cost upper limit. Truncating is a pruning strategy used to determine if the current best edge can form a path better than the known best path. If its second total estimated cost exceeds the upper limit of the path cost, the edge is considered unlikely to form a better path and should be truncated. The third total estimated cost is similar to the second total estimated cost, used to more strictly filter all edges to be processed, deleting those edges that are clearly unlikely to form a good path. The calculation method is the same as the second total estimated cost, but it applies to all edges. The number of sampling points extracted records the number of iterations in the path planning algorithm, used to control the algorithm's termination condition or adjust the search strategy. It can be a counter variable that increments with each sampling operation. The preset number is a pre-set maximum allowed number of sampling points extracted; the algorithm will terminate after reaching this number. It is a fixed integer value, set according to the actual application scenario and computing resources. Collision detection determines whether an edge overlaps with or crosses a restricted area to ensure the generated path is safe. This can be done by querying the discrete points of the edge using a grid map to check if these points fall within the restricted area, or by performing intersection detection between the edge segment and the polygon (the boundary of the restricted area).
[0048] This embodiment optimizes the efficiency and safety of path search by performing refined truncation checks and collision detection on the best edge during the path planning search process. Specifically, in step S31, a second total estimated cost corresponding to the endpoint of the best edge is calculated. This cost combines the actual total path length from the preset starting position to the endpoint of the best edge and the Euclidean distance from the endpoint of the best edge to the preset target position, providing a more comprehensive and accurate estimate of the total cost of the current best edge. This makes the truncation check performed in step S32 more accurate, effectively filtering out edges that, even in the most ideal case, cannot be better than the currently known best path, thus avoiding further exploration of invalid path branches and significantly reducing the waste of computational resources. When the best edge fails the truncation check, in step S33, this scheme further filters all remaining candidate edges, calculates their third total estimated cost, and deletes those edges whose third total estimated cost exceeds the upper limit of the path cost. This further narrows the search space, allowing the algorithm to explore potential nodes and edges more focused on. If any edges remain after this round of filtering, the process returns to step S31 for re-evaluation, ensuring that exploration always begins with the most promising edge. Furthermore, in step S35, this scheme performs rigorous collision detection on the best edge that passes the truncation check to determine if it passes through a restricted area. Once a collision is detected, the best edge and its corresponding first total estimated cost are immediately deleted, and the process returns to step S31 to select the next best edge. This mechanism ensures that the generated navigation path always avoids dangerous areas, greatly improving path safety. Through the aforementioned refined truncation and collision detection, this scheme, combined with the basic sampling-based path planning method, can more efficiently search for paths in complex nautical chart scenarios and ensure the safety of the planned path, effectively solving the problems of high computational complexity, search redundancy, and insufficient path safety in traditional methods.
[0049] In some preferred embodiments, the formula for calculating the first total estimated cost is: ; Among them, f ei Let u represent the first total estimated cost corresponding to the i-th edge. i Let v represent the starting point of the i-th edge. i Let (u) represent the endpoint of the i-th edge. i ,v i ) represents the i-th edge, g(u i ) represents the total path length from the preset starting position to the starting point of the i-th edge, w represents the expansion coefficient, and h(v) represents the total path length from the preset starting position to the starting point of the i-th edge. i (x) represents the Euclidean distance from the endpoint of the i-th edge to the preset target position. G ,y G (x) represents the coordinates of the preset target position.vi ,y vi () represents the coordinates of the endpoint of the i-th edge; The formula for calculating the second total estimated cost is the same as that for the third total estimated cost. The formula for calculating the second total estimated cost is as follows: ; Where f(j) represents the second total estimated cost corresponding to the j-th optimal edge, and v j Let g(v) represent the endpoint of the j-th optimal edge. j h(v) represents the total path length from the preset starting position to the endpoint of the j-th optimal edge. j (x) represents the Euclidean distance from the endpoint of the j-th optimal edge to the preset target position. vj ,y vj ) represents the coordinates of the endpoint of the j-th optimal edge.
[0050] In the formula for calculating the first total estimated cost, this embodiment uses an inflation coefficient to weight the Euclidean distance from the endpoint of the i-th edge to the preset target position. This allows the path planning algorithm to adjust the weights of the heuristic information according to actual needs. Specifically, when the value of w is large, the algorithm tends to explore larger and farther regions to avoid getting trapped in local optima; when the value of w is small, the algorithm focuses more on fast convergence towards the target direction. This dynamic adjustment capability effectively solves the problem that the traditional Euclidean distance heuristic function may be too optimistic, leading to serious redundancy in the search process. By moderately inflating the heuristic estimate (the Euclidean distance from the endpoint of the i-th edge to the preset target position), the algorithm can more effectively guide the search direction, reduce unnecessary exploration, and thus improve sampling efficiency. The formula for calculating the second total estimated cost does not include an inflation coefficient. It provides a more accurate path cost estimate from the preset starting position to the optimal edge endpoint and then to the preset target position, enabling truncation checks to more accurately determine whether the current path has the potential to continue exploration and assisting collision detection to avoid the generation of invalid paths. This dual-cost estimation mechanism—using a weighted heuristic cost (first total estimated cost) to guide the search in its initial stages and a precise cost (second total estimated cost) to determine key decision points—ensures that the entire path planning process is efficient while improving path quality and reliability. Through this optimized cost function, this embodiment can more efficiently extract sampling points and generate edges from the grid map, and effectively perform truncation checks and collision detection on the best edges, thus significantly improving the efficiency and accuracy of path planning in complex nautical chart environments.
[0051] In some preferred embodiments, step S33 includes: S331. Calculate the third total estimated cost for each edge based on the total path length from the preset starting position to the endpoint of each edge and the Euclidean distance from the endpoint of each edge to the preset target position. Delete the edges with third total estimated costs greater than the upper limit of the path cost and the first total estimated cost. Analyze whether there are any edges that have not been deleted. If yes, return to step S31. If no, update the inflation coefficient based on the number of times the sampling points are extracted and execute step S34. The inflation coefficient is greater than or equal to 1. The greater the number of times the sampling points are extracted, the closer the inflation coefficient is to 1. Step S34 includes: S341. Analyze whether the number of sampling points extracted reaches the preset number or the expansion coefficient is equal to 1. If yes, generate the navigation trajectory based on the last stored navigation path. If no, delete all edges and return to step S2. Step S4 includes: S41. When the best edge passes the truncation check and collision detection, analyze whether the endpoint of the best edge is the preset target position and the first total estimated cost of the best edge is less than the upper limit of the path cost. If so, then all the best edges extracted and stored after this sampling point are spliced into a navigation path, the navigation path is stored, the expansion coefficient is updated according to the number of sampling points, and step S5 is executed. If not, step S6 is executed. S5 includes: S51. Analyze whether the number of sampling points extracted reaches the preset number or the expansion coefficient is equal to 1. If yes, generate the navigation trajectory based on the last stored navigation path. If no, proceed to step S52. S52. Take the first total estimated cost as the new upper limit of the path cost, calculate the fourth total estimated cost corresponding to each sampling point according to the total path length from the preset starting position to each sampling point and the Euclidean distance from each sampling point to the preset target position, delete the sampling points corresponding to the fourth total estimated cost that is greater than the upper limit of the path cost, delete all edges, and return to step S2. Step S6 includes: S61. When the endpoint of the best edge is not the preset target position and its first total estimated cost is less than the upper limit of the path cost, the best edge is stored. Then, the endpoint of the best edge is used as the new starting point. Several edges are regenerated based on the remaining sampling points. The first total estimated cost corresponding to each regenerated edge is calculated respectively, and the process returns to step S3. S62. When the first total estimated cost is greater than or equal to the upper limit of the path cost, delete all edges, update the expansion coefficient according to the number of sampling points extracted, and analyze whether the number of sampling points extracted reaches the preset number or the expansion coefficient is equal to 1. If yes, generate the navigation trajectory according to the last stored navigation path. If no, execute step S63. S63. Calculate the fourth total estimated cost corresponding to each sampling point based on the total path length from the preset starting position to each sampling point and the Euclidean distance from each sampling point to the preset target position. Delete the sampling points corresponding to the fourth total estimated cost that is greater than the upper limit of the path cost, delete all edges, and return to step S2.
[0052] In the initial cost estimation, the inflation coefficient serves as a weight for the heuristic estimation. Its value is dynamically adjusted based on the number of algorithm iterations (i.e., the number of sampling points extracted). This adjustment aims to balance the exploratory and convergent aspects of the search. One way to adjust the inflation coefficient is by using a predefined function, such as w = max(1, W_initial - k * N_samples), where W_initial is the initial inflation coefficient, k is the decay factor, and N_samples is the number of sampling points extracted. Alternatively, a piecewise function or lookup table can be used, setting different inflation coefficients for different intervals of sampling. An inflation coefficient greater than or equal to 1 ensures that the heuristic function does not underestimate the actual cost. The greater the number of sampling points extracted, the closer the inflation coefficient approaches 1, meaning that as the search deepens, the algorithm becomes increasingly reliant on the actual cost, reducing the inflation effect of the heuristic estimation and helping to find a better path. Whether the number of sampling points extracted reaches the predefined number or the inflation coefficient equals 1 is the criterion for the algorithm to terminate or proceed to the next stage. The preset number of iterations is a threshold to limit the search depth and prevent infinite loops. An inflation coefficient of 1 indicates that the heuristic cost has stopped inflating, at which point the algorithm's behavior approaches that of Dijkstra's algorithm, usually meaning that a relatively optimal solution has been found or the search has been sufficiently explored. The first total estimated cost is used as a new upper limit for the path cost, designed to dynamically adjust the upper limit of the search. This is used in subsequent iterations to find search branches whose estimated cost is greater than the cost of the current iteration. That is, when a feasible path is found, its cost can be used as a reference for subsequent searches, excluding paths with higher costs. The fourth total estimated cost is calculated for each sampling point based on the total path length from the preset starting position to each sampling point and the Euclidean distance from each sampling point to the preset target position. This is used to evaluate the quality of the sampling points for selection. The fourth total estimated cost is similar to the second total estimated cost, but it applies to the sampling point itself, not the edge. The formula for calculating the fourth total estimated cost is different from that for the second total estimated cost. The deletion of sample points corresponding to the fourth total estimated cost that is greater than the path cost upper limit is based on the dynamically updated path cost upper limit. The sample points are pruned by removing those sample points that cannot be better than the currently known best path even if the best path is taken, thereby reducing the search space and improving efficiency.
[0053] This embodiment introduces a dynamic update mechanism for the expansion coefficient to progressively optimize the search process through multiple sampling iterations, reducing redundant computation and improving path planning efficiency. Specifically, when no edges remain to be deleted, the expansion coefficient is updated based on the number of extractions of sampling points, causing it to approach 1 as the number of extractions increases. This reduces over-expansion in heuristic estimations, avoids blind expansion in later iterations, and focuses on more likely optimal path regions. Simultaneously, by analyzing whether the conditions of reaching a preset number of extractions or an expansion coefficient equal to 1 are met, a decision is made on whether to generate a navigation trajectory or continue iterations. This ensures that the search terminates promptly upon convergence or under preset conditions, preventing invalid loops. In the early stages of iterative optimization, a larger expansion coefficient helps to quickly discover potential paths, even if these paths may not be optimal; while in the later stages of iterative optimization, the expansion coefficient approaches 1, enabling the algorithm to converge more accurately to the optimal path. Meanwhile, the dynamically updated path cost upper limit and the sampling point pruning based on this upper limit can effectively narrow the search range and avoid repeated calculations of unnecessary areas. This significantly improves planning efficiency and real-time performance while ensuring path quality, and is especially suitable for large-scale nautical chart environments and scenarios with complex obstacle distributions.
[0054] In some preferred embodiments, the navigation path includes multiple nodes, and the start or end point of the optimal edge corresponds to a node. The process of generating a navigation trajectory based on the last stored navigation path includes: A1. Mark the nodes corresponding to the preset starting position and the nodes corresponding to the preset target position as key control points; A2. For each node other than the node corresponding to the preset starting position and the node corresponding to the preset target position, obtain the angle information between the best edge starting from the node and the best edge ending at the node, and analyze whether the angle information is greater than or equal to the preset threshold. If yes, mark the node as a key control point; otherwise, delete the node. A3. Generate a navigation trajectory based on all key control points.
[0055] The navigation path in this embodiment is formed by splicing together a series of optimal edges connected end-to-end. Since each optimal edge corresponds to two points (a sampling point, a preset starting position, or a preset target position), the navigation path in this embodiment includes multiple nodes. Each point on the optimal edge has a corresponding node. Specifically, each node represents a position that the ship may pass through during navigation, and they together define the route skeleton of the ship from the starting position to the target position. Since the finally stored navigation path is based on splicing together all the optimal edges corresponding to the minimum total estimated cost, that is, the finally stored navigation path is equivalent to the optimal solution of the navigation path, generating the navigation trajectory based on the finally stored navigation path is equivalent to transforming the optimal solution of the navigation path into a continuous, smooth, and more suitable curved trajectory for the actual navigation of the ship. Step A1 ensures that the planned navigation trajectory can accurately start from the preset starting position and accurately reach the preset target position by marking the nodes corresponding to the preset starting position and the preset target position as key control points. That is, directly marking these two endpoints as key control points is the basis for ensuring the integrity of the path and the reachability of the target. Step A2 identifies nodes in the navigation path that have significant turning implications (nodes with included angle information greater than or equal to a preset threshold) and removes redundant nodes in straight segments (nodes with included angle information less than a preset threshold). The preset threshold can be set according to the ship's maneuverability, the complexity of the navigation environment, and the requirements for trajectory smoothness; for example, it can be set to 15 degrees, 30 degrees, or 45 degrees. When the included angle information is greater than or equal to the preset threshold, it indicates that there is a significant turning at that node, and the node needs to be retained to maintain the geometric characteristics of the path; conversely, if the included angle information is less than the preset threshold, it indicates that the node is located on a relatively straight path segment, and its contribution to the path shape is small, so it can be deleted to simplify the trajectory. Step A3 generates the navigation trajectory based on all key control points. This step uses the selected key control points to construct the final smooth navigation trajectory. Methods for generating a navigation trajectory may include, but are not limited to, using mathematical methods such as spline interpolation (e.g., cubic spline interpolation, B-spline interpolation) or curve fitting (e.g., Bézier curve fitting) to generate a continuous curve with a specified smoothness through these key control points. It should be understood that generating a navigation trajectory based on all key control points using spline interpolation or curve fitting methods is existing technology.
[0056] This embodiment first generates a preliminary navigation path based on preset starting and target positions through a series of sampling and cost evaluations. This path consists of multiple discrete nodes and multiple optimal edges connecting the beginning and end of the path. While this preliminary navigation path can avoid obstacles, it may suffer from an excessive number of nodes and insufficient path smoothness. To address this issue, this application further optimizes the navigation path to generate a smoother and more efficient navigation trajectory. Specifically, the method directly marks the nodes corresponding to the preset starting position and the preset target position in the preliminary navigation path as key control points to ensure the accuracy of the starting and ending points of the final trajectory. Subsequently, for each intermediate node in the path other than the starting node (the node corresponding to the preset starting position) and the target node (the node corresponding to the preset target position), the system obtains the angle information between the optimal edge starting from that node and the optimal edge ending at that node. By analyzing whether this angle information is greater than or equal to a preset threshold, it is determined whether the node represents an important turning point. If the included angle information is large, it indicates a significant change in path direction at the node, and it is marked as a critical control point and retained. Conversely, if the included angle information is small, it indicates that the node is located on a relatively straight path segment and contributes little to the path shape, so it is deleted. In this way, nodes crucial to the shape of the navigation trajectory can be effectively selected, and redundant intermediate nodes can be eliminated. Finally, only these nodes marked as critical control points are used to generate the final navigation trajectory. This embodiment intelligently filters the initial navigation path, retaining only the critical control points that decisively influence the path shape, thereby significantly reducing the number of nodes in the trajectory while maintaining the path's geometric characteristics. This processing method results in a smoother navigation trajectory, reducing unnecessary turns and path segments, and greatly improving the controllability and comfort of the ship during actual navigation. Simultaneously, the reduction in the number of trajectory nodes also reduces the complexity of subsequent trajectory tracking and calculation by the ship's control system, improving the system's real-time response capability. This method, combined with the basic global path planning method, can further optimize the initially planned feasible path into a high-quality, executable navigation trajectory, thereby effectively solving the problems of path redundancy and non-smoothness in traditional methods and improving the practicality and efficiency of path planning in nautical chart scenarios.
[0057] In some preferred embodiments, step A3 includes: A31. Treat all key control points as vertices of the control polygon of the Bézier curve, and use Bernstein polynomials to construct the navigation trajectory based on the vertices of the control polygon.
[0058] Bézier curves are parametric curves widely used in computer graphics and geometric design. Their characteristic is that the shape of the curve is defined by a set of control points. These curves possess excellent smoothness and controllability, generating continuous paths with gentle curvature changes, making them ideal for generating ship navigation trajectories to ensure navigational comfort and safety. The vertices of the control polygon are a set of points in the definition of a Bézier curve, collectively forming a control polygon. The shape of the Bézier curve is determined by these vertices; the curve will approximate, but not necessarily pass through, all intermediate vertices, but will always pass through the starting and ending vertices. By adjusting the positions of these vertices, the direction and curvature of the curve can be precisely controlled. Bernstein polynomials are the mathematical foundation of Bézier curves, providing a precise method for calculating the coordinates of any point on the curve. Using Bernstein polynomials, the positional information of the control polygon vertices can be weighted and combined to generate smooth curve segments. Their mathematical properties guarantee the continuity and differentiability of the generated curve, making the trajectory mathematically smooth. Constructing a navigation trajectory refers to generating a continuous, smooth path that a ship can follow, based on the aforementioned key control points and the mathematical principles of Bézier curves. It should be understood that step S31 is prior art, and its specific process will not be discussed in detail here.
[0059] Please refer to Figure 2 , Figure 2This application provides a schematic diagram of the structure of an electronic device, including a processor 101 and a memory 102. The processor 101 and the memory 102 are interconnected and communicate with each other via a communication bus 103 and / or other forms of connection mechanism (not shown). The memory 102 stores computer-readable instructions executable by the processor 101. When the electronic device is running, the processor 101 executes the computer-readable instructions to perform the method in any optional implementation of the above embodiments to achieve the following functions: Step S1: Convert the electronic chart data corresponding to the preset target navigation area into a grid map with navigation constraint attributes; Step S2: Extract multiple sampling points from the grid map, generate multiple edges according to the preset starting position and all sampling points, and then calculate the first total estimated cost corresponding to each edge; each edge starts from the preset starting position and ends at a sampling point; Step S3: Select the edge with the minimum first total estimated cost as the best edge and truncate the best edge. Step S4: When the best edge passes the truncation check and collision detection, analyze whether the endpoint of the best edge is the preset target position and the first total estimated cost of the best edge is less than the upper limit of the path cost. If yes, then concatenate all the best edges extracted and stored after this sampling point into a navigation path, then store the navigation path and execute step S5. If no, execute step S6. Step S5: Analyze whether the number of sampling point extractions has reached the preset number. If yes, then generate a navigation trajectory based on the last stored navigation path. If no, then delete all edges, use the first total estimated cost as the new upper limit of the path cost, and return to step S2. Step S6: When the endpoint of the best edge is not the preset target position and its first total estimated cost is less than the upper limit of the path cost, store the best edge, then use the endpoint of the best edge as the new starting point, regenerate several edges based on the remaining sampling points, and return to step S3. When the first total estimated cost of the best edge is greater than or equal to the upper limit of the path cost, delete all edges and return to step S2.
[0060] This application embodiment also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it executes the method in any optional implementation of the above embodiments to achieve the following functions: Step S1: Convert the electronic chart data corresponding to the preset target navigation area into a grid map with navigation constraint attributes; Step S2: Extract multiple sampling points from the grid map, generate multiple edges according to the preset starting position and all sampling points, and then calculate the first total estimated cost corresponding to each edge; each edge has a preset starting position as the starting point and a sampling point as the ending point; Step S3: Select the edge with the smallest first total estimated cost as the best edge, and perform truncation checks and collision detection on the best edge; Step S4: When the best edge passes the truncation check and collision detection, analyze whether the endpoint of the best edge is the preset target position and the first total estimated cost of the best edge is satisfied. If the total estimated cost is less than the upper limit of the path cost, then all the best edges extracted and stored after this sampling point are concatenated into a navigation path, and the navigation path is stored and step S5 is executed; otherwise, step S6 is executed. Step S5: Analyze whether the number of sampling point extractions has reached the preset number. If yes, then generate a navigation trajectory based on the last stored navigation path; otherwise, delete all edges, use the first total estimated cost as the new upper limit of the path cost, and return to step S2. Step S6: When the endpoint of the best edge is not the preset target position and its first total estimated cost is less than the upper limit of the path cost, store the best edge, then use the endpoint of the best edge as the new starting point, regenerate several edges based on the remaining sampling points, and return to step S3. When the first total estimated cost of the best edge is greater than or equal to the upper limit of the path cost, delete all edges and return to step S2. The computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0061] As can be seen from the above, the global path planning method, device, and medium provided in this application for nautical chart scenarios improve the efficiency and accuracy of path planning through an iteratively optimized sampling path planning strategy combined with heuristic search, truncation, and collision detection. By dynamically adjusting the upper limit of path cost and a resampling mechanism, iterative optimization of the path is achieved, avoiding getting trapped in local optima. By stitching together the best edges and generating a navigation trajectory, the smoothness and safety of the planned path are ensured, thereby improving the overall performance of global path planning in nautical chart scenarios. Therefore, this application can effectively solve the problems of high computational complexity, difficulty in guaranteeing planning accuracy and real-time performance, poor path smoothness, low sampling efficiency, and serious redundancy in the search process of existing global path planning technologies in nautical chart scenarios.
[0062] In the embodiments provided in this application, it should be understood that relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0063] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A global path planning method for nautical chart scenarios, characterized in that, It includes the following steps: S1. Convert the electronic nautical chart data corresponding to the preset target navigation area into a grid map with navigation constraint attributes; S2. Extract multiple sampling points from the grid map, generate multiple edges based on the preset starting position and all the sampling points, and then calculate the first total estimated cost corresponding to each edge; each edge starts from the preset starting position and ends at one of the sampling points; S3. Take the edge with the smallest total estimated cost as the best edge, and perform truncation check and collision detection on the best edge; S4. When the optimal edge passes the truncation check and collision detection, analyze whether the endpoint of the optimal edge is a preset target position and the first total estimated cost of the optimal edge is less than the upper limit of the path cost. If yes, then all the optimal edges extracted and stored after this sampling point are spliced into a navigation path, and then the navigation path is stored and step S5 is executed. If no, then step S6 is executed. S5. Analyze whether the number of extractions of the sampling points reaches the preset number or the expansion coefficient is equal to 1. If yes, generate the navigation trajectory according to the last stored navigation path. If no, delete all the edges, take the first total estimated cost as the new path cost upper limit, and return to step S2. S6. When the endpoint of the best edge is not the preset target position and its first total estimated cost is less than the upper limit of the path cost, the best edge is stored. Then, taking the endpoint of the best edge as the new starting point, several edges are regenerated based on the remaining sampling points. The first total estimated cost corresponding to each regenerated edge is calculated, and the process returns to step S3. When the first total estimated cost of the best edge is greater than or equal to the upper limit of the path cost, all edges are deleted, and the process returns to step S2.
2. The global path planning method for nautical chart scenarios according to claim 1, characterized in that, The passage constraint attributes include passable areas and restricted areas. Step S1 includes: S11. Obtain electronic nautical chart data corresponding to the preset target navigation area; the electronic nautical chart data includes preset impassable areas, coastlines and reefs; S12. Determine the safety redundancy distance based on the preset size of the vessel to be navigated, and then calculate the safe obstacle avoidance distance based on the safety redundancy distance and the preset minimum safe obstacle avoidance distance. S13. Expand the safe obstacle avoidance distance outward for the shoreline and the reef respectively to obtain the shoreline area and the reef area; S14. Mark the coastline area, the reef area, and the impassable area as no-navigation areas, and mark the areas in the electronic nautical chart data other than the no-navigation areas as navigable areas, so as to obtain electronic nautical chart data with navigability constraint attributes. S15. Perform coordinate unification and scale transformation on electronic nautical chart data with passage constraint attributes to convert the electronic nautical chart data with passage constraint attributes into a grid map with passage constraint attributes.
3. The global path planning method for nautical chart scenarios according to claim 1, characterized in that, Step S2 includes: S21. Analyze whether a navigation path exists. If yes, proceed to step S22; otherwise, proceed to step S23. S22. Construct an elliptical sampling region with a preset starting position and a preset target position as the focus and a path cost upper limit value as the length of the major axis, and then sample the elliptical sampling region to extract multiple sampling points; S23. Perform global sampling on the grid map to extract multiple sampling points.
4. The global path planning method for nautical chart scenarios according to claim 1, characterized in that, The passage constraint attribute includes a no-navigation zone, and step S3 includes: S31. Take the edge with the smallest first total estimated cost as the best edge, and calculate the second total estimated cost corresponding to the end point of the best edge based on the total path length from the preset starting position to the end point of the best edge and the Euclidean distance between the end point of the best edge and the preset target position. S32. Analyze whether the second total estimated cost is greater than or equal to the upper limit of the path cost. If yes, the truncation check is considered to have failed and step S33 is executed. If no, the truncation check is considered to have passed and step S35 is executed. S33. Calculate the third total estimated cost corresponding to the endpoint of each edge based on the total path length from the preset starting position to the endpoint of each edge and the Euclidean distance from the endpoint of each edge to the preset target position. Delete the edges corresponding to the third total estimated cost that are greater than the upper limit of the path cost and the first total estimated cost. Analyze whether there are any edges that have not been deleted. If yes, return to step S31. If no, execute step S34. S34. Analyze whether the number of extractions of the sampling points has reached the preset number. If yes, generate a navigation trajectory based on the last stored navigation path. If no, delete all the edges and return to step S2. S35. Analyze whether the optimal edge passes through the restricted area. If yes, the collision detection is considered to have failed. Delete the optimal edge and its corresponding first total estimated cost, and return to step S31. If no, the collision detection is considered to have passed.
5. The global path planning method for nautical chart scenarios according to claim 4, characterized in that, The formula for calculating the first total estimated cost is as follows: ; Among them, f ei Let u represent the first total estimated cost corresponding to the i-th edge. i Let v represent the starting point of the i-th edge. i Let (u) represent the endpoint of the i-th edge. i ,v i ) represents the i-th edge, g(u i ) represents the total path length from the preset starting position to the starting point of the i-th edge, w represents the expansion coefficient, and h(v) represents the total path length from the preset starting position to the starting point of the i-th edge. i (x) represents the Euclidean distance from the endpoint of the i-th edge to the preset target position. G ,y G (x) represents the coordinates of the preset target position. vi ,y vi () represents the coordinates of the endpoint of the i-th edge; The formula for calculating the second total estimated cost is the same as the formula for calculating the third total estimated cost. The formula for calculating the second total estimated cost is as follows: ; Where f(j) represents the second total estimated cost corresponding to the j-th optimal edge, and v j Let g(v) represent the endpoint of the j-th optimal edge. j h(v) represents the total path length from the preset starting position to the endpoint of the j-th optimal edge. j (x) represents the Euclidean distance from the endpoint of the j-th optimal edge to the preset target position. vj ,y vj ) represents the coordinates of the endpoint of the j-th optimal edge.
6. The global path planning method for nautical chart scenarios according to claim 5, characterized in that, Step S33 includes: S331. Calculate the third total estimated cost corresponding to each edge based on the total path length from the preset starting position to the endpoint of each edge and the Euclidean distance from the endpoint of each edge to the preset target position. Delete edges with a third total estimated cost greater than the upper limit of the path cost and the first total estimated cost. Analyze whether there are any edges that have not been deleted. If yes, return to step S31; otherwise, update the inflation coefficient based on the number of times the sampling point is extracted, and execute step S34. The inflation coefficient is greater than or equal to 1. The greater the number of times the sampling point is extracted, the closer the inflation coefficient is to 1. Step S34 includes: S341. Analyze whether the number of extractions of the sampling points reaches the preset number or the expansion coefficient is equal to 1. If yes, generate a navigation trajectory based on the last stored navigation path. If no, delete all the edges and return to step S2. Step S4 includes: S41. When the optimal edge passes the truncation check and collision detection, analyze whether the endpoint of the optimal edge is a preset target position and the first total estimated cost of the optimal edge is less than the upper limit of the path cost. If yes, then all the optimal edges extracted and stored after this sampling point are spliced into a navigation path, the navigation path is stored, the expansion coefficient is updated according to the number of extractions of the sampling point, and step S5 is executed. If no, then step S6 is executed. S5 includes: S51. Analyze whether the number of extractions of the sampling points reaches the preset number or the expansion coefficient is equal to 1. If yes, generate a navigation trajectory based on the last stored navigation path. If no, proceed to step S52. S52. Using the first total estimated cost as the new upper limit of the path cost, calculate the fourth total estimated cost corresponding to each sampling point based on the total path length from the preset starting position to each sampling point and the Euclidean distance from each sampling point to the preset target position. Delete the sampling points corresponding to the fourth total estimated cost that is greater than the upper limit of the path cost, delete all the edges, and return to step S2. Step S6 includes: S61. When the endpoint of the best edge is not the preset target position and its first total estimated cost is less than the upper limit of the path cost, the best edge is stored. Then, the endpoint of the best edge is used as the new starting point. Several edges are regenerated based on the remaining sampling points. The first total estimated cost corresponding to each regenerated edge is calculated respectively, and the process returns to step S3. S62. When the first total estimated cost is greater than or equal to the upper limit of the path cost, delete all the edges, update the expansion coefficient according to the number of times the sampling points are extracted, and analyze whether the number of times the sampling points are extracted reaches the preset number or the expansion coefficient is equal to 1. If yes, generate a navigation trajectory according to the last stored navigation path. If no, execute step S63. S63. Calculate the fourth total estimated cost corresponding to each sampling point based on the total path length from the preset starting position to each sampling point and the Euclidean distance from each sampling point to the preset target position. Delete the sampling points corresponding to the fourth total estimated cost that is greater than the upper limit of the path cost, delete all the edges, and return to step S2.
7. The global path planning method for nautical chart scenarios according to claim 1, characterized in that, The navigation path includes multiple nodes, and the start or end point of the optimal edge corresponds to one of the nodes. The process of generating the navigation trajectory based on the last stored navigation path includes: A1. Mark the node corresponding to the preset starting position and the node corresponding to the preset target position as key control points; A2. For each node other than the node corresponding to the preset starting position and the node corresponding to the preset target position, obtain the angle information between the best edge starting from the node and the best edge ending at the node, and analyze whether the angle information is greater than or equal to a preset threshold. If yes, mark the node as a key control point; otherwise, delete the node. A3. Generate a navigation trajectory based on all the key control points mentioned above.
8. The global path planning method for nautical chart scenarios according to claim 7, characterized in that, Step A3 includes: A31. Use all the key control points as vertices of the control polygon of the Bézier curve, and construct the navigation trajectory based on the vertices of the control polygon using Bernstein polynomials.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing computer-readable instructions that, when executed by the processor, perform the steps of the method as described in any one of claims 1-8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it performs the steps of the method as described in any one of claims 1-8.