Ultrasonic detection-based carpet avoidance method for robot

By using ultrasonic sensors to detect the carpet edge and calculate the fitted line, the cleaning robot can exit the carpet without turning around, solving the problem of discontinuous cleaning trajectory at the junction of carpet and hard floor, improving cleaning efficiency and avoiding the risk of carpet damage.

WO2026031803A1PCT designated stage Publication Date: 2026-02-12AMICRO SEMICONDUCTOR CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/102916
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-08
Filing Date
2025-06-24
Publication Date
2026-02-12

AI Technical Summary

Technical Problem

Cleaning robots have difficulty effectively avoiding carpets at the junction of carpets and hard floors, resulting in discontinuous cleaning paths, affecting cleaning efficiency, and increasing the risk of wet mops soiling carpets.

Method used

Ultrasonic sensors are used to detect the carpet edge. By calculating the edge fitting line and the robot's current walking direction, the target retreat distance and rotation angle are calculated, allowing the robot to exit the carpet without turning around and adjusting its walking direction to be parallel to the carpet edge, ensuring a continuous cleaning trajectory.

Benefits of technology

It improves the cleaning effect at the junction of carpet and hard floor, reduces the risk of wet mops soiling carpets, and reduces the problem of low efficiency of cleaning robots repeatedly covering carpets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025102916_12022026_PF_FP_ABST
    Figure CN2025102916_12022026_PF_FP_ABST
Patent Text Reader

Abstract

An ultrasonic detection-based carpet avoidance method for a robot, comprising: step 1, when a robot triggers, by means of an ultrasonic sensor, a case that a carpet is detected, obtaining a current trigger position, and then executing step 2; step 2, using the current trigger position and historical trigger positions to calculate an edge fitting line, so as to determine the position of a carpet edge currently crossed by the robot and the direction of the carpet edge, and then executing step 3; step 3, on the basis of the edge fitting line, a current moving direction of the robot, a preset safety distance and the radius of a robot body, calculating a target retreat distance, so that the robot moves the target retreat distance in a direction opposite to the current moving direction without turning around, and then exits the carpet to a preset avoidance position; and on the basis of the current moving direction of the robot and the edge fitting line, calculating a target rotation angle, so that the robot adjusts the current moving direction to be parallel to the direction of the carpet edge by rotating the target rotation angle.
Need to check novelty before this filing date? Find Prior Art

Description

Method for robot evading carpet based on ultrasonic detection TECHNICAL FIELD

[0001] The present application relates to the technical field of carpet recognition, and in particular to a method for robot evading carpet based on ultrasonic detection. BACKGROUND

[0002] The Chinese invention patent with patent application number CN202211238871.8 discloses a ground environment motion planning method based on ultrasonic waves. For a cleaning robot working in a ground environment with carpets, the cleaning robot divides multiple carpet partitions after traversing a whole hard ground area or walking along the boundary line of the carpet. Whether to traverse the carpet partition is determined according to the ratio of the area of the carpet partition to the area of the hard ground area. After the cleaning robot completes the traversal of the carpet partition for a predetermined time, the cleaning robot repositions to the current position of the cleaning robot by extracting edge position information, and then retreats from the carpet. When the cleaning robot returns to the hard ground area from the repositioned current position, the cleaning robot does not correct the cleaning trajectory parallel to the edge of the carpet, and cannot maintain the predetermined cleaning mode of the robot in the hard ground area.

[0003] In addition, the cleaning robot disclosed in the Chinese invention patent with patent application number CN202211238871.8 determines whether to traverse the carpet partition by calculating the area of the region. After traversing the carpet partition, the cleaning robot needs to calculate the cleaning time and exit the carpet after completing the traversal for a predetermined time (e.g., a standard cleaning time). However, for a cleaning robot equipped with a wet mop, it is necessary to accelerate the exit to the edge of the carpet area for cleaning. The cleaning robot equipped with a wet mop cannot bear the risk of the carpet being contaminated by the wet mop due to the continuous walking in the carpet partition for a predetermined time. SUMMARY

[0004] The present application discloses a method for robot evading carpet based on ultrasonic detection, which proposes the following technical solutions:

[0005] The method for robot to avoid carpet based on ultrasonic detection is applied to a robot equipped with ultrasonic sensors, and the method comprises the following steps: in step 1, when the robot detects the carpet through the ultrasonic sensors, the current trigger position is obtained; then step 2 is performed; in step 2, the edge fitting line is calculated by using the current trigger position and the historical trigger position, so as to determine the position of the carpet edge currently crossed by the robot and the trend of the carpet edge; then step 3 is performed; in step 3, the target retreat distance is calculated based on the edge fitting line, the current walking direction of the robot, the preset safety distance and the body radius of the robot, so that the robot walks in the opposite direction of the current walking direction by the target retreat distance without turning around, and then exits the carpet to the preset avoidance position; and the target rotation angle is calculated based on the current walking direction of the robot and the edge fitting line, so that the robot adjusts the current walking direction to be parallel to the trend of the carpet edge by rotating the target rotation angle.

[0006] In conclusion, the method for robot to avoid carpet based on ultrasonic detection can be applied to the robot after the carpet is placed on the robot, the current trigger position is obtained by triggering the detection of the carpet, the edge fitting line is calculated by using the current trigger position and the historical trigger position, the position and trend of the carpet are inferred based on the edge fitting line, and then the target retreat distance and the target rotation angle are calculated based on the edge fitting line, the current walking direction of the robot, the preset safety distance and the body radius of the robot, so that the robot moves from the carpet to the outside of the carpet edge and plans the subsequent motion trajectory outside the carpet edge, and the robot can maintain the established cleaning mode in the hard ground area.

[0007] When the robot is applied to a cleaning robot equipped with a wet mop, the pose parameters of the robot completely exiting the carpet are obtained by performing the aforementioned steps 1 to 3, including the target retreat distance and the target rotation angle, so that the robot walks in the opposite direction of the current walking direction by the target retreat distance without turning around, exits the carpet to the preset avoidance position, rotates the target rotation angle at the preset avoidance position to adjust the walking direction to be parallel to the trend of the carpet edge, and then walks in the direction parallel to the trend of the carpet edge, so as to correct the cleaning trajectory to be parallel to the carpet edge. Therefore, the cleaning effect at the junction of the carpet and other ground media can be improved, the risk of the wet mop staining the carpet can be reduced, and the problem of low coverage efficiency of the cleaning robot repeatedly entering and exiting the carpet can be solved. BRIEF DESCRIPTION OF DRAWINGS

[0008] Fig. 1 is a schematic diagram of the position layout of the ultrasonic sensor in the chassis of the robot according to an embodiment of the present application.

[0009] Fig. 2 is a schematic diagram of the application scenario of the robot entering the carpet from different directions according to an embodiment of the present application.

[0010] FIG. 3 is a schematic diagram of the coordinate relationship between the ultrasonic sensor and the center of the robot body according to an embodiment of the present application.

[0011] FIG. 4 is a schematic diagram of the robot triggering detection and fitting an edge fitting line on the carpet twice according to an embodiment of the present application.

[0012] FIG. 5 is a schematic diagram of the position relationship between the robot and the edge fitting line according to an embodiment of the present application.

[0013] FIG. 6 is a schematic diagram of the robot planning the direction and distance of exiting the carpet according to an embodiment of the present application.

[0014] FIG. 7 is a schematic diagram of the robot walking in a direction parallel to the edge of the carpet at the turning of the arch-shaped motion according to an embodiment of the present application.

[0015] FIG. 8 is a schematic diagram of the robot exiting the carpet and rotating into the carpet again during the cleaning along the edge of the carpet according to an embodiment of the present application.

[0016] FIG. 9 is a schematic diagram of the method for the robot to avoid the carpet based on ultrasonic detection according to an embodiment of the present application. DETAILED DESCRIPTION

