CN103186687A - Simulator gravity sensing data acquisition method and device - Google Patents

Simulator gravity sensing data acquisition method and device Download PDF

Info

Publication number
CN103186687A
CN103186687A CN2011104566378A CN201110456637A CN103186687A CN 103186687 A CN103186687 A CN 103186687A CN 2011104566378 A CN2011104566378 A CN 2011104566378A CN 201110456637 A CN201110456637 A CN 201110456637A CN 103186687 A CN103186687 A CN 103186687A
Authority
CN
China
Prior art keywords
attitude
equipment
analog machine
transient state
transformation matrix
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2011104566378A
Other languages
Chinese (zh)
Inventor
孙元臻
冉放
董海峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN2011104566378A priority Critical patent/CN103186687A/en
Publication of CN103186687A publication Critical patent/CN103186687A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a simulator gravity sensing data acquisition method and a device. The method comprises the following steps: obtaining current simulation attitude information of simulation equipment, which comprises rotating angles alpha, beta and gamma of three axes of the simulation equipment relative to the standard attitude under a self coordinate system, obtaining a coordinate transformation matrix of current attitude, relative to the standard attitude, of the simulation equipment according to alpha, beta and gamma, multiplying the coordinate transformation matrix by gravity vector of the simulation equipment under the standard attitude, so as to obtain gravity sensing data of the simulation equipment under the current attitude, and sending the gravity sensing data to a simulation equipment operation system module of a simulator. By applying the scheme of the invention, the simulation of a gravity sensing operation mode can further be realized in simulator software.

Description

