Obstacle avoidance method, device and obstacle avoidance device for mobile equipment

By using the ultrasonic ranging module to detect the distance between obstacles in a mobile device and combining the feedback information of the walking motor, we can judge and avoid obstacles, and solve the problems of low accuracy and detection blind spots in traditional ultrasonic ranging technology, and improve the equipment's avoidance Obstacle accuracy and work area coverage.

CN114115210BActive Publication Date: 2024-11-19KINGCLEAN ELECTRIC GREEN TECHNOLOGY (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010862258.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-25
Publication Date
2024-11-19
Estimated Expiration
2040-08-25

AI Technical Summary

Technical Problem

Traditional ultrasonic ranging technology in mobile devices has low ranging accuracy due to temperature and time measurement errors, and there are detection blind spots, resulting in the equipment creating working blind spots when planning the path.

Method used

By obtaining the distance of the obstacle detected by the ultrasonic distance measuring module, and when the set threshold is reached, whether the obstacle is in the driving path of the equipment is determined, the walking motor is controlled to slow down and calculate the walking distance based on the feedback information of the walking motor. When the second At threshold, perform obstacle avoidance actions to bypass obstacles and return to the original path.

Benefits of technology

It effectively reduces the distance between the mobile device and the obstacle within a relatively accurate range, makes up for the detection blind spots existing in the ultrasonic ranging module, maximizes the working area of ​​the equipment, and reduces the working blind spots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114115210B_ABST
    Figure CN114115210B_ABST
Patent Text Reader

Abstract

The present application relates to an obstacle avoidance method, device and obstacle avoidance device for a self-moving device, wherein the method obtains the obstacle distance detected by an ultrasonic ranging module, and when the obtained obstacle distance reaches a set first threshold, determines whether the obstacle is in the driving path of the self-moving device. If it is determined that the obstacle is in the driving path of the self-moving device, the travel motor is controlled to decelerate, and the travel distance of the self-moving device is calculated based on the feedback information of the travel motor. When the travel distance reaches a second threshold, the self-moving device is controlled to perform an obstacle avoidance action to bypass the obstacle, and return to the original driving path to continue walking. The above method can control the distance between the self-moving device and the obstacle within a more accurate range, thereby compensating for the disadvantage of the ultrasonic ranging module having a detection blind spot, so that the working area of ​​the self-moving device can be maximized during the obstacle avoidance process, while reducing the working blind spot.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent control technology, and in particular to an obstacle avoidance method, device and obstacle avoidance device for a self-moving device. Background Art

[0002] With the development of intelligent control technology, more and more intelligent self-moving devices (such as smart lawn mowers, sweeping robots, etc.) are involved in people's production and life, greatly improving the convenience of people's production and life.

[0003] In traditional technology, autonomous mobile devices mainly use ultrasonic ranging technology to detect obstacles and automatically plan paths. However, ultrasonic ranging technology will cause certain ranging errors due to temperature and time measurement errors, resulting in low measurement accuracy and certain detection blind spots, which in turn cause corresponding working blind spots for autonomous mobile devices when planning paths. Summary of the invention

[0004] Based on this, it is necessary to provide an obstacle avoidance method, device and obstacle avoidance device for a self-moving device that can reduce the working blind spot, in order to address the problem that the traditional ultrasonic ranging accuracy is not high and causes the self-moving device to have a working blind spot.

[0005] A method for avoiding obstacles of a self-moving device, the self-moving device comprises a main control module, a walking motor and an ultrasonic ranging module which are communicatively connected to the main control module, wherein the ultrasonic ranging module is arranged at the front end of the walking direction of the self-moving device, and the method is applied to the main control module; the method comprises:

[0006] Get the obstacle distance detected by the ultrasonic ranging module;

[0007] If the currently acquired obstacle distance reaches the set first threshold, it is determined whether the obstacle is in the driving path of the self-moving device;

[0008] If it is determined that the obstacle is in the driving path of the self-moving device, the travel motor is controlled to decelerate and the travel distance of the self-moving device is calculated;

[0009] When the travel distance of the self-moving device reaches a set second threshold, the self-moving device is controlled to perform an obstacle avoidance action to bypass the obstacle and return to the travel path to continue traveling.

[0010] In one of the embodiments, determining whether an obstacle is in the driving path of the self-moving device includes: calculating the current forward distance of the self-moving device relative to the historical moment according to the currently acquired obstacle distance and the obstacle distance acquired at the historical moment; if the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at the historical moment, it is determined that the obstacle is in the driving path of the self-moving device.

[0011] In one of the embodiments, the method further includes: if the sum of the forward distance and the currently acquired obstacle distance does not match the obstacle distance acquired at a historical moment, then calculating at the historical moment, a first angle between the distance between the ultrasonic ranging module and the obstacle and the forward direction of the self-moving device, and a second angle between the line between the current position of the ultrasonic ranging module and the end point of the extended line of the edge of the self-moving device and the forward direction, wherein the length of the extended line of the edge of the self-moving device is the body length of the self-moving device; if the first angle is smaller than the second angle, it is determined that the obstacle is in the driving path of the self-moving device.

[0012] In one of the embodiments, after determining that an obstacle is in the driving path of the self-moving device, the method further includes: detecting the position of the obstacle relative to the self-moving device; controlling the self-moving device to perform an obstacle avoidance action to bypass the obstacle includes: controlling the self-moving device to perform an obstacle avoidance action to bypass the obstacle based on the position of the obstacle relative to the self-moving device.

[0013] In one of the embodiments, detecting the position of an obstacle relative to the self-moving device includes: when it is detected that the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at a historical moment, determining that the obstacle is directly in front of the driving path of the self-moving device; when it is detected that the first angle is smaller than the second angle, determining that the obstacle is to the side and front of the driving path of the self-moving device.

[0014] In one of the embodiments, the walking distance is calculated based on feedback information from a walking motor, where the feedback information is feedback pulse information; the calculation of the walking distance of the self-moving device includes: obtaining pulse information fed back by the walking motor, where the pulse information includes the number of pulses; and calculating the walking distance of the self-moving device based on the number of pulses and configuration parameters of the self-moving device.

[0015] In one of the embodiments, the method further includes: if a collision event is detected between the self-moving device and an obstacle, controlling the self-moving device to perform an obstacle avoidance action to bypass the obstacle and return to the driving path to continue moving.

[0016] In one embodiment, the self-moving device is controlled to perform an obstacle avoidance action to bypass the obstacle and return to the driving path to continue moving, including: controlling the self-moving device to stop moving forward and retreat a first set distance; controlling the self-moving device to rotate a first set angle and move forward a second set distance; controlling the self-moving device to rotate a second set angle and move forward a third set distance, wherein the second set angle is equal to the first set angle in magnitude and opposite in direction; controlling the self-moving device to rotate a third set angle and move forward a fourth set distance, wherein the fourth set distance is equal to the second set distance; controlling the self-moving device to rotate the fourth set angle to return to the driving path to continue moving, wherein the fourth set angle is opposite in direction to the third set angle.

[0017] An obstacle avoidance device for a self-moving device, the obstacle avoidance device is communicatively connected with a traveling motor and an ultrasonic ranging module of the self-moving device, the ultrasonic ranging module is arranged at the front end of the traveling direction of the self-moving device, and the obstacle avoidance device comprises:

[0018] The obstacle distance acquisition module is used to obtain the obstacle distance detected by the ultrasonic ranging module;

[0019] An obstacle judgment module is used to judge whether the obstacle is in the driving path of the self-moving device if the currently acquired obstacle distance reaches a set first threshold;

[0020] The deceleration processing module is used to control the travel motor to decelerate and calculate the travel distance of the self-moving device if it is determined that the obstacle is in the travel path of the self-moving device;

[0021] The obstacle avoidance control module is used to control the self-moving device to perform obstacle avoidance actions to bypass obstacles and return to the driving path to continue walking when the walking distance of the self-moving device reaches a set second threshold.

[0022] An obstacle avoidance system is applied to a self-moving device, comprising the obstacle avoidance device, a walking motor and an ultrasonic ranging module as described above, wherein the obstacle avoidance device is communicatively connected with the walking motor and the ultrasonic ranging module of the self-moving device, and the ultrasonic ranging module is arranged at the front end of the walking direction of the self-moving device.

[0023] An obstacle avoidance device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0024] A computer-readable storage medium stores a computer program, which implements the steps of the above method when executed by a processor.

