Speed ​​fusion method, device and computer equipment based on optical flow and accelerometer

Through the velocity fusion method of optical flow and accelerometer, combining instantaneous and cumulative errors, the accelerometer speed is adjusted, which solves the deviation problem in the speed acquisition of cleaning robots and improves the accuracy and stability of speed acquisition.

CN114545017BActive Publication Date: 2024-11-22SHENZHEN UMOUSE TECH DEV
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202210114964.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-31
Publication Date
2024-11-22
Estimated Expiration
2042-01-31

AI Technical Summary

Technical Problem

During the operation of the cleaning robot, counting deviations are prone to occur when calculating the speed through an accelerometer, and there are errors caused by uneven image scenes, resulting in inaccurate speed acquisition.

Method used

The velocity fusion method based on optical flow and accelerometer is adopted to continuously detect the speed, calculate the instantaneous error and cumulative error, adjust the accelerometer speed to reduce deviation, and eliminate errors using integral and weight adjustment algorithms to improve the accuracy of velocity acquisition.

Benefits of technology

By combining optical flow and accelerometer data, the accelerometer speed is adjusted in real time, reducing the impact of error accumulation and image scene unevenness, and improving the accuracy and stability of the speed acquisition of cleaning robots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114545017B_ABST
    Figure CN114545017B_ABST
Patent Text Reader

Abstract

The present invention discloses a speed fusion method based on optical flow and accelerometer, which includes: during the operation of the cleaning robot, continuously detecting the speed of the cleaning robot through an accelerometer and optical flow, and obtaining the accelerometer speed through the accelerometer, and obtaining the optical flow speed through the optical flow; determining the instantaneous error according to the accelerometer speed and the optical flow speed that correspond to each other in time; obtaining the cumulative error between the accelerometer speed and the optical flow speed within a set time period; determining the offset speed according to the cumulative error and the instantaneous error, the offset speed being the speed difference between the accelerometer speed and the target speed of the cleaning robot since the cumulative error began to accumulate; adjusting the accelerometer speed according to the offset speed. This scheme eliminates the data fluctuation of the instantaneous error of the optical flow data, and determines the difference between the accelerometer speed and the target speed by calculating the offset speed, so as to reduce the influence caused by the above data fluctuation and more accurately adjust the value of the accelerometer speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of speed fusion technology, and in particular to a speed fusion method, device and computer equipment based on optical flow and accelerometer. Background Art

[0002] The cleaning robot needs to record its own speed information during operation to achieve control of movement during navigation. In existing solutions, the cleaning robot usually calculates the speed and distance of travel through an accelerometer. Under the influence of environmental factors, the accelerometer will have counting deviations, and the above deviations will accumulate over time. Therefore, the speed value generated by the accelerometer needs to be corrected to ensure that the speed information of the cleaning robot can be correctly reflected; optical flow is another form of obtaining the speed of the cleaning robot. By obtaining continuous images in one direction, observing the speed at which objects in the image move between pixels, and converting the number of pixels moved per unit time into the distance moved to obtain the actual running speed of the measured object, the working scene of the cleaning robot is complex. During long-distance operation, the captured image cannot be guaranteed to always be on the same plane, and it is impossible to ensure that the pixels and distances can be completely accurately corresponded, resulting in deviations in the acquisition of the cleaning robot's running speed. Summary of the invention

[0003] The purpose of the embodiments of the present application is to propose a method that can perform data fusion during the operation of a cleaning robot, so as to improve the accuracy of speed acquisition during the operation of the cleaning robot.

[0004] In order to solve the above technical problems, the embodiment of the present application provides a velocity fusion method based on optical flow and accelerometer, which adopts the following technical solution:

[0005] A velocity fusion method based on optical flow and accelerometer, the method includes:

[0006] During the operation of the cleaning robot, the speed of the cleaning robot is continuously detected by the accelerometer and the optical flow, and the accelerometer speed is obtained by the accelerometer, and the optical flow speed is obtained by the optical flow;

[0007] determining an instantaneous error based on the accelerometer velocity and the optical flow velocity corresponding to each other in time;

[0008] Obtain the cumulative error between the accelerometer velocity and the optical flow velocity within a set time period;

