Unmanned aerial vehicle trajectory planning method based on deep learning and applied unmanned aerial vehicle

Through a deep learning-based trajectory planning method, combined with depth images and current state information, the future trajectory of the UAV is predicted, which solves the problems of insufficient real-time and robustness of the UAV in obstacle-dense environments and achieves efficient obstacle avoidance flight.

CN120803029APending Publication Date: 2025-10-17TIANJIN UNIV
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202511108370.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-08
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing drone autonomous navigation technology faces problems of insufficient real-time performance, robustness and adaptability in obstacle-dense environments. Especially in the case of limited low-cost sensors and onboard computing resources, traditional modular navigation systems are unable to meet the requirements of high-speed flight missions.

Method used

A deep learning-based trajectory planning method is adopted to describe the motion trajectory through three-dimensional independent time-parameterized polynomials. Combined with depth images and current state information, a deep learning network is used to predict the future expected position, velocity and acceleration to achieve end-to-end trajectory planning, and the trajectory is optimized by combining the environmental gradient-guided training method.

Benefits of technology

It achieves real-time and efficient obstacle avoidance flight in complex environments, improves computing efficiency and the real-time and reliability of trajectory planning, and overcomes the delay and performance ceiling problems of imitation learning in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803029A_ABST
    Figure CN120803029A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of unmanned aerial vehicle autonomous navigation, provides an unmanned aerial vehicle trajectory planning method and an unmanned aerial vehicle design applying the method, and aims to realize real-time and efficient environmental perception and unmanned aerial vehicle autonomous obstacle avoidance trajectory generation. A group of primitive sets is predefined in a three-dimensional state space to explore the whole search space so as to realize complete coverage of a feasible region, multi-mode perception input of'depth image, current state and target direction 'is adopted, and the depth image is acquired by a depth camera; the current state is obtained by the airborne vision positioning module; multi-modal sensing input is processed by a deep learning network, future expected position, speed and acceleration information is calculated according to output of the deep learning network and serves as input of a bottom layer controller of the unmanned aerial vehicle for trajectory tracking, and finally obstacle avoidance flight in a complex environment is achieved. The method is mainly applied to unmanned aerial vehicle design and manufacturing occasions.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of unmanned aerial vehicle autonomous navigation, and particularly relates to a trajectory planning method based on deep learning, including real-time multi-modal trajectory prediction model design in complex environment, construction of parallel simulation training environment, and design of low-cost micro unmanned aerial vehicle hardware platform. In particular, it relates to an unmanned aerial vehicle trajectory planning method based on deep learning and an unmanned aerial vehicle applying the same. BACKGROUND

[0002] Autonomous navigation technology of quadrotor unmanned aerial vehicles in obstacle-dense environments has attracted widespread attention in recent years, but its practical application still faces many technical challenges. Existing solutions are mainly limited by the lack of on-board computing resources and the performance bottleneck of low-cost sensors, making it difficult for the real-time performance, robustness and adaptability of the navigation system to meet the needs of high-speed flight tasks. Traditional autonomous navigation systems usually adopt a modular design architecture, which divides the entire navigation process into three relatively independent processing links: "environment perception and map construction module, front-end path search module, and back-end trajectory optimization module". Although this phased processing method improves the interpretability of the system, the delay and cumulative error between modules seriously restrict the overall performance of the system.

[0003] In the perception and mapping link, existing technologies face great challenges in real-time performance, noise robustness, etc. Compared with high-precision laser radar systems, low-cost depth cameras have the advantages of light weight and low power consumption, but the depth images they output have obvious noise interference, and the effective perception range is usually limited to 0.6 to 10 meters. This limited perception capability results in poor accuracy of the constructed environment map, which significantly affects the performance of subsequent path planning algorithms. In addition, in a dynamically changing environment, real-time updating of map information also puts higher requirements on computing resources.

[0004] In terms of path planning, traditional navigation algorithms face the challenge of multi-modal optimization. In practical applications, there are often multiple equally effective feasible paths from the current position to the target point, which makes the planning algorithm prone to local optimal solutions. To solve this problem, existing technologies usually adopt a two-stage planning strategy: first, generate multiple initial path candidates through a front-end module (such as a sampling-based path search algorithm or a topological path search algorithm); then, refine these paths through a back-end optimization module (such as a gradient descent-based optimization method) to meet the requirements of smoothness, safety, and dynamic feasibility. However, this step-by-step processing process not only increases the computational complexity, but also introduces additional processing delays, making it difficult to meet the real-time requirements of high-speed flight scenarios.

[0005] In recent years, deep learning-based methods provide a new technical path for UAV autonomous navigation. This kind of method is mainly divided into imitation learning and reinforcement learning methods. Imitation learning makes the network model learn the decision-making behavior of the privileged expert (such as traditional planning algorithm) through supervised training, although it can realize lightweight real-time reasoning, but its performance is limited by the quality of the expert trajectory and the sample coverage. Reinforcement learning method trains the strategy network by maximizing the environmental reward signal, which can theoretically find a better strategy than the expert demonstration, but in practical application, it faces problems such as sparse reward signal, noise interference and delay, which makes the training process difficult to converge. SUMMARY

[0006] In order to overcome the shortcomings of the prior art, the present application aims to provide a UAV trajectory planning method and a UAV designed by applying the method, which realizes real-time and efficient environment perception and autonomous obstacle avoidance trajectory generation of UAV. To this end, the technical scheme adopted by the present application is as follows: a UAV trajectory planning method based on deep learning, the steps are as follows: a three-dimensional independent time parameterized polynomial is used to describe the motion trajectory in the body coordinate system, a set of primitives P={p0, p1, …, pN} is defined in advance in the three-dimensional state space to explore the entire search space to realize complete coverage of the feasible region, and a multi-modal perception input of "depth image, current state and target direction" is used, wherein the depth image is obtained by a depth camera; the current state specifically includes the speed and acceleration information of the current UAV, which is obtained from the binocular image output by the airborne visual positioning module from the depth camera; the multi-modal perception input is processed by a deep learning network, the expected position, speed and acceleration information in the future are calculated according to the output of the deep learning network, which are used as the input of the UAV bottom controller for trajectory tracking, and finally the obstacle avoidance flight in complex environment is realized.

[0007] The detailed steps are as follows:

[0008] I. A three-dimensional independent time parameterized polynomial is used to describe the motion trajectory in the body coordinate system, and the trajectory of each spatial dimension x, y, z is described by a polynomial function f u (t) about time t, x, y, z are uniformly represented as subscript u, and the representation form is:

[0009] f u (t) = a0 + a1t + a2t 2 +a3t 3 +…+a n t n (1)

[0010] Wherein, A = [a0, a1, a2, …, a n ] is the coefficient vector of the polynomial;

[0011] A set of primitives P={p0, p1, …, pN} is defined in advance in the three-dimensional state space to explore the entire search space to realize complete coverage of the feasible region, and a multi-modal perception input of "depth image, current state and target direction" is used, wherein the depth image is obtained by a depth camera; the current state specifically includes the speed and acceleration information of the current UAV, which is obtained from the binocular image output by the airborne visual positioning module from the depth camera; the multi-modal perception input is processed by a deep learning network, the expected position, speed and acceleration information in the future are calculated according to the output of the deep learning network, which are used as the input of the UAV bottom controller for trajectory tracking, and finally the obstacle avoidance flight in complex environment is realized.n}, to explore the entire search space to achieve complete coverage of the feasible area to avoid trajectory optimization falling into a suboptimal local minimum, where each primitive p ij The initial position in the body coordinate system is expressed as:

[0012]

[0013] Among them, p ij Represents the i×jth primitive, i and j are the primitive indices in the horizontal and vertical directions respectively, r is the trajectory planning radius, For primitive p ij The heading angle, θ j For primitive p ij Pitch angle;

