A path planning method and system based on three-dimensional space grid state marking

CN122813845APending Publication Date: 2026-09-25四川易方智慧科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610978547.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-02
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0006]有鉴于此,本发明提供了一种基于三维空间栅格状态标记的路径规划方法及系统,以解决现有技术中三维无人机路径规划无法兼顾障碍识别精度、路径最优性的问题

Benefits of technology

1.本发明中,基于三维立方体网格双色标记与二十六邻域扩展的N3算法,能够遍历全部可通行网格并精确迭代累计代价,避免了传统A算法的局部最优和RRT算法的路径冗余,实际飞行路径长度缩短15%至40%,真正实现全局最短无碰撞路径规划。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122813845A_ABST
    Figure CN122813845A_ABST
Patent Text Reader

Abstract

The application discloses a path planning method and system based on three-dimensional space grid state marking. The method comprises the following steps: discretizing a three-dimensional space of unmanned aerial vehicle operation into equilateral cubic grids and giving an initial mark to each grid; performing obstacle detection on each grid, marking as a first color state when there is an obstacle, otherwise marking as a second color state; based on a three-dimensional neighborhood expansion algorithm, traversing all passable grids layer by layer from a starting grid, calculating the cumulative cost of each grid relative to the starting grid; when the target grid is included in the traversal range, backtracking from the target grid to the starting grid, extracting the grid sequence with the minimum cumulative cost as the shortest collision-free flight path. The application realizes global shortest path planning in a complex three-dimensional scene through double-color marking and three-dimensional neighborhood expansion, avoids local optimization, significantly shortens the flight path length, and is easy to integrate into a simulation platform for rapid verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of UAV path planning technology, specifically relating to a path planning method and system based on three-dimensional spatial grid state marking. Background Technology

[0002] Drones are widely used in scenarios such as inspection, surveying, and logistics delivery. Three-dimensional spatial path planning is the core technology for autonomous navigation of drones. The actual operating environment contains static or dynamic obstacles such as buildings, vegetation, and terrain. It is necessary to complete spatial modeling and obstacle recognition first, and then generate a safe and feasible flight path.

[0003] Spatial mesh modeling discretizes continuous 3D space into regular cubic meshes, simplifying spatial representation and collision detection; path planning algorithms search for the optimal path within a safe mesh; the Unity simulation platform has the capabilities for 3D scene building, physical collision simulation, and UAV dynamics simulation, making it a mainstream tool for verifying path planning algorithms.

[0004] Existing 3D UAV path planning mainly adopts two types of schemes: Based on raster method and A The algorithm's path planning divides the space into a two-dimensional or three-dimensional grid, marks obstacle areas, and uses A... The algorithm searches for paths in a free grid. This method is simple to implement, but it only considers two-dimensional planar constraints, has poor three-dimensional scalability, is susceptible to local optima, and the path is not the shortest.

[0005] 3D path planning based on sampling methods employs RRT and RRT. Random sampling algorithms construct path trees by randomly sampling nodes in three-dimensional space. This method does not require precise modeling, but it has low sampling efficiency, high path redundancy, cannot guarantee the shortest path, and lacks standardized obstacle marking rules. Summary of the Invention

[0006] In view of this, the present invention provides a path planning method and system based on three-dimensional spatial grid state marking to solve the problem that the existing three-dimensional UAV path planning cannot take into account both obstacle recognition accuracy and path optimization.

[0007] The technical solution adopted in this invention is as follows: A path planning method based on three-dimensional spatial grid state marking includes: Step S1: Discretize the three-dimensional space of the UAV operation into a cubic mesh with equal side length, and assign an initial state label to each mesh; Step S2: Perform obstacle detection on each grid in the cube grid. If there is an obstacle at the location of the grid, mark the grid as the first color state; otherwise, mark it as the second color state. In step S2, the execution obstacle detection specifically includes: Using the center point of each grid as the emission point, detection rays are emitted along the positive and negative directions of the spatial coordinate axes respectively. If any ray intersects with an obstacle collider in the scene, it is determined that there is an obstacle at that grid location.