[0009] determining a deviation speed according to the accumulated error and the instantaneous error, the deviation speed being a speed difference between an accelerometer speed generated by the cleaning robot within the set time period and a target speed of the cleaning robot;

[0010] The accelerometer velocity is adjusted based on the offset velocity.

[0011] Furthermore, the step obtains the cumulative error between the accelerometer velocity and the optical flow velocity within a set time period, specifically by integrating the instantaneous error within the set time period.

[0012] Further, in the process of integrating the instantaneous error, after eliminating the steady-state error caused by the instantaneous error in the integration process by the first coefficient, the accumulated error is accumulated, specifically based on the following formula:

[0013] Vel_S+=ki*Vel_E*time

[0014] Where Vel_S is the cumulative error within the set time period, ki is the first coefficient, Vel_E is the instantaneous error, and time is the set time period.

[0015] Furthermore, the step of determining the offset speed according to the accumulated error and the instantaneous error specifically includes:

[0016] The instantaneous error is adjusted by a second coefficient to adjust the response speed of the offset speed to the instantaneous error;

[0017] superimposing the accumulated error on the instantaneous error of the adjusted weight to obtain the error change rate of the accelerometer speed within a set time;

[0018] Calculate the offset speed according to the error change rate and a set time period;

[0019] The adjusting the accelerometer speed according to the offset speed is specifically based on the following formula:

[0020] acc_V+=(kp*Vel_E+Vel_S)*time

[0021] Where acc_V is the accelerometer velocity, kp is the second coefficient, Vel_E is the instantaneous error, Vel_S is the cumulative error within the set time period, and time is the set time period.

[0022] Furthermore, the method for acquiring the accelerometer velocity specifically includes:

[0023] Continuously acquiring the pressure loaded on the accelerometer, wherein the pressure is a vector;

[0024] Projecting the pressure in the coordinate system where the cleaning robot is located, and projecting it in the forward direction of the cleaning robot in the coordinate system;

[0025] The projected pressure is integrated to obtain the accelerometer velocity, which is an instantaneous scalar.

[0026] Furthermore, the method for obtaining the optical flow velocity specifically includes:

[0027] Continuously acquiring image data, and determining the moving distance of the cleaning robot per unit time according to the continuously acquired image data;

[0028] The moving distance is differentiated to obtain the optical flow speed, which is the average speed of the cleaning robot per unit time.

[0029] In order to solve the above technical problems, the embodiment of the present application further provides a velocity fusion device based on optical flow and accelerometer, which adopts the following technical solution:

[0030] A speed fusion device based on optical flow and accelerometer, the device comprising:

[0031] The instantaneous speed acquisition module is used to continuously detect the speed of the cleaning robot through the accelerometer and the optical flow during the operation of the cleaning robot, and to obtain the accelerometer speed and the optical flow speed through the accelerometer;

[0032] An instantaneous error acquisition module, used to determine an instantaneous error according to the accelerometer velocity and the optical flow velocity corresponding to each other in time;

[0033] The cumulative error acquisition module is used to obtain the cumulative error between the accelerometer velocity and the optical flow velocity within a set time period;

[0034] an offset speed acquisition module, configured to determine an offset speed according to the accumulated error and the instantaneous error, wherein the offset speed is a speed difference between an accelerometer speed generated by the cleaning robot within the set time period and a target speed of the cleaning robot;

[0035] An accelerometer adjustment module is used to adjust the accelerometer speed according to the offset speed.

[0036] Furthermore, the offset speed acquisition module specifically includes:

[0037] An instantaneous error adjustment submodule, used to adjust the instantaneous error by a second coefficient, so as to adjust the response speed of the offset speed to the instantaneous error;

[0038] A change rate determination submodule, used for superimposing the accumulated error on the instantaneous error of the adjusted weight to obtain the error change rate of the accelerometer speed within a set time;

[0039] A migration speed calculation submodule, used to calculate the migration speed according to the error change rate and a set time period;

[0040] The adjusting the accelerometer speed according to the offset speed is specifically based on the following formula:

[0041] acc_V+=(kp*Vel_E+Vel_S)*time