[0014] Second, the multimodal perception input of "depth image, current state and target direction" is adopted. Among them, the depth image is obtained by the depth camera; the current state can be obtained by the binocular image output from the depth camera by the UAV visual positioning module. The current state specifically includes the speed and acceleration information of the current UAV, and is normalized according to the expected maximum flight speed; the target direction is represented by the three-dimensional unit vector pointing to the target point of the current UAV. Specifically, the input depth image is divided into The grid structure, M θ Represent the number of horizontal and vertical primitives respectively. Each grid is responsible for predicting the trajectory within the corresponding local frustum area. The residual network ResNet-18 is used as the backbone network. It first uses the convolution layer for initial feature extraction. Then, the residual blocks are stacked in 4 stages, with 2 residual blocks in each stage. The residual blocks contain convolution layers, batch normalization layers, and activation layers. Skip connections are used to prevent gradients from disappearing or exploding. Finally, the image processing is extracted as dimensional feature map; the input speed, acceleration, and target direction 9-dimensional state information is normalized and expanded to After size and splicing to the feature map, we get dimensional features; on this basis, a weight-shared 1×1 convolutional layer is used as the output layer to process the image and state features and predict the modal position offset of the primitive, including the heading angle offset The pitch angle offset Δθ, trajectory radius offset Δr, velocity v, acceleration a, and the score of each trajectory are used as the original output of the network;

[0015] Three, network prediction post-processing and trajectory generation: in step two, the features of each grid are used to predict the original offset output of the independent primitives in space with a 1x1 convolutional layer, and post-processing is performed to convert into final primitive parameters, including final state position, velocity, and acceleration; first, the prediction of the primitive state offset is constrained by the hyperbolic tangent activation function, generating horizontal and vertical offset angles and trajectory length changes and Δr, the adjusted primitive position p' ij is expressed as:

[0016]

[0017] where p' ij , θ' j r' ij are the adjusted i x j primitive and corresponding heading angle, pitch angle, and trajectory radius, respectively. Second, the velocity and acceleration vectors are predicted from the primitive velocity and acceleration output. Similarly, the original output primitive velocity v and acceleration a are first converted to unit vectors by the hyperbolic tangent tanh activation function, and then multiplied by the maximum expected velocity and expected acceleration to obtain the actual results:

[0018] v' = tanh(v) · v max

[0019] a' = tanh(a) · a max (4)

[0020] where v max , a max are the maximum velocity and acceleration, and v', a' are the actual results predicted by the network. In this way, the velocity and acceleration of flight are constrained to a physically feasible range. Finally, the scores of each trajectory are additionally predicted and used to evaluate the safety, smoothness, and other indicators of each candidate trajectory for selection when executing all predictions.

