Use of Earth’s Magnetic Field for Mitigating Gyroscope Errors Regardless of Magnetic Perturbation

Most portable systems like smart-phones are equipped with low cost consumer grade sensors, making them useful as Pedestrian Navigation Systems (PNS). Measurements of these sensors are severely contaminated by errors caused due to instrumentation and environmental issues rendering the unaided navigation solution with these sensors of limited use. The overall navigation error budget associated with pedestrian navigation can be categorized into position/displacement errors and attitude/orientation errors. Most of the research is conducted for tackling and reducing the displacement errors, which either utilize Pedestrian Dead Reckoning (PDR) or special constraints like Zero velocity UPdaTes (ZUPT) and Zero Angular Rate Updates (ZARU). This article targets the orientation/attitude errors encountered in pedestrian navigation and develops a novel sensor fusion technique to utilize the Earth’s magnetic field, even perturbed, for attitude and rate gyroscope error estimation in pedestrian navigation environments where it is assumed that Global Navigation Satellite System (GNSS) navigation is denied. As the Earth’s magnetic field undergoes severe degradations in pedestrian navigation environments, a novel Quasi-Static magnetic Field (QSF) based attitude and angular rate error estimation technique is developed to effectively use magnetic measurements in highly perturbed environments. The QSF scheme is then used for generating the desired measurements for the proposed Extended Kalman Filter (EKF) based attitude estimator. Results indicate that the QSF measurements are capable of effectively estimating attitude and gyroscope errors, reducing the overall navigation error budget by over 80% in urban canyon environment.


Introduction
The provision to pedestrians of location and orientation information, which in some way can be used for simplifying the task of reaching a particular destination, is called pedestrian navigation. The versatility of environments in which the pedestrian navigation system has to work, differentiates it from land vehicle, sea vessel and aircraft navigation. Of all the possible environments in which the PNS has to work, the urban and indoor environments are the most challenging ones. These challenges arise from the amount and reliability of information available for estimating the navigation parameters. This diversity of environment for pedestrian navigation imposes the use of self-contained sensors for navigation that can provide users with navigation parameters irrespective of the availability of external aids.

Pedestrian Navigation Techniques
Pedestrian navigation can be either accomplished using some man-made information source or by measuring the planetary/universal forces. Radio Frequency (RF) signals are the most widely used man-made information sources for pedestrian navigation [1][2][3][4]. The main problem of RF information sources with respect to pedestrian navigation is their reliable availability in all environments. This leads one to the use of planetary/universal information sources for estimating the required parameters for pedestrian navigation. Systems incorporating sensors that can measure planetary/universal forces that can be used for navigation purposes are known as self-contained navigation systems. A well known navigation methodology, namely an Inertial Navigation System (INS), is normally integrated with some extra sensors for such systems. The sensors used for INS mechanization are gyroscopes and accelerometers. INS can be very accurate and reliable depending on the quality of sensors used, but, in the context of pedestrian navigation where cost, size and power consumption dictate sensor selection, these systems are of the lowest accuracy and reliability [5]. In order to improve the navigation solution of a self-contained system, other aiding sensors/information sources are utilized, which can be categorized into the use of additional physical measurements or the specificities of the human walk, i.e., its biomechanics.
The use of sensors additional to gyroscopes and accelerometers constitutes the first category. For example, with magnetometers, the measure of the Earth's magnetic field can assist the estimation of the direction of motion, which can further be used for estimating errors associated with gyroscopes [6]. But as one moves into urban and indoor environments, the Earth's magnetic field gets perturbed from the man-made infrastructure, rendering it rather useless for absolute orientation estimates.
The second category comprises the use of special constraints dictated by the biomechanical description of the user's dynamics [7,8]. These include locomotion models, ZUPT and ZARU which can take place whenever the user is stationary or detection of certain events that can be used in conjunction with some gait modeling parameters for estimating the displacements per step. The latter is also known as PDR and is the primary research focus of the pedestrian navigation research community [9]. The main limitations of these techniques are the placement of sensors on the pedestrian's body. Researchers have concluded that more than 87% of times, the user normally holds the smart-phone in hand while using it for navigation applications [10]. As it is highly unlikely to have zero acceleration or angular rate periods with the sensor block held in hand, this results in a very few ZUPT of ZARU periods, thus rendering the use of special constraints for sensor error estimation rather useless for smart-phone based pedestrian navigation. This leaves one with the PDR approach, which although it can provide promising results for the propagation of location information in various environments, it is unable to solve for the orientation problem, which causes an error growth of third order in position estimates [11].
As is evident from the above discussion, a number of approaches can be taken to target pedestrian navigation. Only one approach seems feasible for seamless navigation in all the pedestrian navigation environments, namely the PDR approach, which utilizes the self-contained navigation systems. Assuming successful detection of gait events, the main limitation of PDR is the orientation estimation. A novel idea has emerged for mitigating the gyroscope errors and estimating the orientation parameters using the Earth's magnetic field even when it is perturbed by man-made infrastructure [12]. Consequently this new algorithm provides reliable and accurate orientation estimates in diverse and challenging pedestrian navigation environments. Section 2 introduces the Earth's magnetic field, its usefulness for orientation estimation, and the effects of indoor environments on it. Section 3 describes different approaches feasible for pedestrians' attitude estimation, whereas, Section 4 details an Extended Kalman Filter (EKF) based estimator required for mitigation of attitude and sensor errors. The novel technique utilizing perturbed magnetic field for estimating attitude and sensor errors is introduced in Section 5 and Section 6 details the measurement error models required for the EKF. Section 7 addresses the statistical analysis of the proposed mitigation technique. Finally, Section 8 is dedicated to the experimental assessment of the proposed algorithm in a real world environment.

