Direction positioning method, device and storage medium

文档序号:1182820 发布日期:2020-09-22 浏览:14次 中文

阅读说明:本技术 方向定位方法、装置及存储介质 (Direction positioning method, device and storage medium ) 是由 田野 于 2019-03-12 设计创作,主要内容包括:本申请公开了一种方向定位方法、装置及存储介质,该方向定位方法应用于电子设备,包括:获取该电子设备在运动过程中的运动信息、以及地球坐标系的坐标轴方向信息,该运动信息包括在设备坐标系下检测的运动参数坐标,该坐标轴方向信息包括逆地心方向、第一方向和第二方向;根据该坐标轴方向信息将该运动参数坐标转换到该地球坐标系中,得到对应的目标参数坐标;根据该目标参数坐标确定该电子设备在该第一方向上的第一运动变量、以及在该第二方向上的第二运动变量;根据该第一运动变量和第二运动变量确定该电子设备在该地球坐标系下的方位角,以进行方向定位,从而能准确定位出电子设备的运动方向,定位精度高。(The application discloses a direction positioning method, a device and a storage medium, wherein the direction positioning method is applied to electronic equipment and comprises the following steps: acquiring motion information of the electronic equipment in a motion process and coordinate axis direction information of a terrestrial coordinate system, wherein the motion information comprises a motion parameter coordinate detected in an equipment coordinate system, and the coordinate axis direction information comprises an inverse geocentric direction, a first direction and a second direction; converting the motion parameter coordinate into the terrestrial coordinate system according to the coordinate axis direction information to obtain a corresponding target parameter coordinate; determining a first motion variable of the electronic equipment in the first direction and a second motion variable of the electronic equipment in the second direction according to the target parameter coordinate; and determining the azimuth angle of the electronic equipment under the terrestrial coordinate system according to the first motion variable and the second motion variable so as to perform direction positioning, thereby accurately positioning the motion direction of the electronic equipment and having high positioning precision.)

1. A direction positioning method is applied to electronic equipment and is characterized by comprising the following steps:

acquiring motion information of the electronic equipment in a motion process and coordinate axis direction information of a terrestrial coordinate system, wherein the motion information comprises a motion parameter coordinate detected in an equipment coordinate system, and the coordinate axis direction information comprises an inverse geocentric direction, a first direction and a second direction;

converting the motion parameter coordinates into the terrestrial coordinate system according to the coordinate axis direction information to obtain corresponding target parameter coordinates;

determining a first motion variable of the electronic equipment in the first direction and a second motion variable of the electronic equipment in the second direction according to the target parameter coordinates;

and determining the azimuth angle of the electronic equipment under the terrestrial coordinate system according to the first motion variable and the second motion variable so as to perform direction positioning.

2. The method of claim 1, wherein determining a first motion variable of the electronic device in the first direction and a second motion variable in the second direction according to the target parameter coordinates comprises:

generating a waveform diagram according to the target parameter coordinates, wherein the waveform diagram comprises a first signal wave corresponding to a first direction, a second signal wave corresponding to a second direction and a third signal wave corresponding to an inverse geocentric direction;

determining a first correlation coefficient between the first signal wave and the third signal wave, and a second correlation coefficient between the second signal wave and the third signal wave;

and determining a first motion variable of the electronic equipment in the first direction according to the first signal wave and a first correlation coefficient, and determining a second motion variable of the electronic equipment in the second direction according to the second signal wave and a second correlation coefficient.

3. The direction-locating method of claim 2, wherein the determining a first correlation coefficient between the first signal wave and a third signal wave comprises:

determining a covariance corresponding to the first signal wave and the third signal wave as a first covariance;

determining a variance corresponding to the first signal wave and a variance corresponding to a third signal wave;

and calculating a corresponding correlation coefficient according to the first covariance and the variance, wherein the corresponding correlation coefficient is used as a first correlation coefficient between the first signal wave and the third signal wave.

4. The method according to claim 2, wherein determining the first motion variable of the electronic device in the first direction according to the first signal wave and the first correlation coefficient comprises:

determining a first peak point and a first valley point in the first signal wave, and calculating a first average value of a difference value between the first peak point and the first valley point;

determining a numerical value sign corresponding to the first correlation coefficient by using a sign function;

and determining a first motion variable of the electronic equipment in the first direction according to the numerical value symbol and the first average value.

5. The method according to claim 1, wherein the motion parameter coordinates comprise acceleration coordinates or angular velocity coordinates, and the determining the azimuth angle of the electronic device in the terrestrial coordinate system according to the first motion variable and the second motion variable comprises:

substituting the first motion variable and the second motion variable corresponding to the angular velocity coordinate into a preset function to obtain an azimuth angle under the terrestrial coordinate system, or,

and substituting the first motion variable and the second motion variable corresponding to the acceleration coordinate into a preset function to obtain the azimuth angle in the terrestrial coordinate system.

6. The method of claim 1, wherein the motion parameter coordinates comprise an acceleration coordinate and an angular velocity coordinate, and wherein determining the azimuth angle of the electronic device in the terrestrial coordinate system according to the first motion variable and the second motion variable comprises:

adding the first motion variable corresponding to the angular velocity coordinate and the first motion variable corresponding to the acceleration coordinate to obtain a first addition;

adding a second motion variable corresponding to the angular velocity coordinate and a second motion variable corresponding to the acceleration coordinate to obtain a second addition;

and substituting the first addition and the second addition into a preset function to obtain the azimuth angle in the terrestrial coordinate system.

7. The method according to claim 1, wherein said converting the motion parameter coordinates into the terrestrial coordinate system according to the coordinate axis direction information comprises:

determining a coordinate origin of the device coordinate system;

determining a conversion matrix according to the coordinate axis direction information and the coordinate origin;

and performing coordinate transformation on the motion parameter coordinates according to the transformation matrix so as to transform the motion parameter coordinates into the terrestrial coordinate system.

8. A direction positioning device applied to electronic equipment is characterized by comprising:

the acquisition module is used for acquiring motion information of the electronic equipment in a motion process and coordinate axis direction information of an earth coordinate system, wherein the motion information comprises a motion parameter coordinate detected in an equipment coordinate system, and the coordinate axis direction information comprises an inverse geocentric direction, a first direction and a second direction;

the conversion module is used for converting the motion parameter coordinates into the terrestrial coordinate system according to the coordinate axis direction information to obtain corresponding target parameter coordinates;

the first determining module is used for determining a first motion variable of the electronic equipment in the first direction and a second motion variable of the electronic equipment in the second direction according to the target parameter coordinates;

and the second determining module is used for determining the azimuth angle of the electronic equipment under the terrestrial coordinate system according to the first motion variable and the second motion variable so as to perform directional positioning.

9. The direction-locating device of claim 8, wherein the first determining module specifically includes:

the generating unit is used for generating a waveform diagram according to the target parameter coordinates, wherein the waveform diagram comprises a first signal wave corresponding to a first direction, a second signal wave corresponding to a second direction and a third signal wave corresponding to an inverse geocentric direction;

a first determination unit configured to determine a first correlation coefficient between the first signal wave and the third signal wave, and a second correlation coefficient between the second signal wave and the third signal wave;

and the second determining unit is used for determining a first motion variable of the electronic equipment in the first direction according to the first signal wave and the first correlation coefficient, and determining a second motion variable of the electronic equipment in the second direction according to the second signal wave and the second correlation coefficient.

10. The directional positioning device according to claim 8, wherein the motion parameter coordinates comprise acceleration coordinates or angular velocity coordinates, and the second determination module is specifically configured to:

substituting the first motion variable and the second motion variable corresponding to the angular velocity coordinate into a preset function to obtain an azimuth angle under the terrestrial coordinate system, or,

and substituting the first motion variable and the second motion variable corresponding to the acceleration coordinate into a preset function to obtain the azimuth angle in the terrestrial coordinate system.

11. The directional positioning device according to claim 8, wherein the motion parameter coordinates comprise an acceleration coordinate and an angular velocity coordinate, and the second determination module is specifically configured to:

adding the first motion variable corresponding to the angular velocity coordinate and the first motion variable corresponding to the acceleration coordinate to obtain a first addition;

adding a second motion variable corresponding to the angular velocity coordinate and a second motion variable corresponding to the acceleration coordinate to obtain a second addition;

and substituting the first addition and the second addition into a preset function to obtain the azimuth angle in the terrestrial coordinate system.

12. A computer-readable storage medium having stored thereon a plurality of instructions adapted to be loaded by a processor to perform the directional localization method of any of claims 1-7.

13. An electronic device comprising a processor and a memory, the processor being electrically connected to the memory, the memory being configured to store instructions and data, the processor being configured to perform the steps of the direction location method of any one of claims 1 to 7.

Technical Field

The present application relates to the field of computer technologies, and in particular, to a direction positioning method, apparatus, and storage medium.

Background

With the rapid development of terminal technology, the mobile terminal not only can provide entertainment functions of chatting, listening music, watching videos and the like for users, but also can be used for positioning, navigating and tracking people.

Currently, a track guidance method (DR) is often used to realize positioning, navigation and tracking of a user, the track guidance method is a technology for estimating a future position and direction by using the position and speed of an existing object, step counting, step length calculation and direction calculation are often collected to realize iterative derivation of the position, each process has an error, and the direction calculation is the most difficult problem to solve relative to step counting and step length calculation. For example, for a mobile terminal, most of current PDR derivation algorithms are implemented based on an equipment coordinate system, the equipment coordinate system is a coordinate system defined by a manufacturer for each mobile terminal, and the equipment coordinate system is changed along with the placement direction of the mobile terminal, so that in the walking process of a user, if the walking direction needs to be derived, the mobile terminal is usually required to move on a horizontal plane, and a machine head of the terminal needs to face the walking direction, so that a correct derivation result can be obtained.

Disclosure of Invention

The embodiment of the application provides a direction positioning method, a direction positioning device and a storage medium, which can accurately position the walking direction of a user and avoid positioning errors caused by a device placement mode.

The embodiment of the application provides a direction positioning method, which is applied to electronic equipment and comprises the following steps:

acquiring motion information of the electronic equipment in a motion process and coordinate axis direction information of a terrestrial coordinate system, wherein the motion information comprises a motion parameter coordinate detected in an equipment coordinate system, and the terrestrial coordinate system comprises an inverse geocentric direction, a first direction and a second direction;

converting the motion parameter coordinates into the terrestrial coordinate system according to the coordinate axis direction information to obtain corresponding target parameter coordinates;

determining a first motion variable of the electronic equipment in the first direction and a second motion variable of the electronic equipment in the second direction according to the target parameter coordinates;

and determining the azimuth angle of the electronic equipment under the terrestrial coordinate system according to the first motion variable and the second motion variable so as to perform direction positioning.

The embodiment of the present application further provides a direction positioning device, which is applied to an electronic device, and includes:

the acquisition module is used for acquiring motion information of the electronic equipment in a motion process and coordinate axis direction information of an earth coordinate system, wherein the motion information comprises a motion parameter coordinate detected in an equipment coordinate system, and the coordinate axis direction information comprises an inverse geocentric direction, a first direction and a second direction;

the conversion module is used for converting the motion parameter coordinates into the terrestrial coordinate system according to the coordinate axis direction information to obtain corresponding target parameter coordinates;

the first determining module is used for determining a first motion variable of the electronic equipment in the first direction and a second motion variable of the electronic equipment in the second direction according to the target parameter coordinates;

and the second determining module is used for determining the azimuth angle of the electronic equipment under the terrestrial coordinate system according to the first motion variable and the second motion variable so as to perform directional positioning.

The embodiment of the application also provides a storage medium, wherein a plurality of instructions are stored in the storage medium, and the instructions are suitable for being loaded by a processor to execute any one of the direction positioning methods.

An electronic device comprising a processor and a memory, the processor being electrically connected to the memory, the memory being configured to store instructions and data, the processor being configured to perform the steps of any of the above-mentioned directional positioning methods.

The method, the device and the storage medium for directional positioning provided by the application are applied to electronic equipment, motion information of the electronic equipment in a motion process and coordinate axis direction information of an earth coordinate system are obtained, the motion information comprises motion parameter coordinates detected under an equipment coordinate system, the coordinate axis direction information comprises an inverse earth center direction, a first direction and a second direction, then the motion parameter coordinates are converted into the earth coordinate system according to the coordinate axis direction information to obtain corresponding target parameter coordinates, then a first motion variable of the electronic equipment in the first direction and a second motion variable in the second direction are determined according to the target parameter coordinates, an azimuth angle of the electronic equipment under the earth coordinate system is determined according to the first motion variable and the second motion variable to perform directional positioning, so that a user can carry the electronic equipment to walk, the method has the advantages of accurately positioning the motion direction of the electronic equipment, avoiding the influence of the placement direction of the electronic equipment on positioning, along with simplicity, high positioning precision and good positioning effect.

Drawings

The technical solution and other advantages of the present application will become apparent from the detailed description of the embodiments of the present application with reference to the accompanying drawings.

Fig. 1 is a scene schematic diagram of a directional positioning system according to an embodiment of the present application.

Fig. 2 is a schematic flow chart of a direction positioning method according to an embodiment of the present application.

Fig. 3 is a schematic frame flow diagram of a direction positioning method according to an embodiment of the present application.

Fig. 4 is a schematic flowchart of step S102 according to an embodiment of the present application.

Fig. 5 is a schematic flowchart of step S103 according to an embodiment of the present application.

Fig. 6 is a schematic diagram of a waveform diagram corresponding to an angular velocity or an acceleration according to an embodiment of the present application.

Fig. 7 is a schematic view of a scene in which a user walks across a mobile phone according to an embodiment of the present application.

Fig. 8 is a schematic structural diagram of a direction positioning device according to an embodiment of the present application.

Fig. 9 is a schematic structural diagram of a first determining module according to an embodiment of the present application.

Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

The embodiment of the application provides a direction positioning method, a direction positioning device, a storage medium and a server.

Referring to fig. 1, fig. 1 is a schematic view of a scenario of a direction positioning system, where the direction positioning system may include any one of the direction positioning apparatuses provided in the embodiments of the present application, and the direction positioning apparatus may be integrated in an electronic device (e.g., a mobile terminal).

The electronic equipment can acquire motion information of the electronic equipment in a motion process and coordinate axis direction information of an earth coordinate system, wherein the motion information comprises motion parameter coordinates detected in an equipment coordinate system, and the earth coordinate system comprises an inverse earth center direction, a first direction and a second direction; converting the motion parameter coordinate into the terrestrial coordinate system according to the coordinate axis direction information to obtain a corresponding target parameter coordinate; determining a first motion variable of the electronic equipment in the first direction and a second motion variable of the electronic equipment in the second direction according to the target parameter coordinate; and determining the azimuth angle of the electronic equipment under the terrestrial coordinate system according to the first motion variable and the second motion variable so as to carry out directional positioning.

The motion parameter coordinates may include angular velocity coordinates and/or acceleration coordinates, which may be detected by an angular velocity sensor (such as a gyroscope) and/or an acceleration sensor. The device coordinate system and the terrestrial coordinate system are both three-dimensional coordinate systems, where the device coordinate system is a coordinate system customized by a manufacturer for each electronic device, in the mobile terminal shown in fig. 1, an origin O1 of the device coordinate system may be a terminal center, a Y axis may be a linear direction from the terminal center to a handset, an X axis may be a linear direction extending from the terminal center toward a direction away from the handset and perpendicular to the Y axis, and a Z axis may be a linear direction perpendicular to a screen from the terminal center.

The terrestrial coordinate system is mainly determined according to the terrestrial magnetic field, the coordinate axis direction information can be obtained by detecting a gravity sensor and a magnetometer (such as a compass), and the like, in fig. 1, the origin O2 of the terrestrial coordinate system is the geocentric, the reverse geocentric direction V is a linear direction from the geocentric to the ground position of the electronic device, the first direction N can be a linear direction from the geocentric to the geomagnetic north pole, and the second direction E can be a linear direction from the geocentric to the eastern earth.

Specifically, when a user on the earth's surface walks from a to B with the electronic device, if the walking direction of the user in the distance is to be known, the electronic device may utilize a built-in compass and a gravity sensor to monitor the coordinate axis direction information of the earth coordinate system ENV in real time, and utilize an angular velocity sensor and/or an acceleration sensor to monitor the angular velocity coordinate and/or the acceleration coordinate in the own device coordinate system XYZ in real time, and convert the angular velocity coordinate and/or the acceleration coordinate into the earth coordinate system, and determine the first motion variable a1 of the mobile terminal on the N and the second motion variable a2 on the E according to the converted target parameter coordinate, and then determine the azimuth γ according to a1 and a2, that is, the walking direction of the mobile terminal in the earth coordinate system ENV.

As shown in fig. 2 and fig. 3, fig. 2 is a schematic flow chart of a direction positioning method provided in the embodiment of the present application, and a specific flow may be as follows:

s101, obtaining motion information of the electronic equipment in a motion process and coordinate axis direction information of an earth coordinate system, wherein the motion information comprises motion parameter coordinates detected in an equipment coordinate system, and the earth coordinate system comprises an inverse earth center direction, a first direction and a second direction.

In this embodiment, the motion parameter coordinates may include an angular velocity coordinate and/or an acceleration coordinate, which may be detected by various sensors, in fig. 3, an angular velocity sensor (such as a gyroscope) may be used to detect the angular velocity coordinate, and an acceleration sensor (such as an accelerometer) may be used to detect the acceleration coordinate. The device coordinate system XYZ and the terrestrial coordinate system ENV are both three-dimensional coordinate systems, and for the mobile terminal, the origin of coordinates of the device coordinate system may be a terminal center, the Y-axis may be a linear direction from the terminal center to the earpiece, the X-axis may be a linear direction extending from the terminal center toward a direction away from the earpiece and perpendicular to the Y-axis, and the Z-axis may be a linear direction perpendicular to the screen from the terminal center. Generally, the device coordinate system is a coordinate system customized by a manufacturer for each electronic device, and the position of the device coordinate system relative to the ground plane is not fixed and is changed along with the placement angle of the device for the same electronic device.

This earth coordinate system mainly is decided according to earth's magnetic field, can obtain through detection such as gravity sensor and magnetometer (for example compass), and in this earth coordinate system, the origin of coordinates is the geocentric, and contrary geocentric direction V is the straight line direction from the geocentric orientation this electronic equipment place ground position, and this first direction N can be from the geocentric orientation the straight line direction that geomagnetic north pole belongs to, and this second direction E can be from the geocentric orientation the straight line direction that eastern place of earth. Generally, the position of the terrestrial coordinate system is generally fixed with respect to the ground plane for different electronic devices.

And S102, converting the motion parameter coordinate into the terrestrial coordinate system according to the coordinate axis direction information to obtain a corresponding target parameter coordinate.

For example, referring to fig. 4, the step S102 may specifically include:

s1021, determining a coordinate origin of the equipment coordinate system;

s1022, determining a conversion matrix according to the coordinate axis direction information and the coordinate origin;

and S1023, performing coordinate transformation on the motion parameter coordinate according to the transformation matrix so as to transform the motion parameter coordinate into the terrestrial coordinate system.

In this embodiment, the origin of coordinates is usually the center of the device, the origin of the earth coordinate system and the origin of the device coordinate system may be coincided based on coordinate axis direction information, a transformation matrix may be determined according to the amount of change in position and angle when the coordinate axes are coincided, and then the product between the transformation matrix and the motion parameter coordinates may be calculated to obtain the target parameter coordinates.

It should be noted that the determination operation of the transformation matrix should be performed in real time, which may be performed independently by the electronic device, or may be performed by using a server, for example, the electronic device may upload coordinate axis direction information and a device coordinate system to the server in real time, and the server determines the transformation matrix according to the uploaded information. Generally speaking, the transformation matrices are generally different for electronic devices that are in different geographic locations or have different placements.