[0021] Four, in the actual control process of the UAV, first, all predicted trajectories are sorted and selected based on the score value, and the candidate trajectory prediction with the highest score is selected for solving; then, the boundary value problem solver is used to calculate the polynomial coefficient matrix A = M · d, where d = [p0, v0, a0, p', v', a'] is a state vector composed of the initial state and the predicted terminal state, M is a constant mapping matrix used to map the boundary state to the polynomial coefficient, p0, v0, a0 are the current initial state of the UAV, and p', v', a' are the network-predicted final position, velocity, and acceleration. Finally, a T = 2 second time window rolling horizon trajectory is generated, and a discrete reference state sequence is output at a preset fixed frequency, including future position, velocity, and acceleration information, to control the UAV.

[0022] Training process: combine traditional UAV trajectory optimization with deep learning gradient descent, use environmental gradient guidance training method to guide the learning process, the specific steps are as follows:

[0023] Define the cost J as the smoothness, safety, target guidance and other evaluation indexes of the trajectory:

[0024] J = λ s J s + λ o J o + λ g J g (5)

[0025] Where J s is the smoothness cost, used to constrain the integral of the square of the derivative to avoid excessive maneuver; J o is the safety cost, used to punish the distance from the obstacle to ensure flight away from the obstacle; J g is the target cost, used to guide the UAV to the target; and λ is the weight parameter for balancing;

[0026] First, the smoothness J s is defined as the integral of the high-order derivative, which is specifically expressed as:

[0027] J s = d T M T Q M d (6)

[0028] Where the Hessian matrix Q represents the relationship between polynomial coefficients and high-order derivatives, and d is the block matrix composed of the current state d F = [p0, v0, a0] and the optimized final state variable d P = [p', v', a'] On this basis, M T Q M part is also represented as a block matrix B, subscript F, P is the block corresponding to the fixed variable and the free variable, then the cost is further expressed as:

[0029]

[0030] Therefore, the Jacobian matrix of J s with respect to d P is calculated as:

[0031]

[0032] Then, to make the trajectory away from the obstacle, the safety cost J o of the trajectory is defined as the time integral of the potential function c(·) about the position p(t):

[0033]

[0034] where p(τ·dt) is the position of the trajectory at the τth discrete time, the potential function c(·) can be any form of function inversely proportional to the distance to the obstacle, the distance of the trajectory to the nearest obstacle at time t is obtained by querying the current position p(t) and the point cloud map of the environment, and thus, J o The Jacobian matrix in discrete form is:

[0035]

[0036] where the time matrix T = [(τ·dt) 0 ,(τ·dt) 1 ,…,(τ·dt) n ], dt is the discrete time sampling interval, τ·dt is the sampling time after discretization, L p is the right block of the matrix M corresponding to the variable to be optimized;

[0037] Finally, in order to make the trajectory reach the target, the target cost is defined as the distance between the trajectory endpoint p' and the target point g, and the target is normalized to ensure numerical stability:

[0038] J g =(p′-g) 2 (11)

[0039] The Jacobian matrix can be simply calculated as:

[0040]

[0041] The numerical gradient of the above cost is obtained by querying the environment map or directly calculating, and the gradient is conducted to the prediction output of the deep learning network through the chain rule, and is handed over to the deep learning optimizer for gradient update of network parameters; in addition, in order to screen all predicted trajectories, not only the cost is used to optimize the trajectory parameters, but also the cost of each trajectory is predicted as a score to screen the final feasible trajectory; specifically, the loss function of the score prediction is defined as the smooth absolute error SmoothL1 loss between the score and the true value:

[0042] L = SmoothL1(score, -J) (13)

[0043] Where score is the trajectory score predicted by the network policy, this loss is analytical, and the gradient is automatically derived through the deep learning network framework, finally, the Adam optimizer is used to train the network with the manually calculated gradient.

[0044] The method for constructing a trajectory planning unmanned aerial vehicle simulation environment based on deep learning comprises the following steps: firstly, a point cloud model of a small number of trees is constructed in advance, and a random distribution position and a random angle of the trees in the simulation environment are generated based on a Poisson distribution; secondly, the generated tree point cloud is moved to a specified position and superimposed, so as to obtain an original point cloud data environment containing a random tree distribution; and thirdly, a corresponding grid map is constructed based on the obtained original point cloud data, which can effectively represent the spatial structure in the simulation environment and provide support for subsequent depth map generation and collision detection.

[0045] After the environment model is constructed, a virtual depth camera model is further constructed, and the depth information of the grid map is collected by using the depth camera model. Specifically, by using a ray tracing technology, a depth camera emits a ray for each pixel point, and the path of the ray is tracked to calculate the three-dimensional coordinates of each point on the path.

[0046]

[0047] wherein P c =(X c ,Y c ,Z c ) is a point projected into a camera coordinate system, (u,v) is a point on a camera plane, [f x ,f y ,c x ,c y ] is a camera intrinsic parameter, then the projection point P w in the camera system is transformed into a world system P w by using a camera pose [R wc ,t c ] through coordinate transformation P c =R wc P c +t c , and a collision relationship is checked, R wc is a rotation matrix, t c is a translation matrix, and the projection distance Z c is increased until the ray intersects with an obstacle in the grid map, at which time the distance between the ray and the obstacle is the depth value of the pixel.

[0048] In order to adapt to the demand of large-scale simulation environment, a grid remapping mechanism is adopted: when the unmanned aerial vehicle or the ray exceeds the effective range of the current grid map, the system will calculate the coordinate axis u∈{x,y,z} exceeding the map boundary Lu corresponding position P u remapping to P u ', mapping it back into the valid range of the map:

[0049] P u ' = 2L u - P u (15)

[0050] This process enables the map of the simulation environment to be extended to a borderless virtual space.

[0051] The unmanned aerial vehicle based on deep learning trajectory planning adopts a micro-space flight control electronic governor integrated module and a flight control system, integrates flight control, sensor data processing and electronic governor functions, a positioning module adopts a lightweight multi-state constraint Kalman filter MSCKF based on filtering, an on-board card computer runs a program of the deep learning based unmanned aerial vehicle trajectory planning method, and a camera is used to acquire binocular images for positioning of the positioning module; then, state estimation results of the positioning module and depth Figure One of the depth camera are given to the program running on the on-board card computer, are used for environment perception and trajectory prediction; after obtaining a polynomial trajectory of the unmanned aerial vehicle, the card computer is used to calculate expected position, speed and acceleration information in the future as inputs of the micro-space flight control electronic governor integrated module and the flight control system for trajectory tracking, and finally realizes obstacle avoidance flight in a complex environment.

[0052] The characteristics and advantages of the present application are:

[0053] The present application has great significance for the research on deep learning based unmanned aerial vehicle trajectory planning and autonomous navigation. In an unknown complex multi-obstacle environment, the present application can realize real-time and efficient environment perception and unmanned aerial vehicle autonomous obstacle avoidance trajectory generation. The present application has high theoretical and engineering value, and the advantages of the present application are summarized as follows:

[0054] (1) The present application proposes a multi-modal motion planning framework based on deep learning, which realizes an end-to-end trajectory planning solution by organically integrating multiple modules such as perception mapping, path search and trajectory optimization in traditional motion planning into a unified neural network. The framework adopts a motion primitive space representation method, realizes comprehensive coverage and efficient exploration of the planning space, and the network architecture can simultaneously predict the optimization offset and feasibility score of multiple candidate trajectories, which not only retains the multi-modal characteristics of traditional planning methods, but also significantly improves the calculation efficiency. Compared with the traditional serial processing multi-stage planning system, the integrated design greatly improves the calculation efficiency, and provides real-time and reliable trajectory planning capability for high-speed flight of the unmanned aerial vehicle in a complex environment.

[0055] (2) The application proposes a training strategy based on environmental gradient guidance, which establishes a new deep learning paradigm by directly propagating the numerical gradient information in the traditional trajectory optimization method to the neural network parameters. This training method skillfully combines the trajectory optimization of traditional optimization methods with the gradient descent of deep learning, avoiding the dependence of imitation learning on expert demonstration and its performance upper limit problem, overcoming the challenges of reward sparsity and convergence difficulty in the reinforcement learning training process, effectively simplifying the training process and improving the training convergence speed.

[0056] (3) The application proposes a high-efficiency simulation environment construction and micro unmanned aerial vehicle system. The system realizes high-efficiency simulation and depth map generation in complex environments through a tree random distribution model based on point cloud, combined with depth camera simulation and CUDA (Unified Computing Architecture) parallel computing acceleration technology. At the same time, the system designs a micro unmanned aerial vehicle with a size of 7*7 cm and a weight of only 356 grams, which can perform complex autonomous flight tasks in limited space. Compared with traditional simulation environments, the application supports random environment generation and parallel acceleration optimization, which can effectively provide a large amount of data for neural network training; and the unmanned aerial vehicle hardware design has the characteristics of low cost, small size and light weight, and realizes rapid autonomous flight in dense and chaotic environments. BRIEF DESCRIPTION OF DRAWINGS

[0057] ATTACHMENT Figure 1 Overall structure diagram of unmanned aerial vehicle trajectory planning method based on deep learning.

[0058] ATTACHMENT Figure 2 Primitive trajectory representation and grid division symbol schematic diagram.

[0059] ATTACHMENT Figure 3 Simulation environment depth map and radar point cloud rendering diagram.

[0060] ATTACHMENT Figure 4 Random forest environment navigation and obstacle avoidance effect diagram.

[0061] ATTACHMENT Figure 5 Random obstacle navigation and obstacle avoidance effect diagram.

[0062] ATTACHMENT Figure 6 Hardware platform design diagram.

[0063] ATTACHMENT Figure 7 Real environment autonomous navigation and obstacle avoidance flight trajectory diagram. DETAILED DESCRIPTION

[0064] In view of the deficiencies of the prior art, the present application proposes an innovative end-to-end autonomous navigation solution. This solution discards the traditional explicit map construction and modular processing flow, and integrates perception mapping, path search and trajectory optimization into a unified framework through a deep neural network. This integrated design not only significantly reduces the computational delay, but also better captures the complex relationship between environmental features and motion planning through data-driven methods, providing a more optimal technical implementation path for high-speed autonomous flight of unmanned aerial vehicles in dense obstacle environments.

[0065] In order to overcome the deficiencies of the prior art, the present application aims to propose a single-stage unmanned aerial vehicle trajectory planning method based on deep learning. In terms of system architecture, the multiple independent modules of environmental perception, path search and trajectory optimization in the traditional motion planning process are deeply integrated to form an end-to-end neural network planner. This architecture uses a motion primitive space representation method, and achieves comprehensive coverage and efficient exploration of the solution space through grid space division. The network design is based on an anchor box target detection model, supporting multi-trajectory parallel prediction, significantly improving the computational efficiency while retaining the planning multi-modal characteristics. In terms of training methods, the traditional unmanned aerial vehicle trajectory optimization and deep learning gradient descent are combined to propose an environment gradient guided learning strategy. This method innovatively incorporates gradient information from traditional optimization algorithms directly into the neural network training process, eliminating the dependence on expert data for imitation learning and overcoming the reward sparsity problem in reinforcement learning, achieving planning performance beyond traditional methods. In order to achieve efficient training and effectiveness verification of the proposed method, the present application also proposes an efficient simulation environment construction method and a micro unmanned aerial vehicle hardware system. The simulation system uses a tree random distribution model based on point cloud data, combined with depth camera ray tracing and CUDA parallel computing acceleration techniques, to achieve efficient simulation and depth map generation in complex environments. The hardware platform design is a micro unmanned aerial vehicle with a size of only 7x7 cm and a weight of 356 grams, which can perform complex autonomous flight tasks in limited space. In summary, the proposed algorithm has great application value.

[0066] The application discloses a deep learning-based unmanned aerial vehicle trajectory planning method, and steps are as follows: a three-dimensional independent time parameterized polynomial is used to describe a motion trajectory in a body coordinate system; a group of base elements is defined in advance in a three-dimensional state space to explore the whole search space to realize complete coverage of a feasible region; a multi-modal perception input of a "depth image, current state and target direction" is used, wherein the depth image is obtained by a depth camera; the current state specifically includes speed and acceleration information of the current unmanned aerial vehicle and is obtained from binocular images output by an airborne visual positioning module from the depth camera; the multi-modal perception input is processed by a deep learning network; according to the output of the deep learning network, future expected position, speed and acceleration information are calculated to serve as input of a bottom controller of the unmanned aerial vehicle for trajectory tracking, and finally obstacle avoidance flight in a complex environment is realized.

[0067] Detailed steps are as follows:

[0068] I. A three-dimensional independent time parameterized polynomial is used to describe a motion trajectory in a body coordinate system; the trajectory of each spatial dimension x, y and z is described by a polynomial function f u (t) about time t, x, y and z are uniformly represented as subscript u, and the representation form is as follows:

[0069] f u (t) = a0 + a1t + a2t 2 +a3t 3 +…+a n t n (1)

[0070] Wherein, A = [a0, a1, a2, …, a n ] is a coefficient vector of the polynomial;

[0071] A group of base elements P = {p0, p1, …, p n} is defined in advance in a three-dimensional state space to explore the whole search space to realize complete coverage of a feasible region, so as to avoid that trajectory optimization falls into a suboptimal local minimum value; wherein, each base element p ij is represented as an initial position in the body coordinate system:

[0072]

[0073] Wherein, p ij represents the i x j base element, i and j are base element indexes in horizontal and vertical directions respectively, r is a trajectory planning radius, is a heading angle of the base element p ij , and θ j is a pitch angle of the base element p ij .

[0074] II. The multi-modal perception input of "depth image, current state and target direction" is adopted, wherein the depth image is obtained by a depth camera; the current state can be obtained by an unmanned aerial vehicle vision positioning module from the binocular image output by the depth camera, and the current state specifically includes the speed and acceleration information of the current unmanned aerial vehicle, and is normalized according to the expected maximum flight speed; the target direction is represented by a three-dimensional unit vector of the current unmanned aerial vehicle pointing to the target point, and specifically, the input depth image is divided into a grid structure, M θ respectively represent the number of horizontal and vertical primitives, and each grid is responsible for predicting the trajectory in the corresponding local frustum region; a residual network ResNet-18 is used as the backbone network, which first performs initial feature extraction by a convolutional layer; then 4 stages of residual blocks are stacked, 2 residual blocks in each stage, and the residual block contains a convolutional layer, a batch normalization layer and an activation layer, and a skip connection is used to prevent gradient vanishing or explosion, and finally the image processing is extracted as a feature map of 64x64x64; after the normalization processing of the input speed, acceleration and target direction 9-dimensional state information, it is expanded to and spliced to the feature map to obtain a feature of 64x64x64; on this basis, a 1x1 convolutional layer with weight sharing is used as an output layer to process the image and state features and predict the modal position offset of the primitive, including the heading angle offset pitch angle offset Δθ, trajectory radius offset Δr, speed v, acceleration a, and the score of each trajectory as the original output of the network;

[0075] III. Network prediction post-processing and trajectory generation: in step II, the features of each grid are used to predict the original offset output of the independent primitive in the space by a 1x1 convolutional layer, and post-processing is performed to convert it into the final primitive parameters, including the end state position, speed and acceleration; first, the prediction of the primitive state offset is constrained by the hyperbolic tangent activation function, to generate the horizontal and vertical offset angles and the trajectory length change and Δr, and the adjusted primitive position p′ ij is represented as:

[0076]

[0077] wherein p′ ij , θ′ j r′ ij are the adjusted i x j primitive and the corresponding heading angle, pitch angle and trajectory radius, respectively; secondly, the velocity vector and acceleration vector are predicted from the primitive speed and acceleration, and the original output primitive speed v and acceleration a are first converted to unit vectors by the hyperbolic tangent tanh activation function, and then multiplied by the maximum expected speed and expected acceleration to obtain the actual results:

[0078] v' = tanh(v) v max

[0079] a' = tanh(a) a max (4)

[0080] where v max ,a max are maximum velocity and acceleration, v', a' are the actual results predicted by the network, in this way the velocity and acceleration of flight are constrained to the physically feasible interval, finally, the scores of additional prediction of each trajectory are predicted, which are used to evaluate the safety, smoothness and other indicators of each candidate trajectory, for screening all predictions when executed;

[0081] Four, in the actual operation of the unmanned aerial vehicle, first of all, based on the score value of all the predicted trajectory is sorted and screened, and the candidate trajectory prediction with the highest score is selected for solving; then the boundary value problem solver is calculated polynomial coefficient matrix A = M d, where d = [p0, v0, a0, p', v', a'] is the state vector composed of the initial state and the predicted terminal state, M is a constant mapping matrix for mapping the boundary state to the polynomial coefficient, p0, v0, a0 is the current initial state of the unmanned aerial vehicle, p', v', a' is the network predicted final state position, velocity and acceleration, and finally the T = 2 second time window rolling horizon trajectory is generated, and the discrete reference state sequence is output at a preset fixed frequency, including future position, velocity and acceleration information, so as to control the unmanned aerial vehicle.

[0082] Training process: combine traditional unmanned aerial vehicle trajectory optimization with deep learning gradient descent, and use environmental gradient guidance training method to guide the learning process, the specific steps are as follows:

[0083] Define the cost J as the smoothness, safety, target guidance and other multi-evaluation indicators of the trajectory:

[0084] J = λ s J s + λ o J o + λ g J g (5)

[0085] where J s is the smoothness cost, which is used to constrain the integral of the square of the derivative of the trajectory to avoid excessive maneuver; J o is the safety cost, which is used to punish the distance from the obstacle to ensure that the flight is far away from the obstacle; J g is the target cost, which is used to guide the unmanned aerial vehicle to fly to the target; and each λ is a weight parameter for balancing;

[0086] First, the smoothness J s is defined as the integral of the high-order derivative, which is specifically expressed as:

[0087] J s = d T M T Q M d (6)

[0088] where the Hessian matrix Q represents the relationship between the polynomial coefficients and the high-order derivatives, and d is the block matrix composed of the current state d F = [p0, v0, a0] and the to-be-optimized end state variable d P = [p', v', a'], and on this basis, M T Q M is also expressed as a block matrix B, and the subscripts F and P are blocks corresponding to fixed variables and free variables, so the cost is further expressed as:

[0089]

[0090] Therefore, J s is calculated as the Jacobian matrix of d P :

[0091]

[0092] Then, the safety cost J o of the trajectory away from the obstacle is defined as the time integral of the potential function c(·) about the position p(t):

[0093]

[0094] where p(τ·dt) is the position at the τth discrete time on the trajectory, the potential function c(·) can be an arbitrary function inversely proportional to the distance from the obstacle, and the distance of the trajectory from the nearest obstacle at time t is obtained by querying the point cloud map of the current position p(t) and the environment, so J o The Jacobian matrix in the discrete form is:

[0095]

[0096] where the time matrix T = [(τ·dt) 0 ,(τ·dt) 1 ,…,(τdt) n ], dt is the discrete time sampling interval, τ·dt is the sampling time after discretization, and L p is the right block of the matrix M corresponding to the to-be-optimized variable;

[0097] Finally, in order to make the trajectory reach the target, the target cost is defined as the distance between the trajectory endpoint p' and the target point g, and the target is normalized to ensure numerical stability:

[0098] J g = (p' - g) 2 (11)

[0099] The Jacobian matrix thereof can be simply calculated as:

[0100]

[0101] The numerical gradient of the cost is obtained by querying the environment map or direct calculation, and the gradient is conducted to the predicted output of the deep learning network through the chain rule, and is handed over to the deep learning optimizer for gradient update of network parameters; in addition, in order to screen all predicted trajectories, not only the trajectory parameters are optimized by using the cost, but also the cost of each trajectory is predicted as a score to screen the final feasible trajectory; specifically, the loss function of the score prediction is defined as the smooth absolute error SmoothL1 loss between the true value:

[0102] L = SmoothL1 (score, -J) (13)

[0103] Where score is the trajectory score predicted by the network strategy, this loss is analytical, and the gradient is automatically derived through the deep learning network framework, finally, the adaptive matrix estimation Adam optimizer is used to train the network with manually calculated gradient.

[0104] The method for constructing a simulation environment for a deep learning-based trajectory planning unmanned aerial vehicle, by simulating the distribution of trees in a real environment, a simulation environment with randomness and no boundary restriction is constructed, and deep camera and radar sensor rendering are supported, thereby providing a simulation test platform for research and development in the fields of path planning and obstacle avoidance algorithms of unmanned aerial vehicles, specifically, first, a small amount of point cloud models of trees are constructed in advance, and the random distribution positions and random angles of the trees in the simulation environment are generated based on the Poisson distribution, the generated tree point clouds are moved to the specified positions and superimposed, thereby obtaining an original point cloud data environment containing random tree distribution; then, based on the obtained original point cloud data, a corresponding grid map is constructed, this step can effectively represent the spatial structure in the simulation environment, and provide support for subsequent depth map generation and collision detection;

[0105] After the environment model is constructed, a virtual depth camera model is further constructed, and the depth information of the grid map is collected by using the depth camera model, specifically, by ray tracing technology, the depth camera emits a ray for each pixel point, and the path of the ray is traced to calculate the three-dimensional coordinates of each point on the path:

[0106]

[0107] Where, P c=(X c ,Y c ,Z c ) is the point projected to the camera coordinate system, (u,v) is the point on the camera plane, [f x ,f y ,c x ,c y ] is the camera internal parameter, and then the camera posture [R wc ,t c ]Through the coordinate transformation P w =R wc P c +t c The projection point P under the camera c Transform to world system P w And check the collision relationship, R wc is the rotation matrix, t c Translation matrix, by increasing the projection distance Z c Until the ray intersects with the obstacle in the grid map, the distance between the point where the ray intersects with the obstacle is the depth value of the pixel.

[0108] In order to meet the needs of large-scale simulation environments, a grid remapping mechanism is adopted: when the drone or ray exceeds the effective range of the current grid map, the system will remap the coordinate axis u∈{x,y,z} beyond the map boundary L according to the current drone or ray position information. u The corresponding position P u Remap to P u ’, and map it back to the valid range of the map:

[0109] P u ′=2L u -P u (15)

[0110] This process enables the map of the simulation environment to be expanded into a boundless virtual space.

[0111] The UAV based on deep learning trajectory planning adopts a micro-aircraft flight control and electronic adjustment integrated module and a flight control system, which integrates flight control, sensor data processing and electronic adjustment functions. The positioning module adopts a lightweight multi-state constrained Kalman filter MSCKF based on filtering. The onboard card computer runs a program that implements the UAV trajectory planning method based on deep learning. The binocular image is obtained through the camera for positioning the positioning module; then the state estimation result of the positioning module and the depth of the depth camera are combined. Figure OneAnd give the program running on the card computer of the airborne card, for environment perception and trajectory prediction; after obtaining the polynomial trajectory of the unmanned aerial vehicle, the card computer is used to calculate the expected position, speed and acceleration information in the future as the input of the micro air flight control electric governor integrated module and the flight control system for trajectory tracking, and finally the obstacle avoidance flight in a complex environment is realized.

[0112] The application will be further described in detail below in combination with the drawings and specific examples.

[0113] The single-stage unmanned aerial vehicle trajectory planning method based on deep learning provided by the application mainly consists of a planning algorithm part, a training strategy part, a simulation environment part and a hardware design part, which will be described in detail as follows:

[0114] The first part is the optimization of basic trajectory and the design of neural network structure: in order to solve the problems such as system delay and sensitivity to perception noise caused by the modular design of the existing unmanned aerial vehicle trajectory planning method "perception and mapping-front path search-post trajectory optimization", the application provides an end-to-end unmanned aerial vehicle trajectory planning method based on deep learning, and the overall structure diagram is as shown in the accompanying Figure 1 .

[0115] Specifically, similar to the general unmanned aerial vehicle trajectory planning method, the application uses a three-dimensional independent time parameterized polynomial to describe the motion trajectory in the body coordinate system, and the trajectory of each spatial dimension x, y and z (unified as subscript u) is represented by a polynomial function f u (t) with respect to time t, in the form of:

[0116] f u (t) = a0 + a1t + a2t 2 +a3t 3 +…+a n t n (1)

[0117] Wherein, A = [a0, a1, a2, …, a n ] is the coefficient vector of the polynomial, and this representation method can not only ensure the smoothness of the trajectory, but also facilitate subsequent optimization calculation.

[0118] The application learns from the concept of "motion primitives" in the traditional trajectory optimization method, and a set of primitives P = {p0, p1, …, p n} is defined in the three-dimensional state space in advance to explore the entire search space to achieve complete coverage of the feasible region, so as to avoid the trajectory optimization from falling into a suboptimal local minimum value. Wherein, the initial position of each primitive p ij in the body coordinate system can be represented as:

[0119]

[0120] Among them, p ij Represents the i×jth primitive, i and j are the primitive indices in the horizontal and vertical directions respectively, r is the trajectory planning radius, For primitive p ij The heading angle, θ j For primitive p ij The specific symbol definitions are as follows Figure 2 In addition, this trajectory representation based on preset primitives can be seamlessly connected with anchor-based object detection and achieve efficient trajectory prediction using mature object detection frameworks.

[0121] In terms of network architecture design, the present invention adopts multimodal perception input of "depth image, current state and target direction". Among them, the depth image can be obtained by a depth camera such as Intel RealSense D435, and the resolution is 160×96 in the present invention; the current state can come from the visual positioning module, specifically including the speed and acceleration information of the current drone, and is normalized according to the expected maximum flight speed; the target direction is represented by the three-dimensional unit vector of the current drone pointing to the target point. Specifically, the input image is divided into The grid structure ( M θ Represents the number of horizontal and vertical primitives respectively), each grid is responsible for predicting the trajectory within the corresponding local cone area; in order to effectively extract features and take into account real-time performance, the present invention designs a backbone network based on ResNet-18 (residual network), which first uses a 7×7 convolution kernel and a convolution layer with a stride of 2 for initial feature extraction; then stacks residual blocks in 4 stages, with 2 residual blocks in each stage. The block contains a 3×3 convolution layer, a batch normalization layer and an activation layer, and uses jump connections to prevent gradient disappearance or explosion. Finally, the image processing is extracted dimensional feature map; the input 9-dimensional state information (speed, acceleration, target direction) is expanded to After size and splicing to the feature map, we get dimensional features; on this basis, a weight-shared 1×1 convolutional layer is used as the output layer to process the image and state features and predict the output of the primitive trajectory, such as the offset and score; finally, the direct prediction of the network is parsed into the terminal state (including the final state position, velocity, acceleration) and score of all predicted trajectories through post-processing steps. Dimensional output.

[0122] In terms of network post-processing and trajectory generation, the original output of the network is represented as the end-state offset of each base element trajectory and the velocity and acceleration information (as shown in equations (3)-(4)). Specifically, each grid corresponds to an independent base element in space and outputs three key parameters of position, velocity, and acceleration. First, the prediction of the base element state offset is constrained by the hyperbolic tangent activation function, generating horizontal and vertical offset angles and trajectory length changes and Δr, the adjusted base element position p' ij is represented as:

[0123]

[0124] where p' ij , θ' j r' ij are the adjusted i x j base element and the corresponding heading angle, pitch angle, and trajectory radius. Second, the base element velocity and acceleration prediction outputs the velocity vector and the acceleration vector. Similarly, the original output v, a is first converted to a unit vector by the tanh (hyperbolic tangent) activation function, and then multiplied by the maximum expected velocity and expected acceleration to obtain the actual result:

[0125] v' = tanh(v) · v max

[0126] a' = tanh(a) · a max (4)

[0127] where v max , a max are the maximum velocity and acceleration, and v', a' are the actual results of network prediction. In this way, the speed and acceleration of flight can be constrained to a physically feasible range. Finally, the present application additionally predicts the score of each trajectory, which is used to evaluate the safety, smoothness, and other indicators of each candidate trajectory, so as to screen all predictions when executed.

[0128] Finally, in the actual implementation process, firstly, all the predicted trajectories are sorted and screened based on the score value, and the highest score candidate trajectory prediction is selected for solving. Then the boundary value problem solver is used to calculate the polynomial coefficient matrix A=M·d, wherein d=[p0, v0, a0, p', v', a'] is a state vector composed of the initial state and the predicted terminal state, M is a constant mapping matrix for mapping the boundary state to the polynomial coefficient, p0, v0, a0 are the current initial state of the unmanned aerial vehicle, and p', v', a' are the network predicted final state position, speed and acceleration. This module finally generates a rolling horizon trajectory of T=2 seconds time window, and outputs a discrete reference state sequence at a fixed frequency of 50Hz, including future position, speed and acceleration information. This generation method not only ensures the continuous and smooth characteristics of the trajectory, but also meets the real-time requirements of the actual control system, providing high-quality input reference for subsequent trajectory tracking control.

[0129] The second part is the neural network training method guided by the primitive environment gradient. In the field of robot navigation and control, imitation learning and reinforcement learning are widely used in the training of neural network strategies. Specifically, imitation learning realizes training by defining the loss function as the deviation of the predicted result from the expert trajectory. However, this method has the following problems: on the one hand, it requires additional expert strategies, and the performance upper limit of the network strategy is limited by the performance of the expert strategy; on the other hand, navigation problems are often multi-modal, and the distance from a specific expert cannot reflect the true cost. In contrast, the reinforcement learning method models the environment by training a differentiable evaluation network (Critic Network) to evaluate actions, but it needs to be trained through trial and error, which requires a large amount of data and may not converge accurately, which is particularly serious for complex navigation tasks and systems that need to render sensor observations. To solve the above problems, the present invention combines traditional unmanned aerial vehicle trajectory optimization with deep learning gradient descent, and proposes an environment gradient guided training method to guide the learning process, avoiding the dependence on expert strategies and the large number of trial and error of reinforcement learning.

[0130] Consistent with the traditional unmanned aerial vehicle trajectory optimization method, the cost J is defined as a multi-evaluation index of trajectory smoothness, safety, target guidance, etc.:

[0131] J=λ s J s +λ o J o +λ g J g (5)

[0132] Wherein J s is the smoothness cost, which is used to constrain the integral of the square of the derivative of the trajectory to avoid excessive maneuvering; J oJ is a safety cost that penalizes the distance to obstacles to ensure the flight away from obstacles; J g is a goal cost that guides the UAV to fly towards the goal; each λ is a weight parameter for trade-off.

[0133] First, the smoothness J s is defined as the integral of high-order derivatives, which can be specifically expressed as:

[0134] J s = d T M T Q M d (6)

[0135] where the Hessian matrix Q represents the relationship between polynomial coefficients and high-order derivatives, and d is the current state d F = [p0, v0, a0] and the to-be-optimized final state variable d P = [p', v', a'] consist of a block matrix. On this basis, M T Q M part is also expressed as a block matrix B, and the subscripts F and P are blocks corresponding to fixed variables and free variables, so the cost can be further expressed as:

[0136]

[0137] Therefore, J s is the Jacobian matrix of d P , which can be calculated as:

[0138]

[0139] Then, the safety cost J o of the trajectory away from the obstacle is defined as the time integral of the potential function c(·) about the position p(t):

[0140]

[0141] where p(τ·dt) is the position at the τth discrete time on the trajectory, and the potential function c(·) can be an arbitrary function in inverse proportion to the distance from the obstacle, for example, the potential function c(·) = exp(-d t ), where d t is the distance of the trajectory from the nearest obstacle at time t, which can be obtained by querying the current position p(t) and the point cloud map of the environment. Therefore, J o The Jacobian matrix in the discrete form is:

[0142]

[0143] where the time matrix T = [(τ·dt) 0 ,(τ·dt) 1,…,(τ·dt) n ], dt is the discrete time sampling interval, τ·dt is the discrete sampling time, L p It is the right block in the matrix M corresponding to the variable to be optimized.

[0144] Finally, in order to make the trajectory reach the target, the target cost is defined as the distance between the trajectory end point p′ and the target point g, and the target is normalized to ensure numerical stability:

[0145] J g =(p′-g) 2 (11)

[0146] Its Jacobian matrix can be simply calculated as:

[0147]

[0148] The numerical gradient of the above cost can be obtained by querying the environment map or directly calculating it, and the gradient is transmitted to the predicted output of the network through the chain rule, and handed over to the deep learning optimizer for the gradient update of the network parameters. In addition, in order to screen all predicted trajectories, it is necessary not only to optimize the trajectory parameters using the cost, but also to predict the cost of each trajectory as a score to screen the final feasible trajectory. Specifically, the loss function of the score prediction is defined as the SmoothL1 (smoothed absolute error) loss of the true value:

[0149] L=SmoothL1(score, -J) (13)

[0150] Where score is the trajectory score predicted by the network policy. This loss is analytical and can be automatically differentiated using a deep learning framework. Finally, the network is trained using the Adam (Adaptive Moment Estimation) optimizer with manually calculated gradients.

[0151] Part III, Random Dynamic Simulation Environment Generation and CUDA Parallel Accelerated Rendering: This invention relates to a method for constructing a UAV simulation environment, which is suitable for deep learning simulation and training with high real-time requirements and large data volumes. This invention aims to construct a random and boundless simulation environment by simulating the distribution of trees in a real environment, and supports rendering of common sensors such as depth cameras and radars (see Appendix). Figure 3 ), thus providing an efficient and realistic simulation test platform for research and development in areas such as drone path planning and obstacle avoidance algorithms.

[0152] Specifically, first, a point cloud model of a small number of trees is constructed in advance, and random distribution positions and random angles of the trees in the simulation environment are generated based on a Poisson distribution, the generated tree point cloud is moved to the specified position and superimposed, so as to obtain an original point cloud data environment containing random tree distribution. Then, based on the obtained original point cloud data, a corresponding grid map is constructed, which can effectively represent the spatial structure in the simulation environment and provide support for subsequent depth map generation and collision detection.

[0153] After the environment model is constructed, the virtual depth camera model is further constructed, and the depth information of the grid map is collected by using the depth camera model. Specifically, by using the ray tracing technology, the depth camera emits a ray for each pixel point, and the path of the ray is tracked to calculate the three-dimensional coordinates of each point on the path:

[0154]

[0155] wherein P c =(X c ,Y c ,Z c ) is a point projected into the camera coordinate system, (u,v) is a point on the camera plane, and [f x ,f y ,c x ,c y ] is the camera intrinsic parameter. Then, by using the pose [R wc ,t c ] (rotation matrix R wc and translation t c ) of the camera, the projection point P c in the camera system is transformed into the world system P w by coordinate transformation P w =R wc P c +t c , and the collision relationship is checked. By increasing the projection distance Z c , the ray intersects with the obstacle in the grid map, and at this time, the distance between the point where the ray intersects with the obstacle is the depth value of the pixel. The depth value can reflect the spatial distribution and depth information of the obstacle in the simulation environment, and provide real perception data for the unmanned aerial vehicle obstacle avoidance, navigation and other tasks. It is worth noting that the CUDA parallel computing acceleration technology is used in the present application, and the parallel computing capability of the GPU (graphics processing unit) is used to greatly improve the efficiency of the depth map rendering.

[0156] In order to adapt to the needs of large-scale simulation environment, the application also designs a grid remapping mechanism. When the UAV or the ray exceeds the effective range of the current grid map, the system will remap the coordinate axis u∈{x,y,z} exceeding the map boundary L u The corresponding position P u is remapped to P' u , and it is mapped back to the effective range of the map:

[0157] P' u = 2L u -P u (15)

[0158] This process enables the map of the simulation environment to expand into a virtual space without boundaries, thereby avoiding the limitations of traditional finite maps and enabling more flexible simulation of large-scale flight scenarios.

[0159] Through the above technical solutions, the application can efficiently construct a UAV simulation environment while providing an environment model with strong randomness and dynamic change characteristics. Using CUDA acceleration technology, the application can generate a large number of depth maps as training data in a short time (depth map real-time rendering delay <1ms), and supports large-scale environment simulation, which can be widely applied to simulation testing of UAV path planning, flight control, obstacle avoidance algorithms, etc. Finally, the obstacle avoidance method proposed by the application uses the proposed simulation environment and rendering method to test at 6m / s in a jungle (such as the attached Figure 4 ) and random obstacles (such as the attached Figure 5 ), verifying the high-speed obstacle avoidance capability of the algorithm.

[0160] Fourthly, the design and construction of a micro lightweight autonomous UAV platform:

[0161] To verify the performance of the proposed algorithm on a micro UAV platform with limited computing power, the application provides a 2-inch fully autonomous crossing UAV design (attached Figure 6 ), aiming to realize a low-cost, small-size, lightweight flight platform. The wheelbase of the UAV is only 7x7 cm, and the weight is 356 grams, which can realize efficient and fast flight control in complex and dense environments.

[0162] In terms of hardware, the unmanned aerial vehicle is equipped with Luban Cat 0 card computer, which weighs less than 10 grams, has a size of 69*35 mm, and a cost of less than 300 yuan, which is only 1 / 20 of the current mainstream on-board computing device NVIDIA ORIN NX. Its chip is Rockchip RK3566, which is equipped with a quad-core Cortex-A55 ARM processor and a 1TOPS (trillion operations per second) INT8 (8-bit integer) NPU (neural network processor) with a full load power of less than 15W, providing hardware acceleration support for more compact micro unmanned aerial vehicle platforms. In terms of perception system, the unmanned aerial vehicle is equipped with Intel RealSense D435 depth camera, which has a depth field angle of 87*58 and can provide depth information of less than 10m.

[0163] In terms of flight control and electronic speed controller, the unmanned aerial vehicle uses MicoAir 743 AIO (flight control and electronic speed controller integrated module) flight control system, which integrates flight control, sensor data processing and electronic speed control functions, can simplify hardware layout and reduce system complexity, and supports PX4 open source flight control firmware. The motor selected is Oddity RC 1205 5500KV motor, which carries Qianfeng D51 four-blade propeller, which can provide sufficient thrust to meet the demand of rapid crossing flight. The battery of the unmanned aerial vehicle is configured as a 750mAh format model power battery, which can continuously provide power output in complex environment. The frame is a carbon fiber plate structure based on Oddity RC XI20 self-designed, which has the characteristics of light weight and high strength, can effectively resist external impact and provide good flight stability.

[0164] In terms of software system, the unmanned aerial vehicle uses Ubuntu 20.04 operating system, and the positioning module uses a lightweight filtering-based MSCKF (multi-state constraint Kalman filter) scheme to balance the positioning accuracy and real-time performance under limited on-board computing resources. The planning system is a neural network planner designed by the invention, which can realize direct mapping from depth map to controller input signal. After RKNN (Rockchip Neural Network) deployment and INT8 quantization, the planning and control tasks can be completed on the Rockchip RK3566 chip with a low delay of about 20ms, meeting the real-time requirements. In terms of software process, the invention obtains binocular images through Intel RealSense D435 camera for positioning of MSCKF algorithm; then the state estimation result of the positioning module and the depth information of the depth camera are sent to the planning system for planning and control Figure OneAnd give to neural network, be used to environmental perception and trajectory prediction, after getting the unmanned aerial vehicle polynomial trajectory, can calculate the future expected position, speed and acceleration and other information, as the input of unmanned aerial vehicle bottom controller trajectory tracking, finally realize the obstacle avoidance flight in complex environment.The application successfully realizes the obstacle avoidance flight of flight speed greater than 6m / s in complex jungle environment, fully proves the superior performance of the application in the lightweight unmanned aerial vehicle platform with extremely limited computing resources and complex multi-obstacle environment (such as the attached Figure 7 ).

[0165] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application.

Claims

1. A UAV trajectory planning method based on deep learning, characterized by the following steps: As follows: A three-dimensional independent time-parameterized polynomial is used to describe the motion trajectory in the body coordinate system. By pre-defining a set of primitives in the three-dimensional state space, the entire search space is explored to achieve complete coverage of the feasible area. The multimodal perception input is "depth image, current state, and target direction", where the depth image is obtained by a depth camera; the current state specifically includes the current drone's speed and acceleration information, which is obtained by the onboard visual positioning module from the binocular image output by the depth camera; the multimodal perception input is processed by a deep learning network. Based on the output of the deep learning network, the expected future position, velocity, and acceleration information are calculated and used as the input of the drone's underlying controller for trajectory tracking, ultimately achieving obstacle avoidance flight in complex environments.

2. The deep learning-based UAV trajectory planning method according to claim 1, wherein: The detailed steps are as follows:

1. Use three-dimensional independent time parameterized polynomials to describe the motion trajectory in the body coordinate system. The trajectory of each spatial dimension x, y, and z is expressed by a polynomial function f about time t. u (t), x, y, z are uniformly expressed as subscript u, and the representation is: f u (t)=a0+a1t+a2t 2 +a3t 3 +…+a n t n (1) Where A=[a0,a1,a2,…,a n ] is the coefficient vector of the polynomial; By pre-defining a set of primitive sets P = {p0, p1, ..., p n }, to explore the entire search space to achieve complete coverage of the feasible area to avoid trajectory optimization falling into a suboptimal local minimum, where each primitive p ij The initial position in the body coordinate system is expressed as: Among them, p ij Represents the i×jth primitive, i and j are the primitive indices in the horizontal and vertical directions respectively, r is the trajectory planning radius, For primitive p ij The heading angle, θ j For primitive p ij Pitch angle; Second, the multimodal perception input of "depth image, current state and target direction" is adopted. Among them, the depth image is obtained by the depth camera; the current state can be obtained by the binocular image output from the depth camera by the UAV visual positioning module. The current state specifically includes the speed and acceleration information of the current UAV, and is normalized according to the expected maximum flight speed; the target direction is represented by the three-dimensional unit vector pointing to the target point of the current UAV. Specifically, the input depth image is divided into The grid structure, M θ Represent the number of horizontal and vertical primitives respectively. Each grid is responsible for predicting the trajectory within the corresponding local frustum area. The residual network ResNet-18 is used as the backbone network. It first uses the convolution layer for initial feature extraction. Then, the residual blocks are stacked in 4 stages, with 2 residual blocks in each stage. The residual blocks contain convolution layers, batch normalization layers, and activation layers. Skip connections are used to prevent gradients from disappearing or exploding. Finally, the image processing is extracted as dimensional feature map; the input speed, acceleration, and target direction 9-dimensional state information is normalized and expanded to After size and splicing to the feature map, we get dimensional features; on this basis, a weight-shared 1×1 convolutional layer is used as the output layer to process the image and state features and predict the modal position offset of the primitive, including the heading angle offset The pitch angle offset Δθ, trajectory radius offset Δr, velocity v, acceleration a, and the score of each trajectory are used as the original output of the network; 3. Network prediction post-processing and trajectory generation: In step 2, the features of each grid are predicted using a 1×1 convolutional layer to predict the original offset output of the independent primitive in the space, and then post-processed to convert it into the final primitive parameters, including the final state position, velocity, and acceleration; First, the prediction of the primitive state offset is constrained by the hyperbolic tangent activation function to generate the horizontal and vertical offset angles and the change in trajectory length. Δθ and Δr, the adjusted primitive position p′ ij Expressed as: i j ′=θ j +Δθ j ,r′ ij =r ij +Δr ij Among them, p′ ij , θ′ j ,r′ ij They are the adjusted i×j primitives and the corresponding heading angle, pitch angle, and trajectory radius. Secondly, the output velocity vector and acceleration vector are predicted by the primitive velocity and acceleration. Similarly, the original output primitive velocity v and acceleration a are first converted to unit vectors through the hyperbolic tangent tanh activation function, and then multiplied by the maximum expected velocity and expected acceleration to obtain the actual results: v′=tanh(v)·v max a′=tanh(a)·a max (4) where v max ,a max are the maximum speed and acceleration, v′, a′ are the actual results predicted by the network, and in this way the flight speed and acceleration are constrained to the physically feasible range. Finally, the score of each trajectory is additionally predicted to evaluate the safety, smoothness and other indicators of each candidate trajectory, so as to screen all predictions during execution; 4. During the actual control of the drone, all predicted trajectories are first sorted and screened based on the score value, and the candidate trajectory prediction with the highest score is selected for solution; then the polynomial coefficient matrix A = M·d is calculated through the boundary value problem solver, where d = [p0, v0, a0, p′, v′, a′] is the state vector consisting of the initial state and the predicted terminal state, M is a constant mapping matrix used to map the boundary value state to the polynomial coefficient, p0, v0, a0 is the current initial state of the drone, p′, v′, a′ is the final state position, velocity, and acceleration predicted by the network, and finally a rolling time domain trajectory with a time window of T = 2 seconds is generated and discretized into a reference state sequence at a preset fixed frequency output, including future position, velocity, and acceleration information, to control the drone. Training process: Combine traditional UAV trajectory optimization with deep learning gradient descent and use the environment gradient guided training method to guide the learning process. The specific steps are as follows: The cost J is used to define multiple evaluation indicators such as trajectory smoothness, safety, and target guidance: J=λ s J s +λ o J o +λ g J g (5) Among them J s is the smoothness cost, which is used to constrain the integral of the square of the trajectory derivative to avoid excessive maneuvers; J o is the safety cost, which is used to penalize the distance from obstacles to ensure that the flight stays away from obstacles; J g is the target cost, used to guide the UAV to fly to the target; each λ is a weight parameter used for trade-off; First, the smoothness J s It is defined as the integral of higher-order derivatives, specifically expressed as: J s =d T M T Q Md (6) Among them, the Hessian matrix Q represents the relationship between the polynomial coefficients and the higher-order derivatives, and d is the current state d F =[p0,v0,a0] and the final state variable d to be optimized P =[p′,v′,a′], a block matrix, on this basis, M T The QM part is also expressed as a block matrix B, where the subscripts F and P are the blocks corresponding to fixed variables and free variables. The cost is further expressed as: So, J s Right P The Jacobian matrix of is calculated as: Then, the safety cost J of the trajectory is reduced to keep it away from obstacles. o It is defined as the time integral of the potential function c(v) with respect to the position p(t): Where p(τ·dt) is the position of the trajectory at the τth discrete moment, the potential function c(·) can be any function inversely proportional to the distance to the obstacle, and the distance of the trajectory from the nearest obstacle at time t is obtained by querying the current position p(t) and the point cloud map of the environment. Therefore, J o The Jacobian matrix in discrete form is: Wherein the time matrix T=[(τ·dt) 0 ,(τ·dt) 1 ,…,(τ·dt) n ], dt is the discrete time sampling interval, τ·dt is the discrete sampling time, L p is the right block corresponding to the variable to be optimized in the matrix M; Finally, in order to make the trajectory reach the target, the target cost is defined as the distance between the trajectory end point p′ and the target point g, and the target is normalized to ensure numerical stability: J g =(p′-g) 2 (11) Its Jacobian matrix can be simply calculated as: The numerical gradient of the above cost is obtained by querying the environment map or directly calculating it, and the gradient is transmitted to the predicted output of the deep learning network through the chain rule. It is then handed over to the deep learning optimizer for gradient updating of network parameters. In addition, in order to screen all predicted trajectories, it is necessary not only to optimize the trajectory parameters using the cost, but also to predict the cost of each trajectory as a score to screen the final feasible trajectory. Specifically, the loss function of the score prediction is defined as the smoothed absolute error SmoothL1 loss with the true value: L=SmoothL1(score, -J) (13) Where score is the trajectory score predicted by the network policy. This loss is analytical and automatically differentiated through the deep learning network framework. Finally, the network is trained using the adaptive moment estimation Adam optimizer with manually calculated gradients.

3. A method for constructing a trajectory planning UAV simulation environment based on deep learning, characterized by: By simulating the distribution of trees in a real environment, a random, unbounded simulation environment is constructed, which supports depth camera and radar sensor rendering, thus providing a simulation test platform for research and development in areas such as drone path planning and obstacle avoidance algorithms. Specifically, a point cloud model of a small number of trees is first constructed in advance. The random distribution positions and angles of the trees in the simulation environment are generated based on a Poisson distribution. The generated tree point clouds are moved to the specified location and superimposed to obtain a raw point cloud data environment containing the random tree distribution. Then, based on the obtained raw point cloud data, a corresponding grid map is constructed. This step can effectively represent the spatial structure of the simulation environment and support the subsequent depth map generation and collision detection. After the environment model is built, a virtual depth camera model is further constructed, and the depth camera model is used to collect depth information from the grid map. Specifically, through ray tracing technology, the depth camera is simulated to emit rays to each pixel point, and the path of the ray is traced to calculate the three-dimensional coordinates of each point on the path: Among them, P c =(X c ,Y c ,Z c ) is the point projected to the camera coordinate system, (u,v) is the point on the camera plane, [f x ,f y ,c x ,c y ] is the camera internal parameter, and then the camera posture [R wc ,t c ]Through the coordinate transformation P w =R wc P c +t c The projection point P under the camera c Transform to world system P w And check the collision relationship, R wc is the rotation matrix, t c Translation matrix, by increasing the projection distance Z c Until the ray intersects with the obstacle in the grid map, the distance between the point where the ray intersects with the obstacle is the depth value of the pixel.

4. The method for constructing a trajectory planning UAV simulation environment based on deep learning as claimed in claim 3, wherein: In order to meet the needs of large-scale simulation environments, a grid remapping mechanism is adopted: when the drone or ray exceeds the effective range of the current grid map, the system will remap the coordinate axis u∈{x,y,z} beyond the map boundary L according to the current drone or ray position information. u The corresponding position P u Remap to P u ’, and map it back to the valid range of the map: P u ′=2L u -P u (15) This process enables the map of the simulation environment to be expanded into a boundless virtual space.

5. A UAV based on deep learning trajectory planning, characterized by: A micro-aircraft flight control and electronic adjustment integrated module and a flight control system are used, which integrate flight control, sensor data processing and electronic adjustment functions. The positioning module adopts a lightweight multi-state constrained Kalman filter MSCKF based on filtering. The onboard card computer runs a program that implements the deep learning-based UAV trajectory planning method described in claim 1, and obtains binocular images through a camera for positioning the positioning module; then the state estimation result of the positioning module and the depth map of the depth camera are handed over to the program run by the onboard card computer for environmental perception and trajectory prediction; After obtaining the polynomial trajectory of the drone, the card computer is used to calculate the future expected position, velocity and acceleration information, which is used as input to the micro-aerial flight control electronic adjustment integrated module and the flight control system for trajectory tracking, ultimately achieving obstacle avoidance flight in complex environments.

Citation Information

Cited By

  • Unmanned rotorcraft visual navigation method and system for unknown forest area

    CN121007563A

  • A method and system for visual navigation of a rotorcraft unmanned aerial vehicle in an unknown forest region

    CN121007563B

  • Interference and trajectory learning method based on integrated neural network

    CN121543656A

  • Unmanned aerial vehicle autonomous navigation method and system based on visual guidance

    CN121898407A

  • Real-time trajectory optimization method and system for six-degree-of-freedom fixed-wing aircraft

    CN122044203A