Collaborative Optimal Formation Control for Heterogeneous Multi-Agent Systems

In this paper, the distributed optimal control method is used to study the cooperative formation of heterogeneous multi-agents in the air–ground environment. The considered system consists of an unmanned aerial vehicle (UAV) and an unmanned ground vehicle (UGV). The optimal control theory is introduced into the formation control protocol, the distributed optimal formation control protocol is designed, and the stability is verified by graph theory. Furthermore, the cooperative optimal formation control protocol is designed, and the stability is analyzed using a block Kronecker product and matrix transformation theory. Through the comparison of simulation results, the introduction of optimal control theory shortens the formation time of the system and accelerates the convergence speed of the system.


Introduction
With the rapid development of science and technology, the world's military powers attach great importance to the cooperation capability of an unmanned combat system. In recent decades, air-ground heterogeneous unmanned combat systems, which consist of unmanned aerial vehicles (UAVs) and unmanned ground vehicles (UGVs), have been favored by military powers due to their fast response speed, strong communication capability, strong payload capacity, and high target reconnaissance accuracy [1][2][3].
In the field of multi-agent systems, cooperative control has received extensive attention and research. Examples of such applications include the field of robot collaboration, UAV formation, cooperative transport, and combat reconnaissance [4]. Formation control is an application hotspot in the field of distributed cooperation. In general, formation control can be divided into two categories according to the presence or absence of leader agents: leader and leaderless [5][6][7][8]. Reference [9] used the leader-follower method to complete the trajectory tracking task of the UAV-UGV system but did not cooperate in the process of completing the formation. Furthermore, Reference [10] studied the cooperation problem of the UAV-UGV system by improving the artificial physics approach but did not study the formation problem. Reference [11] studied the time-varying formation control of cooperative heterogeneous multi-agent systems and combined formation with cooperation.
In the cooperative reconnaissance and cooperative strike of the unmanned combat system, based on forming an established formation, the unmanned combat system must also identify the complex and volatile battlefield environments and quickly cross barriers, such as fences and fortifications. Therefore, quickly making the whole formation reach the desired state is also an important concern of the formation problem. Reference [12] used a virtual-structure-based approach and multiple-impedance control to achieve the optimal formation of three mobile robots, and the mobile robots carried out the cooperative formation. However, this study was based on the study of homogeneous multi-agents. In Reference [13], the leader-follower strategy and the virtual leader strategy were integrated into an optimal control framework to study the optimal formation of multiple UAVs. However, this study did not investigate the cooperation of multiple UAVs. For the optimal formation of heterogeneous multi-agent, there are few related research results. Reference [14] is based on using reinforcement learning methods to achieve the optimal formation of heterogeneous multi-agent systems but does not study cooperative control. It should be noted that optimal formation control alone can only solve a relatively limited number of problems, and cooperative optimal formation control is still an open problem.
In addition, most of the existing research results are based on the same dynamic model, namely the homogeneous agent model [15][16][17][18]. Compared with homogeneous multi-agent systems, multi-agent systems composed of heterogeneous dynamic models are more flexible in practical applications. Therefore, it is of great significance to study heterogeneous multi-agent systems. A large number of valuable research results have been obtained for the heterogeneous cooperative problem [19][20][21].
In this paper, the cooperative optimal formation problem of heterogeneous multi-agent systems is studied on the unmanned aerial vehicle and unmanned ground vehicle model. There are threefold main innovations: Firstly, a heterogeneous modeled UAV-UGV system is proposed, a cooperative architecture of heterogeneous multi-agent systems with equal number is designed, and a Laplacian matrix of communication topology is designed. In addition, a novel block Kronecker product is used to describe the UAV-UGV system. Based on this, distributed formation control is proposed.
The second contribution is to introduce the optimal control method into the formation control protocol, design the distributed formation optimal control protocol, and prove the stability using the method of graph theory.
The third contribution is to design a cooperative formation control protocol for the air-ground system based on the heterogeneous system model so that the UAV-UGV system can achieve the cooperative formation effect. Then, the optimal control is introduced into the cooperative formation control protocol, and the cooperative optimal formation control protocol is designed, which enables the UAV-UGV system formation to quickly achieve the expected effect.

