The fourth concrete implementation mode: the difference between this embodiment mode and one of the first to third embodiment modes is: the method for fusing the map information and the PDR estimation result through particle filtering in the third step is as follows:
particle filtering is a bayesian filtering method that approximates the posterior probability by using the monte carlo method, without requiring the motion system to be linear or gaussian;
firstly, the state equation of the adopted particle filter is as follows:
<math><mrow>
<msub>
<mi>s</mi>
<mi>k</mi>
</msub>
<mo>=</mo>
<mfenced open='[' close=']'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>k</mi>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>y</mi>
<mi>k</mi>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>=</mo>
<mfenced open='[' close=']'>
<mtable>
<mtr>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mn>0</mn>
</mtd>
<mtd>
<mrow>
<mo>(</mo>
<msub>
<mi>l</mi>
<mi>k</mi>
</msub>
<mo>+</mo>
<msubsup>
<mi>n</mi>
<mi>k</mi>
<mi>l</mi>
</msubsup>
<mo>)</mo>
</mrow>
<mo>·</mo>
<mi>cos</mi>
<mrow>
<mo>(</mo>
<mo>·</mo>
<mo>)</mo>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>0</mn>
</mtd>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mrow>
<mo>(</mo>
<msub>
<mi>l</mi>
<mi>k</mi>
</msub>
<mo>+</mo>
<msubsup>
<mi>n</mi>
<mi>k</mi>
<mi>l</mi>
</msubsup>
<mo>)</mo>
</mrow>
<mo>·</mo>
<mi>sin</mi>
<mrow>
<mo>(</mo>
<mo>·</mo>
<mo>)</mo>
</mrow>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>·</mo>
<mtable>
</mtable>
<mfenced open='' close=''>
<mrow>
<mtable>
</mtable>
</mrow>
</mfenced>
<mrow>
<mo>(</mo>
<mfenced open='[' close=']'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>k</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>y</mi>
<mrow>
<mi>k</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>h</mi>
<mi>k</mi>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>+</mo>
<mfenced open='' close=''>
<mtable>
</mtable>
</mfenced>
<mfenced open='[' close=']'>
<mtable>
<mtr>
<mtd>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<msubsup>
<mi>n</mi>
<mi>k</mi>
<mi>h</mi>
</msubsup>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>)</mo>
</mrow>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>5</mn>
<mo>)</mo>
</mrow>
</mrow></math>
wherein x isk,ykDenotes the position coordinate at step k, xk-1,yk-1Position coordinates representing the k-1 st step, hkIs the estimated heading angle of the vehicle,in order to estimate the error for the step size,for course angle estimation error, lkIs the representation? Sin (·), cos (·) respectively represents solving sine value and cosine value of corresponding angle;
secondly, weighting values w for all the particles in the k stepiAnd (3) calculating:
<math><mrow>
<msub>
<mi>w</mi>
<mi>i</mi>
</msub>
<mo>=</mo>
<mfenced open='{' close=''>
<mtable>
<mtr>
<mtd>
<mi>exp</mi>
<mrow>
<mo>(</mo>
<mo>-</mo>
<mfrac>
<msup>
<mrow>
<mo>|</mo>
<mo>|</mo>
<msubsup>
<mi>pos</mi>
<mi>k</mi>
<mi>PDR</mi>
</msubsup>
<mo>-</mo>
<msubsup>
<mi>pos</mi>
<mi>k</mi>
<mi>i</mi>
</msubsup>
<mo>|</mo>
<mo>|</mo>
</mrow>
<mn>2</mn>
</msup>
<mrow>
<mn>2</mn>
<msup>
<mi>σ</mi>
<mn>2</mn>
</msup>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mo>,</mo>
<mi>condition</mi>
<mo>_</mo>
<mn>1</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>0</mn>
<mo>,</mo>
<mi>condition</mi>
<mo>_</mo>
<mn>2</mn>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>6</mn>
<mo>)</mo>
</mrow>
</mrow></math>
whereinRepresenting the estimated location of the PDR for the k-th step Denotes the position of the ith particle in the k-th step, σ denotes the standard deviation of the PDR position estimate, and w is the position of the particle generated in the k-th step when it is not within the valid position rangeiTaking a value of 0, otherwise, calculating a weight according to condition _ 1;
thirdly, fusing the map information and the PDR estimation result through particle filtering:
obtaining all the weight values w of the particles in the k stepiThen according to wiThe estimated position of the k-th step using particle filtering is calculated:
<math><mrow>
<msubsup>
<mi>pos</mi>
<mi>k</mi>
<mi>PF</mi>
</msubsup>
<mo>=</mo>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>Np</mi>
</munderover>
<msub>
<mover>
<mi>w</mi>
<mo>~</mo>
</mover>
<mi>i</mi>
</msub>
<mo>·</mo>
<msubsup>
<mi>pos</mi>
<mi>k</mi>
<mi>i</mi>
</msubsup>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>7</mn>
<mo>)</mo>
</mrow>
</mrow></math>
wherein Np represents the number of particles in the k-th step,representing the estimated position of the ith particle in the k stepCalculated according to equation (5), to normalize the weight values, by the following equation:
<math><mrow>
<msub>
<mover>
<mi>w</mi>
<mo>~</mo>
</mover>
<mi>i</mi>
</msub>
<mo>=</mo>
<mfrac>
<msub>
<mi>w</mi>
<mi>i</mi>
</msub>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>Np</mi>
</munderover>
<msub>
<mi>w</mi>
<mi>i</mi>
</msub>
</mrow>
</mfrac>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>8</mn>
<mo>)</mo>
</mrow>
</mrow></math>
and continuously carrying out particle filtering on the position estimated by the PDR to obtain a new estimated position.
The state estimation of a dynamic system is generally described by two equations, respectively: sk=F(sk-1,nk-1) (9)
The observation equation: m isk=G(sk,vk) (10)
Wherein F (-), G (-) are the system states sk-1,skFunction of skIs a state variable at time k, mkIs s iskOf the observed value, system noise nkAnd observation noise vkRandom variables with known probability density, which are independent of each other and the system state;
other steps and parameters are the same as those in one of the first to third embodiments.
In the following detailed description of the embodiments, the pedestrian position tracking method based on the inertial sensor is implemented by the following steps:
firstly, step detection and step length estimation are carried out according to an acceleration sensor:
the first embodiment will be described in detail with reference to fig. 2 and 3. Fig. 2 is a plan view illustration of 12 levels of a 2A campus of harbin university of industry, experimented in an inertial sensor based pedestrian location tracking in a corridor (dark filled area in the figure) of the floor, the corridor being about 3 meters wide and about 90 meters long. In fig. 3 is shown the posture of the tester holding the handset in the experimental test, as well as the Sensor coordinate system (Sensor coordinate system), the navigation coordinate system (E-N coordinate system) in the handset.
In the walking process of a person, different parts of the body can change at different accelerated speeds, but the different parts are regular, so that information can be extracted from the acceleration, and whether the person walks or stops and other actions can be identified. The step is detected by adopting a peak-zero value-valley value-time interval (PZVT) method, namely, each step of walking comprises 1 maximum acceleration, 2 zero values and 1 minimum acceleration (as shown in figure 4), the time interval is reasonable, the walking speed at the constant speed of the adult is 2-4 steps per second, and the lower limit of the time interval is set to be 250 milliseconds. The apex box of the waveform represents the detected valid step, S0Indicating start, SiAnd i is 1 … 9, indicating the ith step.
The actual measurement PZVT step detection algorithm shows that the accuracy of the step detection algorithm adopted by the embodiment is basically 100%, namely the situations of false detection, missed detection and multiple detection rarely occur.
The step length is not only related to the height of a person, but also related to factors such as the step frequency in walking, and the like, and the same person has a difference in each step in walking, so that the step length estimation is a very challenging problem. This patent uses the formula
<math><mrow>
<mi>sLen</mi>
<mo>=</mo>
<mi>k</mi>
<mo>·</mo>
<mroot>
<msub>
<mi>acc</mi>
<mi>Ave</mi>
</msub>
<mn>3</mn>
</mroot>
<mo>,</mo>
<msub>
<mi>acc</mi>
<mi>Ave</mi>
</msub>
<mo>=</mo>
<mfrac>
<mrow>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>i</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>N</mi>
</munderover>
<mo>|</mo>
<msub>
<mi>acc</mi>
<mi>i</mi>
</msub>
<mo>|</mo>
</mrow>
<mi>N</mi>
</mfrac>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>)</mo>
</mrow>
</mrow></math>
Where sLen is the estimated step size, acci、accAveThe method respectively represents an acceleration value and an average acceleration value in each step, k is a coefficient corresponding to each method, the value of the method is 1.07, and N represents the number of data acquired in one step.
And secondly, estimating a course angle according to the data measured by the gyroscope. Considering that the mobile phone is not always in the aforementioned basic posture during actual walking, such as slight left-right swing along with the alternation of the steps of the pedestrian during walking, and angular disturbance caused by the up-down fluctuation of the center of gravity, etc., the first step of correction is performed by using (3):
heading=c1·Pitch+c2·Roll+c3·Azimuth (2)
wherein Pitch, Roll, Azimuth correspond to FIG. 2, wherein the rotation amounts around the three axes x, y, z are Pitch angle, Roll angle, Azimuth angle, respectively, and are denoted as Pitch, Roll, Azimuth, c1,c2,c3The corresponding weighting coefficients are obtained by testing in an actual scene, and are assigned as c in the experiment1=1,c2=0.3,c30.1. On the basis, the obtained angle is subjected to second-step correction, namely successive smoothing, mainly to prevent a burr value from appearing to influence the course angle precision in a certain step, but the smoothing is only limited to a straight line walking or a relatively stable process, such as a horizontal segment of a curve in fig. 5, and the calculation is specifically carried out by the following formula
<math><mrow>
<msub>
<mi>heading</mi>
<mi>i</mi>
</msub>
<mo>=</mo>
<mi>mean</mi>
<mrow>
<mo>(</mo>
<munderover>
<mi>Σ</mi>
<mrow>
<mi>k</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mi>i</mi>
</munderover>
<msub>
<mi>heading</mi>
<mi>k</mi>
</msub>
<mo>)</mo>
</mrow>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>4</mn>
<mo>)</mo>
</mrow>
</mrow></math>
Where mean (-) means taking the average.
And thirdly, fusing the map information and the PDR estimation result through particle filtering. And simplifying the motion model relative to Kalman Filtering (KF, Kalman Filtering) so as to obtain an optimal solution, wherein the particle Filtering does not simplify the model but directly calculates a suboptimal solution of the complex motion model so as to gradually approach the optimal solution. The particle filtering is a Bayes filtering method for approximating the posterior probability by adopting a Monte Carlo method, and initial conditions such as setting a motion model as a linear model and the like are not needed.
The state estimation of a dynamic system is generally described by two equations, one for each
The state equation is as follows: sk=F(sk-1,nk-1) (9)
The observation equation: m isk=G(sk,vk) (10)
Wherein F (-), G (-) are the system states sk-1,skFunction of skIs a state variable at time k, mkIs s iskOf the observed value, system noise nkAnd observation noise vkAre random variables whose probability densities are known, independent of each other, and independent of the system state.
The state equation of the particle filter adopted in the present embodiment is
<math><mrow>
<msub>
<mi>s</mi>
<mi>k</mi>
</msub>
<mo>=</mo>
<mfenced open='[' close=']'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mi>k</mi>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>y</mi>
<mi>k</mi>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>=</mo>
<mfenced open='[' close=']'>
<mtable>
<mtr>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mn>0</mn>
</mtd>
<mtd>
<mrow>
<mo>(</mo>
<msub>
<mi>l</mi>
<mi>k</mi>
</msub>
<mo>+</mo>
<msubsup>
<mi>n</mi>
<mi>k</mi>
<mi>l</mi>
</msubsup>
<mo>)</mo>
</mrow>
<mo>·</mo>
<mi>cos</mi>
<mrow>
<mo>(</mo>
<mo>·</mo>
<mo>)</mo>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>0</mn>
</mtd>
<mtd>
<mn>1</mn>
</mtd>
<mtd>
<mrow>
<mo>(</mo>
<msub>
<mi>l</mi>
<mi>k</mi>
</msub>
<mo>+</mo>
<msubsup>
<mi>n</mi>
<mi>k</mi>
<mi>l</mi>
</msubsup>
<mo>)</mo>
</mrow>
<mo>·</mo>
<mi>sin</mi>
<mrow>
<mo>(</mo>
<mo>·</mo>
<mo>)</mo>
</mrow>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>·</mo>
<mtable>
</mtable>
<mfenced open='' close=''>
<mrow>
<mtable>
</mtable>
</mrow>
</mfenced>
<mrow>
<mo>(</mo>
<mfenced open='[' close=']'>
<mtable>
<mtr>
<mtd>
<msub>
<mi>x</mi>
<mrow>
<mi>k</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>y</mi>
<mrow>
<mi>k</mi>
<mo>-</mo>
<mn>1</mn>
</mrow>
</msub>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>h</mi>
<mi>k</mi>
</msub>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>+</mo>
<mfenced open='' close=''>
<mtable>
</mtable>
</mfenced>
<mfenced open='[' close=']'>
<mtable>
<mtr>
<mtd>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<msubsup>
<mi>n</mi>
<mi>k</mi>
<mi>h</mi>
</msubsup>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>)</mo>
</mrow>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>5</mn>
<mo>)</mo>
</mrow>
</mrow></math>
Wherein x isk,ykDenotes the position coordinates at step k, hkIs the estimated heading angle according to embodiment two,in order to estimate the error for the step size,and (3) estimating an error, sin (·), cos (·) for the course angle, wherein the sin value and the cosine value of the corresponding angle are solved respectively.
<math><mrow>
<msub>
<mi>w</mi>
<mi>i</mi>
</msub>
<mo>=</mo>
<mfenced open='{' close=''>
<mtable>
<mtr>
<mtd>
<mi>exp</mi>
<mrow>
<mo>(</mo>
<mo>-</mo>
<mfrac>
<msup>
<mrow>
<mo>|</mo>
<mo>|</mo>
<msubsup>
<mi>pos</mi>
<mi>k</mi>
<mi>PDR</mi>
</msubsup>
<mo>-</mo>
<msubsup>
<mi>pos</mi>
<mi>k</mi>
<mi>i</mi>
</msubsup>
<mo>|</mo>
<mo>|</mo>
</mrow>
<mn>2</mn>
</msup>
<mrow>
<mn>2</mn>
<msup>
<mi>σ</mi>
<mn>2</mn>
</msup>
</mrow>
</mfrac>
<mo>)</mo>
</mrow>
<mo>,</mo>
<mi>condition</mi>
<mo>_</mo>
<mn>1</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>0</mn>
<mo>,</mo>
<mi>condition</mi>
<mo>_</mo>
<mn>2</mn>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>6</mn>
<mo>)</mo>
</mrow>
</mrow></math>
WhereinRepresenting the estimated location of the PDR for the k-th stepDenotes the position of the ith particle at step k, and σ denotes the standard deviation of the PDR position estimate. When a particle generated in the k step is not in the effective position range (such as wall penetration, etc.), wiAnd taking a value of 0, otherwise, calculating the weight according to condition _ 1.
The specific implementation process is as follows: firstly, an initial position (0, 0) is given, whether an effective step is detected, if yes, the step length and the course angle are estimated, a rough position is estimated through PDR according to the step length and the course angle, the positions of the particles are calculated by combining 100 randomly generated particles (regeneration is needed in each step), then the weight of each particle is calculated according to the condition (8), the positions of all the particles are weighted and summed to obtain the position after PF filtering, then the next position estimation is carried out by repeating the above process, and thus, the position tracking of the pedestrian is realized.
And fourthly, finally, acquiring data through a NEXUS5 smart phone in the experimental environment shown in the figure 3 (according to the posture of the mobile phone in the figure 2, a tester holds the mobile phone to walk around the experimental corridor to record the data), wherein the acquired data comprise acceleration values, angular velocity values and sampling time, then performing simulation calculation in MATLAB2012b, and finally obtaining a curve shown in the figure 6 according to the proposed algorithm. It can be seen that the pedestrian position estimation method through the PZVT step detection, the course angle correction and the PF fusion map information improves the estimation accuracy compared with the method of estimating the position only by using the PDR.
Firstly, an initial position (0, 0) is given, whether an effective step is detected, if yes, the step length and the course angle are estimated, a rough position is estimated through PDR according to the step length and the course angle, the positions of the particles are calculated by combining 100 randomly generated particles (regeneration is needed in each step), then the weight of each particle is calculated according to conditions, the positions of all the particles are weighted and summed to obtain the position after PF filtering, then the process is repeated to carry out next position estimation, and therefore the position of each step is repeatedly calculated, and the position tracking of pedestrians is achieved.