A kind of simulator gravity sensing data capture method and device
Technical field
The present invention relates to the simulator technology field, particularly relate to a kind of simulator gravity sensing data capture method and device.
Background technology
Simulator (emulator) also claims emulator (simulator), refers to function and operating system by software mode analog hardware equipment, set up have the complete hardware function, operate in a virtual system in the isolation environment.The form of simulator is varied, and common simulator is based on PC more, for example various game machines of simulation, portable equipment in PC, even in PC simulation one or more PC in addition.The main effect of simulator on the one hand is to make can move software on other platforms on certain platform, for example recreation in the Play Station games on PC; Be the mode with software simulation on the other hand, be provided for the environment of testing apparatus, so that data collection, bug location etc.
For the simulator of equipment such as game machine, mobile phone, an important function is exactly to realize the simulation of mode of operation, common mode is that game machine rocking bar, button, mobile phone key etc. are mapped to operating equipments such as keyboard on the PC, mouse, yet the development along with technology, input mode on the various device has been not limited only to the simple key-press operation now, and for example operation of the touch screen on smart mobile phone, the panel computer, trace ball operation, inductive operation etc. all become the mode of operation of main flow gradually.
At present, touch screen operation and trace ball operation can be simulated realization with the mode of keyboard or mouse, but, for inductive operation, need inductor hardware device built-in in the dependence equipment (for example gravity sensor, magnetic force induction device, attitude inductor, rotary inductive device etc.) to realize, in existing simulator software, also can't realize the simulation to all kinds of inductive operation modes.
Summary of the invention
For solving the problems of the technologies described above, the embodiment of the invention provides a kind of simulator gravity sensing data capture method and device, and to be implemented in the simulator software the simulation of gravity inductive operation mode, technical scheme is as follows:
A kind of simulator gravity sensing data capture method comprises:
Obtain the current simulation attitude information of analog machine, described attitude information comprises: analog machine under self coordinate system with respect to three anglec of rotation α, β, the γ of standard attitude;
Calculate the current attitude of analog machine with respect to the transformation matrix of coordinates of standard attitude according to α, β, γ;
Multiply by the gravity vector of analog machine under the standard attitude with described transformation matrix of coordinates, obtain the gravity sensing data of analog machine under current attitude;
The gravity sensing data are sent to the analog machine operating system module of simulator.
According to one embodiment of the present invention, described standard attitude is:
The equipment horizontal positioned that faces up, and the equipment upper side is towards Zheng Bei.
According to one embodiment of the present invention, described analog machine self coordinate is:
X-axis is pointed to positive from equipment downside sensing upper side, Z axle from the back side of equipment from equipment left surface sensing right flank, Y-axis.
According to one embodiment of the present invention, described α, β, γ are respectively:
The angle that equipment counterclockwise rotates around X, Y, Z axle.
According to one embodiment of the present invention, describedly calculate the current attitude of analog machine with respect to the transformation matrix of coordinates of standard attitude according to α, β, γ, comprising:
Calculate the transformation matrix of coordinates RZ that becomes first transient state from the standard attitude according to γ, wherein, equipment becomes first transient state after the standard attitude centers on Z axle anglec of rotation γ;
Calculate the transformation matrix of coordinates RX that becomes second transient state from first transient state according to α, wherein, equipment becomes second transient state after first transient state centers on X-axis anglec of rotation α;
Calculate the transformation matrix of coordinates RY that becomes current attitude from second transient state according to β, wherein, equipment becomes current attitude after second transient state centers on Y-axis anglec of rotation β;
Then the current attitude of analog machine is with respect to the transformation matrix of coordinates R=R of standard attitude YR XR Z
A kind of simulator gravity sensing data acquisition facility comprises:
The attitude information acquiring unit is used for obtaining the current simulation attitude information of analog machine, and described attitude information comprises: analog machine under self coordinate system with respect to three anglec of rotation α, β, the γ of standard attitude;
The transformation matrix computing unit is used for calculating the current attitude of analog machine with respect to the transformation matrix of coordinates of standard attitude according to α, β, γ;
The sensed data computing unit is used for multiply by the gravity vector of analog machine under the standard attitude with described transformation matrix of coordinates, obtains the gravity sensing data of analog machine under current attitude;
The sensed data transmitting element is for the analog machine operating system module that the gravity sensing data is sent to simulator.
According to one embodiment of the present invention, described standard attitude is:
The equipment horizontal positioned that faces up, and the equipment upper side is towards Zheng Bei.
According to one embodiment of the present invention, described analog machine self coordinate is:
X-axis is pointed to positive from equipment downside sensing upper side, Z axle from the back side of equipment from equipment left surface sensing right flank, Y-axis.
According to one embodiment of the present invention, described α, β, γ are respectively:
The angle that equipment counterclockwise rotates around X, Y, Z axle.
According to one embodiment of the present invention, described transformation matrix computing unit comprises:
First computation subunit is used for calculating the transformation matrix of coordinates R that becomes first transient state from the standard attitude according to γ Z, wherein, equipment becomes first transient state after the standard attitude centers on Z axle anglec of rotation γ;
Second computation subunit is used for calculating the transformation matrix of coordinates R that becomes second transient state from first transient state according to α X, wherein, equipment becomes second transient state after first transient state centers on X-axis anglec of rotation α;
The 3rd computation subunit is used for calculating the transformation matrix of coordinates R that becomes current attitude from second transient state according to β Y, wherein, equipment becomes current attitude after second transient state centers on Y-axis anglec of rotation β;
The 4th computation subunit is used for calculating the current attitude of analog machine with respect to the transformation matrix of coordinates R=R of standard attitude YR XR Z
The present invention also provides a kind of simulation system, comprises foregoing simulator gravity sensing data acquisition facility and analog machine operating system module;
Described analog machine operating system module is used for calling the gravity sensing data that described simulator gravity sensing data acquisition facility sends, with the gravity sensing data distributing to the application program that runs in the operating system.
The technical scheme that the embodiment of the invention provides, utilize analog machine that the user imports with respect to three rotation angle information of standard attitude, calculate the gravity sensing data of analog machine under current attitude, these gravity sensing data can directly be sent to operating system, keep supplying a layer application call.Be equivalent to simulate the function of hardware gravity sensor, made in simulator software, also can realize the simulation to gravity inductive operation mode.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, to do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below, apparently, the accompanying drawing that describes below only is some embodiment that put down in writing among the present invention, for those of ordinary skills, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the induction configuration diagram of hardware device;
Fig. 2 is the simulation system configuration diagram of the embodiment of the invention;
Fig. 3 is the device coordinate system synoptic diagram of the embodiment of the invention;
Fig. 4 is embodiment of the invention simulator gravity sensing data capture method process flow diagram;
Fig. 5 is the coordinate system transformation synoptic diagram of the embodiment of the invention;
Fig. 6 is the structural representation of embodiment of the invention simulator gravity sensing data acquisition facility;
Fig. 7 is the induction configuration diagram of Android equipment;
Fig. 8 is the Android simulation system configuration diagram of the embodiment of the invention.
Embodiment
In order to make those skilled in the art understand technical scheme among the present invention better, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is described in detail, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, the every other embodiment that those of ordinary skills obtain should belong to the scope of protection of the invention.
Figure 1 shows that the induction configuration diagram of normal hardware device: the effect that drives layer provides the communication interface of operating system and inductor hardware, obtains sensed data that inductor obtains and offers application program and call.Yet in simulator, do not have inductor hardware, the driving layer of operating system can't get access to corresponding sensed data, thereby can't be directly to needing sensed data to carry out dry run or test as the application program of input.
For overcoming the above problems, the invention provides a kind of simulation system, as shown in Figure 2, this system comprises simulator sensed data deriving means 110 and analog machine operating system module 120, wherein the effect of simulator sensed data deriving means 110 is that the analog machine attitude data that the user imports is converted to sensed data and imports operating system into, has been equivalent to simulate the function of hardware inductor.120 of analog machine operating system modules are the operating system of the equipment of having simulated in the mode of software.
For the present invention, the concrete function of simulator sensed data deriving means 110 is that the analog machine attitude data that the user imports is converted to the gravity sensing data.
The implication of gravity sensing data is: the coordinate system of define equipment self at first, and under this coordinate system, corresponding the vector representation of the suffered acceleration of gravity of equipment; When the spatial attitude of equipment changes, the direction of coordinate system also can change, and corresponding acceleration of gravity vector also can change so-called gravity sensing data, be exactly that data are when being in various attitude, at the acceleration of gravity vector representation of current coordinate system.
For ease of calculating, generally also can define an equipment standard attitude, under the standard attitude, equipment only be subjected to a change in coordinate axis direction, size is the gravitational acceleration component of g ≈ 9.8, and is 0 at the gravitational acceleration component of other change in coordinate axis direction.Be standard state during general custom define equipment horizontal positioned (face up, the back side down).
According to general custom, can be similar to equipment and regard a hexahedron as, have upper side, downside, left surface, right flank, front, six faces in the back side, the definition X-axis be the direction, Y-axis of pointing to right flank from the equipment left surface for the direction of pointing to upper side from the equipment downside, Z axle for point to the direction in front from the back side of equipment, referring to shown in Figure 3.In addition, face up horizontal positioned, the attitude of upper side towards positive north of define equipment is the standard attitude, and then under the standard attitude, the acceleration of gravity vector representation that equipment is received is:
G 0 → = 0 0 - g
Then Be exactly the gravity vector of equipment under the standard attitude, certainly, according to general custom, think that the acceleration of gravity direction is downward, so the vector representation of acceleration of gravity can for example be expressed as also not exclusively according to the coordinate system of equipment self:
G 0 → = 0 0 g
These do not influence the present invention program's realization.
As seen, gravity sensing is exactly the variation by sensing device gravity/acceleration of gravity vector, comes the variation of the current attitude of judgment device.At present, portable equipments such as a lot of smart mobile phones and panel computer are built-in gravity sensor all, utilizes gravity sensing, can realize as colourful application operatings such as " rocking page turning ", " whipping Switch Video ", " turn-to-mute ", " recreation of balance ball ".
For simulator software, the attitude of an equipment of simulation is easy to realize, the user imports a series of attitude datas by modes such as order line or graphical interfaces, just can uniquely determine the spatial attitude of an analog machine, and the solution of the present invention is exactly that the user imports attitude data, calculates the gravity sensing data of analog machine under current attitude, these gravity sensing data can directly be sent to operating system, keep supplying a layer application call.Be equivalent to simulate the function of hardware gravity sensor, made in simulator software, also can realize the simulation to gravity inductive operation mode.
Shown in Figure 4, a kind of simulator gravity sensing data capture method for the embodiment of the invention provides may further comprise the steps:
S201 obtains the current simulation attitude information of analog machine.
The concept of standard attitude was introduced in the front, if be reference with the standard attitude, any one spatial attitude of equipment can be obtained for 3 times by three the coordinate axis rotations of standard attitude around self coordinate system so.Expression for convenience, definition α, β, three angles of γ:
α: equipment is around the angle of X-axis rotation, counterclockwise for just;
β: equipment is around the angle of Y-axis rotation, counterclockwise for just;
γ: mobile phone is around the angle of Z axle rotation, counterclockwise for just;
Define equipment when the standard attitude, α=β=γ=0.
Need to prove that equipment is current attitude from the standard posture changing, need be through three rotations, and each rotation all is at the coordinate axis of current location, therefore there is sequencing problem in three rotations, for example:
Coordinate axis under the standard attitude is X 0, Y 0, Z 0
After 1 rotation, become first transient state, this moment, coordinate axis was X ', Y ', Z ';
Through 2 times the rotation after, become second transient state, this moment coordinate axis be X ", Y ", Z ";
After 3 rotations, become current attitude.
Suppose that the definition rotation is in proper order, rotate around X earlier that rotate around Y-axis then, around the rotation of Z axle, so actual rotary course should be at last:
Under standard state, around X 0Rotation alpha changes to first transient state;
Under first transient state, around Y ' rotation β, change to second transient state;
Under second transient state, around Z " rotation γ, change to current state.
Be understandable that equipment is current attitude from the standard posture changing, the order of three rotations has 12 kinds of orders, as simulator software, specifically should adopt which kind of order, should be determined by the operating system of analog machine.For example, for Android (andriod) operating system, the order that defines three rotations is Z → X → Y, and under this system, corresponding rotary course is:
Under standard state, around Z 0Rotation γ changes to first transient state;
Under first transient state, around X ' rotation alpha, change to second transient state;
Under second transient state, around Y " rotation β, change to current state.
For ease of explanation, in the subsequent content in the present embodiment, will unify with this rotation is that example describes in proper order.
S202 calculates the current attitude of analog machine with respect to the transformation matrix of coordinates of standard attitude according to α, β, γ;
Obtain just can obtaining analog machine at the transformation matrix of coordinates of current attitude with respect to the standard attitude after α, β, the γ data of user input.In the present embodiment, according to defined rotation order Z → X → Y among the S201, can calculate transformation matrix according to the following steps:
S202a calculates the transformation matrix of coordinates R that becomes first transient state from the standard attitude according to γ Z, wherein, equipment becomes first transient state after the standard attitude centers on Z axle anglec of rotation γ;
Referring to shown in Figure 5, suppose in the X-Y coordinate system, to exist a some A, coordinate be (x, y), OA vector is θ with the angle of X-axis, when equipment rotates the γ angle around the Z axle, the γ angle that has been equivalent to coordinate system rotation is established the coordinate of A point under new coordinate system and is become (x ', y '), then under new coordinate system, the OA vector can be expressed as [x ' y '] T, wherein:
x ′ | OA → | cos ( θ - γ )
= | OA → | ( cos θ cos γ + sin θ sin γ )
= | OA → | × ( x | OA → | cos γ + y | OA → | sin γ )
= x cos γ + y sin γ
Similar approach can obtain:
y ′ = | OA → | sin ( θ - γ )
= - x sin γ + y cos γ
Because the Z axle does not change, therefore have
z′=z
So, can obtain becoming from the standard attitude transformation matrix of coordinates R of first transient state Z:
R z = cos γ sin γ 0 - sin γ cos γ 0 0 0 1
S202b calculates the transformation matrix of coordinates R that becomes second transient state from first transient state according to α X, wherein, equipment becomes second transient state after first transient state centers on X-axis anglec of rotation α;
The derivation method of similar S202a can obtain:
R x = 1 0 0 0 cos α sin α 0 - sin α cos α
S202c calculates the transformation matrix of coordinates R that becomes current attitude from second transient state according to β Y, wherein, equipment becomes current attitude after second transient state centers on Y-axis anglec of rotation β;
The derivation method of same similar S202a can obtain:
R y = cos β 0 - sin β 0 1 0 sin β 0 cos β
S202d calculates the current attitude of analog machine with respect to the transformation matrix of coordinates of standard attitude.
According to the rotation of Z → X → Y order, can obtain for the coordinate under the standard attitude (x, y z), through three postrotational changes in coordinates are being:
x ′ y ′ z ′ = R y R x R z x y z = R x y z
Then the current attitude of analog machine is with respect to the transformation matrix of coordinates R=R of standard attitude YR XR Z
S203 multiply by the gravity vector of analog machine under the standard attitude with described transformation matrix of coordinates, obtains the gravity sensing data of analog machine under current attitude;
If the gravity vector of analog machine under the standard attitude is
Figure BDA0000127398360000093
Then suffered gravity vector is under current attitude:
G → = R y R x R z · G 0 →
S204 is sent to the gravity sensing data analog machine operating system module of simulator.
Obtain after the gravity sensing data under the current attitude, further the gravity sensing data are sent to the analog machine operating system module of simulator, various upper level applications for operating system are called, thereby have realized in simulator generating the gravity sensing data and equipment is operated accordingly.
Need to prove that in the above-described embodiments, just define to rotate sequential definition and describe at specific device coordinate definition, standard attitude, these definition should not be construed the restriction to the present invention program.Those skilled in the art can obtain the solution under other definition modes according to above scheme.
As seen through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential general hardware platform.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product can be stored in the storage medium, as ROM/RAM, magnetic disc, CD etc., comprise that some instructions are with so that a computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the present invention or embodiment.
Corresponding to top method embodiment, the present invention also provides a kind of simulator gravity sensing data acquisition facility, referring to shown in Figure 6, comprising:
Attitude information acquiring unit 310 is used for obtaining the current simulation attitude information of analog machine, and described attitude information comprises: analog machine under self coordinate system with respect to three anglec of rotation α, β, the γ of standard attitude;
Transformation matrix computing unit 320 is used for calculating the current attitude of analog machine with respect to the transformation matrix of coordinates of standard attitude according to α, β, γ;
Sensed data computing unit 330 is used for multiply by the gravity vector of analog machine under the standard attitude with described transformation matrix of coordinates, obtains the gravity sensing data of analog machine under current attitude;
Sensed data transmitting element 340 is for the analog machine operating system module that the gravity sensing data is sent to simulator.
In one embodiment of the invention, described standard attitude is:
The equipment horizontal positioned that faces up, and the equipment upper side is towards Zheng Bei.
In one embodiment of the invention, described analog machine self coordinate is:
X-axis is pointed to positive from equipment downside sensing upper side, Z axle from the back side of equipment from equipment left surface sensing right flank, Y-axis.
In one embodiment of the invention, described α, β, γ are respectively:
The angle that equipment counterclockwise rotates around X, Y, Z axle.
In one embodiment of the invention, described transformation matrix computing unit can comprise:
First computation subunit is used for calculating the transformation matrix of coordinates R that becomes first transient state from the standard attitude according to γ Z, wherein, equipment becomes first transient state after the standard attitude centers on Z axle anglec of rotation γ;
Second computation subunit is used for calculating the transformation matrix of coordinates R that becomes second transient state from first transient state according to α X, wherein, equipment becomes second transient state after first transient state centers on X-axis anglec of rotation α;
The 3rd computation subunit is used for calculating the transformation matrix of coordinates R that becomes current attitude from second transient state according to β Y, wherein, equipment becomes current attitude after second transient state centers on Y-axis anglec of rotation β;
The 4th computation subunit is used for calculating the current attitude of analog machine with respect to the transformation matrix of coordinates R=R of standard attitude YR XR Z
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and identical similar part is mutually referring to getting final product between each embodiment, and each embodiment stresses is difference with other embodiment.Especially, for device or system embodiment, because it is substantially similar in appearance to method embodiment, so describe fairly simplely, relevant part gets final product referring to the part explanation of method embodiment.Apparatus and system embodiment described above only is schematic, wherein said unit as the separating component explanation can or can not be physically to separate also, the parts that show as the unit can be or can not be physical locations also, namely can be positioned at a place, perhaps also can be distributed on a plurality of network element.Can select wherein some or all of module to realize the purpose of present embodiment scheme according to the actual needs.Those of ordinary skills namely can understand and implement under the situation of not paying creative work.
Android is a kind of open source code operating system based on Linux, mainly is used in portable equipments such as smart mobile phone, panel computer.This system adopts the Java language exploitation, comprises ingredients such as operating system, middleware, user interface and application software.Along with the continuous development of Android system, each big hardware vendor also constantly releasing various products based on the Android system, at present, occupies critical role in market based on the Android system product.Further combined with the concrete condition of Android system, the solution of the present invention is described below.
Figure 7 shows that the induction configuration diagram of normal android hardware device: be followed successively by from top to bottom: Java application layer (Java Application Layer), Java ccf layer (Java Framework Layer), the local calling interface layer (Sensor JNI Layer) of inductor, inductor hardware abstraction layer (Sensor Hardware Abstract Layer), inductor drive layer (Sensor Driver Layer).
Fig. 8 is a kind of Android simulation system Organization Chart provided by the present invention, and Sensor is simulated, and can start with from Framework layer or Hardware Abstract Layer.Consider that mostly to the simulation of inductor is as test, if realize at the Framework layer, whether normal just can't find at the development of Framework layer when testing so, so, in scheme provided by the present invention, adopt self-defining Sensor Mock Library to replace original Sensor HAL and Sensor Driver Layer.
For the present invention, can be at the sSensorList[of Sensor Mock Library] in the array, the equipment essential information of adding Gravity Sensor mainly can comprise following field:
.name title
.vendor manufacturer
.version version
.handle the ID of inductor
.type the type of inductor, value is SENSOR_TYPE_GRAVITY in the present embodiment,
.maxRange the maximum measurement range of inductor, 4.0f+9.81f for example, the greatest measurement of expression acceleration of gravity is 12.81
.resolution the sensitivity of inductor, (4.0f+9.81f)/256.0f for example,
.power the power consumption information of inductor, 6.8f for example, the electric current the during operation of expression inductor is 6.8mA
.minDelay the interval of events of twice reported data, 20.0f for example represents that the time interval that reports for twice is 20ms
Then, in the poll function of Sensor Mock Library, add the code of resolving string data.String format be " gravity<x 〉:<y 〉:<z〉"
Figure BDA0000127398360000121
Consider that simulation realizes that the module Sensor Data Generator of sensed data should not belong to the part of Android OS, so partly be put into its realization in the simulator, can make the CPU statistical tool of the user performance test in the Android system can the counting statistics of digital simulation in the middle of the Android system load, can more objectively not react the performance condition of Android OS like this.
At last, in simulation system, also provide the user to import control desk Emulator Console, can allow the user according to oneself demand, revised the value of attitude data, whether normal to check the data that application layer App obtains, whether performance meets the expectation.Wherein, the user can adopt the mode at order line or graphical operation interface, the attitude data of input analog machine.
Utilize Emulator Console, after interpolation arranged the order of attitude data, the user can import attitude data.Then, Gravity Sensor Data Generator transforms into the Gravity data with these data, translates into the form of character string: " gravity<x 〉:<y 〉:<z〉", send to Sensor Mock Library.After Sensor Mock Library receives this character string, resolve the data of character string, construct the structure of an expression Gravity Sensor Data then, pass to the upper strata, finish the simulation to sensed data.
Use scheme provided by the present invention, can make Android App operate on the simulator after, obtain the facility information of Gravity Sensor, and in time obtain the data of Gravity Sensor.More importantly be, the user does not need directly to control the information of gravity sensor, and only need be primarily focused on the attitude of equipment, in the sensor data of generation, the data relationship of attitude inductor and gravity sensor meets physical significance, can not send out into the situation of conflict.The user can revise attitude data according to their expectation, and simulator produces after the corresponding sensed data, correctly returns to upper strata App.
Be understandable that the program source code that provides in above embodiment does not constitute the restriction to the application's scheme, for example, those skilled in the art can improve scheme under the prerequisite that does not break away from the application's principle according to the actual requirements.For example define different function names and form, take different data structures, etc., these do not influence the realization of the application's scheme.
The above only is the specific embodiment of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (11)

