A low-altitude dynamic obstacle avoidance path planning simulation method based on Unity three-dimensional grid

CN122886191APending Publication Date: 2026-10-09TONGJIANG LICHUANG DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611051889.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-15
Publication Date
2026-10-09

AI Technical Summary

Benefits of technology

(1)通过三维栅格空域建模、动态栅格增量更新、多约束路径搜索与预判式避障修正的完整流程,实现低空立体环境下的动态避障路径规划仿真,保障规划过程适配低空复杂空域的环境特征;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122886191A_ABST
    Figure CN122886191A_ABST
Patent Text Reader

Abstract

The application discloses a low-altitude dynamic obstacle avoidance path planning simulation method based on a Unity three-dimensional grid, and belongs to the technical field of computer simulation and low-altitude path planning. The method performs three-dimensional grid discrete profiling and layered modeling on a low-altitude airspace to generate a static grid map; a local incremental updating mechanism is adopted to complete dynamic obstacle grid state refreshing to obtain a real-time grid map; a comprehensive cost function combined with fused dynamics constraints is used to search for a feasible navigation point, and a global flight trajectory is generated through B-spline interpolation smoothing; a risk area is marked through dynamic obstacle trajectory prediction, and local trajectory correction is completed and the final path is output when a conflict exists. The method can improve the three-dimensional adaptability and operation efficiency of low-altitude path planning simulation, the generated trajectory conforms to the physical execution limit of a flight vehicle, and the simulation demand of obstacle avoidance in a complex low-altitude dynamic environment is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer simulation and low-altitude path planning technology, and in particular to a low-altitude dynamic obstacle avoidance path planning simulation method based on Unity 3D grid. Background Technology

[0002] With the continuous expansion of low-altitude flight application scenarios, various low-altitude operation modes such as UAV inspection, low-altitude logistics delivery, urban air traffic, and low-altitude security patrols are gradually becoming widespread. The operating environment of low-altitude flight is characterized by high spatial complexity, dense distribution of obstacles, and diverse dynamic interference factors. Flight control algorithm simulation verification is a key link in the research and development process of low-altitude aircraft. It can complete iterative testing of path planning strategies, obstacle avoidance control logic, and flight performance in a virtual environment, replacing some high-risk actual flight tests and effectively reducing research and development costs and testing risks. The Unity engine has high-precision 3D scene construction, real-time physical simulation, high frame rate dynamic rendering, and scripting development capabilities, and has become the mainstream development platform for low-altitude flight virtual simulation, route extrapolation, and algorithm verification. Currently, low-altitude path planning simulation generally adopts a technical route that combines rasterized spatial modeling and pathfinding algorithms. Two-dimensional raster planning schemes and traditional three-dimensional raster planning schemes are widely used in simulation scenarios of varying complexity, and can support the basic path planning requirements of various low-altitude flight simulations.

[0003] Current low-altitude path planning simulation technologies still have several shortcomings, making it difficult to adapt to the high-precision real-time simulation requirements of complex low-altitude environments. At the airspace modeling level, conventional two-dimensional grid schemes can only complete obstacle marking in planar space, failing to identify vertically distributed three-dimensional obstacles. Traditional three-dimensional grid schemes also lack a height-dimensional airspace hierarchical management mechanism, making it difficult to cover the refined planning requirements of low-altitude three-dimensional airspace. At the dynamic environment update level, traditional three-dimensional grids generally adopt a global traversal refresh mode, requiring state recalculation of the entire grid every frame, resulting in high computational redundancy and delays in dynamic obstacle state updates, failing to meet the operational requirements of high frame rate real-time simulations. At the path generation level, existing pathfinding algorithms mostly optimize for the shortest geometric path length, without incorporating the aircraft's dynamic limits. The generated paths contain turns and climb nodes exceeding maneuverability, failing to adapt to the execution logic of real flight control systems. At the dynamic obstacle avoidance level, existing solutions mostly adopt a passive detection obstacle avoidance mode, which lacks a mechanism for predicting the movement of dynamic obstacles and risk pre-marking. When faced with sudden dynamic interference, the path adjustment is rigid, and the timeliness and trajectory stability of the obstacle avoidance response are insufficient. Summary of the Invention

