WIFI / PDR indoor integrated positioning system in a multi-floor environment

Location-based services (LBS) are services offered through a mobile device that take into account a device’s geographical location. To provide position information for these services, location is a key process. The creation of systems for solving problems of positioning and navigation inside buildings is a very perspective, actual and complicated task, especially in a multi-floor environment. To improve the accuracy of indoor positioning for location-based services, we created an improved WiFi/PDR (Pedestrian Dead Reckoning) integrated positioning and navigation system where we are using Extended Kalman filter (EKF). The proposed algorithm first relies on MEMS in our mobile phone to estimate the velocity and heading angles of the target. Second, the velocity and heading angles, together with the results of WiFi fingerprinting-based positioning, are considered as the input of the EKF for the sake of conducting two-dimensional (2D) positioning. Third, the proposed algorithm calculates the altitude of the target by using the real-time recorded barometer and geographic data. Tests were conducted on two floors of the building to achieve three-dimensional (3D) positioning in multi-floor environment using proposed integrated WiFi/PDR positioning algorithm. The results of our experiments show that integrated navigation system using Extended Kalman filter can effectively eliminate the accumulated errors in the PDR positioning algorithm and can reduce the influence of the large-scale jump of the WiFi fingerprint positioning result brought by the RSSI disturbance on the positioning accuracy of the system. In a real multi-floor environment, the proposed algorithm of WiFi/PDR integrated system has a mean error of positioning accuracy is 1.6m, which is much less than the 10m of the WiFi alone positioning result, and the 2m of the PDR alone positioning result.


Introduction
In 1996, the United States Federal Communications Commission (FCC) mandated that all mobile operators must adopt some method to provide their current location information to users who calls 911, promoting the emergence of location services.The main method of location-based service is to determine the user's geographical location information through the network and provide the location related information service for the user.In recent years, with the development of science and technology, the widespread use of various intelligent terminals, location-based services devices for establishing so-called geofencing i.e. alarm systems which can detect whether a person or an asset has left a certain area unauthorized.Also, indoor positioning technology can be useful for medical care, because in hospitals the location tracking of medical personnel in emergency situations has become increasingly important.Medical applications in hospital also include patient and equipment tracking, e.g.fall detection of patients.Precise positioning is required for robotic assistance during surgeries.Existing analytical devices can be replaced with more efficient surgical equipment.Parents can use the indoor positioning technology to take care of children in real time to avoid losing them in very crowded places.When people are in large shopping malls, they can quickly find outlets and elevators using indoor navigation positioning or get ads about different promotions.
Wireless positioning technology is the core technology of LBS.Commonly used wireless location technologies mainly include Received Signal Strength Indicator (RSSI), Angle of Arrival (AOA), Time of Arrival (TOA).Currently widely used global navigation satellite systems (GNSS), such as Beidou in China, Glonass in Russia, GPS in the United States, Galileo in Europe, mostly use TOA technology.However, in general wireless communication systems, the time synchronization accuracy is limited, AOA techniques are mostly used.Existing short-range wireless communication technologies, such as WiFi, mostly adopt RSS-based positioning technology based on received signal strength [1].
Outdoors, global satellite navigation systems and wireless communication-based positioning systems can basically meet people's requirements for positioning accuracy.However, indoors, due to the occlusion of satellite signals and the presence of serious multipath effects, the positioning accuracy of satellite positioning and wireless communication-based positioning systems drastically decreases, which cannot meet people's requirements.For complex indoor environments, various indoor positioning methods have been proposed, such as Bluetooth [2], Ultra-Wideband (UWB) [3], and Radio Frequency Identification (RFID) [4].WiFi positioning [5]- [11] and inertial sensor positioning [11]- [14] and other indoor positioning technologies.Bluetooth and UWB technology is not very wide used, because of the system cost, complexity and stability.However, WLANs based on the 802.11a/b/g/n protocol are widely deployed in residence, campuses, shopping malls and office buildings.Meanwhile, mobile and intelligent terminals based on android and ios are very widely used, that was promoted the development of WiFi.This enables WiFi-based indoor positioning technology to make full use of existing mobile devices and network environment, effectively reducing the cost of positioning and extending the application range of positioning systems [15].
With Inertial navigation has the advantages of short time positioning accuracy, and is not affected by the external environment, etc., which can make up for the lack of WiFi's individual positioning.However, inertial sensors, especially high-precision inertial sensors, have disadvantages such as large size and high cost.With the rapid development of Micro Electro Mechanical Systems (MEMS) technology, various types of inertial sensors, such as gyroscopes, accelerometers, and magnetometers, have become smaller in size and lower in cost, and have been widely used in various applications.Since MEMS-based positioning technology mainly uses the inertial information of a moving object for positioning, this technology can be well applied in indoor and other complex external environments and is a relative positioning technology with high positioning accuracy in a short time [11].Positioning technologies based on MEMS inertial sensors are mainly divided into two types, namely SINS and Pedestrian Dead Reckoning (PDR) based positioning technology.Positioning technology based on strapdown inertial navigation mainly uses three-dimensional data integration of measured accelerometer and gyroscope to calculate three-dimensional posture, speed and position.However, due to the data drift of the gyroscope and accelerometer, the cumulative error is caused by the positioning result calculated by the integral.PDR positioning technology is a relative positioning technology.It is mainly based on the position of the pedestrian at the previous moment, the heading of the walking, the step length and the number of steps, and the indoor positioning accuracy is more accurate than the strapdown inertial navigation.
The use of RSS-based WiFi absolute positioning in the indoor environment for long time total system positioning accuracy is high, but there are problems such as unstable signals and being susceptible to external interference; while the relative positioning using PDR has a short time positioning accuracy, but there is the inherent shortcomings of variable step sizes and easy accumulation of errors.Therefore, finding a method that can combine MEMS-based and WiFi-based indoor positioning technologies to integrate the advantages of both of them and make up for each other's shortcomings to obtain better indoor positioning accuracy and for the development of indoor positioning technology.It is a great significance to accelerate the large-scale application of indoor positioning technology.
With the development and progress of data fusion, various data fusion filters represented by kalman filters have appeared one after another, such as Extended Kalman Filter (EKF) and Unscented Kalman Filter (UKF), Particle Filter (PF), etc., which makes it possible to combine positioning of WiFi and PDR.Therefore, using the location information provided by WiFi, the PDR provided velocity and heading angle information, a data fusion filtering algorithm is designed.The PDR is corrected in real-time using the position information of the WiFi output to eliminate the cumulative error of the inertial sensor, and the PDR is used to shorten the distance.The advantage of high time positioning accuracy, correcting the RSSI jitter problem in WiFi positioning, combining WiFi and PDR navigation positioning, and outputting high-precision positioning results are entirely feasible [16].