[0025] The obstacle avoidance method, device and obstacle avoidance device of the self-moving device described above obtain the obstacle distance detected by the ultrasonic ranging module, and when the obtained obstacle distance reaches the set first threshold, determine whether the obstacle is in the driving path of the self-moving device. If it is determined that the obstacle is in the driving path of the self-moving device, the travel motor is controlled to decelerate, and the travel distance of the self-moving device is calculated based on the feedback information of the travel motor. When the travel distance reaches the second threshold, the self-moving device is controlled to perform obstacle avoidance action to bypass the obstacle, and return to the original driving path to continue walking. The above method can control the distance between the self-moving device and the obstacle within a more accurate range, thereby compensating for the disadvantage of the ultrasonic ranging module having a detection blind spot, so that the working area of ​​the self-moving device can be maximized during the obstacle avoidance process, while reducing the working blind spot. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A schematic diagram of a flow chart of an obstacle avoidance method for a mobile device in one embodiment;

[0027] Figure 2 A schematic diagram of the structure of an ultrasonic ranging module in one embodiment;

[0028] FIG3( a ) is a schematic diagram of distance measurement of an ultrasonic distance measurement module in one embodiment;

[0029] FIG3( b ) is a schematic diagram of distance measurement of an ultrasonic distance measurement module in another embodiment;

[0030] FIG4( a ) is a schematic diagram of transmitting pulses in one embodiment;

[0031] FIG4( b ) is a schematic diagram of receiving a pulse in one embodiment;

[0032] Figure 5 A schematic diagram of a flow chart of a step of determining whether an obstacle is in a driving path in an embodiment;

[0033] Figure 6 A schematic diagram of a scenario for determining whether an obstacle is in a driving path in an embodiment;

[0034] Figure 7 A schematic diagram of a scenario for determining whether an obstacle is in a driving path in another embodiment;

[0035] FIG8( a ) is a schematic diagram of a scenario for determining whether an obstacle is in a driving path in another embodiment;

[0036] FIG8( b ) is a schematic diagram of a scenario for determining whether an obstacle is in the driving path in another embodiment;

[0037] Fig. 9A schematic diagram of a scenario for determining whether an obstacle is in a driving path in another embodiment;

[0038] Fig.10 is a flowchart of steps for performing an obstacle avoidance action in one embodiment;

[0039] Fig.11 A schematic diagram of a scenario in which an obstacle avoidance action is performed in one embodiment;

[0040] Fig.12 A schematic diagram of a scenario in which an obstacle avoidance action is performed in another embodiment;

[0041] Fig.13 is a schematic diagram of an application for performing an obstacle avoidance action in an embodiment;

[0042] Fig.14 A schematic diagram of a flow chart of an obstacle avoidance method for a mobile device in another embodiment;

[0043] Fig.15 A specific application schematic diagram of performing an obstacle avoidance action in an embodiment;

[0044] Fig.16 is a structural block diagram of an obstacle avoidance device for a mobile device in one embodiment;

[0045] Fig.17 is a structural block diagram of an obstacle avoidance system in one embodiment;

[0046] Fig.18 FIG. 4 is a diagram showing the internal structure of an obstacle avoidance device in one embodiment. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0048] The obstacle avoidance method for a self-moving device provided in the present application can be applied to the main control module of the self-moving device, wherein the self-moving device includes but is not limited to a smart lawn mower, a sweeping robot, etc. Specifically, the self-moving device includes a main control module, a walking motor and an ultrasonic ranging module that are communicatively connected to the main control module. Usually, the ultrasonic ranging module is arranged at the front end of the walking direction of the self-moving device, and is used to detect whether there is an obstacle in front of the driving path of the self-moving device, and when an obstacle is detected, the detected obstacle distance information is transmitted to the main control module, and the main control module can perform path planning according to the obstacle distance information, and control the speed of the walking motor and the driving direction of the self-moving device to bypass the obstacle.

[0049] In one embodiment, Figure 1As shown, a method for avoiding obstacles in a mobile device is provided, which may specifically include the following steps:

[0050] Step 102, obtaining the obstacle distance detected by the ultrasonic ranging module.

[0051] Among them, Figure 2 As shown, the ultrasonic ranging module mainly includes a power supply unit, a controller, an ultrasonic generator and an ultrasonic receiver. The power supply unit supplies power to the entire module. The controller can set the frequency of ultrasonic emission and process the received ultrasonic signal to calculate the distance of the obstacle. The ultrasonic transmitter is used to emit ultrasonic waves outward, and the ultrasonic receiver is used to receive the reflected ultrasonic waves. The ultrasonic ranging module uses the time difference ranging method. The timing starts when the ultrasonic generator emits ultrasonic waves and ends when the ultrasonic receiver receives the reflected wave. The distance to the obstacle is calculated using the known propagation speed of sound waves in the air (usually 340m / s). Specifically, the ultrasonic ranging formula is: L=C×T, where L is the measured distance, C is the speed of ultrasonic waves in the air, and T is the transmission time of the detected ultrasonic wave to the obstacle (usually half of the time from emission to reception). The obstacle distance refers to the distance to the obstacle detected and calculated by the ultrasonic ranging module. In this embodiment, the ultrasonic ranging module is arranged at the front end of the moving device in the walking direction and is communicated with the main control module. When the ultrasonic ranging module detects an obstacle, it will continuously transmit the detected obstacle distance to the main control module. Therefore, the main control module can continuously receive the obstacle distance detected by the ultrasonic ranging module.

[0052] Step 104: If the currently acquired obstacle distance reaches a set first threshold, it is determined whether the obstacle is in the driving path of the mobile device.

[0053] Among them, the first threshold value can be a pre-set distance at which the self-moving device is controlled to decelerate and avoid obstacles when it is determined that there is an obstacle in the driving path, that is, the deceleration threshold. Specifically, the first threshold value can be set in combination with the ranging angle and ranging range of the ultrasonic ranging module and according to the actual application scenario, and this is not limited in this embodiment. In this embodiment, when the main control module detects that the obstacle distance currently obtained reaches the set first threshold value, it is necessary to further determine whether the obstacle is in the driving path of the self-moving device, that is, to determine whether obstacle avoidance measures need to be taken. For example, when the obstacle is located on the side of the self-moving device and is not in the driving path, it means that the obstacle will not affect the forward movement of the self-moving device, and obstacle avoidance is not required at this time; and when the obstacle is located in the driving path of the self-moving device, it means that the obstacle will affect the forward movement of the self-moving device, and obstacle avoidance measures need to be taken at this time.