1. a simulator gravity sensing data capture method is characterized in that, comprising:
Obtain the current simulation attitude information of analog machine, described attitude information comprises: analog machine under self coordinate system with respect to three anglec of rotation α, β, the γ of standard attitude;
Calculate the current attitude of analog machine with respect to the transformation matrix of coordinates of standard attitude according to α, β, γ;
Multiply by the gravity vector of analog machine under the standard attitude with described transformation matrix of coordinates, obtain the gravity sensing data of analog machine under current attitude;
The gravity sensing data are sent to the analog machine operating system module of simulator.
2. method according to claim 1 is characterized in that, described standard attitude is:
The equipment horizontal positioned that faces up, and the equipment upper side is towards Zheng Bei.
3. method according to claim 1 is characterized in that, described analog machine self coordinate is:
X-axis is pointed to positive from equipment downside sensing upper side, Z axle from the back side of equipment from equipment left surface sensing right flank, Y-axis.
4. method according to claim 1 is characterized in that, described α, β, γ are respectively:
The angle that equipment counterclockwise rotates around X, Y, Z axle.
5. method according to claim 1 is characterized in that, describedly calculates the current attitude of analog machine with respect to the transformation matrix of coordinates of standard attitude according to α, β, γ, comprising:
Calculate the transformation matrix of coordinates R that becomes first transient state from the standard attitude according to γ Z, wherein, equipment becomes first transient state after the standard attitude centers on Z axle anglec of rotation γ;
Calculate the transformation matrix of coordinates R that becomes second transient state from first transient state according to α X, wherein, equipment becomes second transient state after first transient state centers on X-axis anglec of rotation α;
Calculate the transformation matrix of coordinates R that becomes current attitude from second transient state according to β Y, wherein, equipment becomes current attitude after second transient state centers on Y-axis anglec of rotation β;
Then the current attitude of analog machine is with respect to the transformation matrix of coordinates R=R of standard attitude YR XR Z
6. a simulator gravity sensing data acquisition facility is characterized in that, comprising:
The attitude information acquiring unit is used for obtaining the current simulation attitude information of analog machine, and described attitude information comprises: analog machine under self coordinate system with respect to three anglec of rotation α, β, the γ of standard attitude;
The transformation matrix computing unit is used for calculating the current attitude of analog machine with respect to the transformation matrix of coordinates of standard attitude according to α, β, γ;
The sensed data computing unit is used for multiply by the gravity vector of analog machine under the standard attitude with described transformation matrix of coordinates, obtains the gravity sensing data of analog machine under current attitude;
The sensed data transmitting element is for the analog machine operating system module that the gravity sensing data is sent to simulator.
7. device according to claim 6 is characterized in that, described standard attitude is:
The equipment horizontal positioned that faces up, and the equipment upper side is towards Zheng Bei.
8. device according to claim 6 is characterized in that, described analog machine self coordinate is:
X-axis is pointed to positive from equipment downside sensing upper side, Z axle from the back side of equipment from equipment left surface sensing right flank, Y-axis.
9. device according to claim 6 is characterized in that, described α, β, γ are respectively:
The angle that equipment counterclockwise rotates around X, Y, Z axle.
10. device according to claim 6 is characterized in that, described transformation matrix computing unit comprises:
First computation subunit is used for calculating the transformation matrix of coordinates R that becomes first transient state from the standard attitude according to γ Z, wherein, equipment becomes first transient state after the standard attitude centers on Z axle anglec of rotation γ;
Second computation subunit is used for calculating the transformation matrix of coordinates R that becomes second transient state from first transient state according to α X, wherein, equipment becomes second transient state after first transient state centers on X-axis anglec of rotation α;
The 3rd computation subunit is used for calculating the transformation matrix of coordinates R that becomes current attitude from second transient state according to β Y, wherein, equipment becomes current attitude after second transient state centers on Y-axis anglec of rotation β;
The 4th computation subunit is used for calculating the current attitude of analog machine with respect to the transformation matrix of coordinates R=R of standard attitude YR XR Z
11. a simulation system is characterized in that, comprises each described simulator gravity sensing data acquisition facility and analog machine operating system module as claim 6-10;
Described analog machine operating system module is used for calling the gravity sensing data that described simulator gravity sensing data acquisition facility sends, with the gravity sensing data distributing to the application program that runs in the operating system.
CN2011104566378A 2011-12-30 2011-12-30 Simulator gravity sensing data acquisition method and device Pending CN103186687A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011104566378A CN103186687A (en) 2011-12-30 2011-12-30 Simulator gravity sensing data acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011104566378A CN103186687A (en) 2011-12-30 2011-12-30 Simulator gravity sensing data acquisition method and device

