A Map/INS/Wi-Fi Integrated System for Indoor Location-Based Service Applications

In this research, a new Map/INS/Wi-Fi integrated system for indoor location-based service (LBS) applications based on a cascaded Particle/Kalman filter framework structure is proposed. Two-dimension indoor map information, together with measurements from an inertial measurement unit (IMU) and Received Signal Strength Indicator (RSSI) value, are integrated for estimating positioning information. The main challenge of this research is how to make effective use of various measurements that complement each other in order to obtain an accurate, continuous, and low-cost position solution without increasing the computational burden of the system. Therefore, to eliminate the cumulative drift caused by low-cost IMU sensor errors, the ubiquitous Wi-Fi signal and non-holonomic constraints are rationally used to correct the IMU-derived navigation solution through the extended Kalman Filter (EKF). Moreover, the map-aiding method and map-matching method are innovatively combined to constrain the primary Wi-Fi/IMU-derived position through an Auxiliary Value Particle Filter (AVPF). Different sources of information are incorporated through a cascaded structure EKF/AVPF filter algorithm. Indoor tests show that the proposed method can effectively reduce the accumulation of positioning errors of a stand-alone Inertial Navigation System (INS), and provide a stable, continuous and reliable indoor location service.


Introduction
Location-based services (LBS), which are accessible from mobile devices, have become increasingly important in recent years. LBS are widely used in a variety of contexts to provide services such as identifying the user's location and performing mobile commerce for customers [1][2][3]. Currently, the common technologies for LBS can be divided into Radio Frequency (RF)-based and non-RF-based positioning methods [4]. The RF-based positioning methods include Wi-Fi-based positioning, cellular-based positioning, Bluetooth-based positioning, etc. On the other hand, the non-RF-based positioning methods include signage and maps positioning, inertial navigation, and acoustic positioning [5].
For commercial LBS, cost and convenience are the primary issues to be considered [6]. In this research, the non-RF-based positioning method, map, and INS positioning technologies are selected among various location method options. When compared with the RF-based positioning method, the non-RF-based positioning methods have the advantage of being low-cost and self-contained.

Methodology
In this research, we take advantage of the ubiquitous Wi-Fi, smartphone built-in IMU and the indoor map information to provide a low-cost and self-contained indoor navigation method. A two-layer KF/APF structure algorithm is designed and used to integrate the above information source. Moreover, a novel map matching and map aiding methods are combined to further improve the final solution by making full use of the indoor map information. In this methodology section, we explain how we used the Wi-Fi data and the IMU data to obtain the estimated positions. Then, we present how we combined/integrated these estimated positions together with the indoor map information.
Firstly, the coordinate systems which are used in this paper are defined as follows, and can be illustrated by Figure 1: (1) The b-frame (X b , Y b , Z b ) is the IMU (smartphone) body frame. Here, the body frame is positioned with its y-axis pointing forward (along the walking direction), z-axis pointing up and x-axis completing a right-handed orthogonal triad.
(2) The n-frame (X n , Y n , Z n ) is the navigation frame. In this research, the NED frame is selected as the system navigation frame (n-frame). The x-axis (N) points towards the ellipsoidal North, and the z-axis is orthogonal to the reference ellipsoid and points downwards (D). The y-axis completes the right-handed orthogonal frame, thus pointing towards East (E).
Sensors 2017, 17, 1272 3 of 18 (2) The n-frame ( , , ) is the navigation frame. In this research, the NED frame is selected as the system navigation frame (n-frame). The x-axis (N) points towards the ellipsoidal North, and the z-axis is orthogonal to the reference ellipsoid and points downwards (D). The y-axis completes the right-handed orthogonal frame, thus pointing towards East (E). Next in this section, we present the various techniques we used to deal with different kinds of information, as well as the two-layer structure we designed to combine the different kinds of information.

INS Navigation Solution
The INS navigation solution provides the primary information for the LBS; the Wi-Fi position and map information are then applied to aid the system on the basis of the INS solution. INS is typically implemented through the mechanization method. The mechanization equations are used in deriving the navigation information from the IMU measurements (i.e., specific force and angular rates). Figure 2 shows the schematic diagram of the INS mechanization method [9]. The motion of the moving object in the navigation frame is given as follows: where = [ ] represents the INS derived position, = [ ] denotes the velocity, and is the rotation matrix describing the rotation of the body frame b relative to the n-frame. The rotation matrix can be used to derive the attitude vector (i.e., pitch, roll and heading).
denotes the accelerometer measurements, and Ω is the skew symmetric matrix of the angular velocity , which is measured by the gyroscope [15]. Next in this section, we present the various techniques we used to deal with different kinds of information, as well as the two-layer structure we designed to combine the different kinds of information.