Related works
With the rapid development of inertial navigation technology in recent years and the increase in people's demand for indoor location services, and the inherent disadvantages of poorly adaptable to different physical environments and large initial workloads, WiFi/PDR integrated navigation methods and related applications has become a research hotspot at home and abroad.
Wendong Xiao et al. of the Institute of Network Information in Singapore proposed a WiFi and inertial device fusion indoor navigation positioning system [33].The system uses a kalman filter to take the position and velocity components of the x and y axes of the navigational coordinate system in the inertial device (accelerometer) as state variables, and the positional information of the x and y axes measured by WiFi fingerprint matching is used as an observation variable to establish the state.The equations and the observation equations are simultaneously used to find the heading angle using the complementary features of the gyroscope and the magnetometer in the frequency domain.The system eliminates the IMU cumulative error to a certain extent, but there are problems such as RSSI disturbance and magnetic interference.Malyavej V et al. of Mahanke University of Technology in Thailand proposed a RSSI that uses detectable APs as observations and uses signal propagation models to calculate positional information [34].This method can eliminate the accumulated error of IMU, and it is also very robust to the jitter of processing measured RSSI, and achieves a positioning accuracy of minimum mean square error of 1 m.However, due to the complex indoor environment, there are serious multipath effects, refractions, and reflections in the wireless signal.It is difficult to establish an accurate signal propagation model.The system believes that the acceleration will remain unchanged in a short period of time.The pedestrian will be calculated using the uniform acceleration linear equation.The speed and position, but pedestrians change linear acceleration, not suitable for indoor pedestrian navigation.Yang Fan and others from Shanghai Jiaotong University focused on WiFi positioning to propose an RSSI position fingerprinting and DR combined positioning system based on dynamic clustering [35].This system is mainly based on WiFi and uses RSS position information output from MEMS to dynamically aggregate RSSI.The class then outputs the WiFi positioning result by matching the query.Zeng Pengfei and others from Jiangnan University proposed the DR/RSSI combined indoor positioning system based on inertial sensors [36].The system uses positioning target and AP distance closer to each other to locate accurately, using RSSI online update step length and corrected dead reckoning to generate Cumulative error, but when the pedestrian is far away from the AP, the positioning accuracy will be seriously reduced.Deng [38], but these are only applicable to Single-floor positioning does not involve multi-floors, and the application scope is limited, and RSSI disturbance solution in WiFi location fingerprinting is not proposed.This paper proposes an indoor Wi-Fi/PDR integrated algorithm for 3D localization in a multi-floor environment aiming at the shortcomings of the existing positioning technology.It solves the RSSI disturbance problem to a certain extent and realizes high-precision positioning across indoor floors.

