WO2023220972A1 - Mobile device, pose estimation method and apparatus therefor, and storage medium - Google Patents

Mobile device, pose estimation method and apparatus therefor, and storage medium Download PDF

Info

Publication number
WO2023220972A1
WO2023220972A1 PCT/CN2022/093607 CN2022093607W WO2023220972A1 WO 2023220972 A1 WO2023220972 A1 WO 2023220972A1 CN 2022093607 W CN2022093607 W CN 2022093607W WO 2023220972 A1 WO2023220972 A1 WO 2023220972A1
Authority
WO
WIPO (PCT)
Prior art keywords
pose
data
posture
mobile device
boundary
Prior art date
Application number
PCT/CN2022/093607
Other languages
French (fr)
Chinese (zh)
Inventor
王琪
Original Assignee
北京小米移动软件有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京小米移动软件有限公司 filed Critical 北京小米移动软件有限公司
Priority to PCT/CN2022/093607 priority Critical patent/WO2023220972A1/en
Publication of WO2023220972A1 publication Critical patent/WO2023220972A1/en

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C21/00Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
    • G01C21/10Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 by using measurements of speed or acceleration
    • G01C21/12Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 by using measurements of speed or acceleration executed aboard the object being navigated; Dead reckoning
    • G01C21/16Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 by using measurements of speed or acceleration executed aboard the object being navigated; Dead reckoning by integrating acceleration or speed, i.e. inertial navigation

Definitions

  • the present disclosure relates to the technical field of mobile robots, and specifically to a mobile device and its pose estimation method, device, and storage medium.
  • the pose estimation of a mobile device is an important prerequisite for autonomous navigation.
  • an inertial measurement unit IMU
  • IMU inertial measurement unit
  • the autonomous navigation system of mobile devices is susceptible to interference and influence from complex environments, which causes the mobile device's pose estimation to drift and affects the pose estimation accuracy.
  • embodiments of the present disclosure provide a mobile device and its pose estimation method, device, and storage medium.
  • embodiments of the present disclosure provide a pose estimation method, which is applied to mobile devices.
  • the method includes:
  • the first pose set of the mobile device at the current moment is obtained through the first sensor of the mobile device
  • the second pose set of the mobile device at the current moment is obtained through the second sensor of the mobile device
  • the first pose set and the second pose set include pose data at the current moment and several previous sampling moments
  • the first posture weight and the second posture weight According to the first posture weight and the second posture weight, the first posture data and the second posture data at the current moment are fused to obtain the target posture of the mobile device at the current moment.
  • obtaining the first attitude set of the mobile device at the current moment through the first sensor of the mobile device includes:
  • the first attitude set is obtained based on the first attitude data at the current time and the first attitude data at a preset number of sampling times before the current time.
  • obtaining the second pose set of the mobile device at the current moment through the second sensor of the mobile device includes:
  • the second pose set is obtained based on the second pose data at the current time and the second pose data at a preset number of sampling times before the current time.
  • the first pose change rate of the mobile device is determined based on the first pose set
  • the second pose change rate of the mobile device is determined based on the second pose set
  • the first slope is determined as the first posture change rate
  • the second slope is determined as the second posture change rate
  • the process of performing the boundary numerical processing on any one of the first pose set and the second pose set includes:
  • the element value of the positive value is reduced by a preset value to obtain the target set.
  • determining the first posture weight of the mobile device at the current moment based on the difference between the first posture change rate and the second posture change rate includes:
  • Kalman filtering is performed on the variance of the first attitude data at several sampling moments before the current moment to obtain the current moment.
  • the first position weight is the difference between the first attitude change rate and the second attitude change rate.
  • the second sensor includes a magnetometer; determining the second pose weight of the mobile device at the current moment includes:
  • the geomagnetic mode length is calculated based on the second pose data at the current moment
  • the second pose weight is determined according to the geomagnetic mode length.
  • the first posture data and the second posture data at the current moment are fused according to the first posture weight value and the second posture weight value to obtain the movement
  • the target pose of the device at the current moment including:
  • Kalman filtering is performed on the first posture data and the second posture data at the current moment to obtain the target position of the mobile device at the current moment. posture.
  • the first sensor includes a gyroscope and the second sensor includes a magnetometer.
  • inventions of the present disclosure provide a pose estimation device, which is applied to mobile devices.
  • the device includes:
  • the acquisition module is configured to obtain the first attitude set of the mobile device at the current moment through the first sensor of the mobile device, and obtain the second attitude set of the mobile device at the current moment through the second sensor of the mobile device.
  • a pose set wherein the first pose set and the second pose set include pose data at the current moment and several previous sampling moments;
  • a change rate determination module configured to determine a first posture change rate of the mobile device according to the first posture set, and determine a second posture change rate of the mobile device according to the second posture set;
  • a weight determination module configured to determine the first posture weight and the second posture weight of the mobile device at the current moment based on the difference between the first posture change rate and the second posture change rate. value
  • the data fusion module is configured to perform fusion processing on the first posture data and the second posture data at the current moment according to the first posture weight value and the second posture weight value to obtain the mobile device.
  • the target pose at the current moment is configured to perform fusion processing on the first posture data and the second posture data at the current moment according to the first posture weight value and the second posture weight value to obtain the mobile device.
  • the acquisition module is configured to:
  • the first attitude set is obtained based on the first attitude data at the current time and the first attitude data at a preset number of sampling times before the current time.
  • the acquisition module is configured to:
  • the second pose set is obtained based on the second pose data at the current time and the second pose data at a preset number of sampling times before the current time.
  • the rate of change determination module is configured to:
  • the first slope is determined as the first posture change rate
  • the second slope is determined as the second posture change rate
  • the rate of change determination module is configured to:
  • the rate of change determination module is configured to:
  • the element value of the positive value is reduced by a preset value to obtain the target set.
  • the weight determination module is configured to:
  • Kalman filtering is performed on the variance of the first attitude data at several sampling moments before the current moment to obtain the current moment.
  • the first position weight is the difference between the first attitude change rate and the second attitude change rate.
  • the second sensor includes a magnetometer; the weight determination module is configured to:
  • the geomagnetic mode length is calculated based on the second pose data at the current moment
  • the second pose weight is determined according to the geomagnetic mode length.
  • the data fusion module is configured to:
  • Kalman filtering is performed on the first posture data and the second posture data at the current moment to obtain the target position of the mobile device at the current moment. posture.
  • the first sensor includes a gyroscope and the second sensor includes a magnetometer.
  • an embodiment of the present disclosure provides a mobile device, including:
  • a memory stores computer instructions for causing the processor to execute the method according to any implementation manner of the first aspect.
  • an embodiment of the present disclosure provides a storage medium that stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any embodiment of the first aspect.
  • the pose estimation method in the embodiment of the present disclosure includes obtaining the first pose set at the current time through the first sensor and determining the first pose change rate, and obtaining the second pose set at the current time through the second sensor and determining the second pose estimation method.
  • the pose change rate based on the difference between the first pose change rate and the second pose change rate, determines the first pose weight and the second pose weight, based on the first pose weight and the second pose weight.
  • the weight fuses the first pose data and the second pose data at the current moment to obtain the target pose of the mobile device at the current moment.
  • the reliability of the two at the current moment is determined, and the pose weights of the two are dynamically adjusted based on the reliability. This can effectively eliminate or alleviate the defects of data distortion caused by signal interference, and improve the accuracy of the target pose obtained after data fusion.
  • Figure 1 is a structural block diagram of a mobile device according to some embodiments of the present disclosure.
  • Figure 2 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
  • Figure 3 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
  • Figure 4 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
  • Figure 5 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
  • Figure 6 is a schematic diagram of a pose estimation method according to some embodiments of the present disclosure.
  • Figure 7 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
  • Figure 8 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
  • Figure 9 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
  • Figure 10 is a structural block diagram of a pose estimation device according to some embodiments of the present disclosure.
  • an inertial measurement unit can usually be used to obtain the pose information of a mobile device through a multi-sensor fusion method.
  • the robot's pose can be directly integrated over time through the robot's gyroscope, accelerometer and other inertial measurement sensors. This method is feasible in a short time, but after the robot moves for a long time, the drift of the gyroscope itself and the influence of the body vibration on the gyroscope will cause distortion of the pose data.
  • this method is suitable for scenarios where the magnetic field environment of the body is single and there is no electromagnetic interference, such as high-altitude flight scenarios of drones.
  • the surrounding magnetic field environment is complex and changeable, which will have a great impact on the magnetometer, resulting in inaccurate estimation of the robot's pose.
  • GPS satellite positioning and gyroscope take the fusion of GPS satellite positioning and gyroscope as an example. This method is suitable for scenarios where the body is outdoors, such as outdoor robots, drones, etc. For robots that move indoors, the GPS signal is weak, the positioning is inaccurate, and it cannot provide accurate pose correction, resulting in inaccurate pose estimation.
  • embodiments of the present disclosure provide a mobile device and its pose estimation method, device, and storage medium, aiming to improve the pose estimation accuracy of the mobile device and reduce the impact of complex environments on sensor accuracy. Impact, without the need to fuse more sensor data, the current environmental conditions of the device can be judged and identified, and the fusion algorithm can be adjusted accordingly to improve the pose estimation accuracy of the device in complex environments.
  • FIG. 1 shows a structural block diagram of a mobile device in some embodiments of the present disclosure, which will be described below with reference to Figure 1 .
  • a mobile device 600 of an example of the present disclosure includes a processor 601, a memory 602, a first sensor 604, a second sensor 605, and a driving device 606.
  • the processor 601, the memory 602, the first sensor 604, the second sensor 605 and the driving device 606 establish a communicable connection between any two through the bus 603.
  • the processor 601 can be any type of processor with one or more processing cores. It can perform single-threaded or multi-threaded operations and is used to parse instructions to perform operations such as obtaining data, performing logical operation functions, and issuing operation processing results.
  • Memory 602 may include non-volatile computer-readable storage media, such as at least one disk storage device, flash memory device, distributed storage device remotely located relative to processor 601, or other non-volatile solid-state storage device.
  • the memory may have a program storage area for storing non-volatile software programs, non-volatile computer executable programs and modules for the processor 601 to call to cause the processor 601 to perform one or more method steps.
  • the memory 602 may also include a storage part such as a volatile random access storage medium or a hard disk as a data storage area for storing operation processing results and data output by the processor 601.
  • the first sensor 604 may be an inertial measurement unit provided on the mobile device.
  • the first sensor 604 may include a gyroscope, an accelerometer, an angular velocity meter, etc.
  • the first sensor 604 may detect the mobile device. The first pose data.
  • the second sensor 605 may be a different type of measurement unit than the first sensor 604 provided on the mobile device.
  • the second sensor 605 may include a magnetometer.
  • the second sensor 605 may detect the mobile device. The second pose data.
  • the second sensor 605 is used to correct the observation data of the first sensor 604 to obtain more accurate pose data.
  • the process of data fusion will be specifically described in the method below of the disclosure. .
  • the driving device 606 is the power system of the mobile device and is used to drive the mobile device 600 to generate displacement.
  • the driving device 606 may include mechanical structures such as a motor, a transmission mechanism, and a roller. Those skilled in the art will undoubtedly understand and fully implement this, and will not be described in detail in this disclosure.
  • embodiments of the present disclosure provide a pose estimation method for real-time estimation of the pose of the mobile device 600 when it is moving. This method can be used by the processor of the mobile device 600. 601 is executed, which will be described below with reference to the implementation in Figure 2 .
  • the pose estimation method of the present disclosure includes:
  • the first sensor and the second sensor will collect the pose data at the current moment in a fixed sampling period, so that the target pose at the current moment can be obtained in real time through a multi-sensor fusion algorithm.
  • the sampling frequency of the first sensor and the second sensor is 10 Hz, that is, pose data is collected 10 times per second, so the processor of the mobile device also performs pose estimation 10 times per second.
  • data fusion is not directly based on the pose data of the first sensor and the second sensor. This is because, considering that in a complex environment, the detection signals of the first sensor and/or the second sensor will be interfered, resulting in large errors in the collected pose data. For example, taking the magnetometer as an example, in a scene with a complex magnetic field environment, the detection signal of the magnetometer is greatly interfered, resulting in a large deviation between the pose data collected by the magnetometer and the actual pose, which in turn causes the data to be fused. There is a large error in the obtained target pose.
  • the environmental conditions of the mobile robot are currently judged and identified, thereby determining whether the working status of the first sensor and the second sensor is reliable. And based on the current reliability of the two, the weight parameters of the first pose data and the second pose data during the data fusion process are dynamically adjusted in real time to ensure the accuracy of the target pose of the mobile device obtained by data fusion and reduce Interference of environmental factors on the sensor.
  • the first attitude data of each sampling moment can be calculated based on the sampling data of the first sensor.
  • the second attitude data of each sampling moment can be calculated based on the sampling data of the second sensor. pose data.
  • the first pose set can be established based on the first pose data of the current time t and several previous sampling moments, which can be expressed as:
  • formula (1) represents the first pose set, Represents the first pose data at the current time t, Represents the first attitude data at the sampling time t-1... and so on, so that the first attitude set includes a total of N first attitude data at the sampling time.
  • the second pose set can be established based on the second pose data of the current time t and several previous sampling moments, expressed as:
  • formula (2) represents the second pose set, Represents the second pose data at the current time t, Represents the second pose data at the sampling time t-1... and so on, so that the second pose set includes a total of N second pose data at the sampling time.
  • first pose set and the second pose set represent a set of pose data for a period of time before the current time.
  • the first pose set represents the pose data of the mobile device for a period of time before the current moment calculated based on the data collected by the first sensor, which can reflect the changing trend of the pose data sampled by the first sensor.
  • the first pose set represents the pose data of the mobile device for a period of time before the current moment calculated based on the data collected by the second sensor, which can reflect the changing trend of the pose data sampled by the second sensor.
  • the first pose set and the second pose set correspond to the movement process of the mobile device within the same period of time. Therefore, in the absence of signal interference, theoretically the change trends of the two should be consistent or close. And if one or both parties are subject to signal interference, the changing trends of the two should be quite different.
  • the first posture change rate can be used to reflect the change trend of each first posture data in the first posture set, and the first posture change rate can be used to reflect each second posture data in the second posture set.
  • the difference between the second posture change rate of the change trend determines whether the current first sensor and/or the second sensor are in a reliable state.
  • linear regression processing can be performed based on each first attitude data included in the first attitude set, the first straight line is obtained by fitting, and the first slope of the first straight line is used as the first attitude change. Rate.
  • linear regression processing can be performed based on each second pose data included in the second pose set, a second straight line is obtained by fitting, and the second slope of the second straight line is used as the second pose change rate.
  • the first attitude change rate can reflect the changing trend of the sampling data of the first sensor
  • the second attitude change rate can reflect the changing trend of the sampling data of the second sensor
  • the difference between the first posture change rate and the second posture change rate is very small, it means that the trends of the posture data calculated by the first sensor and the second sensor are the same, and it also indicates that the current trend is the same.
  • Mobile devices operate in an environment with few distractions.
  • the difference between the first posture change rate and the second posture change rate is large, it means that the trends of the posture data calculated by the first sensor and the second sensor are not the same, or Indicates that the current environment where the mobile device is located is very disruptive.
  • different pose weights of the first sensor and the second sensor can be dynamically adjusted based on the above different situations.
  • the pose weights can be understood as the influence of the sensor's pose data on the target pose.
  • the calculated target pose is more inclined to the first pose data; conversely, if the weight of the second pose is smaller.
  • the weight of one pose is very small, the weight of the second pose is large, and the calculated target pose is more inclined to the second pose data.
  • the first sensor is a gyroscope and the second sensor is a magnetometer. If the difference between the first pose change rate and the second pose change rate is very small, it means that the signal interference of the environment at the current moment is very small, and only the second pose weight of the second pose data can be adjusted. This is due to the higher reliability of the gyroscope relative to the magnetometer when neither the gyroscope nor the magnetometer is disturbed.
  • the first attitude weight and the second attitude weight of the first attitude data can be adjusted at the same time.
  • the second pose weight of the pose data reduces the impact of signal interference.
  • the first posture data can be calculated through the data collected by the first sensor
  • the second posture data can be calculated through the data collected by the second sensor.
  • the first pose data and the second pose data can be fused based on the pose weight, so that Determine the target pose of the mobile device at the current time t.
  • a Kalman filter method can be used to fuse the first pose data and the second pose data to obtain the target pose. This will be described in the following embodiments of the present disclosure and will not be described in detail here.
  • the reliability of the first sensor and the second sensor at the current moment is determined by comparing the changing trends of the sampling data of the first sensor and the second sensor, and the positions of the two are dynamically adjusted based on the reliability. pose weights, which can effectively eliminate or alleviate the defects of data distortion caused by signal interference, and improve the accuracy of the target pose obtained after data fusion.
  • the pose of an object in three-dimensional space can be represented by three-dimensional position coordinates (x, y, z) and three-dimensional attitude ( ⁇ roll , ⁇ pitch , ⁇ yaw ), ⁇ roll represents the roll angle, and ⁇ pitch represents Pitch angle, ⁇ yaw represents the yaw angle.
  • the roll angle ⁇ roll and pitch angle ⁇ pitch themselves have very small motion amplitudes, and can be corrected by the accelerometer.
  • the accelerometer is almost not affected by environmental factors, and the obtained pose results can be compared It converges well, so the difficulty in its three-dimensional pose estimation lies in the estimation of the yaw angle ⁇ yaw .
  • the pose estimation method of the embodiments of the disclosure will be described by taking the pose estimation of the yaw angle ⁇ yaw of the ground mobile device as an example.
  • the pose estimation method in the embodiment of the present disclosure is not limited to this, and can be applied to any other pose estimation, which will not be described in detail in the present disclosure.
  • the first sensor of the mobile device is a gyroscope
  • the second sensor is a magnetometer.
  • the specific working principles of gyroscopes and magnetometers can undoubtedly be understood and fully implemented by those skilled in the art, and will not be described in detail in this disclosure.
  • the process of obtaining the first pose set includes:
  • the first sensor collects motion data of the mobile device every fixed sampling period, which is defined as the first motion data.
  • the first sensor is a gyroscope, and the gyroscope samples the yaw (yaw) angle data of the mobile device every 100 ms, which is the first motion data described in the disclosure.
  • the first motion data collected by the first sensor can be expressed as ⁇ z,t , that is, the angular velocity of the yaw angle of the fuselage at the sampling time t.
  • the motion information of the current moment needs to be accumulated to the pose result of the previous moment, so as to update the pose information in real time.
  • the corresponding first motion data is ⁇ z, t .
  • the previous sampling time is t-1, and the corresponding first motion data is ⁇ z, t-1.
  • the first attitude data corresponding to the sampling time t is expressed as:
  • Equation (3) Represents the yaw angle of the fuselage at the sampling time t obtained by gyroscope integration, that is, the first attitude data. Represents the yaw angle of the fuselage at the previous sampling time t-1. ⁇ t represents the sampling period of the gyroscope.
  • ⁇ z,t represents the angular velocity of the yaw angle sampled at time t
  • ⁇ z,t-1 represents the angular velocity of the yaw angle sampled at time t-1. thereby That is, it represents the average angular velocity of the fuselage yaw angle during the movement from time t-1 to time t.
  • the product of it and the sampling period ⁇ t is the movement angle of the fuselage yaw angle from time t-1 to time t, which is the disclosure
  • the first posture change data described in the embodiment Then the first attitude change data is accumulated into the yaw angle data at time t-1, and the yaw angle data at time t can be obtained.
  • the first posture set based on the first posture data for a period of time before the current time.
  • the first pose set is obtained, expressed as shown in Equation (1):
  • the process of obtaining the second pose set includes:
  • the second sensor collects motion data of the mobile device every fixed sampling period, which is defined as second motion data.
  • the second sensor is a magnetometer, and the magnetometer samples the magnetic field vector and pose angle data around the mobile device every 100 ms, which is the second motion data described in the present disclosure.
  • the process of the magnetometer calculating the yaw angle at each sampling moment can be expressed as:
  • linear regression can be performed on the two pose sets respectively to obtain the slope corresponding to the fitting straight line, and the changing trend of the two poses is determined based on the slope.
  • the process of determining the first pose change rate and the second pose change rate includes:
  • the movement process of the yaw angle is continuous, that is, the mobile device can continuously rotate within the range of 0° to 360°.
  • the yaw angle range of mobile devices is -180° to 180°, which is shown in Figure 6, which will lead to discontinuity at the 180° boundary.
  • the actual motion process of the mobile device from time t-N to time t is: rotation from 175° to 185°.
  • This is continuous in terms of the objective movement of the device, but in terms of the mathematical expression shown in Figure 6, the movement process is: movement from 175° to 180°, and then movement from -180° to -175°. It can be seen that there is a boundary crossing from 180° to -180 in this process, resulting in discontinuity in mathematical expression.
  • the discontinuity of mathematical expression will lead to the discontinuity of each element in the pose set.
  • the elements in the pose set are expressed as: [175,177,179,-179,-177,-175].
  • the real movement process represented by this pose set is: the body moves from 175° to 185°, but the first pose set
  • the elements in are not numerically continuous.
  • the pose set can be expressed as: [175,177,179,181,183,185], which means that each element in the pose set is numerically continuous.
  • the first pose set can be converted into the first target set
  • the second pose set can be converted into the second target set.
  • the process of performing boundary numerical processing on the first pose set and the second pose set will be specifically described in the embodiment of FIG. 7 below in this disclosure, and will not be described in detail here.
  • linear regression can be performed on the N elements included in each of the first target set and the second target set, and the corresponding first straight line and second straight line can be obtained by fitting.
  • the least squares method can be used to perform linear regression on the first target set and the second target set. Any one of the target sets will be used as an example for illustration.
  • I is an N*1 column matrix with all elements being 1, expressed as Based on equation (5) we can get:
  • Y ⁇ N , which is the element in the target set.
  • H [k,b] T
  • k represents the slope of the straight line obtained by fitting
  • b represents the intercept of the straight line obtained by fitting.
  • linear regression can be performed on the first target set to obtain the first slope k g of the corresponding first straight line, and linear regression can be performed on the second target set to obtain the second slope k m of the corresponding second straight line.
  • the first slope k g is determined as the first pose change rate corresponding to the first pose set
  • the second slope is determined as the second pose change rate corresponding to the second pose set.
  • first attitude change rate is the slope of the first straight line fitted according to each first attitude data of the first attitude set, which can reflect each first attitude data in the first attitude set. changing trends.
  • second pose change rate is the slope of the second straight line fitted according to each second pose data in the second pose set, which can reflect the change rate of each second pose data in the second pose set.
  • the trend consistency of the two can be determined through the difference between the first posture change rate and the second posture change rate.
  • the changing trend of the data collected by the first sensor and the second sensor is reflected through the pose data for a period of time before the current time, so that the current environment of the mobile device can be judged, and the third sensor can be used to determine the current environment of the mobile device.
  • the current reliability of the first sensor and the second sensor is quantitatively expressed.
  • the process of performing boundary numerical processing on any one of the first pose set and the second pose set includes:
  • the pose set is expressed as [170,171,172,173,174,175], which means that the yaw angle of the mobile device is rotated from 170° to 175°.
  • all element values are positive, and each element is numerically continuous.
  • the pose set is represented as [-175,-174,-173,-172,-171,-170], which indicates that the yaw angle of the mobile device is rotated from 185° to 190°.
  • all element values are negative, and each element is numerically continuous.
  • each element in the pose set includes both positive and negative values, it does not mean that the values of each element must be discontinuous.
  • the pose set is expressed as [175,177,179,-179,-177,-175], which means that the yaw angle of the mobile device is rotated from 175° to 185°.
  • the values of each element are not continuous because they cross the 180° boundary, and 181° will be represented as -179, resulting in discontinuous values.
  • the pose set is represented as [-5,-3,-1,1,3,5], which means that the yaw angle of the mobile device is rotated from 355° to 5°.
  • this pose set although it also includes both positive and negative elements, the value of each element is continuous because it spans the 0° boundary. Even if the value gradually changes from negative to positive, it is still continuously.
  • the 0° boundary is defined as the first boundary
  • the 180° boundary is defined as the second boundary.
  • the absolute values of all elements can be taken and the average value can be calculated, expressed as:
  • aver_N represents the average of the absolute values of N elements in the pose set
  • ⁇ N represents each element in the pose set.
  • S720 Determine the target boundary corresponding to the pose set based on the relationship between the first absolute value of the difference between the average value and the first boundary, and the magnitude relationship between the second absolute value of the difference between the average value and the second boundary.
  • the pose set when the pose set includes both positive elements and negative elements, it is necessary to further determine whether the pose set spans the first boundary or the second boundary.
  • the first boundary is the 0° boundary
  • the second boundary The boundary is the 180° boundary.
  • the average value obtained above and the absolute value of each boundary difference can be calculated respectively.
  • the target boundary spanned by the pose set can be determined.
  • the absolute value of the first difference between the average value and the first boundary is expressed as:
  • the absolute value of the second difference between the average value and the second boundary is expressed as:
  • the preset boundary is the second boundary. boundary.
  • the target boundary is the first boundary, it means that the pose set spans the 0° boundary, so that each element in the pose set is numerically continuous, so there is no need to perform numerical boundary processing, and the above-mentioned process is performed directly. Linear regression process is sufficient.
  • the target boundary is the second boundary, it means that the pose set spans the 180° boundary. Therefore, each element in the pose set is numerically discontinuous, and linear regression cannot be directly performed. Each element needs to be The element values are numerically converted to obtain a target set with continuous values. The process of numerical conversion is specifically described in the embodiment of FIG. 8 of the present disclosure below.
  • the pose estimation method of the present disclosure includes:
  • the target boundary corresponding to the pose set is the second boundary, it means that the pose set spans the 180° boundary.
  • Each element in the pose set is numerically discontinuous, and discontinuous values need to be converted into continuous values.
  • the number of positive values and negative values can be determined, and the smaller number can be converted into the larger number, thereby reducing the number of numerical values to be converted and improving calculation efficiency.
  • the pose set is expressed as [173,175,177,179,-179,-177], in which the positive values include 173, 175, 177 and 179, a total of 4, that is, the first number is 4. Negative values include -179 and -177, a total of 2, that is, the second number is 2.
  • the first quantity is greater than the second quantity, so all negative values need to be converted into positive values by increasing the preset value.
  • the preset value may be 360.
  • the pose set is expressed as [177,179,-179,-177,-175,-173], in which the positive values include 177 and 179, that is, the first number is 2.
  • the negative values include -179, -177, -175 and -173, a total of 4, that is, the second number is 4.
  • the first quantity is smaller than the second quantity, so all positive values need to be reduced by the preset value and converted into negative values.
  • the preset value may be 360.
  • the target set obtained after numerical conversion is expressed as [-183,-181,-179,-177,-175,-173], as you can see,
  • Each element in the target set is already numerically continuous.
  • boundary numerical processing is performed on the first pose set and the second pose set shown in equations (1) and (2) respectively, and the first target set and the second target set can be obtained, and then based on the aforementioned figure
  • the first attitude change rate represents the changing trend of the data collected by the first sensor
  • the second posture change rate represents the changing trend of the data collected by the second sensor.
  • a preset threshold may be set in advance, and the preset threshold represents a critical value at which the difference between the first posture change rate and the second posture change rate is large.
  • is not greater than the preset threshold, it means that the change trends of the first pose set and the second pose set are consistent, that is, the first sensor and the second sensor are not interfered with and have high reliability.
  • the preset threshold When the difference between the first pose change rate and the second pose change rate
  • the specific value of the preset threshold those skilled in the art can set it according to specific scenarios, and this disclosure does not limit this.
  • the difference between the first attitude change rate and the second attitude change rate is not greater than a preset threshold, it means that neither the first sensor nor the second sensor is interfered, and there is no need to monitor both. To perform interference adjustment on the weight value, you only need to maintain the original update process.
  • the first sensor is a gyroscope
  • the second sensor is a magnetometer.
  • the posture weight of the magnetometer can be adjusted without adjusting the position of the gyroscope. posture weight.
  • the process of determining the second pose weight of the magnetometer includes:
  • S910 Use the magnetometer to collect the second pose data at the current moment.
  • the magnetometer is a sensor that measures the strength of the environmental magnetic field.
  • the magnetic field strength can be measured by the magnetometer to obtain the required three-axis azimuth angle data.
  • the geomagnetic mode length B measured by the magnetometer will change, and the greater the degree of interference can be measured by the rate of change of the geomagnetic mode length.
  • the second pose data can be normalized to obtain the geomagnetic mode length B corresponding to the current time t, which is expressed as:
  • the geomagnetic mode length is 1.
  • the original first attitude weight update process can be maintained, and this disclosure will no longer Repeat.
  • the first posture weight is adjusted.
  • the first attitude weight can be adjusted based on Kalman filtering, which will be described in detail below.
  • the corresponding variance can be calculated, expressed as That is, the variance of the first posture weight of the past M sampling moments.
  • the process of adjusting the first pose weight at the current time t based on Kalman filtering can be expressed as:
  • K M represents the Kalman gain, expressed as:
  • the first attitude data of the current time t can be obtained
  • the corresponding first pose weight Get the second pose data at the current time t
  • the pose weights of each sensor during the data fusion process can be dynamically adjusted in real time, thereby eliminating or reducing the external environment. Interference with the sensor improves pose estimation accuracy.
  • the first pose data and the second pose data can be fused based on the Kalman filter algorithm, expressed as:
  • ⁇ t represents the target pose of the mobile device at the current time t
  • ⁇ t-1 represents the target pose of the previous sampling time t-1
  • K is the Kalman gain, expressed as:
  • the target pose of the mobile device corresponding to the current time t can be calculated, which is the final yaw angle of the mobile device in the above example. It can be understood that in the embodiments of the present disclosure, even if the signal environment around the mobile device changes, for example, the magnetometer and/or gyroscope is interfered, the pose weight corresponding to the sensor can be dynamically adjusted through the above process to ensure the final data. The accuracy of the target pose obtained by fusion.
  • the reliability of the first sensor and the second sensor at the current moment is determined by comparing the changing trends of the sampling data of the first sensor and the second sensor, and the positions of the two are dynamically adjusted based on the reliability. pose weights, which can effectively eliminate or alleviate the defects of data distortion caused by signal interference, and improve the accuracy of the target pose obtained after data fusion.
  • Embodiments of the present disclosure provide a pose estimation device, which can be applied to, for example, the mobile device 600 shown in FIG. 1 , and is used to estimate the pose of the mobile device 600 in real time when it is moving.
  • the pose estimation device of the present disclosure includes:
  • the acquisition module 10 is configured to obtain the first attitude set of the mobile device at the current moment through the first sensor of the mobile device, and obtain the third attitude set of the mobile device at the current moment through the second sensor of the mobile device.
  • Two pose sets wherein, the first pose set and the second pose set include pose data at the current moment and several previous sampling moments;
  • the change rate determination module 20 is configured to determine a first posture change rate of the mobile device according to the first posture set, and determine a second posture change rate of the mobile device according to the second posture set. ;
  • the weight determination module 30 is configured to determine the first posture weight and the second posture of the mobile device at the current moment based on the difference between the first posture change rate and the second posture change rate. weight;
  • the data fusion module 40 is configured to perform fusion processing on the first posture data and the second posture data at the current moment according to the first posture weight value and the second posture weight value to obtain the movement The target pose of the device at the current moment.
  • the reliability of the first sensor and the second sensor at the current moment is determined by comparing the changing trends of the sampling data of the first sensor and the second sensor, and the positions of the two are dynamically adjusted based on the reliability. pose weights, which can effectively eliminate or alleviate the defects of data distortion caused by signal interference, and improve the accuracy of the target pose obtained after data fusion.
  • the acquisition module 10 is configured to:
  • the first attitude set is obtained based on the first attitude data at the current time and the first attitude data at a preset number of sampling times before the current time.
  • the acquisition module 10 is configured to:
  • the second pose set is obtained based on the second pose data at the current time and the second pose data at a preset number of sampling times before the current time.
  • the change rate determination module 20 is configured to:
  • the first slope is determined as the first posture change rate
  • the second slope is determined as the second posture change rate
  • the change rate determination module 20 is configured to:
  • the change rate determination module 20 is configured to:
  • the element value of the positive value is reduced by a preset value to obtain the target set.
  • the weight determination module 30 is configured as:
  • Kalman filtering is performed on the variance of the first attitude data at several sampling moments before the current moment to obtain the current moment.
  • the first position weight is the difference between the first attitude change rate and the second attitude change rate.
  • the second sensor includes a magnetometer; the weight determination module 30 is configured to:
  • the geomagnetic mode length is calculated based on the second pose data at the current moment
  • the second pose weight is determined according to the geomagnetic mode length.
  • the data fusion module 40 is configured to:
  • Kalman filtering is performed on the first posture data and the second posture data at the current moment to obtain the target position of the mobile device at the current moment. posture.
  • the first sensor includes a gyroscope and the second sensor includes a magnetometer.
  • the reliability of the first sensor and the second sensor at the current moment is determined by comparing the changing trends of the sampling data of the first sensor and the second sensor, and the positions of the two are dynamically adjusted based on the reliability. pose weights, which can effectively eliminate or alleviate the defects of data distortion caused by signal interference, and improve the accuracy of the target pose obtained after data fusion.
  • the present disclosure provides a mobile device including:
  • a memory stores computer instructions for causing the processor to execute the method according to any implementation manner of the first aspect.
  • an embodiment of the present disclosure provides a storage medium that stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any embodiment of the first aspect.
  • the reliability of the first sensor and the second sensor at the current moment is determined by comparing the changing trends of the sampling data of the first sensor and the second sensor, and the positions of the two are dynamically adjusted based on the reliability. pose weights, which can effectively eliminate or alleviate the defects of data distortion caused by signal interference, and improve the accuracy of the target pose obtained after data fusion.