The Earth's Magnetic Field
The Earth's magnetic field is a naturally occurring planetary phenomenon, which can be modeled as a dipole and follows the basic laws of magnetic fields summarized and corrected by Maxwell [13,14]. It is a three dimensional vector originating at the positive pole of the dipole, the magnetic South and ends at the magnetic North pole. For centuries, the Earth's magnetic field has been successfully used for navigation purposes.
With the advancements in sensor technology, this field can now be precisely measured with the help of a sensor commonly known as the magnetometer. With the proper transformation of the field components to the horizontal plane and knowing the declination angle specific to the measurement area and time, a simple trigonometric operation estimates the geographic heading. The magnetic field vector is elaborated in Figure 1. Here H is the horizontal field component. The angle between the True North and H is called the declination angle D whereas the angle between the magnetic field B and horizontal plane is called the inclination angle I. B x , B v and B z are the three orthogonal magnetic field components.

Figure 1.
Earth's magnetic field in Cartesian coordinate system.

Heading Estimation Using the Earth's Magnetic Field
The orthogonal components of the horizontal magnetic field are used for estimating the heading. Thus the field components must first be transformed to a local level in order to find the horizontal field component of the measured Earth's magnetic field. For estimating the heading with respect to true North instead of the magnetic North, the declination angle also needs to be predicted using one of the Earth's magnetic field models [15]. After resolving the magnetic field to the local level and estimating the declination angle, a simple trigonometric relationship is used for estimating the heading from the measured Earth's magnetic field: (1)

Effects of Indoor Environment on Earth's Magnetic Field
Modeling of the Earth's magnetic field is possible in an indoor environment in the presence of magnetic dipoles known as magnetic perturbations [12]. These perturbations are due either to electromagnetic devices or magnetization of manmade structures in the presence of an external magnetic field, which is mostly constituted of the Earth's magnetic field. Figure 2 depicts the heading estimates for a clean and a perturbed environment, while the user walks along a straight line path. A perturbation source is modeled at around the 20 s time mark. Here it can be observed that in the close vicinity of a perturbation source, the heading estimate deviates from the nominal heading with respect to the Earth's magnetic field, which results from the change in the local magnetic field components due to the perturbation source. If one uses the magnetic heading estimates obtained using the perturbed magnetic field, the effects on pedestrian navigation solution would be adverse. For bette Earth's mag by surveying hat the effe o 130° in effectively e utilize the pe

