# Decentralized Consensus Protocols on \(SO(4)^{N}\) and \(Tso(4)^{N}\) with Reshaping
## 3 Consensus on \(SO(4)^{n}\) with Reshaping  
### Proposed Consensus Protocol on \(SO(4)^{n}\)  
Suppose that there are \(N\) agents that share information according to an undirected and connected communication graph. Let \(R_{i}\in SO(4)\) be the configuration of agent \(i\) whose angular velocity tensor is \(\Omega_{i}\). The kinematics associated with the \(N\) agents are  
\[\dot{R}_{i}=R_{i}\Omega_{i} \tag{32}\]  
for \(i=1,\ldots,N\). It is desired to drive the configurations to consensus asymptotically such that \(R_{i}^{T}R_{i}=I_{4}\) for all \((i,j)\) pairs in the steady state. As in the previous section, a Lyapunov-based approach is applied to obtain the consensus protocol by specifying the Lyapunov  
Figure 2: Function \(f(\theta)\) for the Base case and reshaping cases 1 and 2.  
function (which is also a Morse-Bott function) and its derivative. For this purpose, consider the Morse-Bott-Lyapunov candidate function on \(SO(4)^{N}\) as  
\[V(R_{j}^{T}R_{i})=\frac{1}{2}\sum_{1\leq i<j\leq N}a_{ij}\sum_{n=1}^{q}\frac{b_{ n}}{n}\operatorname{tr}(I_{4}-(R_{j}^{T}R_{i})^{n})>0\quad\forall R_{j}^{T}R_{i} \in SO(4)\setminus I_{4} \tag{33}\]  
where \(a_{ij}\) are the elements of the adjacency matrix of the communication graph, and \(R_{j}^{T}R_{i}\) is the relative configuration between agents \(i\) and \(j\), for which the two principal rotation angles are \(\theta_{ij1}\) and \(\theta_{ij2}\). Using Equations (21) and (32), and the undirected property of the graph, the derivative of Equation (33) becomes  
\[\dot{V}(R_{j}^{T}R_{i})=\sum_{i=1}^{N}(\Omega_{i}^{\vee})^{T}\sum_{j=1}^{N}a_{ ij}\psi(R_{j}^{T}R_{i}) \tag{34}\]  
where  
\[\psi(R_{j}^{T}R_{i})=\sum_{n=1}^{q}b_{n}(\sin(n\theta_{ij1})S_{ij1}^{\vee}+ \sin(n\theta_{ij2})S_{ij2}^{\vee}). \tag{35}\]  
Due to the form of Equation (34), it is convenient to choose  
\[\dot{V}(R_{j}^{T}R_{i})=-k\sum_{i=1}^{N}\left\|\sum_{j=1}^{N}a_{ij}\psi(R_{j}^ {T}R_{i})\right\|^{2}\leq 0\quad\forall R_{j}^{T}R_{i}\in SO(4) \tag{36}\]  
where \(k>0\) is a positive gain, thus making Equation (33) a Lyapunov function. The resulting consensus protocol can be solved by equating Equations (34) and (36) as  
\[\Omega_{i}=-k\sum_{j=1}^{N}a_{ij}\psi^{\wedge}(R_{j}^{T}R_{i})=-k\sum_{j=1}^{N }a_{ij}\sum_{n=1}^{q}b_{n}(\sin(n\theta_{ij1})S_{ij1})+(\sin(n\theta_{ij2})S_{ ij2}) \tag{37}\]  
thus yielding the closed loop  
\[\dot{R}_{i}=-\frac{k}{2}\sum_{j=1}^{N}a_{ij}\sum_{n=1}^{q}b_{n}R_{i}[(R_{j}^{T }R_{i})^{n}-(R_{i}^{T}R_{j})^{n})],\quad i=1,\ldots,N. \tag{38}\]  
Note that the consensus protocol in Equation (37) utilizes the relative Laplacian flow since it uses feedback of the relative configurations. This type of protocol is commonly used with undirected graphs and is required to achieve consensus with almost global stability on a compact manifold such as \(SO(4)\). A protocol that utilizes an absolute Laplacian flow [28] would be needed for the case of a directed graph, as was conducted in [29] for \(SO(3)\), although only local consensus stability would be achieved. It will be shown in the next section that there are three possible classifications of equilibria. The consensus equilibrium where configuration synchronization is achieved results from the solution \(R_{j}^{T}R_{i}=I_{4}\) for all \((i,j)\) pairs, which implies that the relative configuration PRAs are \(\theta_{ij1},\theta_{ij2}=0\) and Equation (33) achieves its minimum. The case of \(\theta_{ijk}=\pi\) for at least one pair \((i,j)\) for \(k=1\) and/or \(k=2\) while the remaining PRAs are \(\theta_{ijk}=0\) yields an unstable set, resulting in partial consensus. In both of these cases, \(\psi(R_{j}^{T}R_{i})=0\) for all \((i,j)\) pairs. The third case results when at least one \(\theta_{ijk}\
eq 0\) or \(\pi\), and this results when \(\psi(R_{j}^{T}R_{i})\
eq 0\) for at least one \((i,j)\) pair, while the sum over \(j\) vanishes for \(i=1,\ldots,N\). As will be demonstrated in the simulation, the presence of stable non-consensus equilibria is dependent on the communication topology and reshaping case used.