[0042] Where acc_V is the accelerometer velocity, kp is the second coefficient, Vel_E is the instantaneous error, Vel_S is the cumulative error within the set time period, and time is the set time period.

[0043] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0044] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the speed fusion method based on optical flow and accelerometer are implemented as described above.

[0045] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0046] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the velocity fusion method based on optical flow and accelerometer are implemented as described above.

[0047] Compared with the prior art, the present invention mainly has the following beneficial effects: by continuously acquiring the accelerometer velocity and the optical flow velocity, the instantaneous error between the two is calculated.

[0048] The accumulated error between the accelerometer velocity and the optical flow velocity over a period of time is also calculated.

[0049] Then, the instantaneous error and the accumulated error are combined to determine the time point corresponding to the instantaneous error and the offset speed of the accelerometer relative to the target speed, and the accelerometer is offset according to the offset speed to adjust the value of the accelerometer.

[0050] This solution uses the speed information obtained by the accelerometer as the basic value, combined with the speed information generated by the optical flow data, to determine the instantaneous error and cumulative error generated in real time between the optical flow data and the acceleration data, and combines the cumulative error with the instantaneous error to calculate the offset speed between the speed obtained by the accelerometer of the cleaning robot within a period of time and the target speed of the cleaning robot, and adjusts the speed information obtained by the accelerometer. On the premise of eliminating the error caused by the accumulation of the accelerometer, the influence of the data fluctuation of the instantaneous error of the optical flow data caused by the uneven image scene on the offset speed is also eliminated, and the calculated offset speed is used as the basis for the accelerometer speed offset to reduce the influence of the above data fluctuations and more accurately adjust the value of the accelerometer speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0052] Figure 1 A flowchart of an embodiment of a velocity fusion method based on optical flow and accelerometer according to the present application;

[0053] Figure 2 yes Figure 1 A flowchart of a specific implementation of step S400;

[0054] Figure 3 yes Figure 1 A flowchart of a specific implementation method of obtaining the accelerometer velocity in step S100;

[0055] Figure 4 yes Figure 1 A flowchart of a specific implementation method of obtaining the optical flow velocity in step S100;

[0056] Figure 5 is a structural schematic diagram of an embodiment of a velocity fusion method and device based on optical flow and accelerometer according to the present application;

[0057] Figure 6 yes Figure 5 The structure diagram of a specific implementation of the module 400 is shown;

[0058] Figure 7 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0060] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0061] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0062] Continue to refer Figure 1 , shows a flowchart of an embodiment of a velocity fusion method based on optical flow and accelerometer according to the present application.

[0063] A velocity fusion method based on optical flow and accelerometer, the method includes:

[0064] Step S100: During the operation of the cleaning robot, the speed of the cleaning robot is continuously detected by an accelerometer and an optical flow, and the accelerometer speed is obtained by the accelerometer, and the optical flow speed is obtained by the optical flow;

[0065] Step S200: determining an instantaneous error according to the accelerometer velocity and the optical flow velocity corresponding to each other in time;

[0066] Step S300: obtaining the cumulative error between the accelerometer velocity and the optical flow velocity within a set time period;

[0067] Step S400: determining a deviation speed according to the accumulated error and the instantaneous error, wherein the deviation speed is a speed difference between an accelerometer speed generated by the cleaning robot within the set time period and a target speed of the cleaning robot;

[0068] Step S500: adjusting the accelerometer speed according to the offset speed.

[0069] Specifically, the instantaneous error between the accelerometer velocity and the optical flow velocity is calculated by continuously acquiring the two.

[0070] The accumulated error between the accelerometer velocity and the optical flow velocity over a period of time is also calculated.

[0071] Then, the instantaneous error and the accumulated error are combined to determine the time point corresponding to the instantaneous error and the offset speed of the accelerometer relative to the target speed, and the accelerometer is offset according to the offset speed to adjust the value of the accelerometer.

