Summary of the invention
It is an object of the invention to provide the system and method in a kind of automatic calibration gravity sensor direction, it is possible to solve existing
Have when gravity sensor direction is debugged by technology and need to revise source code, time consuming and boring problem.
The technical scheme that the present invention provides is:
First aspect, the system automatically calibrating gravity sensor direction that the present invention provides, including:
Sizing stop, it is for placing the mobile device that gravity sensor direction is to be calibrated, when gravity sensor direction sign
When punctual mobile device is placed on described sizing stop, the gravity sensor data on X-coordinate axle direction of principal axis are first
In predetermined range value, the gravity sensor data on Y coordinate axle direction of principal axis are in the second predetermined range value, at Z coordinate axle axle
Gravity sensor data on direction are in the 3rd predetermined range value;
Calibration module, it is arranged in the mobile device that described gravity sensor direction is to be calibrated and is connected to described gravity
Induction apparatus, when the mobile device that described gravity sensor direction is to be calibrated is placed on described sizing stop, described calibrating die
Block obtains the gravity sensor data on three passages of described gravity sensor, punctual according to described gravity sensor direction sign
Predetermined range value on X-coordinate axle, Y coordinate axle and Z coordinate axle respectively when mobile device is placed on described sizing stop, sentences
The coordinate axes that the gravity sensor data of the disconnected each passage obtained are corresponding, with to the weight on three passages of described gravity sensor
Power sensor data travel direction is calibrated, and the data after direction calibration is sent in gravity sensor direction configuration module;
Gravity sensor direction configuration module, it is connected to described calibration module, is used for the data after receiving direction calibration
And store.
Preferably, the described system automatically calibrating gravity sensor direction, also include:
Starting up's script module, it is when the mobile device start to be calibrated in described gravity sensor direction, from
Data after read direction is calibrated in described gravity sensor direction configuration module, and the data after direction calibration are sent to weight
Power induction apparatus drives in module, so that the gravity sensor that described gravity sensor direction mobile device system to be calibrated obtains
Data are normal.
Preferably, the described system automatically calibrating gravity sensor direction, described sizing stop is A-frame, institute
Three angles stating sizing stop offset the first predetermined angular relative to X-coordinate direction of principal axis in 3-D walls and floor system respectively, and relative Y sits
Parameter direction offsets the second predetermined angular, offsets the 3rd predetermined angular relative to Z coordinate direction of principal axis.
Preferably, the described system automatically calibrating gravity sensor direction, described according to described gravity sensor side
Pre-on X-coordinate axle, Y coordinate axle and Z coordinate axle respectively when mobile device when standard is placed on described sizing stop
Determine value range, it is judged that the coordinate axes that the gravity sensor data of each passage of acquisition are corresponding specifically includes:
Judge that the gravity sensor data absolute value of each passage obtained is whether in described first predetermined range value;
The most then continue to judge whether the gravity sensor data of this passage are less than zero, if less than zero, it is determined that this passage
Gravity sensor data be X-coordinate axial gravity sensor data and it needs to reverse directions, if not less than zero, the most really
The gravity sensor data of this passage fixed are X-coordinate axial gravity sensor data, it is not necessary to reverse directions;
If it is not, then continue to judge that whether the gravity sensor data absolute value of this passage is in described second predetermined range value
In;
The most then continue to judge whether the gravity sensor data of this passage are less than zero, if less than zero, it is determined that this passage
Gravity sensor data be Y coordinate axial gravity sensor data and it needs to reverse directions, if not less than zero, the most really
The gravity sensor data of this passage fixed are Y coordinate axial gravity sensor data, it is not necessary to reverse directions;
If it is not, then continue to judge that whether the gravity sensor data absolute value of this passage is in described 3rd predetermined range value
In;
The most then continue to judge whether the gravity sensor data of this passage are less than zero, if less than zero, it is determined that this passage
Gravity sensor data be Z coordinate axial gravity sensor data and it needs to reverse directions, if not less than zero, the most really
The gravity sensor data of this passage fixed are Z coordinate axial gravity sensor data, it is not necessary to reverse directions;
If it is not, then need to reappose the mobile device that described gravity sensor direction is to be calibrated.
Preferably, the described system automatically calibrating gravity sensor direction, described first predetermined angular is 30~40
Degree, described second predetermined angular is 10~20 degree, and described 3rd predetermined angular is 50~60 degree.
Second aspect, the method automatically calibrating gravity sensor direction that the present invention provides, including:
Mobile device to be calibrated for gravity sensor direction is placed on sizing stop;
Starting calibration module, described calibration module obtains the gravity sensor data on three passages of gravity sensor, root
When being placed on described sizing stop according to the mobile device that gravity sensor direction sign is punctual respectively X-coordinate axle, Y coordinate axle and
Predetermined range value on Z coordinate axle, it is judged that the coordinate axes that the gravity sensor data of each passage of acquisition are corresponding, with to described
Gravity sensor data travel direction calibration on three passages of gravity sensor, and the data after direction calibration are sent to weight
In power induction apparatus direction configuration module;
Gravity sensor direction configures the data after module accepts direction calibration and stores;
Restarting the mobile device that described gravity sensor direction is to be calibrated, starting up's script module is from described gravity
Data after read direction is calibrated in induction apparatus direction configuration module, and the data after direction calibration are sent to gravity sensor
Drive in module.
The present invention at least includes following beneficial effect: owing to being provided with sizing stop, calibration module and gravity sensor side
To configuration module, when therefore the gravity sensor direction to mobile device is debugged, only mobile device need to be placed on calibration
On support, starting calibration module, the direction of gravity sensor just can automatically be calibrated by calibration module, and after calibration
Data be sent to gravity sensor direction configuration module in, as long as so restarting mobile device, starting up's script mould
Block configures the data module after read direction calibration from gravity sensor direction, and sends the data after direction calibration to weight
Power induction apparatus drives in module, it becomes possible to ensure that the gravity sensor data that mobile device system obtains are normal.This system structure
Simply, any one people being ignorant of code can operate, it is possible to saves the plenty of time, and does not revise source code with regard to energy
Enough complete automatically to calibrate.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Describe, it is clear that described embodiment is only a part of embodiment of the present invention rather than whole embodiments wholely.Based on
Embodiment in the present invention, those of ordinary skill in the art obtained under not making creative work premise all other
Embodiment, broadly falls into the scope of protection of the invention.
Advantage for making technical solution of the present invention is clearer, makees the present invention specifically with embodiment below in conjunction with the accompanying drawings
Bright.
As it is shown in figure 1, the system automatically calibrating gravity sensor direction that the embodiment of the present invention provides, including: calibration
Frame, it is for placing the mobile device that gravity sensor direction is to be calibrated, when the mobile device that gravity sensor direction sign is punctual
When being placed on described sizing stop, the gravity sensor data on X-coordinate axle direction of principal axis in the first predetermined range value,
The gravity sensor data on Y coordinate axle direction of principal axis gravity sensing in the second predetermined range value, on Z coordinate axle direction of principal axis
Device data are in the 3rd predetermined range value;Calibration module, it is arranged on the mobile device that described gravity sensor direction is to be calibrated
In and be connected to described gravity sensor, prop up when the mobile device that described gravity sensor direction is to be calibrated is placed on described calibration
Time on frame, described calibration module obtains the gravity sensor data on three passages of described gravity sensor, according to described gravity
Respectively at X-coordinate axle, Y coordinate axle and Z coordinate when the punctual mobile device of induction apparatus direction sign is placed on described sizing stop
Predetermined range value on axle, it is judged that the coordinate axes that the gravity sensor data of each passage of acquisition are corresponding, with to described gravity
Gravity sensor data travel direction calibration on three passages of induction apparatus, and the data after direction calibration are sent to gravity-feed tank
Answer in device direction configuration module;Gravity sensor direction configuration module, it is connected to described calibration module, is used for receiving school, direction
Data after standard also store.
Wherein, as in figure 2 it is shown, described sizing stop is A-frame, three angles of described sizing stop are at three-dimensional coordinate
Axle system offsets the first predetermined angular β relative to X-coordinate direction of principal axis respectively, offsets the second predetermined angle relative to Y coordinate direction of principal axis,
The 3rd predetermined angular γ is offset relative to Z coordinate direction of principal axis.Described first predetermined angular is 30~40 degree, described second predetermined angular
Being 10~20 degree, described 3rd predetermined angular is 50~60 degree.
It should be noted that the first predetermined angular β, the second predetermined angle and the 3rd predetermined angular γ, can be according to need
Want oneself definition, but during definition, must ensure that relative spacing is the biggest, otherwise can cause the situation of misrecognition.
Wherein, when the described mobile device punctual according to described gravity sensor direction sign is placed on described sizing stop
Predetermined range value on X-coordinate axle, Y coordinate axle and Z coordinate axle respectively, it is judged that the gravity sensor number of each passage of acquisition
Specifically include according to corresponding coordinate axes:
Judge that the gravity sensor data absolute value of each passage obtained is whether in described first predetermined range value;
The most then continue to judge whether the gravity sensor data of this passage are less than zero, if less than zero, it is determined that this passage
Gravity sensor data be X-coordinate axial gravity sensor data and it needs to reverse directions, if not less than zero, the most really
The gravity sensor data of this passage fixed are X-coordinate axial gravity sensor data, it is not necessary to reverse directions;
If it is not, then continue to judge that whether the gravity sensor data absolute value of this passage is in described second predetermined range value
In;
The most then continue to judge whether the gravity sensor data of this passage are less than zero, if less than zero, it is determined that this passage
Gravity sensor data be Y coordinate axial gravity sensor data and it needs to reverse directions, if not less than zero, the most really
The gravity sensor data of this passage fixed are Y coordinate axial gravity sensor data, it is not necessary to reverse directions;
If it is not, then continue to judge that whether the gravity sensor data absolute value of this passage is in described 3rd predetermined range value
In;
The most then continue to judge whether the gravity sensor data of this passage are less than zero, if less than zero, it is determined that this passage
Gravity sensor data be Z coordinate axial gravity sensor data and it needs to reverse directions, if not less than zero, the most really
The gravity sensor data of this passage fixed are Z coordinate axial gravity sensor data, it is not necessary to reverse directions;
If it is not, then need to reappose the mobile device that described gravity sensor direction is to be calibrated.
It should be noted that generally, three passages of gravity sensor use on CH0-gravity sensor passage 0
Data (data of typically X/Y coordinate axes), the data (number of typically Y/X coordinate axes on CH1-gravity sensor passage 1
According to), the data (the typically data of Z coordinate axle) on CH2-gravity sensor passage 2, gravity sensor direction configuration module is protected
" the gravity sensor direction configuration file " file format deposited is:
{Xch,Xsig,Ych,Ysig,Zch,Zsig}
XchThe data of X-coordinate axle are from XchObtain on the passage represented;
XsigData on X-coordinate axle are the need of reverse directions;1 expression need not reversion, and-1 expression needs reversion;
YchThe data of Y coordinate axle are from YchObtain on the passage represented;
YsigData on Y coordinate axle are the need of reverse directions;1 expression need not reversion, and-1 expression needs reversion;
ZchData on Z coordinate axle are from ZchObtain on the passage represented;
ZsigData on Z coordinate axle are the need of reverse directions;1 expression need not reversion, and-1 expression needs reversion;
Such as shown in flow chart 3, give the process obtaining X-coordinate number of axle evidence, wherein, GXmin, GXmaxRepresent first respectively
The minima of predetermined range value and maximum.Similarly, obtain Y coordinate number of axle evidence and the process of Z coordinate number of axle evidence, and obtain X
The process of coordinate axes data is the same, and we use GYmin, GYmaxRepresent minima and the maximum of the second predetermined range value respectively,
GZmin, GZmaxRepresent minima and the maximum of the 3rd predetermined range value respectively.
It should be noted that the layout type of gravity sensor in the mobile device to be calibrated of described gravity sensor direction
There are 8 kinds of modes.As shown in Figure 4, it is designed with 8 kinds of modes just because of this hardware, just causes the direction of gravity sensor to have many
Kind.Use which kind of mode to be based on hardware device layout and the limitation of wiring as hardware and design and (or be in it
His purpose considers).
Further, the system automatically calibrating gravity sensor direction as described in Figure 1, also include: starting up's script
Module, it, when the mobile device start to be calibrated in described gravity sensor direction, is joined from described gravity sensor direction
Put the data after read direction calibration in module, and the data after direction calibration sent to gravity sensor driving module,
So that the gravity sensor data that described gravity sensor direction mobile device system to be calibrated obtains are normal.
As it is shown in figure 5, gravity sensor drives module workflow schematic diagram after giving start.
Wherein, gravity sensor drives module also to have and is provided out interface-file device node for external control gravity
The set direction of induction apparatus.
As shown in Figure 6, the method automatically calibrating gravity sensor direction that further embodiment of this invention provides, including:
S01, mobile device to be calibrated for gravity sensor direction is placed on sizing stop;
S02, startup calibration module, described calibration module obtains the gravity sensor number on three passages of gravity sensor
According to, sit at X-coordinate axle, Y respectively when being placed on described sizing stop according to the mobile device that gravity sensor direction sign is punctual
Predetermined range value on parameter and Z coordinate axle, it is judged that the coordinate axes that the gravity sensor data of each passage of acquisition are corresponding, with
Gravity sensor data travel direction on three passages of described gravity sensor is calibrated, and the data after direction calibration are passed
Deliver in gravity sensor direction configuration module;
S03, gravity sensor direction configure the data after module receives direction calibration and store;
S04, restarting the mobile device that described gravity sensor direction is to be calibrated, starting up's script module is from described
Data after read direction is calibrated in gravity sensor direction configuration module, and the data after direction calibration are sent to gravity-feed tank
Device is answered to drive in module.
Wherein, starting after calibration module, the embodiment of the present invention calculates first gravity sensor within scavenging system itself
Calibration data, carry out gravity sensor bearing data analysis the most again thus complete direction calibration.
As it has been described above, the embodiment of the present invention is owing to being provided with sizing stop, calibration module and the configuration of gravity sensor direction
Module, when therefore the gravity sensor direction to mobile device is debugged, only need to be placed on mobile device on sizing stop,
Starting calibration module, the direction of gravity sensor just can automatically be calibrated by calibration module, and the data after calibration
Being sent in gravity sensor direction configuration module, as long as so restarting mobile device, starting up's script module is from weight
Data after read direction is calibrated in power induction apparatus direction configuration module, and the data after direction calibration are sent to gravity sensing
Device drives in module, it becomes possible to ensure that the gravity sensor data that mobile device system obtains are normal.This system structure is simple, appoints
What people being ignorant of code can operate, it is possible to saves the plenty of time, and amendment source code just can not complete
Automatically calibration.
Although embodiment of the present invention are disclosed as above, but it is not restricted in description and embodiment listed
Using, it can be applied to various applicable the field of the invention completely, for those skilled in the art, and can be easily
Realizing other amendment, therefore under the general concept limited without departing substantially from claim and equivalency range, the present invention does not limit
In specific details with shown here as the legend with description.