Preliminaries
This section mainly introduces the preliminary knowledge of unmanned aerial vehicles and unmanned ground vehicles, including the use of graph theory to describe the internal relationship of the system and the state-space equation of the UAV system and the UGV system.

Graph Theory
A weighted undirected graph G = (V, E, A) consists of n vertices, where V = (v 1 , v 2 , · · · v n ) represents the set of all vertices in the undirected graph, and each vertex represents an agent.
represents the edge set between vertices, and e ij = v i , v j represents the edge from v i vertex to v j vertex; an edge connection between two vertices indicates that there is an information interaction between these two vertices. The graph is undirected if it allows two-way communication; otherwise, it is directed. A = a ij n×n represents the adjacency matrix indicating the relationship between agents, where a ij is the weight of the side e ij = v i , v j and where the diagonal elements of the matrix A are all 0. For i, j = 1, 2, 3, · · · , n(i = j), if the agents v i and v j can receive information from each other, then the elements in the adjacency matrix are a ij = a ji > 0; otherwise, the element in the adjacency matrix is 0.
In an undirected graph, the degree represents the number of neighbors of a node, that is, the number of edges per node. D = dig{d 1 , . . . , d n } of undirected graph G is a diagonal matrix with d i = ∑ n j=1 a ij .Then, the Laplacian matrix of G is defined as L = D − A, which has at least one zero eigenvalue with 1 = [1, 1 . . . , 1] T as its corresponding right eigenvector. In addition, L has exactly one zero eigenvalue if and only if the directed graph G contains a directed spanning tree.

UGV Dynamics Model
Single UGV motion model: is the velocity in the direction p gi , and u gi = u x gi , u y gi , u z gi T represents the input of agent i. If there are k UGVs, the above formula is converted to the states: Subscript G represents the state variable of the unmanned vehicle.
The expected formation state is h g = h x g , h y g , h z g T , the formation state is transformed into the position state, and the new error position state naturally appears, namely: Therefore, the problem of formation control becomes finding a protocol U G to drive the error vector δ G to zero, which means that (3)

UAV Dynamics Model
The motion model of a single UAV is: where g is the acceleration of gravity; x, y, and z are the positions of the UAV in three coordinate systems; φ, θ, and ϕ are the roll angle, the pitch angle, and the yaw angle of the UAV, respectively; f z is the lift force in the direction of height; M φ , M θ , and M ϕ are the torques on the three axes of the body coordinate system; I x , I y , and I Z are the inertial matrices in the body coordinate system. For L UAVs, the above equations are converted to the state-space form as follows: . where . Ω A T ,P A = (p 1 , p 2 , p 3 . . . p l ),p i = (x i , y i , z i ), i = 1, 2, . . . , l; .
Subscript A represents the state variable of the unmanned vehicle.
The expected formation state is h a = h x a , h y a , h z a T , the formation state is transformed into the position state, and the new error position state naturally appears, namely: Therefore, the problem of formation control becomes finding a protocol U A to drive the error vector δ A to zero, which means that

Heterogeneous Multi-Agent System
To analyze heterogeneous multi-agent systems more conveniently, the UAV system and UGV system are written into the same state space and combined with the state-space model of the single agent above; the form of the heterogeneous multi-agent state-space model is defined as: where Laplace matrix is L = L AA L AG L GA L GG , where L AG , L GA represents information between heterogeneous agent systems. This paper takes the heterogeneous multi-agent system composed of three UGVs and three UAVs as the research object, and its Laplace matrix relationship is as follows: The expected formation state is h = h T a , h T g T , the formation state is transformed into the position state, and the new error position state naturally appears, namely: Therefore, the problem of formation control becomes finding a protocol U to drive the error vector δ to zero, which means that