System description
As shown in Figure 1, the WiFi/PDR fusion multi-floor 3D positioning algorithm mainly includes four parts: the WiFi fingerprinting positioning, the PDR part, where speed and heading where determined, the EKF (Extended Kalman Filter) part, and the height calculation part.Firstly, we obtained WiFi fingerprinting based positioning, then the speed and heading information of the pedestrian were calculated through the measurement information obtained by the MEMS sensors, and then the combined data was used as the input of the EKF.In the fourth step, the height information measured by the barometer.Finally, we got the 3D positioning result of the pedestrian.The k-nearest neighbors (KNN) algorithm is used here.An object is classified by a majority vote of its neighbors, in which the object is assigned to the class that is most common among its k-nearest neighbors.The targeted area is divided into a regular grid and the angular points are set to be the RPs.The fingerprint information includes the RSSI measurement and the coordinates of the RPs.The signal information for the ith RP can be expressed as [40]: (1) where A is the AP information, O is the RSSI measurement, and Pt denotes the coordinates of the RP.The average value of the signal strength from every AP is computed in the RP.This information is used to construct the fingerprint database.The fingerprint for the ith RP can be express (2) If the real-time WiFi signal strength received by the target user's mobile device is S, the distance between the real-time WiFi signal information and the fingerprint database is calculated by the following matching algorithm: where C is the set constructed by the K smallest values of d i and L i denotes the coordinates of RP [41].

PDR
PDR (Pedestrian Dead Reckoning) positioning algorithm is a relative positioning algorithm.The basic principle of the PDR positioning algorithm is to use inertial sensors and magnetometers to measure the acceleration, angular velocity, and other information of pedestrian movement, so as to calculate the direction and distance of the pedestrian movement, and together with the known pedestrian position information from the previous moment, to calculate the current moment pedestrian's location information.Therefore, when the pedestrian's initial position is known, the pedestrian's position information can be calculated continuously in real time.The basic principle is shown in the Figure 3: If the position of the pedestrian at the initial time t1 is known (x 0 ,y 0 ), the initial heading angle θ 0 is the distance measured by the inertial sensor d 0 , and the position of the pedestrian at the moment (x 1 ,y 1 ) can be calculated: (5) In the same way, the position of the pedestrian (x 1 ,y 1 ) at the moment t 1 can be calculated by using the heading angle and the position (x 2 ,y 2 ) of the moment t 2 as: (6) According to this calculation, we can calculate the position (x k ,y k ) at the moment t k by (7) In the formula, d i it is the time t i-1 to t i forward displacement, which is the heading θ i of the pedestrian position at the time of i.

Offline phase
Weighted K nearest neighbor Newly recorded RSSI

Online phase
Estimated location

Extended kalman filter
When WiFi signals are available, the Kalman filter estimation is employed to update the state parameters through a time update and an observation update in the WiFi/PDR integrated system.The time update process is expressed as [42]: In addition, the Kalman filter observation update equation is written as: (9) where is a priori state estimation, is a posteriori state estimation, G k is the gain matrix the Kalman filter, is a priori covariance matrix of the state vector, P k is a posteriori covariance matrix of the state vector, R k is the covariance matrix of the observation noise vector, and Q k-1 is the covariance matrix of the process noise.The subscript k denotes the time, and the subscript k, k − 1 represents the state or covariant estimates forward from k − 1 to k.

Altitude calculation
Under normal circumstances, pedestrians are divided into three types: walking on flat roads, climbing stairs and descending the stairs.In these three cases, the method of solving two-dimensional positions is the same.Only a small difference in the size of the specified step, i.e., the step length should be set to the width of the stair step.
This article uses only the altitude value measured by the barometer to judge the upper and lower levels and the actual height information is calculated by estimating the height from the floor.
Pedestrians can be divided into two types of situations: walk on the floor, climb the stairs or go down the stairs.In Figure 4, the static atmosphere equation in the vertical force condition is described by: (a) (b) where P is the atmospheric pressure.g is the acceleration of gravity.ρ is the gas density.H is the geopotential height.S is is the cross-sectional area in the vertical direction.As discussed in [43], the ideal gas equation is defined as: (11) where T is the absolute temperature, is the universal gas constant.Combine the above two formulas, we can get (12) There are two sides after the integration (13) where P 0 is the initial atmospheric pressure.For simplicity, we assume that the gravity acceleration, g, is a constant.Then, the temperature is calculated by: (14) where β is the variation rate of the vertical temperature.h0 and T0 are the initial geopotential height and the absolute temperature.The values of the three groups of parameters h0, The two formulas in front of each other can calculate the height (15) In the formula P s , the atmospheric pressure obtained by the barometer is measured in real time, and h is the altitude value calculated by the above formula.Here it is assumed that the height H of the gravitational potential is equal to the altitude h.

Multi-floor positioning
In staircase scenario, the accuracy of the WiFi-based height calculation deteriorates seriously.Furthermore, there is no significant impact on accuracy by adding the height into the state vector in the condition that the target is on a floor.On this basis, the height is calculated separately in our system.
The motion behaviours of the people inside a building can be simply classified into two categories, walking up or down stairs in staircases and walking on a floor.In our experiments, the step lengths of the people with respect to the motion behaviours in a staircase and on a floor are set to be 0.4 m and 0.68 m.
When the target is located in a staircase, we first use Equation ( 13) to estimate the altitude of the target, h 1 .Second, we calculate the height of the target based on the distance between h 1 and the altitude of the entrance of staircase h 2 , ∆h = h 1 -h 2 .
By setting a threshold λ, if |∆h| ≤ λ, we set the height of the target in the current step as equal to the height of the target in the previous step.If |∆h| > λ and ∆h > 0, we set the height of the target in the current step as the previous height, adding a stair height hstair.Otherwise, we set the height of the target in the current step as the previous height, subtracting hstair.
When the target is located on a floor, we set the height of the target equal to the current floor height.
Furthermore, the steps of the judgment of whether the n-th location of the target is in a staircase or on a floor are as follows: (i) Calculate the distance between the n − 1-th locations of the target (x`n -1 , y`n -1 , z`n -1 ), and the location of the entrance of the i-th staircase (x i , y i , z i ), d i,n-1 .(ii) Compare the values of d i,n-1 and r, where r is a given threshold.(iii) When d i,n-1 ≥ r and the n-th locations of the target are in the same staircase or on the same floor.
(iv) When d i,n-1 < r, if the n − 1-th location of the target is in a staircase, the n location of the target is on a floor.To the contrary, if the n − 1-th location of the target is on a floor, the n-th location of the target is in a staircase [45].

Experimental Results
Tests were conducted on the first and second floors in a building at the university.The floors plan is shown in Figure 5, the first floor dimensions are 64.6×18.In our experiments, a smartphone Samsung Galaxy S3, which is integrated with a WiFi module, accelerometer, gyroscope, magnetometer and barometer, is selected as the receiver, shown in Figure 7.We used two apps, WifiSensors and WifiLocation, to conduct MEMS sensors and WiFi RSSI recording.The recorded data are saved in the security digital (SD) card with the frequency of recording equal to 50 Hz.From the results in the Figure 8 of positioning in the 3D plan, it can be seen that the WiFi/PDR fusion location result using the Extended Kalman filter algorithm is better than the PDR location algorithm and WiFi fingerprint algorithm, and the difference between the individual PDR location result, WiFi fingerprint localisation by it self and the real trajectory farther away.The results in the Figure 8 prove that the proposed approach effectively reduces the accumulated errors involved in PDR and, thereby, significantly improves the accuracy of 3D positioning in a multi-floor environment compare with Wifi and PDR systems separately.
We used Matlab find the CDF (Cumulative Distribution Function) of localization error for all three algorithms, that used in this work.The CDF of errors of positioning in the 3D plan test results are shown in Figure 9.The cumulative distribution functions (CDFs) of the errors for height estimation by adopting the proposed height calculation approach and the conventional barometer-based height calculation approach [25] and Kmeans-based height calculation approach [22] in WiFi/PDR, PDR and WiFi, are compared in Figure 9. From Figure 8 and Figure 9, we can observe that the results of the barometer-based height calculation approach are not stable, and the performance of the K-means-based height calculation approach deteriorates seriously when the target is inside a staircase.As can be seen from the above figure, in the 3D plan positioning tests, the confidence probability of the WiFi/PDR fusion positioning error is less than 90% within 2.4m, which is much lower than the WiFi fingerprint positioning 17.5m and the positioning error of the PDR alone is 3.8m.Also, as shown in Table 2, the mean positioning error of the combined positioning of the 3D walking plan for WiFi/PDR is 1.6m, which is much less than the 10m of the WiFi alone positioning result, and the 2m of the PDR alone positioning result  In general, there are three main reasons that the proposed algorithm can achieve an accuracy of 1.6 m.First of all, since the test bed is selected in long and straight corridors, we can easily detect most of the large errors by WiFi positioning when the initial locations of the target are obtained.Second, we only use the results of WiFi positioning with errors smaller than 7 m to integrate with MEMS sensor-based positioning for the sake of avoiding the influence of large errors from WiFi positioning.We observe that about 33% of the errors from WiFi positioning in our system is smaller than 7 m.Third, the EKF is an adaptive filtering approach, which is able to adaptively adjust the weights of the measurement vector.

Conclusions
This paper presented an improved WiFi/PDR integrated system using an Extended Kalman filter to obtain more accurate position information for indoor localization, specifically, for a multi-floor environment.The EKF was implemented to improve the position accuracy of WiFi/PDR integrated systems.Real measurements were used to demonstrate the performance of the proposed approach.
In field tests, a comparison of the error of the extended Kalman filter, WIFI positioning technology and PDR positioning technology based on scenario and motion state recognition was shown to provide a better performance for WiFi/PDR integrated systems than the WIFI and PDR systems by itself.The Kalman filter is very effective at identifying large position information error caused by WiFi positioning technology, that also proves, that the WiFi/PDR extended Kalman fusion location algorithm can effectively eliminate the accumulated errors in the PDR positioning.
the introduction of location-fingerprint-based positioning technology for WiFi in 2000 by BAHL P et al., WiFi indoor positioning technology has gradually become a research hotspot in the academic community, and many WiFi indoor location technologies have been proposed in succession.The WiFi fingerprint indoor positioning technology based on position fingerprinting has a wide coverage, and the overall positioning accuracy of the system is high, and it is suitable for a long-time positioning.However, its positioning accuracy is easily affected by the density of access points (APs) and external signals.The impact of other external factors such as interference, shortterm positioning accuracy is low.The position fingerprintingbased WiFi indoor positioning technique is based on the assumption that the RSSI value received at each location is a stable value, but the signal received at each location is affected by factors such as signal reflection, refraction, and multi-path interference.There is jitter in the intensity RSSI.After testing, it has been found that the maximum jitter can reach 10 dBm or more.At the same time, when it reaches the blind coverage area of the AP, the location-fingerprint-based WiFi positioning technology may fail, and other indoor positioning technologies are needed to supplement it.

( 3 )
Using the k-nearest neighbors algorithm, the K smallest values of d i are used to compute the coordinates of the target point:

Figure 4 .
Figure 4. Force balance in the air in the stationary condition: (a) Horizontal force conditions, (b) Vertical force condition

Figure 7 .
Figure 7. WiFi AP and a mobile phone for the test

Figure 8 .
Figure 8. Real path of the target and results of positioning in the 3D plan

Figure 9 .
Figure 9. CDF of localization error of positioning in the 3D plan Zhongliang et al. of Beijing University of Posts and Telecommunications proposed the study of WiFi-PDR fusion indoor positioning based on Federal Kalman [37], while Liu Xingchuan et al. proposed the WLAN/MARG combined positioning system based on data fusion

Table 1 .
[44]β and P0 that are used in this paper are shown in Table 1[44].Altitude calculation parameters

Table 2 .
Comparison of Algorithm Performance of positioning in the 3D plan