[0017] The technical solutions in the embodiments of the present application will be described in detail below with reference to the accompanying drawings. The following embodiments and features in the embodiments can be combined with each other without conflict. In the present application, it should be understood that the terms "center", "intermediate position", "central axis", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like indicate the orientation or positional relationship shown in the drawings, and are only used to facilitate the description of the present application and simplify the description, and therefore cannot be understood as indicating or implying that the device or element must have a particular orientation or be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. If the terms "first", "second", "third" and the like appear in the embodiments, they are used to facilitate the differentiation of related features, and cannot be understood as indicating or implying their relative importance, order or number of technical features.

[0018] The carpet described in the present application is a broad concept, which can be understood as a floor material different from hard materials such as wood floor and ceramic tile. The output power of the roller brush motor or the driving wheel motor of the cleaning robot may change when the cleaning robot walks on the carpet, or the ground material is not suitable for the cleaning robot to clean in the mopping mode. Specifically, the carpet can be a short blanket, a long blanket, a plush pad, etc. The cleaning robot can be a robot with a cleaning mechanism and a mopping mechanism installed on the chassis. The robot involved in the present application can contact the cleaning surface with one of the cleaning mechanism or the mopping mechanism or simultaneously to clean the cleaning surface during the cleaning process. The mopping mechanism is generally used to clean hard floors such as floors and ceramic tiles. The water sprayed by the mopping mechanism during the cleaning process or the water accumulated in the mopping mechanism itself may wet or damage the carpet. Due to the difference between hard floor and carpet, even if the cleaning mechanism uses the same cleaning strategy, it may damage the carpet or cause damage to the cleaning robot.

[0019] Therefore, when the cleaning robot cleans in the indoor home environment, the cleaning robot goes back and forth between the carpet and the hard floor, which are two different soft and hard ground medium areas. Therefore, the carpet needs to be avoided by the cleaning robot during the autonomous planning of the mopping process. If the cleaning robot does not avoid the carpet, the risk of dirtying the carpet with a wet mop increases, and the continuity of the cleaning path and the cleaning efficiency are also affected.

[0020] One of the sensors that can currently stably identify carpets and have a high degree of industrialization is an ultrasonic sensor. The number of ultrasonic sensors installed on the chassis of a general cleaning robot is limited, and the detection range will be limited, which has the defect of a blind area. The cleaning robot will bypass the blind area region in the subsequent cleaning planning process, and the cleaning robot is prone to missing cleaning on hard floors. If applied to the carpet avoidance scene, the cleaning robot will miss cleaning the area around the carpet; if too many attempts are made to clean the carpet, the wet mop will dirty the carpet. Specifically, the distance size of the body of the cleaning robot entering the carpet is different. In order to avoid the carpet, the retreat distance of the cleaning robot is different; if the retreat distance of the cleaning robot is shortened, the cleaning robot cannot completely exit the carpet, and the subsequent cleaning action may have the risk of dirtying the carpet with a wet mop; if the retreat distance of the cleaning robot is too long, there is a risk of missing cleaning in the subsequent cleaning.

[0021] The present application discloses a method for robot to avoid carpet based on ultrasonic detection, which is applied to a robot with an ultrasonic sensor installed. The installation position of the ultrasonic sensor is placed on the left and / or right side of the universal wheel, as shown in Figure 1. In the position layout diagram of the chassis of the robot, the ultrasonic sensor is installed on the right side of the universal wheel, and the universal wheel is installed on the longitudinal axis of the body of the robot. The current walking direction is parallel to the longitudinal axis of the body, and the current walking direction points to the front side of the body of the robot.

[0022] In some embodiments, the ultrasonic sensor can continuously collect ultrasonic data of the detection plane area at intervals of 6ms, and the robot can convert the position coordinate information of the area detected by the ultrasonic sensor into the global map. The detection plane area generated by the ultrasonic sensor is formed by the ultrasonic transmission angle and the maximum detection distance, and is preferably a conical area range. The ultrasonic data carried by the measurement signal of the ultrasonic reflection signal return is the intensity of the ultrasonic reflection signal return, which includes the intensity of the ultrasonic signal reflected by the surface of the closest obstacle surface to the ultrasonic sensor in the conical area range. Generally, the intensity is represented by the level size, and the medium type of the surface can be distinguished according to the intensity of the ultrasonic signal.

[0023] Since the surface of the carpet is different from the floor (hard ground surface such as wood floor or tile), the carpet can be identified according to the ultrasonic data received by the ultrasonic sensor. In the exemplary embodiment, when the robot cleans the cleaning area along the cleaning path, the ultrasonic sensor emits an ultrasonic signal to the ground and receives the reflected signal to identify the carpet. When the robot drives from the hard ground to the carpet, the reflected ultrasonic signal changes, and the carpet can be identified accordingly. If the left and right drive wheels of the robot are on the hard ground and only the universal wheel climbs onto the carpet, the ultrasonic sensor can detect the carpet, and at this time, the grip of the robot is still good and there is no skidding phenomenon.

[0024] It should be noted that the robot will build a global map during walking. The global map is a global map containing environmental information drawn by the robot for the first time using various sensors (such as acceleration sensor, gyroscope, ultrasonic range finder, camera, single-line laser radar, etc.) carried by itself to search the walking environment area of each room, sense the position, shape and size of each room, and the position, shape and size of the detected obstacles, and calculate the pose information according to the related ranging information to draw a global map containing environmental information.

[0025] The method for avoiding carpet of the robot based on ultrasonic detection disclosed in the present application involves the steps as shown in FIG. 9, which includes:

[0026] Step 1, the robot obtains the current trigger position when the carpet is detected by the ultrasonic sensor trigger; then step 2 is executed. The trigger detection of step 1 is implemented in the process of the robot crossing the edge of the carpet and walking in the carpet and filtering the real-time received ground reflected ultrasonic data, if the carpet is detected, the position of the ultrasonic sensor on the ground is set as the current trigger position, which can also be understood as marking the installation position of the ultrasonic sensor (relative to the position of the body center) as the current trigger position; it is worth noting that step 1 detects the carpet by triggering, not detecting the carpet in real time according to the real-time received ground reflected ultrasonic data, but through a period of detection cycle for filtering and matching comparison.

[0027] The robot will identify the edge of the carpet when entering or exiting the carpet; specifically, it will distinguish whether the robot currently crosses the edge of the carpet or the distance between the installation position of the ultrasonic sensor and the crossed edge of the carpet is greater than the preset distance threshold according to the real-time received ground reflected ultrasonic data, and when the distance between the installation position of the ultrasonic sensor and the crossed edge of the carpet is greater than the preset distance threshold, the carpet is detected by triggering; or distinguish whether the robot currently crosses out of the edge of the carpet or the distance between the installation position of the ultrasonic sensor and the crossed edge of the carpet is greater than the preset distance threshold according to the real-time received ground reflected ultrasonic data, and when the distance between the installation position of the ultrasonic sensor and the crossed edge of the carpet is greater than the preset distance threshold, the hard ground is detected by resetting.

[0028] When the robot enters the carpet and triggers the detection of the carpet, it is considered as triggering ultrasonic detection, and the coordinates of the current installation position of the ultrasonic sensor are recorded as the coordinates of the current trigger position and marked in the map. Illustratively, as shown in FIG. 3, the robot will establish a map coordinate system during walking, the body center of the robot is the origin of the coordinate system, and the current walking direction of the robot (the body longitudinal axis direction) is the Y axis, and the coordinate axis perpendicular to the Y axis is the X axis. The robot real-time obtains the position of the body center and reflects it in the map, and according to the pre-set relative position relationship, the installation position of the ultrasonic sensor can be calculated, so as to obtain the coordinates of the current trigger position in the map to update the carpet information marked in the map. When the robot does not trigger the detection of the carpet and walks in the direction of exiting the carpet, until the robot resets the detection of the hard ground, which can be understood as the reset of the ultrasonic detection. The robot / ultrasonic sensor has completely exited the carpet.