Attitude
The digit respect to a attitude in th (1) [19]. From a pedestrian navigation perspective, mainly two vector measurements are available for this, namely the Earth's magnetic field vector and the Earth's gravity vector. But the navigation environments as well as the user dynamics limit the use of these vectors for estimating the attitude. As mentioned earlier, indoor environments are contaminated with magnetic field perturbations. Also, due to the walking dynamics of a pedestrian, with the sensor block in hand, the specific forces measured by the accelerometers will not correspond to those of the gravity vector resolved in the body frame. Therefore the approach of using only non collinear vector measurements for attitude estimation is not feasible for pedestrian navigation.

Angular Rate Measurements
As the vector measurements are not available for estimating the attitude at every epoch for pedestrian navigation, propagation of the attitude in time is necessary. For this purpose, an inertial sensor providing angular rate measurements, namely the rate gyroscope, can be used [20]. Considering the advantages of representing the rotations using a quaternion [12], the quaternion derivative is used for estimating the attitude using angular rate measurements herein, which is given by: where are the three angular rate measurements in the body frame obtained using the rate gyroscopes. q 1 , q 2 , q 3 and q 4 are the four elements describing the quaternion q. In Equation (3), the negative angular rate vector emphasizes the assumption that the transport rate (rate of change of navigation frame) is negligible [20]. This assumption is valid for pedestrian navigation applications involving traveled distances of a few kilometers. As the angular rates required for computing the quaternion derivative are provided by the MEMS rate gyroscopes, the errors associated with them introduce errors in the estimated attitude. The gyroscope errors as well as the attitude errors need to be estimated and mitigated for estimating reliable attitude angles in pedestrian navigation environments using angular rate measurements.