Design of Control Protocol
To realize the formation of heterogeneous multi-agent systems of UAVs and UGVs, this section is based on the formation control protocol. Firstly, the optimal control law is applied to the single agent. Then, according to the combination of the optimal control law and the formation control protocol, a heterogeneous multi-agent system with distributed optimal formation control is realized. Finally, according to the motion equation of the heterogeneous multi-agent system, the cooperative formation control and cooperative optimal formation control of the heterogeneous multi-agent system are realized. Lemma 1. [22]. For an N * N Laplacian matrix L, Ne −Lt , t > 0 is a random matrix with positive diagonal elements. If L has a unique zero eigenvalue, Rank (N) = N − 1, then its left eigenvector

Formation Control
Formation control protocol for the UAVs: Formation control protocol for the UGVs: where α, β, γ 1 , γ 2 represent the positive gain coefficients, Define the state-space form of the multi-agent system formation: where I is the identity matrix, and ⊗ is the Kronecker product.
Proof of Theorem 1. Substitute Formula (11) into Formula (12) to obtain: According to the linear stability theorem, the parameters α, β, γ 1 , and γ 2 need to be selected so that T d has a zero eigenvalue and other eigenvalues have genuine negative parts. The parameters α and β need to meet the stability of UGV consistency, and the parameters γ 1 and γ 2 need to meet the stability of UAV consistency. After selecting parameters, T d can be converted to a Jordan standard type: T d = PJP −1 . Let v T 1 be the first row of P −1 and the left eigenvector have eigenvalue 0. Let w 1 be the first column of P and the right eigenvector have eigenvalue 0. Therefore, v T 1 w 1 = 1; as time approaches infinity, the system's state becomes:. According to Lemma 1, as time approaches infinity, Systems (2) and (5) asymptotically agree and the systems complete formation.

Optimal Control
The solution of optimal control requires the states of all multi-agents. Before providing performance indicators, Then, define the performance indicator function as: As the UAV and the UGV are independent in different coordinate systems, the UAV weight must be set to Q = q * I 12 , R = r * I 3 , where, q > 0, r > 0. The UGV weight must be set to T = λ * I 6 , γ = µ * I 3 , where λ > 0, µ > 0.
According to the optimal control theory, the optimal control law of a single agent UAV is: The optimal control law for a single agent UGV is: Through the above calculation, the optimal control law u * a can be obtained. Let Similarly, the optimal control law u * g can also be solved, let

Distributed Optimal Formation Control
All UAVs have the same dynamics model, so all UAVs are homogeneous multi-agents. Similarly, all UGVs are homogeneous multi-agents. Therefore, optimal control laws can be extended to the formation control of UAV and UGV multi-agent systems.
Define the multi-agent system to be optimized: where k 4 are derived from the matrix K.g 1 and g 2 are derived from the matrix G.

Theorem 2.
If the unmanned ground vehicle system in (2) and the unmanned aerial vehicle system in (5) use Protocols (17) and (18), respectively, the formation can be completed, and Performance Functions (13) and (14) can be optimized. (17) and (18) shall be unified into the same type:

Proof of Theorem 2. Protocols
where , I is the identity matrix, and ⊗ is the Kronecker product. (19): Elementary row and column transformation can be taken on T l : where T l has only zero eigenvalues. Therefore, we must select the parameters k 1 ,k 2 , k 3 , k 4 , g 1 , and g 2 so that T l has zero eigenvalue, and all other eigenvalues have negative real parts. The parameters k 1 ,k 2 , k 3 and k 4 need to meet the stability of UAV consistency, and the parameters g 1 and g 2 need to meet the stability of UGV consistency. After determining the parameters, T l can be converted to a Jordan standard type: be the first row of P −1 and the left eigenvector have eigenvalue 0. Let w 1 be the first column of P and the right eigenvector with eigenvalue 0. Therefore, v T 1 w 1 = 1; when the time approaches infinity, the system's state becomes: lim t→∞ X = lim t→∞ e T l t X(0), . According to Lemma 1 it is then seen that the system can reach asymptotic consensus in cases where time tends toward infinity.

