Unmanned aerial vehicle cluster flight control method based on ROS message mechanism and artificial potential field method
By adopting the ROS message mechanism and artificial potential field method in the drone cluster, the problems of low flexibility and large delay of the drone cluster flight control method in the prior art are solved, and more efficient and flexible drone cluster flight control is achieved.
Patent Information
- Application Number
- CN202510280776.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-06-13
AI Technical Summary
The existing drone cluster flight control method has the problems of long formation time, low flexibility and large delay.
The UAV cluster flight control method based on the ROS message mechanism and artificial potential field method is adopted. By configuring the IP address and port address of the UAV cluster, an ad hoc network is built, the flight information and obstacle locations are shared, and the artificial potential field method is used to coordinate the UAV movement.
It improves the flexibility of the drone cluster, reduces delay problems, avoids data interference, and enhances the risk resistance of the drone cluster.
Smart Images

Figure CN120143876A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of unmanned aerial vehicle (UAV) flight control, and particularly to a UAV swarm flight control method based on the ROS message mechanism and the artificial potential field method. Background Art
[0002] With the rapid development of UAV technology, UAVs are increasingly widely used in military, civilian and other fields. However, a single UAV has many limitations when performing complex tasks, such as limited task execution ability, insufficient environmental adaptability, and weak risk resistance. To overcome these deficiencies, UAV swarm technology has emerged. By the collaborative work of multiple UAVs, the UAV swarm can significantly improve the efficiency and success rate of task execution.
[0003] A UAV swarm usually consists of three or more UAVs, and each UAV cooperates with each other to complete complex tasks. Each UAV in the UAV swarm can carry different types of sensors, and each UAV performs its own duties, thus reducing the load of a single UAV and increasing the endurance time of the entire UAV swarm. In addition, each UAV in the UAV swarm is usually equipped with devices such as binocular cameras and Simultaneous Localization And Mapping (SLAM) modules, which can accurately obtain environmental information from different angles and improve the adaptability of the UAVs to unfamiliar environments. When a UAV in the UAV swarm fails, other UAVs can quickly take over its task to ensure the continuity of the task, thereby improving the risk resistance of the UAV swarm. Since each UAV in the UAV swarm is small in size and flexible in movement, it can effectively avoid obstacles in a crowded environment.
[0004] However, there are the following problems in the current flight control applications of UAV swarms:
[0005] First, the leader-follower algorithm is widely used in UAV swarm flight control algorithms. This algorithm controls the movement of the entire UAV swarm by setting a leader UAV, and the leader UAV only guides other UAVs to follow through a given flight trajectory. Although this algorithm simplifies the control process, it has problems such as a long formation time and low flexibility of the UAV swarm.
[0006] Second, another commonly used method is to solely adopt the artificial potential field method. This method controls the movement of UAVs by simulating a physical potential field, which can improve the flexibility of the UAV swarm. However, in practical applications, it often generates a large time delay and requires choosing an appropriate communication protocol to ensure the coordination between UAVs.
[0007] Therefore, it is necessary to propose a solution to improve one or more problems existing in the above related technical solutions.
[0008] It should be noted that the information disclosed in the above background art section is only used to enhance the understanding of the background of the present application, and thus may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention
[0009] The embodiments of the present application provide a method for controlling the flight of a UAV swarm based on the ROS message mechanism and the artificial potential field method. The method includes the following steps:
[0010] Using the ROS message mechanism, configure the IP addresses and port addresses of all UAVs in the UAV swarm respectively, and construct a self-organizing network of the UAV swarm;
[0011] Within the self-organizing network of the UAV swarm, share the flight information of all the UAVs and the position information of obstacles in the flight environment, and use the ROS message mechanism to achieve information sharing among all the UAVs;
[0012] Introduce the gravitational gain coefficient, the repulsive gain coefficient, and the repulsive action boundary distance between the UAV and the obstacle, use the artificial potential field method to coordinate the movement of all the UAVs, and use the Captain module in the onboard software system of all the UAVs to complete the flight mission of the UAV swarm.
[0013] In an exemplary embodiment of the present application, the step of using the message mechanism of ROS to configure the IP addresses and port addresses of all UAVs in the UAV swarm respectively, and construct a self-organizing network of the UAV swarm includes:
[0014] Take the leading UAV in the UAV swarm as the host, that is, ROS Master, and configure WIFI AP for the host;
[0015] Take all the following UAVs as slaves, edit the ".bashrc" file for each of the following UAVs respectively, and configure the WIFI module for each of the following UAVs;
[0016] Set ROS_MASTER_URI to the IP address of the host, and set ROS_HOSTNAME to the IP address of each slave respectively, so as to construct the self-organizing network of the UAV swarm.
[0017] In an exemplary embodiment of the present application, the steps of sharing the flight information of all the drones and the position information of obstacles in the flight environment within the self-organizing network of the drone swarm, and implementing information sharing among all the drones by using the ROS message mechanism include:
[0018] In the self-organizing network of the drone swarm, all the drones subscribe to the ROS message mechanism with each other and share the flight information of all the drones;
[0019] The host dispatches control instructions to all the slaves through the ROS message mechanism, and all the slaves respectively respond to the preset program topics and send the control instructions to their own flight control actuators;
[0020] Among them, the flight information at least includes the status information, position information and speed information of all the drones;
[0021] In the drone swarm, all the other drones except the drone itself are regarded as the obstacles of the drone.
[0022] In an exemplary embodiment of the present application, the ROS message mechanism at least includes: / mavros / state topic, / mavros / local_position / pose topic and / mavros / local_position / velocity_local topic;
[0023] When all the drones are involved in the mavros topic, a prefix is added before the mavros topic.
[0024] In an exemplary embodiment of the present application, in the step of introducing the gravitational gain coefficient, the repulsive gain coefficient, and the repulsive action boundary distance between the drone and the obstacle, and using the artificial potential field method to coordinate the movement of all the drones, the expression of the gravitational potential field is:
[0025]
[0026] Among them, U aa (X) represents the gravitational potential field, k aa represents the gravitational gain coefficient, X gg represents the target point, X represents the drone, d(X, X gg ) represents the distance from the drone to the target point;
[0027] The expression of the negative gradient of the gravitational potential field is:
[0028]
[0029] Among them, F aa (X) represents the negative gradient of the gravitational potential energy field, represents the gradient operator, represents the unit direction vector of gravity;
[0030] The expression of the repulsive potential energy field is:
[0031]
[0032] Among them, U rr (X) represents the repulsive potential energy field, k rr represents the repulsive gain coefficient, X 0 represents the obstacle, d(X, X 0 ) represents the distance from the UAV to the obstacle, d 0 represents the boundary distance of the repulsive force action between the UAV and the obstacle;
[0033] The expression of the negative gradient of the repulsive potential energy field is:
[0034]
[0035] Among them, F rr (X) represents the negative gradient of the repulsive potential energy field, represents the unit direction vector of the repulsive force;
[0036] The expression of the comprehensive potential energy field is:
[0037]
[0038] Among them, U(X) represents the comprehensive potential energy field, n represents the number of obstacles, i represents the i-th obstacle, and i ∈ n.
[0039] In an exemplary embodiment of the present application, the expression of the negative gradient of the potential energy field of the target point and a single obstacle received by the UAV is:
[0040] F(X) = F aa (X) + F rr (X) (6)
[0041] Among them, F(X) represents the negative gradient of the potential energy field of the target point and a single obstacle received by the UAV;
[0042] The expression of the negative gradient of the comprehensive potential energy field of the target point and all obstacles received by the UAV is:
[0043]
[0044] Among them, F aaaaaa(X) represents the negative gradient of the combined potential energy field of the target point and all obstacles received by the UAV.
[0045] In an exemplary embodiment of the present application, the step of using the Captain module in the onboard software system of all the UAVs to complete the flight mission of the UAV cluster includes:
[0046] Configuring the Captain module includes: configuring the Captain module on each of the UAVs, and loading a Mission object, a Task object, and a Trajectory object into each Captain module;
[0047] Among them, the Mission object is used to create a Task list in the BuildMissionInfo virtual function;
[0048] The Task object is used to implement the execution of the task in the Run function;
[0049] The Trajectory object is used to generate the trajectories of multiple tasks;
[0050] Initializing the Captian module includes:
[0051] Starting all the Captain modules;
[0052] Reading all the configuration files and loading all the configuration files into the plugin dynamic link library;
[0053] Reading all the configuration files to obtain the Mission name of the current task;
[0054] Creating the current Mission object and calling the GetMissionInfo module for the Task list;
[0055] Creating the Task task and the Trajectory object includes:
[0056] Rewriting the interfaces of the exposed Task object and the Trajectory object using the Captian sdk and registering them using the CALSS_LOADER_REGISTER_CLASS() macro to complete the current task;
[0057] Checking whether the Task list is empty;
[0058] If the Task list is not empty, creating and starting a Task processing thread corresponding to each Captain module respectively;
[0059] Create a corresponding Trajectory object for each of the Task processing threads and initialize all the Trajectory objects;
[0060] Execute the Task, including:
[0061] Execute the Run function of the task object to start the task execution mode;
[0062] Monitor the execution status of the task object;
[0063] If the task object has been executed, delete the completed task object from the Task list, and clear the completed task object and the Trajectory object.
[0064] In an exemplary embodiment of the present application, in the step of checking whether the Task list is empty, if the Task list is empty, make the corresponding drone hover or stay still at the current position, and the current process ends.
[0065] In an exemplary embodiment of the present application, in the step of monitoring the execution status of the task object, if the task object has not been executed, continue to execute until the task object has been executed.
[0066] In an exemplary embodiment of the present application, during the process of using the Captain module in the on-board software system of all the drones to complete the flight mission of the drone cluster, if the drone cluster receives a remote instruction, the Captain module starts to judge the type of the remote instruction, specifically including:
[0067] If the remote instruction is a new task instruction, the drone cluster stops the current flight mission, clears the current Task list, adds the new task name to the current Task list, and jumps to the step of creating a task object according to the name and parameters of the current flight mission and calling the GetMissionInfo module to obtain the Task list to continue the execution;
[0068] If the remote instruction is to request to stop the current flight mission, the drone cluster stops the current flight mission, clears the current Task list, and makes all the drones hover or stay still;
[0069] If the remote instruction is a flight control instruction, send a control instruction to the GeoController module to end the current process.
[0070] Beneficial effects:
[0071] This application provides a method for controlling the flight of an unmanned aerial vehicle (UAV) cluster based on the ROS message mechanism and the artificial potential field method, which has at least the following beneficial effects:
[0072] (1) This application improves the flexibility of the UAV cluster by introducing the artificial potential field method;
[0073] (2) By utilizing the Robot Operating System (ROS) message mechanism, that is, the ROS message mechanism, this application avoids the time delay problem of the UAV cluster and the data interference problem that seems to occur when the data of each UAV in the UAV cluster is sent simultaneously. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the accompanying drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0075] Figure 1 A schematic diagram showing the steps of a method for controlling the flight of a UAV cluster based on the ROS message mechanism and the artificial potential field method in an exemplary embodiment of the present application;
[0076] Figure 2 A schematic diagram showing the structure of the ROS message mechanism in an exemplary embodiment of the present application;
[0077] Figure 3 A schematic diagram showing the principle of the artificial potential field method in an exemplary embodiment of the present application;
[0078] Figure 4 A schematic diagram showing the comparison between the straight-line theoretical trajectory and the straight-line actual trajectory of the UAV cluster in an exemplary embodiment of the present application;
[0079] Figure 5 A schematic diagram showing the comparison between the circular theoretical trajectory and the circular actual trajectory of the UAV cluster in an exemplary embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0080] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various 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 complete and comprehensive, and will fully convey the concept of the example embodiments to those skilled in the art. The features, structures, or characteristics described can be combined in any suitable manner in one or more embodiments.
[0081] In addition, the attached drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the 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.
[0082] For this reason, the present exemplary embodiment provides a method for controlling the flight of a drone swarm based on the ROS message mechanism and the artificial potential field method, as Figure 1 shown, the method may include the following steps:
[0083] Step S101: Using the ROS message mechanism, configure the IP addresses and port addresses of all drones in the drone swarm respectively to construct a self-organizing network for the drone swarm.
[0084] Step S102: Within the self-organizing network of the drone swarm, share the flight information of all drones and the position information of obstacles in the flight environment, and use the ROS message mechanism to achieve information sharing among all drones.
[0085] Step S103: Introduce the gravitational gain coefficient, the repulsive gain coefficient, and the repulsive action boundary distance between the drone and the obstacle, use the artificial potential field method to coordinate the movement of all drones, and use the Captain module in the onboard software system of all drones to complete the flight mission of the drone swarm.
[0086] The embodiment of the present application proposes a method for controlling the flight of a drone swarm based on the ROS message mechanism and the artificial potential field method, which has at least the following beneficial effects:
[0087] (1) The present application improves the flexibility of the drone swarm by introducing the artificial potential field method;
[0088] (2) The present application avoids the time delay problem of the drone swarm and the data interference problem that seems to occur when the data of each drone in the drone swarm is sent simultaneously by using the Robot Operating System (ROS) message mechanism, that is, the ROS message mechanism.
[0089] Next, a method for controlling the flight of a drone swarm based on the ROS message mechanism and the artificial potential field method proposed in the present exemplary embodiment will be described in more detail.
[0090] In as Figure 2As shown, in step S101 of this embodiment, the IP addresses and port addresses of all the drones in the drone cluster are respectively configured by using the ROS message mechanism to construct a self-organizing network for the drone cluster. Step S101 of this embodiment may include the following sub-steps:
[0091] Sub-step S1011: Take the pilot drone in the drone cluster as the host, that is, the ROS Master, and configure the WIFI AP for the host.
[0092] Sub-step S1012: Take all the follower drones as slaves, respectively edit the ".bashrc" file for all the follower drones, and configure the WIFI module for each follower drone.
[0093] Sub-step S1013: Set ROS_MASTER_URI as the IP address of the host, and set ROS_HOSTNAME as the IP address of each slave respectively, so as to construct a self-organizing network for the drone cluster.
[0094] In this embodiment, on the host (i.e., drone 0), a cooperative task management program is run, and control instructions such as distributed search and cooperative tracking are sent to different slaves (i.e., drones 1 to N) through the ROS message mechanism. Each drone only needs to respond to the above topics according to the preset program and hand over the specific control instructions to its own flight controller to complete. Due to the master-slave mode, all slaves will subscribe to the flight data of the host, such as the flight position, flight speed, flight heading, etc. of the host, and finally realize the communication within the drone cluster.
[0095] In this embodiment, first, start drone 0; then, start the remaining drones one after another. After the WIFI modules carried by the remaining drones are started, all slaves will connect to the ROS Master of drone 0, and thus gradually join the entire local area network and share all the ROS message mechanisms.
[0096] In step S102 of this embodiment, within the self-organizing network of the drone cluster, share the flight information of all the drones and the position information of the obstacles in the flight environment, and use the ROS message mechanism to realize the information sharing among all the drones. Step S102 of this embodiment may include the following sub-steps:
[0097] Sub-step S1021: In the self-organizing network of the drone cluster, all the drones subscribe to the ROS message mechanism with each other and share the flight information of all the drones.
[0098] Here, the flight information at least includes the status information, position information and speed information of all the drones. In the drone cluster, all the drones other than the drone itself are regarded as obstacles for this drone.
[0099] Sub-step S1022: The host runs the cooperative task management program and distributes control instructions to all slave drones through the ROS message mechanism. All slave drones respectively respond to the preset program topic and send the control instructions to their own flight control actuators.
[0100] Furthermore, in the entire self-organizing network of the drone cluster, each drone needs to subscribe to the flight information of other drones. The flight information includes the status information, position information, speed information, etc. of the drones. The ROS message mechanism at least includes: / mavros / state topic, / mavros / local_position / pose topic, and / mavros / local_position / velocity_local topic, etc.
[0101] Furthermore, in order to prevent the situation where each drone has the same Mavros topic, when all drones are involved in the mavros topic, only a prefix needs to be added before the mavros topic. For example, when drone 0 sends a control instruction to drone 1, only adding a prefix / UAV0 / **** or / UAV1 / **** can read or send the control instruction to drone 1. The ROS system will maintain a message instruction queue for all drones. According to the index message instruction queue, the sharing of sensor information and control instructions of all drones within the drone cluster can be achieved.
[0102] In step S103 of this embodiment, a gravitational gain coefficient, a repulsive gain coefficient, and a repulsive action boundary distance between the drone and the obstacle are introduced. The artificial potential field method is used to coordinate the movement of all drones, and the Captain module in the onboard software system of all drones is used to complete the flight task of the drone cluster. Step S103 of this embodiment may include the following sub-steps:
[0103] Sub-step S1031: Introduce a gravitational gain coefficient, a repulsive gain coefficient, and a repulsive action boundary distance between the drones and obstacles in the environment, and use the artificial potential field method to coordinate the movement of all drones.
[0104] In the flight control algorithm of this embodiment, the artificial potential field method is mainly used. As Figure 3 shown, the control schematic diagram based on the artificial potential field method. In a three-dimensional space, the potential field is defined as a three-dimensional space coordinate system o-xyz. The spatial coordinates of all drones can be expressed as: X = (x, y, z), and the coordinates of the target point can be expressed as: X gg =(x gg ,y gg ,z gg ), and the coordinates of the obstacle can be expressed as: X0 =(x 0 , y 0 , z 0 ), before the UAV reaches the target point, it is always affected by the gravitational force of the target point. The gravitational force of the target point gradually decreases as the UAV approaches. When the UAV reaches the target point, the gravitational force becomes 0. Figure 3 The robot in Figure 3 can be regarded as a UAV.
[0105] Furthermore, the expression of the gravitational potential energy field is:
[0106]
[0107] Among them, U aa (X) represents the gravitational potential energy field, k aa represents the gravitational gain coefficient, X gg represents the target point, X represents the UAV, and d(X, X gg ) represents the distance from the UAV to the target point.
[0108] Furthermore, the gravitational force on the UAV by the target point is along the direction of the negative gradient of the gravitational potential energy field, and this direction is on the line connecting the UAV and the target point and points to the target point.
[0109] The expression of the negative gradient of the gravitational potential energy field is:
[0110]
[0111] Among them, F aa (X) represents the negative gradient of the gravitational potential energy field, represents the gradient operator, represents the unit direction vector of gravity.
[0112] Furthermore, similar to the gravitational potential energy field, the repulsive potential energy field is related to the distance between the UAV and the obstacle. Let d 0 represent the repulsive action boundary distance between the UAV y and the obstacle. When the distance between the UAV and the obstacle is less than or equal to d 0 , the obstacle will exert a repulsive force on the UAV. At this time, as the UAV approaches the obstacle, the repulsive force generated by the obstacle on the UAV gradually increases.
[0113] The expression of the repulsive potential energy field is:
[0114]
[0115] Among them, U rr (X) represents the repulsive potential energy field, k rr represents the repulsive gain coefficient, X 0 represents the obstacle, d(X, X 0) represents the distance from the UAV to the obstacle, d 0 represents the repulsive force boundary distance between the UAV and the obstacle.
[0116] Furthermore, it can be deduced from formula (3) that the direction of the repulsive force between the UAV and the obstacle is along the line connecting the UAV and the obstacle and points to the UAV.
[0117] The expression for the negative gradient of the repulsive force potential field is:
[0118]
[0119] where, F rr (X) represents the negative gradient of the repulsive force potential field, represents the unit direction vector of the repulsive force.
[0120] Furthermore, the expression for the comprehensive potential field is:
[0121]
[0122] where, U(X) represents the comprehensive potential field, n represents the number of obstacles, i represents the i-th obstacle, and i ∈ n.
[0123] Furthermore, from the Lagrange equation and spatial dynamics, it can be deduced from formula (5) that the expression for the negative gradient of the potential field of the target point and a single obstacle acting on the UAV is:
[0124] F(X) = F aa (X) + F rr (X) (6)
[0125] where, F(X) represents the negative gradient of the potential field of the target point and a single obstacle acting on the UAV.
[0126] Furthermore, since the UAV is not only affected by a single obstacle in the comprehensive potential field, therefore, formula (6) is not yet the guiding force for the flight direction to safely guide the UAV to the target point. The UAV in the comprehensive potential field reaches the target point by relying on the reasonable action of the gravitational force from the target point and the repulsive forces from all obstacles on the flight direction.
[0127] The expression for the negative gradient of the comprehensive potential field of the target point and all obstacles acting on the UAV is:
[0128]
[0129] where, F aaaaaa (X) represents the negative gradient of the comprehensive potential field of the target point and all obstacles acting on the UAV.
[0130] Sub-step S1032: Use the Captain module in the onboard software systems of all drones to complete the flight mission of the drone swarm.
[0131] On this basis, each drone mainly realizes flight control through the Captain module. This module is designed with an extensible architecture and pre-built with various configuration files such as takeoff, landing, and flying along a trajectory. This module can customize manipulation plugins related to specific tasks and seamlessly integrate them into the control management module.
[0132] First, configure the Captain module. The specific process is as follows: Configure the Captain module on all drones respectively, and each Captain module loads Mission objects, Task objects, and Trajectory objects.
[0133] Furthermore, the Mission object is used to create a Task list in the BuildMissionInfo virtual function. The Task object is used to implement the execution of tasks in the Run function. The Trajectory object is used to generate the trajectories of multiple tasks.
[0134] Second, initialize all Captain modules. The specific process is as follows:
[0135] Read all configuration files and load all configuration files into the plugin dynamic link library.
[0136] Read all configuration files and obtain the Mission name of the current task.
[0137] Create the current Mission object and call the GetMissionInfo module Task list.
[0138] Third, create Task tasks and Trajectory objects. The specific process is as follows:
[0139] Rewrite the interfaces of the externally exposed Task object and Trajectory object using the Captian sdk and register them using the CALSS_LOADER_REGISTER_CLASS() macro to complete the current task.
[0140] Check whether the Task list is empty.
[0141] If the Task list is not empty, create and start the Task processing threads corresponding to each Captain module respectively.
[0142] If the Task list is empty, make the corresponding drone hover or stay still at the current position, and the current process ends.
[0143] Create corresponding Trajectory objects for each of the said Task processing threads and initialize all the said Trajectory objects.
[0144] Finally, execute the Task. The specific process is as follows:
[0145] Execute the Run function of the task object to start the task execution mode;
[0146] Monitor the execution status of the task object;
[0147] If the task object has been executed, delete the completed task object from the Task list and clear the completed task object and the said Trajectory object.
[0148] If the task object has not been executed, continue to execute until the task object is executed.
[0149] In addition, during the process of using the Captain module in the on-board software system of all drones to complete the flight mission of the drone swarm, if the drone swarm receives a remote instruction, the Captain module starts to judge the type of the remote instruction, specifically including:
[0150] If the remote instruction is a new task instruction, the drone swarm stops the current flight mission, clears the current Task list, adds the new task name to the current Task list, and jumps to the step of creating a task object according to the name and parameters of the current flight mission and calling the GetMissionInfo module to obtain the Task list to continue the execution;
[0151] If the remote instruction is to request to stop the current flight mission, the drone swarm stops the current flight mission, clears the current Task list, and makes all drones hover or stay still;
[0152] If the remote instruction is a flight control instruction, send a control instruction to the GeoController module to end the current process. The GeoController module is a geometric control module that is responsible for sending control commands to the flight control. When an unexpected error occurs in other software modules, the drone flight control can continue to work normally to improve the system stability.
[0153] As Figure 4 shown, when the drone swarm performs a straight-line flight mission, the straight-line theoretical trajectory and the straight-line actual trajectory are compared. By Figure 4It can be seen that these two trajectories of each drone are approximately coincident. At the same moment, five coordinates are taken on the actual straight-line trajectory and the theoretical straight-line trajectory respectively, and the average absolute value of the corresponding coordinates is calculated, and the result is less than 0.1 m, which reflects the accuracy of the drone swarm flight control method proposed in this application.
[0154] As Figure 5 shown, when the drone swarm performs a circular line flight mission, the theoretical circular line trajectory is compared with the actual circular line trajectory. From Figure 5 it can be seen that these two trajectories of each drone are approximately coincident. At the same moment, five coordinates are taken on the actual circular line trajectory and the theoretical circular line trajectory respectively, and the average absolute value of the corresponding coordinates is calculated, and the result is less than 0.1 m, which reflects the accuracy of the drone swarm flight control method proposed in this application.
[0155] First, set the initial positions and desired positions of each drone, and take the point radius, etc. as initial values. With a starting point as the center, draw a circle with a radius of r;
[0156] Secondly, take 6 evenly spaced points from the circle, and calculate the forward cost of the 6 points including the starting point and the ending point, that is, the gravitational force of the desired point on it and the repulsive force of all obstacles on it;
[0157] Thirdly, select the point coordinates with the minimum forward cost, combine with the current starting point, calculate the new starting point, and repeat all the above steps;
[0158] Finally, when the distance to the end point is relatively close or the number of iterations is completed, the process ends.
[0159] Thus, it can be seen that the Captain module can efficiently manage the formation control tasks of the drone swarm, support multiple task types and external command responses, and ensure the flexibility and reliability of the drone swarm in complex environments.
[0160] In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of this application, "a plurality" means two or more, unless otherwise specifically defined.
[0161] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in connection 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 can combine and combine the different embodiments or examples described in this specification.
[0162] As described above, it is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present application.
[0163] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present application. The present application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include known common knowledge or conventional technical means in the technical field not disclosed by the present application.
Claims
1. A UAV swarm flight control method based on ROS message mechanism and artificial potential field method, characterized in that: The method comprises the following steps: Using the ROS message mechanism, the IP addresses and port addresses of all drones in the drone cluster are configured to build a drone cluster self-organizing network; In the drone cluster self-organizing network, the flight information of all the drones and the location information of obstacles in the flight environment are shared, and the ROS message mechanism is used to realize information sharing among all the drones; The gravitational gain coefficient, the repulsive gain coefficient, and the repulsive boundary distance between the UAV and the obstacle are introduced, the movement of all the UAVs is coordinated by the artificial potential field method, and the flight mission of the UAV cluster is completed by using the Captain module in the onboard software system of all the UAVs.
2. The UAV swarm flight control method based on ROS message mechanism and artificial potential field method according to claim 1 is characterized in that: The steps of using the ROS message mechanism to configure the IP addresses and port addresses of all drones in the drone cluster and constructing a drone cluster self-organizing network include: Use the pilot drone in the drone cluster as the host, i.e., ROS Master, and configure WIFIAP for the host; Set all follow-up drones as slaves, edit ".bashrc" files for all the follow-up drones, and configure a WIFI module for each follow-up drone; Set ROS_MASTER_URI to the IP address of the master, and set ROS_HOSTNAME to the IP address of each slave, so as to build the drone cluster self-organizing network.
3. The UAV swarm flight control method based on ROS message mechanism and artificial potential field method according to claim 2 is characterized in that: The steps of sharing the flight information of all the drones and the location information of obstacles in the flight environment within the drone cluster self-organizing network, and using the ROS message mechanism to realize information sharing among all the drones include: In the drone cluster self-organizing network, all the drones subscribe to the ROS message mechanism and share the flight information of all the drones; The host runs a collaborative task management program and dispatches control instructions to all the slaves through the ROS message mechanism. All the slaves respond to the preset program topic respectively and send the control instructions to their own flight control actuators. The flight information includes at least status information, location information and speed information of all the drones; In the drone cluster, all the drones except the drone itself are regarded as obstacles of the drone.
4. The UAV swarm flight control method based on ROS message mechanism and artificial potential field method according to claim 3 is characterized in that: The ROS message mechanism includes at least: / mavros / state topic, / mavros / local_position / pose topic and / mavros / local_position / velocity_local topic; When all the drones appear to be related to the Mavros topic, a prefix is added before the Mavros topic.
5. The UAV swarm flight control method based on ROS message mechanism and artificial potential field method according to claim 3 is characterized in that: In the step of introducing the gravitational gain coefficient, the repulsive gain coefficient, and the repulsive boundary distance between the UAV and the obstacle, and using the artificial potential field method to coordinate the movement of all the UAVs, the expression of the gravitational potential field is: Among them, U a (X) represents the gravitational potential energy field, k a represents the gravitational gain coefficient, X g represents the target point, X represents the drone, d(X,X g ) represents the distance from the drone to the target point; The expression of the negative gradient of the gravitational potential energy field is: Among them, F a (X) represents the negative gradient of the gravitational potential field, represents the gradient operator, The unit direction vector representing the gravitational force; The expression of repulsive potential energy field is: Among them, U r (X) represents the repulsive potential energy field, k r represents the repulsion gain coefficient, X0 represents the obstacle, d(X,X0) represents the distance from the drone to the obstacle, and d0 represents the boundary distance of the repulsion between the drone and the obstacle; The expression of the negative gradient of the repulsive potential energy field is: Among them, F r (X) represents the negative gradient of the repulsive potential energy field, The unit direction vector representing the repulsive force; The expression of the comprehensive potential energy field is: Among them, U(X) represents the comprehensive potential energy field, n represents the number of obstacles, i represents the i-th obstacle, and i∈n.
6. The UAV swarm flight control method based on ROS message mechanism and artificial potential field method according to claim 5 is characterized in that: The negative gradient of the potential energy field of the target point and a single obstacle to which the UAV is subjected is expressed as: F(X)=F a (X)+F r (X) (6) Among them, F(X) represents the negative gradient of the potential energy field of the target point and a single obstacle on the UAV; The negative gradient expression of the comprehensive potential energy field of the target point and all obstacles to the UAV is: Among them, F all (X) represents the negative gradient of the comprehensive potential energy field of the target point and all obstacles to the UAV.
7. The UAV swarm flight control method based on ROS message mechanism and artificial potential field method according to claim 3 is characterized in that: The step of using the Captain module in the onboard software system of all the drones to complete the flight mission of the drone cluster includes: Configuring the Captain module includes: configuring the Captain module on all the drones respectively, each of the Captain modules being loaded with a Mission object, a Task object and a Trajectory object; Wherein, the Mission object is used to create a Task list in the BuildMissionInfo virtual function; The Task object is used to implement the execution of the task in the Run function; The Trajectory object is used to realize trajectory generation of multiple tasks; Initialize all the Captian modules, including: Start all the Captain modules; Read all configuration files and load them into the plugin dynamic link library; Read all the configuration files and obtain the Mission name of the current task; Create the current Mission object and call the Task list in the GetMissionInfo module; Create Task and Trajectory objects, including: Use Captian SDK to rewrite the exposed interfaces of the Task object and the Trajectory object, and register them using the CALSS_LOADER_REGISTER_CLASS() macro to complete the current task; Check whether the Task list is empty; If the Task list is not empty, create and start the Task processing thread corresponding to each Captain module respectively; Create a corresponding Trajectory object for each Task processing thread respectively, and initialize all the Trajectory objects; Executing the Task includes: Execute the Run function of the task object to start the task execution mode; Monitoring the execution status of the task object; If the task object is executed, the completed task object is deleted from the Task list, and the completed task object and the Trajectory object are cleared.
8. The UAV swarm flight control method based on ROS message mechanism and artificial potential field method according to claim 7 is characterized in that: In the step of checking whether the Task list is empty, if the Task list is empty, the corresponding UAV is kept hovering or stationary at the current position, and the current process ends.
9. The UAV swarm flight control method based on ROS message mechanism and artificial potential field method according to claim 7 is characterized in that: In the step of monitoring the execution status of the task object, if the task object has not been completely executed, the execution continues until the task object is completely executed.
10. The UAV swarm flight control method based on ROS message mechanism and artificial potential field method according to claim 7 is characterized in that: In the process of using the Captain module in the onboard software system of all the drones to complete the flight mission of the drone cluster, if the drone cluster receives a remote command, the Captain module begins to determine the type of the remote command, specifically including: If the remote command is a new task command, the UAV cluster stops the current flight mission, clears the current Task list, adds the new task name to the current Task list, and jumps to the step of creating a task object according to the name and parameters of the current flight mission, and calling the GetMissioninfo module to obtain the Task list to continue execution; If the remote instruction is to stop the current flight mission, the drone cluster stops the current flight mission, clears the current Task list, and keeps all the drones hovering or stationary; If the remote command is a flight control command, a control command is sent to the GeoController module to end the current process.