[0072] The continuously acquired accelerometer speed and optical flow speed reflect the instantaneous speed at the time of acquisition. The speed information acquired by the accelerometer is continuous, and the cumulative error is accumulated continuously. The speed information acquired by the accelerometer, namely the accelerometer speed, is selected to reflect the running speed of the cleaning robot. Errors will occur over time. The accelerometer speed should be used as the basic value and adjusted to accurately reflect the running speed of the cleaning robot. The way to acquire the optical flow speed by optical flow is to capture continuous images, in which the time interval between image frames is determined, and the pixel interval between pixels in the image corresponds to the physical distance. Therefore, according to the time interval between frames and the pixel interval between pixels in the acquired image, the distance moved by the cleaning robot within a period of time can be determined, so as to obtain the average speed of the cleaning robot during this period of time as the instantaneous speed corresponding to the detection time point. The optical flow speed is acquired by optical flow, which is only affected by the period between image frames, and will not produce speed accumulation. Correcting the accelerometer speed by optical flow data can eliminate the influence of accumulation on the accelerometer speed.

[0073] The optical flow velocity obtained by optical flow may fluctuate because the height of objects in the image may change, resulting in inaccurate instantaneous error. Determining the offset speed by combining the instantaneous error and the accumulated error can improve the accuracy of the offset speed.

[0074] The accelerometer velocity is obtained by obtaining the raw data of the accelerometer, performing a second-order low-pass filter on the raw data of the accelerometer, and converting it into an acceleration value. The acceleration value in the heading coordinate system is then projected into the world coordinate system, and then integrated to obtain the velocity for calculation with the optical flow velocity.

[0075] The method for obtaining the optical flow speed is specifically to obtain the original optical flow data, filter the original optical flow data to obtain the optical flow information, decouple the optical flow information to reduce the fluctuation caused by vibration and shaking during the optical flow data acquisition process, and then organize the optical flow data within a period of time into the travel distance of the cleaning robot within the above-mentioned time, and then differentiate the travel distance to obtain the optical flow speed of the cleaning robot within the above-mentioned period of time.

[0076] The accelerometer speed is adjusted according to the offset speed so that the accelerometer speed reaches the target speed. In this solution, the target speed is close to the actual operating speed of the cleaning robot. Adjusting the accelerometer speed to the target speed can ensure that the accelerometer speed reflects the actual operating speed of the cleaning robot as accurately as possible.

[0077] This solution uses the speed information obtained by the accelerometer as the basic value, combined with the speed information generated by the optical flow data, to determine the instantaneous error and cumulative error generated in real time between the optical flow data and the acceleration data, and combines the cumulative error with the instantaneous error to calculate the offset speed between the speed obtained by the accelerometer of the cleaning robot within a period of time and the target speed of the cleaning robot, and adjusts the speed information obtained by the accelerometer. On the premise of eliminating the error caused by the accumulation of the accelerometer, the influence of the data fluctuation of the instantaneous error of the optical flow data caused by the uneven image scene on the offset speed is also eliminated, and the calculated offset speed is used as the basis for the accelerometer speed offset to reduce the influence of the above data fluctuations and more accurately adjust the value of the accelerometer speed.

[0078] Furthermore, the step obtains the cumulative error between the accelerometer velocity and the optical flow velocity within a set time period, specifically by integrating the instantaneous error within the set time period.

[0079] Further, in the process of integrating the instantaneous error, after eliminating the steady-state error caused by the instantaneous error in the integration process by the first coefficient, the accumulated error is accumulated, specifically based on the following formula:

[0080] Vel_S+=ki*Vel_E*time

[0081] Where Vel_S is the cumulative error within the set time period, ki is the first coefficient, Vel_E is the instantaneous error, and time is the set time period.

[0082] Further references Figure 2 The step S400: determining the offset speed according to the accumulated error and the instantaneous error, specifically includes:

[0083] Step S401: adjusting the instantaneous error by a second coefficient to adjust the response speed of the offset speed to the instantaneous error;

[0084] Step S402: superimposing the accumulated error on the instantaneous error of the adjusted weight to obtain the error change rate of the accelerometer speed within a set time;

[0085] Step S403: Calculating the offset speed according to the error change rate and the set time period;

[0086] The adjusting the accelerometer speed according to the offset speed is specifically based on the following formula:

[0087] acc_V+=(kp*Vel_E+Vel_S)*time

[0088] Where acc_V is the accelerometer velocity, kp is the second coefficient, Vel_E is the instantaneous error, Vel_S is the cumulative error within the set time period, and time is the set time period.