Heterogeneous Cooperative Formation Control
For UAV: For UGV: In combination with the Laplace matrix, Protocols (21) and (22) are rewritten as: Define the state-space form of the heterogeneous multi-agent formation: . (21) and (22) (7) can be achieved, and (8) is defined in the formation, then formation control is realized.
I is the identity matrix and ⊗ is the Kronecker product.
Internal stability parameters γ 1 and γ 2 should guarantee the stability of a single UAV agent. Therefore, the UAV is written as:  . The characteristic polynomial is: where I is the identity matrix. For a single UAV: According to the Routh-Hurwitz stability criterion: According to the linear stability theorem, the parameter α, β, γ 1 , and γ 2 should be selected so that there is a zero eigenvalue and other eigenvalues have negative genuine part parameters. The parameters α and β must meet the stability of UGV consistency, and the parameters γ 1 and γ 2 must meet the stability of UAV consistency. After selecting the parameters, T s can be converted to a Jordan standard type: T s = PJP −1 . Let v T 1 be the first row of P −1 and the left eigenvector have eigenvalue 0. Let w 1 be the first column of P and the right eigenvector have eigenvalue 0. Therefore, v T 1 w 1 = 1; when the time approaches infinity, the system's state becomes: lim t→∞ X = lim t→∞ e T s t X(0), e T s t X(0) → w 1 v T 1 X(0)(t → ∞) . According to Lemma 1, when the time approaches infinity, the system in (7) asymptotically agrees; that is, the system achieves cooperative formation.

Heterogeneous Cooperative Optimal Formation Control
UAV systems and UGV systems are heterogeneous systems. Applying the optimal control law to the heterogeneous system can be expressed as: where k 1 , k 2 , k 3 ,and k 4 are derived from the matrix K.g 1 and g 2 are derived from the matrix G.
In combination with the Laplace matrix, Protocols (25) and (26) are rewritten as: Define the state space of heterogeneous multi-agent formation: .
Proof of Theorem 4. Each UAV and UGV is defined as a group of formation units, so their number is made the same, that is, L = K; the block Laplacian matrix of the system has the same number of rows and columns.
Then, the heterogeneous system in (7) becomes: According to State Equation (29): It is easy to discover the eigenvalues of the matrixÂ: to the rank criterion of PBH, the system state space is controllable. (28): The T * basic determinant change: Now λI − T * ∼ = λI − Λ, so matrix T * is similar to Λ. Therefore, there is a nonsingular transformation matrix Q, making Λ = QT * Q −1 , . X = Λ · X; Λ is the matrix for which the sum of each row is zero. Therefore, there is at least one zero eigenvalue. Elementary row and column transformation can be taken on T * : it can be seen that: where the Λ and T * have only zero eigenvalues. Therefore, we must select the parameters k 1 ,k 2 , k 3 , k 4 , g 1 , and g 2 so that T * has zero eigenvalue and all other eigenvalues have negative real parts. The parameters k 1 ,k 2 , k 3 , and k 4 must meet the stability of UAV consistency, and the parameters g 1 and g 2 must meet the stability of UGV consistency. After determining the parameters, T * can be converted to a Jordan standard type: T * = PJP −1 .
Let v T 1 be the first row of P −1 and the left eigenvector have eigenvalue 0. Let w 1 the first column of P and the right eigenvector have eigenvalue 0. Therefore, v T 1 w 1 = 1; when the time approaches infinity, the system's state becomes: lim t→∞ X = lim t→∞ e T * t X(0), e T * t X(0) → w 1 v T 1 X(0)(t → ∞) . According to Lemma 1, it is then seen that the system can reach asymptotic consensus in cases where time tends toward infinity.

