Hybrid Indoor Localization Using WiFi and UWB Technologies

The interest in indoor localization has been increasing in the last few years because of the numerous important applications related to the pervasive diffusion of mobile smart devices that could benefit from localization. Various wireless technologies are in use to perform indoor localization, and, among them, WiFi and UWB technologies are appreciated when robust and accurate localization is required. The major advantage of WiFi technology is that it is ubiquitous, and therefore it can be used to support localization without the introduction of a specific infrastructure. The major drawback of WiFi technology is that it does not often ensure sufficient accuracy. On the contrary, indoor localization based on UWB technology guarantees higher accuracy with increased robustness, but it requires the use of UWB-enabled devices and the deployment of specific infrastructures made of UWB beacons. Experimental results on the synergic use of WiFi and UWB technologies for localization are presented in this paper to show that hybrid approaches can be used to effectively to increase the accuracy of WiFi-based localization. Actually, presented experimental results show that the use of a small number of UWB beacons together with an ordinary WiFi infrastructure is sufficient to significantly increase the accuracy of localization and to make WiFi-based localization adequate to implement relevant location-based services and applications.


Introduction
Wireless localization is an appealing and challenging problem that is gaining significant interest thanks to the increasing diffusion of mobile smart devices (e.g., [1]) and to the related possibility to deliver location-based services and applications (e.g., [2]). A coarse-grained classification of localization scenarios distinguishes between indoor localization and outdoor localization. Concerning outdoor localization, it can be observed that global navigation satellite systems, such as the Global Positioning System (GPS), are today easily accessible by many devices. The accuracy of localization obtained from the GPS is typically in the order of a few meters, and it is sufficient for many applications that include transport navigation and guidance, tracking of smart devices, and synchronization of telecommunications networks (e.g., [3]). Therefore, outdoor localization in normally considered as a solved problem. On the contrary, indoor localization is still an open problem and, at the moment, there are no commodity technologies available to solve it, even if the literature documents many studies on the subject (e.g., [4]). Various types of applications can be envisaged for indoor localization, for example, in the context of home surveillance, smart homes and ambient assisted living (e.g., [5][6][7]), in the context of industrial monitoring and automation (e.g., [8][9][10]), and in the context of creative industries to enable location-aware games (e.g., [11,12]). The number of relevant application scenarios encouraged the exploration of localization strategies involving different technologies, such as inertial sensors, optical and/or acoustic sensors, and Radio Frequency (RF) communications (e.g., [13]).
In this paper, localization strategies based on the use of two different RF technologies, namely WiFi and Ultra-Wide Band (UWB) [14], are considered. In the localization scenario discussed in this paper, some Anchor Nodes (ANs) with fixed and known positions are assumed to be placed in the indoor environment of interest. The considered ANs can be Access Points (APs) of the WiFi network and/or UWB beacons. The aim of the considered localization infrastructure is allow the estimation of the position of a mobile smart device, denoted as Target Node (TN), using a range-based localization approach that benefits from the available WiFi and UWB infrastructures. As the name suggests, range-based localization approaches are based on the possibility to measure the distance between the TN and each AN. Such distance estimates are obtained by properly processing relevant parameters of the RF signals traveling between the TN and each AN, such as the Time of Flight (ToF) and/or the Received Signal Strength (RSS). When sufficient distance estimates from different ANs become available, the application running on the TN can estimate the position of the TN within the considered environment using a proper localization algorithm. Note that the discussed approach assumes that the application running on the TN knows the fixed positions of ANs in the environment.
The choice of WiFi and UWB technologies as ranging technologies is motivated as follows. WiFi infrastructures are available in the large majority of indoor scenarios, and therefore the cost of WiFi-based localization is low because no specific infrastructure is required (e.g., [15]). Unfortunately, the use of WiFi technology to support localization does not guarantee sufficient accuracy for many applications (e.g., [16]) because WiFi-based distance estimates are derived from the RSS, which is influenced by shadowing effects due to the presence of obstacles and reflections typical of indoor environments. On the contrary, the use of UWB technology usually leads to accurate position estimates (e.g., [16]) because UWB devices transmit pulses with durations in the order of nanoseconds. Short-duration pulses guarantee accurate estimates of the ToF of signals, which ultimately leads to high localization accuracy. In addition, the large frequency spectrum that characterizes UWB signals increases the possibility of penetrating through obstacles (e.g., [17]). The two mentioned features make UWB technology as a leading candidate to support range-based localization (e.g., [18]) and, consequently, the interest in UWB-based localization has been rapidly growing. Some UWB devices are readily available and, just to cite relevant vendors, it is worth mentioning (in alphabetical order) UWB modules produced by BeSpoon (www.bespoon.com), Decawave (www.decawave.com), Time Domain (www.timedomain.com), and Ubisense (www.ubisense.net). The main drawback of the use of UWB technology for indoor localization is related to the total cost of ownership of the needed infrastructure. Actually, UWB beacons are not normally available in indoor environments and a specific UWB infrastructure composed of active UWB beacons must be installed just for the purpose to use UWB technology for indoor localization.
It is evident from previous considerations that the identification of a hybrid approach capable of providing the accuracy and the robustness of UWB-based localization without the cost of ownership of an entire specific infrastructure would be highly beneficial to boost the adoption of indoor localization in everyday scenarios. The major contribution of this paper is to assess the possibility of combining WiFi-based localization with UWB-based localization to obtain a hybrid approach that provides sufficient accuracy without the cost of deploying an entire UWB infrastructure. Experimental results shown in the last part of this paper provides convincing empirical evidence that hybrid indoor localization based on the synergistic integration of UWB and WiFi technologies is possible. Experimental results were obtained using an Android smartphone called SpoonPhone that BeSpoon produces to show how UWB technology can be integrated in a commodity device. Such a device provides the ordinary features of modern smartphones, which obviously include WiFi connectivity, but it is also equipped with hardware and software modules needed to implement UWB-based localization. In particular, applications installed on a SpoonPhone can actively measure the distances between the device and paired UWB beacons, and such a possibility is used by the localization module for software agents [19], originally intended to support location-aware educational games [20] and location-based social networks [12,21], that was used to perform experiments.
In detail, the experiments presented in Section 3 were performed in an empty square room whose sides are 4 m long and whose height is 3 m. The positions of the ANs were fixed and the number of ANs were equal to four in all considered scenarios. Note that four is the minimum number of ANs that guarantees the possibility to perform localization and the studied scenario could be extended easily to use more ANs. As expected, the addition of ANs increases the total cost of ownership of the localization infrastructure but it can improve the accuracy of localization (e.g., [22]). The unknown position of the TN, which was a SpoonPhone running an application specifically developed for the experiments, was estimated by the application running on the TN using the Two-Stage Maximum-Likelihood (TMSL) algorithm outlined in Section 2. The application running on the TN was used to estimate the accuracy of localization in different configurations: when all ANs were WiFi APs, when all ANs were UWB beacons, and when some ANs were UWB beacons and the others were WiFi APs. Experimental results confirm that the accuracy of localization based only on UWB technology is better than the accuracy of localization based only on WiFi technology, as expected from previous consideration on the features of WiFi and UWB technologies. In addition, experimental results show that the substitution of some WiFi APs with UWB beacons located at the same positions can significantly improve the accuracy of localization with respect to the localization that uses only WiFi technology. Therefore, hybrid configurations in which WiFi APs coexist with some UWB beacons can be considered as a good compromise between the accuracy of localization and the total cost of ownership of a localization-specific infrastructure.
This paper is organized as follows. Section 2 describes how UWB and WiFi technologies can be used to measure the distances between the TN and each AN, and it also shows how such distances can be used to estimate the position of the TN. Section 3 discusses the experimental results obtained with different configurations of ANs and with the TN located at different positions. Finally, Section 4 concludes the paper by summarizing the lessons learned.