[0054] Specifically, in this embodiment, when judging whether an obstacle is in the driving path of the self-moving device, it can be specifically judged whether the obstacle is directly in front of the driving path of the self-moving device first. If it is determined that the obstacle is directly in front of the driving path of the self-moving device, the obstacle avoidance measures are taken. If it is determined that the obstacle is not directly in front of the driving path of the self-moving device, it is further judged whether the obstacle is in the side front of the driving path of the self-moving device. If it is determined that the obstacle is in the side front of the driving path of the self-moving device, the obstacle avoidance measures are taken. If it is determined that the obstacle is not directly in front of the driving path of the self-moving device, and the obstacle is not in the side front of the driving path of the self-moving device, it can be determined that the obstacle is not in the driving path of the self-moving device, and no obstacle avoidance measures are required at this time. It can be understood that for the case where the obstacle is directly in front of or in front of the driving path of the self-moving device, the corresponding obstacle avoidance measures may be different, which will be explained in detail in the following embodiments.

[0055] Since the ultrasonic waves emitted by the ultrasonic ranging module have a certain angle range, in actual use, there will be certain installation angle and installation height restrictions, and it can only detect an obstacle closest to itself, and cannot determine the position of the obstacle when it is stationary. For example, as shown in Figure 3 (a), when the ultrasonic ranging module detects that the obstacle distance is d, the position of the obstacle may be any point on the arc with the ultrasonic ranging module as the center and d as the radius. Therefore, in this embodiment, if the obstacle distance currently obtained by the main control module reaches the set first threshold, the main control module can determine the approximate position of the obstacle by analyzing the continuously received obstacle distance, and then determine whether the obstacle is in the driving path of the self-moving device, that is, determine whether obstacle avoidance measures need to be taken.

[0056] Among them, the approximate position of the obstacle is determined by analyzing the obstacle distances continuously received, as shown in Figure 3(b). When the self-moving device is at position a, the position of the detected obstacle may be any point on the arc. However, when the machine moves forward a certain distance and is at position b, the same obstacle is detected again, and the basic position of the obstacle can be roughly determined. Specifically, it can be analyzed according to the triangle congruence judgment rule, that is, when the lengths of the three sides (including the obstacle distance detected when located at a, the obstacle distance detected when located at b, and the distance from a to b) and the positions of the three vertices (including the specific position of point a, the specific position of point b, and the position of the obstacle on the arc) are known, the triangle can be uniquely determined.

[0057] Step 106: If it is determined that the obstacle is in the driving path of the self-moving device, the travel motor is controlled to decelerate and the travel distance of the self-moving device is calculated.

[0058] Specifically, since ultrasound is a sound wave, its propagation speed is greatly affected by the propagation medium and temperature. Therefore, ultrasonic ranging technology will have certain errors due to the influence of temperature and time detection accuracy. Its propagation speed in air at 15°C is usually 340m / s, and the higher the temperature, the faster its propagation speed. Under the influence of time detection accuracy, there will also be certain errors in the timing of ultrasonic emission and reception, which will lead to errors in the final calculated obstacle distance. Under this influence, the detection distance range of the ultrasonic ranging module usually has a starting value. For example, to detect the obstacle distance within 20cm, the timing resolution needs to be controlled within 1ms, which is difficult in practical applications. Therefore, the general ultrasonic ranging module will specify a range of use, which not only specifies the maximum detection distance but also the minimum detection distance.

[0059] In addition, in the circuit controlling the ultrasonic emission, 8-10 pulses are emitted in a very short period of time (as shown in FIG. 4(a)), and the point of emitting the first pulse is taken as the starting time, and then 8-10 pulses are emitted again after a long period of time, and then the timing is restarted. When the ultrasonic wave encounters an obstacle, it will be reflected back. After the ultrasonic receiver receives the reflected ultrasonic wave, it will be amplified by the circuit (as shown in FIG. 4(b)). It must be amplified to a state that the circuit can recognize, and then the time of "receiving the reflected ultrasonic wave" is transmitted to the controller, and the timing ends, and the first reflected ultrasonic wave received is taken as the end time. However, it is not possible to determine which pulse among the 8-10 pulses generated the emitted ultrasonic wave, so this is also the reason for the insufficient time detection accuracy. Therefore, the ultrasonic ranging technology cannot determine the exact distance of obstacles that are close to each other, that is, there is a certain detection blind area through ultrasonic ranging. This detection blind area will cause the self-moving device to be unable to bypass the obstacle and collide with it. If obstacle avoidance is performed before reaching the detection blind area, the self-moving device will have a larger working blind area. It can be understood that the first threshold set above is greater than or equal to the detection blind area of ​​the ultrasonic ranging module.

[0060] Based on this, in this embodiment, when the main control module determines that the obstacle is in the driving path of the self-moving device after analyzing the acquired obstacle distance, it takes obstacle avoidance measures to control the travel motor to slow down. At the same time, in order to avoid the self-moving device entering the detection blind spot of the ultrasonic ranging module and causing the measured obstacle distance to be distorted, the main control module calculates the travel distance of the self-moving device based on the feedback information of the travel motor. Since the travel distance calculated by the feedback information of the travel motor has high accuracy and stable performance, the reference to the travel distance in the process of obstacle avoidance can improve the obstacle avoidance accuracy of the self-moving device, thereby reducing the working blind spot of the self-moving device.

[0061] Step 108: When the travel distance of the self-moving device reaches a set second threshold, the self-moving device is controlled to perform an obstacle avoidance action to bypass the obstacle.

[0062] Specifically, when the main control module detects that the travel distance of the self-moving device reaches the set second threshold, the self-moving device is controlled to perform obstacle avoidance to bypass the obstacle and return to the original travel path to continue walking. The second threshold is smaller than the first threshold. By setting the second threshold, the distance between the self-moving device and the obstacle can be controlled within a more accurate range, thereby compensating for the disadvantage of the ultrasonic ranging module having a detection blind spot, so that the working area of ​​the self-moving device can be maximized during the obstacle avoidance process, while reducing the working blind spot.

[0063] The obstacle avoidance method of the self-moving device described above obtains the obstacle distance detected by the ultrasonic ranging module, and when the obtained obstacle distance reaches the set first threshold, determines whether the obstacle is in the driving path of the self-moving device. If it is determined that the obstacle is in the driving path of the self-moving device, the travel motor is controlled to decelerate, and the travel distance of the self-moving device is calculated based on the feedback information of the travel motor. When the travel distance reaches the second threshold, the self-moving device is controlled to perform obstacle avoidance action to bypass the obstacle, and return to the original driving path to continue walking. The above method can control the distance between the self-moving device and the obstacle within a more accurate range, thereby compensating for the disadvantage of the ultrasonic ranging module having a detection blind spot, so that the working area of ​​the self-moving device can be maximized during the obstacle avoidance process, while reducing the working blind spot.

[0064] In one embodiment, Figure 5 As shown, judging whether an obstacle is in the driving path of the self-moving device specifically includes the following steps:

[0065] Step 502: Calculate the current forward distance of the mobile device relative to the historical moment according to the currently acquired obstacle distance and the obstacle distance acquired at the historical moment.