Simulations
The formation protocol, distributed optimal formation protocol, cooperative formation protocol, and cooperative optimal formation protocol individually designed in this paper are simulated and analyzed using Matlab2016a. The effectiveness of the designed control protocol is verified via simulation. To achieve a better cooperative formation task effect in the system, the speed values set by the UAV system and the UGV system are similar.
Simulations of the UAV system and the UGV system using formation control and distributed optimal formation control are shown in Figures 1 and 2. By comparing the two figures in Figures 1 and 2, it can be found that both protocols can be used to complete triangular formation at the same time, but when distributed optimal formation control is used, it can be observed that the error between the actual position and the set value is significantly reduced in a short period of time. When using the formation control protocol, with parameters = 0.2, = 1.5, = 5, and = 2. Figure 1 shows the change of position coordinates of the multi-agent system and shows the actual formation position of the UAV and UGV when = 10 s. It can be seen that there is a significant error with the set value. When using the formation control protocol, with parameters = 0.2, = 1.5, = 5, and = 2. Figure 1 shows the change of position coordinates of the multi-agent system and shows the actual formation position of the UAV and UGV when = 10 s. It can be seen that there is a significant error with the set value.   When using the formation control protocol, with parameters α = 0.2, β = 1.5, γ 1 = 5, and γ 2 = 2. Figure 1 shows the change of position coordinates of the multiagent system and shows the actual formation position of the UAV and UGV when t = 10 s. It can be seen that there is a significant error with the set value.
When using the distributed optimal formation control protocol, with parameters k 1 = 2.3452, k 2 = 6.4707, k 3 = 7.7541, k 4 = 4.5835, g 1 = 0.4472, and g 2 = 1.0461. Figure 2 shows the position coordinate changes of the system and shows the actual formation status of the UAV and UGV when t = 10 s. It can be observed that the system can quickly complete the triangular formation and that the error between the actual position and the set value is small.
It can be seen from Figures 3 and 4 that the state of each system variable changes with time when the formation control protocol is used. It can be seen from the figures that the state of each variable in the system is stable from 40 s to 50 s. complete the triangular formation and that the error between the actual position and the set value is small. It can be seen from Figures 3 and 4 that the state of each system variable changes with time when the formation control protocol is used. It can be seen from the figures that the state of each variable in the system is stable from 40 s to 50 s.   complete the triangular formation and that the error between the actual position and the set value is small. It can be seen from Figures 3 and 4 that the state of each system variable changes with time when the formation control protocol is used. It can be seen from the figures that the state of each variable in the system is stable from 40 s to 50 s.  From Figures 5 and 6, it can be seen that the system uses the distributed optimal formation control protocol to change the state of each variable with time. It is observed From Figures 5 and 6, it can be seen that the system uses the distributed optimal formation control protocol to change the state of each variable with time. It is observed that the system reaches stability between 30 and 40 s.  The simulation of cooperative formation protocol and cooperative optimal formation protocol of heterogeneous multi-agents is shown in Figures 7 and 8.  The simulation of cooperative formation protocol and cooperative optimal formation protocol of heterogeneous multi-agents is shown in Figures 7 and 8. The simulation of cooperative formation protocol and cooperative optimal formation protocol of heterogeneous multi-agents is shown in Figures 7 and 8. When using the cooperative formation control protocol, with parameters = 0.2, = 1.5, = 5, and = 2. Figure 7 shows the change of position coordinates of the system and the expected formation state of the system at the 10th second. It can be seen that the actual formation position of the system has a significant error with the set value.    When using the cooperative formation control protocol, with parameters = 0.2, = 1.5, = 5, and = 2. Figure 7 shows the change of position coordinates of the system and the expected formation state of the system at the 10th second. It can be seen that the actual formation position of the system has a significant error with the set value. When using the cooperative optimal formation control protocol, with parameter = 2.3452, = 6.4707, = 7.7541, = 4.5835, = 0.4472, and = 1.0461. Figure 8 shows the change in position coordinates of the system and the expected formation state of the system at t=10 s. It can be observed that the system can quickly When using the cooperative formation control protocol, with parameters α = 0.2, β = 1.5, γ 1 = 5, and γ 2 = 2. Figure 7 shows the change of position coordinates of the system and the expected formation state of the system at the 10th second. It can be seen that the actual formation position of the system has a significant error with the set value.
When using the cooperative optimal formation control protocol, with parameter k 1 = 2.3452, k 2 = 6.4707, k 3 = 7.7541, k 4 = 4.5835, g 1 = 0.4472, and g 2 = 1.0461. Figure 8 shows the change in position coordinates of the system and the expected formation state of the system at t=10 s. It can be observed that the system can quickly complete the triangular formation and that the error between the actual position and the set value is small. In addition, the cooperative optimal formation protocol speeds up the convergence rate of the system, which is of great help to the formation time of the system. When using the formation control and the distributed optimal formation control, the formation states of the UAV system at different times are shown in Figures 9 and 10. complete the triangular formation and that the error between the actual position and the set value is small. In addition, the cooperative optimal formation protocol speeds up the convergence rate of the system, which is of great help to the formation time of the system. When using the formation control and the distributed optimal formation control, the formation states of the UAV system at different times are shown in Figures 9 and 10.  Figure 9 shows the formation status of the UAV system at different times under the use of the formation control protocol. It can be observed that the system can complete the triangle formation but also that there is a relative reach error with the set position in the formation completion process and that there is still an error at the fiftieth second.    Figure 9 shows the formation status of the UAV system at different times under the use of the formation control protocol. It can be observed that the system can complete the triangle formation but also that there is a relative reach error with the set position in the formation completion process and that there is still an error at the fiftieth second.   Figure 9 shows the formation status of the UAV system at different times under the use of the formation control protocol. It can be observed that the system can complete the triangle formation but also that there is a relative reach error with the set position in the formation completion process and that there is still an error at the fiftieth second. Figure 10 shows the formation status of the UAV system at different times under the use of the distributed optimal formation control protocol. It can be observed that the system can quickly complete the triangle formation and that the error between the actual position and the set value is very small at the thirtieth second.
When using the formation control and the distributed optimal formation control, the formation states of the UGV system at different times are shown in Figures 11 and 12. Figure 10 shows the formation status of the UAV system at different times under the use of the distributed optimal formation control protocol. It can be observed that the system can quickly complete the triangle formation and that the error between the actual position and the set value is very small at the thirtieth second.
When using the formation control and the distributed optimal formation control, the formation states of the UGV system at different times are shown in Figures 11 and 12.  Figure 11 shows the formation status of the UGV system at different moments when the formation control protocol is used. It can be observed that the UGV system can complete the triangle formation, but there is still a certain error with the set value in the formation completion process. At the thirtieth second, the difference between the actual position and the set value gradually decreases.    Figure 11 shows the formation status of the UGV system at different moments when the formation control protocol is used. It can be observed that the UGV system can complete the triangle formation, but there is still a certain error with the set value in the formation completion process. At the thirtieth second, the difference between the actual position and the set value gradually decreases.   Figure 11 shows the formation status of the UGV system at different moments when the formation control protocol is used. It can be observed that the UGV system can complete the triangle formation, but there is still a certain error with the set value in the formation completion process. At the thirtieth second, the difference between the actual position and the set value gradually decreases. Figure 12 shows the change in the formation shape of the UGV system at different moments when the distributed optimal formation control protocol is used; it can be observed that the UGV system can quickly complete the triangle formation and that the error between the actual position and the set value is small.
When using the heterogeneous cooperative formation control and the heterogeneous cooperative optimal formation control, the formation states of the UAV system at different times are shown in Figures 13 and 14. served that the UGV system can quickly complete the triangle formation and that the error between the actual position and the set value is small. When using the heterogeneous cooperative formation control and the heterogeneous cooperative optimal formation control, the formation states of the UAV system at different times are shown in Figures 13 and 14.  Figure 13 shows the formation status of the UAV system at different times under the use of the heterogeneous cooperative formation control protocol. It is observed that the system can complete the triangle formation. At the thirtieth second, the difference between the actual position and the set value gradually decreases.    Figure 13 shows the formation status of the UAV system at different times under the use of the heterogeneous cooperative formation control protocol. It is observed that the system can complete the triangle formation. At the thirtieth second, the difference between the actual position and the set value gradually decreases.   Figure 13 shows the formation status of the UAV system at different times under the use of the heterogeneous cooperative formation control protocol. It is observed that the system can complete the triangle formation. At the thirtieth second, the difference between the actual position and the set value gradually decreases. Figure 14 shows the formation status of the UAV system at different times under the use of the heterogeneous cooperative optimal formation control. It can be observed that the system can quickly complete the triangle formation and that the error between the actual position and the set value is very small at the tenth second.
When using the heterogeneous cooperative formation control and the heterogeneous cooperative optimal formation control, the formation states of the UGV system at different times are shown in Figures 15 and 16. Figure 14 shows the formation status of the UAV system at different times under the use of the heterogeneous cooperative optimal formation control. It can be observed that the system can quickly complete the triangle formation and that the error between the actual position and the set value is very small at the tenth second.
When using the heterogeneous cooperative formation control and the heterogeneous cooperative optimal formation control, the formation states of the UGV system at different times are shown in Figures 15 and 16.  Figure 15 shows the formation status of the UGV system at different times under the use of the heterogeneous cooperative formation control protocol. It can be observed that the system can complete the triangle formation. At the thirtieth second, the difference between the actual position and the set value gradually decreases.    Figure 15 shows the formation status of the UGV system at different times under the use of the heterogeneous cooperative formation control protocol. It can be observed that the system can complete the triangle formation. At the thirtieth second, the difference between the actual position and the set value gradually decreases.   Figure 15 shows the formation status of the UGV system at different times under the use of the heterogeneous cooperative formation control protocol. It can be observed that the system can complete the triangle formation. At the thirtieth second, the difference between the actual position and the set value gradually decreases. Figure 16 shows the formation status of the UGV system at different times under the use of the heterogeneous cooperative optimal formation control. It can be observed that the system can quickly complete the triangle formation and that the error between the actual position and the set value is very small at the tenth second.
The experiments have verified the formation control and distributed optimization formation control, as shown in Figures 17 and 18, respectively. By comparing Figures 17 and 18, it can be found that both protocols can be used to complete triangular formation at the same time, but when distributed optimal formation control is used, it can be observed that the error between the actual position and the set value is significantly reduced in a short period of time.
When using the formation control protocol, with parameters α = 0.2, β = 1.5, Figure 17 shows the change of position coordinates of the complex system and the expected formation state of the complex system. However, it can be seen that there is a significant error with the set value.
The experiments have verified the formation control and distributed optimization formation control, as shown in Figure 17 and Figure 18, respectively. By comparing Figures 17 and 18, it can be found that both protocols can be used to complete triangular formation at the same time, but when distributed optimal formation control is used, it can be observed that the error between the actual position and the set value is significantly reduced in a short period of time. When using the formation control protocol, with parameters = 0.2, = 1.5, = 5, = 2, Figure 17 shows the change of position coordinates of the complex system and the expected formation state of the complex system. However, it can be seen that there is a significant error with the set value. When using the distributed optimal formation control protocol, with parameters = 2.3452, = 6.4707, = 7.7541, = 4.5835, = 0.4472, and = 1.0461 . Figure   18 shows the change of position coordinates of the complex system and the expected for- Figure 18. Distributed optimal formation control protocol for complex heterogeneous multi-agent systems. 18 shows the change of position coordinates of the complex system and the expected formation state of the complex system. It can be observed that the complex system can quickly complete the triangular formation and that the error between the actual position and the set value is small. The experiments have verified the cooperative formation control and the cooperative optimal formation control, as shown in Figure 19 and Figure 20, respectively. When using the cooperative formation control protocol, with parameters = 0.2, = 1.5, = 5, and = 2, Figure 19 shows the change in position coordinates of the complex  When using the cooperative optimal formation control protocol, with parameters = 2.3452, = 6.4707, = 7.7541, = 4.5835, = 0.4472, and = 1.0461 , Figure   20 shows the change in position coordinates of the complex system and the expected formation state of the complex system. It can be observed that the complex system can quickly complete the triangular formation and that the error between the actual position and the set value is small. In addition, the cooperative optimal formation protocol speeds up the convergence rate of the complex system, which is of great help to the formation time of the complex system.