And S103, determining a first motion variable of the electronic equipment in the first direction and a second motion variable of the electronic equipment in the second direction according to the target parameter coordinate.

For example, referring to fig. 5, the step S103 may specifically include:

and S1031, generating a waveform diagram according to the target parameter coordinate, wherein the waveform diagram comprises a first signal wave corresponding to the first direction, a second signal wave corresponding to the second direction and a third signal wave corresponding to the reverse geocentric direction.

In this embodiment, a corresponding oscillogram may be generated according to the target parameter coordinates obtained by conversion within a period of time. For example, referring to fig. 6, the abscissa is the detection time T, the ordinate is the acceleration a or the angular velocity ω, and since the target parameter coordinate has components on all three axes of the global coordinate system N, E, V, three signal waves M1 to M3 are formed in the waveform diagram, wherein the first signal wave M1 may be formed by an N-axis component, the second signal wave M2 may be formed by an E-axis component, and the third signal wave M3 may be formed by a V-axis component.

S1032. determine a first correlation coefficient between the first signal wave and the third signal wave, and a second correlation coefficient between the second signal wave and the third signal wave.

For example, the step of "determining a first correlation coefficient between the first signal wave and the third signal wave" may specifically include:

determining a covariance corresponding to the first signal wave and the third signal wave as a first covariance;

determining a variance corresponding to the first signal wave and a variance corresponding to the third signal wave;

and calculating a corresponding correlation coefficient according to the first covariance and the variance as a first correlation coefficient between the first signal wave and the third signal wave.

In this embodiment, the covariance and variance may be calculated by taking points on the first signal wave M1 and the third signal wave M3, for example, in a period from 0 to Tm, if the first signal wave M1 includes M points q1 to qm and the third signal wave M3 includes M points p1 to pm, the average △ q and △ p of the M points may be calculated respectively, and then the variance corresponding to M1 may be calculatedVariance corresponding to M3

Figure BDA0001992836080000062

Wherein i ∈ [1, m]The covariance COV (M1, M3) between M1 and M3-E (M1M3) -E (M1) E (M3), where E () is the desired value, after which the first correlation coefficient corrv-COV (M1, M3)/σM1σM3

Similarly, the second correlation coefficient CorEV ═ COV (M2, M3)/σ can be calculated for the second signal wave M2 and the third signal wave M3 in the same manner as aboveM2σM3Wherein σ isM2For the variance corresponding to M2, the specific calculation process is similar to the calculation process of the first correlation coefficient corrv, and is not described here again.

S1033, determining a first motion variable of the electronic equipment in the first direction according to the first signal wave and the first correlation coefficient, and determining a second motion variable of the electronic equipment in the second direction according to the second signal wave and the second correlation coefficient.

In this embodiment, the first motion variable and the second motion variable are vectors. Because the walking of the person on the ground plane (namely the plane formed by the coordinate axes EN) is a periodic motion with two alternating legs, according to gait analysis, the motion amplitude of the forward direction of the pedestrian is relatively larger than the motion amplitude of the lateral deviation, so that the accurate walking direction of the person on the ground plane can be determined by analyzing the motion condition of the electronic equipment in the N direction (namely the first direction) and the motion condition of the electronic equipment in the E direction (namely the second direction).

For example, the step of "determining the first motion variable of the electronic device in the first direction according to the first signal wave and the first correlation coefficient" may specifically include:

determining a first peak point and a first valley point in the first signal wave, and calculating a first average value of a difference value between the first peak point and the first valley point;

determining a numerical value sign corresponding to the first correlation coefficient by using a sign function;

and determining a first motion variable of the electronic equipment in the first direction according to the numerical value sign and the first average value.

In this embodiment, since each period of alternation of the two legs is roughly divided into four strokes of leg lifting, standing on one foot, leg kicking, and standing on two feet, and the fluctuation of the wave signal in the interval (i.e., one period) after the leg lifting and before the leg falling is significant, the motion amplitude of the electronic device in the corresponding direction (the first direction and the second direction) may be determined by the average value of the difference between a single adjacent peak and trough or the average value of the difference between a plurality of adjacent peaks and troughs, the positive and negative directions of the electronic device in the corresponding direction may be determined according to the first correlation coefficient (the second correlation coefficient), and then the motion variable of the electronic device in the corresponding direction may be determined according to the positive and negative directions and the motion amplitude.

For example, the first motion variable hN=sign(CorNV)(△M1)nWhere n is a positive integer, sign () is a sign function, △ M1 is a first average value corresponding to M1E=sign(CorEV)(△M2)nWherein △ M2 is the second average corresponding to M2.

And S104, determining the azimuth angle of the electronic equipment under the terrestrial coordinate system according to the first motion variable and the second motion variable so as to perform direction positioning.

In the present embodiment, since the acceleration sensor and the angular velocity sensor are operated independently of each other, the motion parameter coordinates detected by them are not the same. In the above-mentioned fig. 3, when the motion parameter coordinates include an acceleration coordinate or an angular velocity coordinate, it is possible to calculate the motion parameter coordinates based on the acceleration coordinate (or the angular velocity coordinate)Determining a corresponding first motion variable haN(or h)ωN) And a second motion variable haE(or h)ωE) The azimuth angle theta can then be determined from the dimension of acceleration a (or angular velocity omega) alonea(or theta)ω) That is, the scheme step corresponding to the dashed box 1 or 2 in fig. 3, at this time, the step S104 may specifically include:

substituting the first motion variable and the second motion variable corresponding to the angular velocity coordinate into a preset function to obtain an azimuth angle under the terrestrial coordinate system, or,

and substituting the first motion variable and the second motion variable corresponding to the acceleration coordinate into a preset function to obtain the azimuth angle in the terrestrial coordinate system.

In this embodiment, the preset function may be a human-set function atan2(), and the first motion variable h corresponding to the acceleration coordinate is used for the first motion variable haNAnd a second motion variable haEAzimuth angle thetaa=atan2(haE,haN) Or for a first motion variable h corresponding to the angular velocity coordinateωNAnd a second motion variable hωEAzimuth angle thetaω=atan2(hωE,hωN)。

Of course, to improve the accuracy, the azimuth angle may also be determined according to two dimensions, namely, the angular velocity and the acceleration, at this time, the motion parameter coordinate includes an acceleration coordinate and an angular velocity coordinate, and the step S104 may specifically include:

adding a first motion variable corresponding to the angular velocity coordinate and a first motion variable corresponding to the acceleration coordinate to obtain a first addition;

adding a second motion variable corresponding to the angular velocity coordinate and a second motion variable corresponding to the acceleration coordinate to obtain a second addition;

and substituting the first addition and the second addition into a preset function to obtain the azimuth angle in the terrestrial coordinate system.

For example, the first motion variable h is calculated by the above methodaNAnd hωNAnd a second motion variable haEAnd hωEThen, the total motion variable in the first direction (i.e. the first addition) and the total motion variable in the second direction (i.e. the second addition) may be calculated first, and then they are substituted into the above function atan2() to obtain the azimuth angle θ, and the specific scheme steps can be referred to as the above block 3 in fig. 3.

As shown in fig. 7, when the user holds the mobile phone laterally to play the game, the user is assumed to actually walk north (i.e., walk forward along the N axis in the terrestrial coordinate system ENV), if the X axis in the mobile phone coordinate system XYZ represents east, when the user walks the mobile phone laterally, the mobile phone sensor may consider that the user always walks forward along the X axis (i.e., walks eastward), and it is obvious that the result of the direction determination is wrong, and if the direction positioning scheme provided in this embodiment is adopted, i.e., during walking, data (e.g., acceleration) collected by the mobile phone sensor is converted into terrestrial coordinate system ENV in real time (normally, the V axis and the Z axis coincide), and the average of the acceleration component on each coordinate axis of the ENV is calculated, the calculated average of north acceleration △ M1M/s 2 is assumed to be 4M/s2, the average of east acceleration M2 is 16M/s2, and then the calculated average of north acceleration and the associated coefficient of the acceleration and the corresponding to the vertical acceleration of the mobile phone nv 29, and the corresponding corin is assumed to be 0, and the corresponding corin equivalent to the coron equivalent of the corin equivalent to the coron equivalent to 25n=sign(0.13)(4)n=(4)nSecond motion variable hE ═ sign (0.42) in the E direction (16)n=(16)nWhen n is 3, then hN is 43,hE=163Then the azimuth angle thetaa=atan2(haE,haN)=atan2(163,43) The direction judgment result is true north within a certain error range instead of east direction considered by the mobile phone sensor, so that the walking direction of the user can be accurately known, the motion sensing game background can provide proper service according to the walking result, and the user experience is improved.

As can be seen from the above description, the direction positioning method provided by this embodiment is applied to an electronic device, and obtains motion information of the electronic device during a motion process and coordinate axis direction information of a terrestrial coordinate system, where the motion information includes motion parameter coordinates detected in a device coordinate system, the coordinate axis direction information includes an inverse geocentric direction, a first direction and a second direction, then converts the motion parameter coordinates into the terrestrial coordinate system according to the coordinate axis direction information to obtain corresponding target parameter coordinates, then determines a first motion variable of the electronic device in the first direction and a second motion variable in the second direction according to the target parameter coordinates, and determines an azimuth angle of the electronic device in the terrestrial coordinate system according to the first motion variable and the second motion variable to perform direction positioning, so that a user can perform direction positioning while carrying the electronic device, the method has the advantages of accurately positioning the motion direction of the electronic equipment, avoiding the influence of the placement direction of the electronic equipment on positioning, along with simplicity, high positioning precision and good positioning effect.

According to the method described in the above embodiments, this embodiment will be further described from the perspective of a direction positioning device, which may be specifically implemented as an independent entity or integrated in an electronic device.

Referring to fig. 8, fig. 8 specifically illustrates a direction positioning apparatus provided in an embodiment of the present application, which is applied to an electronic device, and the direction positioning apparatus may include: an obtaining module 10, a converting module 20, a first determining module 30 and a second determining module 40, wherein:

(1) acquisition module 10