[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a simulation method for low-altitude dynamic obstacle avoidance path planning based on Unity 3D grid.

[0005] The objective of this invention is achieved through the following technical solution: A simulation method for low-altitude dynamic obstacle avoidance path planning based on a Unity 3D grid is provided. The method includes the following steps: S1. Set the spatial boundary parameters and grid resolution parameters of the low-altitude airspace, perform uniform three-dimensional grid discretization on the low-altitude airspace, establish a two-way mapping relationship between world coordinates and three-dimensional grid index, divide the airspace hierarchy according to the height dimension, define grid status identifiers, import static obstacle models and mark the occupancy status of the corresponding grids, and generate a static grid map. S2. Obtain the axis-aligned bounding box spatial range of dynamic obstacles, calculate the index interval of the local grid to be updated, verify the state duration of the grid within the interval, update the dynamic occupancy state of the grid, and obtain the real-time grid map. S3. Based on the real-time grid map, a comprehensive cost function that integrates dynamic constraints is used to perform three-dimensional path search, and waypoint sequences that meet the physical limits of the aircraft are selected. The waypoint sequences are then processed by B-spline interpolation algorithm to generate a global flight trajectory. S4. Collect the motion state parameters of dynamic obstacles, predict the future motion position of dynamic obstacles through kinematic formulas, mark the warning grid area, detect the conflict state between the global flight trajectory and the warning grid area, and when there is a conflict, use the artificial potential field algorithm to locally correct the trajectory of the conflicting road segment and output the final flight trajectory.

[0006] Furthermore, step S1 includes the following sub-steps: S1.1. Set the spatial boundary parameters and grid resolution parameters of the low-altitude airspace, calculate the total number of three-dimensional grids in the entire area based on the spatial boundary parameters and grid resolution parameters, and initialize the state of all grids to be idle and passable. S1.2. Import the static obstacle model, traverse the axis-aligned bounding box vertex coordinates of the static obstacle model, convert them to the corresponding grid index through the world coordinate to grid index mapping relationship, and mark the state of the grid corresponding to the index as static occupied state. S1.3. Divide the airspace into layers according to the set altitude threshold. The airspace layers include the near-ground obstacle layer, the low-altitude navigation layer, and the high-altitude restricted flight layer. Bind the corresponding airspace access attribute to a single grid cell. S1.4. Solidify the state parameters and hierarchical attribute parameters of all rasters to generate a complete static raster map.

[0007] Furthermore, step S2 includes the following sub-steps: S2.1. Traverse all dynamic obstacles in the simulation scene and obtain the axis-aligned bounding box space coordinate range of a single dynamic obstacle in the current frame; S2.2. By mapping the world coordinates to the raster index, the bounding box space coordinate range is converted into a three-dimensional raster index range, and the raster range to be updated in the current frame is locked. S2.3. Read the temporary occupancy status of a single raster within the index range, count the duration of the corresponding status of the raster, compare the duration of the status with the set time threshold, and verify the validity of the status change; S2.4. Grids that have undergone a state change are updated to a dynamically occupied state, and grids that have left the obstacle coverage area are reset to an idle and passable state. All grid state update operations are performed through multi-threaded parallel computing to obtain the real-time grid map of the current frame.

[0008] Furthermore, step S3 includes the following sub-steps: S3.1. Initialize the starting point coordinates, target point coordinates, and aircraft dynamics constraint parameters for path planning, and set the weight coefficients corresponding to the cost terms in the comprehensive cost function; S3.2. Traverse the available passable grids in the low-altitude navigation layer, calculate the total cost value of all neighboring grids of the current grid based on the comprehensive cost function, and select the grids whose total cost value meets the set conditions as the next waypoint; S3.3. Verify the aircraft dynamics constraints corresponding to the generated waypoints point by point, eliminate path nodes that exceed physical limits, iterate the search until the target airspace is reached, and generate a discrete three-dimensional waypoint sequence. S3.4. Perform B-spline interpolation on the discrete 3D waypoint sequence to eliminate abrupt changes in the angle of the path nodes and generate a continuous global flight trajectory.

[0009] Furthermore, step S4 includes the following sub-steps: S4.1. Collect the position, velocity, and acceleration parameters of dynamic obstacles in the simulation scene, and calculate the predicted future position of the dynamic obstacles using kinematic formulas; S4.2. Delineate the risk coverage area based on the predicted location of dynamic obstacles, and mark the grid within the risk coverage area as a warning buffer state; S4.3. Compare the spatial positions of the global flight trajectory and the warning buffer status grid to determine whether there is a collision conflict in the global flight trajectory; S4.4. When a collision conflict is determined, the trajectory nodes of the conflicting road segment are fine-tuned through the artificial potential field algorithm, and the final flight trajectory is output after a second verification of the compliance of the dynamic constraints.

[0010] Furthermore, in step S1, the grid status identifier includes free and passable status, static obstacle occupancy status, dynamic obstacle occupancy status, no-fly zone status, and warning buffer status, with each type of status corresponding to the set access permissions and planning rules.

[0011] Furthermore, in step S2, the state update operation is only performed on the grid cells within the index range obtained by the axis-aligned bounding box mapping of the dynamic obstacle. The grid cells outside the index range retain the original state of the previous frame and do not perform repeated traversal calculations.

[0012] Furthermore, in step S3, the comprehensive cost function is composed of a weighted combination of actual flight cost, heuristic distance cost, obstacle risk cost, speed constraint cost, and attitude maneuver cost, and the weight coefficients can be adjusted and configured according to the type of aircraft.

[0013] Furthermore, in step S4, the artificial potential field algorithm includes a gravitational potential field pointing towards the target point and a repulsive potential field away from the obstacle. The input parameters of the gravitational potential field are the current trajectory node position and the target point position, and the input parameters of the repulsive potential field are the current trajectory node position and the obstacle position. The trajectory node is finely adjusted in position along the resultant force direction of the gravitational and repulsive potential fields.

[0014] Furthermore, in step S4, after outputting the final flight trajectory, the grid state update, path conflict detection, and trajectory local correction operations are repeatedly executed according to the set frame frequency to form a closed-loop simulation iteration process.

[0015] The beneficial effects of this invention are: (1) Through the complete process of three-dimensional grid spatial domain modeling, dynamic grid incremental update, multi-constraint path search and predictive obstacle avoidance correction, dynamic obstacle avoidance path planning simulation in low-altitude three-dimensional environment is realized, ensuring that the planning process is adapted to the environmental characteristics of low-altitude complex airspace. (2) By integrating the aircraft dynamics constraints into the path search logic and using the interpolation smoothing algorithm to optimize the trajectory shape, the generated flight path conforms to the physical execution limit and can directly support the simulation verification and iterative optimization of the flight control algorithm; (3) Establish a dynamic obstacle trajectory prediction and early warning buffer mechanism, combine local trajectory fine-tuning to achieve active obstacle avoidance, update the environment and path status frame by frame, and form a stable closed-loop simulation iteration system. Attached Figure Description

[0016] Figure 1 A flowchart illustrating the steps of a simulation method for low-altitude dynamic obstacle avoidance path planning based on a Unity 3D grid. Figure 2 The following is a flowchart illustrating the specific steps of a low-altitude dynamic obstacle avoidance path planning simulation method based on a Unity 3D grid, provided as an example. Detailed Implementation

[0017] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] Example 1 See Figure 1 This embodiment provides a simulation method for low-altitude dynamic obstacle avoidance path planning based on a Unity 3D grid. The method includes the following steps: S1. Set the spatial boundary parameters and grid resolution parameters of the low-altitude airspace, perform uniform three-dimensional grid discretization on the low-altitude airspace, establish a two-way mapping relationship between world coordinates and three-dimensional grid index, divide the airspace hierarchy according to the height dimension, define grid status identifiers, import static obstacle models and mark the occupancy status of the corresponding grids, and generate a static grid map. S2. Obtain the axis-aligned bounding box spatial range of dynamic obstacles, calculate the index interval of the local grid to be updated, verify the state duration of the grid within the interval, update the dynamic occupancy state of the grid, and obtain the real-time grid map. S3. Based on the real-time grid map, a comprehensive cost function that integrates dynamic constraints is used to perform three-dimensional path search, and waypoint sequences that meet the physical limits of the aircraft are selected. The waypoint sequences are then processed by B-spline interpolation algorithm to generate a global flight trajectory. S4. Collect the motion state parameters of dynamic obstacles, predict the future motion position of dynamic obstacles through kinematic formulas, mark the warning grid area, detect the conflict state between the global flight trajectory and the warning grid area, and when there is a conflict, use the artificial potential field algorithm to locally correct the trajectory of the conflicting road segment and output the final flight trajectory.

