An obstacle avoidance method for unmanned aerial vehicles in unstructured scenes based on digital twinning
By mapping unknown obstacles in real time and constructing a safe flight corridor through a digital twin system, and combining local replanning and spatial adaptive tube MPC, the problems of trajectory replanning and control robustness of UAVs in unknown obstacle environments are solved, achieving high-precision obstacle avoidance and low-energy autonomous navigation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TIANJIN UNIV
- Filing Date
- 2026-04-29
- Publication Date
- 2026-07-21
AI Technical Summary
Existing UAV obstacle avoidance methods struggle to achieve real-time trajectory replanning and safe obstacle avoidance in environments with unknown obstacles, and fixed robustness margins lead to conservative control or an inability to balance obstacle avoidance safety and tracking accuracy.
A digital twin-based obstacle avoidance and spatial adaptive tube model predictive control method for unmanned aerial vehicles (UAVs) is adopted. The method uses a geometric perception digital twin system to map unknown obstacles in real time, constructs a safe flight corridor, and combines local replanning and spatial adaptive tube MPC to achieve synchronization between virtual and physical space and online adjustment of control parameters.
It improves the obstacle avoidance capability of UAVs in unstructured environments, ensures a balance between trajectory tracking accuracy and control energy consumption, reduces the computational burden on physical UAVs, and enhances the real-time performance and reliability of the system.
Smart Images