Publications (1)

Publication Number Publication Date
CN103186687A true CN103186687A (en) 2013-07-03

Family

ID=48677854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011104566378A Pending CN103186687A (en) 2011-12-30 2011-12-30 Simulator gravity sensing data acquisition method and device

Country Status (1)

Country Link
CN (1) CN103186687A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109147060A (en) * 2018-09-25 2019-01-04 北京金山安全软件有限公司 3D gravity theme display method and device and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007061746A2 (en) * 2005-11-18 2007-05-31 Cardiac Pacemakers, Inc. Posture detector calibration and use
WO2011100422A1 (en) * 2010-02-15 2011-08-18 Cardiac Pacemakers, Inc. Methods for constructing posture calibration matrices

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007061746A2 (en) * 2005-11-18 2007-05-31 Cardiac Pacemakers, Inc. Posture detector calibration and use
WO2011100422A1 (en) * 2010-02-15 2011-08-18 Cardiac Pacemakers, Inc. Methods for constructing posture calibration matrices

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘吉富等: "重力传感器水平度测量仪原理分析", 《微计算机信息》 *
李宁: "《Android/OPhone开发完全讲义》", 30 June 2010, 中国水利水电出版社 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109147060A (en) * 2018-09-25 2019-01-04 北京金山安全软件有限公司 3D gravity theme display method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN106227935B (en) A kind of system and implementation method of satellite gravity anomaly integrative simulation
CN102197377B (en) Multi-touch object inertia simulation
CN101520702A (en) Simulation of multi-point gestures with a single pointing device
CN107038112A (en) The adjustment method and device of application interface
CN102968377A (en) Virtual machine technique based airborne software system testing general platform
CN100553214C (en) Mobile virtual environment system
CN104007844A (en) Electronic instrument and wearable type input device for same
CN102662505A (en) Simulation touch input apparatus, and apparatus and method for configurating simulation touch input
CN109697002A (en) A kind of method, relevant device and the system of the object editing in virtual reality
CN102209146A (en) System and method for simulating joystick of panel computer on smart mobile phone
JP2012146278A (en) Simulation method and system for three-dimensional operation interface
CN107818709A (en) Interactive and game clearance theory exploitation automotive practical-training equipment method is touched based on point
CN113091769A (en) Attitude calibration method and device, storage medium and electronic equipment
CN103186257B (en) A kind of simulator rotating vector sensed data acquisition methods and device
CN103185573B (en) A kind of simulator three-axis gyroscope sensed data acquisition methods and device
CN105847110A (en) Position information displaying method and mobile terminal
CN102929683B (en) The Full-automatic simulation system of input equipment
CN103186687A (en) Simulator gravity sensing data acquisition method and device
CN102541532B (en) Be applicable to the SDK (Software Development Kit) system of Vehicular system simulator
CN110457227B (en) System and method for assisting developers or students in VR application development
Jin et al. Interactive Mobile Augmented Reality system using a vibro-tactile pad
CN104834410B (en) Input unit and input method
CN103186688A (en) Simulator magnetic sensing data acquisition method and device
CN103064619A (en) Method and system for performing slingshot unlocking on touch screen mobile device
KR20230159545A (en) Virtual tool display method, device, terminal and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20130703