[0019] In some embodiments, step S1 includes the following sub-steps: S1.1. Set the spatial boundary parameters and grid resolution parameters of the low-altitude airspace, calculate the total number of three-dimensional grids in the entire area based on the spatial boundary parameters and grid resolution parameters, and initialize the state of all grids to be idle and passable. S1.2. Import the static obstacle model, traverse the axis-aligned bounding box vertex coordinates of the static obstacle model, convert them to the corresponding grid index through the world coordinate to grid index mapping relationship, and mark the state of the grid corresponding to the index as static occupied state. S1.3. Divide the airspace into layers according to the set altitude threshold. The airspace layers include the near-ground obstacle layer, the low-altitude navigation layer, and the high-altitude restricted flight layer. Bind the corresponding airspace access attribute to a single grid cell. S1.4. Solidify the state parameters and hierarchical attribute parameters of all rasters to generate a complete static raster map.

[0020] In some embodiments, step S2 includes the following sub-steps: S2.1. Traverse all dynamic obstacles in the simulation scene and obtain the axis-aligned bounding box space coordinate range of a single dynamic obstacle in the current frame; S2.2. By mapping the world coordinates to the raster index, the bounding box space coordinate range is converted into a three-dimensional raster index range, and the raster range to be updated in the current frame is locked. S2.3. Read the temporary occupancy status of a single raster within the index range, count the duration of the corresponding status of the raster, compare the duration of the status with the set time threshold, and verify the validity of the status change; S2.4. Grids that have undergone a state change are updated to a dynamically occupied state, and grids that have left the obstacle coverage area are reset to an idle and passable state. All grid state update operations are performed through multi-threaded parallel computing to obtain the real-time grid map of the current frame.

[0021] In some embodiments, step S3 includes the following sub-steps: S3.1. Initialize the starting point coordinates, target point coordinates, and aircraft dynamics constraint parameters for path planning, and set the weight coefficients corresponding to the cost terms in the comprehensive cost function; S3.2. Traverse the available passable grids in the low-altitude navigation layer, calculate the total cost value of all neighboring grids of the current grid based on the comprehensive cost function, and select the grids whose total cost value meets the set conditions as the next waypoint; S3.3. Verify the aircraft dynamics constraints corresponding to the generated waypoints point by point, eliminate path nodes that exceed physical limits, iterate the search until the target airspace is reached, and generate a discrete three-dimensional waypoint sequence. S3.4. Perform B-spline interpolation on the discrete 3D waypoint sequence to eliminate abrupt changes in the angle of the path nodes and generate a continuous global flight trajectory.

[0022] In some embodiments, step S4 includes the following sub-steps: S4.1. Collect the position, velocity, and acceleration parameters of dynamic obstacles in the simulation scene, and calculate the predicted future position of the dynamic obstacles using kinematic formulas; S4.2. Delineate the risk coverage area based on the predicted location of dynamic obstacles, and mark the grid within the risk coverage area as a warning buffer state; S4.3. Compare the spatial positions of the global flight trajectory and the warning buffer status grid to determine whether there is a collision conflict in the global flight trajectory; S4.4. When a collision conflict is determined, the trajectory nodes of the conflicting road segment are fine-tuned through the artificial potential field algorithm, and the final flight trajectory is output after a second verification of the compliance of the dynamic constraints.

[0023] In some embodiments, in step S1, the grid status identifier includes an idle and passable status, a static obstacle occupancy status, a dynamic obstacle occupancy status, a no-fly zone status, and a warning buffer status, with each type of status corresponding to the set access permissions and planning rules.

[0024] In some embodiments, in step S2, only the grid cells within the index range obtained by the axis-aligned bounding box mapping of the dynamic obstacle are subjected to state update operations, while the grid cells outside the index range retain the original state of the previous frame and are not subjected to repeated traversal calculations.

[0025] In some embodiments, in step S3, the comprehensive cost function is composed of a weighted combination of actual flight cost, heuristic distance cost, obstacle risk cost, speed constraint cost and attitude maneuver cost, and the weighting coefficients can be adjusted and configured according to the type of aircraft.

[0026] In some embodiments, in step S4, the artificial potential field algorithm includes a gravitational potential field pointing towards the target point and a repulsive potential field away from the obstacle. The input parameters of the gravitational potential field are the current trajectory node position and the target point position, and the input parameters of the repulsive potential field are the current trajectory node position and the obstacle position. The trajectory node is finely adjusted in position along the resultant force direction of the gravitational potential field and the repulsive potential field.

[0027] In some embodiments, after outputting the final flight trajectory in step S4, the grid state update, path conflict detection, and trajectory local correction operations are repeatedly executed according to the set frame frequency to form a closed-loop simulation iteration process.

