Cooperative Localization Using Distance Measurements for Mobile Nodes

This paper considers the two-dimensional (2D) anchorless localization problem for sensor networks in global positioning system (GPS)-denied environments. We present an efficient method, based on the multidimensional scaling (MDS) algorithm, in order to estimate the positions of the nodes in the network using measurements of the inter-node distances. The proposed method takes advantage of the mobility of the nodes to address the location ambiguity problem, i.e., rotation and flip ambiguity, which arises in the anchorless MDS algorithm. Knowledge of the displacement of the moving node is used to produce an analytical solution for the noise-free case. Subsequently, a least squares estimator is presented for the noisy scenario and the associated closed-form solution derived. The simulations show that the proposed algorithm accurately and efficiently estimates the locations of nodes, outperforming alternative methods.


Introduction
Because of the increased availability of low-cost low-power sensors, smart sensors, and multi-functional sensors, wireless sensor networks are becoming increasingly ubiquitous [1][2][3][4]. Wireless sensor networks are being utilized in a diverse array of tracking and monitoring applications from environmental [5] and health monitoring [6] to traffic [7] and border surveillance [8]. In many of these applications, the nodes in the network are mobile and knowledge of their positions is a prerequisite for completing the task, and crucial for information sharing, data collection, and scheduling [9]. For example, if the locations of the nodes are unknown or significantly incorrect, the data they have collected from surrounding environment, such as wildlife [10] or weather information [11], will be useless, since the positional information is not available.
Localization algorithms estimate the locations of unknown nodes in the network using the positions of a known subset of the nodes to provide the required positional information. The most widely used localization techniques in the literature are distancebased localization algorithms, such as trilateration, radio interference positioning system (RIPS) [12], and the Hop-Distance algorithm [13]. These algorithms estimate the internode distances and require anchors, which is nodes with known locations, to provide the locations of the remaining nodes. The location of the anchor nodes is accessed via global positioning system (GPS) or a priori information [12,[14][15][16][17][18].
While, GPS is widely used in locating unknown nodes in many situations, such as indoor, urban, and forest environments, the positions of nodes are difficult to obtain from GPS [19][20][21][22]. In this case, the anchors are absent or the positions of the anchors are not available, and the above algorithms cannot be applied. This is widely regarded as the most significant challenge in the positioning and navigation field [23][24][25]. Therefore, there is an increasing need for anchorless localization of sensor networks for use in GPS-denied or contested environments. Using the movement of nodes and the inter-node communication, cooperative localization can be leveraged in order to solve this problem. This scenario arises in the field of robotics swarms, especially in the navigation and formation control of unmanned aerial vehicles swarms under a GPS-denied environment [20,[25][26][27].
In practice, cooperative localization can be achieved by utilizing the inter-node distances [28]. However, relative localization only gives node positions that satisfy the distance constraint, which means that there could be ambiguity problems, i.e., ambiguity due to rotation and/or flip [29]. The multidimensional scaling (MDS) algorithm is a widely used algorithm that is capable of tackling the anchorless localization problem [30][31][32][33][34][35]. The aim of MDS is to represent the similarity (or dissimilarity) of high dimensional data in a lower dimensional map which describes the relative distances between pairs of objects (in this case sensor nodes). Like other relative localization methods MDS can also be subject to the ambiguity problem; hence, algorithms have been proposed to attempt to address this problem. In [36] a MDS-based algorithm using moving nodes is presented, which constructs a cost function involving velocities and inter-node distances of all nodes at two consecutive time instants. In [37], a similar algorithm is proposed to solve the anchorless localization problem for nodes that can estimate the position via a nonlinear least square estimator; however, in this case, only one node is moving.
In this paper, we present an efficient algorithm for anchorless cooperative localization that is based on MDS. The algorithm mitigates the rotation and flip problems by taking advantage of the movement and inter-node communication of the mobile nodes. Unlike existing algorithms that operate in an iterative manner the proposed algorithm presents a closed-form solution that is computationally efficient. The algorithm is first derived in the noise-free case and the theoretical result is given. Subsrquently, the noisy case is considered and the associated closed-form estimator is presented. The proposed algorithm is supported by a rigorous theoretical derivation which provides optimal parameters. The simulation results support the theoretical analysis and indicate that the algorithm outperforms alternative methods.
This paper is organized, as follows: Section 2 introduces the background to the MDS algorithm and the associated ambiguity problem. The theoretical solution to the ambiguity problem is then presented in Section 3. Based on the theoretical analysis, Section 4 describes the impact of noise and introduces the proposed closed-form estimator for determining positions in noisy scenarios. Section 5 presents simulations for validating the proposed algorithm and, finally, Section 6 concludes the paper.

Multidimensional Scaling Algorithm
In this section, we briefly introduce the MDS algorithm and the ambiguity problem in an ideal scenario. As stated previously, the goal of MDS is to find a representation of the data that provides a low dimensional map (usually two or three dimensions) of the relative positions of the nodes based on their pairwise distances. If we consider the two-dimensional case where there are n nodes with their true coordinates denoted by S i = [x i , y i ] T where i = 1, . . . , n and n ≥ 3. Afterwards, in the noise-free case the distance between nodes i and j, where i, j = 1, . . . , n and i = j is given by d i,j . If we assume in the ideal scenario that the nodes are able to measure the true distances between each other so that the pairwise distance between two nodes with coordinates S i and S j is given by and, furthermore, the squared distance d 2 i,j can be written as then we have the following symmetric Euclidean distance matrix: If S = [S 1 , · · · , S n ] is the collection of all of the node coordinates and ψ is the diagonal elements of S T S, i.e., then we can rewrite D as where e = [1, . . . , 1] T is the vector of ones of length n. Using the centering operation H = I − ee T /n, then we have where UΛU T is the eigendecomposition of the symmetric matrix − 1 2 HDH. Then we can recover S (up to a translation and orthogonal transformation) via the following formula MDS is an efficient algorithm for resolving the relative positions of the nodes [32]. However, as is apparent from the above analysis, in the absence of anchor nodes, MDS can only give relative positions of the nodes, which can include rotation and flip ambiguity. In other words, the result of MDS maintains the relative inter-node distances; however, these calculated locations of the nodes may be flipped and/or rotated versions of the true positions of the nodes. Obviously, when considering navigation of mobile nodes or formation control of the sensor network, incorrect positions of the nodes can lead to problems.

The Ambiguity Problem
In order to consider the ambiguity problem, we assume a set of n nodes in 2D Euclidean space. We fix a coordinate system, which, without a loss of generality, places the first node s 1 at the origin: s 1 = [0, 0] T . We recall that knowledge of the distances provides an ambiguity up to a universal Euclidean transformation of the nodes. This fixing of node 1 at the origin removes the shift from this Euclidean transformation. Accordingly, the solution of the MDS, S * , is replaced by subtracting s * 1 from each column, so that, with some abuse of notation, s * 1 = [0, 0] T , and the other s * j become s * j − s * 1 . Once the shift is removed, the remaining ambiguity devolves to a rotation and a reflection (flip). We give the definitions of rotation and flip ambiguities, as follows.

Definition 2 (Flip ambiguity). Flip ambiguity occurs if
Remark 1. The matrix F can be defined equivalently by F = 1 0 0 −1 . This definition can be obtained via simply rotating (6) by π. In the following analysis, we use the definition of F as in Definition 2.
It can be seen that rotation ambiguity and flip ambiguity can occur simultaneously. If this is the case, then the true positions can be represented by S = M(θ)FS * .
(7) Figure 1 shows samples of these two ambiguities.

Resolving Rotation and Flip Ambiguities
In this section, the rotation ambiguity is analyzed mathematically in the noise-free scenario and an analytical solution to the rotation and flip ambiguities presented.

Analysis of Rotation Ambiguity
Firstly, we assume that there only exists rotation ambiguity between S and S * , no flip ambiguity. This means that based on the coordination rotation principle [38], S * can be rotated to S using an unknown angle θ via (4). Hence, the true (unknown) locations of the nodes [x i , y i ] T , for i = 1, . . . , n, can be obtained by Therefore, we need to know θ 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 displacement and orientation; that is, we let the lead node move to a known position, i.e., [∆x 1 , ∆y 1 ] T . Subsequently, the coordinates of all nodes after moving can be obtained as where the i-th column of ∆S is given by Accordingly, after moving the distance between the ith and jth nodes is where S i is the ith column of S . We can then update the distance matrix (2) with the entries d 2 i,j to give where, by considering Substituting (9) and (12) into the distance matrix (11) we have where 0 is a zero matrix with dimensions n × 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 θ. If we break the analysis of (13) into three parts, then we have the following: 1. Since only the lead node's position is changed, then the term D − D in (13) becomes 2. In (13), ∆D is the distance matrix between point ∆S 1 and n − 1 origin points [0, 0] T , i.e., 3. For the term −2∆S T S − 2S T ∆S in (13), since S T ∆S can be calculated by Inserting the rotation (8) into x i ∆x 1 + y i ∆y 1 in (16), for i = 2, . . . , n, we have Using (18) allows us to express (17) in a way that is independent of [x i , y i ] T . If we combine (14)- (18), then (13) becomes where with coefficients Equation (19) is equivalent to the following system of equations: Finally, the solution to (24) is the angle to resolve the rotation ambiguity. Importantly, this solution can be shown to be unique when n ≥ 3. If we consider the case of n = 3, then (24) can be expressed as Obviously, given W 1 and W 2 , (25) has a unique solution to θ within [−π, π). Similarly, it is straightforward to show that, when n ≥ 3, (24) has a unique solution within [−π, π).

Analysis of Rotation and Flip Ambiguities
Having obtained a unique solution to the rotation angle when only rotation ambiguity is present, in this section we present an analytical solution that is based on the analysis in Section 3.1 for when rotation and flip ambiguities occur simultaneously. The key idea behind this method is again to use the mobility of the lead node to acquire extra information in order to detect the flip of the initial MDS localization result.
Firstly, we assume that there exist three non-collinear nodes in order to be able to detect flip ambiguity. Next, we note that the ith equation in (24) has the following solutions θ i,1 and θ i,2 : where atan2(·, ·) ∈ [−π, π) is the 2-argument arctangent. Therefore, the solution to (26), which is common to all values of i, ∀i = 2, . . . , n is the unique solution to (24). It can also be shown that θ i,1,2 ∈ [−π, π) given in (26) can be rewritten and rearranged into a concise form can wrap any arbitrary angle t in radians into range [−π, π). Appendix A provides the full derivation of these equations.

represent the angles between vectors
. . , n, as shown in Figure 2, and play an important role in the ability to detect flip ambiguity. When there is only rotation ambiguity, because of the uniqueness of solution of (24), we have θ i,1 = θ j,1 , ∀i, j = 2, . . . , n, as shown in the previous section. Whereas, the angles θ i,2 in (28) are the summation of θ i,1 and the angle induced by ∆x 1 and ∆x 2 . Obviously, if there exist three non-collinear nodes, Θ i = Θ j , ∀i, j = 2, . . . , n and i = j and, therefore, from (28) we have θ i,2 = θ j,2 , ∀i, j = 2, . . . , n. In contrast, it can be shown that flip ambiguity exists if and only if θ i,1 = θ j,1 , ∀i, j = 2, . . . , n and i = j. In order to illustrate why this is the case, we give the counter example, assuming without loss of generality, that n = 3, θ 2,1 = θ 3,1 and flip ambiguity exists. θ 2,1 = θ 3,1 implies that S * i , i = 2, 3, can be rotated simultaneously to the true positions S i via either θ 2,1 or θ 3,1 , as shown in Figure 2a. Hence, this contradicts the assumption of the existence of flip ambiguity. Furthermore, extending to the case where n > 3, still assuming that θ 2,1 = θ 3,1 and flip ambiguity exists. We know that, for i = 2, 3, S * i can be simultaneously rotated to the true positions S i via θ 2,1 (or θ 3,1 ). Because there exist three non-collinear nodes, then three nodes with correct positions are sufficient for guaranteeing the localization of the whole network [39]. In this case, s 1 , s 2 and s 3 can be found exactly from θ 2,1 (or θ 3,1 ). Therefore, S i , for i = 4, . . . , n, must be solvable via rotating S * i by angle θ 2,1 (or θ 3,1 ) and, as a result, θ i,1 = θ 2,1 = θ 3,1 . This again contradicts the assumption of existence of flip ambiguity. On the other hand, if θ i,1 = θ j,1 , ∀i, j = 2, · · · , n and i = j, then it is obvious that there exists flip ambiguity, since s * i cannot be rotated to S i simultaneously. As a conclusion, there exists flip ambiguity if and only if θ i,1 = θ j,1 , ∀i, j = 2, · · · , n and i = j.
In what follows, we assume that there exist three non-collinear nodes and, based on the above analysis, we make the following conclusion: ∀i, j = 2, . . . , n and i = j θ i,1 = θ j,1 (equivalently θ i,2 = θ j,2 ), If no flip ambiguity exists.
Although we cannot use (27)- (29) directly to determine the existence of flip as they contain unknown true positions, those results are crucial in deriving the estimator for locations in noisy scenario.
In reality, the solution to (24) is computed using S * , ∆S and D . We denote this unique solution by θ R S * , ∆S , D . The same notation θ R (·, ·, ·) is used to denote a rotation angle that is calculated with different variables, nonetheless, whatever the variables used, the method is the same as described above. If we denote the positions that are calculated using the rotation angle θ R S * , ∆S , D as S * * we have the following result If the lead node then moves to a second position [∆x 1 , ∆y 1 ] giving a matrix formed by true positions S = S + ∆S , where ∆S = ∆S 1 , ∆S 2 , . . . , ∆S n = ∆x 1 0 · · · 0 ∆y 1 0 · · · 0 .
After obtaining a new distance matrix D at position S , we can solve θ R (S * * , ∆S , D ). If θ R (S * * , ∆S , D ) = 0, then there is no flip ambiguity and the true positions are S = S * * ; otherwise, we move to the process of resolving the flip ambiguity. For this, according to Definition 2, all the values in S * along the x−axis are required to be flipped to obtain FS * . Subsequently, we only need to calculate the rotation angle using θ R (FS * , ∆S , D ). It should be noted that, since ∆S and D are fixed, it is unnecessary to take any new measurements and the true position S can be resolved by

Proposed Algorithm Robust to Ambiguity and Noise
The analysis in the previous section assumes ideal measurements; however, in practice, the measurements are corrupted by noise that can have a significant impact on the localization performance. If we consider the distances between two nodes, in the noise-free case the distance between the ith and jth nodes is the same regardless of which node it is measured from, i.e., d i,j = d j,i . When noise is introduced, this is no longer the case, if we denote the measured distances asd i,j andd j,i , thend i,j =d j,i resulting in uncertainty in our estimates of the distances. In general, the measured distance between the ith and jth nodes can be modeled byd where d i,j is the true distance and ω i,j is the measurement noise.
As we know that d i,j = d j,i when the noise is absent, therefore, in order to obtain a symmetric EDM in noisy case, we can usê where E(d i,j ,d j,i ) is an estimator for the distance between i-th and j-th nodes usingd i,j and d j,i . In practice, this estimator is designed by using the knowledge of noise distribution. For example, when the noise ind i,j andd j,i are assumed to comprise independent and identically distributed (i.i.d.) normal distributions, then we haved i,j =d j,i = 1 2 d i,j +d j,i [40]. Because the study of the estimator E(d i,j ,d j,i ) and estimation of the EDM is outside the scope of this article, we refer the interested reader to [40,41] for more information, including completing and estimating an EDM.
Accordingly, the estimated symmetric EDM D can be obtained while usingd i,j . Similarly, we can obtain D by using the new position of S = S + ∆S , as described in (10).
In (24), in the noise-free case, the solution is unique and easy to find. However, in the noisy environment, the theoretical unique solution to (24) is not guaranteed. Therefore, a key issue in estimating θ is to find a value that satisfies a certain objective, i.e., where Obj θ; S * , ∆S , D is an objective function of θ given S * , ∆S , and D . In general, the least square estimator provides a good choice of objective function, as it is a well defined computationally efficient estimator. The objective function based on the least square estimator is given by Solutions to (37) can be obtained by taking the derivative of the objective function with respect to θ and equating to zero, from this we obtain a quartic equation (see Appendix B for details), which has, at most, four real roots giving the corresponding collection of angles as where λ j ∈ [−1, 1], j = 1, . . . , m, and m is the number of solutions, such that 1 ≤ m ≤ 4. Subsequently, (37) becomes and, accordingly, by (30) In order to detect flip ambiguity, we can follow the same method, as described in Section 3, i.e., let the lead node move to another position [∆x 1 , ∆y 1 ] T and solve θ R (S * * , ∆S , D ) via (38) while using the estimated distance matrix D obtained at the new position S = S + ∆S . However, becasue of the presence of noise θ R S * * , ∆S , D is not necessarily equal to 0 when there is no flip ambiguity. To handle this, we need to create a detector for the flip. For this, we use a straightforward threshold detector: The following proposition, the proof of which is given in Appendix C, allows for us to efficiently find an optimal threshold in (40).
As a conclusion, the positions of nodes can estimated using the following formula: Algorithm 1 summarizes the algorithm to estimate locations of nodes with noisy measurements.

Simulations
Networks with randomly generated nodes were used to test the performance of the proposed algorithm. In all of the following simulations the position of the first node is fixed to [0, 0] and the positions of the other nodes are uniformly generated within [−20, 20].
To validate the proposed approach that can address the ambiguity problem, we use the same noise-free scenarios as given in Figure 1 the results of which are shown in Figure 3. Unlike the results that are obtained from the MDS alone, as shown in Figure 1, when we compare the locations of the true and estimated nodes in Figure 3, we can see that, while using the method that is presented in Section 3, the rotation and flip ambiguities are solved correctly and, therefore, the positions of the nodes are successfully recovered.  Next, we consider the noisy scenario, as discussed in Section 4, in the noisy scenario the detection of whether flip has occurred is no longer straightforward and requires an appropriate choice of threshold. Firstly, to demonstrate the ability of the proposed algorithm to detect flip or no flip states, we tested two different network configurations: one with the number of nodes n = 6 and the other with n = 10. The noise is assumed to be Gaussian distributed with mean 0 and standard deviation, σ, of 0.01. For each of the configurations, the outcomes of 50 simulations are shown in Figure 4. The results show that the proposed algorithm can correctly detect flip ambiguity in the noisy scenario.  Having established that the proposed algorithm can successfully deal with the ambiguity problem, we now consider the performance of the algorithm in terms of the accuracy of the localization. For the sake of simplicity, we define the noise level, standard variance of the noise, as δ = −20 log 10 σ, with δ chosen to range from 20 to 50 in steps of five and σ calculated accordingly. For each noise level, the Root-Mean-Square Error (RMSE) from 2000 simulations is used to evaluate the performance of the localization. The RMSE is defined by where (x i,j , y i,j ) and (x i,j ,ŷ i,j ) are the true and estimated location of i-th, i = 1, · · · , n, node in j-th, j = 1, · · · , m, Monte Carlo simulation. It is assumed that (x i,j , y i,j ) is generated within region [−100, 100] × [−100, 100] uniformly in each Monte Carlo simulation.
In order to provide a comparison with the proposed algorithm, we implemented the nonlinear least squares estimator (NLSE) that is presented in [37], solving the nonlinear least square problem using an optimization method. Additionally, the proposed algorithm essentially takes advantage of the mobility of the node to create virtual anchors for localizing the unknown nodes. As a result, the alignment method of relative locations proposed in [30,42] can be potentially applied in this scenario. As a comparison, the performance of this conventional method is also given.
From the simulation results that are shown in Figure 5, it can be seen that the proposed algorithm has better performance in terms of the RMSE for different noise levels and numbers of nodes than the NLS estimator with the conventional method. The localization error are arise from two effects: 1. MDS localization error; 2. mis-alignment error, i.e., the error from inaccurately aligning the positions. Additionally, it should also be noted that the algorithm proposed in this paper can simultaneously estimate the positions of all of the nodes, which cannot be achieved using the algorithm that was presented in [37]. As an indication of the computational efficiency of the proposed algorithm, our simulations indicate a ratio of required CPU time of the proposed algorithm relative to NLSE is Proposed algorithm:NLSE = 1:8.83.  Figure 5. The Root-Mean-Square Error (RMSE) for the proposed algorithm, the NLS estimator [37], NLSE, and conventional algorithm proposed in [30,42] for different numbers of nodes and different noise levels.

Conclusions
In this paper, we have presented an efficient cooperative localization algorithm that is based on MDS. The algorithm provides a practical solution for anchorless localization of mobile nodes using noisy measurements. Unlike traditional MDS algorithms, which suffer from an ambiguity problem, the algorithm that is presented here can solve the flip and rotation ambiguities and accurately estimate the positions of nodes in 2D space. The simulation results demonstrate the accuracy of the algorithm, showing that it outperforms alternative methods. At the same time, the proposed algorithm provides greater efficiency than alternative solutions that operate in an iterative manner by providing a closed-form solution. We point out that the main limitations of this algorithm are twofold. Firstly, as mentioned above, this algorithm has been developed in a 2D scenario, which limits its application in more complex situations. Although one may follow a similar procedure to derive the corresponding algorithm for a more general case, i.e., 3D space, this is non-trivial, as the geometry of the network has more degrees of freedom in the 3D space. Secondly, and in a similar vein to other algorithms, the algorithm proposed here requires inertial navigation to provide the displacement of the moving node. Consequently, a deeper analysis of the error that arises from the inertial navigation system should be taken into account in improving this algorithm. These issues will be addressed in future work.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following variables are used in this manuscript: The distance between nodes i and j The diagonal elements of S T S The following notation is used to denote changes in the variables:

(·)
The parameter after the first movement

(·)
The parameter after the second movement

∆(·)
The change in the parameter after the first movement

∆(·)
The change in the parameter, relative to the original, after the second movement For example, S is the collection of true locations of all of the nodes incorporating the changes in position, i.e., S = S + ∆S , similarly S = S + ∆S . It should be noted that S = S + ∆S can be re-formulated as S = S + ∆S with ∆S ∆S − ∆S .