Abstract:
A method and system are provided for determining a heading angle of a user of a portable electronic device in an indoor environment. In an embodiment, the device collects rotational movement information indicative of rotational movement of the device and determines a first heading angle of the device. The first heading angle is determined by using the downward direction of the device to determine the vertical angular rate in the horizontal plane, and integrating the vertical angular rate to form the first heading angle. The device collects first direction information from a first direction sensor and second direction information from a second direction sensor and uses it determine which of the first and second direction information is an outlier, e.g., inaccurate due to an occurrence of a disturbance. The device then corrects the heading angle by comparing the heading angle to the first and second direction information.

Description:
TECHNICAL FIELD 
       [0001]    The present disclosure is related generally to indoor navigation, and, more particularly, to a system and method for determining a heading (direction of motion) in an indoor positioning system. 
       BACKGROUND 
       [0002]    Navigation and localization have always been important to mankind, and maps have been developed since the first systematic explorations started. Today, localization is in almost all applications performed by electronic systems, where global navigation satellite systems (GNSS) provide a robust, global and versatile solution for localization suitable for almost all outdoor applications. Navigation systems also involve determination of orientation and speed. Either separate sensors as electronic compass and speedometers can be used, or the positions from GNSS can be filtered to provide these additional features. 
         [0003]    Indoor localization and navigation is a much harder task, but it is still an important application for many humans and autonomous systems moving around in complex indoor environments. The GNSS approach does not work due to the weak radio signals that are shielded and reflected by the building construction. 
         [0004]    There are two main approaches available for indoor navigation based on different information sources: 
         [0005]    1) Landmark based navigation, where the indoor landmarks with known position are deployed in the indoor environment, and the user is equipped with a map of these landmarks. The localization algorithm consists of triangulation and trilateration based on detection of one or more of these landmarks. This includes fingerprinting of radio signal strength indications (RSSI) from WiFi, cell phone base stations, Bluetooth Low Energy (BLE) or other radio beacons. The advantages of landmark based navigation include robust, potentially quite accurate, drift-free localization. To implement such an approach, simple localization algorithms can be utilized, e.g., filter methods are not needed but can be used to get smooth trajectories. However, landmark based navigation requires pre-installed infrastructure and tedious mapping. The approach is also sensitive to modification of the mobile radio beacons, their position or other changes of the radio environment. 
         [0006]    2) Dead-reckoning based on inertial measurements and map based corrections. The basic principle of dead-reckoning is to integrate speed and heading changes to a global heading and position. Since velocity and heading rate are subject to offsets and disturbances, the integrated position will quickly diverge from or “drift away” from the true position. An indoor map is then required to stabilize the solution to stay in a feasible set of indoor positions, and to provide feedback of the actual offset values. An advantage of dead-reckoning is that it is a general and well known principle requiring only sensors in the device and no infrastructure. The approach works well potentially in indoor environments with a limited number of alternatives to move (the map is informative). However, dead-reckoning requires more complex algorithms, where filtering is required. The approach works less well in open indoor areas, where there is little information in the map. Further, drifting of the position estimate is common. 
         [0007]    These principles can be combined into one solution that potentially avoids all the aforementioned disadvantages, but such an approach still faces many hard challenges and still requires a complex algorithm. 
         [0008]    Changes in heading are the most important information in the dead-reckoning approach, besides the indoor map itself. As an example, in an office building, it is often sufficient to keep track of the 90 degree turns and the distance in between the turns. Given a starting point and assuming fairly constant speed, it is then possible to figure out the path, which is a simple task for a human. Computers can do this inference systematically, by evaluating a large number of alternatives and then selecting the one that best fits the observed changes in heading. The question is how to compute the heading change based on available sensors in a user carried device. Many hand-held devices, such as for instance smart phones, have both gyroscopes and vector magnetometers that relate to heading. 
         [0009]    The most natural alternative is to start with the vector magnetometer, since its standard use is as a compass sensor, i.e., a heading sensor. If the user carried device has a fixed orientation relative to the moving person or object, and if the person is walking upright without tilting or rotating the device, then changes in the heading are directly detected from changes in the compass heading provided by the magnetometer. However, many indoor environments have large and frequent magnetic disturbances that would trigger a lot of false heading changes. Also, one cannot assume that the device is in a constant orientation relative the person all the time. 
         [0010]    Gyroscopes are normally used to measure angular rates, including heading changes which are the angular rate projected onto the horizontal plane. The projection requires that 3 the downward direction is known. This can be computed from a vector accelerometer. Now, the angular rate has a rather large offset in consumer grade sensors, on the order of degrees per second. This offset further drifts over time, and cannot be calibrated once for all. The offset in combination with uncertainty in downward direction gives a large drift  5  in heading that is not easily stabilized. All in all, gyroscopes are in themselves not well suited to detect heading changes, and are useless for heading determination. Moreover, changes in the orientation of the device relative its user can be falsely interpreted as a turn. 
       SUMMARY 
       [0011]    In an embodiment of the disclosed principles, it is an object of the present invention to provide an improved solution that alleviates the mentioned drawbacks with present devices. Furthermore, it is an object to provide a method to combine the information from motion and direction sensors in such a way that disturbances and changes in the heading of the user carried device relative to the user can be detected. 
         [0012]    According to a first aspect of the invention, this is achieved by a method for determining the change in heading of a user in an indoor environment, wherein the user has a user carried device and the user carried device is provided with a direction sensor and a movement sensor. The method comprises the steps of receiving rotational movement information from a motion sensor regarding rotational movement of the user carried device; determining a heading angle based on said motion information; receiving a first direction information from a direction sensor regarding the downward direction of the user carried device; receiving a second direction information from a direction sensor regarding the direction of the movement of the user carried device; detect an outlier in said first and second direction information; and compute a corrected angle of said angle by comparing said angle with said first and second direction information and by considering the outlier. Herein, the term “outlier” refers to an inertial or magnetic measurement that is useless for localization due to a disturbance, and which, if used, would imply an incorrect turn in the odometric model. 
         [0013]    The rotational movement of the user carried device may be measured as an angular rate. The downward direction, as sensed by a direction sensor, may be measured and used to determine the vertical angular rate in the horizontal plan. By using an integrator the vertical angular rate can be integrated to a heading angle. Since the angular rate may include an offset value, the integrated angle may unfortunately drift over time. The idea in the present invention is to use a filter that corrects the integrator by comparing the integrated angle with direction information sensed by another type of sensor. An advantage with this approach is that the two signals are sensed by two independent sensors, which are based on different measurement technology. A further advantage is that the two sensors measure different and independent magnitudes, since the second direction sensor may measure the angle whereas the rotational movement sensor measures the angular rate. Disturbances may influence these two sensors in different manner and at different occasions. That is, a disturbance in the rotational motion sensor may not appear in the direction sensor and the integrated angle may be corrected under knowledge of the information received from the direction sensor. A further advantage of this idea is that the downward direction information may be received from a third independent sensor sensitive to a third kind of disturbance and may thereby be able to correct the information of the other two sensors. 
         [0014]    In the case when disturbances are present in any of the direction sensor measurement the correction filter may be disabled in order to not erroneously correct the integrated angle. One embodiment of the present invention includes an outlier rejection algorithm that disables the filter whenever one or both of the direction measurements deviates more than expected from the integrated angle. 
         [0015]    A further idea of the present invention comprises an optional step of hypothesis testing if a change in the heading direction angle from one time to another is consistent with a change in heading, or if the change in angle comes from a change in orientation of the device relative the user. 
         [0016]    According to a second aspect of the invention, a user carried device for determining the change in heading of a user in an indoor environment is provided, wherein the user carried device is provided with a direction sensor and a movement sensor. The movement sensor is adapted to provide rotational movement information regarding rotational movement of the user carried device. A first direction sensor is adapted to provide downward direction regarding the downward direction of the user carried device and a second direction sensor is adapted to provide heading information regarding the direction of the movement of the user carried device. The user carried device comprises a calculation unit that is adapted to determine an angle based on said rotational motion information; detect an outlier in said first and second direction sensors; and compute a corrected angle of said angle by comparing said heading angle with said first and second direction information and by considering the outlier. 
         [0017]    In one embodiment, the rotational movement sensor may comprise a gyroscope. In another embodiment the downward direction sensor may comprise an accelerometer. If the accelerometer measures the acceleration in at least three directions it may be able to measure the direction of the gravitational field and the downward direction may be derived based on this information. The outlier rejection algorithm may be used to remove movements, sensed as accelerations, of the user carried device that influence the estimated downward direction. 
         [0018]    In a further embodiment the heading direction sensor may comprise a magnetometer. The outlier rejection algorithm may be used to remove magnetic indoor disturbances from the compass heading. 
     
    
     
       BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS 
         [0019]    While the appended claims set forth the features of the present techniques with particularity, these techniques, together with their objects and advantages, may be best understood from the following detailed description taken in conjunction with the accompanying drawings of which: 
           [0020]      FIG. 1  shows a module-level schematic of a system in accordance with an embodiment of the disclosed principles; 
           [0021]      FIG. 2  shows a set of data plots associated with data in accordance with an embodiment of the disclosed principles; 
           [0022]      FIG. 3  shows a further set of data plots associated with data in accordance with an embodiment of the disclosed principles; 
           [0023]      FIG. 4  shows a further set of data plots associated with data in accordance with an embodiment of the disclosed principles; 
           [0024]      FIG. 5  shows a further set of data plots associated with data in accordance with an embodiment of the disclosed principles; 
           [0025]      FIG. 6  shows a further set of data plots associated with data in accordance with an embodiment of the disclosed principles; and 
           [0026]      FIG. 7  shows a flow chart of indoor navigation in accordance with an embodiment of the disclosed principles. 
       
    
    
     DETAILED DESCRIPTION 
       [0027]    The present invention will be described more fully hereinafter with reference to the accompanying drawing, in which preferred embodiments of the invention are shown. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. In the drawing, like numbers refer to like elements. 
         [0028]    There are three coordinate systems to consider: The orientation of the user carried device q, the coordinate system of the reference map, which can be assumed to be a world reference system (A vector in the device coordinate system is rotated to reference coordinate system by the rotation matrix R(q)), and the body orientation of the user relative to the map, and most importantly the heading ψ and heading rate {dot over (ψ)} defining in what direction the user is moving relative the reference map. 
         [0029]    The device in one embodiment includes the following inertial and magnetic sensors: 
         [0000]    Gyroscopes ( 102 ) providing turn rate ω, but measured with an offset b ω   k  and noise e ω   k  to yield y ω   k =ω k +b ω   k +e ω   k . Accelerometers ( 106 ) providing gravity gin the device coordinate system, but measured with an offset b a   k  and disturbance d a   k  (the linear acceleration a of the device) and noise e a   k  to yield y a   k =R(q k )g+b a   k +d a   k +e a   k . 
         [0030]    Magnetometers ( 108 ) providing the earth magnetic field m in the device coordinate system, but measured with a bias b m   k  and disturbance d m   k  (stemming from soft and hard iron in the environment) and noise e m   k  to yield y m   k =R(q k )m+b m   k +d m   k +e m   k . The earth magnetic field is here assumed to be a constant vector m, which might be known in advance or might be estimated in a separate calibration phase. 
         [0031]    Secondary position sensors are also relevant for this invention, such as Bluetooth beacons or global navigation satellite systems (GNSS) providing a position fix (X(t), Y (t)) of high accuracy. 
         [0032]    In summary, we have the raw measurements: 
         [0000]        y   k   ω =ω k   +b   k   ω   +e   k   ω   (1)
 
         [0000]        y   k   a   =R ( q   k ) g+b   k   a   +d   k   a   +e   k   a   (2)
 
         [0000]        y   k   m   =R ( q   k ) m+b   k   m   +d   k   m   +e   k   m   (3)
 
         [0033]    These sensors are representative for the key steps in this invention, but it should be noted that there are other sensors for measuring angle and angular rates of a device for indoor navigation. 
         [0034]    In the horizontal plane, the heading defines the direction of motion of the device relative the reference map. The heading in the horizontal plane is defined as w, and correspondingly, the heading rate is defined as {dot over (ψ)}. A heading rate sensor can be provided by {dot over (ψ)}=ω s  from the gyro, given that the device is orientated horizontally all the time. With an inclination sensor measuring q, the heading rate can be computed as {dot over (ψ)}=(1,0,0)R(q)ω. In this way, we have the basic form of a heading rate sensor. 
         [0035]    One way to compute the heading rate directly is based on the dot product of the gyro and accelerometer, 
         [0000]    
       
         
           
             
               
                 
                   
                     ψ 
                     . 
                   
                   = 
                   
                     
                       || 
                       
                         ω 
                         · 
                         a 
                       
                       || 
                     
                     g 
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
         [0036]    This model illustrates the main problems of using the gyro as a heading rate sensor. More advanced ways to utilize the gyro will be described later. If we replace the theoretical values of gravitational acceleration and rotational rates using (1) and (2), then we approximate the total effects of bias, disturbance and noise as 
         [0000]        y   k   {dot over (ψ)}   ={dot over (ψ)}k+b   k   {dot over (ψ)}   +e   k   {dot over (ψ)} .  (5)
 
         [0037]    The point is that we replace the three-dimensional errors of two sensors with one dimensional error of each kind (offset, disturbance, measurement error). This is sufficient for horizontal positioning, and substantially decreases the complexity of the problem. Normally, the set of all offsets is not even identifiable. 
         [0038]    Similarly, the heading of the device can be computed from the magnetometer using a cross product (for simplicity, assuming an horizontal device with θ=φ=0 more advanced models to follow) 
         [0000]    
       
         
           
             
               
                 
                   
                     v 
                     = 
                     
                       
                         a 
                         × 
                         m 
                       
                       = 
                       
                         
                           
                             ( 
                             
                               
                                 
                                   
                                     cos 
                                      
                                     
                                       ( 
                                       ψ 
                                       ) 
                                     
                                   
                                 
                                 
                                   
                                     sin 
                                      
                                     
                                       ( 
                                       ψ 
                                       ) 
                                     
                                   
                                 
                                 
                                   0 
                                 
                               
                               
                                 
                                   
                                     sin 
                                      
                                     
                                       ( 
                                       ψ 
                                       ) 
                                     
                                   
                                 
                                 
                                   
                                     - 
                                     
                                       cos 
                                        
                                       
                                         ( 
                                         ψ 
                                         ) 
                                       
                                     
                                   
                                 
                                 
                                   0 
                                 
                               
                               
                                 
                                   0 
                                 
                                 
                                   0 
                                 
                                 
                                   1 
                                 
                               
                             
                             ) 
                           
                            
                           
                             ( 
                             
                               
                                 
                                   0 
                                 
                               
                               
                                 
                                   
                                     
                                       cos 
                                        
                                       
                                         ( 
                                         δ 
                                         ) 
                                       
                                     
                                      
                                     m 
                                   
                                 
                               
                               
                                 
                                   
                                     
                                       - 
                                       
                                         sin 
                                          
                                         
                                           ( 
                                           δ 
                                           ) 
                                         
                                       
                                     
                                      
                                     m 
                                   
                                 
                               
                             
                             ) 
                           
                           × 
                           
                             ( 
                             
                               
                                 
                                   0 
                                 
                               
                               
                                 
                                   0 
                                 
                               
                               
                                 
                                   g 
                                 
                               
                             
                             ) 
                           
                         
                         = 
                         
                           gm 
                            
                           
                               
                           
                            
                           
                             cos 
                              
                             
                               ( 
                               δ 
                               ) 
                             
                           
                            
                           
                             ( 
                             
                               
                                 
                                   
                                     cos 
                                      
                                     
                                       ( 
                                       ψ 
                                       ) 
                                     
                                   
                                 
                               
                               
                                 
                                   
                                     sin 
                                      
                                     
                                       ( 
                                       ψ 
                                       ) 
                                     
                                   
                                 
                               
                               
                                 
                                   0 
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
             
               
                 
                   
                       
                   
                    
                   
                     ψ 
                     = 
                     
                       
                         atan 
                          
                         
                           ( 
                           
                             
                               v 
                               2 
                             
                              
                             
                               / 
                             
                              
                             
                               v 
                               1 
                             
                           
                           ) 
                         
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
           
         
       
     
         [0039]    Here, m is the magnitude of the earth magnetic field and δ is dip angle (angle to horizontal plane). Both are location-dependent, but their influence will be cancelled out when solving the right hand side above for the heading ψ. 
         [0040]    Once again, if we replace the theoretical values of gravitational acceleration and magnetic field with the observed values (1) and (3), then we approximate the total effects of bias, disturbance and noise as 
         [0000]        y   k   ψ =ψ k   +b   k   ψ   +e   k   ψ .  (8)
 
         [0041]    Thus, the inertial sensors provide the following heading related information, which can be seen as virtual sensors of heading rate and heading: 
         [0000]        y   k   {dot over (ψ)} ={dot over (ψ)} k   +b   k   {dot over (ψ)}   +d   k   (1)   +e   k   {dot over (ψ)}   (9)
 
         [0000]        y   k   ψ ={dot over (ψ)} k   +b   k   ψ   +d   k   (2)   +e   k   ψ   (10)
 
         [0042]    The first disturbance d k   (1)  is mainly due to an acceleration that causes the accelerometer to measure linear acceleration besides gravitation. The second disturbance d k   (2)  is mainly due to a magnetic disturbance that comes and goes. The two offsets b k  are caused by all of the involved offsets (nine in total). These offsets are slowly varying over time, and can during short time horizons be seen as a constant. 
         [0043]    A Horizontal Motion Model 
         [0044]    Denoting the horizontal position at time t with (X(t), Y(t)), one embodiment of dead reckoning model based on the state vector x=(X, Y, ψ, {dot over (ψ)}, L, b ψ , b {dot over (ψ)} ) is as follows: 
         [0000]        X ( t+ 1)= X ( t )+ L ( t )cos(ψ( t )),  (11)
 
         [0000]        Y ( t+ 1)= Y ( t )+ L ( t )sin(ψ( t )),  (12)
 
         [0000]      ψ( t+ 1)=ψ( t )+ T ( t ){dot over (ψ)}( t ),  (13)
 
         [0000]      {dot over (ψ)}( t+ 1)={dot over (ψ)}( t )+ T ( t )ω {dot over (ψ)} ( t ),  (14)
 
         [0000]        L ( t+ 1)= L ( t )+ω L ( t ),  (15)
 
         [0000]        b   {dot over (ψ)} ( t+ 1)= b   {dot over (ψ)} ( t )+ω b,{dot over (ψ)} ( t ),  (16)
 
         [0000]        b   ψ ( t+ 1)= b   ψ ( t )+ω b,ψ ( t )  (17)
 
         [0045]    Here, the offsets are assumed to be slowly time-varying according to a random walk. The heading is assumed to be double integrated white noise, and the speed L(t) is integrated white noise. The position is dead-reckoned from heading and speed. The sampling rate can be time-varying, and T(t) denotes the sample interval at time t. In one embodiment, t denotes the number of steps taken, L(t) is the step length and T(t) the step interval. 
         [0046]    The point with this selection of states is that the measurements in (9) and (10) are now (linear) functions of the state. Similarly, position related measurements as provided by GNSS, radio beacons or proximity sensors are also (linear) functions of the state. In total, the framework fits a standard filtering application, where the extended or unscented Kalman filter, point-mass or particle filters, can be applied. It will be appreciated that other suitable algorithms may be used instead if desired. 
         [0047]    The horizontal motion model (11)-(17) constitutes one instance of a pedestrian odometric model with the purpose of dead-reckoning inertial sensor information into a trajectory. This pedestrian trajectory can be used to monitor the correctness or plausibility of the sensor information. If one of the inertial sensors gives contradictory information or information that results in improbable trajectories, it can be deemed to be an outlier. The odomeric model is thus one instrument for detecting outliers in the measurements. 
         [0048]    Moreover, building information models (BIM) can be used to define feasible pedestrian trajectories that follow corridors and doors, without crossing walls and other obstacles. BIM is thus a further tool to monitor the measurements and another instrument that can be used to detect outliers. 
         [0049]    Building information models can also be handled in the filter framework described above, for instance as constraints on passable areas in the horizontal plane. 
         [0050]    One key point is that supporting information from BIM and position sensors will assist in tracking the offsets and in this way improve the dead-reckoning in intervals with no such information. 
         [0051]    Outlier Rejection of Bad Measurements. 
         [0052]    The virtual sensors in (9) and (10) can both be either reliable or unreliable, depending on the disturbance. This can be phrased as a hypothesis test for each virtual sensor i: 
         [0000]        H   0   (i)   :d   k   (i) =0  (18)
 
         [0000]        H   1   (i)   :d   k   (i) ≠0  (19)
 
         [0053]    To decide if a virtual sensor is reliable at the same time as getting a robust estimate of heading, a filter approach can be done. In a straightforward embodiment, a Kalman filter can be used as follows. 
         [0054]    The hypothesis test in (18) can be implemented using the following tests: 
         [0000]      | y   k   (1) −{circumflex over (ψ)} k   |&lt;h   (1) ,  (20)
 
         [0000]      | y   k   (2) −{circumflex over ({dot over (ψ)})} k   −{circumflex over (b)}   k   |&lt;h   (2)   (21)
 
         [0000]      (22) 
         [0055]    It should be noted that there are many ways to state this and similar tests, for instance by weighting the test statistics with the inverse covariance from the Kalman filter. In an IPS, some of the disturbances can be reoccurring at the same position for all users. This is true for magnetic disturbances, for instance. The device may therefore report the existence and size of the disturbance to a database. This allows for crowd-sourcing of magnetic field disturbances that can be added to the IPS BIM model. 
         [0056]    Three-Dimensional Orientation Models 
         [0057]    The exemplary and illustrative computations leading to (9) can be extended to more advanced three-dimensional navigation models. Here, the rotational dynamics can be stated as a dynamical system using the rotation vector q (Euler angles, quaternions or any other representation deemed useful) and angular rate vector ω using the state vector x(t)=(q T (t), ω T (t), b ω (t), m(t) T . Here, gyro bias and magnetic field are also included in the state vector. 
         [0058]    The continuous time dynamics for this state vector are given by: 
         [0000]      {dot over ( q )}( t )= S ( q ( t ))ω( t ),  (23)
 
         [0000]      {dot over (ω)}( t )= v   ω ( t ),  (24)
 
         [0000]        b   ω ( t )= v   b ( t ),  (25)
 
         [0000]        m ( t )= v   m ( t ),  (26)
 
         [0000]    where v i (t), iε{ω, b, m} are stochastic processes modeling the change in angular rate, gyro bias and magnetic field, respectively. Here, q=q(t) is a continuous time angle, while q k  is the value at a sampling time t k , indexed by k. 
         [0059]    In this 3D case, there is also an option to eliminate the angular rate from the state vector, and the complete model becomes: 
         [0000]      {dot over ( q )}( t )= S ( q ( t ))( y   ω ( t )− b   ω ( t )− e   ω ( t ))  (27)
 
         [0000]        y   k   a   =R ( q   k ) g+b   k   a   +d   k   a   +e   k   a   (28)
 
         [0000]        y   k   m   =R ( q   k ) m+b   k   m   +d   k   m   +e   k   m   (29)
 
         [0060]    Here, d k   (i)  for iε{m, a} is a possible disturbance on magnetometer (m) and accelerometer (a), respectively, and e k   (i)  denotes their measurement noise. 
         [0061]    Just as in the 2D case, we can first include the offset values b in the state vector and learn these on the fly, and second we can pose the problem with disturbances as a hypothesis test, this time directly on the magnetometer and accelerometer) (iε{a, m}): 
         [0000]        H   0   (i)   :d   k   (i) =0,  (33)
 
         [0000]        H   1   (i)   :d   k   (i) ≠0,  (34)
 
         [0062]    A simple hypothesis test is to accept the magnetometer measurement if 
         [0000]      ∥ y   k   m   −R ( {circumflex over (q)}   k ) {circumflex over (m)}   k   ∥&lt;h   m   (35)
 
         [0000]    and for the accelerometer 
         [0000]      ∥ y   k   a   −R ( {circumflex over (q)}   k ) g∥&lt;h   a .  (36)
 
         [0063]    The described embodiments illustrated in 2D and 3D fit into a general nonlinear filtering framework where the state vector is x=(q T  b ω,T  m T ) T . It is also a standard problem to detect the disturbances in the measurements y k  by outlier detection algorithms ( 110 ), and in such case exclude such outliers ( 112 ) from the filter operation. 
         [0064]    The result is a nonlinear filter ( 114 ) that provides the orientation q of the device even during short time accelerations and passages of magnetic field disturbances. The time update in the nonlinear filter involves simulation of the dynamic model from one measurement time to the next one. The model in Equation (30) above is given in continuous time, and can in a standard way be discretized by integrating the measured turn rate. This is preferably done as fast as possible to avoid discretization effects. 
         [0065]    The measurements arrive at a high sampling rate. Since the movement of the user is rather periodic, much can be gained by averaging the accelerometer and magnetometer signals over one complete cycle. The motion pattern would then ideally integrate to zero when moving with constant speed straightforward, and the two disturbances would naturally be zero. This approach requires that the period time of the motion pattern is known, which requires an external input. Here, a standard step detection algorithm can be used. 
         [0066]    In one embodiment, the particle filter is used as a nonlinear filter. It has many nice features for indoor navigation. The disturbances we anticipate in Equations (1-3) that we want to detect can be summarized as follows: 
         [0067]    The disturbance d k   a  is due to a linear acceleration of the device. This can be caused by user operation of the device, which implies problem to find the downward direction and the orientation q of the device. 
         [0068]    The disturbance d k   m  is due to hard and soft iron in the environment, that gives rise to a magnetic field that is superimposed on the earth magnetic field that is used to find that compass direction. 
         [0069]    What we mean by outlier is thus a disturbance, including the ones above, that would be falsely interpreted as motion-related if not detected and treated appropriately in the IPS. An outlier can also be caused in the sensor itself, rather than by the user or the environment. 
         [0070]    For instance, it can handle the nonlinear rotation operations without approximation, and it can evaluate a large number of hypotheses on the trajectory in real-time on standard devices. For this approach, it adds the benefit of soft decisions. That is, normally an outlier rejection test or hypothesis test leads to a hard decision that is fed back to the filter. An incorrect decision will then lead to a decision feedback problem that may cause divergence in the filter. The feature of having a large number of independent hypotheses in the particle filter enables soft decisions. 
         [0071]    While there are other application scenarios for the illustrated system and process, this document will not attempt to catalog all such uses. Those of skill in the art will appreciate that there are many possible embodiments to which the principles of the present disclosure may be applied. The embodiments described herein with respect to the drawing figures are meant to be illustrative only and should not be taken as limiting the scope of the claims. Therefore, the techniques as described herein contemplate all such embodiments as may come within the scope of the following claims and equivalents thereof.