INS Navigation Solution
The INS navigation solution provides the primary information for the LBS; the Wi-Fi position and map information are then applied to aid the system on the basis of the INS solution. INS is typically implemented through the mechanization method. The mechanization equations are used in deriving the navigation information from the IMU measurements (i.e., specific force and angular rates). Figure 2 shows the schematic diagram of the INS mechanization method [9]. (2) The n-frame ( , , ) is the navigation frame. In this research, the NED frame is selected as the system navigation frame (n-frame). The x-axis (N) points towards the ellipsoidal North, and the z-axis is orthogonal to the reference ellipsoid and points downwards (D). The y-axis completes the right-handed orthogonal frame, thus pointing towards East (E). Figure 1. Frame definition used in the LBS.
Next in this section, we present the various techniques we used to deal with different kinds of information, as well as the two-layer structure we designed to combine the different kinds of information.

INS Navigation Solution
The INS navigation solution provides the primary information for the LBS; the Wi-Fi position and map information are then applied to aid the system on the basis of the INS solution. INS is typically implemented through the mechanization method. The mechanization equations are used in deriving the navigation information from the IMU measurements (i.e., specific force and angular rates). Figure 2 shows the schematic diagram of the INS mechanization method [9]. The motion of the moving object in the navigation frame is given as follows: ] denotes the velocity, and is the rotation matrix describing the rotation of the body frame b relative to the n-frame. The rotation matrix can be used to derive the attitude vector (i.e., pitch, roll and heading).
denotes the accelerometer measurements, and Ω is the skew symmetric matrix of the angular velocity , which is measured by the gyroscope [15]. The motion of the moving object in the navigation frame is given as follows: where r n = r x r y r z T represents the INS derived position, v n = v x v y v z T denotes the velocity, and T n b is the rotation matrix describing the rotation of the body frame b relative to the n-frame. The rotation matrix can be used to derive the attitude vector (i.e., pitch, roll and heading). f b denotes the accelerometer measurements, and Ω b is the skew symmetric matrix of the angular velocity ω b , which is measured by the gyroscope [15].
The error of the INS grows with time; therefore, NHC, a commonly used auxiliary information source, can be used to reduce the INS accumulated error [16,17]. NHC assumes that a moving platform cannot skid or jump, and the lateral and vertical speeds can be assumed to be zero. The forward, lateral, and vertical speeds update velocity for the INS in order to limit the INS velocity errors through EKF. The following equations are: (1) the EKF system update equation and (2) the measurement update equation: Based on the mechanization Equation (1), we can obtain the linearized discrete INS error model [15]. The subscript k represents the update time k. The vector δx I NS k = δr n δv n δε n T is the INS error state including the error states of position, velocity, and attitude. ω I NS k is the sensor noise vector, and G ins is the noise distribution matrix. Φ I NS k+1,k is the discrete-time error state transition matrix from epoch k to k + 1. δz I NS/NHC k is the measurement vector, which is the true velocity/position (NHC velocity) of the system minus the velocity vector derived from INS during the NHC update. v I NS/NHC k is the measurement noise matrix.
However, the NHC-aided INS-alone system has limited observation information. Therefore, before we designed an integrated navigation algorithm, it was necessary to analyze the system observability. Reference [18] deduces and discusses the observability of the NHC-INS system in detail. We know that the system observability of the NHC-aided INS system, specifically the system heading, is weak. Therefore, the ubiquitous Wi-Fi signal and map information are used to integrate with the INS solution.

