Disclosure of Invention
The invention provides a magnetometer null-bias irrelevant magnetic field fingerprint database generation method, which aims at solving the problem of complicated magnetometer calibration in an ambulatory acquisition database building method. And respectively obtaining the reference magnetic field intensity under the local coordinate system and the magnetometer observation true value under the carrier coordinate system through attitude angle projection, and then obtaining the zero offset of the magnetometer. And after the observation value of the compensation magnetometer obtains the accurate environment magnetic field intensity observation value of the known position, establishing a grid magnetic field fingerprint database by combining data acquisition track coordinates. The method does not need any external equipment or parameter setting, is simple and efficient, has good universality, and can meet the requirements of high-precision and high-dimensionality fingerprint libraries.
The invention adopts the following technical scheme: a magnetometer null-bias independent magnetic field fingerprint library generation method requires that the course angle of a walking track traverses different directions (such as a walking closed rectangular track or a S-shaped track), obtains the magnetometer null bias through attitude projection under the assumption that the local region-based geomagnetic field intensity components are the same and the mean value of magnetic field interference is zero, and establishes a magnetic field fingerprint library; the technical scheme comprises the following steps:
step 1, traversing tracks in different directions at a region walking course angle for establishing a magnetic field fingerprint library, and obtaining coordinates, high-precision attitude angles and magnetic field information of all positions in the walking tracks through sensor data acquired by intelligent equipment;
step 2, projecting the magnetometer original observed values of all positions to a local horizontal coordinate system by using the sensor attitude angles obtained in the step 1, and averaging the magnetic field projection components of all positions to obtain the reference magnetic field strength in the local horizontal coordinate system;
step 3, projecting the reference magnetic field strength to a carrier coordinate system by combining the reference magnetic field strength and the sensor attitude angle to obtain a magnetometer reference observation value; the original observed values and the reference observed values of the magnetometers at all positions are subjected to difference, and the difference value of each position is averaged to obtain the zero offset of the magnetometers; using the acquired magnetometer zero offset to compensate the magnetometer original observed values, and acquiring accurate environment magnetic field intensity observed values of all positions;
step 4, setting a minimum matrix covering a magnetic field database area based on the acquired track coordinates, dividing the minimum matrix into grids with equal size, and smoothing the magnetic field intensity in the same grid; and (4) performing interpolation filling on the non-collected region by using the magnetic field intensity values of the surrounding grids, and finally establishing a magnetic field grid fingerprint database under a local coordinate system.
Further, the positions in the step 1 are three-dimensional positions, namely a north position, an east position and a vertical position; and the attitude angle is a roll angle, a pitch angle and a course angle.
Further, the implementation of step 2 comprises the following sub-steps,
21) projecting the magnetic field intensity of all the positions in the carrier coordinate to a local coordinate system to obtain the magnetic field intensity of each position in the local coordinate system,
22) based on the assumption that the average value of the magnetic field interference formed by the manual facilities and the equipment in the local area is zero, the average value of the magnetic field intensity of each position in the local coordinate system is used as the reference magnetic field intensity,
in the above formula, the subscript n represents a local coordinate n system, the n system takes the inertial sensor IMU phase center as an origin, the x axis is parallel to the local horizontal plane and points to true north, the y axis is parallel to the local horizontal plane and points to true east, the z axis is perpendicular to the local horizontal plane and points downwards, and the three form a right-handed system; b represents a system b of a carrier coordinate system, the system b takes an inertial sensor IMU phase center as an origin, an x axis points to the advancing direction of the carrier, a y axis is perpendicular to the x axis and points to the right side of the carrier, and a z axis is perpendicular to the x axis and the y axis and forms a right-hand system; i represents the ith position, and j is total;
an attitude rotation matrix from the local coordinate system to the carrier coordinate system for each position; m
n,iRepresenting the magnetic field strength of the ith position under the n system; m
b,iRepresenting the magnetic field intensity of the ith position under the b system; m
n_refRepresenting the reference magnetic field strength in the local coordinate system n.
Further, in step 3, the magnetometer original observation value is the fusion magnetic field strength of the magnetometer zero offset, the earth magnetic field and the magnetic field interference formed by the artificial equipment or facilities; the reference magnetic field strength is a projection value of the earth magnetic field strength under a local horizontal coordinate system; the magnetometer reference observed value is a projection value of the earth magnetic field under the carrier coordinate.
Further, the implementation of step 3 comprises the following sub-steps,
31) projecting the reference magnetic field intensity to a magnetometer reference observation value of each position in a carrier coordinate system through an attitude angle,
Mn_refrepresenting the reference magnetic field strength under a local coordinate system n system;
32) taking the mean value of the difference between the reference observation value of the magnetometer and the original observation value of the magnetometer in the carrier coordinate system as the zero offset of the magnetometer, and compensating the observation value of the magnetometer to obtain the accurate magnetic field intensity; the specific calculation method is as follows:
in the formula (I), the compound is shown in the specification,
representing the reference observation of the magnetometer under system b, M
b,iA raw output representing the magnetometer at the ith position; bias represents the zero bias error of the magnetometer;
represents the magnetometer observations after the i-th position compensation zero offset.
Further, in step 4, the magnetic field strength in the same grid is smoothed, and the smoothing method includes: averaging, weighted averaging, median, maximum-minimum averaging, averaging after eliminating the maximum and minimum, and gaussian model.
Further, in step 4, the non-collected region is interpolated and filled by using the magnetic field intensity values of the surrounding grids, and the interpolation method includes a linear interpolation method, a bilinear interpolation method, a cubic spline interpolation method, a nearest neighbor method, a gaussian model method and a kriging method.
Further, the specific implementation manner of step 4 includes the following sub-steps,
41) projecting the magnetometer observation value after compensating zero offset to a local coordinate system through an attitude angle;
42) dividing the reservoir building area into uniform grids according to the east-west direction and the south-north direction under a local coordinate system, and building a local coordinate system;
43) projecting the three-dimensional position information of the acquisition track into a local coordinate system, and recording a grid corresponding to each position point on the acquisition track;
44) averaging the magnetic field information of all position points in a single grid to obtain high-dimensional magnetic field information of the grid, and forming a magnetic field fingerprint together with the positions of the grid;
45) traversing all the grids, if a certain grid does not contain magnetic field information, interpolating by using the magnetic field information of surrounding grids to fill the magnetic field information of the grid, wherein the interpolation method specifically comprises the following steps:
a) drawing a circle by taking the center of a grid to be interpolated as the center of a circle and n meters as the radius, wherein the grid completely contained in the circle is taken as a grid to be selected, and the grid containing magnetic field information in the grid to be selected is taken as an effective grid;
b) traversing 8 directions of the grid to be interpolated, namely true east, true west, true south, true north, east south, east north, west south and west north, if and only if an effective grid exists in the true east and true west direction or an effective grid exists in the true south and north direction, allowing interpolation operation, and if not, considering the grid to be interpolated as an invalid region in the magnetic field fingerprint library;
c) if the interpolation operation can be carried out, respectively taking out the effective grids which are closest to the grid to be interpolated in 8 directions; if no effective grid exists in a certain direction, the grid in the opposite direction is determined to be ineffective;
d) carrying out weighted average processing on the magnetic field information in the effective grid, wherein the weight is the reciprocal of the distance from the center of the effective grid to the center of the grid to be interpolated, and carrying out normalization processing on the weight to obtain the magnetic field information in the effective grid;
at this point, the generation of the magnetic field fingerprint library is completed.
The invention has the following beneficial effects:
(1) the invention constructs the high-dimensional magnetic field fingerprint database in the north direction, the east direction and the height direction by the walking acquisition method, has high database construction efficiency, simple and easy operation and high information dimensionality of the fingerprint database.
(2) According to the invention, magnetometer calibration is not required to be carried out in advance, and the zero offset of the magnetometer is obtained through attitude projection under the assumption that the components of the magnetic field intensity in a local area are the same and the mean value of magnetic field interference is zero, so that the complicated magnetometer calibration process is omitted, the calibration effect is good, and the operation is further simplified.
(3) The method is simple to operate, easy to realize, simple and feasible, has good universality, does not need any external equipment or parameter setting, and can meet the requirements of a high-precision magnetic field fingerprint library.
Detailed Description
The technical solution of the present invention is further explained with reference to the drawings and the embodiments.
Step 1, holding the mobile phone in a random initial posture, and traversing tracks in different directions (0-360 degrees) at a walking course angle in a region for establishing a magnetic field library. For example, in an open area, walking the route (S-shaped track) in the shape of (a) and (b) in the attached figure 1, and determining the track interval according to the interpolation distance during library building; for a long and narrow corridor, a circle of walking is needed to go along the outer circle of the corridor, if the width of the corridor is larger, an acquisition route is needed to be added in the middle according to the interpolation distance during library building, and the walking tracks are as shown in (c) and (d) (rectangular tracks) in the attached figure 1. Acquiring coordinates of each position in a line-shaped track by using the method of the patent 'acquisition method of indoor positioning fingerprints'; acquiring high-precision attitude angles of the mobile phone at various positions in the walking process by the method of the MEMS gyroscope automatic calibration method; keeping the mobile phone posture stable during the library building period, and completing the acquisition of magnetic field information;
step 2, obtaining the reference magnetic field intensity under the local coordinate system through attitude projection according to the attitude angle obtained in the step 1;
furthermore, the implementation of step 2 comprises the following sub-steps,
21) projecting the magnetic field intensity of all the positions in the carrier coordinate to a local coordinate system to obtain the magnetic field intensity of each position in the local coordinate system,
22) based on the assumption that the average value of the magnetic field interference formed by the manual facilities and the equipment in the local area is zero, taking the average value of the magnetic field intensity of each position in the local coordinate system as the reference magnetic field intensity,
in the above formula, the subscript n represents a local coordinate n system, the n system takes the inertial sensor IMU phase center as an origin, the x axis is parallel to the local horizontal plane and points to true north, the y axis is parallel to the local horizontal plane and points to true east, the z axis is perpendicular to the local horizontal plane and points downwards, and the three form a right-handed system; b represents a system b of a carrier coordinate system, the system b takes an inertial sensor IMU phase center as an origin, an x axis points to the advancing direction of the carrier, a y axis is perpendicular to the x axis and points to the right side of the carrier, and a z axis is perpendicular to the x axis and the y axis and forms a right-hand system; i represents the ith position, and j is total;
an attitude rotation matrix from the local coordinate system to the carrier coordinate system for each position; m
n,iRepresenting the magnetic field strength of the ith position under the n system; m
b,iA raw output representing the magnetometer at the ith position; m
n_refRepresenting the reference magnetic field strength in the local coordinate system n.
Step 3, obtaining a magnetometer reference observation value according to the reference magnetic field intensity in the local horizontal coordinate system obtained in the step 2, solving the magnetometer zero bias and compensating the magnetometer observation value;
furthermore, the implementation of step 3 comprises the following sub-steps,
31) projecting the reference magnetic field intensity to a magnetometer reference observation value of each position in a carrier coordinate system through an attitude angle,
in the formula (I), the compound is shown in the specification,
is the attitude rotation matrix from the local coordinate system to the carrier coordinate system.
32) And taking the mean value of the difference between the reference observation value of the magnetometer and the original observation value of the magnetometer in the carrier coordinate system as the zero offset of the magnetometer, and compensating the observation value of the magnetometer to obtain the accurate magnetic field intensity. The specific calculation method is as follows:
in the formula (I), the compound is shown in the specification,
representing magnetometer reference observations under system b; bias represents the zero bias error of the magnetometer;
represents the magnetometer observations after the i-th position compensation zero offset.
Therefore, a relatively accurate magnetometer observed value is obtained.
And 4, setting a minimum matrix covering the magnetic field database area according to the data acquisition track coordinates, and dividing the reservoir building area into grids with equal size. Averaging the magnetic field intensity in the grids, interpolating the magnetic field intensity of the adjacent grids in the area where the magnetic field intensity is not acquired, and establishing a magnetic field grid fingerprint database under a local coordinate system;
furthermore, the implementation of step 4 comprises the following sub-steps,
41) projecting the magnetometer observation value after compensating zero offset to a local coordinate system through an attitude angle;
42) dividing the reservoir building area into uniform grids according to the east-west direction and the south-north direction under a local coordinate system, and building a local coordinate system;
43) projecting the three-dimensional position information of the acquisition track into a local coordinate system, and recording a grid corresponding to each position point on the acquisition track;
44) averaging the magnetic field information of all position points in a single grid to obtain high-dimensional magnetic field information of the grid, and forming a magnetic field fingerprint together with the positions of the grid;
45) traversing all the grids, if a certain grid does not contain magnetic field information, interpolating by using the magnetic field information of surrounding grids to fill the magnetic field information of the grid, wherein the interpolation method specifically comprises the following steps:
a) the center of the grid to be interpolated is taken as the center of a circle, a circle is drawn by taking 1.5 meters as the radius, the grid completely contained in the circle is taken as a grid to be selected, and the grid containing magnetic field information in the grid to be selected is taken as an effective grid. Assuming the central non-numbered gray grid in fig. 2 as the grid to be interpolated, the radius of the circle is 1.5 m. The grids 1 to 8 are candidate grids, wherein the grids 1 to 6 with gray numbers contain magnetic field information and are effective grids; the grids 7 to 8 with black numbers do not contain magnetic field information and are invalid grids.
b) And traversing 8 directions of the grid to be interpolated, namely true east, true west, true south, true north, east south, east north, west south and west north, if and only if an effective grid exists in the true east and true west direction or an effective grid exists in the true south and north direction, allowing the interpolation operation, and if not, considering the grid to be interpolated as an invalid region in the magnetic field fingerprint library. Grid 2 (due north) and grid 6 (due south) in fig. 2 are both active grids and interpolation operations can be performed.
c) If the interpolation operation can be carried out, respectively taking out the effective grids which are closest to the grid to be interpolated in 8 directions; if no valid grid exists in a certain direction, the grid in the opposite direction is considered invalid. In FIG. 2, grids 1-6 contain magnetic field information, but according to the rule in c, grids 1, 2, 5, 6 satisfy the relative relationship, and are effective grids; the grids 7 and 8 corresponding to the grids 3 and 4 are invalid grids, and do not satisfy the relative relationship, so that the grids are removed from the valid grids.
d) And carrying out weighted average processing on the magnetic field information in the effective grid, wherein the weight is the reciprocal of the distance from the center of the effective grid to the center of the grid to be interpolated. And carrying out normalization processing on the weight to obtain the magnetic field information in the effective grid.
At this point, the generation of the magnetic field fingerprint library is completed.
The specific embodiments described herein are merely illustrative of the spirit of the invention. Various modifications or additions may be made to the described embodiments or alternatives may be employed by those skilled in the art without departing from the spirit or ambit of the invention as defined in the appended claims.