[0029] Step 2, calculate the edge fitting line using the current trigger position and the historical trigger positions to determine the position of the carpet edge that the robot currently crosses and the direction of the carpet edge; then perform step 3; wherein the historical trigger positions can be updated by the current trigger position; step 2 calculates the edge fitting line based on the robot crossing the carpet edge from the hard floor, which can directly use a current trigger position and a historical trigger position to construct a straight line equation to represent the edge fitting line, or can use at least one current trigger position and at least one historical trigger position for straight line fitting processing to obtain the edge fitting line. Then the edge fitting line can be used to simulate the carpet edge that the robot currently crosses, and the position of the carpet edge that the robot currently crosses can be calculated based on the distance of the robot walking in the carpet after crossing the carpet edge, and the corresponding direction of the carpet edge is determined based on the direction of the historical trigger position pointing to the current trigger position, which is set according to the walking direction of the robot. Thus, the placement trend of the carpet relative to the robot and the coverage range boundary are determined, so that the robot can correct the movement trajectory parallel to the carpet edge when exiting the carpet regardless of the angle at which the robot enters the carpet.

[0030] Step 2, each time an edge fitting line is calculated, the robot has crossed into a carpet edge and exists a certain distance from the carpet edge. In some embodiments, the robot can distinguish between the carpet and other ground detection results when walking the certain distance. The other ground detection results can be the area that the robot has covered, and the other ground detection results include carpet candidate results or hard floor candidate results. Considering detection errors, the carpet candidate results can be carpet interior positions or carpet edge positions, and the true detection of the carpet is determined when the carpet is detected by the trigger, otherwise it is classified as a candidate result for carpet detection before the current trigger position; the hard floor candidate results can also be hard floor edge positions or hard floor interior positions, and the true detection of the hard floor is determined when the hard floor is detected by the reset, otherwise it is classified as a candidate result for hard floor detection before the robot completely enters the hard floor or the preset avoidance position. Equivalently, the trigger detection of the carpet and the reset detection of the hard floor can both start detecting adjacent areas from the same carpet edge, and start detecting from the carpet candidate results and the hard floor candidate results (which can be understood as candidate results detected at the boundary line), respectively. The carpet edge can be regarded as the boundary line between the carpet and the hard floor, and the trigger detection of the carpet and the reset detection of the hard floor improve the recognition accuracy of the carpet and the hard floor, respectively.

[0031] Step 3, based on the edge fitting line, the current walking direction of the robot, the pre-set safety distance and the body radius of the robot, the target retreat distance is calculated, so that the robot walks in the opposite direction of the current walking direction by the target retreat distance without turning around, and then exits the carpet to the pre-set avoidance position; in the case that the current walking direction is considered as the forward direction, walking in the opposite direction of the current walking direction by the target retreat distance is actually that the robot retreats by the target retreat distance and reaches the pre-set avoidance position; as can be seen from FIG. 5 and FIG. 6, according to the included angle between the edge fitting line and the current walking direction of the robot, the distance from the edge fitting line to the nearest carpet edge crossed by the robot along its current walking direction, the safety distance and the sum of the body radius of the robot are converted into an equivalent distance value in the current walking direction based on the triangular geometric relationship, which is used as the avoidance distance of the robot based on the edge fitting line, so that the robot completely exits the carpet from the edge fitting line to the hard ground; since the edge fitting line is a straight line associated with the coordinates calculated from the current trigger position (determined by the installation position of the ultrasonic sensor), the distance from the edge fitting line to the body center is converted, so that the target retreat distance required to be calculated in step 3 is considered as the actual retreat distance of the body center.

[0032] In the indoor environment where the present application is located, there is no increase or decrease in the carpet, and the carpet position does not move.

[0033] On the basis of the avoidance distance and its equivalent distance in the current walking direction being calculated, the ratio between the distance from the body center to the edge fitting line and the sine value of the included angle between the edge fitting line and the current walking direction of the robot is calculated first to obtain the body redundancy distance; in the process of moving the body center of the robot to drive the whole robot to exit the carpet, in order to let the body center of the robot move through the avoidance distance to drive the ultrasonic sensor not to detect the carpet, the equivalent distance is reduced by the body redundancy distance to obtain the target retreat distance. After the target retreat distance is planned in advance, the robot exits the carpet to the pre-set avoidance position by walking in the opposite direction of the current walking direction by the target retreat distance.

[0034] And step 3 calculates the target rotation angle based on the current walking direction of the robot and the edge fitting line, the included angle between the current walking direction of the robot and the edge fitting line is equal to the target rotation angle, so that the robot adjusts the current walking direction to be parallel to the corresponding carpet edge direction by rotating the target rotation angle; if the robot exits the carpet to the pre-set avoidance position, the robot adjusts the walking direction to be parallel to the corresponding carpet edge direction at the pre-set avoidance position, and then can adopt the carpet edge strategy to walk along the outside of the carpet edge.

[0035] In summary, the method for robot evading carpet based on ultrasonic detection provided in the application can be applied to the robot after the carpet is detected, the current trigger position is obtained by triggering the detection of the carpet, the edge fitting line is calculated by using the current trigger position and the historical trigger position, the placement position and the trend of the carpet are inferred based on this, and then the target retreat distance and the target rotation angle are calculated based on the edge fitting line, the current walking direction of the robot, the pre-set safety distance and the body radius of the robot, so as to facilitate the robot to move from the carpet to the outside of the edge of the carpet and plan the subsequent motion trajectory outside the edge of the carpet, and facilitate the robot to maintain the established cleaning mode in the hard ground area.

[0036] When the robot is applied to a cleaning robot installed with a wet mop, the pose parameters of the robot completely exiting from the carpet are obtained by executing the aforementioned steps 1 to 3, including the target retreat distance and the target rotation angle, so that the robot walks in the opposite direction of the current walking direction by the target retreat distance without turning around, exits the carpet to a pre-set evading position, and then adjusts the walking direction to be parallel to the edge trend of the carpet by rotating the target rotation angle at the pre-set evading position, and then walks along the direction parallel to the edge trend of the carpet, so as to correct the cleaning trajectory to be parallel to the edge of the carpet. Thus, the cleaning effect at the junction of the carpet and other ground media can be improved, the risk of the wet mop staining the carpet can be reduced, and the problem of low coverage efficiency of the cleaning robot repeatedly going up and down the carpet can be reduced.

[0037] As an embodiment, when the robot detects the carpet candidate result in the process of executing the target working behavior, steps 1 to 3 or step 3 are executed to obtain the target retreat distance. Specifically, the robot obtains a target retreat distance by executing steps 1 to 3 for the first time to control the robot to move to a pre-set evading position; in the case that the robot walks along the same side edge of the carpet, in addition to executing steps 1 to 3 for the first time, a plurality of target retreat distances are obtained in sequence by repeatedly executing step 3 on the basis of the same edge fitting line to make the robot move to each pre-set evading position in sequence. In addition, when the robot walks to the other side edge of the same carpet or the side edge of another carpet after walking along the same side edge of the carpet, steps 1 to 3 are repeatedly executed to obtain corresponding target retreat distances in sequence on the basis of each edge fitting line to make the robot move to the corresponding pre-set evading positions at different carpet edges in sequence.

[0038] After obtaining the corresponding target retreat distance, the robot walks in the opposite direction of the current walking direction by the corresponding target retreat distance to the corresponding preset avoidance position without turning around, as shown in FIG. 6, the body center R can move to the preset avoidance position H in the opposite direction of the corresponding arrow of the current walking direction, which can be understood as that the body center of the robot retreats from the carpet to the preset avoidance position H, driving the ultrasonic sensor to move to the lower right to deviate from the current trigger position, and the target retreat distance is shown by the length of the line segment RH, and the distance between the preset avoidance position and the edge fitting line is the avoidance distance.