Figure CN122431370A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of autonomous navigation and intelligent control technology for unmanned aerial vehicles (UAVs), specifically relating to an obstacle avoidance method for UAVs in unstructured scenarios based on digital twins. Background Technology
[0002] With the widespread application of drones in fields such as inspection, logistics delivery, emergency rescue, and security patrol, their autonomous navigation and obstacle avoidance capabilities in complex environments have become one of the key technologies. Most existing drone obstacle avoidance methods rely on static prior maps or global environment models. If unknown obstacles appear during operation, the original reference trajectory is easily rendered invalid, making it difficult to complete local replanning and safe obstacle avoidance in a timely manner.
[0003] Existing digital twin methods typically focus on state synchronization between physical and virtual objects, but they do not adequately consider changes in environmental topology, especially geometric constraints caused by unknown obstacles. As a result, it is difficult to reflect changes in the distribution of obstacles in the physical space in real time in the virtual space, which affects the reliability of subsequent trajectory planning and control decisions.
[0004] Furthermore, existing model predictive control methods typically employ fixed robustness margins and fixed feedback gains. In open areas, fixed robustness margins lead to conservative control and increased energy consumption; in confined areas, fixed robustness margins may fail to balance obstacle avoidance safety and tracking accuracy. Therefore, there is an urgent need for a UAV obstacle avoidance method that can achieve real-time synchronization with environmental geometry, support local safe replanning, and adjust control parameters online according to spatial constraints. Summary of the Invention
[0005] To address the aforementioned issues, this invention provides a digital twin-based method for unmanned aerial vehicle (UAV) obstacle avoidance and spatial adaptive tube model predictive control. By mapping unknown obstacles in the physical space to the virtual space in real time, a safe flight corridor is constructed. Combined with local replanning and spatial adaptive tube MPC, the UAV can achieve safe obstacle avoidance, high-precision trajectory tracking, and low control energy consumption in unstructured environments.
[0006] The technical solution of this invention is: an obstacle avoidance method for unmanned aerial vehicles (UAVs) in unstructured scenarios based on digital twins, comprising the following steps:
[0007] S1. Construct a geometrically perceptual digital twin system;
[0008] A digital twin system is established, comprising physical space, virtual space, data processing module, and application service module. The digital twin system performs high-fidelity mapping of the physical space in the simulation environment, constructing a virtual space that highly corresponds to the physical space in terms of dynamic characteristics, control constraints, and environmental topology, thereby realizing the twin mapping from physical space to virtual space.
[0009] S2. Collect information on unknown obstacles and perform geometric synchronization;
[0010] The depth information of the environment is obtained by the depth sensor on the physical drone; the data processing module extracts the virtual geometric envelope of unknown obstacles based on the depth information and sends it to the virtual space, where the corresponding virtual obstacles are dynamically generated to maintain the topological consistency between the physical space and the virtual space.
[0011] S3. Perform dynamic modeling and discretization of the virtual drone;
[0012] S4. Construct a pseudo-control input and linear prediction model;
[0013] S5. Create a safe flight corridor;
[0014] S6. Perform partial replanning;
[0015] S7. Establish the disturbed system and the error system;
[0016] S8. Construct a robust positive invariant set and apply constraint tightening;
[0017] S9. Constructing a spatial adaptive tube bundle model for predictive control optimization;
[0018] S10, Online execution space adaptive adjustment;
[0019] S11, Output control commands and maintain virtual-real synchronization;
[0020] The replanned reference trajectory and optimal control commands are sent to the physical UAV for execution, while the reference trajectory and control variables are synchronized to the virtual UAV to maintain the consistency of bilateral motion between the physical and virtual spaces.
[0021] Furthermore, step S3 specifically includes:
[0022] The virtual drone is modeled as a six-degree-of-freedom rigid body system, and the system state is defined as follows:
[0023]
[0024] in, It is a position vector; It is the velocity vector; This is the attitude angle vector; The x-axis component represents the position. The position is represented by the y-axis component; The z-axis component represents the position. This refers to the roll angle; The pitch angle; Yaw angle;
[0025] Based on the Newton-Euler equations, the nonlinear dynamic model of the virtual drone is as follows:
[0026]
[0027] in, For virtual drone quality, These are the moments of inertia in the x, y, and z axes, respectively. For total thrust, These are attitude torque inputs for the roll axis, pitch axis, and yaw axis, respectively. This is the acceleration due to gravity.
[0028] Furthermore, step S4 specifically includes:
[0029] Introducing virtual acceleration pseudo-control input:
[0030]
[0031] in, These are control input components in the x, y, and z axes, respectively;
[0032] Define the translation state as Then its continuous-time linear model is:
[0033]
[0034] in, .
[0035] Furthermore, step S5 specifically includes:
[0036] In the virtual space, based on the updated obstacle geometry envelope, a global skeleton path connecting the starting point and the target point is first generated using a front-end path search algorithm:
[0037]
[0038] in, These are path points on the skeleton path;
[0039] For each seed point on the skeleton path Search for the nearest obstacle point:
[0040]
[0041] in, For the set of obstacles A certain obstacle point in the;
[0042] Construct the normal vector of the separating hyperplane Combined with the safety radius of drones Construct half-space safety constraints:
[0043]
[0044] in, Let be the position vector of the UAV in three-dimensional space;
[0045] All locally convex polyhedra connected end to end form a safe flight corridor:
[0046]
[0047] in, For the first A locally convex polyhedron The total number of locally convex polyhedra in the safe flight corridor;
[0048] And constrain the trajectory to the corresponding corridor:
[0049]
[0050] in, For reference trajectory position, For reference trajectory in the 1st The start and end times within a convex polyhedron.
[0051] Furthermore, step S6 specifically includes:
[0052] When an unknown obstacle is detected blocking the original reference trajectory, local replanning is performed under the updated safe flight corridor constraints, and a new local collision-free reference trajectory is generated by B-spline trajectory stitching to ensure the continuity and smoothness of the trajectory in terms of position, velocity and curvature.
[0053] Furthermore, step S7 specifically includes:
[0054] Considering model mismatch and external disturbances, the disturbed system is represented as:
[0055]
[0056] in, It is a bounded, compact set of convex perturbations;
[0057] The corresponding nominal system is:
[0058]
[0059] in, This is the nominal translation state. For nominal control input;
[0060] Define error vector The error system is then:
[0061]
[0062] The closed-loop error system is obtained as follows:
[0063]
[0064] in, Let be the feedback gain matrix, such that the closed-loop matrix satisfies the Hurwitz stability condition.
[0065] Furthermore, step S8 specifically includes:
[0066] Constructing robust positive invariant sets for closed-loop error systems This ensures that the error state always satisfies Constraints on the original state and input constraints Tighten to obtain:
[0067]
[0068] For the first in the safe flight corridor Hyperplane constraints Its tightened boundary is ,in This is the mapping matrix from state to position. It is the first Normal vectors of the hyperplane, It is the first The original boundary values of the hyperplane; thus the nominal position satisfy , A matrix representing safe flight corridors. This represents a vector composed of all tightened boundary values, thus ensuring that the actual disturbed location satisfies the original corridor constraints.
[0069] Furthermore, step S9 specifically includes:
[0070] At any moment For the finite-time optimization problem of nominal system construction:
[0071]
[0072] in, To predict the length of the time domain, It is the reference trajectory corresponding to the endpoint. Let be the integral vector. The state and input weighting matrix, The terminal cost matrix;
[0073] The constraints are:
[0074]
[0075] in, It is a terminal invariant set; This is the tightened set of input constraints;
[0076] Solving for the optimal nominal control input yields the solution. Then, the control input applied to the system is:
[0077] .
[0078] Furthermore, step S10 specifically includes:
[0079] Based on the current safe flight corridor width Online adjustment of tube bundle cross section With feedback gain When the drone is in a confined space, the tube cross-section is reduced and the feedback gain is increased; when the drone is in an open space, the tube cross-section is increased and the feedback gain is reduced, so as to achieve a balance between obstacle avoidance safety, trajectory tracking accuracy and control energy consumption.
[0080] Beneficial effects
[0081] Compared with the prior art, the present invention has the following advantages:
[0082] 1. This invention maps unknown obstacles to virtual space in real time through a geometric synchronization mechanism, which can maintain topological consistency between virtual and real spaces when the environmental topology changes, thereby improving the system's response capability to unknown obstacles.
[0083] 2. This invention transforms the non-convex obstacle avoidance problem into a piecewise linear constraint problem by using a safe flight corridor, which is beneficial to improving the solution efficiency of local replanning and rolling optimization.
[0084] 3. This invention transfers the computationally intensive planning and optimization tasks to the virtual space through a digital twin architecture, reducing the computing power pressure on the physical drone's onboard end and improving the system's real-time performance.
[0085] 4. This invention uses a space-adaptive tube MPC to adjust the tube cross-section and feedback gain online according to the corridor width, thereby improving tracking accuracy in narrow spaces and reducing control energy consumption in open spaces.
[0086] 5. This invention balances obstacle avoidance safety, trajectory smoothness, and control robustness, and is suitable for autonomous navigation tasks involving unknown obstacles in unstructured environments. Attached Figure Description
[0087] Figure 1This is a diagram of the overall architecture of the unknown obstacle avoidance system based on the digital twin system of the present invention.
[0088] Figure 2 This is a schematic diagram of the functional modules of the digital twin system of the present invention.
[0089] Figure 3 This is a diagram illustrating the planning and control architecture of the spatial adaptive tube bundle model predictive control based on the present invention.
[0090] Figure 4 This is a schematic diagram of the safe flight corridor generation mechanism of the present invention.
[0091] Figure 5 This is a schematic diagram of the experimental environment and virtual mapping relationship in an embodiment of the present invention.
[0092] Figure 6 The diagram shows the reference trajectory and trajectory tracking results of the virtual drone and the physical drone in the embodiments of the present invention.
[0093] Figure 7 This is a diagram illustrating the real-time obstacle avoidance and trajectory tracking process of the digital twin system according to an embodiment of the present invention.
[0094] Figure 8 This is a diagram showing the physical drone position tracking error in an embodiment of the present invention.
[0095] Figure 9 This is a virtual drone position tracking error diagram according to an embodiment of the present invention.
[0096] Figure 10 This is a comparison diagram of obstacle avoidance trajectories of the embodiments of the present invention and the comparative method.
[0097] Figure 11 This is a comparison chart of the position tracking errors of the embodiments of the present invention and the comparative methods. Detailed Implementation
[0098] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0099] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0100] This invention provides an obstacle avoidance method for unmanned aerial vehicles (UAVs) in unstructured scenarios based on digital twins. The aim is to design a geometric perception digital twin system for autonomous obstacle avoidance scenarios of quadrotor UAVs in unknown obstacle environments. Based on this system, a local replanning method under safe flight corridor constraints and a spatial adaptive bundle model predictive control strategy are proposed. This enables UAVs to achieve real-time perception of unknown obstacles, virtual-real topology synchronization, safe obstacle avoidance, and high-precision trajectory tracking in unstructured environments. At the same time, the computationally intensive planning and optimization tasks are transferred from physical space to virtual space, thereby reducing the computational pressure on airborne hardware and improving the overall planning and control performance of the system.
[0101] Figure 1 The overall architecture of this invention, based on a digital twin system, for obstacle avoidance is illustrated. The physical UAV and the virtual UAV operate in physical and virtual spaces respectively, interacting through bidirectional data flow. When an unknown obstacle appears in the physical space and blocks the original reference trajectory, the system triggers a geometric synchronization mechanism, mapping the spatial information of the unknown obstacle to geometric constraints in the virtual space. Subsequently, a safe flight corridor is constructed based on the updated virtual environment, and local replanning is performed to generate a collision-free reference trajectory that bypasses the unknown obstacle. Finally, a spatial adaptive bundle model predictive controller tracks and controls this reference trajectory, sending control commands to the physical UAV for execution. This approach transfers the high-load computational tasks of perception, planning, and optimization to the virtual space, improving the real-time performance and control consistency of obstacle avoidance in unknown obstacle scenarios.
[0102] A method for obstacle avoidance in unstructured scenarios using drones based on digital twins includes the following steps:
[0103] S1. Construct a geometrically perceptive digital twin system.
[0104] A digital twin system is established, comprising physical space, virtual space, data processing module, and application service module. The digital twin system performs high-fidelity mapping of the physical space in the simulation environment, constructing a virtual space that highly corresponds to the physical space in terms of dynamic characteristics, control constraints, and environmental topology, thereby realizing the twin mapping from physical space to virtual space.
[0105] Unlike existing digital twin methods that only synchronize states, this invention further integrates the geometric information of unknown obstacles into the virtual space. This allows the virtual space to not only reflect the UAV's motion state but also to reflect changes in obstacles in the physical environment in real time. Leveraging its powerful computing capabilities, the virtual space can rapidly simulate and solve processes such as environment updates, corridor generation, local replanning, and control optimization, thereby transferring high-load computing tasks from the physical space to the virtual space.
[0106] Figure 2 The present invention illustrates four functional modules of the digital twin system. The physical space, serving as the system's execution end, comprises a physical UAV platform and an unstructured environment. The physical UAV carries an onboard computing unit, flight control system, positioning module, and depth camera to collect depth information of unknown obstacles and execute control commands. The virtual space is used to construct a virtual dynamic mirror image consistent with the physical UAV's dynamic parameters and dynamically generates virtual obstacles upon receiving geometric synchronization information, thereby updating the virtual map in real time. The data processing module converts the raw depth data from the physical space into lightweight virtual geometric envelope information and sends it to the virtual space via a communication mechanism to reduce bandwidth overhead. The application service module performs safe flight corridor generation, local trajectory replanning, and spatial adaptive bundle model predictive control solution, serving as the core of the entire system's decision-making and control.
[0107] S2. Collect information on unknown obstacles and perform geometric synchronization.
[0108] The depth information of the environment is obtained by the depth sensor on the physical drone; the data processing module extracts the virtual geometric envelope of unknown obstacles based on the depth information and sends it to the virtual space, where the corresponding virtual obstacles are dynamically generated to maintain the topological consistency between the physical space and the virtual space.
[0109] S3. Perform dynamic modeling and discretization of the virtual drone.
[0110] The virtual drone is modeled as a six-degree-of-freedom rigid body system, and the system state is defined as follows:
[0111]
[0112] in, It is a position vector; It is the velocity vector; This is the attitude angle vector; The x-axis component represents the position. The position is represented by the y-axis component; The z-axis component represents the position. This refers to the roll angle; The pitch angle; This is the yaw angle.
[0113] Based on the Newton-Euler equations, the nonlinear dynamic model of the virtual drone is as follows:
[0114]
[0115] in, For virtual drone quality, These are the moments of inertia in the x, y, and z axes, respectively. For total thrust, These are attitude torque inputs for the roll axis, pitch axis, and yaw axis, respectively. This is the acceleration due to gravity.
[0116] S4. Construct a pseudo-control input and linear prediction model.
[0117] Introducing virtual acceleration pseudo-control input:
[0118]
[0119] in, These are the pseudo-control acceleration components in the x, y, and z axes, respectively.
[0120] Define the translation state as Then its continuous-time linear model is:
[0121]
[0122] in, .
[0123] Figure 3 This paper illustrates the planning and control architecture of the present invention based on spatial adaptive bundle model predictive control. After the physical UAV collects information about unknown obstacles, the geometric envelope is extracted by the data processing module and synchronized to the virtual space. The virtual space constructs a safe flight corridor based on the synchronized geometric constraints and generates a collision-free reference trajectory. Subsequently, the application service module will use the safe flight corridor width parameter. The reference trajectory is input into the spatial adaptive bundle model predictive controller. The virtual end calculates the nominal control input based on the reference trajectory and virtual state, while the physical end generates the actual control input based on physical state feedback, ensuring that the actual trajectory remains within the bundle centered on the nominal trajectory. Furthermore, the system introduces a bilateral synchronization error mechanism to reduce the state deviation between the physical and virtual UAVs, ensuring consistency between virtual and real motion.
[0124] S5. Generate a safe flight corridor.
[0125] The mechanism for generating the safe flight corridor in this invention is as follows: Figure 4 As shown.
[0126] In the virtual space, based on the updated obstacle geometry envelope, a global skeleton path connecting the starting point and the target point is first generated using a front-end path search algorithm:
[0127]
[0128] in, These are path points on the skeleton path;
[0129] For each seed point on the skeleton path Search for the nearest obstacle point:
[0130]
[0131] in, For the set of obstacles A certain obstacle point in the;
[0132] Construct the normal vector of the separating hyperplane Combined with the safety radius of drones Construct half-space safety constraints:
[0133]
[0134] in, Let be the position vector of the UAV in three-dimensional space;
[0135] All locally convex polyhedra connected end to end form a safe flight corridor:
[0136]
[0137] in, For the first A locally convex polyhedron The total number of locally convex polyhedra in the safe flight corridor;
[0138] And constrain the trajectory to the corresponding corridor:
[0139]
[0140] in, For reference trajectory position, For reference trajectory in the 1st The start and end times within a convex polyhedron.
[0141] S6. Perform local replanning.
[0142] When an unknown obstacle is detected blocking the original reference trajectory, local replanning is performed under the updated safe flight corridor constraints, and a new local collision-free reference trajectory is generated by B-spline trajectory stitching to ensure the continuity and smoothness of the trajectory in terms of position, velocity and curvature.
[0143] S7. Establish the disturbed system and the error system.
[0144] Considering model mismatch and external disturbances, the disturbed system is represented as:
[0145]
[0146] in, It is a bounded, compact set of convex perturbations;
[0147] The corresponding nominal system is:
[0148]
[0149] in, This is the nominal translation state. For nominal control input;
[0150] Define error vector The error system is then:
[0151]
[0152] The closed-loop error system is obtained as follows:
[0153]
[0154] in, Let be the feedback gain matrix, such that the matrix satisfies the Hurwitz stability condition.
[0155] S8. Construct a robust positive invariant set and tighten it with constraints.
[0156] Constructing robust positive invariant sets for closed-loop error systems This ensures that the error state always satisfies Constraints on the original state and input constraints Tighten to obtain:
[0157]
[0158] For the first in the safe flight corridor Hyperplane constraints Its tightened boundary is ,in This is the mapping matrix from state to position. It is the first Normal vectors of the hyperplane, It is the first The original boundary values of the hyperplane; thus the nominal position satisfy , A matrix representing safe flight corridors. This represents a vector composed of all tightened boundary values, thus ensuring that the actual disturbed location satisfies the original corridor constraints.
[0159] S9. Constructing a spatial adaptive tube bundle model for predictive control optimization.
[0160] At any moment For the finite-time optimization problem of nominal system construction:
[0161]
[0162] in, To predict the length of the time domain, It is the reference trajectory corresponding to the endpoint. Let be the integral vector. The state and input weighting matrix, The terminal cost matrix;
[0163] The constraints are:
[0164]
[0165] in, It is a terminal invariant set; This is the tightened set of input constraints;
[0166] Solving for the optimal nominal control input yields the solution. Then, the control input applied to the system is:
[0167] .
[0168] S10, Online execution space adaptive adjustment.
[0169] Based on the current safe flight corridor width Online adjustment of tube bundle cross section With feedback gain When the drone is in a confined space, the tube cross-section is reduced and the feedback gain is increased; when the drone is in an open space, the tube cross-section is increased and the feedback gain is reduced, so as to achieve a balance between obstacle avoidance safety, trajectory tracking accuracy and control energy consumption.
[0170] S11, output control commands and maintain virtual-real synchronization.
[0171] The replanned reference trajectory and optimal control commands are sent to the physical UAV for execution, while the reference trajectory and control variables are synchronized to the virtual UAV to maintain the consistency of bilateral motion between the physical and virtual spaces.
[0172] Example:
[0173] This invention uses a quadcopter UAV digital twin obstacle avoidance experimental platform as the verification object. The experimental platform mainly consists of a physical quadcopter UAV, an onboard computing unit, a flight control system, a real-time dynamic differential positioning module, a depth camera, a PC host computer, a wireless communication network, and experimental obstacles. The physical UAV is used to perform actual flight missions, the PC host computer is used to deploy virtual space, data processing modules, and application service modules, and the wireless communication network is used to realize state synchronization, geometric synchronization, and control command transmission between the physical space and the virtual space. The corresponding instruction manual for this embodiment can be found in the user-provided instruction manual template.
[0174] In this embodiment, the digital twin system is deployed on a PC host computer. The virtual space is constructed based on the Gazebo emulator and PX4 software in a loop environment. The physical UAV and the virtual UAV maintain consistency in dynamic parameters such as mass, moment of inertia, and actuator constraints. Through the ROS topic communication mechanism, the state information and environmental geometry information collected by the physical UAV are sent to the virtual space, while the reference trajectory and control commands generated in the virtual space are sent to the physical UAV to achieve bilateral synchronous control.
[0175] like Figure 5 As shown, the experimental environment in this embodiment is a mixed obstacle environment containing both known and unknown obstacles. A Cartesian coordinate system is established with the starting position of the physical UAV as the origin, and the target point is set at (9 m, 0 m). Four cylindrical obstacles are set in the experimental area, two of which are known obstacles, pre-modeled in the virtual space before the flight mission begins; the other two are unknown obstacles, placed near the initial planned path of the UAV to simulate sudden obstacle scenarios in an unstructured environment. During flight, the depth camera on the physical UAV acquires the depth information of the unknown obstacles in real time. The data processing module processes the depth information, extracts the virtual geometric envelope of the unknown obstacles, and synchronously maps it into the virtual space to complete the topology update between the physical and virtual spaces.
[0176] After completing environmental synchronization, the application service module performs trajectory planning based on the updated virtual obstacle map. Specifically, it first generates a global skeleton path based on the start point, end point, and current obstacle distribution; then, it performs free space convexification around seed points on the skeleton path to construct multiple local convex polyhedra, and connects these polyhedra end-to-end to form a safe flight corridor; when an unknown obstacle is detected blocking the original trajectory, the system performs local replanning under the constraints of the updated safe flight corridor, and generates a new local collision-free reference trajectory using trajectory stitching.
[0177] In terms of control implementation, this embodiment deploys spatially adaptive tube MPC controllers at both the virtual and physical UAV ends. The virtual end solves for the nominal control input based on the updated reference trajectory and virtual state to generate the planned motion; the physical end solves for the actual control input based on the real-time state feedback of the physical UAV, ensuring that the physical UAV remains within the tube centered on the nominal trajectory even with modeling errors and external disturbances. Simultaneously, the controller adjusts the tube cross-section size and feedback gain online based on the width of the safe flight corridor: when the UAV enters a narrow area, the tube cross-section is reduced and the feedback gain is increased to enhance trajectory constraint satisfaction; when the UAV enters an open area, the tube cross-section is appropriately increased and the feedback gain is reduced to decrease control energy consumption. Through this approach, a balance between obstacle avoidance safety, trajectory tracking accuracy, and control input smoothness is achieved.
[0178] During the experiment, the physical drone was first manually controlled to take off and reach a predetermined flight altitude, then switched to autonomous control mode and flew towards the target location along a reference trajectory issued by the digital twin system. During flight, when an unknown obstacle entered the perception range, the system triggered geometric synchronization, corridor updates, and local replanning, and issued a new reference trajectory to the physical drone in real time for execution. The real-time operation of the digital twin system in this embodiment is as follows: Figure 7 As shown. By Figure 7 It can be seen that the trajectory planning window, the virtual space window, and the physical space window maintain a high degree of consistency, indicating that the present invention can achieve effective synchronization between physical space and virtual space and real-time execution of trajectory planning results.
[0179] The final result is as follows Figure 6 The reference trajectory, virtual drone trajectory, and physical drone trajectory are shown. (By...) Figure 6 It can be seen that when the original path is blocked by unknown obstacles, the present invention can complete local replanning in a timely manner and generate a smooth reference trajectory that bypasses the unknown obstacles. Both the virtual UAV and the physical UAV can track the reference trajectory well, and the physical UAV does not show obvious trajectory divergence and collision during the obstacle avoidance process. This shows that the geometric perception digital twin obstacle avoidance method and the spatial adaptive tube MPC control strategy proposed in this invention can achieve safe and stable obstacle avoidance flight.
[0180] Figure 8 and Figure 9 The position error results for both physical and virtual UAVs during trajectory tracking are presented. Figure 6It can be seen that although the physical UAV is affected by unmodeled dynamics and airflow disturbances during obstacle avoidance, its position tracking error always remains within the allowable range; the tracking error of the virtual UAV is further reduced, indicating that the spatial adaptive tube MPC control strategy proposed in this invention can effectively suppress the state deviation caused by disturbances and constrain the system state within the tube range corresponding to the robust positive invariant set, thereby ensuring high-precision trajectory tracking control.
[0181] Furthermore, to further verify the effectiveness of the method of the present invention, this embodiment also conducted a comparative experiment with a nonlinear model predictive control method, and the comparison results are as follows: Figure 10 and Figure 11 As shown. By Figure 10 It can be seen that without real-time environmental synchronization and local replanning, the original trajectory of the drone will collide with unknown obstacles; however, with this invention, the system can update the virtual environment and generate a new collision-free trajectory in a timely manner after the appearance of unknown obstacles. Figure 11 As can be seen, compared with the comparison method, the present invention has smaller error fluctuations and smoother trajectory changes in the sharp turning area near obstacles, indicating that the present invention has better spatial adaptability and control accuracy under complex spatial constraints.
[0182] In summary, this embodiment demonstrates that the digital twin system designed in this invention can achieve real-time synchronization of geometric information of unknown obstacles and complete local collision-free replanning based on a safe flight corridor; the proposed spatial adaptive tube MPC control strategy can improve trajectory tracking accuracy, enhance obstacle avoidance safety in narrow spaces, and transfer high-load planning and optimization calculation tasks to virtual space, thereby providing a feasible implementation scheme for autonomous navigation of resource-constrained UAV platforms.
Claims
1. A method for obstacle avoidance in unstructured scenarios using unmanned aerial vehicles (UAVs) based on digital twins, characterized in that, Includes the following steps: S1. Construct a geometrically perceptual digital twin system; A digital twin system is established, comprising physical space, virtual space, data processing module, and application service module. The digital twin system performs high-fidelity mapping of the physical space in the simulation environment, constructing a virtual space that highly corresponds to the physical space in terms of dynamic characteristics, control constraints, and environmental topology, thereby realizing the twin mapping from physical space to virtual space. S2. Collect information on unknown obstacles and perform geometric synchronization; The depth information of the environment is obtained by the depth sensor on the physical drone; the data processing module extracts the virtual geometric envelope of unknown obstacles based on the depth information and sends it to the virtual space, where the corresponding virtual obstacles are dynamically generated to maintain the topological consistency between the physical space and the virtual space. S3. Perform dynamic modeling and discretization of the virtual drone; S4. Construct a pseudo-control input and linear prediction model; S5. Create a safe flight corridor; S6. Perform partial replanning; S7. Establish the disturbed system and the error system; S8. Construct a robust positive invariant set and apply constraint tightening; S9. Constructing a spatial adaptive tube bundle model for predictive control optimization; S10, Online execution space adaptive adjustment; S11, Output control commands and maintain virtual-real synchronization; The replanned reference trajectory and optimal control commands are sent to the physical UAV for execution, while the reference trajectory and control variables are synchronized to the virtual UAV to maintain the consistency of bilateral motion between the physical and virtual spaces.
2. The obstacle avoidance method for unmanned aerial vehicles (UAVs) in unstructured scenarios based on digital twins according to claim 1, characterized in that, Step S3 is as follows: The virtual drone is modeled as a six-degree-of-freedom rigid body system, and the system state is defined as follows: in, It is a position vector; It is the velocity vector; This is the attitude angle vector; The x-axis component represents the position. The position is represented by the y-axis component; The z-axis component represents the position. This refers to the roll angle; The pitch angle; Yaw angle; Based on the Newton-Euler equations, the nonlinear dynamic model of the virtual drone is as follows: in, For virtual drone quality, These are the moments of inertia in the x, y, and z axes, respectively. For total thrust, These are attitude torque inputs for the roll axis, pitch axis, and yaw axis, respectively. This is the acceleration due to gravity.
3. The obstacle avoidance method for unmanned aerial vehicles (UAVs) in unstructured scenarios based on digital twins according to claim 2, characterized in that, Step S4 is as follows: Introducing virtual acceleration pseudo-control input: in, These are control input components in the x, y, and z axes, respectively; Define the translation state as Then its continuous-time linear model is: in, .
4. The obstacle avoidance method for unmanned aerial vehicles (UAVs) in unstructured scenarios based on digital twins according to claim 3, characterized in that, Step S5 is as follows: In the virtual space, based on the updated obstacle geometry envelope, a global skeleton path connecting the starting point and the target point is first generated using a front-end path search algorithm: in, These are path points on the skeleton path; For each seed point on the skeleton path Search for the nearest obstacle point: in, For the set of obstacles A certain obstacle point in the; Construct the normal vector of the separating hyperplane Combined with the safety radius of drones Construct half-space safety constraints: in, Let be the position vector of the UAV in three-dimensional space; All locally convex polyhedra connected end to end form a safe flight corridor: in, For the first A locally convex polyhedron The total number of locally convex polyhedra in the safe flight corridor; And constrain the trajectory to the corresponding corridor: in, For reference trajectory position, For reference trajectory in the 1st The start and end times within a convex polyhedron.
5. The obstacle avoidance method for unmanned aerial vehicles (UAVs) in unstructured scenarios based on digital twins according to claim 4, characterized in that, Step S6 is as follows: When an unknown obstacle is detected blocking the original reference trajectory, local replanning is performed under the updated safe flight corridor constraints, and a new local collision-free reference trajectory is generated by B-spline trajectory stitching to ensure the continuity and smoothness of the trajectory in terms of position, velocity and curvature.
6. The obstacle avoidance method for unmanned aerial vehicles (UAVs) in unstructured scenarios based on digital twins according to claim 5, characterized in that, Step S7 is as follows: Considering model mismatch and external disturbances, the disturbed system is represented as: in, It is a bounded, compact set of convex perturbations; The corresponding nominal system is: in, This is the nominal translation state. For nominal control input; Define error vector The error system is then: The closed-loop error system is obtained as follows: in, Let be the feedback gain matrix, such that the closed-loop matrix satisfies the Hurwitz stability condition.
7. The obstacle avoidance method for unmanned aerial vehicles (UAVs) in unstructured scenarios based on digital twins according to claim 6, characterized in that, Step S8 is as follows: Constructing robust positive invariant sets for closed-loop error systems This ensures that the error state always satisfies Constraints on the original state and input constraints Tighten to obtain: For the first in the safe flight corridor Hyperplane constraints Its tightened boundary is ,in This is the mapping matrix from state to position. It is the first Normal vectors of the hyperplane, It is the first The original boundary values of the hyperplane; thus the nominal position satisfy , A matrix representing safe flight corridors. This represents a vector composed of all tightened boundary values, thus ensuring that the actual disturbed location satisfies the original corridor constraints.
8. The obstacle avoidance method for unmanned aerial vehicles (UAVs) in unstructured scenarios based on digital twins according to claim 7, characterized in that, Step S9 is as follows: At any moment For the finite-time optimization problem of nominal system construction: in, To predict the length of the time domain, It is the reference trajectory corresponding to the endpoint. Let be the integral vector. The state and input weighting matrix, The terminal cost matrix; The constraints are: in, It is a terminal invariant set; This is the tightened set of input constraints; Solving for the optimal nominal control input yields the solution. Then, the control input applied to the system is: 。 9. The obstacle avoidance method for unmanned aerial vehicles (UAVs) in unstructured scenarios based on digital twins according to claim 8, characterized in that, Step S10 is as follows: Based on the current safe flight corridor width Online adjustment of tube bundle cross section With feedback gain When the drone is in a confined space, the tube cross-section is reduced and the feedback gain is increased; when the drone is in an open space, the tube cross-section is increased and the feedback gain is reduced, so as to achieve a balance between obstacle avoidance safety, trajectory tracking accuracy and control energy consumption.