# Vertex-Weighted Consensus-Based Formation Control with Area Constraints and Collision Avoidance
## 2 Problem Formulation
### Formation Control Design
Based on (5) and (8), a total potential function can be defined as  
\[V=\sum_{i=1}^{N}\big{(}V_{i}+V_{\mathcal{C}_{i}}\big{)}. \tag{10}\]  
The total potential function \(V\) in (10) exploits the collision avoidance capacities of (5), plus the match for all the signed areas formed by the triplets (8), which is useful to avoid ambiguities such as a flipped version of the desired formation and local minima. It is a fact that (10), including (8), causes each area to be counted three times since each area is considered in three of the subsets \(\mathcal{C}_{0},\mathcal{C}_{1},\ldots,\mathcal{C}_{N}\). In other words, vertex \(j\) or \(k\) of the triplet in a different iteration could be the value of \(i\), but that is covered with the gain \(K_{\mathcal{C}_{ijk}}>0\). Actually, if \(K_{\mathcal{C}_{ijk}}\) were equal to \(1/3\), the result obtained would be as if each area had only been counted once. What we obtain by doing it this way is unifying the potential energy Equations (5) and (8) in terms of the vertices instead of having one in terms of bonds [6] and another in terms of triplets [24; 25]. Using \(d^{*}=2a\Rightarrow a=d^{*}/2>0\) according to (6), it is possible to ensure the [PERSON] [24; 25] and Falconi [6] convergence and stability conditions at \(d^{*}=\delta\), with \(d^{*}\) as the desired distance between two defined agents (see Appendix A). Then, the value of \(d^{*}\) is calculated according to  
\[d^{*}=\|I_{ij}\| \tag{11}\]  
For control purposes, we can use the next gradient descent law  
\[\hat{\mathbf{p}}_{i}=-\frac{\partial V}{\partial\mathbf{p}_{i}}, \tag{12}\]  
which can be used as control input for agent \(i\). Then, we have \[\hat{\mathbf{p}}_{i}=\mathbf{U}_{\mathcal{N}_{i}}+\mathbf{U}_{\mathcal{C}_{i}}, \tag{13}\]  
where  
\[\mathbf{U}_{\mathcal{N}_{i}}=-\sum_{j\in\mathcal{N}_{i}}\alpha_{ij}\bigg{(}- \frac{1}{k_{ij}\|l_{ij}\|}\mathrm{csch}^{2}\bigg{(}\frac{\|l_{ij}\|-\delta}{k _{ij}}\bigg{)}+1\bigg{)}I_{ij}, \tag{14}\]  
\[\mathbf{U}_{\mathcal{C}_{i}}=-\sum_{(j,k)\in\mathcal{C}_{i}}K_{\mathcal{C}_{ ijk}}\Big{(}Z_{ijk}-Z_{ijk}^{*}\Big{)} \begin{bmatrix}0&1\\ -1&0\end{bmatrix} I_{jk}. \tag{15}\]  
Since control law (13) is only based on agent \(i\) and its neighbors' \((j,k)\) positions, it could be implemented as a decentralized control as long as every vertex in the graph is part of at least one triplet. This is very useful because every 2D shape could be represented as a 2D triangulated mesh; this allows us to reduce the number of connections between agents. The signed area function defined in (9) requires the global positions \(\mathbf{p}_{i}\), \(\mathbf{p}_{j}\), and \(\mathbf{p}_{k}\) for control. However, this function can be expressed in terms of the relative position of \(\mathbf{p}_{j}\) and \(\mathbf{p}_{k}\) with respect to \(\mathbf{p}_{i}\) for decentralized control purposes. Then, (9) can be rewritten as  
\[Z_{ijk}=\frac{1}{2}I_{ij}^{T} \begin{bmatrix}0&1\\ -1&0\end{bmatrix} I_{ik}. \tag{16}\]  
The use of a signed area function (16) allows for the control of any number of agents in a decentralized way because we only need the neighbor's relative position. Notice that the proposed control law in (13) is designed for holonomic robots. In the case of non-holonomic systems, such as differential-drive mobile platforms, the transformation in (4) can be useful to drive the non-holonomic with \((v_{i},\omega_{i})\) inputs. Then, the agents converge in the position \((x_{i}^{L},y_{i}^{L})\) rather than \((x_{i},y_{i},\theta_{i})\).