[0089] Specifically, when the cleaning robot offsets the accelerometer speed, the offset speed is determined based on the cumulative error and the instantaneous error. The instantaneous error is referenced to ensure that the cleaning robot responds quickly to the speed error recently generated by the two speed measurement methods, while the cumulative error is referenced to ensure that the cleaning robot takes into account the accumulated error over a period of time when adjusting the accelerometer speed, so that it can respond to the recently generated speed difference. This ensures the accuracy of the offset speed adjustment.

[0090] The second coefficient Kp is set for weighting the instantaneous error generated at the moment closest to the offset. The second coefficient Kp is a proportional parameter used to speed up the response speed of the system, which can improve the regulation accuracy of the system. If the KP value is too small, the regulation accuracy will be reduced and the response speed will be insufficient. As Kp increases, the response speed of the system will be faster and the regulation accuracy of the system can be improved. However, setting a higher value for the second coefficient Kp will cause the system to easily overshoot, the stability of the system will deteriorate, and even cause the system to be unstable.

[0091] In this regard, the accumulated error is weighted by the first coefficient Ki, which is an integral action parameter. The main function is to eliminate the steady-state error generated by the system when the accumulated error is integrated. The larger the first coefficient Ki, the faster the steady-state error of the system is eliminated, but the first coefficient Ki cannot be too large, otherwise integral saturation will occur in the early stage of the response process. If the first coefficient Ki is too small, the steady-state error of the system will be difficult to eliminate, affecting the regulation accuracy of the system. By setting parameters to ensure the steady-state error of the system, it can also offset the impact of the second coefficient Kp on the system and improve the accuracy of the offset speed.

[0092] By weighting the instantaneous error and reducing the weight of the instantaneous error, the influence of the change of optical flow data on the offset speed can be eliminated. Then, the instantaneous error is compensated by accumulating the error to obtain the error change rate between the accelerometer speed and the optical flow speed. Finally, the offset speed is determined according to the time interval between the two accelerometers and the above change rate. This scheme can improve the accuracy of the offset speed.

[0093] Further references Figure 3 , the method for obtaining the accelerometer velocity specifically comprises:

[0094] Step S101: continuously acquiring the pressure applied to the accelerometer, where the pressure is a vector;

[0095] Step S102: projecting the pressure in the coordinate system where the cleaning robot is located, and projecting it in the forward direction of the cleaning robot in the coordinate system;

[0096] Step S103: Integrate the projected pressure to obtain the accelerometer velocity, which is an instantaneous scalar.

[0097] This solution can accurately obtain the value of the accelerometer speed of the cleaning robot in the moving direction.

[0098] Further references Figure 4 , the method for obtaining the optical flow velocity specifically includes:

[0099] Step S104: continuously acquiring image data, and determining the moving distance of the cleaning robot per unit time according to the continuously acquired image data;

[0100] Step S105: Differentiate the moving distance to obtain the optical flow speed, which is the average speed of the cleaning robot per unit time.

[0101] This scheme determines the optical flow speed by the average speed of the cleaning robot moving per unit time, which can greatly eliminate the error of the optical flow speed caused by running accumulation.

[0102] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0103] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0104] Further references Figure 5 , as a response to the above Figure 1 The present application provides an embodiment of a speed fusion device based on optical flow and accelerometer, and the device embodiment is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0105] A speed fusion device based on optical flow and accelerometer, the device comprising:

[0106] The instantaneous speed acquisition module 100 is used to continuously detect the speed of the cleaning robot through the accelerometer and the optical flow during the operation of the cleaning robot, and to obtain the accelerometer speed and the optical flow speed through the accelerometer;

[0107] An instantaneous error acquisition module 200, configured to determine an instantaneous error based on the accelerometer velocity and the optical flow velocity that correspond to each other in time;

[0108] The cumulative error acquisition module 300 is used to obtain the cumulative error between the accelerometer velocity and the optical flow velocity within a set time period;

[0109] An offset speed acquisition module 400, configured to determine an offset speed according to the accumulated error and the instantaneous error, wherein the offset speed is a speed difference between an accelerometer speed generated by the cleaning robot within the set time period and a target speed of the cleaning robot;