System Initialization of INS
We know that the INS provides the relative position, which means that the initial position and attitude information are needed. There are two initialization modes for our system: (1) "manual mode", which means the user can manually enter the initial position and heading according to the given map information, and (2) "program mode" in which the initial position is provided by the Wi-Fi solution, and assumes that the Wi-Fi signal is available. Moreover, the initial heading in this LBS is given by magnetometer, as shown in Figure 3. Then, the initial azimuth Ψ is given by: where D is the magnetic declination, denoting the angle between the geographic north and the magnetic north, H = H x H y H z is the magnetometer-measured magnetic field vector composed of the three field components along the b-frame. The error of the INS grows with time; therefore, NHC, a commonly used auxiliary information source, can be used to reduce the INS accumulated error [16,17]. NHC assumes that a moving platform cannot skid or jump, and the lateral and vertical speeds can be assumed to be zero. The forward, lateral, and vertical speeds update velocity for the INS in order to limit the INS velocity errors through EKF. The following equations are: (1) the EKF system update equation and (2) the measurement update equation: Based on the mechanization Equation (1), we can obtain the linearized discrete INS error model [15]. The subscript k represents the update time k. / is the measurement noise matrix. However, the NHC-aided INS-alone system has limited observation information. Therefore, before we designed an integrated navigation algorithm, it was necessary to analyze the system observability. Reference [18] deduces and discusses the observability of the NHC-INS system in detail. We know that the system observability of the NHC-aided INS system, specifically the system heading, is weak. Therefore, the ubiquitous Wi-Fi signal and map information are used to integrate with the INS solution.

System Initialization of INS
We know that the INS provides the relative position, which means that the initial position and attitude information are needed. There are two initialization modes for our system: (1) "manual mode", which means the user can manually enter the initial position and heading according to the given map information, and (2) "program mode" in which the initial position is provided by the Wi-Fi solution, and assumes that the Wi-Fi signal is available. Moreover, the initial heading in this LBS is given by magnetometer, as shown in Figure 3. Then, the initial azimuth Ψ is given by: where is the magnetic declination, denoting the angle between the geographic north and the magnetic north, = ( ) is the magnetometer-measured magnetic field vector composed of the three field components along the b-frame.

Wi-Fi Derived Solution
Fingerprinting and trilateration are two popular Wi-Fi based positioning methods, each of which has its own advantages and disadvantages. In this research, the fingerprinting method is used because it provides the users' position without any knowledge of the access point's (AP) location or signal-propagation model. As shown in Figure 4, fingerprinting-based Wi-Fi positioning usually has two operational steps: (1) the offline pre-survey, and (2) the online positioning [19].

Wi-Fi Derived Solution
Fingerprinting and trilateration are two popular Wi-Fi based positioning methods, each of which has its own advantages and disadvantages. In this research, the fingerprinting method is used because it provides the users' position without any knowledge of the access point's (AP) location or signal-propagation model. As shown in Figure 4, fingerprinting-based Wi-Fi positioning usually has two operational steps: (1) the offline pre-survey, and (2) the online positioning [19]. In the first step, the Received Signal Strength values from the available access points and their observed position information are collected as fingerprints to populate a database [20]. Each fingerprint in the radio-map database is recorded as a vector, which normally has the following form: = (SSID , MAC , RSS ), … , (SSID , MAC , RSS ) , where the Service Set Identifier (SSID) and the Media Access Control (MAC), respectively, present the name and the MAC address of a specific AP.
In the second step, the device's position is estimated by comparing the measured vector of the RSS with the fingerprints in the pre-built database, in order to estimate and determine the closest fingerprints [21]. The Weighted K-Nearest Neighbor (WKNN) algorithm is used in estimating the optimal match between the device's newly-collected RSSs and those RSSs stored in the radio-map database. Compared with traditional methods, such as the Nearest Neighbor (NN) algorithm and the K-Nearest Neighbor (KNN) algorithm, the weighted KNN (WKNN) takes more than one (k) neighbor into consideration and arranges the weight according to the Euclidean distances. The device's current estimated position is updated by weighting the corresponding k reference coordinates (fingerprints) in the radio-map database using the following equation: where ̂ is the estimated navigation coordinate; , in which d is the twodimensional Euclidean distance between and , d is defined as d = | − |, ( = 1,2, … , ). Vector = … represents the RSS set of the fingerprints' database. The measured RSS values from n APs at an unknown location are expressed as a set = … , n is the number In the first step, the Received Signal Strength values from the available access points and their observed position information are collected as fingerprints to populate a database [20]. Each fingerprint in the radio-map database is recorded as a vector, which normally has the following form: S i = {(SSID 1 , MAC 1 , RSS 1 ), . . . , (SSID n , MAC n , RSS n )}, where the Service Set Identifier (SSID) and the Media Access Control (MAC), respectively, present the name and the MAC address of a specific AP.
In the second step, the device's position is estimated by comparing the measured vector of the RSS with the fingerprints in the pre-built database, in order to estimate and determine the closest fingerprints [21]. The Weighted K-Nearest Neighbor (WKNN) algorithm is used in estimating the optimal match between the device's newly-collected RSSs and those RSSs stored in the radio-map database. Compared with traditional methods, such as the Nearest Neighbor (NN) algorithm and the K-Nearest Neighbor (KNN) algorithm, the weighted KNN (WKNN) takes more than one (k) neighbor into consideration and arranges the weight according to the Euclidean distances. The device's current estimated position is updated by weighting the corresponding k reference coordinates (fingerprints) in the radio-map database using the following equation: wherep is the estimated navigation coordinate; p j (j = 1, 2, . . . K is the setting number of the K-nearest neighbors (points) with the smallest distances to β.