[0008] In step 2, the first color state is red, representing the obstacle mesh; the second color state is green, representing the safety mesh, as shown in the following formula:

[0009] In the formula, For grid 3D indexing, Mark the grid status; Step S3: Obtain the starting grid and target grid for the drone's flight, and only designate the grid marked in the second color state as passable areas; Step S4: Based on the three-dimensional neighborhood expansion algorithm, starting from the starting grid, traverse all passable grids layer by layer, and calculate the cumulative cost of each grid relative to the starting grid. The cumulative cost includes at least the spatial distance factor between the grid and the starting grid and the spatial distance factor between the grid and the target grid. Step S4 specifically includes: Step S41: Obtain the 26 neighborhoods of the current grid, and include only the grids marked with the second color state in the neighborhoods; the expression for the 26 neighborhoods of the current grid is as follows:

[0010] in, The neighborhood is the 3D index of the current grid, and it contains all combinations of coordinate changes that are all -1, 0, or +1 and not all zero.

[0011] Step S42: Obtain the single-step cost, which is the three-dimensional Euclidean distance between the center points of two grids; the three-dimensional Euclidean distance is determined by the following formula:

[0012] in, and For any two grids, ( )and( ) are the coordinates of the center points of the two grids, respectively.

[0013] Step S43: Obtain the heuristic cost function, which is a weighted sum of three terms, where the first term is the three-dimensional Euclidean distance from the current grid to the starting grid, the second term is the three-dimensional Euclidean distance from the current grid to the target grid, and the third term is the safety penalty term. The weighted sum of the three terms is shown in the following formula:

[0014] in, For the current grid n The total cost, D(n,S) For grid n To the starting point S The three-dimensional Euclidean distance, D(n, T) For grid n To the finish line T The three-dimensional Euclidean distance, P(n) For safety penalties, obstacle grid P=∞, and safety grid P=0. Let be the weighting coefficient, satisfying .

[0015] Step S44: Based on the neighborhood, the single-step cost, and the heuristic cost function, calculate the minimum cumulative cost from the starting grid to each passable grid through iterative updates until the cumulative cost of the target grid is determined.

[0016] The iterative update calculation is represented as follows:

[0017] in, Cost(n) From the starting point to the grid n The minimum cumulative cost, m For grid n The neighborhood security grid, C(m,n) For grid m arrive n The cost per step.

[0018] Step S5: Once the target grid is included in the traversal range, backtrack from the target grid to the starting grid and extract the grid sequence with the minimum cumulative cost as the shortest collision-free flight path for the UAV.

[0019] Step S5 specifically includes: Step S51: Take the target grid as the current backtracking node, select the neighboring grid with the smallest cumulative cost in the twenty-six neighborhoods of the current backtracking node as the previous node, and update the previous node as the new current backtracking node. Step S52: Repeat step S51 until the current backtracking node is the starting grid. Arrange the nodes obtained in sequence during the backtracking process in order from the start to the target to obtain the shortest path node sequence. in, As the starting grid, For the target grid, These are the intermediate grid nodes obtained sequentially during the backtracking process, arranged in order from the start to the target.

[0020] Step 5 is followed by step 6: converting the grid sequence in the shortest collision-free flight path into a three-dimensional spatial coordinate point sequence, and importing the coordinate point sequence into the simulation platform to generate the UAV's flight path; mounting the UAV dynamics model in the simulation platform, executing simulated flight, and verifying the collision-free and shortest distance characteristics of the path.