[0028] Example 2 This embodiment provides a specific implementation process for a low-altitude dynamic obstacle avoidance path planning simulation method based on a Unity 3D grid. Leveraging the Unity engine's 3D scene construction, real-time physical simulation, and script execution capabilities, it completes a closed-loop simulation of the entire process, including low-altitude airspace discrete modeling, dynamic obstacle incremental updates, dynamic constraint path planning, and proactive predictive obstacle avoidance correction. Figure 2 As shown, the specific implementation process is as follows: Step 1. Layered 3D raster spatial modeling: This step addresses the differentiated spatial characteristics of the low-altitude three-dimensional airspace by uniformly discretizing the continuous three-dimensional airspace, establishing a unified spatial index mapping system, completing the marking of static obstacles and the division of airspace hierarchy, and generating a static raster base map that can be used for subsequent path planning.

[0029] Step 1.1. Spatial parameters and raster system initialization: Set the spatial boundary parameters and raster resolution parameters for the low-altitude airspace. Calculate the total number of three-dimensional rasters in the entire area based on the spatial boundary range and raster resolution. Construct a three-dimensional raster state array and set the initial state of all rasters to an idle and passable state to complete the basic initialization of the raster system.

[0030] In some specific implementations, to achieve a one-to-one correspondence between any spatial location within a Unity scene and discrete grid cells, it is necessary to establish bidirectional conversion rules between world coordinates and 3D grid indices. This involves using unified resolution parameters to achieve a standardized mapping from continuous space to discrete grids, ensuring consistency in the coordinate system for all spatial operations such as obstacle location marking, path node search, and collision detection, and avoiding coordinate conversion discrepancies between different modules. The formula for converting world coordinates to grid indices is: ; in, , , These are the world space coordinates of the flying vehicle or obstacle within the Unity scene. , , This is the 3D index value of the 3D raster corresponding to the coordinate point; , , The minimum boundary coordinates of the low-altitude airspace simulation range in the three coordinate axis directions; The side length of a single grid cube, i.e., the grid resolution; This is a floor function used to obtain the integer index value corresponding to the grid. The forward mapping relationship can quickly locate any spatial location in the scene to the corresponding grid cell, providing a unified spatial index benchmark for subsequent obstacle occupancy marking and path node matching, and supporting coordinate consistency in spatial operations throughout the entire process.

[0031] In some specific implementations, to achieve reverse positioning from raster index to spatial location, it is necessary to establish an inverse mapping rule from raster index to world coordinates. The center coordinates of a single raster are calculated using the raster index, which is then used for obstacle collision detection and spatial matching of path points, enabling bidirectional communication between discrete raster and continuous physical space. The formula for calculating the inverse mapping of raster index to world coordinates is: ; in, , , The center world coordinates of a single grid cube; , , This is the three-dimensional index value of the corresponding raster. , , , The meaning remains consistent with the previous definition. The inverse mapping relationship can convert discrete grid indices into specific spatial coordinates, providing spatial coordinate support for path point output and collision distance calculation, so that the discrete grid planning results can be directly mapped to the physical spatial location of the simulation scene.

[0032] Step 1.2. Static obstacle occupancy marking: Import static obstacle models from the scene, traverse the axis-aligned bounding box vertex coordinates of all static obstacle models, and convert them to corresponding raster indices using a world coordinate to raster index mapping relationship. Mark all raster states within the bounding box coverage area as statically occupied. An axis-aligned bounding box is a minimal cuboid structure that remains parallel to the axes of the coordinate system in 3D space. It is a common technique in 3D collision detection and, in this embodiment, is used to quickly define the spatial coverage of obstacles. This eliminates the need for complex mesh-level collision detection, allowing for batch marking of obstacle coverage rasters and improving the efficiency of static modeling. Static obstacles include three types of fixed spatial occlusions within the simulation scene: buildings, poles / wires, and terrain. The occupancy rasters of all static obstacles are marked only during the initialization phase and remain unchanged during subsequent operation.

[0033] Step 1.3. Spatial domain hierarchy division and attribute binding: The entire grid is divided into layers according to the set height threshold, and corresponding airspace access attributes are bound to the grids of different layers. The airspace access rules of different height intervals are defined, and the effective airspace range of path planning is limited.

[0034] In some specific implementations, to adapt to the differentiated access rules of low-altitude airspace, it is necessary to manage the airspace hierarchically according to the altitude dimension. The entire raster area is divided into multiple levels based on different altitude thresholds, with each level corresponding to different access permissions and planning constraints. This limits the effective airspace range for path searching and reduces the traversal calculations of invalid raster cells. The calculation formula for low-altitude airspace hierarchical determination is: ; in, The spatial hierarchy corresponding to the raster; The vertical height coordinates of the grid center; , The preset layer height threshold; This represents the maximum altitude for low-altitude airspace simulation. This is the near-ground obstacle layer, with a large number of near-ground obstacles distributed within this layer, and it is not considered as the main planned airspace. This is the low-altitude navigation layer, which is the passable airspace for route planning; For high-altitude restricted flight layers, flight restrictions are set for corresponding layers, and these layers are not included in the scope of regular path planning. The airspace layering mechanism can limit the effective airspace range for path search, reduce the traversal calculation of invalid grids, and match the airspace management rules for low-altitude general aviation.