[0110] The accelerometer adjustment module 500 is configured to adjust the accelerometer speed according to the offset speed.

[0111] This solution uses the speed information obtained by the accelerometer as the base value, combines the cumulative error with the instantaneous error to calculate the offset speed, and adjusts the speed information obtained by the accelerometer. This eliminates the data fluctuation of the instantaneous error of the optical flow data caused by the uneven image scene, and determines the difference between the accelerometer speed and the target speed by calculating the offset speed as the basis for the accelerometer speed offset, so as to reduce the impact of the above data fluctuations and more accurately adjust the accelerometer speed value.

[0112] Further references Figure 6 The offset speed acquisition module 400 specifically includes:

[0113] The instantaneous error adjustment submodule 401 is used to adjust the instantaneous error by a second coefficient to adjust the response speed of the offset speed to the instantaneous error;

[0114] A change rate determination submodule 402, configured to add the accumulated error to the instantaneous error of the adjusted weight to obtain the error change rate of the accelerometer speed within a set time;

[0115] A migration speed calculation submodule 403 is used to calculate the migration speed according to the error change rate and a set time period;

[0116] The adjusting the accelerometer speed according to the offset speed is specifically based on the following formula:

[0117] acc_V+=(kp*Vel_E+Vel_S)*time

[0118] Among them, acc_V is the accelerometer speed, kp is the second coefficient, Vel_E is the instantaneous error, Vel_S is the cumulative error within the set time period, and time is the set time period. By weighting the instantaneous error and reducing the weight of the instantaneous error, the influence of the change of optical flow data on the offset speed is eliminated. Then, the instantaneous error is compensated by the cumulative error to obtain the error change rate between the accelerometer speed and the optical flow speed. Finally, the offset speed is determined according to the time interval between the two accelerometers and the above change rate. This solution can improve the accuracy of the offset speed.

[0119] To solve the above technical problems, the present application also provides a computer device. Figure 7 Figure 7 This is a basic structural block diagram of the computer device in this embodiment.

[0120] The computer device 6 includes a memory 61, a processor 62, and a network interface 63 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 6 with components 61-63, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0121] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0122] The memory 61 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 61 can be an internal storage unit of the computer device 6, such as a hard disk or memory of the computer device 6. In other embodiments, the memory 61 can also be an external storage device of the computer device 6, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 6. Of course, the memory 61 can also include both the internal storage unit of the computer device 6 and its external storage device. In this embodiment, the memory 61 is generally used to store the operating system and various application software installed on the computer device 6, such as the program code of the velocity fusion method based on optical flow and accelerometer, etc. In addition, the memory 61 can also be used to temporarily store various types of data that have been output or are to be output.

[0123] The processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 62 is generally used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to run the program code stored in the memory 61 or process data, such as running the program code of the velocity fusion method based on optical flow and accelerometer.

[0124] The network interface 63 may include a wireless network interface or a wired network interface. The network interface 63 is generally used to establish a communication connection between the computer device 6 and other electronic devices.

[0125] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores a speed fusion program based on optical flow and accelerometer, and the speed fusion program based on optical flow and accelerometer can be executed by at least one processor to enable the at least one processor to perform the steps of the speed fusion method based on optical flow and accelerometer as described above.

[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0127] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A velocity fusion method based on optical flow and accelerometer, characterized by: The method includes: During the operation of the cleaning robot, the speed of the cleaning robot is continuously detected by the accelerometer and the optical flow, and the accelerometer speed is obtained by the accelerometer, and the optical flow speed is obtained by the optical flow; determining an instantaneous error based on the accelerometer velocity and the optical flow velocity corresponding to each other in time; Obtaining a cumulative error between the accelerometer velocity and the optical flow velocity by integrating the instantaneous error within a set time period; Specifically, after eliminating the steady-state error caused by the instantaneous error in the integration process through the first coefficient, the accumulated error is accumulated, specifically based on the following formula: Vel_S+=ki*Vel_E*time Where Vel_S is the cumulative error within the set time period, ki is the first coefficient, Vel_E is the instantaneous error, and time is the set time period; determining a deviation speed according to the accumulated error and the instantaneous error, the deviation speed being a speed difference between an accelerometer speed generated by the cleaning robot within the set time period and a target speed of the cleaning robot; adjusting the accelerometer velocity according to the offset velocity; Specifically, the instantaneous error is adjusted by the second coefficient to adjust the response speed of the offset speed to the instantaneous error; superimposing the accumulated error on the instantaneous error of the adjusted weight to obtain the error change rate of the accelerometer speed within a set time period; Calculate the offset speed according to the error change rate and a set time period; The adjusting the accelerometer speed according to the offset speed is specifically based on the following formula: acc_V+=(kp*Vel_E+Vel_S)*time Where acc_V is the accelerometer velocity, kp is the second coefficient, Vel_E is the instantaneous error, Vel_S is the accumulated error within the set time period, and time is the set time period.