Conclusions
In this paper, a heterogeneous multi-agent system has been established by analyzing the dynamics model of the unmanned ground vehicle and the unmanned aerial vehicle. Firstly, the formation control protocol is proposed based on the communication topology of a multi-agent system. Then, according to the internal state of a single agent, the optimal control law of a single agent system is designed using the optimal control theory, and the optimal control law is introduced into the system to achieve the distributed optimal formation. Finally, based on the cooperative architecture of the heterogeneous multi-agent When using the distributed optimal formation control protocol, with parameters k 1 = 2.3452, k 2 = 6.4707, k 3 = 7.7541, k 4 = 4.5835, g 1 = 0.4472, and g 2 = 1.0461. Figure 18 shows the change of position coordinates of the complex system and the expected formation state of the complex system. It can be observed that the complex system can quickly complete the triangular formation and that the error between the actual position and the set value is small.
The experiments have verified the cooperative formation control and the cooperative optimal formation control, as shown in Figures 19 and 20, respectively.
When using the cooperative formation control protocol, with parameters α = 0.2, β = 1.5, γ 1 = 5, and γ 2 = 2, Figure 19 shows the change in position coordinates of the complex system and the expected formation state of the complex system. However, it can be seen that there is a significant error with the set value.
When using the cooperative optimal formation control protocol, with parameters k 1 = 2.3452, k 2 = 6.4707, k 3 = 7.7541, k 4 = 4.5835, g 1 = 0.4472, and g 2 = 1.0461, Figure 20 shows the change in position coordinates of the complex system and the expected formation state of the complex system. It can be observed that the complex system can quickly complete the triangular formation and that the error between the actual position and the set value is small. In addition, the cooperative optimal formation protocol speeds up the convergence rate of the complex system, which is of great help to the formation time of the complex system.

Conclusions
In this paper, a heterogeneous multi-agent system has been established by analyzing the dynamics model of the unmanned ground vehicle and the unmanned aerial vehicle. Firstly, the formation control protocol is proposed based on the communication topology of a multi-agent system. Then, according to the internal state of a single agent, the optimal control law of a single agent system is designed using the optimal control theory, and the optimal control law is introduced into the system to achieve the distributed optimal formation. Finally, based on the cooperative architecture of the heterogeneous multi-agent system, the cooperative formation design of the heterogeneous multi-agent system is carried out, and the optimal control theory is introduced into the heterogeneous multiagent system to realize the optimal cooperative formation of the heterogeneous system. The stability of the system is further analyzed by graph theory. The communication topology of the multi-agent system does not interfere with the protocol and the protocol can optimize the performance function while the system completes the formation task. The simulation results show that the optimal control can accelerate the convergence speed of the system and greatly help the system to quickly reach the desired formation state. In the next step, we plan to investigate the anomaly detection and recognition problems under heterogeneous multi-agent cooperation architecture, and we plan to apply the theoretical research results in practice to engineering applications.

Data Availability Statement:
The data that support the findings of this study are available from the corresponding author, Meichen Liu, upon reasonable request.