Course estimation method and device and storage medium
By determining and converting the sampling angular velocity and initial attitude information in the target equipment, effective estimation of pedestrian heading is achieved, and the difficulty in heading determination in the prior art in the absence of GPS signals or magnetic interference is solved, and adaptability is improved and estimation accuracy.
Patent Information
- Application Number
- CN202310977955.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2025-02-14
AI Technical Summary
When the global navigation satellite system fails, it is difficult for the existing technology to effectively estimate the heading of pedestrians in user arm swing scenarios, especially in non-linear sections and modeling requiring high data volumes, there is a problem of 180° phase fuzzy and lack of common ground. Problem of suitability.
By determining the target angular velocity at the target position among the at least two sampling angular velocities of the target device, and determining the target pose information based on the initial attitude information and these angular velocities, the heading angle of the target device at the target position is then converted. This method does not rely on global positioning system (GPS) information or magnetic vectors, and can work effectively in areas where GPS failure or magnetic interference is severe.
Effective estimates of pedestrian headings are achieved, the heading determination ability is improved in environments with severe GPS signals or magnetic interference, the dependence on environmental conditions is weakened, and the adaptability is enhanced.
Smart Images

Figure CN119437210A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to positioning technology, and in particular to a heading estimation method and device, and a storage medium. Background Art
[0002] When the Global Navigation Satellite System (GNSS) fails, how to estimate the pedestrian's heading using the watch's IMU sensor in the scenario where the user swings his arm has always been a research hotspot. In related technologies, methods for estimating pedestrian heading include:
[0003] Principal component analysis (PCA) method, forward and lateral accelerations modeling (FLAM) method and frequency analysis of inertial s i gnals (FIS) method. Among them, the PCA method has certain requirements on the amount of acceleration data and is not suitable for non-straight sections. The heading obtained has a 180° phase ambiguity problem. The effect is poor in practical applications and there are few applicable scenarios. Both FLAM and FIS methods require modeling of users in advance, and the data volume requirements are huge. The model is only applicable to the current user and is not universal. Summary of the invention
[0004] The embodiments of the present application provide a heading estimation method and device, and a storage medium, which can estimate the heading of a pedestrian and have strong adaptability to the environment.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] The present invention provides a method for estimating a heading, the method comprising:
[0007] Determine a target angular velocity at a target position among at least two sampled angular velocities of the target device, wherein the heading angle at the target position represents the heading of the target device;
[0008] Determine, based on the initial posture information and the at least two sampled angular velocities, target posture information corresponding to the target angular velocity, wherein the initial posture information represents the posture of the target device in an initial state, the target posture information represents the posture of the target device when the angular velocity of the target device is the target angular velocity, and the acceleration of the target device in the initial state is the acceleration of gravity;
[0009] The target posture information is converted to obtain the heading angle of the target device at the target position.
[0010] An embodiment of the present application provides an electronic device, the electronic device comprising:
[0011] A first determining unit is configured to determine a target angular velocity at a target position among at least two sampled angular velocities of the target device, wherein the heading angle at the target position represents the heading of the target device;
[0012] a second determining unit, configured to determine target posture information corresponding to the target angular velocity based on the initial posture information and the at least two sampled angular velocities, wherein the initial posture information represents the posture of the target device in an initial state, the target posture information represents the posture of the target device when the angular velocity of the target device is the target angular velocity, and the acceleration of the target device in the initial state is the acceleration of gravity;
[0013] The conversion unit is configured to convert the target posture information to obtain a heading angle of the target device at the target position.
[0014] An embodiment of the present application provides an electronic device, including a processor, wherein the processor is configured to:
[0015] Determine a target angular velocity at a target position among at least two sampled angular velocities of the target device, wherein the heading angle at the target position represents the heading of the target device;
[0016] Determine, based on the initial posture information and the at least two sampled angular velocities, target posture information corresponding to the target angular velocity, wherein the initial posture information represents the posture of the target device in an initial state, the target posture information represents the posture of the target device when the angular velocity of the target device is the target angular velocity, and the acceleration of the target device in the initial state is the acceleration of gravity;
[0017] The target posture information is converted to obtain the heading angle of the target device at the target position.
[0018] An embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned heading estimation method are implemented.
[0019] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the above-mentioned heading estimation method is implemented.
[0020] The chip provided in the embodiment of the present application is used to implement the above-mentioned heading estimation method, and the chip includes: a processor, which is used to call and run a computer program from a memory, so that a device equipped with the chip executes the above-mentioned heading estimation method.
[0021] The heading estimation method, device and storage medium provided in the embodiments of the present application determine a target angular velocity at a target position among at least two sampled angular velocities of a target device, wherein the heading angle at the target position represents the heading of the target device; determine target attitude information corresponding to the target angular velocity based on initial attitude information and the at least two sampled angular velocities, wherein the initial attitude information represents the attitude of the target device in an initial state, wherein the target attitude information represents the attitude of the target device when the angular velocity of the target device is the target angular velocity, and the acceleration of the target device in the initial state is the acceleration of gravity; convert the target attitude information to obtain the heading angle of the target device at the target position; thereby determining the current heading angle of the target device through the sampled angular velocity of the target device at the target position and the initial attitude information of the attitude of the target device in the initial state, without requiring global positioning system (GPS) information and without relying on magnetic vectors, and being able to determine the heading angle of the target device even in areas where GPS fails or magnetic interference is severe, thereby reducing dependence on environmental conditions and having higher adaptability to the environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is an optional flowchart of the heading estimation method provided in the embodiment of the present application;
[0023] Figure 2A is an optional structural diagram of a target device provided in an embodiment of the present application;
[0024] Figure 2B This is an optional schematic diagram of a target device provided in an embodiment of the present application being located in a swinging position in a scenario of a user's left hand;
[0025] Figure 2C This is an optional schematic diagram of a target device provided in an embodiment of the present application being located in a swinging position in a scene of the user's right hand;
[0026] Figure 3 is an optional structural diagram of a target device provided in an embodiment of the present application;
[0027] Figure 4 It is an optional flowchart of the heading estimation method provided in the embodiment of the present application;
[0028] Figure 5A It is an optional flowchart of the heading estimation method provided in the embodiment of the present application;
[0029] Figure 5B It is an optional flowchart of the heading estimation method provided in the embodiment of the present application;
[0030] Figure 6 is an optional structural diagram of an electronic device provided in an embodiment of the present application;
[0031] Figure 7 is an optional schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0032] Figure 8 is an optional schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0033] Fig. 9 It is an optional schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0035] The embodiments of the present application can provide a heading estimation method, device and storage medium. In practical applications, the heading estimation method can be implemented by an electronic device, and each functional entity in the electronic device can be collaboratively implemented by hardware resources of a computer device (such as a terminal device, a wearable device, etc.), such as computing resources such as a processor, and communication resources (such as for supporting various communication methods such as optical cables and cellular).
[0036] Of course, the embodiments of the present application are not limited to being provided as methods and hardware, and there may be multiple implementation methods, such as being provided as a storage medium (storing instructions for executing the heading estimation method provided by the embodiments of the present application).
[0037] The following describes various embodiments of the heading estimation method, device, and storage medium provided in the embodiments of the present application.
[0038] The information processing method provided in the embodiment of the present application can be as follows Figure 1 As shown, the method may include:
[0039] S101. Determine a target angular velocity at a target position among at least two sampled angular velocities of a target device, wherein the heading angle at the target position represents the heading of the target device.
[0040] When the user is walking, as the user's arm swings, the swing trajectory of the target device presents a curve with alternating peaks and troughs. As the user's arm swings, the angular velocity of the target device also changes.
[0041] In the embodiment of the present application, Figure 2A As shown, the target device 200 is provided with an angular velocity sensor 201, such as a gyroscope. The angular velocity sensor 201 can collect the angular velocity of the target device. The angular velocity collected by the angular velocity sensor is the angular velocity of the coordinate system of the target device.
[0042] The target device collects the angular velocity of the target device during movement through the angular velocity sensor to obtain the angular velocity, and the electronic device determines the angular velocity at the target position in the sampled angular velocity collected by the target device to obtain the target angular velocity.
[0043] In an embodiment of the present application, the target position can be understood as a position whose heading angle can characterize the heading of the target device, wherein the heading angle can be understood as the angle of rotation of the target device around the Z axis in the navigation system, and the navigation system can be understood as a navigation coordinate system, such as the East (E)-North (N)-Ultraviolet (U) coordinate system.
[0044] The target position may be any position in the swing trajectory of the target device, or may be a position in the swing trajectory determined based on the sampled angular velocity.
[0045] S102. Determine target posture information corresponding to the target angular velocity based on the initial posture information and the at least two sampled angular velocities, wherein the initial posture information represents the posture of the target device in an initial state, the target posture information represents the posture of the target device when the angular velocity of the target device is the target angular velocity, and the acceleration of the target device in the initial state is the acceleration of gravity.
[0046] After the electronic device determines the target angular velocity, it determines the target attitude information representing the attitude of the target device at the target position based on the initial attitude information of the target device. The initial attitude information can be obtained by the electronic device from the network side, or can be determined by the initial heading angle collected by the GPS of the target device, wherein the initial heading angle is the heading angle of the target device in the initial state.
[0047] In the embodiment of the present application, the initial posture information represents the posture in the initial state, and the initial state can be understood as a quasi-static state. In the quasi-static state, the motion acceleration in the acceleration of the target device is relatively small (it can be considered to be less than the set motion acceleration threshold). At this time, the acceleration of the target device is approximately only the gravity acceleration. In practice, due to human body movement, the acceleration of the target device will always include human body motion acceleration other than gravity acceleration. Here, the position with the smallest motion acceleration within a period of time is taken as the quasi-static position, i.e., the reference point. At this time, it can be considered that the acceleration of the reference point only includes gravity acceleration, and the posture information of the reference point is the initial posture information.
[0048] The target posture information is the posture information of the target device at the target position, and represents the posture of the target device at the target position.
[0049] The target posture can be understood as the posture of the target device at the target position when the angular velocity changes to at least two angular velocities based on the initial posture and the target angular velocity corresponds to the target angular velocity.
[0050] In the embodiment of the present application, the posture information may include: posture quaternion. If the posture information is a posture quaternion, the target posture information may be understood as the target posture quaternion, and the initial posture information may be understood as the initial posture quaternion.
[0051] S103: Convert the target posture information to obtain a heading angle of the target device.
[0052] In the embodiment of the present application, the angular velocity of the target device is the rotation of the navigation system relative to the present system, the initial attitude information is the rotation of the navigation system relative to the present system, and the target attitude information obtained based on the target angular velocity and the initial attitude information of the target device is the rotation of the navigation system relative to the present system. Therefore, after determining the target attitude information in S102, the electronic device converts the target attitude information determined in S102 from the navigation system relative to the present system to the present system relative to the navigation system.
[0053] In one example, the target attitude information of the navigation system relative to the system is the target attitude quaternion q of the navigation system relative to the system. bn , for q bn Take the inversion to get the target attitude quaternion q of this system relative to the navigation system nb (q0, q1, q2, q3), where q0, q1, q2, q3 are q nb The four elements in .
[0054] After the electronic device determines the target attitude information of the system relative to the navigation system, it converts it into the target attitude angle according to the target rotation mode. The target attitude angle includes: the pitch angle γ rotating around the X axis, the roll angle θ rotating around the Y axis, and the heading angle ψ rotating around the Z axis. The heading angle of the Z axis in the target attitude angle is the heading angle of the target device.
[0055] In an embodiment of the present application, the target rotation mode is a rotation mode used by the electronic device when converting target posture information. The rotation mode is the order of the X-axis, Y-axis, and Z-axis during the rotation process. In one example, the rotation mode is that the X-axis rotates first, then the Y-axis, and finally the Z-axis rotates. In this case, the rotation mode can be expressed as a 1-2-3 rotation mode. In one example, the rotation mode is that the Y-axis rotates first, then the X-axis, and finally the Z-axis rotates. In this case, the rotation mode can be expressed as a 2-1-3 rotation mode. In one example, the rotation mode is that the Z-axis rotates first, then the X-axis, and finally the Y-axis rotates. In this case, the rotation mode can be expressed as a 3-1-2 rotation mode.
[0056] When the electronic device converts the target attitude quaternion into the target attitude angle according to the target rotation mode, it can establish a corresponding relationship between the rotation matrix of the target attitude quaternion in the target rotation mode and the rotation matrix of the target attitude angle in the target rotation mode, and solve the inverse trigonometric function by the elements of the corresponding quaternion to obtain the rotation angles of the target attitude angle.
[0057] In one example, the rotation matrix represented by the target pose quaternion can be expressed as formula (1A):
[0058]
[0059] Among them, q0, q1, q2, q3 are four elements in the attitude quaternion. It should be noted that the attitude quaternion includes a vector part and a scalar part, q1, q2, q3 belong to the vector part, and q0 belongs to the scalar part.
[0060] In one example, the rotation matrix represented by the target attitude angle can be expressed as formula (1B):
[0061]
[0062] A corresponding relationship between formula (1A) and formula (1B) is established, and the target attitude angles are obtained by solving q0, q1, q2, and q3: the pitch angle γ rotating around the X axis, the roll angle θ rotating around the Y axis, and the heading angle ψ rotating around the Z axis, where the heading angle ψ rotating around the Z axis in the target attitude angle is the heading angle of the target device at the target position.
[0063] In the embodiment of the present application, there is no limitation on the target rotation mode used to convert the target attitude information into the target attitude angle.
[0064] It is understandable that the electronic device can be the target device or a device other than the target device. If the electronic device is a device other than the target device, the angular velocity collected by the target device through the angular velocity sensor can be sent to the electronic device, or when the electronic device moves synchronously with the target device, the angular velocity is collected through its own angular velocity sensor as the angular velocity of the target device, so that the electronic device determines the heading angle of the target device based on the obtained angular velocity. The electronic device can be a terminal device, a wearable device, or other device that can move with the user's arm.
[0065] The heading estimation method provided in the embodiment of the present application determines the target angular velocity at the target position among at least two sampled angular velocities of the target device, the heading angle at the target position characterizing the heading of the target device; determines the target attitude information corresponding to the target angular velocity based on the initial attitude information and the at least two sampled angular velocities, the initial attitude information characterizing the attitude of the target device in the initial state, the target attitude information characterizing the attitude of the target device when the angular velocity of the target device is the target angular velocity, and the acceleration of the target device in the initial state is the acceleration of gravity; converts the target attitude information to obtain the heading angle of the target device at the target position; thereby determining the current heading angle of the target device through the sampled angular velocity of the target device at the target position and the initial attitude information of the attitude of the target device in the initial state, without requiring GPS information and without relying on the magnetic vector, and being able to determine the heading angle of the target device even in areas where GPS fails or magnetic interference is severe, thereby reducing dependence on environmental conditions and having higher adaptability to the environment.
[0066] In some embodiments, S101 determines a target angular velocity at a target position among at least two sampled angular velocities of the target device, including:
[0067] S1011, determining the angular velocity of each of the at least two sampled angular velocities on the Z axis, to obtain at least two angular velocities on the Z axis;
[0068] S1012, determining at least one Z-axis angular velocity peak among the angular velocities on the at least two Z-axes;
[0069] S1013: Determine, among the at least two sampled angular velocities, a sampled angular velocity corresponding to a maximum angular velocity peak among the at least one Z-axis angular velocity peak as the target angular velocity.
[0070] The target device samples the angular velocity of the target device based on the first sampling frequency to obtain a first number of sampled angular velocities, wherein one sampling angle corresponds to one posture of the target device. In one example, the first frequency is 40 Hz, and the first number is 40. In one example, the first frequency is 50 Hz, and the first number is 50. In one example, the first frequency is 100 Hz, and the first number is 100.
[0071] The target device determines the Z-axis angular velocity of each sampled angular velocity in the first number of sampled angular velocities, obtains at least two Z-axis angular velocities, and searches for a Z-axis angular velocity peak in the at least two Z-axis velocities, where the Z-axis angular velocity peak is greater than the two adjacent Z-axis angular velocities. When a Z-axis angular velocity peak is determined, the sampled angular velocity corresponding to the Z-axis angular velocity peak is determined as the target angular velocity. When multiple Z-axis angular velocity peaks are determined, the sampled angular velocity corresponding to the largest Z-axis angular velocity peak among the multiple Z-axis velocity peaks is determined as the target angular velocity.
[0072] In one example, based on Figure 2B The target device shown is located in the coordinate system of the user's left hand scene and is based on Figure 2C The target device shown is located in the coordinate system of the user's right-hand scene. When the target device is located at the swing positions shown in 21, 22, and 23, the angle A representing the swing direction is as follows: the angle A corresponding to position 23 is greater than the angle A corresponding to position 22, and the angle A corresponding to position 21 is greater than the angle A corresponding to position 22. When the arm swings to the lowest point, the angle A is small. It can be approximately considered that the swing direction at this time is consistent with the walking direction. The navigation angle at this time is determined as the heading angle of the target device. When the arm swings to the lowest point, the acceleration of the target device on the Z axis is the peak angular velocity. Among them, angle A is the angle between the walking direction P and Figure 2B The angle between the intersection line of the swing arm surface and the horizontal plane shown, the swing arm surface formed by the X-axis and the Y-axis, and the horizontal plane formed by the E-axis and the N-axis. Figure 2B and Figure 2C The intersection line of the middle swing arm surface and the horizontal plane is the intersection line of the swing position when the target device is at position 22. The intersection line of the swing position when the target device is at position 21 or 23 has an angle with the intersection line shown in the figure. Therefore, the angle A of the swing position when the target device is at position 21 or 23 is greater than the angle A of the swing position when the target device is at position 22.
[0073] In practical applications, when the instantaneous arm swing plane at different positions of the human body is the same during the arm swing process, it is considered that the current arm swing belongs to the standard arm swing, and the angles between the intersections of the arm swing planes at different positions and the horizontal plane and the walking direction P are the same. In this case, Figure 2B and Figure 2CThe sizes of angles A at positions 21, 22, and 23 are the same. At this time, the target position can be any position in the swing arm trajectory.
[0074] Among them, Figure 2B and Figure 2C In the figure, the coordinate system composed of the three axes of East (E)-North (N)-Upper (U) shown by the thicker solid line is the navigation coordinate system, and the coordinate system composed of the three axes of XYZ shown by the dotted line is the body coordinate system.
[0075] In some embodiments, S102 determines the target posture information corresponding to the target angular velocity based on the initial posture information and the at least two sampled angular velocities, including:
[0076] S1021, based on the initial posture information and the at least two sampled angular velocities, recursively derive target posture information corresponding to each of the at least two sampled angular velocities to obtain at least two target posture information;
[0077] S1022: Select target attitude information corresponding to the target angular velocity from the at least two target attitude information.
[0078] The electronic device determines the posture information corresponding to each sampling angular velocity in the first number of sampling angular velocities to characterize the posture corresponding to each sampling angular velocity, and selects the target posture information corresponding to the target angular velocity from the first number of target posture information. For a sampling angular velocity, the electronic device recursively obtains it based on the initial posture information and the sampling angular velocity and the sampling angular velocity before the sampling angular velocity in at least two sampling angular velocities.
[0079] After determining the target posture information corresponding to each of the at least two sampled angular velocities, the electronic device determines the target posture information corresponding to the target angular velocity from the at least two determined target posture information.
[0080] In an embodiment of the present application, the electronic device may set a first index corresponding to each sampling angular velocity, and after determining the target posture information corresponding to each sampling angular velocity, establish a relationship between the corresponding first index and the sampling angular velocity. After determining the target angular velocity, the target posture information corresponding to the target angular velocity is determined from the first number of target posture information according to the first index corresponding to the target angular velocity.
[0081] In some embodiments, S1021 recursively determines the target posture information corresponding to each of the at least two sampling angular velocities based on the initial posture information and the at least two sampling angular velocities, and obtains at least two target posture information, including:
[0082] For each of the at least two sampled angular velocities, the following processing is performed:
[0083] If the sampling speed is the first sampling angular speed of the at least two sampling angular speeds, the initial posture information is updated by the sampling angular speed to obtain the target posture information corresponding to the sampling angular speed;
[0084] If the sampling speed is not the first sampling angular speed of the at least two sampling angular speeds, the reference posture information is updated by the sampling angular speed to obtain the target posture information corresponding to the sampling angular speed, and the reference posture information is the target posture information corresponding to the previous sampling angular speed of the at least two sampling angular speeds.
[0085] In the embodiment of the present application, the target attitude information is a target attitude quaternion, and the electronic device can determine a target attitude quaternion based on formula (1C):
[0086]
[0087] Where w is the current sampling angular velocity, w x 、w y 、w z are the angular velocities on the X, Y, and Z axes in w, respectively. q represents the target attitude quaternion corresponding to the current sampling angular velocity. is the differential result of the target attitude quaternion corresponding to the current sampling angular velocity, and is related to the current target attitude quaternion and the target attitude quaternion corresponding to the previous sampling angular velocity. For the first sampling angular velocity of the first number of sampling angular velocities, the target attitude quaternion of the previous sampling angular velocity of the sampling angular velocity can be understood as the initial attitude quaternion.
[0088] By calculating formula (1C), the target attitude quaternion corresponding to each sampling angular velocity is obtained, wherein the target attitude quaternion corresponding to each sampling angular velocity can characterize the attitude of the target device corresponding to these sampling angular velocities, thereby determining the attitude change of the target device during the movement process.
[0089] In some embodiments, the initial posture information includes an initial posture quaternion. Before S102, the electronic device further performs the following processing:
[0090] An initial attitude angle of the target device in the initial state is determined based on an initial acceleration, a gravitational acceleration and an initial heading angle, wherein the initial acceleration is the acceleration of the target device in the initial state, and the initial heading angle is the heading angle collected by a positioning system of the target device when the target device is in the initial state; and the initial attitude angle is converted into the initial attitude quaternion.
[0091] The electronic device determines the roll angle and pitch angle of the target device in the initial state through the initial acceleration and the gravity acceleration, and combines the roll angle and the initial pitch angle in the initial state to obtain the initial attitude angle of the target electronic device.
[0092] In the embodiment of the present application, the rotation of the target device can be understood as a rigid body motion, and the present system can be understood as a coordinate system with the target device or the human body as the center in the rigid body motion, that is, the present system can include a device coordinate system with the target device as the center and a human coordinate system with the human body as the center. Among them, the heading angle is the rotation of the human body coordinate system relative to the navigation system; the roll angle and the pitch angle are the rotation of the mobile phone coordinate system relative to the navigation system. Therefore, the initial attitude angle of the roll angle, the pitch angle and the initial heading angle in the initial state is neither the mobile phone attitude nor the pedestrian attitude.
[0093] The electronic device determines the roll angle and pitch angle of the target device in the initial state based on a first rotation matrix, gravitational acceleration and initial acceleration, wherein the initial acceleration is the acceleration of the target device in the initial state, the initial attitude angle is the attitude angle of the target device in the initial state, and the first rotation matrix represents the conversion relationship between this system and the navigation system.
[0094] The electronic device determines a first rotation matrix according to a target rotation mode, where the first rotation matrix is a rotation matrix from the navigation system to the local system; based on the first rotation matrix, the electronic device determines the roll angle and pitch angle corresponding to the initial acceleration, that is, the roll angle and pitch angle of the target device in the initial state.
[0095] The initial acceleration can be understood as the acceleration detected by the accelerometer of the target device in the initial state, i.e., the quasi-stationary state, and can be understood as the acceleration of this system. The acceleration of the navigation system of the target device in the initial state only includes the gravity acceleration. The initial acceleration can be a preset acceleration, or an acceleration obtained from the network device side, or an acceleration calculated by the target device when it has a GPS function.
[0096] In the embodiment of the present application, the initial acceleration is expressed as G[G x , G y , G z ], the acceleration values on the X-axis and Y-axis in the quasi-static navigation system are 0, and the acceleration on the Z-axis is the gravity acceleration g. There is a relationship shown in formula (2) between the initial acceleration, the acceleration in the quasi-static navigation system and the first rotation matrix:
[0097]
[0098] in, is the first rotation matrix.
[0099] The roll angle and pitch angle of the target device in an initial state are determined based on the first rotation matrix and the target rotation mode adopted by the target device.
[0100] In one example, if the target rotation mode from the local system to the navigation system adopts a 2-1-3 rotation mode, the first rotation matrix from the navigation system to the local system is expressed as formula (3):
[0101]
[0102] The target rotation mode of the first rotation matrix is the same as the target rotation mode used in S103.
[0103] By combining formula (2) and formula (3), the pitch angle and roll angle included in the calculated initial attitude angle, where the roll angle and pitch angle can be expressed as formula (4) and formula (5):
[0104]
[0105]
[0106] The initial heading angle may be the heading angle in the initial state determined by the positioning system in the target device, i.e., the initial heading angle. Based on the initial heading angle and the roll angle and pitch angle shown in formula (4) and formula (5), the attitude angle of the target device in the quasi-static state, i.e., the initial attitude angle, is obtained. The positioning system of the target device is a system used for positioning, such as GPS.
[0107] The target device determines the initial attitude angle, converts the initial attitude angle into the initial attitude quaternion, and obtains the attitude quaternion of the target device in the initial state, that is, the initial attitude quaternion. In the embodiment of the present application, the initial attitude quaternion q nb-c The relationship between and the initial attitude angle can be expressed as formula (6):
[0108]
[0109] In the embodiment of the present application, considering the initial posture quaternion q nb-c For the conversion from the local system to the navigation system, the initial attitude quaternion needs to be converted into the conversion q from the navigation system to the local system as shown in formula (7): bn-c :
[0110]
[0111] Among them, q nb-c (1:3) represents q nb-c The vector part, q nb-c (4) indicates q nb-cThe scalar part of . Formula (7) is the inverse of the quaternion (in this paper, all quaternions are unit quaternions, that is, the modulus is 1. The obtained quaternion is used as the initial value in formula (1C) for recursive update.
[0112] In some embodiments, before the electronic device determines the initial attitude angle of the target device in the initial state based on the initial acceleration, the gravity acceleration and the initial heading angle, the electronic device further performs the following processing:
[0113] Sampling the acceleration of the target device to obtain a sampled acceleration sequence consisting of at least two sampled accelerations;
[0114] Determine a first sampled acceleration and a second sampled acceleration in the sampled acceleration sequence, wherein the first sampled acceleration and the second sampled acceleration are respectively a pair of peak sampled acceleration and trough sampled acceleration in the sampled acceleration sequence;
[0115] The initial acceleration is determined based on the first sampled acceleration and the second sampled acceleration.
[0116] like Figure 3 As shown, the target device 200 further includes an acceleration sensor 202, and the acceleration sensor 202 can collect the acceleration of the target device.
[0117] The target device samples the acceleration of the target device at a first frequency to obtain a first number of sampled accelerations.
[0118] The electronic device determines a pair of peak sampling acceleration and trough sampling acceleration in the first number of sampling accelerations, namely, a first sampling angular velocity and a second sampling acceleration: wherein the first sampling acceleration is a peak sampling acceleration, which is greater than the two adjacent sampling accelerations, and the second sampling acceleration is a trough sampling acceleration, which is less than the two adjacent sampling accelerations. The terminal device determines the initial acceleration based on the first sampling acceleration and the second sampling acceleration.
[0119] The sampled acceleration may include accelerations in the X, Y, and Z axis directions. The accelerations in the three directions of the sampled acceleration are modulo-ed, and the magnitudes of adjacent sampled accelerations in the first number of sampled accelerations are compared based on the modulo-ed results, thereby determining the first sampled angular velocity and the second sampled acceleration.
[0120] In some embodiments, determining the initial acceleration based on the first sampled acceleration and the second sampled acceleration includes:
[0121] A sampled acceleration located between the first sampled acceleration and the second sampled acceleration in the sampled acceleration sequence is determined as the initial acceleration.
[0122] Here, the sampling acceleration at the middle position of a pair of the first sampling acceleration and the second sampling acceleration is determined as the initial acceleration.
[0123] In one example, the first sampled acceleration is the 20th sampled acceleration in the sampled acceleration sequence, the second sampled acceleration is the 30th sampled acceleration in the sampled acceleration sequence, and the initial acceleration is the 25th sampled acceleration in the sampled acceleration sequence.
[0124] In actual applications, the electronic device can set a second index corresponding to each sampled acceleration, and determine the second index of the first sampled acceleration and the second index of the second sampled acceleration, determine a target second index based on the second index of the first sampled acceleration and the second index of the second sampled acceleration, and determine the sampled acceleration corresponding to the target second index as the initial acceleration.
[0125] In some embodiments, the method further comprises:
[0126] Obtaining the heading accuracy of the target device; wherein, if the heading accuracy is greater than a heading accuracy threshold, sampling the acceleration of the target device.
[0127] In the embodiment of the present application, for the device whose chip bottom layer reports the heading estimation accuracy, the heading accuracy threshold can be directly set as needed. In one example, the heading accuracy threshold is 5 degrees. If the heading accuracy of the target device meets the heading accuracy threshold, it is determined that the GPS accuracy of the target device meets the heading accuracy condition. At this time, the initial attitude information is obtained by sampling the acceleration.
[0128] In the embodiment of the present application, the heading accuracy of the target device may be the accuracy of the positioning system.
[0129] In some embodiments, the method further comprises:
[0130] The speed of the target device is obtained; wherein, if the speed is greater than a speed threshold, the acceleration of the target device is sampled.
[0131] In the embodiment of the present application, if the chip bottom layer of the target device does not report the estimated accuracy, the heading accuracy of the target device can be judged by the current speed of the target device to determine whether it meets the heading accuracy threshold. For example, if the speed>2m / s is considered as the speed threshold, the heading is selected based on this threshold. If the speed of the target device is greater than the speed threshold, it is determined that the GPS accuracy of the target device meets the condition. At this time, the initial attitude information is obtained by sampling the acceleration.
[0132] In an embodiment of the present application, the heading accuracy of the target device and / or the speed of the target device can be used to determine whether to obtain the initial heading angle through the positioning system of the target device. When the heading accuracy of the target device is greater than the heading accuracy threshold and / or the speed of the target device is greater than the speed threshold, the initial heading angle is obtained based on the positioning system of the target device.
[0133] The following is a further description of the heading estimation method provided in the embodiment of the present application.
[0134] In the heading estimation method provided in the embodiment of the present application, when the GPS accuracy meets the validity requirement and the heading accuracy meets the threshold, the algorithm is started, and the initial posture is calculated in combination with the accelerometer sampling value. Subsequently, the gyroscope can be used for posture recursion, and the pedestrian's heading can be given without relying on GPS.
[0135] The heading estimation method provided in the embodiment of the present application is as follows: Figure 4 As shown, including:
[0136] S401, determining whether the GPS heading accuracy meets the navigation accuracy threshold.
[0137] For devices that report the estimated heading accuracy at the bottom layer of the chip, the heading accuracy threshold can be set directly as needed, usually 5 degrees can meet the needs. If the bottom layer of the chip does not report the estimated accuracy, the user's current speed can be judged. For example, if the heading of a scene with a speed greater than 2m / s is considered to be more accurate, this can be used as the threshold to select the heading. If the heading accuracy of the GPS meets the heading accuracy threshold, execute S402, otherwise continue to execute S401.
[0138] S402: Initialize the posture to obtain the initial posture quaternion.
[0139] S403: Output the heading based on the angle data obtained by the gyroscope.
[0140] In S402, if Figure 5A As shown, including:
[0141] S4021. Perform acceleration sampling.
[0142] With an acceleration sampling rate of 50 Hz, after acquiring 50 acceleration sampling values per second, the modulus value of each acceleration is taken.
[0143] S4022. Determine a quasi-static point based on the acceleration results.
[0144] Detect the peaks and troughs in the acceleration sampling sequence, take the middle value of a pair of peaks and troughs as the quasi-static point, and record its index value. The index value represents the position of the quasi-static point in the corresponding point of the sampling sequence.
[0145] The index is the corresponding serial number of the sampling value stored in the array in chronological order, and the corresponding acceleration sampling value can be obtained by pressing the serial number.
[0146] Among them, in static state, the acceleration only includes the acceleration due to gravity; but due to human body movement, the measurement value of the accelerometer always includes the acceleration of human body movement other than gravity. Here, the point with the smallest acceleration within 1s is regarded as static state, which is called quasi-static state.
[0147] S4023. Calculate the pitch angle and roll angle in quasi-static state.
[0148] Read the three-axis acceleration sampling value [Gx, Gy, Gz] of the quasi-static point according to the index and substitute it into formula (2):
[0149]
[0150] In formula (1C), b represents the mobile phone system, n represents the navigation system, It represents the rotation matrix from the navigation system to the local system, G represents the gravitational acceleration of the local system, G can be expressed as [Gx, Gy, Gz], and g represents the local gravitational acceleration.
[0151] When the 2-1-3 rotation mode is adopted, there is formula (3):
[0152]
[0153] In formula (2), θ is the roll angle (rotation around the y-axis), γ is the pitch angle (rotation around the x-axis), and ψ is the heading angle (rotation around the z-axis).
[0154] Here, the 2-1-3 rotation mode can be understood as a rotation mode of rotating the Y axis first, then the X axis, and finally the Z axis.
[0155] From formula (2) and formula (3), the pitch angle and roll angle shown in formula (4) and formula (5) can be obtained:
[0156]
[0157]
[0158] S4024. Output an initial attitude quaternion based on the pitch angle and roll angle in the quasi-static state.
[0159] The current GPS heading angle is set as the heading angle ψ, and the initial attitude angle is completed (note that the attitude at this moment is neither the attitude of a mobile phone / watch nor the attitude of a pedestrian).
[0160] The initial attitude quaternion is completed based on the initial attitude angle. The initial attitude quaternion can be calculated by formula (6):
[0161]
[0162] Considering that the gyro-integrated attitude is the rotation of the navigation system relative to the local system, the initial attitude quaternion is transformed as shown in formula (7):
[0163]
[0164] In the embodiment of the present application, the initial posture quaternion belongs to a four-dimensional complex number, q nb (1:3) represents the vector part of the attitude quaternion, q nb (4) represents the scalar part of the quaternion.
[0165] Formula (5) is the inverse of the attitude quaternion (in the embodiments of the present application, the attitude quaternions are all unit quaternions, that is, the modulus is 1).
[0166] In S403, if Figure 5B As shown, including:
[0167] S4031. Select the maximum angular velocity among the angular velocity samples, and record its index as the target index.
[0168] Considering that the gyro sampling rate is 50Hz, the angular velocity of the Z axis is sampled to detect the peak. In the case of multiple peaks, the peak with the largest angular velocity is selected and its index is recorded.
[0169] S4032. Update each angular velocity sample according to the attitude quaternion to obtain a target quaternion corresponding to each angular velocity.
[0170] Among them, according to the angular velocity sampling w, the initial attitude quaternion q bn Update to obtain the target attitude quaternion corresponding to each acceleration sampling value, as shown in formula (1C):
[0171]
[0172] S4033. Determine the target attitude quaternion corresponding to the target index from the target attitude quaternions sampled from each angular velocity.
[0173] From the 40 target attitude quaternions calculated in S4032, select the target attitude quaternion corresponding to the target index in S4031, and negate the target attitude quaternion to obtain the target attitude q of the body relative to the navigation system nb , according to the 2-1-3 rotation mode, the body is rotated relative to the target attitude q of the navigation system nb Converted into attitude angle, the rotation angle corresponding to the Z axis is the final pedestrian heading.
[0174] When the target attitude quaternion of the body relative to the navigation system is converted into the target attitude angle according to the rotation mode of 2-1-3, the corresponding relationship can be established through the appropriate rotation matrix elements, and the inverse trigonometric function can be solved by the elements of the corresponding quaternion.
[0175] An electronic device implemented as a target device in an embodiment of the present application is as follows: Figure 6 As shown, the electronic device 600 includes:
[0176] A first determining unit 601 is configured to determine a target angular velocity at a target position among at least two sampled angular velocities of a target device, wherein the heading angle at the target position represents the heading of the target device;
[0177] A second determining unit 602 is configured to determine target posture information corresponding to the target angular velocity based on the initial posture information and the at least two sampled angular velocities, wherein the initial posture information represents the posture of the target device in an initial state, the target posture information represents the posture of the target device when the angular velocity is the target angular velocity, and the acceleration of the target device in the initial state is the acceleration of gravity;
[0178] The conversion unit 603 is configured to convert the target posture information to obtain the heading angle of the target device at the target position.
[0179] In some embodiments, the first determining unit 601 is further configured to:
[0180] Determine the angular velocity of each of the at least two sampled angular velocities on the Z axis to obtain at least two angular velocities on the Z axis;
[0181] Determine at least one Z-axis angular velocity peak among the angular velocities on the at least two Z-axes;
[0182] The sampled angular velocity corresponding to the maximum angular velocity peak among the at least one Z-axis angular velocity peak among the at least two sampled angular velocities is determined as the target angular velocity.
[0183] In some embodiments, the second determining unit 602 is further configured to:
[0184] Based on the initial posture information and the at least two sampled angular velocities, recursively derive the target posture information corresponding to each of the at least two sampled angular velocities to obtain at least two target posture information;
[0185] From the at least two pieces of target posture information, select the target posture information corresponding to the target angular velocity.
[0186] In some embodiments, the second determining unit 602 is further configured to:
[0187] For each of the at least two sampled angular velocities, the following processing is performed:
[0188] If the sampling speed is the first sampling angular speed of the at least two sampling angular speeds, the initial posture information is updated by the sampling angular speed to obtain the target posture information corresponding to the sampling angular speed;
[0189] If the sampling speed is not the first sampling angular speed of the at least two sampling angular speeds, the reference posture information is updated by the sampling angular speed to obtain the target posture information corresponding to the sampling angular speed, and the reference posture information is the target posture information corresponding to the previous sampling angular speed of the at least two sampling angular speeds.
[0190] In some embodiments, the electronic device further includes: a first initial unit configured to:
[0191] Determine an initial attitude angle of the target device in the initial state based on an initial acceleration, a gravitational acceleration and an initial heading angle, wherein the initial acceleration is the acceleration of the target device in the initial state, and the initial heading angle is the heading angle collected by the positioning system of the target device when the target device is in the initial state;
[0192] The initial attitude angle is converted into the initial attitude quaternion.
[0193] In some embodiments, the electronic device further includes: a second initial unit configured to:
[0194] Sampling the acceleration of the target device to obtain a sampled acceleration sequence consisting of at least two sampled accelerations;
[0195] Determine a first sampled acceleration and a second sampled acceleration in the sampled acceleration sequence, wherein the first sampled acceleration and the second sampled acceleration are respectively a pair of peak sampled acceleration and trough sampled acceleration in the sampled acceleration sequence;
[0196] The initial acceleration is determined based on the first sampled acceleration and the second sampled acceleration.
[0197] In some embodiments, the second initialization unit is further configured to:
[0198] A sampled acceleration located between the first sampled acceleration and the second sampled acceleration in the sampled acceleration sequence is determined as the initial acceleration.
[0199] In some embodiments, the electronic device further includes: a first acquisition unit configured to:
[0200] Obtaining the heading accuracy of the target device; wherein, if the heading accuracy is greater than a heading accuracy threshold, sampling the acceleration of the target device.
[0201] In some embodiments, the electronic device further includes: a second acquisition unit configured to:
[0202] The speed of the target device is obtained; wherein, if the speed is greater than a speed threshold, the acceleration of the target device is sampled.
[0203] In actual applications, the above-mentioned first determination unit, second determination unit, first initial unit, second initial unit, first acquisition unit, second acquisition unit and other modules can be implemented by a processor located on the electronic device, specifically a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), or a microprocessor implemented as a fast charging module.
[0204] Those skilled in the art should understand that the relevant description of the above-mentioned electronic device in the embodiment of the present application can be understood with reference to the relevant description of the heading estimation method in the embodiment of the present application.
[0205] Figure 7 An optional implementation of the present application is provided as a schematic diagram of the structure of an electronic device, such as Figure 8 As shown, an embodiment of the present application provides an electronic device 700, including an electronic chip 701, which can be implemented as a heading estimation method as described in one or more embodiments above. The electronic chip can be implemented as a processor of an electronic device or as a microprocessor of a fast charging module.
[0206] An embodiment of the present application provides an electronic device, Figure 8 Another optional implementation provided in the embodiment of the present application is a structural diagram of an electronic device, such as Figure 8 As shown, an embodiment of the present application provides an electronic device 800, including:
[0207] A processor 801 and a storage medium 802 storing executable instructions of the processor 801, wherein the storage medium 802 relies on the processor 801 to perform operations through a communication bus 803, and when the instructions are executed by the processor 801, the heading estimation method performed in one or more of the above embodiments is executed.
[0208] It should be noted that, in actual application, the various components in the terminal are coupled together via the communication bus 803. It is understandable that the communication bus 803 is used to realize the connection and communication between these components. In addition to the data bus, the communication bus 803 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 8 Various buses are labeled as communication buses 803.
[0209] An embodiment of the present application provides a computer storage medium, wherein the computer-readable storage medium is used to store a computer program, wherein the computer program enables a computer to execute the steps of the heading estimation method described in one or more of the above embodiments.
[0210] An embodiment of the present application provides a schematic structural diagram of an electronic device 900. Fig. 9 The electronic device 900 shown includes a processor 910. The processor 910 is configured to:
[0211] Determine a target angular velocity at a target position among at least two sampled angular velocities of the target device, wherein the heading angle at the target position represents the heading of the target device;
[0212] Determine, based on the initial posture information and the at least two sampled angular velocities, target posture information corresponding to the target angular velocity, wherein the initial posture information represents the posture of the target device in an initial state, the target posture information represents the posture of the target device when the angular velocity of the target device is the target angular velocity, and the acceleration of the target device in the initial state is the acceleration of gravity;
[0213] The target posture information is converted to obtain the heading angle of the target device at the target position.
[0214] In the embodiment of the present application, the processor 910 can call and run a computer program from the memory to implement the heading estimation method in the embodiment of the present application.
[0215] Alternatively, if Fig. 9 As shown, the electronic device 900 may further include a memory 920. The processor 910 may call and run a computer program from the memory 920 to implement the heading estimation method in the embodiment of the present application.
[0216] The memory 920 may be a separate device independent of the processor 910 , or may be integrated into the processor 910 .
[0217] Alternatively, if Fig. 9As shown, the electronic device 900 may further include a transceiver 930. The processor 910 may control the transceiver 930 to communicate with other devices, specifically, to receive signals sent by other devices. Here, the transceiver may include at least two antennas.
[0218] Understandable, Figures 7 to 9 The electronic device shown in any of the figures may also include an angular velocity sensor and an acceleration sensor. The angular velocity sensor is used to collect the angular velocity of the electronic device, and the acceleration sensor is used to collect the acceleration of the electronic device.
[0219] Optionally, the electronic device 900 can implement the corresponding processes implemented by the electronic device in each method of the embodiment of the present application, and for the sake of brevity, it will not be repeated here. It should be understood that the processor of the embodiment of the present application may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Arra y, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0220] It can be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0221] It should be understood that the above-mentioned memory is exemplary but not restrictive. For example, the memory in the embodiments of the present application may also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate S DRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) and direct RAM bus random access memory (Direct RAM, DR RAM), etc. That is to say, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.
[0222] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program.
[0223] Optionally, the computer-readable storage medium can be applied to the electronic device in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the electronic device in the various methods of the embodiments of the present application. For the sake of brevity, they are not repeated here.
[0224] An embodiment of the present application also provides a computer program product, including computer program instructions.
[0225] Optionally, the computer program can be applied to the electronic device in the embodiments of the present application. When the computer program runs on a computer, the computer executes the corresponding processes implemented by the electronic device in the various methods of the embodiments of the present application. For the sake of brevity, they are not described here.
[0226] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0227] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0228] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0229] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0230] 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 separately, or two or more units may be integrated into one unit.
[0231] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0232] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A heading estimation method, characterized in that: The method comprises: Determine a target angular velocity at a target position among at least two sampled angular velocities of the target device, wherein the heading angle at the target position represents the heading of the target device; Determine, based on the initial posture information and the at least two sampled angular velocities, target posture information corresponding to the target angular velocity, wherein the initial posture information represents the posture of the target device in an initial state, the target posture information represents the posture of the target device when the angular velocity of the target device is the target angular velocity, and the acceleration of the target device in the initial state is the acceleration of gravity; The target posture information is converted to obtain the heading angle of the target device at the target position.
2. The method according to claim 1, characterized in that The step of determining a target angular velocity of at least two sampled angular velocities of the target device at the target position comprises: Determine the angular velocity of each of the at least two sampled angular velocities on the Z axis to obtain at least two angular velocities on the Z axis; Determine at least one Z-axis angular velocity peak among the angular velocities on the at least two Z-axes; The sampled angular velocity corresponding to the maximum angular velocity peak among the at least one Z-axis angular velocity peak among the at least two sampled angular velocities is determined as the target angular velocity.
3. The method according to claim 1, characterized in that The step of determining the target attitude information corresponding to the target angular velocity based on the initial attitude information and the at least two sampled angular velocities includes: Based on the initial posture information and the at least two sampled angular velocities, recursively derive the target posture information corresponding to each of the at least two sampled angular velocities to obtain at least two target posture information; From the at least two pieces of target posture information, select the target posture information corresponding to the target angular velocity.
4. The method according to claim 3, characterized in that The step of recursively deducing target posture information corresponding to each of the at least two sampling angular velocities based on the initial posture information and the at least two sampling angular velocities to obtain at least two target posture information includes: For each of the at least two sampled angular velocities, the following processing is performed: If the sampling speed is the first sampling angular speed of the at least two sampling angular speeds, the initial posture information is updated by the sampling angular speed to obtain the target posture information corresponding to the sampling angular speed; If the sampling speed is not the first sampling angular speed of the at least two sampling angular speeds, the reference posture information is updated by the sampling angular speed to obtain the target posture information corresponding to the sampling angular speed, and the reference posture information is the target posture information corresponding to the previous sampling angular speed of the at least two sampling angular speeds.
5. The method according to claim 1, characterized in that: The initial posture information includes an initial posture quaternion, and the method further includes: Determine an initial attitude angle of the target device in the initial state based on an initial acceleration, a gravitational acceleration and an initial heading angle, wherein the initial acceleration is the acceleration of the target device in the initial state, and the initial heading angle is the heading angle collected by the positioning system of the target device when the target device is in the initial state; The initial attitude angle is converted into the initial attitude quaternion.
6. The method according to claim 5, characterized in that The method further comprises: Sampling the acceleration of the target device to obtain a sampled acceleration sequence consisting of at least two sampled accelerations; Determine a first sampled acceleration and a second sampled acceleration in the sampled acceleration sequence, wherein the first sampled acceleration and the second sampled acceleration are respectively a pair of peak sampled acceleration and trough sampled acceleration in the sampled acceleration sequence; The initial acceleration is determined based on the first sampled acceleration and the second sampled acceleration.
7. The method according to claim 6, characterized in that: The determining the initial acceleration based on the first sampled acceleration and the second sampled acceleration comprises: A sampled acceleration located between the first sampled acceleration and the second sampled acceleration in the sampled acceleration sequence is determined as the initial acceleration.
8. The method according to claim 6, characterized in that The method further comprises: Obtaining the heading accuracy of the target device; wherein, if the heading accuracy is greater than a heading accuracy threshold, sampling the acceleration of the target device.
9. The method according to claim 6, characterized in that The method further comprises: The speed of the target device is obtained; wherein, if the speed is greater than a speed threshold, the acceleration of the target device is sampled.
10. An electronic device, characterized in that: The electronic device comprises: A first determining unit is configured to determine a target angular velocity at a target position among at least two sampled angular velocities of the target device, wherein the heading angle at the target position represents the heading of the target device; a second determining unit, configured to determine target posture information corresponding to the target angular velocity based on the initial posture information and the at least two sampled angular velocities, wherein the initial posture information represents the posture of the target device in an initial state, the target posture information represents the posture of the target device when the angular velocity of the target device is the target angular velocity, and the acceleration of the target device in the initial state is the acceleration of gravity; The conversion unit is configured to convert the target posture information to obtain a heading angle of the target device at the target position.
11. An electronic device, comprising a processor, characterized in that: The processor is configured to: Determine a target angular velocity at a target position among at least two sampled angular velocities of the target device, wherein the heading angle at the target position represents the heading of the target device; Determine, based on the initial posture information and the at least two sampled angular velocities, target posture information corresponding to the target angular velocity, wherein the initial posture information represents the posture of the target device in an initial state, the target posture information represents the posture of the target device when the angular velocity of the target device is the target angular velocity, and the acceleration of the target device in the initial state is the acceleration of gravity; The target posture information is converted to obtain the heading angle of the target device at the target position.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps in the heading estimation method according to any one of claims 1 to 9 are implemented.
13. A storage medium storing an executable program, characterized in that: When the executable program is executed by a processor, the heading estimation method according to any one of claims 1 to 9 is implemented.
14. A chip, comprising a processor, characterized in that: The processor is configured to execute the heading estimation method according to any one of claims 1 to 9.