[0035] In some specific implementations, to distinguish the different access states and risk levels of a grid, multiple status identifiers need to be set for each grid. Different states correspond to different access rules and planning processing logic, supporting full-process status management of static modeling, dynamic updates, and risk prediction. The calculation formula for grid multi-state identifiers is: ; in, For index , , The status values ​​correspond to the grid cells. Status value 0 corresponds to an unobstructed, passable state; the grid cell is unobstructed and can be included in the path search range. Status value 1 corresponds to a static obstacle occupancy state; the grid cell is covered by a static obstacle and cannot be passed. Status value 2 corresponds to a dynamic obstacle occupancy state; the grid cell is covered by a dynamic obstacle and cannot be passed. Status value 3 corresponds to a no-fly zone state; the area to which the grid cell belongs is a no-fly zone and cannot be passed. Status value 4 corresponds to a warning buffer state; the grid cell is located in a predicted risk area of ​​a dynamic obstacle and obstacle avoidance is required. This multi-state labeling mechanism enables differentiated handling of different types of obstacles and risks, providing a unified basis for status determination for subsequent dynamic updates, path planning, and obstacle avoidance correction.

[0036] Step 1.4. Static raster map solidification: After binding the occupancy markers and spatial hierarchy of all static obstacles, the state parameters and hierarchical attribute parameters of all grids are fixed, generating a complete static grid map as the base map for subsequent dynamic environment updates and path planning. The static grid map remains fixed during simulation and is only regenerated when the scene configuration changes, ensuring the stability of the basic environment.

[0037] Step 2. Incremental local raster update: This step abandons the traditional global traversal update mode of 3D grids. Instead, it performs local region clipping based on the spatial enclosure range of dynamic obstacles, and only updates the state of the grid intervals covered by obstacles. Combined with a state debouncing mechanism to filter out minor jitter interference, and improves update efficiency through multi-threaded parallel computing, it achieves low-latency real-time updates of grid state.

[0038] Step 2.1. Obtaining the dynamic obstacle bounding box: The algorithm iterates through all dynamic obstacles in the simulation scene frame by frame, obtaining the axis-aligned bounding box spatial coordinate range of each individual dynamic obstacle in the current frame, and determining the spatial coverage area of ​​the obstacle in the current frame. Dynamic obstacles are spatial occlusions in the simulation scene whose positions change over time, including three categories: moving aircraft, flying creatures, and active operational equipment.

[0039] Step 2.2. Local update interval calculation: By mapping the world coordinates to the grid index, the bounding box coordinate range of dynamic obstacles is converted into the index range of the 3D grid, locking the grid range that needs to be updated in the current frame, and only performing state detection and updating on the grids within that range.

[0040] In some specific implementations, to accurately delineate the grid update range corresponding to dynamic obstacles, it is necessary to calculate the start and end indices of the corresponding grid using the bounding box coordinates of the obstacle. This achieves precise pruning of the update region, avoids invalid traversal of the entire grid, and significantly reduces the computational load of state updates. The formula for pruning the dynamic obstacle grid update region is: ; in, , , , , , The minimum and maximum coordinates of the bounding box aligned with the dynamic obstacle axes in the three coordinate axes; , , , , , This corresponds to the start and end indices of the raster to be updated in three dimensions; , , , The meaning remains consistent with the previous definition. The region clipping formula can directly convert the spatial range of dynamic obstacles into a raster index range, accurately lock the raster set to be updated, significantly reduce the range of state traversal, reduce unnecessary computation, and improve the running efficiency of dynamic updates.

[0041] Step 2.3. Grid status debouncing verification: Read the temporary occupancy status of a single grid cell within the index range, calculate the duration of the corresponding status of the grid cell, compare the duration of the status with the set time threshold, verify the validity of the status change, filter out frequent status jumps caused by minor obstacle jitter, and ensure the stability of the grid status.

[0042] In some specific implementations, to avoid frequent grid state switching caused by minor displacements of dynamic obstacles or rendering jitter, a state de-jitter mechanism needs to be set up. This mechanism only executes a formal state change when the duration of a state reaches a set threshold, reducing frequent grid state jumps and lowering the unnecessary trigger frequency of path planning. The formula for determining the grid de-jitter state is: ; in, This represents the final state after the raster update. This represents the temporary detection state of the raster. This represents the original state of the previous frame in the grid. The duration of the temporary detection status; This is the preset anti-shake time threshold. The state anti-shake judgment mechanism can filter out instantaneous state fluctuations, reduce frequent grid state jumps, decrease unnecessary triggering frequency of path planning, and improve the stability of simulation operation.

[0043] Step 2.4. Multi-threaded parallel state update: Rasteres with valid state changes are updated to a dynamically occupied state, while rasters that have left the obstacle coverage area are reset to an idle and passable state. The raster update task is split into multiple tasks using multi-threaded parallel computation, decoupling the update operation from the rendering thread. This process completes the state modification of all rasters to be updated, resulting in a real-time raster map for the current frame. All rasters outside the index range retain their original state from the previous frame, avoiding repeated traversal calculations and thus reducing computational redundancy.

[0044] In some specific implementations, to improve the computational efficiency of raster updates, a multi-threaded parallel computing framework can be used to split the update task. The update task for a local raster region is evenly distributed among multiple threads for parallel execution, compressing the overall update time. Simultaneously, the computational logic is separated from the rendering thread to avoid stuttering in the simulation. The computational formula for multi-threaded parallel acceleration is as follows: ; in, Total time spent updating the raster; The time taken to execute all update tasks in a single thread; This represents the number of threads executing in parallel. Multi-threaded parallel computing relies on the Unity Job System, a built-in multi-threaded parallel computing framework within the Unity engine. It is a native functional module of the Unity engine. In this embodiment, it is used to split the raster update task into multiple independent subtasks, which are then distributed to multiple threads for parallel execution. This decouples the raster update operation from the main thread's rendering logic, preventing stuttering in the simulation and ensuring the smooth operation of real-time simulation.

[0045] Step 3. Multi-constraint global path generation: This step, based on the 3D pathfinding algorithm, constructs a comprehensive cost function that integrates multiple types of constraints, embeds the dynamic limit constraints of the aircraft, selects waypoint sequences that meet the physical execution capabilities, and then generates a continuous and stable flight trajectory through an interpolation smoothing algorithm to ensure that the planned path can be executed by the actual flight control system.