Wi-Fi/INS/NHC Kalman Filter
When the Wi-Fi position solution is available, the measurement update equation for the EKF in Equation (2)  is reset, which means the error state prediction procedure is no longer required. The complementary characteristics of MEMS sensors and Wi-Fi enable an efficient integration for indoor navigation applications. Thus, if a Wi-Fi signal is available, we estimate a more accurate INS solution from the lower filter. Subsequently, the number of particles used in the upper filter decreases, which can indirectly increase the computational speed of the system. However, if no Wi-Fi signal is available, an indoor map is still the main auxiliary information of the system.

Two-Layer KF/PF Structure
This research proposes a two-layer KF/PF structure algorithm as shown in Figure 5. On the upper layer of the algorithm, a PF is used to introduce the map information to the primary Wi-Fi/INS integrated solution. The PF is easy and convenient for adding additional map information, and can accommodate arbitrary sensor characteristics, motion dynamics, and noise distributions. Moreover, the number of samples used in PF can be controlled to suit the available computational resources in some enhanced versions of PF. The step and heading information calculated from the primary Wi-Fi/INS solution are utilized to perform the Pedestrian Dead Reckoning (PDR) update; the update rate is the same as the low step detection rate. After this step, the indoor map information is used as new measurement to re-set the weights of particles and obtain a map-constrained navigation solution. of the access point. K is the setting number of the K-nearest neighbors (points) with the smallest distances to .

Wi-Fi/INS/NHC Kalman Filter
When the Wi-Fi position solution is available, the measurement update equation for the EKF in Equation (2) will be updated as: is the measurement vector, which is the true velocity/position (NHC velocity/Wi-Fi position) of the system minus the velocity/position vector derived from INS during the NHC/Wi-Fi update.
/ / is the measurement noise matrix. The measurement matrix is . Everytime the state error is updated, the errors are applied to the INS navigation solution; then, is reset, which means the error state prediction procedure is no longer required. The complementary characteristics of MEMS sensors and Wi-Fi enable an efficient integration for indoor navigation applications. Thus, if a Wi-Fi signal is available, we estimate a more accurate INS solution from the lower filter. Subsequently, the number of particles used in the upper filter decreases, which can indirectly increase the computational speed of the system. However, if no Wi-Fi signal is available, an indoor map is still the main auxiliary information of the system.

Two-Layer KF/PF Structure
This research proposes a two-layer KF/PF structure algorithm as shown in Figure 5. On the upper layer of the algorithm, a PF is used to introduce the map information to the primary Wi-Fi/INS integrated solution. The PF is easy and convenient for adding additional map information, and can accommodate arbitrary sensor characteristics, motion dynamics, and noise distributions. Moreover, the number of samples used in PF can be controlled to suit the available computational resources in some enhanced versions of PF. The step and heading information calculated from the primary Wi-Fi/INS solution are utilized to perform the Pedestrian Dead Reckoning (PDR) update; the update rate is the same as the low step detection rate. After this step, the indoor map information is used as new measurement to re-set the weights of particles and obtain a map-constrained navigation solution. To take full advantage of indoor map information, the map-matching method is also used to project the INS/Map integrated solution to the map. However, the PF algorithm also decreases the computational efficiency, and may face particle failure problems. To overcome these implementation issues of PF, the KF is used on the bottom layer of the algorithm, NHC and Wi-Fi estimated position To take full advantage of indoor map information, the map-matching method is also used to project the INS/Map integrated solution to the map. However, the PF algorithm also decreases the computational efficiency, and may face particle failure problems. To overcome these implementation issues of PF, the KF is used on the bottom layer of the algorithm, NHC and Wi-Fi estimated position (if Wi-Fi is available) are used as inputs to the KF to correct the preliminary INS navigation solution. Compared with the other traditional particle filters, PF with a two-layer KF/PF structure has low computational burden, because the update rate of PF has been changed from "IMU data output rate 50 Hz" to "step detection update rate".

