A method for constructing a digital twin flight system for drone swarms
By building a system model of the UAV cluster flight system and loading it into a digital twin system, integrating simulation and control functions, the adaptability and data utilization problems of the UAV cluster flight system in the existing technology in complex environments is solved, and the problem of adaptability and data utilization in complex environments is realized. Higher flight system accuracy and applicability.
Patent Information
- Application Number
- CN202411422781.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-10-12
AI Technical Summary
The simulation subsystem model of the existing drone cluster flight system is simple and cannot adapt to complex environments. The control subsystem cannot effectively utilize real-time data and historical data, which limits the accuracy and applicability of the flight system.
By building a system model of the drone cluster flight system and loading it into a digital twin system, the simulation and control functions of the drone cluster are integrated. Use digital twin systems to optimize parameters and dynamically adjust parameters based on real-time and historical data to improve flight efficiency and maneuverability.
It has achieved the improvement of the complex environment adaptability and data utilization rate of the UAV cluster flight system, improved the accuracy and applicability of the flight system, and optimized the flight trajectory and maneuverability.
Smart Images

Figure CN118938942B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of digital twin technology, and in particular to a method for constructing a digital twin flight system for a drone cluster. Background Art
[0002] Due to its advantages of collaborative operation, high efficiency and strong flexibility, drone swarms have shown great potential and advantages in many fields such as drone transportation and intelligent traffic monitoring. With the increase in application scenarios, drone swarms need to continuously improve their environmental adaptability to cope with various complex environments. This development trend has put forward higher requirements for drone swarm flight systems. At present, drone swarm flight systems mainly rely on two subsystems: simulation subsystem and control subsystem, but both subsystems have some defects and limitations, as follows:
[0003] First, although the physical characteristics of the UAV model in the existing simulation subsystem are relatively complete, the UAV model in the simulation subsystem is relatively simple and provides limited geographical environment information, which cannot adapt to modeling in complex environments;
[0004] Secondly, the existing control subsystem can only play a one-way control role on the physical entity. The collected attitude feedback information has not formed a good information sharing mechanism with the simulation subsystem. The data utilization rate is low and real-time data and historical data cannot be fully utilized. This limits the accuracy and applicability of the control subsystem in predicting and analyzing the actual behavior of the UAV swarm flight system.
[0005] Therefore, it is necessary to propose a solution to improve one or more problems existing in the above-mentioned related technical solutions.
[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0007] The present application provides a method for constructing a digital twin flight system of a drone cluster, the method comprising the following steps:
[0008] Constructing a system model of a UAV swarm flight system, wherein the system model includes a plurality of UAV geometric models, a UAV swarm geometric model, and a flight environment geometric model;
[0009] Construct a digital twin system, load the system model into the digital twin system, and complete the recording, simulation, retrieval and control of all real drones in the digital twin system to obtain a digital twin flight system;
[0010] The digital twin flight system is used to construct a parameter optimization scheme for the system model, and the parameter optimization scheme is dynamically adjusted according to real-time data and historical data.
[0011] In an exemplary embodiment of the present application, the step of constructing a system model of a drone swarm flight system includes:
[0012] Modeling the plurality of real drones using three-dimensional modeling software to obtain a plurality of drone geometric models, wherein the plurality of drone geometric models include a pilot drone and a plurality of follower drones;
[0013] Using artificial potential field method to construct the UAV cluster geometric model;
[0014] Using the aerial photography data of all the real UAVs to construct the flight environment geometric model;
[0015] The flight environment geometric model includes the flight environment between all the UAV geometric models and the target point, and the flight environment between all the UAV geometric models.
[0016] In an exemplary embodiment of the present application, the step of modeling the plurality of real drones using three-dimensional modeling software to obtain the plurality of drone geometric models includes:
[0017] respectively obtaining specific parameters of all components of each of the real drones;
[0018] According to all the specific parameters, in the three-dimensional modeling software, all the components in each of the real drones are modeled to obtain multiple component models;
[0019] Combining all the component models of each real drone respectively to form multiple drone models;
[0020] All the drone models are detected and rendered using three-dimensional rendering software to obtain a plurality of the drone geometric models.
[0021] In an exemplary embodiment of the present application, the step of constructing the UAV cluster geometric model using the artificial potential field method includes:
[0022] In the earth coordinate system, all the UAV geometric models are combined into a UAV cluster formation model. In the UAV cluster formation model, one UAV geometric model is selected as the pilot UAV, and the remaining UAV geometric models are all used as the follower UAVs.
[0023] The artificial potential field method is introduced, all the UAV geometric models and all the obstacles are regarded as charged particles respectively, the potential energy between all the UAV geometric models and the target point is regarded as the gravitational potential energy field, the potential energy between all the UAV geometric models and all the obstacles is regarded as the repulsive potential energy field, and the comprehensive potential energy field is obtained according to the gravitational potential energy field and the repulsive potential energy field;
[0024] Utilizing the comprehensive potential energy field to perform path planning on all the UAV geometric models, and constructing the UAV cluster geometric model;
[0025] Among them, in the drone cluster formation model, for any drone geometric model, all other drone geometric models except itself are regarded as obstacles.
[0026] In an exemplary embodiment of the present application, the matrix expression of the drone cluster formation model is:
[0027] (1)
[0028] in, Represents the matrix form of the UAV cluster formation model, Indicates the pilot drone, Indicates The distance between the following drone and the pilot drone, Indicates The vertical angle between the follower drone and the pilot drone. Indicates The horizontal angle between the follower drone and the pilot drone;
[0029] In the earth coordinate system, The coordinates of the following drone are , the coordinates of the pilot drone are , No. The expression for the relationship between the coordinates of the following UAV and the coordinates of the pilot UAV is:
[0030] (2)
[0031] in, Indicates The following drone is in the earth coordinate system The coordinates of the axes, Indicates The following drone is in the earth coordinate system The coordinates of the axes, Indicates The following drone is in the earth coordinate system The coordinates of the axes, Indicates that the pilot drone is in the earth coordinate system The coordinates of the axes, Indicates that the pilot drone is in the earth coordinate system The coordinates of the axes, Indicates that the pilot drone is in the earth coordinate system The coordinates of the axis.
[0032] In an exemplary embodiment of the present application, the expression of the comprehensive potential energy field is:
[0033] (3)
[0034] in, represents the comprehensive potential energy field, represents the gravitational potential energy field, represents the position of the UAV geometric model in the flight environment, , represents the gravitational gain coefficient, , Indicates the location of the target point in the flight environment, Indicates the distance between the UAV geometric model and the target point, represents the repulsive potential energy field, , represents the repulsion gain coefficient, Indicates the flight environment The location of the obstacle, Represents the distance between the UAV geometric model and obstacles in the flight environment. It indicates the boundary distance of the geometric model of the drone in the flight environment where the repulsive force of obstacles is applied. represents the number of obstacles, ;
[0035] The negative gradient of the comprehensive potential energy field is expressed as:
[0036] (4)
[0037] in, represents the negative gradient of the integrated potential energy field, represents the negative gradient of the gravitational potential energy field, , represents the gradient operator, represents the unit direction vector of gravity, represents the negative gradient of the repulsive potential energy field, , The unit direction vector representing the repulsive force;
[0038] The unit direction vector of the gravitational force is the position of the geometric model of the UAV in the flight environment. Point to the location of the target point The unit direction vector of the repulsive force is given by The location of the obstacle Point to the location of the drone geometry model .
[0039] In an exemplary embodiment of the present application, the step of constructing the flight environment geometric model using the aerial photography data of all the real drones includes:
[0040] The flight altitude of all the real drones during filming is always kept at more than 12 meters above the building, and the aerial photography data includes multiple photos, and the overlap rate of all the photos is greater than 75%;
[0041] Performing three-dimensional modeling processing on all the photographs using three-dimensional real-scene modeling software to obtain a plurality of model blocks;
[0042] All the model blocks are spliced together using three-dimensional geometry processing software to obtain the flight environment geometry model.
[0043] In an exemplary embodiment of the present application, the steps of building a digital twin system and loading the system model into the digital twin system include: using C++ language and QT software to write the system framework of the digital twin system, and using OpenGL and the third-party open source library Assimp to complete the deployment of the three-dimensional picture display function in the system framework, building the digital twin system, and loading the system model into the digital twin system.
[0044] In an exemplary embodiment of the present application, the steps of recording, simulating, retrieving and controlling all real drones in the digital twin system to obtain a digital twin flight system include:
[0045] The sub-steps of recording all the real drones include:
[0046] Building a MySQL database, wherein the MySQL database includes the total amount of data storage, the type of data storage and the meaning of data storage;
[0047] The total amount of data storage includes the number of all the UAV geometric models in the UAV cluster geometric model;
[0048] The data storage type includes the pilot drone and the follower drone;
[0049] The data storage means including a real drone state data table and a virtual drone state data table corresponding to each drone geometric model;
[0050] The fields in the real drone status data table include: real drone number, real yaw angle, real pitch angle, real roll angle, real drone position coordinates and real axis speed coordinates;
[0051] The fields in the virtual drone status data table include: virtual drone number, virtual yaw angle, virtual pitch angle, virtual roll angle, virtual drone position coordinates and virtual axis speed coordinates;
[0052] The sub-steps of simulating all the real drones include:
[0053] Create a new child thread using the QThread class of the QT software, initialize the Mavlink protocol parser in the child thread, establish a connection with the MySQL database, and use QMutex for data synchronization and protection;
[0054] When the Mavlink protocol parser is used to parse the Mavlink protocol, the received data stream is parsed using the mavlink_parse_char function, and the obtained Mavlink data is passed to the corresponding processing function for subsequent processing;
[0055] When performing the MySQL database operation, the QsqlDatabase class of the QT software is used to establish a connection with the MySQL database, an SQL statement is constructed according to the Mavlink data obtained by the parsing process, and is executed through the QsqlQuery object;
[0056] The sub-steps of performing the retrieval on all the real drones include:
[0057] Initialize the MySQL database, add a connection to the MySQL database through the static addDatabase provided by the QsqlDatabase class, and specify the use of the MySQL driver;
[0058] The host name, database name, user name and password of the MySQL database are respectively set through multiple instance methods of the QsqlDatabase class to complete the configuration of the connection to the MySQL database;
[0059] Call the Open method to establish a connection with the MySQL database, and use the QsqlQuery object to execute SQL queries;
[0060] Traversing the results of the SQL query, including searching the results of the SQL query one by one through the next method;
[0061] Use the interface design component of the QT software to create multiple corresponding controls, use the Owidget instance as the window, and use QVBoxLayout to vertically stack all the controls; for each data display area, use QLabel to display the field name, and use QlineEdit as the data display; use the addWidget method to add the label and text box to the layout manager;
[0062] When the required data is retrieved from the MySQL database, the retrieved data is filled into the QlineEdit using the setText method;
[0063] The sub-steps of controlling all the real drones include:
[0064] In the QT software, a slot function is connected by clicking a signal to issue multiple commands. The slot function is written in accordance with the Ma v link protocol;
[0065] All the commands are sent to the corresponding UAV geometric models through the User Datagram Protocol, and all the UAV geometric models perform corresponding actions after receiving the commands.
[0066] In an exemplary embodiment of the present application, the steps of using the digital twin flight system to construct a parameter optimization scheme for the system model and dynamically adjusting the parameter optimization scheme according to real-time data and historical data include:
[0067] Using the gravitational gain coefficient , the repulsion gain coefficient The distance from the boundary , construct the parameter optimization scheme;
[0068] The expression of the parameter optimization scheme is:
[0069] (5)
[0070] in, represents the change in the gravitational gain coefficient, represents the decision weight of the gravity empirical model, represents the empirical model of gravity, represents the decision weight of gravity historical data, represents the historical data of gravity, represents the gravitational disturbance factor, Represents the change in the repulsion gain coefficient, represents the decision weight of the repulsive empirical model, represents the empirical model of repulsion, represents the decision weight of the repulsive historical data, Represents the historical data of repulsion, Represents the repulsive interference factor, represents the change in the boundary distance, represents the decision weight of the boundary distance model, represents the boundary distance model, represents the decision weight of the boundary distance historical data, Represents historical data of boundary distance, Represents the boundary distance interference factor.
[0071] Beneficial effects:
[0072] The present application provides a method for constructing a digital twin flight system of a drone cluster, which has at least the following beneficial effects:
[0073] (1) This application integrates the two functions of simulation and control by constructing a system model and a digital twin system of a UAV swarm flight system and loading the system model into the digital twin system. The simulation function is used to provide a virtual scene of UAV swarm flight containing rich geographic information, and the control function is used to collect attitude feedback information and form a good information sharing mechanism with the simulation function, thereby improving data utilization;
[0074] (2) This application improves the flight efficiency of the UAV swarm formation and optimizes the flight trajectory and maneuverability of the UAV swarm formation by constructing a parameter optimization scheme for the system model and being able to adjust the parameter optimization scheme in real time based on real-time data and historical data. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0076] Figure 1 A schematic diagram showing the steps of a method for constructing a digital twin flight system of a drone cluster in an exemplary embodiment of the present application;
[0077] Figure 2 A schematic diagram showing a pilot drone and two follower drones in an exemplary embodiment of the present application;
[0078] Figure 3 A schematic diagram showing a drone cluster formation model in an earth coordinate system in an exemplary embodiment of the present application;
[0079] Figure 4 A schematic diagram showing the relative position relationship between a pilot drone and two follower drones in an exemplary embodiment of the present application;
[0080] Figure 5 A schematic diagram showing a process of constructing a UAV cluster geometric model using an artificial potential field method in an exemplary embodiment of the present application;
[0081] Figure 6 A schematic diagram of the flight trajectory of a drone cluster formation model in which no parameter optimization scheme is constructed and the parameter optimization scheme cannot be dynamically adjusted in an exemplary embodiment of the present application is shown;
[0082] Figure 7 A schematic diagram of the flight trajectory of a drone cluster formation model in which a parameter optimization scheme is constructed and the parameter optimization scheme is dynamically adjusted in an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0083] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0084] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0085] To this end, this example implementation provides a method for constructing a digital twin flight system of a drone cluster, such as Figure 1 As shown, the method may include the following steps:
[0086] Step S101: construct a system model of the UAV cluster flight system, where the system model includes multiple UAV geometric models, a UAV cluster geometric model, and a flight environment geometric model.
[0087] Step S102: Build a digital twin system, load the system model into the digital twin system, and complete the recording, simulation, retrieval and control of all real drones in the digital twin system to obtain a digital twin flight system.
[0088] Step S103: Utilize the digital twin flight system to build a parameter optimization plan for the system model, and dynamically adjust the parameter optimization plan based on real-time data and historical data.
[0089] The present application embodiment proposes a method for constructing a digital twin flight system of a drone cluster, which has at least the following beneficial effects:
[0090] (1) This application integrates the two functions of simulation and control by constructing a system model and a digital twin system of a UAV swarm flight system and loading the system model into the digital twin system. The simulation function is used to provide a virtual scene of UAV swarm flight containing rich geographic information, and the control function is used to collect attitude feedback information and form a good information sharing mechanism with the simulation function, thereby improving data utilization;
[0091] (2) This application improves the flight efficiency of the UAV swarm formation and optimizes the flight trajectory and maneuverability of the UAV swarm formation by constructing a parameter optimization scheme for the system model and being able to adjust the parameter optimization scheme in real time based on real-time data and historical data.
[0092] Below, the method for constructing a digital twin flight system of a drone cluster proposed in this example embodiment will be described in more detail.
[0093] The simulation subsystem in the existing UAV swarm flight system is relatively simple, provides limited geographical environment information, and cannot adapt to modeling in complex environments. The control subsystem in the UAV swarm flight system can only play a one-way control role on the physical entity, and the collected attitude feedback information has not formed a good information sharing mechanism with the simulation subsystem. The data utilization rate is low and real-time and historical data cannot be fully utilized. This limits the accuracy and applicability of the control subsystem in predicting and analyzing the actual behavior of the UAV swarm flight system.
[0094] This actually creates two problems: the first problem is how to quickly establish a system model of the drone swarm flight system that can adapt to complex environments, and efficiently load and simulate the system model; the other problem is how to make full use of the real-time and historical data of the drone swarm to optimize the flight parameters, thereby improving the flight efficiency of the drone swarm formation, and optimizing the flight trajectory and maneuverability of the drone swarm formation.
[0095] To this end, this application introduces digital twin technology and proposes a method for constructing a digital twin flight system for a drone swarm, providing a new perspective for solving the above problems.
[0096] In step S101 of this embodiment, a system model of the drone swarm flight system is constructed, and the system model includes a plurality of drone geometric models, a drone swarm geometric model, and a flight environment geometric model. Step S101 of this embodiment includes the following sub-steps:
[0097] Sub-step S1011: Figure 2 As shown, multiple real drones are modeled using 3D modeling software to obtain multiple drone geometric models. In this embodiment, the multiple drone geometric models include a pilot drone and two follower drones, namely, follower drone No. 1 and follower drone No. 2.
[0098] In this embodiment, the 3D modeling software is preferably SolidWorks. First, it is necessary to accurately measure multiple real drones to obtain the specific parameters of each component of each real drone, such as the size of each component; second, based on all the specific parameters obtained, all the components in each real drone are modeled in SolidWorks to obtain multiple component models; third, all the component models in each real drone are combined to form multiple drone models; finally, all drone models are tested and rendered using 3D rendering software to obtain multiple drone geometric models.
[0099] Furthermore, the detection of all drone models includes: performing motion detection and interference detection on all drone models, testing whether there is any path conflict or mutual obstruction between the propeller and the drone model during flight, and finally obtaining multiple drone geometric models.
[0100] Furthermore, SolidWorks only creates a simple mechanical structure of a drone model without textures and lighting, so it is necessary to use professional 3D rendering software. In this embodiment, Cinema4D software (referred to as C4D software) is preferably used to perform 3D rendering of all drone models. First, use SolidWorks to package the drone model as a whole and export it in STL format. In order to ensure that the export and import of the drone model are normal, the version of Cinema4D software needs to be slightly higher than SolidWorks.
[0101] Furthermore, in this embodiment, the version of the 3D modeling software used is SolidWorks2019; the version of the 3D rendering software used is Cinema4DR25.
[0102] Furthermore, in this embodiment, the drone cluster formation model includes three drone geometric models, one of which is a pilot drone, and the other two are follower drones, namely, follower drone No. 1 and follower drone No. 2.
[0103] In order to make it easier to distinguish these drone geometric models, the entire fuselage of all drone geometric models uses the same texture, and different parts are no longer subdivided. Here, taking the green camouflage texture as an example, first, import the drone model in STL format into the C4D software; then, create a new material in the C4D software, click the texture file, select the camouflage picture, and select a simpler UVW map for projection. Next, adjust the UV parameters appropriately, with the offset U being 12% and the offset V being 8%. In the ambient light, set the global illumination intensity to 60%, and the global illumination intensity to 60%; finally, assign the material to all drone models to construct multiple drone geometric models.
[0104] Sub-step S1012: Figure 3 and Figure 4 As shown in the figure, the geometric model of UAV cluster is constructed using the artificial potential field method.
[0105] First, establish a global coordinate system, in which all the UAV geometric models are combined into a UAV cluster formation model. In the UAV cluster formation model, select one UAV geometric model as the pilot UAV, and the remaining UAV geometric models are all used as follower UAVs. Figure 3 middle, It means that No. 1 follows the drone. It means that No. 2 is following the drone. Indicates pilot drone.
[0106] Furthermore, all follower drones calculate their expected positions in the drone swarm formation model according to the position of the pilot drone, which can effectively ensure the overall flight state of the drone swarm formation model. Here, the pilot drone only needs to fly towards the target point and adjust the flight speed according to the specific situation, while all follower drones need to switch formations according to the position of the pilot drone and maintain stable flight.
[0107] Furthermore, the matrix expression of the UAV cluster formation model is:
[0108] (1)
[0109] in, Represents the matrix form of the UAV cluster formation model, Indicates the pilot drone, Indicates The distance between the following drone and the pilot drone, Indicates The vertical angle between the follower drone and the pilot drone. Indicates The horizontal angle between the follower drone and the pilot drone.
[0110] In the Earth coordinate system, The coordinates of the following drone are , the coordinates of the pilot drone are , No. The relationship between the coordinates of the following UAV and the coordinates of the pilot UAV is expressed as:
[0111] (2)
[0112] in, Indicates The following drone is in the earth coordinate system The coordinates of the axes, Indicates The following drone is in the earth coordinate system The coordinates of the axes, Indicates The following drone is in the earth coordinate system The coordinates of the axes, Indicates that the pilot drone is in the earth coordinate system The coordinates of the axes, Indicates that the pilot drone is in the earth coordinate system The coordinates of the axes, Indicates that the pilot drone is in the earth coordinate system The coordinates of the axis.
[0113] Although the flight mode of the pilot drone and multiple follower drones can keep the flight mode of the drone cluster formation model for all drone geometric models, it cannot solve the mutual collision problem of all drone geometric models in the drone cluster formation model. Therefore, the artificial potential field method is introduced to regard all drone geometric models and all obstacles as charged particles, the potential energy between all drone geometric models and the target point as the gravitational potential energy field, and the potential energy between all drone geometric models and all obstacles as the repulsive potential energy field. The comprehensive potential energy field is obtained based on the gravitational potential energy field and the repulsive potential energy field. The artificial potential field method simply introduces gravity and repulsion, so it has low control requirements, occupies less resources, has good robustness, and is relatively smooth for the path planning of the drone cluster formation model.
[0114] Furthermore, for the repulsive potential energy field, when the distance between the UAV geometric model and the obstacle increases, the repulsive force between the two will be weakened accordingly, that is, the farther the distance between the two is, the lower the function value of the repulsive potential energy field will be; on the contrary, the closer the distance between the two is, the larger the function value of the repulsive potential energy field will be. The function value of the repulsive potential energy field is negatively correlated with the distance between the UAV geometric model and the obstacle. Such a design can ensure that all UAV geometric models can effectively avoid obstacles.
[0115] Furthermore, for the gravitational potential energy field, when the distance between the UAV geometric model and the target point decreases, the gravitational force between the two will be weakened accordingly, that is, the closer the distance between the two is, the lower the function value of the gravitational potential energy field will be. On the contrary, the farther the distance between the two is, the larger the function value of the gravitational potential energy field will be. The function value of the gravitational potential energy field is positively correlated with the distance between the UAV geometric model and the obstacle. Such a design helps to guide all UAV geometric models to fly towards the target point.
[0116] Furthermore, the comprehensive potential energy field of the flight environment where the UAV geometric model is located is the synthetic effect of the gravitational potential energy field and the repulsive potential energy field, and the flight direction of the UAV geometric model points from high potential energy to low potential energy. The flight path planned according to the artificial potential field method can effectively avoid obstacles and ensure that the UAV geometric model reaches the target point smoothly.
[0117] Furthermore, when the UAV swarm formation model is flying, the flight altitudes of all UAV geometric models are almost the same, and under the action of the artificial potential field method, the flight mode of the UAV swarm formation model pays more attention to the overall coordination and the smoothness of the flight trajectory, and is less sensitive to altitude information, so the altitude factor can be ignored.
[0118] The expression of the comprehensive potential energy field is:
[0119] (3)
[0120] in, represents the comprehensive potential energy field, represents the gravitational potential energy field, represents the position of the UAV geometric model in the flight environment, , represents the gravitational gain coefficient, , Indicates the location of the target point in the flight environment, Indicates the distance between the UAV geometric model and the target point, represents the repulsive potential energy field, , represents the repulsion gain coefficient, Indicates the flight environment The location of the obstacle, Represents the distance between the UAV geometric model and obstacles in the flight environment. It indicates the boundary distance of the geometric model of the drone in the flight environment where the repulsive force of obstacles is applied. represents the number of obstacles, .
[0121] The expression of the negative gradient of the comprehensive potential energy field is:
[0122] (4)
[0123] in, represents the negative gradient of the integrated potential energy field, represents the negative gradient of the gravitational potential field, , represents the gradient operator, represents the unit direction vector of gravity, represents the negative gradient of the repulsive potential energy field, , The unit direction vector representing the repulsive force.
[0124] Here, the unit direction vector of gravity is the position of the UAV geometric model in the flight environment Point to the target point The unit direction vector of the repulsive force is given by the first The location of the obstacle Point to the location of the drone geometry .
[0125] Finally, the comprehensive potential energy field is used to plan the paths of all UAV geometric models and construct a UAV cluster geometric model.
[0126] It should be noted that in the UAV swarm formation model, obstacles refer to: for any UAV geometric model, all other UAV geometric models except itself are regarded as obstacles.
[0127] The whole process of constructing the UAV cluster geometric model using the artificial potential field method is as follows: Figure 4 and Figure 5 shown.
[0128] Depend on Figure 4 It can be seen that with the introduction of the artificial potential field method, a pilot UAV is responsible for the navigation and decision-making of the entire UAV swarm formation model. Its key role is to indicate the flight direction for the entire UAV swarm formation model and formulate action strategies. At the same time, other follower UAVs all play the role of followers. The UAV swarm formation model uses the artificial potential field method to intelligently adjust its own actions. This adjustment strategy not only takes into account the surrounding environmental factors, but also the flight trajectory and flight behavior of the pilot UAV.
[0129] like Figure 5 As shown, the whole process is as follows:
[0130] The first step is to determine the relative positions of a leading drone and two following drones in the drone cluster formation model. Figure 4 It can be seen that the entire UAV cluster formation model is coordinated through the artificial potential field method to form a cluster mode with a stable structure. Figure 4 In the figure, each connecting line represents the interaction between the corresponding UAV geometric models, that is, these connecting lines depict how a following UAV is affected by the artificial potential field generated by the other two UAV geometric models in the UAV swarm formation model. Finally, the UAV swarm formation model relies on this flight mode to form a predetermined triangular formation, and the three UAV geometric models fly towards the target point in a coordinated manner.
[0131] In the second step, the expected position vectors of each UAV geometric model and the two adjacent UAV geometric models in the UAV cluster formation model are calculated respectively, and the expected position vectors of the two adjacent UAV geometric models of each UAV geometric model are added respectively.
[0132] The third step is to initialize an array to store the position coordinates of all UAV geometric models in the UAV cluster formation model during the iteration process.
[0133] In the fourth step, the straight-line distance between every two adjacent UAV geometric models is set as an array, which is used to record the distance information.
[0134] The fifth step is to iteratively calculate the straight-line distance between every two adjacent UAV geometric models in the UAV cluster formation model.
[0135] In the sixth step, the comprehensive potential energy field between each UAV geometric model and the two adjacent UAV geometric models, as well as the negative gradient of the comprehensive potential energy field, are calculated respectively, and the calculation results are stored in the corresponding array.
[0136] In the seventh step, based on the distance between the ideal position coordinates and the current position coordinates of each UAV geometric model and the expected position vector calculated in the second step, it is determined whether each UAV geometric model has reached the predetermined position, and the moving step size of the pilot UAV is adjusted accordingly.
[0137] In the eighth step, based on the current position coordinates, gravitational gain and repulsive gain of each UAV geometric model, the coordinate position of the next step of each UAV geometric model is calculated respectively.
[0138] Step 9: Repeat the process from step 5 to step 8 until the drone cluster formation model successfully reaches the target point.
[0139] Sub-step S1013: construct a flight environment geometric model using the aerial photography data of all real drones.
[0140] In this embodiment, first, using the five oblique cameras mounted on each real drone, when shooting in a specific area, it is required that the flight altitude of all real drones when shooting is always maintained at more than 12 meters above the building. The aerial photography data includes multiple photos, and the overlap rate of all photos is greater than 75%.
[0141] Secondly, three-dimensional real-scene modeling software is used to perform three-dimensional modeling on all the photographs to obtain multiple model blocks.
[0142] Furthermore, after obtaining all the photographs, it is necessary to use 3D real scene modeling software to perform 3D modeling on these photographs. In this embodiment, the 3D real scene modeling software is preferably Context Capture software. The specific process is:
[0143] The first step is to create a new project in the Context Capture software, import all the photos into the Context Capture software, and calculate the aerial triangulation. The Context Capture software background uses an internal algorithm to match the common feature points between all the photos and generate a rough sparse point cloud.
[0144] In the second step, click Reconstruct after the calculation is completed. The sparse point cloud will be further refined to fully display the three-dimensional structure of the target area. It is important to note that the modeling area needs to be cropped according to the computer memory size and the cropping should be performed according to the prompts of the Context Capture software. Note that it cannot exceed the size of the existing memory, otherwise the modeling will fail. After completing the settings, you can submit the modeling.
[0145] The third step is to export to multiple formats according to project requirements. Since the modeling area is composed of many small areas, the texture layers are rich and the details are complex, the export format is preferably OBJ format.
[0146] Finally, all the model blocks are spliced together using 3D geometry processing software to obtain the flight environment geometry model.
[0147] In this embodiment, the Context Capture software can export multiple independent model blocks. In order to obtain a complete and coherent flight environment geometric model, it is also necessary to use three-dimensional geometry processing software, preferably MeshLab software, to stitch all model blocks. With the help of the advanced stitching algorithm in the MeshLab software, the precise positions of all model blocks during the stitching process can be determined, thereby ensuring the integrity and high-precision performance of the entire flight environment geometric model, and finally obtaining a high-definition flight environment geometric model.
[0148] In step S102 of this embodiment, a digital twin system is constructed, the system model is loaded into the digital twin system, and the recording, simulation, retrieval and control of all real drones are completed in the digital twin system to obtain a digital twin flight system. Step S102 of this embodiment includes the following sub-steps:
[0149] Sub-step S1021: In this embodiment, the system framework of the digital twin system is written using C++ language and QT software, and the three-dimensional image display function in the system framework is deployed using OpenGL and the third-party open source library Assimp to build a digital twin system, and load the system model into the digital twin system. Specifically, the following process is included:
[0150] First, during the initialization phase, the Assimp Importer class is instantiated and the 3D model file is read by calling the ReadFile method. This method does more than simply read the file. It also performs a series of preprocessing, which varies depending on the flags specified during the call, including triangulation, spatial calculation of normals and tangents, and optimization of vertex deduplication. These preprocessing are crucial to optimizing the rendering of the flight environment geometry model because they can reduce the complexity of the flight environment geometry model and ensure that the data meets the requirements of OpenGL.
[0151] Secondly, you need to go deep into the aiScene object, which is a core data structure provided by Assimp, which contains all the information of the parsed 3D model file. This core data structure reflects the design concept of Assimp, which is to convert complex 3D model files into a format that is easy to manage and access. At this stage, you need to traverse each aiMesh in the aiScene object and extract the vertex data, texture coordinates, normals, faces and other data information. Each aiMesh can be regarded as an independent component in the 3D model file, which may represent a part of the 3D model file or a specific material.
[0152] Again, the extracted data information is transferred to OpenGL. This usually involves creating a series of vertex buffers (Vertex Buffer Objects, VBO) and vertex array objects (Vertex Array Objects, VAO). These OpenGL objects are used to store and manage the data required for rendering in the graphics processing unit (Graphics Processing Unit, GPU). The correct organization and uploading of data is crucial to achieving efficient rendering. For example, vertex data may need to be split into multiple different VBOs to optimize its storage and access in the GPU.
[0153] In terms of texture processing, Assimp provides automatic loading and conversion of texture coordinates. Texture data plays an important role in 3D graphics rendering, and efficient processing of texture data is the key to improving overall rendering performance. Assimp will parse texture references in 3D model files and load texture images into memory, which will then need to be uploaded to OpenGL's texture unit.
[0154] Finally, after the data of the 3D model file is successfully processed and uploaded to OpenGL, the rendering phase begins. In the rendering phase, the 3D model file is drawn to the screen using the prepared VAO and VBO through OpenGL API calls. This process may involve complex shader programs, which are responsible for processing vertex data, calculating lighting effects, applying textures, etc.
[0155] At the end of the entire model life cycle, it is very important to clean up resources correctly. First release OpenGL resources, use OpenGL's glDeleteBuffers function and glDeleteVertexArrays function to delete VBO and VAO, these functions remove the corresponding resources from the GPU's memory. For texture resources, use the glDeleteTextures function to delete; then release Assimp resources, use Assimp's Importer class instance, call the FreeScene method, this method can release the memory resources allocated by Assimp when loading 3D model files, including all data such as meshes, materials, animations, etc. contained in the aiScene object. Releasing OpenGL resources first and then releasing Assimp resources can avoid dependency problems.
[0156] Sub-step S1022: Complete the recording, simulation, retrieval and control of all real drones in the digital twin system to obtain a digital twin flight system.
[0157] First, the sub-steps of recording all real drones include:
[0158] Build a MySQL database, which includes the total amount of data storage, data storage type and data storage meaning; in this embodiment, the MySQL database and the digital twin system both use local connection mode, and the client and server have the same local IP address: 127.0.0.1, and the same port: 3306, so as to perform real-time and efficient access to the data of the drone geometric model.
[0159] The total amount of data storage includes the number of all drone geometry models in the drone cluster geometry model.
[0160] Data storage types include pilot drones and follower drones.
[0161] The data storage means including the real UAV status data table and the virtual UAV status data table corresponding to each UAV geometric model.
[0162] The function of the real drone status data table is to map the status of all real drones into the virtual environment. All drone geometric models in the virtual environment need to adjust their own postures according to the flight postures of the real drones, so as to achieve the effect of virtual-reflecting-real. With the self-built drone number as the primary key index, the fields in the real drone status data table include: real drone number, real yaw angle, real pitch angle, real roll angle, real drone position coordinates and real axis speed coordinates.
[0163] The virtual drone status data table is mainly the data obtained by the digital twin system simulation. As the data output by the digital twin system, it can be used to analyze the flight status of the real drone and optimize its flight plan and decision. The fields in the virtual drone status data table include: virtual drone number, virtual yaw angle, virtual pitch angle, virtual roll angle, virtual drone position coordinates and virtual axis speed coordinates.
[0164] Second, the sub-steps of simulating all real drones include:
[0165] Use the QThread class of QT software to create a new child thread, initialize the Mavlink protocol parser in the child thread, and establish a connection with the MySQL database. At the same time, QMutex is used for data synchronization and protection to ensure the real-time and accuracy of data transmission.
[0166] When the Mavlink protocol parser is used to parse the Mavlink protocol, the mavlink_parse_char function is used to parse the received data stream to ensure the integrity and correctness of the data packet. Once the parsing is completed, the Mavlink data obtained by the parsing process can be passed to the corresponding processing function for subsequent processing.
[0167] When operating the MySQL database, the QsqlDatabase class in the QT software is used to establish a connection with the MySQL database, and the SQL statement is constructed based on the Mavlink data obtained through parsing and processing, and executed through the QsqlQuery object. In order to ensure the security and integrity of the data, this operation uses a transaction processing method to ensure the atomicity of data operations and the reliability and consistency of data processing.
[0168] Again, the sub-steps of retrieving all real drones include:
[0169] It is necessary to initialize the connection object of the MySQL database. Here, the static addDatabase provided by the QsqlDatabase class is used to add a connection to the MySQL database and specify the use of the MySQL driver;
[0170] Through multiple instance methods of the QsqlDatabase class: setHostName, setDatabaseName, setUserName and setPassword, the host name, database name, user name and password of the MySQL database are set respectively to complete the configuration of the connection to the MySQL database.
[0171] After that, the Open method is called to try to establish a connection with the MySQL database. This method returns a Boolean value to indicate whether the connection is successful or not. Once the connection is successful, the SQL query can be executed using the QsqlQuery object. The exec method of this object is used to execute a query containing an appropriate SELECT statement in order to retrieve the relevant data.
[0172] To traverse the results of a SQL query, you usually use the next method to search the results of the SQL query one by one. For each record, you can access the field value of a specific index through the value method, which can return the data content of the field.
[0173] In terms of user interface, the interface design component of QT software is used to create multiple corresponding controls. The window itself is an instance of Owidget, and in terms of layout, QVBoxLayout can be used to stack all controls vertically. For each data display area, QLabel is used to display the field name, and QlineEdit is used as the data display. The addWidget method is used to add labels and text boxes to the layout manager.
[0174] When the required data is retrieved from the MySQL database, the setText method is used to fill the retrieved data into the corresponding QlineEdit. Here, it is necessary to ensure that the data type retrieved from the MySQL database is compatible with the string type expected by the setText method, which may require appropriate data type conversion.
[0175] The sub-steps for controlling all real drones include:
[0176] The commands executed in the QT software need to connect a slot function through the button click signal clicked to send multiple commands. In other words, in order to achieve the normal sending of multiple commands, a slot function needs to be written. The writing of the slot function needs to comply with the Mavlink protocol so that the drone geometry model can recognize the command normally.
[0177] All commands are sent to the corresponding UAV geometric models through the User Datagram Protocol (UDP), and all UAV geometric models perform corresponding actions after receiving the commands.
[0178] In step S103 of this embodiment, the present application adopts the leader-follower model of the artificial potential field method, which determines the cooperation efficiency and safety of the UAV cluster formation model. The three key parameters are the gravitational gain coefficient , repulsion gain coefficient and boundary distance In order to make the drone cluster formation model more maneuverable and efficient. This application uses digital twin technology to optimize these three parameters. The core is to use historical data and real-time data, combined with summarized experience and industry standards, to build a parameter optimization solution.
[0179] The expression of the parameter optimization scheme is:
[0180] (5)
[0181] in, represents the change in the gravitational gain coefficient, represents the decision weight of the gravity empirical model, represents the empirical model of gravity, represents the decision weight of gravity historical data, represents the historical data of gravity, represents the gravitational disturbance factor, Represents the change in the repulsion gain coefficient, represents the decision weight of the repulsive empirical model, represents the empirical model of repulsion, represents the decision weight of the repulsive historical data, Represents the historical data of repulsion, Represents the repulsive interference factor, represents the change in the boundary distance, represents the decision weight of the boundary distance model, represents the boundary distance model, represents the decision weight of the boundary distance historical data, Represents historical data of boundary distance, Represents the boundary distance interference factor.
[0182] This design makes the parameter optimization scheme more flexible and adaptable. Under the guidance of digital twin technology, operators can dynamically adjust these key parameters based on real-time and historical data to adapt to different flight environments and flight missions, improving the robustness and intelligence of path planning.
[0183] In order to verify the beneficial effects of the method proposed in this application, the following simulation experiments were conducted:
[0184] like Figure 6 As shown, when the key parameters are not optimized, the gravity gain coefficient is set , repulsion gain coefficient , boundary distance .
[0185] like Figure 7 As shown in the figure, relying on digital twin technology, the UAV cluster formation model is optimized, and the specific key parameters are: gravity gain coefficient , repulsion gain coefficient , boundary distance .
[0186] The dotted line indicates the pilot drone (i.e. Figure 6 and Figure 7 The dotted line represents the No. 1 follower drone (i.e. Figure 6 and Figure 7 The solid line represents the No. 2 follower drone (i.e. Figure 6 and Figure 7The "X" indicates the starting point of the UAV geometric model, and the "+" indicates the end point of the UAV geometric model. During the flight of the UAV cluster formation model, a certain moment of turning and parallel to the y-axis is selected, and the formation of the UAV cluster formation model is marked with a triangle. First, compare Figure 6 and Figure 7 The flight trajectories of the triangle formations of the two drone cluster formation models are shown in Figure 2. It can be seen that the triangle formation with optimized key parameters is closer to the ideal isosceles triangle, and its flight trajectory is significantly better than the triangle formation without optimized key parameters. Then, the flight trajectories of the two drone cluster formation models are compared. Figure 6 and Figure 7 The location of the first triangle of the flight trajectory of the two drone cluster formation models. Figure 6 The flight trajectory of the Follower No. 2 UAV is not parallel to the flight trajectory of the pilot UAV. It takes a process for the Follower No. 2 UAV to slowly approach the pilot UAV. Figure 7 The flight trajectory of the Follower No. 2 UAV is basically parallel to the flight trajectory of the pilot UAV.
[0187] By comparison, it can be found that after the key parameters are optimized, the follower drone can adjust the flight yaw angle more quickly and effectively follow the flight trajectory of the pilot drone for formation flight. Through the analysis of the flight trajectory and the triangular formation, it can be concluded that the parameter optimization scheme proposed in this application can effectively optimize the flight trajectory and maneuverability of the drone cluster formation model when dealing with the complex flight trajectory of the drone cluster formation.
[0188] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0189] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification.
[0190] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and these modifications or substitutions should be included in the protection scope of the present application.
[0191] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
Claims
1. A method for constructing a digital twin flight system of a drone swarm, characterized in that: The method comprises the following steps: Constructing a system model of a UAV swarm flight system, wherein the system model includes a plurality of UAV geometric models, a UAV swarm geometric model, and a flight environment geometric model; The steps of constructing the system model of the UAV swarm flight system include: Using three-dimensional modeling software to model multiple real drones to obtain multiple drone geometric models, wherein the multiple drone geometric models include a pilot drone and multiple follower drones; The geometric model of the UAV cluster is constructed using the artificial potential field method, including: In the earth coordinate system, all the UAV geometric models are combined into a UAV cluster formation model. In the UAV cluster formation model, one UAV geometric model is selected as the pilot UAV, and the remaining UAV geometric models are all used as the follower UAVs. The artificial potential field method is introduced, all the UAV geometric models and all the obstacles are regarded as charged particles respectively, the potential energy between all the UAV geometric models and the target point is regarded as the gravitational potential energy field, the potential energy between all the UAV geometric models and all the obstacles is regarded as the repulsive potential energy field, and the comprehensive potential energy field is obtained according to the gravitational potential energy field and the repulsive potential energy field; The expression of the comprehensive potential energy field is: Among them, U(q u ) represents the comprehensive potential energy field, U att (q u ) represents the gravitational potential energy field, q u represents the position of the UAV geometric model in the flight environment, ζ represents the gravitational gain coefficient, ζ>0, q g represents the position of the target point in the flight environment, ρ ug (q u ,q g ) represents the distance between the UAV geometric model and the target point, represents the repulsive potential energy field, η represents the repulsion gain coefficient, represents the position of the kth obstacle in the flight environment, represents the distance between the UAV geometric model and obstacles in the flight environment, ρ o It represents the boundary distance of the geometric model of the UAV in the flight environment under the repulsive force of obstacles, n represents the number of obstacles, k∈n; The negative gradient of the comprehensive potential energy field is expressed as: Among them, F sun (q u ) represents the negative gradient of the integrated potential energy field, F att (q u ) represents the negative gradient of the gravitational potential energy field, represents the gradient operator, represents the unit direction vector of gravity, represents the negative gradient of the repulsive potential energy field, The unit direction vector representing the repulsive force; The unit direction vector of the gravitational force is the position q of the geometric model of the UAV in the flight environment. u Pointing to the position q of the target point g , the unit direction vector of the repulsive force is the position of the kth obstacle in the flight environment Point to the position q of the UAV geometric model u ; The comprehensive potential energy field is used to perform path planning for all the UAV geometric models to construct the UAV cluster geometric model; in the UAV cluster formation model, for any UAV geometric model, all other UAV geometric models except itself are regarded as obstacles; The matrix expression of the UAV cluster formation model is: Among them, F represents the matrix form of the UAV cluster formation model, P represents the pilot UAV, l ip represents the distance between the i-th follower UAV and the pilot UAV, δ ip represents the vertical angle between the ith follower drone and the pilot drone, represents the horizontal angle between the i-th follower UAV and the pilot UAV; In the earth coordinate system, the coordinates of the i-th following drone are (x i y i z i ), the coordinates of the pilot drone are (x p y p z p ), the expression of the relationship between the coordinates of the i-th following UAV and the coordinates of the pilot UAV is: Among them, x i represents the x-axis coordinate of the i-th following drone in the earth coordinate system, y i represents the coordinate of the ith following drone on the y-axis of the earth coordinate system, z i represents the coordinate of the i-th following drone on the z-axis of the earth coordinate system, x p Indicates the x-axis coordinate of the pilot drone in the earth coordinate system, y p Indicates the coordinate of the pilot drone on the y-axis of the earth's coordinate system, z p Indicates the coordinate of the pilot drone on the z-axis of the earth coordinate system; The flight environment geometric model is constructed by using the aerial photography data of all the real drones, including: The flight altitude of all the real drones during filming is always kept at more than 12 meters above the building, and the aerial photography data includes multiple photos, and the overlap rate of all the photos is greater than 75%; Performing three-dimensional modeling processing on all the photographs using three-dimensional real-scene modeling software to obtain a plurality of model blocks; Using three-dimensional geometry processing software to splice all the model blocks to obtain the flight environment geometry model; The flight environment geometric model includes the flight environment between all the UAV geometric models and the target point, and between all the UAV geometric models; Construct a digital twin system, load the system model into the digital twin system, and complete the recording, simulation, retrieval and control of all real drones in the digital twin system to obtain a digital twin flight system; Using the digital twin flight system, a parameter optimization scheme of the system model is constructed, and the parameter optimization scheme is dynamically adjusted according to real-time data and historical data, including: Using the attraction gain coefficient ζ, the repulsion gain coefficient η and the boundary distance ρ o , construct the parameter optimization scheme; The expression of the parameter optimization scheme is: Among them, Δζ represents the change of the gravitational gain coefficient, k 1ζ represents the decision weight of the gravity empirical model, CM ζ represents the empirical model of gravity, k 2ζ Denotes the decision weight of gravity history data, HD ζ represents the historical data of gravity, k 0ζ represents the gravitational disturbance factor, Δη represents the change in the repulsive gain coefficient, k 1η represents the decision weight of the repulsive empirical model, CM η represents the empirical model of repulsion, k 2η represents the decision weight of the repulsive historical data, HD η Represents the historical data of repulsion, k 0η represents the repulsive interference factor, Δρ o represents the change in the boundary distance, represents the decision weight of the boundary distance model, represents the boundary distance model, represents the decision weight of the boundary distance historical data, Represents historical data of boundary distance, Represents the boundary distance interference factor.
2. The method for constructing a digital twin flight system of a drone cluster according to claim 1, characterized in that: The step of using three-dimensional modeling software to model the plurality of real drones to obtain the plurality of drone geometric models comprises: respectively obtaining specific parameters of all components of each of the real drones; According to all the specific parameters, in the three-dimensional modeling software, all the components in each of the real drones are modeled to obtain multiple component models; Combining all the component models of each real drone respectively to form multiple drone models; All the drone models are detected and rendered using three-dimensional rendering software to obtain a plurality of the drone geometric models.
3. The method for constructing a digital twin flight system of a drone cluster according to claim 2, characterized in that: The steps of building a digital twin system and loading the system model into the digital twin system include: using C++ language and QT software to write the system framework of the digital twin system, and using OpenGL and the third-party open source library Assimp to complete the deployment of the three-dimensional picture display function in the system framework, building the digital twin system, and loading the system model into the digital twin system.
4. The method for constructing a digital twin flight system of a drone cluster according to claim 3 is characterized in that: The steps of recording, simulating, retrieving and controlling all real UAVs in the digital twin system to obtain the digital twin flight system include: The sub-steps of recording all the real drones include: Building a MySQL database, wherein the MySQL database includes the total amount of data storage, the type of data storage and the meaning of data storage; The total amount of data storage includes the number of all the UAV geometric models in the UAV cluster geometric model; The data storage type includes the pilot drone and the follower drone; The data storage means including a real drone state data table and a virtual drone state data table corresponding to each drone geometric model; The fields in the real drone status data table include: real drone number, real yaw angle, real pitch angle, real roll angle, real drone position coordinates and real axis speed coordinates; The fields in the virtual drone status data table include: virtual drone number, virtual yaw angle, virtual pitch angle, virtual roll angle, virtual drone position coordinates and virtual axis speed coordinates; The sub-steps of simulating all the real drones include: Create a new child thread using the QThread class of the QT software, initialize the Mavlink protocol parser in the child thread, establish a connection with the MySQL database, and use QMutex for data synchronization and protection; When the Mavlink protocol parser is used to parse the Mavlink protocol, the received data stream is parsed using the mavlink_parse_char function, and the obtained Mavlink data is passed to the corresponding processing function for subsequent processing; When performing the MySQL database operation, the QsqlDatabase class of the QT software is used to establish a connection with the MySQL database, an SQL statement is constructed according to the Mavlink data obtained by the parsing process, and is executed through the QsqlQuery object; The sub-steps of performing the retrieval on all the real drones include: Initialize the MySQL database, add a connection to the MySQL database through the static addDatabase provided by the QsqlDatabase class, and specify the use of the MySQL driver; The host name, database name, user name and password of the MySQL database are respectively set through multiple instance methods of the QsqlDatabase class to complete the configuration of the connection to the MySQL database; Call the Open method to establish a connection with the MySQL database, and use the QsqlQuery object to execute SQL queries; Traversing the results of the SQL query, including searching the results of the SQL query one by one through the next method; Use the interface design component of the QT software to create multiple corresponding controls, use the Owidget instance as the window, and use QVBoxLayout to vertically stack all the controls; for each data display area, use QLabel to display the field name, and use QlineEdit as the data display; use the addWidget method to add the label and text box to the layout manager; When the required data is retrieved from the MySQL database, the retrieved data is filled into the QlineEdit using the setText method; The sub-steps of controlling all the real drones include: In the QT software, a slot function is connected by a click signal to issue multiple commands, and the slot function is written in accordance with the Mavlink protocol; All the commands are sent to the corresponding UAV geometric models through the User Datagram Protocol, and all the UAV geometric models perform corresponding actions after receiving the commands.
Citation Information
Patent Citations
Vehicle formation control method and device, equipment, storage medium and product
CN118502416A