[0046] Step 3.1. Initialization of planning parameters and constraints: The starting point coordinates, target point coordinates, and aircraft dynamics constraint parameters are initialized for path planning. Weighting coefficients for each type of cost term in the comprehensive cost function are set, completing the basic parameter configuration for path search. Dynamics constraint parameters are inherent physical limits of the aircraft, including three categories: turning angle limits, climb rate limits, and flight speed range, used to define the feasible range of the path.

[0047] Step 3.2. Multi-cost raster path search: Traverse all available passable grids within the low-altitude navigation layer, calculate the total cost value of all neighboring grids of the current grid based on the comprehensive cost function, select grids whose total cost value meets the set conditions as the next waypoint, and gradually advance the search towards the target point to complete the initial search of the global path.

[0048] In some specific implementations, to balance path length, obstacle risk, and flight constraints, a multi-dimensional comprehensive cost function needs to be constructed. This function transforms various constraints such as distance, obstacles, speed, and attitude into cost values, and obtains the total cost of the grid through weighted summation. This cost serves as the criterion for path search evaluation, ensuring that the path search process simultaneously considers multiple constraints. The formula for calculating the three-dimensional pathfinding comprehensive cost function is: ; in, For the current grid Total agency value; From the starting point of the path to the current grid The actual flight cost is positively correlated with the length of the flight path; For the current grid The Euclidean distance to the target point is used to heuristically determine the search direction and improve pathfinding efficiency. For the current grid The risk value of obstacles is determined by the grid's proximity to the obstacle; the closer the grid is to the obstacle, the higher its corresponding risk value. For the current grid The corresponding speed constraint cost increases when the path speed deviates from the set range. For the current grid The corresponding attitude maneuver value increases as the path attitude change exceeds the steady range. , , These are the weighting coefficients for obstacle risk cost, velocity constraint cost, and attitude maneuver cost, respectively. These weighting coefficients can be adjusted and configured according to the aircraft type and simulation requirements. The multi-dimensional comprehensive cost function can simultaneously consider multiple types of constraints during path search, avoiding the generation of paths that only satisfy the geometric shortest path but do not meet flight requirements.

[0049] Step 3.3. Dynamic constraint compliance verification: The dynamic constraints of the generated waypoints are verified point by point, path nodes that exceed physical limits are eliminated, and the search is iteratively performed until the target airspace is reached, generating a discrete three-dimensional waypoint sequence.

[0050] In some specific implementations, to ensure that the generated paths conform to the physical execution limits of the aircraft, three types of dynamic hard constraints need to be set to rigidly filter path nodes during the search process, eliminating unexecutable path branches and ensuring that the generated waypoints are within the physical execution capabilities of the aircraft. The formula for calculating the dynamic hard constraints is: ; ; ; in, The flight turning angle corresponding to the path node; This represents the maximum turning angle threshold for the aircraft. The vertical flight speed corresponding to the path node; The maximum vertical velocity threshold for the aircraft; The horizontal flight speed corresponding to the path node; The minimum horizontal flight speed threshold for the aircraft; This represents the maximum horizontal flight speed threshold for the aircraft. Three types of constraints limit the feasible range of the path from three dimensions: turning maneuver, vertical climb, and horizontal speed, ensuring that the generated waypoint sequence is within the aircraft's physical capabilities and avoiding path nodes that cannot be tracked by the flight control system.

[0051] Step 3.4. Trajectory smoothing optimization: The discrete 3D waypoint sequence is processed using the B-spline interpolation algorithm to eliminate abrupt angle changes at path nodes, generating a continuous global flight trajectory and ensuring a smooth transition in flight attitude. The B-spline interpolation algorithm is a general-purpose smooth interpolation algorithm in computer graphics and trajectory planning. It generates continuous differentiable curves through a weighted combination of basis functions. In this embodiment, it is used to convert the discrete waypoint sequence into a continuous and smooth flight trajectory, adapting to the trajectory tracking requirements of the flight control system and reducing attitude changes during flight.

[0052] In some specific implementations, a second-order B-spline interpolation algorithm is used to smooth discrete waypoints. A continuous trajectory is generated through a weighted combination of control points and basis functions, ensuring the continuity of the trajectory's first derivative and achieving a smooth attitude transition. This allows the generated trajectory to adapt to the control logic of the actual flight control system. The formula for calculating B-spline trajectory smoothing is: ; in, The coordinates of the trajectory points generated by interpolation; These are discrete waypoint control points; It is a second-order B-spline basis function; These are interpolation parameters, with values ​​ranging from 0 to 1; This represents the number of waypoint control points. B-spline interpolation can convert discrete polyline waypoints into continuous and smooth curve trajectories, eliminating abrupt changes in angle at path inflection points, making flight attitude continuously controllable, and matching the control logic of the actual flight control system.

[0053] Step 4. Dynamically predict and correct local trajectory: This step collects the motion state of dynamic obstacles, predicts the short-term future position of obstacles, and marks the risk warning grid area in advance. When a conflict is detected between the global flight trajectory and the risk area, the trajectory of the conflicting road segment is fine-tuned through the local potential field algorithm, and the dynamic constraints are verified twice to achieve active dynamic obstacle avoidance.

[0054] Step 4.1. Dynamic obstacle motion state acquisition and prediction: The system collects position, velocity, and acceleration parameters of dynamic obstacles within a simulated scenario, calculates their future predicted positions using kinematic formulas, and obtains their short-term motion trends to provide a basis for risk prediction.

[0055] In some specific implementations, based on the current motion state of a dynamic obstacle, a uniformly accelerated kinematic model is used to predict the obstacle's position over a future period, achieving short-term trajectory prediction of the dynamic obstacle and providing data support for early collision avoidance. The calculation formula for dynamic obstacle trajectory prediction is: ; in, For obstacles in Predicted location at any given time; For the obstacle at the current moment Location; For the obstacle at the current moment speed; For the obstacle at the current moment The acceleration; The trajectory prediction formula can predict the future spatial location of dynamic obstacles in advance, providing data support for risk warning and obstacle avoidance, and realizing the transformation from passive obstacle avoidance to active prediction.