[0066] Since the ultrasonic ranging module will continuously transmit the detected obstacle distance to the main control module when detecting an obstacle, the main control module can continuously receive the obstacle distance detected by the ultrasonic ranging module. When the main control module detects that the obstacle distance currently received reaches the set first threshold, it is necessary to further determine whether the obstacle is in the driving path of the self-moving device, that is, to determine whether the obstacle will hinder the self-moving device from walking along the original driving path. Generally, for the case where the obstacle is not in the driving path of the self-moving device, since the obstacle will not affect the forward movement of the self-moving device, there is no need to avoid the obstacle in this case. For the case where the obstacle is in the driving path of the self-moving device, it includes the obstacle in front of the driving path of the self-moving device and the obstacle on the side of the driving path of the self-moving device. Based on this, this embodiment analyzes the obstacle distance continuously received and calculates the forward distance of the self-moving device relative to the historical moment, so as to determine whether the obstacle is in the driving path of the self-moving device through the forward distance and subsequent steps, that is, to determine whether obstacle avoidance measures need to be taken.

[0067] Step 504 , determining whether the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at a historical moment.

[0068] Specifically, Figure 6 As shown, when the self-moving device (the machine in the figure) is at position 1, the distance of the obstacle detected by the ultrasonic ranging module is a (that is, the obstacle distance detected at a certain historical moment), and when the self-moving device advances a distance b and reaches position 2, the obstacle distance detected by the ultrasonic ranging module is c (that is, the obstacle distance currently detected, and the distance reaches the set first threshold). Since the ultrasonic ranging module can only detect the closest obstacle, when b+c=a, it can be determined that the obstacle is directly in front of the self-moving device in the driving path. Based on this, this embodiment determines whether the obstacle is in the driving path of the self-moving device by judging whether the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at a historical moment, that is, if it matches, step 506 is executed, and if it does not match, step 508 is executed. As for whether there is a match, the matching conditions can be determined based on the body width of the self-moving device, the installation angle and the ranging range of the ultrasonic ranging module, such as b+c=a±d, where d is the matching condition set according to the actual application scenario, that is, as long as this equation is satisfied, it can be determined that the obstacle is in the driving path of the self-moving device.

[0069] Step 506: Determine if an obstacle is in the driving path of the self-moving device.

[0070] If the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at a historical moment, it is determined that the obstacle is in the driving path of the self-moving device.

[0071] Step 508, calculating the first angle and the second angle.

[0072] Among them, the first angle is the angle between the distance between the ultrasonic ranging module and the obstacle and the forward direction of the self-moving device at the historical moment; the second angle is the angle between the line between the current position of the ultrasonic ranging module and the end point of the extended line of the edge of the self-moving device and the forward direction, wherein the length of the extended line of the edge of the self-moving device is the body length of the self-moving device.

[0073] In this embodiment, if the sum of the forward distance and the currently acquired obstacle distance does not match the obstacle distance acquired at the historical moment, it means that the obstacle is not directly in front of the driving path of the self-moving device. At this time, by further calculating the first angle between the distance between the ultrasonic ranging module and the obstacle and the forward direction of the self-moving device at the historical moment, and the second angle between the line between the current position of the ultrasonic ranging module and the end point of the extended line of the edge of the self-moving device and the forward direction, and through subsequent steps, it is determined whether the obstacle is on the side of the driving path of the self-moving device or whether the obstacle is not in the driving path of the self-moving device.

[0074] Specifically, Figure 7 As shown, when the self-moving device is at position 1, the detected obstacle distance is a. When the self-moving device moves forward a distance b and reaches position 2, the detected obstacle distance is c. The detection point in the figure is the tangent point of a circle with the ultrasonic ranging module as the center and the detected distance as the radius, and the outer contour of the obstacle to ensure that this point is the closest point. As can be seen from the figure, the three lines a, b, and c can be approximated as the three sides of a triangle. When the lengths of the three sides are known, a unique triangle can be determined, and thus the angle of the triangle can be determined. However, if Figure 7 As shown, since the ultrasonic ranging module can only detect the distance to the obstacle, it cannot detect the position of the obstacle when it is stationary. Therefore, it cannot be determined whether the obstacle is actually on the left or on the right. Although a unique triangle can be determined, only b is fixed and the specific position of the triangle cannot be determined.

[0075] Therefore, when an obstacle is detected, this embodiment starts to calculate the angle, that is, calculates the first angle between the distance between the ultrasonic ranging module and the obstacle and the forward direction of the self-moving device at the historical moment, and the second angle between the line between the current position of the ultrasonic ranging module and the end point of the extended line of the edge of the self-moving device and the forward direction, and through multiple calculations, until the currently acquired obstacle distance reaches the set first threshold, so as to determine whether the obstacle is in the driving path of the self-moving device by analyzing the angle.

[0076] Step 510, determining whether the first angle is smaller than the second angle.

[0077] If the first angle is smaller than the second angle, then step 506 is executed to determine that the obstacle is in the driving path of the self-moving device. Otherwise, step 512 is executed.

[0078] Step 512, determine that the obstacle is not in the driving path of the mobile device.

[0079] Specifically, as shown in Figures 8(a) and 8(b), b in the figure is the length of the self-moving device, e is half of the width of the body, and o represents the position of the ultrasonic ranging module. Assume that: after the self-moving device moves forward by a body position b, when it reaches the first threshold, that is, the deceleration threshold, by comparing the two triangles, △abc and △dbe, if ∠aob (that is, the first angle) is greater than ∠dob (that is, the second angle), it means that the obstacle is outside the driving path of the self-moving device (as shown in Figure 8(a)), that is, the obstacle is not in the driving path of the self-moving device, and obstacle avoidance is not required at this time; if ∠aob (that is, the first angle) is less than ∠dob (that is, the second angle), it means that the obstacle is in the driving path of the self-moving device (as shown in Figure 8(b)), that is, the obstacle will prevent the self-moving device from moving forward along the driving path, and obstacle avoidance is required at this time, so as to control the walking motor to decelerate and perform obstacle avoidance measures.

[0080] It is understandable that since the ultrasonic ranging module has a certain measurement angle, such as Fig. 9 As shown in Figure 8(a), when the self-mobile device approaches an obstacle, it may not detect the obstacle. Fig. 9 In the scenario, as the distance between the machine and the obstacle gets closer, the c side (the distance between the machine and the obstacle) becomes shorter and closer to the deceleration threshold. However, there will not be a situation where c is less than or equal to the deceleration threshold. Therefore, in this case, it can be determined that the obstacle is not in the driving path of the self-moving device.

[0081] In one embodiment, after determining that an obstacle is in the driving path of the self-moving device, a step of further determining the position of the obstacle relative to the self-moving device may be performed. Specifically, when it is detected that the sum of the forward distance of the self-moving device and the currently acquired obstacle distance matches the obstacle distance acquired at a historical moment, it can be determined that the obstacle is directly in front of the driving path of the self-moving device; when it is detected that the first angle is smaller than the second angle, it can be determined that the obstacle is to the side of the driving path of the self-moving device. Then, according to the position of the obstacle relative to the self-moving device, the self-moving device can be controlled to perform an obstacle avoidance action to bypass the obstacle.