[0039] After the body center of the robot moves from the carpet to the preset avoidance position, the current walking direction is adjusted to be parallel to the edge fitting line by rotating the target rotation angle at the preset avoidance position, so that the latest walking direction of the robot at the preset avoidance position becomes parallel to the edge direction of the carpet, and then the robot continues to perform the target working behavior, so that the trajectory formed by the target working behavior extends along the edge direction of the carpet, that is, the trajectory direction of the target working behavior at the preset avoidance position becomes parallel to the edge fitting line, wherein the edge fitting line is considered to be parallel to the edge direction of the carpet, and the trajectory direction of the target working behavior at the preset avoidance position is the edge direction of the carpet, which is shown as the direction from right to left in FIG. 6. If the target working behavior of the robot is a cleaning motion from right to left, the cleaning trajectory at the preset avoidance position extends from right to left according to the direction of the arrow of the edge fitting line, so as to clean the area along the edge of the carpet and its vicinity to the left (cleaning along the edge of the carpet to the left).

[0040] It should be noted that each time step 3 is performed, the target retreat distance and the target rotation angle are updated once, so that the preset avoidance position is updated once.

[0041] When the robot detects the carpet candidate, the robot enters the carpet and walks on the carpet according to the current walking direction until the carpet is detected. It can be understood that the robot detects the carpet candidate after crossing the boundary between the hard ground and the carpet, and the robot performs the target working behavior before detecting the carpet candidate by the ultrasonic sensor.

[0042] The target working behavior includes but is not limited to walking along the same side edge of the carpet or different side edges of the same carpet or different carpets to implement edge work, extending along the same side edge of the carpet or different side edges of the same carpet or different carpets to implement arch-shaped motion.

[0043] Considering the detection error, the carpet candidate result can be a carpet internal position or a carpet edge position, until triggering detecting the carpet to determine that the carpet is truly detected, otherwise classified as a candidate result for carpet detection before the current triggering position. Equivalently, triggering detecting the carpet can start detecting the adjacent area from the same carpet edge, and start detecting from the carpet candidate result (understandable as the candidate result detected at the boundary line), wherein the carpet edge can be regarded as the boundary line between the carpet and the hard ground, thereby improving the carpet recognition accuracy in the process of repeatedly entering and exiting the carpet and the hard ground through the target working behavior.

[0044] As an embodiment, the target working behavior is walking along the same side edge of the carpet, there are:

[0045] Action one, when the robot detects the carpet candidate result, pause the execution of the target working behavior, and execute straight line walking, which can be understood as the robot detects the carpet edge to execute straight line walking, such as the rightmost robot in Figure 8 walking along the vertical upward arrow, making the robot cross from the hard ground into the carpet, until triggering detecting the carpet, and then obtaining the target retreat distance by executing step 3, and then controlling the robot to walk to the preset avoidance position to completely exit the carpet, such as the rightmost robot in Figure 8 walking along the vertical downward arrow, making the robot body completely outside the carpet. Then the robot executes action two.

[0046] Action two, adjust the current walking direction to be parallel to the pre-calculated edge fitting line by rotating the target rotation angle at the preset avoidance position, that is, parallel to the edge fitting line calculated in the latest execution of step 2, so that the direction in which the robot walks from the preset avoidance position is parallel to the carpet edge direction; it should be noted that the same side edge of the carpet can be regarded as the edge fitting line obtained by the first execution of step 2 in the scenario that the robot crosses the same side edge of the carpet into the carpet, which is parallel to the same side edge of the carpet. Corresponding to the target rotation angle in Figure 8, the included angle between the vertical upward arrow direction and the horizontal edge of the carpet is equal to 90 degrees, and after the robot adjusts by 90 degrees of rotation, the direction in which the robot walks from the preset avoidance position is parallel to the horizontal arrow direction. Then the robot executes action three.

[0047] Action three, the robot walks along the same side edge of the carpet for a preset edge distance according to the adjusted current walking direction, wherein the preset edge distance is greater than or equal to the body diameter of the robot. Then the robot executes action four.

[0048] Action four, walk in a circular arc way towards the same side edge of the carpet, in Fig. 8, the second robot on the left walks in a circular arc way towards the left upper direction; then repeat action one to trigger the detection of the carpet, as shown in Fig. 8, the first robot on the left triggers the detection of the carpet at the installation position of the ultrasonic sensor on the right side of the first robot on the left, the installation position of the ultrasonic sensor on the right side of the first robot on the left can be recorded as the current trigger position or the historical trigger position, wherein the current walking direction of the first robot on the left is the straight arrow direction pointing to the left upper direction in Fig. 8. Then perform step 3 while keeping the edge fitting line unchanged, respectively calculate the new target retreat distance and the new target rotation angle, so that the robot exits the carpet to the preset avoidance position by walking in the opposite direction of the current walking direction for the target retreat distance without turning around, and the robot adjusts the current walking direction to be parallel to the same side edge of the carpet by rotating the target rotation angle.

[0049] Therefore, by performing actions one to four, the robot is controlled to perform the edge cleaning motion along the edge of the carpet in the process of repeatedly entering and exiting the carpet, and by introducing the target retreat distance and the preset avoidance position, the robot is prevented from excessively deepening into the carpet to cause damage to the carpet, and the working efficiency of the robot in maintaining the edge behavior in the edge of the carpet is also facilitated.

[0050] On the basis of the above embodiment, in the process of walking in a circular arc way towards the other side edge of the same carpet (if the same carpet is a rectangular carpet, when the robot walks through the bottom edge of the carpet and walks to the left side edge of the carpet, the carpet edge detected by the robot changes by 90 degrees, and the previous current trigger position or the historical trigger position is wrong) or the side edge of another carpet (there are multiple carpets in the environment, and it is a case of re-entering other carpets) after the robot has walked through the same side edge of the same carpet, when the robot detects a carpet candidate, since the same side edge of the same carpet has been walked through, the currently detected carpet candidate is from the other side edge of the same carpet or the side edge of another carpet, and it is determined that the robot has started to cross the other side edge of the same carpet or the side edge of another carpet and is detected by the ultrasonic sensor, at this time, the edge fitting line needs to be updated to represent the new carpet edge; then the robot performs straight line walking, which is regarded as the first time that the robot enters the current carpet edge, until the detection of the carpet is triggered, and then steps 1 to 3 are performed to maintain the robot to continue walking along the other side edge of the same carpet or the side edge of another carpet by updating the edge fitting line, and when the robot enters the current carpet edge again, the historical data of the edge fitting line is directly used to maintain the edge behavior.

[0051] As an embodiment, the target working behavior is the case of an arcuate motion extending along the same side edge of the carpet, there are:

[0052] Whenever the robot triggers the detection of the carpet, the robot is controlled to walk to a preset avoidance position to completely exit the carpet by performing step 3, and then to adjust the current walking direction to be parallel to the pre-computed edge fitting line by rotating the target rotation angle at the preset avoidance position, since the robot is currently performing the arcuate motion along the same side edge of the carpet, corresponding to FIG. 7, the robot performs the arcuate motion along the illustrated real carpet edge or edge fitting line, and the trajectory formed by the arcuate motion is shown outside the illustrated real carpet edge, so the edge fitting line required by step 3 in the process of entering and exiting the same side edge is the same, i.e., the pre-computed edge fitting line is used.

[0053] Then the robot walks along the same side edge of the carpet for a preset bending distance according to the adjusted current walking direction, so that the arcuate motion extending along the same side edge of the carpet has a turning trajectory parallel to the same side edge of the carpet, corresponding to the trajectory formed by the arcuate motion extending from the top right to the bottom left in FIG. 7, the aforementioned adjusted current walking direction is also from the top right to the bottom left and parallel to the illustrated edge fitting line, and in particular, the straight line trajectory of the arcuate motion at the short side turning point is parallel to the illustrated edge fitting line.

[0054] In order to meet the area coverage rate, the preset bending distance can be set to be less than or equal to the body radius of the robot, so as to narrow the distance between the adjacent long straight line trajectories on both sides of the short line trajectory formed by the arcuate motion.