[0056] Step 4.2. Risk warning grid marking: Based on the predicted location of dynamic obstacles, a risk coverage area is delineated, and the grids within the risk coverage area are marked as early warning buffer states, thus constructing a safe obstacle avoidance buffer space and providing a risk benchmark for subsequent conflict detection and obstacle avoidance correction.

[0057] In some specific implementations, the spatial distance between the aircraft and the predicted obstacle location is calculated to determine whether it has entered the safety warning range. If the distance is less than a set threshold, the corresponding grid is marked as a warning state, prompting the path planning module to take obstacle avoidance measures in advance. The calculation formula for the risk grid pre-occupancy determination is as follows: ; in, The Euclidean distance between the predicted position of the aircraft and the predicted position of the obstacle; The predicted position of the aircraft; Predicted location of obstacles; This is a safety warning distance threshold. When the distance meets the judgment criteria, the corresponding grid within the spatial range is marked as a warning buffer state, prompting the path planning module to perform obstacle avoidance and avoid collision risks in advance.

[0058] Step 4.3. Trajectory Conflict Detection and Judgment: By comparing the spatial positions of the global flight trajectory and the warning buffer status grid, it is determined whether there is a collision conflict in the global flight trajectory, and the specific road segment range that needs trajectory correction is identified. If there is no conflict, the original global flight trajectory is retained, and no correction is required.

[0059] Step 4.4. Local Trajectory Correction and Output: When a collision is detected, the trajectory nodes of the conflicting road segment are fine-tuned using an artificial potential field algorithm. The dynamic constraints of the corrected trajectory are then verified a second time. Once the constraints are confirmed to meet the requirements, the final flight trajectory is output. The artificial potential field algorithm is a classic algorithm for local obstacle avoidance in the path planning field. By constructing a virtual potential field with superimposed attraction and repulsion, it drives path nodes to move towards the target point and away from obstacles. In this embodiment, it is used for local trajectory adjustment of conflicting road segments, eliminating the need to restart the global path search and improving the response speed of dynamic obstacle avoidance.

[0060] In some specific implementations, an improved artificial potential field algorithm is used for local trajectory correction. This algorithm includes an gravitational potential field pointing towards the target point and a repulsive potential field moving away from obstacles. The superposition of these two types of potential fields forms a total potential force, driving the trajectory nodes to adjust in a safe direction. Only trajectory nodes in conflict sections are corrected, preserving the main structure of the global path. The formula for calculating the total potential force is: ; The formula for calculating the gravitational potential field is: ; The formula for calculating the repulsive potential field is: ; in, This represents the total potential force acting on the trajectory nodes; It is the force exerted by the gravitational potential field; It is a repulsive potential field force; The weighting coefficients for the gravitational potential field; This refers to the target point location of the local path; This represents the current position of the trajectory node; The weighting coefficients for the repulsive potential field; This represents the distance between the trajectory node and the predicted location of the obstacle. Predicted location of obstacles; The distance threshold for the repulsive force is consistent with the warning distance threshold. The input parameters for the gravitational potential field are the current trajectory node position and the target point position, which drives the trajectory node to move towards the target direction; the input parameters for the repulsive potential field are the current trajectory node position and the predicted obstacle position, which drives the trajectory node away from the obstacle risk area. The trajectory node makes minor position adjustments along the direction of the total potential force, correcting only the trajectory nodes in conflict sections, preserving the main structure of the global path, and achieving rapid local obstacle avoidance.

[0061] After the final flight trajectory of a single frame is output, the grid state update, path conflict detection and trajectory local correction operations are repeatedly executed according to the set frame frequency. The environmental changes and flight trajectory status are continuously synchronized to form a complete closed-loop simulation iteration process, ensuring real-time matching of the environment and path during the simulation process.

[0062] This embodiment achieves refined path planning simulation in low-altitude three-dimensional airspace through a combination of hierarchical 3D grid modeling, incremental local updates, multi-constraint path planning, and predictive dynamic obstacle avoidance. At the airspace modeling level, the 3D grid discretization and hierarchical partitioning mechanism covers obstacle detection and airspace management in vertical space, adapting to the simulation requirements of complex low-altitude three-dimensional environments and expanding vertical planning capabilities compared to planar grid schemes. In terms of operational efficiency, the use of local incremental updates instead of global traversal refresh reduces unnecessary computational redundancy, and combined with multi-threaded parallel computing, improves the update speed of the grid state, meeting the operational requirements of real-time simulation. Regarding path usability, aircraft dynamics constraints are integrated into the path search logic, and the generated trajectory conforms to physical execution limits, reducing deviations between simulated paths and actual flight, and supporting iterative verification of flight control algorithms. At the dynamic obstacle avoidance level, trajectory prediction and early warning buffering mechanisms can identify dynamic obstacle risks in advance, and combined with local trajectory fine-tuning, achieve smooth obstacle avoidance, improving obstacle avoidance response capabilities in dynamic scenarios. The entire solution forms a complete simulation closed loop, without relying on third-party grid libraries, and can be adapted to the Unity native simulation system. It supports batch verification and iterative optimization of low-altitude obstacle avoidance algorithms, providing a reusable simulation technology path for the flight control R&D and safety testing of low-altitude aircraft.

[0063] The above description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the concept described herein through the above teachings or related technologies or knowledge. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.

Claims

