# Vertex-Weighted Consensus-Based Formation Control with Area Constraints and Collision Avoidance
## 2 Problem Formulation
### Formation Control Design  
Since communication topology among a set of robots can be represented with an undirected graph, some basic graph theory concepts are summarized ahead. An undirected graph with \(N\) elements is defined as a pair \(G=(\mathcal{V},\mathcal{E})\), where \(\mathcal{E}\subseteq\mathcal{V}\times\mathcal{V}\) is the edge set of cardinality \(M\) and \(\mathcal{V}=\{v_{i},i=1,2,\cdots,N\}\) stands for the vertex set of cardinality \(N\). An edge \(\mathcal{E}_{k}=(v_{i},v_{j})\) represents bidirectional communication between agents \(i\) and \(j\), where \(\mathcal{E}_{k}\) is the \(k\)-th edge of \(G\). Inspired by the edge-tension function proposed in [6], we define a vertex-tension function for every vertex \(v_{i}\in\mathcal{V}\) instead of every edge in the graph. The vertex-tension is defined as  
\[V_{i}=\sum_{j\in N_{i}}\alpha_{ij}\Bigg{(}\coth\left(\frac{\|I_{ij}\|-\delta}{ k_{ij}}\right)+\frac{1}{2}\|I_{ij}\|^{2}-V_{ij}^{min}\Bigg{)}, \tag{5}\]  
where \(\mathcal{N}_{i}=\{\forall v_{j}\in\mathcal{V}\mid(i,j)\in\mathcal{E}\}\) is the subset of neighbors of the \(i\)-th robot, and \(K_{ij}\) is a constant that defines a related position of the minimum of the edge-tension function, i.e., the desired distance for each couple of agents. Moreover, \(\alpha_{ij}\) defines the intensity of the inter-robot influence, \(\delta\) is a safety distance to avoid collision between agents, and \(V_{ij}^{min}\) is defined as follows  
\[\min_{\|I_{ij}\|>\delta}V_{i}=0 \tag{6}\]  
Finally, \(\mathbf{l}_{ij}=\mathbf{p}_{i}-\mathbf{p}_{j}\) is the edge vector between agents \(i\) and \(j\), where \(\mathbf{p}_{i}\) is the state of the \(i\)-th agent. In the case of differential-drive robots, the state of the \(i\)-th agent is given by  
\[\mathbf{p}_{i}= \begin{bmatrix}x_{i}^{L}\\ y_{i}^{L}\end{bmatrix}  \tag{7}\]  
Inspired by [24; 25], we proposed creating a connected graph such that every vertex \(v_{i}\in\mathcal{V}\) is part of at least one triplet \((i,j,k)\), where \(\{(i,j),(i,k),(k,i)\}\in\mathcal{E}\) (see Figure 2). Every triplet is related to a signed area function that can be useful to avoid ambiguities and local minima. The set of all triplets \((i,j,k)\) in the graph is denoted by \(\mathcal{C}\). Notice that if we permute the triplet in a cyclical way, we will be referring to the same triplet, that is, \((i,j,k):=(k,i,j):=(j,k,i)\). Then, we can define the subset \(\mathcal{C}_{i}=\{(j,k)|(i,j,k)\in\mathcal{C}\}\) that denotes all triplets where the vertex \(v_{i}\) is involved. Figure 2: Formation patterns for experiments. The desired edge lengths in the formation are defined with the \(k_{ij}\) values, and the desired signed area terms are defined with the \(Z_{ijk}^{*}\) values. (**a**) Hexagonal formation with six agents. (**b**) Rectangular formation with six agents. (**c**) Square formation with four agents. As an example, we can see that the set \(\mathcal{C}\) for Figure 2a is defined as  
\[\mathcal{C}=\{(0,1,5),(1,2,3),(3,4,5),(1,3,5)\},\]  
where we have the next subsets  
\[\mathcal{C}_{0} =\{(1,5)\}\] \[\mathcal{C}_{1} =\{(5,0),(2,3),(3,5)\}\] \[\ldots\] \[\mathcal{C}_{5} =\{(0,1),(3,4),(1,3)\}.\]  
We proposed the triplet-tension function for every vertex \(v_{i}\)  
\[V_{\mathcal{C}_{i}}=\sum_{(j,k)\in\mathcal{C}_{i}}\frac{1}{2}K_{\mathcal{C}_{ ijk}}\Big{(}Z_{ijk}-Z_{ijk}^{*}\Big{)}^{2}, \tag{8}\]  
where \(K_{\mathcal{C}_{ijk}}\in\mathbb{R}\) is a constant greater than zero that allows for avoiding ambiguities and local minima. Moreover, \(Z_{ijk}\) and \(Z_{ijk}^{*}\) are the currently signed area and desired signed area of the triplet \((i,j,k)\), respectively. The triplet area \(Z_{ijk}\) is defined as  
\[Z_{ijk}:=\frac{1}{2}\text{det}\Bigg{[} \begin{array}{ccc}1&1&1\\ \mathbf{p}_{i}&\mathbf{p}_{j}&\mathbf{p}_{k}\end{array} \Bigg{]}. \tag{9}\]  
As can be seen in (9), \(Z_{ijk}=Z_{kij}=Z_{j\mu}\) because of the switching property of the determinant. Moreover, the triplet could be permuted in a cyclical way.