Experimental Results on Agent-Based Indoor Localization using WiFi Signaling

This paper discusses experimental results on the possibility of accurately estimating the position of smart devices in known indoor environments using agent technology. Discussed localization approaches are based on WiFi signaling, which can be considered as an ubiquitous technology in the large majority of indoor environments. The use of WiFi signaling ensures that no specific infrastructures nor special on-board sensors are required to support localization. Localization is performed using range estimates from the fixed access points of the WiFi network, which are assumed to have known positions. The performance of two range-based localization algorithms are discussed. The first, called Two-Stage Maximum-Likelihood algorithm, is well-known in the literature, while the second is a recent optimization-based algorithm that uses particle swarm techniques. Results discussed in the last part of the paper show that a proper processing of WiFi-based range estimates allows obtaining accurate position estimates, especially if the optimization-based algorithm is used. Keywords—WiFi-based localization; indoor localization; particle swarm optimization; agent technology


I. INTRODUCTION
In recent years, mobile devices and smart appliances have assumed a relevant impact on everyday life and their number has rapidly increased.Such devices can be commonly used in a variety of contexts, including, e.g., fitness activity and sport, tourism and outdoor navigation, monitoring of environmental parameters, social networks and social games.One of the weaknesses observed in available smart appliances is that they do not yet offer support for accurate indoor localization.While outdoor localization is effectively achieved using various assisted technologies, such as the Global Positioning System (GPS), accurate indoor localization is still an open issue (e.g., [1], [2]).Recently, the use of specific technologies to support indoor localization has been investigated.Among such technologies, it is worth recalling Ultra Wide Band (UWB), which seems to be very promising (e.g., [3], [4]).The large bandwidth and the high time resolution of UWB signals reduce the impact of phenomena which typically interfere with wireless communications in indoor environments (e.g., non-line-of-sight propagation, multi-path, and multiple access interference) [5].The main drawback of this technology is that it requires a dedicated infrastructure which is not widely available in common indoor scenarios, and which is also still expensive today.In order to overcome such a limitation, we focus in this paper on indoor localization approaches based on the use of WiFi technology, which can be easily found in almost all indoor environments.
In the experimental scenario discussed in this paper, WiFi-based localization is addressed by means of agent technology.Presented experimental results are obtained by using an addon module for the Java Agent and DEvelopment framework (JADE) [6].JADE has been developed during the last 20 years and, in 1998, four of the major manufactures of mobile appliances of the time started a joint research initiative [7] to bring agent technology to what we used to call Java-enabled phones at the time.The results of such an initiative eventually became the base of JADE for Android [8].Since then, nomadic agents have been considered one of the most promising applications of agent technology and JADE, together with its companion language JADEL [9]- [11], is a consolidated tool in this field which has been used for many applications (e.g., [12]- [14]).The significant opportunities that the synergic combination of agents and smart appliances offer have already been investigated, e.g., in the scope of the Agent-based Multi-User Social Environment (AMUSE) project [15].AMUSE is a major evolution of JADE and it consists of an open-source platform built on top of JADE that addresses specific issues of online social games, which is an application domain where the use of agents is particularly promising.AMUSE has already been fruitfully used to experiment mixed-reality games, in which the possibility of interacting with the physical world becomes crucial [16].In addition, other examples of games that can be developed using AMUSE include social games in indoor areas with high concentration of potential users, like halls of shopping malls, waiting areas of airports and train stations, interactive museums and exhibits, and covered markets in historic towns.Such areas typically offer dedicated WiFi coverage by means of Access Points (APs) spread in the environment, which can be used to support effective localization by means of dedicated techniques as discussed in the following sections.Note that discussed techniques only requires that the WiFi receiver is active on smart appliances and they do not necessitate that appliances are connected to one of the WiFi networks of the area.
The JADE module used to obtain experimental results discussed in this paper can be used to develop agents capable of sensing their positions with respect to a fixed reference frame in known indoor environments [17].Localization is performed by properly processing estimates of the distances between the smart appliance where the agent runs and the APs of the WiFi network, whose positions are assumed to be known.In such scenarios, estimated distances among the smart appliance and APs can be used to feed a localization algorithm which is in charge of providing the agent with an estimate of its position.Experimental results discussed in this paper show that the accuracy of the two discussed localization algorithms are comparable.Actually, both can achieve an accuracy in the order of 1 m, and even better accuracy can be obtained by properly averaging range estimates.Note that the paper focuses on presenting two of the localization algorithms available in the JADE add-on module, and a detailed description of the architecture of the module is left for a future paper.This paper is organized as follows.Section II introduces the problem of localization and discusses relevant related work.Section III shows how WiFi signaling can be used to obtain information on the position of smart appliances and introduces useful notations.Section IV illustrates the two discussed localization algorithms.Section V introduces metrics to evaluate the performance of discussed approaches and shows illustrative experimental results.Section VI concludes the paper.