Range-Based Indoor Localization
This section introduces relevant notation and outlines the localization algorithm used to obtain the experimental results discussed in Section 3. Note that this section does not distinguish between WiFi APs and UWB beacons, and the generic term ANs is used for both. Section 3 presents experimental results obtained with different configurations of ANs and the distinction between WiFi APs and UWB beacons is made explicit to discuss the characteristics of single configurations.

Scenario and Notation
Let m ≥ 4 be the number of ANs available in the considered indoor environment. Such ANs can be WiFi APs and/or UWB beacons, and the position of the i−th AN is denoted as a i ∈ R 3 with 1 ≤ i ≤ m. The positions of the ANs are fixed and known to the application running on the TN, and the application can associate each acquired distance estimate with the corresponding AN. Actually, the communication between the TN and a generic AN provides the application running on the TN with either the Basic Service Set IDentification (BSSID) of the responding WiFi AP (for WiFi communications) or the ID of the responding UWB beacon (for UWB communications). Given that it is assumed that the application running on the TN can map each BSSID and/or ID with the coordinates of the corresponding AN, each distance estimate can be related to the coordinates of the corresponding AN.
The (unknown) true position of the TN is denoted as t ∈ R 3 and the (unknown) true distance between the TN and the i−th AN is denoted as where 1 ≤ i ≤ m and ||x|| denotes the Euclidean norm of vector x ∈ R 3 . Note that the ordinary notation x = (x 1 , x 2 , . . . , x n ) = (x i ) n i=1 is used to refer to column vector x ∈ R n with n ∈ N + . If the values of the true distances (r i ) m i=1 were known, the position t of the TN could be found by intersecting the m spheres centered in (a i ) m i=1 with radii (r i ) m i=1 . The computation of such an intersection would require to solve the following quadratic system of equations and the unique solution of such a system would correspond to the true position of the TN. However, in real localization scenarios the values of the true distance between the TN and each AN is unknown, and therefore it is necessary to use corresponding estimates in order to compute estimates of the position of the TN. The following quadratic system of equations is obtained by replacing the (unknown) true values of the distances (r i ) m i=1 in system (2) with their corresponding estimates (r wheret ∈ R 3 denotes an estimate of the position of the TN. Observe that equations in system such spheres do not normally intersect in a single point. Therefore, proper solution strategies need to be applied to estimate the position of the TN even if system (3) can have several or possibly no solutions. Applicable solution strategies are commonly called localization algorithms, and they are the subject of a relevant literature (e.g., [23]). In the remaining of this section, the algorithm implemented to obtain the experimental results discussed in Section 3 is briefly outlined. Such an algorithm, normally called TSML, was chosen among the plethora of localization algorithms because it is proved [24] that it can attain the Cramér-Rao lower bound for the position estimator.

The TSML Algorithm
The Two-Stage Maximum-Likelihood (TSML) [25] algorithm is a two-step method to solve system (3) that uses the maximum-likelihood approach. The algorithm is notable because it is proved [24] that it can achieve the Cramér-Rao lower bound for the position estimator. In order to apply the algorithm, the quadratic system of Equations (3) is rewritten in matrix notation as As a first step, the solution v ∈ R 4 of the matrix Equation (4) is computed as if system (3) was linear. Note that since the fourth component of the solution vector v is written in terms of its first three components, the second step of the algorithm is necessary to computet, which is the desired estimate of the position of the TN.
Given a positive definite matrix W 1 , the weighted least-square solution of (4) that minimizes The simplest choice of the weighting matrix W 1 is the identity matrix, but it can be shown [25] that the choice of W 1 that minimizes the variance of v is where Q is a diagonal matrix whose entries are the variances of distance estimates (r i ) m i=1 , and B is a diagonal matrix whose diagonal entries are (r i ) m i=1 . The entries of Q depend significantly on the adopted ranging technology, and they are normally estimated once the actual ranging technology used to measure the distance between the TN and each AN is fixed. On the contrary, no a priori measure of the entries of B is possible, and as suggested in [25] . The second step of the TSML algorithm is meant to address the fact that the fourth component of the solution vector v depends on its first three components, and it involves the solution of a second system of equations. The second system of equations is linear and it can be written as where The weighted least-square solution of system (8) that minimizes (h 2 − Hw) W 2 (h 2 − Hw) can be expressed as where W 2 is a positive definite matrix. Also in this case, the simplest choice for W 2 is the identity matrix, but a different choice is suggested in [25] to minimize the variance of w. The weighted least-square solution of (8) that minimizes the weighted norm of (h 2 − Hw) is obtained with the following positive definite matrix where B 2 is the following 4 × 4 diagonal matrix which assumes that the true position of the TN t = (t 1 , t 2 , t 3 ) was available. Since in practical scenarios the true values of the coordinates of the TN are unknown, they are normally replaced with their estimates, that is with the first three components of v. Finally, the desired estimate of the position of the TN can be computed as where w = (w 1 , w 2 , w 3 ) and U is a 3 × 3 diagonal matrix whose diagonal entries are the signs of the components of v. Interested readers should consult the literature (e.g., [25]) for details on the dependence of the performance of the TSML algorithm on the multiple sources of errors, which include errors on distance estimates (r i ) m i=1 and on the positions of ANs (a i ) m i=1 .

Experimental Results
The scenario considered to obtain the experimental results discussed in this section is a square room whose sides are 4 m long and whose height is 3 m. Four ANs are placed in the middle of each wall at different heights. The coordinates of the ANs can be expressed in meters as Note that each AN can be either a WiFi AP or an UWB beacon. Different configurations of WiFi APs and UWB beacons are considered in the remaining of this section, but in all configurations the number of ANs is equal to four, which is the minimum number of ANs needed to estimate the position of the TN. In detail, the following four configurations are considered: In order to clarify the geometry of the experimental scenario, the positions of the ANs and the four positions of the TN are shown in Figure 1. Observe that Configuration 1 is the less expensive in terms of the costs related to the localization infrastructure because it only relies on the presence of WiFi APs, which are nowadays available in virtually all indoor environments. As discussed in Section 1, the accuracy of WiFi-based distance estimates is low (e.g., [16]), and therefore it is expected that the accuracy of obtained position estimates is also low. At the opposite, Configuration 4 is the more expensive because it requires the installation of four UWB beacons to be used specifically to support localization, but position estimates in Configuration 4 are expected to be more accurate than in Configuration 1 because UWB-based distance estimates are typically more accurate than those provided by the WiFi technology. Finally, the costs related to the localization infrastructure of Configurations 2 and 3 are between those of Configuration 1 and Configuration 4 because they partially rely on the available WiFi network but they also require the installation of some (one or two) UWB beacons. Experimental results discussed in the remaining of this section show that the use of some UWB beacons improves significantly the accuracy of localization with respect to the accuracy obtained in Configuration 1. Therefore, Configurations 2 and 3 can be both considered as good compromises between keeping the installation costs low and improving the accuracy of localization. Note that presented experiments were performed without considering the presence of obstacles between the TN and each AN. Therefore, the localization errors measured in presented experiments must be considered lower bounds, and they are expected to increase as the number of obstacles increases. In particular, the errors caused by the presence of obstacles is expected to impact severely on distance estimates obtained using the WiFi technology, while it is expected to be less relevant for distance estimates obtained using the UWB technology (e.g., [14]). Therefore, the impact of obstacles on localization errors is expected to decrease as WiFi APs are replaced with UWB beacons, ranging from the worst case of Configuration 1, in which only WiFi APs are used, to the best case in Configuration 4, in which only UWB beacons are used.
In detail, in order to obtain the discussed experimental results, the TSML algorithm is iterated n = 100 times for each position of the TN and for each configuration of the ANs, and the distribution of the localization error computed over the n position estimates is studied. The performance of the TSML algorithm for each position of the TN and for each configuration of the ANs is analyzed in terms of the average localization error and of the standard deviation of the localization error over the n position estimates. In particular, let e ∈ R 3 be the vector defined as where, following the notation introduced in Section 2, t ∈ R 3 denotes the true position of the TN andt ∈ R The average and the standard deviation of the Euclidean norm of the projection of e along the y−axis over the n iterations, denoted as e y and σ y , respectively; and • The average and the standard deviation of the Euclidean norm of the projection of e along the z−axis over the n iterations, denoted as e z and σ z , respectively.
Note that the study of the localization error along single axes is important because in many applications only the projection of the position of the TN along one axis is relevant. For example, in many applications related to educational games in exhibitions, only the projections of the position of the TN on the x-axis and on the y-axis are used to determine which painting the visitor is currently observing. Similarly, in many applications related to home care, only the projection of the position of the TN on the z-axis is used to determine if the patient is currently sitting or standing.
Before analyzing the accuracy of localization for each configuration of the ANs and for each position of the TN in terms the quantities defined above, an additional remark is due to precisely account for the parameters used in the TSML algorithm. With reference to the description of the TSML algorithm in Section 2, note that matrix Q introduced in matrix Equation (7) contains the variances of the distances from the TN to each AN, which can vary significantly when different ranging technologies are adopted for different ANs. The variances used to populate matrix Q in the current implementation of the TSML algorithm were obtained by studying the distribution of distance estimates obtained using WiFi and UWB technologies. In particular, in the implementation of the TSML algorithm used for experiments, the value of the variances used for the entries of Q corresponding to WiFi APs is 0.13 m 2 , while the value used for the entries of Q corresponding to UWB beacons is 0.01 m 2 . As expected, the variance of distance estimates is larger when WiFi technology is used because UWB technology is normally more accurate. Note that, in general, the variances of distance estimates depend on the true distances between the TN and each considered AN, but the experiments used to compute the adopted variances confirm that such a dependence is negligible in the considered scenario.
In the remaining of this section, the localization error is reported for each configuration of the ANs and for each position of the TN, and a discussion on obtained results is provided.

Configuration 1
In this configuration of the ANs, all the ANs used for localization are WiFi APs. For each considered position (t i ) 4 i=1 of the TN, n = 100 position estimates are computed and results are properly processed to obtain the quantities used to measure the accuracy of localization. Table 1 shows the average value of the distance between the true position of the TN and its estimates, denoted as e, and the standard deviation of the distance between the true position of the TN and its estimates, denoted as σ. The average values (e x , e y , and e z ) and the standard deviations (σ x , σ y , and σ z ) of the localization errors with respect to the three axes are also shown. Table 1. Experimental results in Configuration 1: measured average errors (e, e x , e y , and e z ) are shown together with the relative standard deviations (σ, σ x , σ y , and σ z ) for the four considered positions (t 1 , t 2 , t 3 , and t 4 ) of the TN.

Configuration 2
In this configuration of the ANs, the AN positioned in a 1 is an UWB beacon and the remaining three ANs are WiFi APs. For each considered position (t i ) 4 i=1 of the TN, n = 100 position estimates are computed and results are properly processed to obtain the quantities used to measure the accuracy of localization. Table 2 shows the average value of the distance between the true position of the TN and its estimates, denoted as e, and the standard deviation of the distance between the true position of the TN and its estimates, denoted as σ. The average values (e x , e y , and e z ) and the standard deviations (σ x , σ y , and σ z ) of the localization errors with respect to the three axes are also shown. Table 2. Experimental results in Configuration 2: measured average errors (e, e x , e y , and e z ) are shown together with the relative standard deviations (σ, σ x , σ y , and σ z ) for the four considered positions (t 1 , t 2 , t 3 , and t 4 )  Observe that the values of e vary between 0.398 m (in correspondence of t 4 ) and 0.692 m (in correspondence of t 2 ). A comparison between the values of e obtained in this configuration and those obtained in Configuration 1 shows that the use of a single UWB beacon improves the accuracy of localization. The value of e obtained in Configuration 2 is reduced by 29% with respect to that obtained in Configuration 1 when the TN is in position t 1 . The value of e obtained in Configuration 2 is reduced by 8% with respect to that obtained in Configuration 1 when the TN is in position t 2 . The value of e obtained in Configuration 2 is reduced by 23% with respect to that obtained in Configuration 1 when the TN is in position t 3 . Finally, the value of e obtained in Configuration 2 is reduced by 24% with respect to that obtained in Configuration 1 when the TN is in position t 4

Configuration 3
In this configuration of the ANs, the AN positioned in a 1 and the AN positioned in a 3 are UWB beacons, while the remaining two ANs are WiFi APs. For each considered position (t i ) 4 i=1 of the TN, n = 100 position estimates are computed and results are properly processed to obtain the quantities used to measure the accuracy of localization. Table 3 shows the average value of the distance between the true position of the TN and its estimates, denoted as e, and the standard deviation of the distance between the true position of the TN and its estimates, denoted as σ. The average values (e x , e y , and e z ) and the standard deviations (σ x , σ y , and σ z ) of the localization errors with respect to the three axes are also shown. Table 3. Experimental results in Configuration 3: measured average errors (e, e x , e y , and e z ) are shown together with the relative standard deviations (σ, σ x , σ y , and σ z ) for the four considered positions (t 1 , t 2 , t 3 , and t 4 ) of the TN.  3 is reduced by 72% with respect to that obtained in Configuration 1 when the TN is in position t 1 . The value of e obtained in Configuration 3 is reduced by 69% with respect to that obtained in Configuration 1 when the TN is in position t 2 . The value of e obtained in Configuration 3 is reduced by 70% with respect to that obtained in Configuration 1 when the TN is in position t 3 . Finally, the value of e obtained in Configuration 3 is reduced by 67% with respect to that obtained in Configuration 1 when the TN is in position t 4 .
The introduction of a second UWB beacon improves the accuracy of localization also with respect to Configuration 2, where only one UWB beacon is present. The value of e obtained in Configuration 3 is reduced by 61% with respect to that obtained in Configuration 2 when the TN is in position t 1 . The value of e obtained in Configuration 3 is reduced by 66% with respect to that obtained in Configuration 2 when the TN is in position t 2 . The value of e obtained in Configuration 3 is reduced by 61% with respect to that obtained in Configuration 2 when the TN is in position t 3 . Finally, the value of e obtained in Configuration 3 is reduced by 56% with respect to that obtained in Configuration 2 when the TN is in position t 4 .
Observe that the values of σ vary between 0.093 m (in correspondence of t 1 ) and 0.142 m (in correspondence of t 2 ) and they are further reduced with respect to those obtained in Configurations 1 and 2. The values of the average errors along the three axis are similar to each other and they are lower than those obtained in Configurations 1 and 2. The same holds for the corresponding values of the standard deviations.

Configuration 4
In this configuration of the ANs, all the ANs used for localization are UWB beacons. For each considered position (t i ) 4 i=1 of the TN, n = 100 position estimates are computed and results are properly processed to obtain the quantities used to measure the accuracy of localization. Table 4 shows the average value of the distance between the true position of the TN and its estimates, denoted as e, and the standard deviation of the distance between the true position of the TN and its estimates, denoted as σ. The average values (e x , e y , and e z ) and the standard deviations (σ x , σ y , and σ z ) of the localization errors with respect to the three axes are also shown. Table 4. Experimental results in Configuration 4: measured average errors (e, e x , e y , and e z ) are shown together with the relative standard deviations (σ, σ x , σ y , and σ z ) for the four considered positions (t 1 , t 2 , t 3 , and t 4 ) of the TN. Observe that the values of e vary between 0.032 m (in correspondence of t 4 ) and 0.136 m (in correspondence of t 2 ). A comparison between the values of e obtained in this configuration and those obtained in Configuration 1, where only WiFi APs were used, shows that replacing all the WiFi APs with UWB beacons strongly improves the accuracy of localization. The value of e obtained in Configuration 4 is reduced by 81% with respect to that obtained in Configuration 1 when the TN is in position t 1 . The value of e obtained in Configuration 4 is reduced by 82% with respect to that obtained in Configuration 1 when the TN is in position t 2 . The value of e obtained in Configuration 4 is reduced by 90% with respect to that obtained in Configuration 1 when the TN is in position t 3 . Finally, the value of e obtained in Configuration 4 is reduced by 93% with respect to that obtained in Configuration 1 when the TN is in position t 4 .
The use of four UWB beacon improves the accuracy of localization also with respect to Configuration 2, where only one UWB beacon is present. The value of e obtained in Configuration 4 is reduced by 74% with respect to that obtained in Configuration 2 when the TN is in position t 1 . The value of e obtained in Configuration 4 is reduced by 74% with respect to that obtained in Configuration 2 when the TN is in position t 1 . The value of e obtained in Configuration 4 is reduced by 80% with respect to that obtained in Configuration 2 when the TN is in position t 2 . The value of e obtained in Configuration 4 is reduced by 87% with respect to that obtained in Configuration 2 when the TN is in position t 3 . Finally, the value of e obtained in Configuration 4 is reduced by 91% with respect to that obtained in Configuration 2 when the TN is in position t 4 .
The accuracy of localization with four UWB beacon is also improved with respect to Configuration 3, where only two UWB beacons are used. The value of e obtained in Configuration 4 is reduced by 33% with respect to that obtained in Configuration 3 when the TN is in position t 1 . The value of e obtained in Configuration 4 is reduced by 40% with respect to that obtained in Configuration 3 when the TN is in position t 2 . The value of e obtained in Configuration 4 is reduced by 68% with respect to that obtained in Configuration 3 when the TN is in position t 3 . Finally, the value of e obtained in Configuration 4 is reduced by 81% with respect to that obtained in Configuration 3 when the TN is in position t 4 . Observe that the values of σ vary between 0.005 m (in correspondence of t 4 ) and 0.018 m (in correspondence of t 1 and t 2 ) and they are further reduced by one order of magnitude with respect to those obtained in Configuration 3. The values of the average errors along the three axis are similar to each other and they are lower than those obtained in Configurations 1 and 2. The same holds for the corresponding values of the standard deviations.

Discussion
The remaining of this section provides additional comments on obtained experimental results in order to clarify the analysis of localization errors. The experimental results presented in this section show that the accuracy of localization improves as the number of UWB beacons increases. Such a result is not surprising because UWB-based distance estimates are typically more accurate than WiFi-based distance estimates. Figure 2 shows the values of the average localization errors e for the four considered positions of the TN. In the figure, light-blue dots represent the values of e obtained in Configuration 1, violet triangles represent the values of e obtained in Configuration 2, orange crosses represent the values of e obtained in Configuration 3, and green diamonds represent the values of e obtained in Configuration 4. Regardless of the position of the TN, the values of e decrease as the number of UWB beacon used for localization increases. A significant improvement can be noticed when the number of UWB beacons is equal to two (orange crosses).
As an illustrative example intended to further clarify the details of experimental results, Figure 3 shows for all configurations of the ANs the values of the distances between the true position of the TN and the relative estimated position for each one of the n = 100 samples when the TN is positioned in t 1 . In detail, light-blue dots refer to Configuration 1, violet triangles refer to Configuration 2, orange crosses refer to Configuration 3, and green diamonds refer to Configuration 4. When considering WiFi-based localization (light-blue dots), the values of the localization error are often higher 0.5 m and they can vary significantly when different samples are considered. When considering distance estimates obtained with one UWB beacon and three WiFi APs, the values of the localization error (violet triangles) are reduced with respect to the previous case and the number of peaks corresponding to high errors is also reduced. The figure also shows that the accuracy of localization improves when considering the configuration with two UWB beacons and two WiFi APs because the values of the localization error are further reduced (orange crosses). Finally, the lower values of the localization error are obtained when localization uses only the UWB technology. In this case, the values of the localization error are almost constant over the n samples. Finally, Figure 3 also shows that the variance of the localization error decreases as the number of UWB beacons involved in localization increases, in agreement with results in Tables 1-4.

Conclusions
The major contribution of this paper is to validate the possibility of effectively implementing hybrid indoor localization to benefit from both the widespread availability of WiFi networks and the well-known accuracy of UWB-based localization. The major advantage of the use of WiFi technology to support localization is that nowadays WiFi networks are ubiquitous and virtually all smart devices supports WiFi connectivity. On the other hand, the accuracy of WiFi-based localization is not often sufficient to support relevant applications because WiFi-based localization is not an option when the requested accuracy is below 50 cm. At the opposite, UWB-based localization is well-known for its accuracy and robustness, but UWB beacons are not normally available in indoor environments, and their deployment contributes to increase the total cost of ownership of the localization infrastructure. Therefore, the possibility of synergistically using both technologies seems to provide a good compromise between accuracy and infrastructure costs.
Experimental results discussed in the last part of this paper provide convincing empirical evidence that the proposed hybrid approach to enhance the accuracy of WiFi-based localization using a small number of UWB beacons is effective. Four different configurations of WiFi APs and UWB beacons were considered, and for each considered configuration the localization accuracy corresponding to four different positions of the TN was evaluated. In the first configuration, only WiFi APs were available and localization was performed using only WiFi-based distance estimates. In the second configuration, one of the four WiFi APs was replaced with an UWB beacon, so that three WiFi APs and one UWB beacon were used. In the third configuration, the number of WiFi APs is further reduced to two because an additional WiFi AP is replaced with an UWB beacon. Finally, in the fourth configuration, only UWB beacons were used. As expected, the accuracy of localization improves as the number of UWB beacons increases and the most accurate position estimates were obtained when four UWB beacons were used. Notably, discussed results show that the use of a small number of UWB beacons (one or two) can significantly reduce the average localization error. In detail, the use of just one UWB beacon reduces the average localization error from nearly 70 cm to 50 cm, while the use of two UWB beacons reduces it further to 20 cm. Therefore, the adoption of a hybrid localization infrastructure seems to provide an effective and adjustable compromise between the accuracy of localization and the total cost of ownership of the infrastructure.
Author Contributions: Authors contributed equally to this work in terms of conceptualization, methodology, software, validation, formal analysis, investigation, resources, data curation, writing-original draft preparation, and writing-review and editing.
Funding: This research received no external funding.

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

Abbreviations
The following abbreviations are used in this manuscript: