<<

Article S-PDR: SBAUPT-Based Pedestrian Dead Reckoning Algorithm for Free-Moving Handheld Devices

Maan Khedr 1,2,* and Naser El-Sheimy 1

1 Department of Geomatics Engineering, University of Calgary, 2500 University Dr NW, Calgary, AB T2N1N4, Canada; [email protected] 2 Department of Computer Engineering, Arab Academy for Science and Technology, Alexandria P.O. Box 1029, Egypt * Correspondence: [email protected]; Tel.: +1-403-805-2171

Abstract: Mobile location-based services (MLBS) are attracting attention for their potential public and personal use for a variety of applications such as location-based advertisement, smart shopping, smart cities, health applications, emergency response, and even gaming. Many of these applications rely on Inertial Systems (INS) due to the degraded GNSS services indoors. INS-based MLBS using is hindered by the quality of the MEMS sensors provided in smartphones which suffer from high noise and errors resulting in high drift in the navigation solution rapidly. Pedestrian dead reckoning (PDR) is an INS-based navigation technique that exploits human motion to reduce navigation solution errors, but the errors cannot be eliminated without aid from other techniques. The purpose of this study is to enhance and extend the short-term reliability of PDR systems for smartphones as a standalone system through an enhanced step detection algorithm, a periodic attitude correction technique, and a novel PCA-based motion direction estimation technique.

 Testing shows that the developed system (S-PDR) provides a reliable short-term navigation solution  with a final positioning error that is up to 6 m after 3 min runtime. These results were compared to a

Citation: Khedr, M.; El-Sheimy, N. PDR solution using an Xsens IMU which is known to be a high grade MEMS IMU and was found S-PDR: SBAUPT-Based Pedestrian to be worse than S-PDR. The findings show that S-PDR can be used to aid GNSS in challenging Dead Reckoning Algorithm for environments and can be a viable option for short-term indoor navigation until aiding is provided by Free-Moving Handheld Devices. alternative means. Furthermore, the extended reliable solution of S-PDR can help reduce the opera- Geomatics 2021, 1, 148–176. https:// tional complexity of aiding navigation systems such as RF-based indoor navigation and magnetic doi.org/10.3390/geomatics1020010 map matching as it reduces the frequency by which these aiding techniques are required and applied.

