Indoor positioning method based on pedestrian inertial navigation and map
By combining the indoor positioning method of Kalman filtering and hidden Markov models, and using IMU and map matching technology, the problem of indoor positioning error accumulation and external signal dependence is solved, and high-precision autonomous navigation and trajectory matching are achieved.
Patent Information
- Application Number
- CN202410235507.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-01
- Publication Date
- 2024-09-06
AI Technical Summary
Existing indoor positioning technology has problems with accumulation of positioning errors and dependence on external signals in complex environments. Especially in weakened GPS signals, insufficient WiFi coverage, or emergency scenarios, it is difficult to achieve high-precision autonomous navigation.
The method of combining the pedestrian inertial navigation system based on Kalman filter and hidden Markov map matching is used to process the IMU data through LSTM, perform zero speed detection and step constraint correction, combine the magnetometer and barometer information, and use HDBSCAN to cluster landmarks , and use the Viterbi algorithm to optimize the positioning results.
It achieves high-precision autonomous navigation in complex indoor environments, reduces inertial navigation errors, improves zero-speed detection accuracy, and can match pedestrian trajectories for positioning when the initial position is unknown.
Smart Images

Figure CN118603085A
Abstract
Description
Technical Field
[0001] The invention belongs to the field of indoor inertial positioning, and in particular relates to a map matching method combining a pedestrian inertial navigation algorithm based on Kalman filtering and a map. Background Art
[0002] GPS is a very mature positioning technology currently in use, but due to multipath effects and poor signal penetration, GPS signals are difficult to use indoors. MEMS (Micro-Electro-Mechanical Systems) IMU (Inertial Measurement Unit) is an inertial sensor combination manufactured using micro-electromechanical system technology, including accelerometers and gyroscopes. This technology is widely used in modern navigation, motion control, unmanned systems and other fields. MEMS IMU has the advantage of not relying on external signals. At the same time, its miniaturization and lightweight advantages make it easy for pedestrians to wear indoors. It also has the advantages of low cost and low power consumption. It is the core component of indoor navigation. The inertial data of IMU can be used to determine the pedestrian's gait, step length and heading, and can achieve autonomous positioning of pedestrians.
[0003] Although IMU-based indoor positioning technology has been developed, due to gyroscope errors and acceleration errors, the positioning error of inertial navigation accumulates over time. Usually, inertial navigation is combined with WiFi signal navigation to achieve positioning. To obtain higher accuracy, a WiFi fingerprint library needs to be built, but the initial establishment of the WiFi fingerprint library requires a lot of manpower and time. There are also problems such as indoor environments not covered by WiFi or changes in the location of WiFi access points, which require fingerprint library maintenance. Ultrawideband (UWB) is susceptible to multipath effects and requires the establishment of related infrastructure access points in advance. Vision-based applications are also relatively widespread, but in emergency scenarios such as sudden fires indoors, the visibility of the room decreases due to thick smoke. At this time, the camera cannot extract feature points. The positioning method that relies on external radio facilities and visual assistance PDR is subject to large external interference and has a high positioning cost. Summary of the invention
[0004] To solve the above problems, the present invention discloses an indoor positioning method based on pedestrian inertial navigation and map, which integrates the pedestrian inertial navigation system based on Kalman filtering and hidden Markov map matching, and can realize autonomous navigation in complex indoor environments.
[0005] To achieve the above object, the technical solution of the present invention is as follows:
[0006] The indoor positioning method based on pedestrian inertial navigation and map includes the following steps:
[0007] Step 1: Use LSTM (Long Short Term Memory, LSTM) recursive neural network to process the training imu data to determine whether the pedestrian is in motion or stationary state;
[0008] Step 2: Establish a cascade structure. The upper layer is based on HMM map matching, and the lower layer is based on Kalman filter inertial navigation. For the lower structure, use zero speed correction, zero angular velocity update, magnetometer correction heading angle, heuristic heading update and step constraint to correct the positioning result of inertial navigation. The step size uses the Weinberg adaptive step size estimation model, and the barometer is used to determine the floor information.
[0009] Step 3: Detect seed landmarks (such as stairs, elevators, etc.) and organic landmarks (magnetic anomalies, indoor corners, etc.) in the room, classify the two landmarks using the HDBSCAN clustering algorithm, and obtain the landmark positions after matching the landmark library for subsequent updating of the HMM emission probability;
[0010] Step 4: The lower-layer Kalman filter-based inertial navigation system provides the pedestrian's step length and heading information for each step to the upper-layer HMM-based map matching. The upper-layer map matching updates the HMM transition probability based on the step length and heading information provided by the lower layer and the graph model, and uses the Viterbi algorithm to calculate the optimal path and optimize the positioning result.
[0011] Preferably, the step 1 specifically includes the following process:
[0012] Step 1.1: Generate a training set and use the SHOE detector (Stance Hypothesis Optimal Estimation) on the imu dataset to determine whether the pedestrian is in a zero-speed detection state. The SHOE detector combines accelerometer data and gyroscope data for comprehensive judgment, and has a higher detection accuracy when the pedestrian walks with a certain gait. Use the RBF kernel function SVM to train the imu dataset with known pedestrian gaits to determine whether the pedestrian is walking or running, optimize the threshold of the SHOE detector, and effectively improve the accuracy of data annotation (when the pedestrian is in a zero-speed state). The formula of the SHOE detector is as follows:
[0013]
[0014]
[0015] Among them, c k is the amount of calculation for zero speed detection. If c k If the speed is less than the threshold γ, the pedestrian is considered to be in a zero-speed state. The threshold γ is determined through experiments. The threshold is adjusted under different gaits to minimize the error between the KF-based inertial navigation positioning result and the actual position. N is the sampling point range, a iAccelerometer measurement, w i is the gyroscope measurement value, is the average acceleration over a period of time, g is the modulus of the gravity vector, and is the noise variance of the accelerometer and gyroscope;
[0016] Step 1.2: Use the labeled training set to train the model. Input the IMU data sequence into the LSTM model, perform supervised learning based on the label, and train the LSTM model based on the standard cross entropy loss function. The cross entropy loss function expression is:
[0017]
[0018] where p i For prediction, y i is the true value.
[0019] LSTM consists of several layers. The last layer has two units and is fully connected to the previous layer. The softmax function is used to convert the two data to between 0 and 1 to determine whether the pedestrian is in a zero-speed state. The trained LSTM model can determine whether the pedestrian is in a zero-speed state in real time, and the judgment accuracy is significantly improved compared to the optimal zero-speed detection algorithm.
[0020] Preferably, the step 2 specifically includes the following process:
[0021] Step 2.1: Use the inertial strapdown navigation algorithm to calculate the pedestrian's posture, speed and position in real time:
[0022]
[0023] Among them, and are all vector values in the carrier coordinate system. is the rotation angular velocity of the carrier coordinate system relative to the navigation coordinate system, is the specific force measured by acceleration in the carrier coordinate system; and n is the vector value in the navigation coordinate system, is the angular velocity of the Earth-centered Earth-fixed coordinate system relative to the inertial coordinate system, is the angular velocity of the navigation coordinate system relative to the Earth-centered Earth-fixed coordinate system, g n is the acceleration due to gravity.
[0024] The attitude, velocity and position error differential equations are:
[0025]
[0026] Where φ is the attitude angle error, δvn is the velocity error, δp is the position error, and is the vector value in the navigation coordinate system, is the angular velocity of the navigation coordinate system relative to the inertial coordinate system, is the angular velocity of the carrier coordinate system relative to the inertial coordinate system, is the specific force of acceleration measurement in the navigation coordinate system.
[0027] Formulate a linear stochastic differential equation for the error vector:
[0028]
[0029] Where F(t) and G(t) are deterministic time-varying matrices that change with time, and w(t) is a zero-mean Gaussian white noise vector. Discretize the continuous-time system differential equation. Since the frequency of imu is very high and the sampling time is extremely short, the state one-step matrix is approximated as:
[0030]
[0031] Where I is the identity matrix, Δt is the sampling interval, and the state equation and observation equation of Kalman filtering are established:
[0032]
[0033] Z k =H k X k +V k
[0034] The state variable X k is a 15-dimensional error vector, including the attitude error Speed error δv n , position error δp, accelerometer estimation bias b a and the gyro estimated bias b g . is the state one-step matrix, H k is the observation matrix, Γ k-1 is the noise allocation matrix, W k-1 is the system noise vector, V k is the measurement noise vector. Due to the nonlinear problem, the Kalman filter part in this method can be replaced by all nonlinear filtering methods such as extended Kalman filter, unscented Kalman filter and particle filter.
[0035] Step 2.2: The walking state of the pedestrian is judged in real time according to the LSTM zero-speed detector. In the zero-speed stage, zero-speed correction, zero angular velocity update, magnetometer-corrected heading angle, heuristic heading update, and step-size constraint are used to suppress the accumulation of inertial navigation system errors over time. The errors are corrected entirely based on the sensor information generated by the inertial sensor and magnetometer.
[0036] Zero speed update: When the pedestrian is in zero speed state, the foot tied to the imu is relatively still with the ground. The speed of the inertial navigation system based on KF is taken as the speed error. The speed calculated by the inertial system at zero speed is set as v k , the observation equation is:
[0037] z v =v k -[0,0,0] T =δv k
[0038] Zero angular velocity update: When the pedestrian is in the zero speed state, the angular velocity is set to zero. At this time, the angular velocity of the inertial navigation system based on KF is used as the angular velocity error. The angular velocity calculated by the inertial system at zero speed is set to w k , the observation equation is:
[0039] z w =w k -[0,0,0] T =δw k
[0040] Magnetometer correction of heading angle: Although metal places indoors will interfere with magnetometer measurement, using a magnetometer to calculate heading when the indoor environment is stable can still improve the heading angle calculation accuracy to a certain extent. When the pedestrian is at zero speed, the pitch angle and roll angle are both approximately zero. The heading angle is calculated based on the magnetometer measurement value:
[0041]
[0042] in and is the measured value of the x-axis and y-axis of the magnetometer. Assume that the heading angle obtained by the inertial navigation system at time k is The observed value is the difference between the heading angle calculated by the inertial system and the heading angle calculated by the magnetometer:
[0043]
[0044] Heuristic heading update: When pedestrians walk, their heading remains basically unchanged in indoor corridors and other places. This feature can be used to provide heading correction for the KF-based navigation system. Compare the heading values updated by the strapdown algorithm, taking the average heading value of the previous three moments as the benchmark. If the heading value at time k is If the difference between the heading average value of the previous three moments is less than the threshold, a heading correction value is provided at time k. If the difference is greater than the threshold, no feedback value is provided. The difference threshold is set to
[0045]
[0046]
[0047] Step size constraint: The Weinberg adaptive step size formula is used to calculate the step size, and the positioning result of the KF-based inertial navigation system is constrained by the step size. The adaptive step size formula is:
[0048]
[0049] Where β is the gait parameter, and each pedestrian has a different value according to their height and gait frequency. max and a min are the maximum and minimum values of the z-axis acceleration in one step. The uncorrected position at time k is p k =(x k ,y k ,z k ) T , let d k is the distance between the two positions mentioned above:
[0050]
[0051] The observation equation for the step-size constraint is as follows: the distance between the positions solved by INS at adjacent moments and the adaptive step-size are subtracted as the step-size constraint observation z step , H adpt is the observation matrix about the step size constraint:
[0052] z step =d k -m k =H adpt δp+v m
[0053]
[0054] Combining the above constraint methods, the observation matrix is an 8×15-dimensional matrix, and the order of observations is the velocity difference z v , angular velocity difference z w , heading angle difference (including z mag and z heu ) and the step-length observation z step :
[0055]
[0056] Preferably, the step 3 specifically includes the following process:
[0057] Taking into account the known positions of seed landmarks (such as elevators, stairs, etc.) and organic landmarks (magnetic anomalies detected by magnetometers, turning points, door landmarks, etc.), two types of landmarks are used to correct positioning during map matching. Seed landmarks identify staircase or elevator landmarks through the regularity of accelerometer readings, or staircase or elevator landmarks through barometer data. Organic landmarks such as magnetic anomalies are identified by magnetometers, turning points can be identified by the change in the angle of gyroscope integration, and door landmarks can be identified by the change in acceleration amplitude before and after pedestrians push the door.
[0058] HDBSCAN has the characteristics of hierarchical structure and stability selection, and can automatically determine the optimal number of clusters. HDBSCAN is used to cluster seed landmarks and organic landmarks, and the barometer is combined to obtain floor change information. After identifying the type of landmark, it is planned to use confidence matching to match the location of the landmark in the landmark library to provide the emission probability for the upper layer map matching based on the hidden Markov model. Suppose the location of the matching landmark is o t =(x l ,y l ,z l ), let the state variable in HMM be s i , in s i Get observation o t The probability is:
[0059]
[0060] Among them, σ r is the standard deviation of the landmark position; the lower layer Kalman filter-based inertial navigation system solves the pedestrian's posture, speed and position information at the imu frequency. According to the zero-speed detection, when the system is in the zero-speed state, the inertial information is provided to the upper layer map matching system based on the hidden Markov model, and the heading change and step length of each step are calculated according to the heading angle and position in the zero-speed stage. For example, at the k-1th time, the heading is The heading at time k is The direction changes are:
[0061]
[0062] The step length at time K is:
[0063]
[0064] Preferably, step 4 specifically includes the following process:
[0065] Step 4.1: First build an indoor directed graph model: 1) Set up a node model, set nodes in the map, select the central axis to form a one-dimensional topology for narrow structures such as corridors, and select points 1 meter apart as nodes on the one-dimensional topology; for indoor spaces and wider areas such as halls, set a two-dimensional grid with a side length of 1 meter, and the center point of the grid is the node. Record the location of the node:
[0066] s=<x,y>
[0067] 2) Set the edge model, where s from is the starting node of the edge, s to is the end node of the edge, and the third dimension records the direction of the edge:
[0068] e= from ,s to ,ori>
[0069] 3) Set graph model constraints. For any two edges in the graph, the state transition probability exists only when the end node of edge i is equal to the start node of edge j. At the same time, since people may stay at a certain location indoors for a while, such as admiring calligraphy and paintings in a museum, buying drinks in front of a vending machine, stopping to check mobile phone messages, etc., there is also a state transition probability from edge i to edge i. Record the state transition matrix.
[0070] S4.2: Update the transition probability between states according to the direction change of the pedestrian and the cumulative length. Set the direction change of each step of the pedestrian to α, and the direction change from edge i to edge j to β, and obtain the state transition probability from edge i to edge j:
[0071]
[0072] where σ h is the standard deviation of the pedestrian direction measurement; at the same time, the cumulative length change of pedestrian displacement is used as auxiliary information of the transition probability; let the edge sequence matched at time t be edge i, and the cumulative length of the matched edge sequence at this time is recorded as The length of the pedestrian's trajectory at time t is The pedestrian displacement calculated by the lower inertial system between time t and time t+1 is Then the length of the pedestrian’s trajectory at t+1 is:
[0073]
[0074] The edge transition probability related to the change in the cumulative length of the pedestrian's displacement is:
[0075]
[0076] Among them j For edge e j The length ofl is the standard deviation of pedestrian displacement; combined with the change in pedestrian direction, the change in the cumulative length of pedestrian displacement, and the direction and length information of each edge in the graph model, the edge e i To the edge j The overall transition probability is:
[0077]
[0078]
[0079] a ij It is edge i To the edge j The overall transition probability, G(e j ,e i ) means that when edge e i To the edge j The value is 1 if the graph model constraints are met, otherwise it is 0.
[0080] Step 4.3: Use the Viterbi algorithm to find the corresponding hidden sequence that is most likely to produce the observed event. Assume that the direction change sequence obtained from the lower layer is (α1, α2, …, α T ), the displacement cumulative length change sequence is (traj1, traj2, …, traj T ). The Viterbi algorithm recursively calculates the highest probability path for each state. This step considers the transition probability and emission probability from the previous state to the current state. When no landmark is detected, the emission probability is 1. When a landmark is detected, the emission probability is related to the landmark position. The emission probability is calculated as follows:
[0081]
[0082] Starting from time 1, for each state i, calculate all the transition probabilities that can be transferred to state i from the previous moment according to the direction change sequence and the displacement cumulative length change sequence, and record the maximum value of the current state probability and the state node at the previous moment that makes the current state probability value the largest. Let δ t (i) is the maximum probability of all single paths in state i at time t, and we can get δ t The recursive formula is:
[0083]
[0084] Record the state node of the previous moment to trace back the optimal path:
[0085]
[0086] In the Viterbi decoding process, the maximum probability at time T is the probability P of the optimal path. *, and get the end node of the optimal path Calculate at time T, δ T (i)(i=1,2,…,n) the maximum value from the optimal path Start by backtracking from back to front to get the optimal path
[0087]
[0088]
[0089]
[0090] After obtaining the optimal path, set k When the edge matched in the graph model is e i , at t k+n The new adjacent edge matched at the moment is e j , use interpolation to get t k and t k+n The positioning result at each moment in .
[0091] The beneficial effects of the present invention are:
[0092] 1. A cascaded Kalman filter and HMM indoor positioning structure is proposed. The upper layer is based on HMM map matching, and the lower layer is based on Kalman filter inertial navigation. The lower layer uses zero-speed correction, zero angular velocity update, magnetometer-corrected heading angle, heuristic heading update and step-size constraint to reduce the positioning error of inertial navigation and realize autonomous high-precision navigation of pedestrians.
[0093] 2. In the map matching process, the pedestrian direction change, walking distance change and landmark detection provided by the lower-level inertial navigation system are used to obtain the global optimal matching result. When the initial position of the pedestrian is unknown, the pedestrian trajectory can also be matched to achieve positioning.
[0094] 3. The LSTM zero-speed detector can accurately detect the zero-speed state of pedestrians when they are running or walking at a normal speed, thereby improving the accuracy of zero-speed detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] Figure 1 The schematic diagram of the indoor positioning method based on pedestrian inertial navigation and map of the present invention;
[0096] Figure 2 This is a flow chart of the indoor positioning method based on pedestrian inertial navigation and map of the present invention. DETAILED DESCRIPTION
[0097] The present invention will be further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0098] The indoor positioning method based on pedestrian inertial navigation and map described in the present invention is implemented as follows Figure 1 The experimental process is as shown in Figure 2 The process mainly includes the following steps:
[0099] Step 1: Use LSTM (Long Short Term Memory, LSTM) recursive neural network to process the training imu data to determine whether the pedestrian is in motion or stationary state;
[0100] Step 1.1: Generate a training set and use the SHOE detector (Stance Hypothesis Optimal Estimation) on the imu dataset to determine whether the pedestrian is in a zero-speed detection state. The SHOE detector combines accelerometer data and gyroscope data for comprehensive judgment, and has a higher detection accuracy when the pedestrian walks with a certain gait. Use the RBF kernel function SVM to train the imu dataset with known pedestrian gaits to determine whether the pedestrian is walking or running, optimize the threshold of the SHOE detector, and effectively improve the accuracy of data annotation (when the pedestrian is in a zero-speed state). The formula of the SHOE detector is as follows:
[0101]
[0102]
[0103] Among them, c k is the amount of calculation for zero speed detection. If c k If the speed is less than the threshold γ, the pedestrian is considered to be in a zero-speed state. The threshold γ is determined through experiments. The threshold is adjusted under different gaits to minimize the error between the KF-based inertial navigation positioning result and the actual position. N is the sampling point range, a i Accelerometer measurement, w i is the gyroscope measurement value, is the average acceleration over a period of time, g is the modulus of the gravity vector, and is the noise variance of the accelerometer and gyroscope;
[0104] Step 1.2: Use the labeled training set to train the model. Input the IMU data sequence into the LSTM model, perform supervised learning based on the label, and train the LSTM model based on the standard cross entropy loss function. The cross entropy loss function expression is:
[0105]
[0106] where p i For prediction, y i is the true value.
[0107] LSTM consists of several layers. The last layer has two units and is fully connected to the previous layer. The softmax function is used to convert the two data to between 0 and 1 to determine whether the pedestrian is in a zero-speed state. The trained LSTM model can determine whether the pedestrian is in a zero-speed state in real time, and the judgment accuracy is significantly improved compared to the optimal zero-speed detection algorithm.
[0108] Step 2: Establish a cascade structure. The upper layer is based on HMM map matching, and the lower layer is based on Kalman filter inertial navigation. For the lower structure, use zero speed correction, zero angular velocity update, magnetometer correction heading angle, heuristic heading update and step constraint to correct the positioning result of inertial navigation. The step size uses the Weinberg adaptive step size estimation model, and the barometer is used to determine the floor information.
[0109] Step 2.1: Use the inertial strapdown navigation algorithm to calculate the pedestrian's posture, speed and position in real time:
[0110]
[0111] Among them, and are all vector values in the carrier coordinate system. is the rotation angular velocity of the carrier coordinate system relative to the navigation coordinate system, is the specific force measured by acceleration in the carrier coordinate system; and n is the vector value in the navigation coordinate system, is the angular velocity of the Earth-centered Earth-fixed coordinate system relative to the inertial coordinate system, is the angular velocity of the navigation coordinate system relative to the Earth-centered Earth-fixed coordinate system, g n is the acceleration due to gravity.
[0112] The attitude, velocity and position error differential equations are:
[0113]
[0114] Where φ is the attitude angle error, δv n is the velocity error, δp is the position error, and is the vector value in the navigation coordinate system, is the angular velocity of the navigation coordinate system relative to the inertial coordinate system, is the angular velocity of the carrier coordinate system relative to the inertial coordinate system, is the specific force of acceleration measurement in the navigation coordinate system.
[0115] Formulate a linear stochastic differential equation for the error vector:
[0116]
[0117] Where F(t) and G(t) are deterministic time-varying matrices that change with time, and w(t) is a zero-mean Gaussian white noise vector. Discretize the continuous-time system differential equation. Since the frequency of imu is very high and the sampling time is extremely short, the state one-step matrix is approximated as:
[0118]
[0119] Where I is the identity matrix, Δt is the sampling interval, and the state equation and observation equation of Kalman filtering are established:
[0120]
[0121] Z k =H k X k +V k
[0122] The state variable X k is a 15-dimensional error vector, including the attitude error Speed error δv n , position error δp, accelerometer estimation bias b a and the gyro estimated bias b g . is the state one-step matrix, H k is the observation matrix, Γ k-1 is the noise allocation matrix, W k-1 is the system noise vector, V k is the measurement noise vector. Due to the nonlinear problem, the Kalman filter part in this method can be replaced by all nonlinear filtering methods such as extended Kalman filter, unscented Kalman filter and particle filter.
[0123] Step 2.2: The walking state of the pedestrian is judged in real time according to the LSTM zero-speed detector. In the zero-speed stage, zero-speed correction, zero angular velocity update, magnetometer-corrected heading angle, heuristic heading update, and step-size constraint are used to suppress the accumulation of inertial navigation system errors over time. The errors are corrected entirely based on the sensor information generated by the inertial sensor and magnetometer.
[0124] Zero speed update: When the pedestrian is in zero speed state, the foot tied to the imu is relatively still with the ground. The speed of the inertial navigation system based on KF is taken as the speed error. The speed calculated by the inertial system at zero speed is set as v k, the observation equation is:
[0125] z v =v k -[0,0,0] T =δv k
[0126] Zero angular velocity update: When the pedestrian is in the zero speed state, the angular velocity is set to zero. At this time, the angular velocity of the inertial navigation system based on KF is used as the angular velocity error. The angular velocity calculated by the inertial system at zero speed is set to w k , the observation equation is:
[0127] z w =w k -[0,0,0] T =δw k
[0128] Magnetometer correction of heading angle: Although metal places indoors will interfere with magnetometer measurement, using a magnetometer to calculate heading when the indoor environment is stable can still improve the heading angle calculation accuracy to a certain extent. When the pedestrian is at zero speed, the pitch angle and roll angle are both approximately zero. The heading angle is calculated based on the magnetometer measurement value:
[0129]
[0130] in and is the measured value of the x-axis and y-axis of the magnetometer. Assume that the heading angle obtained by the inertial navigation system at time k is The observed value is the difference between the heading angle calculated by the inertial system and the heading angle calculated by the magnetometer:
[0131]
[0132] Heuristic heading update: When pedestrians walk, their heading remains basically unchanged in indoor corridors and other places. This feature can be used to provide heading correction for the KF-based navigation system. Compare the heading values updated by the strapdown algorithm, taking the average heading value of the previous three moments as the benchmark. If the heading value at time k is If the difference between the heading average value of the previous three moments is less than the threshold, a heading correction value is provided at time k. If the difference is greater than the threshold, no feedback value is provided. The difference threshold is set to
[0133]
[0134]
[0135] Step size constraint: The Weinberg adaptive step size formula is used to calculate the step size, and the positioning result of the KF-based inertial navigation system is constrained by the step size. The adaptive step size formula is:
[0136]
[0137] Where β is the gait parameter, and each pedestrian has a different value according to their height and gait frequency. max and a min are the maximum and minimum values of the z-axis acceleration in one step. The uncorrected position at time k is p k =(x k ,y k ,z k ) T , let d k is the distance between the two positions mentioned above:
[0138]
[0139] The observation equation for the step-size constraint is as follows: the distance between the positions solved by INS at adjacent moments and the adaptive step-size are subtracted as the step-size constraint observation z step , H adpt is the observation matrix about the step size constraint:
[0140] z step =d k -m k =H adpt δp+v m
[0141]
[0142] Combining the above constraint methods, the observation matrix is an 8×15-dimensional matrix, and the order of observations is the velocity difference z v , angular velocity difference z w , heading angle difference (including z mag and z heu ) and the step-length observation z step :
[0143]
[0144] Step 3: Detect seed landmarks (such as stairs, elevators, etc.) and organic landmarks (magnetic anomalies, indoor corners, etc.) in the room, classify the two landmarks using the HDBSCAN clustering algorithm, and obtain the landmark positions after matching the landmark library for subsequent updating of the HMM emission probability;
[0145] Taking into account the known positions of seed landmarks (such as elevators, stairs, etc.) and organic landmarks (magnetic anomalies detected by magnetometers, turning points, door landmarks, etc.), two types of landmarks are used to correct positioning during map matching. Seed landmarks identify staircase or elevator landmarks through the regularity of accelerometer readings, or staircase or elevator landmarks through barometer data. Organic landmarks such as magnetic anomalies are identified by magnetometers, turning points can be identified by the change in the angle of gyroscope integration, and door landmarks can be identified by the change in acceleration amplitude before and after pedestrians push the door.
[0146] HDBSCAN has the characteristics of hierarchical structure and stability selection, and can automatically determine the optimal number of clusters. HDBSCAN is used to cluster seed landmarks and organic landmarks, and the barometer is combined to obtain floor change information. After identifying the type of landmark, it is planned to use confidence matching to match the location of the landmark in the landmark library to provide the emission probability for the upper layer map matching based on the hidden Markov model. Suppose the location of the matching landmark is o t =(x l ,y l ,z l ), let the state variable in HMM be s i , in s i Get observation o t The probability is:
[0147]
[0148] Among them, σ r is the standard deviation of the landmark position; the lower layer Kalman filter-based inertial navigation system solves the pedestrian's posture, speed and position information at the imu frequency. According to the zero-speed detection, when the system is in the zero-speed state, the inertial information is provided to the upper layer map matching system based on the hidden Markov model, and the heading change and step length of each step are calculated according to the heading angle and position in the zero-speed stage. For example, at the k-1th time, the heading is The heading at time k is The direction changes are:
[0149]
[0150] The step length at time K is:
[0151]
[0152] Step 4: The lower-layer Kalman filter-based inertial navigation system provides the pedestrian's step length and heading information for each step to the upper-layer HMM-based map matching. The upper-layer map matching updates the HMM transition probability based on the step length and heading information provided by the lower layer and the graph model, and uses the Viterbi algorithm to calculate the optimal path and optimize the positioning result.
[0153] Step 4.1: First build an indoor directed graph model: 1) Set up a node model, set nodes in the map, select the central axis to form a one-dimensional topology for narrow structures such as corridors, and select points 1 meter apart as nodes on the one-dimensional topology; for indoor spaces and wider areas such as halls, set a two-dimensional grid with a side length of 1 meter, and the center point of the grid is the node. Record the location of the node:
[0154] s=<x,y>
[0155] 2) Set the edge model, where s from is the starting node of the edge, s to is the end node of the edge, and the third dimension records the direction of the edge:
[0156] e= from ,s to ,ori>
[0157] 3) Set graph model constraints. For any two edges in the graph, the state transition probability exists only when the end node of edge i is equal to the start node of edge j. At the same time, since people may stay at a certain location indoors for a while, such as admiring calligraphy and paintings in a museum, buying drinks in front of a vending machine, stopping to check mobile phone messages, etc., there is also a state transition probability from edge i to edge i. Record the state transition matrix.
[0158] S4.2: Update the transition probability between states according to the direction change of the pedestrian and the cumulative length. Set the direction change of each step of the pedestrian to α, and the direction change from edge i to edge j to β, and obtain the state transition probability from edge i to edge j:
[0159]
[0160] where σ h is the standard deviation of the pedestrian direction measurement; at the same time, the cumulative length change of pedestrian displacement is used as auxiliary information of the transition probability; let the edge sequence matched at time t be edge i, and the cumulative length of the matched edge sequence at this time is recorded as The length of the pedestrian's trajectory at time t is The pedestrian displacement calculated by the lower inertial system between time t and time t+1 is Then the length of the pedestrian’s trajectory at t+1 is:
[0161]
[0162] The edge transition probability related to the change in the cumulative length of the pedestrian's displacement is:
[0163]
[0164] Among them j For edge e j The length ofl is the standard deviation of pedestrian displacement; combined with the change in pedestrian direction, the change in the cumulative length of pedestrian displacement, and the direction and length information of each edge in the graph model, the edge e i To the edge j The overall transition probability is:
[0165]
[0166]
[0167] a ij It is edge i To the edge j The overall transition probability, G(e j ,e i ) means that when edge e i To the edge j The value is 1 if the graph model constraints are met, otherwise it is 0.
[0168] Step 4.3: Use the Viterbi algorithm to find the corresponding hidden sequence that is most likely to produce the observed event. Assume that the direction change sequence obtained from the lower layer is (α1, α2, …, α T ), the displacement cumulative length change sequence is (traj1, traj2, …, traj T ). The Viterbi algorithm recursively calculates the highest probability path for each state. This step considers the transition probability and emission probability from the previous state to the current state. When no landmark is detected, the emission probability is 1. When a landmark is detected, the emission probability is related to the landmark position. The emission probability is calculated as follows:
[0169]
[0170] Starting from time 1, for each state i, calculate all the transition probabilities that can be transferred to state i from the previous moment according to the direction change sequence and the displacement cumulative length change sequence, and record the maximum value of the current state probability and the state node at the previous moment that makes the current state probability value the largest. Let δ t (i) is the maximum probability of all single paths in state i at time t, and we can get δ t The recursive formula is:
[0171]
[0172] Record the state node of the previous moment to trace back the optimal path:
[0173]
[0174] In the Viterbi decoding process, the maximum probability at time T is the probability P of the optimal path. *, and get the end node of the optimal path Calculate at time T, δ T (i)(i=1,2,…,n) the maximum value from the optimal path Start by backtracking from back to front to get the optimal path
[0175]
[0176]
[0177]
[0178] After obtaining the optimal path, set k When the edge matched in the graph model is e i , at t k+n The new adjacent edge matched at the moment is e j , use interpolation to get t k and t k+n The positioning result at each moment in .
[0179] It should be noted that the above content only illustrates the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications all fall within the protection scope of the claims of the present invention.
Claims
1. An indoor positioning method based on pedestrian inertial navigation and maps, characterized in that: The following steps are involved: S1: Use LSTM recurrent neural network to process training imu data to determine whether the pedestrian is in motion or stationary state; S2: Establish a cascade structure, the upper layer is based on HMM map matching, the lower layer is based on Kalman filter inertial navigation, for the lower structure, use zero speed correction, zero angular velocity update, magnetometer correction heading angle, heuristic heading update and step constraint to correct the positioning result of inertial navigation, the step size uses the Weinberg adaptive step size estimation model, and the barometer is used to determine the floor information; S3: Detect seed landmarks and organic landmarks in the room, classify the two landmarks using the HDBSCAN clustering algorithm, and obtain the landmark positions after matching the landmark library for subsequent updating of the emission probability of the HMM; S4: The lower-layer Kalman filter-based inertial navigation system provides the pedestrian’s step length and heading information for each step to the upper-layer HMM-based map matching. The upper-layer map matching updates the HMM transition probability based on the step length and heading information provided by the lower layer and the graph model, and uses the Viterbi algorithm to calculate the optimal path and optimize the positioning result.
2. The indoor positioning method based on pedestrian inertial navigation and map according to claim 1 is characterized in that: The step S1 specifically The process includes: S1.1: Generate a training set and use the SHOE detector to determine whether the pedestrian is in the zero-speed detection state for the imu data set; the SHOE detector combines the accelerometer data and the gyroscope data for comprehensive judgment, and the detection accuracy is higher when the pedestrian walks with a certain gait; the SHOE detector formula is as follows: Among them, c k is the amount of calculation for zero speed detection. If c k If the speed is less than the threshold γ, the pedestrian is considered to be in a zero-speed state. The threshold γ is determined through experiments. The threshold is adjusted under different gaits to minimize the error between the KF-based inertial navigation positioning result and the actual position. N is the sampling point range, a i Accelerometer measurement, w i is the gyroscope measurement value, is the average acceleration over a period of time, g is the modulus of the gravity vector, and is the noise variance of the accelerometer and gyroscope; S1.2: Use the labeled training set to train the model; input the IMU data sequence into the LSTM model, perform supervised learning based on the labels, and train the LSTM model based on the standard cross entropy loss function. The cross entropy loss function expression is: where p i For prediction, y i is the true value; LSTM consists of several layers. The last layer has 2 units and is fully connected to the previous layer. The softmax function is used to convert the two data to between 0 and 1 to determine whether the pedestrian is in a zero-speed state. The trained LSTM model can determine whether the pedestrian is in a zero-speed state in real time.
3. The indoor positioning method based on pedestrian inertial navigation and map according to claim 1 is characterized in that: The step S2 specifically includes the following process: S2.1: Use inertial strapdown navigation algorithm to calculate pedestrians’ posture, speed and position in real time: Among them, and are all vector values in the carrier coordinate system. is the rotation angular velocity of the carrier coordinate system relative to the navigation coordinate system, is the specific force measured by acceleration in the carrier coordinate system; and n is the vector value in the navigation coordinate system, is the angular velocity of the Earth-centered Earth-fixed coordinate system relative to the inertial coordinate system, is the angular velocity of the navigation coordinate system relative to the Earth-centered Earth-fixed coordinate system, g n is the acceleration due to gravity; The attitude, velocity and position error differential equations are: Where φ is the attitude angle error, δv n is the velocity error, δp is the position error, and is the vector value in the navigation coordinate system, is the angular velocity of the navigation coordinate system relative to the inertial coordinate system, is the angular velocity of the carrier coordinate system relative to the inertial coordinate system, is the specific force of acceleration measurement in the navigation coordinate system; Formulate a linear stochastic differential equation for the error vector: Where F(t) and G(t) are deterministic time-varying matrices that change with time, and w(t) is a zero-mean Gaussian white noise vector; discretized continuous-time system differential equations, due to the high frequency of imu and extremely short sampling time, the state one-step matrix is approximated as: Where I is the identity matrix, Δt is the sampling interval, and the state equation and observation equation of Kalman filtering are established: Z k =H k X k +V k The state variable X k is a 15-dimensional error vector, including the attitude error Speed error δv n , position error δp, accelerometer estimation bias b a and the gyro estimated bias b g ; is the state one-step matrix, H k is the observation matrix, Γ k-1 is the noise allocation matrix, W k-1 is the system noise vector, V k is the measurement noise vector; S2.2: The walking state of pedestrians is judged in real time based on the LSTM zero-speed detector. In the zero-speed stage, zero-speed correction, zero angular velocity update, magnetometer-corrected heading angle, heuristic heading update, and step-size constraint are used to suppress the accumulation of inertial navigation system errors over time. The errors are corrected entirely based on the sensor information generated by the inertial sensor and magnetometer. Zero speed update: When the pedestrian is in zero speed state, the foot tied to the imu is relatively still with the ground. The speed of the inertial navigation system based on KF is taken as the speed error. The speed calculated by the inertial system at zero speed is set as v k , the observation equation is: z v =v k -[0,0,0] T =δv k Zero angular velocity update: When the pedestrian is in the zero speed state, the angular velocity is set to zero. At this time, the angular velocity of the inertial navigation system based on KF is used as the angular velocity error. The angular velocity calculated by the inertial system at zero speed is set to w k , the observation equation is: With w =in k -[0,0,0] T =δw k Magnetometer corrects heading angle: Although metal places indoors will interfere with magnetometer measurement, using a magnetometer to calculate heading when the indoor environment is stable can still improve the heading angle estimation accuracy to a certain extent; when the pedestrian is at zero speed, the pitch angle and roll angle are both approximately zero, and the heading angle is calculated based on the magnetometer measurement value: in and is the measured value of the x-axis and y-axis of the magnetometer. Assume that the heading angle obtained by the inertial navigation system at time k is The observed value is the difference between the heading angle calculated by the inertial system and the heading angle calculated by the magnetometer: Heuristic heading update: When pedestrians walk, their heading remains basically unchanged indoors. This feature is used to provide heading correction for the KF-based navigation system. Compare the heading values updated by the strapdown algorithm, taking the average heading value of the previous three moments as the benchmark. If the heading value at moment k is If the difference between the heading average value of the previous three moments is less than the threshold, a heading correction value is provided at time k. If the difference is greater than the threshold, no feedback value is provided. The difference threshold is set to Step size constraint: The step size is calculated using the Weinberg adaptive step size formula to constrain the positioning results of the KF-based inertial navigation system; the adaptive step size formula is: Where β is the gait parameter, and each pedestrian has a different value according to their height and gait frequency. max and a min They are the maximum and minimum values of the z-axis acceleration in one step respectively; the position corrected by KF at time k-1 is known The uncorrected position at time k is p k =(x k ,y k , z k ) T , let d k is the distance between the two positions mentioned above: The observation equation for the step-size constraint is as follows: the distance between the positions solved by INS at adjacent moments and the adaptive step-size are subtracted as the step-size constraint observation z step , H adpt is the observation matrix with respect to the step size constraint: z step =d k -m k =H adpt δp+v m Combining the above constraint methods, the observation matrix is an 8×15-dimensional matrix, and the order of observations is the velocity difference z v , angular velocity difference z w , heading angle difference and step length observation z step :
4. The indoor positioning method based on pedestrian inertial navigation and map according to claim 1 is characterized in that: The step S3 specifically The process includes: Taking into account the known positions of seed landmarks and organic landmarks, two types of landmarks are used to correct positioning during map matching; seed landmarks identify stair or elevator landmarks through the regularity of accelerometer readings, or identify stair or elevator landmarks through barometer data, organic landmarks such as magnetic anomalies are identified by magnetometers, turns can be identified by the change in the angle of gyroscope integration, and door landmarks can be identified by the change in acceleration amplitude before and after pedestrians push the door; HDBSCAN has the characteristics of hierarchical structure and stability selection, and can automatically determine the optimal number of clusters. HDBSCAN is used to cluster seed landmarks and organic landmarks, and the barometer is combined to obtain floor change information. After identifying the type of landmark, the confidence matching landmark position in the landmark library is proposed to provide the emission probability for the upper layer map matching based on the hidden Markov model. Suppose the position of the matching landmark is o t =(x l ,y l , z l ), let the state variable in HMM be s i , in s i Get observation o t The probability is: Among them, σ r is the standard deviation of the landmark position; the lower layer inertial navigation system based on Kalman filtering solves the pedestrian's posture, speed and position information at the imu frequency. According to the zero-speed detection, when the system is in the zero-speed state, the inertial information is provided to the upper layer map matching system based on the hidden Markov model, and the heading change and step length of each step are calculated according to the heading angle and position in the zero-speed stage; for example, at the k-1th time, the heading is The heading at time k is The direction changes are: The step length at time K is:
5. The indoor positioning method based on pedestrian inertial navigation and map according to claim 1, characterized in that: The step S4 specifically The process includes: S4.1: First, build an indoor directed graph model: 1) Set up the node model. Set up nodes in the map. For the narrow corridor structure, select the central axis to form a one-dimensional topology. Select points 1 meter apart in the one-dimensional topology as nodes; for the indoor space and the wide area of the hall, set a two-dimensional grid with a side length of 1 meter, and the center point of the grid is the node; record the location of the node: s=<x,y> 2) Set the edge model, where s from is the starting node of the edge, s to is the end node of the edge, and the third dimension records the direction of the edge: e= from ,s to ,or> 3) Set graph model constraints. For any two edges in the graph, the state transition probability exists only when the end node of edge i is equal to the start node of edge j. At the same time, since people may stay at a certain location indoors for a while, there is also a state transition probability from edge i to edge i. Record the state transition matrix; S4.2: Update the transition probability between states according to the direction change of the pedestrian and the cumulative length. Set the direction change of each step of the pedestrian to α, and the direction change from edge i to edge j to β, and obtain the state transition probability from edge i to edge j: where σ h is the standard deviation of the pedestrian direction measurement; at the same time, the cumulative length change of pedestrian displacement is used as auxiliary information of the transition probability; let the edge sequence matched at time t be edge i, and the cumulative length of the matched edge sequence at this time is recorded as The length of the pedestrian's trajectory at time t is The pedestrian displacement calculated by the lower inertial system between time t and time t+1 is Then the length of the pedestrian’s trajectory at t+1 is: The edge transition probability related to the change in the cumulative length of the pedestrian's displacement is: Among them j For edge e j The length of l is the standard deviation of pedestrian displacement; combined with the change in pedestrian direction, the change in the cumulative length of pedestrian displacement, and the direction and length information of each edge in the graph model, the edge e i To the edge j The overall transition probability is: a ij It is edge i To the edge j The overall transition probability, G(e j , e i ) means that when edge e i To the edge j The value is 1 when the graph model constraints are met, otherwise it is 0; S4.3: Use the Viterbi algorithm to find the corresponding hidden sequence that is most likely to produce the observed event; assume that the direction change sequence obtained from the lower layer is (α1, α2, ..., α T ), the displacement cumulative length change sequence is (traj1, traj2, ..., traj T ); The Viterbi algorithm recursively calculates the highest probability path for each state. This step considers the transition probability and emission probability from the previous state to the current state; when no landmark is detected, the emission probability is 1. When a landmark is detected, the emission probability is related to the landmark position. The calculation formula for the emission probability is as follows: Starting from time 1, for each state i, calculate the transition probabilities of all states that can be transferred to state i from the previous moment according to the direction change sequence and the displacement cumulative length change sequence, record the maximum probability of the current state and the state node at the previous moment that makes the current state probability value the largest, let δ t (i) is the maximum probability of all single paths in state i at time t, and we get δ t The recursive formula is: Record the state node of the previous moment to trace back the optimal path In the Viterbi decoding process, the maximum probability at time T is the probability P of the optimal path. * , and get the end node of the optimal path Calculate at time T, δ T (i) (i = 1, 2, ..., n) the maximum value, from the optimal path Start by backtracking from back to front to get the optimal path After obtaining the optimal path, set k When the edge matched in the graph model is e i , at t k+n The new adjacent edge matched at the moment is e j , use interpolation to get t k and t k+n The positioning result at each moment in .
Citation Information
Cited By
Water hydrogen production platform robot walking positioning method
CN119245638A
Railway map matching method and system based on Beidou navigation system and odometer
CN119509509A
Robot positioning method, system and equipment based on SLAM (Simultaneous Localization and Mapping) technology
CN120521620A
A robot positioning method, system and device using SLAM technology
CN120521620B
Extended Kalman filtering inertial navigation method based on magnetic semantics and related equipment
CN120576745A