[0082] In one embodiment, the feedback information can be the pulse information fed back by the walking motor, and the walking distance of the self-moving device is calculated. Specifically, the walking distance of the self-moving device can be calculated according to the pulse information fed back by the walking motor and the configuration parameters of the self-moving device. Specifically, when the walking motor is working, pulses will be generated. When the walking motor drives the large wheel of the self-moving device to rotate one circle, that is, when the large wheel advances a distance of one wheel circumference, a fixed number of pulses (the specific number is determined by the configuration parameters of the self-moving device, wherein the configuration parameters include but are not limited to the circumference of the wheel, the number of pulses generated by the walking motor when the wheel is driven to rotate one circle, etc.) will be generated. Therefore, by calculating the number of pulses, the rotation distance of the large wheel (that is, the walking distance of the self-moving device) can be obtained. Specifically, the pulses can be counted by configuring a code disk in the walking motor, and then the counting result can be passed to the main control module. For example, if the configuration parameters of the self-moving device include: the circumference of the wheel is C, and the number of pulses generated by the walking motor when the wheel is driven to rotate one circle is 360. Therefore, when the pulse information received by the main control module is 720 pulses, the forward distance of the self-moving device can be calculated as 2C. Therefore, the pulse information fed back by the walking motor can be used to calculate the distance information with high accuracy and stable performance. The present application is precisely to improve the accuracy of obstacle avoidance. When it is detected that the obstacle distance reaches the set first threshold and it is determined that the obstacle is in the driving path of the self-moving device, the feedback information of the walking motor is used to monitor the walking distance of the self-moving device, so as to control the distance between the self-moving device and the obstacle within a precise range (i.e., the first threshold minus the second threshold). Usually, the range can be controlled within 1 cm to 2 cm to improve the accuracy of obstacle avoidance of the self-moving device, thereby reducing the working blind spot generated during obstacle avoidance.

[0083] In one embodiment, Fig.10 As shown, controlling the mobile device to perform obstacle avoidance actions to bypass obstacles specifically includes the following steps:

[0084] Step 1002, controlling the mobile device to stop moving forward and retreat a first set distance.

[0085] Among them, the first set distance can be determined according to the body width and length of the self-moving device. Specifically, when it is detected that the walking distance of the self-moving device reaches the set second threshold, that is, the distance between the self-moving device and the obstacle reaches the distance of the first threshold minus the second threshold, that is, it is in a precise range. At this time, it is necessary to control the self-moving device to perform obstacle avoidance actions to bypass the obstacle. Since the self-moving device and the obstacle are in a precise distance range, that is, the self-moving device is very close to the obstacle, therefore, by controlling the self-moving device to stop moving forward and retreat the first set distance, by retreating the first set distance, the self-moving device can change the driving angle to bypass the obstacle, that is, the first set distance is the minimum distance required to ensure that the self-moving device has enough space to bypass.

[0086] Step 1004, controlling the mobile device to rotate to a first set angle and move forward a second set distance.