Map Aiding through Auxiliary Value PF
Indoor map information is used to constrain the primary INS solution through the PF, which is numerically implementation of Bayesian estimator. A set of particle samples are used to represent the posterior density p(x t |Y t ) through the Monte Carlo approach [22,23]: where t is the time index, x t is the state, Y t is the measurement set. w (i) t is the i-th particle's weight at time t, and can be represented as: where q is the importance density function. Traditional PF methods select the state transition probability density function as the importance density function of PF, and the traditional PF methods do not take the measurements into consideration, and therefore may cause unsatisfactory sampling results. This can result in many particle weights at values of either zero or close to zero, and few particles are duplicated during the resampling processes. Therefore, the PF method loses diversity, and suffers from particle impoverishment, as previously reported in [24].
In this research, Auxiliary Value Sequential Importance Resampling (ASIR) PF is applied instead of the traditional SIR PF. Different from the state transition probability density function, AVPF takes the measurements into consideration and provides an efficient method for solving the particle impoverishment problem [25,26]. On the other hand, particles that do not match the current measurements are pre-tested and deleted. PF consists of three phases: system propagation, measurement update, and resampling (when required). The posterior probability density function of x k can be represented as: Introducing the auxiliary variable ζ to represent the component index in the above equation: then we can select the importance density function: in which, ( z k u i k|k−1 ) is the statistic of x k given x i k−1 , and it is related with p x k x i k−1 . Usually, u i k|k−1 can be set as the expectation of p x k x i k−1 . From the importance resampling method, we can obtain a set of new particles ∼ q x k , ς i k−1 z 0:k . Ignoring the auxiliary variable ζ, we can obtain the particle set x i k , w i k N s i=1 , in which w i k is the weight of the particles: Therefore, the process of AVPF can be summarized as: (1) Calculating the auxiliary variable u i k|k−1 for each particle. (2) Calculating the auxiliary weight of each particle:ŵ i k−1 ∝ w i k−1 p z k |u i k|k−1 .
(3) Normalizing the weight: (4) Resampling according to the normalized auxiliary weight w i k , but only the sequence number ς i k−1 is needed.
(5) Importance sampling (Prediction): and normalizing the value to obtain both the particles and their weight The Dead Reckoning (DR) positioning technique is used to build the particle filter system update model. Essentially, the Pedestrian Dead Reckoning (PDR) method determines a new position by utilizing the knowledge of a previously known position, together with the current travelled distance and heading information [27,28]. In this research, step detection of the upper filter is performed during the INS mechanization process in the lower filter, using the method in [29]. The stride length and heading estimation results derived from the lower KF are the measurements of the upper PF. Therefore, the system model for PF can be written as: in which S i k is the stride length of the user, and Ψ i k is the heading. The superscript i denotes the i-th particle of PF, and the subscript k denotes the k-th step of the PDR update. E i k+1 and N i k+1 are the East and North position of the system.
For the measurement update process, two-dimensional indoor architectural map information is used as a new measurement to update the weight of the particles w (i) k . A Cross-wall method based on indoor map aiding is used to update the particle weight [30]. Specifically, if the new particle has intersection with the wall after system propagation, then this particle is invalid, and assigned a zero weight (i.e., w (i) k = 0). If a wall is not intersected by the particle during the propagation step, the new generated particle is valid, and the weight of the particle remains the same, as with the previous step.

