Collision prediction method, self-moving device, and storage medium
Patent Information
- Application Number
- PCT/CN2026/075379
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-02-28
- Filing Date
- 2026-01-28
- Publication Date
- 2026-09-03
Smart Images

Figure CN2026075379_03092026_PF_FP_ABST
Abstract
Description
Collision prediction methods, self-moving devices and storage media
[0001] This application claims priority to Chinese Patent Application No. 202510246242.7, filed on February 28, 2025, entitled "Collision Prediction Method, Self-Moving Device and Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of self-moving device technology, and in particular to a collision prediction method, a self-moving device, and a storage medium. Background Technology
[0003] With the continuous advancement of technology and the rapid development of artificial intelligence, using self-moving equipment (such as lawnmowers, cleaners, cruisers, etc.) for operations can greatly improve work efficiency.
[0004] To ensure the safety and efficiency of self-moving devices, accurate collision prediction for obstacle avoidance is crucial. Related technologies primarily rely on sensors to measure the distance between the self-moving device and obstacles to determine the presence of collision risk. Additionally, obstacle information can be obtained based on pre-built maps to further assess the collision risk between the self-moving device and obstacles.
[0005] However, due to factors such as the detection accuracy of sensor technology, the complexity of detection algorithms, and the need for real-time map updates, related technologies often struggle to balance the accuracy and real-time performance of collision prediction. Summary of the Invention
[0006] In view of the above, it is necessary to provide a collision prediction method, a self-moving device, and a storage medium that can solve the technical problem of difficulty in accurately and in real time performing collision prediction.
[0007] On one hand, this application provides a collision prediction method applied to a self-moving device. The method includes: detecting obstacles in the direction of movement using sensors during movement to obtain detection data, wherein the detection data is used to indicate whether there are obstacles in the direction of movement, and if there are obstacles in the direction of movement, the detection data includes the distance between the self-moving device and the obstacle. When obtaining each frame of target detection data, the following steps are performed: updating the collision risk value according to the target detection data of the current frame, updating the collision trigger threshold according to the target detection data of the current frame, and determining the collision prediction result of the self-moving device for the obstacle based on the comparison result between the updated collision risk value and the updated collision trigger threshold.
[0008] On the other hand, this application provides a self-moving device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the self-moving device implements the collision prediction method.
[0009] On the other hand, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor in a self-moving device, implements the collision prediction method.
[0010] In the collision prediction method of this embodiment, since the detection data includes the distance between the mobile device and the obstacle, the collision risk value is updated based on the target detection data of the current frame, so that the updated collision risk value can accurately reflect the collision risk of the mobile device to the obstacle. Considering that the closer the mobile device is to the obstacle, the higher the sensitivity requirement for collision prediction, the collision trigger threshold is updated based on the target detection data of the current frame, so that the updated collision trigger threshold can reflect the sensitivity required for collision prediction when the mobile device is currently in position. Therefore, based on the comparison between the updated collision risk value and the updated collision trigger threshold, the collision prediction result of the mobile device to the obstacle can be accurately determined. In this way, not only can the sensitivity of collision prediction be controlled, but the accuracy of the collision prediction result can also be improved, thereby enabling real-time and accurate determination of whether there is a collision risk between the mobile device and the obstacle. Attached Figure Description
[0011] Figure 1 is a flowchart of a collision prediction method provided in an embodiment of this application.
[0012] Figure 2 is a schematic diagram of obstacle detection provided in an embodiment of this application.
[0013] Figure 3 is a schematic diagram of the structure of a self-moving device provided in an embodiment of this application. Detailed Implementation
[0014] To make the objectives, technical solutions, and advantages of this application clearer, the application will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0015] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence.
[0016] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0017] With the continuous advancement of technology and the rapid development of artificial intelligence, utilizing self-moving devices (such as lawnmowers, cleaners, and cruisers) can greatly improve work efficiency. To ensure the safety and efficiency of self-moving devices, accurate collision prediction for obstacle avoidance is crucial. Related technologies primarily rely on sensors to measure the distance between the self-moving device and obstacles to determine the existence of collision risks. Additionally, obstacle information can be obtained based on pre-built maps to further assess the collision risk between the self-moving device and obstacles.
[0018] However, due to factors such as the detection accuracy of sensor technology, the complexity of detection algorithms, and the need for real-time map updates, related technologies often struggle to balance the accuracy and real-time performance of collision prediction.
[0019] To address the aforementioned technical problems, this application provides a collision prediction method that can accurately predict collisions between a self-moving device and obstacles.
[0020] The collision prediction method provided in this application can be applied to one or more self-moving devices, which can be lawnmowers, cleaning robots, de-icing robots, and cruise robots, etc. This application does not limit the specific type of self-moving device.
[0021] In other embodiments of this application, the collision prediction method provided in this application can be applied to one or more electronic devices, wherein the electronic devices can be computers, tablets, mobile phones, servers, cloud servers, personal digital assistants (PDAs), game consoles, interactive network television (IPTV), smart wearable devices, etc. This application does not limit the type of electronic device.
[0022] To more clearly illustrate the collision prediction method provided in the embodiments of this application, the following will provide an example of a collision prediction method applied to a self-moving device.
[0023] Figure 1 shows a flowchart of a collision prediction method provided in an embodiment of this application. The order of the steps in the flowchart can be adjusted according to different needs, and some steps can be omitted. The method is applied to self-moving devices, such as the self-moving device 1 shown in Figure 3.
[0024] S11, during the movement, the sensor detects obstacles in the direction of movement and obtains detection data.
[0025] In some embodiments of this application, the sensors include, but are not limited to, cameras and radar. For example, the camera may be a monocular camera or a multi-view camera, and the radar may be a lidar. This application does not limit the specific types of cameras and radars. The sensors may be located at the front of the self-moving device to facilitate obstacle detection of the self-moving device's direction of movement or path.
[0026] The detection data can be used to indicate whether there are obstacles in the direction of movement of the self-moving device. If there are obstacles in the direction of movement, the detection data can include information such as the distance between the self-moving device and the obstacle, the type of obstacle, and the number of obstacles.
[0027] For example, if the sensor is a binocular camera, during movement, the self-moving device can capture environmental images in the direction of movement or along the path of movement using the binocular camera. Based on the environmental images, the device can obtain scene depth information using principles such as parallax and triangulation. Based on the scene depth information, the device can determine whether there are obstacles in the direction of movement or along the path of movement, and obtain detection data such as the type of obstacle and the distance between the self-moving device and the obstacle.
[0028] For example, if the sensor includes a lidar, during movement, the self-moving device can scan its direction of movement or path by emitting laser light to obtain point cloud data. This point cloud data can then be clustered using algorithms such as K-Means clustering and Density-Based Spatial Clustering of Applications with Noise (DBSCAN) to determine if any point cloud clusters belong to obstacles, thereby enabling obstacle detection. Furthermore, the self-moving device can determine the distance to obstacles based on the time difference between the emitted and reflected laser light, utilizing the Time of Flight (TOF) principle.
[0029] Figure 2 is a schematic diagram of obstacle detection provided in an embodiment of this application. In Figure 2, the sensor is located at the front of the self-moving device and is capable of measuring the distance between the self-moving device and the obstacle.
[0030] Considering that the detection data may be inaccurate if the self-moving device is still in motion during the data determination process, in some embodiments, to reduce errors caused by the movement of the self-moving device, the self-moving device can adjust the detection data based on its travel speed and the sensor's detection parameters. Taking the distance between the self-moving device and an obstacle in the detection data as an example, the self-moving device can update the distance between itself and the obstacle based on its travel speed and the sensor's detection cycle to obtain an updated distance. The detection cycle can be the duration between two consecutive data collection points by the sensor.
[0031] For example, the updated distance can be calculated using the following formula (1): d″=d ′ -T*v; (1)
[0032] Where d″ represents the updated distance, d′ represents the distance between the self-moving device and the obstacle as measured by the sensor, T represents the sensor's detection period, and v represents the self-moving device's speed.
[0033] In some embodiments, in order to accurately predict the collision of the self-moving device with obstacles, during the obstacle detection process, when each frame of detection data is obtained, the self-moving device can determine whether the current frame detection data is qualified according to a preset rule. If the current frame detection data is qualified, the self-moving device can determine that the current frame detection data is the target detection data, so as to perform collision prediction based on the target detection data.
[0034] The preset rules can be customized. For example, when the current frame detection data includes the distance between the mobile device and the obstacle, if the distance between the mobile device and the obstacle is within the detection range of the sensor, the current frame detection data can be determined to be qualified.
[0035] In this embodiment, using qualified detection data as target detection data can ensure the quality of target detection data, so as to accurately predict the collision situation of the self-moving device with obstacles.
[0036] In other embodiments, the self-moving device can directly determine each frame of detection data obtained as target detection data.
[0037] When obtaining target detection data for each frame, the self-moving device can perform the following steps S12 to S14.
[0038] S12, Update the collision risk value based on the target detection data of the current frame.
[0039] In some embodiments of this application, the collision risk value can reflect the collision risk of the self-moving device with an obstacle. For example, the higher the collision risk value, the greater the probability of the self-moving device colliding with the obstacle; the lower the collision risk value, the less likely the self-moving device will collide with the obstacle.
[0040] The collision risk value can be obtained by recording a counter in the self-moving device. For example, the collision risk value can be adjusted by changing the counter's count value.
[0041] In some embodiments of this application, the self-moving device updates the collision risk value based on the target detection data of the current frame, including: if it is determined based on the target detection data of the current frame that there is no obstacle in the direction of movement, then the collision risk value is reduced by a preset step size; if it is determined based on the target detection data of the current frame that there is an obstacle in the direction of movement, and the distance between the self-moving device and the obstacle is greater than or equal to the safe distance, then the collision risk value is reduced by a preset step size; if it is determined based on the target detection data of the current frame that there is an obstacle in the direction of movement, and the distance between the self-moving device and the obstacle is less than the safe distance, then the collision risk value is increased by a preset step size.
[0042] The distance between the self-moving device and the obstacle can be a distance measured by sensors, or a distance updated based on the self-moving device's speed and sensor detection parameters. The preset step size can be customized, and this application does not impose any restrictions on it. For example, the preset step size can be 1. For instance, if it is determined that there is no obstacle in the direction of movement, or if there is an obstacle in the direction of movement and the distance between the self-moving device and the obstacle is greater than or equal to the safe distance, the self-moving device will subtract 1 from the collision risk value; if there is an obstacle in the direction of movement and the distance between the self-moving device and the obstacle is less than the safe distance, the self-moving device can add 1 to the collision risk value.
[0043] For example, the self-moving device determines a safe distance based on its driving speed and a preset first linear model. The first linear model includes variables corresponding to the driving speed and the safe distance, a first gain value, and an initial safe distance. This model indicates how the safe distance is calculated based on the self-moving device's driving speed, using the first gain value and the initial safe distance. Therefore, the self-moving device can use the first linear model to calculate the safe distance based on its driving speed.
[0044] For example, the safe distance can be calculated using the following formula (2): Ds=G1*v+d0; (2)
[0045] Where Ds represents the safe distance, G1 represents the first gain value, v represents the speed of the self-moving device, and d0 represents the initial safe distance.
[0046] In some embodiments, to ensure the reasonableness of the collision risk value, the self-moving device can configure an upper limit for increasing the collision risk value and a lower limit for decreasing it. For example, the self-moving device can set the collision risk value to be in the range of [0, 100].
[0047] In this embodiment, since the detection data includes the distance between the self-moving device and the obstacle, the collision risk value is updated based on the target detection data of the current frame, so that the updated collision risk value can accurately reflect the collision risk of the self-moving device to the obstacle. Considering that the greater the driving speed of the self-moving device, the longer the time required for the self-moving device to decelerate, and the greater the required safety distance, the safety distance can be linearly increased based on the driving speed of the self-moving device using the first linear model, thereby allowing more reaction time for the self-moving device.
[0048] The above-described method of updating the collision risk value based on the distance between the mobile device and obstacles is merely an example of updating the collision risk value based on the target detection data of the current frame, and is not limited to this in practical applications. For example, when the target detection data of the current frame includes the distance between the mobile device and obstacles and the number of obstacles, if it is determined from the target detection data of the current frame that there is an obstacle in the direction of movement, the distance between the mobile device and the obstacle is greater than or equal to the safe distance, and the number of obstacles is less than a preset threshold, then the collision risk value is decreased by a preset step size. If it is determined from the target detection data of the current frame that there is an obstacle in the direction of movement, the distance between the mobile device and the obstacle is less than the safe distance, and the number of obstacles is greater than or equal to the preset threshold, then the collision risk value is increased by a preset step size. The preset threshold can be customized, and this application does not impose any restrictions on it. For example, the preset threshold can be one or two.
[0049] In other embodiments of this application, the self-moving device can be configured with preset upper and lower threshold values corresponding to the collision risk value, so as to control the driving speed of the self-moving device based on the comparison result between the updated collision risk value and the preset upper and lower threshold values. The preset upper and lower threshold values can be customized, and this application does not impose any restrictions on them. For example, if the preset upper threshold is 100 and the preset lower threshold is 20.
[0050] The comparison results between the updated collision risk value and the preset upper and lower thresholds can include the updated collision risk value being less than the preset lower threshold, or the updated collision risk value being between the preset lower and upper thresholds.
[0051] For example, the self-moving device controls its driving speed based on the comparison result between the updated collision risk value and the preset upper limit threshold and the preset lower limit threshold. This includes: if the updated collision risk value is less than the preset lower limit threshold, the self-moving device can control its driving speed according to the first speed; if the updated collision risk value is between the preset lower limit threshold and the preset upper limit threshold, the self-moving device can control its driving speed according to the second speed.
[0052] The first speed is greater than the second speed. The first speed and the second speed can be customized, and this application does not impose any restrictions on them.
[0053] Considering that obstacles may be dynamic, in this embodiment, when the updated collision risk value is less than a preset lower threshold, the self-moving device is controlled to travel at a higher first speed; when the updated collision risk value is between the preset lower and upper thresholds, the self-moving device is controlled to travel at a lower first speed. This allows for adaptive adjustment of the self-moving device's speed based on the dynamic changes of the obstacle. This maintains a certain lag inertial filtering for obstacle collision prediction even when the self-moving device's speed is low and the obstacle's dynamic changes are minimal, reducing frequent warnings caused by small short-term changes and avoiding unstable obstacle detection due to sensor noise or improper threshold settings. Furthermore, controlling the self-moving device's speed using preset upper and lower thresholds allows the device to continue decelerating even when an obstacle appears within the sensor's blind zone boundary, thus reducing the potential collision risk caused by a brief loss of obstacle information.
[0054] S13, Update the collision trigger threshold based on the target detection data of the current frame.
[0055] In some embodiments of this application, the collision trigger threshold can be used to reflect the sensitivity required for collision prediction based on the location of the self-moving device, wherein the sensitivity can represent the minimum collision risk value corresponding to a collision between the self-moving device and an obstacle.
[0056] In some embodiments of this application, updating the collision trigger threshold based on the target detection data of the current frame includes: if it is determined from the target detection data of the current frame that there is no obstacle in the direction of movement, then the current collision trigger threshold remains unchanged; if it is determined from the target detection data of the current frame that there is an obstacle in the direction of movement, then the updated collision trigger threshold is determined based on the distance between the self-moving device and the obstacle and a preset second linear model.
[0057] The distance between the self-moving device and the obstacle can be a distance measured by sensors, or an updated distance based on the self-moving device's speed and sensor detection parameters. The second linear model includes variables corresponding to the distance between the self-moving device and the obstacle, variables corresponding to the updated collision trigger threshold, a second gain value, and an initial trigger threshold. It indicates how to calculate the updated collision trigger threshold based on the distance between the self-moving device and the obstacle, using the second gain value and the initial trigger threshold. Therefore, the self-moving device can use the second linear model to calculate the distance between itself and the obstacle to obtain the updated collision trigger threshold.
[0058] For example, the updated collision trigger threshold can be calculated using the following formula (3): K=G2*d+k0; (3)
[0059] Where K represents the updated collision trigger threshold, G2 represents the second gain value, d represents the distance between the self-moving device and the obstacle as measured by the sensor or the distance after updating the distance measured by the sensor, and k0 represents the initial trigger threshold.
[0060] Considering that the closer the self-moving device is to the obstacle, the higher the sensitivity requirement for collision prediction, in this embodiment, based on the target detection data of the current frame, the second linear model can linearly increase the collision trigger threshold, so that the updated collision trigger threshold can accurately reflect the sensitivity required for collision prediction when the self-moving device is currently in position. This satisfies the requirement that the closer the self-moving device is to the obstacle, the higher the sensitivity of collision prediction, and achieves accurate control of the sensitivity of collision prediction.
[0061] The above-described method of updating the collision trigger threshold based on the distance between the mobile device and the obstacle is merely an example of updating the collision trigger threshold based on the target detection data of the current frame, and is not limited to this in practical applications. For example, when the target detection data of the current frame includes the distance between the mobile device and the obstacle and the number of obstacles, if the number of obstacles is greater than or equal to a preset threshold, the distance between the mobile device and the obstacle is calculated using a larger second gain value in formula (3) to obtain the updated collision trigger threshold. If the number of obstacles is less than the preset threshold, the distance between the mobile device and the obstacle is calculated using a smaller second gain value in formula (3) to obtain the updated collision trigger threshold.
[0062] S14. Based on the comparison between the updated collision risk value and the updated collision trigger threshold, determine the collision prediction result of the self-moving device for the obstacle.
[0063] In some embodiments of this application, the self-moving device determines the collision prediction result of the self-moving device against the obstacle based on the comparison result between the updated collision risk value and the updated collision trigger threshold, including: if the updated collision risk value is greater than the updated collision trigger threshold, the collision prediction result is determined to be that the self-moving device has the possibility of colliding with the obstacle; if the updated collision risk value is less than or equal to the updated collision trigger threshold, the collision prediction result is determined to be that the self-moving device will not collide with the obstacle.
[0064] In this embodiment, since the collision trigger threshold represents the minimum collision risk value corresponding to the collision between the self-moving device and the obstacle at the location of the self-moving device, it is determined that the self-moving device has the possibility of colliding with the obstacle when the updated collision risk value is greater than the updated collision trigger threshold, and it is determined that the self-moving device will not collide with the obstacle when the updated collision risk value is less than or equal to the updated collision trigger threshold. This ensures the accuracy of the collision prediction results and enables accurate prediction of the collision situation between the self-moving device and the obstacle.
[0065] In the collision prediction method of this embodiment, since the detection data includes the distance between the mobile device and the obstacle, the collision risk value is updated based on the target detection data of the current frame, so that the updated collision risk value can accurately reflect the collision risk of the mobile device to the obstacle. Considering that the closer the mobile device is to the obstacle, the higher the sensitivity requirement for collision prediction, the collision trigger threshold is updated based on the target detection data of the current frame, so that the updated collision trigger threshold can reflect the sensitivity required for collision prediction when the mobile device is currently in position. Therefore, based on the comparison between the updated collision risk value and the updated collision trigger threshold, the collision prediction result of the mobile device to the obstacle can be accurately determined. In this way, not only can the sensitivity of collision prediction be controlled, but the accuracy of the collision prediction result can also be improved, thereby enabling real-time and accurate determination of whether there is a collision risk between the mobile device and the obstacle.
[0066] For example, Figure 3 shows a schematic diagram of the structure of a self-moving device provided in an embodiment of this application. In Figure 3, the self-moving device 1 includes a main body and a memory 11, a processor 12, a power supply 13, a sensor 14, a working mechanism 15, a communication module 16, a positioning module 17, a drive wheel 18, and a bus 19 disposed on the main body. The processor 12 is coupled to the memory 11, the power supply 13, the sensor 14, the working mechanism 15, the communication module 16, the positioning module 17, and the drive wheel 18 via the bus 19.
[0067] Memory 11 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM). The RAM can be directly read and written by the processor 12, and can be used to store executable programs (e.g., machine instructions) of the operating system or other running programs, as well as user and application data. The RAM may include static random-access memory (SRAM), dynamic random-access memory (DRAM), synchronous dynamic random-access memory (SDRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM), etc.
[0068] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 12. Non-volatile memory can include disk storage devices and flash memory.
[0069] The memory 11 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 12. The one or more computer programs include multiple instructions that, when executed by the processor 103, can implement a collision prediction method executed on the self-moving device 1.
[0070] In other embodiments, the self-moving device 1 further includes an external memory interface for connecting to an external memory to expand the storage capacity of the self-moving device 1.
[0071] Processor 12 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0072] The processor 12 provides computing and control capabilities, for example, the processor 12 is used to execute computer programs stored in the memory 11 to implement the collision prediction method described above.
[0073] The power source 13 is used to power the self-moving device. In one embodiment of this application, the power source 13 may include any one or more power supply devices of the type such as a battery, a fuel generator, a solar power generation module, or a wind power generation module.
[0074] Sensor 14 is used to acquire information for the self-moving device 1, such as environmental information and movement information of the self-moving device 1. In one embodiment of this application, sensor 14 may include one or more sensors of the type such as lidar, camera, infrared sensor, encoder, etc.
[0075] The working mechanism 15 is used to perform corresponding work tasks, such as mowing, de-icing, patrolling, sweeping, and spraying pesticides. In some embodiments of this application, the working mechanism 15 may include a motor, a transmission mechanism, and a blade disc. When the self-moving device is a lawnmower, the motor can drive the blade disc to rotate through the transmission mechanism to achieve the mowing function. The motor can also control the movement of the blades to adjust the mowing height and the mowing area.
[0076] The communication module 16 is used to enable communication between the self-moving device and other devices. In one embodiment of this application, the communication module 16 can interact with other devices via wired and / or wireless communication. The aforementioned wireless communication may include one or more combinations of communication methods such as Bluetooth communication, Wi-Fi communication, and Near Field Communication (NFC).
[0077] The positioning module 17 is used to determine the location of the self-moving device. In some embodiments of this application, the positioning module 17 may include one or more of the following types of positioning modules: Global Positioning System (GPS), inertial navigation system, real-time kinematic (RTK) carrier phase differential system, etc.
[0078] The drive wheel 18 is used to enable movement of the self-moving device. In some embodiments of this application, the drive wheel 18 can realize the movement function of the self-moving device according to the control of the processor 12. In some embodiments of this application, the drive wheel 18 may include a left drive wheel and a right drive wheel.
[0079] Bus 19 is used at least to provide a channel for communication between the memory 11, processor 12, power supply 13, sensor 14, working mechanism 15, communication module 16, positioning module 17, and drive wheel 18 in the self-moving device 1.
[0080] In other embodiments of this application, the self-moving device 1 may further include a collision avoidance section and a steering assembly. The collision avoidance section can be used to prevent the drive wheels 18 from colliding with obstacles or the like in front of the self-moving device. The steering assembly can be used to adjust the driving direction of the drive wheels 18.
[0081] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the self-moving device 1. In other embodiments of this application, the self-moving device 1 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0082] This application also provides a computer-readable storage medium storing a computer program, which includes program instructions. When the program instructions are executed, the method implemented can refer to the methods in the above embodiments of this application.
[0083] The computer-readable storage medium can be the internal memory of the self-movable device or electronic device described in the above embodiments, such as a hard disk or memory of the self-movable device or electronic device. The computer-readable storage medium can also be an external storage device of the self-movable device or electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the self-movable device or electronic device.
[0084] In some embodiments, a computer-readable storage medium may include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, etc.; and the stored data area may store data created based on the use of a self-moving device or electronic device, etc.
[0085] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0086] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0087] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A collision prediction method applied to self-moving devices, wherein, The method includes: During movement, sensors detect obstacles in the direction of movement to obtain detection data. The detection data is used to indicate whether there are obstacles in the direction of movement. If there are obstacles in the direction of movement, the detection data includes the distance between the self-moving device and the obstacle. Upon obtaining target detection data for each frame, the following steps are performed: Update the collision risk value based on the target detection data in the current frame; Update the collision trigger threshold based on the target detection data of the current frame; The collision prediction result of the self-moving device for the obstacle is determined based on the comparison between the updated collision risk value and the updated collision trigger threshold.
2. The collision prediction method as described in claim 1, wherein, The method further includes: The distance between the self-moving device and the obstacle is updated based on the driving speed of the self-moving device and the detection cycle of the sensor.
3. The collision prediction method as described in claim 1 or 2, wherein, The step of updating the collision risk value based on the target detection data of the current frame includes: If it is determined from the target detection data of the current frame that there are no obstacles in the direction of movement, then the collision risk value is reduced; If, based on the target detection data of the current frame, it is determined that there is an obstacle in the direction of movement, and the distance between the self-moving device and the obstacle is greater than or equal to the safe distance, then the collision risk value is reduced. If, based on the target detection data of the current frame, it is determined that there is an obstacle in the direction of movement, and the distance between the self-moving device and the obstacle is less than the safe distance, then the collision risk value is increased.
4. The collision prediction method as described in claim 3, wherein, The methods for determining the safe distance include: The safe distance is determined based on the travel speed of the self-moving device and a preset first linear model, wherein the first linear model indicates that the safe distance is calculated based on the travel speed, using a first gain value and an initial safe distance.
5. The collision prediction method as described in claim 1 or 2, wherein, The step of updating the collision trigger threshold based on the target detection data of the current frame includes: If it is determined from the target detection data of the current frame that there are no obstacles in the direction of movement, then the current collision trigger threshold remains unchanged; If an obstacle is determined to exist in the direction of movement based on the target detection data of the current frame, the updated collision trigger threshold is determined based on the distance between the self-moving device and the obstacle and a preset second linear model, wherein the second linear model indicates that the updated collision trigger threshold is calculated based on the distance between the self-moving device and the obstacle, using a second gain value and an initial trigger threshold.
6. The collision prediction method as described in claim 1, wherein, The step of determining the collision prediction result of the self-moving device for the obstacle based on the comparison result between the updated collision risk value and the updated collision trigger threshold includes: If the updated collision risk value is greater than the updated collision trigger threshold, the collision prediction result is determined to be that the self-moving device has the possibility of colliding with the obstacle; If the updated collision risk value is less than or equal to the updated collision trigger threshold, the collision prediction result is determined to be that the self-moving device will not collide with the obstacle.
7. The collision prediction method as described in claim 1, wherein, The collision risk value is obtained by recording a counter in the self-moving device.
8. The collision prediction method as described in claim 1, wherein, The collision risk value has a corresponding preset upper limit threshold and a preset lower limit threshold, and the method further includes: The driving speed of the self-moving device is controlled based on the comparison results between the updated collision risk value and the preset upper limit threshold and the preset lower limit threshold.
9. The collision prediction method as described in claim 8, wherein, The step of controlling the driving speed of the self-moving device based on the comparison result between the updated collision risk value and the preset upper limit threshold and the preset lower limit threshold includes: If the updated collision risk value is less than the preset lower threshold, the self-moving device is controlled to drive according to the first speed. If the updated collision risk value is between the preset lower threshold and the preset upper threshold, the self-moving device is controlled to drive according to the second speed, wherein the first speed is greater than the second speed.
10. The collision prediction method as described in claim 1, wherein, The method further includes: Determine whether the detection data of the current frame is qualified; If the current frame detection data is qualified, the current frame detection data is determined to be the target detection data.
11. A self-moving device, wherein, The self-moving device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the self-moving device implements the collision prediction method as described in any one of claims 1 to 10.
12. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program that, when executed by a processor in a self-moving device, implements the collision prediction method as described in any one of claims 1 to 10.