[0055] It should be noted that when the target working behavior is the arcuate path, the robot can be a cleaning robot, and the cleaning trajectory generated on the hard ground other than the carpet is an arcuate cleaning route. Specifically, the arcuate path generated by the cleaning robot is composed of a plurality of mutually parallel motion trajectory line segments, wherein the perpendicular distance between two adjacent motion trajectory line segments (positionally adjacent) can be less than the body diameter of the cleaning robot, and both of the two adjacent motion trajectory line segments have an end point connected by a bending line or a short line segment (shorter than the parallel motion trajectory line segment), and the bending line or the short line segment is adjusted to be parallel to the carpet edge currently followed by the robot in this application.

[0056] The skilled in the art can understand that these mutually parallel motion trajectory line segments are long side lines of the arch-shaped motion, and the aforementioned bending lines or short line segments are short side lines between adjacent two motion trajectory line segments, so that these mutually parallel motion trajectory line segments cover the reachable area of the robot, and the aforementioned short side line is initially set to be perpendicular to the motion trajectory line segment or the initial cleaning direction, but in the case where the robot triggers to detect the carpet and controls the robot to walk to the preset avoidance position by performing step 3 in this application, the current walking direction is adjusted to be parallel to the pre-calculated edge fitting line after rotating the target rotation angle.

[0057] On the basis of the above-mentioned embodiments, after the robot walks along the same side edge of the same carpet by performing the arch-shaped motion, when the arch-shaped motion is continued to be performed, steps 1 to 3 are performed to configure the arch-shaped motion performed by the robot to extend along different side edges of the same carpet or extend along edges of different carpets in sequence by updating the edge fitting line; wherein the edge of the carpet along which the arch-shaped motion extends is the edge of the carpet along which the robot walks.

[0058] When the robot walks along the bottom edge of the carpet to the left side edge of the carpet by the arch-shaped motion, the carpet edge detected by the robot changes by 90 degrees, and the process of using the previous current trigger position or the historical trigger position or the side edge of another carpet (there are multiple carpets in the environment, and it is the case of re-walking on other carpets) occurs an error) or another carpet, when the robot triggers to detect the carpet in the process of the arch-shaped motion, since the same side edge of the same carpet has been walked along, the current detected carpet candidate is from another side edge of the same carpet or a side edge of another carpet, and it is determined that the robot has started to cross the other side edge of the same carpet or the side edge of another carpet and is detected by the ultrasonic sensor, at this time, the edge fitting line needs to be updated to represent the new carpet edge; therefore, steps 1 to 3 are performed to update the edge fitting line to configure the arch-shaped motion performed by the robot to extend along different side edges of the same carpet or extend along edges of different carpets in sequence.

[0059] When the robot needs to perform step 1 at the carpet edge mentioned in the foregoing embodiments, the more times step 1 is repeatedly performed, the more current trigger positions are obtained, the more historical trigger positions are obtained in the subsequently performed step 2, and the more times the edge fitting line is updated, and the number of times of updating here is the number of times of cumulative calculation of the edge fitting line at different carpet edges, in some embodiments, the edge fitting line is calculated once at the same carpet edge, and the number of trigger positions required for calculation is at least two, including the current trigger position and the historical trigger position.

[0060] In some embodiments, the robot obtains a current trigger position by each of the plurality of ultrasonic sensors, and the robot obtains a plurality of current trigger positions simultaneously by each of the plurality of ultrasonic sensors, and the robot determines the installation positions of the plurality of ultrasonic sensors are located on a straight line parallel to the edge of the carpet, and the robot obtains a plurality of current trigger positions simultaneously in the carpet.

[0061] In the scenario of repeatedly performing steps 1 to 3 or the scenario of repeatedly performing step 3, the current trigger position obtained by the last execution of step 1 is updated as the historical trigger position in the current execution of step 2, and a current trigger position and a plurality of historical trigger positions are involved in the straight line fitting, and then the edge fitting line parallel to the same carpet edge or a plurality of edge fitting lines parallel to different carpet edges are calculated, and then with the increase of the historical trigger positions, the number of edge fitting lines can be increased to simulate different carpet edge directions, and the edge fitting line parallel to the same carpet edge can be corrected to update the edge fitting line.

[0062] Therefore, the more the current trigger positions and the historical trigger positions increase, the more comprehensive and accurate the edge fitting line is inferred, and the accuracy of the inferred relative position of the carpet edge and the direction of the carpet edge (the trend of the carpet placement) is improved, and the inferred shape and coverage of the carpet are used in the cleaning scenario near the carpet edge, and the cleaning coverage rate outside the carpet area is also improved, and the risk of the robot entering the carpet too deeply and causing the wet mop to dirty the carpet is prevented.

[0063] As an embodiment, after the robot obtains the edge fitting line by performing step 2, when the robot triggers the detection of the carpet and the current trigger position is in the carpet area between the carpet edge along which the robot moves and the edge fitting line currently obtained, if the perpendicular distance from the current trigger position to the edge fitting line is less than or equal to the preset detection distance, the current trigger position approaches the edge fitting line, which drives the center of the robot body to move to the carpet edge along which the robot moves, and then the robot can start the logic processing of deceleration or early avoidance, including deceleration walking or starting to walk in the opposite direction of the current walking direction without turning around, to prevent the robot from continuing to walk into the carpet for a long distance.

[0064] It should be noted that in combination with FIG. 3, it can be known that the installation position of the ultrasonic sensor on the robot body chassis is closer to the front side of the robot in the current walking direction relative to the body center, and the front side here refers to the side of the robot shell in the current walking direction; along the current walking direction, when the installation position of the ultrasonic sensor crosses the carpet edge to the edge fitting line, the detection of the carpet is triggered, that is, the ultrasonic detection is triggered, and the body center also approaches the carpet edge along the current walking direction, in other words, when the body center reaches the carpet edge, the ultrasonic sensor has already triggered the detection of the carpet.

[0065] As an embodiment, after the robot obtains the edge fitting line by performing step 2, if the robot does not trigger the detection of the carpet when the installation position of the ultrasonic sensor crosses the currently obtained edge fitting line during the robot walking process from the detection of the carpet candidate to the installation position of the ultrasonic sensor, it is determined that the robot walks to the carpet corner position; specifically, during the process in which the robot exits the carpet to the preset avoidance position by using the target retreat distance obtained in the last execution of step 3, it is possible to walk out of the carpet by the target retreat distance to the preset avoidance position from the carpet corner position, and then when walking back to the carpet from the preset avoidance position, for example, when starting to cross the carpet edge, the robot detects the carpet candidate, but the installation position of the ultrasonic sensor moves to even cross the currently obtained edge fitting line without triggering the detection of the carpet, it is determined that there is a working blind area between the robot and the detected carpet edge, including an undetected carpet edge; a leak repair action needs to be performed, and the leak repair action includes at least one of the following: changing the angular velocity to rotate, changing the angular velocity and linear velocity to turn, changing the linear velocity to advance or retreat; in order to perform the leak repair action, the embodiment turns by setting the differential between the left drive wheel and the right drive wheel of the robot, forms an arc trajectory between the detected carpet edge and the working blind area, realizes the robot walking into the undetected carpet edge in the form of an arc, and supplements the related carpet edge information into the carpet, and then performs steps 1 to 3 to update the edge fitting line and the preset avoidance position in turn on the basis of triggering the detection of the carpet. Thus, at least part of the working blind area can be traversed; two arc turning motions can also be performed, and the trajectories formed by the two arc turning motions are orthogonal to ensure that most or all of the missed working areas, i.e., the working blind area, have a chance to be repaired.

[0066] From another perspective, when the robot walks to the carpet corner position, it has walked along one side edge of the same carpet and needs to enter the other side edge of the same carpet, otherwise it continues to perform the target work behavior along one side edge of the same carpet and repeatedly enters and exits the carpet near one side edge of the same carpet by repeatedly performing step 3, each time crossing the edge fitting line without triggering detection of the carpet each time it walks to the carpet corner position, which can be located on the boundary line between the detected carpet and the work blind area. After the robot walks to the carpet corner position, the work blind area is not considered as a carpet area, so it does not continue to detect the work blind area, and therefore needs to perform a supplemental work on the work blind area.