Landscapes

  • Engineering & Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Automation & Control Theory (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Control Of Position, Course, Altitude, Or Attitude Of Moving Bodies (AREA)

Abstract

The present disclosure relates to the technical field of mobile robots, and specifically provides a mobile device, a pose estimation method and apparatus therefor, and a storage medium. The pose estimation method comprises: obtaining a first pose set and a second pose set by means of a first sensor and a second sensor of a mobile device; determining a first pose change rate according to the first pose set, determining a second pose change rate according to the second pose set, and according to a difference between the first pose change rate and the second pose change rate, determining a first pose weight value and a second pose weight value of the mobile device at the current time; and according to the first pose weight value and the second pose weight value, performing fusion processing on first pose data and second pose data at the current time to obtain a target pose. In the implementation of the present disclosure, the weight values of the sensors can be dynamically adjusted, so that the influence of signal interference is reduced, and the pose estimation accuracy is improved.

Description

移动设备及其位姿估计方法、装置、存储介质Mobile device and pose estimation method, device and storage medium thereof 技术领域Technical field
本公开涉及移动机器人技术领域,具体涉及一种移动设备及其位姿估计方法、装置、存储介质。The present disclosure relates to the technical field of mobile robots, and specifically to a mobile device and its pose estimation method, device, and storage medium.
背景技术Background technique
移动设备的位姿估计是实现自主导航的重要前提,相关技术中,通常可以使用惯性测量单元(IMU,Inertial Measurement Unit)通过多传感器融合的方法得到移动设备的位姿信息。但是,相关技术中,移动设备的自主导航系统容易受到复杂环境的干扰和影响,导致移动设备位姿估计出现漂移,影响位姿估计精度。The pose estimation of a mobile device is an important prerequisite for autonomous navigation. In related technologies, an inertial measurement unit (IMU) can usually be used to obtain the pose information of a mobile device through a multi-sensor fusion method. However, in related technologies, the autonomous navigation system of mobile devices is susceptible to interference and influence from complex environments, which causes the mobile device's pose estimation to drift and affects the pose estimation accuracy.
发明内容Contents of the invention
为提高移动设备的位姿估计精度,本公开实施方式提供了一种移动设备及其位姿估计方法、装置、存储介质。In order to improve the pose estimation accuracy of a mobile device, embodiments of the present disclosure provide a mobile device and its pose estimation method, device, and storage medium.
第一方面,本公开实施方式提供了一种位姿估计方法,应用于移动设备,所述方法包括:In a first aspect, embodiments of the present disclosure provide a pose estimation method, which is applied to mobile devices. The method includes:
通过所述移动设备的第一传感器得到所述移动设备在当前时刻的第一位姿集合,通过所述移动设备的第二传感器得到所述移动设备在当前时刻的第二位姿集合;其中,所述第一位姿集合和所述第二位姿集合包括在当前时刻以及之前若干采样时刻的位姿数据;The first pose set of the mobile device at the current moment is obtained through the first sensor of the mobile device, and the second pose set of the mobile device at the current moment is obtained through the second sensor of the mobile device; wherein, The first pose set and the second pose set include pose data at the current moment and several previous sampling moments;
根据所述第一位姿集合确定所述移动设备的第一位姿变化率,根据所述第二位姿集合确定所述移动设备的第二位姿变化率;Determine a first posture change rate of the mobile device based on the first posture set, and determine a second posture change rate of the mobile device based on the second posture set;
根据所述第一位姿变化率和所述第二位姿变化率的差异,确定所述移动设备在当前时刻的第一位姿权值和第二位姿权值;Determine the first posture weight and the second posture weight of the mobile device at the current moment based on the difference between the first posture change rate and the second posture change rate;
根据所述第一位姿权值和所述第二位姿权值,对当前时刻的第一位姿数据和第二位姿数据进行融合处理,得到所述移动设备当前时刻的目标位 姿。According to the first posture weight and the second posture weight, the first posture data and the second posture data at the current moment are fused to obtain the target posture of the mobile device at the current moment.
在一些实施方式中,所述通过所述移动设备的第一传感器得到所述移动设备在当前时刻的第一位姿集合,包括:In some embodiments, obtaining the first attitude set of the mobile device at the current moment through the first sensor of the mobile device includes:
对于每个采样时刻,基于所述第一传感器采集得到所述采样时刻的第一运动数据;For each sampling moment, obtain the first motion data at the sampling moment based on the first sensor collection;
根据所述采样时刻的第一运动数据、前一采样时刻的第一运动数据以及采样周期,确定所述移动设备的第一位姿变化数据;Determine the first attitude change data of the mobile device according to the first motion data at the sampling time, the first motion data at the previous sampling time, and the sampling period;
根据前一采样时刻的第一位姿数据和所述第一位姿变化数据,确定所述移动设备在所述采样时刻的第一位姿数据;Determine the first attitude data of the mobile device at the sampling moment based on the first attitude data of the previous sampling moment and the first attitude change data;
根据当前时刻的第一位姿数据和当前时刻之前预设数量采样时刻的第一位姿数据,得到所述第一位姿集合。The first attitude set is obtained based on the first attitude data at the current time and the first attitude data at a preset number of sampling times before the current time.
在一些实施方式中,所述通过所述移动设备的第二传感器得到所述移动设备在当前时刻的第二位姿集合,包括:In some embodiments, obtaining the second pose set of the mobile device at the current moment through the second sensor of the mobile device includes:
对于每个采样时刻,基于所述第二传感器采集得到所述采样时刻的第二运动数据;For each sampling moment, obtain the second motion data of the sampling moment based on the second sensor collection;
根据所述第二运动数据确定所述移动设备在所述采样时刻的第二位姿数据;Determine the second pose data of the mobile device at the sampling moment according to the second motion data;
根据当前时刻的第二位姿数据和当前时刻之前预设数量采样时刻的第二位姿数据,得到所述第二位姿集合。The second pose set is obtained based on the second pose data at the current time and the second pose data at a preset number of sampling times before the current time.
在一些实施方式中,所述根据所述第一位姿集合确定所述移动设备的第一位姿变化率,根据所述第二位姿集合确定所述移动设备的第二位姿变化率,包括:In some embodiments, the first pose change rate of the mobile device is determined based on the first pose set, and the second pose change rate of the mobile device is determined based on the second pose set, include:
基于所述第一位姿集合包括的各个第一位姿数据进行边界数值处理,得到在数值上连续的第一目标集;基于所述第二位姿集合包括的各个第二位姿数据进行边界数据处理,得到在数值上连续的第二目标集;Perform boundary numerical processing based on each first pose data included in the first pose set to obtain a numerically continuous first target set; perform boundary processing based on each second pose data included in the second pose set Data processing to obtain a numerically continuous second target set;
根据所述第一目标集包括的各个元素进行线性回归,得到所述第一目标集对应的第一直线的第一斜率;根据所述第二目标集包括的各个元素进行线性回归,得到所述第一目标集对应的第二直线的第二斜率;Perform linear regression based on each element included in the first target set to obtain the first slope of the first straight line corresponding to the first target set; perform linear regression based on each element included in the second target set to obtain the the second slope of the second straight line corresponding to the first target set;
将所述第一斜率确定为所述第一位姿变化率,将所述第二斜率确定为所述第二位姿变化率。The first slope is determined as the first posture change rate, and the second slope is determined as the second posture change rate.
在一些实施方式中,对所述第一位姿集合和所述第二位姿集合中的任意一个位姿集合进行所述边界数值处理的过程包括:In some embodiments, the process of performing the boundary numerical processing on any one of the first pose set and the second pose set includes:
响应于所述位姿集合中各个元素同时包括正值和负值,计算得到所有元素绝对值的平均值;In response to each element in the pose set including both positive and negative values, calculate an average of the absolute values of all elements;
根据所述平均值与第一边界的第一差值绝对值,以及所述平均值与所述第二边界的第二差值绝对值的大小关系,确定所述位姿集合对应的目标边界;Determine the target boundary corresponding to the pose set according to the relationship between the first absolute value of the difference between the average value and the first boundary, and the magnitude relationship between the second absolute value of the difference between the average value and the second boundary;
响应于所述目标边界为第一边界和第二边界中的预设边界,对所述位姿集合中的各个元素进行数值转换,得到在数值上连续的目标集。In response to the target boundary being the preset boundary among the first boundary and the second boundary, numerical conversion is performed on each element in the pose set to obtain a numerically continuous target set.
在一些实施方式中,所述响应于所述目标边界为第一边界和第二边界中的预设边界,对所述位姿集合中的各个元素进行数值转换,得到在数值上连续的目标集,包括:In some embodiments, in response to the target boundary being a preset boundary among the first boundary and the second boundary, numerical conversion is performed on each element in the pose set to obtain a numerically continuous target set. ,include:
响应于所述目标边界为第一边界和第二边界中的预设边界,确定所述位姿集合中正值的第一数量和负值的第二数量;In response to the target boundary being a preset boundary among the first boundary and the second boundary, determining a first number of positive values and a second number of negative values in the pose set;
响应于所述第一数量大于所述第二数量,将所有负值的元素数值增加预设数值,得到所述目标集;In response to the first quantity being greater than the second quantity, increasing all negative element values by a preset value to obtain the target set;
响应于所述第一数量不大于所述第二数量,将所述正值的元素数值减少预设数值,得到所述目标集。In response to the first quantity not being greater than the second quantity, the element value of the positive value is reduced by a preset value to obtain the target set.
在一些实施方式中,根据所述第一位姿变化率和所述第二位姿变化率的差异,确定所述移动设备在当前时刻的第一位姿权值,包括:In some embodiments, determining the first posture weight of the mobile device at the current moment based on the difference between the first posture change rate and the second posture change rate includes:
响应于所述第一位姿变化率与所述第二位姿变化率的差异大于预设阈值,对当前时刻之前若干采样时刻的第一位姿数据的方差进行卡尔曼滤波处理,得到当前时刻的第一位姿权值。In response to the difference between the first attitude change rate and the second attitude change rate being greater than the preset threshold, Kalman filtering is performed on the variance of the first attitude data at several sampling moments before the current moment to obtain the current moment. The first position weight.
在一些实施方式中,所述第二传感器包括磁力计;确定所述移动设备在当前时刻的第二位姿权值,包括:In some implementations, the second sensor includes a magnetometer; determining the second pose weight of the mobile device at the current moment includes:
利用所述磁力计采集得到当前时刻的第二位姿数据;Using the magnetometer to collect the second pose data at the current moment;
根据当前时刻的第二位姿数据计算得到地磁模长;The geomagnetic mode length is calculated based on the second pose data at the current moment;
根据所述地磁模长确定所述第二位姿权值。The second pose weight is determined according to the geomagnetic mode length.
在一些实施方式中,所述根据所述第一位姿权值和所述第二位姿权值,对当前时刻的第一位姿数据和第二位姿数据进行融合处理,得到所述移动 设备当前时刻的目标位姿,包括:In some embodiments, the first posture data and the second posture data at the current moment are fused according to the first posture weight value and the second posture weight value to obtain the movement The target pose of the device at the current moment, including:
根据所述第一位姿权值和所述第二位姿权值,对当前时刻的第一位姿数据和第二位姿数据进行卡尔曼滤波处理,得到所述移动设备当前时刻的目标位姿。According to the first posture weight and the second posture weight, Kalman filtering is performed on the first posture data and the second posture data at the current moment to obtain the target position of the mobile device at the current moment. posture.
在一些实施方式中,所述第一传感器包括陀螺仪,所述第二传感器包括磁力计。In some embodiments, the first sensor includes a gyroscope and the second sensor includes a magnetometer.
第二方面,本公开实施方式提供了一种位姿估计装置,应用于移动设备,所述装置包括:In a second aspect, embodiments of the present disclosure provide a pose estimation device, which is applied to mobile devices. The device includes:
获取模块,被配置为通过所述移动设备的第一传感器得到所述移动设备在当前时刻的第一位姿集合,通过所述移动设备的第二传感器得到所述移动设备在当前时刻的第二位姿集合;其中,所述第一位姿集合和所述第二位姿集合包括在当前时刻以及之前若干采样时刻的位姿数据;The acquisition module is configured to obtain the first attitude set of the mobile device at the current moment through the first sensor of the mobile device, and obtain the second attitude set of the mobile device at the current moment through the second sensor of the mobile device. A pose set; wherein the first pose set and the second pose set include pose data at the current moment and several previous sampling moments;
变化率确定模块,被配置为根据所述第一位姿集合确定所述移动设备的第一位姿变化率,根据所述第二位姿集合确定所述移动设备的第二位姿变化率;a change rate determination module configured to determine a first posture change rate of the mobile device according to the first posture set, and determine a second posture change rate of the mobile device according to the second posture set;
权值确定模块,被配置为根据所述第一位姿变化率和所述第二位姿变化率的差异,确定所述移动设备在当前时刻的第一位姿权值和第二位姿权值;A weight determination module configured to determine the first posture weight and the second posture weight of the mobile device at the current moment based on the difference between the first posture change rate and the second posture change rate. value;
数据融合模块,被配置为根据所述第一位姿权值和所述第二位姿权值,对当前时刻的第一位姿数据和第二位姿数据进行融合处理,得到所述移动设备当前时刻的目标位姿。The data fusion module is configured to perform fusion processing on the first posture data and the second posture data at the current moment according to the first posture weight value and the second posture weight value to obtain the mobile device. The target pose at the current moment.
在一些实施方式中,所述获取模块被配置为:In some implementations, the acquisition module is configured to:
对于每个采样时刻,基于所述第一传感器采集得到所述采样时刻的第一运动数据;For each sampling moment, obtain the first motion data at the sampling moment based on the first sensor collection;
根据所述采样时刻的第一运动数据、前一采样时刻的第一运动数据以及采样周期,确定所述移动设备的第一位姿变化数据;Determine the first attitude change data of the mobile device according to the first motion data at the sampling time, the first motion data at the previous sampling time, and the sampling period;
根据前一采样时刻的第一位姿数据和所述第一位姿变化数据,确定所述移动设备在所述采样时刻的第一位姿数据;Determine the first attitude data of the mobile device at the sampling moment based on the first attitude data of the previous sampling moment and the first attitude change data;
根据当前时刻的第一位姿数据和当前时刻之前预设数量采样时刻的第一位姿数据,得到所述第一位姿集合。The first attitude set is obtained based on the first attitude data at the current time and the first attitude data at a preset number of sampling times before the current time.
在一些实施方式中,所述获取模块被配置为:In some implementations, the acquisition module is configured to:
对于每个采样时刻,基于所述第二传感器采集得到所述采样时刻的第二运动数据;For each sampling moment, obtain the second motion data of the sampling moment based on the second sensor collection;
根据所述第二运动数据确定所述移动设备在所述采样时刻的第二位姿数据;Determine the second pose data of the mobile device at the sampling moment according to the second motion data;
根据当前时刻的第二位姿数据和当前时刻之前预设数量采样时刻的第二位姿数据,得到所述第二位姿集合。The second pose set is obtained based on the second pose data at the current time and the second pose data at a preset number of sampling times before the current time.
在一些实施方式中,所述变化率确定模块被配置为:In some embodiments, the rate of change determination module is configured to:
基于所述第一位姿集合包括的各个第一位姿数据进行边界数值处理,得到在数值上连续的第一目标集;基于所述第二位姿集合包括的各个第二位姿数据进行边界数据处理,得到在数值上连续的第二目标集;Perform boundary numerical processing based on each first pose data included in the first pose set to obtain a numerically continuous first target set; perform boundary processing based on each second pose data included in the second pose set Data processing to obtain a numerically continuous second target set;
根据所述第一目标集包括的各个元素进行线性回归,得到所述第一目标集对应的第一直线的第一斜率;根据所述第二目标集包括的各个元素进行线性回归,得到所述第一目标集对应的第二直线的第二斜率;Perform linear regression based on each element included in the first target set to obtain the first slope of the first straight line corresponding to the first target set; perform linear regression based on each element included in the second target set to obtain the the second slope of the second straight line corresponding to the first target set;
将所述第一斜率确定为所述第一位姿变化率,将所述第二斜率确定为所述第二位姿变化率。The first slope is determined as the first posture change rate, and the second slope is determined as the second posture change rate.
在一些实施方式中,所述变化率确定模块被配置为:In some embodiments, the rate of change determination module is configured to:
响应于所述位姿集合中各个元素同时包括正值和负值,计算得到所有元素绝对值的平均值;In response to each element in the pose set including both positive and negative values, calculate an average of the absolute values of all elements;
根据所述平均值与第一边界的第一差值绝对值,以及所述平均值与所述第二边界的第二差值绝对值的大小关系,确定所述位姿集合对应的目标边界;Determine the target boundary corresponding to the pose set according to the relationship between the first absolute value of the difference between the average value and the first boundary, and the magnitude relationship between the second absolute value of the difference between the average value and the second boundary;
响应于所述目标边界为第一边界和第二边界中的预设边界,对所述位姿集合中的各个元素进行数值转换,得到在数值上连续的目标集。In response to the target boundary being the preset boundary among the first boundary and the second boundary, numerical conversion is performed on each element in the pose set to obtain a numerically continuous target set.
在一些实施方式中,所述变化率确定模块被配置为:In some embodiments, the rate of change determination module is configured to:
响应于所述目标边界为第一边界和第二边界中的预设边界,确定所述位姿集合中正值的第一数量和负值的第二数量;In response to the target boundary being a preset boundary among the first boundary and the second boundary, determining a first number of positive values and a second number of negative values in the pose set;
响应于所述第一数量大于所述第二数量,将所有负值的元素数值增加预设数值,得到所述目标集;In response to the first quantity being greater than the second quantity, increasing all negative element values by a preset value to obtain the target set;
响应于所述第一数量不大于所述第二数量,将所述正值的元素数值减 少预设数值,得到所述目标集。In response to the first quantity not being greater than the second quantity, the element value of the positive value is reduced by a preset value to obtain the target set.
在一些实施方式中,所述权值确定模块被配置为:In some implementations, the weight determination module is configured to:
响应于所述第一位姿变化率与所述第二位姿变化率的差异大于预设阈值,对当前时刻之前若干采样时刻的第一位姿数据的方差进行卡尔曼滤波处理,得到当前时刻的第一位姿权值。In response to the difference between the first attitude change rate and the second attitude change rate being greater than the preset threshold, Kalman filtering is performed on the variance of the first attitude data at several sampling moments before the current moment to obtain the current moment. The first position weight.
在一些实施方式中,所述第二传感器包括磁力计;所述权值确定模块被配置为:In some implementations, the second sensor includes a magnetometer; the weight determination module is configured to:
利用所述磁力计采集得到当前时刻的第二位姿数据;Using the magnetometer to collect the second pose data at the current moment;
根据当前时刻的第二位姿数据计算得到地磁模长;The geomagnetic mode length is calculated based on the second pose data at the current moment;
根据所述地磁模长确定所述第二位姿权值。The second pose weight is determined according to the geomagnetic mode length.
在一些实施方式中,所述数据融合模块被配置为:In some embodiments, the data fusion module is configured to:
根据所述第一位姿权值和所述第二位姿权值,对当前时刻的第一位姿数据和第二位姿数据进行卡尔曼滤波处理,得到所述移动设备当前时刻的目标位姿。According to the first posture weight and the second posture weight, Kalman filtering is performed on the first posture data and the second posture data at the current moment to obtain the target position of the mobile device at the current moment. posture.
在一些实施方式中,所述第一传感器包括陀螺仪,所述第二传感器包括磁力计。In some embodiments, the first sensor includes a gyroscope and the second sensor includes a magnetometer.
第三方面,本公开实施方式提供了一种移动设备,包括:In a third aspect, an embodiment of the present disclosure provides a mobile device, including:
第一传感器和第二传感器;a first sensor and a second sensor;
处理器;以及processor; and
存储器,存储有计算机指令,所述计算机指令用于使所述处理器执行根据第一方面任意实施方式所述的方法。A memory stores computer instructions for causing the processor to execute the method according to any implementation manner of the first aspect.
第四方面,本公开实施方式提供了一种存储介质,存储有计算机指令,所述计算机指令用于使计算机执行根据第一方面任意实施方式所述的方法。In a fourth aspect, an embodiment of the present disclosure provides a storage medium that stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any embodiment of the first aspect.
本公开实施方式的位姿估计方法,包括通过第一传感器得到当前时刻的第一位姿集合并确定第一位姿变化率,通过第二传感器得到当前时刻的第二位姿集合并确定第二位姿变化率,根据第一位姿变化率和第二位姿变化率的差值,确定第一位姿权值和第二位姿权值,根据第一位姿权值和第二位姿权值对当前时刻的第一位姿数据和第二位姿数据进行融合处理,得到移动设备当前时刻的目标位姿。本公开实施方式中,通过对第一传感器和第二传感器 当前一段时间内的采样数据变化趋势进行对比,确定两者当前时刻的可靠程度,并基于可靠程度动态调整两者的位姿权值,从而可以有效消除或者缓解信号干扰导致的数据失真的缺陷,提高数据融合后得到的目标位姿的准确性。The pose estimation method in the embodiment of the present disclosure includes obtaining the first pose set at the current time through the first sensor and determining the first pose change rate, and obtaining the second pose set at the current time through the second sensor and determining the second pose estimation method. The pose change rate, based on the difference between the first pose change rate and the second pose change rate, determines the first pose weight and the second pose weight, based on the first pose weight and the second pose weight The weight fuses the first pose data and the second pose data at the current moment to obtain the target pose of the mobile device at the current moment. In the embodiment of the present disclosure, by comparing the changing trends of the sampling data of the first sensor and the second sensor within a current period of time, the reliability of the two at the current moment is determined, and the pose weights of the two are dynamically adjusted based on the reliability. This can effectively eliminate or alleviate the defects of data distortion caused by signal interference, and improve the accuracy of the target pose obtained after data fusion.
附图说明Description of the drawings
为了更清楚地说明本公开具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly explain the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings that need to be used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description The drawings illustrate some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.
图1是根据本公开一些实施方式中移动设备的结构框图。Figure 1 is a structural block diagram of a mobile device according to some embodiments of the present disclosure.
图2是根据本公开一些实施方式中位姿估计方法的流程图。Figure 2 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
图3是根据本公开一些实施方式中位姿估计方法的流程图。Figure 3 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
图4是根据本公开一些实施方式中位姿估计方法的流程图。Figure 4 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
图5是根据本公开一些实施方式中位姿估计方法的流程图。Figure 5 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
图6是根据本公开一些实施方式中位姿估计方法的原理图。Figure 6 is a schematic diagram of a pose estimation method according to some embodiments of the present disclosure.
图7是根据本公开一些实施方式中位姿估计方法的流程图。Figure 7 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
图8是根据本公开一些实施方式中位姿估计方法的流程图。Figure 8 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
图9是根据本公开一些实施方式中位姿估计方法的流程图。Figure 9 is a flowchart of a pose estimation method according to some embodiments of the present disclosure.
图10是根据本公开一些实施方式中位姿估计装置的结构框图。Figure 10 is a structural block diagram of a pose estimation device according to some embodiments of the present disclosure.
具体实施方式Detailed ways
下面将结合附图对本公开的技术方案进行清楚、完整地描述,显然,所描述的实施方式是本公开一部分实施方式,而不是全部的实施方式。基于本公开中的实施方式,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施方式,都属于本公开保护的范围。此外,下面所描述的本公开不同实施方式中所涉及的技术特征只要彼此之间未构成冲突就可以相互结合。The technical solution of the present disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, but not all of them. Based on the embodiments in this disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this disclosure. In addition, the technical features involved in different embodiments of the present disclosure described below can be combined with each other as long as they do not conflict with each other.
移动设备的位姿估计是实现自主导航的重要前提,相关技术中,通常可以使用惯性测量单元(IMU,Inertial Measurement Unit)通过多传感器融合的方法得到移动设备的位姿信息。The pose estimation of a mobile device is an important prerequisite for autonomous navigation. In related technologies, an inertial measurement unit (IMU) can usually be used to obtain the pose information of a mobile device through a multi-sensor fusion method.
例如以地面移动机器人的位姿估计场景为例,在一种简单实现方式中,可以通过机器人的陀螺仪、加速度计等惯性测量传感器直接随时间积分得到机器人的位姿。这种方法在短时间内可行,但是在机器人长时间运动后,陀螺仪自身漂移以及机体振动对陀螺仪的影响,会导致位姿数据失真。For example, taking the pose estimation scenario of a ground mobile robot as an example, in a simple implementation, the robot's pose can be directly integrated over time through the robot's gyroscope, accelerometer and other inertial measurement sensors. This method is feasible in a short time, but after the robot moves for a long time, the drift of the gyroscope itself and the influence of the body vibration on the gyroscope will cause distortion of the pose data.
为了解决陀螺仪失真问题,相关技术中,可以融合其他类型的传感器数据,不断修正陀螺仪,避免陀螺仪漂移。但是,相关技术中的方法难以满足复杂场景的位姿估计。In order to solve the problem of gyroscope distortion, in related technologies, other types of sensor data can be integrated to continuously correct the gyroscope to avoid gyroscope drift. However, methods in related technologies are difficult to satisfy the pose estimation of complex scenes.
例如,以磁力计和陀螺仪融合为例,这种方法适用于机体所处的磁场环境单一,无电磁干扰的场景,例如无人机高空飞行场景等。而对于地面移动机器人,周围磁场环境复杂多变,会对磁力计造成极大影响,导致机器人位姿估计不准。For example, taking the fusion of magnetometer and gyroscope as an example, this method is suitable for scenarios where the magnetic field environment of the body is single and there is no electromagnetic interference, such as high-altitude flight scenarios of drones. For ground mobile robots, the surrounding magnetic field environment is complex and changeable, which will have a great impact on the magnetometer, resulting in inaccurate estimation of the robot's pose.
又例如,以GPS卫星定位和陀螺仪融合为例,这种方法适用于机体处于室外的场景,例如室外机器人、无人机等。而对于室内移动的机器人,GPS信号较弱,定位不准,无法提供准确的位姿修正,导致位姿估计不准。As another example, take the fusion of GPS satellite positioning and gyroscope as an example. This method is suitable for scenarios where the body is outdoors, such as outdoor robots, drones, etc. For robots that move indoors, the GPS signal is weak, the positioning is inaccurate, and it cannot provide accurate pose correction, resulting in inaccurate pose estimation.
因此,相关技术中,为了实现室内机器人准确地位姿估计,只能融合更多类型和数量的传感器数据,导致机体成本和算法复杂程度倍增。Therefore, in related technologies, in order to achieve accurate posture estimation of indoor robots, more types and quantities of sensor data can only be integrated, doubling the cost of the machine and the complexity of the algorithm.
基于上述相关技术中存在的缺陷,本公开实施方式提供了一种移动设备及其位姿估计方法、装置、存储介质,旨在提高移动设备的位姿估计精度,且降低复杂环境对传感器精度的影响,在无需融合更多传感器数据的基础上,对设备当前所处的环境状况进行判断识别,并且对应调整融合算法,提高设备在复杂环境下的位姿估计精度。Based on the deficiencies in the above related technologies, embodiments of the present disclosure provide a mobile device and its pose estimation method, device, and storage medium, aiming to improve the pose estimation accuracy of the mobile device and reduce the impact of complex environments on sensor accuracy. Impact, without the need to fuse more sensor data, the current environmental conditions of the device can be judged and identified, and the fusion algorithm can be adjusted accordingly to improve the pose estimation accuracy of the device in complex environments.
本公开实施方式的位姿估计方法,可应用于移动设备,移动设备是指可受驱动地产生位置移动的电子设备,例如移动机器人、无人机等。图1示出了本公开一些实施方式中移动设备的结构框图,下面结合图1进行说明。The pose estimation method in the embodiment of the present disclosure can be applied to mobile devices. Mobile devices refer to electronic devices that can be driven to produce position movement, such as mobile robots, drones, etc. Figure 1 shows a structural block diagram of a mobile device in some embodiments of the present disclosure, which will be described below with reference to Figure 1 .
如图1所示,在一些实施方式中,本公开示例的移动设备600包括处理器601、存储器602、第一传感器604、第二传感器605以及驱动装置606。As shown in Figure 1, in some implementations, a mobile device 600 of an example of the present disclosure includes a processor 601, a memory 602, a first sensor 604, a second sensor 605, and a driving device 606.
处理器601、存储器602、第一传感器604、第二传感器605以及驱动装 置606,通过总线603建立任意两者之间的可通信连接。The processor 601, the memory 602, the first sensor 604, the second sensor 605 and the driving device 606 establish a communicable connection between any two through the bus 603.
处理器601可以为任何类型,具备一个或者多个处理核心的处理器。其可以执行单线程或者多线程的操作,用于解析指令以执行获取数据、执行逻辑运算功能以及下发运算处理结果等操作。The processor 601 can be any type of processor with one or more processing cores. It can perform single-threaded or multi-threaded operations and is used to parse instructions to perform operations such as obtaining data, performing logical operation functions, and issuing operation processing results.
存储器602可包括非易失性计算机可读存储介质,例如至少一个磁盘存储器件、闪存器件、相对于处理器601远程设置的分布式存储设备或者其他非易失性固态存储器件。存储器可以具有程序存储区,用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,供处理器601调用以使处理器601执行一个或者多个方法步骤。存储器602还可以包括易失性随机存储介质、或者硬盘等存储部分,作为数据存储区,用以存储处理器601下发输出的运算处理结果及数据。 Memory 602 may include non-volatile computer-readable storage media, such as at least one disk storage device, flash memory device, distributed storage device remotely located relative to processor 601, or other non-volatile solid-state storage device. The memory may have a program storage area for storing non-volatile software programs, non-volatile computer executable programs and modules for the processor 601 to call to cause the processor 601 to perform one or more method steps. The memory 602 may also include a storage part such as a volatile random access storage medium or a hard disk as a data storage area for storing operation processing results and data output by the processor 601.
第一传感器604可以是设置在移动设备上的惯性测量单元,例如第一传感器604可包括陀螺仪、加速度计、角速度计等,在移动设备600运动过程中,第一传感器604可以检测到移动设备的第一位姿数据。The first sensor 604 may be an inertial measurement unit provided on the mobile device. For example, the first sensor 604 may include a gyroscope, an accelerometer, an angular velocity meter, etc. During the movement of the mobile device 600, the first sensor 604 may detect the mobile device. The first pose data.
第二传感器605可以是设置在移动设备上与第一传感器604不同类型的测量单元,例如第二传感器605可以包括磁力计等,在移动设备600运动过程中,第二传感器605可以检测到移动设备的第二位姿数据。The second sensor 605 may be a different type of measurement unit than the first sensor 604 provided on the mobile device. For example, the second sensor 605 may include a magnetometer. During the movement of the mobile device 600, the second sensor 605 may detect the mobile device. The second pose data.
可以理解,本公开实施方式中,第二传感器605用于对第一传感器604的观测数据进行修正,从而得到更为准确的位姿数据,对于数据融合的过程,本公开下文方法中进行具体说明。It can be understood that in the embodiment of the disclosure, the second sensor 605 is used to correct the observation data of the first sensor 604 to obtain more accurate pose data. The process of data fusion will be specifically described in the method below of the disclosure. .
驱动装置606为移动设备的动力系统,用于驱动移动设备600产生位移。在一些实施方式中,驱动装置606可以包括例如电机、传动机构以及滚轮等机械结构,本领域技术人员对此毫无疑问可以理解并充分实现,本公开不再赘述。The driving device 606 is the power system of the mobile device and is used to drive the mobile device 600 to generate displacement. In some embodiments, the driving device 606 may include mechanical structures such as a motor, a transmission mechanism, and a roller. Those skilled in the art will undoubtedly understand and fully implement this, and will not be described in detail in this disclosure.
在图1所示的移动设备的基础上,本公开实施方式提供了一种位姿估计方法,用于对移动设备600运动时的位姿进行实时估计,该方法可以由移动设备600的处理器601执行,下面结合图2实施方式进行说明。On the basis of the mobile device shown in Figure 1, embodiments of the present disclosure provide a pose estimation method for real-time estimation of the pose of the mobile device 600 when it is moving. This method can be used by the processor of the mobile device 600. 601 is executed, which will be described below with reference to the implementation in Figure 2 .
如图2所示,在一些实施方式中,本公开示例的位姿估计方法,包括:As shown in Figure 2, in some implementations, the pose estimation method of the present disclosure includes:
S210、通过移动设备的第一传感器得到移动设备在当前时刻的第一位姿集合,通过移动设备的第二传感器得到移动设备在当前时刻的第二位姿集合。S210. Obtain the first pose set of the mobile device at the current moment through the first sensor of the mobile device, and obtain the second pose set of the mobile device at the current moment through the second sensor of the mobile device.
可以理解,移动设备在移动过程中,第一传感器和第二传感器会以固定的采样周期采集当前时刻的位姿数据,从而通过多传感器融合算法,实时解算得到当前时刻的目标位姿。例如一个示例中,第一传感器和第二传感器的采样频率为10Hz,也即每秒采集10次位姿数据,从而移动设备的处理器同样每秒进行10次位姿估计。It can be understood that when the mobile device is moving, the first sensor and the second sensor will collect the pose data at the current moment in a fixed sampling period, so that the target pose at the current moment can be obtained in real time through a multi-sensor fusion algorithm. For example, in one example, the sampling frequency of the first sensor and the second sensor is 10 Hz, that is, pose data is collected 10 times per second, so the processor of the mobile device also performs pose estimation 10 times per second.
本公开实施方式中,对于当前时刻的目标位姿进行解算时,并非直接基于第一传感器和第二传感器的位姿数据进行数据融合。这是由于,考虑到在复杂环境下,第一传感器和/或第二传感器的检测信号会受到干扰,从而导致采集的位姿数据出现较大的误差。例如,以磁力计为例,在磁场环境复杂的场景中,磁力计的检测信号受到较大的干扰,导致磁力计采集的位姿数据与实际位姿产生较大的偏差,进而造成数据融合后得到的目标位姿出现较大误差。In the embodiment of the present disclosure, when solving the target pose at the current moment, data fusion is not directly based on the pose data of the first sensor and the second sensor. This is because, considering that in a complex environment, the detection signals of the first sensor and/or the second sensor will be interfered, resulting in large errors in the collected pose data. For example, taking the magnetometer as an example, in a scene with a complex magnetic field environment, the detection signal of the magnetometer is greatly interfered, resulting in a large deviation between the pose data collected by the magnetometer and the actual pose, which in turn causes the data to be fused. There is a large error in the obtained target pose.
因此,本公开实施方式中,在对当前时刻的目标位姿进行解算之前,首先对移动机器人当前所处的环境情况进行判断识别,从而确定第一传感器和第二传感器的工作状态是否可靠,并且根据两者当前的可靠程度,实时对数据融合过程中第一位姿数据和第二位姿数据的权值参数进行动态调整,保证数据融合得到的移动设备的目标位姿的准确性,降低环境因素对传感器的干扰。Therefore, in the embodiment of the present disclosure, before solving the target pose at the current moment, first the environmental conditions of the mobile robot are currently judged and identified, thereby determining whether the working status of the first sensor and the second sensor is reliable. And based on the current reliability of the two, the weight parameters of the first pose data and the second pose data during the data fusion process are dynamically adjusted in real time to ensure the accuracy of the target pose of the mobile device obtained by data fusion and reduce Interference of environmental factors on the sensor.
具体而言,在每个采样时刻,根据第一传感器的采样数据可以计算得到每个采样时刻的第一位姿数据,同样,根据第二传感器的采样数据可以计算得到每个采样时刻的第二位姿数据。Specifically, at each sampling moment, the first attitude data of each sampling moment can be calculated based on the sampling data of the first sensor. Similarly, the second attitude data of each sampling moment can be calculated based on the sampling data of the second sensor. pose data.
本公开实施方式中,以当前时刻t为例,首先可根据当前时刻t及之前若干个采样时刻的第一位姿数据,建立第一位姿集合,可表示为:In the embodiment of the present disclosure, taking the current time t as an example, firstly, the first pose set can be established based on the first pose data of the current time t and several previous sampling moments, which can be expressed as:
Figure PCTCN2022093607-appb-000001
Figure PCTCN2022093607-appb-000001
式(1)中,
Figure PCTCN2022093607-appb-000002
表示第一位姿集合,
Figure PCTCN2022093607-appb-000003
表示当前时刻t的第一位姿数据,
Figure PCTCN2022093607-appb-000004
表示采样时刻t-1的第一位姿数据……以此类推,从而第一位姿集合中共包括N个采样时刻的第一位姿数据。
In formula (1),
Figure PCTCN2022093607-appb-000002
represents the first pose set,
Figure PCTCN2022093607-appb-000003
Represents the first pose data at the current time t,
Figure PCTCN2022093607-appb-000004
Represents the first attitude data at the sampling time t-1... and so on, so that the first attitude set includes a total of N first attitude data at the sampling time.
其次,可根据当前时刻t及之前若干个采样时刻的第二位姿数据,建立第二位姿集合,表示为:Secondly, the second pose set can be established based on the second pose data of the current time t and several previous sampling moments, expressed as:
Figure PCTCN2022093607-appb-000005
Figure PCTCN2022093607-appb-000005
式(2)中,
Figure PCTCN2022093607-appb-000006
表示第二位姿集合,
Figure PCTCN2022093607-appb-000007
表示当前时刻t的第二位姿数据,
Figure PCTCN2022093607-appb-000008
表示采样时刻t-1的第二位姿数据……以此类推,从而第二位姿集合中共包括N个采样时刻的第二位姿数据。
In formula (2),
Figure PCTCN2022093607-appb-000006
represents the second pose set,
Figure PCTCN2022093607-appb-000007
Represents the second pose data at the current time t,
Figure PCTCN2022093607-appb-000008
Represents the second pose data at the sampling time t-1... and so on, so that the second pose set includes a total of N second pose data at the sampling time.
值得说明的是,第一位姿集合和第二位姿集合表示的是当前时刻之前一段时段的位姿数据的集合,本公开实施方式对于集合中元素的数量N不作限制,其可取任意大于0的正整数,例如N=10、20、50等,本公开对此不作限制。It is worth noting that the first pose set and the second pose set represent a set of pose data for a period of time before the current time. The embodiment of the present disclosure does not place a limit on the number N of elements in the set, which can be arbitrarily greater than 0. Positive integers, such as N=10, 20, 50, etc., this disclosure does not limit this.
S220、根据第一位姿集合确定移动设备的第一位姿变化率,根据第二位姿集合确定移动设备的第二位姿变化率。S220. Determine the first posture change rate of the mobile device based on the first posture set, and determine the second posture change rate of the mobile device based on the second posture set.
可以理解,第一位姿集合表示的是基于第一传感器采集数据计算得到的移动设备在当前时刻之前一段时间的位姿数据,其可以反映出第一传感器采样的位姿数据的变化趋势。It can be understood that the first pose set represents the pose data of the mobile device for a period of time before the current moment calculated based on the data collected by the first sensor, which can reflect the changing trend of the pose data sampled by the first sensor.
同样,第一位姿集合表示的是基于第二传感器采集数据计算得到的移动设备在当前时刻之前一段时间的位姿数据,其可以反映出第二传感器采样的位姿数据的变化趋势。Similarly, the first pose set represents the pose data of the mobile device for a period of time before the current moment calculated based on the data collected by the second sensor, which can reflect the changing trend of the pose data sampled by the second sensor.
第一位姿集合和第二位姿集合对应的是同一段时间内的移动设备运动过程,因此,在没有受到信号干扰的情况下,理论上两者的变化趋势应当是一致或者接近的。而若其中一方或者双方均受到信号干扰的情况下,两者的变化趋势应当具有较大差异。The first pose set and the second pose set correspond to the movement process of the mobile device within the same period of time. Therefore, in the absence of signal interference, theoretically the change trends of the two should be consistent or close. And if one or both parties are subject to signal interference, the changing trends of the two should be quite different.
基于此原理,本公开实施方式中,即可通过反映第一位姿集合中各个第一位姿数据变化趋势的第一位姿变化率,以及反映第二位姿集合中各个第二位姿数据变化趋势的第二位姿变化率之间的差异,确定当前第一传感器和/或第二传感器是否处于可靠状态。Based on this principle, in the embodiment of the present disclosure, the first posture change rate can be used to reflect the change trend of each first posture data in the first posture set, and the first posture change rate can be used to reflect each second posture data in the second posture set. The difference between the second posture change rate of the change trend determines whether the current first sensor and/or the second sensor are in a reliable state.
在一些实施方式中,可以基于第一位姿集合中包括的各个第一位姿数据进行线性回归处理,拟合得到第一直线,将第一直线的第一斜率作为第一位姿变化率。同样,可以基于第二位姿集合中包括的各个第二位姿数据进行线性回归处理,拟合得到第二直线,将第二直线的第二斜率作为第二位姿变化率。本公开下文实施方式中进行具体说明,在此暂不详述。In some embodiments, linear regression processing can be performed based on each first attitude data included in the first attitude set, the first straight line is obtained by fitting, and the first slope of the first straight line is used as the first attitude change. Rate. Similarly, linear regression processing can be performed based on each second pose data included in the second pose set, a second straight line is obtained by fitting, and the second slope of the second straight line is used as the second pose change rate. The present disclosure will be specifically described in the following embodiments and will not be described in detail here.
S230、根据第一位姿变化率和第二位姿变化率的差异,确定移动设备在当前时刻的第一位姿权值和第二位姿权值。S230. Determine the first posture weight and the second posture weight of the mobile device at the current moment based on the difference between the first posture change rate and the second posture change rate.
基于前述可知,第一位姿变化率可以反映第一传感器的采样数据的变化趋势,第二位姿变化率可以反映第二传感器的采样数据的变化趋势。Based on the foregoing, it can be seen that the first attitude change rate can reflect the changing trend of the sampling data of the first sensor, and the second attitude change rate can reflect the changing trend of the sampling data of the second sensor.
在一些实施方式中,若第一位姿变化率与第二位姿变化率之间的差异很小,说明通过第一传感器和第二传感器所计算得到的位姿数据的趋势相同,也表明当前移动设备所处的环境干扰很少。In some embodiments, if the difference between the first posture change rate and the second posture change rate is very small, it means that the trends of the posture data calculated by the first sensor and the second sensor are the same, and it also indicates that the current trend is the same. Mobile devices operate in an environment with few distractions.
在另一些实施方式中,若第一位姿变化率与第二位姿变化率之间的差异较大,说明通过第一传感器和第二传感器所计算得到的位姿数据的趋势不相同,也表示当前移动设备所处的环境干扰很大。In other embodiments, if the difference between the first posture change rate and the second posture change rate is large, it means that the trends of the posture data calculated by the first sensor and the second sensor are not the same, or Indicates that the current environment where the mobile device is located is very disruptive.
本公开实施方式中,可以基于上述不同的情况,动态调整第一传感器与第二传感器不同的位姿权值,该位姿权值可以理解为传感器的位姿数据对目标位姿的影响力。In the embodiment of the present disclosure, different pose weights of the first sensor and the second sensor can be dynamically adjusted based on the above different situations. The pose weights can be understood as the influence of the sensor's pose data on the target pose.
例如一个示例中,在数据融合过程中,若第一位姿权值较大,第二位姿权值较小,计算得到的目标位姿则更加倾向于第一位姿数据;反之,若第一位姿权值很小,第二位姿权值较大,计算得到的目标位姿则更加倾向于第二位姿数据。For example, in an example, during the data fusion process, if the weight of the first pose is larger and the weight of the second pose is smaller, the calculated target pose is more inclined to the first pose data; conversely, if the weight of the second pose is smaller The weight of one pose is very small, the weight of the second pose is large, and the calculated target pose is more inclined to the second pose data.
从而,在一些实施方式中,假设第一传感器为陀螺仪,第二传感器为磁力计。若第一位姿变化率与第二位姿变化率之间的差异很小,说明当前时刻环境的信号干扰很小,可以仅针对第二位姿数据的第二位姿权值进行调整。这是由于,在陀螺仪和磁力计均不受干扰的情况下,陀螺仪相对于磁力计具有更高的可靠性。Thus, in some embodiments, it is assumed that the first sensor is a gyroscope and the second sensor is a magnetometer. If the difference between the first pose change rate and the second pose change rate is very small, it means that the signal interference of the environment at the current moment is very small, and only the second pose weight of the second pose data can be adjusted. This is due to the higher reliability of the gyroscope relative to the magnetometer when neither the gyroscope nor the magnetometer is disturbed.
若第一位姿变化率与第二位姿变化率之间的差异较大,说明当前时刻环境的信号干扰较大,则可以同时调整第一位姿数据的第一位姿权值和第二位姿数据的第二位姿权值,降低信号干扰的影响。If the difference between the first attitude change rate and the second attitude change rate is large, indicating that the signal interference of the environment at the current moment is large, the first attitude weight and the second attitude weight of the first attitude data can be adjusted at the same time. The second pose weight of the pose data reduces the impact of signal interference.
本公开下文实施方式中对确定第一位姿权值和第二位姿权值的过程进行具体说明,在此暂不展开。The process of determining the first posture weight and the second posture weight will be described in detail in the following embodiments of the present disclosure, which will not be elaborated here.
S240、根据第一位姿权值和第二位姿权值,对当前时刻的第一位姿数据和第二位姿数据进行融合处理,得到移动设备当前时刻的目标位置。S240. According to the first posture weight and the second posture weight, fuse the first posture data and the second posture data at the current moment to obtain the target position of the mobile device at the current moment.
结合前述可知,对于当前时刻t,可以通过第一传感器的采集数据计算得到第一位姿数据,通过第二传感器的采集数据计算得到第二位姿数据。在通过前述过程确定两者分别对应的第一位姿权值和第二位姿权值之后,即可基 于位姿权值对第一位姿数据和第二位姿数据进行数据融合处理,从而确定移动设备在当前时刻t的目标位姿。Based on the above, it can be seen that for the current time t, the first posture data can be calculated through the data collected by the first sensor, and the second posture data can be calculated through the data collected by the second sensor. After the first pose weight and the second pose weight corresponding to the two are determined through the aforementioned process, the first pose data and the second pose data can be fused based on the pose weight, so that Determine the target pose of the mobile device at the current time t.
在一些实施方式中,可以采用卡尔曼滤波方法对第一位姿数据和第二位姿数据进行融合处理,得到目标位姿。本公开下文实施方式对此进行说明,在此暂不详述。In some implementations, a Kalman filter method can be used to fuse the first pose data and the second pose data to obtain the target pose. This will be described in the following embodiments of the present disclosure and will not be described in detail here.
通过上述可知,本公开实施方式中,通过对第一传感器和第二传感器当前一段时间内的采样数据变化趋势进行对比,确定两者当前时刻的可靠程度,并基于可靠程度动态调整两者的位姿权值,从而可以有效消除或者缓解信号干扰导致的数据失真的缺陷,提高数据融合后得到的目标位姿的准确性。As can be seen from the above, in the embodiment of the present disclosure, the reliability of the first sensor and the second sensor at the current moment is determined by comparing the changing trends of the sampling data of the first sensor and the second sensor, and the positions of the two are dynamically adjusted based on the reliability. pose weights, which can effectively eliminate or alleviate the defects of data distortion caused by signal interference, and improve the accuracy of the target pose obtained after data fusion.
值得说明的是,物体在三维空间的位姿可以通过三维位置坐标(x,y,z)以及三维姿态(ψ roll,ψ pitch,ψ yaw)来表示,ψ roll表示横滚角,ψ pitch表示俯仰角,ψ yaw表示偏航角。 It is worth explaining that the pose of an object in three-dimensional space can be represented by three-dimensional position coordinates (x, y, z) and three-dimensional attitude (ψ roll , ψ pitch , ψ yaw ), ψ roll represents the roll angle, and ψ pitch represents Pitch angle, ψ yaw represents the yaw angle.
对于地面移动设备的三维姿态估计,其横滚角ψ roll和俯仰角ψ pitch本身运动幅度很小,而且可以通过加速度计进行校正,加速度计几乎不受环境因素影响,得到的位姿结果可以较好收敛,因此其三维位姿估计的难点在于偏航角ψ yaw的估计。 For the three-dimensional attitude estimation of ground mobile equipment, the roll angle ψ roll and pitch angle ψ pitch themselves have very small motion amplitudes, and can be corrected by the accelerometer. The accelerometer is almost not affected by environmental factors, and the obtained pose results can be compared It converges well, so the difficulty in its three-dimensional pose estimation lies in the estimation of the yaw angle ψ yaw .
本公开下文实施方式中,将以地面移动设备的偏航角ψ yaw位姿估计为例,对本公开实施方式的位姿估计方法进行说明。但是需要理解,本公开实施方式的位姿估计方法并不局限于此,对于其他任何位姿估计均可以适用,本公开对此不再赘述。 In the following embodiments of the disclosure, the pose estimation method of the embodiments of the disclosure will be described by taking the pose estimation of the yaw angle ψ yaw of the ground mobile device as an example. However, it should be understood that the pose estimation method in the embodiment of the present disclosure is not limited to this, and can be applied to any other pose estimation, which will not be described in detail in the present disclosure.
另外,下文实施方式中,移动设备的第一传感器以陀螺仪为例,第二传感器以磁力计为例。对于陀螺仪和磁力计的具体工作原理,本领域技术人员毫无疑问可以理解并充分实现,本公开不再赘述。In addition, in the following embodiments, the first sensor of the mobile device is a gyroscope, and the second sensor is a magnetometer. The specific working principles of gyroscopes and magnetometers can undoubtedly be understood and fully implemented by those skilled in the art, and will not be described in detail in this disclosure.
如图3所示,在一些实施方式中,本公开示例的位姿估计方法,得到第一位姿集合的过程包括:As shown in Figure 3, in some implementations, according to the pose estimation method of the present disclosure, the process of obtaining the first pose set includes:
S310、对于每个采样时刻,基于第一传感器采集得到的采样时刻的第一运动数据。S310. For each sampling moment, based on the first motion data at the sampling moment collected by the first sensor.
可以理解,第一传感器每隔固定的采样周期会采集一次移动设备的运动数据,定义为第一运动数据。例如本公开实施方式中,第一传感器为陀螺仪,陀螺仪每隔100ms采样一次移动设备yaw(偏航)角数据,也即本公开所述 的第一运动数据。It can be understood that the first sensor collects motion data of the mobile device every fixed sampling period, which is defined as the first motion data. For example, in the embodiment of the disclosure, the first sensor is a gyroscope, and the gyroscope samples the yaw (yaw) angle data of the mobile device every 100 ms, which is the first motion data described in the disclosure.
以采样时刻t为例,第一传感器采集得到的第一运动数据可表示为ω z,t,也即,采样时刻t的机身yaw角的角速度。 Taking the sampling time t as an example, the first motion data collected by the first sensor can be expressed as ω z,t , that is, the angular velocity of the yaw angle of the fuselage at the sampling time t.
S320、根据采样时刻的第一运动数据、前一采样时刻的第一运动数据以及采样周期,确定移动设备的第一位姿变化数据。S320. Determine the first posture change data of the mobile device based on the first motion data at the sampling time, the first motion data at the previous sampling time, and the sampling period.
S330、根据前一采样时刻的第一位姿数据和第一位姿变化数据,确定移动设备在采样时刻的第一位姿数据。S330. Determine the first attitude data of the mobile device at the sampling time based on the first attitude data and the first attitude change data at the previous sampling time.
在通过第一传感器采样得到当前时刻的第一运动数据之后,需要将当前时刻的运动信息累加到前一时刻的位姿结果上,从而实时对位姿信息进行更新。After the first motion data of the current moment is obtained through the first sensor sampling, the motion information of the current moment needs to be accumulated to the pose result of the previous moment, so as to update the pose information in real time.
具体而言,仍以采样时刻t为例,其对应的第一运动数据为ω z,t,前一采样时刻即为t-1,其对应的第一运动数据即为ω z,t-1,则采样时刻t对应的第一位姿数据表示为: Specifically, still taking the sampling time t as an example, the corresponding first motion data is ω z, t . The previous sampling time is t-1, and the corresponding first motion data is ω z, t-1. , then the first attitude data corresponding to the sampling time t is expressed as:
Figure PCTCN2022093607-appb-000009
Figure PCTCN2022093607-appb-000009
式(3)中,
Figure PCTCN2022093607-appb-000010
表示通过陀螺仪积分得到的采样时刻t的机身yaw角,也即第一位姿数据。
Figure PCTCN2022093607-appb-000011
表示前一采样时刻t-1的机身yaw角。Δt表示陀螺仪的采样周期。
In formula (3),
Figure PCTCN2022093607-appb-000010
Represents the yaw angle of the fuselage at the sampling time t obtained by gyroscope integration, that is, the first attitude data.
Figure PCTCN2022093607-appb-000011
Represents the yaw angle of the fuselage at the previous sampling time t-1. Δt represents the sampling period of the gyroscope.
参见上式(3),ω z,t表示t时刻采样得到的yaw角的角速度,ω z,t-1表示t-1时刻采样得到的yaw角的角速度。从而
Figure PCTCN2022093607-appb-000012
即表示由t-1时刻至t时刻运动过程中机身yaw角的平均角速度,其与采样周期Δt的乘积即为由t-1时刻至t时刻机身yaw角的运动角度,也即本公开实施方式所述的第一位姿变化数据。然后将第一位姿变化数据累加至t-1时刻的yaw角数据中,即可得到t时刻的yaw角数据。
Referring to the above formula (3), ω z,t represents the angular velocity of the yaw angle sampled at time t, and ω z,t-1 represents the angular velocity of the yaw angle sampled at time t-1. thereby
Figure PCTCN2022093607-appb-000012
That is, it represents the average angular velocity of the fuselage yaw angle during the movement from time t-1 to time t. The product of it and the sampling period Δt is the movement angle of the fuselage yaw angle from time t-1 to time t, which is the disclosure The first posture change data described in the embodiment. Then the first attitude change data is accumulated into the yaw angle data at time t-1, and the yaw angle data at time t can be obtained.
对于每个采样时刻,均通过上述公式(3)进行计算,可以得到每个采样时刻所对应的第一位姿数据。For each sampling moment, the calculation is performed through the above formula (3), and the first attitude data corresponding to each sampling moment can be obtained.
S340、根据当前时刻的第一位姿数据和当前时刻之前预设数量采样时刻的第一位姿数据,得到第一位姿集合。S340. Obtain the first attitude set based on the first attitude data at the current time and the first attitude data at a preset number of sampling times before the current time.
本公开实施方式中,需要基于当前时刻之前一段时间的第一位姿数据构建第一位姿集合。In the embodiment of the present disclosure, it is necessary to construct the first posture set based on the first posture data for a period of time before the current time.
以当前时刻t为例,可以获取当前时刻t、前一采样时刻t-1、前两个采样时刻t-1、……、前N个采样时刻t-N,共N个采样时刻对应的第一位姿数据, 得到第一位姿集合,表示为如式(1)所示:
Figure PCTCN2022093607-appb-000013
Taking the current time t as an example, you can obtain the current time t, the previous sampling time t-1, the first two sampling times t-1,..., the first N sampling times tN, and the first position corresponding to a total of N sampling times. pose data, the first pose set is obtained, expressed as shown in Equation (1):
Figure PCTCN2022093607-appb-000013
如图4所示,在一些实施方式中,本公开示例的位姿估计方法,得到第二位姿集合的过程包括:As shown in Figure 4, in some implementations, according to the pose estimation method of the present disclosure, the process of obtaining the second pose set includes:
S410、对于每个采样时刻,基于第二传感器采集得到采样时刻的第二运动数据。S410. For each sampling moment, obtain the second motion data at the sampling moment based on the second sensor collection.
可以理解,第二传感器每隔固定的采样周期会采集一次移动设备的运动数据,定义为第二运动数据。例如本公开实施方式中,第二传感器为磁力计,磁力计每隔100ms采样一次移动设备周围的磁场向量和位姿角数据,也即本公开所述的第二运动数据。It can be understood that the second sensor collects motion data of the mobile device every fixed sampling period, which is defined as second motion data. For example, in the embodiment of the present disclosure, the second sensor is a magnetometer, and the magnetometer samples the magnetic field vector and pose angle data around the mobile device every 100 ms, which is the second motion data described in the present disclosure.
S420、根据第二运动数据确定移动设备在采样时刻的第二位姿数据。S420. Determine the second pose data of the mobile device at the sampling time based on the second motion data.
在本公开实施方式中,磁力计计算每个采样时刻的yaw角的过程,可表示为:In the embodiment of the present disclosure, the process of the magnetometer calculating the yaw angle at each sampling moment can be expressed as:
Figure PCTCN2022093607-appb-000014
Figure PCTCN2022093607-appb-000014
式(4)中,
Figure PCTCN2022093607-appb-000015
表示磁力计计算得到的机身yaw角,B=[B x,B y,B z] T表示磁力计检测得到的磁场向量。φ表示机身横滚角,θ表示机身俯仰角,可以采用例如Mahony姿态解算算法得到。
In formula (4),
Figure PCTCN2022093607-appb-000015
represents the yaw angle of the fuselage calculated by the magnetometer, and B=[B x , By y , B z ] T represents the magnetic field vector detected by the magnetometer. φ represents the fuselage roll angle, and θ represents the fuselage pitch angle, which can be obtained using, for example, the Mahony attitude solution algorithm.
对于每个采样时刻,均通过上述式(4)进行计算,可以得到每个采样时刻所对应的第二位姿数据。For each sampling moment, calculation is performed through the above formula (4), and the second pose data corresponding to each sampling moment can be obtained.
S430、根据当前时刻的第二位姿数据和当前时刻之前预设数量采样时刻的第二位姿数据,得到第二位姿集合。S430. Obtain a second pose set based on the second pose data at the current time and the second pose data at a preset number of sampling times before the current time.
本公开实施方式中,需要基于当前时刻之前一段时间的第二位姿数据构建第二位姿集合。In the embodiment of the present disclosure, it is necessary to construct a second pose set based on the second pose data for a period of time before the current time.
以当前时刻t为例,可以获取当前时刻t、前一采样时刻t-1、前两个采样时刻t-1、……、前N个采样时刻t-N,共N个采样时刻对应的第二位姿数据,得到第二位姿集合,表示为如式(2)所示:
Figure PCTCN2022093607-appb-000016
Taking the current time t as an example, you can obtain the current time t, the previous sampling time t-1, the first two sampling times t-1,..., the first N sampling times tN, and the second bit corresponding to a total of N sampling times. pose data to obtain the second pose set, expressed as shown in Equation (2):
Figure PCTCN2022093607-appb-000016
在一些实施方式中,在得到第一位姿集合和第二位姿集合之后,可以分别对两个位姿集合进行线性回归,得到拟合直线所对应的斜率,基于斜率判断两者的变化趋势是否一致或相近。下面结合图5实施方式进行说明。In some embodiments, after obtaining the first pose set and the second pose set, linear regression can be performed on the two pose sets respectively to obtain the slope corresponding to the fitting straight line, and the changing trend of the two poses is determined based on the slope. Are they consistent or similar. The following description will be made with reference to the embodiment of FIG. 5 .
如图5所示,在一些实施方式中,本公开示例的位姿估计方法,确定第 一位姿变化率和第二位姿变化率的过程包括:As shown in Figure 5, in some embodiments, according to the pose estimation method of the present disclosure, the process of determining the first pose change rate and the second pose change rate includes:
S510、基于第一位姿集合包括的各个第一位姿数据进行边界数值处理,得到数值上连续的第一目标集;基于第二位姿集合包括的各个第二位姿数据进行边界处理,得到数值上连续的第二目标集。S510. Perform boundary numerical processing based on each first pose data included in the first pose set to obtain a numerically continuous first target set; perform boundary processing based on each second pose data included in the second pose set to obtain A numerically consecutive second set of targets.
需要特别说明的是,对于移动设备的真实移动场景,其yaw角的移动过程是连续的,也即移动设备可在0°~360°范围内连续转动。但是,在数学表示上,移动设备的yaw角范围为-180°~180°,也即如图6所示,这就会导致180°边界的不连续。It should be noted that in the real moving scene of the mobile device, the movement process of the yaw angle is continuous, that is, the mobile device can continuously rotate within the range of 0° to 360°. However, in mathematical representation, the yaw angle range of mobile devices is -180° to 180°, which is shown in Figure 6, which will lead to discontinuity at the 180° boundary.
举例来说,移动设备在t-N时刻至t时刻的真实运动过程为:由175°转动至185°。这在设备的客观运动上是连续的,但是在图6所示的数学表达上,该运动过程为:由175°运动至180°,然后由-180°运动至-175°。可以看到,该过程存在由180°突变至-180的边界跨越,导致数学表达的不连续。For example, the actual motion process of the mobile device from time t-N to time t is: rotation from 175° to 185°. This is continuous in terms of the objective movement of the device, but in terms of the mathematical expression shown in Figure 6, the movement process is: movement from 175° to 180°, and then movement from -180° to -175°. It can be seen that there is a boundary crossing from 180° to -180 in this process, resulting in discontinuity in mathematical expression.
数学表达的不连续,将会导致位姿集合中各个元素的不连续,这样在对位姿集合进行线性回归之前,需要对存在边界跨越的元素数值进行边界数值处理,使得位姿集合中每个元素的数值是连续的。The discontinuity of mathematical expression will lead to the discontinuity of each element in the pose set. In this way, before performing linear regression on the pose set, it is necessary to perform boundary numerical processing on the element values that have boundary crossings, so that each element in the pose set The values of the elements are consecutive.
例如,位姿集合中的元素表示为:[175,177,179,-179,-177,-175],该位姿集合表示的真实运动过程为:机体由175°运动至185°,但是第一位姿集合中的各个元素在数值上并不连续。通过边界数值处理,可以将该位姿集合表示为:[175,177,179,181,183,185],也即使得位姿集合中各个元素在数值上连续。For example, the elements in the pose set are expressed as: [175,177,179,-179,-177,-175]. The real movement process represented by this pose set is: the body moves from 175° to 185°, but the first pose set The elements in are not numerically continuous. Through boundary numerical processing, the pose set can be expressed as: [175,177,179,181,183,185], which means that each element in the pose set is numerically continuous.
基于上述边界数值处理之后,可以将第一位姿集合转换为第一目标集,将第二位姿集合转换为第二目标集。对于第一位姿集合和第二位姿集合进行边界数值处理的过程,本公开下文图7实施方式中进行具体说明,在此暂不详述。After the above boundary numerical processing, the first pose set can be converted into the first target set, and the second pose set can be converted into the second target set. The process of performing boundary numerical processing on the first pose set and the second pose set will be specifically described in the embodiment of FIG. 7 below in this disclosure, and will not be described in detail here.
S520、根据第一目标集包括的各个元素进行线性回归,得到第一目标集对应的第一直线的第一斜率;根据第二目标集包括的各个元素进行线性回归,得到第一目标集对应的第二直线的第二斜率。S520. Perform linear regression based on each element included in the first target set to obtain the first slope of the first straight line corresponding to the first target set; perform linear regression based on each element included in the second target set to obtain the first slope corresponding to the first target set. The second slope of the second straight line.
本公开实施方式中,在进行边界数值处理之后,可以对第一目标集和第二目标集各自包括的N个元素进行线性回归,拟合得到各自对应的第一直线和第二直线。In the embodiment of the present disclosure, after performing boundary numerical processing, linear regression can be performed on the N elements included in each of the first target set and the second target set, and the corresponding first straight line and second straight line can be obtained by fitting.
在一些实施方式中,可以采用最小二乘法对第一目标集和第二目标集进 行线性回归,以其中任意一个目标集为例进行说明。In some implementations, the least squares method can be used to perform linear regression on the first target set and the second target set. Any one of the target sets will be used as an example for illustration.
首先,对目标集中N个元素进行线性回归,表示为:First, linear regression is performed on N elements in the target set, expressed as:
A=[X,I]     (5)A=[X,I] (5)
式(5)中,X为时间向量,表示为X=[0,1,...,N-1] T。I为N*1的列矩阵,元素均为1,表示为
Figure PCTCN2022093607-appb-000017
基于式(5)可得:
In formula (5), X is a time vector, expressed as X=[0,1,...,N-1] T . I is an N*1 column matrix with all elements being 1, expressed as
Figure PCTCN2022093607-appb-000017
Based on equation (5) we can get:
H=(A TA) -1A TY   (6) H=(A T A) -1 A T Y (6)
式(6)中,Y=ψ N,也即目标集中的元素。H=[k,b] T,k表示拟合得到的直线的斜率,b表示拟合得到的直线的截距。 In formula (6), Y=ψ N , which is the element in the target set. H=[k,b] T , k represents the slope of the straight line obtained by fitting, and b represents the intercept of the straight line obtained by fitting.
通过上述过程,可以分别对第一目标集进行线性回归得到对应的第一直线的第一斜率k g,对第二目标集进行线性回归得到对应的第二直线的第二斜率k mThrough the above process, linear regression can be performed on the first target set to obtain the first slope k g of the corresponding first straight line, and linear regression can be performed on the second target set to obtain the second slope k m of the corresponding second straight line.
S530、将第一斜率确定为第一位姿变化率,将第二斜率确定为第二位姿变化率。S530. Determine the first slope as the first posture change rate, and determine the second slope as the second posture change rate.
本公开实施方式中,将第一斜率k g确定为第一位姿集合对应的第一位姿变化率,将第二斜率确定为第二位姿集合对应的第二位姿变化率。 In the embodiment of the present disclosure, the first slope k g is determined as the first pose change rate corresponding to the first pose set, and the second slope is determined as the second pose change rate corresponding to the second pose set.
可以理解,第一位姿变化率是根据第一位姿集合的各个第一位姿数据拟合得到的第一直线的斜率,其可以反映出第一位姿集合中各个第一位姿数据的变化趋势。同理,第二位姿变化率是根据第二位姿集合的各个第二位姿数据拟合得到的第二直线的斜率,其可以反映出第二位姿集合中各个第二位姿数据的变化趋势。It can be understood that the first attitude change rate is the slope of the first straight line fitted according to each first attitude data of the first attitude set, which can reflect each first attitude data in the first attitude set. changing trends. Similarly, the second pose change rate is the slope of the second straight line fitted according to each second pose data in the second pose set, which can reflect the change rate of each second pose data in the second pose set. Trend.
在得到第一位姿变化率和第二位姿变化率之后,即可通过第一位姿变化率和第二位姿变化率的差异,确定两者的趋势一致性,本公开下文实施方式中对此过程进行具体说明。After obtaining the first posture change rate and the second posture change rate, the trend consistency of the two can be determined through the difference between the first posture change rate and the second posture change rate. In the following embodiments of the present disclosure, Provide a detailed explanation of this process.
通过上述可知,本公开实施方式中,通过当前时刻之前一段时间内的位姿数据,来反映第一传感器和第二传感器采集数据的变化趋势,可以对移动设备当前所处环境进行判断,将第一传感器和第二传感器当前的可靠程度进行量化表达。It can be seen from the above that in the embodiment of the present disclosure, the changing trend of the data collected by the first sensor and the second sensor is reflected through the pose data for a period of time before the current time, so that the current environment of the mobile device can be judged, and the third sensor can be used to determine the current environment of the mobile device. The current reliability of the first sensor and the second sensor is quantitatively expressed.
如图7所示,在一些实施方式中,对第一位姿集合和第二位姿集合中任意一个位姿集合进行边界数值处理的过程包括:As shown in Figure 7, in some embodiments, the process of performing boundary numerical processing on any one of the first pose set and the second pose set includes:
S710、响应于位姿集合中各个元素同时包括正值和负值,计算得到所有 元素绝对值的平均值。S710. In response to each element in the pose set including both positive and negative values, calculate the average of the absolute values of all elements.
结合图6所示,对于某个位姿集合,若其中包括的元素既有正值也有负值,表示该位姿集合中的各个元素数值可能是不连续的。As shown in Figure 6, for a certain pose set, if the elements included in it have both positive and negative values, it means that the values of each element in the pose set may be discontinuous.
例如一个示例中,位姿集合表示为[170,171,172,173,174,175],其表示移动设备的yaw角由170°转动至175°。在该位姿集合中,所有的元素数值均为正值,而且各个元素在数值上是连续的。For example, in an example, the pose set is expressed as [170,171,172,173,174,175], which means that the yaw angle of the mobile device is rotated from 170° to 175°. In this pose set, all element values are positive, and each element is numerically continuous.
例如一个示例中,位姿集合表示为[-175,-174,-173,-172,-171,-170],其表示移动设备的yaw角由185°转动至190°。在该位姿集合中,所有元素数值均为负值,而且各个元素在数值上是连续的。For example, in an example, the pose set is represented as [-175,-174,-173,-172,-171,-170], which indicates that the yaw angle of the mobile device is rotated from 185° to 190°. In this pose set, all element values are negative, and each element is numerically continuous.
由此可见,若位姿集合中所有元素均为正值,或者所有元素均为负值,则说明位姿集合中各个元素在数值上是连续的,也即没有跨越0°边界或者180°边界,无需进行边界数值处理,直接进行上述线性回归过程即可。It can be seen that if all elements in the pose set are positive values, or all elements are negative values, it means that each element in the pose set is numerically continuous, that is, it does not cross the 0° boundary or the 180° boundary. , there is no need to perform boundary numerical processing, and the above linear regression process can be directly performed.
但是,若位姿集合中的各个元素既包括正值,又包括负值,也不代表各个元素的数值一定是不连续的。However, if each element in the pose set includes both positive and negative values, it does not mean that the values of each element must be discontinuous.
例如一个示例中,位姿集合表示为[175,177,179,-179,-177,-175],其表示移动设备的yaw角由175°转动至185°。在该位姿集合中,既包括正值又包括负值,并列各个元素数值并不连续,因为其跨越了180°边界,181°将被表示为-179,导致出现数值的不连续。For example, in an example, the pose set is expressed as [175,177,179,-179,-177,-175], which means that the yaw angle of the mobile device is rotated from 175° to 185°. In this pose set, including both positive and negative values, the values of each element are not continuous because they cross the 180° boundary, and 181° will be represented as -179, resulting in discontinuous values.
例如一个示例中,位姿集合表示为[-5,-3,-1,1,3,5],其表示移动设备的yaw角由355°转动至5°。在该位姿集合中,虽然也同时包括正值元素和负值元素,但是各个元素数值是连续的,因为其跨越的是0°边界,数值即使由负值逐渐变为正值,其依旧是连续的。For example, in an example, the pose set is represented as [-5,-3,-1,1,3,5], which means that the yaw angle of the mobile device is rotated from 355° to 5°. In this pose set, although it also includes both positive and negative elements, the value of each element is continuous because it spans the 0° boundary. Even if the value gradually changes from negative to positive, it is still continuously.
因此,本步骤中,首先确定位姿集合中各个元素的数值是否同时包括正值和负值,若是,则需要进一步判断位姿集合跨越的边界是0°边界还是180°边界。本公开实施方式中,定义0°边界为第一边界,定义180°边界为第二边界。Therefore, in this step, it is first determined whether the values of each element in the pose set include both positive and negative values. If so, it is necessary to further determine whether the boundary spanned by the pose set is the 0° boundary or the 180° boundary. In the embodiment of the present disclosure, the 0° boundary is defined as the first boundary, and the 180° boundary is defined as the second boundary.
本公开实施方式中,若位姿集合中同时包括正值元素和负值元素,可对所有元素取绝对值之后求平均值,表示为:In the embodiment of the present disclosure, if the pose set includes both positive elements and negative elements, the absolute values of all elements can be taken and the average value can be calculated, expressed as:
Figure PCTCN2022093607-appb-000018
Figure PCTCN2022093607-appb-000018
式(7)中,aver_N表示位姿集合中N个元素的绝对值的平均值,ψ N表 示位姿集合中每个元素。 In formula (7), aver_N represents the average of the absolute values of N elements in the pose set, and ψ N represents each element in the pose set.
S720、根据平均值与第一边界的第一差值绝对值,以及平均值与第二边界的第二差值绝对值的大小关系,确定位姿集合对应的目标边界。S720. Determine the target boundary corresponding to the pose set based on the relationship between the first absolute value of the difference between the average value and the first boundary, and the magnitude relationship between the second absolute value of the difference between the average value and the second boundary.
基于前述可知,在位姿集合中同时包括正值元素和负值元素的情况下,需要进一步判断位姿集合跨越的是第一边界还是第二边界,第一边界即为0°边界,第二边界即为180°边界。Based on the foregoing, it can be seen that when the pose set includes both positive elements and negative elements, it is necessary to further determine whether the pose set spans the first boundary or the second boundary. The first boundary is the 0° boundary, and the second boundary The boundary is the 180° boundary.
具体而言,可以分别计算前述得到的平均值与每个边界差值的绝对值,通过对比两者大小,即可判断位姿集合跨越的目标边界。Specifically, the average value obtained above and the absolute value of each boundary difference can be calculated respectively. By comparing the two sizes, the target boundary spanned by the pose set can be determined.
例如,平均值与第一边界的第一差值绝对值表示为:|aver_N-180|,平均值与第二边界的第二差值绝对值表示为:|aver_N-0|。For example, the absolute value of the first difference between the average value and the first boundary is expressed as: |aver_N-180|, and the absolute value of the second difference between the average value and the second boundary is expressed as: |aver_N-0|.
在一些实施方式中,若|aver_N-180|<|aver_N-0|,说明位姿集合中的元素更加靠近0°边界,也即第一边界,从而将第一边界确定为目标边界。In some implementations, if |aver_N-180|<|aver_N-0|, it means that the elements in the pose set are closer to the 0° boundary, that is, the first boundary, so that the first boundary is determined as the target boundary.
在另一些实施方式中,若|aver_N-180|>|aver_N-0|,说明位姿集合中的元素更加靠近180°边界,也即第二边界,从而将第二边界确定为目标边界。In other implementations, if |aver_N-180|>|aver_N-0|, it means that the elements in the pose set are closer to the 180° boundary, that is, the second boundary, so that the second boundary is determined as the target boundary.
S730、响应于目标边界为第一边界和第二边界中的预设边界,对位姿集合中各个元素进行数值转换,得到在数值上连续的目标集。S730. In response to the target boundary being the preset boundary among the first boundary and the second boundary, perform numerical conversion on each element in the pose set to obtain a numerically continuous target set.
基于前述可知,只有当位姿集合跨越180°边界(也即第二边界)时,位姿集合中各个元素在数值上才不连续,因此,本公开实施方式中,预设边界即为第二边界。Based on the foregoing, it can be seen that only when the pose set crosses the 180° boundary (that is, the second boundary), each element in the pose set is numerically discontinuous. Therefore, in the embodiment of the present disclosure, the preset boundary is the second boundary. boundary.
在一些实施方式中,若目标边界为第一边界,说明位姿集合跨越的是0°边界,从而位姿集合中各个元素在数值上是连续的,从而无需进行数值边界处理,直接进行上述的线性回归过程即可。In some implementations, if the target boundary is the first boundary, it means that the pose set spans the 0° boundary, so that each element in the pose set is numerically continuous, so there is no need to perform numerical boundary processing, and the above-mentioned process is performed directly. Linear regression process is sufficient.
在另一些实施方式中,若目标边界为第二边界,说明位姿集合跨越的是180°边界,从而位姿集合中各个元素在数值上是不连续的,无法直接进行线性回归,需要对各个元素数值进行数值转换,得到数值连续的目标集。本公开下文图8实施方式对数值转换的过程进行具体说明。In other embodiments, if the target boundary is the second boundary, it means that the pose set spans the 180° boundary. Therefore, each element in the pose set is numerically discontinuous, and linear regression cannot be directly performed. Each element needs to be The element values are numerically converted to obtain a target set with continuous values. The process of numerical conversion is specifically described in the embodiment of FIG. 8 of the present disclosure below.
通过前述可知,本公开实施方式中,通过对位姿集合中各个元素的数值连续性进行判断,可以有效对数学表达不连续的位姿集合进行线性回归,适用于任何场景下的位姿估计。As can be seen from the foregoing, in the embodiments of the present disclosure, by judging the numerical continuity of each element in the pose set, linear regression can be effectively performed on a pose set with discontinuous mathematical expressions, which is suitable for pose estimation in any scenario.
如图8所示,在一些实施方式中,本公开示例的位姿估计方法,对位姿 集合中各个元素进行数值转换的过程,包括:As shown in Figure 8, in some implementations, the pose estimation method of the present disclosure example, the process of numerical conversion of each element in the pose set includes:
S810、响应于目标边界为第一边界和第二边界中的预设边界,确定位姿集合中正值的第一数量和负值的第二数量。S810. In response to the target boundary being the preset boundary among the first boundary and the second boundary, determine the first number of positive values and the second number of negative values in the pose set.
S820、响应于第一数量大于第二数量,将所有负值的元素数值增加预设数值,得到目标集。S820. In response to the first quantity being greater than the second quantity, increase all negative element values by the preset value to obtain the target set.
S830、响应于第一数量不大于第二数量,将正值的元素数值减少预设数值,得到目标集。S830. In response to the first quantity not being greater than the second quantity, reduce the positive element value by the preset value to obtain the target set.
基于前述可知,若位姿集合对应的目标边界为第二边界,说明位姿集合跨越了180°边界,位姿集合中各个元素数值上是不连续的,需要将不连续数值转换为连续数值。Based on the above, it can be seen that if the target boundary corresponding to the pose set is the second boundary, it means that the pose set spans the 180° boundary. Each element in the pose set is numerically discontinuous, and discontinuous values need to be converted into continuous values.
在数值转换时,既可以将所有的负值统一转换为正值,也可以将所有的正值统一转换为负值。在一些实施方式中,为了降低计算量,可以判断正值与负值的数量,将数量较少的一方转换为数量较多的一方,从而减少数值转换的数值数量,提高计算效率。When converting numerical values, you can convert all negative values into positive values uniformly, or you can convert all positive values into negative values uniformly. In some implementations, in order to reduce the amount of calculation, the number of positive values and negative values can be determined, and the smaller number can be converted into the larger number, thereby reducing the number of numerical values to be converted and improving calculation efficiency.
例如一个示例中,位姿集合表示为[173,175,177,179,-179,-177],其中正值包括173、175、177以及179共4个,也即第一数量为4。负值包括-179、-177共2个,也即第二数量为2。For example, in an example, the pose set is expressed as [173,175,177,179,-179,-177], in which the positive values include 173, 175, 177 and 179, a total of 4, that is, the first number is 4. Negative values include -179 and -177, a total of 2, that is, the second number is 2.
在本示例中,第一数量大于第二数量,从而需要将所有的负值增加预设数值转换为正值,本公开示例中预设数值可为360。例如,-179+360=181,-177+360=183,从而数值转换后得到的目标集表示为[173,175,177,179,181,183],可以看到,目标集中各个元素在数值上已经是连续的。In this example, the first quantity is greater than the second quantity, so all negative values need to be converted into positive values by increasing the preset value. In the example of this disclosure, the preset value may be 360. For example, -179+360=181, -177+360=183, so the target set obtained after numerical conversion is expressed as [173,175,177,179,181,183]. It can be seen that each element in the target set is numerically continuous.
例如另一个示例中,位姿集合表示为[177,179,-179,-177,-175,-173],其中正值包括177、179共2个,也即第一数量为2。负值包括-179、-177、-175以及-173共4个,也即第二数量为4。For example, in another example, the pose set is expressed as [177,179,-179,-177,-175,-173], in which the positive values include 177 and 179, that is, the first number is 2. The negative values include -179, -177, -175 and -173, a total of 4, that is, the second number is 4.
在本示例中,第一数量小于第二数量,从而需要将所有的正值减少预设数值转换为负值,本公开示例中预设数值可为360。例如,177-360=-183,179-360=-181,从而数值转换后得到的目标集表示为[-183,-181,-179,-177,-175,-173],可以看到,目标集中各个元素在数值上已经是连续的。In this example, the first quantity is smaller than the second quantity, so all positive values need to be reduced by the preset value and converted into negative values. In the example of this disclosure, the preset value may be 360. For example, 177-360=-183, 179-360=-181, so the target set obtained after numerical conversion is expressed as [-183,-181,-179,-177,-175,-173], as you can see, Each element in the target set is already numerically continuous.
通过上述过程,分别对式(1)和式(2)所示的第一位姿集合和第二位姿集合进行边界数值处理,可以得到第一目标集和第二目标集,然后基于前述图5所述的线性回归过程,分别得到第一位姿集合对应的第一位姿变化率和第二位姿集合对应的第二位姿变化率,本公开不再赘述。Through the above process, boundary numerical processing is performed on the first pose set and the second pose set shown in equations (1) and (2) respectively, and the first target set and the second target set can be obtained, and then based on the aforementioned figure The linear regression process described in 5, respectively, obtains the first pose change rate corresponding to the first pose set and the second pose change rate corresponding to the second pose set, which will not be described in detail in this disclosure.
通过上述可知,本公开实施方式中,通过对位姿集合中各个元素进行数值转换,将位姿集合中各个元素转换为连续数值,可以有效对数学表达不连续的位姿集合进行线性回归。It can be seen from the above that in the embodiments of the present disclosure, by performing numerical conversion on each element in the pose set and converting each element in the pose set into a continuous numerical value, linear regression can be effectively performed on a pose set with discontinuous mathematical expression.
结合图5实施方式所述,第一位姿变化率表示的是第一传感器采集数据的变化趋势,第二位姿变化率表示的是第二传感器采集数据的变化趋势。基于前述可知,在第一传感器和第二传感器正常工作状态下,理论上第一位姿变化率和第二位姿变化率的变化趋势应当是一致或者十分接近,若两者变化趋势差异较大,则说明第一传感器和/或第二传感器存在较大的干扰。因此,本公开实施方式中,可以根据第一位姿变化率和第二位姿变化率之间的差异,确定移动设备当前的传感器可靠性。As described in conjunction with the embodiment of FIG. 5 , the first attitude change rate represents the changing trend of the data collected by the first sensor, and the second posture change rate represents the changing trend of the data collected by the second sensor. Based on the foregoing, it can be seen that under normal working conditions of the first sensor and the second sensor, theoretically the changing trends of the first attitude change rate and the second attitude change rate should be consistent or very close. If the change trends of the two are significantly different, , it means that there is large interference in the first sensor and/or the second sensor. Therefore, in the embodiment of the present disclosure, the current sensor reliability of the mobile device can be determined based on the difference between the first attitude change rate and the second attitude change rate.
在本公开实施方式中,可以预先设置预设阈值,该预设阈值表示第一位姿变化率与第二位姿变化率差异较大的临界值。当第一位姿变化率与第二位姿变化率的差异|k g-k m|不大于预设阈值,表示第一位姿集合与第二位姿集合变化趋势一致,也即第一传感器和第二传感器没有受到干扰,可靠性较高。当第一位姿变化率与第二位姿变化率的差异|k g-k m|大于预设阈值,表示第一位姿结合与第二位姿集合变化趋势不一致,也即第二传感器和/或第二传感器存在干扰,可靠性较差。对于预设阈值的具体数值,本领域技术人员可以根据具体场景进行设置,本公开对此不作限制。 In the embodiment of the present disclosure, a preset threshold may be set in advance, and the preset threshold represents a critical value at which the difference between the first posture change rate and the second posture change rate is large. When the difference between the first pose change rate and the second pose change rate |k g -k m | is not greater than the preset threshold, it means that the change trends of the first pose set and the second pose set are consistent, that is, the first sensor and the second sensor are not interfered with and have high reliability. When the difference between the first pose change rate and the second pose change rate |k g -k m | is greater than the preset threshold, it means that the change trends of the first pose combination and the second pose set are inconsistent, that is, the second sensor and /Or there is interference in the second sensor and its reliability is poor. As for the specific value of the preset threshold, those skilled in the art can set it according to specific scenarios, and this disclosure does not limit this.
在一些实施方式中,当第一位姿变化率与第二位姿变化率的差异不大于预设阈值的情况下,说明第一传感器和第二传感器均未受到干扰,从而无需对两者的权重值进行干涉调整,只需要保持原有的更新过程即可。In some embodiments, when the difference between the first attitude change rate and the second attitude change rate is not greater than a preset threshold, it means that neither the first sensor nor the second sensor is interfered, and there is no need to monitor both. To perform interference adjustment on the weight value, you only need to maintain the original update process.
而在另一些实施方式中,第一传感器以陀螺仪为例,第二传感器为磁力计为例。在确定陀螺仪与磁力计的采集数据的变化趋势一致时,考虑到陀螺仪相较于磁力计具有更高的可靠性,从而可仅调整磁力计的位姿权值,不调整陀螺仪的位姿权值。而在确定陀螺仪与磁力计的采集数据的变化趋势不一致时,同时对陀螺仪和磁力计的位姿权值进行调整。下面分别进行说明。In other embodiments, the first sensor is a gyroscope, and the second sensor is a magnetometer. When determining that the changing trends of the collected data of the gyroscope and the magnetometer are consistent, considering that the gyroscope has higher reliability than the magnetometer, only the posture weight of the magnetometer can be adjusted without adjusting the position of the gyroscope. posture weight. When it is determined that the changing trends of the data collected by the gyroscope and the magnetometer are inconsistent, the posture weights of the gyroscope and the magnetometer are adjusted at the same time. Each is explained below.
如图9所示,在一些实施方式中,本公开示例的位姿估计方法,确定磁力计的第二位姿权值的过程包括:As shown in Figure 9, in some embodiments, according to the pose estimation method of the present disclosure, the process of determining the second pose weight of the magnetometer includes:
S910、利用磁力计采集得到当前时刻的第二位姿数据。S910: Use the magnetometer to collect the second pose data at the current moment.
S920、根据当前时刻的第二位姿数据计算得到地磁模长。S920. Calculate the geomagnetic module length based on the second pose data at the current moment.
S930、根据地磁模长确定第二位姿权值。S930. Determine the second pose weight according to the geomagnetic mode length.
可以理解,磁力计是一种测量环境磁场强度的传感器,可通过磁力计测得磁场强度进而得到所需的三轴方位角数据。在周围磁场环境受到干扰时,磁力计测得的地磁模长B会发生变化,并且受干扰程度越可以用地磁模长的变化率进行度量。It can be understood that the magnetometer is a sensor that measures the strength of the environmental magnetic field. The magnetic field strength can be measured by the magnetometer to obtain the required three-axis azimuth angle data. When the surrounding magnetic field environment is disturbed, the geomagnetic mode length B measured by the magnetometer will change, and the greater the degree of interference can be measured by the rate of change of the geomagnetic mode length.
本公开实施方式中,在利用磁力计采集得到当前时刻t的第二位姿数据之后,可以对第二位姿数据进行归一化处理,得到当前时刻t对应的地磁模长B,表示为:In the embodiment of the present disclosure, after using a magnetometer to collect the second pose data at the current time t, the second pose data can be normalized to obtain the geomagnetic mode length B corresponding to the current time t, which is expressed as:
Figure PCTCN2022093607-appb-000019
Figure PCTCN2022093607-appb-000019
式(8)中,
Figure PCTCN2022093607-appb-000020
表示理想状态下磁力计的第二位姿权值,B表示地磁模长,
Figure PCTCN2022093607-appb-000021
表示当前时刻t磁力计的第二位姿权值。
In formula (8),
Figure PCTCN2022093607-appb-000020
represents the second pose weight of the magnetometer under ideal conditions, B represents the geomagnetic mode length,
Figure PCTCN2022093607-appb-000021
Indicates the second pose weight of the magnetometer at the current time t.
可以理解,在理想状态下地磁模长为1,周围磁场干扰越强,计算得到的地磁模长越小于1。因此,通过上述式(8)可以实时计算得到每个采样时刻下磁力计的第二位姿权值,并且随着周围磁场环境的变化,第二位姿权值可以动态调整,从而周围磁场干扰程度越大,磁力计的第二位姿权值越小。It can be understood that under ideal conditions the geomagnetic mode length is 1. The stronger the surrounding magnetic field interference, the smaller the calculated geomagnetic mode length is less than 1. Therefore, the second pose weight of the magnetometer at each sampling moment can be calculated in real time through the above equation (8), and as the surrounding magnetic field environment changes, the second pose weight can be dynamically adjusted, so that the surrounding magnetic field interferes The greater the degree, the smaller the second pose weight of the magnetometer.
对于陀螺仪,在第一位姿变化率与第二位姿变化率的差异不大于预设阈值的情况下,保持原有的第一位姿权值更新过程即可,本公开对此不再赘述。For the gyroscope, when the difference between the first attitude change rate and the second attitude change rate is not greater than the preset threshold, the original first attitude weight update process can be maintained, and this disclosure will no longer Repeat.
而在第一位姿变化率与第二位姿变化率的差异大于预设阈值的情况下,表示当前陀螺仪可能存在受震动等因素影响,导致陀螺仪可靠性降低,从而需要对陀螺仪的第一位姿权值进行调整。在一些实施方式中,可基于卡尔曼滤波对第一位姿权值进行调整,下面具体进行说明。When the difference between the first attitude change rate and the second attitude change rate is greater than the preset threshold, it means that the current gyroscope may be affected by factors such as vibration, resulting in reduced reliability of the gyroscope, thus requiring maintenance of the gyroscope. The first posture weight is adjusted. In some implementations, the first attitude weight can be adjusted based on Kalman filtering, which will be described in detail below.
首先,可获取当前时刻及之前共M个采样时刻的第一位姿权值,表示为:
Figure PCTCN2022093607-appb-000022
以此类推。可以理解,M的具体取值可以根据场景需求进行设置,例如M=5、10、20等,本公开对此不作限制。
First, the first pose weight of the current moment and the previous M sampling moments can be obtained, expressed as:
Figure PCTCN2022093607-appb-000022
And so on. It can be understood that the specific value of M can be set according to scene requirements, for example, M=5, 10, 20, etc., and this disclosure does not limit this.
然后,基于M个采样时刻的第一位姿权值,可以计算得到对应的方差,表示为
Figure PCTCN2022093607-appb-000023
也即过去M个采样时刻的第一位姿权值的方差。基于卡尔曼滤波对当前时刻t的第一位姿权值调整的过程,可表示为:
Then, based on the first attitude weight of M sampling moments, the corresponding variance can be calculated, expressed as
Figure PCTCN2022093607-appb-000023
That is, the variance of the first posture weight of the past M sampling moments. The process of adjusting the first pose weight at the current time t based on Kalman filtering can be expressed as:
Figure PCTCN2022093607-appb-000024
Figure PCTCN2022093607-appb-000024
式(9)中,
Figure PCTCN2022093607-appb-000025
表示当前时刻t对应的第一位姿权值,
Figure PCTCN2022093607-appb-000026
表示过去M个采样时刻的第一位姿权值的方差,
Figure PCTCN2022093607-appb-000027
表示前一采样时刻t-1对应的第一位姿权值。K M表示卡尔曼增益,表示为:
In formula (9),
Figure PCTCN2022093607-appb-000025
Indicates the first posture weight corresponding to the current moment t,
Figure PCTCN2022093607-appb-000026
Represents the variance of the first pose weight of the past M sampling moments,
Figure PCTCN2022093607-appb-000027
Indicates the first posture weight corresponding to the previous sampling time t-1. K M represents the Kalman gain, expressed as:
Figure PCTCN2022093607-appb-000028
Figure PCTCN2022093607-appb-000028
式(10)中,
Figure PCTCN2022093607-appb-000029
表示过去M个采样时刻的方差的置信度,
Figure PCTCN2022093607-appb-000030
表示第一位姿数据的位姿权值的置信度。
In formula (10),
Figure PCTCN2022093607-appb-000029
Represents the confidence of the variance of the past M sampling moments,
Figure PCTCN2022093607-appb-000030
Represents the confidence of the pose weight of the first pose data.
基于上述过程,可以得到当前时刻t的第一位姿数据
Figure PCTCN2022093607-appb-000031
对应的第一位姿权值
Figure PCTCN2022093607-appb-000032
得到当前时刻t的第二位姿数据
Figure PCTCN2022093607-appb-000033
对应的第二位姿权值
Figure PCTCN2022093607-appb-000034
Based on the above process, the first attitude data of the current time t can be obtained
Figure PCTCN2022093607-appb-000031
The corresponding first pose weight
Figure PCTCN2022093607-appb-000032
Get the second pose data at the current time t
Figure PCTCN2022093607-appb-000033
The corresponding second pose weight
Figure PCTCN2022093607-appb-000034
通过上述可知,本公开实施方式中,可以基于对第一传感器和第二传感器的可靠程度量化判断,实时对数据融合过程中各个传感器的位姿权值进行动态的调整,从而消除或者降低外部环境对传感器的干扰,提高位姿估计精度。It can be seen from the above that in the embodiments of the present disclosure, based on the quantitative judgment of the reliability of the first sensor and the second sensor, the pose weights of each sensor during the data fusion process can be dynamically adjusted in real time, thereby eliminating or reducing the external environment. Interference with the sensor improves pose estimation accuracy.
本公开实施方式中,在得到当前时刻t的第一位姿数据
Figure PCTCN2022093607-appb-000035
第二位姿数据
Figure PCTCN2022093607-appb-000036
第一位姿权值
Figure PCTCN2022093607-appb-000037
以及第二位姿权值
Figure PCTCN2022093607-appb-000038
之后,即可基于第一位姿权值
Figure PCTCN2022093607-appb-000039
和第二位姿权值
Figure PCTCN2022093607-appb-000040
对第一位姿数据
Figure PCTCN2022093607-appb-000041
和第二位姿数据
Figure PCTCN2022093607-appb-000042
进行数据融合处理,得到移动设备的目标位姿。
In the embodiment of the present disclosure, after obtaining the first posture data of the current time t
Figure PCTCN2022093607-appb-000035
Second pose data
Figure PCTCN2022093607-appb-000036
First position weight
Figure PCTCN2022093607-appb-000037
and the second pose weight
Figure PCTCN2022093607-appb-000038
After that, based on the first posture weight
Figure PCTCN2022093607-appb-000039
and the second pose weight
Figure PCTCN2022093607-appb-000040
To the first attitude data
Figure PCTCN2022093607-appb-000041
and the second pose data
Figure PCTCN2022093607-appb-000042
Perform data fusion processing to obtain the target pose of the mobile device.
在一些实施方式中,可基于卡尔曼滤波算法对第一位姿数据和第二位姿数据进行融合处理,表示为:In some implementations, the first pose data and the second pose data can be fused based on the Kalman filter algorithm, expressed as:
Figure PCTCN2022093607-appb-000043
Figure PCTCN2022093607-appb-000043
式(11)中,ψ t表示移动设备当前时刻t的目标位姿,ψ t-1表示前一采样时刻t-1的目标位姿,
Figure PCTCN2022093607-appb-000044
表示当前时刻t的第一位姿数据,
Figure PCTCN2022093607-appb-000045
表示当前时刻t的第二位姿数据。K为卡尔曼增益,表示为:
In formula (11), ψ t represents the target pose of the mobile device at the current time t, ψ t-1 represents the target pose of the previous sampling time t-1,
Figure PCTCN2022093607-appb-000044
Represents the first pose data at the current time t,
Figure PCTCN2022093607-appb-000045
Represents the second pose data at the current time t. K is the Kalman gain, expressed as:
Figure PCTCN2022093607-appb-000046
Figure PCTCN2022093607-appb-000046
式(11)中,
Figure PCTCN2022093607-appb-000047
表示第一位姿权值,
Figure PCTCN2022093607-appb-000048
表示第二位姿权值。
In formula (11),
Figure PCTCN2022093607-appb-000047
Represents the first posture weight,
Figure PCTCN2022093607-appb-000048
Represents the second pose weight.
基于上述过程,即可计算得到当前时刻t对应的移动设备的目标位姿,也即上述示例中移动设备最终的yaw角。可以理解,本公开实施方式中,即使移动设备周围的信号环境发生变化,例如磁力计和/或陀螺仪受到干扰,可以通过上述过程对传感器对应的位姿权值进行动态的调整,保证最终数据融合得到的目标位姿的准确性。Based on the above process, the target pose of the mobile device corresponding to the current time t can be calculated, which is the final yaw angle of the mobile device in the above example. It can be understood that in the embodiments of the present disclosure, even if the signal environment around the mobile device changes, for example, the magnetometer and/or gyroscope is interfered, the pose weight corresponding to the sensor can be dynamically adjusted through the above process to ensure the final data. The accuracy of the target pose obtained by fusion.
通过上述可知,本公开实施方式中,通过对第一传感器和第二传感器当 前一段时间内的采样数据变化趋势进行对比,确定两者当前时刻的可靠程度,并基于可靠程度动态调整两者的位姿权值,从而可以有效消除或者缓解信号干扰导致的数据失真的缺陷,提高数据融合后得到的目标位姿的准确性。As can be seen from the above, in the embodiment of the present disclosure, the reliability of the first sensor and the second sensor at the current moment is determined by comparing the changing trends of the sampling data of the first sensor and the second sensor, and the positions of the two are dynamically adjusted based on the reliability. pose weights, which can effectively eliminate or alleviate the defects of data distortion caused by signal interference, and improve the accuracy of the target pose obtained after data fusion.
本公开实施方式提供了一种位姿估计装置,该装置可应用于例如图1所示的移动设备600,用于对移动设备600运动时的位姿进行实时估计。Embodiments of the present disclosure provide a pose estimation device, which can be applied to, for example, the mobile device 600 shown in FIG. 1 , and is used to estimate the pose of the mobile device 600 in real time when it is moving.
如图10所示,在一些实施方式中,本公开示例的位姿估计装置包括:As shown in Figure 10, in some implementations, the pose estimation device of the present disclosure includes:
获取模块10,被配置为通过所述移动设备的第一传感器得到所述移动设备在当前时刻的第一位姿集合,通过所述移动设备的第二传感器得到所述移动设备在当前时刻的第二位姿集合;其中,所述第一位姿集合和所述第二位姿集合包括在当前时刻以及之前若干采样时刻的位姿数据;The acquisition module 10 is configured to obtain the first attitude set of the mobile device at the current moment through the first sensor of the mobile device, and obtain the third attitude set of the mobile device at the current moment through the second sensor of the mobile device. Two pose sets; wherein, the first pose set and the second pose set include pose data at the current moment and several previous sampling moments;
变化率确定模块20,被配置为根据所述第一位姿集合确定所述移动设备的第一位姿变化率,根据所述第二位姿集合确定所述移动设备的第二位姿变化率;The change rate determination module 20 is configured to determine a first posture change rate of the mobile device according to the first posture set, and determine a second posture change rate of the mobile device according to the second posture set. ;
权值确定模块30,被配置为根据所述第一位姿变化率和所述第二位姿变化率的差异,确定所述移动设备在当前时刻的第一位姿权值和第二位姿权值;The weight determination module 30 is configured to determine the first posture weight and the second posture of the mobile device at the current moment based on the difference between the first posture change rate and the second posture change rate. weight;
数据融合模块40,被配置为根据所述第一位姿权值和所述第二位姿权值,对当前时刻的第一位姿数据和第二位姿数据进行融合处理,得到所述移动设备当前时刻的目标位姿。The data fusion module 40 is configured to perform fusion processing on the first posture data and the second posture data at the current moment according to the first posture weight value and the second posture weight value to obtain the movement The target pose of the device at the current moment.
通过上述可知,本公开实施方式中,通过对第一传感器和第二传感器当前一段时间内的采样数据变化趋势进行对比,确定两者当前时刻的可靠程度,并基于可靠程度动态调整两者的位姿权值,从而可以有效消除或者缓解信号干扰导致的数据失真的缺陷,提高数据融合后得到的目标位姿的准确性。As can be seen from the above, in the embodiment of the present disclosure, the reliability of the first sensor and the second sensor at the current moment is determined by comparing the changing trends of the sampling data of the first sensor and the second sensor, and the positions of the two are dynamically adjusted based on the reliability. pose weights, which can effectively eliminate or alleviate the defects of data distortion caused by signal interference, and improve the accuracy of the target pose obtained after data fusion.
在一些实施方式中,所述获取模块10被配置为:In some implementations, the acquisition module 10 is configured to:
对于每个采样时刻,基于所述第一传感器采集得到所述采样时刻的第一运动数据;For each sampling moment, obtain the first motion data at the sampling moment based on the first sensor collection;
根据所述采样时刻的第一运动数据、前一采样时刻的第一运动数据以及采样周期,确定所述移动设备的第一位姿变化数据;Determine the first attitude change data of the mobile device according to the first motion data at the sampling time, the first motion data at the previous sampling time, and the sampling period;
根据前一采样时刻的第一位姿数据和所述第一位姿变化数据,确定所述移动设备在所述采样时刻的第一位姿数据;Determine the first attitude data of the mobile device at the sampling moment based on the first attitude data of the previous sampling moment and the first attitude change data;
根据当前时刻的第一位姿数据和当前时刻之前预设数量采样时刻的第一位姿数据,得到所述第一位姿集合。The first attitude set is obtained based on the first attitude data at the current time and the first attitude data at a preset number of sampling times before the current time.
在一些实施方式中,所述获取模块10被配置为:In some implementations, the acquisition module 10 is configured to:
对于每个采样时刻,基于所述第二传感器采集得到所述采样时刻的第二运动数据;For each sampling moment, obtain the second motion data of the sampling moment based on the second sensor collection;
根据所述第二运动数据确定所述移动设备在所述采样时刻的第二位姿数据;Determine the second pose data of the mobile device at the sampling moment according to the second motion data;
根据当前时刻的第二位姿数据和当前时刻之前预设数量采样时刻的第二位姿数据,得到所述第二位姿集合。The second pose set is obtained based on the second pose data at the current time and the second pose data at a preset number of sampling times before the current time.
在一些实施方式中,所述变化率确定模块20被配置为:In some embodiments, the change rate determination module 20 is configured to:
基于所述第一位姿集合包括的各个第一位姿数据进行边界数值处理,得到在数值上连续的第一目标集;基于所述第二位姿集合包括的各个第二位姿数据进行边界数据处理,得到在数值上连续的第二目标集;Perform boundary numerical processing based on each first pose data included in the first pose set to obtain a numerically continuous first target set; perform boundary processing based on each second pose data included in the second pose set Data processing to obtain a numerically continuous second target set;
根据所述第一目标集包括的各个元素进行线性回归,得到所述第一目标集对应的第一直线的第一斜率;根据所述第二目标集包括的各个元素进行线性回归,得到所述第一目标集对应的第二直线的第二斜率;Perform linear regression based on each element included in the first target set to obtain the first slope of the first straight line corresponding to the first target set; perform linear regression based on each element included in the second target set to obtain the the second slope of the second straight line corresponding to the first target set;
将所述第一斜率确定为所述第一位姿变化率,将所述第二斜率确定为所述第二位姿变化率。The first slope is determined as the first posture change rate, and the second slope is determined as the second posture change rate.
在一些实施方式中,所述变化率确定模块20被配置为:In some embodiments, the change rate determination module 20 is configured to:
响应于所述位姿集合中各个元素同时包括正值和负值,计算得到所有元素绝对值的平均值;In response to each element in the pose set including both positive and negative values, calculate an average of the absolute values of all elements;
根据所述平均值与第一边界的第一差值绝对值,以及所述平均值与所述第二边界的第二差值绝对值的大小关系,确定所述位姿集合对应的目标边界;Determine the target boundary corresponding to the pose set according to the relationship between the first absolute value of the difference between the average value and the first boundary, and the magnitude relationship between the second absolute value of the difference between the average value and the second boundary;
响应于所述目标边界为第一边界和第二边界中的预设边界,对所述位姿集合中的各个元素进行数值转换,得到在数值上连续的目标集。In response to the target boundary being the preset boundary among the first boundary and the second boundary, numerical conversion is performed on each element in the pose set to obtain a numerically continuous target set.
在一些实施方式中,所述变化率确定模块20被配置为:In some embodiments, the change rate determination module 20 is configured to:
响应于所述目标边界为第一边界和第二边界中的预设边界,确定所述位姿集合中正值的第一数量和负值的第二数量;In response to the target boundary being a preset boundary among the first boundary and the second boundary, determining a first number of positive values and a second number of negative values in the pose set;
响应于所述第一数量大于所述第二数量,将所有负值的元素数值增加 预设数值,得到所述目标集;In response to the first quantity being greater than the second quantity, all negative element values are increased by a preset value to obtain the target set;
响应于所述第一数量不大于所述第二数量,将所述正值的元素数值减少预设数值,得到所述目标集。In response to the first quantity not being greater than the second quantity, the element value of the positive value is reduced by a preset value to obtain the target set.
在一些实施方式中,所述权值确定模块30被配置为:In some implementations, the weight determination module 30 is configured as:
响应于所述第一位姿变化率与所述第二位姿变化率的差异大于预设阈值,对当前时刻之前若干采样时刻的第一位姿数据的方差进行卡尔曼滤波处理,得到当前时刻的第一位姿权值。In response to the difference between the first attitude change rate and the second attitude change rate being greater than the preset threshold, Kalman filtering is performed on the variance of the first attitude data at several sampling moments before the current moment to obtain the current moment. The first position weight.
在一些实施方式中,所述第二传感器包括磁力计;所述权值确定模块30被配置为:In some embodiments, the second sensor includes a magnetometer; the weight determination module 30 is configured to:
利用所述磁力计采集得到当前时刻的第二位姿数据;Using the magnetometer to collect the second pose data at the current moment;
根据当前时刻的第二位姿数据计算得到地磁模长;The geomagnetic mode length is calculated based on the second pose data at the current moment;
根据所述地磁模长确定所述第二位姿权值。The second pose weight is determined according to the geomagnetic mode length.
在一些实施方式中,所述数据融合模块40被配置为:In some embodiments, the data fusion module 40 is configured to:
根据所述第一位姿权值和所述第二位姿权值,对当前时刻的第一位姿数据和第二位姿数据进行卡尔曼滤波处理,得到所述移动设备当前时刻的目标位姿。According to the first posture weight and the second posture weight, Kalman filtering is performed on the first posture data and the second posture data at the current moment to obtain the target position of the mobile device at the current moment. posture.
在一些实施方式中,所述第一传感器包括陀螺仪,所述第二传感器包括磁力计。In some embodiments, the first sensor includes a gyroscope and the second sensor includes a magnetometer.
通过上述可知,本公开实施方式中,通过对第一传感器和第二传感器当前一段时间内的采样数据变化趋势进行对比,确定两者当前时刻的可靠程度,并基于可靠程度动态调整两者的位姿权值,从而可以有效消除或者缓解信号干扰导致的数据失真的缺陷,提高数据融合后得到的目标位姿的准确性。As can be seen from the above, in the embodiment of the present disclosure, the reliability of the first sensor and the second sensor at the current moment is determined by comparing the changing trends of the sampling data of the first sensor and the second sensor, and the positions of the two are dynamically adjusted based on the reliability. pose weights, which can effectively eliminate or alleviate the defects of data distortion caused by signal interference, and improve the accuracy of the target pose obtained after data fusion.
在一些实施方式中,本公开提供了一种移动设备,包括:In some embodiments, the present disclosure provides a mobile device including:
第一传感器和第二传感器;a first sensor and a second sensor;
处理器;以及processor; and
存储器,存储有计算机指令,所述计算机指令用于使所述处理器执行根据第一方面任意实施方式所述的方法。A memory stores computer instructions for causing the processor to execute the method according to any implementation manner of the first aspect.
本公开实施方式的移动设备,可参照前述图1所示的移动设备600结构和原理,本公开对此不再赘述。For the mobile device in the embodiment of the present disclosure, reference can be made to the structure and principle of the mobile device 600 shown in FIG. 1 , which will not be described again in the present disclosure.
第四方面,本公开实施方式提供了一种存储介质,存储有计算机指令, 所述计算机指令用于使计算机执行根据第一方面任意实施方式所述的方法。In a fourth aspect, an embodiment of the present disclosure provides a storage medium that stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any embodiment of the first aspect.
通过上述可知,本公开实施方式中,通过对第一传感器和第二传感器当前一段时间内的采样数据变化趋势进行对比,确定两者当前时刻的可靠程度,并基于可靠程度动态调整两者的位姿权值,从而可以有效消除或者缓解信号干扰导致的数据失真的缺陷,提高数据融合后得到的目标位姿的准确性。As can be seen from the above, in the embodiment of the present disclosure, the reliability of the first sensor and the second sensor at the current moment is determined by comparing the changing trends of the sampling data of the first sensor and the second sensor, and the positions of the two are dynamically adjusted based on the reliability. pose weights, which can effectively eliminate or alleviate the defects of data distortion caused by signal interference, and improve the accuracy of the target pose obtained after data fusion.
显然,上述实施方式仅仅是为清楚地说明所作的举例,而并非对实施方式的限定。对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动。这里无需也无法对所有的实施方式予以穷举。而由此所引伸出的显而易见的变化或变动仍处于本公开创造的保护范围之中。Obviously, the above-mentioned embodiments are only examples for clear explanation and are not limitations of the embodiments. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. An exhaustive list of all implementations is neither necessary nor possible. The obvious changes or modifications derived therefrom are still within the protection scope of the present invention.

Claims (13)

  1. 一种位姿估计方法,其特征在于,应用于移动设备,所述方法包括:A pose estimation method, characterized in that it is applied to mobile devices, and the method includes:
    通过所述移动设备的第一传感器得到所述移动设备在当前时刻的第一位姿集合,通过所述移动设备的第二传感器得到所述移动设备在当前时刻的第二位姿集合;其中,所述第一位姿集合和所述第二位姿集合包括在当前时刻以及之前若干采样时刻的位姿数据;The first pose set of the mobile device at the current moment is obtained through the first sensor of the mobile device, and the second pose set of the mobile device at the current moment is obtained through the second sensor of the mobile device; wherein, The first pose set and the second pose set include pose data at the current moment and several previous sampling moments;
    根据所述第一位姿集合确定所述移动设备的第一位姿变化率,根据所述第二位姿集合确定所述移动设备的第二位姿变化率;Determine a first posture change rate of the mobile device based on the first posture set, and determine a second posture change rate of the mobile device based on the second posture set;
    根据所述第一位姿变化率和所述第二位姿变化率的差异,确定所述移动设备在当前时刻的第一位姿权值和第二位姿权值;Determine the first posture weight and the second posture weight of the mobile device at the current moment based on the difference between the first posture change rate and the second posture change rate;
    根据所述第一位姿权值和所述第二位姿权值,对当前时刻的第一位姿数据和第二位姿数据进行融合处理,得到所述移动设备当前时刻的目标位姿。According to the first posture weight and the second posture weight, the first posture data and the second posture data at the current moment are fused to obtain the target posture of the mobile device at the current moment.
  2. 根据权利要求1所述的方法,其特征在于,所述通过所述移动设备的第一传感器得到所述移动设备在当前时刻的第一位姿集合,包括:The method of claim 1, wherein obtaining the first attitude set of the mobile device at the current moment through the first sensor of the mobile device includes:
    对于每个采样时刻,基于所述第一传感器采集得到所述采样时刻的第一运动数据;For each sampling moment, obtain the first motion data at the sampling moment based on the first sensor collection;
    根据所述采样时刻的第一运动数据、前一采样时刻的第一运动数据以及采样周期,确定所述移动设备的第一位姿变化数据;Determine the first attitude change data of the mobile device according to the first motion data at the sampling time, the first motion data at the previous sampling time, and the sampling period;
    根据前一采样时刻的第一位姿数据和所述第一位姿变化数据,确定所述移动设备在所述采样时刻的第一位姿数据;Determine the first attitude data of the mobile device at the sampling moment based on the first attitude data of the previous sampling moment and the first attitude change data;
    根据当前时刻的第一位姿数据和当前时刻之前预设数量采样时刻的第一位姿数据,得到所述第一位姿集合。The first attitude set is obtained based on the first attitude data at the current time and the first attitude data at a preset number of sampling times before the current time.
  3. 根据权利要求1所述的方法,其特征在于,所述通过所述移动设备的第二传感器得到所述移动设备在当前时刻的第二位姿集合,包括:The method according to claim 1, wherein obtaining the second pose set of the mobile device at the current moment through the second sensor of the mobile device includes:
    对于每个采样时刻,基于所述第二传感器采集得到所述采样时刻的第二运动数据;For each sampling moment, obtain the second motion data of the sampling moment based on the second sensor collection;
    根据所述第二运动数据确定所述移动设备在所述采样时刻的第二位姿 数据;Determine the second pose data of the mobile device at the sampling moment according to the second motion data;
    根据当前时刻的第二位姿数据和当前时刻之前预设数量采样时刻的第二位姿数据,得到所述第二位姿集合。The second pose set is obtained based on the second pose data at the current time and the second pose data at a preset number of sampling times before the current time.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述根据所述第一位姿集合确定所述移动设备的第一位姿变化率,根据所述第二位姿集合确定所述移动设备的第二位姿变化率,包括:The method according to any one of claims 1 to 3, characterized in that the first attitude change rate of the mobile device is determined according to the first attitude set, and the first attitude change rate is determined according to the second attitude set. The second pose change rate of the mobile device includes:
    基于所述第一位姿集合包括的各个第一位姿数据进行边界数值处理,得到在数值上连续的第一目标集;基于所述第二位姿集合包括的各个第二位姿数据进行边界数据处理,得到在数值上连续的第二目标集;Perform boundary numerical processing based on each first pose data included in the first pose set to obtain a numerically continuous first target set; perform boundary processing based on each second pose data included in the second pose set Data processing to obtain a numerically continuous second target set;
    根据所述第一目标集包括的各个元素进行线性回归,得到所述第一目标集对应的第一直线的第一斜率;根据所述第二目标集包括的各个元素进行线性回归,得到所述第一目标集对应的第二直线的第二斜率;Perform linear regression based on each element included in the first target set to obtain the first slope of the first straight line corresponding to the first target set; perform linear regression based on each element included in the second target set to obtain the the second slope of the second straight line corresponding to the first target set;
    将所述第一斜率确定为所述第一位姿变化率,将所述第二斜率确定为所述第二位姿变化率。The first slope is determined as the first posture change rate, and the second slope is determined as the second posture change rate.
  5. 根据权利要求4所述的方法,其特征在于,对所述第一位姿集合和所述第二位姿集合中的任意一个位姿集合进行所述边界数值处理的过程包括:The method according to claim 4, characterized in that the process of performing the boundary numerical processing on any one of the first pose set and the second pose set includes:
    响应于所述位姿集合中各个元素同时包括正值和负值,计算得到所有元素绝对值的平均值;In response to each element in the pose set including both positive and negative values, calculate an average of the absolute values of all elements;
    根据所述平均值与第一边界的第一差值绝对值,以及所述平均值与所述第二边界的第二差值绝对值的大小关系,确定所述位姿集合对应的目标边界;Determine the target boundary corresponding to the pose set according to the relationship between the first absolute value of the difference between the average value and the first boundary, and the magnitude relationship between the second absolute value of the difference between the average value and the second boundary;
    响应于所述目标边界为第一边界和第二边界中的预设边界,对所述位姿集合中的各个元素进行数值转换,得到在数值上连续的目标集。In response to the target boundary being the preset boundary among the first boundary and the second boundary, numerical conversion is performed on each element in the pose set to obtain a numerically continuous target set.
  6. 根据权利要求5所述的方法,其特征在于,所述响应于所述目标边界为第一边界和第二边界中的预设边界,对所述位姿集合中的各个元素进行数值转换,得到在数值上连续的目标集,包括:The method according to claim 5, characterized in that, in response to the target boundary being a preset boundary among the first boundary and the second boundary, numerical conversion is performed on each element in the pose set to obtain A numerically continuous set of targets, including:
    响应于所述目标边界为第一边界和第二边界中的预设边界,确定所述位姿集合中正值的第一数量和负值的第二数量;In response to the target boundary being a preset boundary among the first boundary and the second boundary, determining a first number of positive values and a second number of negative values in the pose set;
    响应于所述第一数量大于所述第二数量,将所有负值的元素数值增加预设数值,得到所述目标集;In response to the first quantity being greater than the second quantity, increasing all negative element values by a preset value to obtain the target set;
    响应于所述第一数量不大于所述第二数量,将所述正值的元素数值减少预设数值,得到所述目标集。In response to the first quantity not being greater than the second quantity, the element value of the positive value is reduced by a preset value to obtain the target set.
  7. 根据权利要求1所述的方法,其特征在于,根据所述第一位姿变化率和所述第二位姿变化率的差异,确定所述移动设备在当前时刻的第一位姿权值,包括:The method of claim 1, wherein the first posture weight of the mobile device at the current moment is determined based on the difference between the first posture change rate and the second posture change rate, include:
    响应于所述第一位姿变化率与所述第二位姿变化率的差异大于预设阈值,对当前时刻之前若干采样时刻的第一位姿数据的方差进行卡尔曼滤波处理,得到当前时刻的第一位姿权值。In response to the difference between the first attitude change rate and the second attitude change rate being greater than the preset threshold, Kalman filtering is performed on the variance of the first attitude data at several sampling moments before the current moment to obtain the current moment. The first position weight.
  8. 根据权利要求1或7所述的方法,其特征在于,所述第二传感器包括磁力计;确定所述移动设备在当前时刻的第二位姿权值,包括:The method according to claim 1 or 7, wherein the second sensor includes a magnetometer; determining the second pose weight of the mobile device at the current moment includes:
    利用所述磁力计采集得到当前时刻的第二位姿数据;Using the magnetometer to collect the second pose data at the current moment;
    根据当前时刻的第二位姿数据计算得到地磁模长;The geomagnetic mode length is calculated based on the second pose data at the current moment;
    根据所述地磁模长确定所述第二位姿权值。The second pose weight is determined according to the geomagnetic mode length.
  9. 根据权利要求1所述的方法,其特征在于,所述根据所述第一位姿权值和所述第二位姿权值,对当前时刻的第一位姿数据和第二位姿数据进行融合处理,得到所述移动设备当前时刻的目标位姿,包括:The method according to claim 1, characterized in that, based on the first posture weight and the second posture weight, the first posture data and the second posture data at the current moment are processed. Fusion processing to obtain the target pose of the mobile device at the current moment, including:
    根据所述第一位姿权值和所述第二位姿权值,对当前时刻的第一位姿数据和第二位姿数据进行卡尔曼滤波处理,得到所述移动设备当前时刻的目标位姿。According to the first posture weight and the second posture weight, Kalman filtering is performed on the first posture data and the second posture data at the current moment to obtain the target position of the mobile device at the current moment. posture.
  10. 根据权利要求1所述的方法,其特征在于,The method according to claim 1, characterized in that:
    所述第一传感器包括陀螺仪,所述第二传感器包括磁力计。The first sensor includes a gyroscope and the second sensor includes a magnetometer.
  11. 一种位姿估计装置,其特征在于,应用于移动设备,所述装置包括:A pose estimation device, characterized in that it is applied to mobile equipment, and the device includes:
    获取模块,被配置为通过所述移动设备的第一传感器得到所述移动设备在当前时刻的第一位姿集合,通过所述移动设备的第二传感器得到所述移动设备在当前时刻的第二位姿集合;其中,所述第一位姿集合和所述第二位姿集合包括在当前时刻以及之前若干采样时刻的位姿数据;The acquisition module is configured to obtain the first attitude set of the mobile device at the current moment through the first sensor of the mobile device, and obtain the second attitude set of the mobile device at the current moment through the second sensor of the mobile device. A pose set; wherein the first pose set and the second pose set include pose data at the current moment and several previous sampling moments;
    变化率确定模块,被配置为根据所述第一位姿集合确定所述移动设备的第一位姿变化率,根据所述第二位姿集合确定所述移动设备的第二位姿变化率;a change rate determination module configured to determine a first posture change rate of the mobile device according to the first posture set, and determine a second posture change rate of the mobile device according to the second posture set;
    权值确定模块,被配置为根据所述第一位姿变化率和所述第二位姿变化率的差异,确定所述移动设备在当前时刻的第一位姿权值和第二位姿权值;A weight determination module configured to determine the first posture weight and the second posture weight of the mobile device at the current moment based on the difference between the first posture change rate and the second posture change rate. value;
    数据融合模块,被配置为根据所述第一位姿权值和所述第二位姿权值,对当前时刻的第一位姿数据和第二位姿数据进行融合处理,得到所述移动设备当前时刻的目标位姿。The data fusion module is configured to perform fusion processing on the first posture data and the second posture data at the current moment according to the first posture weight value and the second posture weight value to obtain the mobile device. The target pose at the current moment.
  12. 一种移动设备,其特征在于,包括:A mobile device, characterized by including:
    第一传感器和第二传感器;a first sensor and a second sensor;
    处理器;以及processor; and
    存储器,存储有计算机指令,所述计算机指令用于使所述处理器执行根据权利要求1至10任一项所述的方法。A memory storing computer instructions for causing the processor to execute the method according to any one of claims 1 to 10.
  13. 一种存储介质,其特征在于,存储有计算机指令,所述计算机指令用于使计算机执行根据权利要求1至10任一项所述的方法。A storage medium, characterized in that computer instructions are stored, and the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 10.
PCT/CN2022/093607 2022-05-18 2022-05-18 Mobile device, pose estimation method and apparatus therefor, and storage medium WO2023220972A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/093607 WO2023220972A1 (en) 2022-05-18 2022-05-18 Mobile device, pose estimation method and apparatus therefor, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/093607 WO2023220972A1 (en) 2022-05-18 2022-05-18 Mobile device, pose estimation method and apparatus therefor, and storage medium

Publications (1)

Publication Number Publication Date
WO2023220972A1 true WO2023220972A1 (en) 2023-11-23

Family

ID=88834168

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/093607 WO2023220972A1 (en) 2022-05-18 2022-05-18 Mobile device, pose estimation method and apparatus therefor, and storage medium

Country Status (1)

Country Link
WO (1) WO2023220972A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106153042A (en) * 2015-03-31 2016-11-23 日本电气株式会社 Course angle acquisition methods and device
CN109001787A (en) * 2018-05-25 2018-12-14 北京大学深圳研究生院 A kind of method and its merge sensor of solving of attitude and positioning
CN109108936A (en) * 2018-10-24 2019-01-01 电子科技大学 A kind of the self-balance robot control system and control method of Multiple Source Sensor data fusion
CN109218709A (en) * 2018-10-18 2019-01-15 北京小米移动软件有限公司 The method of adjustment and device and computer readable storage medium of holographic content
CN110530356A (en) * 2019-09-04 2019-12-03 青岛海信电器股份有限公司 Processing method, device, equipment and the storage medium of posture information
WO2021233309A1 (en) * 2020-05-21 2021-11-25 杭州海康威视数字技术股份有限公司 Extrinsic parameter change detection method and apparatus, electronic device, and detection system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106153042A (en) * 2015-03-31 2016-11-23 日本电气株式会社 Course angle acquisition methods and device
CN109001787A (en) * 2018-05-25 2018-12-14 北京大学深圳研究生院 A kind of method and its merge sensor of solving of attitude and positioning
CN109218709A (en) * 2018-10-18 2019-01-15 北京小米移动软件有限公司 The method of adjustment and device and computer readable storage medium of holographic content
CN109108936A (en) * 2018-10-24 2019-01-01 电子科技大学 A kind of the self-balance robot control system and control method of Multiple Source Sensor data fusion
CN110530356A (en) * 2019-09-04 2019-12-03 青岛海信电器股份有限公司 Processing method, device, equipment and the storage medium of posture information
WO2021233309A1 (en) * 2020-05-21 2021-11-25 杭州海康威视数字技术股份有限公司 Extrinsic parameter change detection method and apparatus, electronic device, and detection system

Similar Documents

Publication Publication Date Title
CN112051590B (en) Detection method and related device for laser radar and inertial measurement unit
JP5854655B2 (en) A method for evaluating the horizontal speed of drones, especially drones capable of hovering flight under autopilot
EP4290878A2 (en) Techniques for co-optimization of motion and sensory control
WO2019071916A1 (en) Antenna beam attitude control method and system
CN109000612A (en) Angle evaluation method, device, camera assembly and the aircraft of equipment
US11669109B2 (en) Method and apparatus for yaw fusion and aircraft
WO2018214978A1 (en) Positioning device and method and automatically moving apparatus
US9677888B2 (en) Determining sensor orientation in indoor navigation
JP2022510418A (en) Time synchronization processing method, electronic devices and storage media
WO2021027638A1 (en) Yaw angle fusion method and apparatus, and aerial vehicle
WO2022170847A1 (en) Online calibration method based on laser and visual fusion
JP2012173190A (en) Positioning system and positioning method
CN110969643B (en) On-board autonomous prediction method for ground target movement track
Nguyen et al. Flexible and resource-efficient multi-robot collaborative visual-inertial-range localization
CN110824453A (en) Unmanned aerial vehicle target motion estimation method based on image tracking and laser ranging
WO2023220972A1 (en) Mobile device, pose estimation method and apparatus therefor, and storage medium
KR20110081701A (en) Calibration apparatus for gyro sensor
WO2023142353A1 (en) Pose prediction method and apparatus
Li et al. Onboard hover control of a quadrotor using template matching and optic flow
WO2022016322A1 (en) Gimbal, gimbal performance evaluation method and device, and mobile platform
Hou et al. Robust optimization-based fusion of GNSS and Visual-Inertial-Wheel Odometry
CN111811500A (en) Target object pose estimation method and device, storage medium and electronic equipment
WO2023162017A1 (en) Position and posture estimation device, position and posture estimation system, and sensor installation method
CN115388914B (en) Parameter calibration method and device for sensor, storage medium and electronic device
Conroy et al. Continuous Time Rate Gyro Calibration and Monocular Camera Misalignment Estimation using a Nonlinear Observer

Legal Events

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

Ref document number: 22942014

Country of ref document: EP

Kind code of ref document: A1