The obtaining module 10 is configured to obtain motion information of the electronic device in a motion process and coordinate axis direction information of a terrestrial coordinate system, where the motion information includes a motion parameter coordinate detected in a device coordinate system, and the coordinate axis direction information includes an inverse geocentric direction, a first direction, and a second direction.

In this embodiment, the motion parameter coordinates may include an angular velocity coordinate and/or an acceleration coordinate, which may be detected by various sensors, in fig. 3, an angular velocity sensor (such as a gyroscope) may be used to detect the angular velocity coordinate, and an acceleration sensor (such as an accelerometer) may be used to detect the acceleration coordinate. The device coordinate system XYZ and the terrestrial coordinate system ENV are both three-dimensional coordinate systems, and for the mobile terminal, the origin of coordinates of the device coordinate system may be a terminal center, the Y-axis may be a linear direction from the terminal center to the earpiece, the X-axis may be a linear direction extending from the terminal center toward a direction away from the earpiece and perpendicular to the Y-axis, and the Z-axis may be a linear direction perpendicular to the screen from the terminal center. Generally, the device coordinate system is a coordinate system customized by a manufacturer for each electronic device, and the position of the device coordinate system relative to the ground plane is not fixed and is changed along with the placement angle of the device for the same electronic device.

This earth coordinate system mainly is decided according to earth's magnetic field, can obtain through detection such as gravity sensor and magnetometer (for example compass), and in this earth coordinate system, the origin of coordinates is the geocentric, and contrary geocentric direction V is the straight line direction from the geocentric orientation this electronic equipment place ground position, and this first direction N can be from the geocentric orientation the straight line direction that geomagnetic north pole belongs to, and this second direction E can be from the geocentric orientation the straight line direction that eastern place of earth. Generally, the position of the terrestrial coordinate system is generally fixed with respect to the ground plane for different electronic devices.

(2) Conversion module 20

And the conversion module 20 is configured to convert the motion parameter coordinate into the terrestrial coordinate system according to the coordinate axis direction information, so as to obtain a corresponding target parameter coordinate.

For example, the conversion module 20 may be specifically configured to:

determining the origin of coordinates of the device coordinate system;

determining a conversion matrix according to the coordinate axis direction information and the coordinate origin;

and performing coordinate transformation on the motion parameter coordinates according to the transformation matrix so as to transform the motion parameter coordinates into the terrestrial coordinate system.

In this embodiment, the origin of coordinates is usually the center of the device, the origin of the earth coordinate system and the origin of the device coordinate system may be coincided based on coordinate axis direction information, a transformation matrix may be determined according to the amount of change in position and angle when the coordinate axes are coincided, and then the product between the transformation matrix and the motion parameter coordinates may be calculated to obtain the target parameter coordinates.

It should be noted that the determination operation of the transformation matrix should be performed in real time, which may be performed independently by the electronic device, or may be performed by using a server, for example, the electronic device may upload coordinate axis direction information and a device coordinate system to the server in real time, and the server determines the transformation matrix according to the uploaded information. Generally speaking, the transformation matrices are generally different for electronic devices that are in different geographic locations or have different placements.

(3) First determination module 30

A first determining module 30, configured to determine a first motion variable of the electronic device in the first direction and a second motion variable in the second direction according to the target parameter coordinate.

For example, referring to fig. 9, the first determining module 30 may specifically include:

the generating unit 31 is configured to generate a waveform diagram according to the target parameter coordinate, where the waveform diagram includes a first signal wave corresponding to the first direction, a second signal wave corresponding to the second direction, and a third signal wave corresponding to the reverse geocentric direction.

In this embodiment, a corresponding oscillogram may be generated according to the target parameter coordinates obtained by conversion within a period of time. For example, referring to fig. 6, the abscissa is the detection time T, the ordinate is the acceleration a or the angular velocity ω, and since the target parameter coordinate has components on all three axes of the global coordinate system N, E, V, three signal waves M1 to M3 are formed in the waveform diagram, wherein the first signal wave M1 may be formed by an N-axis component, the second signal wave M2 may be formed by an E-axis component, and the third signal wave M3 may be formed by a V-axis component.

A first determination unit 32 for determining a first correlation coefficient between the first signal wave and the third signal wave, and a second correlation coefficient between the second signal wave and the third signal wave.

For example, the first determining unit 32 may specifically be configured to:

determining a covariance corresponding to the first signal wave and the third signal wave as a first covariance;

determining a variance corresponding to the first signal wave and a variance corresponding to the third signal wave;

and calculating a corresponding correlation coefficient according to the first covariance and the variance as a first correlation coefficient between the first signal wave and the third signal wave.

In this embodiment, the covariance and variance may be calculated by taking points on the first signal wave M1 and the third signal wave M3, for example, in a period from 0 to Tm, if the first signal wave M1 includes M points q1 to qm and the third signal wave M3 includes M points p1 to pm, the average △ q and △ p of the M points may be calculated respectively, and then the variance corresponding to M1 may be calculated

Figure BDA0001992836080000111

Variance corresponding to M3Wherein i ∈ [1, m]The covariance COV (M1, M3) between M1 and M3-E (M1M3) -E (M1) E (M3), where E () is the desired value, after which the first correlation coefficient corrv-COV (M1, M3)/σM1σM3