[0087] The first set angle can be specifically determined according to the location of the obstacle and the desired detour direction of the self-moving device. For example, when the obstacle is located in front of the self-moving device in the driving path (such as Fig.11 ) or when the obstacle is located on the side of the driving path of the self-moving device (such as Fig.12 As shown in FIG. 1 , the angle at which the self-moving device rotates to avoid obstacles is different. At the same time, based on the different detour directions of the self-moving device to detour to the left or to the right, the angle at which the self-moving device rotates to avoid obstacles is also different. Fig.11 , Fig.12 All of them are schematic diagrams of obstacle avoidance paths for detouring to the left, where the direction indicated by the arrow is the driving direction of the machine. If it is detouring to the right, the corresponding rotation angle should be equal to the angle when detouring to the left, but in the opposite direction. The second set distance can be determined according to the size of the obstacle. Since ultrasonic ranging cannot detect the shape and size of the obstacle, in this embodiment, the shape and size of the obstacle can be predicted according to the actual application scenario and application environment, and then the size of the second set distance can be determined according to the predicted shape and size of the obstacle.

[0088] Step 1006, controlling the mobile device to rotate to a second set angle and move forward a third set distance.

[0089] The second setting angle is equal to the first setting angle in magnitude and opposite in direction. Fig.13 As shown in FIG. 1 , after the mobile device has rotated twice, its driving direction X1 is basically the same as the direction X before the rotation. Fig.13As shown, when the self-moving device detects that the distance to the obstacle reaches the distance d0 obtained by subtracting the second threshold from the first threshold (this distance is usually within an accurate range, such as between 1 cm and 2 cm), the self-moving device is controlled to retreat the first set distance d1 to ensure that the self-moving device has enough space to rotate to bypass the obstacle from the side. If the self-moving device rotates to the left by the first set angle α when it rotates for the first time, and travels the second set distance d2 at this driving angle, the self-moving device is controlled to rotate to the right by the second set angle, that is, rotate to the right by α, and move forward the third set distance d3 at this driving angle to bypass the obstacle. Specifically, the third set distance d3 is related to the predicted shape and size of the obstacle. For example, Fig.13 As shown in , if the predicted obstacle shape is circular, the diameter of the obstacle is The third set distance may be similar to the predicted diameter of the obstacle.

[0090] Step 1008, controlling the mobile device to rotate to a third set angle and move forward a fourth set distance.

[0091] The fourth set distance is equal to the second set distance. Specifically, the self-moving device is controlled to rotate the third set angle and travel the fourth set distance d4 at the driving angle, so as to approach the original driving path of the self-moving device. The direction and size of the third set angle can be the same as the direction and size of the second set angle.

[0092] Step 1010, controlling the mobile device to rotate to a fourth set angle to return to the driving path and continue walking.

[0093] Specifically, by controlling the self-moving device to rotate multiple times, the self-moving device can bypass obstacles and return to the original driving path to continue walking, so that the self-moving device can reach the maximum working area.

[0094] In one embodiment, when the main control module controls the self-moving device to perform the above-mentioned obstacle avoidance action, it can also continuously detect whether a collision event occurs between the self-moving device and the obstacle. Specifically, due to the complexity of the working environment of the self-moving device, such as when there are too many obstacles or the shapes of the obstacles are complex, or the gaps between the obstacles are not enough for the self-moving device to pass through, therefore, when the self-moving device performs the above-mentioned obstacle avoidance action, it cannot completely avoid the obstacle and may collide with the obstacle. At the moment of collision, the self-moving device stops moving and the speed of the walking motor is zero. At this time, the current of the walking motor will increase. When the main control module detects that the current of the walking motor becomes larger, it determines that the self-moving device has collided, that is, a collision event is detected. Therefore, the main control module will control the self-moving device to perform the following again. Fig.10The obstacle avoidance process shown is to bypass the obstacle and return to the original driving path.

[0095] In one embodiment, Fig.14 As shown, the method of the present application is further described below through a specific embodiment. In this embodiment, the actual distance between the mobile device and the obstacle is set to d, and the distance information transmitted by the ultrasonic ranging module to the main control module is d out , the deceleration threshold (i.e., the first threshold) of the self-mobile device is set to d th , the detection blind area of ​​the ultrasonic ranging module is d blind , and d blind ≤d th , when the obstacle is outside the blind area of ​​the ultrasonic ranging module, d out = d, that is, the distance detected by the ultrasonic ranging module is the same as the actual distance; when the obstacle is in the blind area of ​​the ultrasonic ranging module, d out =d blind That is, the distance detected by the ultrasonic ranging module is different from the actual distance. It can be understood that when the obstacle is in the blind area of ​​the ultrasonic ranging module, no matter whether the distance between the mobile device and the obstacle is close or far, the distance detected by the ultrasonic ranging module is d blind ,Since the ultrasonic ranging module has entered the working blind area at this time, it can no longer detect the exact distance.

[0096] In this embodiment, the deceleration threshold d is set th , and because of the ultrasonic ranging module's detection blind area d blind It is known that, therefore, the solution of this application includes the following steps:

[0097] Step 1401, continuously receiving obstacle distance information d detected by the ultrasonic ranging module out .

[0098] For the distance information transmitted by the ultrasonic ranging module to the main control module, the main control module can continuously receive the distance information transmitted by the ultrasonic ranging module. out , and perform different controls according to different distance information.

[0099] Step 1402, determine obstacle distance information d out Whether the deceleration threshold d is reached th .

[0100] Step 1403, control the mobile device to maintain the original driving path at a normal speed.

[0101] Step 1404, determine whether an obstacle is in the driving path of the mobile device.

[0102] Step 1405, controlling the mobile device to start decelerating.

[0103] For example, when the distance information transmitted by the ultrasonic ranging module is outside the deceleration threshold, that is, d out =d≥d th When d , it means that the obstacle is far away from the mobile device. At this time, step 1403 is executed to control the mobile device to maintain the original driving path at a normal speed. When the distance information transmitted by the ultrasonic ranging module reaches the deceleration threshold, that is, when d out =d th , then execute step 1404 to determine whether the obstacle is in the driving path of the self-moving device. If it is determined that the obstacle is in the driving path of the self-moving device, then execute step 1405 to control the self-moving device to start decelerating. If it is determined that the obstacle is not in the driving path of the self-moving device, then execute step 1403 to control the self-moving device to maintain the original driving path at a normal speed.

[0104] Step 1406, calculating the travel distance of the mobile device according to the feedback pulse of the travel motor.

[0105] Step 1407, determine whether the walking distance reaches a second threshold.

[0106] Step 1408, controlling the mobile device to perform obstacle avoidance actions to avoid obstacles.

[0107] The walking distance of the self-moving device is calculated based on the pulse information fed back by the walking motor of the self-moving device, so that the distance between the self-moving device and the obstacle is kept within an accurate range (the range is obtained by the deceleration threshold and the second threshold corresponding to the walking distance). When the walking distance reaches the set second threshold, step 1408 is executed to control the self-moving device to perform obstacle avoidance action to bypass the obstacle. When the walking distance does not reach the set second threshold, the walking distance of the self-moving device is continuously calculated. Among them, controlling the distance between the self-moving device and the obstacle to be kept within an accurate range can be set according to actual needs. For example, if the distance between the self-moving device and the obstacle is expected to be kept at about 2 cm, the deceleration threshold is known to be d. th , then the second threshold can be set to d th -2cm, so that the distance between the self-moving device and the obstacle can be kept within 2cm.

[0108] It is understandable that the specific obstacle avoidance action may be a preset plan, such as a preset detour direction, detour angle and distance of the obstacle avoidance. For example, if the self-moving device is an automatic lawn mower, since the lawn mower sweeps from left to right in a "bow" shape when working, and starts from the left side of the entire working area and moves to the right, the detour direction of the obstacle avoidance can be set to detour to the left, such as Fig.15As shown, and since each obstacle avoidance is performed by bypassing the obstacle from the left side, when the lawn mower passes the same obstacle from different directions along the working path, since the lawn mower bypasses from the left side, but relative to the obstacle, it bypasses from different sides of the obstacle, the working area around the obstacle can be mowed to achieve the maximum working area.

[0109] Specifically, the specific detour angle and distance for performing obstacle avoidance actions can be determined based on the predicted size of the obstacle. For example, for a scene where the obstacle is located directly in front of the machine, if the predicted radius of the obstacle is r, when the machine moves forward to a distance of 2cm from the obstacle, it retreats 2r-2cm, then rotates -45°, moves forward 2.828 times r, rotates 45°, moves forward 2r, rotates 45°, moves forward 2.828 times r, and then rotates -45° to return to the original driving path, where the rotation direction is always to the left front of the driving path. The path planning diagram can be referred to. Fig.11 .

[0110] It can be seen from this that when the self-moving device performs an obstacle avoidance action, it does not use the detection information of the ultrasonic ranging module as the only basis, but applies the detection information of the ultrasonic ranging module before starting to avoid the obstacle. Since the ultrasonic ranging module has a detection blind spot, in order to reduce the problem of too large a working blind spot of the self-moving device caused by the detection blind spot, this embodiment calculates the walking distance of the self-moving device through the feedback pulse of the walking motor when the ultrasonic ranging module enters the detection blind spot, thereby controlling the distance between the self-moving device and the obstacle within a more precise range, and performing an obstacle avoidance action to bypass the obstacle and return to the original driving path, thereby reducing the working blind spot of the self-moving device, so that the self-moving device can reach the maximum working area.

[0111] It should be understood that although Figure 1-15 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-15 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0112] In one embodiment, Fig.16As shown, an obstacle avoidance device for a self-moving device is provided, the obstacle avoidance device comprises: an obstacle distance acquisition module 1601, an obstacle judgment module 1602, a deceleration processing module 1603 and an obstacle avoidance control module 1604, wherein:

[0113] The obstacle distance acquisition module 1601 is used to obtain the obstacle distance detected by the ultrasonic ranging module;

[0114] The obstacle determination module 1602 is used to determine whether the obstacle is in the driving path of the mobile device if the currently acquired obstacle distance reaches a set first threshold;

[0115] The deceleration processing module 1603 is used to control the travel motor to decelerate and calculate the travel distance of the self-moving device if it is determined that the obstacle is in the travel path of the self-moving device;

[0116] The obstacle avoidance control module 1604 is used to control the self-moving device to perform obstacle avoidance actions to bypass obstacles and return to the driving path to continue walking when the walking distance of the self-moving device reaches a set second threshold.

[0117] In one embodiment, the obstacle judgment module 1602 is specifically used to: calculate the current forward distance of the mobile device relative to the historical moment based on the currently acquired obstacle distance and the obstacle distance acquired at the historical moment; if the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at the historical moment, it is determined that the obstacle is in the driving path of the mobile device.

[0118] In one embodiment, the obstacle judgment module 1602 is also used for: if the sum of the forward distance and the currently acquired obstacle distance does not match the obstacle distance acquired at a historical moment, then calculating the first angle between the distance between the ultrasonic ranging module and the obstacle and the forward direction of the self-moving device at the historical moment and the second angle between the line between the current position of the ultrasonic ranging module and the end point of the extended line of the edge of the self-moving device and the forward direction, wherein the length of the extended line of the edge of the self-moving device is the body length of the self-moving device; if the first angle is smaller than the second angle, it is determined that the obstacle is in the driving path of the self-moving device.

[0119] In one embodiment, the apparatus further comprises an obstacle position detection module for detecting the position of the obstacle relative to the self-moving device after determining that the obstacle is in the driving path of the self-moving device.

[0120] In one embodiment, the obstacle position detection module is specifically used to: when it is detected that the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at a historical moment, it is determined that the obstacle is directly in front of the driving path of the self-moving device; when it is detected that the first angle is smaller than the second angle, it is determined that the obstacle is in the side front of the driving path of the self-moving device.

