A spatial attitude angle calculation method and device, electronic equipment and storage medium
By periodically acquiring system attitude information and calculating reference error information, and combining Kalman filtering and Euler angle calculation methods, the problems of high accuracy and high cost in surgical robot attitude detection are solved, and high-precision, low-cost attitude angle calculation is achieved.
Patent Information
- Application Number
- CN202510543377.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-04-28
AI Technical Summary
In the existing technology, the spatial posture detection of surgical robots requires high-precision and high-cost sensors, which leads to high production and maintenance costs of the detection system and insufficient detection accuracy.
By periodically acquiring the system attitude information of the target moving device, the reference state information and reference error information are determined. The target state information and target error information are calculated using acceleration data and angular velocity data. Kalman filtering and Euler angle calculation methods are used to reduce the accuracy requirements of the sensors and improve the accuracy of attitude angle calculation.
By reducing the accuracy requirements of sensors, high-precision detection of the spatial attitude angle of surgical robots was achieved, thereby reducing production and maintenance costs.
Smart Images

Figure CN120086478B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and in particular, to a spatial pose angle calculation method and device, electronic equipment and storage medium. BACKGROUND
[0002] With the development of technology, surgical robots are widely used in the field of medical treatment. Since the surgical robot usually needs to ensure the level of the base during use, and the deformation of the rod affects the pose of each link of the mechanical arm to a certain extent. Therefore, the change of the spatial pose of the surgical robot will affect the surgical process, and it is necessary to detect the spatial pose of each link and the base of the surgical robot in real time during the surgical process to compensate accordingly through the dynamics method and achieve good control effect. The detection of the related technology usually needs to use high-precision and expensive sensors, and the production and post-maintenance costs of the entire detection system are very high. SUMMARY
[0003] The present disclosure is dedicated to solving the deficiencies of the prior art and improving the accuracy of the detection result of the spatial pose.
[0004] According to a first aspect of the present disclosure, a spatial pose angle calculation method is provided, the method comprising:
[0005] Periodically acquiring system pose information of a target mobile device, the system pose information comprising acceleration data and angular velocity data;
[0006] Determining reference state information and reference error information of the current period, the reference state information being used to represent the spatial pose of the target mobile device at the beginning of the current period, and the reference error information being used to represent the error of the reference state information at the beginning of the current period;
[0007] According to the system pose information, the reference state information and the reference error information, calculating target state information and target error information of the current period;
[0008] According to the target state information, determining the spatial pose angle of the target mobile device in the current period.
[0009] In a possible implementation, the determination of the reference state information and the reference error information of the current period comprises:
[0010] In response to the current period being the first period, determining the reference state information of the current period according to the acceleration data collected in the current period;
[0011] Determining the preset initial error information as the reference error information of the current period.
[0012] In a possible implementation, the determining the reference state information and the reference error information of the current period comprises:
[0013] In response to the current period not being the first period, determining the target state information of the previous period as the reference state information of the current period;
[0014] Determining the target error information of the previous period as the reference error information of the current period.
[0015] In a possible implementation, the calculating the target state information and the target error information of the current period according to the system attitude information, the reference state information and the reference error information comprises:
[0016] According to the angular velocity data, the reference state information and the reference error information, calculating the target error information of the current period;
[0017] According to the acceleration data and the reference state information, determining a system measurement equation of the current period;
[0018] According to the system attitude information, the reference state information, the target error information and the system measurement equation, calculating the target state information of the current period.
[0019] In a possible implementation, the calculating the target error information of the current period according to the angular velocity data, the reference state information and the reference error information comprises:
[0020] According to the angular velocity data and the reference state information, calculating an intermediate state parameter;
[0021] According to the reference error information and the intermediate state parameter, calculating the target error information of the current period.
[0022] In a possible implementation, the calculating the target state information of the current period according to the system attitude information, the reference state information, the target error information and the system measurement equation comprises:
[0023] According to the reference state information, the target error information and the system measurement equation, calculating a corresponding Kalman gain matrix value;
[0024] According to the system attitude information, the Kalman gain matrix value, the reference state information and the system measurement equation, calculating the target state information of the current period.
[0025] In a possible implementation, the target state information comprises a quaternion for representing a spatial attitude of the target mobile device.
[0026] The space attitude angle of the target mobile device in the current period is determined according to the target state information, and the space attitude angle of the target mobile device in the current period is determined according to the target state information.
[0027] A first attitude cosine matrix is determined according to the quaternion in the target state information.
[0028] A second attitude cosine matrix is calculated according to the first attitude cosine matrix and a preset calibration error matrix.
[0029] Euler angles are solved according to the second attitude cosine matrix, and the space attitude angle of the target mobile device in the current period is obtained.
[0030] According to a second aspect of the present disclosure, a space attitude angle calculation device is provided, and the device comprises:
[0031] An information acquisition module is configured to periodically acquire system attitude information of a target mobile device, wherein the system attitude information comprises acceleration data and angular velocity data.
[0032] An information determination module is configured to determine reference state information and reference error information in a current period, wherein the reference state information is used to represent the space attitude of the target mobile device at the beginning of the current period, and the reference error information is used to represent the error of the reference state information at the beginning of the current period.
[0033] An information calculation module is configured to calculate target state information and target error information in the current period according to the system attitude information, the reference state information and the reference error information.
[0034] An attitude calculation module is configured to determine the space attitude angle of the target mobile device in the current period according to the target state information.
[0035] In a possible implementation, the information determination module is further configured to:
[0036] In response to the current period being a first period, the reference state information in the current period is determined according to the acceleration data acquired in the current period.
[0037] The preset initial error information is determined as the reference error information in the current period.
[0038] In a possible implementation, the information determination module is further configured to:
[0039] In response to the current period not being the first period, the target state information determined in the previous period is determined as the reference state information in the current period.
[0040] The target error information determined in the previous period is determined as the reference error information in the current period.
[0041] In a possible implementation, the information calculating module is further configured to calculate the target error information according to the angular velocity data, the reference state information and the reference error information.
[0042] determining a system measurement equation of a current period according to the acceleration data and the reference state information;
[0043] calculating target state information of the current period according to the system attitude information, the reference state information, the target error information and the system measurement equation.
[0044] In a possible implementation, the information calculating module is further configured to calculate an intermediate state parameter according to the angular velocity data and the reference state information.
[0045] calculating target error information of the current period according to the reference error information and the intermediate state parameter.
[0046] In a possible implementation, the information calculating module is further configured to:
[0047] calculating a corresponding Kalman gain matrix value according to the reference state information, the target error information and the system measurement equation;
[0048] calculating target state information of the current period according to the system attitude information, the Kalman gain matrix value, the reference state information and the system measurement equation.
[0049] In a possible implementation, the target state information includes a quaternion used to represent a spatial attitude of the target mobile device.
[0050] The attitude calculating module is further configured to:
[0051] determining a first attitude cosine matrix according to the quaternion in the target state information;
[0052] calculating a second attitude cosine matrix according to the first attitude cosine matrix and a preset calibration error matrix;
[0053] solving Euler angles according to the second attitude cosine matrix to obtain a spatial attitude angle of the target mobile device in the current period.
[0054] According to a third aspect of the present disclosure, an electronic device is provided, including a processor, a memory for storing processor-executable instructions, wherein the processor is configured to implement the above method when executing the instructions stored in the memory.
[0055] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the method described above.
[0056] According to a fifth aspect of the present disclosure, there is provided a computer program product comprising computer readable code, or a non-transitory computer-readable storage medium carrying computer readable code, which when run in a processor of an electronic device, the processor in the electronic device performs the method described above.
[0057] In the embodiments of the present disclosure, the spatial attitude angle can be periodically detected in real time through a simple calculation process, and reference state information and reference error information are introduced to assist the calculation in each period of detection process, so that the accuracy of the calculation result is improved in the case of low accuracy of the system attitude information.
[0058] Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the drawings. BRIEF DESCRIPTION OF DRAWINGS
[0059] The complete and enabling disclosure of the present application, including its best mode(s), will be more fully described in this specification, reference is made to the accompanying drawings, in which:
[0060] Figure 1 A flow chart of a spatial attitude angle calculation method provided by an embodiment of the present disclosure;
[0061] Figure 2 A schematic diagram of a spatial attitude angle calculation device provided by an embodiment of the present disclosure;
[0062] Figure 3 A schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0063] Reference will now be made in detail embodiments of the application, one or more examples of which are illustrated in the figures. Each example is provided by way of explanation of the application and is not meant as a limitation of the application. In fact, it will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the scope or spirit of the application. For instance, features illustrated or described as part of one embodiment, can be used with another embodiment to yield still a further embodiment. As used in the specification, the terms "first", "second", etc. are used an interchangeable to distinguish one component from another and are not meant to, nor should they be construed to, imply a location or an importance of individual components. As used in the specification, the terms "a", "an" and "the" are intended to represent one or more items, unless the context clearly indicates otherwise. The terms "includes", "including", "has", and "having" are intended to be inclusive and mean that there can be additional items.
[0064] Reference will now be made in detail embodiments of the application, one or more examples of which are illustrated in the figures. Each example is provided by way of explanation of the application and is not meant as a limitation of the application. In fact, it will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the scope or spirit of the application. For instance, features illustrated or described as part of one embodiment, can be used with another embodiment to yield still a further embodiment. As used in the specification, the terms "first", "second", etc. are used an interchangeable to distinguish one component from another and are not meant to, nor should they be construed to, imply a location or an importance of individual components. As used in the specification, the terms "a", "an" and "the" are intended to represent one or more items, unless the context clearly indicates otherwise. The terms "includes", "including", "has", and "having" are intended to be inclusive and mean that there can be additional items.
[0065] In a possible implementation, the spatial pose angle calculation method of the embodiments of the present disclosure can be executed by an electronic device such as a processor, a terminal device, or a server. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, and the like. The server can be a single server or a server cluster composed of multiple servers. The electronic device can implement the spatial pose angle calculation method of the embodiments of the present disclosure by calling computer readable instructions stored in a memory through a processor.
[0066] Figure 1 A flowchart of a spatial pose angle calculation method provided by the embodiments of the present disclosure is shown in FIG. 10. As shown in FIG. 10, the spatial pose angle calculation method of the embodiments of the present disclosure can include the following steps S10-S40. Figure 1
[0067] Step S10, periodically acquiring system pose information of a target mobile device.
[0068] In a possible implementation, the target mobile device can be any device capable of moving in any form, such as a mobile cart, a mechanical arm, or a robot, etc., which needs to detect the pose. During the working process of the target mobile device, the electronic device can periodically acquire the corresponding system pose information of the target mobile device. The system pose information can include acceleration data and angular velocity data, which are used to represent the motion pose of the target mobile device at the data acquisition time.
[0069] Optionally, the system posture information can be acquired by collecting angular velocity data and acceleration data of a specific position in the target mobile device. The specific position can be a moving mechanism such as a wheel group or a mechanical arm, or other structures that need to detect the posture driven by the moving mechanism. Further, the angular velocity data and the acceleration data can be detected by sensors installed at the specific position. For example, in the case of a surgical robot as the target mobile device, the angular velocity data and the acceleration data can be collected by sensor chips installed on the robot base and the mechanical arm links, and then the system posture information can be determined.
[0070] Further, the period of collecting the system posture information can be pre-set according to the actual application scenario to ensure the timeliness of the posture angle calculation process.
[0071] Step S20, determine the reference state information and the reference error information of the current period.
[0072] In one possible implementation, after determining the system posture information in each period, the reference state information and the reference error information of the current period are determined by the electronic device to assist in calculating the spatial posture angle of the target mobile device based on the system posture information. The reference state information is used to represent the spatial posture of the target mobile device at the beginning of the current period, and the reference error information is used to represent the error of the reference state information at the beginning of the current period.
[0073] In different time periods, the determination methods of the reference state information and the reference error information are different. Since the reference state information and the reference error information are respectively used to represent the spatial posture of the target mobile device at the beginning of the current period and the error of the reference state information, the target state information representing the spatial posture of the target mobile device at the end of the current period and the target error information representing the error of the target state information at the end of the current period are calculated after the end of each period. In the case that there are other periods before the current period, i.e., the current period is not the first period, the target state information and the target error information of the previous period can be directly used as the reference state information and the reference error information of the current period. That is, in response to the current period not being the first period, the target state information determined in the previous period is determined as the reference state information, and the target error information determined in the previous period is determined as the reference error information.
[0074] Optionally, in the case that the current period is the first period, since the target state information and the target error information of the previous period have not been calculated, the reference state information and the reference error information of the current period can be determined by other preset manners. Illustratively, in response to the current period being the first period, the reference state information is determined according to the acceleration data collected in the current period, and the preset initial error information is determined as the reference error information.
[0075] In a possible implementation, the reference state information can be represented as , wherein q includes a quaternion used to represent the spatial pose of the target mobile device at the start time of the current period , and ωerr includes the error of the angular velocity data of the system in the x, y, and z axis directions When the current period is the first period, the quaternion in the reference state information is determined according to the acceleration data in the system pose information obtained in the current period, and the angular velocity error is an initial error value set initially. Alternatively, the quaternion can also be calculated according to the acceleration data and the geomagnetic field intensity data. The manner of calculating the quaternion can be a pre-designed manner in the prior art, which is not limited herein.
[0076] Step S30, determining the target state information and the target error information of the current period according to the system pose information, the reference state information, and the reference error information.
[0077] In a possible implementation, after the electronic device determines the system pose information, the reference state information, and the reference error information of the current period, the electronic device can perform calculation based on the obtained data to obtain the target state information and the target error information of the current period. The target state information represents the target state information of the spatial pose of the target mobile device at the end time of the current period. The target error information represents the error condition of the target state information at the end time of the current period.
[0078] Optionally, the target error information can be calculated according to the angular velocity data in the system pose information obtained in the current period, and the reference state information and the reference error information. The target state information can be calculated according to the system pose information, the reference state information, and the target error information, wherein the system measurement equation of the current period can be determined according to the acceleration data and the reference state information, and the target state information can be calculated according to the system pose information, the reference state information, the target error information, and the system measurement equation.
[0079] Furthermore, the target error information can be calculated by first calculating the intermediate state parameters based on the angular velocity data and the reference state information. The target error information is calculated based on the reference error information and the intermediate state parameters. The intermediate state parameters can be calculated by first using the first-order Runge-Kutta method to establish the system state equation based on the system attitude information, and then using the reference state information to obtain the intermediate state parameters by taking the partial derivative of the system state equation. For example, when the reference state information is In the case of .
[0080] Furthermore, the Jacobian matrix F can be obtained as the intermediate state parameter by taking the partial derivative of the system state equation f based on the reference state information: , to further reference error information and intermediate state parameters, calculate the target error information Wherein, Q is a preset matrix parameter, for example, a 7×7 diagonal matrix, which is used as the process excitation noise covariance matrix to characterize the relationship between the system attitude information and the noise during the update process. The value in the matrix can be 10 to the power of -7 or 10 to the power of -8.
[0081] Alternatively, the system measurement equation can be expressed as ,in, Represents the estimated value of acceleration. The determination process of the system measurement equation h can obtain the attitude cosine matrix for the reference state information quaternion , and then according to the attitude cosine matrix , the acceleration estimate is obtained by the following formula to obtain the simplified system measurement equation (that is, a part of the complete system measurement equation) ,in, Represents the quaternion in the reference state information, N is the inertial reference system, B is the carrier coordinate system, the first digit of the subscript n represents the row position in the matrix C, and the second digit represents the column position in the matrix C. For example, n13 represents the element in the 1st row and 3rd column of the C matrix. h is a column vector, and 1-3 represents its vector elements 1 to 3. The Jacobian matrix H of the simplified system measurement equation can be expressed as: .
[0082] In one possible implementation, the target state information may be calculated by first calculating the corresponding Kalman gain matrix value based on the reference state information, the target error information, and the system measurement equation. The target state information may then be calculated based on the system attitude information, the Kalman gain matrix value, the reference state information, and the system measurement equation. The system measurement equation may be: The system measurement equation can be determined by first establishing the measurement equation, then converting the acceleration data and geomagnetic field data to the sensor coordinate system, and then converting them to the world coordinate system to obtain the system measurement equation. Among them, the system attitude information can be expressed as , a and m are acceleration data and angular velocity data respectively, that is, the acceleration data can be expressed as ,in, 、 、 Indicates the x-, y-, and z-axis components of the acceleration data at the current moment in the sensor chip coordinate system.
[0083] Furthermore, after establishing the system measurement equation h, the electronic device further calculates the corresponding Kalman gain matrix value based on the reference state information, the target error information, and the system measurement equation h. This process can first use the reference state information to find the partial derivative of the system measurement equation h to obtain the Jacobian matrix value of the system measurement equation h: Then, the Kalman gain matrix value is obtained based on the target error information P and the Jacobian matrix value H of the system measurement equation h. .
[0084] Furthermore, after the Kalman gain matrix value is calculated, the target state information can be calculated based on the system attitude information, the Kalman gain matrix value, the reference state information and the system measurement equation. , where X is the target state information, is the reference state information, Y is the system attitude information, h is the system measurement equation, and K is the Kalman gain matrix value.
[0085] Step S40: Determine the spatial attitude angle of the target mobile device in the current period according to the target state information.
[0086] In one possible implementation, after determining the target state information for the current cycle, the electronic device may determine a first attitude cosine matrix based on the quaternion in the target state information. A second attitude cosine matrix is then calculated based on the first attitude cosine matrix and a preset calibration error matrix. Finally, the Euler angles are solved based on the second attitude cosine matrix to obtain the spatial attitude angle of the target mobile device for the current cycle. The calibration error matrix is a preset parameter that can be pre-set as needed.
[0087] Furthermore, to ensure real-time calculation of the spatial attitude angle, the electronic device can cache the angular velocity and acceleration data collected each time. It also caches the target state information and target error information from the previous cycle for use in the spatial attitude angle calculation process of the current cycle.
[0088] Based on the technical features, the space attitude angle calculation method of the embodiment of the present disclosure can periodically detect the space attitude angle through a simple calculation process, and introduce reference state information and reference error information to assist calculation in each period detection process, so as to improve the accuracy of the calculation result in the case of low system attitude information accuracy. This method has lower accuracy requirements for the system attitude information obtained by the sensor, so that the target mobile device can ensure accurate calculation of the space attitude angle without installing high-precision sensors, thereby reducing the production and maintenance cost of the product.
[0089] Figure 2 A schematic diagram of a space attitude angle calculation device provided by the embodiment of the present disclosure is shown in FIG. 1. As shown in FIG. 1, the space attitude angle calculation device of the embodiment of the present disclosure can include: Figure 2
[0090] An information acquisition module 20 is configured to periodically acquire system attitude information of a target mobile device, wherein the system attitude information includes acceleration data and angular velocity data.
[0091] An information determination module 21 is configured to determine reference state information and reference error information of a current period, wherein the reference state information is used to represent the space attitude of the target mobile device at the beginning of the current period, and the reference error information is used to represent the error of the reference state information at the beginning of the current period.
[0092] An information calculation module 22 is configured to calculate target state information and target error information of the current period according to the system attitude information, the reference state information and the reference error information.
[0093] An attitude calculation module 23 is configured to determine the space attitude angle of the target mobile device in the current period according to the target state information.
[0094] In a possible implementation, the information determination module 21 is further configured to:
[0095] In response to the current period being a first period, determine the reference state information of the current period according to the acceleration data collected in the current period.
[0096] Determine a preset initial error information as the reference error information of the current period.
[0097] In a possible implementation, the information determination module 21 is further configured to:
[0098] In response to the current period not being the first period, determine the target state information of the previous period as the reference state information of the current period.
[0099] Determine the target error information of the previous period as the reference error information of the current period.
[0100] In a possible implementation, the information calculating module 22 is further configured to calculate the target error information according to the angular velocity data, the reference state information, and the reference error information.
[0101] determining a system measurement equation of a current period according to the acceleration data and the reference state information;
[0102] calculating target state information of the current period according to the system attitude information, the reference state information, the target error information, and the system measurement equation.
[0103] In a possible implementation, the information calculating module 22 is further configured to calculate an intermediate state parameter according to the angular velocity data and the reference state information.
[0104] calculating target error information of the current period according to the reference error information and the intermediate state parameter.
[0105] In a possible implementation, the information calculating module 22 is further configured to:
[0106] calculating a corresponding Kalman gain matrix value according to the reference state information, the target error information, and the system measurement equation;
[0107] calculating target state information of the current period according to the system attitude information, the Kalman gain matrix value, the reference state information, and the system measurement equation.
[0108] In a possible implementation, the target state information includes a quaternion used to represent a spatial attitude of the target mobile device.
[0109] The attitude calculating module 23 is further configured to:
[0110] determining a first attitude cosine matrix according to the quaternion in the target state information;
[0111] calculating a second attitude cosine matrix according to the first attitude cosine matrix and a preset calibration error matrix;
[0112] solving Euler angles according to the second attitude cosine matrix to obtain a spatial attitude angle of the target mobile device in the current period.
[0113] Figure 3 A schematic diagram of an electronic device 800 according to an embodiment of the present disclosure is shown. The electronic device 800 can be, for example, a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
[0114] Referring to Figure 3 The electronic device 800 can include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0115] The processing component 802 usually controls overall operations of the electronic device 800, such as operations associated with displaying, making phone calls, data communications, camera operations and recording operations. The processing component 802 can include one or more processors 820 to execute instructions to complete all or part of steps of the methods described above. In addition, the processing component 802 can include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0116] The memory 804 is configured to store various types of data to support operations of the electronic device 800. Examples of these data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0117] The power component 806 provides power to various components of the electronic device 800. The power component 806 can include a power management system, one or more power sources, and other components associated with generating, managing and distributing power for the electronic device 800.
[0118] The multimedia component 808 includes a screen to provide an output interface between the electronic device 800 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense a touch, a slide, and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or a sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0119] The audio component 810 is configured to output and / or input an audio signal. For example, the audio component 810 includes a microphone (MIC) to receive an external audio signal when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker to output an audio signal.
[0120] The I / O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0121] The sensor component 814 includes one or more sensors to provide various state assessments for the electronic device 800. For example, the sensor component 814 can detect an open / closed state of the electronic device 800, relative positioning of components, such as a display and a keypad of the electronic device 800, a change in position of the electronic device 800 or a component of the electronic device 800, presence or absence of user contact with the electronic device 800, an orientation or acceleration / deceleration of the electronic device 800, and a temperature change of the electronic device 800. The sensor component 814 can include a proximity sensor configured to detect presence of a nearby object without any physical touch. The sensor component 814 can further include a light sensor, such as a CMOS or CCD image sensor, for use in an imaging application. In some embodiments, the sensor component 814 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0122] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) techniques, infrared data association (IrDA) techniques, ultra-wideband (UWB) techniques, Bluetooth (BT) techniques, and other techniques.
[0123] In an exemplary embodiment, the electronic device 800 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements, for performing the above-described methods.
[0124] In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804 including computer program instructions, is also provided, which can be executed by the processor 820 of the electronic device 800 to complete the above-described methods.
[0125] The above-described embodiments of the present disclosure have been described, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical application, or improvement of technology in the market, or to enable other ordinary skilled persons in the art to understand the embodiments disclosed herein.
Claims
1. A method of calculating a spatial attitude angle, characterized by, The method comprises: periodically acquiring system attitude information of a target mobile device, the system attitude information comprising acceleration data and angular velocity data; determining reference state information and reference error information of a current period, the reference state information being used to represent a spatial attitude of the target mobile device at the beginning of the current period, and the reference error information being used to represent an error of the reference state information at the beginning of the current period; the determination of the reference state information and the reference error information of the current period comprises: in response to the current period being a first period, determining the reference state information of the current period according to the acceleration data collected in the current period; determining preset initial error information as the reference error information of the current period; in response to the current period not being the first period, determining target state information determined in a previous period as the reference state information of the current period; and determining target error information determined in the previous period as the reference error information of the current period; calculating target state information and target error information of the current period according to the system attitude information, the reference state information and the reference error information; determining a spatial attitude angle of the target mobile device in the current period according to the target state information; wherein the calculation of the target state information and the target error information of the current period according to the system attitude information, the reference state information and the reference error information comprises: calculating an intermediate state parameter according to the angular velocity data and the reference state information; wherein the intermediate state parameter is calculated by establishing a system state equation based on the system attitude information using a first-order Runge-Kutta method, and obtaining the intermediate state parameter F by taking partial derivatives of the system state equation with respect to the reference state information; calculating the target error information of the current period according to the reference error information and the intermediate state parameter; wherein the target error information is the reference error information, F is the intermediate state parameter, and Q is a preset matrix parameter used as a process excitation noise covariance matrix to represent the relationship between the system attitude information and the noise in the updating process; determining a system measurement equation of the current period according to the acceleration data and the reference state information; calculating a corresponding Kalman gain matrix value according to the reference state information, the target error information and the system measurement equation; calculating the target state information of the current period according to the system attitude information, the Kalman gain matrix value, the reference state information and the system measurement equation.
2. The method of claim 1, wherein, the target state information comprises a quaternion used to represent the spatial attitude of the target mobile device; the determination of the spatial attitude angle of the target mobile device in the current period according to the target state information comprises: determining a first attitude cosine matrix according to the quaternion in the target state information; calculating a second attitude cosine matrix according to the first attitude cosine matrix and a preset calibration error matrix; solving Euler angles according to the second attitude cosine matrix to obtain the spatial attitude angle of the target mobile device in the current period.
3. A spatial attitude angle calculation device, characterized by comprising: The method comprises: an information acquisition module configured to periodically acquire system attitude information of a target mobile device, the system attitude information comprising acceleration data and angular velocity data; information determining module, configured to determine reference state information and reference error information of a current period, the reference state information being used to represent a spatial posture of the target mobile device at the beginning of the current period, and the reference error information being used to represent an error of the reference state information at the beginning of the current period; in response to the current period being a first period, the reference state information of the current period is determined according to acceleration data collected in the current period; an initial error information is determined as the reference error information of the current period; in response to the current period not being the first period, target state information determined in a previous period is determined as the reference state information of the current period, and target error information determined in the previous period is determined as the reference error information of the current period; information calculating module, configured to calculate target state information and target error information of the current period according to the system posture information, the reference state information and the reference error information; the information calculating module is further configured to calculate an intermediate state parameter according to the angular velocity data and the reference state information, the intermediate state parameter being calculated by establishing a system state equation based on the system posture information using a first-order Runge-Kutta method, and obtaining the intermediate state parameter F by taking partial derivative of the system state equation with respect to the reference state information; the target error information of the current period is calculated according to the reference error information and the intermediate state parameter, the target error information being represented as FQ, wherein F is the intermediate state parameter, Q is a preset matrix parameter, and is used as a process excitation noise covariance matrix to represent a relationship between the system posture information and noise in an updating process; a system measurement equation of the current period is determined according to the acceleration data and the reference state information; a corresponding Kalman gain matrix value is calculated according to the reference state information, the target error information and the system measurement equation; and the target state information of the current period is calculated according to the system posture information, the Kalman gain matrix value, the reference state information and the system measurement equation; a posture calculating module, configured to determine a spatial posture angle of the target mobile device in the current period according to the target state information.
4. An electronic device, characterized in that: comprise: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the method of any one of claims 1-2 when executing the instructions stored in the memory.
5. A non-transitory computer readable storage medium having stored thereon computer program instructions, wherein, The computer program instructions, when executed by the processor, implement the method of any one of claims 1-2.
Citation Information
Patent Citations
Mahony attitude measurement method based on iterative EKF
CN117029810A