Academic Editor: Sisi Zlatanova Keywords: indoor localization and positioning; pedestrian dead reckoning; MEMS IMU; sensors; step detection; attitude correction; heading estimation Received: 13 January 2021 Accepted: 11 March 2021 Published: 25 March 2021 1. Introduction Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in Navigation is a service that we rely on during our daily activities and is defined as the published maps and institutional affil- task of successfully providing directions from a starting point to a destination. The goal of iations. any navigation system is finding the time-varying navigation states: position, velocity, and attitude of a moving platform with high precision [1]. Existing navigation technologies and techniques can be categorized into absolute measurements (also known as reference-based) systems, relative measurements (also known as Dead Reckoning) systems, or a combination of both [2]. Global navigation satellite system (GNSS) is one of the main technologies used Copyright: © 2021 by the authors. Licensee MDPI, Basel, Switzerland. for navigation with the global positioning system (GPS) being the prevalent system. GNSS This article is an open access article is a reference-based system that uses a set of satellites for the purpose of positioning and distributed under the terms and attitude estimation. Although GNSS is always expanding and improving with the presence conditions of the Creative Commons of many constellations such as GPS, BEIDOU, GALILEO, and QZSS, and the increasing Attribution (CC BY) license (https:// number of satellites per constellation providing wide coverage, GNSS navigation is not creativecommons.org/licenses/by/ always accurate and stable, and in many cases it can fail to provide a positional solution [3]. 4.0/). This results from degraded GNSS services in certain environments such as urban canyons

Geomatics 2021, 1, 148–176. https://doi.org/10.3390/geomatics1020010 https://www.mdpi.com/journal/geomatics Geomatics 2021, 1 149

and indoors. To compensate for the shortcomings of GNSS, relative navigation techniques are used as an alternative or aiding in the case of a combined system. Relative navigation techniques cannot measure the position and attitude directly and rely on other techniques to evaluate the navigation states. Inertial navigation is one of the prominent relative navigation techniques that can aid GNSS systems to achieve a continu- ous navigation solution. An inertial navigation system (INS) is a self-contained navigation system that relies on inertial measurements provided by an inertial measurements unit (IMU) to compute position, velocity, and attitude information [2,4]. The bases of inertial navigation are based on Newton’s 1st and 2nd laws of motion and uses a technique known as dead reckoning (DR) [2]. The inertial measurements are provided from an IMU that consists of a combination of 3-axis and 3-axis gyroscopes to measure the acceleration and angular rate vectors. In some cases, extra sensors are available and used in conjunction with an IMU to provide more information for navigational purposes such as a three-axis to provide magnetic field measurements and a barometer for pres- sure measurements. The sensor measurements provided by the IMU are processed using DR to track the changing navigation states of the platform, where the position is updated by knowing the distance traveled and the direction of motion [5]. An initialization process for obtaining the initial position is required along with an alignment process for finding the initial attitude difference between the navigation platform and the navigation frame—local level frame (LLF)—[6]. The miniaturization and power efficiency of IMU sensors made possible by micro-electro-mechanical systems (MEMS) technology advancements [7–12] led to their inclusion in many of the consumer-based devices such as smartphones and wearable devices. The availability of sensor-enabled smart devices led to an increasing interest in MLBS applications such as military applications, gaming, personal navigation and localization [13], and emergency service providers tracking [14] especially when GNSS services are degraded. Indoor MLBS applications fall under three main sectors: govern- ment, business, and individual [15], and can fall in multiple sectors at a time. These sectors are considered to be the commercial drivers of MLBS market, and they dictate the level of required services [16]. On the other hand, MEMS IMU tend to suffer from high measurement errors which makes them less reliable. IMUs are categorized based on their performance and underlying fabrication technologies. Although there is no definitive metric or a well-defined and agreed upon grouping performance thresholds [17,18], in general, there are four grades—in some cases five—of IMUs that are based on grouping of likewise performance and main applications. A comparison of the different types and grades of IMUs is presented in [2]. The comparison shows the relatively high errors of the MEMS IMUs—also referred to as commercial grade—in comparison to the higher more expensive counterparts, where the performance charts show that MEMS technology suffers from the highest error budget in comparison to other technologies. Since DR is a relative navigation technique, and since MEMS IMU suffer from high errors, the navigation solution drifts quickly from the true values of position and attitude. Hence, DR requires correction techniques or even aiding from other technologies to provide corrections for the navigation states. Methods for correction have been developed and used to enhance the performance of DR. Some of these correction techniques include: zero velocity update (ZUPT) [19], zero angular rate update (ZARU) [20], magnetic angular rate update (MARU) [21], and heuristic drift reduction (HDR) [22]. These techniques exploit certain motion constraints to provide corrections, but in the case of smartphone- based navigation, many of these conditions do not occur frequently. Pedestrian dead reckoning (PDR) is a modified form of DR that was developed especially for pedestrian navigation and uses human motion information—namely the gait cycle (GC)—to improve the performance over regular DR methods. PDR consists of four main parts: attitude estimation, step detection, heading estimation, and step length estimation. This research presents a modified PDR system for smartphone navigation that exploits tendencies in human motion to further reduce the error accumulation in the navigation Geomatics 2021, 1, FOR PEER REVIEW 3

performance over regular DR methods. PDR consists of four main parts: attitude estima- tion, step detection, heading estimation, and step length estimation. Geomatics 2021, 1 This research presents a modified PDR system for smartphone navigation that ex-150 ploits tendencies in human motion to further reduce the error accumulation in the navi- gation states. The developed system can: accurately detect steps under varying motion speeds and smartphone use cases, provide frequent attitude corrections without imposing states. The developed system can: accurately detect steps under varying motion speeds motion restrictions on the user, and estimate motion direction with high accuracy. The and smartphone use cases, provide frequent attitude corrections without imposing motion contributions of this system are: (1) accurately detect steps using sensor fusion while being restrictions on the user, and estimate motion direction with high accuracy. The contributions able to verify steps taken and compensate for missed steps, (2) provide attitude corrections of this system are: (1) accurately detect steps using sensor fusion while being able to verify as frequent as a step-by-step basis without imposing motion constraints on the user and steps taken and compensate for missed steps, (2) provide attitude corrections as frequent as without relying on previous attitude states to eliminate drift, (3) estimate the direction of a step-by-step basis without imposing motion constraints on the user and without relying motion of the user with high accuracy by analyzing the accelerations within a step and on previous attitude states to eliminate drift, (3) estimate the direction of motion of the user eliminating outliers to obtain a reduced data set that accurately captures the direction of with high accuracy by analyzing the accelerations within a step and eliminating outliers to motion of the user. obtain a reduced data set that accurately captures the direction of motion of the user. This article is organized as follows: After covering some of the state-of-the-artstate-of-the-art PDR systems and and the the innovations innovations in in the the PDR PDR modu modulesles in inSection Section 2, 2the, the developed developed method method for PDRfor PDR and andthe underlying the underlying enhancements enhancements in each in eachof the of main the mainPDR subs PDRystems subsystems is presented is pre- insented Section in 3. Section In Section3. In 4, Section a description4, a description of the testing of the and testing experimental and experimental setup is provided, setup followedis provided, by performance followed by performanceanalysis, evaluation, analysis, and evaluation, discussion and in discussionSection 5. Finally, in Section con-5. clusionsFinally, conclusions are presented are in presented Section 6. in Section6.

2. Related Work The main ideaidea ofof PDR PDR is is to to detect detect the the steps steps the the user user takes takes while while having having a good a good estimate esti- mateof the of length the length and direction and direction of the of step the taken step bytaken the by pedestrian the pedestrian [23]. Using [23]. Using this approach, this ap- proach,the the accelerometer data are nodata longer are no integrated longer integrated throughout throughout the navigation the process.navigation Instead, pro- cess.the data Instead, are being the data used are for being detecting used steps for detec takenting by the steps user, taken that by are the then user, used that for are position then usedestimation for position based estimation on the step based length on of the the step pedestrian length of and thehis pedestrian orientation. and Figurehis orientation.1 shows Figurean illustrative 1 shows example an illustrative of a 2D example PDR where of a the 2D position PDR where is only the described position is as only east anddescribed north ascomponents east and north in the components LLF. in the LLF.

Figure 1. Pedestrian Dead Reckoning (PDR).

PDR systems can be categorized into two categories: strapdown systems systems and and free- moving (handheld devices) systems. For stra strapdownpdown PDR systems, we utilize the human GC [24–26]. [24–26]. GC describes the step cyclic motion and is split into two main parts: the stance phase which which is is the the period period when when the the pedestrian pedestrian foot foot is in is incontact contact with with the theground, ground, and and the Swingthe Swing phase phase which which is when is when the foot the footis swinging is swinging in between in between two consecutive two consecutive stances. stances. Hu- manHuman gait gait analysis analysis studies studies the human the human motion motion patterns patterns through through the kinematic, the kinematic, kinetic, kinetic, spa- tial,spatial, and andtemporal temporal parameters parameters [25]. The [25]. repetiti The repetitivenessveness of the GC of themakes GC it makesideal for it breaking ideal for downbreaking the down pedestrian the pedestrian navigation navigation problem, problem, as most asbody most segments body segments have expected have expected cyclic cyclic and repetitive accelerations and angular rate signals under nominal motion. A GC example with all phases is presented in Figure2.

Geomatics 2021, 1, FOR PEER REVIEW 4

Geomatics 2021, 1, FOR PEER REVIEW 4

Geomatics 2021, 1 and repetitive accelerations and angular rate signals under nominal motion. A GC exam-151 pleand with repetitive all phases accelerations is presented and in angularFigure 2. rate signals under nominal motion. A GC exam- ple with all phases is presented in Figure 2.

Figure 2. Human gait cycle (GC) [27]. FigureFigure 2. 2.Human Human gaitgait cycle cycle (GC) (GC) [ 27[27].]. This approach decreases the accumulated error in position over time as it breaks down ThistheThis pedestrian approach approach decreases navigation decreases the problemthe accumulated accumulated into smaller error erro in independentr position in position over modules timeover astime itthat breaks as accumu- it downbreaks latethedown less pedestrian theerror pedestrian over navigation time. navigation Alternatively, problem problem into smallerit imposes into smaller independent new independent challenges modules such modules that as accumulate optimal that accumu- step less detection,errorlate less over steperror time. length over Alternatively, time.estimation, Alternatively, it and imposes user it neworientation imposes challenges new tracking. challenges such A as general optimal such blockas step optimal detection,diagram step ofstepdetection, PDR length systems step estimation, islength shown andestimation, in userFigure orientation and3, where user tracking.orientationthe PDR Amechanization generaltracking. block A general block diagram combines block of PDR diagram the sys- informationtemsof PDR is shown systems of the in Figureis detected shown3, where in step—heading Figure the PDR3, where mechanization an dthe length—and PDR mechanization block uses combines them block to the compute informationcombines the the of the detected step—heading and length—and uses them to compute the current position currentinformation position of derived the detected from thestep—heading previous posi antion.d length—and This also imposes uses them the requirement to compute ofthe derived from the previous position. This also imposes the requirement of knowing the knowingcurrent theposition initial derived position from and the attitude previous as a posistartingtion. pointThis alsofor theimposes navigation the requirement solution. of initialknowing position the initial and attitude position as and a starting attitude point as a forstarting the navigation point for the solution. navigation solution.

Figure 3. PDR block diagram. Figure 3. PDR block diagram. FigureEnhancements 3. PDR block diagram. applied to any of the PDR subsystems will enhance the full system performance,Enhancements hence applied the following to any subsections of the PDR cover subsystems the recent will advances enhance in the each full of thesystem PDR performance,subsystems.Enhancements Sincehence the the applied aim following of thisto any articlesubsections of the is to PDR develop cover subsystems the a PDR recent for will smartphones,advances enhance in the each novelties full of system the in PDRtheperformance, subsystemsubsystems. thathence Since can the the benefit following aim of free-moving this subsections article PDRis to coverdevelop systems the area recentPDR presented. for advances smartphones, in each novel- of the tiesPDR in thesubsystems. subsystem Since that thecan aim benefit of this free-moving article is to PDR develop systems a PDR are for presented. smartphones, novel- 2.1.tiesStep in the Detection subsystem that can benefit free-moving PDR systems are presented. 2.1. StepPDR Detection navigation systems require a robust step detection algorithm. The effect of a step2.1.PDR Step miss navigationDetection or a fake stepsystems count require can vary a robust on the step performance detection algorithm. of PDR depending The effect on of the a stepmethodology missPDR or navigation a offake how step the systems count step count canrequire vary is being a on robust the used. performance step For detection elaboration, of algorithm.PDR consider depending The an algorithmeffect on the of a methodologythatstep utilizes miss or aof a fixed howfake step thestep step length count count forcan is a vary user.being on If us the theed. step Forperformance detectionelaboration, algorithmof considerPDR depending fails an algorithm to capture on the thatamethodology step utilizes or is a fooled fixed of how step into the length counting step for count a step,user. is being If this the willus steped. lead detectionFor toelaboration, an erroralgorithm of consider a stepfails lengthto an capture algorithm in the a stepnavigationthat or utilizes is fooled solution. a fixed into countingstep Now length consider a step, for aa this longuser. will periodIf the lead step of to navigation andetection error of wherealgorithm a step thelength algorithmfails in to the capture nav- skips a igationmultiplestep or solution. is steps, fooled this Now into will countingconsider lead to aa highstep,long magnitudethisperiod will of lead navigation of to positional an error where error.of a stepthe algorithmlength in the skips nav- multipleigationStep steps,solution. detection this Nowwill algorithms lead consider to relya high a onlong magnitude pattern period detection ofof navigationpositional in the sensor error. where measurements. the algorithm These skips patternsmultipleStep aredetection steps, prominent this algorithms will and lead distinguishable to rely a high on magnitudepattern for strapdowndetection of positional in systems the error. sensor that aremeasurements. tethered to a Thesebody-segment patternsStep detection are where prominent algorithms the navigation and distinguishablrely deviceon pattern is ine for alignmentdetection strapdown in with thesystems the sensor motion, that measurements. are such tethered as the foot.These Such patterns an approach are prominent relishes and the distinguishabl benefits of closelye for strapdown capturing the systems characteristics that are tethered of GC such as the static state of the foot during the stance phase, making it easier to detect a step. The use of a smartphone for step detection is more complex than strapdown systems due to the high dynamicity of the smartphone. In the case of smartphones for navigation,

Geomatics 2021, 1 152

there is no detectable zero velocity region for the stance phase of the GC as the human upper body half is in continuous motion unlike the foot. Furthermore, the device might exhibit none-walking related motion from the arm movement causing orientation changes and accelerations that do not represent the walking behavior. Finally, the use case of the phone and its placement will alter the patterns in the acceleration signals, hence it is hard to use a generalized method for step detection that works seamlessly across all possible phone placements and walking behavior. Step detection for smartphone navigation applications is usually based on peak and valley pair detection. It usually incorporates the use of thresholds to filter out false peaks or employs motion mode and/or smartphone use case classifiers to adaptively tune the parameters for step detection. The thresholds for step detection can be computed and adaptively tuned in many ways. When the accelerations are compensated for gravity, zero-crossing can be a very efficient way to detect steps [28]. Alternatively, peak/valley pairs from accelerations are used based on thresholds that can be obtained through the training/learning process [29] but might suffer from being user-dependent. A more ef- ficient step detection combines a multi-level threshold system that adaptively tunes the peak/valley thresholds in real-time without the need for a training process, and incorpo- rates temporal thresholds [30], pseudo-zero crossing, and peak validation to eliminate fake peaks and valleys [31]. Smartphone use case classifiers—such as holding, swinging, calling, pocket placement, and backpack placement—and motion mode classifiers—such as walking, running, or taking the stairs—are used to either adaptively select the appropriate set of thresholds or extraction of repetitive features for step detection. These classifiers can be implemented in many ways such as but not limited to: artificial neural networks (ANN) [32,33], deci- sion trees (DT) [34], fuzzy logic [35], support vector machines (SVM) [36], SVM and DT fusion [37], multilayer perceptron (MLP) [38], and bidirectional long short-term memory recurrent neural networks (BLSTM-RNN) [39]. Alternative sensors from smartphones have been also utilized for step detection, such as camera sensors which is referred to as [40–43], but they can only work under the constraint of using the device in compassing mode for the camera to capture the foot motion of the user.

2.2. Alignment and Walking Direction Estimation Although gyroscopes are known for their short-term accuracy and reliability in com- parison to accelerometers, the continuous integration of the angular rates over time will cause drift in the estimated attitudes. Errors in attitude angles affect the transformation of accelerations and magnetic measurements to LLF. On one hand, failure to do proper align- ment between the navigation device—sensor/body frame (BF)—and LLF results in wrong gravity compensation, causing wrong step length estimation. On the other hand, the wrong leveling of magnetic measurements affects the quality of azimuth estimation and correction leading to the wrong direction of motion estimation. These factors combined result in fast and high drift in position estimation and divergence from the true navigation solution. For attitude and heading estimation in PDR, the attitude and heading reference system (AHRS) algorithm is employed to enhance the PDR performance. The main concept of an AHRS is to fuse the data from magnetic, angular rate, and gravity (MARG) sensors, where each sensor is used to compensate for the biases introduced by the other sensors. The data from all sensors go through an attitude/orientation filter to get the final estimated attitude angles. Some of the commonly used AHRS systems are the fundamental AHRS [44], Mahony [45], Madgwick [46], and DLR-AHRS [44]. In the case of smartphone navigation, there is another factor which is the changing orientation of the device with respect to the user. This variability raises a new problem, where the heading of the user and the navigation device can be different in many cases. This imposes extra processing to estimate the heading of the pedestrian separately from the azimuth angle. The attitude mechanization suffers from drift from measurement integration and imposes the need for periodic attitude corrections and realignment between the BF and Geomatics 2021, 1 153

LLF. The realignment process is usually carried out in two phases, the first is leveling where tilting angles—roll and pitch—are estimated, and then the azimuth is corrected from projected magnetic measurements in the LLF. For the tilt compensation, the accelerometer measurements are used to extract gravity information for the leveling process. One way to estimate the gravity components is through averaging of acceleration measurements over a window of time [47–49], where the underlying principle is that accelerations over time will tend to gravity value. The magnetometer is then used for azimuth estimation, and the magnetic measurements are validated to reduce the effect of magnetic interfer- ence [46,50–53]. Fusion of sensor data from accelerometer, gyroscope, and magnetometer is used for In-run calibration to estimate the errors in the measured angular rates [54,55]. Alternative sensors that can derive angular rates can be used for attitude correction such as a camera. Cameras can be used to derive visual angular rates through feature extraction from subsequent frames [56,57] and can be used to provide corrections for the estimated attitudes from the gyroscope and magnetometer. Filters and optimization techniques are used for information fusion from IMU and possible alternative sensors to form an AHRS system. Some of these techniques are but not limited to: complementary filter (CP) [58,59], extended Kalman filter (EKF) [60], unscented Kalman filter (UKF) [21,50], particle filter (PF) [51], quaternion EKF with gradient descent (GD) [61]. After the attitudes representing the misalignment between the BF and LLF are esti- mated, the heading direction of the user is needed. The main source of direction of motion information is the projected accelerations in the LLF, hence the majority of the research regarding this issue relies on different ways to analyze the projected accelerations. In its simplest form, the heading of a step can be computed from the arctangent of the accumu- lative accelerations of the step [62], but suffers from the inaccuracies in the accelerations unless filtered properly. Alternatively, some research proposes to find the best linear fit to the data—as a step is assumed to be taken in a straight line direction—through curve fitting methods such as least-squared linear regression [49], and use the arctangent of the fitted line as the heading. In some cases, it is safe to assume a straight line motion of the user, and hence the direction of motion is not changing unless a turn event occurs, and the heading change would be based on the estimated turning event angle [63]. This kind of approach is heuristic and not optimal, while it can work efficiently in corridors, it will not be able to track slight changes in heading in open areas and spaces. Principal component analysis (PCA) is another alternative that has been utilized in many studies, where PCA is applied to the horizontal plane accelerations of the LLF to extract the 1st and 2nd principal components of the data. The 1st component is used as the heading direction [37,64–69] but suffers from forward/backward directional ambiguity and requires extra processing to distinguish the forward walking direction. Alternative sensors can be used for the heading estimation such as the gyroscope, where it exhibits relatable measurements to the direction of motion as well, especially when placed in pocket or in swinging use case [70]. In a similar manner, the magnetometer measurements can be used to detect the heading changes but not as an absolute value as the magnetic measurements provide an absolute reference to the surrounding magnetic field [71]. A fusion of both sensors can be used to limit the drift induced from the gyroscope measurement integration while avoiding the errors in heading that can be induced by magnetic disturbances [72,73]. The lack of absolute attitude correction techniques without imposing constraints or relying on alternative techniques that require infrastructure knowledge makes attitude and heading estimation an open challenge for INS. In the case of smartphone-based PDR systems, the free-motion of the device and its changing attitude with respect to the user makes it even more challenging. Frequent attitude and heading corrections are needed to increase the reliability of smartphone-based PDR systems for a longer runtime until a coordinate update (CUPT) is available. Wi-Fi fingerprinting and magnetic-map matching (MM) have been utilized to aid with the positional correction [74–77], but require regular Geomatics 2021, 1 154

surveying and maintenance. Furthermore, they suffer from RF interference and magnetic disturbance that occur regularly indoors due to the environment variability.

2.3. Step-Length Estimation The final subsystem of a PDR is the step length estimation. There are mainly two approaches regarding this point: The first is using an average step length per user, and the second is to estimate the step length on the go. Studies from [24,78] show a relationship between the pedestrian physical features, frequency of steps, and their step length. It is found that the step length is directly proportional to the step frequency and with the user’s leg length and height. Other studies include the age and gender of the pedestrian as more factors for computing the step length. In its simplest form, step length can be estimated by applying position mechanization for the in-step accelerations [79], but it requires means of bias and drift correction. In the approach of using a foot-mounted IMU this is feasible as a ZUPT would help estimate the errors in velocity and compensate for the position error. In the case of a handheld device, applying ZUPT is not feasible as the device does not experience a zero-velocity period. Various step length models have been proposed for step length estimation and they rely on the relation between the step length and step characteristics of the user. Acceleration- based step length estimation techniques refrain from the integration of the accelerations as it imposes an error that is large relative to the step size. Instead, they employ models that utilize some of the step characteristics such as average acceleration in the step, maximum and minimum accelerations, and include a user-specific parameter that is usually based on the user’s physical features [80–82]. Another famous approach is the frequency-based step length estimation model, where the step is estimated as a function of the frequency of steps taken. Many models exist that use a different underlying relationship between the step frequency and the step length, whereas in some cases the relation is assumed to be linear [83,84], and user information such as height can be used to make it more adaptive [85]. In other cases, the relation is assumed to be quadratic [86]. A more informed model can use the step frequency in combination with the acceleration variances, or a combination of average, maximum, and minimum accelerations, and user-specific information such as leg length [87,88]. In all cases, these methods require user-specific information to be able to estimate the step and would usually perform well in strapdown mode. More complex models that use machine learning and avoid the use of predetermined user-specific parameters have been tested, where the step length is computed based on artificial intelligence machine learning algorithms, feature extraction, classifiers, and alter- native sensors. Some of the approaches are based on—but not limited to—long short-term memory (LSTM) [89], autoencoders [90], back propagation neural network (BP-NN) [91], DT- and ANN-based classification [92], adaptive step length parameters [93], adaptive parameters based on classifiers [94,95], and optical flow from camera [96]. Different studies for step length estimation have been carried out that mainly rely on physical features of the user such as leg length or height, or factors related to their walking behavior such as their step frequency, acceleration variance, average walking velocity, and the sway angles. The problem when using any of these models is that it needs to be trained individually per each user to obtain the user-specific estimator parameters. For models relying on physical features, the more information provided about the pedestrian the more accurate they could get. On the other hand, the use of step frequency and variance in acceleration measurements provide very promising results, but they also require a lot of preprocessing and filtering in order to obtain the signal representing only the walking motion of the pedestrian. Usual PDR approaches suffer from the problem of restricting the user activity where there is an assumption made about the motion mode and/or use case of the navigation device. Recent state-of-the-art approaches address this issue through the use of classifiers and detectors to identify the placement of the navigation device, and motion mode of the user to enhance the navigation solution. The problem with using the classifier approach is Geomatics 2021, 1, FOR PEER REVIEW 8

a lot of preprocessing and filtering in order to obtain the signal representing only the walking motion of the pedestrian. Usual PDR approaches suffer from the problem of restricting the user activity where there is an assumption made about the motion mode and/or use case of the navigation Geomatics 2021, 1 device. Recent state-of-the-art approaches address this issue through the use of classifiers155 and detectors to identify the placement of the navigation device, and motion mode of the user to enhance the navigation solution. The problem with using the classifier approach is the lack of uniform standards for the classifier categories and classes, while also requir- the lack of uniform standards for the classifier categories and classes, while also requiring ing a vast database for training and the need for user dependant parameters in some cases. a vast database for training and the need for user dependant parameters in some cases. Furthermore, the addition of the classification stage imposes a new challenge for when Furthermore, the addition of the classification stage imposes a new challenge for when the the classification fails and/or misclassification takes place. classification fails and/or misclassification takes place. While there are many attitude and heading estimation approaches, the correction of While there are many attitude and heading estimation approaches, the correction of the tilt angles without imposing motion restriction is still an issue. This issue propagates the tilt angles without imposing motion restriction is still an issue. This issue propagates toto the the azimuth azimuth correction correction aided aided by by magnetom magnetometerseters due due to to the the requirement of leveling magneticmagnetic measurements withwith accurateaccurate tilttilt angle angle estimates. estimates. Furthermore, Furthermore, errors errors and and drift drift in inthe the attitude attitude angles angles result result in in poor poor step step heading heading estimation. estimation. AllAll these these factors factors combined combined result result in in fast fast and and high high drift drift from from the the true true trajectory, trajectory, hence hence thethe need need for for frequent frequent aiding aiding by by other other technolo technologiesgies and and techniques techniques such such as MM, as MM, Wi-Fi Wi-Fi fin- gerprinting,fingerprinting, pseudo pseudo indoor indoor GNSS GNSS systems, systems, and more. and more. The problem The problem with these with theseaiding aiding tech- niquestechniques is that is they that theymight might rely on rely phenomena on phenomena that are that changing are changing over time—such over time—such as mag- as neticmagnetic mapping—and mapping—and hence hence woul wouldd require require regular regular surveying surveying and system and system maintenance maintenance and calibration.and calibration. Although Although PDR require PDR require aiding aidingby other by technologies, other technologies, it is appealing it is appealing to improve to theimprove solution the of solution PDR as of a PDRstandalone as a standalone system in system the case in theof limited case of and limited infrequent and infrequent correc- tionscorrections to make to them make reliable them reliable for an extend for aned extended runtime. runtime. Enhancing Enhancing PDR performance PDR performance results inresults less complex in less complex and costly and aiding costly systems aiding systems requirements. requirements.

3.3. SBAUPT-Based SBAUPT-Based Pedestrian Pedestrian Dead Dead Reckoning Reckoning (S-PDR) (S-PDR) ThisThis study study presents presents S-PDR, S-PDR, an an enhanced enhanced PDR PDR system system for for smartphones that exploits certaincertain motion motion behaviors behaviors that that occur occur frequently frequently for for most most steps steps taken. taken. The The flowchart flowchart of S- of PDRS-PDR is shown is shown in inFigure Figure 4.4 .

FigureFigure 4. 4. S-PDRS-PDR flowchart. flowchart.

TheThe developed developed S-PDR S-PDR utilizes utilizes a a step step detec detectiontion technique technique that that was was developed developed by by the the authorsauthors in in [97] [97] which which avoids avoids the the use use of of classi classifiersfiers for for tuning tuning the the step step detection detection parameters parameters as it can cause issues when misclassifications occur. To improve the performance of a PDR system, S-PDR uses a recently developed attitude correction technique developed by the authors in [27] that can provide corrections frequently to prevent the attitudes from drifting and maintain a good estimate of the relation between the BF and LLF. Finally, a novel heading estimation technique is developed that uses a complementary filter with adaptive gain mapping to compute the heading from two estimates. The first heading estimate is computed from statistical analysis of the accelerations recorded in the step window, and the second is computed by applying PCA to a reduced acceleration set. The reduced set is Geomatics 2021, 1 156

obtained through outlier detection and eliminates accelerations that have low magnitude and are usually not descriptive of the direction of motion of the platform. The following subsections present in-depth information and description of the meth- ods used in each of the developed subsystems for S-PDR.

3.1. Step Detection To enhance the performance of a PDR system, a robust step detection technique is needed. The step detection technique should be able to detect steps at varying motion speeds and under different smartphone use cases. Furthermore, it should have the ability to verify steps, whether making sure that a detected step is an actual step and not a similar pattern mistaken for a step—false positive—or a step went undetected—false negative. The developed algorithm [97] proposed an adaptive cut-off frequency filtering of the sensor measurements to adaptively remove motion noise, then uses peak and valley pair detection with temporal and spatial filtering for step detection, fusion of alternative sensors for enhanced step detection, and finally a step verification module. The following subsections briefly describe the novelties.

3.1.1. Adaptive Cut-Off Frequency Filter The acceleration measurements represent the device motion. The measurements are poised with high noise introduced by the sensor and the motion noise of the user—for example shaking hands. The developed step detection algorithm utilizes an adaptive cut-off frequency filter, where the cut-off frequency is frequently updated based on the estimated speed of motion.

3.1.2. Temporal Filtering Although filtering the signal removes most of the unwanted signal fluctuation inter- fering with the step detection, there is leftover motion noise that can affect the detection accuracy. To enhance the peak/valley extraction for step detection, temporal filtering is used to avoid unwanted peak/valley detections. The temporal filtering is carried out by introducing candidate and rejection regions. The candidate regions represent the regions where a peak/valley exists and only one peak/valley is accepted. The rejection region is the region where no peak/valley should exist and if any is detected, it is discarded.

3.1.3. Sensor Fusion In certain types of motion such as phone swinging, other sensors exhibit motion patterns that can be useful for step detection. In the developed technique, a repetitiveness detector is employed to detect such useful information in the gyroscope and magnetometer measurements. The detector identifies the dominant axis of motion for the alternative sensors, and the signals from these sensors are used for peak/valley verification.

3.1.4. Step Validation In some cases, signal patterns that can be mistaken for a step occur—referred to as a false positive. To verify the detected step, the candidate step must have a displace- ment based on the recorded accelerations. Furthermore, a detector can fail to detect a step—referred to a false negative—if the peak/valley pair detection fails. Temporal and displacement-based verification is used to account for missed steps.

3.2. Azimuth Step-Based Attitude Update (SBAUPT) In most cases, the attitude estimation in PDR is based on the attitude mechanization from the DR technique shown in Figure5. Unlike accelerations, the angular rates do not benefit from the cyclic repetitiveness of GC, but rather use accelerations during static periods to reset the tilt angles estimate. SBAUPT is an attitude correction technique that provides corrections over two phases. The first phase—step-based update SBUPT [98]—is the tilt angles correction without imposing motion constraints such as static periods of Geomatics 2021, 1, FOR PEER REVIEW 10

referred to a false negative—if the peak/valley pair detection fails. Temporal and displace- ment-based verification is used to account for missed steps.

3.2. Azimuth Step-Based Attitude Update (SBAUPT) In most cases, the attitude estimation in PDR is based on the attitude mechanization from the DR technique shown in Figure 5. Unlike accelerations, the angular rates do not benefit from the cyclic repetitiveness of GC, but rather use accelerations during static pe- Geomatics 2021, 1 157 riods to reset the tilt angles estimate. SBAUPT is an attitude correction technique that pro- vides corrections over two phases. The first phase—step-based update SBUPT [98]—is the tilt angles correction without imposing motion constraints such as static periods of oper- ation,operation, but rather but rather exploiting exploiting motion motion behavi behaviorsors that that occur occur frequently frequently during during pedestrian pedestrian walking.walking. The The second second phase phase is is providing providing the the azimuth azimuth correction correction from from fusion fusion of of gyroscope- gyroscope- derivedderived azimuth azimuth with with magnetometer-based magnetometer-based az azimuthimuth when when the the magnetometer magnetometer is is deemed deemed accurateaccurate at at sensing sensing the the earth’s earth’s magnetic magnetic fie fieldld [[27].27]. The magnetometer measurementmeasurement quality qual- ityis is assessed assessed on on a a two-level two-level thresholding thresholding decision decision processprocess toto decide when to to apply apply the the correction.correction. The The following following subsections subsections briefly briefly describe describe the the two two phases phases of of SBAUPT. SBAUPT.

FigureFigure 5. 5. BlockBlock diagram diagram of of Dead Dead Reckoning Reckoning (DR). (DR).

3.2.1.3.2.1. Step-Based Step-Based Update Update (SBUPT) (SBUPT) Tilt angles—roll and pitch—are computed based on gravity components. A common Tilt angles—roll and pitch—are computed based on gravity components. A common constraint to apply tilt angle corrections is to use static periods where the accelerations are constraint to apply tilt angle corrections is to use static periods where the accelerations are only corresponding to gravity components. When using smartphones for navigation, there only corresponding to gravity components. When using smartphones for navigation, are usually no static periods and the accelerometer is measuring the net force of gravity there are usually no static periods and the accelerometer is measuring the net force of and linear acceleration of the device. gravity and linear acceleration of the device. SBUPT [98] exploits periods of motion with nearly steady walking speed, where the SBUPT [98] exploits periods of motion with nearly steady walking speed, where the accelerations average in a step will tend to gravity and can be used to estimate the tilt accelerations average in a step will tend to gravity and can be used to estimate the tilt angles. To estimate the roll and pitch angles from the step-window accelerations, they need angles. To estimate the roll and pitch angles from the step-window accelerations, they to be in the same reference frame. Usual methods use transformation to LLF to project all need to be in the same reference frame. Usual methods use transformation to LLF to pro- accelerations into the same reference frame, but using this approach introduces historically ject all accelerations into the same reference frame, but using this approach introduces accumulated errors into the projection process. SBUPT overcomes this problem by defining historicallya step frame accumulated (SF)—which errors is the finalinto BFthe in proj theection step-window. process. SFSBUPT is an arbitraryovercomes relative this prob- frame lemwith by unknown defining attitudesa step frame buthas (SF)—which known relative is theattitude final BF to in other the step-window. BF instances within SF is an the arbitrarystep, and relative uses the frame in-step with gyroscope unknown measurements attitudes but to has transform known allrelative in-step attitude accelerations to other to BFthe instances same reference within the frame. step, A and least uses squares the in-step estimator gyroscope is developed measurements and used to to transform refine the allgravity in-step estimates accelerations and reduceto the same the effect reference of leftover frame. linear A least acceleration squares estimator components. is devel- This opedprocess and eliminates used to refine accumulation the gravity of errorsestimates as the an processd reduce resets the witheffect each of leftover detected linear step andac- celerationdoes not relycomponents. on absolute This attitude process values eliminates estimated. accumulation This correction of errors process as the can process be applied re- setsfrequently with each on detected a step basis step if and the does step averagenot rely on passes absolute the threshold attitude va conditionlues estimated. indicating This a correctionnear-constant process motion can speed.be applied Tracking frequently the full on attitude a step basis states if during the step the average step is obtainedpasses the by the attitude mechanization process.

3.2.2. Azimuth Fusion

Azimuth is estimated from the attitude mechanization and suffers from drifting due to error accumulation. can be used for azimuth correction by utilizing the earth magnetic field information, but there must be no magnetic interference and the roll and pitch estimates must be accurate for this correction process to be success- ful. The developed azimuth correction technique [27] starts by evaluating the integrity of magnetic measurements using a two-level threshold pass/fail test. If the magnetic measurements pass the test, an adaptive gain mapping procedure is applied to be used for Geomatics 2021, 1, FOR PEER REVIEW 11

threshold condition indicating a near-constant motion speed. Tracking the full attitude states during the step is obtained by the attitude mechanization process.

3.2.2. Azimuth Fusion Azimuth is estimated from the attitude mechanization and suffers from drifting due to error accumulation. Magnetometers can be used for azimuth correction by utilizing the earth magnetic field information, but there must be no magnetic interference and the roll and pitch estimates must be accurate for this correction process to be successful. The de- veloped azimuth correction technique [27] starts by evaluating the integrity of magnetic measurements using a two-level threshold pass/fail test. If the magnetic measurements pass the test, an adaptive gain mapping procedure is applied to be used for the comple- mentary filter fusion of the magnetometer-based and the gyroscope-derived azimuth.

3.3. Heading Estimation Many methods assume that the pedestrian is using the smartphone in compassing mode—phone screen facing up and y-axis of the phone pointing in the direction of mo- tion—while using navigation applications, hence the pedestrian and BF main axis of mo- tion—forward motion—are aligned and both frames have the same azimuth. Under these assumptions, the pedestrian heading is considered to be the azimuth angle of the BF align- ment to the LLF. This assumption fails to track the pedestrian heading when the smartphone is reoriented in any way so that the y-axis is no longer aligned with the user’s motion direction. In this case, the PDR would mistakenly believe that the user changed direction while he did not. Geomatics 2021, 1 To overcome this problem the pedestrian 158heading should be estimated separately from the smartphone orientation. Once the orientation of the BF is known with respect to the complementary filter fusion of the magnetometer-based and the gyroscope-derived LLF,azimuth. the accelerations are transformed to LLF and can be used to estimate the heading of

the3.3. Heading pedestrian. Estimation The heading is derived from the components of the linear acceleration vec- torsMany of methods the user assume thatin theLLF pedestrian based is using on the smartphoneEquation in compassing (1). The horizontal component of the user’s mode—phone screen facing up and y-axis of the phone pointing in the direction of motion— linearwhile using acceleration navigation applications, vector hence the pedestrian𝐴 is decomposed and BF main axis of motion— into the horizontal plane of LLF over the forward motion—are aligned and both frames have the same azimuth. Under these northassumptions, and the pedestrianeast axis heading as isshown considered in to beFigure the azimuth 6. angle of the BF alignment to the LLF. This assumption fails to track the pedestrian heading when the smartphone is reoriented in any way so that the y-axis is no longer aligned with the user’s motion direction. In this case, the PDR would mistakenly believe𝜃 that the = userarctan2 changed(𝐴, 𝐴) (1) direction while he did not. To overcome this problem the pedestrian heading should be estimated separately where,from the smartphone 𝜃 is orientation.the heading Once the orientationangle ofcomputed the BF is known withfrom respect the north direction, 𝐴 and 𝐴 are the linearto LLF, the acceleration accelerations are transformed components to LLF and can in be usedeast to estimateand north the heading directions, respectively. The formulation of the pedestrian. The heading is derived from the components of the linear acceleration previouslyvectors of the user in presented LLF based on Equation can (1). estimate The horizontal the component heading of the user’s of a single acceleration sample. During a linear acceleration vector Ah is decomposed into the horizontal plane of LLF over the north step,and east axisa sequence as shown in Figure of6 .accelerations is recorded corresponding to the direction of motion. One

would think that allθ = thearctan2 accelerations(AE, AN) during the(1) step would be in the same direction but

thatwhere, θisis not the heading the anglecase. computed During from thea step, north direction, the userAE and undergoesAN are the an accelerating stage followed by a linear acceleration components in east and north directions, respectively. The formulation deceleratingpreviously presented canstage, estimate with the heading a fluctuating of a single acceleration transition sample. During that a ends up generating accelerations in a step, a sequence of accelerations is recorded corresponding to the direction of motion. One varietywould think thatof alldirections the accelerations that during themight step would not be inbe the descrip same directiontive but of the direction of motion. In addition that is not the case. During a step, the user undergoes an accelerating stage followed by a todecelerating that, stage,the withaccelerations a fluctuating transition have that ends a varying up generating accelerationsvertical in component a due to the inverse pendulum variety of directions that might not be descriptive of the direction of motion. In addition motionto that, the accelerations of the haveuser a varying and vertical the componentnavigation due to the device inverse pendulum instability. This behavior can be seen in Fig- uremotion 7. of the user and the navigation device instability. This behavior can be seen in Figure7.

− Figure 6. Acceleration 6. Accelerationbased heading in− LLF.based heading in LLF.

Geomatics 2021, 1, FOR PEER REVIEW 12 Geomatics 2021, 1 159 Geomatics 2021, 1, FOR PEER REVIEW 12

Figure 7. In−step linear accelerations vectors direction. FigureFigure 7. 7.InIn−step−step linear linear accelerations accelerations vectors vectors direction. direction. The resulting headings from the horizontal components of the linear acceleration in the LLFTheThe navigation resulting resulting headingsframe headings suffer from from from the the highhorizontal horizontal fluctuations components components at low of accelerations of the the linear linear acceleration accelerationand reverse in in bythe theapproximately LLF LLF navigation navigation 180 frame framedegrees suffer suffer during from from thehigh high decele fluctuations fluctuationsration stage at at low lowof accelerationsthe accelerations step. This and is and further reverse reverse illustratedbyby approximately approximately in Figure 180 8. 180 It degrees is degrees clear duringat during that pointthe the decele decelerationthat rationno single stage stage instance of of the the ofstep.step. the Thisaccelerations This is isfurther further illustrated in Figure8. It is clear at that point that no single instance of the accelerations wouldillustrated be sufficient in Figure to 8. determine It is clear theat that heading point ofthat the no step. single Common instance methods of the accelerations to address would be sufficient to determine the heading of the step. Common methods to address thiswould issue be is sufficientto use the toaverage determine of the the step heading accelerations of the tostep. derive Common the heading methods or using to address PCA this issue is to use the average of the step accelerations to derive the heading or using tothis find issue the dominantis to use the direction average of of motion. the step Wh accelerationsen using the to accelerationsderive the heading average, or usingthe head- PCA PCA to find the dominant direction of motion. When using the accelerations average, the ingto findangle the suffers dominant from direction high errors of motion. due to Whthe enlow using linear the acceleration accelerations average average, value the head-that heading angle suffers from high errors due to the low linear acceleration average value mighting angle approach suffers zero. from On high the othererrors hand, due to when the lowusing linear PCA acceleration the resulting average direction value suffers that that might approach zero. On the other hand, when using PCA the resulting direction frommight inaccuracy approach due zero. to Onthe theoutlier other accelerati hand, whenons with using low PCA magnitude the resulting and suffers direction from suffers 180 suffers from inaccuracy due to the outlier accelerations with low magnitude and suffers degreesfrom inaccuracy ambiguity, due meaning to the outlier that we accelerati can not distinguishons with low forward magnitude from and backward suffers motion.from 180 from 180 degrees ambiguity, meaning that we can not distinguish forward from backward Hence,degrees an ambiguity, alternative meaning solution thatto estimating we can not the distinguish heading is forward needed. from backward motion. motion. Hence, an alternative solution to estimating the heading is needed. Hence, an alternative solution to estimating the heading is needed.

FigureFigure 8. In 8.−stepIn−step headings headings from from horizont horizontalal linear linear accelerations. accelerations. Figure 8. In−step headings from horizontal linear accelerations. 3.3.1.3.3.1. Outlier Outlier Rejection Rejection and and Statistical Statistical Heading Heading Estimation Estimation 3.3.1.To Outlier Toenhance enhance Rejection the the estimation estimation and Statistical of the of the heading, Heading heading, outlier Estimation outlier measurements measurements in the in the step step window window needneed toTo be toenhance befiltered filtered the out. estimation out. The The walking walking of the behavi heading, behavioror of outlier pedestrians of pedestrians measurements includes includes ina swaying the a swaying step windowmotion motion asneed theas the userto be user switches filtered switches out.between between The walkingright right and behavi and left left stepor steps, ofs, thispedestrians this is part is part of includes the of the balancing balancing a swaying process process motion to to maintainasmaintain the user the the switchescenter center of betweengravity of gravity of right the of thebody. and body. left This Thisstep motions, motion this can is can partcause cause of low the low accelerationbalancing acceleration process periods periods to ofmaintain theof the step step theto todeviate center deviate of far gravity far from from the of the the true true body. head heading Thising of motion of the the step step can and and cause hence low areacceleration consideredconsidered periodsoutliers. out- liers.ofThe the The headingstep heading to deviate estimation estimation far from is hence is thehence mainlytrue mainly head targetinging targeting of the step highthe high and acceleration/deceleration acceleration/decelerationhence are considered stagesout- stagesliers.of the Theof step.the heading step. estimation is hence mainly targeting the high acceleration/deceleration stagesAs Asofper the per previous step. previous elaborations, elaborations, the the usual usual step step is similar is similar to a to sinusoidal a sinusoidal wave wave including including a peaka peakAs and per and valley previous valley pair pair elaborations,that that are areboth both thepositive positiveusual values step values is duesimilar due to the toto theashift sinusoidal shift by the by the gravitywave gravity including vector. vector. a Whenpeak and the valley signals pair are leveledthat are andboth compensated positive values for gravity,due to the the shift east by and the north gravity accelerations vector.

GeomaticsGeomatics 20212021,, 11,, FORFOR PEERPEER REVIEWREVIEW 1313

WhenWhen thethe signalssignals areare leveledleveled andand compensatedcompensated forfor gravity,gravity, thethe easteast andand northnorth accelera-accelera- Geomatics 2021, 1 tionstions componentscomponents areare nearlynearly zerozero meanmean sinusoidalsinusoidal waves,waves, andand whenwhen160 thethe magnitudemagnitude ofof thethe totaltotal horizontalhorizontal accelerationacceleration isis computedcomputed itit resultsresults inin invertinginverting thethe valleyvalley partpart ofof thethe signalsignal toto aa peak.peak. Hence,Hence, thethe selectionselection ofof thethe acceleraaccelerationstions isis basedbased onon aa wiwindowndow ofof measurementsmeasurements fromfromcomponents thethe two aretwo nearly peakpeak zero valuesvalues mean sinusoidal inin thethe waves,horizontalhorizontal and when accelerations’accelerations’ the magnitude of components.components. the total TheThe windowwindow aroundhorizontal the acceleration first peak is computed is representative it results in inverting of the theforward valley part direction of the signal of tomotion, a while the win- aroundpeak. Hence, the the first selection peak of is the representative accelerations is based of onthe a windowforward of measurementsdirection of from motion, while the win- dowdowthe two aroundaround peak values thethe in secondsecond the horizontal peakpeak accelerations’ isis representativerepresentative components. ofof thethe The reverse windowreverse around directiondirection the ofof motionmotion deceler-deceler- ationationfirst peak sectionsection is representative ofof thethe step.step. of the The forwardThe regionregion direction ofof ofintereintere motion,stst in whilein thethe the accelerationacceleration window around windowwindow isis shownshown inin Figurethe second 9 peakbased is representative on magnitude of the reversefiltering direction arou ofnd motion the decelerationpeak values, section and of the corresponding Figurethe step. The9 based region ofon interest magnitude in the acceleration filtering window around is shown the peak in Figure values,9 based and on the corresponding accelerationaccelerationmagnitude filtering vectorsvectors around inin the thethe peak east/northeast/north values, and the planeplane corresponding areare shownshown acceleration inin FigureFigure vectors 10.10. in Finally,Finally, thethe in-stepin-step headingsheadingsthe east/north withwith plane encircledencircled are shown headingsheadings in Figure 10 .ofof Finally, interestinterest the in-step correspondingcorresponding headings with toto encircled thethe selectedselected accelerationsaccelerations fromheadings the of measurements interest corresponding window to the selectedare shown accelerations in Figure from 11. the measurements fromwindow the are measurements shown in Figure 11 .window are shown in Figure 11.

FigureFigure 9. 9.9.In In−Instep−−stepstep accelerations accelerationsaccelerations regions regions ofregions interest. ofof interest.interest.

Figure 10. In−step east vs. north accelerations scatter. FigureFigure 10.10. InIn−−stepstep easteast vs.vs. northnorth accelerationsaccelerations scatter.scatter.

Geomatics 2021, 1, FOR PEER REVIEW 14

Geomatics 2021, 1, FOR PEER REVIEW 16114

Figure 11. In−step headings of interest. FigureFigure 11. 11. InIn−−stepstep headings headings of of interest. interest. The dominant heading angle can be verified by further analysis of the in-step head- ings usingTheThe adominant histogram, headingheading where angletheangle expected can can be be verified outcverifiedome by by is further tofurther have analysis aanalysis peak ofbin theof in the in-stepthe in-step histogram headings head- representingingsusing using a histogram, a the histogram, direction where where of themotion, the expected expected and another outcome outcome peak is is to tobin have have that a a peakis peak 180 bin bindegrees inin thethe ( histogramπ) away fromrepresentingrepresenting the first peak the the directionrepresenting direction of of motion, motion,the direction and and another another of deceleration. peak peak bin bin To that that re solveis is 180 180 the degrees degrees ambiguity ( (ππ) away of whichfromfrom ofthe the the first first two peak peak bins representing representing represent the the the forward direction direction di of rection, deceleration. the accelerations To To re resolvesolve inthe each ambiguity bin are of matchedwhich of back the to two the bins original represent accelerations the forward signals di direction, rection,and the thebin containingaccelerations the in acceleration each bin are samplesmatchedmatched from back back the to to first the the originalhalf of the accelerations step—which si signalsgnals is the and accelerating the bin containing phase of thethe stepacceleration in the directionsamplessamples of from from motion—is the the first first thehalf bin of therepresenting step—which the isforward the accelerating motion. The phase distribution of the step of in the the previouslydirectiondirection presentedof of motion—is headings the bin is representing illustrated in the Figure forward 12, where motion. there The is distribution a dominant of bin the at previouslyheading 2 radianspresented and headings headings another is isat illustrated illustratednearly −1.4 in in radians. Figure Figure 12,12In , somewhere where cases, there there the is a true dominant heading bin willatat beheading borderline 2 radians between and two another bins atand nearlynearly the re −−corded1.41.4 radians. radians. headings In In some some will becases, cases, split the over true two heading bins, hencewill bewe borderline borderlineexpand the between selection two to bins binstake and andinto the theacco re recordeduntcorded the directheadings headings neighbor will be be to split split the over overleft ortwo two right bins, bins, basedhencehence on we we a selection expand the criterion. selection to take into acco accountunt the direct neighbor to the left or right basedbasedThe on onhistogram a a selection distribution criterion. is constructed with bins of width 0.1π radians resulting in 20 bins.TheThe Afterhistogram distinguishing distribution distribution the is isfirst cons constructed domitructednant with with bin, bins binsthe direct of of width neighbors 0.1 π radians of the resultingbin are examinedinin 20 20 bins. bins. to Afterdecide After distinguishing if distinguishing one of them the will the first be first includeddomi dominantnant in bin, the bin, theheading the direct direct computation. neighbors neighbors of Thethe of thebinright binare andexaminedare left examined neighbors to decide to decideare if inspected, one if of one them of and them will the be will ne includedighbor be included with in the the in heading thegreater heading computation. number computation. of measure- The right The mentsandright leftper and neighborsbin left is neighborschosen are inspected,as area candidate inspected, and thebin andne toighbor be the merged neighbor with thewith withgreater the thedominant number greater ofbin. number measure- If the of candidatementsmeasurements per bin bin has is per achosen number bin is chosenas ofa candidatemeasurements as a candidate bin to that binbe ismerged to higher be merged with than withthe a certain dominant the dominant threshold, bin. bin.If itthe If the candidate bin has a number of measurements that is higher than a certain threshold, it willcandidate be merged bin with has athe number dominant of measurements bin. that is higher than a certain threshold, it will be merged with the dominant bin. will be merged with the dominant bin.

FigureFigure 12. 12. In−Instep−step heading heading distribution distribution histogram. histogram. Figure 12. In−step heading distribution histogram. Once the dominant bin and possible direct neighbor is/are distinguished, the remain- ing bins in the forward phase are discarded and the search for the second dominant bin

GeomaticsGeomatics 2021, 1 ,2021 FOR, 1PEER, FOR REVIEW PEER REVIEW 15 15

Geomatics 2021, 1 162

Once theOnce dominant the dominant bin and bin possible and possible direct direct neighbor neighbor is/are is/aredistinguished, distinguished, the remain- the remain- ing binsstarts.ing in bins the It in isforward the expected forward phase that phase are the discarded secondare discarded dominant and the and search binthe issearch for nearly the for secondπ theradians second dominant away dominant frombin thebin starts.firststarts. It is dominant expected It is expected that bin asthe that shown second the second in dominant the polar dominant plotbin is of binnearly the is accelerationsnearly π radians π radians away presented awayfrom thefrom in Figurefirst the first 13, dominantanddominant thebin polaras bin shown histogramas shown in the in presentedpolar the polarplot inof plot Figurethe of accelerations the 14. accelerations The same presented process presented in for Figure selecting in Figure 13, neighborand 13, and the polarcandidatethe polarhistogram histogram bin is presented applied. presented Thein Figure selection in Figure 14. criterionThe 14. same The is sameprocess shown process infor Equations selecting for selecting (2)–(4).neighbor neighbor Where can- b can-n is didatethedidate bin dominant is binapplied. is applied. bin, The and selection Thebc is selection the criterion candidate criterion is neighboring shown is shown in Equations bin. in Equations (2)–(4). (2)–(4). Where Where 𝑏 is 𝑏 is the dominantthe dominant bin, and bin, 𝑏 and is the𝑏 iscandidate the candidate neighboring neighboring bin. bin. bn = max bi (2) 𝑏 =max𝑏 =max1≤𝑏i≤ 20 𝑏 (2) (2) = ( ) 𝑏 =max(𝑏bc 𝑏 =max(𝑏maxb,𝑏n−1, b),𝑏n +1 ) (3) (3)(3)   𝑏 bn𝑏 𝑖𝑓i f 𝑏 𝑖𝑓>bc > 𝑏 →𝑚𝑒𝑟𝑔𝑒(𝑏> →𝑚𝑒𝑟𝑔𝑒(𝑏→ merge,𝑏(b)n , b,𝑏c) ) (4) (4)(4) 2 2 2

FigureFigureFigure 13. Accelerations 13.13. AccelerationsAccelerations in polar inin axespolarpolar “”. axesaxes “compass”.“compass”.

FigureFigureFigure 14. Polar 14.14. histogramPolarPolar histogramhistogram of headings. ofof headings.headings.

It is importantItIt isis importantimportant to view to to view theview histogram the the histogram histogram in polar in in polar polarcoordinates coordinates coordinates as it as shows as it showsit shows the thecontinuity the continuity continuity of of thetheof bins, the bins, wherebins, where where the the first the first bin first bin and bin and last and last bin last bin of bin ofthe theof histogram the histogram histogram are are neighboring are neighboring neighboring bins bins and bins and can and can can be be merged.merged.be merged. For For example, For example, example, if the if the ifdirection the direction direction of mo of motionoftion mo istion in is the in is the innorth the north northdirection, direction, direction, the the accelerat- the accelerating accelerat- ing segmentsegmenting segment of of the the of step stepthe will step will result will result resultin in a apeak peakin a binpeak bin atat binzero zero at radians, zero radians, radians, and and the theand decelerating decelerating the decelerating seg- segment seg- ment willmentwill createcreate will create anan expectedexpected an expected peak peak at atpeak negative/positive negative/positive at negative/positive ππ,, whichwhich π, which areare the the are first first the and and first last last and bins bins last in bins the in thehistogram,in histogram, the histogram, but but from from but the thefrom polar polar the histogram polarhistogram histogram it canit can be itbe seen can seen thatbe thatseen they they that are neighboringarethey neighboring are neighboring bins and bins andcanbins can be and merged be can merged be together merged together iftogether needed. if needed. if needed.

Geomatics 2021, 1, FOR PEER REVIEW 16316

3.3.2.3.3.2. Reduced-Set Reduced-Set Acceleration Acceleration PCA PCA WithWith the elimination of thethe outlieroutlier accelerations,accelerations, thethe remainingremaining reduced reduced set set of of acceler- accel- erationsations from from the the acceleration acceleration window window are are more more precise precise in describingin describing the the direction direction of motion.of mo- tion.Alternatively Alternatively to averaging to averaging the heading the heading angles angles from from the reduced-set the reduced-set accelerations, accelerations, PCA PCAcan becan applied be applied to the to reduced-set the reduced-set to obtain to obtain the main the directionmain direction of motion. of motion. As discussed As dis- cussedearlier, earlier, the principal the principal components components returned retu fromrnedthe from PCA thesuffer PCA suffer from directionalfrom directional ambi- ambiguityguity as they as they represent represent the correlationthe correlation of the of data.the data. The The effect effect of the of outlierthe outlier accelerations accelera- tionsis evident is evident in Figure in Figure 15, where 15, where the first the principalfirst principal component component from from the reducedthe reduced set is set less is lessaffected affected by theby the outliers outliers in in comparison comparison the the first first principal principal component componentbased based onon the full accelerationsaccelerations window. window.

FigureFigure 15. 15. PrincipalPrincipal Component Component Analysis Analysis (PCA) (PCA) for for full full step step window window vs. reduced reduced step step window. window.

TheThe heading heading derived derived from from the the PCA PCA is is computed based on the components of the unityunity vector vector representing representing the the correlation correlation of of the the data data as as shown shown in in Equation (5) (5) but is also representativerepresentative of of the the forward or backward direction of motion.motion. Hence, two candidate headingsheadings are are derived derived from from the the PCA PCA that that are are ππ radians apart, where the second candidate isis computed computed as as in in Equation Equation (6), (6), and and the the candidate candidate coinciding coinciding with with heading heading from from the his- the togramhistogram matching matching process process is chosen is chosen to be to th bee thePCA PCA derived derived heading heading for forforward forward motion motion as inas Equation in Equation (7).(7). =  θPCAc1 arctan2 p1E , p1N (5) 𝜃 =arctan2𝑝 ,𝑝 (5) = +  θPCAc2 RoundToPi θPCAc1 π (6) 𝜃 = 𝑅𝑜𝑢𝑛𝑑𝑇𝑜𝑃𝑖(𝜃 +𝜋) (6) = −  −  θPCA min abs θPCAc1 θH , abs θPCAc2 θH (7) 𝜃 =min(𝑎𝑏𝑠𝜃 −𝜃, 𝑎𝑏𝑠(𝜃 −𝜃)) (7) where p1E is the 1st principal component in east direction, p1N is the 1st principal compo- 𝑝 𝑝 wherenent in North is the direction, 1st principalθPCAc 1componentand θPCAc2 inare east the direction, candidate headings is the from1st principal PCA, θPCA com-is ponentthe PCA in heading,North direction, the min function𝜃 and returns 𝜃 the are candidate the candidate angle withheadings minimum from PCA, delta from𝜃 isθH thewhich PCA is heading, the heading the frommin function the histogram, returns and the RoundToPi candidate isangl a functione with minimum that rounds delta the fromangles 𝜃 to which a [−π, isπ ]the range. heading from the histogram, and RoundToPi is a function that roundsSince the thereangles are to twoa [−𝜋, heading 𝜋] range. estimates—the first being the analytical heading from the histogramSince there and are the two second heading being estimates—the the reduced-set first PCA-based being the heading,analytical it heading is desirable from to theapply histogram a fusion and phase the to second combine being the the information reduced-set from PCA-based both estimates. heading, The it fusionis desirable is done to applyby means a fusion of a phase complementary to combine filter the informatio with an adaptiven from both gain estimates. based on The the covariancesfusion is done of byeach means of the of derived a complementary angles. First, filter the headingwith an derivedadaptive from gain the based histogram on the iscovariances computed of as eachthe average of the derived of all the angles. headings First, in the the headin bins representingg derived from the the forward histogram direction is computed of motion as thecomputed average as of in all Equation the headings (8), and in the bins variance representing of the headings the forward in the direction bins are computedof motion computedbased on Equationas in Equation (9). For (8), the and PCA-based the variance heading, of the the headings variance in ofthe the bins data are points computed from basedthe principal on Equation component (9). For is the computed PCA-based to represent heading, how the goodvariance the of fit the is, which data points is based from on thethe principal residuals (componentrm) that are is shown computed in Figure to repres 16 andent computed how good by the Equation fit is, which (10). Theis based weights on used for the filter are then computed as the ratio of each variance to the total variance of the residuals (𝑟) that are shown in Figure 16 and computed by Equation (10). The weights usedboth for estimates the filter as are shown then in computed Equation as (11). the The ratio weights of each are variance cross corelated, to the total so variance the weight of computed from the PCA is used for the histogram-derived angles and vice versa. As one

Geomatics 2021, 1, FOR PEER REVIEW 17

Geomatics 2021, 1 164

both estimates as shown in Equation (11). The weights are cross corelated, so the weight computedestimate has from a higher the PCA variance is used and for a the consequently histogram-derived higher ratio, angles the and higher vice weightversa. As should one estimatebe given has to the a higher other estimate.variance and The a fusion consequently angle is computedhigher ratio, based the higher on Equation weight (12). should be given to the other estimate. The fusion angle is computed based on Equation (12). n ∑i=1 θi θH = ∑ 𝜃 (8) 𝜃 = n (8) 𝑛 n 2 ∑∑(i=1(θ𝜃i −−𝜃θH)) var𝑣𝑎𝑟H == (9)(9) n𝑛−1− 1 m 2 ∑∑i=1 r𝑟m var𝑣𝑎𝑟PCA == (10)(10) m𝑚−1− 1 varPCA varH w 𝑤= = w 𝑤== (11)(11) PCA H varH + varPCA varH + varPCA

θF 𝜃= =𝑤wH × ×𝜃θPCA++𝑤wPCA××𝜃θH (12)(12)

FigureFigure 16. 16. SamplesSamples of of residuals residuals for for the the PCA. PCA.

TheThe block block diagram diagram for for the the heading estimation estimation algorithm algorithm is is shown shown in in Figure 17,17, the algorithmalgorithm for for heading heading estimation estimation is is shown shown in in Algorithm Algorithm 1, 1, and and the used notations are shownshown in in Table Table 11..

TableTable 1. List of notations used in the heading estimation algorithm.

NotationsNotations BoldBold Bold notations Bold notations represent represent arrays arrays and and matrices matrices ALLF Acceleration window in LLF (east, north, and up column wise) 𝑨window Acceleration window in LLF (east, north, and up column wise) θ Array of in-step headings 𝜽 Array of in-step headings ALLF, ALLF First and second columns of ALLF respectively 𝑨, 𝑨E N 𝑨window θs First and second columnsSorted in-step of headings respectively 𝜽 θH MeanSorted heading in-step from headings histogram analysis w𝜃H, wPCA WeightMean of histogram heading headingfrom histogram and PCA analysis heading respectively ALLF Reduced acceleration window after outlier rejection 𝑤,𝑤reduced Weight of histogram heading and PCA heading respectively thr Outlier threshold 𝑨 o p Reduced accelerationPrincipal window components after (3 outlier vectors) rejection 𝑡ℎ𝑟 p1 1st principal componentOutlier threshold vector (dominant component) θPCAc1,𝒑θPCA c2 1stPrincipal and 2nd components candidates of PCA-based(3 vectors) heading θ PCA-based heading 𝑝 PCA 1st principal component vector (dominant component) θF Fusion heading 𝜃,𝜃 1st and 2nd candidates of PCA-based heading 𝜃 PCA-based heading 𝜃 Fusion heading

GeomaticsGeomatics 20212021,, 11, FOR PEER REVIEW 16518

Figure 17. Heading estimation block diagram.

LLF AlgorithmAlgorithm 1. Heading Estimation Estimation (A (window𝑨) ) ------—— StatisticalStatistical heading extraction extraction——------( ) 1.1. 𝜽θ = =arctan2 arctanA 2 𝑨LLF , A, 𝑨LLF  𝜽 =𝑠𝑜𝑟𝑡(𝜽 ) E N 2.2. θs = sort(θ ) 3.3. 𝒃𝒊𝒏𝒔bins = group (=θ 𝑔𝑟𝑜𝑢𝑝(𝜽s, bin , 𝑏𝑖𝑛_𝑒𝑑𝑔𝑒𝑠)_edges) 4.4. 𝜽θf == 𝑓𝑜𝑟𝑤𝑎𝑟𝑑_𝑏𝑖𝑛_𝑒𝑥𝑡𝑟𝑎𝑐𝑡𝑖𝑜𝑛(𝒃𝒊𝒏𝒔)f orward_bin_extraction(bins)   5.5. 𝜃θH =𝑚𝑒𝑎𝑛(𝜽= mean θf)   6. 𝜎2 = 𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒(𝜽) 6. σH = variance θf ------PCA-based heading ------—— PCA-based heading ——- 7. 𝑨 = 𝑜𝑢𝑡𝑙𝑖𝑒𝑟_𝑟𝑒𝑗𝑒𝑐𝑡𝑖𝑜𝑛(𝑨 ,𝑡ℎ𝑟 ) LLF LLF  7. A = outlier _rejection A , thr 𝒑=𝑝𝑐𝑎(𝑨reduced ) window o 8. LLF 8. p = pca Areduced 9. 𝜃 =arctan2𝑝,𝑝 9. θPCAc1 = arctan2(p1E, p1N ) 10. 𝜃 = 𝑅𝑜𝑢𝑛𝑑𝑇𝑜𝑃𝑖(𝜃 +𝜋) 10. θPCAc2 = RoundToPi(θPCAc1+ π) 11.11. 𝜃θPCA=min= min(𝑎𝑏𝑠𝜃 (abs(θPCAc1 −−𝜃θH),,abs 𝑎𝑏𝑠(𝜃(θPCAc2 − θ−𝜃H)))) 2 LLF  12.12. 𝜎σPCA=𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒= variance (A𝑨reducedf rom)𝑓𝑟𝑜𝑚p1 𝒑𝟏 ------—— HeadingHeading fusionfusion——------ σ2 𝑤 = PCA 13.13. wPCA = 2 2 σH+σPCA 2 14. w = σH 14. 𝑤H= σ2 +σ2 HPCA 15. θF = wH × θPCA + wPCA × θH 15. 𝜃 =𝑤 ×𝜃 +𝑤 ×𝜃 16. Return (θF) 16. Return (𝜃)

3.4. Step Length Estimation 3.4. Step Length Estimation For the step length estimation the model presented in [93] which is based on the For the step length estimation the model presented in [93] which is based on the Wein- Weinberg [81] model was adopted which is shown in Equation (13). A study of different berg [81] model was adopted which is shown in Equation (13). A study of different step step length estimation models presented in [99] shows that the Weinberg model with per- length estimation models presented in [99] shows that the Weinberg model with personal- sonalized set of constants—user and test defined parameters—outperforms other models. ized set of constants—user and test defined parameters—outperforms other models. The The Weinberg model utilizes the maximum and minimum accelerations in the step to es- Weinberg model utilizes the maximum and minimum accelerations in the step to estimate timatethe step the length step length based onbased a conversion on a conversion unit (K unit). The (K) method. The method introduced introduced in [93 ]in utilizes [93] uti- a lizesmodified a modified Weinberg Weinberg model wheremodel the where conversion the conv unitersion is adaptive unit is adaptive to increase to theincrease accuracy the accuracyof the estimation. of the estimation. The proposed The proposed adaptive adap conversiontive conversion unit is unit based is based on a second-order on a second- polynomialorder polynomial of the of estimated the estimated step velocity. step velocity. 𝐿 =𝐾 × 𝐴 − 𝐴 p4 (13) Lstep = Kstep × Amax − Amin (13)

Geomatics 2021, 1 166

where, Lstep is the step length, Kstep is the adaptive conversion unit, Amax is the maximum vertical acceleration in the step, and Amin is the minimum vertical acceleration in the step. The trajectory is then updated using the estimated heading angle and the step length, where the current position is the previous position plus the decomposed step length based on the heading as shown in Equations (14) and (15).

= + ( ) × PNorthi PNorthi−1 cos θF Lstep (14) = + × PEasti PEasti−1 sin(θF) Lstep (15)

4. Experimental Setup Testing was carried out using a Samsung S8 smartphone, while reference inertial measurements and solution was provided by the Xsens MTi G-710 which is considered to be a high-grade MEMS sensor with better performance than the MEMS sensor equipped in a smartphone. The Xsens Mti G-710 is reported to have a 10◦/h gyro bias stability, roll and pitch accuracy of 0.2◦ in static mode and 0.3◦ in dynamic mode, and azimuth of accuracy 0.8◦ when no magnetic distortion exist [100]. As a reference, the Xsens has an on-board processing option that provides a full navigation solution. The on-board processing provides full positional and attitude estimates that were used to recreate a PDR-based solution in comparison to the solution from S-PDR. The setup and device reference frames are presented in Figure 18. Magnetometer calibration to compensate for the cross magnetic field distortion of both devices was applied for each of the tests described below, and initial alignment between the devices was carried out to accurately project the solution and measurements of both devices to the same frame. First, each device was calibrated using the six-position static test for accelerometer calibration and using a precision rate table for gyroscope calibration. Once the smartphone sensors and Xsens sensor have been calibrated separately, the devices were attached as shown in Figure 18. For each of the tests described below, a 2-min spherical data window is collected before the test starts and is used for the magnetometer ellipsoid fitting calibration to compensate for the magnetic interference between the two devices. To find the misalignment between the two devices, static data for 20 min were collected from the devices while attached. The data were compensated for biases and scale factors derived from the calibration procedures and used to find the transformation matrix from each of the two devices to LLF. Note that the static data is collected every time the devices are detached and reattached to compensate for any alignment changes. Finally, the misalignment matrix between the two devices was derived by multiplying the two transformation matrices Xsense as shown in Equation (16). Where RLLF is the alignment matrix from LLF to the Xsens S8 frame, and RLLF is the alignment matrix from LLF to the Samsung S8 phone frame, and S8 RXSense is the resulting alignment matrix between the two devices.

−1 S8 S8  Xsense RXSense = RLLF ∗ RLLF (16)

Two tests were designed with preplanned trajectories to evaluate the performance of S-PDR under different conditions. The tests were designed to reflect the cases where GNSS is degraded or even denied such as indoor, or near buildings with high reflective surface structures. Sample set 1 takes place indoor on the second floor of Engineering G building (ENG) of University of Calgary, with the purpose of testing the effects of magnetic interference. The test trajectory is shown in Figure 19. Sample set 2 takes place outdoors beside a steel building structure between CCIT, Engineering D (END), and Engineering E (ENE) buildings on the University of Calgary campus, where the purpose is to test the feasibility of using S-PDR as an alternative to GNSS when the satellite signals will have a high error due to multipath and refraction while being used in a non-stable magnetic field. The trajectory is shown in Figure 20. Geomatics 2021, 1, FOR PEER REVIEW 19

where, 𝐿 is the step length, 𝐾 is the adaptive conversion unit, 𝐴 is the maxi- mum vertical acceleration in the step, and 𝐴 is the minimum vertical acceleration in the step. The trajectory is then updated using the estimated heading angle and the step length, where the current position is the previous position plus the decomposed step length based on the heading as shown in Equations (14) and (15).

𝑃 =𝑃 + cos(𝜃 )×𝐿 (14)

𝑃 =𝑃 +sin(𝜃)×𝐿 (15)

4. Experimental Setup Testing was carried out using a Samsung S8 smartphone, while reference inertial measurements and solution was provided by the Xsens MTi G-710 which is considered to be a high-grade MEMS sensor with better performance than the MEMS sensor equipped in a smartphone. The Xsens Mti G-710 is reported to have a 10°/h gyro bias stability, roll and pitch accuracy of 0.2° in static mode and 0.3° in dynamic mode, and azimuth of accu- racy 0.8° when no magnetic distortion exist [100]. As a reference, the Xsens has an on- board processing option that provides a full navigation solution. The on-board processing provides full positional and attitude estimates that were used to recreate a PDR-based solution in comparison to the solution from S-PDR. The setup and device reference frames are presented in Figure 18. Magnetometer cal- ibration to compensate for the cross magnetic field distortion of both devices was applied for each of the tests described below, and initial alignment between the devices was car- ried out to accurately project the solution and measurements of both devices to the same frame. First, each device was calibrated using the six-position static test for accelerometer calibration and using a precision rate table for gyroscope calibration. Once the smartphone sensors and Xsens sensor have been calibrated separately, the devices were attached as shown in Figure 18. For each of the tests described below, a 2-min spherical data window is collected before the test starts and is used for the magnetometer ellipsoid fitting calibration to compensate for the magnetic interference between the two devices. To find the misalignment between the two devices, static data for 20 min were collected from the devices while attached. The data were compensated for biases and scale factors derived from the calibration procedures and used to find the transformation matrix from each of the two devices to LLF. Note that the static data is collected every time the devices are detached and reattached to compensate for any alignment changes. Finally, the misa- lignment matrix between the two devices was derived by multiplying the two transfor- mation matrices as shown in Equation (16). Where 𝑅 is the alignment matrix from LLF to the Xsens frame, and 𝑅 is the alignment matrix from LLF to the Samsung S8 Geomatics 2021, 1 phone frame, and 𝑅 is the resulting alignment matrix between the two devices.167 𝑅 =𝑅 ∗ (𝑅 ) (16) GeomaticsGeomatics 2021 2021, ,1 1, ,FOR FOR PEER PEER REVIEW REVIEW 2020

TwoTwo tests tests were were designed designed with with preplanned preplanned traj trajectoriesectories to to evaluate evaluate the the performance performance of of S-PDRS-PDR underunder differentdifferent conditions.conditions. TheThe teststests werewere designeddesigned toto reflectreflect thethe casescases wherewhere GNSSGNSS isis degradeddegraded oror eveneven denieddenied suchsuch asas indoor,indoor, oror nearnear buildingsbuildings withwith highhigh reflectivereflective surfacesurface structures.structures. SampleSample setset 11 takestakes placeplace inindoordoor onon thethe secondsecond floorfloor ofof EngineeringEngineering GG buildingbuilding (ENG)(ENG) ofof UniversityUniversity ofof Calgary,Calgary, withwith thethe purposepurpose ofof testingtesting thethe effectseffects ofof mag-mag- neticnetic interference.interference. TheThe testtest trajectorytrajectory is is shown shown inin Figure Figure 19. 19. SampleSample setset 22 takestakes place place out-out- doorsdoors besidebeside aa steelsteel buildingbuilding structurestructure bebetweentween CCIT,CCIT, EngineeringEngineering DD (END),(END), andand Engi-Engi- neeringneering E E (ENE) (ENE) buildings buildings on on the the University University of of Calgary Calgary campus, campus, where where the the purpose purpose is is to to testtest the the feasibility feasibility of of using using S-PDR S-PDR as as an an alternative alternative to to GNSS GNSS when when the the satellite satellite signals signals will will havehave aa highhigh errorerror duedue toto multipathmultipath andand refractionrefraction whilewhile beingbeing usedused inin aa non-stablenon-stable mag-mag- FigureFigure 18. 18.Testing Testing device device configuration. configuration. neticnetic field. field. The The trajectory trajectory is is shown shown in in Figure Figure 20. 20.

FigureFigure 19. 19. Engineering Engineering G G (ENG) (ENG) building building trajectory. trajectory.

Figure 20. Outdoor trajectory. Figure 20. Outdoor trajectory.

5.5. ResultsResults andand DiscussionDiscussion InInIn thisthis this section,section, section, thethe the S-PDRS-PDR S-PDR systemsystem system willwill will bebe be evaluatedevaluated evaluated byby by comparingcomparing comparing thethe the finalfinal final trajectorytrajectory trajectory trackingtrackingtracking of ofof the the system system system to to to the the the true true true pre-deter pre-deter pre-determinedminedmined trajectory trajectory trajectory and and and compared compared compared to to a a PDR toPDR a PDRsolu-solu- solutiontiontion basedbased based onon onthethethe XsensXsens Xsens on-boardon-board on-board linearlinear linear acac accelerationscelerationscelerations andand and attitudeattitude estimates. estimates.estimates. The The PDRPDRPDR implementationimplementationimplementation usedused forforfor the thethe Xsens XsensXsens data datadata is isis based basedbased on onon [ [37].37[37].]. This ThisThis PDR PDRPDR implementation implementationimplementation was waswas selectedselected toto comparecomparecompare tototo forforfor its itsits use useuse of ofof classifiers, classificlassifiers,ers, integration integrationintegration of ofof magnetometer magnetometermagnetometer in inin attitude attitudeattitude andand heading heading estimation, estimation, andand and thethe the lack lack of of aiding aiding from from alternative alternative technologies. technologies. The The reported reported resultsresults ininin [ [37]37[37]] show showshow that thatthat the thethe implemented implementedimplemented classifier classifierclassifier has hashas high highhigh accuracy accuracyaccuracy in inin comparison comparisoncomparison to toto differentdifferent classificationclassification classification approaches approaches approaches making making making it it appealingit appealing appealing to to to compare compare compare to to asto as aas representationa a representation representation of ofof classifier-basedclassifier-based PDRPDR approaches.approaches. AdditionAdditionally,ally, thethe developeddeveloped PDRPDR usesuses thethe accelera-accelera- tionstions andand magnetometermagnetometer measurementsmeasurements periodicallyperiodically toto applyapply thethe attitudeattitude estimationestimation butbut

Geomatics 2021, 1 168

Geomatics 2021, 1, FOR PEER REVIEW 21

classifier-based PDR approaches. Additionally, the developed PDR uses the accelerations andlacks magnetometer magnetic interference measurements detection periodically and rejection, to apply and then the attitudeapply a PCA-based estimation approach but lacks magneticfor the heading interference estimation. detection Hence, and the rejection, compar andison then to this apply PDR a PCA-basedcan highlight approach the perfor- for themance heading difference estimation. between Hence, the different the comparison attitude to and this PCA PDR implementations. can highlight the performance difference between the different attitude and PCA implementations. 5.1. Indoor Test 5.1. Indoor Test The trajectory for this test set was planned indoor on the second floor of the Engi- The trajectory for this test set was planned indoor on the second floor of the Engi- neering ENG building at the University of Calgary. The trajectory was planned to make a neering ENG building at the University of Calgary. The trajectory was planned to make afull full loop loop around around a block a block of ofclasses classes to test to test the theAzimuth Azimuth estimation estimation as the as corridors the corridors are per- are perpendicularpendicular which which would would make make azimuth azimuth errors errors clear. clear. The The trajectory trajectory passes passes by multiplemultiple metal structures andand hashas highhigh magneticmagnetic interference.interference. A sample of the the results results from from S-PDR S-PDR and and Xsens Xsens for for the the planned planned trajectory trajectory is isshown shown in inFigure Figure 21. 21 The. The trajectory trajectory is approximately is approximately 293 293 m mlong long and and on onaverage average took took 420 420 steps steps to tocover cover with with an anaverage average step step length length of approximately of approximately 0.7 0.7m for m forregular regular walking, walking, and and370 370steps steps with with an average an average step step length length of approximately of approximately 0.8 for 0.8 forfastfast walking. walking. As shown As shown in the in thefigure, figure, the theS-PDR S-PDR provides provides a good a good solution solution in in comparison comparison to to the the trajectory trajectory constructedconstructed using the attitudes provided byby thethe Xsens.Xsens. TheThe trajectory constructed fromfrom thethe XsensXsens datadata uses itsits on-boardon-board computedcomputed attitudes attitudes to to transform transform the the on-board on-board gravity gravity compensated compensated linear lin- accelerationsear accelerations to LLF, to LLF, which which is then is usedthen forused step for detection, step detection, step heading step heading estimation estimation using PCA,using andPCA, step and length step length estimation estimation to compute to comp a PDRute a trajectoryPDR trajectory solution solution based based on [37 on]. [37]. The XsensThe Xsens attitudes attitudes suffered suffered from from high andhigh quickand qu driftick becausedrift because of magnetic of magnetic interference interference from thefrom surrounding the surrounding environment, environment, which which leads toleads higher to higher positional positional error. error.

Figure 21. ENG building reference trajectorytrajectory andand reconstructedreconstructed trajectorytrajectory usingusing S-PDRS-PDR andand Xsens.Xsens.

The results from thethe shownshown indoorindoor testtest samplesample showshow aa finalfinal positionalpositional errorerror ofof 6.36.3 mm forfor thethe S-PDR,S-PDR, whilewhile thethe XsensXsens trajectorytrajectory hadhad aa positionalpositional errorerror ofof 34.834.8 m.m. TheThe testtest waswas carried out 20 timestimes usingusing thethe SamsungSamsung S8S8 phonephone withwith thethe XsensXsens attachedattached toto itsits backback asas perper thethe configurationconfiguration shownshown inin FigureFigure 18 18.. The The results results for for the the 20 20 tests tests are are shown shown in inTable Table2 . Where2. Where the the final final positional positional error error is the is differencethe difference between between the true the positiontrue position of the of end the point end ofpoint the of trajectory the trajectory and the and estimated the estimated end position. end position. The averageThe average position position error error across across the trajectorythe trajectory is the is the average average error error at different at different stages stages of theof the trajectory trajectory based based on on land land markers mark- anders and targets targets with with known known locations locations across across the trajectory.the trajectory.

Geomatics 2021, 1 169

Table 2. Test results for indoor ENG building test.

Final Positional Error (m) Average Position Error across Trajectory Test # S-PDR Xsens MTi G-710 S-PDR Xsens MTi G-710 1 11.51 27.9 5.79 17.53 2 10.52 31.58 4.61 21.97 3 6.30 34.8 3.4 20.13 4 5.91 39.31 4.52 23.82 5 10.14 25.93 6.32 16.37 6 7.52 15.62 3.91 8.79 7 5.93 20.74 2.88 13.51 8 6.22 33.94 3.75 18.98 9 7.83 45.38 4.09 30.47 10 5.78 17.52 4.10 9.8 11 6.91 36.73 3.81 21.75 12 8.34 41.55 4.29 25.05 13 4.63 38.73 2.26 25.19 14 7.17 39.57 5.59 27.83 15 6.73 31.72 3.38 19.08 16 11.28 37.69 7.61 22.36 17 10.59 32.2 7.59 18.73 18 6.36 28.17 2.96 15.01 19 9.59 19.63 4.51 8.94 20 8.27 43.88 3.94 29.05 Avg Error 7.88 32.13 4.47 19.72 Min 4.63 15.62 2.26 8.79 Max 11.51 45.38 7.61 30.47 STD 2.06 8.77 1.45 6.38

The table shows that S-PDR outperforms the Xsens PDR solution. For the sake of comparison, the trajectories recreated using S-PDR and the Xsens data used the same estimated step length, this way the final error difference between the two systems will be representative of the errors in attitude and headings combined. The results show that the Xsens solution has high variability which is a result of the magnetic interference and instability. The tests were carried out on different days and at different times of the day so that the magnetic print of the place would change, and as shown it highly affects the results of the Xsens. On the other hand, the results for the S-PDR are consistent with low variation under the different surrounding environmental conditions and changes. The average final position error of the S-PDR was found to be much lower and more consistent than the Xsens, and the average position error through trajectory was also much lower than the Xsens as the S-PDR was able to track the trajectory with lower error for most of the trajectory. The analysis of the results presented in Table2 is shown as boxplots in Figure 22, where each box represents the one sigma confidence interval, the red line inside the box represents the median value, the upper and lower limits represent the maximum and minimum values respectively, and the plus sign represents outliers in the data. Geomatics 2021, 1, FOR PEER REVIEW 23

GeomaticsGeomatics 20212021, 1,, FOR1 PEER REVIEW 23170

Figure 22. Boxplot of the errors of S-PDR vs. Xsens for indoor test.

FigureFigure For22. 22. Boxplot theBoxplot case of of ofthe theS-PDR errors errors ofall ofS-PD the S-PDR Rtests vs. vs. Xsens had Xsens a for final for indoor indoor positional test. test. error ranging between 4.63 and 11.51 m, with one sigma confidence interval in the 5.9 to 10.02 m of error range. The averageForFor the duration the case case of of ofS-PDR this S-PDR test all all wasthe the tests3 testsmin had with had a final aan final average positional positional trajectory error error ranginglength ranging of between 290 between m, hence4.63 4.63 andtheand 11.51 relative 11.51 m, m, withfinal with positionone one sigma sigma error confidence confidence is found interval to interval be ranging in inthe the 5.9between 5.9 to to10.02 10.02 1.5% m mofto oferror3.5% error ofrange. range.the trajec- The The averagetory.average duration duration of ofthis this test test was was 3 min 3 min with with an an average average trajectory trajectory length length of of290 290 m, m, hence hence thethe relative relative final final position position error error is is found found to to be be ranging ranging between 1.5%1.5% toto 3.5%3.5%of of the the trajectory. trajec- tory.5.2. Outdoor Test 5.2. Outdoor Test The trajectory for this test was planned outdoor over a small, squared park found The trajectory for this test was planned outdoor over a small, squared park found 5.2.between Outdoor the Test CCIT, END, and ENG buildings at the University of Calgary. The small park between the CCIT, END, and ENG buildings at the University of Calgary. The small park is surroundedThe trajectory by formetal this and test glass was structures.planned outdoor The glass over structures a small, squaredcontribute park heavily found to is surrounded by metal and glass structures. The glass structures contribute heavily to betweenerrors in the GNSS CCIT, navigation END, and systems ENG buildings and would at the benefit University from aiding of Calgary. by an The alternative small park sys- errors in GNSS navigation systems and would benefit from aiding by an alternative system, istem, surrounded while the by metal metal structures and glass make structures. relying The on theglass magnetometer structures contribute solely for heavily estimating to while the metal structures make relying on the magnetometer solely for estimating the errorsthe azimuth in GNSS nearly navigation impossible systems due and to high would ma benefitgnetic interference.from aiding Aby sample an alternative of the results sys- azimuth nearly impossible due to high magnetic interference. A sample of the results tem,from while S-PDR the and metal Xsens structures for the makeplanned relying trajectory on the is magnetometer shown in Figure solely 23. Thefor estimatingtrajectory is from S-PDR and Xsens for the planned trajectory is shown in Figure 23. The trajectory is approximately 235 m long and on average took 340 steps to cover with an average step theapproximately azimuth nearly 235 impossible m long and due on to averagehigh ma tookgnetic 340 interference. steps to cover A sample with an of averagethe results step length of approximately 0.7 m for regular walking, and 295 steps with an average step fromlength S-PDR of approximatelyand Xsens for the 0.7 planned m for regular trajectory walking, is shown and in 295 Figure steps 23. with The an trajectory average stepis length of approximately 0.8 for fast walking. approximatelylength of approximately 235 m long 0.8and for on fast average walking. took 340 steps to cover with an average step length of approximately 0.7 m for regular walking, and 295 steps with an average step length of approximately 0.8 for fast walking.

FigureFigure 23. 23. OutdoorOutdoor reference reference trajectory trajectory and and reconstr reconstructeducted trajectory trajectory using using S-PDR S-PDR and and Xsens. Xsens.

Figure The23.The Outdoor results results referencefrom from the trajectory shown outdooroutdoor and reconstr testtestucted samplesamp trajectoryleshow show a usinga final final S-PDR positional positional and Xsens. error error of of 2.5 2.5 m mfor for the the S-PDR, S-PDR, while while the the Xsens Xsen reconstructeds reconstructed trajectory trajectory had had a positionala positional error error of of 38.32 38.32 m. m.The The test resultstest was was carried from carried the out shownout 20 times20 timesoutdoor using using test the th samesampe samele configuration show configuration a finalas positional thatas that ofthe oferror the indoor ofindoor 2.5 test mtest andfor andthe the S-PDR,the results results arewhile are shown the shown Xsen in Table ins reconstructedTable3. 3. trajectory had a positional error of 38.32 m. The test was carried out 20 times using the same configuration as that of the indoor test and the results are shown in Table 3.

Geomatics 2021, 1 171

Table 3. Test results for outdoor loop test.

Final Positional Error (m) Average Position Error across Trajectory Test # S-PDR Xsens MTi G-710 S-PDR Xsens MTi G-710 1 1.59 37.12 0.87 20.32 2 4.31 45.94 2.95 14.49 3 2.50 38.32 1.42 27.91 4 2.91 29.73 1.53 19.38 5 3.25 39.13 1.98 15.27 6 3.03 32.26 1.42 23.51 7 2.72 28.17 1.37 18.78 8 4.58 37.84 3.01 17.09 9 2.08 36.58 1.35 27.93 10 2.49 40.93 1.09 24.30 11 3.28 35.07 1.73 20.19 12 2.90 36.95 1.17 18.54 13 4.08 48.39 2.19 21.61 14 2.25 41.71 1.06 27.93 15 3.19 35.80 2.15 21.95 16 1.93 33.94 0.82 19.06 17 2.14 41.23 1.29 29.71 18 3.69 32.83 2.71 16.55 19 1.72 29.49 0.49 15.99 20 4.05 47.61 2.36 29.17 Avg Error 2.93 37.45 1.65 21.48 Min 1.59 28.17 0.49 14.49 Max 4.58 48.39 3.01 29.71 STD 0.88 5.72 0.71 4.89

Similar to the indoor test, the Xsens suffered from quick and high drift in attitudes that resulted in a high positional error. In this scenario, the magnetic interference was higher due to the large buildings metal structures surrounding the area where the tests were carried out. The attitudes derived from the Xsens on-board sensor fusion algorithm suffered from high drift resulting in poor tracking. On the other hand, the results show that S-PDR was once more consistent even with the magnetic interference due to the rejection criteria and the adaptive fusion technique it utilizes for azimuth estimation. The analysis of the results presented in Table3 is shown as boxplots in Figure 24. For the case of S-PDR all the tests had a final positional error ranging between 1.59 and 4.58 m, with one sigma confidence interval in the 2.1 to 3.86 m of error range. The average duration of this test was 2 min with an average trajectory length of 230 m, hence the relative final position error is found to be ranging between 0.5% to 2.17% of the trajectory. Although the errors are lower than the indoor case, they are consistent as this trajectory was shorter and the errors increase at a higher rate as the duration of the navigation is prolonged. The findings of this test are crucial for the case of urban canyons where GNSS signals are hindered, and AHRS-based tracking suffers from magnetic interference and results in a high positional error. The S-PDR system developed was able to track the position while reducing the attitude drift and positional error, and being resistive to magnetic interference. GeomaticsGeomatics 20212021, 1,, FOR1 PEER REVIEW 25172

FigureFigure 24. 24.BoxplotBoxplot of the of the errors errors of S-PDR of S-PDR vs. vs.Xsens Xsens for foroutdoor outdoor test. test.

6. ConclusionsFor the case of S-PDR all the tests had a final positional error ranging between 1.59 and 4.58PDR m, with systems one suffersigma from confidence the inherent interval drift in inthe INS-based 2.1 to 3.86 navigation m of error makingrange. The them averagereliable duration for a limited of this time test and was requiring 2 min with aid byan otheraverage technologies trajectory tolength correct of and230 compensatem, hence thefor relative the errors. final position The aim error of this is article found isto to be present ranging a between novel and 0.5% enhanced to 2.17% PDR of the system trajec- that tory.can Although provide a the positional errors are solution lower withthan acceptablethe indoor accuracycase, they for are a consistent prolonged as operation this trajec- time. toryBy was enhancing shorter theand performance the errors increase of PDR, at the a hi complexitygher rate as of the aiding duration and frequencyof the navigation by which is itprolonged. is needed The can findings be reduced. of this The test developed are crucial system for the under case theof urban name S-PDRcanyons utilizes: where a GNSSrobust signals step detectionare hindered, technique and AHRS-based invariant to trac motionking mode suffers and from smartphone magnetic useinterference case that is andcapable results of in detecting a high positional steps with error. high The accuracy, S-PDR accountsystem developed for misdetection, was able and to can track validate the positionsteps; while an attitude reducing correction the attitude method drift thatand canpositional be applied error, frequentlyand being resistive without to imposing mag- neticusage interference. or motion constraints, that helps eliminate drift in attitude angles by exploiting user motion patterns and behavior; an enhanced PCA-based heading estimation that combines 6. Conclusionsstatistical analysis information from the in-step accelerations window, and accelerations outlier rejection to improve the accelerations correlation representative of motion direction. PDR systems suffer from the inherent drift in INS-based navigation making them Test results show that S-PDR can successfully track the position changes of the pedestrian reliable for a limited time and requiring aid by other technologies to correct and compen- with a low final positional error usually below 6 m after 3 min of operation and meter level sate for the errors. The aim of this article is to present a novel and enhanced PDR system average positional error through most of the trajectory. This would have not been feasible thatif can not forprovide an accurate a positional step detection,solution with low acceptable error attitudes accuracy that for do a not prolonged drift over operation time, and time.accurate By enhancing heading estimationthe performance that can of successfullyPDR, the complexity track the directionof aiding ofand motion frequency of the by user. whichThis it positional is needed accuracycan be reduced. makes The S-PDR developed a viable system short-term under solution the name for S-PDR positioning utilizes: and a robustlocalization step detection indoors and technique can be usedinvariant for aiding to motion GNSS mode in urban and canyons smartphone where use GNSS casesignals that is capableare degraded of detecting or blocked. steps The with increased high accu reliabilityracy, account of the solutionfor misdetection, impacts the and complexity can vali- of dateaiding steps; requirements an attitude correction such as Wi-Fi method fingerprinting that can be and applied magnetic frequently map matching without where: imposing lower usagedata or resolution motion constraints, is needed—fewer that helps data eliminat pointse todrift be in surveyed—which attitude angles by decreases exploiting memory user motionrequirements patterns and and behavior; surveying an time, enhanced less frequentPCA-based corrections heading estimation are needed that and combines improves statisticalreal-time analysis processing. information from the in-step accelerations window, and accelerations outlier rejection to improve the accelerations correlation representative of motion direc- tion.Author Test Contributions:results show thatM.K. S-PDR developed can thesuccess methodology,fully track designed the position the experiments, changes of analyzed the pe- the destriandata, and with wrote a low the final paper; positional N.E.-S. reviewed error usually the methodology, below 6 m verified after 3 the min results, of operation and revised and the meterpaper. level All average authors have positional read and error agreed through to the publishedmost of the version trajectory. of the manuscript. This would have not beenFunding: feasibleThis if not research for an wasaccurate funded step by detect Nasserion, El-Sheimy low error from attitudes NSERC that and doCanada not drift Research over time,Chairs and programs. accurate heading estimation that can successfully track the direction of motion of the user. This positional accuracy makes S-PDR a viable short-term solution for posi- Institutional Review Board Statement: Not applicable. tioning and localization indoors and can be used for aiding GNSS in urban canyons where GNSSInformed signals Consent are degraded Statement: orNot blocked. applicable. The increased reliability of the solution impacts theData complexity Availability of aiding Statement: requirementsData will be such shared as upon Wi-Fi request. fingerprinting and magnetic map matching where: lower data resolution is needed—fewer data points to be surveyed—

Geomatics 2021, 1 173

Acknowledgments: This research is under the supervision, support and funding of Nasser El-Sheimy. The authors thank the handling editor and anonymous reviewers for providing constructive remarks. Conflicts of Interest: The authors declare no conflict of interest.

References 1. Bräunl, T. Localization and Navigation. In Embedded Robotics; Springer: Heidelberg, Germany, 2008; pp. 241–269. 2. Noureldin, A.; Karamat, T.B.; Georgy, J. Fundamentals of Inertial Navigation, Satellite-Based Positioning and Their Integration; Springer: Berlin, Germany, 2013; ISBN 9783642447907. 3. Misra, P.; Enge, P. Global Positioning Systems: Signals, Measurements, and Performance, 2nd ed.; Ganga-Jamuna: Lincoln, MA, USA, 2010; ISBN 0970954417. 4. Grewal, M.S.; Weill, L.R.; Lawrence, R.; Andrews, A.P. Global Positioning Systems, Inertial Navigation, and Integration; Wiley- Interscience: Hoboken, NJ, USA, 2007; ISBN 9780470099711. 5. Hofmann-Wellenhof, B.; Legat, K.; Wieser, M. Navigation: Principles of Positioning and Guidance; Springer: Vienna, Austria, 2003; ISBN 9783709160787. 6. Salychev, O.S.; Oleg, S. Applied Inertial Navigation: Problems and Solutions; BMSTU Press: Moscow, Russia, 2004; ISBN 5703823951. 7. Greiff, P.; Boxenhorn, B.; King, T.; Niles, L. Silicon monolithic micromechanical gyroscope. In Proceedings of the TRANSDUCERS ’91: 1991 International Conference on Solid-State Sensors and Actuators. Digest of Technical Papers, San Francisco, CA, USA, 24–27 June 1991; pp. 966–968. [CrossRef] 8. Kourepenis, A.; Borenstein, J.; Connelly, J.; Elliott, R.; Ward, P.; Weinberg, M. Performance of MEMS inertial sensors. In Proceedings of the Position Location and Navigation Symposium (Cat. No.98CH36153), Palm Springs, CA, USA, 20–23 April 1996; pp. 1–8. [CrossRef] 9. El-Sheimy, N.; Niu, X. The promise of MEMS to the navigation community. Insid. Gnss 2007, 2, 46–56. 10. Davidson, P.; Vazquez, M.A.; Piche, R. Uninterrupted portable car navigation system using GPS, map and inertial sensors data. In Proceedings of the 2009 IEEE 13th International Symposium on Consumer Electronics, Kyoto, Japan, 25–28 May 2009; pp. 836–840. 11. Huang, C.; Liao, Z.; Zhao, L. Synergism of INS and PDR in Self-Contained Pedestrian Tracking with a Miniature Sensor Module. IEEE Sens. J. 2010, 10, 1349–1359. [CrossRef] 12. Tazartes, D. An historical perspective on inertial navigation systems. In Proceedings of the 2014 International Symposium on Inertial Sensors and Systems (ISISS), Laguna Beach, CA, USA, 25–26 February 2014; pp. 1–5. 13. Qian, W.-X.; Zeng, Q.-H.; Wan, J.-W.; Xiong, Z. Pedestrian navigation method based on kinematic mechanism of human lower limb. Zhongguo Guanxing Jishu Xuebao/J. Chin. Inert. Technol. 2015, 23, 24–28. 14. Renaudin, V.; Yalak, O.; Tomé, P.; Merminod, B. Indoor Navigation of Emergency Agents. Eur. J. Navig. Sci. 2007, 5, 36–45. 15. Cheema, M.A. Indoor location-based services: Challenges and Opportunities. Sigspatial Spec. 2018, 10, 10–17. [CrossRef] 16. Nokia Mobile. Mobile Location Services; Nokia Mobile: Espoo, Finland, 2001. 17. IMU and INS–VectorNav Library. Available online: https://www.vectornav.com/support/library/imu-and-ins (accessed on 10 November 2020). 18. Zupt Inertial Survey Technology. Available online: https://www.zupt.com/inertial-technology/ (accessed on 9 November 2020). 19. Ojeda, L.; Borenstein, J. Non-GPS navigation for security personnel and first responders. J. Navig. 2007, 60, 391–407. [CrossRef] 20. Rajagopal, S. Personal Dead Reckoning System with Shoe Mounted Inertial Sensors. Master’s Thesis, KTH Royal Institute of Technology, Stockholm, Sweden, 2008. 21. Zampella, F.; Khider, M.; Robertson, P.; Jimnez, A. Unscented Kalman filter and Magnetic Angular Rate Update (MARU) for an improved Pedestrian Dead-Reckoning. In Proceedings of the 2012 IEEE/ION Position, Location and Navigation Symposium, Myrtle Beach, SC, USA, 23–26 April 2012; pp. 129–139. [CrossRef] 22. Borenstein, J.; Ojeda, L.; Kwanmuang, S. Heuristic Reduction of Gyro Drift for Personnel Tracking Systems. J. Navig. 2009. [CrossRef] 23. Ojeda, L.; Borenstein, J. Personal Dead-reckoning System for GPS-denied Environments. In Proceedings of the 2007 IEEE International Workshop on Safety, Security and Rescue Robotics, Rome, Italy, 27–29 September 2007; pp. 1–6. 24. Rose, J.; Gamble, J.G. Human Walking; Lippincott Williams and Wilkins: Philadelphia, PA, USA, 2006; ISBN 9780781759540. 25. Do, T.N.; Suh, Y.S. Gait analysis using floor markers and inertial sensors. Sensors 2012, 12, 1594–1611. [CrossRef] 26. Parry, J. Gait Analysis Normal and Pathological Function; SLACK: Thorofare, NJ, USA, 1992; ISBN 9781556421921. 27. Khedr, M.E.; El-Sheimy, N. SBAUPT: Azimuth SBUPT for frequent full attitude correction of smartphone-based PDR. IEEE Sens. J. 2020, 1. [CrossRef] 28. Shin, S.H. New Map-Matching Algorithm Using Virtual Track for Pedestrian Dead Reckoning. Etri J. 2010, 32, 891–900. [CrossRef] 29. Huang, Y.; Zheng, H.; Nugent, C.; McCullagh, P.; McDonough, S.M.; Tully, M.A.; Connor, S.O. Activity monitoring using an intelligent mobile phone–A Validation Study. In Proceedings of the 3rd International Conference on Pervasive Technologies Related to Assistive Environments–PETRA ’10, Samos, Greece, 23–25 June 2010; p. 1. 30. Xu, L.; Xiong, Z.; Zhao, R. An indoor pedestrian navigation algorithm based on smartphone mode recognition. In Proceedings of the 2019 IEEE 3rd Information Technology, Networking, Electronic and Automation Control Conference, ITNEC 2019, Chengu, China, 15–17 March 2019; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2019; pp. 831–835. 31. Lee, H.H.; Choi, S.; Lee, M.J. Step detection robust against the dynamics of smartphones. Sensors 2015, 15, 27230–27250. [CrossRef] Geomatics 2021, 1 174

32. Tian, Q.; Salcic, Z.; Wang, K.I.-K.; Pan, Y. A Multi-Mode Dead Reckoning System for Pedestrian Tracking Using Smartphones. IEEE Sens. J. 2016, 16, 2079–2093. [CrossRef] 33. Kupke, J.; Willemsen, T.; Keller, F.; Sternberg, H. Development of a step counter based on artificial neural networks. J. Locat. Based Serv. 2016, 10, 161–177. [CrossRef] 34. Susi, M.; Renaudin, V.; Lachapelle, G. Motion mode recognition and step detection algorithms for mobile phone users. Sensors 2013, 13, 1539–1562. [CrossRef] 35. Kammoun, S.; Pothin, J.B.; Cousin, J.C. An efficient fuzzy logic step detection algorithm for unconstrained smartphones. In Proceedings of the IEEE International Symposium on Personal, Indoor and Mobile Radio Communications, PIMRC, Hong Kong, China, 31 August–3 September 2015. 36. Park, S.Y.; Heo, S.J.; Park, C.G. Accelerometer-based smartphone step detection using machine learning technique. In Proceedings of the International Electrical Engineering Congress, IEECON 2017, New York, NY, USA, 10 March 2017; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2017. 37. Wang, B.; Liu, X.; Yu, B.; Jia, R.; Gan, X. Pedestrian dead reckoning based on motion mode recognition using a smartphone. Sensors 2018, 18, 1811. [CrossRef][PubMed] 38. Zhang, H.; Yuan, W.; Shen, Q.; Li, T.; Chang, H. A handheld inertial pedestrian navigation system with accurate step modes and device poses recognition. IEEE Sens. J. 2015, 15, 1421–1429. [CrossRef] 39. Edel, M.; Koppe, E. An advanced method for pedestrian dead reckoning using BLSTM-RNNs. In Proceedings of the 2015 International Conference on Indoor Positioning and Indoor Navigation, IPIN 2015, Banff, AB, Canada, 3–16 October 2015; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2015. 40. Ozcan, K.; Velipasalar, S. Robust and Reliable Step Counting by Mobile Phone Cameras. In Proceedings of the 9th International Conference on Distributed Smart Cameras, Seville, Spain, 8–11 September 2015; pp. 164–169. [CrossRef] 41. Marouane, C.; Ebert, A.; Linnhoff-Popien, C.; Christil, M. Step and activity detection based on the orientation and scale attributes of the SURF algorithm. In Proceedings of the 2016 International Conference on Indoor Positioning and Indoor Navigation (IPIN), Alcala de Henares, Spain, 4–7 October 2016; pp. 1–8. 42. Aubeck, F.; Isert, C.; Gusenbauer, D. Camera based step detection on mobile phones. In Proceedings of the 2011 International Conference on Indoor Positioning and Indoor Navigation, IPIN 2011, Guimaraes, Portugal, 21–23 September 2011. 43. Torteeka, P.; Chundi, X.; Dongkai, Y. Hybrid technique for indoor positioning system based on Wi-Fi received signal strength indication. In Proceedings of the 2014 International Conference on Indoor Positioning and Indoor Navigation (IPIN), Busan, Korea, 27–30 October 2014; pp. 48–57. 44. Diaz, E.M.; De Ponte Muller, F.; Jimenez, A.R.; Zampella, F. Evaluation of AHRS algorithms for inertial personal localization in industrial environments. In Proceedings of the IEEE International Conference on Industrial Technology, Seville, Spain, 17–19 March 2015; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2015; Volume 2015, pp. 3412–3417. 45. Euston, M.; Coote, P.; Mahony, R.; Kim, J.; Hamel, T. A complementary filter for attitude estimation of a fixed-wing UAV. In Proceedings of the 2008 IEEE/RSJ International Conference on Intelligent and Systems, IROS, Nice, France, 22–26 September 2008; pp. 340–345. 46. Madgwick, S.O.H.; Harrison, A.J.L.; Vaidyanathan, R. Estimation of IMU and MARG orientation using a gradient descent algorithm. In Proceedings of the 2011 IEEE International Conference on Rehabilitation Robotics, Zurich, Switzerland, 29 June 2011; pp. 1–7. 47. Mizell, D. Using Gravity to Estimate Accelerometer Orientation; IEEE: White Plains, NY, USA, 2003. 48. Xiao, Z.; Wen, H.; Markham, A.; Trigoni, N. Robust Indoor Positioning with Lifelong Learning. IEEE J. Sel. Areas Commun. 2015, 33, 2287–2301. [CrossRef] 49. Xiao, Z.; Wen, H.; Markham, A.; Trigoni, N. Robust pedestrian dead reckoning (R-PDR) for arbitrary mobile device placement. In Proceedings of the 2014 International Conference on Indoor Positioning and Indoor Navigation (IPIN), Busan, Korea, 27–30 October 2014; pp. 187–196. [CrossRef] 50. Diaz, E.M.; Gonzalez, A.L.M.; De Ponte Müller, F. Standalone Inertial Pocket Navigation System. In Proceedings of the Record– IEEE PLANS, Position Location and Navigation Symposium, Monterey, CA, USA, 5–8 May 2014; Institute of Electrical and Electronics Engineers Inc.: New York, NY, USA, 2014; pp. 241–251. 51. Yadav, N.; Bleakley, C. Accurate orientation estimation using AHRS under conditions of magnetic distortion. Sensors 2014, 14, 20008–20024. [CrossRef] 52. Daponte, P.; De Vito, L.; Rapuano, S.; Riccio, M.; Picariello, F. Compensating magnetic disturbances on MARG units by means of a low complexity data fusion algorithm. In Proceedings of the 2015 IEEE International Symposium on Medical Measurements and Applications, MeMeA, New York, NY, USA, 4–5 May 2015; pp. 157–162. 53. Ma, M.; Song, Q.; Gu, Y.; Zhou, Z. Use of magnetic field for mitigating gyroscope errors for indoor pedestrian positioning. Sensors 2018, 18, 2592. [CrossRef] 54. Li, Y.; Georgy, J.; Niu, X.; Goodall, C.; El-sheimy, N. An Automatic Multi-level Gyro Calibration Architecture for Consumer Portable Devices. In Proceedings of the International Conference on Indoor Positioning and Indoor Navigation (IPIN), Busan, Korea, 27–30 October 2014. 55. Li, Y.; Georgy, J.; Niu, X.; Li, Q.; El-Sheimy, N. Autonomous Calibration of MEMS Gyros in Consumer Portable Devices. IEEE Sens. J. 2015, 15, 4062–4072. [CrossRef] Geomatics 2021, 1 175

56. Ruotsalainen, L.; Bancroft, J.; Lachapelle, G. Mitigation of attitude and gyro errors through vision aiding. In Proceedings of the 2012 International Conference on Indoor Positioning and Indoor Navigation (IPIN), Sydney, Australia, 13–15 November 2016; pp. 1–9. 57. Antigny, N.; Servieres, M.; Renaudin, V. Hybrid visual and inertial position and orientation estimation based on known urban 3D models. In Proceedings of the 2016 International Conference on Indoor Positioning and Indoor Navigation (IPIN), Alcala de Henares, Spain, 4–7 October 2016; pp. 1–8. 58. Del Rosario, M.B.; Lovell, N.H.; Redmond, S.J. Quaternion-Based Complementary Filter for Attitude Determination of a Smartphone. IEEE Sens. J. 2016, 16, 6008–6017. [CrossRef] 59. Fourati, H. Heterogeneous data fusion algorithm for pedestrian navigation via foot-mounted inertial measurement unit and complementary filter. IEEE Trans. Instrum. Meas. 2015, 64, 221–229. [CrossRef] 60. Renaudin, V.; Combettes, C. Magnetic, Acceleration Fields and Gyroscope Quaternion (MAGYQ)-Based Attitude Estimation with Smartphone Sensors for Indoor Pedestrian Navigation. Sensors 2014, 14, 22864–22890. [CrossRef] 61. Yean, S.; Lee, B.S.; Yeo, C.K.; Vun, C.H.; Oh, H.L. Smartphone Orientation Estimation Algorithm Combining With Gradient Descent. IEEE J. Biomed. Heal. Inf. 2018, 22, 1421–1433. [CrossRef] 62. Liu, D.; Pei, L.; Qian, J.; Wang, L.; Liu, P.; Dong, Z.; Xie, S.; Wei, W. A novel heading estimation algorithm for pedestrian using a smartphone without attitude constraints. In Proceedings of the 4th International Conference on Ubiquitous Positioning, Indoor Navigation and Location-Based Services–UPINLBS 2016, Shanghai, China, 2–4 November 2016; Institute of Electrical and Electronics Engineers Inc.: Piscataway, NJ, USA, 2017; pp. 29–37. 63. Lee, J.S.; Huang, S.M. An Experimental Heuristic Approach to Multi-Pose Pedestrian Dead Reckoning Without Using Magne- tometers for Indoor Localization. IEEE Sens. J. 2019, 19, 9532–9542. [CrossRef] 64. Deng, Z.A.; Wang, G.; Hu, Y.; Wu, D. Heading estimation for indoor pedestrian navigation using a smartphone in the pocket. Sensors 2015, 15, 21518–21536. [CrossRef] 65. Deng, Z.; Si, W.; Qu, Z.; Liu, X.; Na, Z. Heading estimation fusing inertial sensors and landmarks for indoor navigation using a smartphone in the pocket. Eurasip J. Wirel. Commun. Netw. 2017, 2017, 160. [CrossRef] 66. Kourogi, M.; Kurata, T. Personal positioning based on walking locomotion analysis with self-contained sensors and a wearable camera. In Proceedings of the 2nd IEEE and ACM International Symposium on Mixed and Augmented Reality, ISMAR 2003, Tokyo, Japan, 10 October 2003; pp. 103–112. 67. Kunze, K.; Lukowicz, P.; Partridge, K.; Begole, B. Which way am I facing: Inferring horizontal device orientation from an accelerometer signal. In Proceedings of the 2009 International Symposium on Wearable Computers, Linz, Austria, 4–7 September 2009; pp. 149–150. [CrossRef] 68. Bojja, C.; Parviainen, J.; Collin, J.; Hellevaara, J.; Käppi, R.; Alanen, J.; Takala, K. Robust Misalignment Handling in Pedestrian Dead Reckoning. In Proceedings of the 2016 IEEE 84th Vehicular Technology Conference (VTC-Fall), Montreal, QC, Canada, 18–21 September 2016. [CrossRef] 69. Bao, H.; Wong, W.C. Improved PCA based step direction estimation for dead-reckoning localization. In Proceedings of the 2013 International Conference on Cyber-Enabled Distributed Computing and Knowledge Discovery, CyberC 2013, Washington, DC, USA, 10–12 October 2013; pp. 325–331. 70. Yang, X.; Huang, B.; Miao, Q. A step-wise algorithm for heading estimation via a smartphone. In Proceedings of the 28th Chinese Control and Decision Conference, CCDC 2016, Yinchuan, China, 26–28 May 2016; pp. 4598–4602. 71. Shin, B.; Lee, S.; Kim, C.; Kim, J.; Lee, T.; Kee, C.; Heo, S.; Rhee, H. Implementation and performance analysis of smartphone-based 3D PDR system with hybrid motion and heading classifier. In Proceedings of the Record–IEEE PLANS, Position Location and Navigation Symposium, Monserey, CA, USA, 5–8 May 2014; pp. 201–204. 72. Knauth, S. Smartphone PDR positioning in large environments employing WiFi, particle filter, and backward optimization. In Proceedings of the 2017 International Conference on Indoor Positioning and Indoor Navigation, IPIN 2017, Sapporo, Japan, 18–21 September 2017; Institute of Electrical and Electronics Engineers Inc.: Piscataway, NJ, USA, 2017; Volume 2017, pp. 1–6. 73. Moder, T.; Wisiol, K.; Hafner, P.; Wieser, M. Smartphone-based indoor positioning utilizing motion recognition. In Proceedings of the 2015 International Conference on Indoor Positioning and Indoor Navigation, IPIN, Banff, AB, Canada, 13–16 October 2015. 74. Li, Y.; Lan, H.; Zhuang, Y.; Zhang, P.; Niu, X.; El-Sheimy, N. Real-time attitude tracking of mobile devices. In Proceedings of the International Conference on Indoor Positioning and Indoor Navigation IPIN, Banff, AB, Canada, 13–16 October 2015; Volume 13–16. [CrossRef] 75. Li, Y.; Niu, X.; Zhang, P.; Lan, H.; Zhuang, Y.; El-sheimy, N. Smartphone-based Indoor Navigation using PDR and Magnetic Matching. In Proceedings of the 28th International Technical Meeting of the Satellite Division of the Institute of Navigation, Nashville, TN, USA, 16–20 September 2015; pp. 2060–2066. 76. Li, Y.; Zhang, P.; Lan, H.; Zhuang, Y.; Niu, X.; El-Sheimy, N. A modularized real-time indoor navigation algorithm on smartphones. In Proceedings of the International Conference on Indoor Positioning and Indoor Navigation, Zurich, Switzerland, 15–17 September 2010; pp. 13–16. [CrossRef] 77. Li, Y.; Zhuang, Y.; Lan, H.; Zhang, P.; Niu, X.; El-Sheimy, N. WiFi-aided magnetic matching for indoor navigation with consumer portable devices. Micromachines 2015, 6, 747–764. [CrossRef] Geomatics 2021, 1 176

78. Shin, S.H.; Park, C.G.; Kim, J.W.; Hong, H.S.; Lee, J.M. Adaptive Step Length Estimation Algorithm Using Low-Cost MEMS Inertial Sensors. In Proceedings of the 2007 IEEE Sensors Applications Symposium, Atlanta, GA, USA, 28–31 October 2007; pp. 1–5. [CrossRef] 79. Abadleh, A.; Al-Hawari, E.; Alkafaween, E.; Al-Sawalqah, H. Step detection algorithm for accurate distance estimation using dynamic step length. In Proceedings of the18th IEEE International Conference on Mobile Data Management, MDM 2017, Daejeon, Korea, 29 May–1 June 2017; pp. 324–328. 80. Kim, J.W.; Jang, H.J.; Hwang, D.-H.; Park, C. A Step, Stride and Heading Determination for the Pedestrian Navigation System; Scientific Research Publishing: Wuhan, China, 2004; Volume 3. 81. Weinberg, H. Using the ADXL202 in Pedometer and Personal Navigation Applications; Analog Devices Inc.: Norwood, MA, USA, 2002. 82. Way, O.T.; Scarlett, J. Enhancing the Performance of Pedometers Using a Single Accelerometer; Application Note an-900; Analog Devices Inc.: Norwood, MA, USA, 2007. 83. LEVI. Robert Dead Reckoning Navigational System Using Accelerometer to Measure Foot Impacts. U.S. Patent No. 5,583,776, 10 December 1996. 84. Li, F.; Zhao, C.; Ding, G.; Gong, J.; Liu, C.; Zhao, F. A Reliable and accurate indoor localization method using phone inertial sensors. In Proceedings of the 2012 ACM Conference on Ubiquitous Computing, Association for Computing, Pittsburg, PA, USA, 5–8 September 2012; pp. 421–430. 85. Renaudin, V.; Susi, M.; Lachapelle, G. Step Length Estimation Using Handheld Inertial Sensors. Sensors 2012, 12, 8507–8525. [CrossRef][PubMed] 86. Lee, S.W.; Mase, K. Recognition on walking behaviors for pedestrian navigation. In Proceedings of the IEEE Conference on Control Applications, New Orleans, LA, USA, 4–7 November 2001; pp. 1152–1155. 87. Pepa, L.; Marangoni, G.; Di Nicola, M.; Ciabattoni, L.; Verdini, F.; Spalazzi, L.; Longhi, S. Real Time Step Length Estimation on Smartphone. In Proceedings of the 2016 IEEE International Conference on Consumer Electronics (ICCE), Nantou, Taiwan, 27–29 May 2016; pp. 315–316. [CrossRef] 88. González, R.C.; Alvarez, D.; López, A.M.; Alvarez, J.C. Modified pendulum model for mean step length estimation. In Proceedings of the Annual International Conference of the IEEE Engineering in Medicine and Biology, New Orleans, LA, USA, 20 February 2007; pp. 1371–1374. 89. Wang, Q.; Ye, L.; Luo, H.; Men, A.; Zhao, F.; Huang, Y. Pedestrian stride-length estimation based on LSTM and denoising autoencoders. Sensors 2019, 19, 840. [CrossRef][PubMed] 90. Gu, F.; Khoshelham, K.; Yu, C.; Shang, J. Accurate Step Length Estimation for Pedestrian Dead Reckoning Localization Using Stacked Autoencoders. IEEE Trans. Instrum. Meas. 2019, 68, 2705–2713. [CrossRef] 91. Liu, Y.; Chen, Y.; Shi, L.; Tian, Z.; Zhou, M.; Li, L. Accelerometer based joint step detection and adaptive step length estimation algorithm using handheld devices. J. Commun. 2015, 10, 520–525. [CrossRef] 92. Shin, B.; Kim, C.; Kim, J.H.; Lee, S.; Kee, C.; Lee, T. Hybrid Model–Based Motion Recognition for Smartphone Users. Etri J. 2014, 36, 1016–1022. [CrossRef] 93. Ho, N.H.; Truong, P.H.; Jeong, G.M. Step-detection and adaptive step-length estimation for pedestrian dead-reckoning at variouswalking speeds using a smartphone. Sensors 2016, 16, 1423. [CrossRef] 94. Sun, Y.; Wu, H.; Schiller, J. A Step Length Estimation Model for Position Tracking. In Proceedings of the 2015 International Conference on Localization and GNSS (ICL-GNSS), Turin, Italy, 25–27 June 2015; Institute of Electrical and Electronics Engineers: New York, NY, USA, 2015. 95. Lee, J.H.; Shin, B.; Lee, S.; Hun, J.; Kim, C.; Lee, T.; Park, J.; Recognition, A.M. Motion based Adaptive Step Length Estimation using Smartphone. In Proceedings of the 18th IEEE International Symposium on Consumer Electronics (ISCE 2014), Jeju, Korea, 22–25 June 2014; pp. 1–2. [CrossRef] 96. Qian, J.; Pei, L.; Zou, D.; Qian, K.; Liu, P. Optical flow based step length estimation for indoor pedestrian navigation on a smartphone. In Proceedings of the Record–IEEE PLANS, Position Location and Navigation Symposium, Monterey, CA, USA, 5–8 May 2014. 97. Khedr, M.; El-Sheimy, N. A smartphone step counter using IMU and magnetometer for navigation and health monitoring applications. Sensors 2017, 17, 2573. [CrossRef][PubMed] 98. Khedr, M.E.; Radi, A.; El-Sheimy, N. Step-Based Attitude Update (SBUPT) Technique for Pedestrian Dead Reckoning (PDR) using Handheld Devices. In Proceedings of the ION 2019 Pacific PNT Meeting, Honolulu, HI, USA, 8–11 April 2019; pp. 582–593. 99. Vezocnik, M.; Juric, M.B. Average Step Length Estimation Models’ Evaluation Using Inertial Sensors: A Review. IEEE Sens. J. 2019, 19, 396–403. [CrossRef] 100. MTi 100-Series. Available online: https://www.xsens.com/products/mti-100-series (accessed on 4 December 2020).