II. RELEVANT APPROACHES FOR INDOOR LOCALIZATION
Many localization algorithms have been proposed in the literature to provide location information to nodes of a network (e.g., [18]).In particular, range-based localization methods rely on the knowledge of inter-node distances or angle information and they can be classified into active and passive [3].In active methods, all nodes are equipped with sensors and with an electronic device which sends information to a positioning system.Passive localization, instead, is based on the fact that wireless communications strongly depend on the surrounding environment.Relying on the scattering caused by small targets during signal propagation and/or on the variance of a measured signals, changes in the received signals can be used to detect and locate targets and for tracking purposes [19].
In this paper, we focus on active range-based algorithms, which typically involves two steps.First, proper parameters related to signals traveling between the smart appliance and some nodes of the network with known positions are estimated.Such parameters can be the Time of Flight (ToF), the Angle of Arrival (AoA), or the Received Signal Strength (RSS) [20].Then, the parameters evaluated in the first step are used to estimate the position of the smart appliance using a proper localization algorithm.Concerning the first step, note that range-estimation techniques based on AoA rely on the measurements of angles between nodes, which are usually taken by means of antenna arrays that require dedicated hardware.Moreover, the installation cost of antenna arrays can be high and the number of signal paths in indoor environments can be large for the presence of obstacles, which make accurate angle estimation challenging in practical scenarios.Time-based range-estimation techniques, instead, rely on measurements of the ToF of signals traveling between nodes, and, therefore, they require high time resolution in the processing of considered signals and they are not particularly well suited when WiFi technology is used.For the reasons mentioned above, we focus on localization approaches based on RSS, which is typically used when performing localization with WiFi signaling.Under the assumption that the energy of transmitted signals is known, the availability of a relation between the received power of a signal traveling between two nodes and the distance between the nodes can be used to estimate the distance using RSS measurements at the receiver node.In detail, in order to use RSS measurements to estimate the distance that separates a receiving node from a transmitting node, we rely on the Friis transmission equation, according to which the received power P (ρ) at distance ρ can be expressed as [5] where, P 0 is the known power at reference distance ρ 0 and β is a parameter related to the details of the transmission [21].An estimate of the received power P (ρ) yields the value of the distance ρ by inverting (1).
In the remaining of this paper, we assume that range estimates are obtained from measurements of the RSS of signals traveling between nodes using (1).The adopted add-on module for JADE uses the functionality of the smart appliance where it is installed to obtain the RSS of signals used by WiFi APs to support network scanning.Measured RSS is used to estimate the distances between the smart appliance where the module is installed, which is normally called Target Node (TN), and the APs of the network, which are assumed to be in known and static positions.Each communication between the TN and one of the AP allows obtaining an estimate of the distance between them together with other valuable information, such as the Basic Service Set IDentification (BSSID) of the responding AP.Assuming that the position of each AP is known, each mapped BSSID can be associated with the coordinates of the corresponding AP and, hence, each distance estimate can also be related to the coordinates of the corresponding AP.The possibility of associating the position of an AP with each distance estimate between a TN and that AP is crucial to support localization, as discussed in the following.
In order to provide agents with information on their current positions, the add-on module for JADE integrates localization algorithms that use estimated distances from APs to estimate the position of the TN and feed it to interested agents.In detail, once range estimates are acquired, they are used to feed one of the available localization algorithms, which computes an estimate of the position of the TN.Finally, interested agents are informed of the current position of the TN, which is used as the position of the agents that are host in the smart appliance where the add-on module is installed.The current version of the JADE module includes different localization algorithm and, in this paper, we compare the performance of two of them: • The Two-Stage Maximum-Likelihood (TSML) algorithm, which is well-known in the literature because it can attain the Cramer-Rao lower bound, which is a lower bound for the variance of an estimator [22].
• A recent optimization-based algorithm [23], which relies on the use of Particle Swarm Optimization (PSO) to obtain effective localization.
Preliminary results on the accuracy of discussed algorithms were presented in [24], where only the TSML algorithm was considered to address a localization scenario different from the scenario discussed in the following sections.Experimental results discussed in this paper show that the accuracy of the two localization algorithms are comparable, and that they can both achieve an accuracy in the order of 1 m.Such accuracy can be further improved, especially for the second algorithm, by using proper processing of estimated distances.