[0021] A path planning system based on three-dimensional spatial grid state marking includes: The 3D meshing module discretizes the 3D space of UAV operations into cubic meshes of equal side lengths and assigns an initial state label to each mesh. The obstacle detection and marking module performs obstacle detection on each grid in the cube grid. If there is an obstacle at the location of the grid, the grid is marked as the first color state; otherwise, it is marked as the second color state. The module also acquires the starting grid and target grid of the UAV flight and only marks the grid marked as the second color state as the passable area. The path search module, based on the three-dimensional neighborhood expansion algorithm, starts from the starting grid and traverses all passable grids layer by layer, calculating the cumulative cost of each grid relative to the starting grid. The cumulative cost includes at least the spatial distance factor between the grid and the starting grid and the spatial distance factor between the grid and the target grid. The backtracking output module, after the target grid is included in the traversal range, backtracks from the target grid to the starting grid and extracts the grid sequence with the minimum cumulative cost as the shortest collision-free flight path for the UAV. The simulation verification module converts the grid sequence in the shortest collision-free flight path into a three-dimensional spatial coordinate point sequence, imports the coordinate point sequence into the simulation platform, generates the UAV's flight path, mounts the UAV dynamics model in the simulation platform, executes simulated flight, and verifies the collision-free and shortest distance characteristics of the path.

[0022] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: 1. In this invention, the N3 algorithm based on two-color marking of a three-dimensional cubic mesh and twenty-six-neighborhood expansion can traverse all walkable meshes and accurately iterate and accumulate costs, avoiding the limitations of traditional A algorithms. The algorithm's local optima and the RRT algorithm's path redundancy reduce the actual flight path length by 15% to 40%, truly achieving global shortest collision-free path planning.

[0023] 2. In this invention, by expanding the omnidirectional neighborhood, it naturally adapts to complex three-dimensional scenes such as undulating terrain and multi-story buildings, and completely solves the problem of obstacle collision caused by the lack of vertical search capability in the two-dimensional grid method.

[0024] 3. This invention deeply integrates grid marking, path search and simulation platform, and the planned path node sequence can be directly converted into UAV flight path and completed dynamic simulation verification.

[0025] 4. In this invention, the grid edge length and cost function weight can be flexibly adjusted according to the operation accuracy and task preference, and it is compatible with various scenarios such as inspection, surveying, and logistics as well as UAV models, realizing a high-precision, high-efficiency, and highly versatile three-dimensional path planning integrated closed loop. Attached Figure Description

[0026] The present invention will be described by way of example and with reference to the accompanying drawings, wherein: Figure 1 This is a schematic diagram of the process structure of the present invention; Figure 2 This is a schematic diagram of the structure after mesh division in step S1 of the present invention; Figure 3 This is a schematic diagram of the structure after color marking in step S2 of the present invention. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0028] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0029] It should be noted that, unless otherwise specified, the embodiments and features described in this invention can be combined with each other.

[0030] It should be noted that similar labels 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.

[0031] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.

[0032] It should be noted that, unless otherwise specified, the embodiments and features described in this invention can be combined with each other.

[0033] Example

[0034] like Figures 1-3 As shown in the figure, an embodiment of the present invention discloses a path planning method based on three-dimensional spatial grid state marking, including: Step S1: Discretize the three-dimensional space of the UAV operation into a cubic mesh with equal side length, and assign an initial state label to each mesh; The number of grid cells in each direction is represented as follows:

[0035] These represent the maximum lengths of the three-dimensional space along the horizontal, vertical, and longitudinal axes, respectively. Where is the grid side length, and the total number of grid cells is:

[0036] Step S2: Perform obstacle detection on each grid in the cube grid. If there is an obstacle at the location of the grid, mark the grid as the first color state; otherwise, mark it as the second color state. In step S2, the execution obstacle detection specifically includes: Using the center point of each grid as the emission point, detection rays are emitted along the positive and negative directions of the spatial coordinate axes respectively. If any ray intersects with an obstacle collider in the scene, it is determined that there is an obstacle at that grid location.

[0037] like Figure 3 As shown, in step 2, the first color state is red, representing the obstacle mesh; the second color state is green, representing the safety mesh. This is illustrated in the following formula:

[0038] In the formula, For grid 3D indexing, Mark the grid status; Step S3: Obtain the starting grid and target grid for the drone's flight, and only designate the grid marked in the second color state as passable areas; Step S4: Based on the three-dimensional neighborhood expansion algorithm, starting from the starting grid, traverse all passable grids layer by layer, and calculate the cumulative cost of each grid relative to the starting grid. The cumulative cost includes at least the spatial distance factor between the grid and the starting grid and the spatial distance factor between the grid and the target grid. Step S4 specifically includes: Step S41: Obtain the 26 neighborhoods of the current grid, and include only the grids marked with the second color state in the neighborhoods; the expression for the 26 neighborhoods of the current grid is as follows:

[0039] in, The neighborhood is the 3D index of the current grid, and it contains all combinations of coordinate changes that are all -1, 0, or +1 and not all zero.

[0040] Step S42: Obtain the single-step cost, which is the three-dimensional Euclidean distance between the center points of two grids; the three-dimensional Euclidean distance is determined by the following formula:

[0041] in, and For any two grids, ( )and( ) are the coordinates of the center points of the two grids, respectively.

[0042] Step S43: Obtain the heuristic cost function, which is a weighted sum of three terms, where the first term is the three-dimensional Euclidean distance from the current grid to the starting grid, the second term is the three-dimensional Euclidean distance from the current grid to the target grid, and the third term is the safety penalty term. The weighted sum of the three terms is shown in the following formula:

[0043] in, For the current grid n The total cost, D(n,S) For grid n To the starting point S The three-dimensional Euclidean distance, D(n, T) For grid n To the finish line T The three-dimensional Euclidean distance, P(n) For safety penalties, obstacle grid P=∞, and safety grid P=0. Let be the weighting coefficient, satisfying .

[0044] Step S44: Based on the neighborhood, the single-step cost, and the heuristic cost function, calculate the minimum cumulative cost from the starting grid to each passable grid through iterative updates until the cumulative cost of the target grid is determined.

[0045] The iterative update calculation is represented as follows:

[0046] in, Cost(n) From the starting point to the grid n The minimum cumulative cost, m For grid n The neighborhood security grid, C(m,n) For grid m arrive n The cost per step.

[0047] Step S5: Once the target grid is included in the traversal range, backtrack from the target grid to the starting grid and extract the grid sequence with the minimum cumulative cost as the shortest collision-free flight path for the UAV.

[0048] Step S5 specifically includes: Step S51: Take the target grid as the current backtracking node, select the neighboring grid with the smallest cumulative cost in the twenty-six neighborhoods of the current backtracking node as the previous node, and update the previous node as the new current backtracking node. Step S52: Repeat step S51 until the current backtracking node is the starting grid. Arrange the nodes obtained sequentially during the backtracking process in order from the starting point to the target to obtain the shortest path node sequence. The shortest path is represented as:

[0049] Step 5 is followed by step 6: converting the grid sequence in the shortest collision-free flight path into a three-dimensional spatial coordinate point sequence, and importing the coordinate point sequence into the simulation platform to generate the UAV's flight path; mounting the UAV dynamics model in the simulation platform, executing simulated flight, and verifying the collision-free and shortest distance characteristics of the path.

[0050] Example 2

[0051] This implementation, based on Example 1, uses the shortest path planning of a drone in a complex urban environment as an example for illustration:

[0052] The three-dimensional spatial range for UAV operations is defined as follows: east-west (X-axis) 0~120m, north-south (Y-axis) 0~80m, and vertical (Z-axis) 0~40m. With a grid side length d = 0.5m, the number of grid cells in the X, Y, and Z directions are respectively: , , The total number of grid cells M = 240 × 160 × 80 = 3,072,000. The initial state of each grid cell is marked as "undetected".

[0053] This uses the Physics.Raycast interface from the Unity engine. It uses the center point of each grid cell as an example. Starting from a point, emit rays with a length slightly longer than the grid's edge length (e.g., 0.6m) along the ±X, ±Y, and ±Z directions. If any ray intersects with an obstacle (building, tree, telephone pole) in the scene that has a Collider component, the grid is marked as red (obstacle); otherwise, it is marked as green (free). To improve detection robustness, the ray starting point can be slightly offset to avoid self-intersection; the offset is 1% of the grid's edge length.

