# Cooperative Localization Using Distance Measurements for Mobile Nodes
## 3 Resolving Rotation and Flip Ambiguities
### Analysis of Rotation Ambiguity  
Firstly, we assume that there only exists rotation ambiguity between \(\mathbf{\mathcal{S}}\) and \(\mathbf{\mathcal{S}}^{*}\), no flip ambiguity. This means that based on the coordination rotation principle [38], \(\mathbf{\mathcal{S}}^{*}\) can be rotated to \(\mathbf{\mathcal{S}}\) using an unknown angle \(\theta\) via (4). Hence, the true (unknown) locations of the nodes \([x_{i},y_{i}]^{T}\), for \(i=1,\ldots,n\), can be obtained by rotating \([x_{i}^{*},y_{i}^{*}]^{T}\) by \(\theta\), i.e.,  
\[\mathbf{\mathcal{S}}=\mathbf{M}(\theta)\mathbf{\mathcal{S}}^{*}. \tag{8}\]  
Therefore, we need to know \(\theta\) to obtain the true locations of the nodes. In order to achieve this, we allow the lead node to move; this movement can then be utilized to obtain information that can be used to recover the locations of other nodes. Consider mobile nodes that are equipped with inertial navigation systems, the lead node can move with known  
Figure 1: Illustration of the positions of nodes calculated via multidimensional scaling (MDS), where red circles are the desired position (randomly generated) and black diamonds are the output of MDS. (**a**) rotation ambiguity only; and, (**b**) rotation and flip ambiguities. displacement and orientation; that is, we let the lead node move to a known position, i.e., \([\Delta x_{1}^{\prime},\Delta y_{1}^{\prime}]^{T}\). Subsequently, the coordinates of all nodes after moving can be obtained as  
\[\mathbf{\mathcal{S}}^{\prime}=\mathbf{\mathcal{S}}+\Delta\mathbf{\mathcal{S}}^{\prime} \tag{9}\]  
where the \(i\)-th column of \(\Delta\mathbf{\mathcal{S}}^{\prime}\) is given by  
\[\Delta\mathbf{\mathcal{S}}^{\prime}_{i}= \begin{cases}[\Delta x_{1}^{\prime},\ \Delta y_{1}^{\prime}]^{T}&i=1\\,\ 0]^{T}&i\
eq 1\end{cases} , \tag{10}\]  
Accordingly, after moving the distance between the \(i\)th and \(j\)th nodes is  
\[d_{i,j}^{\prime}=\|\mathbf{\mathcal{S}}^{\prime}_{i}-\mathbf{\mathcal{S}}^{\prime}_{j} \|,\]  
where \(\mathbf{\mathcal{S}}^{\prime}_{i}\) is the \(i\)th column of \(\mathbf{\mathcal{S}}^{\prime}\). We can then update the distance matrix (2) with the entries \(d_{i,j}^{\prime\,2}\) to give  
\[\mathbf{D}^{\prime}=\psi^{\prime}\mathbf{e}^{T}-2\mathbf{\mathcal{S}}^{\prime\,T }\mathbf{\mathcal{S}}^{\prime}+\mathbf{e}\psi^{\prime\,T}, \tag{11}\]  
where, by considering \(\mathbf{\mathcal{S}}_{1}=[0,0]^{T}\) and \(\Delta\mathbf{\mathcal{S}}^{\prime}_{i}=[0,0]^{T}\) for \(i=2,\ldots,n\),  
\[\psi^{\prime}=\text{diag}(\mathbf{\mathcal{S}}^{\prime T}\mathbf{\mathcal{S}}^{\prime} )=\text{diag}(\mathbf{\mathcal{S}}^{T}\mathbf{\mathcal{S}})+\text{diag}(\Delta\mathbf{ \mathcal{S}}^{\prime\,T}\Delta\mathbf{\mathcal{S}}^{\prime})\triangleq\psi+\Delta \psi^{\prime} \tag{12}\]  
Substituting (9) and (12) into the distance matrix (11) we have  
\[\mathbf{D}^{\prime} =(\psi+\Delta\psi^{\prime})\mathbf{e}^{T}-2(\mathbf{\mathcal{S}}+ \Delta\mathbf{\mathcal{S}}^{\prime})^{T}(\mathbf{\mathcal{S}}+\Delta\mathbf{\mathcal{S}} ^{\prime})+\mathbf{e}(\psi+\Delta\psi^{\prime})^{T}\] \[=(\psi\mathbf{e}^{T}-2\mathbf{\mathcal{S}}^{T}\mathbf{\mathcal{S}}+ \mathbf{e}\psi^{T})+(\Delta\psi^{\prime}\mathbf{e}^{T}-2\Delta\mathbf{\mathcal{S }}^{\prime\,T}\Delta\mathbf{\mathcal{S}}^{\prime}+\mathbf{e}\Delta\psi^{\prime \,T})-2\Delta\mathbf{\mathcal{S}}^{\prime\,T}\mathbf{\mathcal{S}}-2\mathbf{\mathcal{S}}^{ T}\Delta\mathbf{\mathcal{S}}^{\prime}\] \[=\mathbf{D}+\Delta\mathbf{D}^{\prime}-2\Delta\mathbf{\mathcal{S}}^{ \prime\,T}\mathbf{\mathcal{S}}-2\mathbf{\mathcal{S}}^{T}\Delta\mathbf{\mathcal{S}}^{\prime},\]  
giving  
\[\mathbf{0}=\mathbf{D}-\mathbf{D}^{\prime}+\Delta\mathbf{D}^{\prime}-2\Delta \mathbf{\mathcal{S}}^{\prime\,T}\mathbf{\mathcal{S}}-2\mathbf{\mathcal{S}}^{T}\Delta\mathbf{ \mathcal{S}}^{\prime}, \tag{13}\]  
where \(\mathbf{0}\) is a zero matrix with dimensions \(n\times n\). This equation describes the relationship between both the locations and distance matrices pre and post the lead node moving; this information can be used to obtain the angle of rotation \(\theta\).