2. The velocity fusion method based on optical flow and accelerometer according to claim 1, characterized in that: The method for obtaining the accelerometer velocity specifically includes: Continuously acquiring the pressure loaded on the accelerometer, wherein the pressure is a vector; Projecting the pressure in the coordinate system where the cleaning robot is located, and projecting it in the forward direction of the cleaning robot in the coordinate system; The projected pressure is integrated to obtain the accelerometer velocity, which is an instantaneous scalar.

3. The velocity fusion method based on optical flow and accelerometer according to claim 1, characterized in that: The method for obtaining the optical flow velocity specifically includes: Continuously acquiring image data, and determining the moving distance of the cleaning robot per unit time according to the continuously acquired image data; The moving distance is differentiated to obtain the optical flow speed, which is the average speed of the cleaning robot per unit time.

4. A velocity fusion device based on optical flow and accelerometer, characterized in that: The device includes: The instantaneous speed acquisition module is used to continuously detect the speed of the cleaning robot through the accelerometer and the optical flow during the operation of the cleaning robot, and obtain the accelerometer speed through the accelerometer and the optical flow speed through the optical flow; An instantaneous error acquisition module, used to determine an instantaneous error according to the accelerometer velocity and the optical flow velocity corresponding to each other in time; A cumulative error acquisition module, used to obtain a cumulative error between the accelerometer velocity and the optical flow velocity by integrating the instantaneous error within a set time period; Specifically, after eliminating the steady-state error caused by the instantaneous error in the integration process through the first coefficient, the accumulated error is accumulated, specifically based on the following formula: Vel_S+=ki*Vel_E*time Where Vel_S is the cumulative error within the set time period, ki is the first coefficient, Vel_E is the instantaneous error, and time is the set time period; an offset speed acquisition module, configured to determine an offset speed according to the accumulated error and the instantaneous error, wherein the offset speed is a speed difference between an accelerometer speed generated by the cleaning robot within the set time period and a target speed of the cleaning robot; an accelerometer adjustment module, configured to adjust the accelerometer speed according to the offset speed; Specifically, it includes: an instantaneous error adjustment submodule, which is used to adjust the instantaneous error through a second coefficient to adjust the response speed of the offset speed to the instantaneous error; A change rate determination submodule, used for superimposing the accumulated error on the instantaneous error of the adjusted weight to obtain the error change rate of the accelerometer speed within a set time period; A migration speed calculation submodule, used to calculate the migration speed according to the error change rate and a set time period; The adjusting the accelerometer speed according to the offset speed is specifically based on the following formula: acc_V+=(kp*Vel_E+Vel_S)*time Where acc_V is the accelerometer velocity, kp is the second coefficient, Vel_E is the instantaneous error, Vel_S is the accumulated error within the set time period, and time is the set time period.

5. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the velocity fusion method based on optical flow and accelerometer are implemented as described in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the velocity fusion method based on optical flow and accelerometer as described in any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Unmanned-plane horizontal-speed control method based on fusion of data of acceleration sensor and optical-flow sensor

    CN105352495A

  • Unmanned aerial vehicle movement speed prediction method based on machine learning

    CN105806342A

  • A group abnormal behavior detection method based on acceleration motion feature descriptors

    CN109948424A

  • Indoor unmanned aerial vehicle positioning system

    CN110332932A

  • Nonlinear estimation method and system based on optical flow and IMU fusion

    CN112284380A