1. A simulation method for low-altitude dynamic obstacle avoidance path planning based on a Unity 3D grid, characterized in that, Includes the following steps: S1. Set the spatial boundary parameters and grid resolution parameters of the low-altitude airspace, perform uniform three-dimensional grid discretization on the low-altitude airspace, establish a two-way mapping relationship between world coordinates and three-dimensional grid index, divide the airspace hierarchy according to the height dimension, define grid status identifiers, import static obstacle models and mark the occupancy status of the corresponding grids, and generate a static grid map. S2. Obtain the axis-aligned bounding box spatial range of dynamic obstacles, calculate the index interval of the local grid to be updated, verify the state duration of the grid within the interval, update the dynamic occupancy state of the grid, and obtain the real-time grid map. S3. Based on the real-time grid map, a comprehensive cost function that integrates dynamic constraints is used to perform three-dimensional path search, and waypoint sequences that meet the physical limits of the aircraft are selected. The waypoint sequences are then processed by B-spline interpolation algorithm to generate a global flight trajectory. S4. Collect the motion state parameters of dynamic obstacles, predict the future motion position of dynamic obstacles through kinematic formulas, mark the warning grid area, detect the conflict state between the global flight trajectory and the warning grid area, and when there is a conflict, use the artificial potential field algorithm to locally correct the trajectory of the conflicting road segment and output the final flight trajectory.

2. The method according to claim 1, characterized in that, Step S1 includes the following sub-steps: S1.

1. Set the spatial boundary parameters and grid resolution parameters of the low-altitude airspace, calculate the total number of three-dimensional grids in the entire area based on the spatial boundary parameters and grid resolution parameters, and initialize the state of all grids to be idle and passable. S1.

2. Import the static obstacle model, traverse the axis-aligned bounding box vertex coordinates of the static obstacle model, convert them to the corresponding grid index through the world coordinate to grid index mapping relationship, and mark the state of the grid corresponding to the index as static occupied state. S1.

3. Divide the airspace into layers according to the set altitude threshold. The airspace layers include the near-ground obstacle layer, the low-altitude navigation layer, and the high-altitude restricted flight layer. Bind the corresponding airspace access attribute to a single grid cell. S1.

4. Solidify the state parameters and hierarchical attribute parameters of all rasters to generate a complete static raster map.

3. The method according to claim 1, characterized in that, Step S2 includes the following sub-steps: S2.

1. Traverse all dynamic obstacles in the simulation scene and obtain the axis-aligned bounding box space coordinate range of a single dynamic obstacle in the current frame; S2.

2. By mapping the world coordinates to the raster index, the bounding box space coordinate range is converted into a three-dimensional raster index range, and the raster range to be updated in the current frame is locked. S2.

3. Read the temporary occupancy status of a single raster within the index range, count the duration of the corresponding status of the raster, compare the duration of the status with the set time threshold, and verify the validity of the status change; S2.

4. Grids that have undergone a state change are updated to a dynamically occupied state, and grids that have left the obstacle coverage area are reset to an idle and passable state. All grid state update operations are performed through multi-threaded parallel computing to obtain the real-time grid map of the current frame.

4. The method according to claim 1, characterized in that, Step S3 includes the following sub-steps: S3.

1. Initialize the starting point coordinates, target point coordinates, and aircraft dynamics constraint parameters for path planning, and set the weight coefficients corresponding to the cost terms in the comprehensive cost function; S3.

2. Traverse the available passable grids in the low-altitude navigation layer, calculate the total cost value of all neighboring grids of the current grid based on the comprehensive cost function, and select the grids whose total cost value meets the set conditions as the next waypoint; S3.

3. Verify the aircraft dynamics constraints corresponding to the generated waypoints point by point, eliminate path nodes that exceed physical limits, iterate the search until the target airspace is reached, and generate a discrete three-dimensional waypoint sequence. S3.

4. Perform B-spline interpolation on the discrete 3D waypoint sequence to eliminate abrupt changes in the angle of the path nodes and generate a continuous global flight trajectory.

5. The method according to claim 1, characterized in that, Step S4 includes the following sub-steps: S4.

1. Collect the position, velocity, and acceleration parameters of dynamic obstacles in the simulation scene, and calculate the predicted future position of the dynamic obstacles using kinematic formulas; S4.

2. Delineate the risk coverage area based on the predicted location of dynamic obstacles, and mark the grid within the risk coverage area as a warning buffer state; S4.

3. Compare the spatial positions of the global flight trajectory and the warning buffer status grid to determine whether there is a collision conflict in the global flight trajectory; S4.

4. When a collision conflict is determined, the trajectory nodes of the conflicting road segment are fine-tuned through the artificial potential field algorithm, and the final flight trajectory is output after a second verification of the compliance of the dynamic constraints.

6. The method according to claim 1, characterized in that, In step S1, the grid status identifiers include free and passable status, static obstacle occupancy status, dynamic obstacle occupancy status, no-fly zone status, and warning buffer status. Each type of status corresponds to the set access permissions and planning rules.

7. The method according to claim 1, characterized in that, In step S2, the state update operation is performed only on the grid cells within the index range obtained by the axis-aligned bounding box mapping of the dynamic obstacle. The grid cells outside the index range retain the original state of the previous frame and do not perform repeated traversal calculations.

8. The method according to claim 1, characterized in that, In step S3, the comprehensive cost function is composed of a weighted combination of actual flight cost, heuristic distance cost, obstacle risk cost, speed constraint cost, and attitude maneuver cost. The weight coefficients can be adjusted and configured according to the type of aircraft.

9. The method according to claim 1, characterized in that, In step S4, the artificial potential field algorithm includes a gravitational potential field pointing towards the target point and a repulsive potential field away from the obstacle. The input parameters of the gravitational potential field are the current trajectory node position and the target point position, and the input parameters of the repulsive potential field are the current trajectory node position and the obstacle position. The trajectory node is finely adjusted in position along the resultant force direction of the gravitational and repulsive potential fields.

10. The method according to claim 1, characterized in that, In step S4, after outputting the final flight trajectory, the grid state update, path conflict detection, and trajectory local correction operations are repeatedly executed according to the set frame frequency to form a closed-loop simulation iteration process.