[0054] Let the coordinates of the UAV's takeoff point be (2.3m, 1.5m, 0.8m), and the corresponding grid index be... , , The target point coordinates are (95.7m, 72.3m, 18.2m), corresponding to the grid index (191, 144, 36). Only green grids are allowed to participate in the path search.

[0055] Adopting improved A The algorithm framework is as follows, but the extended neighborhood has twenty-six directions. The data structure uses a priority queue (min-heap), with the key being the total cost F(n) = G(n) + H(n). The specific iterative steps are as follows: Algorithm pseudocode (3D 26-neighborhood optimal path search): 1. Initialize openSet = , closedSet = ; 2. Add the initial grid S to the openSet, G(S)=0, F(S)=H(S); 3. while openSet is not empty: current = the node with the smallest F value in openSet; if current == T: break; openSet.remove(current), closedSet.add(current); For each neighbor in Ω(current) ∩ Green grid: if neighbor in closedSet: continue; tentative_G = G(current) + c(current, neighbor); if neighbor not in openSet or tentative_G < G(neighbor): G(neighbor) = tentative_G; H(neighbor) = w1·D(neighbor,T) + w2·P(neighbor); / / P(neighbor)=0 F(neighbor) = G(neighbor) + H(neighbor); parent(neighbor) = current; if neighbor not in openSet: openSet.add(neighbor); 4. Backtrack to obtain the path.

[0056] In this embodiment, weights are selected. The algorithm prioritizes the shortest distance with minimal safety penalties. During the actual iteration, approximately 420,000 nodes were expanded, and the final target point dequeued at G(T) = 134.2m, meaning the optimal path length was 134.2 meters. This path bypasses three high-rise buildings and crosses a sloping terrain, with no collisions along the entire route.

[0057] Starting from the target node, the parent nodes are sequentially searched until the starting node. After obtaining the mesh sequence, the center coordinates of each mesh are connected to form a polyline. Optionally, a cubic B-spline curve is used to smooth the path, but the original mesh sequence is retained for simulation verification. The final generated path nodes (partial) are as follows: [(2.25,1.25,0.75), (2.75,1.75,1.25), … , (95.75,72.25,18.25)].

[0058] The coordinate point sequence was imported into the Unity simulation platform, and a quadcopter UAV dynamic model (mass 1.5kg, maximum thrust 20N, using a PID position controller) was mounted. The maximum flight speed was set to 5m / s, and the simulation time step was 0.02s. The UAV flew along the flight path without colliding with any obstacles, and the actual flight distance differed from the planned distance by less than 0.3% (due to dynamic tracking errors). Video recordings showed that the path closely followed the edges of obstacles while maintaining a safe distance (mesh boundaries ensured a gap of at least 0.5m), verifying the engineering feasibility of this method.

[0059] Example 3

[0060] This embodiment, based on Embodiment 1, illustrates a power line inspection scenario prioritizing safety and its weighted impact analysis: In power line inspection missions, drones need to approach high-voltage towers but avoid collisions with the tower materials and power lines, while also requiring their paths to stay as far away from obstacles as possible to improve safety. Therefore, the weight of the safety penalty term in the heuristic function is adjusted to... Meanwhile, the safety penalty term P(n) is changed to a continuous value related to the density of obstacles around the grid: ,in The proportion of free grid within a 26-neighborhood. Other parameters are the same as in Example 1. The path search was re-executed, and the total path length increased from 134.2m to 147.8m (an increase of approximately 10%), but the average distance between the path and the nearest obstacle increased from 0.85m to 1.42m, significantly improving flight safety. This example demonstrates that the present invention can flexibly adapt to different mission requirements by adjusting the weights.

[0061] Table 1 below compares the planning results under different weight configurations (for the same scenario): Table 1

[0062] The above data shows that the method of the present invention can continuously adjust between path length and security, and the search efficiency meets the real-time requirements (millisecond level).

[0063] Example 4