III. WIFI-BASED RANGE ESTIMATES
In this section, we introduce relevant notation that will be used to describe the localization scenario and localization algorithms.Throughout the paper, we denote the number of available APs as M .Note that the coordinates of APs are assumed to be known and static, and using a proper coordinate system, they are denoted as ( The unknown position of the TN is denoted as For the sake of simplicity, in the following we assume that there exist a unique TN whose position needs to be estimated, but it is worth noting that discussed approaches can be used also with a large number of TN, provided they are all equipped with the JADE add-on module.Using the introduced notation, the distance between the TN and the i-th AP is where ||x|| denotes the Euclidean norm of vector x.The position of the TN defined in (3) can be found by intersecting the spheres with radii {ρ i } M i=1 centered in {s i } M i=1 , i.e., by solving the following non-linear system of equations: In order to guarantee that the system of equations (4) has a unique solution, the number of available APs needs to be at least equal to 4.
Unfortunately, when performing localization in realistic scenarios, the exact values of distances {ρ i } M i=1 between the TN and APs are unknown.As a matter of fact, their knowledge together with the system of equations (4) would also imply that the true TN position u would be known.For this reason, it is necessary to rely on range estimates acquired by a proper processing of the RSS of WiFi signals.As soon as range estimates from the M APs are available, a proper localization algorithm can use them to estimate the position of the TN.It is assumed that this acquisition and processing procedure is iterated L > 1 times, thus leading to L position estimates at different instants.We denote the estimated distance between the i−th AP and the TN at the j−th iteration as ρi,j .
Before describing the localization algorithms used to obtain discussed results, let us make additional comments on range estimates.Instead of using a single range estimate from each APs, it is possible to acquire K > 1 range estimates from each AP and then use the average of such range estimates to derive an estimate of the TN position.In detail, let us define which represent the averaged range estimates from the ith AP obtained by averaging ρi,j over K consecutive acquisitions.Averages ρK i,j can be used instead of single estimates ρi,j to alleviate problems related to acquisition noise and multipath.
From now on, we make an additional assumption which allows simplifying the localization algorithm, i.e., we assume that the height z of the considered TN is known.Even though this may seem a strong assumption, we remark that, in considered scenarios, users are holding their smart appliances, i.e., the TNs, in their hands or in their pockets.Hence, even if the true height is not accurately known, it can be reasonably approximated to, e.g., z = 1 m.Errors in the order of a few centimeters on the value of z do not have a strong impact on the accuracy of discussed algorithms because range estimates error are typically in the order of 10 cm [25].Additionally, this assumption has the advantage of simplifying the localization algorithm as if the considered scenario was a bidimensional one, namely, as if the coordinates of the i-th AP were (x i , y i , z) for i ∈ {1, . . ., M }.In other words, the third coordinate can be neglected and the mathematical description of the discussed localization algorithms is simplified.Let us define the difference between the height z of the TN and the height z i of the i-th AP as Given this definition, it is possible to evaluate the projections of the distances {ρ i } M i=1 between the TN and the ith AP on the plane z = z where the TN lies.According to the Pythagorean theorem, under the assumption that the true values of distances {ρ i } M i=1 are known, the projections of such distances can be written as An illustrative geometric representation of the relations among ρ i , h i , and r i is shown in Fig. 1, assuming that the coordinates of the considered AP, expressed in meters, are (0, 0, 3) and those of the TN, expressed in meters, are (1, 1, 1).
Under the assumption that that the height z of the TN is known, the abscissa and the ordinate of the TN can be found by intersecting the circumferences centered in {(x i , y i )} M i=1 with radii {r i } M i=1 , i.e., by solving the following non-linear system of equations: As previously observed, the values of {ρ i } M i=1 are unknown and, consequently, the values of {r i } M i=1 are also unknown.Hence, it is necessary to rely on range estimates obtained from the RSS of WiFi signals.Let us define the projections of distances ρi,j from the i−th AP at the j−th iteration on the plane z = z as www.ijacsa.thesai.orgThe position estimate of the TN at the j−th iteration will be denoted as ûj = (x j , ŷj , z).
Similarly, from the definition of averaged range estimates ρK i,j introduced in (5), it is also possible to define the projections of the averaged range estimates introduced in (5) on the plane z = z as Finally, the position estimates obtained by feeding the localization algorithm with averaged range estimates {r K i,j } M i=1 are denoted as We remark that the j-th position estimate vK j relies on the M averaged range estimates {ρ K i,j } M i=1 , and, therefore, on the M • K range estimates {ρ i,h } M i=1 with h ∈ {j, . . ., j + K − 1}.For this reason, the first position estimate vK 1 can be obtained only after an initial phase during which K range estimates from each of the M APs are acquired.Once vK 1 is evaluated, the position estimates that follow can be determined as soon as a new M -tuple of range estimates from the M APs is acquired.We remark that using the notation introduced for averaged range estimates it is also possible to consider the case without range averaging by setting K = 1 in (5).

IV. TWO RELEVANT LOCALIZATION ALGORITHMS
Various range-based localization algorithms have been proposed in the literature (e.g., [26]) and they can all be integrated with the adopted JADE add-on module.This section describes the two algorithms used to obtain experimental results shown in next section, namely the TSML algorithm and the PSObased algorithm.The starting point for the considered localization algorithms is (8), where the exact distances {r i } M i=1 are replaced by their estimates ri,j .For the sake of simplicity, in the descriptions of localization algorithms we neglect the subscript j, which counts iterations, and we denote as {r i } M i=1 a generic set of range estimates at a given iteration.Using this notation, the non-linear system of equations ( 8) is replaced by The system of equations (13) shows the equations of the M circumferences lying on the plane z = z, centered in {(x i , y i )} M i=1 with radii {r i,j } M i=1 .If the radii of such circumferences were the exact distances {r i } M i=1 , they would all intersect in the same point, which would correspond to the exact TN position.Instead, the radii of circumferences in (13) are range estimates, and they are affected by errors.Hence, circumferences do not intersect in a unique point and, therefore, proper localization algorithms are needed.In the following, we denote the solution of ( 13) as ũ = (x, ŷ).

A. Two-Stage Maximum-Likelihood Algorithm
In order to simplify the description of the algorithm, let us define the following quantity, related to the solution ũ of ( 13) Then, the system of equations ( 13) can be reformulated in matrix notation as where and We remark that ( 15) is not a linear system since the third element of vector ω depends on the first two elements according to (14).Neglecting this dependence, the solution ω of ( 15) is determined through a Maximum-Likelihood (ML) approach as where W 1 is a positive definite matrix [27].For the sake of simplicity, in the implementation used to obtain discussed experimental results, matrix W 1 is equal to the identity matrix.
Once the solution ω of ( 15) is evaluated, the dependence of n on x and ŷ can be taken into account by considering the following system of equations: where φ = (x 2 , ŷ2 ) and Let us remark that ωj in (20) denotes the j−th component of ω.The solution of the rectangular system (19) can be determined, using a ML approach, as where W 2 is a positive definite matrix.In the implementation used to obtain discussed experimental results, matrix W 2 is set equal to the identity matrix, as done for W 1 .Given the solution φ, the estimated abscissa and ordinate at a generic iteration of the considered localization algorithm can be expressed as where U = diag(sign(ω)), and φ = ( φ1 , φ2 ).Finally, reintroducing the subscript j to denote the corresponding iteration, the estimated position of the TN at the j−th iteration can be written as ûj = (x j , ŷj , z).
The same localization algorithm can be applied also to the averaged range estimates rK i,j defined in (11).In this case, the initial system of equations can be obtained from (13) by substituting range estimates ri,j with the averaged range estimates rK i,j , namely, The M equations in (24) represent the M circumferences lying on the plane z = z, centered in {(x i , y i )} M i=1 , with radii equal to the averaged range estimates {r K i,j } M i=1 .By applying the TSML algorithm to the system of equations in (24), it is possible to obtain position estimates evaluated using averaged distances and, in the following, such position estimates are denoted as

B. The PSO-Based Algorithm
Observe that the system of equations ( 13) can be re-written in matrix notation as where 1 is the vector with M elements equal to 1, k is a vector whose i−th element is r2 i − (x 2 i + y 2 i ), and A is the Also observe that the solution of the system of equations ( 26), and, hence, of the system of equations (13), can be reinterpreted as the solution of a related optimization problem.In detail, the solution ũ = (x, ŷ) can be found as the solution of the following minimization problem: where the fitness function F (u) is defined as In order to solve the minimization problem (28), thus finding estimates for the abscissa and the ordinate of the TN, we proposed to use the PSO algorithm [28].The PSO algorithm was first introduced in [29] and it considers the set of potential solutions of an optimization problem as a swarm of S particles which move through a search space according to proper rules.In detail, it is assumed that, at every instant, each particle is associated with a position in the search space and with a velocity.Positions and velocities of particles are iteratively updated according to proper rules, which are meant to move all particles towards the solution of the minimization problem, namely towards the position which minimizes the fitness function (29).The rules that are normally adopted to update positions and velocities are inspired by the rules which govern the behaviors of birds in swarms.
The use of PSO to support the localization of a TN works as follows.At initialization, the positions of the particles are randomly initialized in the search space, which, in our context, corresponds to the plane z = z where the abscissa and the ordinate of the TN are supposed to be situated.The initial positions are denoted as x (i) (0), where i ∈ {1, . . ., S} is the index of a generic particle and S is the number of particles.Similarly, the velocities of all the particles are randomly initialized and they are denoted as w (i) (0), where i ∈ {1, . . ., S} is the index of a generic particle.After this initialization phase, positions and velocities of all particles are updated at each iteration t > 0 to simulate interactions among individuals [30].The position of the i−th particle at the t−th iteration is denoted as x (i) (t) and its velocity is denoted as w (i) (t).At each iteration, the velocity of the i−th particle is updated according to a specific rule expressed as the sum of three addends.In detail, the velocity of the i−th particle at the (t + 1)-th iteration is [31] where the following quantities [32] are used: • y(t) is the best position globally reached so far; • y (i) (t) is the best position reached so far by the i-th particle; • ω(t) is called inertial factor; • c 1 is called cognition parameter; • c 2 is called social parameter; and • R 1 (t) and R 2 (t) are independent random variables uniformly distributed in (0, 1).
The first addend in ( 30) is related to the velocity of the i−th particle at previous iteration t, which is weighed according to the inertial factor ω(t).In the second addend, the cognition parameter is a positive real parameter and the best position reached so far by the i−th particle can be expressed as where Hence, this second addend is meant to move each particle towards its best position reached so far.Finally, in the third addend, the social parameter is a positive real parameter and the best position reached so far by any particle in the swarm can be expressed as where Y (i) = {y (1) (t), . . ., y (S) (t)}.The third addend is meant to move each particle towards the global best position, namely the position which corresponds to the lowest value of the fitness function among all those reached by any particle in the swarm [30].The velocities computed with (30) are used to update the positions of particles at each iteration.Such updates are performed by adding the velocities evaluated in (30) to the previous positions of each particle, namely The PSO algorithm is iterated until a termination condition is met.One of the possible termination conditions for the PSO algorithm is the reach of a maximum number of iterations.Once the execution of the algorithm is terminated, the solution corresponds to the position of the particle in the global best position, namely the position of the particle with the lowest value of the fitness function.This solution correspond to the estimated abscissa and ordinate of the TN.
The PSO algorithm outlined previously is used to solve the localization problem formulated in (28) and, hence, to solve the localization problem described in (13).The same algorithm can be applied also when the system of equations (24), where averaged range estimates rK i,j defined in (11) appear, is used.In this case, (24) can be re-written in matrix notation as where 1 is the vector with M elements equal to 1, kj is a vector whose i−th element is rK i,j 2 − (x 2 i + y 2 i ), and A is defined in (27).By applying the PSO algorithm to (34), it is possible to obtain position estimates evaluated using averaged distances and, in the following, such position estimates are denoted as Experimental results shown in the remaining of this paper are obtained with a population of S = 40 particles.The inertial factor is set to ω(t) = 0.5 and the values of c 1 and c 2 are both set to 2, so that the average values of c 1 R 1 (t) and of c 2 R 2 (t) correspond to 1.The termination condition for the PSO algorithm corresponds to the reach of 50 iterations.These values proved to be effective for localization purposes [33].
Illustrative experimental results about the performance of the PSO-based algorithm are shown in next section.

V. PERFORMANCE EVALUATION
In the experimental campaign described in this section we consider three values for K, namely, K = 1 (i.e., no averaging); K = 10; and K = 100.The performance of discussed localization approaches is evaluated in terms of the distances between the true TN position and its estimates.In order to evaluate the performance of the discussed localization algorithms, let us define the distance error as Observe that, since we assume that the height of the TN is known, the third component of ûj is equal to the third component of the vector u which represents the true TN position.Therefore, (36) represents the projection of the distance error on the plane z = z.The definition of the distance error (36) allows introducing the maximum value of the distance errors, which can be denoted as Let us also introduce the average value of the distance error, which can be expressed as Finally, the standard deviation of the distance error is Analogous values relative to position estimates vK j obtained using averaged range estimates can be defined.In detail, let us define which represents the distance error on the plane z = z between the true TN position and its estimate in the j−th iteration obtained using averaged range estimates over K consecutive range acquisitions.The definition of δ K j allows computing the maximum value of the distance error as and the average value of the distance error as www.ijacsa.thesai.orgFinally, the standard deviation of the distance error is Observe that the values in (37), (38), and (39) can be equally defined using the more general notation in (41), (42), and (43), respectively, for K = 1.
In order to assess the accuracy of the localization algorithms previously described, we performed an experimental campaign in an illustrative indoor scenario which consists of a square room whose sides are 4 m long.The considered scenario is shown in Fig. 2, where M = 3 APs are shown (blue squares).Observe that M = 3 is the minimum number of APs which allows the application of described localization algorithms.The coordinates of the APs are denoted as {AP i } 3 i=1 and they are positioned in the room in such a way that, in a proper coordinate system, they can be expressed, in meters, as In Fig. 2, three different TN positions are also shown (red stars) and their position in the same coordinate system can be expressed in meters as Using the described configuration of fixed APs, the three different TN positions are estimated.Results of such position estimates are discussed in the remaining of this section, using both localization algorithms introduced in previous section, on the basis of the distance error discussed above.Let us remark that, even if in the considered scenario all APs are placed at the same height (i.e., 3 m), and all TNs are placed at the same height (i.e., 1 m), both proposed localization algorithms are general and they do not require that APs share the same height.Moreover, different heights for the TNs could also be considered, provided that they are known, so that the values of h i defined in ( 6) can be computed.
In the remaining of this section, relevant comments on the localization of the three TNs are presented.In all scenarios, the number of iterations in set equal to L = 100.Hence, the average value and the standard deviations of distance errors is based on 100 position estimates.In the following figures and tables, in order to distinguish between position estimates obtained using the two algorithms, we add superscript (T ) and (P ) to denote position estimates derived using the TSML and the PSO-based algorithm, respectively.

A. First Scenario
We start by considering the TN denoted as TN 1 in Fig. 2, whose coordinates are u 1 = (1, 1, 1) T .Since the coordinates of the APs are also known, the true distances {ρ i } 3 i=1 between the i-th AP and the TN can be computed.In detail, from ( 44) and ( 45), the values of {ρ i } 3 i=1 can be computed as ρ 1 2.45 m ρ 2 3.74 m ρ 3 4.69 m.
The projections {r i } 3 i=1 of the range estimates {ρ i } 3 i=1 on the plane z = 1 m can be also computed according to the Pythagorean theorem.Simple algebraic manipulations show that the values of {r i } 3 i=1 are r 1 1.41 m r 2 3.16 m r 3 4.24 m.
In order to apply the discussed algorithms, we acquire range estimates from each AP to have: 100 position estimates obtained without range averaging; 100 position estimates obtained by averaging over K = 10 consecutive range estimates; and 100 position estimates obtained by averaging over K = 100 consecutive range estimates.Fig. 3 shows the true position of TN 1 on the plane z = 1 (red star).In the same figure, the projections of the position estimates on the plane z = 1 (black circles) obtained without averaging are also shown, together with the projections of the position estimates (magenta crosses) obtained by averaging over 10 consecutive range estimates from each AP, and the projections of the position estimates (green triangles) obtained by averaging over 100 consecutive range estimates from each AP.From Fig. 3 it can be observed that, as expected, the position estimates are closer to each other as K increases.This is in agreement with the intuitive idea that averaging range estimates over large values of K leads, on average, to more accurate values of rK i,j .The more accurate are the range estimates used to feed the localization algorithm, the more accurate are the obtained position estimates.Fig. 4 shows the Cumulative Distribution Functions (CDFs) of the distance errors without range averaging (black line), with K = 10 (dashed magenta line), and with K = 100 (dash-dotted green line).As intuitively expected from Fig. 3, the larger is K, the steepest is the graph of the CDF. on the plane z = 1 (black circles) obtained without range averaging; the projections of position estimates (cyan crosses) obtained by averaging over 10 consecutive range estimates from each AP; and the projections of position estimates (yellow triangles) obtained by averaging 100 consecutive range estimates from each AP.As observed when using the TSML algorithm, the position estimates are closer to the TN position as K increases.Hence, also when considering the PSO-based algorithm, more accurate range estimates lead to more accurate position estimates.Fig. 6 shows the CDFs of distance errors without range averaging (black line), with K = 10 (dashed cyan line), and with K = 100 (dash-dotted yellow line).As expected, larger values of K correspond to steeper CDFs.
Table I shows the values of the maximum distances and of the average distances between the considered TN and its estimates, and the values of standard deviations of distance errors for K = 1, K = 10, and K = 100.It can be observed that when localization is performed using the TSML algorithm,  the values of the maximum distance between the considered TN and its estimates decrease as K increases.In detail, without range averaging the values of the maximum distance between the considered TN and its estimates is equal to 1.32 m and it decreases to 0.49 m when K = 10 and to 0.27 m when K = 100.Analogous considerations hold when analyzing results relative to the PSO-based algorithm.In this case, the value of the maximum distance between the considered TN and its estimates without range averaging equals 1.23 m, and it is slightly smaller than that evaluated when considering the TSML algorithm.The values of the maximum distance between the considered TN and its estimates are equal to 0.59 m and to 0.34 m when K = 10 and K = 100, respectively, and they are slightly higher than those obtained by applying TSML algorithm.Form the fourth row of Table I it can be observed that also the values of the average distance between the considered TN and its estimates decrease as K increases, starting from 0.38 m when no range averaging is considered to 0.24 m when K = 100 is considered.The values of the average distance δ K avg between the considered TN and its estimates when using the PSO-based algorithm are comparable to those obtained when using the TSML algorithm, and they are equal to 0.49 m, when range averages are not performed, and to 0.32 m and 0.29 m when K = 10 and K = 100, respectively.Finally, Table I shows that the values of the standard deviations of distance errors σ K δ also decrease when K increases.This results was expected also from Fig. 4 and Fig. 6, from which it is evident that increasing K not only reduces the distances between the position estimates and the TN, it also reduces the distances between different position estimates because it alleviates the influence of acquisition errors.For the same choice of K, the values of the standard deviation evaluated using the TSML algorithm and using the PSO-based algorithm are similar and their order of magnitude is 0.2 m without range averaging and 0.02 m when K = 100.

B. Second Scenario
We now consider the TN positioned in the point denoted as TN 2 in Fig. 2, whose coordinates are denoted as u 2 in (45).In this case, the true distances {ρ i } 3 i=1 between the i-th AP and the TN are The projections of the range estimates on the plane z = 1 m can be evaluated, according to the Pythagorean theorem, as In order to estimate the position of TN 2 , range estimates from the APs are taken in order to have: 100 position estimates obtained without range averaging; 100 position estimates obtained by averaging over K = 10 consecutive range estimates; and 100 position estimates obtained by averaging over K = 100 consecutive range estimates.
In Fig. 7, the true position of TN 2 on the plane z = 1 (red star) is shown.Fig. 7 also shows the projections of the position estimates on the plane z = 1 (black circles) obtained without range averaging.Moreover, the projections of the position estimates (magenta crosses) obtained by averaging over 10 consecutive range estimates from each AP, and the projections of the position estimates (green triangles) obtained by averaging over 100 consecutive range estimates from each AP are shown.Fig. 7 shows that the distance among the TN position and its estimates decreases as K increases.This is motivated by the fact that large values of K lead to more precise averaged range estimates, which allow more accurate position estimates to be derived.Fig. 8 shows the CDFs of the distance errors without range averaging (black line), with K = 10 (dashed magenta line), and with K = 100 (dash-dotted green line).As when considering TN 1 , the steepness of the CDF increases as K also increases.
-   Fig. 9 shows the true position of TN 2 on the plane z = 1 (red star), together with, the projections of the position estimates (black circles) obtained without range averaging, the projections of the position estimates (cyan crosses) obtained with K = 10, and the projections of the position estimates (yellow triangles) obtained with K = 100.As observed when using the TSML algorithm, the accuracy of the position estimates increases as K increases.Hence, also when considering the PSO-based algorithm, more accurate range estimates lead to more accurate position estimates.Fig. 10 shows the CDFs of the distance errors without range averaging (black line), with K = 10 (dashed cyan line), with K = 100 (dash-dotted yellow line).As expected from Fig. 9, the larger is K, the steepest is the graph of the CDF.
Table II shows the values of the maximum distances and of the average distances between the considered TN and its estimates, and the values of the standard deviations of the distance errors for K = 1, K = 10, and K = 100.As when considering the first scenario, all such values decrease as the number of range averages K increases.Table II also shows that with no range estimate averaging, the maximum distance and the average distance between the considered TN and its estimates when using the PSO-based algorithm correspond to the double of the analogous values obtained with the TSML algorithm.When K = 10 and K = 100, values obtained with the TSML algorithm are more similar to each other, even though the values obtained with the latter are slightly higher than those obtained with the former.Concerning the standard deviations of the distance error, it can be observed that, as in the first scenario, the values corresponding to K = 100 are one order of magnitude lower than those obtained when K = 1.

C. Third Scenario
Finally, let us now consider the TN positioned in the middle of the room, denoted as TN 3 in Fig. 2, whose coordinates are denoted as u 3 in (45).In this case, the true distances {ρ i } 3 i=1 between the i-th AP and the TN, expressed in meters, are

Since the values of {h
i=1 are 2 m, the projections of the distances on the plane z = 1 m can be computed as As in previous scenarios, range estimates from each of the three APs are acquired in order to have: 100 position estimates obtained without range averaging; 100 position estimates obtained by averaging over K = 10 consecutive range estimates; and 100 position estimates obtained by averaging over K = 100 consecutive range estimates.Fig. 11 shows the projection of the true position of TN 3 on the plane z = 1 (red star).In the same figure, the projections of the position estimates (black circles) obtained without range averaging, the projections of the position estimates (magenta crosses) obtained by averaging over 10 consecutive range estimates from each AP, and the projections of the position estimates (cyan triangles) obtained by averaging over 100 consecutive range estimates from each AP, are also shown.As in the previous cases, Fig. 11 shows that the distance between position estimates and the TN decreases as K increases.Fig. 12 shows the CDFs of the distance errors without range averaging (black line), with K = 10 (dashed magenta line), and with K = 100 (dash-dotted green line), which is steeper as K increases.Fig. 13 shows the true position of TN 3 on the plane z = 1 (red star), together with the projections of the position estimates on the plane z = 1 (black circles) obtained without range averaging, the projections of the position estimates (cyan crosses) obtained by averaging over 10 consecutive range estimates from each AP, and the projections of the position estimates (yellow triangles) obtained by averaging over 100 consecutive range estimates from each AP.As in previous scenarios, the position estimates are closer to each other and to the true TN position as K increases.Hence, also when considering the PSO-based algorithm, more accurate range estimates lead to more accurate position estimates.Fig. 14 shows the CDFs of the distance errors without range averaging (black line), with K = 10 (dashed cyan line), and with K = 100 (dash-dotted yellow line).Once again, the larger is K, the steepest is the graph of the CDF.
Table III shows the values of the maximum distances and of the average distances between the considered TN and it estimates, and the values of the standard deviations of the the distance errors for K = 1, K = 10, and K = 100.
As when considering previous scenarios, all such values decrease as the number of range averages K increases.Moreover, for the same choice of K values obtained with the TSML algorithm are of the same order of magnitude than those obtained with the PSO-based algorithm, even though the values obtained with the latter are slightly higher than those obtained with the former.Concerning the standard deviations of the distance error, it can be observed that, as in previous scenarios, the values corresponding to K = 100 are one order of magnitude lower than those obtained when K = 1.It is worth observing that, according to results shown in Tables I, II and III, the performance of both algorithms are similar in all scenarios.

VI. CONCLUSION
This paper presented an experimental evaluation of two approaches to indoor localization which both use ordinary WiFi signaling with no dedicated localization infrastructure.In both discussed approaches, agents acquire range estimates from the APs of the WiFi infrastructure, and they use such estimates to obtain real-time information on the position of the smart appliances which hosts them.
The results obtained in the presented experimental campaign are meant to give a quantitative assessment on the performance of WiFi-based indoor localization, and they show that the level of accuracy of WiFi-based localization can be increased by a proper pre-processing of acquired range estimates.Obtained results show that agents can reach a localization accuracy of less than 1 m, thus making the proposed approach adequate for many application scenarios.In particular, such an accuracy is sufficient to support social games in large environments like shopping malls, waiting areas of airports and train stations, and covered markets in historical areas of towns.It is worth noting that presented results are valid under the assumption that the smart appliance does not move, or that it moves slowly with respect to range acquisition rate.Such an assumption does not necessarily hold for social games, and further investigation on dynamic scenarios is in progress.(i) without range averaging (black line); (ii) with K = 10 (dashed magenta line), and (iii) with K = 100 (dash-dotted green line), relative to the position estimates of TN 3 obtained using the TSML algorithm.

Fig. 1 .
Fig.1.The distance ρ between an AP (blue square) and a TN (red star) is shown (green line), together with the height h of AP with respect to the TN (cyan line).The projection r of the distance ρ on the plane on which the TN lies is also shown (magenta line).

1 Fig. 2 .
Fig. 2. The positions of the three considered APs (blue squares) and three different TN positions (red stars) are shown.

TABLE I .
VALUES OF THE MAXIMUM DISTANCE ERROR (FIRST ROW), OF THE AVERAGE DISTANCE ERROR (SECOND ROW), AND OF THE STANDARD DEVIATION OF THE DISTANCE ERROR (THIRD ROW) ARE SHOWN, FOR DIFFERENT VALUES OF K, RELATIVE TO POSITION ESTIMATES OF TN 1 OBTAINED WITH THE TSML ALGORITHM AND WITH THE PSO-BASED ALGORITHM, RESPECTIVELY

TABLE II .
VALUES OF THE MAXIMUM DISTANCE ERROR (FIRST ROW), OF THE AVERAGE DISTANCE ERROR (SECOND ROW), AND OF THE STANDARD DEVIATION OF THE DISTANCE ERROR (THIRD ROW) ARE SHOWN, FOR DIFFERENT VALUES OF K, RELATIVE TO POSITION ESTIMATES OF TN 2 OBTAINED WITH THE TSML ALGORITHM AND WITH THE PSO-BASED ALGORITHM, RESPECTIVELY

TABLE III .
VALUES OF THE MAXIMUM DISTANCE ERROR (FIRST ROW), OF THE AVERAGE DISTANCE ERROR (SECOND ROW), AND OF THE STANDARD DEVIATION OF THE DISTANCE ERROR (THIRD ROW) ARE SHOWN, FOR DIFFERENT VALUES OF K, RELATIVE TO POSITION ESTIMATES OF TN 3 OBTAINED WITH THE TSML ALGORITHM AND WITH THE PSO-BASED ALGORITHM, RESPECTIVELY