[0067] As an embodiment, in the step 1, when the robot triggers detection of the carpet by the ultrasonic sensor, the method for obtaining the current trigger position comprises: as shown in FIG. 4, when the robot triggers detection of the carpet for the first time, the installation position of the ultrasonic sensor is marked as the first trigger position, then the robot walks in a straight line from the carpet to the hard ground without turning around, and drives the installation position of the ultrasonic sensor to return to the hard ground, detects the corresponding change in the ultrasonic data caused by the ultrasonic reflection signal, and determines that the hard ground state is restored; then, the robot rotates by a preset trigger angle on the hard ground to obtain the longitudinal axis of the robot body after rotation, wherein the robot uses the extension direction of the longitudinal axis of the robot body to the front side of the robot body to represent the current walking direction, and therefore the direction of the longitudinal axis of the robot body after rotation pointing to the front side of the robot body is configured as the rotated walking direction shown in the figure, and the preset trigger angle is preferably 45 degrees. Then, the robot walks according to the longitudinal axis of the robot body after rotation until it triggers detection of the carpet, and the installation position of the ultrasonic sensor is marked as the second trigger position, that is, the robot advances to the installation position of the ultrasonic sensor according to the rotated walking direction shown in FIG. 4 to enter the edge fitting line shown with arrows, the robot triggers detection of the carpet again, and the installation position of the ultrasonic sensor is marked as the second trigger position. Then, the second trigger position is marked as the current trigger position, and the first trigger position is marked as the historical trigger position. The trigger positions obtained by entering the carpet for detection twice in succession are used to set the current trigger position.

[0068] On the basis of marking the second trigger position, if the robot walks in a straight line to the hard ground without turning around, and then rotates by a preset trigger angle, which can be less than 45 degrees at this time, and then walks according to the longitudinal axis of the robot body after rotation until it triggers detection of the carpet, the installation position of the ultrasonic sensor is marked as the third trigger position; then, the third trigger position is marked as the current trigger position, and the second trigger position is marked as the historical trigger position. The trigger positions obtained by entering the carpet for detection twice in succession are used to update the current trigger position and the historical trigger position.

[0069] Based on the foregoing embodiments, in the step 2, the method for calculating the edge fitting line using the current trigger position and the historical trigger position comprises:

[0070] When a current trigger position and a historical trigger position are obtained by a single execution of the step 1, a straight line equation is constructed using the coordinates of the current trigger position and the coordinates of the historical trigger position to obtain the edge fitting line. The constructed straight line equation is equivalent to the coordinates of the current trigger position and the coordinates of the historical trigger position substituted into the two-point distance formula to obtain parameters, and then the parameters and coordinate variables are combined to form the straight line equation. The straight line equation is represented as the edge fitting line in the map and located in the carpet. The historical trigger position and the current trigger position detected by the ultrasonic sensor are both located on the edge fitting line.

[0071] Since the generation time of the coordinates of the historical trigger position is earlier than the generation time of the coordinates of the current trigger position, the straight line direction of the edge fitting line is the direction from the historical trigger position to the current trigger position. As shown in the left extension direction of the edge fitting line in FIG. 4, the edge fitting line is preferably parallel to the lower edge of the carpet to represent the direction in which the robot walks along the edge of the carpet parallel to the edge fitting line.

[0072] In addition, there is another way to calculate the edge fitting line, which comprises: when multiple current trigger positions and multiple historical trigger positions are obtained by a single execution of the step 1, a straight line fitting process is performed using the coordinates of the multiple current trigger positions and the coordinates of the multiple historical trigger positions to obtain the edge fitting line. The robot is provided with multiple ultrasonic sensors, and the robot can obtain multiple current trigger positions simultaneously by a single execution of the step 1. When the robot detects the carpet through each ultrasonic sensor, there are multiple ultrasonic carpet detection trigger points, i.e., the number of ultrasonic sensors is equal to the number of current trigger positions. All current trigger positions and historical trigger positions can be subjected to straight line fitting, wherein one ultrasonic sensor corresponds to one current trigger position, and the number of current trigger positions is equal to the number of historical trigger positions. When the robot detects the carpet through part of the ultrasonic sensors, the number of ultrasonic sensors is greater than the number of current trigger positions, and all current trigger positions can be subjected to straight line fitting. All current trigger positions and all historical trigger positions do not necessarily lie on the same edge fitting line. The greater the number of current trigger positions and historical trigger positions required for the fitting process, the more accurate the relative position and placement trend direction inferred from the edge fitting line.

[0073] If an edge fitting line is calculated for each side edge of the carpet, the contour of the carpet can be enclosed, the shape of the carpet can be inferred, and parameters such as the distance and rotation angle required for the robot to exit the carpet can be calculated, so as to plan the subsequent robot motion trajectory.

[0074] Specifically, in the step 1, when the robot detects the carpet candidate through the ultrasonic sensor, it is determined that the detection position of the ultrasonic sensor has changed from other ground media to the carpet, which can also be understood as that the installation position of the ultrasonic sensor has crossed from other ground media to the carpet; in some working scenarios, the detection position of the ultrasonic sensor remains in the carpet. Wherein, the robot detects the carpet candidate by threshold comparison on the ultrasonic data received by the ultrasonic sensor, for example, when the ultrasonic data received by the ultrasonic sensor is greater than the preliminary judgment threshold, the detection position of the ultrasonic sensor is still in the hard ground; when the ultrasonic data received by the ultrasonic sensor is less than or equal to the preliminary judgment threshold, the detection position of the ultrasonic sensor changes to the carpet, which is the carpet candidate, and the robot preliminarily detects the carpet at this time.

[0075] Then, in the process of the robot walking on the carpet, a plurality of frames of ultrasonic data are sampled by counting a detection period, and all the sampled frames of ultrasonic data are filtered, and illustratively, the detection time of a frame of ultrasonic data is set to 18-20 ms, and by sampling 10 frames of ultrasonic data in turn, a detection period of about 200 ms can be counted, and the filtering processing disclosed in the application is set to filter the interference of actual environmental scenarios such as robot jitter and tile gaps. The filtering processing disclosed in the application adopts a filtering algorithm program pre-solidified in the ultrasonic sensor, and the filtering algorithm includes amplitude limiting filtering method, median filtering method, arithmetic average filtering method, recursive average filtering method (sliding average filtering method), median average filtering method (anti-pulse interference average filtering method), amplitude limiting average filtering method, etc. It can be applied to the application scenarios of ultrasonic sensor collecting ultrasonic data and the accuracy requirements of ultrasonic detection of ground media.

[0076] The ultrasonic sensor can distinguish the difference between the carpet and the hard ground as soon as it enters the carpet, but it is usually counted and filtered to filter the misjudgment. Then, whether the robot triggers the detection of the carpet is determined according to the filtering result; specifically, the size relationship between the filtering result and the pre-set filtering threshold is compared, when the filtering result is greater than the pre-set filtering threshold, the robot does not trigger the detection of the carpet, and the robot may walk on the carpet but the detection position of the ultrasonic sensor has entered the hard ground; when the filtering result is less than or equal to the pre-set filtering threshold, the robot triggers the detection of the carpet.

[0077] If the robot triggers detection of the carpet, mark the installation position of the ultrasonic sensor as the first trigger position or the second trigger position; specifically, when the robot triggers detection of the carpet for the first time, mark the installation position of the ultrasonic sensor as the first trigger position, then the robot linearly retreats to the hard floor, then the body longitudinal axis rotates a preset trigger angle, and then walks to the carpet until it triggers detection of the carpet again, mark the installation position of the ultrasonic sensor as the second trigger position. Preferably, the detection position of the ultrasonic sensor covers the installation position of the ultrasonic sensor.