[0064] This embodiment compares the algorithm with the traditional algorithm based on Embodiment 1: Under the same scenario and initial target conditions, implement the classic 3D A (Six neighboring domains only), RRT (Sampling step size 1.5m, maximum iterations 5000) and the method of this invention. Each algorithm was run 20 times, and the average path length and success rate (the proportion of collision-free paths found) were statistically analyzed. Results: Six-neighborhood A Due to the lack of diagonal / vertical extension, the path length is 172.3m (28% longer than this invention), and some narrow passages are impassable; RRT The average path length was 158.6m, but the success rate was only 85% (random sampling is prone to getting trapped in local conditions). The method of this invention has a 100% success rate and the smallest standard deviation of path length (<1.2m), verifying its global optimality and robustness.

[0065] Example 5

[0066] This embodiment proposes a path planning system based on three-dimensional spatial grid state marking, based on embodiment 1, including: The 3D meshing module discretizes the 3D space of UAV operations into cubic meshes of equal side lengths and assigns an initial state label to each mesh. The obstacle detection and marking module performs obstacle detection on each grid in the cube grid. If there is an obstacle at the location of the grid, the grid is marked as the first color state; otherwise, it is marked as the second color state. The module also acquires the starting grid and target grid of the UAV flight and only marks the grid marked as the second color state as the passable area. The path search module, based on the three-dimensional neighborhood expansion algorithm, starts from the starting grid and traverses all passable grids layer by layer, calculating the cumulative cost of each grid relative to the starting grid. The cumulative cost includes at least the spatial distance factor between the grid and the starting grid and the spatial distance factor between the grid and the target grid. The backtracking output module, after the target grid is included in the traversal range, backtracks from the target grid to the starting grid and extracts the grid sequence with the minimum cumulative cost as the shortest collision-free flight path for the UAV. The simulation verification module converts the grid sequence in the shortest collision-free flight path into a three-dimensional spatial coordinate point sequence, imports the coordinate point sequence into the simulation platform, generates the UAV's flight path, mounts the UAV dynamics model in the simulation platform, executes simulated flight, and verifies the collision-free and shortest distance characteristics of the path.

[0067] The circuits, electronic components, and modules involved are all existing technologies, which can be fully implemented by those skilled in the art, and need not be elaborated upon. The scope of protection of this invention does not involve any improvement to the software and methods.

[0068] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0069] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A path planning method based on three-dimensional spatial grid state marking, characterized in that, include: Step S1: Discretize the three-dimensional space of the UAV operation into a cubic mesh with equal side length, and assign an initial state label to each mesh; Step S2: Perform obstacle detection on each grid in the cube grid. If there is an obstacle at the location of the grid, mark the grid as the first color state; otherwise, mark it as the second color state. Step S3: Obtain the starting grid and target grid for the drone's flight, and only designate the grid marked in the second color state as passable areas; Step S4: Based on the three-dimensional neighborhood expansion algorithm, starting from the starting grid, traverse all passable grids layer by layer, and calculate the cumulative cost of each grid relative to the starting grid. The cumulative cost includes at least the spatial distance factor between the grid and the starting grid and the spatial distance factor between the grid and the target grid. Step S5: Once the target grid is included in the traversal range, backtrack from the target grid to the starting grid and extract the grid sequence with the minimum cumulative cost as the shortest collision-free flight path for the UAV.

2. The path planning method based on three-dimensional spatial grid state marking according to claim 1, characterized in that, In step S2, the execution obstacle detection specifically includes: Using the center point of each grid as the emission point, detection rays are emitted along the positive and negative directions of the spatial coordinate axes respectively. If any ray intersects with an obstacle collider in the scene, it is determined that there is an obstacle at that grid location.