[0121] In one embodiment, the walking distance is calculated based on the feedback information of the walking motor, and the feedback information is feedback pulse information. The deceleration processing module 1503 is specifically used to: obtain the pulse information fed back by the walking motor, wherein the pulse information includes the number of pulses; calculate the walking distance of the self-moving device based on the number of pulses and the configuration parameters of the self-moving device.

[0122] In one embodiment, the device further comprises a collision event detection module, which is used to control the self-moving device to perform obstacle avoidance action to bypass the obstacle and return to the driving path to continue moving if a collision event is detected between the self-moving device and an obstacle.

[0123] In one embodiment, the obstacle avoidance control module 1604 is specifically used to: control the self-moving device to stop moving forward and retreat a first set distance; control the self-moving device to rotate a first set angle and move forward a second set distance; control the self-moving device to rotate a second set angle and move forward a third set distance, wherein the second set angle is equal to the first set angle in magnitude and opposite in direction; control the self-moving device to rotate a third set angle and move forward a fourth set distance, wherein the fourth set distance is equal to the second set distance; control the self-moving device to rotate a fourth set angle to return to the driving path and continue walking, wherein the fourth set angle is opposite in direction to the third set angle.

[0124] In one embodiment, an obstacle avoidance system is provided. The obstacle avoidance system is applied to a self-moving device, specifically, Fig.17 As shown, the obstacle avoidance system includes: Fig.16 The obstacle avoidance device shown in the figure is communicatively connected with the walking motor and ultrasonic ranging module of the self-moving device. The ultrasonic ranging module is arranged at the front end of the walking direction of the self-moving device, and is used to detect the distance of obstacles in front of the self-moving device, and transmit the detected obstacle distance to the obstacle avoidance device. The obstacle avoidance device can also receive feedback pulses from the walking motor and control the speed of the walking motor.

[0125] For the specific definition of the obstacle avoidance device of the self-moving device, please refer to the definition of the obstacle avoidance method of the self-moving device above, which will not be repeated here. Each module in the above-mentioned obstacle avoidance device of the self-moving device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0126] In one embodiment, an obstacle avoidance device is provided, such as Fig.18 As shown, the obstacle avoidance device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the obstacle avoidance device is used to provide computing and control capabilities. The memory of the obstacle avoidance device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the obstacle avoidance device is used to store obstacle distance data. The network interface of the obstacle avoidance device is used to communicate with an external module (such as an ultrasonic ranging module and a walking motor of a self-moving device) through a network connection. When the computer program is executed by the processor, an obstacle avoidance method for a self-moving device is implemented.

[0127] Those skilled in the art will understand that Fig.18 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0128] In one embodiment, an obstacle avoidance device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0129] Get the obstacle distance detected by the ultrasonic ranging module;

[0130] If the currently acquired obstacle distance reaches the set first threshold, it is determined whether the obstacle is in the driving path of the self-moving device;

[0131] If it is determined that the obstacle is in the driving path of the self-moving device, the travel motor is controlled to decelerate and the travel distance of the self-moving device is calculated;

[0132] When the travel distance of the self-moving device reaches a set second threshold, the self-moving device is controlled to perform an obstacle avoidance action to bypass the obstacle and return to the travel path to continue traveling.

[0133] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the currently acquired obstacle distance and the obstacle distance acquired at the historical moment, the current forward distance of the self-moving device relative to the historical moment is calculated; if the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at the historical moment, it is determined that the obstacle is in the driving path of the self-moving device.

[0134] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if the sum of the forward distance and the currently acquired obstacle distance does not match the obstacle distance acquired at a historical moment, then the first angle between the distance between the ultrasonic ranging module and the obstacle and the forward direction of the self-moving device at the historical moment and the second angle between the line between the current position of the ultrasonic ranging module and the end point of the extended line of the edge of the self-moving device and the forward direction are calculated, wherein the length of the extended line of the edge of the self-moving device is the body length of the self-moving device; if the first angle is smaller than the second angle, it is determined that the obstacle is in the driving path of the self-moving device.

[0135] In one embodiment, the processor further implements the following steps when executing the computer program: if it is determined that an obstacle is in the driving path of the self-moving device, it also includes detecting the position of the obstacle relative to the self-moving device, and controlling the self-moving device to perform obstacle avoidance actions to bypass the obstacle based on the position of the obstacle relative to the self-moving device.

[0136] In one embodiment, the processor further implements the following steps when executing the computer program: when it is detected that the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at a historical moment, it is determined that the obstacle is directly in front of the driving path of the self-moving device; when it is detected that the first angle is smaller than the second angle, it is determined that the obstacle is to the side and front of the driving path of the self-moving device.

[0137] In one embodiment, the walking distance is calculated based on the feedback information of the walking motor, and the feedback information is feedback pulse information. When the processor executes the computer program, the following steps are also implemented: obtaining the pulse information fed back by the walking motor, wherein the pulse information includes the number of pulses; and calculating the walking distance of the self-moving device based on the number of pulses and the configuration parameters of the self-moving device.

[0138] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if a collision event is detected between the self-moving device and an obstacle, the self-moving device is controlled to perform an obstacle avoidance action to bypass the obstacle and return to the driving path to continue moving.

[0139] In one embodiment, the processor also implements the following steps when executing the computer program: controlling the self-moving device to stop moving forward and retreat a first set distance; controlling the self-moving device to rotate a first set angle and move forward a second set distance; controlling the self-moving device to rotate a second set angle and move forward a third set distance, wherein the second set angle is equal to the first set angle in magnitude and opposite in direction; controlling the self-moving device to rotate a third set angle and move forward a fourth set distance, wherein the fourth set distance is equal to the second set distance; controlling the self-moving device to rotate a fourth set angle to return to the driving path and continue moving, wherein the fourth set angle is opposite in direction to the third set angle.

[0140] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0141] Get the obstacle distance detected by the ultrasonic ranging module;

[0142] If the currently acquired obstacle distance reaches the set first threshold, it is determined whether the obstacle is in the driving path of the self-moving device;

[0143] If it is determined that the obstacle is in the driving path of the self-moving device, the travel motor is controlled to decelerate and the travel distance of the self-moving device is calculated;

[0144] When the travel distance of the self-moving device reaches a set second threshold, the self-moving device is controlled to perform an obstacle avoidance action to bypass the obstacle and return to the travel path to continue traveling.

[0145] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the currently acquired obstacle distance and the obstacle distance acquired at the historical moment, the current forward distance of the self-moving device relative to the historical moment is calculated; if the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at the historical moment, it is determined that the obstacle is in the driving path of the self-moving device.

[0146] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the sum of the forward distance and the currently acquired obstacle distance does not match the obstacle distance acquired at a historical moment, then the first angle between the distance between the ultrasonic ranging module and the obstacle and the forward direction of the self-moving device at the historical moment and the second angle between the line between the current position of the ultrasonic ranging module and the end point of the extended line of the edge of the self-moving device and the forward direction are calculated, wherein the length of the extended line of the edge of the self-moving device is the body length of the self-moving device; if the first angle is smaller than the second angle, it is determined that the obstacle is in the driving path of the self-moving device.

[0147] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if it is determined that an obstacle is in the driving path of the self-moving device, it also includes detecting the position of the obstacle relative to the self-moving device, and according to the position of the obstacle relative to the self-moving device, controlling the self-moving device to perform obstacle avoidance actions to bypass the obstacle.