[0078] The intensity of the ultrasonic reflection signal received by the ultrasonic sensor (which can be represented by ultrasonic data) is the level signal obtained by analog-to-digital conversion of the reflection signal of the ultrasonic sensor on the surface of the robot walking environment. The robot can detect the signal strength feedback by the ground medium through the ultrasonic sensor, especially identify the carpet, prevent the robot from entering the carpet, and reduce the degree of pollution of the carpet.

[0079] As an embodiment, in step 3, the method for calculating the target retreat distance based on the edge fitting line, the current walking direction of the robot, the pre-set safety distance, and the body radius of the robot includes:

[0080] When the robot detects a carpet candidate through the ultrasonic sensor, it is determined that the robot has entered the carpet from other ground media, specifically, it is determined that the robot has crossed one side edge of the carpet, a detection period is counted, and the distance walked by the robot in the current walking direction is calculated in real time until the robot triggers detection of the carpet, the installation position of the ultrasonic sensor is offset to the current trigger position, and the calculated distance is marked as the robot trigger distance, which represents the distance from the edge fitting line to the side edge crossed by the robot; Specifically, the time consumed from detecting the carpet candidate to triggering detection of the carpet is a detection period, and the distance walked by the robot in the current walking direction in the detection period is calculated, that is, the speed measured by the robot is multiplied by the detection period to obtain the distance walked by the robot in the current walking direction.

[0081] It should be noted that the marking of the current trigger position requires filtering processing, and the filtering processing needs to go through a detection period, so the robot will walk the distance it enters the carpet based on its walking speed in the detection period, that is, the robot trigger distance.

[0082] As shown in FIG. 6, an angle between a current walking direction of the robot and the edge fitting line is marked as a target rotation angle, a projection distance of the robot trigger distance in a vertical direction of the edge fitting line is calculated, and the projection distance is equivalent to the sensor trigger distance shown in FIG. 5, specifically, a distance between the edge fitting line and a nearest carpet edge in FIG. 6 is calculated, and the distance is equivalent to a distance between the real edge line and the edge fitting line in FIG. 5.

[0083] When the edge fitting line is parallel to the nearest carpet edge, a map coordinate of the edge fitting line is controlled to be subtracted by the sensor trigger distance to obtain a relative position of the nearest carpet edge of the edge fitting line, wherein the nearest carpet edge of the edge fitting line is a carpet edge crossed by the robot in a process of walking from a hard ground to detecting a carpet candidate.

[0084] As shown in FIG. 5 and FIG. 6, a sum of the sensor trigger distance, a safety distance and a body radius of the robot is marked as an avoidance distance, wherein the safety distance can be set as an experience value of 2 cm to 5 cm, so that a certain gap is reserved between a mop installed on the cleaning robot and the carpet when the cleaning robot performs a target working behavior (for example, planning cleaning near the carpet edge).

[0085] Then, according to a trigonometric function relationship of the avoidance distance and the target rotation angle in a geometric model, a ratio between the avoidance distance and a sine value of the target rotation angle is calculated to obtain a retreat planning distance, that is, a slant line passing through the body center R of the preset avoidance position to the edge fitting line, wherein a line segment RH is located in the slant line, and an angle between the slant line and the edge fitting line in the respective arrow directions is the target rotation angle.

[0086] A ratio between a distance from the body center of the robot to the edge fitting line and the sine value of the target rotation angle is calculated to obtain a body redundancy distance, wherein a line segment extending from the body center R by the body redundancy distance is located on the slant line, and the line segment with the length of the body redundancy distance and the line segment RH form the slant line.

[0087] Then, the retreat planning distance is controlled to be subtracted by the body redundancy distance, and a difference value obtained by the subtraction is marked as a target retreat distance, that is, a length of the line segment RH shown in FIG. 6; after the robot walks the target retreat distance in the opposite direction of the current walking direction without turning around, the body center of the robot reaches the preset avoidance position.

[0088] It should be noted that in the current walking direction of the robot, the ultrasonic sensor is closer to the front side of the body center of the robot, and the current trigger position (the installation position of the current ultrasonic sensor) of FIG. 6 is located above and to the right of the body center of the robot.

[0089] As can be known in combination with Fig. 2, the robot forms the current walking direction in Fig. 2 leftward, the current walking direction in Fig. 2 in the middle and the current walking direction in Fig. 2 rightward respectively from different angles of the carpet, when the ultrasonic sensor triggers to detect the carpet, the distance of the robot body entering the carpet is different, through the execution of step 3, in combination with the edge fitting line, the current walking direction of the robot, the pre-set safety distance and the robot body radius, the target retreat distance calculated by the trigonometric function is different, the actual retreat distance of the robot is dynamically calculated, so as to ensure that the robot can retreat to the evading position of the edge of the carpet from any direction of the carpet. Thus, it is prevented that the robot body does not completely retreat back to the carpet due to the short distance of the robot retreating back to the hard ground from the carpet, and thus the subsequent cleaning action of the robot may cause the carpet to be contaminated by the wet mop; it is also prevented that the interval between the robot and the carpet is too long due to the long distance of the robot retreating back to the hard ground from the carpet, and thus there is a risk of missing cleaning when the robot subsequently cleans the area near the carpet.

[0090] As an embodiment, in the step 3, the method for calculating the target rotation angle based on the current walking direction of the robot and the edge fitting line comprises: as can be known in combination with Fig. 6, after the robot body center of the robot walks the target retreat distance in the reverse direction of the current walking direction to the pre-set evading position under the condition that the robot triggers to detect the carpet and the target retreat distance RH is calculated, the included angle between the current walking direction of the robot and the edge fitting line is calculated, and then the included angle is marked as the target rotation angle; then the robot adjusts the current walking direction to be parallel to the edge fitting line according to the target rotation angle, so that the robot walks along the edge of the carpet parallel to the edge fitting line, corresponding to Fig. 6, after the robot body center retreats to the pre-set evading position shown, the current walking direction becomes parallel to the edge fitting line after counterclockwise rotation of the target rotation angle shown, the robot walks from right to left from the pre-set evading position shown, and the arrow of the edge fitting line shown points to the horizontal left, i.e. the aforementioned carpet edge direction extends to the left, so as to plan the subsequent path direction of the robot, including planning the walking direction of the robot at the pre-set evading position in the aforementioned target working behavior.

[0091] Although the present application has been described in detail with reference to the preferred embodiments, it should be understood that the specific embodiments described are only examples of the present application and are not intended to limit the scope of the present application, and that modifications or equivalent substitutions of some technical features can be made to the specific embodiments without departing from the spirit of the present application, which should be covered in the technical scheme range of the present application.

Claims

1. A method for a robot to avoid a carpet based on ultrasonic detection, characterized in that, The method is applied to a robot equipped with an ultrasonic sensor, and the method comprises: Step 1: When the robot detects a carpet through the ultrasonic sensor, the current triggering position is obtained; and then step 2 is performed; Step 2: An edge fitting line is calculated by using the current triggering position and historical triggering positions, so as to determine the position of a carpet edge currently crossed by the robot and the trend of the carpet edge; and then step 3 is performed; Step 3: Based on the edge fitting line, the current walking direction of the robot, a preset safety distance and the body radius of the robot, a target retreat distance is calculated, so that the robot walks in the opposite direction of the current walking direction by the target retreat distance without turning around, and then exits the carpet to a preset avoidance position; and based on the current walking direction of the robot and the edge fitting line, a target rotation angle is calculated, so that the robot adjusts the current walking direction to be parallel to the trend of the carpet edge by rotating the target rotation angle.

