Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the element(s) defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other like elements in different embodiments of the application having the same meaning as may be defined by the same meaning as they are explained in this particular embodiment or by further reference to the context of this particular embodiment.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the figures may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily occurring in sequence, but may be performed alternately or alternately with other steps or at least a portion of the other steps or stages.
It should be noted that, in this document, step numbers such as 101 and 102 are used for the purpose of more clearly and briefly describing the corresponding contents, and not to constitute a substantial limitation on the sequence, and those skilled in the art may execute 102 first and then execute 101 when they are implemented, which is within the scope of the present application.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the invention. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
The embodiment of the invention provides a posture estimation method, and an execution subject of the posture estimation method can be a posture estimation device provided by the embodiment of the invention or an intelligent terminal and a server integrated with the posture estimation device, wherein the posture estimation device can be realized in a hardware or software mode.
Specifically, referring to fig. 1, fig. 1 is a schematic flow chart of a gesture estimation method according to an embodiment of the present invention, where the specific flow of the gesture estimation method may be as follows:
101. the current first acceleration value is measured by an accelerometer and resolved in a three-dimensional coordinate system into first components of the first acceleration value in the X-axis, Y-axis and Z-axis.
In an embodiment, the accelerometer may be integrated on an electronic device (such as a smart phone) or on a wearable device (such as a smart bracelet, a smart watch), and when the accelerometer is stationary, the 3 coordinate axis directions x, y, z of the sensor correspond to the right side direction, the front direction, and the vertical direction, respectively. When the accelerometer is in a static state, the acceleration in the axial direction of X, Y, Z is 0.0m/s2,0.0m/m/s2 and 9.8m/m/s2 respectively, and when the accelerometer is in a motion state, the axial direction of X, Y, Z is changed, so that the acceleration value of the accelerometer in each direction can be read, and the acceleration values can be respectively recorded as Rx_acc, ry_acc and rz_acc, namely first components of the first acceleration values in the X axis, the Y axis and the Z axis. In an embodiment, the sampling frequency of the accelerometer may be adjusted according to the current device power, so as to improve the endurance of the device.
In an embodiment, after the first components of the first acceleration values in the X-axis, the Y-axis and the Z-axis are obtained, 2 times of filtering processing may be further performed, including first order low-pass filtering processing and moving average filtering processing, for example. The low-pass filtering process is used for filtering out some interference generated by the acceleration sensor hardware, the moving average filtering process is used for filtering out some pseudo peaks, and an FIR filter can be selected. In this implementation, the FIR filter may be designed using a window function method. The sampling points in the walking stage are intercepted, and after low-pass filtering and secondary filtering, the waveform is smoother than the original waveform, and meanwhile, the pseudo wave crest generated by body jitter is greatly reduced.
102. And measuring the angular change rate of the projection of the current first acceleration value on the XZ plane and the Z-axis included angle and the angular change rate of the projection of the current first acceleration value on the YZ plane and the Z-axis included angle through a gyroscope.
In an embodiment, components of the gyroscope model on the X-axis, the Y-axis and the Z-axis respectively in the three-dimensional coordinate system according to the first acceleration value R, that is, rx, ry and Rz, may be first determined, and then a projection of the first acceleration value on the XZ plane and an included angle of the Z-axis may be defined as Axz, and correspondingly, a projection of the first acceleration value on the YZ plane and an included angle of the Z-axis may be Ayz.
The right triangle formed by Rz and Axz can be deduced that tan (Axz) =rx/Rz, after transformation, axz=atan2 (Rx, rz), and, similarly, ayz=atan2 (Ry, rz), for the angle Axz, since the gyroscope measures the rate of change of the angle of Axz and the rate of change of the angle of Ayz, the new angles Axz (n) and Ayz (n) can be estimated as follows:
Axz(n)= Axz(n-1)+Rate(Axz(n))T
Ayz(n)= Ayz(n-1)+Rate(Ayz(n))T
Wherein n is the current measurement times, T is the measurement interval time, axz (n) is the angle change Rate of the projection of the first acceleration value on the XZ plane and the Z-axis included angle, ayz (n) is the angle change Rate of the projection of the first acceleration value on the YZ plane and the Z-axis included angle, axz (n-1) and Ayz (n-1) are the previous angle change Rate measurement results, and are related to the previous attitude estimation values, and Rate (Axz (n)) and Rate (Ayz (n)) are read from the ADC of the gyroscope.
The above-mentioned Axz (n-1) can be calculated by the component Rx_est (n-1) of the previous attitude estimation value on the X axis and the component rz_est (n-1) on the Z axis, and the calculation formula is that Axz (n-1) =atan2 (Rx_est (n-1), rz_est (n-1)), and accordingly Ayz (n-1) =atan2 (Ry_est (n-1), rz_est (n-1)).
103. And calculating second components of the gyroscope-corrected second acceleration values in the X axis, the Y axis and the Z axis respectively according to the angle change rate.
In an embodiment, the second components of the second acceleration values in the X-axis, the Y-axis and the Z-axis are derived according to the Axz (n) and the Ayz (n), and may be defined as rx_gyro, ry_gyro, and rz_gyro, and first according to the three-dimensional pythagorean theorem R 2=Rx2+ Ry2+ Rz2, so that r_gyro may be written as:
meanwhile, since R_acc is standardized, the length of R_acc is considered to be 1 and the length is kept unchanged after rotation, the following mode can be written as R_gyro=1, and the R_gyro=1 can be obtained after being brought into the formula for conversion:
wherein when rz_gyro > =0, sign (rz_gyro) =1, and when rz_gyro <0, sign (rz_gyro) = -1.
104. And respectively acquiring the confidence degrees of the first acceleration value and the second acceleration value.
In one embodiment, the first acceleration value is the acceleration measured directly by the accelerometer, so that the accelerometer is at rest or near rest and the measured acceleration consists essentially of gravitational acceleration. At the surface of the earth, the magnitude of the gravitational acceleration is about 9.81 m/s2. When the device is stationary, the accelerometer readings in the vertical direction (typically the Z-axis, but depending on the orientation of the device) will approach this value. So the readings of the accelerometer in three axes can be taken, if the device is stationary, the magnitude of the gravitational acceleration can be estimated by calculating a vector modulus, and the confidence level corresponding to the first acceleration can be determined by comparing the calculated g with the theoretical value of 9.81 m/s2.
Further, the gyroscope itself does not directly measure gravitational acceleration, but it can measure the angular velocity of the device, so that the rotation of the device can be inferred, so this embodiment can evaluate the confidence in the accelerometer in measuring gravitational acceleration by analyzing the gyroscope data. Specifically, the angular velocity of the gyroscope in three axes may be read, the gyroscope data may be used to estimate the rotation of the device, for example, by integrating the angular velocity to estimate the angle of rotation, if the device is rotating rapidly, the accelerometer readings may be affected by centrifugal acceleration and thus deviate from true gravitational acceleration, by comparing the rotational velocity indicated by the gyroscope data with the change in accelerometer readings, it may be determined whether the accelerometer readings are affected by non-gravitational acceleration, if the gyroscope data display device is in a relatively stationary or slowly rotating state, and the accelerometer readings are stable, the confidence of gravitational acceleration is high.
105. And calculating the attitude estimation value of the current equipment according to the confidence level, the first component and the second component.
In one embodiment, the pose estimate for the current device may be calculated by the following formula:
Where r_est (n) is the pose estimation value of the current device, w1 is the confidence level of the first acceleration value, w2 is the confidence level of the second acceleration value, r_acc= [ rx_acc, ry_acc, rz_acc ], r_gyro= [ rx_gyro, ry_gyro, rz_gyro ].
In the above, the attitude estimation method provided by the embodiment of the application may measure the current first acceleration value through the accelerometer, decompose the current first acceleration value into the first components of the first acceleration value on the X axis, the Y axis and the Z axis in the three-dimensional coordinate system, measure the angular change rate of the projection of the current first acceleration value on the XZ plane and the Z axis included angle and the angular change rate of the projection of the current first acceleration value on the YZ plane and the Z axis included angle through the gyroscope, calculate the second components of the second acceleration value corrected by the gyroscope on the X axis, the Y axis and the Z axis respectively according to the angular change rate, and obtain the respective confidence coefficients of the first acceleration value and the second acceleration value respectively, and calculate the attitude estimation value of the current device according to the confidence coefficient, the first component and the second component. The proposal provided by the embodiment of the application can estimate the gesture of the equipment according to the first acceleration value measured by the accelerometer and the second acceleration value corrected by the gyroscope, thereby improving the accuracy of gesture estimation.
The method according to the previous embodiments will be described in further detail below.
Referring to fig. 2, fig. 2 is a schematic flow chart of a second method for estimating an attitude according to an embodiment of the invention. The method comprises the following steps:
201. The current first acceleration value is measured by an accelerometer and resolved in a three-dimensional coordinate system into first components of the first acceleration value in the X-axis, Y-axis and Z-axis.
In one embodiment, the first component of the first acceleration value in the X-axis, Y-axis, and Z-axis may be calculated by the following formula:
Wherein, ,,A first component of the first acceleration value in the X-axis, the Y-axis and the Z-axis respectively,,,Analog values output by the accelerometer on the X axis, the Y axis and the Z axis are respectively read by the ADC,In order to acquire a reference voltage value for the system,Is the zero drift value of the acceleration chip,For the sensitivity of the chip, the unit mV/(deg/s), is usually written as mV/deg/s, meaning how much the output of the gyroscope increases if the rotation speed increases by 1 deg/s. The sensitivity value of the Acc_gyro plate in the embodiment of the application is 2mV/deg/s or 0.002V/deg/s.
It should be noted that, r_acc= [ rx_acc, ry_acc, rz_acc ], r_acc is the first acceleration value measured by the accelerometer, while r_acc is the gravity force measured when stationary, and if the obtained vector length is approximately equal to 1 gravity acceleration g, it is correct, that is, it may be expressed as follows:
202. the components of the previous attitude estimation value on the X axis, the components on the Y axis, and the components on the Z axis are acquired.
The embodiment of the application introduces a new vector, namely the data R_est of the accelerometer corrected by the gyroscope data, which is expressed as follows:
accordingly, the previous attitude estimation value R_est (n-1) on the X-axis, the Y-axis, and the Z-axis may be expressed as Rx_est (n-1), ry_est (n-1), and rz_est (n-1).
203. The projection of the first acceleration value on the XZ plane and the angle change rate of the Z axis included angle are calculated through the previous component of the attitude estimation value on the X, Z axis, and the projection of the first acceleration value on the YZ plane and the angle change rate of the Z axis included angle are calculated through the previous component of the attitude estimation value on the Y, Z axis.
Further, after the above Rx_est (n-1) and rz_est (n-1) are obtained, it is possible to calculate:
where Axz (n-1) is the previous angular rate of change measurement, and the gyroscope measures the angular rate of change of Axz, so a new angle Axz (n) can be calculated as follows:
Axz(n)= Axz(n-1)+Rate(Axz(n))T
Wherein n is the current measurement times, T is the measurement interval time, axz (n) is the angle change Rate of the projection of the first acceleration value on the XZ plane and the Z-axis included angle, axz (n-1) is the previous angle change Rate measurement result, and is related to the previous attitude estimation value, and Rate (Axz (n)) can be read from the ADC of the gyroscope.
The same principle can be obtained:
Ayz(n)= Ayz(n-1)+Rate(Ayz(n))T
ayz (n) is the angle change rate of the projection of the first acceleration value on the YZ plane and the Z-axis included angle.
204. And calculating second components of the second acceleration value corrected by the gyroscope on the X axis and the Y axis respectively according to the angle change rate.
205. And calculating second components of the second acceleration values in the Z axis according to the second components of the second acceleration values in the X axis and the Y axis respectively.
In an embodiment, the second components of the second acceleration values in the X-axis, the Y-axis, and the Z-axis may be further calculated, and may be defined as rx_gyro, ry_gyro, and rz_gyro, respectively, first according to the three-dimensional pythagorean theorem R 2=Rx2+ Ry2+ Rz2, so that r_gyro may be written as:
Meanwhile, since r_acc is already standardized, its length can be considered to be 1 and remains unchanged after rotation, it can be written in such a way that i r_gyro i=1, and then x=rx_gyro, y=ry_gyro, and z=rz_gyro can be substituted into the above formula for convenience of calculation:
Dividing the numerator and denominator by each other The following steps are obtained:
Order the The method can obtain:
The partial numerator and denominator in the root number are multiplied by z 2 to obtain:
At the future AndAfter replacement, it can be obtained:
The symbol is replaced by the original symbol:
Is available in the same way
After the Rx_gyro and Ry_gyro are obtained, rz_gyro can be further calculated:
wherein when rz_gyro > =0, sign (rz_gyro) =1, and when rz_gyro <0, sign (rz_gyro) = -1.
206. And respectively acquiring the confidence degrees of the first acceleration value and the second acceleration value.
207. And calculating the attitude estimation value of the current equipment according to the confidence level, the first component and the second component.
Further, after the first component and the second component are obtained, a weighted average value may be used:
Where r_est (n) is the pose estimation value of the current device, w1 is the confidence level of the first acceleration value, w2 is the confidence level of the second acceleration value, r_acc= [ rx_acc, ry_acc, rz_acc ], r_gyro= [ rx_gyro, ry_gyro, rz_gyro ].
In one embodiment, continuing to simplify the formula, dividing the numerator and denominator in the formula of r_est (n) by w1 may result in:
wherein, let w2/w1=w_gyro to obtain:
In this formula, w_gyro represents the degree of belief to the accelerometer and gyroscope. This value can be determined by testing and can be set to 10 according to the present embodiment empirically, the most important difference between this algorithm and the kalman filter is that its weight is relatively fixed, while the weight in the kalman filter varies with the noise read by the accelerometer.
Further, the above formula of r_est (n) is disassembled to obtain:
In the above, the attitude estimation method provided by the embodiment of the application may measure the current first acceleration value through the accelerometer, decompose the current first acceleration value into the first components of the first acceleration value on the X axis, the Y axis and the Z axis in the three-dimensional coordinate system, obtain the components of the previous attitude estimation value on the X axis, the components of the Y axis and the components of the Z axis, calculate the angular change rate of the projection of the first acceleration value on the XZ plane and the Z axis included angle through the components of the previous attitude estimation value on the X, Z axis, calculate the angular change rate of the projection of the first acceleration value on the YZ plane and the Z axis included angle through the components of the previous attitude estimation value on the Y, Z axis, calculate the second components of the gyroscope corrected second acceleration value on the X axis and the Y axis respectively according to the second components of the second acceleration value on the X axis and the Y axis, respectively obtain the respective confidence degrees of the first acceleration value and the second acceleration value, respectively, and calculate the current attitude estimation value according to the confidence degrees and the first component and the second component. The proposal provided by the embodiment of the application can estimate the gesture of the equipment according to the first acceleration value measured by the accelerometer and the second acceleration value corrected by the gyroscope, thereby improving the accuracy of gesture estimation.
In order to implement the above method, the embodiment of the invention also provides a gesture estimation device, which can be integrated in terminal equipment such as mobile phones, tablet computers and other equipment.
For example, as shown in fig. 3, a schematic structural diagram of an attitude estimation device according to an embodiment of the present invention is shown. The posture estimation device may include:
A first measurement unit 301 for measuring a current first acceleration value by an accelerometer and decomposing the current first acceleration value into first components of the first acceleration value in an X-axis, a Y-axis and a Z-axis in a three-dimensional coordinate system;
A second measurement unit 302, configured to measure, by using a gyroscope, an angular rate of change of a projection of the current first acceleration value on the XZ plane and a Z-axis included angle, and an angular rate of change of a projection of the current first acceleration value on the YZ plane and a Z-axis included angle;
A calculation unit 303 for calculating second components of the gyroscope-corrected second acceleration values in the X-axis, the Y-axis, and the Z-axis, respectively, according to the angle change rate;
An obtaining unit 304, configured to obtain confidence degrees of the first acceleration value and the second acceleration value respectively;
an estimation unit 305 for calculating an attitude estimation value of the current device according to the confidence level, the first component and the second component.
According to the gesture estimation device provided by the embodiment of the application, the current first acceleration value can be measured through the accelerometer and is decomposed into first components of the first acceleration value on the X axis, the Y axis and the Z axis in the three-dimensional coordinate system, the angular change rate of the projection of the current first acceleration value on the XZ plane and the included angle of the Z axis and the angular change rate of the projection of the current first acceleration value on the YZ plane and the included angle of the Z axis are measured through the gyroscope, second components of the second acceleration value corrected by the gyroscope on the X axis, the Y axis and the Z axis are calculated according to the angular change rate, the confidence coefficient of each of the first acceleration value and the second acceleration value is obtained respectively, and the gesture estimation value of the current equipment is calculated according to the confidence coefficient, the first components and the second components. The proposal provided by the embodiment of the application can estimate the gesture of the equipment according to the first acceleration value measured by the accelerometer and the second acceleration value corrected by the gyroscope, thereby improving the accuracy of gesture estimation.
Embodiments of the present invention also provide a terminal, as shown in fig. 4, where the terminal may include a Radio Frequency (RF) circuit 601, a memory 602 including one or more computer readable storage media, an input unit 603, a display unit 604, a sensor 605, an audio circuit 606, a wireless fidelity (WiFi, wireless Fidelity) module 607, a processor 608 including one or more processing cores, and a power supply 609. It will be appreciated by those skilled in the art that the terminal structure shown in fig. 4 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
The RF circuit 601 may be used for receiving and transmitting signals during a message or a call, in particular, receiving downlink information from a base station, and then processing the received downlink information by one or more processors 608, and transmitting uplink related data to the base station. Typically, RF circuitry 601 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM, subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 601 may also communicate with networks and other devices through wireless communications. The wireless communication may use any communication standard or protocol including, but not limited to, global system for mobile communications (GSM, global System of Mobile communication), universal packet Radio Service (GPRS, general Packet Radio Service), code division multiple access (CDMA, code Division Multiple Access), wideband code division multiple access (WCDMA, wideband Code Division Multiple Access), long term evolution (LTE, long Term Evolution), email, short message Service (SMS, short MESSAGING SERVICE), and the like.
The memory 602 may be used to store software programs and modules, and the processor 608 may execute various functional applications and information processing by executing the software programs and modules stored in the memory 602. The memory 602 may mainly include a storage program area that may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), etc., and a storage data area that may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide access to the memory 602 by the processor 608 and the input unit 603.
The input unit 603 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in one particular embodiment, the input unit 603 may include a touch-sensitive surface, as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations thereon or thereabout by a user using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection means according to a predetermined program. Alternatively, the touch-sensitive surface may comprise two parts, a touch detection device and a touch controller. The touch controller receives touch information from the touch detection device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 608, and can receive and execute commands sent by the processor 608. In addition, touch sensitive surfaces may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic waves. The input unit 603 may comprise other input devices in addition to a touch sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 604 may be used to display information input by a user or information provided to the user and various graphical user interfaces of the terminal, which may be composed of graphics, text, icons, video and any combination thereof. The display unit 604 may include a display panel, which may optionally be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay a display panel, and upon detection of a touch operation thereon or thereabout, the touch-sensitive surface is passed to the processor 608 to determine the type of touch event, and the processor 608 then provides a corresponding visual output on the display panel based on the type of touch event. Although in fig. 4 the touch sensitive surface and the display panel are implemented as two separate components for input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel to implement the input and output functions.
The terminal may also include at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and/or backlight when the terminal moves to the ear. The gravity acceleration sensor can detect the acceleration in all directions (generally three axes), can detect the gravity and the direction when the mobile phone is stationary, can be used for identifying the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration identification related functions (such as pedometer and knocking), and other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor and the like which are also configured by the terminal are not repeated herein.
Audio circuitry 606, speakers, and a microphone may provide an audio interface between the user and the terminal. The audio circuit 606 may convert the received audio data into an electrical signal, transmit the electrical signal to a speaker, and convert the electrical signal to a sound signal for output by the speaker, and on the other hand, the microphone converts the collected sound signal into an electrical signal, receives the electrical signal from the audio circuit 606, converts the electrical signal into audio data, processes the audio data with the audio data output processor 608, sends the audio data to, for example, another terminal via the RF circuit 601, or outputs the audio data to the memory 602 for further processing. The audio circuit 606 may also include an ear bud jack to provide communication of the peripheral ear bud with the terminal.
The WiFi belongs to a short-distance wireless transmission technology, and the terminal can help the user to send and receive e-mail, browse web pages, access streaming media and the like through the WiFi module 607, so that wireless broadband internet access is provided for the user. Although fig. 4 shows a WiFi module 607, it is understood that it does not belong to the essential constitution of the terminal, and can be omitted entirely as required within the scope of not changing the essence of the invention.
The processor 608 is a control center of the terminal, and connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the terminal and processes data by running or executing software programs and/or modules stored in the memory 602, and calling data stored in the memory 602, thereby performing overall monitoring of the mobile phone. Optionally, the processor 608 may include one or more processing cores, and preferably the processor 608 may integrate an application processor and a modem processor, wherein the application processor primarily processes operating systems, user interfaces, application programs, etc., and the modem processor primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 608.
The terminal also includes a power supply 609 (e.g., a battery) for powering the various components, which may be logically connected to the processor 608 via a power management system so as to provide for managing charging, discharging, and power consumption by the power management system. The power supply 609 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal may further include a camera, a bluetooth module, etc., which will not be described herein. Specifically, in this embodiment, the processor 608 in the terminal loads executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 608 executes the application programs stored in the memory 602, so as to implement various functions:
Measuring a current first acceleration value by an accelerometer and decomposing the current first acceleration value into first components of the first acceleration value in an X axis, a Y axis and a Z axis in a three-dimensional coordinate system;
Measuring the angle change rate of the projection of the current first acceleration value on the XZ plane and the Z-axis included angle and the angle change rate of the projection on the YZ plane and the Z-axis included angle through a gyroscope;
Calculating second components of the second acceleration value corrected by the gyroscope on the X axis, the Y axis and the Z axis respectively according to the angle change rate;
The confidence degrees of the first acceleration value and the second acceleration value are respectively obtained;
and calculating an attitude estimation value of the current equipment according to the confidence level, the first component and the second component.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and for those portions of an embodiment that are not described in detail, reference may be made to the foregoing detailed description of the attitude estimation method, which is not repeated herein.
As can be seen from the above, the terminal according to the embodiment of the present application may measure the current first acceleration value through the accelerometer, decompose the current first acceleration value into first components of the first acceleration value on the X axis, the Y axis and the Z axis in the three-dimensional coordinate system, measure the angular rate of change of the projection of the current first acceleration value on the XZ plane and the Z axis included angle, and the angular rate of change of the projection of the current first acceleration value on the YZ plane and the Z axis included angle through the gyroscope, calculate, according to the angular rate of change, second components of the second acceleration value corrected by the gyroscope on the X axis, the Y axis and the Z axis, respectively obtain respective confidence coefficients of the first acceleration value and the second acceleration value, and calculate, according to the confidence coefficients, the first components and the second components, the pose estimation value of the current device. The proposal provided by the embodiment of the application can estimate the gesture of the equipment according to the first acceleration value measured by the accelerometer and the second acceleration value corrected by the gyroscope, thereby improving the accuracy of gesture estimation.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present invention provide a computer-readable storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any of the pose estimation methods provided by embodiments of the present invention. For example, the instructions may perform the steps of:
Measuring a current first acceleration value by an accelerometer and decomposing the current first acceleration value into first components of the first acceleration value in an X axis, a Y axis and a Z axis in a three-dimensional coordinate system;
Measuring the angle change rate of the projection of the current first acceleration value on the XZ plane and the Z-axis included angle and the angle change rate of the projection on the YZ plane and the Z-axis included angle through a gyroscope;
Calculating second components of the second acceleration value corrected by the gyroscope on the X axis, the Y axis and the Z axis respectively according to the angle change rate;
The confidence degrees of the first acceleration value and the second acceleration value are respectively obtained;
and calculating an attitude estimation value of the current equipment according to the confidence level, the first component and the second component.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
The storage medium may include a Read Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or the like.
The steps in any posture estimation method provided by the embodiment of the present invention can be executed due to the instructions stored in the storage medium, so that the beneficial effects that any posture estimation method provided by the embodiment of the present invention can achieve can be achieved, and detailed descriptions of the previous embodiments are omitted here.
The foregoing describes in detail a method, apparatus, terminal and storage medium for estimating an attitude provided by the embodiments of the present invention, and specific examples are used herein to illustrate the principles and embodiments of the present invention, and the description of the foregoing examples is only for aiding in understanding the method and core concept of the present invention, and meanwhile, to those skilled in the art, according to the concept of the present invention, there are variations in the specific embodiments and application ranges, so the disclosure should not be interpreted as limiting the present invention.