[0148] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when it is detected that the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at a historical moment, it is determined that the obstacle is directly in front of the driving path of the self-moving device; when it is detected that the first angle is smaller than the second angle, it is determined that the obstacle is to the side and front of the driving path of the self-moving device.

[0149] In one embodiment, the walking distance is calculated based on the feedback information of the walking motor, and the feedback information is feedback pulse information. When the computer program is executed by the processor, the following steps are also implemented: obtaining the pulse information fed back by the walking motor, wherein the pulse information includes the number of pulses; and calculating the walking distance of the self-moving device based on the number of pulses and the configuration parameters of the self-moving device.

[0150] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if a collision event is detected between the self-moving device and an obstacle, the self-moving device is controlled to perform an obstacle avoidance action to bypass the obstacle and return to the driving path to continue moving.

[0151] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: controlling the self-moving device to stop moving forward and retreat a first set distance; controlling the self-moving device to rotate a first set angle and move forward a second set distance; controlling the self-moving device to rotate a second set angle and move forward a third set distance, wherein the second set angle is equal to the first set angle in magnitude and opposite in direction; controlling the self-moving device to rotate a third set angle and move forward a fourth set distance, wherein the fourth set distance is equal to the second set distance; controlling the self-moving device to rotate a fourth set angle to return to the driving path and continue moving, wherein the fourth set angle is opposite in direction to the third set angle.

[0152] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0153] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0154] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. An obstacle avoidance method for a self-moving device, characterized in that: The self-moving device comprises a main control module, a walking motor and an ultrasonic ranging module which are communicatively connected to the main control module, and the ultrasonic ranging module is arranged at the front end of the walking direction of the self-moving device, and the method is applied to the main control module; the method comprises: Obtaining the obstacle distance detected by the ultrasonic ranging module; If the currently acquired obstacle distance reaches a set first threshold, determining whether the obstacle is in the driving path of the self-moving device; If it is determined that the obstacle is in the driving path of the self-moving device, the travel motor is controlled to decelerate and the travel distance of the self-moving device is calculated; When the travel distance of the self-moving device reaches a set second threshold, the self-moving device is controlled to perform an obstacle avoidance action to bypass the obstacle and return to the travel path to continue walking; The determining whether an obstacle is in the driving path of the self-moving device includes: Calculate the current forward distance of the mobile device relative to the historical moment according to the currently acquired obstacle distance and the obstacle distance acquired at the historical moment; If the sum of the forward distance and the currently acquired obstacle distance does not match the obstacle distance acquired at a historical moment, then calculate the first angle between the distance between the ultrasonic ranging module and the obstacle and the forward direction of the self-moving device at the historical moment, and the second angle between the line between the current position of the ultrasonic ranging module and the end point of the extended edge line of the self-moving device and the forward direction, where the length of the extended edge line of the self-moving device is the body length of the self-moving device; If the first angle is smaller than the second angle, it is determined that the obstacle is in the driving path of the self-moving device.

2. The method according to claim 1, characterized in that The method further comprises: If the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at a historical moment, it is determined that the obstacle is in the driving path of the self-moving device.

3. The method according to claim 1, characterized in that After determining that the obstacle is in the driving path of the self-moving device, the method further includes: Detecting a position of the obstacle relative to the self-moving device; The controlling the self-moving device to perform an obstacle avoidance action to avoid the obstacle includes: According to the position of the obstacle relative to the self-moving device, the self-moving device is controlled to perform an obstacle avoidance action to bypass the obstacle.

4. The method according to claim 3, characterized in that The detecting the position of the obstacle relative to the self-moving device comprises: When it is detected that the sum of the forward distance and the currently acquired obstacle distance matches the obstacle distance acquired at a historical moment, it is determined that the obstacle is directly in front of the driving path of the self-moving device; When it is detected that the first angle is smaller than the second angle, it is determined that the obstacle is located in front of the side of the driving path of the self-moving device.

5. The method according to claim 1, characterized in that The walking distance is calculated based on the feedback information of the walking motor, and the feedback information is the feedback pulse information; The calculating the travel distance of the self-moving device includes: Acquire pulse information fed back by the walking motor, wherein the pulse information includes the number of pulses; The travel distance of the self-moving device is calculated according to the number of pulses and the configuration parameters of the self-moving device.

6. The method according to claim 1, characterized in that The method further comprises: If a collision event is detected between the self-moving device and the obstacle, the self-moving device is controlled to perform an obstacle avoidance action to bypass the obstacle and return to the driving path to continue moving.

7. The method according to any one of claims 1 to 6, characterized in that: The controlling the self-moving device to perform an obstacle avoidance action to bypass the obstacle and return to the driving path to continue walking includes: Controlling the self-moving device to stop moving forward and retreat a first set distance; Controlling the self-moving device to rotate a first set angle and move forward a second set distance; Controlling the self-moving device to rotate a second set angle and move forward a third set distance, wherein the second set angle is equal to the first set angle in magnitude and opposite in direction; Controlling the self-moving device to rotate a third set angle and move forward a fourth set distance, wherein the fourth set distance is equal to the second set distance; The self-moving device is controlled to rotate to a fourth set angle to return to the driving path and continue walking, and the fourth set angle is opposite to the direction of the third set angle.

8. An obstacle avoidance device for a self-moving device, characterized in that: The self-moving device comprises a main control module, a walking motor and an ultrasonic ranging module which are communicatively connected to the main control module, the ultrasonic ranging module is arranged at the front end of the walking direction of the self-moving device, and the obstacle avoidance device is applied to the main control module; the obstacle avoidance device comprises: An obstacle distance acquisition module, used to acquire the obstacle distance detected by the ultrasonic ranging module; An obstacle judgment module, configured to judge whether an obstacle is in the driving path of the self-moving device if the currently acquired obstacle distance reaches a set first threshold; A deceleration processing module, for controlling the travel motor to decelerate if it is determined that the obstacle is in the travel path of the self-moving device, and calculating the travel distance of the self-moving device; An obstacle avoidance control module, configured to control the self-moving device to perform an obstacle avoidance action to bypass the obstacle and return to the driving path to continue walking when the walking distance of the self-moving device reaches a set second threshold; The obstacle judgment module is also used for: Calculate the current forward distance of the mobile device relative to the historical moment according to the currently acquired obstacle distance and the obstacle distance acquired at the historical moment; If the sum of the forward distance and the currently acquired obstacle distance does not match the obstacle distance acquired at a historical moment, then calculate the first angle between the distance between the ultrasonic ranging module and the obstacle and the forward direction of the self-moving device at the historical moment, and the second angle between the line between the current position of the ultrasonic ranging module and the end point of the extended edge line of the self-moving device and the forward direction, where the length of the extended edge line of the self-moving device is the body length of the self-moving device; If the first angle is smaller than the second angle, it is determined that the obstacle is in the driving path of the self-moving device.

9. An obstacle avoidance system, characterized in that: The obstacle avoidance system is applied to a self-moving device, including the obstacle avoidance device as claimed in claim 8, a walking motor and an ultrasonic ranging module, the obstacle avoidance device is communicatively connected with the walking motor and the ultrasonic ranging module of the self-moving device, and the ultrasonic ranging module is arranged at the front end of the walking direction of the self-moving device.

10. An obstacle avoidance device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.