2. The method of claim 1, wherein, In the process of the robot performing a target working behavior, when the robot detects a carpet candidate, steps 1 to 3 or step 3 are performed to obtain a target retreat distance, and then the robot walks in the opposite direction of the current walking direction by the target retreat distance without turning around to the preset avoidance position, and then adjusts the current walking direction to be parallel to the edge fitting line by rotating the target rotation angle at the preset avoidance position, and then the robot continues to perform the target working behavior, so that the trajectory formed by the target working behavior extends along the trend of the carpet edge; Wherein, each time step 3 is performed, the target retreat distance and the target rotation angle are updated once, so that the preset avoidance position is updated once; Wherein, when the robot detects a carpet candidate, the robot enters the carpet and walks on the carpet according to the current walking direction until the carpet is detected.

3. The method of claim 2, wherein, When the robot detects a carpet candidate in the case of walking along the same side edge of the carpet, the target working behavior is paused, and instead, straight line walking is performed until the carpet is detected, and then the target retreat distance is obtained by performing step 3, and then the robot is controlled to walk to the preset avoidance position to completely exit the carpet, and then the current walking direction is adjusted to be parallel to the pre-calculated edge fitting line by rotating the target rotation angle at the preset avoidance position, and then the robot walks along the same side edge of the carpet by a preset edge distance according to the adjusted current walking direction, and then walks in a circular arc manner towards the same side edge of the carpet until the carpet is detected, and then step 3 is performed while keeping the edge fitting line unchanged.

4. The method of claim 3, wherein, In the process of walking in a circular arc manner towards another side edge of the same carpet or a side edge of another carpet after walking along the same side edge of the same carpet, when the robot detects a carpet candidate, straight line walking is performed until the carpet is detected, and then steps 1 to 3 are performed to walk along another side edge of the same carpet or a side edge of another carpet by updating the edge fitting line.

5. The method of claim 2, wherein, In the case of the target working behavior being an arch-shaped motion extending along the same side edge of the carpet, when the robot triggers the detection of the carpet, the robot is controlled to walk to a preset avoidance position to completely exit the carpet by performing step 3, to adjust the current walking direction to be parallel to the pre-calculated edge fitting line by rotating the target rotation angle at the preset avoidance position, and then to walk along the same side edge of the carpet for a preset bending distance according to the adjusted current walking direction, so that the trajectory of the arch-shaped motion extending along the same side edge of the carpet at the turning thereof is parallel to the same side edge of the carpet.

6. The method of claim 5, wherein, After the robot walks along the same side edge of the same carpet by performing the arch-shaped motion, when the robot continues to perform the arch-shaped motion, steps 1 to 3 are performed to configure the arch-shaped motion performed by the robot to extend along different side edges of the same carpet in sequence or along edges of different carpets in sequence by updating the edge fitting line; wherein the edge along which the arch-shaped motion extends is the edge of the carpet along which the robot walks.

7. The method according to claim 4 or 6, characterized in that, The more times step 1 is repeatedly performed, the more current trigger positions are obtained, the more historical trigger positions are obtained in the subsequent performance of step 2, and the more times the edge fitting line is updated; Wherein the current trigger position obtained by the last performance of step 1 is updated as the historical trigger position in the current performance of step 2.

8. The method of claim 7, wherein, After the robot currently obtains the edge fitting line by performing step 2, when the robot triggers the detection of the carpet and the current trigger position is in the carpet region between the edge of the carpet along which the robot walks and the currently obtained edge fitting line, if the perpendicular distance from the current trigger position to the edge fitting line is less than or equal to a preset detection distance, the robot slows down or starts walking in the opposite direction of the current walking direction without turning around.

9. The method of claim 7, wherein, After the robot currently obtains the edge fitting line by performing step 2, when the robot walks from the detection of the carpet candidate by the robot to the installation position of the ultrasonic sensor over the currently obtained edge fitting line, if the robot does not trigger the detection of the carpet, it is determined that the robot walks to the carpet corner position.

10. The method of claim 7, wherein, In the step 1, when the robot triggers the detection of the carpet by the ultrasonic sensor, the method for obtaining the current trigger position comprises: When the robot triggers the detection of the carpet for the first time, the installation position of the ultrasonic sensor is marked as the first trigger position, then the robot linearly walks to the reset detection of the hard ground without turning around, then rotates by a preset trigger angle, and then walks according to the rotated body longitudinal axis until the detection of the carpet is triggered, the installation position of the ultrasonic sensor is marked as the second trigger position; then the second trigger position is marked as the current trigger position, and the first trigger position is marked as the historical trigger position; wherein the robot uses the extension direction of the body longitudinal axis to the front side of the body to represent the current walking direction.

11. The method of claim 10, wherein, In the step 2, the method for calculating the edge fitting line by using the current trigger position and the historical trigger position comprises: When a current trigger position and a historical trigger position are obtained by single execution of step 1, a straight line equation is constructed by the coordinates of the current trigger position and the coordinates of the historical trigger position to obtain the edge fitting line, wherein the robot is installed with an ultrasonic sensor; Or, when multiple current trigger positions and multiple historical trigger positions are obtained by single execution of step 1, a straight line fitting process is performed by the coordinates of the multiple current trigger positions and the coordinates of the multiple historical trigger positions to obtain the edge fitting line, wherein the robot is installed with multiple ultrasonic sensors.

12. The method of claim 10, wherein, In the step 1, when the robot detects a carpet candidate through the ultrasonic sensor, it is determined that the detection position of the ultrasonic sensor has changed from other ground medium to carpet, and then in the process of the robot walking on the carpet, multiple frames of ultrasonic data are sampled by counting a detection period, and all the sampled frames of ultrasonic data are filtered, and then whether the robot triggers to detect the carpet is determined according to the filtering result; If the robot triggers to detect the carpet, the installation position of the ultrasonic sensor is marked as the first trigger position or the second trigger position; Wherein, the robot detects the carpet candidate by threshold comparison on the ultrasonic data received by the ultrasonic sensor.

13. The method of claim 12, wherein, In the step 3, the method for calculating the target retreat distance based on the edge fitting line, the current walking direction of the robot, the pre-set safety distance and the body radius of the robot includes: After the robot detects a carpet candidate through the ultrasonic sensor, a detection period is counted, and the distance walked by the robot in the current walking direction is calculated in real time, and when the robot triggers to detect the carpet, the distance calculated in real time is marked as the robot trigger distance to represent the distance from the edge fitting line to the side edge crossed by the robot; An included angle between the current walking direction of the robot and the edge fitting line is marked as the target rotation angle, the projection distance of the robot trigger distance in the vertical direction of the edge fitting line is calculated, and the projection distance is marked as the sensor trigger distance; The sum value between the sensor trigger distance, the safety distance and the body radius of the robot is marked as the avoidance distance, and then the ratio between the avoidance distance and the sine value of the target rotation angle is calculated to obtain the retreat planning distance; The ratio between the distance from the body center of the robot to the edge fitting line and the sine value of the target rotation angle is calculated to obtain the body redundancy distance; Then the retreat planning distance is controlled to subtract the body redundancy distance, and the difference obtained by the subtraction is marked as the target retreat distance, so that the body center of the robot reaches the pre-set avoidance position after the robot walks in the opposite direction of the current walking direction by the target retreat distance without turning around.

14. The method of claim 1, wherein, In the step 3, the method for calculating the target rotation angle based on the current walking direction of the robot and the edge fitting line includes: When the robot detects the carpet and calculates the target retreat distance, the robot body center moves in the opposite direction of the current walking direction by the target retreat distance to the preset avoidance position, the included angle between the current walking direction of the robot and the edge fitting line is calculated, and the included angle is marked as the target rotation angle; then the robot adjusts the current walking direction to be parallel to the edge fitting line according to the target rotation angle.

Citation Information

Patent Citations

  • Control method and device of mopping robot and mopping robot

    CN113545715A

  • Carpet detection method and device of cleaning robot, cleaning robot and medium

    CN113974507A

  • Carpet edge detection method based on ultrasonic waves, chip and robot

    CN118937483A

  • Method for robot to avoid carpet based on ultrasonic detection

    CN119014766A

  • Robot cleaner using edge detection and method of controlling the same

    US20080191653A1