Extended Kalman Filter for Attitude and Angular Rate Error Estimation
Attitude and its error estimation constitute a non linear problem [21], which can be solved by using a number of estimation approaches. In this article, an extension of a Kalman filter based estimator, namely an Extended Kalman Filter (EKF) is used [22]. The main purpose of this estimator is to model the effects of the gyroscope errors on attitude estimates and use the magnetic field information as corrective measurements to estimate the attitude errors in general and gyroscope errors in particular, which can then be compensated from the present epoch and remodeled for the proceeding ones until new measurements are available. Detailed derivation of the said estimator can be found in a number of books [6,[20][21][22][23][24][25]. Only the appropriate states, measurements and their respective system and measurement error models are detailed herein.

The State Vector
As only the attitude/orientation estimation for pedestrian navigation is targeted herein, the main states to be estimated are the three attitude angles. The attitude is primarily determined using the angular rates obtained using the rate gyroscopes. The deterministic errors associated with this sensor can be compensated for using the calibration parameters [12], leaving the time varying biases as the residual errors. Thus the state vector becomes: Here, φ is the roll angle, θ is the pitch angle and Ψ is the heading angle. The time varying biases associated with the three gyroscopes are represented by , and .

System Error Model
The perturbed state vector representing errors in Equation (4) is given by: where is the attitude error vector in the navigation frame, which defines the small angle rotations to align the estimated local level frame to the actual one. are the errors in the inertial sensor bias estimates. As the attitude errors are periodically updated using the measurement vectors, the components of give the small angle representation of the attitude errors [20]. A small angle transformation matrix can then be used to compensate for the attitude errors from the predicted rotation matrix given by: where is the skew symmetric matrix for the vector and the circumflex accent on the rotation matrix means that it has been compensated for the attitude errors. From Equation (6), it can be shown that: The derivative of Equation (7) is: The differential equation for the rotation matrix is given by: where is the skew symmetric matrix of the angular rate vector obtained from the rate gyroscopes. Substituting Equation (9) in Equation (8) and simplifying gives: The matrix is defined by the uncompensated gyroscope measurements. Let be the skew symmetric matrix for the gyroscope measurement errors. By definition of the different matrices, can now be written as: Substituting Equation (11) in Equation (10), simplifying and neglecting the second order terms to get a relationship for yields: (12) which, in vector form, becomes: In Equation (13): (14) where is the true angular rate vector and is the angular rate estimates obtained after compensating for the sensor errors, which are estimated using calibration as well as stochastic modeling. The estimated angular rate vector can be written as: (15) where is the raw angular rate measurement vector and is the estimate of the time varying bias vector obtained from the estimator (EKF). Substituting for the gyroscope model, with being the wideband noise, and using Equation (15) in Equation (14), one gets: (16) which after simplification becomes: (17) where is the perturbation of the time varying gyroscope biases. Equation (13) now becomes: (18) The time varying gyroscope bias is modeled as an exponentially correlated noise term, resulting in the derivative of perturbations in the time varying gyroscope bias given by [20]: (19) where is the correlation time and is the noise vector for the stochastic modeling of the time varying gyroscopes' biases. Equations (18) and (19) lead to the following system dynamics model: where F is the dynamics matrix, G is the shaping matrix and w is the system noise matrix as defined in literature on Kalman filter.

Measurement Error Models
The measurements used for compensating the errors associated with the attitude vector in general and gyroscope biases in particular are herein solely based on the magnetic field vector measurements. In order to utilize the clean as well as perturbed magnetic field measurements, a novel technique for estimating the sensor frame's angular rates using a tri-axis magnetometer was developed and is detailed in the following section.

Quasi-Static Field (QSF) Based Attitude and Angular Rate Measurements (Patent Pending)
The novel idea for estimating attitude and gyroscope errors using magnetic field measurements for pedestrian navigation environments mainly involves detecting quasi-static total magnetic field periods during pedestrian motion and utilizing them as measurements for estimating attitude and gyroscope errors. Indeed when the local magnetic field is quasi-static, the rate of change of the magnetic field is combined with the rotational rate of change of the inertial device generating an estimated gyroscope error, which can be further used to correct for time-varying inherent gyroscope errors [12]. Contrary to existing solutions, this technique is working in magnetically perturbed environments as long as the field is identified as constant over a selective period of time. Further, in order to successfully detect the presence of QSF periods, proper pre-calibration of the magnetic field sensors is necessary. This is achieved by utilizing a calibration algorithm developed by the authors [26]. The QSF detector, developed using statistical signal processing techniques, is now presented.
The Earth's magnetic field, though a good source of information for estimating heading outdoor, suffers severe degradations in the indoors caused by magnetic field perturbations [16]. These perturbations are of changing magnitudes and directions, which induce random variations in the total magnetic field. These variations render the magnetic field information useless for absolute orientation estimation with respect to the magnetic North in indoor environments. Although the magnetic field indoor is not spatially constant due to changing perturbation sources, depending on the pedestrian's speed and surroundings, it is possible to have locations as well as short periods (user not moving) when the perturbed magnetic field is constant in magnitude as well as in direction. The rate of change of the total magnetic field in such situations will be ideally zero. It is possible to have very slight changes in the magnitude and direction of the total magnetic field (due to sensor noise) that can still be considered as quasi-static. Thus information to be considered for detecting a QSF is the rate of change of the total magnetic field , which is referred to as the field gradient and is computed using: where is the magnetic field at the current epoch, is the magnetic field at the previous epoch and Δt is the measurement update rate. For a window of size N, a QSF detector will detect a static field if: Let the hypothesis for a non-static field be H 0 and that for a quasi-static field be H 1 respectively. The Probability Density Functions (PDFs) associated with these two hypotheses are: (23) The rate of change of the total magnetic field is also contaminated by white Gaussian noise , which, when modeled with the measurements, gives: (24) where y k is the information to be tested for H 0 or H 1 . Under H 0 , is the unknown parameter required to describe the signal completely. Therefore, for the two hypotheses, is defined as: where Ω l N: l 1 with N N and n N. As the complete knowledge about is unknown for H 0 , the PDF in this case is given by: Let the Maximum Likelihood Estimator (MLE) for the unknown parameter in case of H 0 be , which is given by the mean of the signal as: Now the PDF for becomes: For hypothesis , the rate of change of the total magnetic field is known (it will be zero), therefore the PDF in this case becomes: The Generalized Likelihood Ratio Test (GLRT) for detecting a quasi-static field is given by: Taking the natural log on both sides and simplifying yields: where is the threshold for QSF detection.

Use of QSF Detected Periods for Attitude and Gyroscope Error Estimation
Once the QSF periods are detected during pedestrian motion, the next step is to utilize the magnetic field information during such periods for estimating the attitude angles and the gyroscope errors. This section derives the equations required for using QSF magnetic field measurements, even perturbed, in the EKF developed in Section 4. It principally consists of a measurement error model that is used for updating the state vector of the navigation filter.

QSF Measurement Error Model Using the Local Magnetic Field
Let the magnetic field measurement in the sensor frame at the start, i.e., the k th epoch, of the quasi-static field period be given by: Considering the attitude at the start of quasi-static period as the reference for the measurement model, the magnetic field measurement can be transformed to the navigation frame using: is considered as a measurement during quasi-static field periods. Indeed in the novel approach the magnetic field information extracted from a geomagnetic field model is not considered as a measurement of the truth but rather the field is considered as a reference over the QSF period. As the inaccuracies in the sensor will bias the estimated attitude, the transformations of proceeding magnetic field measurements from body to navigation frame using the updated would be different from hence introducing the measurement error. This gives the relationship for the first measurement error model:  (35), the measurement error model becomes: Ideally, as the magnetic field during QSF period is locally static (magnetic field vector not changing its magnitude or direction), Equation (36) should be equal to zero. But due to errors in rate gyroscope measurements, which are used for estimating the rotation matrix, the following perturbed model is obtained: is the measurement noise of the magnetometers.
Simplifying (37) to get a relationship between measurements and states, one obtains: Because the last term in Equation (38) is of the second order in errors, neglecting it results in: where is the skew symmetric matrix of vector .

QSF Measurement Error Model Using the Rate of Change of the Local Magnetic Field
During the quasi-static field periods, the rate of change of the reference magnetic field is zero. Using this information as a measurement, one gets: Taking the derivative of Equation (41) to get the relationship between the rate of change of a vector in two different frames [28], one gets: where is the angular rate vector required for rotating the magnetic field measurements between two epochs in the sensor frame. Because the QSF periods are identified as those where the field vector in the navigation frame is not changing its magnitude and orientation, the left hand side of Equation (42) During user motion, the magnetic field components in the body frame will encounter changes, which can be modeled by Equation (43). But due to errors in gyroscopes angular rates, the predicted changes in magnetic field will be different from the measured ones given by: where and is the time period between two consecutive epochs. Expanding Equation (44) and substituting from Equation (43) results in: (45) The first two terms give the rate of change of the reference magnetic field, which, during QSF periods, is zero.
is the error in caused by the gyroscope biases. Thus Equation (45) reduces to: (46) which can be rewritten as: giving the following measurement model: (48)

Full QSF Measurement Error Model
Combining Equations (40) and (48), the complete measurement error model using QSF is: , which can be utilized for constraining the error growth in attitude angles and estimating the rate gyroscope errors.

Statistical Analysis of the QSF Detector
In order to quantify the performance of the proposed quasi-static magnetic field detector, statistical analysis was conducted. From Equation (32), it can be observed that there are a number of tuning parameters that need to be evaluated for effectively using the QSF detector. These are the threshold, noise variance and the number of samples (window size) required for the detection test statistics.

Measurement Noise Variance
This factor corresponds to the variance of the total field gradient when the field itself is not changing. This gives a measure of the gradient noise that is encountered during quasi-static field periods. More than seven hours of data in five different environments that are common for pedestrian navigation have been collected and analyzed for evaluating this parameter [16,27]. The magnetic field survey was conducted using a tri-axis Bartington high resolution and high sensitivity fluxgate magnetometer. The magnetically derived heading was compared with the true heading estimated by post-processing synchronous measurements collected with the tactical grade inertial system (INS): the SPAN-CPT HG1700 from NovAtel. As shown in Figure 3, all devices were rigidly mounted on a plastic cart. The complete hardware setup was calibrated by performing 3D rotational maneuvers in a perturbation free environment and applying the complete calibration algorithm detailed in [26] to the recorded data. Figure 4 depicts the derived field gradient noise distribution, which is used for estimating the noise variance at 1σ. This comes out to be 0.057 μT 2 .

Selection of Threshold and Window Size Using Receiver Operating Characteristics
The Receiver Operating Characteristics (ROC) curve allows one to select the test statistics acceptance threshold based on the required probability of detection P d and the acceptable probability of false alarm P f . Figure 5 shows the ROC for the QSF detector for different sample window sizes. The sensor sampling rate is 0.04 s, which gives a minimum window size of 0.12 s and a maximum of 0.32 s in this case. It can be observed that the ROC tends to flatten out after P d = 0.8. Thus selecting a P d any larger than this value will cause more false alarms. Hence a P d of approximately 0.8 is selected for this detector. The effect of the window size on the detector's performance is negligible at the selected P d . Therefore a window size of three samples is selected to reduce the processing burden. Table 1 summarizes the parameters selected for the QSF detector.   Figure 6 summarizes the QSF detection periods and their respective durations for different pedestrian navigation environments surveyed. Most of the detection periods have a duration of 120 ms to 300 ms. Figure 7 depicts the shortest and longest gaps between two consecutive QSF periods and their percentages of occurrence respectively. The minimum gap, i.e., 240 ms, occurs more frequently as compared with the maximum gap of 480 ms. Therefore it can be concluded that the QSF periods are encountered frequently and hence may allow for estimation of angular rate errors. It is worth mentioning here that unlike some pedestrian navigation applications where Zero Velocity Updates γ (ZUPT) occur frequently during a pedestrian's walk (e.g., shoe mounted sensors), when the sensor block is in the hand or in a pocket/purse, these may not be encountered at all. In such scenarios, QSF periods can still be used effectively for providing regular measurements for sensor error estimation.

Experimental Assessment of the Proposed Attitude Computer
In order to assess the performance of the proposed QSF based orientation/attitude estimation algorithm, test data was collected in a real world environment, which is most common for pedestrian navigation applications: downtown. The test setup used for analyzing the impact of the proposed algorithm on attitude estimation comprised a Multiple Sensor Platform (MSP) and an optical wheel encoder developed by the author [12]. The MSP comprises a tri-axis gyroscope made of a dual-axis ST Microelectronics' LPR530AL and a single-axis LY530ALH from the same manufacturer. It includes a HMC5843 tri-axis Anisotropic Magneto-Resistive (AMR) sensor for magnetic field measurements. Finally a tri-axis Analog Devices' ADXL335 accelerometer completes the inertial measurement unit. The wheel encoder is used here for measuring the pedestrian's walking speed so as to bring the outcome of the proposed algorithm from attitude domain to the position domain and provide better insight into the performance of the system. The wheel encoder is capable of computing the pedestrian's walking speed with an accuracy of ±4 × 10 −3 m/s. This walking speed is later resolved into North and East components using the estimated attitude to compute the position, the latter being obtained by integrating the velocity components. As this article focuses only on attitude estimation, the wheel encoder provides accurate speed measurements, which are necessary for de-correlating the velocity error budget from the attitude one, allowing the assessment of attitude accuracies only.
In an actual portable device such as a smart-phone, the walking speed would be measured by accelerometers. Although smart-phones of today are equipped with accelerometers, performing gait analysis with a handheld device is a challenging task and constitutes a research topic in itself. Thus with the use of wheel encoder, the experimental assessments of the proposed attitude estimator in the position domain as described herein, can be considered free of errors induced by speed sensors (accelerometers), providing a better insight into attitude accuracy. However the MSP developed for this research is hosting a tri-axis of accelerometers, which can be used in future for investigating different methods to estimate stride length and speed. This work targets the implementation of a complete pedestrian navigation system.
The MSP was rigidly mounted on a plastic plate, which can be easily carried in a hand. The wheel encoder is mounted on a pole that can be held by a pedestrian and pushed along the ground for measuring the walking speed. Figure 8(a) shows the handheld arrangement of the sensor module used for the test data collection. Here the pedestrian and body frames are also identified to clarify in which frame (body frame) the attitude is estimated. Figure 8(b) shows the overall test data collection setup including the wheel encoder. It is assumed that the body frames x-z plane is aligned with that of the pedestrian frame in order to account for the ambiguity between sensor frame's orientation and users walking direction. This is achieved with the help of the hand held plastic plate. Thus the sensor's frame is effectively aligned with the body frame.

Assessment Criterion
In order to assess the impact of the proposed algorithm on attitude estimation for pedestrian navigation, the solution repeatability criterion is chosen. Multiple paths of the same trajectory were followed in different environments keeping the same starting and ending point to assess the performance. The paths were followed so as to keep the separation between them within one metre if possible. This is achieved by following prominent patterns on the ground (tiles boundaries, pavement markings/intersections etc.).

Test Environment
In order to assess the impact of the proposed algorithms on attitude estimation for pedestrian applications, a urban canyon was selected.
Urban canyons can be considered as one of the regions where pedestrian navigation applications have a lot of commercial significance. Also before moving indoor, one often ends up being in an urban canyon for some time. Hence detailed analysis of the proposed algorithm in this environment is very important. Figure 9 gives the bird's eye view of the test region selected in downtown Calgary for the assessment. The block selected is newly constructed with a walkway filled with ferrous infrastructure all around including phone booths, newspaper dispensers, street light poles and manholes. The walking trajectory around this block was approximately 370 m and was traversed thrice for repeatability testing.   Figure 10(b) shows one of the paths traversed in the selected region with high rise buildings and metallic infrastructure all around. Indeed this environment includes numerous magnetic field perturbation sources and hence can be considered a good test area for assessing the attitude estimation algorithms presented in this article.  Figure 11 shows the total field observed in the urban canyon environment along with the QSF detections. It can be observed that the overall signatures of the total field as well as the detection of QSF periods are temporally very similar for different paths. This is because the paths traversed were kept within 1 m of one another for assessing the repeatability of the results. Figure 11. Total field and QSF detections for similar paths in urban canyon. Figure 12 shows the trajectories obtained using raw heading versus QSF measurements for estimating gyroscope errors. It can be observed that due to severe magnetic field perturbations, the trajectory obtained using raw heading estimates has a maximum error of 43 m as compared to 5 m in case of QSF measurements. The observability of gyroscope biases using QSF measurements is presented graphically in Figures 13 and 14. Using Equation (43), one can obtain the estimates of the rate of change of magnetic field components using gyroscopes during a QSF period. Due to presence of biases in the gyroscope measurements, these estimates are different from the actual rate of change of magnetic field as shown in Figure 13. Upon utilizing Equation (44) as measurement errors for the EKF, the gyroscope biases are successfully estimated and compensated from the gyroscope measurements bringing the estimated rate of change of magnetic field components in harmony with the actual ones, as shown in Figure 14.   Figure 15 shows the three trajectories obtained using QSF measurements in the urban canyon. These trajectories are obtained by initializing the starting position and orientation for each loop. The first observation is the consistency of the ending locations. These are within 2 m of one another showing the effectiveness of QSF in estimating the rate gyroscope errors. The other observation is the random skewing of the three trajectories with respect to one another. This is because the QSF measurements can completely observe the rate gyroscope errors, but are not capable of observing the actual attitude errors. The attitude error growth is constrained using QSF measurements as is evident from Equation (49). As the rate gyroscope errors are randomly varying, these cause random errors in the attitude at the beginning of each path while the gyroscope errors are being estimated, which results in a random orientation error. Once the rate gyroscope errors are completely estimated, the attitude error growth is constrained. Thus the accuracy of the estimated trajectory is improved through the use of the QSF detections. Reference Traj. Figure 16 shows the trajectory obtained using the three loops in a continuous fashion. It is quite evident that Loop2 and Loop3 are very similar in this case. This is because the rate gyroscope errors have been properly estimated resulting in trajectories with a steady skew, which means that the orientation errors are now effectively constrained. Figure 16. Continuous trajectory in urban canyon using QSF.

Performance of Attitude Estimator in Urban Environment
The maximum trajectory error obtained using raw magnetic heading based on measurement models for estimating continuous trajectory, whose length was longer than 1 km (for the three loops) is approximately 87 m whereas that for the QSF measurement model is approximately 16 m. Thus the trajectory errors are reduced by 80% by utilizing QSF measurements for constraining the attitude error growth and estimating the gyroscopes' errors.

Conclusions and Future Work
This article investigated the use of handheld devices (smart-phones) equipped with low cost consumer grade sensors for pedestrian navigation. As the attitude/orientation errors play a major role in the overall navigation error budget, the focus was on improving the attitude estimates in environments where GPS is denied. For this purpose, the use of the Earth's magnetic field as a measurement source for estimating the errors associated with low cost inertial sensors was investigated.
A novel method for utilizing the Quasi-Static magnetic Field (QSF), regardless of perturbation, to mitigate gyroscope errors has been developed and the corresponding equations have been presented. The novel estimation technique proved to deliver a high level of performance, reducing the trajectory errors by 80% for a distance of more than 1 km. This method detected the QSF periods during pedestrian's motion and related the changes in the magnetic field components during these periods with the angular rates of the sensor block, thus providing measurements for directly assessing the errors associated with the rate gyroscopes. Development of an Extended Kalman Filter (EKF) for modeling the attitude and gyroscope errors as well as relating these to the magnetic field measurements have been conducted. They gave an insight into the interdependence of different parameters, which proved beneficial in identifying the limitations of the proposed model. Selection of an urban canyon (magnetically disturbed outdoor field) for the experimental assessments provided data sets for a realistic and detailed analysis of the performance of the proposed algorithm. Analyzing the results in the position domain with the sensor platform carried in a hand gave detailed insight into the impact of the attitude estimator on the position error budget. A high accuracy wheel encoder made it possible to isolate the attitude errors from the position ones.
Even with an 80% error reduction in the positioning domain as compared with classical integration of magnetometers and gyroscopes in attitude estimation filter, the use of QSF measurements to successfully estimate the gyroscope errors resulted in constant orientation errors. This showed that this scheme is not sufficient for observing the absolute attitude errors. The position errors reached 16 m for a traversed trajectory of more than 1 km.
The use of accelerometers and pressure sensors for estimating pedestrian's position as well as speed is necessary to completely assess the impact of this research in real world navigation scenarios. Both of these sensors are already incorporated in the MSP developed for this research and will form the basis for the above suggested research.
Research into the resolution of the ambiguity between sensor and body frames, which was constrained to be zero for the experiment herein, is needed. This can be achieved by using the accelerometers, but requires detailed modeling of the pedestrian's walk related to arm swing or hip joint motion. The algorithm developed herein is self-contained and assumed a fully denied GNSS environment. However, GNSS is partly available in urban canyons and in numerous indoor environments. Hence research into the integration of the two approaches to maximize availability and accuracy is in order.