A local trajectory planning method, device and equipment for a quadrotor unmanned aerial vehicle
Patent Information
- Application Number
- CN202611073606.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2046-07-20
AI Technical Summary
该类方法在中低速、结构化场景下效果良好,但在密集障碍、高速飞行和机载资源受限条件下存在明显缺陷:各模块串行执行引入较大计算延迟,搜索与优化对初值质量敏感且易陷入局部极值,且参数调节依赖人工经验,部署泛化能力不足
[0010] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the local trajectory planning method for a quadcopter UAV provided in the first aspect.
Smart Images

Figure CN122590907B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of unmanned aerial vehicle (UAV) technology, and more specifically to a method, apparatus, and device for local trajectory planning of a quadcopter UAV. Background Technology
[0002] Quadcopter drones are essential for autonomous flight in complex environments, including power line inspection, bridge inspection, warehousing and logistics, and autonomous exploration in challenging spaces. The real-time performance and safety of local trajectory planning algorithms are crucial for the reliable flight of drones in such environments.
[0003] Existing local trajectory planning methods generally adopt a phased framework of "perception mapping - path search - trajectory optimization - control execution". An initial path is obtained by constructing a local map, performing a graph search, or sampling search, and then generating a smooth trajectory through polynomial optimization or B-spline optimization. These methods perform well in low-to-medium speed, structured scenarios, but they have significant drawbacks under conditions of dense obstacles, high-speed flight, and limited onboard resources: the sequential execution of each module introduces significant computational latency; the search and optimization processes are sensitive to the quality of initial values and are prone to getting trapped in local optima; parameter tuning relies on human experience; and deployment generalization ability is insufficient.
[0004] In recent years, end-to-end learning-based planning methods have directly predicted control commands or trajectories from depth maps and state variables, effectively reducing online computational overhead. However, existing learning-based methods have two prominent problems: First, the pure black-box approach of directly outputting control commands or single trajectories lacks explicit safety checks, which can easily lead to unpredictable abnormal behaviors in noisy or distributed environments. Second, while the method using a fixed motion primitive library retains a certain degree of interpretability, the primitives lack real-time adaptive correction to the current environmental observation and UAV state, resulting in insufficient coverage, conservative obstacle avoidance behavior, and even insufficient safe distance. Summary of the Invention
[0005] The purpose of this invention is to provide a method, apparatus, and device for local trajectory planning of a quadcopter unmanned aerial vehicle (UAV). By inputting depth maps and state information into a lightweight neural network, it directly predicts the terminal states, execution times, and ranking scores of multiple motion primitives end-to-end, and generates candidate trajectories that can be safely verified. Compared to the traditional staged serial architecture of "perception mapping-path search-trajectory optimization," this significantly shortens the computational link from perception to trajectory output, effectively reducing online planning latency. Furthermore, this invention can complete high-frequency local replanning without constructing a global ESDF map, greatly reducing dependence on onboard computing resources and online mapping quality. In addition, this invention restricts network predictions to a preset dynamically feasible range through physical boundary mapping, and combines this with an explicit candidate trajectory safety verification mechanism to avoid the risk of outputting unexecutable or dangerous trajectories in noisy or out-of-distribution scenarios, which is common in pure black-box learning planning. This ensures both real-time computation and flight safety and trajectory verifiability.
[0006] To achieve the above objectives, the present invention provides the following technical solution: In a first aspect, the present invention provides a local trajectory planning method for a quadcopter unmanned aerial vehicle (UAV), the method comprising: Acquire airborne depth map and UAV status information; UAV status information includes current position, current speed, and local target orientation; The depth map and UAV state information are input into a trained lightweight neural network to obtain unbounded predictive variables for each of the multiple motion primitives; the unbounded predictive variables include terminal state variables, execution time variables, and ranking score variables. The unbounded prediction variables of each motion element are mapped to candidate terminal states that satisfy preset physical boundary constraints, which include at least position range constraints and velocity amplitude constraints. Multiple candidate trajectories are generated based on the candidate terminal states of each motion primitive; The candidate trajectories are sequentially subjected to security checks in descending order of their ranking scores, and the first candidate trajectory that passes the security check is output as the execution trajectory.
[0007] Secondly, the present invention also provides a local trajectory planning device for a quadcopter unmanned aerial vehicle, the device comprising: The information acquisition module is used to acquire airborne depth maps and UAV status information; the UAV status information includes current position, current speed, and local target orientation. The information input module is used to input the depth map and UAV state information into the trained lightweight neural network to obtain the unbounded predictive variables corresponding to each of the multiple motion primitives; the unbounded predictive variables include terminal state variables, execution time variables, and ranking score variables. The variable mapping module is used to map the unbounded prediction variables of each motion primitive to candidate terminal states that satisfy preset physical boundary constraints. The physical boundary constraints include at least position range constraints and velocity amplitude constraints. The trajectory generation module is used to generate multiple candidate trajectories based on the candidate terminal states of each motion primitive; The security verification module is used to perform security verification on each candidate trajectory in descending order of sorting scores, and output the first candidate trajectory that passes the security verification as the execution trajectory.
[0008] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the local trajectory planning method for a quadcopter UAV provided in the first aspect.
[0009] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the local trajectory planning method for a quadcopter UAV provided in the first aspect.
[0010] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the local trajectory planning method for a quadcopter UAV provided in the first aspect.
[0011] The beneficial effects of this invention are as follows: By inputting depth maps and state information into a lightweight neural network, this invention directly predicts the terminal states, execution times, and ranking scores of multiple motion primitives end-to-end, and generates candidate trajectories that can be safely verified. Compared to the traditional staged serial architecture of "perception mapping-path search-trajectory optimization," this significantly shortens the computational link from perception to trajectory output, effectively reducing online planning latency. Simultaneously, this invention can complete high-frequency local replanning without constructing a global ESDF map, greatly reducing dependence on onboard computing resources and online mapping quality. Furthermore, this invention restricts network predictions to a preset dynamically feasible range through physical boundary mapping, and combined with an explicit candidate trajectory safety verification mechanism, avoids the risk of pure black-box learning planning outputting unexecutable or dangerous trajectories in noisy or out-of-distribution scenarios, ensuring both real-time computation and flight safety and trajectory verifiability.
[0012] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, the preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings. Attached Figure Description
[0013] Figure 1This is a flowchart illustrating a local trajectory planning method for a quadcopter unmanned aerial vehicle according to an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the principle of local trajectory generation based on motion primitive direction sets according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating the training and inference process of an end-to-end quadrotor trajectory planning method according to an embodiment of the present invention. Figure 4 This is a simulation diagram showing different obstacle densities according to an embodiment of the present invention; Figure 5 This is a schematic diagram of a partial trajectory comparison according to an embodiment of the present invention; Figure 6 This is a schematic diagram of a quadcopter drone hardware platform according to an embodiment of the present invention; Figure 7 This is a schematic diagram illustrating depth perception, local mapping, and trajectory execution in a three-dimensional obstacle environment according to an embodiment of the present invention. Figure 8 This is a schematic diagram of a local trajectory planning device for a quadcopter unmanned aerial vehicle according to an embodiment of the present invention; Figure 9 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation
[0014] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. 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.
[0015] It should be noted that references to "an embodiment," "embodiment," "example embodiment," etc., in this specification refer to the described embodiment including specific features, structures, or characteristics; however, not every embodiment must include these specific features, structures, or characteristics. Furthermore, such expressions do not refer to the same embodiment. Moreover, when describing specific features, structures, or characteristics in conjunction with embodiments, whether or not explicitly described, it is indicated that incorporating such features, structures, or characteristics into other embodiments is within the knowledge of those skilled in the art.
[0016] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0017] Example 1 This embodiment provides a local trajectory planning method for a quadcopter unmanned aerial vehicle (UAV), such as... Figure 1As shown, in actual deployment, the quadcopter drone is equipped with sensor modules and an onboard computing platform. The sensor modules include a stereo camera or depth camera for acquiring depth maps and an inertial measurement unit (IMU) for measuring inertial data; the onboard computing platform is used to run lightweight neural network models and trajectory planning programs, and generate trajectory commands that can be tracked by the flight controller.
[0018] S101, acquires airborne depth map and UAV status information.
[0019] During drone flight, an onboard stereo camera or depth camera captures depth maps of the surrounding environment at a certain frame rate. The depth map is a two-dimensional image where each pixel value represents the distance between the corresponding spatial point and the camera's optical center. Simultaneously, the IMU (Inertial Measurement Unit) works in conjunction with a visual inertial odometry system (VIS) or flight control state estimator to output the drone's current state information in real time. This state information includes at least the drone's current position, current velocity, current acceleration, and current attitude in the world frame. The world frame is an inertial reference frame, which can be a north-north sky coordinate system. The attitude is represented by a rotation matrix of the drone's frame relative to the world frame, with the x-axis pointing forward, the y-axis pointing laterally, and the z-axis pointing upward.
[0020] Let the current state of the drone be... ,in , , These represent the drone's current position, velocity, and acceleration within the world system, respectively. The rotation matrix from the machine system to the world system. Represents a global or local target point. This represents the current depth map. This state information provides the necessary input data and physical constraint benchmarks for subsequent network inference and trajectory generation.
[0021] In this step, by transforming the local target orientation from the world frame to the machine frame, the network input is decoupled from the UAV's orientation, improving the model's generalization ability under different heading angles. Specifically, the local target vector is calculated as follows: ,in This is a very small positive constant used to prevent the denominator from being zero. This local target vector represents the direction of the target point relative to the current orientation of the UAV, and together with state variables such as velocity in the network input, it constitutes the state vector.
[0022] For depth maps, preprocessing is required to facilitate neural network processing. Preprocessing includes cropping, normalization, and padding. Cropping refers to cropping the depth map to a spatial size suitable for the network input; normalization refers to linearly mapping the effective depth values to a predetermined range, for example, normalizing the depth value D(u,v) according to... Normalization is performed, where For pixels The original depth value at that location; This represents a truncation function used to truncate the input value. Limited to the range inside, when Time to take ,when Time to take ,when Time to take ; and These are the lower and upper limits of the effective depth, respectively. Depth values outside these limits are considered invalid. Invalid value padding refers to filling invalid pixels in the depth map (such as missing values due to sensor noise or occlusion) with a preset constant to avoid numerical anomalies in subsequent convolution operations. clip represents the truncation function.
[0023] Through the above processing, the depth map is converted into a standard format suitable for lightweight neural network inputs. Simultaneously, a state vector, composed of the current position, current velocity, and local target vector, is generated. This state vector reflects the current motion state of the UAV and the mission target orientation, providing a dynamic and mission-level basis for the network to predict motion primitives.
[0024] S102 inputs the depth map and UAV state information into the trained lightweight neural network to obtain the unbounded prediction variables corresponding to each of the multiple motion primitives.
[0025] A motion primitive refers to a basic motion unit with a definite start and end point. In this invention, each motion primitive corresponds to a local trajectory that starts from the current position of the UAV and terminates at a certain candidate terminal state. Each motion primitive has a specific direction in space, which is determined by the horizontal angle and the pitch angle. The motion primitive direction set is a set of unit direction vectors that cover the local flight space in front of the UAV system. It is constructed as follows: the horizontal angle is discretized in the range of 0 to 2π according to a preset horizontal direction. Perform uniform discretization, dispersing the pitch angle within a preset range, such as from -60° to 60°, along a preset vertical direction. Uniform discretization is performed, and the unit direction vector of each motion element in the system is determined by the combination of horizontal and pitch angles. The total number of candidate element directions is... .
[0026] like Figure 2 As shown in the figure, this illustrates the principle of local trajectory generation based on a set of motion primitive directions. Multiple rays emanating from the current position of the UAV represent different primitive directions, each with an initial unit direction vector. For the first The first horizontal angle and the first There are three vertical angles: ; ; ; in, For the first A horizontal angle, For the first A vertical angle, and These are the maximum and minimum offset angles in the horizontal direction, respectively. and These represent the maximum and minimum offset angles in the vertical direction, respectively.
[0027] These initial directions form the directional basis of the motion primitives, but the present invention does not directly fix the terminal in the preset direction, but uses the preset direction as the initial reference for subsequent network residual correction.
[0028] The lightweight neural network is one of the core components of this invention, and its structure is as follows: Figure 3 As shown, the system includes a depth feature branch, a state feature branch, and a fusion output branch. The depth feature branch receives a preprocessed normalized depth map and extracts the geometric features of near-field obstacles through several convolutional layers, normalization layers, and activation functions. This branch is used to perceive the distribution, distance, and shape information of obstacles ahead from the depth map. The state feature branch receives a state vector composed of position, velocity, and local target orientation, and extracts flight dynamics and mission target features through a multi-layer perceptron (MLP). This branch is used to understand the current motion state of the UAV and its relative relationship with the target. The two types of features are concatenated and input into the fusion head, which consists of several fully connected layers and finally outputs a tensor of dimension N×11. Where N is the number of motion primitives, and 11 indicates that each primitive corresponds to 11 unbounded predictor variables. , , and For unbounded variables output by the network, For the first The ranking score of each motion primitive; the smaller the score, the higher the priority of that primitive being checked and executed.
[0029] Specifically, for the i-th motion primitive, the unbounded predictive variables output by the lightweight neural network include: the three-dimensional unbounded variable of the terminal position. Terminal velocity three-dimensional unbounded variable Terminal acceleration three-dimensional unbounded variable Unbounded variables in execution time and sorting score scalar The terminal position, velocity, acceleration, and execution time are used for subsequent mapping to physically meaningful candidate terminal states. The ranking score is used to determine the priority of verification among multiple candidate trajectories; a smaller score indicates that the trajectory corresponding to that primitive is checked more preferentially. These variables are called "unbounded predictive variables" because the output layer of a neural network typically uses a linear activation function, whose output value can theoretically take any real number. Therefore, subsequent mapping operations are needed to constrain it to a pre-defined physically feasible range.
[0030] In this step, through parallel forward inference of the neural network, the prediction results for all N motion primitives can be obtained in a single calculation, avoiding the iterative process of searching or optimizing in each direction in traditional methods, and greatly reducing online computation latency. At the same time, since the network receives depth map and state information simultaneously, the prediction results can be adaptively adjusted according to the current obstacle distribution and UAV motion state, overcoming the deficiency of fixed primitive library in lacking environmental perception capability.
[0031] S103, map the unbounded prediction variables of each motion primitive to candidate terminal states that satisfy preset physical boundary constraints.
[0032] Since the unbounded predictive variables directly output by the neural network may exceed the physical limits allowed by the UAV's flight dynamics (e.g., the terminal position is too far, the speed is too high, or the execution time is unreasonable), it is necessary to map each unbounded predictive variable to a candidate terminal state with clear physical meaning. This mapping process is achieved through preset physical boundary constraints, which include at least position range constraints and velocity amplitude constraints, as well as acceleration amplitude constraints and execution time range constraints.
[0033] Specifically, for the first one direction ,set up The nominal primitive length, The range is adjusted to the endpoint. For maximum speed, For maximum acceleration, and Let the shortest and longest execution times be respectively. Then, the candidate terminal position, velocity, acceleration, and execution time in the machine system are defined as follows: ; ; ; in, This is the Sigmoid function. The above mapping prevents the network from outputting terminal states that exceed a preset physical range, reducing the impact of abnormal predictions on flight safety.
[0034] Then the terminal state under the machine system is switched to the world system: ; in , , This represents the final state within the world system.
[0035] In one specific embodiment, the following may be adopted: ; The above parameters can also be adjusted according to the aircraft type, payload, sensor field of view, and flight speed.
[0036] The core benefit of this step is that, through the bounded mapping of the Sigmoid function, the network prediction results naturally satisfy the basic dynamic constraints. Even if there is noise in the depth map or the environmental structure exceeds the training distribution, the candidate terminal state output by the network will not exceed the preset physical safety boundary, thereby reducing the probability of abnormal predictions leading to unexecutable trajectories.
[0037] S104 generates multiple candidate trajectories based on the candidate terminal states of each motion primitive.
[0038] After obtaining the candidate terminal's position, velocity, acceleration, and execution time in the world frame, a continuous trajectory connecting the UAV's current state with the candidate terminal's state needs to be generated. This invention employs a fifth-order polynomial trajectory, which is continuous in position, velocity, and acceleration, thus helping to reduce trajectory tracking errors and sudden changes in flight attitude.
[0039] Specifically, for the first Each motion element, within a time interval Internally generated three-dimensional fifth-order polynomial trajectory: ; in, These are the polynomial coefficients.
[0040] The trajectory satisfies the pose derivative boundary conditions at the start and end points: ; For each spatial dimension, let And define the offset: ; ; ; The polynomial coefficients can then be uniquely determined by the boundary conditions: ; ; ; ; in represents the coefficients of a fifth-order polynomial.
[0041] Therefore, this invention converts the learning output into an explicit trajectory representation with continuous position, velocity, and acceleration boundaries, balancing end-to-end prediction efficiency and trajectory verifiability.
[0042] This step transforms the discrete candidate terminal states output by the neural network into continuous explicit polynomial trajectories, giving the generated trajectories clear mathematical expressions and physical meanings, facilitating subsequent collision checks and dynamic constraint verification. Simultaneously, because the fifth-order polynomial ensures the continuity of position, velocity, and acceleration, the controller's tracking error is small, and the flight attitude does not oscillate violently due to sudden trajectory changes.
[0043] S105. Perform security checks on each candidate trajectory in descending order of sorting scores, and output the first candidate trajectory that passes the security check as the execution trajectory.
[0044] After obtaining all N candidate trajectories and their corresponding ranking scores, a safe and feasible trajectory needs to be selected for execution. This invention employs a strategy of prioritizing the examination of better candidates to avoid traversing all candidates, thereby reducing online computational overhead. Specifically, each motion primitive is first sorted according to its ranking score from smallest to largest to determine the verification order. The smaller the ranking score, the better the network predicts the candidate trajectory, and therefore it is checked first.
[0045] The purpose of safety verification is to ensure that the selected trajectory will not collide with obstacles during flight. This invention does not rely on a complete global ESDF map during the inference phase, but instead utilizes current local depth-sensing information to perform safety verification, thereby reducing the computational burden of online mapping. Local depth-sensing information can originate from local point clouds obtained by backprojecting a depth map, or from locally constructed voxel range fields or short-term local ESDFs.
[0046] Taking a local depth point cloud as an example, the specific process of security verification is as follows: During the training phase, each candidate trajectory is sampled. Discrete points, sampling time: ; The distance to the nearest obstacle is obtained through ESDF in the simulation environment. .
[0047] No. The total cost of candidate trajectories is defined as: ; in, As a result of the collision, The cost of advancing towards the goal As a cost of smoothness, For execution time, , , , As weight.
[0048] Collision cost can be defined as: ; in, This is the safe distance threshold.
[0049] Target advance cost, used to encourage the trajectory toward the local target, can be defined as: ; The smoothness cost is represented by the integral squared jerk: ; Select the best motion primitive from the training samples based on the total candidate cost: .
[0050] For candidate trajectories that pass the safety check, a further dynamic feasibility check is performed. The dynamic feasibility check determines whether the velocity, acceleration, and jerk of the candidate trajectory at each sampling point are all less than or equal to the corresponding preset thresholds. Jerk is the first derivative of acceleration, reflecting the drastic change in acceleration; excessive jerk can cause the UAV's attitude response to fail to keep up with the trajectory requirements. If the velocity, acceleration, and jerk of the trajectory at each sampling point all meet the threshold constraints, the candidate trajectory is deemed to have passed the dynamic feasibility check.
[0051] When a candidate trajectory passes both safety and dynamic feasibility checks, it is selected as the execution trajectory. After selection, the position, velocity, and acceleration commands for the trajectory are sent to the flight controller via the flight control interface. The controller can employ methods such as position-velocity cascade proportional-integral-derivative (PID) control, model predictive control, or geometric control. Because the selected trajectory is continuous in position, velocity, and acceleration and has undergone safety checks, the controller can perform rapid obstacle avoidance flight with relatively small tracking errors.
[0052] If all candidate trajectories fail the safety or dynamic feasibility checks, a pre-defined braking or hovering strategy is executed as a safety fallback. The braking strategy can take the form of velocity reversal and acceleration truncation, generating an emergency trajectory that decelerates the UAV to hover along its current velocity direction to avoid collisions when no safe trajectory is available. Specifically, the terminal velocity of the braking trajectory is set to zero, and the terminal acceleration is set to the maximum deceleration in the opposite direction of the velocity. The execution time is calculated based on the current velocity and deceleration. At the start of the next planning cycle, depth map acquisition, network inference, and candidate trajectory verification are performed again.
[0053] This step employs a priority verification mechanism guided by ranking scores, minimizing the computational load of online verification while ensuring security. Furthermore, local point cloud security verification does not rely on the global ESDF map, allowing the method to run frequently even under resource-constrained conditions. The introduction of a safety rollback strategy further enhances the robustness and security of the entire planning system.
[0054] The lightweight neural networks used in the above methods require offline training to achieve good predictive performance. The training process is performed in a simulation environment, such as... Figure 3 As shown, the training and inference phases share the same network structure, but the training phase additionally utilizes an ESDF map to generate supervisory signals. A 3D map containing various obstacles is randomly generated in the simulator. These obstacles can include cylinders, square pillars, tree-like columns, and ring-shaped obstacles, simulating different types of obstacles in a real, complex environment. For each training sample, a depth map, UAV status, local target orientation, and the corresponding ESDF map are obtained from the simulation environment. The ESDF map records the distance from each location in space to the nearest obstacle.
[0055] The depth map and UAV state of the training samples are input into a lightweight neural network to obtain unbounded predictive variables for each motion primitive. These variables are then mapped to candidate terminal states using the aforementioned method, generating fifth-order polynomial trajectories. Subsequently, the cost of each candidate trajectory is evaluated using an ESDF map in the simulation environment. Specifically, the training loss consists of trajectory supervision loss and ranking score loss. ; in, The terminal state and execution time used to monitor the optimal primitive can be defined as: ; in , , and It can be given by the lowest cost candidate or simulated teacher trajectory after ESDF evaluation. , and These are the weighting coefficients.
[0056] This is used to improve the consistency between the network output score and the ESDF evaluation cost. Let: ; ; in This represents the first value calculated based on the total cost of the candidate trajectory. The soft sorting labels corresponding to each motion primitive; This represents the ranking score calculated based on the network prediction. The predicted sorting probability corresponding to each motion primitive; and These represent the temperature coefficients corresponding to the cost distribution and the ranking score distribution, respectively, and are used to adjust the smoothness of the probability distribution.
[0057] The ranking score loss can then be defined in the form of cross-entropy: .
[0058] in This represents a very small positive number that prevents logarithmic operations from producing a zero value.
[0059] The optimal motion primitive (the one with the lowest total cost) is determined based on the total cost of each candidate trajectory. Simultaneously, soft-ranking labels are generated based on the relative magnitudes of the total costs of each candidate trajectory, reflecting the relative merits of the candidates. Subsequently, a trajectory supervision loss (which can be expressed as mean squared error) is constructed based on the difference between the candidate terminal state and execution time of the optimal motion primitive and the network prediction results. A ranking score loss (which can be expressed as cross-entropy) is constructed based on the consistency between the soft-ranking labels and the ranking scores predicted by the network. The sum of these two losses is used as the total loss, and gradient descent is employed to optimize the parameters of the lightweight neural network.
[0060] Through the above training method, the network simultaneously learns "how to generate feasible candidate terminal states" and "how to rank candidate primitives by quality." During the inference phase, ESDF maps and iterative optimization are no longer needed; only one forward inference of the network is required to obtain all candidates and their ranking scores, thereby achieving low-latency local trajectory planning.
[0061] like Figures 4 to 7 The figures shown are simulation diagrams under different obstacle densities, local trajectory comparison diagrams, a schematic diagram of a quadcopter UAV hardware platform, and diagrams of depth perception, local mapping, and trajectory execution in a 3D obstacle environment. Figure 4 The method's adaptability under different obstacle density scenarios was demonstrated. Figure 5 The differences between the local trajectories generated by this invention and existing methods were compared. Figure 6 The hardware platform architecture of the quadcopter, equipped with a stereo camera, IMU, onboard computing unit, and flight control, is shown. Figure 7 This demonstrates the complete workflow for depth map acquisition, local map construction, and trajectory execution in a real 3D obstacle environment.
[0062] It should be understood that the parameters used in the above embodiments, such as the number of network layers, convolution kernel size, number of primitives, angle range, velocity threshold, acceleration threshold, safe distance threshold, number of sampling points, and loss weight, can be adjusted according to the UAV model, flight speed, sensor field of view, scene scale, and mission safety level. These adjustments do not change the core method and scope of protection of this invention.
[0063] The method provided in this embodiment fuses depth map perception and state information into a lightweight neural network to predict motion primitive candidates with ranking scores end-to-end. The prediction results are then mapped to candidate terminal states that satisfy physical boundary constraints, and a safe-verifiable fifth-order polynomial trajectory is generated. Finally, an execution trajectory is selected through a score-guided priority verification mechanism. During the training phase, supervised learning is performed using an ESDF map, and during the inference phase, safety verification is completed solely by local depth perception. This approach combines the low-latency advantage of learning-based planning with the verifiability and safety of traditional trajectory planning.
[0064] Example 2 To verify the effectiveness and superiority of the end-to-end motion primitive trajectory planning method proposed in this invention, it was compared with several representative local planning methods in a simulation environment. The experimental platform was built based on the Robot Operating System (ROS) and a quadcopter UAV simulator. The UAV model was set with a maximum flight speed of 6 m / s and a maximum acceleration of 6 m / s². 2The airborne sensor simulates a stereo camera, outputting a depth map with a resolution of 640×480 pixels and a field of view of 90° horizontally and 60° vertically. The simulated map size is 50m×50m, and obstacles are arranged in a mixed pattern of cylindrical and square pillars at a density of 1 / 10 per m. 2 There are approximately 250 obstacles, forming a dense obstacle environment to fully test the planning capabilities of various methods in complex scenarios. The drone needs to autonomously fly from the starting point to the target point about 50m away, relying on local perception information for replanning throughout the process, with the replanning frequency set at 10Hz.
[0065] The comparison methods selected are the currently mainstream quadcopter local planning algorithms: Fast-Planner, EGO-Planner, and YOPO. Fast-Planner is a classic method based on B-spline trajectory optimization, generating smooth trajectories through front-end path search and back-end optimization; EGO-Planner employs a gradient optimization strategy, does not rely on a global map, and has good real-time performance; YOPO is a learning-based method that directly predicts trajectory points and is known for its extremely low planning latency. All comparison methods were run in the same simulation environment and hardware configuration, with the hardware platform simulating an NVIDIA Jetson Orin NX embedded computing unit to ensure fairness in the comparison.
[0066] The evaluation metrics consist of six items, comprehensively reflecting the overall performance of the planning method. Planning delay represents the average time taken from receiving sensing information to outputting an executable trajectory for a single local planning call, measured in milliseconds. This metric directly measures the method's real-time performance. Average and minimum safe distances are statistically analyzed along the actual execution trajectory, reflecting obstacle avoidance redundancy during flight; larger average and minimum safe distances indicate better safety. Trajectory length is the actual flight distance of the UAV from the starting point to the target point, reflecting the efficiency of path planning. Smoothness is measured using the integral square jerk of the trajectory; a smaller value indicates a smoother trajectory, which is beneficial for flight attitude stability. Flight time is the total time taken for the UAV to reach the target point from the starting point, comprehensively reflecting flight efficiency.
[0067] The results of the comparative experiment are shown in Table 1.
[0068] Table 1 Performance comparison of the present invention with representative quadrotor local programming methods
[0069] As shown in Table 1, the present invention achieves a planning latency of 2.42ms, which, while slightly higher than YOPO's 1.71ms, is significantly lower than Fast-Planner's 57.2ms and EGO-Planner's 13.4ms. This indicates that while maintaining the low latency characteristics of end-to-end learning-based planning, the present invention offers an order-of-magnitude speed advantage over traditional phased methods, effectively meeting the real-time requirements of high-frequency replanning in high-speed flight scenarios. Regarding safety, the present invention achieves an average safe distance of 1.68m and a minimum safe distance of 0.69m, on par with Fast-Planner and EGO-Planner, and significantly better than YOPO's minimum safe distance of 0.63m. This demonstrates that the present invention, through explicit polynomial trajectory generation and safety verification mechanisms, effectively avoids the collision risks that may occur in dense obstacle environments using pure learning methods, ensuring flight safety redundancy. In terms of trajectory length, this invention achieved a best result of 53.7m, which is 10.8% shorter than Fast-Planner and 8.4% shorter than YOPO. This demonstrates that the learning-based primitive sorting combined with residual correction can guide the UAV to select candidate trajectories closer to the optimal path, reducing unnecessary detours. Regarding smoothness, the integral squared jerk of this invention is 1014.45m. 2 / s 5 This is superior to EGO-Planner's 2319.31m. 2 / s 5 Slightly higher than YOPO's 814.77m 2 / s 5 However, considering that the trajectory length and flight time of this invention are shorter, this level of smoothness is sufficient to ensure stable tracking by the controller. In terms of flight time, this invention achieved the best result at 9.5s, which is 19.5% shorter than the fastest YOPO. This is due to the fact that this invention selects a shorter and dynamically feasible trajectory while ensuring safety, thus achieving efficient flight.
[0070] Based on the above experimental results, this invention achieves a superior balance between computational efficiency, safety redundancy, and flight efficiency. Compared to Fast-Planner and EGO-Planner, this invention significantly reduces planning latency while maintaining a comparable level of safe distance. Compared to YOPO, although this invention slightly increases planning latency, it significantly improves the minimum safe distance and shortens flight distance and flight time. Experiments verify that this invention can generate safe, smooth, and efficient local trajectories with extremely low online computational overhead in dense obstacle environments, demonstrating good engineering deployment value.
[0071] Figures 4 to 7The experimental results further demonstrate the planning effect, local trajectory quality, hardware platform configuration, and depth perception and trajectory execution of the present invention under different obstacle densities. The above experimental results and the accompanying figures corroborate each other, fully illustrating the robustness and practicality of the present invention in complex and dense environments.
[0072] Based on the same inventive concept, this application also provides a quadrotor drone local trajectory planning device for implementing the aforementioned quadrotor drone local trajectory planning method. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more quadrotor drone local trajectory planning device embodiments provided below can be found in the limitations of the quadrotor drone local trajectory planning method described above, and will not be repeated here.
[0073] In one embodiment, such as Figure 8 As shown, a local trajectory planning device for a quadcopter unmanned aerial vehicle is provided, the device comprising: The information acquisition module 30 is used to acquire airborne depth maps and UAV status information; the UAV status information includes current position, current speed, and local target orientation. The information input module 31 is used to input the depth map and UAV state information into the trained lightweight neural network to obtain the unbounded prediction variables corresponding to each of the multiple motion primitives; the unbounded prediction variables include terminal state variables, execution time variables, and ranking score variables. The variable mapping module 32 is used to map the unbounded prediction variables of each motion primitive to candidate terminal states that satisfy preset physical boundary constraints. The physical boundary constraints include at least position range constraints and velocity amplitude constraints. The trajectory generation module 33 is used to generate multiple candidate trajectories based on the candidate terminal states of each motion primitive; The security verification module 34 is used to perform security verification on each candidate trajectory in descending order of sorting scores, and output the first candidate trajectory that passes the security verification as the execution trajectory.
[0074] This application also provides an electronic device, in some embodiments, referring to... Figure 9 As shown, the electronic device 700 includes an input unit 710, a memory 720, a processor 730, and an output unit 740. The memory 720 stores program instructions that can be executed on the processor 730. The processor 730 can execute the local trajectory planning method and / or technical solution for a quadcopter UAV based on the foregoing embodiments by calling the program instructions. The electronic device 700 can be a mobile terminal device such as a mobile phone or computer.
[0075] Furthermore, embodiments of this application also provide a computer-readable storage medium for storing a computer program that executes a local trajectory planning method for a quadcopter unmanned aerial vehicle. For example, computer program instructions, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. The program instructions that invoke the methods of this application may be stored in a fixed or removable storage medium, and / or transmitted via data streams in broadcast or other signal carrying media, and / or stored in a storage medium that operates according to the program instructions.
[0076] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0077] The technical features of the above embodiments can be arbitrarily integrated. For the sake of brevity, not all possible integrations of the technical features in the above embodiments are described. However, as long as the integration of these technical features does not contradict each other, they should be considered to be within the scope of this specification.
[0078] The above embodiments merely illustrate several implementation methods of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. A method for local trajectory planning of a quadcopter unmanned aerial vehicle, characterized in that, The method includes: Acquire airborne depth map and UAV status information; the UAV status information includes current position, current speed, and local target orientation; The depth map and the UAV state information are input into a trained lightweight neural network to obtain unbounded prediction variables corresponding to each of the multiple motion primitives; the unbounded prediction variables include terminal state variables, execution time variables, and ranking score variables. The unbounded predictive variables of each motion primitive are mapped to candidate terminal states that satisfy preset physical boundary constraints, which include at least position range constraints and velocity amplitude constraints. Specifically, this includes: determining the unit direction vector of each motion primitive in the machine system based on a preset motion primitive direction set; mapping the unbounded terminal position variable of each motion primitive through a Sigmoid function, multiplying it by a preset terminal position correction range, and then adding it to the product of the nominal primitive length and the unit direction vector to obtain the candidate terminal position; mapping the unbounded terminal velocity variable and the unbounded terminal acceleration variable through a Sigmoid function, multiplying them by preset maximum velocity and maximum acceleration to obtain candidate terminal velocity and candidate terminal acceleration; and mapping the unbounded execution time variable to a preset execution time range through a Sigmoid function to obtain the candidate execution time. Multiple candidate trajectories are generated based on the candidate terminal states of each motion primitive; the generation of multiple candidate trajectories includes: taking the current state of the UAV as the starting point and the states of each candidate terminal as the ending point, generating a fifth-order polynomial trajectory that satisfies the boundary conditions of the starting point and the ending point position, velocity, and acceleration, wherein the fifth-order polynomial trajectory is continuous in position, velocity, and acceleration; The candidate trajectories are sequentially subjected to safety checks according to their ranking scores from best to worst. The first candidate trajectory that passes the safety check is output as the execution trajectory. The safety check includes: sampling multiple discrete points on the current candidate trajectory; obtaining the distance between each sampling point and the obstacle using the local depth perception information at the current moment; if the distance of all sampling points is greater than or equal to a preset safety distance threshold, the current candidate trajectory is determined to have passed the safety check; if it fails, the next candidate trajectory is checked according to the ranking scores until a candidate trajectory that passes the safety check is selected or all candidate trajectories are traversed. The training process of the lightweight neural network includes: generating a 3D map containing obstacles in a simulation environment; acquiring the depth map, UAV state, local target orientation, and corresponding ESDF map of the training samples; inputting the depth map and UAV state into the lightweight neural network to obtain unbounded prediction variables for each motion primitive, mapping them to candidate terminal states, and generating candidate trajectories; using the ESDF map to calculate the collision cost, target advancement cost, and smoothness cost of each candidate trajectory to obtain the total cost of each candidate trajectory; determining the optimal motion primitive based on the total cost of each candidate trajectory and generating soft ranking labels; constructing a trajectory supervision loss based on the difference between the optimal motion primitive and the network prediction results, and constructing a ranking score loss based on the consistency between the soft ranking labels and the ranking scores predicted by the network; and optimizing the network parameters by summing the two losses.
2. The local trajectory planning method for a quadcopter UAV as described in claim 1, characterized in that, Also includes: Before or simultaneously with the security verification of the candidate trajectory, a dynamic feasibility verification is performed on the candidate trajectory to determine whether the velocity, acceleration, and jerk of the candidate trajectory at each sampling point are all less than or equal to the corresponding preset threshold. The first candidate trajectory that passes the safety check is a candidate trajectory that passes both the safety check and the dynamic feasibility check. If all candidate trajectories fail the safety or dynamic feasibility check, the preset braking or hovering strategy will be executed.
3. A local trajectory planning device for a quadcopter unmanned aerial vehicle (UAV), characterized in that, The device includes: The information acquisition module is used to acquire airborne depth maps and UAV status information; the UAV status information includes current position, current speed, and local target orientation. The information input module is used to input the depth map and the UAV state information into a trained lightweight neural network to obtain unbounded prediction variables corresponding to multiple motion primitives; the unbounded prediction variables include terminal state variables, execution time variables, and ranking score variables. The variable mapping module is used to map the unbounded prediction variables of each motion primitive to candidate terminal states that satisfy preset physical boundary constraints, which include at least position range constraints and velocity amplitude constraints. Specifically, it includes: determining the unit direction vector of each motion primitive in the machine system based on a preset motion primitive direction set; mapping the unbounded terminal position variable of each motion primitive using a Sigmoid function, multiplying it by a preset terminal position correction range, and then adding it to the product of the nominal primitive length and the unit direction vector to obtain the candidate terminal position; mapping the unbounded terminal velocity variable and the unbounded terminal acceleration variable using a Sigmoid function, multiplying them by preset maximum velocity and maximum acceleration to obtain candidate terminal velocity and candidate terminal acceleration; and mapping the unbounded execution time variable to a preset execution time range using a Sigmoid function to obtain the candidate execution time. The trajectory generation module is used to generate multiple candidate trajectories based on the candidate terminal states of each motion primitive; the generation of multiple candidate trajectories includes: taking the current state of the UAV as the starting point and the states of each candidate terminal as the ending point, generating a fifth-order polynomial trajectory that satisfies the boundary conditions of the starting point and the ending point position, velocity, and acceleration, wherein the fifth-order polynomial trajectory is continuous in position, velocity, and acceleration; The safety verification module is used to perform safety verification on each candidate trajectory in descending order of the ranking scores, and output the first candidate trajectory that passes the safety verification as the execution trajectory. The safety verification includes: sampling multiple discrete points on the current candidate trajectory; obtaining the distance between each sampling point and the obstacle using the local depth perception information at the current moment; if the distance of all sampling points is greater than or equal to a preset safety distance threshold, the current candidate trajectory is determined to have passed the safety verification; if it fails, the next candidate trajectory is verified in the order of the ranking scores until a candidate trajectory that passes the safety verification is selected or all candidate trajectories are traversed. The training process of the lightweight neural network includes: generating a 3D map containing obstacles in a simulation environment; acquiring the depth map, UAV state, local target orientation, and corresponding ESDF map of the training samples; inputting the depth map and UAV state into the lightweight neural network to obtain unbounded prediction variables for each motion primitive, mapping them to candidate terminal states, and generating candidate trajectories; using the ESDF map to calculate the collision cost, target advancement cost, and smoothness cost of each candidate trajectory to obtain the total cost of each candidate trajectory; determining the optimal motion primitive based on the total cost of each candidate trajectory and generating soft ranking labels; constructing a trajectory supervision loss based on the difference between the optimal motion primitive and the network prediction results, and constructing a ranking score loss based on the consistency between the soft ranking labels and the ranking scores predicted by the network; and optimizing the network parameters by summing the two losses.
4. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the local trajectory planning method for a quadcopter UAV as described in any one of claims 1 to 2.
5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the local trajectory planning method for a quadcopter UAV as described in any one of claims 1 to 2.
6. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the local trajectory planning method for a quadcopter UAV as described in any one of claims 1 to 2.
Citation Information
Patent Citations
Trajectory planning method for unmanned aerial vehicle to quickly pass through window
CN120846342A