Map Matching
The map-matching method is the last step of the navigation algorithm used to re-correct the estimation error after applying the PF-based map-aiding method. The predicted position from PF is projected to the digital map database. Depending on the format of the indoor digital map, different map matching algorithms can be used. In this paper, the point-to-point map-matching method is used because of the simple format requirements of the digital map. The algorithm projects the estimated location, P(X P , Y P ), to the closest link in the network using the distance form Equation (13) [31]: (14) in which (X e , Y e ) is the position estimated from the MA-based APF algorithm, (X 1 , Y 2 ) is the start-point, and (X 2 , Y 2 ) is the end-point of the closest line segment in the digital map. Additionally, A = (X 2 − X 1 ), and B = (Y 2 − Y 1 ). We obtain the closest line segment using Equation (15): Therefore, the final estimated position solution is the set of these projection points: P(X P , Y P ).
In summary, in this research, we present a Map/INS/Wi-Fi integrated indoor navigation method, and a two-layer KF/APF structure is proposed to combine multiple information sources. From the design of the system methodology, we know that this is a self-contained and low cost system. Moreover, the low PF update rate can decrease the system computational burden to a certain extent. In the following section, we test the accuracy of the proposed method.

Experiment and Analysis
The validity and feasibility of the proposed algorithm are confirmed through conducting indoor experiments in the basement floor of Engineering (ENG) building and the first floor of the Energy Environment Experiential Learning (EEEL) building at the University of Calgary. The time duration of these tests is approximately 30 min. Figures 6a and 7a show the experiment environment for the tests in the ENG and EEEL building, respectively. Figures 6b and 7b are the corresponding designed experiment trajectory plotted on the two-dimension digital map of the first floor. In summary, in this research, we present a Map/INS/Wi-Fi integrated indoor navigation method, and a two-layer KF/APF structure is proposed to combine multiple information sources. From the design of the system methodology, we know that this is a self-contained and low cost system. Moreover, the low PF update rate can decrease the system computational burden to a certain extent. In the following section, we test the accuracy of the proposed method.