Similarly, the second correlation coefficient CorEV ═ COV (M2, M3)/σ can be calculated for the second signal wave M2 and the third signal wave M3 in the same manner as aboveM2σM3Wherein σ isM2For the variance corresponding to M2, the specific calculation process is similar to the calculation process of the first correlation coefficient corrv, and is not described here again.

A second determining unit 33, configured to determine a first motion variable of the electronic device in the first direction according to the first signal wave and the first correlation coefficient, and determine a second motion variable of the electronic device in the second direction according to the second signal wave and the second correlation coefficient.

In this embodiment, the first motion variable and the second motion variable are vectors. Because the walking of the person on the ground plane (namely the plane formed by the coordinate axes EN) is a periodic motion with two alternating legs, according to gait analysis, the motion amplitude of the forward direction of the pedestrian is relatively larger than the motion amplitude of the lateral deviation, so that the accurate walking direction of the person on the ground plane can be determined by analyzing the motion condition of the electronic equipment in the N direction (namely the first direction) and the motion condition of the electronic equipment in the E direction (namely the second direction).

For example, the second determining unit 33 may specifically be configured to:

determining a first peak point and a first valley point in the first signal wave, and calculating a first average value of a difference value between the first peak point and the first valley point;

determining a numerical value sign corresponding to the first correlation coefficient by using a sign function;

and determining a first motion variable of the electronic equipment in the first direction according to the numerical value sign and the first average value.

In this embodiment, since each period of alternation of the two legs is roughly divided into four strokes of leg lifting, standing on one foot, leg kicking, and standing on two feet, and the fluctuation of the wave signal in the interval (i.e., one period) after the leg lifting and before the leg falling is significant, the motion amplitude of the electronic device in the corresponding direction (the first direction and the second direction) may be determined by the average value of the difference between a single adjacent peak and trough or the average value of the difference between a plurality of adjacent peaks and troughs, the positive and negative directions of the electronic device in the corresponding direction may be determined according to the first correlation coefficient (the second correlation coefficient), and then the motion variable of the electronic device in the corresponding direction may be determined according to the positive and negative directions and the motion amplitude.

For example, the first motion variable hN=sign(CorNV)(△M1)nWhere n is a positive integer, sign () is a sign function, △ M1 is a first average value corresponding to M1E=sign(CorEV)(△M2)nWherein △ M2 is the second average corresponding to M2.

(4) Second determination module 40

And a second determining module 40, configured to determine an azimuth angle of the electronic device in the terrestrial coordinate system according to the first motion variable and the second motion variable, so as to perform directional positioning.

In the present embodiment, since the acceleration sensor and the angular velocity sensor are operated independently of each other, the motion parameter coordinates detected by them are not the same. In the above-mentioned fig. 3, when the motion parameter coordinate includes an acceleration coordinate or an angular velocity coordinate, a corresponding first motion variable h may be determined according to the acceleration coordinate (or the angular velocity coordinate)aN(or h)ωN) And a second motion variable haE(or h)ωE) The azimuth angle theta can then be determined from the dimension of acceleration a (or angular velocity omega) alonea(or theta)ω) That is, the scheme step corresponding to the dashed box 1 or 2 in fig. 3, at this time, the second determining module 40 may specifically be configured to:

substituting the first motion variable and the second motion variable corresponding to the angular velocity coordinate into a preset function to obtain an azimuth angle under the terrestrial coordinate system, or,

and substituting the first motion variable and the second motion variable corresponding to the acceleration coordinate into a preset function to obtain the azimuth angle in the terrestrial coordinate system.

In this embodiment, the preset function may be a human-set function atan2(), and the first motion variable h corresponding to the acceleration coordinate is used for the first motion variable haNAnd a second motion variable haEAzimuth angle thetaa=atan2(haE,haN) Or for a first motion variable h corresponding to the angular velocity coordinateωNAnd a second motion variable hωEAzimuth angle thetaω=atan2(hωE,hωN)。

Of course, to improve the accuracy, the azimuth angle may also be determined according to two dimensions, namely, angular velocity and acceleration, at this time, the motion parameter coordinate includes an acceleration coordinate and an angular velocity coordinate, and the second determining module 40 may specifically be configured to:

adding a first motion variable corresponding to the angular velocity coordinate and a first motion variable corresponding to the acceleration coordinate to obtain a first addition;

adding a second motion variable corresponding to the angular velocity coordinate and a second motion variable corresponding to the acceleration coordinate to obtain a second addition;

and substituting the first addition and the second addition into a preset function to obtain the azimuth angle in the terrestrial coordinate system.

For example, the first motion variable h is calculated by the above methodaNAnd hωNAnd a second motion variable haEAnd hωEThen, the total motion variable in the first direction (i.e., the first addition) and the total motion variable in the second direction (i.e., the second addition) may be calculated first, and then they are substituted into the above function atan2() to obtain the azimuth angle θ, and the specific scheme steps can be referred to as the above dashed box 3 in fig. 3.

22页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种自动驾驶装置精准定位的方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!