3. The path planning method based on three-dimensional spatial grid state marking according to claim 1, characterized in that, Step S4 specifically includes: Obtain the 26 neighborhoods of the current grid, and include only the grids marked with the second color state in the neighborhoods; Obtain the single-step cost, which is the three-dimensional Euclidean distance between two grid center points; Obtain a heuristic cost function, which is a weighted sum of three terms, where the first term is the three-dimensional Euclidean distance from the current grid to the starting grid, the second term is the three-dimensional Euclidean distance from the current grid to the target grid, and the third term is a safety penalty term; Based on the neighborhood, the single-step cost, and the heuristic cost function, the minimum cumulative cost from the starting grid to each passable grid is calculated through iterative updates until the cumulative cost of the target grid is determined.

4. The path planning method based on three-dimensional spatial grid state marking according to claim 3, characterized in that, The expression for the 26 neighborhoods of the current grid is as follows: in, The neighborhood is the 3D index of the current grid, and it contains all combinations of coordinate changes that are all -1, 0, or +1 and not all zero.

5. The path planning method based on three-dimensional spatial grid state marking according to claim 3, characterized in that, The three-dimensional Euclidean distance is determined by the following formula: in, and For any two grids, ( )and( ) are the coordinates of the center points of the two grids, respectively.

6. The path planning method based on three-dimensional spatial grid state marking according to claim 3, characterized in that, The weighted sum of the three terms is shown in the following formula: in, For the current grid n The total cost, D(n,S) For grid n To the starting point S The three-dimensional Euclidean distance, D(n,T) For grid n To the finish line T The three-dimensional Euclidean distance, P(n) For safety penalties, obstacle grid P=∞, and safety grid P=0. Let be the weighting coefficient, satisfying .

7. The path planning method based on three-dimensional spatial grid state marking according to claim 3, characterized in that, The iterative update calculation is represented as follows: in, Cost(n) From the starting point to the grid n The minimum cumulative cost, m For grid n The neighborhood security grid, C(m,n) For grid m arrive n The cost per step.

8. The path planning method based on three-dimensional spatial grid state marking according to claim 1, characterized in that, Step S5 specifically includes: Step S51: Take the target grid as the current backtracking node, select the neighboring grid with the smallest cumulative cost in the twenty-six neighborhoods of the current backtracking node as the previous node, and update the previous node as the new current backtracking node. Step S52: Repeat step S51 until the current backtracking node is the starting grid. Arrange the nodes obtained in sequence during the backtracking process in order from the start to the target to obtain the shortest path node sequence.

9. The path planning method based on three-dimensional spatial grid state marking according to claim 1, characterized in that, Step 5 is followed by: converting the grid sequence in the shortest collision-free flight path into a three-dimensional spatial coordinate point sequence, importing the coordinate point sequence into the simulation platform to generate the UAV's flight path; mounting the UAV dynamics model in the simulation platform, executing simulated flight, and verifying the collision-free and shortest distance characteristics of the path.

10. A path planning system based on three-dimensional spatial grid state marking, used to implement the path planning method based on three-dimensional spatial grid state marking as described in claims 1-8, characterized in that, include: The 3D meshing module discretizes the 3D space of UAV operations into cubic meshes of equal side lengths and assigns an initial state label to each mesh. The obstacle detection and marking module performs obstacle detection on each grid in the cube grid. If there is an obstacle at the location of the grid, the grid is marked as the first color state; otherwise, it is marked as the second color state. The module also acquires the starting grid and target grid of the UAV flight and only marks the grid marked as the second color state as the passable area. The path search module, based on the three-dimensional neighborhood expansion algorithm, starts from the starting grid and traverses all passable grids layer by layer, calculating the cumulative cost of each grid relative to the starting grid. The cumulative cost includes at least the spatial distance factor between the grid and the starting grid and the spatial distance factor between the grid and the target grid. The backtracking output module, after the target grid is included in the traversal range, backtracks from the target grid to the starting grid and extracts the grid sequence with the minimum cumulative cost as the shortest collision-free flight path for the UAV. The simulation verification module converts the grid sequence in the shortest collision-free flight path into a three-dimensional spatial coordinate point sequence, imports the coordinate point sequence into the simulation platform, generates the UAV's flight path, mounts the UAV dynamics model in the simulation platform, executes simulated flight, and verifies the collision-free and shortest distance characteristics of the path.