WO2022206127A1 - Attitude calibration method and apparatus, storage medium, and electronic device - Google Patents

Attitude calibration method and apparatus, storage medium, and electronic device Download PDF

Info

Publication number
WO2022206127A1
WO2022206127A1 PCT/CN2022/072342 CN2022072342W WO2022206127A1 WO 2022206127 A1 WO2022206127 A1 WO 2022206127A1 CN 2022072342 W CN2022072342 W CN 2022072342W WO 2022206127 A1 WO2022206127 A1 WO 2022206127A1
Authority
WO
WIPO (PCT)
Prior art keywords
coordinate system
data
attitude
coordinate
gravitational acceleration
Prior art date
Application number
PCT/CN2022/072342
Other languages
French (fr)
Chinese (zh)
Inventor
陈明
曾理
张晓帆
钟卫东
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2022206127A1 publication Critical patent/WO2022206127A1/en

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C25/00Manufacturing, calibrating, cleaning, or repairing instruments or devices referred to in the other groups of this subclass
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/017Gesture based interaction, e.g. based on a set of recognized hand gestures

Definitions

  • the present application relates to the field of computer technology, and in particular, to an attitude calibration method, device, storage medium and electronic device.
  • terminals such as mobile phones and tablet computers are becoming more and more extensive.
  • the user's operation of the terminal often involves the change of the terminal's posture.
  • different movements, directions and changes in the external environment can be sensed based on the terminal's sensors, so as to feed back the current terminal's posture to the application scenarios involving the terminal.
  • terminal-based behavior recognition such as terminal-based gesture interaction and other scenarios.
  • Embodiments of the present application provide an attitude calibration method, apparatus, storage medium, and electronic device.
  • the technical solutions of the embodiments of the present application are as follows:
  • an embodiment of the present application provides an attitude calibration method, the method comprising:
  • the reference attitude data is calibrated according to the coordinate system conversion formula, and the target attitude data in the second coordinate system is determined.
  • an embodiment of the present application provides an attitude calibration device, the device comprising:
  • a data determination module configured to determine the first gravitational acceleration data under the first coordinate system corresponding to the current attitude, and determine the reference attitude data of the current attitude under the first coordinate system;
  • a data conversion module configured to determine a coordinate system conversion formula for converting from the first coordinate system to a second coordinate system based on the first gravitational acceleration data, where the second coordinate system is constructed when the terminal is in a fixed posture carrier coordinate system;
  • a data calibration module configured to perform calibration processing on the reference attitude data according to the coordinate system conversion formula, and determine the target attitude data in the second coordinate system.
  • an embodiment of the present application provides a computer storage medium, where the computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above method steps.
  • an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein, the memory stores a computer program, and the computer program is adapted to be loaded by the processor and execute the above method steps .
  • the terminal determines the first gravitational acceleration data in the first coordinate system corresponding to the current attitude, and determines the reference attitude data in the first coordinate system corresponding to the current attitude, based on the
  • the first gravitational acceleration data determines the coordinate system conversion formula from the first coordinate system to the second coordinate system, and the second coordinate system is usually the carrier coordinate system constructed when the terminal is in a fixed posture; according to the determined
  • the coordinate system conversion formula performs calibration processing on the reference attitude data, and can determine the target attitude data in the second coordinate system.
  • the attitude of the terminal is adaptively corrected, so as to eliminate the influence of the low accuracy of the attitude data caused by the change of the terminal attitude, and reduce the error of the acquired attitude data;
  • the constructed carrier coordinate system combines the change of gravitational acceleration to perform attitude calibration.
  • the calculation amount in the attitude calibration process can be greatly reduced, and the increase of The processing efficiency of attitude calibration can effectively describe the attitude change process of the terminal due to gesture changes such as gesture interaction, and the final attitude data is not limited by the equipment attitude change, device location, geographic location and other environments; and the use of gravity Acceleration is used to convert the coordinate system, the gravitational acceleration is easy to obtain, and the sampling rate of gravitational acceleration is usually high, which is suitable for real-time processing in practical application scenarios; the rotation matrix is calculated by the change of the gravitational acceleration vector, which is simple and fast to calculate.
  • FIG. 1 is a schematic flowchart of an attitude calibration method provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a coordinate system involved in an attitude calibration method provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of a scenario of a terminal attitude change involved in the attitude calibration method provided by the embodiment of the present application;
  • FIG. 4 is a schematic diagram of a scene during a terminal attitude change process of a first coordinate system involved in an attitude calibration method provided by an embodiment of the present application;
  • FIG. 5 is a schematic diagram of a scene of constructing a coordinate system involved in the attitude calibration method provided by the embodiment of the present application;
  • Fig. 6 is a scene schematic diagram of a coordinate system conversion involved in the attitude calibration method provided by the embodiment of the present application.
  • FIG. 7 is a schematic flowchart of an attitude calibration method provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a scene of a coordinate system datum plane involved in an attitude calibration method provided by an embodiment of the present application;
  • FIG. 9 is a schematic flowchart of another attitude calibration method provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an attitude calibration device provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a data conversion module provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of another attitude calibration device provided by an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of an operating system and a user space provided by an embodiment of the present application.
  • Figure 15 is an architecture diagram of the Android operating system in Figure 13;
  • FIG. 16 is an architectural diagram of the IOS operating system in FIG. 13 .
  • a plurality means two or more.
  • “And/or”, which describes the association relationship of the associated objects means that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone.
  • the character “/” generally indicates that the associated objects are an "or" relationship.
  • This specification provides a network state synchronization method, which is applied to a first device, and the method includes:
  • tracking area identifier exists in the tracking area identifier list before disconnection, perform network state synchronization to the network end.
  • the performing network state synchronization to the network includes:
  • the performing network state synchronization to the network based on the synchronization decision information includes:
  • the synchronization judgment information is the off-network duration, and if the off-network duration is greater than the preset duration threshold, network state synchronization is performed to the network; or,
  • the synchronization judgment information is the network interaction information before the first device is disconnected from the network. If the network interaction information matches the reference interaction information, the network state synchronization is performed to the network terminal; the network interaction information includes the network interaction frequency. , at least one of network interaction data volume, and network interaction scenarios.
  • the performing network state synchronization to the network includes:
  • the verification result sent by the network terminal is received, and it is determined based on the verification result that the network state synchronization is successful.
  • the sending a network synchronization request to the network includes:
  • the acquiring a data transmission state and generating a network synchronization request based on the data transmission state includes:
  • the data transmission state is the calling service state, generating a service service request
  • the data transmission state is the called service state or the idle service state, a tracking area update request is generated.
  • the sending a network synchronization request to the network so that the network performs network recovery verification on the network synchronization request includes:
  • a network synchronization request carrying a temporary identity identifier is sent to the network terminal, so that the network terminal performs network recovery verification on the network synchronization request based on the temporary identity identifier.
  • the receiving the verification result sent by the network terminal, and determining that the network state synchronization is successful based on the verification result includes:
  • a network identity registration process is initiated to the network end, and after the network identity registration process is successful, it is determined that the network state synchronization is successful.
  • the receiving the verification result sent by the network terminal, and determining that the network state synchronization is successful based on the verification result includes:
  • the verification success information sent by the network terminal is received, and it is determined that the synchronization of the network state is successful.
  • the performing network state synchronization to the network based on the synchronization decision information includes:
  • the monitoring of network request instructions for network services includes:
  • a monitoring timer for the network calling service is started, and a network service instruction for the network calling service is monitored based on the monitoring timer.
  • the performing network state synchronization to the network includes:
  • the network state is synchronized to the network terminal based on the first storage state.
  • the judging the storage state of the first temporary identity of the first device on the network includes:
  • the second storage state is the storage state of the second temporary identity corresponding to the second device on the network end; the second device and the first The devices are under the same local area network;
  • the second storage state is a storage loss state
  • the first storage state on the network for the first temporary identity of the first device is the storage loss state
  • the second storage state is the storage normal state, it is determined that the storage state of the first temporary identity identifier for the first device on the network end is the storage normal state.
  • the method further includes:
  • the third device and the first device are under the same local area network.
  • the performing network state synchronization to the network terminal based on the first storage state includes:
  • the network identity registration process is initiated to the network terminal, and after the network identity registration process is successful, it is determined that the network state synchronization is successful;
  • the first storage state is a normal storage state
  • a network synchronization request is sent to the network end, so that the network end performs network recovery verification on the first device; it is determined that the network state synchronization is successful.
  • an attitude calibration method is proposed, which can be implemented by means of a computer program and can be run on an attitude calibration device based on the von Neumann system.
  • the computer program can be integrated into an application or run as a stand-alone utility application.
  • the attitude calibration apparatus may be a terminal, including but not limited to: wearable device, handheld device, personal computer, tablet computer, vehicle-mounted device, smart phone, computing device, or other processing device connected to a wireless modem, etc.
  • Terminal equipment can be called by different names in different networks, for example: user equipment, access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile equipment, user terminal, wireless communication equipment, User agent or user equipment, cellular phone, cordless phone, personal digital assistant (PDA), terminal equipment in 5G network or future evolution network, etc.
  • PDA personal digital assistant
  • the attitude calibration method includes:
  • Step S101 Determine first gravitational acceleration data in a first coordinate system corresponding to the current posture, and determine reference posture data in a first coordinate system corresponding to the current posture.
  • the terminal can usually have a variety of built-in sensors, such as gyro sensor, magnetic sensor, acceleration sensor, direction sensor, etc., which can sense the different movements, directions and external environment corresponding to the terminal when the terminal attitude changes.
  • the terminal can obtain more accurate original three-dimensional data based on the included sensors, but these data are all based on the attitude data in the first coordinate system corresponding to the current attitude of the terminal, that is Referring to the attitude data, when the position or direction of the terminal changes, its current attitude is usually different from the attitude at the last data collection moment. At this time, the first coordinate system corresponding to the current attitude is different from the last data collection moment.
  • the reference attitude data at the current moment (relative to the attitude data at the last data collection moment) determined by the terminal based on at least one built-in sensor of the terminal will naturally change accordingly.
  • the above changes are often due to the personalization of the user's usage habits or the user's personalization when performing specific gesture interaction function scenarios, such as the placement of terminals (such as mobile phones, smart watches, smart bracelets) In the hand, or in the trouser pocket or handbag, and the terminal posture change caused by the user making a specific gesture interaction operation using the terminal.
  • terminals such as mobile phones, smart watches, smart bracelets
  • Different users may tend to use different holding methods or holding gesture preferences when using the terminal.
  • the change of the terminal posture will cause the relative relationship between the first coordinate system corresponding to the current posture of the terminal and the physical world reference coordinate system where the current user of the terminal is located to change.
  • the present application can execute the posture calibration method, In the process of using the terminal, the attitude of the terminal is adaptively corrected to eliminate the influence caused by the change of the terminal attitude, and the coordinate system conversion formula during attitude calibration is determined based on the reference quantity of gravitational acceleration, so as to convert the measured value of the terminal The "reference attitude data in the first coordinate system corresponding to the current attitude" is converted into the "second coordinate system".
  • the first coordinate system corresponding to the current posture of the terminal will change.
  • the first coordinate system corresponding to the current posture of the terminal will also change accordingly" during measurement.
  • the first coordinate system in the "first coordinate system corresponding to the current attitude” is strongly related to the current attitude, which may be a carrier coordinate system corresponding to the current attitude of the device.
  • the carrier coordinate system may be. Taking the sensor installation or carrying equipment carrier (terminal) center of mass as the origin, when the terminal is placed horizontally, the direction of the terminal head/forward/forward is the positive direction of the Y-axis, and the direction that is perpendicular to the Y-axis to the right on the horizontal plane is X
  • the positive axis, the upward direction perpendicular to the horizontal plane is the positive Z axis, as shown in FIG. 2 , which is a schematic diagram of a coordinate system involved in the present application.
  • the carrier coordinate system (that is, the first coordinate system) is fixed relative to the terminal itself, that is, when the current posture of the terminal changes, as shown in Figure 3,
  • Figure 3 is a schematic diagram of a scene where the terminal posture changes, and the user can hold the terminal Rotate based on any space rotation angle under the world geographic coordinate system, that is, the terminal attitude changes.
  • FIG. 4 is the first coordinate system involved in the application in the terminal attitude.
  • the change of the three base coordinate axes (X-axis, Y-axis, Z-axis) in the system is used to quantify the attitude change.
  • the base coordinate rotation angle ⁇ is used to characterize the change of the base coordinate X-axis of the first coordinate system.
  • the base coordinate rotation The angle ⁇ is used to characterize the change of the base coordinate Z axis of the first coordinate system, and the base coordinate rotation angle ⁇ is used to characterize the change of the base coordinate Y axis of the first coordinate system.
  • the conversion of the collected reference attitude data in the first coordinate system from the first coordinate system to the unified reference coordinate system has universal applicability, and the converted attitude data has more
  • the clear physical meaning reduces the influence of the terminal's position and attitude on the collected data, and has a wide range of application values in terminal-based situational awareness. It will significantly improve the accuracy of behavior recognition and have a broad application prospect.
  • the reference attitude data refers to the simulation of one or more data such as attitude, angular velocity data, acceleration data, etc., of a movable or rotating object (such as a terminal) based on the sensing device (current sampling time point) sensed by the included sensing device.
  • the reference attitude data is data represented based on the first coordinate system, in this application, it can be understood as the position of the terminal in space and/or its attitude at the position when the user manipulates the terminal.
  • the reference attitude data can be used to characterize or quantify the current attitude of the terminal in the first coordinate system. For example, the angular velocity of the terminal changes (the rotation angle between two adjacent sampling moments), the movement speed changes, the movement direction changes, and so on.
  • the terminal has a variety of sensing devices for real-time detection of current pose information
  • the sensing devices include but are not limited to acceleration sensors, magnetic sensors, gyroscopes, physical quantity sensors, etc., and the terminal can obtain the information through the sensing devices.
  • the reference attitude data can be a gravitational acceleration parameter, a magnetic force parameter, an angular velocity parameter, etc. Wait.
  • a gravitational acceleration sensor is usually provided in the terminal, which may be realized by a software sensor.
  • the terminal can be obtained by filtering the data of the acceleration sensor. That is, the terminal can obtain the acceleration data in the first coordinate system corresponding to the current posture, perform data filtering processing on the acceleration data, and obtain the first gravitational acceleration data.
  • the first gravitational acceleration data can be understood as the sense of the current posture of the device.
  • the gravitational acceleration data produced by the measured gravity.
  • the acceleration sensor data includes the acceleration data of the terminal itself during the movement process and the first gravitational acceleration data generated due to gravity.
  • the former "acceleration data of the terminal's own motion process” is usually called Linear Acceleration
  • the latter "first gravitational acceleration data generated due to gravity” is called Gravity, that is, Have:
  • a low-pass filter can be used to set filtering parameters to filter acceleration data to obtain gravitational acceleration.
  • a high-pass filter can be used to obtain linear acceleration. acceleration, so as to achieve the separation of linear acceleration and gravitational acceleration.
  • this method is relatively simple to implement, and the calculation amount is relatively small, which is suitable for real-time calculation in the attitude calibration process.
  • Step S102 Determine a coordinate system conversion formula from the first coordinate system to a second coordinate system based on the first gravitational acceleration data, where the second coordinate system is a carrier coordinate system constructed when the terminal is in a fixed posture .
  • the second coordinate system is a carrier coordinate system constructed by the terminal when the terminal is in a fixed posture.
  • the second coordinate system is a carrier coordinate system constructed by the terminal in a fixed posture.
  • the carrier coordinate system may be The center of mass of the sensor installation or carrying equipment carrier (terminal) is the origin.
  • the direction pointed to by the terminal head/forward/forward is the positive direction of the Y-axis
  • the direction that is perpendicular to the Y-axis on the horizontal plane is the positive direction of the X-axis.
  • the upward direction perpendicular to the horizontal plane is the positive direction of the Z-axis.
  • the fixed posture may be that the terminal has been adjusted in the factory configuration stage, or that the terminal provides a human-computer interaction interface during the later use of the terminal.
  • the carrier coordinate system constructed under a certain pose that is reset by subsequent changes on the corresponding interactive interface.
  • the coordinate system conversion formula may be a coordinate system conversion matrix or a coordinate system conversion formula.
  • the fixed posture can be that the carrier coordinate system corresponding to the mobile phone when the mobile phone is placed horizontally in the actual application space environment is the second coordinate system, as shown in Figure 5.
  • the pointing direction of the device is the Y axis
  • the gravity direction coincides with the Z axis (the terminal sensor gravity data is a positive value, and the real gravity direction is the negative direction of the Z axis).
  • the user may construct the second carrier coordinate system when the terminal is in a fixed posture during the machine initialization stage when the terminal is used for the first time.
  • the “second coordinate system” usually coincides with the “first coordinate system”.
  • the fixed posture is not limited in this application. It can be the carrier coordinate system corresponding to the horizontal placement of the terminal (such as a mobile phone) in the actual application space environment as the second coordinate system, or it can be the corresponding coordinate system in any state in the three-dimensional space.
  • the current posture of the terminal can be the carrier coordinate system corresponding to the horizontal placement of the terminal (such as a mobile phone) in the actual application space environment as the second coordinate system, or it can be the corresponding coordinate system in any state in the three-dimensional space.
  • the current posture of the terminal can be the carrier coordinate system corresponding to the horizontal placement of the terminal (such as a mobile phone) in the actual application space environment as the second coordinate system, or it can be the corresponding coordinate system in any state in the three-dimensional space.
  • the terminal when it constructs a "second coordinate system" in a fixed attitude, it can measure the gravitational acceleration data when it is in a fixed attitude and under the "second coordinate system", that is, the second coordinate system in this application. Gravitational acceleration data.
  • a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system is determined based on the second gravitational acceleration data of the "gravitational acceleration" index in the second coordinate system.
  • the terminal can acquire the second gravitational acceleration data of the gravitational acceleration in the second coordinate system when it is in a fixed attitude; in practical applications, the second gravitational acceleration data is used to construct the second gravitational acceleration data
  • the coordinate system can be measured accordingly, and quantitative characterization is performed based on the second coordinate system.
  • the terminal may determine the rotation angle of the coordinate system based on the first gravitational acceleration data and the second gravitational acceleration data.
  • the rotation angle of the coordinate system is the relative rotation angle of the first coordinate system with respect to the second coordinate system.
  • the rotation angle of the coordinate system may be represented by the variation of the base coordinate axis, as shown in FIG. 6 .
  • 6 is a schematic diagram of a coordinate system transformation involved in the present application.
  • the second coordinate system may be based on the sensor installation or the center of mass of the carrying device carrier (terminal) of the terminal in a certain fixed attitude.
  • the direction pointed to by the terminal head/forward/forward is the positive direction of the Y-axis
  • the direction that is perpendicular to the Y-axis on the horizontal plane is the positive direction of the X-axis
  • the upward direction perpendicular to the horizontal plane is the positive direction of the Z-axis.
  • the second coordinate system, the first coordinate system can be the current posture of the terminal: with the sensor installation or the center of mass of the device carrier (terminal) as the origin, when the terminal is placed horizontally, the direction pointed to by the terminal head/forward/forward is the positive Y0 axis
  • the direction pointing to the right perpendicular to the Y0 axis on the horizontal plane is the positive direction of the X0 axis
  • the upward direction perpendicular to the horizontal plane is the positive direction of the Z0 axis;
  • the change of the first coordinate system relative to the second coordinate system can be characterized based on the rotation axis of the coordinate system and the rotation angle of the coordinate system, while the attitude calibration method described in this application is actually
  • the "attitude data under the first coordinate system” is restored to the target attitude data under the second coordinate system "taking the second coordinate system as a reference", which is mainly to determine how the "attitude data” is rotated from the first coordinate system to
  • this process can be regarded as, the reference attitude data in the first coordinate system is rotated by the angle corresponding to the "coordinate system rotation angle" based on a "coordinate system rotation axis", and then the second coordinate system can be obtained.
  • Target pose data is regarded as, the reference attitude data in the first coordinate system is rotated by the angle corresponding to the "coordinate system rotation angle" based on a "coordinate system rotation axis", and then the second coordinate system can be obtained.
  • attitude calibration can be seen as, for the three-dimensional attitude vector corresponding to any attitude data under the first coordinate in the three-dimensional space, rotate along the "rotation axis of the coordinate system" (assumed to be u) corresponding to the "rotation angle of the coordinate system".
  • the "rotated three-dimensional attitude vector” after the angle, at this time: “rotated three-dimensional attitude vector” is the target attitude data in the second coordinate system "with the second coordinate system as a reference”.
  • FIG. 6 which is a schematic diagram of an attitude calibration scenario involved in the present application, in FIG.
  • the three-dimensional vector V can be understood as: for any attitude data corresponding to the first coordinate in the three-dimensional space Three-dimensional attitude vector; the attitude calibration process is: the rotated three-dimensional attitude vector V' obtained after the three-dimensional vector V rotates along the "coordinate system rotation axis u" by an angle corresponding to the "coordinate system rotation angle ⁇ ".
  • a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system can be determined based on the change.
  • the terminal acquires the second gravitational acceleration data of the gravitational acceleration in the second coordinate system, and the second gravitational acceleration data is represented by a space vector V1;
  • the first gravitational acceleration in the first coordinate system corresponding to the current posture of the terminal is data, the first gravitational acceleration data is represented by the space vector V2, then the rotation angle ⁇ of the coordinate system can be obtained by the following formula:
  • is the vector modulus of the space vector V1
  • is the vector modulus of the space vector V2
  • arccos represents the arc cosine calculation in the inverse trigonometric function.
  • the rotation axis u of the coordinate system can be obtained by calculating the result of the cross product of the gravitational acceleration V1 and the reference gravitational acceleration V2, that is, the rotation axis u of the coordinate system can be obtained by the following formula:
  • represents the vector cross product calculation.
  • the second gravitational acceleration data and the first gravitational acceleration data are respectively input into the above formula, and the coordinate system rotation angle ⁇ and the coordinate system rotation axis u can be output.
  • an initial conversion formula for converting from the first coordinate system to the second coordinate system is constructed.
  • the initial coordinate system conversion formula can obtain a universal expression for the three-dimensional rotation in the three-dimensional space through mathematical analysis.
  • the initial coordinate For the system conversion formula please refer to the following initial coordinate system conversion formula:
  • V′ Vcos ⁇ +(u ⁇ V)u(1-cos ⁇ )+(u ⁇ V)sin ⁇
  • represents the vector cross product calculation
  • represents the vector dot product calculation
  • Step S103 Perform calibration processing on the reference attitude data according to the coordinate system conversion formula, and determine the target attitude data in the second coordinate system.
  • the reference attitude data is calibrated according to the coordinate system conversion formula: the terminal can calculate the product of the reference attitude data and the coordinate system conversion formula, and then can obtain the reference attitude data in the first The target pose data in the two-coordinate system.
  • the acceleration data collected by the device is acc xyz
  • the target attitude data is:
  • the target attitude data is:
  • the terminal determines the first gravitational acceleration data in the first coordinate system corresponding to the current attitude and determines the reference attitude data in the first coordinate system corresponding to the current attitude, based on the first gravity
  • the acceleration data determines the coordinate system conversion formula from the first coordinate system to the second coordinate system, and the second coordinate system is usually the carrier coordinate system constructed when the terminal is in a fixed posture; according to the determined coordinate system conversion formula
  • the target attitude data in the second coordinate system can be determined.
  • the attitude of the terminal is adaptively corrected, so as to eliminate the influence of the low accuracy of the attitude data caused by the change of the terminal attitude, and reduce the error of the acquired attitude data;
  • the constructed carrier coordinate system combines the change of gravitational acceleration to perform attitude calibration.
  • the calculation amount in the attitude calibration process can be greatly reduced, and the increase of The processing efficiency of attitude calibration can effectively describe the attitude change process of the terminal due to gesture changes such as gesture interaction, and the final attitude data is not limited by the equipment attitude change, device location, geographic location and other environments; and the use of gravity Acceleration is used to convert the coordinate system, the gravitational acceleration is easy to obtain, and the sampling rate of gravitational acceleration is usually high, which is suitable for real-time processing in practical application scenarios; the rotation matrix is calculated by the change of the gravitational acceleration vector, which is simple and fast to calculate.
  • FIG. 7 is a schematic flowchart of another embodiment of an attitude calibration method proposed in the present application. specific:
  • Step S201 Determine first gravitational acceleration data in a first coordinate system corresponding to the current posture, and determine reference posture data of the current posture in the first coordinate system.
  • step S101 For details, refer to step S101, which will not be repeated here.
  • Step S202 mapping the first gravitational acceleration data to the first reference plane under the first coordinate system to obtain a first gravitational component
  • the terminal attitude calibration can be combined with the actual application situation, only considering the attitude change or actual demand of the terminal in the corresponding plane, and the three-dimensional attitude change can be simplified, that is, usually the terminal is in the In the corresponding application scenario, only the change amplitude in the fixed plane under the first coordinate system can be included in the reference, and the change of the attitude in other planes under the first coordinate system other than the fixed plane can be filtered out, That is, the influence of attitude changes in other planes on attitude data is not considered.
  • the process of terminal posture calibration can be pre-combined with each posture calibration scenario to each reference plane (a plane composed of at least two base coordinate lines, such as the xoz plane (consisting of the x-axis base coordinate line and the z-axis base coordinate line). composition), xoy plane (consisting of x-axis base coordinate line and y-axis base coordinate line), zoy plane (consisting of z-axis base coordinate line and y-axis base coordinate line)%)
  • the attitude data is accurate
  • the influence rate of the property is evaluated, and at least one reference plane in the first coordinate system with high reference property in the reference calibration scenario is determined, that is, the first reference plane.
  • the terminal may only consider the influence of the attitude change of the terminal in the first plane on the acquired attitude data corresponding to the current attitude, and ignore or not consider other things except the first reference plane.
  • only the first gravitational acceleration data can be mapped to the first coordinate system.
  • the first reference plane for example, mapping the first gravitational acceleration data measured in the three-dimensional space to the first reference plane under the first coordinate system, such as the xoz plane (consisting of an x-axis base coordinate line and a z-axis base coordinate line).
  • a mapping relationship between at least one posture calibration scene and the reference datum plane may be established in advance, and the terminal may first determine the current target posture calibration scene. Then, based on the mapping relationship, the first reference plane to which the current target posture calibration scene corresponds is determined; in specific implementation, the posture calibration scene may be determined based on the terminal function mode triggered or enabled by the current user. Further, the posture calibration scene may be a spatial gesture input scene, such as the user holding the terminal to perform specific gesture action input (such as writing Chinese characters, drawing, etc.), it can be understood that when the user triggers the spatial gesture input function and the terminal is in the When corresponding spatial gesture input scenarios, the first datum plane can be determined based on the mapping relationship.
  • the first datum plane can be the xoz plane (consisting of the x-axis base coordinate line and the z-axis base coordinate line).
  • the user uses the spatial gesture based on the terminal.
  • a plane gesture such as drawing a circle, etc.
  • the posture calibration scene can be a somatosensory entertainment scene, the benchmark corresponding to the somatosensory entertainment scene
  • the plane can be the xoz plane (consisting of the x-axis base coordinate line and the z-axis base coordinate line) or the zoy plane (consisting of the z-axis base coordinate line and the y-axis base coordinate line), etc.
  • the first gravitational component can be understood as the gravitational component of the first gravitational acceleration data in the first reference plane under the first coordinate system.
  • the first reference plane is the XZ plane
  • plane gestures such as drawing a circle, etc.
  • the main movement of the terminal device can be regarded as all
  • the influence of the attitude changes of the other two-dimensional planes on the accuracy of the attitude data in practical applications, the three-dimensional spatial data corresponding to the spatial gesture can usually be mapped to a two-dimensional plane, only based on the two-dimensional plane data identification) can be ignored.
  • the first reference plane is a reference plane ab formed by any two coordinate axes (indicated by coordinate axis a and coordinate axis b)
  • a , b is any two of x, y, and z.
  • Step S203 constructing an initial conversion formula from the first coordinate system to the second coordinate system, and obtaining the second gravity component of the gravitational acceleration in the second reference plane under the second coordinate system;
  • the transformation of the two-dimensional coordinate system can directly use the rotation matrix to realize the coordinate transformation.
  • the rotation matrix is represented by M, there are:
  • x represents the attitude data in the first coordinate system
  • x ⁇ represents the attitude data in the second coordinate system.
  • M can be expressed as a and b are any two of the base coordinate axis characters x, y, and z of the first coordinate system.
  • the second gravitational component of the gravitational acceleration in the second reference plane under the second coordinate system is obtained. Since the second coordinate system is a carrier coordinate system constructed when the terminal is in a fixed posture, the first reference plane and the first reference plane are The two datum planes are related. When the terminal is in a fixed posture corresponding to the construction of the second coordinate system, such as the above-mentioned fixed posture when the terminal (such as a mobile phone) is placed horizontally in the actual application space environment, the first datum plane is at this time.
  • the second datum plane can be expressed as plane a0b0
  • the second gravitational component of the gravitational acceleration in the second datum plane under the second coordinate system can be expressed as g a0b0 .
  • the second gravity component is now a fixed value.
  • the first reference plane the XZ plane
  • the second reference plane can be represented as the X0Z0 plane.
  • the vector modulus of the second gravitational component g X0Z0 is usually a fixed value, such as the gravitational component value of the gravitational acceleration on the XZ plane
  • the first reference plane the YZ plane
  • the second reference plane can be represented as the Y0Z0 plane.
  • the vector modulus of the second gravitational component g X0Z0 is usually a fixed value, such as the gravitational component value of the gravitational acceleration on the YZ plane
  • Step S204 Calculate the initial conversion formula based on the first gravity component, the second gravity component and the reference coordinate base data relationship corresponding to the first coordinate system to obtain a coordinate system conversion formula.
  • the terminal may be based on the data conversion relationship between the first gravity component and the second gravity component, the vector modulus corresponding to the reference coordinate base being a preset fixed value, and the reference coordinate base corresponding to The vector angle is a preset angle value, the initial conversion formula is calculated, and then the coordinate system conversion formula is obtained, wherein the reference coordinate base is the corresponding base vector in the first coordinate system
  • the data conversion relationship between the first gravitational component and the second gravitational component can be understood as that the first gravitational component undergoes an initial conversion data conversion process, and the second gravitational component after the data conversion process can be obtained.
  • the data conversion relationship between the first gravity component and the second gravity component may be that the product of the first gravity component and the initial conversion formula is equal to the second gravity component.
  • the reference coordinate base data relationship corresponding to the first coordinate system specifically includes the mapping relationship of the vector modulus corresponding to the reference coordinate base and the mapping relationship of the vector angle corresponding to the reference coordinate base.
  • the vector modulus corresponding to the reference coordinate base is a preset fixed value; and the vector angle corresponding to the reference coordinate base is a preset angle value, wherein the reference coordinate base can be understood as the base vector corresponding to the first coordinate system.
  • the coordinate conversion formula may be a coordinate system conversion matrix, and during interpretation, the initial conversion formula may also be an initial rotation matrix.
  • first datum plane and “second datum plane” are datum planes determined by the same datum division basis under different coordinate systems.
  • first datum plane and second datum plane may be It is determined according to the same base vectors (such as base vector x and base vector y) in two different coordinate systems, and further, the same vector names in two different coordinate systems (such as the vector name x of base vector x and base vector y The basis vector of the vector name y) can be considered to belong to the same basis vector;
  • the first reference plane is the x-y coordinate reference plane composed of basis vector x and basis vector y in the first coordinate system
  • the datum plane is the x-y coordinate datum plane composed of the base vector x and the base vector y under the second coordinate system
  • FIG. 8 is a schematic diagram of the coordinate system datum plane involved in the application.
  • the attitude change brings about the accuracy of the attitude data.
  • the main influence can be understood as causing the X-Z coordinate datum in the first coordinate system (that is, the first datum) to rotate relative to the X0-Z0 coordinate datum (that is, the second datum) in the second coordinate system, such as shown in Figure 8.
  • the current attitude has changed compared with the first coordinate system at the last attitude data sampling time.
  • the X-Z coordinate datum plane ie the first datum plane
  • the second coordinate system Changes in the X0-Z0 coordinate datum (that is, the second datum) in the system
  • the first reference plane the XZ plane under the first coordinate system
  • the second reference plane can be represented as the X0Z0 plane under the second reference plane.
  • the second gravity component of the gravitational acceleration in the second reference plane under the second coordinate system can be expressed as: g X0Z0 .
  • the rotation matrix is represented by M, then the initial rotation matrix M can be represented as
  • the product of the first gravity component and the initial rotation matrix is equal to the second gravity component, which can be expressed as reference formula 1.1:
  • the data relationship of the reference coordinate base corresponding to the first coordinate system is: the vector modulus corresponding to the reference coordinate base is a preset fixed value and the vector angle corresponding to the reference coordinate base is a preset angle value.
  • the preset fixed value and the preset angle value are determined based on the actual application environment, that is, the relationship between the coordinate base of the first coordinate system and the vector modulus in the actual application environment is determined.
  • the preset fixed value may be 1
  • the preset angle value can be 90 degrees.
  • the vector modulus corresponding to the reference coordinate base is a preset fixed value of 1
  • the vector angle corresponding to the reference coordinate base is a preset angle value of 90 degrees.
  • Reference formula 1.2 can be obtained:
  • the reference formula 1.3 when the current posture of the terminal is a fixed posture corresponding to the construction of the second coordinate system, that is, the first datum plane (xz datum plane) in the first coordinate system and the When the second datum plane (x0z0 datum plane) coincides, the reference formula 1.3 can be obtained:
  • the initial rotation matrix can be calculated to obtain the final coordinate system conversion matrix, which can also be understood as the coordinate system conversion formula in the foregoing.
  • the coordinate system transformation matrix is:
  • the coordinate system transformation matrix is:
  • Step S205 Perform calibration processing on the reference attitude data according to the coordinate system conversion formula, and determine the target attitude data in the second coordinate system.
  • step S103 For details, refer to step S103, which will not be repeated here.
  • the terminal determines the first gravitational acceleration data in the first coordinate system corresponding to the current attitude and determines the reference attitude data in the first coordinate system corresponding to the current attitude, based on the first gravity
  • the acceleration data determines the coordinate system conversion formula from the first coordinate system to the second coordinate system, and the second coordinate system is usually the carrier coordinate system constructed when the terminal is in a fixed posture; according to the determined coordinate system conversion formula
  • the target attitude data in the second coordinate system can be determined.
  • the attitude of the terminal is adaptively corrected, so as to eliminate the influence of the low accuracy of the attitude data caused by the change of the terminal attitude, and reduce the error of the acquired attitude data;
  • the constructed carrier coordinate system combines the change of gravitational acceleration to perform attitude calibration.
  • the calculation amount in the attitude calibration process can be greatly reduced, and the increase of The processing efficiency of attitude calibration can effectively describe the attitude change process of the terminal due to gesture changes such as gesture interaction, and the final attitude data is not limited by the equipment attitude change, device location, geographic location and other environments; and the use of gravity Acceleration is used to convert the coordinate system, the gravitational acceleration is easy to obtain, and the sampling rate of gravitational acceleration is usually high, which is suitable for real-time processing in practical application scenarios; the rotation matrix is calculated by the change of the gravitational acceleration vector, which is simple and fast to calculate.
  • FIG. 9 is a schematic flowchart of another embodiment of an attitude calibration method proposed in the present application. specific:
  • Step S301 determine the first gravitational acceleration data under the first coordinate system corresponding to the current attitude, and determine the reference attitude data of the current attitude under the first coordinate system;
  • step S101 For details, reference may be made to step S101, which will not be repeated here.
  • Step S302 Determine the reference vector modulus of the first gravitational acceleration data in the preset reference plane corresponding to the first coordinate system.
  • the process of determining the coordinate system conversion formula may not be performed, and it is only necessary to perform the coordinate numerical transformation based on the posture change rule in the special scenario, which can speed up the process. Efficiency of pose calibration in special scenarios.
  • the terminal attitude change when the base coordinate axis of the first coordinate system of the terminal coincides with the base coordinate axis related to the direction of gravitational acceleration under the second coordinate system, any attitude data measured under the first coordinate can be directly measured. You can change the corresponding base coordinate value.
  • the "basic coordinate axis related to the direction of the gravitational acceleration in the second coordinate system” can be understood as the gravitational acceleration and a certain basic coordinate axis are located on the same straight line, schematically, the gravitational acceleration and the basic coordinate axis - The y-axis coincides.
  • the preset reference plane can be understood as a plane composed of at least two base coordinate lines (such as one of the x-axis, y-axis, and z-axis) under the first coordinate system, such as the xoz plane (consisting of the x-axis base coordinate line). and the z-axis base coordinate line), the xoy plane (composed of the x-axis base coordinate line and the y-axis base coordinate line), and the zoy plane (composed of the z-axis base coordinate line and the y-axis base coordinate line).
  • the reference vector modulus is the component of the first gravitational acceleration data on the preset reference plane. Wherein, for the calculation of the vector modulus, reference may be made to the manner of the modulus operation in the related art, which will not be repeated here.
  • Step S303 When the reference vector modulus is inconsistent with the target value, determine the coordinate system conversion formula from the first coordinate system to the second coordinate system based on the first gravitational acceleration data, and the second coordinate system is: The carrier coordinate system constructed when the terminal is in a fixed posture.
  • the determination based on the first gravitational acceleration data can be performed.
  • the target value may be determined based on the actual application environment, for example, the preset target value based on the actual application environment is 0, considering that the error target value in the actual application environment may be a plurality of reference values determined based on the actual application situation, or, A numerical range is set in consideration of the error in the actual application environment, which is not limited here.
  • Step S304 Perform calibration processing on the reference attitude data according to the coordinate system conversion formula, and determine the target attitude data in the second coordinate system.
  • step S103 For details, refer to step S103, which will not be repeated here.
  • Step S305 when the reference vector modulus is consistent with the target value, perform coordinate value exchange processing on the first coordinate value and the second coordinate value corresponding to the reference attitude data, and obtain the coordinate value in the second coordinate system.
  • Target pose data when the reference vector modulus is consistent with the target value, perform coordinate value exchange processing on the first coordinate value and the second coordinate value corresponding to the reference attitude data, and obtain the coordinate value in the second coordinate system.
  • the reference vector modulus is the component of the first gravitational acceleration data on the preset reference plane, and generally the value of the reference vector modulus may be 0.
  • the reference vector modulus can be expressed as
  • G. G is the standard gravity parameter value.
  • the reference plane can be represented as the AoB plane, and A and B are any two characters in the characters corresponding to the a-axis, b-axis, and c-axis.
  • the reference vector norm can be expressed as
  • 0, usually the gravitational acceleration is mapped to the gravitational component of the C axis
  • G.
  • G is the standard gravity parameter value
  • C is a character different from "A, B" in the corresponding characters of the a-axis, b-axis, and c-axis, if A is the character a corresponding to the a-axis, and B is the character b corresponding to the b-axis, then C is The c axis corresponds to the character c.
  • the reference attitude data includes a first coordinate value, a second coordinate value, and a third coordinate value in the first coordinate system
  • the second target value is determined based on the numerical value of the first coordinate value and the first target value is determined based on the second coordinate value, so as to obtain target attitude data in the second coordinate system, where the target attitude data includes the the first target value, the second target value and the third coordinate value.
  • X abc [X in the first coordinate system. a , X b , X c ]; Xa is the first coordinate value, Xb is the second coordinate value, and Xc is the third coordinate value.
  • the terminal attitude calibration may be combined with the actual application situation and only consider the attitude change of the terminal in the corresponding plane or
  • the three-dimensional attitude change can be simplified, that is, in the corresponding application scenario, the terminal only involves the change in the fixed plane in the first coordinate system. Changes of attitudes in other planes under one coordinate system can be filtered out, that is, the influence of attitude changes in other planes on attitude data is not considered. Then the above steps can be further simplified, only considering the plane coordinate change, schematic:
  • the reference vector modulus when the reference vector modulus is the target value and only the change in the preset datum plane needs to be considered, then only the first coordinate value and the second coordinate value corresponding to the reference attitude data need to be considered to perform the coordinate value interactive exchange It can be processed, and the third coordinate value corresponding to the reference attitude data can be ignored.
  • the reference vector modulus when the reference vector modulus is the target value, it can be that the Y axis in the first coordinate system of the device coincides with the gravitational acceleration, that is, Y The axis and Z axis data have flipped. At this time, it is only necessary to exchange the Y axis and Z axis data and consider the positive and negative values of g C to obtain the attitude calibration data.
  • the acceleration and angular velocity sensor data taking the acceleration and angular velocity sensor data as an example, the device The collected acceleration data is acc xz , and the angular velocity data is gyro xz , as follows
  • the terminal determines the first gravitational acceleration data in the first coordinate system corresponding to the current attitude and determines the reference attitude data in the first coordinate system corresponding to the current attitude, based on the first gravity
  • the acceleration data determines the coordinate system conversion formula from the first coordinate system to the second coordinate system, and the second coordinate system is usually the carrier coordinate system constructed when the terminal is in a fixed posture; according to the determined coordinate system conversion formula
  • the target attitude data in the second coordinate system can be determined.
  • the attitude of the terminal is adaptively corrected, so as to eliminate the influence of the low accuracy of the attitude data caused by the change of the terminal attitude, and reduce the error of the acquired attitude data;
  • the constructed carrier coordinate system combines the change of gravitational acceleration to perform attitude calibration.
  • the calculation amount in the attitude calibration process can be greatly reduced, and the increase of The processing efficiency of attitude calibration can effectively describe the attitude change process of the terminal due to gesture changes such as gesture interaction, and the final attitude data is not limited by the equipment attitude change, device location, geographic location and other environments; and the use of gravity Acceleration is used to convert the coordinate system, the gravitational acceleration is easy to obtain, and the sampling rate of gravitational acceleration is usually high, which is suitable for real-time processing in practical application scenarios; the rotation matrix is calculated by the change of the gravitational acceleration vector, which is simple and fast to calculate.
  • FIG. 10 shows a schematic structural diagram of an attitude calibration apparatus provided by an exemplary embodiment of the present application.
  • the attitude calibration device can be implemented as a whole or a part of the device through software, hardware or a combination of the two.
  • the device 1 includes a data determination module 11 , a data conversion module 12 and a data calibration module 13 .
  • the data determination module 11 is used to determine the first gravitational acceleration data under the first coordinate system corresponding to the current attitude, and determine the reference attitude data of the current attitude under the first coordinate system;
  • a data conversion module 12 configured to determine a coordinate system conversion formula for converting from the first coordinate system to a second coordinate system based on the first gravitational acceleration data, where the second coordinate system is constructed when the terminal is in a fixed posture
  • the data calibration module 13 is configured to perform calibration processing on the reference attitude data according to the coordinate system conversion formula, and determine the target attitude data in the second coordinate system.
  • the data conversion module 12 includes:
  • a data acquisition unit 121 configured to acquire the second gravitational acceleration data of the gravitational acceleration in the second coordinate system
  • a rotation data determination unit 122 configured to determine a coordinate system rotation angle and a coordinate system rotation axis based on the first gravitational acceleration data and the second gravitational acceleration data;
  • the transformation matrix determination unit 123 is configured to construct an initial transformation formula for converting from the first coordinate system to the second coordinate system, and calculate the initial transformation formula according to the rotation angle of the coordinate system and the rotation axis of the coordinate system, Get the coordinate system conversion.
  • the data conversion module 12 includes:
  • the data acquisition unit 121 is further configured to map the first gravitational acceleration data to the first reference plane under the first coordinate system to obtain a first gravitational component;
  • the data acquisition unit 121 is further configured to construct an initial conversion formula from the first coordinate system to the second coordinate system, and acquire the second gravity component of the gravitational acceleration in the second reference plane under the second coordinate system ;
  • the conversion matrix determining unit 123 is further configured to be a preset fixed value based on the data conversion relationship between the first gravity component and the second gravity component, the vector modulus corresponding to the reference coordinate base, and the reference coordinate base.
  • the vector included angle is a preset angle value, and the initial conversion formula is calculated to obtain a coordinate system conversion formula, wherein the reference coordinate base is the corresponding base vector in the first coordinate system.
  • the device 1 further includes:
  • a vector modulus calculation module 14 configured to determine the reference vector modulus of the first gravitational acceleration data in the preset reference plane corresponding to the first coordinate system
  • the data conversion module 12 performs the step of determining a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system based on the first gravitational acceleration data .
  • the device 1 further includes:
  • the data conversion module 12 is further configured to perform coordinate value exchange processing on the first coordinate value and the second coordinate value corresponding to the reference attitude data when the reference vector modulus is a target value, to obtain the first coordinate value and the second coordinate value corresponding to the reference attitude data.
  • the target pose data in the two-coordinate system.
  • the data conversion module 12 is also used for the data conversion module 12 .
  • the reference attitude data includes a first coordinate value, a second coordinate value and a third coordinate value in the first coordinate system
  • the second target value is determined based on the numerical value of the first coordinate value and the first target value is determined based on the second coordinate value, so as to obtain target attitude data in the second coordinate system, where the target attitude data includes the the first target value, the second target value and the third coordinate value.
  • the device 1 is also used for:
  • the data conversion module 12 is further configured to acquire acceleration data in the first coordinate system corresponding to the current posture, and perform data filtering processing on the acceleration data to obtain first gravitational acceleration data.
  • the device 1 is also used for:
  • attitude calibration apparatus when the attitude calibration apparatus provided in the above embodiment executes the attitude calibration method, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions may be allocated to different functional modules as required. , that is, dividing the internal structure of the device into different functional modules to complete all or part of the functions described above.
  • attitude calibration device and the attitude calibration method embodiments provided by the above embodiments belong to the same concept, and the embodiment and implementation process thereof are detailed in the method embodiments, which will not be repeated here.
  • the terminal determines the first gravitational acceleration data in the first coordinate system corresponding to the current attitude and determines the reference attitude data in the first coordinate system corresponding to the current attitude, based on the first gravity
  • the acceleration data determines the coordinate system conversion formula from the first coordinate system to the second coordinate system, and the second coordinate system is usually the carrier coordinate system constructed when the terminal is in a fixed attitude; according to the determined coordinate system conversion formula
  • the target attitude data in the second coordinate system can be determined.
  • the attitude of the terminal is adaptively corrected, so as to eliminate the influence of the low accuracy of the attitude data caused by the change of the terminal attitude, and reduce the error of the acquired attitude data;
  • the constructed carrier coordinate system combines the change of gravitational acceleration to perform attitude calibration.
  • the calculation amount in the attitude calibration process can be greatly reduced, and the increase of The processing efficiency of attitude calibration can effectively describe the attitude change process of the terminal due to gesture changes such as gesture interaction, and the final attitude data is not limited by the equipment attitude change, device location, geographic location and other environments; and the use of gravity Acceleration is used to convert the coordinate system, the gravitational acceleration is easy to obtain, and the sampling rate of gravitational acceleration is usually high, which is suitable for real-time processing in practical application scenarios; the rotation matrix is calculated by the change of the gravitational acceleration vector, which is simple and fast to calculate.
  • An embodiment of the present application further provides a computer storage medium, where the computer storage medium can store a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above-described embodiments shown in FIG. 1 to FIG. 9 .
  • the attitude calibration method for the specific execution process, reference may be made to the specific description of the embodiments shown in FIG. 1 to FIG. 9 , which will not be repeated here.
  • the present application also provides a computer program product, the computer program product stores at least one instruction, and the at least one instruction is loaded by the processor and executes the attitude calibration in the embodiment shown in the above-mentioned FIG. 1 to FIG. 9 .
  • the computer program product stores at least one instruction
  • the at least one instruction is loaded by the processor and executes the attitude calibration in the embodiment shown in the above-mentioned FIG. 1 to FIG. 9 .
  • the specific execution process reference may be made to the specific descriptions of the embodiments shown in FIG. 1 to FIG. 9 , which will not be repeated here.
  • FIG. 13 shows a structural block diagram of an electronic device provided by an exemplary embodiment of the present application.
  • An electronic device in this application may include one or more of the following components: a processor 110 , a memory 120 , an input device 130 , an output device 140 and a bus 150 .
  • the processor 110 , the memory 120 , the input device 130 and the output device 140 may be connected through a bus 150 .
  • the processor 110 may include one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts in the entire electronic device, and executes the electronic device by running or executing the instructions, programs, code sets or instruction sets stored in the memory 120, and calling the data stored in the memory 120.
  • Various functions of the device 100 and processing data may adopt at least one of digital signal processing (digital signal processing, DSP), field-programmable gate array (field-programmable gate array, FPGA), and programmable logic array (programmable logic Array, PLA).
  • DSP digital signal processing
  • FPGA field-programmable gate array
  • PLA programmable logic array
  • a hardware form is implemented.
  • the processor 110 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like.
  • the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used for rendering and drawing of the display content; the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may also not be integrated into the processor 110, and is implemented by a communication chip alone.
  • the memory 120 may include random access memory (RAM), or may include read-only memory (ROM).
  • the memory 120 includes a non-transitory computer-readable storage medium.
  • Memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
  • the memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, etc.
  • the operating system can be an Android (Android) system, including a system based on the deep development of the Android system, an IOS system developed by Apple, including a system based on the deep development of the IOS system or other systems.
  • the storage data area can also store data created by the electronic device in use, such as a phone book, audio and video data, chat record data, and the like.
  • the memory 120 can be divided into an operating system space and a user space, the operating system runs in the operating system space, and the native and third-party applications run in the user space.
  • the operating system allocates corresponding system resources to different third-party applications.
  • different application scenarios in the same third-party application also have different requirements for system resources.
  • the third-party application has higher requirements on the disk read speed; in the animation rendering scenario, the first Third-party applications have higher requirements on GPU performance.
  • the operating system and the third-party application are independent of each other, and the operating system often cannot perceive the current application scenario of the third-party application in time, so that the operating system cannot perform targeted system resource adaptation according to the specific application scenario of the third-party application.
  • the memory 120 may store the Linux kernel layer 320, the system runtime library layer 340, the application framework layer 360 and the application layer 380, Among them, the Linux kernel layer 320, the system runtime layer 340 and the application framework layer 360 belong to the operating system space, and the application layer 380 belongs to the user space.
  • the Linux kernel layer 320 provides underlying drivers for various hardwares of electronic devices, such as display drivers, audio drivers, camera drivers, Bluetooth drivers, Wi-Fi drivers, power management and the like.
  • the system runtime layer 340 provides main feature support for the Android system through some C/C++ libraries.
  • the SQLite library provides database support
  • the OpenGL/ES library provides 3D drawing support
  • the Webkit library provides browser kernel support.
  • An Android runtime library (Android runtime) is also provided in the system runtime library layer 340, which mainly provides some core libraries, which can allow developers to use the Java language to write Android applications.
  • the application framework layer 360 provides various APIs that may be used when building applications. Developers can also build their own applications by using these APIs, such as activity management, window management, view management, notification management, content provider, Package management, call management, resource management, location management.
  • the IOS system includes: a core operating system layer 420 (Core OS layer), a core service layer 440 (Core Services layer), a media layer 460 (Media layer), touchable layer 480 (CocoaTouch Layer).
  • the core operating system layer 420 includes the operating system kernel, drivers, and low-level program frameworks, which provide functions closer to hardware for use by the program frameworks located in the core service layer 440 .
  • the core service layer 440 provides system services and/or program frameworks required by application programs, such as a foundation framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a motion framework, and the like.
  • the media layer 460 provides audiovisual interfaces for applications, such as graphics and image related interfaces, audio technology related interfaces, video technology related interfaces, and audio and video transmission technology wireless playback (AirPlay) interfaces.
  • the touchable layer 480 provides various common interface-related frameworks for application development, and the touchable layer 480 is responsible for the user's touch interaction operation on the electronic device. Such as local notification service, remote push service, advertising framework, game tool framework, message user interface interface (User Interface, UI) framework, user interface UIKit framework, map framework and so on.
  • the frameworks related to most applications include but are not limited to: the basic framework in the core service layer 440 and the UIKit framework in the touchable layer 480 .
  • the basic framework provides many basic object classes and data types, and provides the most basic system services for all applications, regardless of UI.
  • the classes provided by the UIKit framework are the basic UI class libraries for creating touch-based user interfaces. iOS applications can provide UI based on the UIKit framework, so it provides the application's infrastructure for building user interfaces, drawing , handling and user interaction events, responding to gestures, and more.
  • the method and principle of implementing data communication between a third-party application and an operating system in the IOS system may refer to the Android system, which will not be repeated in this application.
  • the input device 130 is used for receiving input instructions or data, and the input device 130 includes but is not limited to a keyboard, a mouse, a camera, a microphone or a touch device.
  • the output device 140 is used for outputting instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like.
  • the input device 130 and the output device 140 may be co-located, and the input device 130 and the output device 140 are a touch display screen, the touch display screen is used to receive any suitable objects such as a user's finger, a touch pen, etc. Nearby touch actions, as well as displaying the user interface of each application.
  • the touch display is usually provided on the front panel of the electronic device.
  • the touch screen can be designed as a full screen, a curved screen or a special-shaped screen.
  • the touch display screen can also be designed to be a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of the present application.
  • the structure of the electronic device shown in the above drawings does not constitute a limitation to the electronic device, and the electronic device may include more or less components than those shown in the drawings, or a combination of certain components may be included. some components, or a different arrangement of components.
  • the electronic device also includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, and a Bluetooth module, which will not be repeated here.
  • WiFi wireless fidelity
  • the execution body of each step may be the electronic device described above.
  • the execution subject of each step is an operating system of the electronic device.
  • the operating system may be an Android system, an IOS system, or other operating systems, which are not limited in this embodiment of the present application.
  • the electronic device may also have a display device installed thereon, and the display device may be various devices that can realize a display function, such as a cathode ray tube display (Cathode ray tube display, CR for short), a light emitting diode display (light emitting diode display).
  • a cathode ray tube display Cathode ray tube display, CR for short
  • a light emitting diode display light emitting diode display
  • - emitting diode display referred to as LED
  • electronic ink screen liquid crystal display (liquid crystal display, referred to as LCD), plasma display panel (plasma display panel, referred to as PDP) and so on.
  • LCD liquid crystal display
  • PDP plasma display panel
  • the user can use the display device on the electronic device 101 to view the displayed text, image, video and other information.
  • the electronic device may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality) device, a car, a data storage device, an audio playback device, a video playback device, a notebook, a desktop computing device, a wearable device such as an electronic device. Watches, electronic glasses, electronic helmets, electronic bracelets, electronic necklaces, electronic clothing and other equipment.
  • the processor 110 may be used to invoke the attitude calibration application program stored in the memory 120, and specifically perform the following operations:
  • the reference attitude data is calibrated according to the coordinate system conversion formula, and the target attitude data in the second coordinate system is determined.
  • the processor 110 when the processor 110 executes the determining, based on the first gravitational acceleration data, a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system, the processor 110 specifically performs the following operations:
  • An initial conversion formula for converting from the first coordinate system to the second coordinate system is constructed, and the initial conversion formula is calculated according to the rotation angle of the coordinate system and the rotation axis of the coordinate system to obtain the coordinate system conversion formula.
  • the processor 110 when the processor 110 executes the determining, based on the first gravitational acceleration data, a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system, the processor 110 specifically performs the following operations:
  • the vector modulus corresponding to the reference coordinate base is a preset fixed value
  • the vector angle corresponding to the reference coordinate base is a preset angle value
  • the processor 110 further includes:
  • the step of determining a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system based on the first gravitational acceleration data is performed.
  • the method when the processor 110 executes the attitude calibration method, the method further includes:
  • coordinate value exchange processing is performed on the first coordinate value and the second coordinate value corresponding to the reference attitude data to obtain the target attitude data in the second coordinate system.
  • the processor 110 executes the coordinate value exchange process on the first coordinate value and the second coordinate value corresponding to the reference attitude data to obtain the target in the second coordinate system Attitude data, specifically perform the following operations:
  • the reference attitude data includes a first coordinate value, a second coordinate value and a third coordinate value in the first coordinate system
  • the second target value is determined based on the numerical value of the first coordinate value and the first target value is determined based on the second coordinate value, so as to obtain target attitude data in the second coordinate system, where the target attitude data includes the the first target value, the second target value and the third coordinate value.
  • the processor 110 when the processor 110 performs the determining of the first gravitational acceleration data in the first coordinate system corresponding to the current posture, the processor 110 specifically performs the following operations:
  • Acquire acceleration data in the first coordinate system corresponding to the current posture and perform data filtering processing on the acceleration data to obtain first gravitational acceleration data.
  • the processor 110 when the processor 110 performs the calibration process on the reference attitude data according to the coordinate system conversion formula and determines the target attitude data in the second coordinate system, the processor 110 specifically performs the following steps: step:
  • the terminal determines the first gravitational acceleration data in the first coordinate system corresponding to the current attitude and determines the reference attitude data in the first coordinate system corresponding to the current attitude, based on the first gravity
  • the acceleration data determines the coordinate system conversion formula from the first coordinate system to the second coordinate system, and the second coordinate system is usually the carrier coordinate system constructed when the terminal is in a fixed posture; according to the determined coordinate system conversion formula
  • the target attitude data in the second coordinate system can be determined.
  • the attitude of the terminal is adaptively corrected, so as to eliminate the influence of the low accuracy of the attitude data caused by the change of the terminal attitude, and reduce the error of the acquired attitude data;
  • the constructed carrier coordinate system combines the change of gravitational acceleration to perform attitude calibration.
  • the calculation amount in the attitude calibration process can be greatly reduced, and the increase of The processing efficiency of attitude calibration can effectively describe the attitude change process of the terminal due to gesture changes such as gesture interaction, and the final attitude data is not limited by the equipment attitude change, device location, geographic location and other environments; and the use of gravity Acceleration is used to convert the coordinate system, the gravitational acceleration is easy to obtain, and the sampling rate of gravitational acceleration is usually high, which is suitable for real-time processing in practical application scenarios; the rotation matrix is calculated by the change of the gravitational acceleration vector, which is simple and fast to calculate.
  • the “unit” and “module” in this specification refer to software and/or hardware that can perform a specific function independently or in cooperation with other components, wherein the hardware can be, for example, a Field-Programmable Gate Array (FPGA) , Integrated Circuit (IC), etc.
  • FPGA Field-Programmable Gate Array
  • IC Integrated Circuit
  • the disclosed apparatus may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some service interfaces, indirect coupling or communication connection of devices or units, and may be in electrical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented as a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable memory.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art, or all or part of the technical solution, and the computer software product is stored in a memory.
  • a computer device which may be a personal computer, a server, or a network device, etc.
  • the aforementioned memory includes: U disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Manufacturing & Machinery (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

An attitude calibration method and apparatus, a storage medium, and an electronic device. The method comprises: determining first gravitational acceleration data in a first coordinate system corresponding to the current attitude, and determining reference attitude data of the current attitude in the first coordinate system (S101); determining, on the basis of the first gravitational acceleration data, a coordinate system conversion formula for converting from the first coordinate system to a second coordinate system, the second coordinate system being a carrier coordinate system constructed when a terminal is in a fixed attitude (S102); and calibrating the reference attitude data according to the coordinate system conversion formula, and determining target attitude data in the second coordinate system (S103).

Description

姿态校准方法、装置、存储介质及电子设备Attitude calibration method, device, storage medium and electronic device
本申请要求了2021年03月30日提交的、申请号为2021103441400、发明名称为“姿态校准方法、装置、存储介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on March 30, 2021 with the application number of 2021103441400 and the invention titled "Attitude Calibration Method, Device, Storage Medium and Electronic Equipment", the entire contents of which are incorporated herein by reference Applying.
技术领域technical field
本申请涉及计算机技术领域,尤其涉及一种姿态校准方法、装置、存储介质及电子设备。The present application relates to the field of computer technology, and in particular, to an attitude calibration method, device, storage medium and electronic device.
背景技术Background technique
随着通信技术的发展,诸如手机、平板电脑等终端的应用场景越来越广泛。在日常使用过程中,用户操作终端常会涉及到终端的姿态变化,通常可基于终端的传感器来感知不同的运动、方向以及外部环境的变化,从而将当前终端的姿态反馈到涉及终端的应用场景中,如基于终端的行为识别、基于终端的手势交互等场景。With the development of communication technology, the application scenarios of terminals such as mobile phones and tablet computers are becoming more and more extensive. In the daily use process, the user's operation of the terminal often involves the change of the terminal's posture. Usually, different movements, directions and changes in the external environment can be sensed based on the terminal's sensors, so as to feed back the current terminal's posture to the application scenarios involving the terminal. , such as terminal-based behavior recognition, terminal-based gesture interaction and other scenarios.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种姿态校准方法、装置、存储介质及电子设备。本申请实施例的技术方案如下:Embodiments of the present application provide an attitude calibration method, apparatus, storage medium, and electronic device. The technical solutions of the embodiments of the present application are as follows:
第一方面,本申请实施例提供了一种姿态校准方法,所述方法包括:In a first aspect, an embodiment of the present application provides an attitude calibration method, the method comprising:
确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态对应的第一坐标系下的参考姿态数据;determining the first gravitational acceleration data under the first coordinate system corresponding to the current attitude, and determining the reference attitude data under the first coordinate system corresponding to the current attitude;
基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系为所述终端处于固定姿态时构建的载体坐标系;Determine a coordinate system conversion formula for converting from the first coordinate system to a second coordinate system based on the first gravitational acceleration data, where the second coordinate system is a carrier coordinate system constructed when the terminal is in a fixed attitude;
根据所述坐标系转换式对所述参考姿态数据进行校准处理,确定在所述第二坐标系下的目标姿态数据。The reference attitude data is calibrated according to the coordinate system conversion formula, and the target attitude data in the second coordinate system is determined.
第二方面,本申请实施例提供了一种姿态校准装置,所述装置包括:In a second aspect, an embodiment of the present application provides an attitude calibration device, the device comprising:
数据确定模块,用于确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态在所述第一坐标系下的参考姿态数据;a data determination module, configured to determine the first gravitational acceleration data under the first coordinate system corresponding to the current attitude, and determine the reference attitude data of the current attitude under the first coordinate system;
数据转换模块,用于基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系为所述终端处于固定姿态时构建的载体坐标系;A data conversion module, configured to determine a coordinate system conversion formula for converting from the first coordinate system to a second coordinate system based on the first gravitational acceleration data, where the second coordinate system is constructed when the terminal is in a fixed posture carrier coordinate system;
数据校准模块,用于根据所述坐标系转换式对所述参考姿态数据进行校准处理,确定在所述第二坐标系下的目标姿态数据。A data calibration module, configured to perform calibration processing on the reference attitude data according to the coordinate system conversion formula, and determine the target attitude data in the second coordinate system.
第三方面,本申请实施例提供一种计算机存储介质,所述计算机存储介质存储有多条指令,所述指令适于由处理器加载并执行上述的方法步骤。In a third aspect, an embodiment of the present application provides a computer storage medium, where the computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above method steps.
第四方面,本申请实施例提供一种电子设备,可包括:处理器和存储器;其中,所述存储器存储有计算机程序,所述计算机程序适于由所述处理器加载并执行上述的方法步骤。In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein, the memory stores a computer program, and the computer program is adapted to be loaded by the processor and execute the above method steps .
本申请一些实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solutions provided by some embodiments of the present application include at least:
在本申请一个或多个实施例中,终端通过确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态对应的第一坐标系下的参考姿态数据,基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系通常为所述终端处于固定姿态时构建的载体坐标系;根据确定的坐标系转换式对所述参考姿态数据进行校准处理,可以确定在所述第二坐标系下的目标姿态数据。从而在使用终端的过程中,实现对终端的姿态进行自适应校正,以消除终端姿态变化导致的姿态数据准确性不高的影响,降低获取到的姿态数据的误差;以及基于终端处于固定姿态时构建的载体坐标系结合重力加速度的变化情况来进行姿态校准,相对于相关技术中涉及的大地坐标系、地理坐标系、多载体坐标系等方案可以大幅减小姿态校准过程中的计算量,提高姿态校准的处理效率,可以有效描述由于诸如手势交互等姿态变化场景下终端的姿态变化过程,最终确定的姿态数据不受设备姿态变化、设备所处方位、地理位置等环境的限制;以及利用重力加速度来进行坐标系转换,重力加速度获取简单,通常重力加速度采样率较高,适合实际应用场景下的实时处理;通过重力加速度向量的变化来计算旋转矩阵,实现简单、计算快速。In one or more embodiments of the present application, the terminal determines the first gravitational acceleration data in the first coordinate system corresponding to the current attitude, and determines the reference attitude data in the first coordinate system corresponding to the current attitude, based on the The first gravitational acceleration data determines the coordinate system conversion formula from the first coordinate system to the second coordinate system, and the second coordinate system is usually the carrier coordinate system constructed when the terminal is in a fixed posture; according to the determined The coordinate system conversion formula performs calibration processing on the reference attitude data, and can determine the target attitude data in the second coordinate system. Therefore, in the process of using the terminal, the attitude of the terminal is adaptively corrected, so as to eliminate the influence of the low accuracy of the attitude data caused by the change of the terminal attitude, and reduce the error of the acquired attitude data; The constructed carrier coordinate system combines the change of gravitational acceleration to perform attitude calibration. Compared with the geodetic coordinate system, geographic coordinate system, multi-carrier coordinate system and other schemes involved in related technologies, the calculation amount in the attitude calibration process can be greatly reduced, and the increase of The processing efficiency of attitude calibration can effectively describe the attitude change process of the terminal due to gesture changes such as gesture interaction, and the final attitude data is not limited by the equipment attitude change, device location, geographic location and other environments; and the use of gravity Acceleration is used to convert the coordinate system, the gravitational acceleration is easy to obtain, and the sampling rate of gravitational acceleration is usually high, which is suitable for real-time processing in practical application scenarios; the rotation matrix is calculated by the change of the gravitational acceleration vector, which is simple and fast to calculate.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1是本申请实施例提供的一种姿态校准方法的流程示意图;1 is a schematic flowchart of an attitude calibration method provided by an embodiment of the present application;
图2是本申请实施例提供的姿态校准方法涉及的一种坐标系的示意图;2 is a schematic diagram of a coordinate system involved in an attitude calibration method provided by an embodiment of the present application;
图3是本申请实施例提供的姿态校准方法涉及的一种终端姿态变化的场景示意图;3 is a schematic diagram of a scenario of a terminal attitude change involved in the attitude calibration method provided by the embodiment of the present application;
图4是本申请实施例提供的姿态校准方法涉及的第一坐标系在终端姿态变化过程中的场景示意图;4 is a schematic diagram of a scene during a terminal attitude change process of a first coordinate system involved in an attitude calibration method provided by an embodiment of the present application;
图5是本申请实施例提供的姿态校准方法涉及的一种坐标系构建的场景示意图;5 is a schematic diagram of a scene of constructing a coordinate system involved in the attitude calibration method provided by the embodiment of the present application;
图6是本申请实施例提供的姿态校准方法涉及的一种坐标系转换的场景示意图;Fig. 6 is a scene schematic diagram of a coordinate system conversion involved in the attitude calibration method provided by the embodiment of the present application;
图7是本申请实施例提供的一种姿态校准方法的流程示意图;7 is a schematic flowchart of an attitude calibration method provided by an embodiment of the present application;
图8是本申请实施例提供的姿态校准方法涉及的坐标系基准面的场景示意图;8 is a schematic diagram of a scene of a coordinate system datum plane involved in an attitude calibration method provided by an embodiment of the present application;
图9是本申请实施例提供的另一种姿态校准方法的流程示意图;9 is a schematic flowchart of another attitude calibration method provided by an embodiment of the present application;
图10是本申请实施例提供的一种姿态校准装置的结构示意图;10 is a schematic structural diagram of an attitude calibration device provided by an embodiment of the present application;
图11是本申请实施例提供的一种数据转换模块的结构示意图;11 is a schematic structural diagram of a data conversion module provided by an embodiment of the present application;
图12是本申请实施例提供的另一种姿态校准装置的结构示意图;12 is a schematic structural diagram of another attitude calibration device provided by an embodiment of the present application;
图13是本申请实施例提供的一种电子设备的结构示意图;13 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图14是本申请实施例提供的操作系统和用户空间的结构示意图;14 is a schematic structural diagram of an operating system and a user space provided by an embodiment of the present application;
图15是图13中安卓操作系统的架构图;Figure 15 is an architecture diagram of the Android operating system in Figure 13;
图16是图13中IOS操作系统的架构图。FIG. 16 is an architectural diagram of the IOS operating system in FIG. 13 .
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
在本申请的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。在本申请的描述中,需要说明的是,除非另有明确的规定和限定,“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本申请中的具体含义。此外,在本申请的描述中,除非另有说明,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。In the description of the present application, it should be understood that the terms "first", "second" and the like are used for descriptive purposes only, and should not be construed as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise expressly specified and defined, "including" and "having" and any modifications thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally also includes For other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood in specific situations. Also, in the description of the present application, unless otherwise specified, "a plurality" means two or more. "And/or", which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the associated objects are an "or" relationship.
本说明书提供一种网络状态同步方法,应用于第一设备,所述方法包括:This specification provides a network state synchronization method, which is applied to a first device, and the method includes:
在所述第一设备脱网并恢复网络时,获取所述网络当前的跟踪区标识;When the first device goes offline and restores the network, acquiring the current tracking area identifier of the network;
若所述跟踪区标识存在于脱网前的跟踪区标识列表中,向网络端进行网络状态同步。If the tracking area identifier exists in the tracking area identifier list before disconnection, perform network state synchronization to the network end.
在一种实施方式中,所述向网络端进行网络状态同步,包括:In an implementation manner, the performing network state synchronization to the network includes:
获取同步判决信息,基于所述同步判决信息向网络端进行网络状态同步。Obtain synchronization decision information, and perform network state synchronization to the network based on the synchronization decision information.
在一种实施方式中,所述基于所述同步判决信息向网络端进行网络状态同步,包括:In an implementation manner, the performing network state synchronization to the network based on the synchronization decision information includes:
所述同步判决信息为脱网时长,若所述脱网时长大于预设时长阈值,则向网络端进行网络状态同步;或,The synchronization judgment information is the off-network duration, and if the off-network duration is greater than the preset duration threshold, network state synchronization is performed to the network; or,
所述同步判决信息为所述第一设备脱网前的网络交互信息,若所述网络交互信息与参考交互信息相匹配,则向网络端进行网络状态同步;所述网络交互信息包括网络交互频率、网络交互数据量、网络交互场景中的至少一种。The synchronization judgment information is the network interaction information before the first device is disconnected from the network. If the network interaction information matches the reference interaction information, the network state synchronization is performed to the network terminal; the network interaction information includes the network interaction frequency. , at least one of network interaction data volume, and network interaction scenarios.
在一种实施方式中,所述向网络端进行网络状态同步,包括:In an implementation manner, the performing network state synchronization to the network includes:
向所述网络端发送网络同步请求,以使所述网络端对所述网络同步请求进行网络恢复验证;sending a network synchronization request to the network end, so that the network end performs network recovery verification on the network synchronization request;
接收所述网络端发送的验证结果,基于所述验证结果确定网络状态同步成功。The verification result sent by the network terminal is received, and it is determined based on the verification result that the network state synchronization is successful.
在一种实施方式中,所述向所述网络端发送网络同步请求,包括:In an implementation manner, the sending a network synchronization request to the network includes:
获取数据传输状态,基于所述数据传输状态生成网络同步请求;obtaining a data transmission state, and generating a network synchronization request based on the data transmission state;
向所述网络端发送网络同步请求。Send a network synchronization request to the network end.
在一种实施方式中,所述获取数据传输状态,基于所述数据传输状态生成网络同步请求,包括:In an implementation manner, the acquiring a data transmission state and generating a network synchronization request based on the data transmission state includes:
若所述数据传输状态为主叫业务状态,则生成业务服务请求;If the data transmission state is the calling service state, generating a service service request;
若所述数据传输状态为被叫业务状态或空闲业务状态,则生成跟踪区更新请求。If the data transmission state is the called service state or the idle service state, a tracking area update request is generated.
在一种实施方式中,所述向所述网络端发送网络同步请求,以使所述网络端对所述网络同步请求进行网络恢复验证,包括:In an implementation manner, the sending a network synchronization request to the network so that the network performs network recovery verification on the network synchronization request includes:
向所述网络端发送携带临时身份标识的网络同步请求,以使所述网络端基于所述临时身份标识对所述网络同步请求进行网络恢复验证。A network synchronization request carrying a temporary identity identifier is sent to the network terminal, so that the network terminal performs network recovery verification on the network synchronization request based on the temporary identity identifier.
在一种实施方式中,所述接收所述网络端发送的验证结果,基于所述验证结果确定网络状态同步成功,包括:In an embodiment, the receiving the verification result sent by the network terminal, and determining that the network state synchronization is successful based on the verification result, includes:
接收所述网络端发送的验证失败信息,确定所述网络端的第一临时身份标识丢失;Receive the verification failure information sent by the network, and determine that the first temporary identity of the network is lost;
向所述网络端发起网络身份注册流程,在所述网络身份注册流程成功后,确定网络状态同步成功。A network identity registration process is initiated to the network end, and after the network identity registration process is successful, it is determined that the network state synchronization is successful.
在一种实施方式中,所述接收所述网络端发送的验证结果,基于所述验证结果确定网络状态同步成功,包括:In an embodiment, the receiving the verification result sent by the network terminal, and determining that the network state synchronization is successful based on the verification result, includes:
接收所述网络端发送的验证成功信息,确定网络状态同步成功。The verification success information sent by the network terminal is received, and it is determined that the synchronization of the network state is successful.
在一种实施方式中,所述基于所述同步判决信息向网络端进行网络状态同步,包括:In an implementation manner, the performing network state synchronization to the network based on the synchronization decision information includes:
若所述同步判决信息满足网络同步条件,则进行网络同步等待,并监测针对网络主叫业务的网络业务指令;If the synchronization judgment information satisfies the network synchronization condition, wait for network synchronization, and monitor the network service instruction for the network calling service;
确定监测到所述网络业务指令,向网络端进行网络状态同步。It is determined that the network service instruction is monitored, and the network state is synchronized to the network end.
在一种实施方式中,所述监测针对网络业务的网络请求指令,包括:In an implementation manner, the monitoring of network request instructions for network services includes:
开启针对网络主叫业务的监测定时器,基于所述监测定时器监测针对所述网络主叫业务的网络业务指令。A monitoring timer for the network calling service is started, and a network service instruction for the network calling service is monitored based on the monitoring timer.
在一种实施方式中,所述向网络端进行网络状态同步,包括:In an implementation manner, the performing network state synchronization to the network includes:
判断网络端上针对所述第一设备的第一临时身份标识的第一存储状态;Judging the first storage state of the first temporary identity for the first device on the network;
基于所述第一存储状态向所述网络端进行网络状态同步。The network state is synchronized to the network terminal based on the first storage state.
在一种实施方式中,所述判断网络端上针对所述第一设备的第一临时身份标识的存储状态,包括:In one embodiment, the judging the storage state of the first temporary identity of the first device on the network includes:
获取至少一个第二设备的第二存储状态;所述第二存储状态为所述网络端上所述第二设备对应的第二临时身份标识的存储状态;所述第二设备与所述第一设备处于同一局域网下;Acquire the second storage state of at least one second device; the second storage state is the storage state of the second temporary identity corresponding to the second device on the network end; the second device and the first The devices are under the same local area network;
若所述第二存储状态为存储丢失状态,则网络端上针对所述第一设备的第一临时身份标识的第一存储状态为所述存储丢失状态;If the second storage state is a storage loss state, the first storage state on the network for the first temporary identity of the first device is the storage loss state;
若所述第二存储状态为存储正常状态,则确定所述网络端上针对所述第一设备的第一临时身份标识的存储状态为存储正常状态。If the second storage state is the storage normal state, it is determined that the storage state of the first temporary identity identifier for the first device on the network end is the storage normal state.
在一种实施方式中,所述方法还包括:In one embodiment, the method further includes:
向至少一个第三设备同步所述第一临时身份标识的所述第一存储状态,以使所述第三设备判断所述网络端上针对所述第三设备的第三临时身份标识的第三存储状态,并基于所述第三存储状态向所述网络端进行网络状态同步;Synchronize the first storage state of the first temporary identity with at least one third device, so that the third device judges the third device on the network for the third temporary identity of the third device. storing the state, and synchronizing the network state to the network terminal based on the third storage state;
其中,所述第三设备与所述第一设备处于同一局域网下。Wherein, the third device and the first device are under the same local area network.
在一种实施方式中,所述基于所述第一存储状态向所述网络端进行网络状态同步,包括:In an implementation manner, the performing network state synchronization to the network terminal based on the first storage state includes:
若所述第一存储状态为存储丢失状态,则向所述网络端发起网络身份注册流程,在所述网络身份注 册流程成功后,确定网络状态同步成功;If the first storage state is the storage loss state, then the network identity registration process is initiated to the network terminal, and after the network identity registration process is successful, it is determined that the network state synchronization is successful;
若所述第一存储状态为存储正常状态,则向所述网络端发送网络同步请求,以使所述网络端对所述第一设备进行网络恢复验证;确定网络状态同步成功。If the first storage state is a normal storage state, a network synchronization request is sent to the network end, so that the network end performs network recovery verification on the first device; it is determined that the network state synchronization is successful.
下面结合具体的实施例对本申请进行详细说明。The present application will be described in detail below with reference to specific embodiments.
在一个实施例中,如图1所示,特提出了一种姿态校准方法,该方法可依赖于计算机程序实现,可运行于基于冯诺依曼体系的姿态校准装置上。该计算机程序可集成在应用中,也可作为独立的工具类应用运行。In one embodiment, as shown in FIG. 1 , an attitude calibration method is proposed, which can be implemented by means of a computer program and can be run on an attitude calibration device based on the von Neumann system. The computer program can be integrated into an application or run as a stand-alone utility application.
所述姿态校准装置可以是一种终端,所述终端包括但不限于:可穿戴设备、手持设备、个人电脑、平板电脑、车载设备、智能手机、计算设备或连接到无线调制解调器的其它处理设备等。在不同的网络中终端设备可以叫做不同的名称,例如:用户设备、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、无线通信设备、用户代理或用户装置、蜂窝电话、无绳电话、个人数字处理(personal digital assistant,PDA)、5G网络或未来演进网络中的终端设备等。The attitude calibration apparatus may be a terminal, including but not limited to: wearable device, handheld device, personal computer, tablet computer, vehicle-mounted device, smart phone, computing device, or other processing device connected to a wireless modem, etc. . Terminal equipment can be called by different names in different networks, for example: user equipment, access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile equipment, user terminal, wireless communication equipment, User agent or user equipment, cellular phone, cordless phone, personal digital assistant (PDA), terminal equipment in 5G network or future evolution network, etc.
具体的,该姿态校准方法包括:Specifically, the attitude calibration method includes:
步骤S101:确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态对应的第一坐标系下的参考姿态数据。Step S101: Determine first gravitational acceleration data in a first coordinate system corresponding to the current posture, and determine reference posture data in a first coordinate system corresponding to the current posture.
终端通常可内置的多种传感器,如陀螺传感器、磁力传感器、加速度传感器、方向传感器等可以对终端姿态改变的情况下,终端对应的不同的运动、方向和外部环境进行姿态感知,在实际应用中,可在监测终端的移动和位置变化时,终端基于所包含的传感器能获得较精确的原始三维数据,但这些数据都是基于终端当前姿态所对应的第一坐标系下的姿态数据,也即参考姿态数据,当终端放置的位置或者方向发生改变时,其当前姿态与上一数据采集时刻的姿态通常不一样,此时当前姿态所对应的第一坐标系其相对于上一数据采集时刻而言,第一坐标系产生变化,终端基于其内置的至少一种传感器确定的当前时刻的参考姿态数据(相对于上一数据采集时刻的姿态数据)自然会随之改变。The terminal can usually have a variety of built-in sensors, such as gyro sensor, magnetic sensor, acceleration sensor, direction sensor, etc., which can sense the different movements, directions and external environment corresponding to the terminal when the terminal attitude changes. In practical applications , when monitoring the movement and position changes of the terminal, the terminal can obtain more accurate original three-dimensional data based on the included sensors, but these data are all based on the attitude data in the first coordinate system corresponding to the current attitude of the terminal, that is Referring to the attitude data, when the position or direction of the terminal changes, its current attitude is usually different from the attitude at the last data collection moment. At this time, the first coordinate system corresponding to the current attitude is different from the last data collection moment. In other words, when the first coordinate system changes, the reference attitude data at the current moment (relative to the attitude data at the last data collection moment) determined by the terminal based on at least one built-in sensor of the terminal will naturally change accordingly.
进一步,在实际应用中上述变化常由于用户使用习惯的个性化或执行特定手势交互功能场景时用户的个性化,如终端(如手机、智能手表、智能手环)放置位置不同,是常握在手中,还是放在裤兜或手提包里,以及用户使用终端作出特定手势交互操作所导致的终端姿态变化。不同的用户在使用终端时可能会倾向于使用不同的持握方式或持握姿态喜好。Further, in practical applications, the above changes are often due to the personalization of the user's usage habits or the user's personalization when performing specific gesture interaction function scenarios, such as the placement of terminals (such as mobile phones, smart watches, smart bracelets) In the hand, or in the trouser pocket or handbag, and the terminal posture change caused by the user making a specific gesture interaction operation using the terminal. Different users may tend to use different holding methods or holding gesture preferences when using the terminal.
进一步的,终端姿态的变化,会导致终端当前姿态对应的第一坐标系与终端当前用户所在的物理世界参考坐标系的相对关系发生变化,基于此,本申请可通过执行所述姿态校准方法,在使用终端的过程中,对终端的姿态进行自适应校正,以消除终端姿态变化导致的影响,通过基于重力加速度这一参考量来确定姿态校准时的坐标系转换式,从而将终端测得的“当前姿态对应的第一坐标系下的参考姿态数据”转换至“第二坐标系”下。Further, the change of the terminal posture will cause the relative relationship between the first coordinate system corresponding to the current posture of the terminal and the physical world reference coordinate system where the current user of the terminal is located to change. Based on this, the present application can execute the posture calibration method, In the process of using the terminal, the attitude of the terminal is adaptively corrected to eliminate the influence caused by the change of the terminal attitude, and the coordinate system conversion formula during attitude calibration is determined based on the reference quantity of gravitational acceleration, so as to convert the measured value of the terminal The "reference attitude data in the first coordinate system corresponding to the current attitude" is converted into the "second coordinate system".
其中,在终端使用过程中,若终端的当前姿态相对与上一姿态数据采集时刻发生改变,通过终端当前姿态对应的第一坐标系会产生变化,如终端从水平放置状态由于终端产生了空间旋转此时测量时的“终端当前姿态对应的第一坐标系也会随之改变”。Among them, during the use of the terminal, if the current posture of the terminal changes relative to the time when the last posture data was collected, the first coordinate system corresponding to the current posture of the terminal will change. At this time, "the first coordinate system corresponding to the current posture of the terminal will also change accordingly" during measurement.
可选的,所述“当前姿态对应的第一坐标系”中的第一坐标系与当前姿态强相关其可以是一种设备当前姿态所对应的载体坐标系,实际应用中,载体坐标系可以是以传感器安装或承载设备载体(终端)质心为原点,终端水平放置时,终端头部/正向/前方所指方向为Y轴正向,水平面上垂直于Y轴向右所指方向为X轴正向,垂直于水平面向上的方向为Z轴正向,如图2所示,图2是本申请涉及的一种坐标系的示意图。载体坐标系(也即第一坐标系)相对于终端自身是固定的,即终端当前姿态发生变化时,如图3所示,图3是一种终端姿态变化的场景示意图,用户可握持终端以世界地理坐标系下任一空间旋转角为基准进行旋转,也即终端姿态产生变化,在这个姿态变化过程中,如图4所示,图4是本申请涉及的第一坐标系在终端姿态变化过程中的场景示意图,如图4所示终端上一时刻与当前时刻的(终端当 前姿态下对应的)第一坐标系的相对关系会发生变化,可基于如图4所示的第一坐标系中的三个基坐标轴(X轴、Y轴、Z轴)的变化来进行姿态变化的量化,基坐标旋转角α用来可以表征第一坐标系基坐标X轴的变化,基坐标旋转角β用来可以表征第一坐标系基坐标Z轴的变化,基坐标旋转角γ用来可以表征第一坐标系基坐标Y轴的变化,通过图4可示意在终端姿态变化时,终端上一时刻与当前时刻的(终端当前姿态下对应的)第一坐标系的相对关系情况。因此终端设备姿态的变化会导致传感器在第一坐标系下采集的当前姿态参考数据发生变化,实际应用中鉴于用户使用习惯的多样性和终端的摆放位置的多变性,本申请将基于内置传感器采集的第一坐标系下的参考姿态数据从第一坐标系转换到统一参考坐标系(也即终端处于固定姿态时构建的第二坐标系)具有普遍适用性,转换后的姿态数据有了更清晰的物理含义,减少终端所处方位以及姿态对采集数据的影响,在基于终端的情景感知中有广泛的应用价值。将会对行为识别正确率有显著提高和广泛的应用前景。Optionally, the first coordinate system in the "first coordinate system corresponding to the current attitude" is strongly related to the current attitude, which may be a carrier coordinate system corresponding to the current attitude of the device. In practical applications, the carrier coordinate system may be. Taking the sensor installation or carrying equipment carrier (terminal) center of mass as the origin, when the terminal is placed horizontally, the direction of the terminal head/forward/forward is the positive direction of the Y-axis, and the direction that is perpendicular to the Y-axis to the right on the horizontal plane is X The positive axis, the upward direction perpendicular to the horizontal plane is the positive Z axis, as shown in FIG. 2 , which is a schematic diagram of a coordinate system involved in the present application. The carrier coordinate system (that is, the first coordinate system) is fixed relative to the terminal itself, that is, when the current posture of the terminal changes, as shown in Figure 3, Figure 3 is a schematic diagram of a scene where the terminal posture changes, and the user can hold the terminal Rotate based on any space rotation angle under the world geographic coordinate system, that is, the terminal attitude changes. During this attitude change process, as shown in FIG. 4 , FIG. 4 is the first coordinate system involved in the application in the terminal attitude. A schematic diagram of the scene during the change process. As shown in Figure 4, the relative relationship between the last moment of the terminal and the first coordinate system at the current moment (corresponding to the current posture of the terminal) will change, which can be based on the first coordinate shown in Figure 4. The change of the three base coordinate axes (X-axis, Y-axis, Z-axis) in the system is used to quantify the attitude change. The base coordinate rotation angle α is used to characterize the change of the base coordinate X-axis of the first coordinate system. The base coordinate rotation The angle β is used to characterize the change of the base coordinate Z axis of the first coordinate system, and the base coordinate rotation angle γ is used to characterize the change of the base coordinate Y axis of the first coordinate system. The relative relationship between a moment and the first coordinate system at the current moment (corresponding to the current posture of the terminal). Therefore, the change of the attitude of the terminal device will cause the current attitude reference data collected by the sensor in the first coordinate system to change. The conversion of the collected reference attitude data in the first coordinate system from the first coordinate system to the unified reference coordinate system (that is, the second coordinate system constructed when the terminal is in a fixed attitude) has universal applicability, and the converted attitude data has more The clear physical meaning reduces the influence of the terminal's position and attitude on the collected data, and has a wide range of application values in terminal-based situational awareness. It will significantly improve the accuracy of behavior recognition and have a broad application prospect.
其中,所述参考姿态数据是指可移动或旋转对象(如终端)基于所包含的传感器件感测到(当前采样时间点)的姿态、角速度数据、加速度数据等一种或多种数据的拟合,其中,参考姿态数据为基于第一坐标系表征的数据,在本申请中,可以理解为用户在操控终端时终端在空间中所处的位置和/或其在该位置上的姿态。在本实施例中,通过该参考姿态数据可以用于表征或用于量化终端当前在第一坐标系下的姿态。如终端的角速度变化(相邻两个采样时刻之间的旋转角度)、移动速度变化、移动方向变化等等。The reference attitude data refers to the simulation of one or more data such as attitude, angular velocity data, acceleration data, etc., of a movable or rotating object (such as a terminal) based on the sensing device (current sampling time point) sensed by the included sensing device. Combined, where the reference attitude data is data represented based on the first coordinate system, in this application, it can be understood as the position of the terminal in space and/or its attitude at the position when the user manipulates the terminal. In this embodiment, the reference attitude data can be used to characterize or quantify the current attitude of the terminal in the first coordinate system. For example, the angular velocity of the terminal changes (the rotation angle between two adjacent sampling moments), the movement speed changes, the movement direction changes, and so on.
进一步的,所述终端具有多种实时检测当前位姿信息的传感器件,该传感器件包括但不限于加速度传感器、磁力传感器、陀螺仪、物理量感应器等,所述终端通过所述传感器件可获取到当前姿态对应的第一坐标系下的第一重力加速度数据,以及当前姿态在所述第一坐标系下的参考姿态数据,所述参考姿态数据可以是重力加速度参数、磁力参数、角速度参数等等。Further, the terminal has a variety of sensing devices for real-time detection of current pose information, the sensing devices include but are not limited to acceleration sensors, magnetic sensors, gyroscopes, physical quantity sensors, etc., and the terminal can obtain the information through the sensing devices. To the first gravitational acceleration data under the first coordinate system corresponding to the current attitude, and the reference attitude data of the current attitude under the first coordinate system, the reference attitude data can be a gravitational acceleration parameter, a magnetic force parameter, an angular velocity parameter, etc. Wait.
在一种具体的实施场景中,通常终端中都具备重力加速度传感器,其可以是由软件传感器实现得到。对于不具备重力加速度传感器的终端,其可以通过对加速度传感器的数据进行滤波得到。也即终端可以获取当前姿态对应的第一坐标系下的加速度数据,对所述加速度数据进行数据滤波处理,得到第一重力加速度数据,所述第一重力加速度数据可以理解为设备当前姿态下感测到的重力产生的重力加速度数据。In a specific implementation scenario, a gravitational acceleration sensor is usually provided in the terminal, which may be realized by a software sensor. For a terminal without a gravitational acceleration sensor, it can be obtained by filtering the data of the acceleration sensor. That is, the terminal can obtain the acceleration data in the first coordinate system corresponding to the current posture, perform data filtering processing on the acceleration data, and obtain the first gravitational acceleration data. The first gravitational acceleration data can be understood as the sense of the current posture of the device. The gravitational acceleration data produced by the measured gravity.
进一步的,通常加速度传感器数据(Acceleration)包含了终端本身运动过程的加速度数据以及由于重力产生的第一重力加速度数据。在一些实施例中,前者“终端本身运动过程的加速度数据”通常称之为线性加速度(Linear Acceleration),后者“由于重力产生的第一重力加速度数据”称之为重力加速度(Gravity),即有:Further, usually the acceleration sensor data (Acceleration) includes the acceleration data of the terminal itself during the movement process and the first gravitational acceleration data generated due to gravity. In some embodiments, the former "acceleration data of the terminal's own motion process" is usually called Linear Acceleration, and the latter "first gravitational acceleration data generated due to gravity" is called Gravity, that is, Have:
Acceleration=Linear Accelerarion+GravityAcceleration=Linear Accelerarion+Gravity
由于重力加速度相对于线性加速度可以理解为是一个低频分量,因此本申请中可以通过一个低通滤波器设置滤波参数对加速度数据进行滤波可得到重力加速度,例如通过一个高通滤波器进行滤波可以得到线性加速度,从而实现线性加速度与重力加速度的分离。另外,此种方式实现也相对简单,且计算量相对较小,适合于姿态校准过程中的实时计算。Since gravitational acceleration can be understood as a low-frequency component relative to linear acceleration, in this application, a low-pass filter can be used to set filtering parameters to filter acceleration data to obtain gravitational acceleration. For example, a high-pass filter can be used to obtain linear acceleration. acceleration, so as to achieve the separation of linear acceleration and gravitational acceleration. In addition, this method is relatively simple to implement, and the calculation amount is relatively small, which is suitable for real-time calculation in the attitude calibration process.
步骤S102:基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系为所述终端处于固定姿态时构建的载体坐标系。Step S102: Determine a coordinate system conversion formula from the first coordinate system to a second coordinate system based on the first gravitational acceleration data, where the second coordinate system is a carrier coordinate system constructed when the terminal is in a fixed posture .
其中,所述第二坐标系为终端在处于固定姿态时构建的载体坐标系,在本申请中,第二坐标系为终端在某一固定姿态下构建的载体坐标系,载体坐标系可以是以传感器安装或承载设备载体(终端)质心为原点,终端水平放置时,终端头部/正向/前方所指方向为Y轴正向,水平面上垂直于Y轴向右所指方向为X轴正向,垂直于水平面向上的方向为Z轴正向,所述固定姿态可以是终端在出厂配置阶段已调校好的,也可以是在终端后期使用过程中,终端对外提供人机交互界面用户在相应交互界面上进行后续更改重新设置的某一姿态下构建的载体坐标系。在一些实施例中,所述坐标系转换式可以是一种坐标系转换矩阵,也可以是一个坐标系转换公式。The second coordinate system is a carrier coordinate system constructed by the terminal when the terminal is in a fixed posture. In this application, the second coordinate system is a carrier coordinate system constructed by the terminal in a fixed posture. The carrier coordinate system may be The center of mass of the sensor installation or carrying equipment carrier (terminal) is the origin. When the terminal is placed horizontally, the direction pointed to by the terminal head/forward/forward is the positive direction of the Y-axis, and the direction that is perpendicular to the Y-axis on the horizontal plane is the positive direction of the X-axis. The upward direction perpendicular to the horizontal plane is the positive direction of the Z-axis. The fixed posture may be that the terminal has been adjusted in the factory configuration stage, or that the terminal provides a human-computer interaction interface during the later use of the terminal. The carrier coordinate system constructed under a certain pose that is reset by subsequent changes on the corresponding interactive interface. In some embodiments, the coordinate system conversion formula may be a coordinate system conversion matrix or a coordinate system conversion formula.
在一种具体的实施方式中,以终端为手机为例,固定姿态可以是手机在以实际应用空间环境中手 机水平放置时对应的载体坐标系为第二坐标系,如图5所示。此时,设备指向方向为Y轴,重力指向与Z轴重合(终端传感器重力数据为正值,真实重力指向为Z轴负方向)。In a specific embodiment, taking the terminal as a mobile phone as an example, the fixed posture can be that the carrier coordinate system corresponding to the mobile phone when the mobile phone is placed horizontally in the actual application space environment is the second coordinate system, as shown in Figure 5. At this time, the pointing direction of the device is the Y axis, and the gravity direction coincides with the Z axis (the terminal sensor gravity data is a positive value, and the real gravity direction is the negative direction of the Z axis).
可选的,在本申请中,用户可在终端首次使用时的机器初始化阶段终端处于固定姿态时构建的第二载体坐标系。可以理解的是,在本申请中,可以理解的是,在构建“第二坐标系”对应的初始时刻,“第二坐标系”通常与“第一坐标系”重合。在本申请中不对固定姿态进行限定,可以是上述在以实际应用空间环境中终端(如手机)水平放置是对应的载体坐标系为第二坐标系,也可以是三维空间中任一状态下对应的终端当前姿态。Optionally, in this application, the user may construct the second carrier coordinate system when the terminal is in a fixed posture during the machine initialization stage when the terminal is used for the first time. It can be understood that, in this application, it can be understood that, at the initial moment corresponding to the construction of the “second coordinate system”, the “second coordinate system” usually coincides with the “first coordinate system”. The fixed posture is not limited in this application. It can be the carrier coordinate system corresponding to the horizontal placement of the terminal (such as a mobile phone) in the actual application space environment as the second coordinate system, or it can be the corresponding coordinate system in any state in the three-dimensional space. The current posture of the terminal.
可选的,终端在处于固定姿态情况下构建“第二坐标系”时,可测得在处于固定姿态时且在“第二坐标系”下的重力加速度数据,也即本申请中的第二重力加速度数据。以“重力加速度”指标在所述第二坐标系下的第二重力加速度数据为基准,从而确定从所述第一坐标系转换至第二坐标系的坐标系转换式。Optionally, when the terminal constructs a "second coordinate system" in a fixed attitude, it can measure the gravitational acceleration data when it is in a fixed attitude and under the "second coordinate system", that is, the second coordinate system in this application. Gravitational acceleration data. A coordinate system conversion formula for converting from the first coordinate system to the second coordinate system is determined based on the second gravitational acceleration data of the "gravitational acceleration" index in the second coordinate system.
在一种具体的实施方式中,终端在处于固定姿态情况下可以获取重力加速度在所述第二坐标系下的第二重力加速度数据;在实际应用中,该第二重力加速度数据在构建第二坐标系时可随之测量得到,并以第二坐标系为基准进行量化表征。In a specific implementation, the terminal can acquire the second gravitational acceleration data of the gravitational acceleration in the second coordinate system when it is in a fixed attitude; in practical applications, the second gravitational acceleration data is used to construct the second gravitational acceleration data The coordinate system can be measured accordingly, and quantitative characterization is performed based on the second coordinate system.
具体的,终端可基于第一重力加速度数据以及第二重力加速度数据,来确定坐标系旋转角。Specifically, the terminal may determine the rotation angle of the coordinate system based on the first gravitational acceleration data and the second gravitational acceleration data.
所述坐标系旋转角为第一坐标系相对于第二坐标系的相对旋转角度,在一些实施例中,所述坐标系旋转角可以是以基坐标轴的变化量来表征,如图6所示,图6是本申请涉及的一种坐标系转换的场景示意图,第二坐标系可以是以终端在某一固定姿态下以传感器安装或承载设备载体(终端)质心为原点,终端水平放置时,终端头部/正向/前方所指方向为Y轴正向,水平面上垂直于Y轴向右所指方向为X轴正向,垂直于水平面向上的方向为Z轴正向,从而确定的第二坐标系,第一坐标系可以是终端当前姿态下:以传感器安装或承载设备载体(终端)质心为原点,终端水平放置时,终端头部/正向/前方所指方向为Y0轴正向,水平面上垂直于Y0轴向右所指方向为X0轴正向,垂直于水平面向上的方向为Z0轴正向;The rotation angle of the coordinate system is the relative rotation angle of the first coordinate system with respect to the second coordinate system. In some embodiments, the rotation angle of the coordinate system may be represented by the variation of the base coordinate axis, as shown in FIG. 6 . 6 is a schematic diagram of a coordinate system transformation involved in the present application. The second coordinate system may be based on the sensor installation or the center of mass of the carrying device carrier (terminal) of the terminal in a certain fixed attitude. When the terminal is placed horizontally , the direction pointed to by the terminal head/forward/forward is the positive direction of the Y-axis, the direction that is perpendicular to the Y-axis on the horizontal plane is the positive direction of the X-axis, and the upward direction perpendicular to the horizontal plane is the positive direction of the Z-axis. The second coordinate system, the first coordinate system can be the current posture of the terminal: with the sensor installation or the center of mass of the device carrier (terminal) as the origin, when the terminal is placed horizontally, the direction pointed to by the terminal head/forward/forward is the positive Y0 axis The direction pointing to the right perpendicular to the Y0 axis on the horizontal plane is the positive direction of the X0 axis, and the upward direction perpendicular to the horizontal plane is the positive direction of the Z0 axis;
在一种可行的实施方式中,第一坐标系相对与第二坐标系的变化情况可基于坐标系旋转轴和坐标系旋转角进行表征,而本申请所述姿态校准方法实则为将当前测得的“在第一坐标系下的姿态数据”还原至“以第二坐标系为参考”在第二坐标系下的目标姿态数据,其主要在于确定“姿态数据”如何从第一坐标系旋转至第二坐标系,这个过程可视作,第一坐标系下的参考姿态数据以一个“坐标系旋转轴”为基准旋转“坐标系旋转角”对应的角度,即可得到第二坐标系下的目标姿态数据。简而言之,姿态校准可看做,针对三维空间中第一坐标下的任一姿态数据对应的三维姿态向量沿着“坐标系旋转轴”(假设为u)旋转“坐标系旋转角”对应的角度之后的“旋转后的三维姿态向量”,此时:“旋转后的三维姿态向量”即为“以第二坐标系为参考”在第二坐标系下的目标姿态数据。例如,如图6所示,图6是本申请涉及的一种姿态校准的场景示意图,在图6中,三维向量V可以理解为:针对三维空间中第一坐标下的任一姿态数据对应的三维姿态向量;姿态校准过程即为:三维向量V沿着“坐标系旋转轴u”旋转“坐标系旋转角θ”对应的角度之后得到的旋转后的三维姿态向量V′。In a feasible implementation manner, the change of the first coordinate system relative to the second coordinate system can be characterized based on the rotation axis of the coordinate system and the rotation angle of the coordinate system, while the attitude calibration method described in this application is actually The "attitude data under the first coordinate system" is restored to the target attitude data under the second coordinate system "taking the second coordinate system as a reference", which is mainly to determine how the "attitude data" is rotated from the first coordinate system to The second coordinate system, this process can be regarded as, the reference attitude data in the first coordinate system is rotated by the angle corresponding to the "coordinate system rotation angle" based on a "coordinate system rotation axis", and then the second coordinate system can be obtained. Target pose data. In short, attitude calibration can be seen as, for the three-dimensional attitude vector corresponding to any attitude data under the first coordinate in the three-dimensional space, rotate along the "rotation axis of the coordinate system" (assumed to be u) corresponding to the "rotation angle of the coordinate system". The "rotated three-dimensional attitude vector" after the angle, at this time: "rotated three-dimensional attitude vector" is the target attitude data in the second coordinate system "with the second coordinate system as a reference". For example, as shown in FIG. 6 , which is a schematic diagram of an attitude calibration scenario involved in the present application, in FIG. 6 , the three-dimensional vector V can be understood as: for any attitude data corresponding to the first coordinate in the three-dimensional space Three-dimensional attitude vector; the attitude calibration process is: the rotated three-dimensional attitude vector V' obtained after the three-dimensional vector V rotates along the "coordinate system rotation axis u" by an angle corresponding to the "coordinate system rotation angle θ".
进一步的,本申请基于重力加速度实际上是相对恒定不会变化的,由于终端的姿态变化会导致在第一坐标系和第二坐标系产生的相对变化,才会导致两坐标系中的实际第一重力加速度数据不一样,基于该变化可确定从所述第一坐标系转换至第二坐标系的坐标系转换式。具体实施中,基于前述第一坐标系测得的第一重力加速度数据以及第二坐标系下测得的第二重力加速度数据,确定坐标系旋转角θ以及坐标系旋转轴u;Further, based on the fact that the gravitational acceleration of the present application is relatively constant and will not change, because the attitude change of the terminal will cause relative changes in the first coordinate system and the second coordinate system, it will lead to the actual first coordinate system in the two coordinate systems. When the gravitational acceleration data is different, a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system can be determined based on the change. In a specific implementation, based on the first gravitational acceleration data measured in the first coordinate system and the second gravitational acceleration data measured in the second coordinate system, determine the coordinate system rotation angle θ and the coordinate system rotation axis u;
示意性的,终端获取重力加速度在所述第二坐标系下的第二重力加速度数据,其第二重力加速度数据以空间向量V1表示;终端当前姿态对应的第一坐标系下的第一重力加速度数据,其第一重力加速度数据以空间向量V2表示,则坐标系旋转角θ可由如下公式求得:Schematically, the terminal acquires the second gravitational acceleration data of the gravitational acceleration in the second coordinate system, and the second gravitational acceleration data is represented by a space vector V1; the first gravitational acceleration in the first coordinate system corresponding to the current posture of the terminal is data, the first gravitational acceleration data is represented by the space vector V2, then the rotation angle θ of the coordinate system can be obtained by the following formula:
Figure PCTCN2022072342-appb-000001
Figure PCTCN2022072342-appb-000001
其中,“||V1||”为空间向量V1的向量模,“||V2||”为空间向量V2的向量模,“arccos”表示的是反三角函数中的反余弦计算。Among them, "||V1||" is the vector modulus of the space vector V1, "||V2||" is the vector modulus of the space vector V2, and "arccos" represents the arc cosine calculation in the inverse trigonometric function.
示意性的,坐标系旋转轴u可由重力加速度V1和参考重力加速度V2计算向量叉乘的结果得到,也即坐标系旋转轴u可由如下公式求得:Schematically, the rotation axis u of the coordinate system can be obtained by calculating the result of the cross product of the gravitational acceleration V1 and the reference gravitational acceleration V2, that is, the rotation axis u of the coordinate system can be obtained by the following formula:
u=V1×V2u=V1×V2
其中,“×”表示向量叉乘计算。Among them, "×" represents the vector cross product calculation.
实际应用中,将第二重力加速度数据和第一重力加速度数据分别输入至上述公式中,可输出坐标系旋转角θ以及坐标系旋转轴u。In practical applications, the second gravitational acceleration data and the first gravitational acceleration data are respectively input into the above formula, and the coordinate system rotation angle θ and the coordinate system rotation axis u can be output.
进一步的,构建从所述第一坐标系转换至第二坐标系的初始转换式,初始坐标系转换式可对三维空间中的三维旋转情况经数理分析得到普适性的表达式子,初始坐标系转换式可参考如下初始坐标系转换公式:Further, an initial conversion formula for converting from the first coordinate system to the second coordinate system is constructed. The initial coordinate system conversion formula can obtain a universal expression for the three-dimensional rotation in the three-dimensional space through mathematical analysis. The initial coordinate For the system conversion formula, please refer to the following initial coordinate system conversion formula:
V′=Vcosθ+(u·V)u(1-cosθ)+(u×V)sinθV′=Vcosθ+(u·V)u(1-cosθ)+(u×V)sinθ
其中,“×”表示向量叉乘计算,“·”表示向量点乘计算。Among them, "×" represents the vector cross product calculation, and "·" represents the vector dot product calculation.
然后将上述输出的“坐标系旋转角θ以及坐标系旋转轴u”输入至初始转换式公式中,可得到输出最终的坐标系转换式。Then, the above output "the coordinate system rotation angle θ and the coordinate system rotation axis u" are input into the initial conversion formula, and the final output coordinate system conversion formula can be obtained.
可选的,基于前述第一坐标系测得的第一重力加速度数据以及第二坐标系下测得的第二重力加速度数据,确定坐标系旋转角θ以及坐标系旋转轴u之后,还可采用诸如三维空间的旋转矩阵、欧拉角以及四元数等方法来得到坐标系转换,仅需将坐标系旋转角θ以及坐标系旋转轴u进行相应转换即可,此处不做具体展开,可参考相关技术中的相应释义。Optionally, based on the first gravitational acceleration data measured in the first coordinate system and the second gravitational acceleration data measured in the second coordinate system, after determining the coordinate system rotation angle θ and the coordinate system rotation axis u, you can also use Methods such as the rotation matrix of the three-dimensional space, Euler angles, and quaternions can be used to obtain the coordinate system transformation. It is only necessary to transform the coordinate system rotation angle θ and the coordinate system rotation axis u accordingly. There is no specific expansion here. Refer to the corresponding definitions in the related art.
步骤S103:根据所述坐标系转换式对所述参考姿态数据进行校准处理,确定在所述第二坐标系下的目标姿态数据。Step S103: Perform calibration processing on the reference attitude data according to the coordinate system conversion formula, and determine the target attitude data in the second coordinate system.
具体的,根据所述坐标系转换式对所述参考姿态数据进行校准处理:终端可以计算所述参考姿态数据与所述坐标系转换式的积,然后可以得到所述参考姿态数据在所述第二坐标系下的目标姿态数据。Specifically, the reference attitude data is calibrated according to the coordinate system conversion formula: the terminal can calculate the product of the reference attitude data and the coordinate system conversion formula, and then can obtain the reference attitude data in the first The target pose data in the two-coordinate system.
以参考姿态数据为加速度数据为例,设备采集到的加速度数据为acc xyz,则目标姿态数据为: Taking the reference attitude data as the acceleration data as an example, the acceleration data collected by the device is acc xyz , and the target attitude data is:
acc=f(acc xyz) acc=f(acc xyz )
以参考姿态数据为角速度传感器数据为例,设备采集到的角速度传感器数据gyro xyz,则目标姿态数据为: Taking the reference attitude data as the angular velocity sensor data as an example, the angular velocity sensor data gyro xyz collected by the device, the target attitude data is:
gyro=f(gyro xyz) gyro=f(gyro xyz )
其中,“f”为坐标系转换式。Among them, "f" is the coordinate system conversion formula.
在本申请实施例中,终端通过确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态对应的第一坐标系下的参考姿态数据,基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系通常为所述终端处于固定姿态时构建的载体坐标系;根据确定的坐标系转换式对所述参考姿态数据进行校准处理,可以确定在所述第二坐标系下的目标姿态数据。从而在使用终端的过程中,实现对终端的姿态进行自适应校正,以消除终端姿态变化导致的姿态数据准确性不高的影响,降低获取到的姿态数据的误差;以及基于终端处于固定姿态时构建的载体坐标系结合重力加速度的变化情况来进行姿态校准,相对于相关技术中涉及的大地坐标系、地理坐标系、多载体坐标系等方案可以大幅减小姿态校准过程中的计算量,提高姿态校准的处理效率,可以有效描述由于诸如手势交互等姿态变化场景下终端的姿态变化过程,最终确定的姿态数据不受设备姿态变化、设备所处方位、地理位置等环境的限制;以及利用重力加速度来进行坐标系转换,重力加速度获取简单,通常重力加速度采样率较高,适合实际应用场景下的实时处理;通过重力加速度向量的变化来计算旋转矩 阵,实现简单、计算快速。In this embodiment of the present application, the terminal determines the first gravitational acceleration data in the first coordinate system corresponding to the current attitude and determines the reference attitude data in the first coordinate system corresponding to the current attitude, based on the first gravity The acceleration data determines the coordinate system conversion formula from the first coordinate system to the second coordinate system, and the second coordinate system is usually the carrier coordinate system constructed when the terminal is in a fixed posture; according to the determined coordinate system conversion formula By performing calibration processing on the reference attitude data, the target attitude data in the second coordinate system can be determined. Therefore, in the process of using the terminal, the attitude of the terminal is adaptively corrected, so as to eliminate the influence of the low accuracy of the attitude data caused by the change of the terminal attitude, and reduce the error of the acquired attitude data; The constructed carrier coordinate system combines the change of gravitational acceleration to perform attitude calibration. Compared with the geodetic coordinate system, geographic coordinate system, multi-carrier coordinate system and other schemes involved in related technologies, the calculation amount in the attitude calibration process can be greatly reduced, and the increase of The processing efficiency of attitude calibration can effectively describe the attitude change process of the terminal due to gesture changes such as gesture interaction, and the final attitude data is not limited by the equipment attitude change, device location, geographic location and other environments; and the use of gravity Acceleration is used to convert the coordinate system, the gravitational acceleration is easy to obtain, and the sampling rate of gravitational acceleration is usually high, which is suitable for real-time processing in practical application scenarios; the rotation matrix is calculated by the change of the gravitational acceleration vector, which is simple and fast to calculate.
请参见图7,图7是本申请提出的一种姿态校准方法的另一种实施例的流程示意图。具体的:Please refer to FIG. 7 , which is a schematic flowchart of another embodiment of an attitude calibration method proposed in the present application. specific:
步骤S201:确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态在所述第一坐标系下的参考姿态数据。Step S201: Determine first gravitational acceleration data in a first coordinate system corresponding to the current posture, and determine reference posture data of the current posture in the first coordinate system.
具体可参见步骤S101,此处不再赘述。For details, refer to step S101, which will not be repeated here.
步骤S202:将所述第一重力加速度数据映射至所述第一坐标系下的第一基准面,得到第一重力分量;Step S202: mapping the first gravitational acceleration data to the first reference plane under the first coordinate system to obtain a first gravitational component;
在一些实施例中,终端姿态校准在一些应用场景下,可以结合实际应用情况,仅考虑在相应平面内的终端的姿态变化情况或实际需求,可以对三维姿态变化进行简化,也即通常终端在相应的应用场景下,仅涉及到在第一坐标系下的固定平面内的变化幅度可纳入参考,除该固定平面之外的第一坐标系下的其它平面内姿态的变化可进行滤除,也即不考虑其它平面内姿态的变化对姿态数据的影响。In some embodiments, in some application scenarios, the terminal attitude calibration can be combined with the actual application situation, only considering the attitude change or actual demand of the terminal in the corresponding plane, and the three-dimensional attitude change can be simplified, that is, usually the terminal is in the In the corresponding application scenario, only the change amplitude in the fixed plane under the first coordinate system can be included in the reference, and the change of the attitude in other planes under the first coordinate system other than the fixed plane can be filtered out, That is, the influence of attitude changes in other planes on attitude data is not considered.
在一些实施例中,终端姿态校准的过程可预先结合各姿态校准场景对各个基准面(由至少两条基坐标线构成的平面,如xoz平面(由x轴基坐标线和z轴基坐标线构成)、xoy平面(由x轴基坐标线和y轴基坐标线构成)、zoy平面(由z轴基坐标线和y轴基坐标线构成)...)下终端姿态变化对姿态数据准确性的影响率进行评估,确定至少一个参考校准场景下参考性高的第一坐标系下的基准面,也即第一基准面。可以理解的是,在该参考校准场景下,终端可仅考虑在第一平面内的终端的姿态变化情况对获取的当前姿态对应的姿态数据的影响,而忽视或不考虑其它除第一基准面之外平面内姿态的变化对姿态数据的影响。从而对除该固定平面之外的第一坐标系下的其它平面内姿态的变化可进行滤除,具体实施中,可仅将所述第一重力加速度数据映射至所述第一坐标系下的第一基准面,如将三维空间下测量的第一重力加速度数据映射至第一坐标系下的第一基准面,如xoz平面(由x轴基坐标线和z轴基坐标线构成)。In some embodiments, the process of terminal posture calibration can be pre-combined with each posture calibration scenario to each reference plane (a plane composed of at least two base coordinate lines, such as the xoz plane (consisting of the x-axis base coordinate line and the z-axis base coordinate line). composition), xoy plane (consisting of x-axis base coordinate line and y-axis base coordinate line), zoy plane (consisting of z-axis base coordinate line and y-axis base coordinate line)...) Under the terminal attitude change, the attitude data is accurate The influence rate of the property is evaluated, and at least one reference plane in the first coordinate system with high reference property in the reference calibration scenario is determined, that is, the first reference plane. It can be understood that in this reference calibration scenario, the terminal may only consider the influence of the attitude change of the terminal in the first plane on the acquired attitude data corresponding to the current attitude, and ignore or not consider other things except the first reference plane. The effect of changes in attitude in the outer plane on the attitude data. Therefore, the changes of postures in other planes under the first coordinate system other than the fixed plane can be filtered out. In specific implementation, only the first gravitational acceleration data can be mapped to the first coordinate system. The first reference plane, for example, mapping the first gravitational acceleration data measured in the three-dimensional space to the first reference plane under the first coordinate system, such as the xoz plane (consisting of an x-axis base coordinate line and a z-axis base coordinate line).
可选的,可预先建立至少一个姿态校准场景与参考基准面的映射关系,终端可先确定当前的目标姿态校准场景。然后基于所述映射关系来确定当前的目标姿态校准场景对于的第一基准面;具体实施中,姿态校准场景可基于当前用户触发或开启的终端功能模式来确定。进一步的,所述姿态校准场景可以是空间手势输入场景,如用户握持终端进行特定手势动作输入(如书写汉字、画画等),可以理解的是在用户在触发空间手势输入功能进而终端处于相应空间手势输入场景时,可基于该映射关系确定第一基准面,如第一基准面可以是xoz平面(由x轴基坐标线和z轴基坐标线构成),通常用户基于终端使用空间手势时,主要是使用平面手势(如画圈等等),即使用空间手势相关功能时,设备的主要运动皆在一个平面上;所述姿态校准场景可以是体感娱乐场景,体感娱乐场景对应的基准面可以是xoz平面(由x轴基坐标线和z轴基坐标线构成)也可以是zoy平面(由z轴基坐标线和y轴基坐标线构成)等等,需要说明的是上述例举的场景仅仅为了更好的释义本实施例的应用,本领域的技术人员应当知悉的是上述举例并不对本申请的发明范围进行限定。Optionally, a mapping relationship between at least one posture calibration scene and the reference datum plane may be established in advance, and the terminal may first determine the current target posture calibration scene. Then, based on the mapping relationship, the first reference plane to which the current target posture calibration scene corresponds is determined; in specific implementation, the posture calibration scene may be determined based on the terminal function mode triggered or enabled by the current user. Further, the posture calibration scene may be a spatial gesture input scene, such as the user holding the terminal to perform specific gesture action input (such as writing Chinese characters, drawing, etc.), it can be understood that when the user triggers the spatial gesture input function and the terminal is in the When corresponding spatial gesture input scenarios, the first datum plane can be determined based on the mapping relationship. For example, the first datum plane can be the xoz plane (consisting of the x-axis base coordinate line and the z-axis base coordinate line). Usually, the user uses the spatial gesture based on the terminal. When using a plane gesture (such as drawing a circle, etc.), that is, when using spatial gesture-related functions, the main movements of the device are all on one plane; the posture calibration scene can be a somatosensory entertainment scene, the benchmark corresponding to the somatosensory entertainment scene The plane can be the xoz plane (consisting of the x-axis base coordinate line and the z-axis base coordinate line) or the zoy plane (consisting of the z-axis base coordinate line and the y-axis base coordinate line), etc. It should be noted that the above examples are The scenarios described above are only to better explain the application of this embodiment, and those skilled in the art should know that the above examples do not limit the scope of the invention of the present application.
所述第一重力分量可以理解为第一重力加速度数据在第一坐标系下的第一基准面中的重力分量,示意性的,假设第一重力加速度数据在第一坐标系下可表示为:g xyz=[g x,g y,g z],其中
Figure PCTCN2022072342-appb-000002
G为标准重力参数值。假设第一基准面为XZ平面,如空间手势输入场景下,通常该场景下主要是使用平面手势(如画圈等等),即使用空间手势相关功能时,终端设备的主要运动可视作为皆在一个二维平面上,其余二维平面的姿态变化情况对姿态数据准确性的影响(实际应用中通常可以将空间手势对应的三维空间数据映射到某一个二维平面中,仅基于二维平面数据识别即可)可忽视。则将所述第一重力加速度数据映射至第一坐标系下的第一基准面(如XZ平面),得到第一重力分量,第一重力分量可表示为g xz=[g x,g z]。进一步的,当第一基准面由任意两坐标轴(以坐标轴a、坐标轴b示意)构成的基准面ab时,第一重力分量可表示为g ab=[g a,g b],a、b为x、y、z中的任意两个。 如,第一基准面为yz平面,则第一重力分量可表示为g yz=[g y,g z]。
The first gravitational component can be understood as the gravitational component of the first gravitational acceleration data in the first reference plane under the first coordinate system. Illustratively, it is assumed that the first gravitational acceleration data can be expressed as: g xyz = [g x , g y , g z ], where
Figure PCTCN2022072342-appb-000002
G is the standard gravity parameter value. Assuming that the first reference plane is the XZ plane, for example, in a spatial gesture input scenario, plane gestures (such as drawing a circle, etc.) are mainly used in this scenario, that is, when using spatial gesture-related functions, the main movement of the terminal device can be regarded as all On a two-dimensional plane, the influence of the attitude changes of the other two-dimensional planes on the accuracy of the attitude data (in practical applications, the three-dimensional spatial data corresponding to the spatial gesture can usually be mapped to a two-dimensional plane, only based on the two-dimensional plane data identification) can be ignored. Then map the first gravitational acceleration data to the first reference plane (such as the XZ plane) under the first coordinate system to obtain the first gravitational component, which can be expressed as g xz =[g x ,g z ] . Further, when the first reference plane is a reference plane ab formed by any two coordinate axes (indicated by coordinate axis a and coordinate axis b), the first gravity component can be expressed as g ab =[g a , g b ], a , b is any two of x, y, and z. For example, if the first reference plane is the yz plane, the first gravity component can be expressed as g yz =[g y , g z ].
步骤S203:构建从所述第一坐标系转换至第二坐标系的初始转换式,并获取重力加速度在第二坐标系下的第二基准面中的第二重力分量;Step S203: constructing an initial conversion formula from the first coordinate system to the second coordinate system, and obtaining the second gravity component of the gravitational acceleration in the second reference plane under the second coordinate system;
具体的,构建从所述第一坐标系转换至第二坐标系的初始转换式f,二维坐标系的转换可以直接使用旋转矩阵来实现坐标转换,如以M表示旋转矩阵,则有:Specifically, to construct the initial transformation formula f for converting from the first coordinate system to the second coordinate system, the transformation of the two-dimensional coordinate system can directly use the rotation matrix to realize the coordinate transformation. For example, the rotation matrix is represented by M, there are:
x'=f(x)=xMx'=f(x)=xM
其中f表示坐标系转换式,x表示第一坐标系中的姿态数据,x`表示第二坐标系的姿态数据。M可表示为
Figure PCTCN2022072342-appb-000003
a、b为第一坐标系的基坐标轴字符x、y、z中的任意两个。
Where f represents the coordinate system conversion formula, x represents the attitude data in the first coordinate system, and x` represents the attitude data in the second coordinate system. M can be expressed as
Figure PCTCN2022072342-appb-000003
a and b are any two of the base coordinate axis characters x, y, and z of the first coordinate system.
具体的,获取重力加速度在第二坐标系下的第二基准面中的第二重力分量,第二坐标系由于是为所述终端处于固定姿态时构建的载体坐标系,第一基准面和第二基准面相关联,当终端处于构建第二坐标系时对应的固定姿态时,如可以是上述在以实际应用空间环境中终端(如手机)水平放置时的固定姿态,此时第一基准面和第二基准面重合,假设第一基准面以面ab表示,则第二基准面可表示为面a0b0,重力加速度在第二坐标系下的第二基准面中的第二重力分量可表示为g a0b0。第二重力分量此时为一固定值。 Specifically, the second gravitational component of the gravitational acceleration in the second reference plane under the second coordinate system is obtained. Since the second coordinate system is a carrier coordinate system constructed when the terminal is in a fixed posture, the first reference plane and the first reference plane are The two datum planes are related. When the terminal is in a fixed posture corresponding to the construction of the second coordinate system, such as the above-mentioned fixed posture when the terminal (such as a mobile phone) is placed horizontally in the actual application space environment, the first datum plane is at this time. Coinciding with the second datum plane, assuming that the first datum plane is represented by plane ab, the second datum plane can be expressed as plane a0b0, and the second gravitational component of the gravitational acceleration in the second datum plane under the second coordinate system can be expressed as g a0b0 . The second gravity component is now a fixed value.
例如第一基准面:XZ平面,则第二基准面可表示为X0Z0平面。则在构建第二坐标系时终端处于固定姿态时,重力加速度在第二坐标系下的第二基准面中的第二重力分量可表示为:g X0Z0,g X0Z0=[0,g z0]。第二重力分量g X0Z0的向量模通常为一固定值,如重力加速度在XZ平面的重力分量值||g xz||=|g z0| For example, the first reference plane: the XZ plane, the second reference plane can be represented as the X0Z0 plane. Then when the terminal is in a fixed attitude when the second coordinate system is constructed, the second gravity component of the gravitational acceleration in the second reference plane under the second coordinate system can be expressed as: g X0Z0 , g X0Z0 =[0,g z0 ]. The vector modulus of the second gravitational component g X0Z0 is usually a fixed value, such as the gravitational component value of the gravitational acceleration on the XZ plane ||g xz ||=|g z0 | .
例如第一基准面:YZ平面,则第二基准面可表示为Y0Z0平面。则在构建第二坐标系时终端处于固定姿态时,重力加速度在第二坐标系下的第二基准面中的第二重力分量可表示为:g Y0Z0,g Y0Z0=[0,g z0]。第二重力分量g X0Z0的向量模通常为一固定值,如重力加速度在YZ平面的重力分量值||g yz||=|g z0|。 For example, the first reference plane: the YZ plane, the second reference plane can be represented as the Y0Z0 plane. Then when the terminal is in a fixed posture when the second coordinate system is constructed, the second gravity component of the gravitational acceleration in the second reference plane under the second coordinate system can be expressed as: g Y0Z0 , g Y0Z0 =[0, g z0 ]. The vector modulus of the second gravitational component g X0Z0 is usually a fixed value, such as the gravitational component value of the gravitational acceleration on the YZ plane ||g yz ||=|g z0 |.
步骤S204:基于所述第一重力分量、所述第二重力分量和所述第一坐标系对应的参考坐标基数据关系,对所述初始转换式进行计算,得到坐标系转换式。Step S204: Calculate the initial conversion formula based on the first gravity component, the second gravity component and the reference coordinate base data relationship corresponding to the first coordinate system to obtain a coordinate system conversion formula.
在一种具体的实施方式中,终端可基于所述第一重力分量与所述第二重力分量的数据转换关系、参考坐标基对应的向量模为预设固定值以及所述参考坐标基对应的向量夹角为预设角度值,对所述初始转换式进行计算,然后得到坐标系转换式,其中,所述参考坐标基为所述第一坐标系下对应的基向量In a specific implementation manner, the terminal may be based on the data conversion relationship between the first gravity component and the second gravity component, the vector modulus corresponding to the reference coordinate base being a preset fixed value, and the reference coordinate base corresponding to The vector angle is a preset angle value, the initial conversion formula is calculated, and then the coordinate system conversion formula is obtained, wherein the reference coordinate base is the corresponding base vector in the first coordinate system
所述第一重力分量与所述第二重力分量的数据转换关系可以理解为所述第一重力分量经过初始转换式的数据转换处理,可得到数据转换处理之后的第二重力分量,在一些实施方式中,所述第一重力分量与所述第二重力分量的数据转换关系可以是所述第一重力分量与所述初始转换式的乘积等于所述第二重力分量。The data conversion relationship between the first gravitational component and the second gravitational component can be understood as that the first gravitational component undergoes an initial conversion data conversion process, and the second gravitational component after the data conversion process can be obtained. In some implementations In the method, the data conversion relationship between the first gravity component and the second gravity component may be that the product of the first gravity component and the initial conversion formula is equal to the second gravity component.
所述第一坐标系对应的参考坐标基数据关系具体包括了参考坐标基对应的向量模的映射关系和参考坐标基对应的向量夹角的映射关系,在一些实施方式中具体可以为:所述参考坐标基对应的向量模为预设固定值;以及,所述参考坐标基对应的向量夹角为预设角度值,其中参考坐标基可以理解为第一坐标系对应的基向量。The reference coordinate base data relationship corresponding to the first coordinate system specifically includes the mapping relationship of the vector modulus corresponding to the reference coordinate base and the mapping relationship of the vector angle corresponding to the reference coordinate base. The vector modulus corresponding to the reference coordinate base is a preset fixed value; and the vector angle corresponding to the reference coordinate base is a preset angle value, wherein the reference coordinate base can be understood as the base vector corresponding to the first coordinate system.
在本实施例中,坐标是转换式可以是一种坐标系转换矩阵,释义时,初始转换式也可以是一种初始旋转矩阵。In this embodiment, the coordinate conversion formula may be a coordinate system conversion matrix, and during interpretation, the initial conversion formula may also be an initial rotation matrix.
在本申请中,“第一基准面”与“第二基准面”为不同坐标系下采用相同基准划分依据确定的基准 平面,实际实施中“第一基准面”与“第二基准面”可根据两个不同坐标系下的同类基向量(如基向量x和基向量y)确定,进一步的,两个不同坐标系下的相同向量名(如基向量x的向量名x和基向量y的向量名y)的基向量可认为属于同类基向量;In this application, "first datum plane" and "second datum plane" are datum planes determined by the same datum division basis under different coordinate systems. In actual implementation, "first datum plane" and "second datum plane" may be It is determined according to the same base vectors (such as base vector x and base vector y) in two different coordinate systems, and further, the same vector names in two different coordinate systems (such as the vector name x of base vector x and base vector y The basis vector of the vector name y) can be considered to belong to the same basis vector;
如以相同向量名的基向量(如基向量x和基向量y)为例,则第一基准面为第一坐标系下由基向量x和基向量y构成的x-y坐标基准面、则第二基准面为第二坐标系下由基向量x和基向量y构成的x-y坐标基准面;For example, taking the basis vectors with the same vector names (such as basis vector x and basis vector y) as an example, the first reference plane is the x-y coordinate reference plane composed of basis vector x and basis vector y in the first coordinate system, then the second reference plane The datum plane is the x-y coordinate datum plane composed of the base vector x and the base vector y under the second coordinate system;
示意性的,如图8所示,图8为本申请涉及的坐标系基准面的场景示意图,在一些设备握持场景中,如终端空中手势输入场景中,姿态变化对姿态数据准确性带来的主要影响可以理解为是导致第一坐标系中X-Z坐标基准面(也即第一基准面)相对第二坐标系中X0-Z0坐标基准面(也即第二基准面)发生了旋转,如图8所示。由于终端自身姿态变化,当前姿态相较与上一姿态数据采样时刻第一坐标系发生了变化,可主要考虑“第一坐标系中X-Z坐标基准面(也即第一基准面)相对第二坐标系中X0-Z0坐标基准面(也即第二基准面)发生的变化”:Schematically, as shown in FIG. 8, FIG. 8 is a schematic diagram of the coordinate system datum plane involved in the application. In some device holding scenarios, such as the terminal aerial gesture input scenario, the attitude change brings about the accuracy of the attitude data. The main influence can be understood as causing the X-Z coordinate datum in the first coordinate system (that is, the first datum) to rotate relative to the X0-Z0 coordinate datum (that is, the second datum) in the second coordinate system, such as shown in Figure 8. Due to the change of the terminal's own attitude, the current attitude has changed compared with the first coordinate system at the last attitude data sampling time. It can be mainly considered that "the X-Z coordinate datum plane (ie the first datum plane) in the first coordinate system is relative to the second coordinate system. Changes in the X0-Z0 coordinate datum (that is, the second datum) in the system":
例如第一基准面:第一坐标系下的XZ平面,则第二基准面可表示为第二基准面下的X0Z0平面。则在构建第二坐标系时终端处于固定姿态时,重力加速度在第二坐标系下的第二基准面中的第二重力分量可表示为:g X0Z0。g X0Z0为一固定值g x0z0=[0,g z0]; For example, the first reference plane: the XZ plane under the first coordinate system, the second reference plane can be represented as the X0Z0 plane under the second reference plane. Then, when the terminal is in a fixed posture when the second coordinate system is constructed, the second gravity component of the gravitational acceleration in the second reference plane under the second coordinate system can be expressed as: g X0Z0 . g X0Z0 is a fixed value g x0z0 =[0,g z0 ];
旋转矩阵以M表示,则初始旋转矩阵M可表示为
Figure PCTCN2022072342-appb-000004
The rotation matrix is represented by M, then the initial rotation matrix M can be represented as
Figure PCTCN2022072342-appb-000004
1、所述第一重力分量与所述初始旋转矩阵的乘积等于所述第二重力分量,可表示为参考式1.1:1. The product of the first gravity component and the initial rotation matrix is equal to the second gravity component, which can be expressed as reference formula 1.1:
Figure PCTCN2022072342-appb-000005
Figure PCTCN2022072342-appb-000005
可推得:
Figure PCTCN2022072342-appb-000006
It can be inferred:
Figure PCTCN2022072342-appb-000006
2、所述第一坐标系对应的参考坐标基数据关系为:所述参考坐标基对应的向量模为预设固定值以及所述参考坐标基对应的向量夹角为预设角度值。示意性的所述预设固定值、预设角度值基于实际应用环境确定,也即实际应用环境下第一坐标系的坐标基和向量模之间的关系确定,如预设固定值可以是1,预设角度值可以是90度。2. The data relationship of the reference coordinate base corresponding to the first coordinate system is: the vector modulus corresponding to the reference coordinate base is a preset fixed value and the vector angle corresponding to the reference coordinate base is a preset angle value. Illustratively, the preset fixed value and the preset angle value are determined based on the actual application environment, that is, the relationship between the coordinate base of the first coordinate system and the vector modulus in the actual application environment is determined. For example, the preset fixed value may be 1 , the preset angle value can be 90 degrees.
进一步的,所述参考坐标基对应的向量模为预设固定值1,所述参考坐标基对应的向量夹角为预设角度值90度,可得到参考式1.2:Further, the vector modulus corresponding to the reference coordinate base is a preset fixed value of 1, and the vector angle corresponding to the reference coordinate base is a preset angle value of 90 degrees. Reference formula 1.2 can be obtained:
Figure PCTCN2022072342-appb-000007
Figure PCTCN2022072342-appb-000007
基于上述参考式中的5个式子,可确定初始旋转矩阵M中的4个未知数a 1、b 1、a 2、b 2Based on the five formulas in the above reference formula, four unknowns a 1 , b 1 , a 2 , and b 2 in the initial rotation matrix M can be determined.
在一些实施例中,还可基于当终端当前姿态为构建第二坐标系时对应的固定姿态时,也即第一坐标系下的第一基准面(xz基准面)与第二坐标系下的第二基准面(x0z0基准面)重合时,可得参考式1.3:In some embodiments, when the current posture of the terminal is a fixed posture corresponding to the construction of the second coordinate system, that is, the first datum plane (xz datum plane) in the first coordinate system and the When the second datum plane (x0z0 datum plane) coincides, the reference formula 1.3 can be obtained:
g xz=[0,g z]=g x0z0=g xzM          (参考式1.3) g xz =[0,g z ]=g x0z0 =g xz M (refer to Equation 1.3)
可得
Figure PCTCN2022072342-appb-000008
Available
Figure PCTCN2022072342-appb-000008
基于上述条件,可对所述初始旋转矩阵进行计算,得到最终的坐标系转换矩阵,也可以理解为前述中的坐标系转换式。Based on the above conditions, the initial rotation matrix can be calculated to obtain the final coordinate system conversion matrix, which can also be understood as the coordinate system conversion formula in the foregoing.
如,以第一基准面(xz基准面)、第二基准面(x0z0基准面)释义,坐标系转换矩阵即为:For example, in terms of the first datum plane (xz datum plane) and the second datum plane (x0z0 datum plane), the coordinate system transformation matrix is:
Figure PCTCN2022072342-appb-000009
Figure PCTCN2022072342-appb-000009
如,以第一基准面(yz基准面)、第二基准面(y0z0基准面)释义,坐标系转换矩阵即为:For example, in terms of the first datum plane (yz datum plane) and the second datum plane (y0z0 datum plane), the coordinate system transformation matrix is:
Figure PCTCN2022072342-appb-000010
Figure PCTCN2022072342-appb-000010
步骤S205:根据所述坐标系转换式对所述参考姿态数据进行校准处理,确定在所述第二坐标系下的目标姿态数据。Step S205: Perform calibration processing on the reference attitude data according to the coordinate system conversion formula, and determine the target attitude data in the second coordinate system.
具体可参考步骤S103,此处不再赘述。For details, refer to step S103, which will not be repeated here.
在本申请实施例中,终端通过确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态对应的第一坐标系下的参考姿态数据,基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系通常为所述终端处于固定姿态时构建的载体坐标系;根据确定的坐标系转换式对所述参考姿态数据进行校准处理,可以确定在所述第二坐标系下的目标姿态数据。从而在使用终端的过程中,实现对终端的姿态进行自适应校正,以消除终端姿态变化导致的姿态数据准确性不高的影响,降低获取到的姿态数据的误差;以及基于终端处于固定姿态时构建的载体坐标系结合重力加速度的变化情况来进行姿态校准,相对于相关技术中涉及的大地坐标系、地理坐标系、多载体坐标系等方案可以大幅减小姿态校准过程中的计算量,提高姿态校准的处理效率,可以有效描述由于诸如手势交互等姿态变化场景下终端的姿态变化过程,最终确定的姿态数据不受设备姿态变化、设备所处方位、地理位置等环境的限制;以及利用重力加速度来进行坐标系转换,重力加速度获取简单,通常重力加速度采样率较高,适合实际应用场景下的实时处理;通过重力加速度向量的变化来计算旋转矩阵,实现简单、计算快速。In this embodiment of the present application, the terminal determines the first gravitational acceleration data in the first coordinate system corresponding to the current attitude and determines the reference attitude data in the first coordinate system corresponding to the current attitude, based on the first gravity The acceleration data determines the coordinate system conversion formula from the first coordinate system to the second coordinate system, and the second coordinate system is usually the carrier coordinate system constructed when the terminal is in a fixed posture; according to the determined coordinate system conversion formula By performing calibration processing on the reference attitude data, the target attitude data in the second coordinate system can be determined. Therefore, in the process of using the terminal, the attitude of the terminal is adaptively corrected, so as to eliminate the influence of the low accuracy of the attitude data caused by the change of the terminal attitude, and reduce the error of the acquired attitude data; The constructed carrier coordinate system combines the change of gravitational acceleration to perform attitude calibration. Compared with the geodetic coordinate system, geographic coordinate system, multi-carrier coordinate system and other schemes involved in related technologies, the calculation amount in the attitude calibration process can be greatly reduced, and the increase of The processing efficiency of attitude calibration can effectively describe the attitude change process of the terminal due to gesture changes such as gesture interaction, and the final attitude data is not limited by the equipment attitude change, device location, geographic location and other environments; and the use of gravity Acceleration is used to convert the coordinate system, the gravitational acceleration is easy to obtain, and the sampling rate of gravitational acceleration is usually high, which is suitable for real-time processing in practical application scenarios; the rotation matrix is calculated by the change of the gravitational acceleration vector, which is simple and fast to calculate.
请参见图9,图9是本申请提出的一种姿态校准方法的另一种实施例的流程示意图。具体的:Please refer to FIG. 9 , which is a schematic flowchart of another embodiment of an attitude calibration method proposed in the present application. specific:
步骤S301:确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态在所述第一坐标系下的参考姿态数据;Step S301: determine the first gravitational acceleration data under the first coordinate system corresponding to the current attitude, and determine the reference attitude data of the current attitude under the first coordinate system;
具体可参考步骤S101,此处不再赘述。For details, reference may be made to step S101, which will not be repeated here.
步骤S302:确定所述第一重力加速度数据在所述第一坐标系对应的预设基准面中的参考向量模。Step S302: Determine the reference vector modulus of the first gravitational acceleration data in the preset reference plane corresponding to the first coordinate system.
在本申请实施例中,由于终端姿态变化,在一些特殊场景下为了简化计算,可不执行确定坐标系转换式的过程,仅需基于特殊场景下姿态变化规律,进行坐标数值变换即可,可加快特殊场景下姿态校准的效率。进一步的,随着终端姿态变化,当终端的第一坐标系的基坐标轴与第二坐标系下重力加速度方向相关的基坐标轴重合时,可直接对第一坐标下测量的任一姿态数据进行相应基坐标数值的变化即可。在一些实施例中,所述“第二坐标系下重力加速度方向相关的基坐标轴”可以理解为重力加速度与某一 基坐标轴位于同一直线上,示意性的,重力加速度与基坐标轴-y轴重合。In the embodiment of the present application, due to the change of the terminal posture, in some special scenarios, in order to simplify the calculation, the process of determining the coordinate system conversion formula may not be performed, and it is only necessary to perform the coordinate numerical transformation based on the posture change rule in the special scenario, which can speed up the process. Efficiency of pose calibration in special scenarios. Further, with the terminal attitude change, when the base coordinate axis of the first coordinate system of the terminal coincides with the base coordinate axis related to the direction of gravitational acceleration under the second coordinate system, any attitude data measured under the first coordinate can be directly measured. You can change the corresponding base coordinate value. In some embodiments, the "basic coordinate axis related to the direction of the gravitational acceleration in the second coordinate system" can be understood as the gravitational acceleration and a certain basic coordinate axis are located on the same straight line, schematically, the gravitational acceleration and the basic coordinate axis - The y-axis coincides.
所述预设基准面可以理解为第一坐标系下由至少两条基坐标线(如x轴、y轴、z轴中的其一)构成的平面,如xoz平面(由x轴基坐标线和z轴基坐标线构成)、xoy平面(由x轴基坐标线和y轴基坐标线构成)、zoy平面(由z轴基坐标线和y轴基坐标线构成)。The preset reference plane can be understood as a plane composed of at least two base coordinate lines (such as one of the x-axis, y-axis, and z-axis) under the first coordinate system, such as the xoz plane (consisting of the x-axis base coordinate line). and the z-axis base coordinate line), the xoy plane (composed of the x-axis base coordinate line and the y-axis base coordinate line), and the zoy plane (composed of the z-axis base coordinate line and the y-axis base coordinate line).
所述参考向量模为第一重力加速度数据在预设基准面上的分量。其中,向量模的计算可参考相关技术中的模运算的方式,此处不再赘述。The reference vector modulus is the component of the first gravitational acceleration data on the preset reference plane. Wherein, for the calculation of the vector modulus, reference may be made to the manner of the modulus operation in the related art, which will not be repeated here.
步骤S303:当所述参考向量模与目标值不一致时,基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系为所述终端处于固定姿态时构建的载体坐标系。Step S303: When the reference vector modulus is inconsistent with the target value, determine the coordinate system conversion formula from the first coordinate system to the second coordinate system based on the first gravitational acceleration data, and the second coordinate system is: The carrier coordinate system constructed when the terminal is in a fixed posture.
进一步的,当所述参考向量模与目标值(如0)不一致时,通常终端姿态变化不涉及上述例举的一些特殊场景下,可执行所述基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式的步骤,所述第二坐标系为所述终端处于固定姿态时构建的载体坐标系,具体可参考步骤s101-s103以及s201-s205。Further, when the reference vector modulus is inconsistent with the target value (such as 0), usually the terminal attitude change does not involve some special scenarios exemplified above, the determination based on the first gravitational acceleration data can be performed. The step of converting the first coordinate system to the coordinate system conversion formula of the second coordinate system, where the second coordinate system is the carrier coordinate system constructed when the terminal is in a fixed posture, for details, please refer to steps s101-s103 and s201-s205.
其中,所述目标值可基于实际应用环境确定,如基于实际应用环境预设目标值为0,虑到实际应用环境下的误差目标值可以是基于实际应用情况确定的多个参考值,或,考虑到实际应用环境下的误差而设置一个数值范围,此处不做限定。Wherein, the target value may be determined based on the actual application environment, for example, the preset target value based on the actual application environment is 0, considering that the error target value in the actual application environment may be a plurality of reference values determined based on the actual application situation, or, A numerical range is set in consideration of the error in the actual application environment, which is not limited here.
步骤S304:根据所述坐标系转换式对所述参考姿态数据进行校准处理,确定在所述第二坐标系下的目标姿态数据。Step S304: Perform calibration processing on the reference attitude data according to the coordinate system conversion formula, and determine the target attitude data in the second coordinate system.
具体可参考步骤S103,此处不再赘述。For details, refer to step S103, which will not be repeated here.
步骤S305:当所述参考向量模与目标值一致时,对所述参考姿态数据所对应的第一坐标值和第二坐标值进行坐标数值交互换处理,得到在所述第二坐标系下的目标姿态数据。Step S305: when the reference vector modulus is consistent with the target value, perform coordinate value exchange processing on the first coordinate value and the second coordinate value corresponding to the reference attitude data, and obtain the coordinate value in the second coordinate system. Target pose data.
所述参考向量模为第一重力加速度数据在预设基准面上的分量,通常所述参考向量模的值可以是0。The reference vector modulus is the component of the first gravitational acceleration data on the preset reference plane, and generally the value of the reference vector modulus may be 0.
如以预设基准面为第一坐标系下的xoz平面(由x轴基坐标线和z轴基坐标线构成)为例,所述参考向量模可表示为||g xz||=0,假设终端采集到的重力传感器数据为g xyz=[g x,g y,g z],通常|g y|=G。G为标准重力参数值。 For example, taking the preset reference plane as the xoz plane in the first coordinate system (consisting of the x-axis base coordinate line and the z-axis base coordinate line) as an example, the reference vector modulus can be expressed as ||g xz ||=0, It is assumed that the gravity sensor data collected by the terminal is g xyz =[g x , g y , g z ], usually |g y |=G. G is the standard gravity parameter value.
示意性的,以第一坐标系的基坐标轴分别为a轴、b轴、c轴为例,假设终端采集到的重力传感器数据为g abc=[g a,g b,g c],预设基准面可表示为AoB平面,A、B为a轴、b轴、c轴对应字符中的任意两个字符。所述参考向量模可表示为||g AB||=0,通常重力加速度映射至C轴的重力分量|gC|=G。G为标准重力参数值,C为a轴、b轴、c轴对应字符中与“A、B”不同的字符,如A为a轴对应字符a,B为b轴对应字符b,则C为c轴对应字符c。 Schematically, taking the base coordinate axes of the first coordinate system as the a-axis, the b-axis, and the c-axis, as an example, it is assumed that the gravity sensor data collected by the terminal is g abc =[g a , g b , g c ]. It is assumed that the reference plane can be represented as the AoB plane, and A and B are any two characters in the characters corresponding to the a-axis, b-axis, and c-axis. The reference vector norm can be expressed as ||g AB ||=0, usually the gravitational acceleration is mapped to the gravitational component of the C axis |gC|=G. G is the standard gravity parameter value, C is a character different from "A, B" in the corresponding characters of the a-axis, b-axis, and c-axis, if A is the character a corresponding to the a-axis, and B is the character b corresponding to the b-axis, then C is The c axis corresponds to the character c.
在一种具体的实施场景中,所述参考姿态数据包含所述第一坐标系下的第一坐标值、第二坐标值以及第三坐标值;In a specific implementation scenario, the reference attitude data includes a first coordinate value, a second coordinate value, and a third coordinate value in the first coordinate system;
基于所述第一坐标值的数值确定第二目标值以及基于所述第二坐标值确定第一目标值,得到在所述第二坐标系下的目标姿态数据,所述目标姿态数据包括所述第一目标值、所述第二目标值以及第三坐标值。The second target value is determined based on the numerical value of the first coordinate value and the first target value is determined based on the second coordinate value, so as to obtain target attitude data in the second coordinate system, where the target attitude data includes the the first target value, the second target value and the third coordinate value.
示意性的,以上述第一坐标系的基坐标轴分别为a轴、b轴、c轴为例,假设终端采集到的参考姿态数据X在第一坐标系下可表示为X abc=[X a,X b,X c];Xa为第一坐标值,Xb为第二坐标值,Xc为第三坐标值。 Schematically, taking the base coordinate axes of the first coordinate system as the a-axis, b-axis, and c-axis respectively, it is assumed that the reference attitude data X collected by the terminal can be expressed as X abc =[X in the first coordinate system. a , X b , X c ]; Xa is the first coordinate value, Xb is the second coordinate value, and Xc is the third coordinate value.
若参考向量模||g AB||=0,-gC=G,将所述第一坐标值Xb作为第二目标值,将所述第二坐标值Xc 的负值作为第一目标值,则目标姿态数据可表示为X=[X a,X c,-X b]; If the reference vector modulo ||g AB ||=0, -gC=G, the first coordinate value Xb is taken as the second target value, and the negative value of the second coordinate value Xc is taken as the first target value, then The target attitude data can be expressed as X=[X a , X c , -X b ];
若参考向量模||g AB||=0,g C=G,将所述第一坐标值Xb作为第二目标值,将所述第二坐标值Xc作为第一目标值,则目标姿态数据可表示为X=[X a,X c,X b]; If the reference vector modulo ||g AB ||=0, g C =G, the first coordinate value Xb is taken as the second target value, and the second coordinate value Xc is taken as the first target value, then the target attitude data It can be expressed as X=[X a , X c , X b ];
在一种具体的实施场景中,如前述实施例步骤S201-S202所示出的,终端姿态校准在一些应用场景下,可以结合实际应用情况,仅考虑在相应平面内的终端的姿态变化情况或实际需求,可以对三维姿态变化进行简化,也即通常终端在相应的应用场景下,仅涉及到在第一坐标系下的固定平面内的变化幅度可纳入参考,除该固定平面之外的第一坐标系下的其它平面内姿态的变化可进行滤除,也即不考虑其它平面内姿态的变化对姿态数据的影响。则上述步骤可进一步简化,仅考虑平面坐标变化,示意性的:In a specific implementation scenario, as shown in steps S201-S202 in the foregoing embodiment, in some application scenarios, the terminal attitude calibration may be combined with the actual application situation and only consider the attitude change of the terminal in the corresponding plane or For actual needs, the three-dimensional attitude change can be simplified, that is, in the corresponding application scenario, the terminal only involves the change in the fixed plane in the first coordinate system. Changes of attitudes in other planes under one coordinate system can be filtered out, that is, the influence of attitude changes in other planes on attitude data is not considered. Then the above steps can be further simplified, only considering the plane coordinate change, schematic:
特别的,当所述参考向量模为目标值,且仅需考虑预设基准面内的变化时,则只需考虑参考姿态数据所对应的第一坐标值和第二坐标值进行坐标数值交互换处理即可,参考姿态数据所对应的第三坐标值可忽视,例如,当所述参考向量模为目标值,此时可以是设备第一坐标系中的Y轴与重力加速度指向重合,即Y轴和Z轴数据发生了翻转,此时只需交换Y轴和Z轴数据并考虑g C数值的正负即可得到姿态校准后的数据,进一步的,以加速度和角速度传感器数据为例,设备采集到的加速度数据为acc xz,角速度数据为gyro xz,如下 In particular, when the reference vector modulus is the target value and only the change in the preset datum plane needs to be considered, then only the first coordinate value and the second coordinate value corresponding to the reference attitude data need to be considered to perform the coordinate value interactive exchange It can be processed, and the third coordinate value corresponding to the reference attitude data can be ignored. For example, when the reference vector modulus is the target value, it can be that the Y axis in the first coordinate system of the device coincides with the gravitational acceleration, that is, Y The axis and Z axis data have flipped. At this time, it is only necessary to exchange the Y axis and Z axis data and consider the positive and negative values of g C to obtain the attitude calibration data. Further, taking the acceleration and angular velocity sensor data as an example, the device The collected acceleration data is acc xz , and the angular velocity data is gyro xz , as follows
Figure PCTCN2022072342-appb-000011
Figure PCTCN2022072342-appb-000011
在本申请实施例中,终端通过确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态对应的第一坐标系下的参考姿态数据,基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系通常为所述终端处于固定姿态时构建的载体坐标系;根据确定的坐标系转换式对所述参考姿态数据进行校准处理,可以确定在所述第二坐标系下的目标姿态数据。从而在使用终端的过程中,实现对终端的姿态进行自适应校正,以消除终端姿态变化导致的姿态数据准确性不高的影响,降低获取到的姿态数据的误差;以及基于终端处于固定姿态时构建的载体坐标系结合重力加速度的变化情况来进行姿态校准,相对于相关技术中涉及的大地坐标系、地理坐标系、多载体坐标系等方案可以大幅减小姿态校准过程中的计算量,提高姿态校准的处理效率,可以有效描述由于诸如手势交互等姿态变化场景下终端的姿态变化过程,最终确定的姿态数据不受设备姿态变化、设备所处方位、地理位置等环境的限制;以及利用重力加速度来进行坐标系转换,重力加速度获取简单,通常重力加速度采样率较高,适合实际应用场景下的实时处理;通过重力加速度向量的变化来计算旋转矩阵,实现简单、计算快速。In this embodiment of the present application, the terminal determines the first gravitational acceleration data in the first coordinate system corresponding to the current attitude and determines the reference attitude data in the first coordinate system corresponding to the current attitude, based on the first gravity The acceleration data determines the coordinate system conversion formula from the first coordinate system to the second coordinate system, and the second coordinate system is usually the carrier coordinate system constructed when the terminal is in a fixed posture; according to the determined coordinate system conversion formula By performing calibration processing on the reference attitude data, the target attitude data in the second coordinate system can be determined. Therefore, in the process of using the terminal, the attitude of the terminal is adaptively corrected, so as to eliminate the influence of the low accuracy of the attitude data caused by the change of the terminal attitude, and reduce the error of the acquired attitude data; The constructed carrier coordinate system combines the change of gravitational acceleration to perform attitude calibration. Compared with the geodetic coordinate system, geographic coordinate system, multi-carrier coordinate system and other schemes involved in related technologies, the calculation amount in the attitude calibration process can be greatly reduced, and the increase of The processing efficiency of attitude calibration can effectively describe the attitude change process of the terminal due to gesture changes such as gesture interaction, and the final attitude data is not limited by the equipment attitude change, device location, geographic location and other environments; and the use of gravity Acceleration is used to convert the coordinate system, the gravitational acceleration is easy to obtain, and the sampling rate of gravitational acceleration is usually high, which is suitable for real-time processing in practical application scenarios; the rotation matrix is calculated by the change of the gravitational acceleration vector, which is simple and fast to calculate.
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are apparatus embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
请参见图10,其示出了本申请一个示例性实施例提供的姿态校准装置的结构示意图。该姿态校准装置可以通过软件、硬件或者两者的结合实现成为装置的全部或一部分。该装置1包括数据确定模块11、数据转换模块12和数据校准模块13。Please refer to FIG. 10 , which shows a schematic structural diagram of an attitude calibration apparatus provided by an exemplary embodiment of the present application. The attitude calibration device can be implemented as a whole or a part of the device through software, hardware or a combination of the two. The device 1 includes a data determination module 11 , a data conversion module 12 and a data calibration module 13 .
数据确定模块11,用于确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态在所述第一坐标系下的参考姿态数据;The data determination module 11 is used to determine the first gravitational acceleration data under the first coordinate system corresponding to the current attitude, and determine the reference attitude data of the current attitude under the first coordinate system;
数据转换模块12,用于基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系为所述终端处于固定姿态时构建的载体坐标系;A data conversion module 12, configured to determine a coordinate system conversion formula for converting from the first coordinate system to a second coordinate system based on the first gravitational acceleration data, where the second coordinate system is constructed when the terminal is in a fixed posture The carrier coordinate system of ;
数据校准模块13,用于根据所述坐标系转换式对所述参考姿态数据进行校准处理,确定在所述第二坐标系下的目标姿态数据。The data calibration module 13 is configured to perform calibration processing on the reference attitude data according to the coordinate system conversion formula, and determine the target attitude data in the second coordinate system.
可选的,如图11所示,所述数据转换模块12,包括:Optionally, as shown in Figure 11, the data conversion module 12 includes:
数据获取单元121,用于获取重力加速度在所述第二坐标系下的第二重力加速度数据;a data acquisition unit 121, configured to acquire the second gravitational acceleration data of the gravitational acceleration in the second coordinate system;
旋转数据确定单元122,用于基于所述第一重力加速度数据以及所述第二重力加速度数据,确定坐标系旋转角以及坐标系旋转轴;a rotation data determination unit 122, configured to determine a coordinate system rotation angle and a coordinate system rotation axis based on the first gravitational acceleration data and the second gravitational acceleration data;
转换矩阵确定单元123,用于构建从所述第一坐标系转换至第二坐标系的初始转换式,根据所述坐标系旋转角以及所述坐标系旋转轴对所述初始转换式进行计算,得到坐标系转换式。The transformation matrix determination unit 123 is configured to construct an initial transformation formula for converting from the first coordinate system to the second coordinate system, and calculate the initial transformation formula according to the rotation angle of the coordinate system and the rotation axis of the coordinate system, Get the coordinate system conversion.
可选的,如图11所示,所述数据转换模块12,包括:Optionally, as shown in Figure 11, the data conversion module 12 includes:
所述数据获取单元121,还用于将所述第一重力加速度数据映射至所述第一坐标系下的第一基准面,得到第一重力分量;The data acquisition unit 121 is further configured to map the first gravitational acceleration data to the first reference plane under the first coordinate system to obtain a first gravitational component;
所述数据获取单元121,还用于构建从所述第一坐标系转换至第二坐标系的初始转换式,并获取重力加速度在第二坐标系下的第二基准面中的第二重力分量;The data acquisition unit 121 is further configured to construct an initial conversion formula from the first coordinate system to the second coordinate system, and acquire the second gravity component of the gravitational acceleration in the second reference plane under the second coordinate system ;
所述转换矩阵确定单元123,还用于基于所述第一重力分量与所述第二重力分量的数据转换关系、参考坐标基对应的向量模为预设固定值以及所述参考坐标基对应的向量夹角为预设角度值,对所述初始转换式进行计算,得到坐标系转换式,其中,所述参考坐标基为所述第一坐标系下对应的基向量。The conversion matrix determining unit 123 is further configured to be a preset fixed value based on the data conversion relationship between the first gravity component and the second gravity component, the vector modulus corresponding to the reference coordinate base, and the reference coordinate base. The vector included angle is a preset angle value, and the initial conversion formula is calculated to obtain a coordinate system conversion formula, wherein the reference coordinate base is the corresponding base vector in the first coordinate system.
可选的,如图12所示,所述装置1还包括:Optionally, as shown in FIG. 12 , the device 1 further includes:
向量模计算模块14,用于确定所述第一重力加速度数据在所述第一坐标系对应的预设基准面中的参考向量模;a vector modulus calculation module 14, configured to determine the reference vector modulus of the first gravitational acceleration data in the preset reference plane corresponding to the first coordinate system;
当所述参考向量模与目标值不一致时,所述数据转换模块12执行所述基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式的步骤。When the reference vector modulus is inconsistent with the target value, the data conversion module 12 performs the step of determining a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system based on the first gravitational acceleration data .
可选的,所述装置1还包括:Optionally, the device 1 further includes:
所述数据转换模块12,还用于当所述参考向量模为目标值时,对所述参考姿态数据所对应的第一坐标值和第二坐标值进行坐标数值交换处理,得到在所述第二坐标系下的目标姿态数据。The data conversion module 12 is further configured to perform coordinate value exchange processing on the first coordinate value and the second coordinate value corresponding to the reference attitude data when the reference vector modulus is a target value, to obtain the first coordinate value and the second coordinate value corresponding to the reference attitude data. The target pose data in the two-coordinate system.
可选的,所述数据转换模块12,还用于Optionally, the data conversion module 12 is also used for
所述参考姿态数据包含所述第一坐标系下的第一坐标值、第二坐标值以及第三坐标值;The reference attitude data includes a first coordinate value, a second coordinate value and a third coordinate value in the first coordinate system;
基于所述第一坐标值的数值确定第二目标值以及基于所述第二坐标值确定第一目标值,得到在所述第二坐标系下的目标姿态数据,所述目标姿态数据包括所述第一目标值、所述第二目标值以及第三坐标值。The second target value is determined based on the numerical value of the first coordinate value and the first target value is determined based on the second coordinate value, so as to obtain target attitude data in the second coordinate system, where the target attitude data includes the the first target value, the second target value and the third coordinate value.
可选的,所述装置1还用于:Optionally, the device 1 is also used for:
所述数据转换模块12,还用于获取当前姿态对应的第一坐标系下的加速度数据,对所述加速度数据进行数据滤波处理,得到第一重力加速度数据。The data conversion module 12 is further configured to acquire acceleration data in the first coordinate system corresponding to the current posture, and perform data filtering processing on the acceleration data to obtain first gravitational acceleration data.
可选的,所述装置1还用于:Optionally, the device 1 is also used for:
计算所述参考姿态数据与所述坐标系转换式的积,得到所述参考姿态数据在所述第二坐标系下的目标姿态数据。Calculate the product of the reference attitude data and the coordinate system conversion formula to obtain target attitude data of the reference attitude data in the second coordinate system.
需要说明的是,上述实施例提供的姿态校准装置在执行姿态校准方法时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的姿态校准装置与姿态校准方法实施例属于同一构思,其体现实现过程详见方法实施例,这里不再赘述。It should be noted that, when the attitude calibration apparatus provided in the above embodiment executes the attitude calibration method, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions may be allocated to different functional modules as required. , that is, dividing the internal structure of the device into different functional modules to complete all or part of the functions described above. In addition, the attitude calibration device and the attitude calibration method embodiments provided by the above embodiments belong to the same concept, and the embodiment and implementation process thereof are detailed in the method embodiments, which will not be repeated here.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
在本申请实施例中,终端通过确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态对应的第一坐标系下的参考姿态数据,基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系通常为所述终端处于固定姿态时构建的载体坐标系; 根据确定的坐标系转换式对所述参考姿态数据进行校准处理,可以确定在所述第二坐标系下的目标姿态数据。从而在使用终端的过程中,实现对终端的姿态进行自适应校正,以消除终端姿态变化导致的姿态数据准确性不高的影响,降低获取到的姿态数据的误差;以及基于终端处于固定姿态时构建的载体坐标系结合重力加速度的变化情况来进行姿态校准,相对于相关技术中涉及的大地坐标系、地理坐标系、多载体坐标系等方案可以大幅减小姿态校准过程中的计算量,提高姿态校准的处理效率,可以有效描述由于诸如手势交互等姿态变化场景下终端的姿态变化过程,最终确定的姿态数据不受设备姿态变化、设备所处方位、地理位置等环境的限制;以及利用重力加速度来进行坐标系转换,重力加速度获取简单,通常重力加速度采样率较高,适合实际应用场景下的实时处理;通过重力加速度向量的变化来计算旋转矩阵,实现简单、计算快速。In this embodiment of the present application, the terminal determines the first gravitational acceleration data in the first coordinate system corresponding to the current attitude and determines the reference attitude data in the first coordinate system corresponding to the current attitude, based on the first gravity The acceleration data determines the coordinate system conversion formula from the first coordinate system to the second coordinate system, and the second coordinate system is usually the carrier coordinate system constructed when the terminal is in a fixed attitude; according to the determined coordinate system conversion formula By performing calibration processing on the reference attitude data, the target attitude data in the second coordinate system can be determined. Therefore, in the process of using the terminal, the attitude of the terminal is adaptively corrected, so as to eliminate the influence of the low accuracy of the attitude data caused by the change of the terminal attitude, and reduce the error of the acquired attitude data; The constructed carrier coordinate system combines the change of gravitational acceleration to perform attitude calibration. Compared with the geodetic coordinate system, geographic coordinate system, multi-carrier coordinate system and other schemes involved in related technologies, the calculation amount in the attitude calibration process can be greatly reduced, and the increase of The processing efficiency of attitude calibration can effectively describe the attitude change process of the terminal due to gesture changes such as gesture interaction, and the final attitude data is not limited by the equipment attitude change, device location, geographic location and other environments; and the use of gravity Acceleration is used to convert the coordinate system, the gravitational acceleration is easy to obtain, and the sampling rate of gravitational acceleration is usually high, which is suitable for real-time processing in practical application scenarios; the rotation matrix is calculated by the change of the gravitational acceleration vector, which is simple and fast to calculate.
本申请实施例还提供了一种计算机存储介质,所述计算机存储介质可以存储有多条指令,所述指令适于由处理器加载并执行如上述图1-图9所示实施例的所述姿态校准方法,具体执行过程可以参见图1-图9所示实施例的具体说明,在此不进行赘述。An embodiment of the present application further provides a computer storage medium, where the computer storage medium can store a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above-described embodiments shown in FIG. 1 to FIG. 9 . For the attitude calibration method, for the specific execution process, reference may be made to the specific description of the embodiments shown in FIG. 1 to FIG. 9 , which will not be repeated here.
本申请还提供了一种计算机程序产品,该计算机程序产品存储有至少一条指令,所述至少一条指令由所述处理器加载并执行如上述图1-图9所示实施例的所述姿态校准方法,具体执行过程可以参见图1-图9所示实施例的具体说明,在此不进行赘述。The present application also provides a computer program product, the computer program product stores at least one instruction, and the at least one instruction is loaded by the processor and executes the attitude calibration in the embodiment shown in the above-mentioned FIG. 1 to FIG. 9 . For the specific execution process, reference may be made to the specific descriptions of the embodiments shown in FIG. 1 to FIG. 9 , which will not be repeated here.
请参考图13,其示出了本申请一个示例性实施例提供的电子设备的结构方框图。本申请中的电子设备可以包括一个或多个如下部件:处理器110、存储器120、输入装置130、输出装置140和总线150。处理器110、存储器120、输入装置130和输出装置140之间可以通过总线150连接。Please refer to FIG. 13 , which shows a structural block diagram of an electronic device provided by an exemplary embodiment of the present application. An electronic device in this application may include one or more of the following components: a processor 110 , a memory 120 , an input device 130 , an output device 140 and a bus 150 . The processor 110 , the memory 120 , the input device 130 and the output device 140 may be connected through a bus 150 .
处理器110可以包括一个或者多个处理核心。处理器110利用各种接口和线路连接整个电子设备内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(digital signal processing,DSP)、现场可编程门阵列(field-programmable gate array,FPGA)、可编程逻辑阵列(programmable logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(central processing unit,CPU)、图像处理器(graphics processing unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts in the entire electronic device, and executes the electronic device by running or executing the instructions, programs, code sets or instruction sets stored in the memory 120, and calling the data stored in the memory 120. Various functions of the device 100 and processing data. Optionally, the processor 110 may adopt at least one of digital signal processing (digital signal processing, DSP), field-programmable gate array (field-programmable gate array, FPGA), and programmable logic array (programmable logic Array, PLA). A hardware form is implemented. The processor 110 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like. Among them, the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used for rendering and drawing of the display content; the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may also not be integrated into the processor 110, and is implemented by a communication chip alone.
存储器120可以包括随机存储器(random Access Memory,RAM),也可以包括只读存储器(read-only memory,ROM)。可选地,该存储器120包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等,该操作系统可以是安卓(Android)系统,包括基于Android系统深度开发的系统、苹果公司开发的IOS系统,包括基于IOS系统深度开发的系统或其它系统。存储数据区还可以存储电子设备在使用中所创建的数据比如电话本、音视频数据、聊天记录数据,等。The memory 120 may include random access memory (RAM), or may include read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. Memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, etc., the operating system can be an Android (Android) system, including a system based on the deep development of the Android system, an IOS system developed by Apple, including a system based on the deep development of the IOS system or other systems. The storage data area can also store data created by the electronic device in use, such as a phone book, audio and video data, chat record data, and the like.
参见图14所示,存储器120可分为操作系统空间和用户空间,操作系统即运行于操作系统空间,原生及第三方应用程序即运行于用户空间。为了保证不同第三方应用程序均能够达到较好的运行效果,操作系统针对不同第三方应用程序为其分配相应的系统资源。然而,同一第三方应用程序中不同应用场景对系统资源的需求也存在差异,比如,在本地资源加载场景下,第三方应用程序对磁盘读取速度的要求较高;在动画渲染场景下,第三方应用程序则对GPU性能的要求较高。而操作系统与第三方应用程序之间相互独立,操作系统往往不能及时感知第三方应用程序当前的应用场景,导致操作系统无法根据第三方应用程序的具体应用场景进行针对性的系统资源适配。Referring to FIG. 14 , the memory 120 can be divided into an operating system space and a user space, the operating system runs in the operating system space, and the native and third-party applications run in the user space. In order to ensure that different third-party applications can achieve better running effects, the operating system allocates corresponding system resources to different third-party applications. However, different application scenarios in the same third-party application also have different requirements for system resources. For example, in the local resource loading scenario, the third-party application has higher requirements on the disk read speed; in the animation rendering scenario, the first Third-party applications have higher requirements on GPU performance. The operating system and the third-party application are independent of each other, and the operating system often cannot perceive the current application scenario of the third-party application in time, so that the operating system cannot perform targeted system resource adaptation according to the specific application scenario of the third-party application.
为了使操作系统能够区分第三方应用程序的具体应用场景,需要打通第三方应用程序与操作系统之间的数据通信,使得操作系统能够随时获取第三方应用程序当前的场景信息,进而基于当前场景进行针对性的系统资源适配。In order to enable the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up the data communication between the third-party application and the operating system, so that the operating system can obtain the current scene information of the third-party application at any time, and then perform the operation based on the current scene. Targeted system resource adaptation.
以操作系统为Android系统为例,存储器120中存储的程序和数据如图15所示,存储器120中可存储有Linux内核层320、系统运行时库层340、应用框架层360和应用层380,其中,Linux内核层320、系统运行库层340和应用框架层360属于操作系统空间,应用层380属于用户空间。Linux内核层320为电子设备的各种硬件提供了底层的驱动,如显示驱动、音频驱动、摄像头驱动、蓝牙驱动、Wi-Fi驱动、电源管理等。系统运行库层340通过一些C/C++库来为Android系统提供了主要的特性支持。如SQLite库提供了数据库的支持,OpenGL/ES库提供了3D绘图的支持,Webkit库提供了浏览器内核的支持等。在系统运行时库层340中还提供有安卓运行时库(Android runtime),它主要提供了一些核心库,能够允许开发者使用Java语言来编写Android应用。应用框架层360提供了构建应用程序时可能用到的各种API,开发者也可以通过使用这些API来构建自己的应用程序,比如活动管理、窗口管理、视图管理、通知管理、内容提供者、包管理、通话管理、资源管理、定位管理。应用层380中运行有至少一个应用程序,这些应用程序可以是操作系统自带的原生应用程序,比如联系人程序、短信程序、时钟程序、相机应用等;也可以是第三方开发者所开发的第三方应用程序,比如游戏类应用程序、即时通信程序、相片美化程序、姿态校准程序等。Taking the Android system as the operating system as an example, the programs and data stored in the memory 120 are shown in FIG. 15 . The memory 120 may store the Linux kernel layer 320, the system runtime library layer 340, the application framework layer 360 and the application layer 380, Among them, the Linux kernel layer 320, the system runtime layer 340 and the application framework layer 360 belong to the operating system space, and the application layer 380 belongs to the user space. The Linux kernel layer 320 provides underlying drivers for various hardwares of electronic devices, such as display drivers, audio drivers, camera drivers, Bluetooth drivers, Wi-Fi drivers, power management and the like. The system runtime layer 340 provides main feature support for the Android system through some C/C++ libraries. For example, the SQLite library provides database support, the OpenGL/ES library provides 3D drawing support, and the Webkit library provides browser kernel support. An Android runtime library (Android runtime) is also provided in the system runtime library layer 340, which mainly provides some core libraries, which can allow developers to use the Java language to write Android applications. The application framework layer 360 provides various APIs that may be used when building applications. Developers can also build their own applications by using these APIs, such as activity management, window management, view management, notification management, content provider, Package management, call management, resource management, location management. There is at least one application running in the application layer 380, and these applications may be native applications that come with the operating system, such as contact programs, SMS programs, clock programs, camera applications, etc.; they may also be developed by third-party developers Third-party applications, such as game applications, instant messaging programs, photo enhancement programs, posture calibration programs, etc.
以操作系统为IOS系统为例,存储器120中存储的程序和数据如图16所示,IOS系统包括:核心操作系统层420(Core OS layer)、核心服务层440(Core Services layer)、媒体层460(Media layer)、可触摸层480(CocoaTouch Layer)。核心操作系统层420包括了操作系统内核、驱动程序以及底层程序框架,这些底层程序框架提供更接近硬件的功能,以供位于核心服务层440的程序框架所使用。核心服务层440提供给应用程序所需要的系统服务和/或程序框架,比如基础(Foundation)框架、账户框架、广告框架、数据存储框架、网络连接框架、地理位置框架、运动框架等等。媒体层460为应用程序提供有关视听方面的接口,如图形图像相关的接口、音频技术相关的接口、视频技术相关的接口、音视频传输技术的无线播放(AirPlay)接口等。可触摸层480为应用程序开发提供了各种常用的界面相关的框架,可触摸层480负责用户在电子设备上的触摸交互操作。比如本地通知服务、远程推送服务、广告框架、游戏工具框架、消息用户界面接口(User Interface,UI)框架、用户界面UIKit框架、地图框架等等。Taking the operating system as the IOS system as an example, the programs and data stored in the memory 120 are shown in FIG. 16 . The IOS system includes: a core operating system layer 420 (Core OS layer), a core service layer 440 (Core Services layer), a media layer 460 (Media layer), touchable layer 480 (CocoaTouch Layer). The core operating system layer 420 includes the operating system kernel, drivers, and low-level program frameworks, which provide functions closer to hardware for use by the program frameworks located in the core service layer 440 . The core service layer 440 provides system services and/or program frameworks required by application programs, such as a foundation framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a motion framework, and the like. The media layer 460 provides audiovisual interfaces for applications, such as graphics and image related interfaces, audio technology related interfaces, video technology related interfaces, and audio and video transmission technology wireless playback (AirPlay) interfaces. The touchable layer 480 provides various common interface-related frameworks for application development, and the touchable layer 480 is responsible for the user's touch interaction operation on the electronic device. Such as local notification service, remote push service, advertising framework, game tool framework, message user interface interface (User Interface, UI) framework, user interface UIKit framework, map framework and so on.
在图16所示出的框架中,与大部分应用程序有关的框架包括但不限于:核心服务层440中的基础框架和可触摸层480中的UIKit框架。基础框架提供许多基本的对象类和数据类型,为所有应用程序提供最基本的系统服务,和UI无关。而UIKit框架提供的类是基础的UI类库,用于创建基于触摸的用户界面,iOS应用程序可以基于UIKit框架来提供UI,所以它提供了应用程序的基础架构,用于构建用户界面,绘图、处理和用户交互事件,响应手势等等。Among the frameworks shown in FIG. 16 , the frameworks related to most applications include but are not limited to: the basic framework in the core service layer 440 and the UIKit framework in the touchable layer 480 . The basic framework provides many basic object classes and data types, and provides the most basic system services for all applications, regardless of UI. The classes provided by the UIKit framework are the basic UI class libraries for creating touch-based user interfaces. iOS applications can provide UI based on the UIKit framework, so it provides the application's infrastructure for building user interfaces, drawing , handling and user interaction events, responding to gestures, and more.
其中,在IOS系统中实现第三方应用程序与操作系统数据通信的方式以及原理可参考Android系统,本申请在此不再赘述。The method and principle of implementing data communication between a third-party application and an operating system in the IOS system may refer to the Android system, which will not be repeated in this application.
其中,输入装置130用于接收输入的指令或数据,输入装置130包括但不限于键盘、鼠标、摄像头、麦克风或触控设备。输出装置140用于输出指令或数据,输出装置140包括但不限于显示设备和扬声器等。在一个示例中,输入装置130和输出装置140可以合设,输入装置130和输出装置140为触摸显示屏,该触摸显示屏用于接收用户使用手指、触摸笔等任何适合的物体在其上或附近的触摸操作,以及显示各个应用程序的用户界面。触摸显示屏通常设置在电子设备的前面板。触摸显示屏可被设计成为全面屏、曲面屏或异型屏。触摸显示屏还可被设计成为全面屏与曲面屏的结合,异型屏与曲面屏的结合,本申请实施例对此不加以限定。The input device 130 is used for receiving input instructions or data, and the input device 130 includes but is not limited to a keyboard, a mouse, a camera, a microphone or a touch device. The output device 140 is used for outputting instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be co-located, and the input device 130 and the output device 140 are a touch display screen, the touch display screen is used to receive any suitable objects such as a user's finger, a touch pen, etc. Nearby touch actions, as well as displaying the user interface of each application. The touch display is usually provided on the front panel of the electronic device. The touch screen can be designed as a full screen, a curved screen or a special-shaped screen. The touch display screen can also be designed to be a combination of a full screen and a curved screen, or a combination of a special-shaped screen and a curved screen, which is not limited in the embodiments of the present application.
除此之外,本领域技术人员可以理解,上述附图所示出的电子设备的结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。比如,电子设备中还包括射频电路、输入单元、传感器、音频电路、无线保真(wireless fidelity,WiFi)模块、电源、蓝牙模块等部件,在此不再赘述。In addition, those skilled in the art can understand that the structure of the electronic device shown in the above drawings does not constitute a limitation to the electronic device, and the electronic device may include more or less components than those shown in the drawings, or a combination of certain components may be included. some components, or a different arrangement of components. For example, the electronic device also includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, and a Bluetooth module, which will not be repeated here.
在本申请实施例中,各步骤的执行主体可以是上文介绍的电子设备。可选地,各步骤的执行主体为电子设备的操作系统。操作系统可以是安卓系统,也可以是IOS系统,或者其它操作系统,本申请实施例对此不作限定。In this embodiment of the present application, the execution body of each step may be the electronic device described above. Optionally, the execution subject of each step is an operating system of the electronic device. The operating system may be an Android system, an IOS system, or other operating systems, which are not limited in this embodiment of the present application.
本申请实施例的电子设备,其上还可以安装有显示设备,显示设备可以是各种能实现显示功能的设备,例如:阴极射线管显示器(cathode ray tubedisplay,简称CR)、发光二极管显示器(light-emitting diode display,简称LED)、电子墨水屏、液晶显示屏(liquid crystal display,简称LCD)、等离子显示面板(plasma display panel,简称PDP)等。用户可以利用电子设备101上的显示设备,来查看显示的文字、图像、视频等信息。所述电子设备可以是智能手机、平板电脑、游戏设备、AR(Augmented Reality,增强现实)设备、汽车、数据存储装置、音频播放装置、视频播放装置、笔记本、桌面计算设备、可穿戴设备诸如电子手表、电子眼镜、电子头盔、电子手链、电子项链、电子衣物等设备。The electronic device according to the embodiment of the present application may also have a display device installed thereon, and the display device may be various devices that can realize a display function, such as a cathode ray tube display (Cathode ray tube display, CR for short), a light emitting diode display (light emitting diode display). - emitting diode display, referred to as LED), electronic ink screen, liquid crystal display (liquid crystal display, referred to as LCD), plasma display panel (plasma display panel, referred to as PDP) and so on. The user can use the display device on the electronic device 101 to view the displayed text, image, video and other information. The electronic device may be a smart phone, a tablet computer, a gaming device, an AR (Augmented Reality) device, a car, a data storage device, an audio playback device, a video playback device, a notebook, a desktop computing device, a wearable device such as an electronic device. Watches, electronic glasses, electronic helmets, electronic bracelets, electronic necklaces, electronic clothing and other equipment.
在图13所示的电子设备中,其中电子设备可以是一种终端,处理器110可以用于调用存储器120中存储的姿态校准应用程序,并具体执行以下操作:In the electronic device shown in FIG. 13 , where the electronic device may be a terminal, the processor 110 may be used to invoke the attitude calibration application program stored in the memory 120, and specifically perform the following operations:
确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态在所述第一坐标系下的参考姿态数据;determining the first gravitational acceleration data under the first coordinate system corresponding to the current attitude, and determining the reference attitude data of the current attitude under the first coordinate system;
基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系为所述终端处于固定姿态时构建的载体坐标系;Determine a coordinate system conversion formula for converting from the first coordinate system to a second coordinate system based on the first gravitational acceleration data, where the second coordinate system is a carrier coordinate system constructed when the terminal is in a fixed attitude;
根据所述坐标系转换式对所述参考姿态数据进行校准处理,确定在所述第二坐标系下的目标姿态数据。The reference attitude data is calibrated according to the coordinate system conversion formula, and the target attitude data in the second coordinate system is determined.
在一个实施例中,所述处理器110在执行所述基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式时,具体执行以下操作:In one embodiment, when the processor 110 executes the determining, based on the first gravitational acceleration data, a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system, the processor 110 specifically performs the following operations:
获取重力加速度在所述第二坐标系下的第二重力加速度数据;acquiring the second gravitational acceleration data of the gravitational acceleration in the second coordinate system;
基于所述第一重力加速度数据以及所述第二重力加速度数据,确定坐标系旋转角以及坐标系旋转轴;determining a coordinate system rotation angle and a coordinate system rotation axis based on the first gravitational acceleration data and the second gravitational acceleration data;
构建从所述第一坐标系转换至第二坐标系的初始转换式,根据所述坐标系旋转角以及所述坐标系旋转轴对所述初始转换式进行计算,得到坐标系转换式。An initial conversion formula for converting from the first coordinate system to the second coordinate system is constructed, and the initial conversion formula is calculated according to the rotation angle of the coordinate system and the rotation axis of the coordinate system to obtain the coordinate system conversion formula.
在一个实施例中,所述处理器110在执行所述基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式时,具体执行以下操作:In one embodiment, when the processor 110 executes the determining, based on the first gravitational acceleration data, a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system, the processor 110 specifically performs the following operations:
将所述第一重力加速度数据映射至所述第一坐标系下的第一基准面,得到第一重力分量;mapping the first gravitational acceleration data to the first reference plane under the first coordinate system to obtain a first gravitational component;
构建从所述第一坐标系转换至第二坐标系的初始转换式,并获取重力加速度在第二坐标系下的第二基准面中的第二重力分量;constructing an initial conversion formula from the first coordinate system to the second coordinate system, and obtaining the second gravity component of the gravitational acceleration in the second reference plane under the second coordinate system;
基于所述第一重力分量与所述第二重力分量的数据转换关系、参考坐标基对应的向量模为预设固定值以及所述参考坐标基对应的向量夹角为预设角度值,对所述初始转换式进行计算,得到坐标系转换式,其中,所述参考坐标基为所述第一坐标系下对应的基向量。Based on the data conversion relationship between the first gravity component and the second gravity component, the vector modulus corresponding to the reference coordinate base is a preset fixed value, and the vector angle corresponding to the reference coordinate base is a preset angle value, The initial conversion formula is calculated to obtain the coordinate system conversion formula, wherein the reference coordinate base is the corresponding base vector in the first coordinate system.
在一个实施例中,所述处理器110在执行所述方法还包括:In one embodiment, the processor 110 further includes:
确定所述第一重力加速度数据在所述第一坐标系对应的预设基准面中的参考向量模;determining the reference vector modulus of the first gravitational acceleration data in the preset reference plane corresponding to the first coordinate system;
当所述参考向量模与目标值不一致时,执行所述基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式的步骤。When the reference vector modulus is inconsistent with the target value, the step of determining a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system based on the first gravitational acceleration data is performed.
在一个实施例中,所述处理器110在执行所述姿态校准方法还包括:In one embodiment, when the processor 110 executes the attitude calibration method, the method further includes:
当所述参考向量模为目标值时,对所述参考姿态数据所对应的第一坐标值和第二坐标值进行坐标数值交换处理,得到在所述第二坐标系下的目标姿态数据。When the reference vector modulus is the target value, coordinate value exchange processing is performed on the first coordinate value and the second coordinate value corresponding to the reference attitude data to obtain the target attitude data in the second coordinate system.
在一个实施例中,所述处理器110在执行所述对所述参考姿态数据所对应的第一坐标值和第二坐标值进行坐标数值交换处理,得到在所述第二坐标系下的目标姿态数据时,具体执行以下操作:In one embodiment, the processor 110 executes the coordinate value exchange process on the first coordinate value and the second coordinate value corresponding to the reference attitude data to obtain the target in the second coordinate system Attitude data, specifically perform the following operations:
所述参考姿态数据包含所述第一坐标系下的第一坐标值、第二坐标值以及第三坐标值;The reference attitude data includes a first coordinate value, a second coordinate value and a third coordinate value in the first coordinate system;
基于所述第一坐标值的数值确定第二目标值以及基于所述第二坐标值确定第一目标值,得到在所述第二坐标系下的目标姿态数据,所述目标姿态数据包括所述第一目标值、所述第二目标值以及第三坐标 值。The second target value is determined based on the numerical value of the first coordinate value and the first target value is determined based on the second coordinate value, so as to obtain target attitude data in the second coordinate system, where the target attitude data includes the the first target value, the second target value and the third coordinate value.
在一个实施例中,所述处理器110在执行所述确定当前姿态对应的第一坐标系下的第一重力加速度数据时,具体执行以下操作:In one embodiment, when the processor 110 performs the determining of the first gravitational acceleration data in the first coordinate system corresponding to the current posture, the processor 110 specifically performs the following operations:
获取当前姿态对应的第一坐标系下的加速度数据,对所述加速度数据进行数据滤波处理,得到第一重力加速度数据。Acquire acceleration data in the first coordinate system corresponding to the current posture, and perform data filtering processing on the acceleration data to obtain first gravitational acceleration data.
在一个实施例中,所述处理器110在执行所述根据所述坐标系转换式对所述参考姿态数据进行校准处理,确定在所述第二坐标系下的目标姿态数据时,具体执行以下步骤:In one embodiment, when the processor 110 performs the calibration process on the reference attitude data according to the coordinate system conversion formula and determines the target attitude data in the second coordinate system, the processor 110 specifically performs the following steps: step:
计算所述参考姿态数据与所述坐标系转换式的积,得到所述参考姿态数据在所述第二坐标系下的目标姿态数据。Calculate the product of the reference attitude data and the coordinate system conversion formula to obtain target attitude data of the reference attitude data in the second coordinate system.
在本申请实施例中,终端通过确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态对应的第一坐标系下的参考姿态数据,基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系通常为所述终端处于固定姿态时构建的载体坐标系;根据确定的坐标系转换式对所述参考姿态数据进行校准处理,可以确定在所述第二坐标系下的目标姿态数据。从而在使用终端的过程中,实现对终端的姿态进行自适应校正,以消除终端姿态变化导致的姿态数据准确性不高的影响,降低获取到的姿态数据的误差;以及基于终端处于固定姿态时构建的载体坐标系结合重力加速度的变化情况来进行姿态校准,相对于相关技术中涉及的大地坐标系、地理坐标系、多载体坐标系等方案可以大幅减小姿态校准过程中的计算量,提高姿态校准的处理效率,可以有效描述由于诸如手势交互等姿态变化场景下终端的姿态变化过程,最终确定的姿态数据不受设备姿态变化、设备所处方位、地理位置等环境的限制;以及利用重力加速度来进行坐标系转换,重力加速度获取简单,通常重力加速度采样率较高,适合实际应用场景下的实时处理;通过重力加速度向量的变化来计算旋转矩阵,实现简单、计算快速。In this embodiment of the present application, the terminal determines the first gravitational acceleration data in the first coordinate system corresponding to the current attitude and determines the reference attitude data in the first coordinate system corresponding to the current attitude, based on the first gravity The acceleration data determines the coordinate system conversion formula from the first coordinate system to the second coordinate system, and the second coordinate system is usually the carrier coordinate system constructed when the terminal is in a fixed posture; according to the determined coordinate system conversion formula By performing calibration processing on the reference attitude data, the target attitude data in the second coordinate system can be determined. Therefore, in the process of using the terminal, the attitude of the terminal is adaptively corrected, so as to eliminate the influence of the low accuracy of the attitude data caused by the change of the terminal attitude, and reduce the error of the acquired attitude data; The constructed carrier coordinate system combines the change of gravitational acceleration to perform attitude calibration. Compared with the geodetic coordinate system, geographic coordinate system, multi-carrier coordinate system and other schemes involved in related technologies, the calculation amount in the attitude calibration process can be greatly reduced, and the increase of The processing efficiency of attitude calibration can effectively describe the attitude change process of the terminal due to gesture changes such as gesture interaction, and the final attitude data is not limited by the equipment attitude change, device location, geographic location and other environments; and the use of gravity Acceleration is used to convert the coordinate system, the gravitational acceleration is easy to obtain, and the sampling rate of gravitational acceleration is usually high, which is suitable for real-time processing in practical application scenarios; the rotation matrix is calculated by the change of the gravitational acceleration vector, which is simple and fast to calculate.
本领域的技术人员可以清楚地了解到本申请的技术方案可借助软件和/或硬件来实现。本说明书中的“单元”和“模块”是指能够独立完成或与其他部件配合完成特定功能的软件和/或硬件,其中硬件例如可以是现场可编程门阵列(Field-ProgrammaBLE Gate Array,FPGA)、集成电路(Integrated Circuit,IC)等。Those skilled in the art can clearly understand that the technical solutions of the present application can be implemented by means of software and/or hardware. The "unit" and "module" in this specification refer to software and/or hardware that can perform a specific function independently or in cooperation with other components, wherein the hardware can be, for example, a Field-Programmable Gate Array (FPGA) , Integrated Circuit (IC), etc.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that, for the sake of simple description, the foregoing method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Because in accordance with the present application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些服务接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some service interfaces, indirect coupling or communication connection of devices or units, and may be in electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个 计算机可读取存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented as a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable memory. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art, or all or part of the technical solution, and the computer software product is stored in a memory, Several instructions are included to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通进程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: flash memory disk, read-only memory (Read-Only Memory, ROM), random access device (Random Access Memory, RAM), magnetic disk or optical disk, etc.
以上所述者,仅为本公开的示例性实施例,不能以此限定本公开的范围。即但凡依本公开教导所作的等效变化与修饰,皆仍属本公开涵盖的范围内。本领域技术人员在考虑说明书及实践这里的公开后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未记载的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的范围和精神由权利要求限定。The above descriptions are merely exemplary embodiments of the present disclosure, which cannot limit the scope of the present disclosure. That is, all equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. Other embodiments of the present disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or conventional techniques in the art not described in this disclosure . The specification and examples are to be regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

Claims (20)

  1. 一种姿态校准方法,所述方法包括:An attitude calibration method, the method includes:
    确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态在所述第一坐标系下的参考姿态数据;determining the first gravitational acceleration data under the first coordinate system corresponding to the current attitude, and determining the reference attitude data of the current attitude under the first coordinate system;
    基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系为所述终端处于固定姿态时构建的载体坐标系;Determine a coordinate system conversion formula for converting from the first coordinate system to a second coordinate system based on the first gravitational acceleration data, where the second coordinate system is a carrier coordinate system constructed when the terminal is in a fixed attitude;
    根据所述坐标系转换式对所述参考姿态数据进行校准处理,确定在所述第二坐标系下的目标姿态数据。The reference attitude data is calibrated according to the coordinate system conversion formula, and the target attitude data in the second coordinate system is determined.
  2. 根据权利要求1所述的方法,所述基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,包括:The method according to claim 1, wherein determining a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system based on the first gravitational acceleration data, comprising:
    获取重力加速度在所述第二坐标系下的第二重力加速度数据;acquiring the second gravitational acceleration data of the gravitational acceleration in the second coordinate system;
    基于所述第一重力加速度数据以及所述第二重力加速度数据,确定坐标系旋转角以及坐标系旋转轴;determining a coordinate system rotation angle and a coordinate system rotation axis based on the first gravitational acceleration data and the second gravitational acceleration data;
    构建从所述第一坐标系转换至第二坐标系的初始转换式,根据所述坐标系旋转角以及所述坐标系旋转轴对所述初始转换式进行计算,得到坐标系转换式。An initial conversion formula for converting from the first coordinate system to the second coordinate system is constructed, and the initial conversion formula is calculated according to the rotation angle of the coordinate system and the rotation axis of the coordinate system to obtain the coordinate system conversion formula.
  3. 根据权利要求1所述的方法,所述基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,包括:The method according to claim 1, wherein determining a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system based on the first gravitational acceleration data, comprising:
    将所述第一重力加速度数据映射至所述第一坐标系下的第一基准面,得到第一重力分量;mapping the first gravitational acceleration data to the first reference plane under the first coordinate system to obtain a first gravitational component;
    构建从所述第一坐标系转换至第二坐标系的初始转换式,并获取重力加速度在第二坐标系下的第二基准面中的第二重力分量;constructing an initial conversion formula from the first coordinate system to the second coordinate system, and obtaining the second gravity component of the gravitational acceleration in the second reference plane under the second coordinate system;
    基于所述第一重力分量与所述第二重力分量的数据转换关系、参考坐标基对应的向量模为预设固定值以及所述参考坐标基对应的向量夹角为预设角度值,对所述初始转换式进行计算,得到坐标系转换式,其中,所述参考坐标基为所述第一坐标系下对应的基向量。Based on the data conversion relationship between the first gravity component and the second gravity component, the vector modulus corresponding to the reference coordinate base is a preset fixed value, and the vector angle corresponding to the reference coordinate base is a preset angle value, The initial conversion formula is calculated to obtain the coordinate system conversion formula, wherein the reference coordinate base is the corresponding base vector in the first coordinate system.
  4. 根据权利要求3所述的方法,所述将所述第一重力加速度数据映射至所述第一坐标系下的第一基准面之前,还包括:The method according to claim 3, before the mapping the first gravitational acceleration data to the first reference plane under the first coordinate system, further comprising:
    确定当前的目标姿态校准场景,基于至少一个姿态校准场景与参考基准面的映射关系获取所述目标姿态校准场景对应的第一基准面。A current target posture calibration scene is determined, and a first reference plane corresponding to the target posture calibration scene is acquired based on a mapping relationship between at least one posture calibration scene and a reference datum plane.
  5. 根据权利要求4所述的方法,所述确定当前的目标姿态校准场景,包括:The method according to claim 4, said determining the current target attitude calibration scene, comprising:
    获取当前触发或开启的功能模式,基于所述功能模式确定目标姿态校准场景。The currently triggered or enabled functional mode is acquired, and the target attitude calibration scene is determined based on the functional mode.
  6. 根据权利要求1所述的方法,所述方法还包括:The method of claim 1, further comprising:
    确定所述第一重力加速度数据在所述第一坐标系对应的预设基准面中的参考向量模;determining the reference vector modulus of the first gravitational acceleration data in the preset reference plane corresponding to the first coordinate system;
    当所述参考向量模与目标值不一致时,执行所述基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式的步骤。When the reference vector modulus is inconsistent with the target value, the step of determining a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system based on the first gravitational acceleration data is performed.
  7. 根据权利要求6所述的方法,所述方法还包括:The method of claim 6, further comprising:
    当所述参考向量模与目标值一致时,对所述参考姿态数据所对应的第一坐标值和第二坐标值进行坐标数值交换处理,得到在所述第二坐标系下的目标姿态数据。When the reference vector modulus is consistent with the target value, a coordinate value exchange process is performed on the first coordinate value and the second coordinate value corresponding to the reference attitude data to obtain the target attitude data in the second coordinate system.
  8. 根据权利要求7所述的方法,所述对所述参考姿态数据所对应的第一坐标值和第二坐标值进行坐标数值交换处理,得到在所述第二坐标系下的目标姿态数据,包括:The method according to claim 7, wherein the coordinate value exchange processing is performed on the first coordinate value and the second coordinate value corresponding to the reference attitude data to obtain the target attitude data in the second coordinate system, comprising: :
    所述参考姿态数据包含所述第一坐标系下的第一坐标值、第二坐标值以及第三坐标值;The reference attitude data includes a first coordinate value, a second coordinate value and a third coordinate value in the first coordinate system;
    基于所述第一坐标值的数值确定第二目标值以及基于所述第二坐标值确定第一目标值,得到在所述第二坐标系下的目标姿态数据,所述目标姿态数据包括所述第一目标值、所述第二目标值以及第三坐标值。The second target value is determined based on the numerical value of the first coordinate value and the first target value is determined based on the second coordinate value, so as to obtain target attitude data in the second coordinate system, where the target attitude data includes the the first target value, the second target value and the third coordinate value.
  9. 根据权利要求1所述的方法,所述确定当前姿态对应的第一坐标系下的第一重力加速度数据,包括:The method according to claim 1, said determining the first gravitational acceleration data in the first coordinate system corresponding to the current attitude, comprising:
    获取当前姿态对应的第一坐标系下的加速度数据,对所述加速度数据进行数据滤波处理,得到第一重力加速度数据。Acquire acceleration data in the first coordinate system corresponding to the current posture, and perform data filtering processing on the acceleration data to obtain first gravitational acceleration data.
  10. 根据权利要求1所述的方法,所述根据所述坐标系转换式对所述参考姿态数据进行校准处理,确定在所述第二坐标系下的目标姿态数据,包括:The method according to claim 1, wherein the calibration process is performed on the reference attitude data according to the coordinate system conversion formula, and the target attitude data in the second coordinate system is determined, comprising:
    计算所述参考姿态数据与所述坐标系转换式的积,得到所述参考姿态数据在所述第二坐标系下的目标姿态数据。Calculate the product of the reference attitude data and the coordinate system conversion formula to obtain target attitude data of the reference attitude data in the second coordinate system.
  11. 一种姿态校准装置,所述装置包括:An attitude calibration device, the device includes:
    数据确定模块,用于确定当前姿态对应的第一坐标系下的第一重力加速度数据,和确定所述当前姿态在所述第一坐标系下的参考姿态数据;a data determination module, configured to determine the first gravitational acceleration data under the first coordinate system corresponding to the current attitude, and determine the reference attitude data of the current attitude under the first coordinate system;
    数据转换模块,用于基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式,所述第二坐标系为所述终端处于固定姿态时构建的载体坐标系;A data conversion module, configured to determine a coordinate system conversion formula for converting from the first coordinate system to a second coordinate system based on the first gravitational acceleration data, where the second coordinate system is constructed when the terminal is in a fixed posture carrier coordinate system;
    数据校准模块,用于根据所述坐标系转换式对所述参考姿态数据进行校准处理,确定在所述第二坐标系下的目标姿态数据。A data calibration module, configured to perform calibration processing on the reference attitude data according to the coordinate system conversion formula, and determine the target attitude data in the second coordinate system.
  12. 根据权利要求11所述的装置,所述数据转换模块,包括:数据获取单元,用于获取重力加速度在所述第二坐标系下的第二重力加速度数据;旋转数据确定单元,用于基于所述第一重力加速度数据以及所述第二重力加速度数据,确定坐标系旋转角以及坐标系旋转轴;转换矩阵确定单元,用于构建从所述第一坐标系转换至第二坐标系的初始转换式,根据所述坐标系旋转角以及所述坐标系旋转轴对所述初始转换式进行计算,得到坐标系转换式。The device according to claim 11, wherein the data conversion module comprises: a data acquisition unit for acquiring second gravitational acceleration data of the gravitational acceleration in the second coordinate system; a rotation data determination unit for The first gravitational acceleration data and the second gravitational acceleration data are used to determine the rotation angle of the coordinate system and the rotation axis of the coordinate system; the conversion matrix determination unit is used to construct the initial conversion from the first coordinate system to the second coordinate system. formula, the initial conversion formula is calculated according to the coordinate system rotation angle and the coordinate system rotation axis to obtain the coordinate system conversion formula.
  13. 根据权利要求11所述的装置,所述数据转换模块,包括:所述数据获取单元,还用于将所述第一重力加速度数据映射至所述第一坐标系下的第一基准面,得到第一重力分量;所述数据获取单元,还用于构建从所述第一坐标系转换至第二坐标系的初始转换式,并获取重力加速度在第二坐标系下的第二基准面中的第二重力分量;The device according to claim 11, wherein the data conversion module comprises: the data acquisition unit, further configured to map the first gravitational acceleration data to a first reference plane under the first coordinate system, to obtain the first gravity component; the data acquisition unit is further configured to construct an initial conversion formula from the first coordinate system to the second coordinate system, and obtain the gravitational acceleration in the second reference plane under the second coordinate system the second gravity component;
    所述转换矩阵确定单元,还用于基于所述第一重力分量与所述第二重力分量的数据转换关系、参考坐标基对应的向量模为预设固定值以及所述参考坐标基对应的向量夹角为预设角度值,对所述初始转换式进行计算,得到坐标系转换式,其中,所述参考坐标基为所述第一坐标系下对应的基向量。The conversion matrix determining unit is further configured to be based on the data conversion relationship between the first gravity component and the second gravity component, the vector modulus corresponding to the reference coordinate base being a preset fixed value, and the vector corresponding to the reference coordinate base The included angle is a preset angle value, and the initial conversion formula is calculated to obtain a coordinate system conversion formula, wherein the reference coordinate base is a corresponding base vector in the first coordinate system.
  14. 根据权利要求11所述的装置,所述装置还包括:向量模计算模块,用于确定所述第一重力加速度数据在所述第一坐标系对应的预设基准面中的参考向量模;当所述参考向量模与目标值不一致时,所述数据转换模块执行所述基于所述第一重力加速度数据确定从所述第一坐标系转换至第二坐标系的坐标系转换式的步骤。The device according to claim 11, further comprising: a vector modulus calculation module, configured to determine a reference vector modulus of the first gravitational acceleration data in a preset reference plane corresponding to the first coordinate system; when When the reference vector modulus is inconsistent with the target value, the data conversion module executes the step of determining a coordinate system conversion formula for converting from the first coordinate system to the second coordinate system based on the first gravitational acceleration data.
  15. 根据权利要求14所述的装置,所述装置还包括:所述数据转换模块,还用于当所述参考向量模为目标值时,对所述参考姿态数据所对应的第一坐标值和第二坐标值进行坐标数值交换处理,得到在所述第二坐标系下的目标姿态数据。The apparatus according to claim 14, further comprising: the data conversion module, further configured to perform a conversion between the first coordinate value and the first coordinate value corresponding to the reference attitude data when the reference vector modulus is a target value The two coordinate values are subjected to coordinate value exchange processing to obtain the target attitude data in the second coordinate system.
  16. 根据权利要求15所述的装置,所述数据转换模块,还用于:所述参考姿态数据包含所述第一坐标系下的第一坐标值、第二坐标值以及第三坐标值;基于所述第一坐标值的数值确定第二目标值以及基于所述第二坐标值确定第一目标值,得到在所述第二坐标系下的目标姿态数据,所述目标姿态数据包括所述第一目标值、所述第二目标值以及第三坐标值。The device according to claim 15, wherein the data conversion module is further configured to: the reference attitude data includes a first coordinate value, a second coordinate value and a third coordinate value in the first coordinate system; The numerical value of the first coordinate value determines the second target value and the first target value is determined based on the second coordinate value, and the target attitude data under the second coordinate system is obtained, and the target attitude data includes the first target value. target value, the second target value and the third coordinate value.
  17. 根据权利要求11所述的装置,所述数据转换模块,还用于获取当前姿态对应的第一坐标系下的加速度数据,对所述加速度数据进行数据滤波处理,得到第一重力加速度数据。The device according to claim 11, wherein the data conversion module is further configured to acquire acceleration data in the first coordinate system corresponding to the current posture, and perform data filtering processing on the acceleration data to obtain the first gravitational acceleration data.
  18. 根据权利要求11所述的装置,所述装置,还用于:计算所述参考姿态数据与所述坐标系转换式的积,得到所述参考姿态数据在所述第二坐标系下的目标姿态数据。The apparatus according to claim 11, further configured to: calculate the product of the reference attitude data and the coordinate system conversion formula to obtain the target attitude of the reference attitude data in the second coordinate system data.
  19. 一种计算机存储介质,所述计算机存储介质存储有多条指令,所述指令适于由处理器加载并执行如权利要求1~10任意一项的方法步骤。A computer storage medium storing a plurality of instructions adapted to be loaded by a processor and perform the method steps of any one of claims 1-10.
  20. 一种电子设备,包括:处理器和存储器;其中,所述存储器存储有计算机程序,所述计算机程序适于由所述处理器加载并执行如权利要求1~10任意一项的方法步骤。An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and perform the method steps of any one of claims 1-10.
PCT/CN2022/072342 2021-03-30 2022-01-17 Attitude calibration method and apparatus, storage medium, and electronic device WO2022206127A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110344140.0A CN113091769A (en) 2021-03-30 2021-03-30 Attitude calibration method and device, storage medium and electronic equipment
CN202110344140.0 2021-03-30

Publications (1)

Publication Number Publication Date
WO2022206127A1 true WO2022206127A1 (en) 2022-10-06

Family

ID=76671489

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/072342 WO2022206127A1 (en) 2021-03-30 2022-01-17 Attitude calibration method and apparatus, storage medium, and electronic device

Country Status (2)

Country Link
CN (1) CN113091769A (en)
WO (1) WO2022206127A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113091769A (en) * 2021-03-30 2021-07-09 Oppo广东移动通信有限公司 Attitude calibration method and device, storage medium and electronic equipment
DE102022112930A1 (en) * 2022-05-23 2023-11-23 Gestigon Gmbh CAPTURE SYSTEM AND METHOD FOR COLLECTING CONTACTLESS DIRECTED USER INPUTS AND METHOD FOR CALIBRATION OF THE CAPTURE SYSTEM
CN116718196B (en) * 2023-08-09 2023-10-20 腾讯科技(深圳)有限公司 Navigation method, device, equipment and computer readable storage medium
CN117129956B (en) * 2023-10-27 2024-04-09 深圳绿米联创科技有限公司 Positioning correction method, device, detection equipment, computer equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120330497A1 (en) * 2010-12-24 2012-12-27 Claudio De Tommasi Method for calibrating inertial sensor installed in arbitrary position on board vehicle and sensor system of dynamics of vehicle able to be installed on board in arbitrary position
CN102997913A (en) * 2011-09-14 2013-03-27 意法半导体(中国)投资有限公司 Method and device for determining object posture
CN103917850A (en) * 2011-10-25 2014-07-09 中国人民解放军国防科学技术大学 Motion alignment method of inertial navigation system
CN105807094A (en) * 2016-05-06 2016-07-27 深圳市安智车米汽车信息化有限公司 First-order low-pass filtering calculation method and device
CN105823463A (en) * 2016-03-17 2016-08-03 广州展讯信息科技有限公司 Vehicle gesture measuring method and apparatus
US20170336208A1 (en) * 2016-05-20 2017-11-23 Site Sensing Inc. Attitude estimating device, attitude estimating method, and storage medium
CN108426584A (en) * 2017-02-14 2018-08-21 厦门雅迅网络股份有限公司 The calibration method of automobile multisensor
CN111289012A (en) * 2020-02-20 2020-06-16 北京邮电大学 Attitude calibration method and device for sensor
CN113091769A (en) * 2021-03-30 2021-07-09 Oppo广东移动通信有限公司 Attitude calibration method and device, storage medium and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108225368B (en) * 2016-12-22 2020-09-04 华为技术有限公司 Step counting device and step counting method
CN106643717A (en) * 2016-12-28 2017-05-10 北京奇艺世纪科技有限公司 Method and device for performance detection of nine-axis sensor
CN109242913B (en) * 2018-09-07 2020-11-10 百度在线网络技术(北京)有限公司 Method, device, equipment and medium for calibrating relative parameters of collector
CN110972112B (en) * 2019-12-10 2022-04-05 Oppo广东移动通信有限公司 Subway running direction determining method, device, terminal and storage medium
CN111240469B (en) * 2019-12-31 2023-04-25 北京诺亦腾科技有限公司 Calibration method and device for hand motion capture, electronic equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120330497A1 (en) * 2010-12-24 2012-12-27 Claudio De Tommasi Method for calibrating inertial sensor installed in arbitrary position on board vehicle and sensor system of dynamics of vehicle able to be installed on board in arbitrary position
CN102997913A (en) * 2011-09-14 2013-03-27 意法半导体(中国)投资有限公司 Method and device for determining object posture
CN103917850A (en) * 2011-10-25 2014-07-09 中国人民解放军国防科学技术大学 Motion alignment method of inertial navigation system
CN105823463A (en) * 2016-03-17 2016-08-03 广州展讯信息科技有限公司 Vehicle gesture measuring method and apparatus
CN105807094A (en) * 2016-05-06 2016-07-27 深圳市安智车米汽车信息化有限公司 First-order low-pass filtering calculation method and device
US20170336208A1 (en) * 2016-05-20 2017-11-23 Site Sensing Inc. Attitude estimating device, attitude estimating method, and storage medium
CN108426584A (en) * 2017-02-14 2018-08-21 厦门雅迅网络股份有限公司 The calibration method of automobile multisensor
CN111289012A (en) * 2020-02-20 2020-06-16 北京邮电大学 Attitude calibration method and device for sensor
CN113091769A (en) * 2021-03-30 2021-07-09 Oppo广东移动通信有限公司 Attitude calibration method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN113091769A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
WO2022206127A1 (en) Attitude calibration method and apparatus, storage medium, and electronic device
US9881353B2 (en) Buffers for display acceleration
US10019219B2 (en) Display device for displaying multiple screens and method for controlling the same
KR20180109229A (en) Method and apparatus for providing augmented reality function in electornic device
WO2019028912A1 (en) Application switching method and device
EP3721327B1 (en) Dynamic interaction adaptation of a digital inking device
CN110119305B (en) Task execution method and device, computer equipment and storage medium
CN111355888A (en) Video shooting method and device, storage medium and terminal
CN112788583B (en) Equipment searching method and device, storage medium and electronic equipment
WO2019071600A1 (en) Image processing method and apparatus
US10776979B2 (en) Virtual skeleton based on computing device capability profile
CN111127469A (en) Thumbnail display method, device, storage medium and terminal
WO2019095360A1 (en) Method and apparatus for handling menu in virtual scene, and storage medium
CN110968815A (en) Page refreshing method, device, terminal and storage medium
CN113055272B (en) Message reminding method and device based on dual systems and terminal equipment
CN112995562A (en) Camera calling method and device, storage medium and terminal
US11564069B2 (en) Recipient-based content optimization in a messaging system
CN113419650A (en) Data moving method and device, storage medium and electronic equipment
CN113449948B (en) Service processing method, device, electronic equipment and medium
CN114125048B (en) Message push setting method and device, storage medium and electronic equipment
CN115314588B (en) Background synchronization method, device, terminal, equipment, system and storage medium
CN113204283A (en) Text input method, text input device, storage medium and electronic equipment
CN115357112A (en) Vr remote education device based on 5G technology
CN118132174A (en) Cross-system content display method and device
CN117270675A (en) User virtual image loading method based on mixed reality remote collaborative environment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22778316

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22778316

Country of ref document: EP

Kind code of ref document: A1