Experiment and Analysis
The validity and feasibility of the proposed algorithm are confirmed through conducting indoor experiments in the basement floor of Engineering (ENG) building and the first floor of the Energy Environment Experiential Learning (EEEL) building at the University of Calgary. The time duration of these tests is approximately 30 min. Figures 6a and 7a show the experiment environment for the tests in the ENG and EEEL building, respectively. Figures 6b and 7b are the corresponding designed experiment trajectory plotted on the two-dimension digital map of the first floor.  From Figure 7a, we can see that there is a hall in EEEL building (112 in Figure 7b). For this area, not much architecture map information can be used to constrain the INS derived solution. Also, for deep indoor areas, there is no GNSS signal can be used to provide positional information.
The proposed algorithm has been implemented on the Samsung Galaxy Note 4 smartphone which includes the sensors listed in Table 1. In order to quantitatively analyze the performance of the proposed algorithm, a "heading lock" PDR method is used in generating reference trajectories. In this mode, it is assumed that the user's walking heading for the PDR update is "locked" to a specific value according to the indoor map. This mode then uses the specific corners and intersections as "landmarks" to further correct the PDR-derived positions. From this method, we obtain the reference trajectories of the tests in ENG and EEEL, illustrated in Figures 8. Figures 9-13 illustrate the estimated solutions of test in ENG building from different kinds of methods. From Figure 7a, we can see that there is a hall in EEEL building (112 in Figure 7b). For this area, not much architecture map information can be used to constrain the INS derived solution. Also, for deep indoor areas, there is no GNSS signal can be used to provide positional information.
The proposed algorithm has been implemented on the Samsung Galaxy Note 4 smartphone which includes the sensors listed in Table 1. In order to quantitatively analyze the performance of the proposed algorithm, a "heading lock" PDR method is used in generating reference trajectories. In this mode, it is assumed that the user's walking heading for the PDR update is "locked" to a specific value according to the indoor map. This mode then uses the specific corners and intersections as "landmarks" to further correct the PDR-derived positions. From this method, we obtain the reference trajectories of the tests in ENG and EEEL, illustrated in Figure 8. Figures 9-13 illustrate the estimated solutions of test in ENG building from different kinds of methods.            Figure 7 with the reference trajectory in Figure 6, it is evident that INS-alone system cannot provide realistic estimated position solutions, even with the NHC velocity constraint. The reason for this is when the velocity is used to correct the system error, the heading of the system is unobservable, which is also confirmed by the observability analysis conducted in [32]. Therefore, aiding information is needed to further correct the error of the system. Figure 10 illustrates the Wi-Fi fingerprint estimated positions, where each black dot represents one Wi-Fi estimated position. Figure 11 Figure 7 with the reference trajectory in Figure 6, it is evident that INS-alone system cannot provide realistic estimated position solutions, even with the NHC velocity constraint. The reason for this is when the velocity is used to correct the system error, the heading of the system is unobservable, which is also confirmed by the observability analysis conducted in [32]. Therefore, aiding information is needed to further correct the error of the system. Figure 10 illustrates the Wi-Fi fingerprint estimated positions, where each black dot represents one Wi-Fi estimated position. Figure 11 Figure 7 with the reference trajectory in Figure 6, it is evident that INS-alone system cannot provide realistic estimated position solutions, even with the NHC velocity constraint. The reason for this is when the velocity is used to correct the system error, the heading of the system is unobservable, which is also confirmed by the observability analysis conducted in [32]. Therefore, aiding information is needed to further correct the error of the system.   Figure 7 with the reference trajectory in Figure 6, it is evident that INS-alone system cannot provide realistic estimated position solutions, even with the NHC velocity constraint. The reason for this is when the velocity is used to correct the system error, the heading of the system is unobservable, which is also confirmed by the observability analysis conducted in [32]. Therefore, aiding information is needed to further correct the error of the system. Figure 10 illustrates the Wi-Fi fingerprint estimated positions, where each black dot represents one Wi-Fi estimated position. Figure 11 is the INS/Wi-Fi integrated positions. Figure 12 shows the Map/Wi-Fi/INS integrated solution using the PF-based map-aiding method. Figure 13 shows the map-matching and map-aiding combined estimated solution. By comparing Figure 12 with the reference trajectory in Figure 8, the estimated trajectory closely matches the reference trajectory.
For the test in the EEEL building, Figure 14 is the reference trajectory. Figures 15-19 illustrate the estimated solutions from different kinds of methods. Figure 15 is the INS/NHC derived position without auxiliary Wi-Fi position or map information. Comparing Figure 15 with the reference trajectory in Figure 14, it is also evident that INS-alone system cannot not satisfy the user requirements.
Sensors 2017, 17,1272 13 of 18 Figure 12 shows the Map/Wi-Fi/INS integrated solution using the PF-based map-aiding method. Figure 13 shows the map-matching and map-aiding combined estimated solution. By comparing Figure 12 with the reference trajectory in Figure 8, the estimated trajectory closely matches the reference trajectory.
For the test in the EEEL building, Figure 14 is the reference trajectory. Figure 15-19 illustrate the estimated solutions from different kinds of methods. Figure 15 is the INS/NHC derived position without auxiliary Wi-Fi position or map information. Comparing Figure 15 with the reference trajectory in Figure 14, it is also evident that INS-alone system cannot not satisfy the user requirements.     Figure 13 shows the map-matching and map-aiding combined estimated solution. By comparing Figure 12 with the reference trajectory in Figure 8, the estimated trajectory closely matches the reference trajectory.
For the test in the EEEL building, Figure 14 is the reference trajectory. Figure 15-19 illustrate the estimated solutions from different kinds of methods. Figure 15 is the INS/NHC derived position without auxiliary Wi-Fi position or map information. Comparing Figure 15 with the reference trajectory in Figure 14, it is also evident that INS-alone system cannot not satisfy the user requirements.     Figure 12 shows the Map/Wi-Fi/INS integrated solution using the PF-based map-aiding method. Figure 13 shows the map-matching and map-aiding combined estimated solution. By comparing Figure 12 with the reference trajectory in Figure 8, the estimated trajectory closely matches the reference trajectory.
For the test in the EEEL building, Figure 14 is the reference trajectory. Figure 15-19 illustrate the estimated solutions from different kinds of methods. Figure 15 is the INS/NHC derived position without auxiliary Wi-Fi position or map information. Comparing Figure 15 with the reference trajectory in Figure 14, it is also evident that INS-alone system cannot not satisfy the user requirements.         Figure 16, we can see that the Wi-Fi fingerprint solution contains positional errors that distort the whole trajectory. However, when we aid the Wi-Fi solution with the PDR, the results in Figure 17 shows that the integrated algorithm can complement each other, providing a better lower filter solution. However, the integrated Wi-Fi/PDR solution still contains positional drift in the trajectory. Figure 18 shows the Map/Wi-Fi/INS integrated solution using the PF-based map-aiding method, and Figure 19 shows the map-matching and map-aiding combined estimated solution. By comparing Figure 18 with Figure 14, the estimated trajectory closely matches the reference trajectory. Additionally,     Figure 16, we can see that the Wi-Fi fingerprint solution contains positional errors that distort the whole trajectory. However, when we aid the Wi-Fi solution with the PDR, the results in Figure 17 shows that the integrated algorithm can complement each other, providing a better lower filter solution. However, the integrated Wi-Fi/PDR solution still contains positional drift in the trajectory. Figure 18 shows the Map/Wi-Fi/INS integrated solution using the PF-based map-aiding method, and Figure 19 shows the map-matching and map-aiding combined estimated solution. By comparing Figure 18 with Figure 14, the estimated trajectory closely matches the reference trajectory. Additionally,     Figure 16, we can see that the Wi-Fi fingerprint solution contains positional errors that distort the whole trajectory. However, when we aid the Wi-Fi solution with the PDR, the results in Figure 17 shows that the integrated algorithm can complement each other, providing a better lower filter solution. However, the integrated Wi-Fi/PDR solution still contains positional drift in the trajectory. Figure 18 shows the Map/Wi-Fi/INS integrated solution using the PF-based map-aiding method, and Figure 19 shows the map-matching and map-aiding combined estimated solution. By comparing Figure 18 with Figure 14, the estimated trajectory closely matches the reference trajectory. Additionally,   Figure 16, we can see that the Wi-Fi fingerprint solution contains positional errors that distort the whole trajectory. However, when we aid the Wi-Fi solution with the PDR, the results in Figure 17 shows that the integrated algorithm can complement each other, providing a better lower filter solution. However, the integrated Wi-Fi/PDR solution still contains positional drift in the trajectory. Figure 18 shows the Map/Wi-Fi/INS integrated solution using the PF-based map-aiding method, and Figure 19 shows the map-matching and map-aiding combined estimated solution. By comparing Figure 18 with Figure 14, the estimated trajectory closely matches the reference trajectory. Additionally, when we combine the map-matching method with the map-aiding method, the user's trajectory will further converge; when MM method is applied the RMS error improves by 1 m, respectively.
Finally, Root-Mean-Square (RMS) values are calculated to analyze the estimated ENG and EEEL test results using the four methods. The RMS error of the proposed methods are computed, in order to see the difference between the estimated navigation solutions using our methods and the reference true trajectory. The following equation is used to calculate the root square mean error: where x 1,k is the reference position, and x 2,k is the estimated position from the proposed methods. 3. When indoor map information is added into the system, this accuracy further improved by more than 2 m. Additionally, when we add the map-matching method into the system, the RMS error of the system can be reduced to less than 5 m. Using the proposed method, we can obtain similar RMS value with [33][34][35], but have a low cost and self-contained system. Another thing needs to be mentioned is that, thousands of particles or even more are needed for traditional PF to implement indoor navigation [36,37]; however, in this research, we need less particles than traditional PF. Using the proposed method in this research, for the test in EEEL building, 2000 particles are needed; for the test in ENG building, only 1000 particles are needed. The number of particles used in the research can indirectly demonstrate that the proposed method has low computational burden.

Conclusions
This paper presents a two-layer EKF/AVPF structure algorithm to integrate MEMS/Wi-Fi/Map integrated indoor LBS applications. The two-layer EKF/AVPF structure algorithm is used to increase the system efficiency and decrease the system computational burden. The two-layer structure can take advantage of both PF and EKF, ensuring the utilization rate of inertial sensor data, while reducing the update frequency of PF. Therefore, we conclude that the INS/Wi-Fi integrated algorithm can improve the accuracy of the lower filter INS solution. In addition, the MA-based AVPF method improved the accuracy of the INS-derived navigation solution. Furthermore, by adding the MM algorithm, the MA-based AVPF results were optimized. This research applies free ubiquitous Wi-Fi signal and indoor map information, in order to correct the INS accumulative errors. This can decrease the cost of LBS and has significant meaning for its popularization. Moreover, based on RMS analysis, the system accuracy has been effectively improved, and the RMS error was reduced within 5 m.
In future, we will test the algorithm in multiple floor-plan environments, so the user will have continuous navigation service, while moving between several floors. Then, all the proposed algorithms will be programed into a smartphone platform in real time. Moreover, we will design appropriate algorithms and perform real-time experiment to directly demonstrate that the proposed method has a low computational burden.