Robot escape method based on carpet detection

Through ultrasonic sensors, the cleaning robot walks along the fitting line to avoid collisions, solving the problem of getting stuck and improving working performance.

CN118948165APending Publication Date: 2024-11-15AMICRO SEMICONDUCTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411085200.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

When the cleaning robot moves near the anti-slip carpet, the ultrasonic sensor has a small detection range and is prone to collision with the wall, resulting in the risk of getting stuck.

Method used

The edge of the carpet is detected by ultrasonic sensors, and the edge fitting line is calculated. The robot walks along the fitting line to avoid collisions and achieve escape.

Benefits of technology

It reduces the risk of trapping the robot in the surrounding environment of the carpet and improves the working performance of the robot in avoiding carpet scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118948165A_ABST
    Figure CN118948165A_ABST
Patent Text Reader

Abstract

The invention discloses a robot escape method based on carpet detection, and the method comprises the steps: A, enabling a robot to walk along a first side wall until the robot walks to a wall corner region, rotating according to a preset hour hand direction, and obtaining a first triggering position if a carpet is detected through triggering; b, the robot walks in the direction opposite to the current walking direction under the condition that the robot does not turn around, and if a carpet is preliminarily detected while the robot walks till collision occurs, the step C is executed; c, rotating according to a preset hour hand direction until the hard ground is preliminarily detected; d, rotating according to the reverse direction of the preset hour hand direction until the carpet is triggered and detected, and obtaining a second triggering position; e, calculating an edge fitting line by using the first trigger position and the second trigger position; the relative position of the carpet edge closest to the edge fitting line is calculated; then the robot walks along the carpet edge closest to the edge fitting line in the direction away from the second side wall, and the robot is prevented from being trapped.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of carpet recognition, and in particular to a robot escape method based on carpet detection. Background Art

[0002] In the home environment, in addition to the large carpets laid in the living room, anti-slip carpets are also placed on the floor mats of the entrance door, kitchen, and bathroom doors. These anti-slip carpets are usually placed at the door, with thresholds and walls erected around them. When the cleaning robot moves to the vicinity of the anti-slip carpet for cleaning, due to the small detection range of the ultrasonic sensor, when exiting the anti-slip carpet, it is easy to collide with the wall due to insufficient adjustment space.

[0003] The Chinese invention patent with patent application number CN202211238871.8 discloses a ground environment motion planning method based on ultrasound. For a cleaning robot working in a ground environment with carpets, after traversing a whole hard floor or walking along the boundary line of the carpet, the cleaning robot divides into multiple carpet partitions. It will decide whether to traverse the carpet partition according to the ratio of the area of ​​the carpet partition to the area of ​​the hard floor. After the cleaning robot completes the traversal of the carpet partition for a predetermined time, it repositions the cleaning robot to its current position by extracting the edge position information. Then, the cleaning robot exits the carpet from the repositioned current position and returns to the hard floor. Since the hard floor near the edge of each carpet partition will erect thresholds, walls, etc., the movable area between the repositioned current position and the thresholds and walls is not large. The cleaning robot cannot retreat normally to avoid the carpet due to insufficient adjustment space, that is, the rear side of the cleaning robot body will collide with the wall while the front side of the cleaning robot body remains in the carpet. Therefore, there is a risk of the cleaning robot being stuck when exiting the carpet from the repositioned current position. Summary of the invention

[0004] This application discloses a robot escape method based on carpet detection, and proposes the following technical solutions: A robot escape method based on carpet detection, the robot escape method is applied to a robot, an ultrasonic sensor is installed on one side of the robot body; the robot escape method comprises: step A, the robot walks along the first side wall until it walks to the corner area, the robot rotates in a preset clockwise direction to walk along the second side wall, if the robot detects the carpet through the ultrasonic sensor trigger, the first trigger position is obtained, and then step B is executed; wherein the corner area is formed by the intersection of the first side wall and the second side wall on the hard ground; step B, the robot walks in the opposite direction of the current walking direction without turning around, if the robot walks until a collision occurs and the carpet is preliminarily detected by the ultrasonic sensor, step C is executed; step C, The robot rotates in the preset clockwise direction until the hard ground is preliminarily detected by the ultrasonic sensor, and then step D is executed; in step D, the robot rotates in the opposite direction of the preset clockwise direction until the carpet is triggered and detected by the ultrasonic sensor, the robot obtains a second trigger position, and then step E is executed; in step E, an edge fitting line is calculated using the first trigger position and the second trigger position; the relative position of the edge of the carpet closest to the edge fitting line is calculated using the distance traveled by the robot from the preliminarily detecting the carpet to the triggering detecting the carpet; then, the robot walks along the edge of the carpet closest to the edge fitting line in a direction away from the second side wall to prevent the robot from being trapped between the carpet and the corner area.

[0005] In summary, the present application controls the robot to rotate in and out of the carpet through steps A to E. In the process of rotating in and out of the carpet, the ultrasonic sensor is controlled to detect two trigger positions in succession, and the relative position of the carpet edge and the escape direction are inferred, so as to control the robot to walk out of the current trapped scene in the escape direction and along the carpet edge. The robot's escape trajectory is planned at the edge of the carpet in the corner area, reducing the risk of the robot being trapped in the carpet environment and improving the robot's working performance in scenes where the carpet is avoided.

[0006] Furthermore, in step A, when the robot walks along the first side wall, the first side wall is the nearest wall detected by the ultrasonic sensor or the wall closest to one side of the body, and the ultrasonic sensor is arranged on the side of the body away from the carpet; wherein the first side wall and the second side wall intersect; the distance between the edge of the carpet closest to the robot and the first side wall is less than the body diameter of the robot; wherein, the robot moves away from the second side wall by rotating in a preset clockwise direction in step C; and the direction in which the robot moves away from the second side wall in step E is the direction from the first trigger position to the second trigger position. Therefore, in step C, the robot moves away from the second side wall by rotating in a preset clockwise direction, thereby controlling the ultrasonic sensor to change from detecting the carpet to detecting the hard ground by rotating in the preset clockwise direction, driving the robot's head to walk out of the edge of the carpet, and the position of the ultrasonic sensor when detecting the hard ground is away from the second side wall relative to the first trigger position disclosed in step A; and then the direction of the robot away from the second side wall set in step E is the direction from the first trigger position to the second trigger position. Therefore, in the process of the robot walking along the edge of the carpet closest to the edge fitting line, it can avoid collision with the first side wall and the second side wall.

[0007] Furthermore, in step A, when the robot walks along the first side wall until the minimum distance between the front edge of the robot and the second side wall is equal to the preset safety distance, it is determined that the robot has entered the corner area, and the robot rotates in a preset clockwise direction to start walking along the second side wall and preliminarily detect the carpet until the carpet is triggered to be detected. Thus, an environment is constructed in which the robot detects the carpet from the corner area.

[0008] Furthermore, in step B, the robot starts to walk from the first trigger position of the ultrasonic sensor in the opposite direction of the current walking direction without turning around until the robot collides with the first side wall. The carpet is preliminarily detected by the ultrasonic sensor, and it is determined that the detection position of the ultrasonic sensor is still inside the carpet, thereby determining that the robot has not completely exited the carpet.

[0009] Furthermore, in step C, when the robot does not preliminarily detect the carpet through the ultrasonic sensor and does not trigger the detection of the carpet through the ultrasonic sensor, it is determined that the robot detects the hard floor through the ultrasonic sensor; wherein the robot preliminarily detects the carpet by comparing the detection data of the ultrasonic sensor with a threshold value. Thus, the situation in which the carpet cannot be detected is uniformly classified as the situation in which the hard floor is detected.

[0010] Further, in step D, the robot rotates in the reverse direction of the preset clockwise direction until the carpet is detected by the ultrasonic sensor. The method for the robot to obtain the second trigger position includes: starting from the position where the hard ground is detected in step C, the robot rotates in the reverse direction of the preset clockwise direction. When the robot preliminarily detects the carpet through the ultrasonic sensor, it is determined that the detection position of the ultrasonic sensor has changed from other ground media to the carpet. The robot continues to rotate on the carpet in the reverse direction of the preset clockwise direction, starts counting a detection cycle, and samples multiple frames of ultrasonic data in sequence within the detection cycle, and filters all the sampled frames of ultrasonic data, and then determines whether the robot is triggered to detect the carpet based on the relationship between the result of the filtering processing and the size of the filtering threshold; if the robot is triggered to detect the carpet, the installation position of the ultrasonic sensor is marked as the second trigger position.

[0011] Further, in step A, if the robot is triggered to detect the carpet through the ultrasonic sensor, the method for obtaining the first trigger position includes: when the robot rotates in a preset clockwise direction, when the robot initially detects the carpet through the ultrasonic sensor, it is determined that the detection position of the ultrasonic sensor has entered the carpet from other ground media, and then the robot continues to rotate on the carpet in the preset clockwise direction, and at the same time starts counting a detection cycle to sample multiple frames of ultrasonic data, and all the sampled frames of ultrasonic data are filtered, and then it is determined whether the robot is triggered to detect the carpet based on the relationship between the filtering result and the filtering threshold; if the robot is triggered to detect the carpet, the installation position of the ultrasonic sensor is marked as the first trigger position.

[0012] In summary, from the initial detection of the carpet to the trigger detection of the carpet, the robot needs to walk a certain distance on the basis of crossing the edge of the carpet to reserve time for sampling and filtering processing, thereby improving the recognition accuracy of the carpet.

[0013] Furthermore, in the step E, the method of calculating the edge fitting line using the first trigger position and the second trigger position includes: in the map constructed by the robot, constructing a straight line equation from the map coordinates of the first trigger position and the map coordinates of the second trigger position to obtain the edge fitting line, wherein the edge fitting line is a straight line represented by the constructed straight line equation in the map; the direction from the first trigger position to the second trigger position is the extension direction of the edge fitting line, to indicate the direction in which the robot walks along the edge of the carpet parallel to the edge fitting line.

[0014] Further, in step E, the method of calculating the relative position of the carpet edge closest to the edge fitting line by using the distance traveled by the robot from the initial detection of the carpet to the trigger detection of the carpet includes: when the time consumed from the initial detection of the carpet to the trigger detection of the carpet is one detection cycle, the distance traveled by the robot in the vertical direction of the edge fitting line is calculated at a predetermined speed during the process of the ultrasonic sensor shifting from the position at which the carpet is initially detected to the trigger position, and then marking the calculated distance as the pre-escape distance to indicate the distance between the edge fitting line and the carpet edge closest to it; wherein the trigger position is the first trigger position or the second trigger position; when the edge fitting line is parallel to the carpet edge closest to it, the coordinate of the edge fitting line in its vertical direction is controlled to subtract the pre-escape distance to obtain the relative position of the carpet edge closest to the edge fitting line; wherein the carpet edge closest to the edge fitting line is the carpet edge crossed by the robot during the process of walking from the hard ground to the initial detection of the carpet. Thus, the positioning accuracy of the relative position of the carpet edge is improved by counting and filtering.

[0015] Furthermore, in step E, the method in which the robot walks along the edge of the carpet closest to the edge fitting line in a direction away from the second side wall includes: after calculating the relative position of the edge of the carpet closest to the edge fitting line, the robot walks toward the relative position of the edge of the carpet closest to the edge fitting line until the installation position of the ultrasonic sensor or the body center of the robot is at the relative position of the edge of the carpet closest to the edge fitting line, and then adjusts the current walking direction of the robot to the extension direction of the edge fitting line by rotation, and then walks along the extension direction of the edge fitting line, so that the robot walks out of the corner area along the edge of the carpet closest to the edge fitting line. Then, when the robot leaves the corner area, the robot completes the escape, so that the robot can plan subsequent work trajectories in an open area. Prevent the robot from being trapped between the carpet and the corner area. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of the position layout of ultrasonic sensors in the chassis of a robot provided in one embodiment of the present application.

[0017] Figure 2 A schematic diagram of the coordinate relationship between an ultrasonic sensor and the body center of a robot provided in one embodiment of the present application.

[0018] Figure 3 This is a schematic diagram of a robot provided in an embodiment of the present application walking to the edge of a carpet in a corner area.

[0019] Figure 4A schematic diagram of the positional relationship between a robot and an edge fitting line provided in one embodiment of the present application.

[0020] Figure 5 A schematic flow chart of a robot escape method based on carpet detection provided in one embodiment of the present application. DETAILED DESCRIPTION

[0021] The technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present invention. In the absence of conflict, the following embodiments and the features in the embodiments can be combined with each other. In the present application, it is necessary to understand that the terms "center", "middle position", "central axis", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like, the orientation or positional relationship indicated by them is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. If the terms "first", "second", "third" and the like appear in the embodiments, it is to facilitate the distinction of related features, and cannot be understood as indicating or implying the relative importance, order or number of technical features.

[0022] The carpet described in this application is a broad concept. In addition to the large carpet in the living room, many people also have small carpets in their homes. For example, the floor mat placed at the entrance, the anti-slip carpet mat at the entrance of the kitchen or bathroom, etc. Figure 3 The carpet is shown.

[0023] like Figure 3 As shown, when the robot walks along the edge of the first side wall, the ultrasonic sensor only detects the first side wall and cannot detect the carpet placed on the left side of the robot body. When the robot walks to the second side wall near the corner area, it needs to switch to the edge of the wall for cleaning. After the robot rotates to the left, the ultrasonic sensor begins to detect the carpet, but the tail space of the robot is insufficient and it cannot retreat normally to avoid it. That is, the robot is prone to collide with the first side wall when retreating from the carpet to the corner area, resulting in the risk of the robot being trapped. Therefore, when the robot runs to the corner area near the toilet / bathroom door where the carpet is placed, due to the small detection range of the ultrasonic sensor installed on one side of the body, the robot is insufficient to adjust the space required to avoid the carpet, and the robot is easily trapped in the corner area where the carpet is placed at the toilet / bathroom door and repeatedly collides.

[0024] The present application discloses a robot escape method based on carpet detection. The robot escape method is applied to a robot, wherein an ultrasonic sensor is installed on one side of the robot body; wherein the position layout of the ultrasonic sensor on the robot is pre-fixed; the installation position of the ultrasonic sensor is placed on the left and / or right side of the universal wheel, as shown schematically. Figure 1 As shown, in the schematic diagram of the position layout of the robot's chassis, the ultrasonic sensor is installed on the right side of the universal wheel, the universal wheel is installed on the longitudinal axis of the robot's body, the current walking direction shown in the figure is parallel to the longitudinal axis of the body, and the current walking direction points to the front side of the robot's body.

[0025] Since the surface of the carpet and the hard surface of the floor (wooden floor or tile) reflect the sensor signal differently, the carpet can be identified based on the ultrasonic data received by the ultrasonic sensor. In an exemplary embodiment, when the robot cleans the cleaning area, the ultrasonic sensor transmits an ultrasonic signal to the ground and receives the signal reflected from the ground to identify the carpet. When the robot moves from the hard ground to the carpet, the reflected ultrasonic signal emission changes, and it can be determined that the carpet is identified.

[0026] The robot will build a global map during its walking process. The global map is the first time the robot is used. It uses various sensors it carries (such as accelerometers, gyroscopes, ultrasonic rangefinders, cameras, single-line laser radars, etc.) 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 detected obstacles, and calculate the posture information based on the relevant ranging information to draw a frame of global map containing environmental information. In the process of the robot walking along the first side wall and along the second side wall, the first side wall and the second side wall are marked in the map in turn to intersect and represent the corner area.

[0027] like Figure 5 As shown, the robot escape method comprises the following steps: Step A: The robot walks along the first side wall until it reaches the corner area, and then the robot rotates in a preset clockwise direction to walk along the second side wall. Schematically, during the process of the robot walking along the first side wall, Figure 3 As shown in the figure, the robot represented by the dotted circle walks to the corner area in the direction of the dotted arrow and is about to collide with the second side wall. The robot needs to rotate to walk along the second side wall. The rotation of step A can be the robot rotating around the center of the robot body, or the robot rotating around other positions to enter the carpet by walking in an arc trajectory.

[0028] When the robot walks along the first side wall, the side closest to the edge of the carpet is the side of the robot body where no ultrasonic sensor is installed. Before the robot walks along the second side wall, the robot rotates in a preset clockwise direction to avoid colliding with the second side wall. Figure 3 As shown in the figure, the robot represented by the solid circle rotates 90 degrees counterclockwise relative to the robot represented by the dotted circle, driving the ultrasonic sensor to rotate around the center of the robot's body to enter the carpet from the hard ground, and then the robot walks into the carpet in the direction of the solid arrow.

[0029] If the robot detects the carpet through the ultrasonic sensor trigger, the first trigger position is obtained, such as Figure 4 The robot walks in the preset clockwise direction, and the small circular position on the right side of the robot's walking direction after the preset clockwise rotation (corresponding to the installation position of the ultrasonic sensor) is the first trigger position, specifically, the installation position of the ultrasonic sensor is set to the first trigger position; then execute step B. The corner area is the area formed by the intersection of the first side wall and the second side wall on the hard ground, such as Figure 3 As shown in the area formed by the first side wall and the second side wall arranged vertically in the middle, the size of the corner area in the horizontal direction is smaller than the body diameter of the robot, and the size of the corner area in the vertical direction is larger than the body diameter of the robot.

[0030] Step B: Starting from the first trigger position, the robot walks in the opposite direction of the current walking direction without turning around, that is, the ultrasonic sensor moves with the robot body in the opposite direction of the current walking direction from the first trigger position, which can be understood as the robot retreating from the carpet to the hard ground; if the robot walks until a collision occurs and the ultrasonic sensor initially detects the carpet, it is determined that the robot has not detected the hard ground through the ultrasonic sensor, and step C is executed. When the robot executes step B, it retreats to avoid the carpet, but the robot is blocked from retreating in the area between the corner area and the carpet, that is, the robot walks to the area with the carpet. Figure 3 As shown, the first side wall collides, and the robot's head and the detection position of the ultrasonic sensor are still on the carpet to preliminarily detect the carpet. At this time, the robot does not restore the ultrasonic sensor to perform hard ground detection.

[0031] Step C, the robot rotates in the preset clockwise direction. The robot starts to rotate in the preset clockwise direction from the position where the ultrasonic sensor does not detect the hard ground (the position where the robot collides with the first side wall and the carpet is initially detected) in step B until the ultrasonic sensor initially detects the hard ground, and then executes step D. Schematically, combined with Figure 3 and Figure 4It can be seen that the robot rotates counterclockwise until the robot changes from triggering the detection of the carpet to preliminarily detecting the hard ground, and has been reset from the state of detecting the carpet, and the rotation of the robot in step C can be around the center of the body in a preset clockwise direction, or around a position point other than the center of the body (set on the same map plane as the center of the body and the first trigger position) in a preset clockwise direction until the ultrasonic sensor is driven into the hard ground, which can drive the robot away from the second side wall, providing a new starting point or transition area for subsequent triggering and detecting the carpet.

[0032] Step D, the robot rotates in the reverse direction of the preset clockwise direction until the carpet is detected by the ultrasonic sensor, the robot obtains the second trigger position, and then executes step E. Specifically, the robot starts from the position where the hard ground is initially detected in step C, and rotates in the reverse direction of the preset clockwise direction. The robot can rotate around the center of the body, or the robot can rotate around other positions to walk out of an arc track, driving the ultrasonic sensor from the hard ground into the carpet until the carpet is detected by the ultrasonic sensor, and then the installation position of the ultrasonic sensor is set to the second trigger position. At this time, the second trigger position is not equal to the first trigger position, so that two trigger positions are obtained by two trigger detections in the rotation operation in the opposite direction, which are the first trigger position and the second trigger position.

[0033] When the robot enters the carpet and triggers the detection of the carpet, it is considered that the ultrasonic detection of the carpet is triggered, and the coordinates of the current installation position of the ultrasonic sensor are recorded as the coordinates of the first trigger position or the coordinates of the second trigger position, and marked on the map. Schematically, Figure 3 and Figure 4 As shown in the figure, a map coordinate system will be established during the robot's walking process. The robot's body center is the origin of the coordinate system, and the robot's current walking direction (the direction of the longitudinal axis of the body) is the Y axis. The coordinates of the body center are known in real time. According to the preset relative position relationship, the installation position of the ultrasonic sensor can be calculated, so as to obtain the coordinates of the first trigger position or the coordinates of the second trigger position in the map to update the carpet information marked on the map.

[0034] Step E, using the first trigger position and the second trigger position to calculate the edge fitting line; then using the distance traveled by the robot from the initial detection of the carpet to the trigger detection of the carpet, calculate the relative position of the carpet edge closest to the edge fitting line, wherein the carpet edge closest to the edge fitting line is the carpet edge that is parallel to the edge fitting line and the robot's ultrasonic sensor reciprocates in and out of step A, step C and step D, the ultrasonic sensor enters the carpet from the hard ground through the carpet edge in step A, the ultrasonic sensor enters the hard ground through the carpet edge in step C, and the ultrasonic sensor enters the carpet from the hard ground through the carpet edge in step D.

[0035] In step E, the robot calculates the edge fitting line based on the robot reciprocatingly rotating across the edge of the carpet from the hard ground. The first trigger position and the second trigger position can be directly used to construct a straight line equation to represent the edge fitting line. The edge fitting line can be used to simulate the edge of the carpet that the robot currently crosses, and the position of the edge of the carpet that the robot currently crosses can be calculated based on the distance the robot walks in the carpet after crossing the edge of the carpet. In this way, the coverage boundary of the carpet relative to the robot is determined, so that no matter from which angle the robot enters the carpet, it can leave the aforementioned corner area along a motion trajectory parallel to the edge of the carpet to prevent being trapped.

[0036] When the edge fitting line is calculated in step E, the coordinate information of the edge fitting line in the map is calculated. Each time an edge fitting line is calculated, the robot has stepped into the edge of a carpet and is at a certain distance from the edge of the carpet. In some embodiments, the robot can distinguish between carpet and other ground detection results when walking the certain distance. Other ground detection results can be areas that the robot has covered. Other ground detection results include carpet candidate results or hard ground candidate results. Taking into account the detection error, the carpet candidate result can be the internal position of the carpet or the edge position of the carpet. It is not determined that the carpet is actually detected until the carpet is triggered and detected. Otherwise, it is classified as the candidate result of the carpet detection before the robot's ultrasonic sensor reaches the first trigger position or the second trigger position; the hard ground candidate result can also be the edge position of the hard ground or the internal position of the hard ground. It is not determined that the hard ground is actually detected until the hard ground is triggered and detected. Otherwise, it is classified as the candidate result of the hard ground detection when the robot completely enters the hard ground.

[0037] Equivalently, triggering detection of carpet and triggering detection of 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 the candidate results detected at the dividing line), respectively. The carpet edge can be regarded as the dividing line between the carpet and the hard floor. Triggering detection of carpet and triggering detection of hard floor can improve the recognition accuracy of carpet and hard floor, respectively.

[0038] In addition, the distance from the edge fitting line to the nearest edge of the carpet that the robot crosses along its current walking direction is the distance that the robot has walked since the carpet was initially detected in step A, walking along the second side wall until the ultrasonic sensor is triggered to detect the carpet. Alternatively, the distance from the edge fitting line to the nearest edge of the carpet that the robot has walked since the carpet was initially detected in step D, rotating in the reverse direction of the preset clockwise direction until the ultrasonic sensor is triggered to detect the carpet. On this basis, the robot uses the coordinate information of the edge fitting line in the map to subtract the distance from the edge fitting line to the nearest edge of the carpet that the robot has crossed along its current walking direction, and obtains the coordinates of the relative position of the carpet edge closest to the edge fitting line.

[0039] Then, the robot walks along the edge of the carpet closest to the edge fitting line in a direction away from the second side wall to prevent the robot from being trapped between the carpet and the corner area; specifically, the ultrasonic sensor moves along the edge of the carpet closest to the edge fitting line to drive the robot out of the corner area. In order to walk along the edge of the carpet closest to the edge fitting line, after the robot rotates to obtain the second trigger position in step D and calculates the edge fitting line in step E, the robot rotates its current walking direction to a direction away from the second side wall, and the direction away from the second side wall is the robot's current escape direction; the direction away from the second side wall is preferably the direction from the first trigger position to the second trigger position, or forms a certain acute angle with the direction from the first trigger position to the second trigger position but does not point to the first side wall, so that the current walking direction after rotation points to a direction away from the corner area, but not to the center of the carpet, which can guide the robot to walk out of the corner area along the edge of the carpet, and then drive the robot to completely exit the carpet.

[0040] Preferably, in step E, before walking along the edge of the carpet closest to the edge fitting line, after calculating the edge fitting line, the angle between the robot's current walking direction and the edge fitting line in the direction away from the second side wall (the direction in which the first trigger position points to the second trigger position) is calculated to obtain a target rotation angle, and the robot adjusts the current walking direction to be parallel to the corresponding carpet edge by rotating the target rotation angle, and then can walk along the outer side of the carpet edge while maintaining a certain distance.

[0041] In summary, the present application controls the robot to rotate in and out of the carpet through steps A to E. In the process of rotating in and out of the carpet, the ultrasonic sensor is controlled to detect two trigger positions in succession, and the relative position of the carpet edge and the escape direction are inferred, so as to control the robot to walk out of the current trapped scene in the escape direction and along the carpet edge. The robot's escape trajectory is planned at the edge of the carpet in the corner area, reducing the risk of the robot being trapped in the carpet environment and improving the robot's working performance in scenes where the carpet is avoided.

[0042] In the above embodiment, combined with Figure 3 and Figure 4 It can be seen that in step A, the robot Figure 3 When walking along the first side wall, the first side wall is the nearest wall detected by the ultrasonic sensor or the wall closest to one side of the robot body, and the ultrasonic sensor is installed on the side of the robot body away from the carpet; wherein the first side wall and the second side wall intersect to surround the side of the robot body. The distance between the edge of the carpet closest to the robot and the first side wall is less than the body diameter of the robot, so in the process of executing steps A to E, each time the robot exits from the carpet to the corner area, the robot body cannot completely exit from the carpet, and there is always a part of the body covered in the carpet. When the distance of retreating from the carpet is too large, the body will collide with the first side wall or the second side wall, and it is not possible to return to the hard ground by retreating in a straight line to allow the ultrasonic sensor to detect, which is understood as retreat being blocked. Therefore, in step C, the robot moves away from the second side wall by rotating in a preset clockwise direction, thereby controlling the ultrasonic sensor to change from detecting the carpet to detecting the hard ground by rotating in the preset clockwise direction, driving the robot's head to walk out of the edge of the carpet, and the position of the ultrasonic sensor when detecting the hard ground is away from the second side wall relative to the first trigger position disclosed in step A; and then the direction of the robot away from the second side wall set in step E is the direction from the first trigger position to the second trigger position. Therefore, in the process of the robot walking along the edge of the carpet closest to the edge fitting line, it can avoid collision with the first side wall and the second side wall.

[0043] It should be noted that the second trigger position obtained in step D is obtained by triggering detection during the process of the robot rotating back to the carpet after initially detecting the hard ground in step C. The first trigger position is the installation position of the ultrasonic sensor that is triggered to detect the carpet for the first time after the robot enters the carpet, and then the robot walks (backwards) from the carpet to the hard ground until the carpet is initially detected without turning around, and then rotates in the preset clockwise direction until the hard ground is initially detected by the ultrasonic sensor. The installation position of the ultrasonic sensor that the robot initially detects the hard ground in step C is far away from the second side wall relative to the first trigger position and the installation position of the ultrasonic sensor that the robot initially detects the carpet in step B. In step A, the robot walks along the first side wall to the corner area, and then, during the process of the robot rotating in a preset clockwise direction to walk along the second side wall, the ultrasonic sensor of the robot is arranged on the side of the body away from the carpet; and during the process of the robot reversely rotating to re-trigger and detect the carpet after initially detecting the hard ground in step C, the ultrasonic sensor of the robot is arranged on the side of the body close to the carpet; therefore, the rotation angle of the robot reversely rotating to re-trigger and detect the carpet after initially detecting the hard ground in step C is less than the rotation angle of the robot from the first trigger position to the rotation angle of the robot when the hard ground is initially detected in step C; thereby causing the second trigger position obtained by the robot in step D to be away from the second side wall relative to the first trigger position obtained by the robot in step A, that is, along Figure 4 The edge fitting line shown is in the downward arrow direction, and the second trigger position is located below the first trigger position.

[0044] As an embodiment, in step A, when the robot walks along the first side wall until the minimum distance between the front edge of the robot and the second side wall is equal to the preset safety distance, it is determined that the robot has entered the corner area. The preset safety distance can be between 2 cm and 5 cm, so that a safety gap is left between the robot body and the second side wall or a distance along the edge is formed during the walking process. Figure 3 As shown in the area where the robot is located represented by the solid circle, the size of the corner area in the direction parallel to the second side wall is smaller than the diameter of the robot body, so that part of the robot body covers the carpet; then the robot rotates in a preset clockwise direction, and the installation position of the ultrasonic sensor (the relatively small circle shown in the figure) can be rotated into the carpet. The robot can walk around the arc to the edge of the carpet, which has been covered by the robot body but not detected by the ultrasonic sensor during the robot's walking along the first side wall; at this time, the robot starts to walk along the second side wall and preliminarily detects the carpet through the ultrasonic sensor; the robot keeps walking along the second side wall until the carpet is triggered and detected. Thus, an environment is constructed in which the robot detects the carpet from the corner area.

[0045] As an embodiment, in step B, the robot does not turn around, and the ultrasonic sensor starts walking from the first trigger position in the opposite direction of the current walking direction. Based on the above embodiment, it is equivalent to the ultrasonic sensor of the robot moving backward from the first trigger position along the second side wall toward the first side wall until the robot collides with the first side wall. At this time, due to the edge of the carpet closest to the robot ( Figure 3 The distance between the edge of the carpet covered by one side of the robot body as shown in the figure and the first side wall is smaller than the body diameter of the robot, and the ultrasonic sensor is installed on the head of the robot (such as Figure 1 Therefore, when the robot walks in the opposite direction of the current walking direction until the tail of the robot collides with the first side wall without turning around, the installation position of the ultrasonic sensor is still on the carpet. The robot preliminarily detects the carpet through the ultrasonic sensor and determines that the detection position of the ultrasonic sensor is still in the carpet, thereby determining that the robot has not completely exited the carpet.

[0046] On the basis of the above-mentioned embodiment, in step C, when the robot fails to preliminarily detect the carpet through the ultrasonic sensor and fails to trigger the detection of the carpet through the ultrasonic sensor, it is determined that the robot detects the hard ground through the ultrasonic sensor, including the process from preliminarily detecting the hard ground to triggering the detection of the hard ground during the walking process of the robot. Thus, the situation in which the carpet cannot be detected is uniformly classified as the situation in which the hard ground is detected.

[0047] It should be noted that the robot initially detects the carpet by comparing the detection data of the ultrasonic sensor with the threshold. The robot's initial detection of the hard floor is similarly deduced. Specifically, if the detection data of the ultrasonic sensor is greater than the preset sound wave intensity threshold, it is determined that the robot has initially detected the hard floor; if the detection data of the ultrasonic sensor is less than or equal to the preset sound wave intensity threshold, it is determined that the robot has initially detected the carpet. The preset sound wave intensity threshold is an empirical value obtained by technicians in the relevant field at the boundary between carpet and hard floor after multiple experiments.

[0048] The trigger detection is implemented when the robot crosses the edge of the carpet and then walks inside the carpet and filters the ultrasonic data reflected by the ground received in real time. If the carpet is detected by triggering, the ultrasonic sensor is set as a trigger position at the position covered by the detection surface, such as the first trigger position or the second trigger position. It can also be understood that the installation position of the ultrasonic sensor (relative to the position of the center of the body) is marked as the first trigger position or the second trigger position. It is worth noting that the carpet is detected by triggering in step A and step D, not by real-time detection of the carpet based on the ultrasonic data reflected by the ground received in real time, but by filtering and matching comparison after a detection period.

[0049] When the robot enters or exits the carpet, it will identify the edge of the carpet, that is, the dividing line between the carpet and the hard floor. Specifically, it will distinguish whether the robot is currently stepping into the edge of the carpet or whether the distance between the installation position of the ultrasonic sensor and the edge of the stepped carpet is greater than the preset distance threshold based on the ultrasonic data reflected by the ground received in real time. When the distance between the installation position of the ultrasonic sensor and the edge of the stepped carpet is greater than the preset distance threshold, the carpet is triggered to be detected. When the robot is currently stepping into the edge of the carpet, it is considered that the robot has preliminarily detected the carpet. The preset distance threshold is the distance experience value obtained by technicians in the relevant field at the dividing line between the carpet and the hard floor after multiple experiments.

[0050] In addition, the robot distinguishes whether the robot is currently stepping over the edge of the carpet or whether the distance between the installation position of the ultrasonic sensor and the stepped carpet edge is greater than a preset distance threshold based on the ultrasonic data reflected by the ground received in real time. When the distance between the installation position of the ultrasonic sensor and the stepped carpet edge is greater than the preset distance threshold, the hard ground is detected. When the robot is currently stepping over the edge of the carpet, it is considered that the robot has preliminarily detected the hard ground.

[0051] As an embodiment, in step D, the robot rotates in the reverse direction of the preset clockwise direction until the carpet is detected by the ultrasonic sensor. The method for the robot to obtain the second trigger position includes: the robot starts from the position where the hard ground is detected in step C, and rotates in the reverse direction of the preset clockwise direction. When the robot preliminarily detects the carpet through the ultrasonic sensor, it is determined that the detection position of the ultrasonic sensor has changed from the hard ground to the carpet, and the installation position of the ultrasonic sensor has crossed the edge of the carpet and entered the carpet. The robot continues to rotate on the carpet in the reverse direction of the preset clockwise direction, and starts counting a detection cycle, that is, counting a detection cycle from the initial detection of the carpet. The ultrasonic sensor samples multiple frames of ultrasonic data in sequence during the detection cycle, and filters all the sampled frames of ultrasonic data, and then determines whether the robot triggers the detection of the carpet based on the relationship between the result of the filtering processing and the size of the filtering threshold. If the robot triggers the detection of the carpet, the installation position of the ultrasonic sensor is marked as the second trigger position. At this time, the installation position of the ultrasonic sensor preferably enters Figure 4 The edge fit lines are shown with arrows.

[0052] As an embodiment, in step A, if the robot detects the carpet through the ultrasonic sensor, the method for obtaining the first trigger position includes: when the robot rotates in a preset clockwise direction, when the robot preliminarily detects the carpet through the ultrasonic sensor, it is determined that the detection position of the ultrasonic sensor has entered the carpet from the hard ground, and the installation position of the ultrasonic sensor has crossed the edge of the carpet and entered the carpet, then the robot continues to rotate on the carpet in the preset clockwise direction, and at the same time starts counting a detection cycle to sample multiple frames of ultrasonic data, that is, counting a detection cycle from the initial detection of the carpet, the ultrasonic sensor samples multiple frames of ultrasonic data in sequence within the detection cycle, and filters all the sampled frames of ultrasonic data, and then determines whether the robot triggers the detection of the carpet according to the relationship between the filtering result and the filtering threshold value; if the robot triggers the detection of the carpet, the installation position of the ultrasonic sensor is marked as the first trigger position, at this time, the installation position of the ultrasonic sensor preferably enters Figure 4 The edge fit lines are shown with arrows.

[0053] Based on the above embodiments, in step A or step D, when the robot preliminarily detects the carpet 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 the installation position of the ultrasonic sensor has crossed from other ground media to the carpet. The detection position of the ultrasonic sensor covers the installation position of the ultrasonic sensor, or the detection position of the ultrasonic sensor is the installation position of the ultrasonic sensor. In some working scenarios, the detection position of the ultrasonic sensor remains in the carpet. On this basis, the robot needs to walk a certain distance on the basis of crossing the edge of the carpet from the preliminary detection of the carpet to the triggering of the detection of the carpet, so as to reserve time for sampling and filtering processing, thereby improving the recognition accuracy of the carpet.

[0054] Specifically, when the ultrasonic data received by the ultrasonic sensor is greater than the preset sound wave intensity threshold, the detection position of the ultrasonic sensor is still on the hard ground; when the ultrasonic data received by the ultrasonic sensor is less than or equal to the preset sound wave intensity threshold, the detection position of the ultrasonic sensor becomes on the carpet.

[0055] When the robot walks on the carpet, multiple frames of ultrasonic data are sampled by counting a detection cycle, and all the sampled frames of ultrasonic data are filtered. Schematically, the detection time of one frame of ultrasonic data is set to 18 to 20ms. By sampling 10 frames of ultrasonic data in sequence, a detection cycle of about 200ms can be counted. The filtering process disclosed in the present application is set to filter the interference of actual environmental scenes such as jitter in the robot and gaps between floor tiles. After multiple filtering tests, the filtering threshold is obtained. The ultrasonic sensor can distinguish the difference between the carpet and the hard ground from the moment it enters the carpet, but it usually counts and filters to filter out misjudgments. Therefore, the size relationship between the result of the filtering process and the pre-set filtering threshold is compared. When the result of the filtering process is greater than the pre-set filtering threshold, the robot does not trigger the detection of the carpet; when the result of the filtering process is less than or equal to the pre-set filtering threshold, the robot triggers the detection of the carpet.

[0056] The filtering process disclosed in this application uses a filtering algorithm program pre-cursed in the ultrasonic sensor. The filtering algorithms include limiting filtering, median filtering, arithmetic mean filtering, recursive average filtering (sliding average filtering), median average filtering (anti-pulse interference average filtering), limiting average filtering, etc. It can be applied to application scenarios where ultrasonic sensors collect ultrasonic data and the accuracy requirements of ultrasonic detection of ground media. The intensity of the ultrasonic reflection signal received by the ultrasonic sensor (which can be represented by ultrasonic data) is the reflection signal of the ultrasonic sensor on the surface of the robot's walking environment, and the level signal is obtained through analog-to-digital conversion. The robot can use the ultrasonic sensor to detect the strength of the signal feedback from the carpet to prevent the robot from mistakenly entering the carpet too deep and reduce the degree of contamination of the carpet.

[0057] The robot controls the ultrasonic sensor to emit ultrasonic waves and receive ultrasonic reflection signals, and controls the inertial sensor to measure the robot's attitude angle. The ultrasonic sensor determines the ground type by emitting ultrasonic data to the ground it is traveling on, and then determines the edge of the carpet area and the effective detection position of the ultrasonic sensor. Compared with traditional laser detection, it is cheaper and not affected by light. Combined with the angle information of the inertial sensor, the detection process is more stable. The inertial sensor is a device that responds to physical movement, such as linear displacement or angular rotation, but does not actively send out detection signals. This allows the robot to adapt to complex and diverse indoor media environments.

[0058] As an embodiment, in the step E, the method of calculating the edge fitting line using the first trigger position and the second trigger position includes: in the map constructed by the robot, constructing a straight line equation from the map coordinates of the first trigger position and the map coordinates of the second trigger position to obtain the edge fitting line, wherein the edge fitting line is a straight line represented by the constructed straight line equation in the map; and the direction from the first trigger position to the second trigger position is the extension direction of the edge fitting line.

[0059] In this embodiment, the constructed straight line equation is equivalent to the map plane coordinates of the first trigger position and the map plane coordinates of the second trigger position. After being substituted into the distance formula between the two points, the equation coefficient is obtained, and then the straight line equation is constructed by the equation coefficient and the map plane coordinates. Then, the straight line equation is represented as the edge fitting line in the map and is located in the carpet. Preferably, the robot is equipped with an ultrasonic sensor, and a first trigger position is obtained in step A and a second trigger position is obtained in step D by an ultrasonic sensor.

[0060] Since the generation time of the first trigger position is earlier than the generation time of the second trigger position, the extension direction of the edge fitting line is from the first trigger position to the second trigger position. Schematically, as shown in FIG. Figure 4 As shown in the extending direction of the edge fitting line from top to bottom, the edge fitting line is preferably parallel to the right edge of the carpet to indicate the direction in which the robot walks along the edge of the carpet parallel to the edge fitting line.

[0061] Indicatively, if Figure 3As shown, a map coordinate system will be established during the robot's walking process, with the robot's body center as the origin of the coordinate system, the robot's current walking direction (the direction of the body's longitudinal axis) as the Y axis, and the coordinate axis perpendicular to the Y axis as the X axis; the robot obtains the position of the body center in real time and reflects it in the map, and the installation position of the ultrasonic sensor can be calculated based on the relative position relationship between the body center and the ultrasonic sensor pre-set in the robot body, thereby obtaining the coordinates of the first trigger position and the second trigger position in the map to update the carpet information marked on the map.

[0062] As an embodiment, in step E, the method of calculating the relative position of the carpet edge closest to the edge fitting line by using the distance traveled by the robot from the initial detection of the carpet to the trigger detection of the carpet includes: when the time consumed by the robot from the initial detection of the carpet to the trigger detection of the carpet is one detection cycle, in the process of the ultrasonic sensor shifting from the position at which the carpet is initially detected to the trigger position, the distance traveled by the robot in the vertical direction of the edge fitting line is calculated according to a predetermined speed, and then the calculated distance is marked as a pre-escape distance to represent the distance between the edge fitting line and the carpet edge closest to it; wherein the trigger position is the first trigger position or the second trigger position, and the predetermined speed is the speed at which the robot walks in the carpet along the vertical direction of the edge fitting line, which is considered to be unchanged; when the installation position of the ultrasonic sensor reaches the first trigger position in step A, the pre-escape distance is calculated by multiplying one detection cycle by the aforementioned speed; or, when the installation position of the ultrasonic sensor reaches the second trigger position in step D, the pre-escape distance is calculated by multiplying one detection cycle by the aforementioned speed. On this basis, the coordinate of the edge fitting line in the vertical direction is controlled to subtract the pre-escaping distance to obtain the relative position of the carpet edge closest to the edge fitting line. Thus, the positioning accuracy of the relative position of the carpet edge is improved through counting and filtering.

[0063] In this embodiment, the carpet edge closest to the edge fitting line is the carpet edge crossed by the robot when walking from the hard ground to the initial detection of the carpet. Therefore, the pre-escape distance is expressed as the distance from the edge fitting line to the carpet edge on one side crossed by the robot.

[0064] It should be noted that since the mark of the trigger position needs to be obtained after filtering the ultrasonic data collected by the ultrasonic sensor in real time, and the filtering process needs to go through a detection cycle, the robot will use the distance it enters the carpet within the detection cycle based on its walking speed as the distance at which the robot triggers carpet detection.

[0065] Based on the above embodiment, in step E, the method in which the robot walks along the edge of the carpet closest to the edge fitting line in a direction away from the second side wall includes: After the robot calculates the relative position of the edge of the carpet closest to the edge fitting line, the robot walks toward the relative position of the edge of the carpet closest to the edge fitting line. The walking method here can be to rotate a certain angle from the current position, walk toward the first side wall, and walk toward the edge of the carpet closest to the edge fitting line until the installation position of the ultrasonic sensor or the body center of the robot is at the relative position of the edge of the carpet closest to the edge fitting line; if the movable area of ​​the robot body between the edge of the carpet closest to the edge fitting line and the first side wall is large enough (not greater than the body diameter of the robot), the installation position of the ultrasonic sensor is allowed to follow the robot walking and shift to the relative position of the edge of the carpet closest to the edge fitting line; if the movable area of ​​the robot body between the edge of the carpet closest to the edge fitting line and the first side wall is relatively small (not greater than the body radius of the robot), only the body center of the robot is allowed to reach the relative position of the edge of the carpet closest to the edge fitting line, and continuing to walk along the real-time walking direction will collide with the first side wall. Therefore, before the robot walks along the carpet edge closest to the edge fitting line, the robot's posture is adjusted so that the robot covers the carpet edge closest to the edge fitting line or its ultrasonic sensor detects the carpet edge closest to the edge fitting line.

[0066] Then the robot adjusts its current walking direction to the extension direction of the edge fitting line by rotating, and then walks along the extension direction of the edge fitting line, so that the robot walks out of the corner area along the edge of the carpet closest to the edge fitting line. When the robot leaves the corner area, the robot is freed, so that the robot can plan subsequent work trajectories in an open area, thereby preventing the robot from being trapped between the carpet and the corner area.

[0067] Although the present invention has been described in detail with reference to preferred embodiments, a person skilled in the art should understand that the specific implementation modes of the present invention can still be modified or some technical features can be replaced by equivalents without departing from the spirit of the technical solution of the present invention, which should be included in the scope of the technical solution for protection of the present invention.

Claims

1. A robot escape method based on carpet detection, characterized in that: The robot escape method is applied to a robot, wherein an ultrasonic sensor is installed on one side of the robot body; The robot escape method comprises: Step A, the robot walks along the first side wall until it reaches the corner area, and the robot rotates in a preset clockwise direction to walk along the second side wall. If the robot detects the carpet through the ultrasonic sensor trigger, the first trigger position is obtained, and then step B is executed; wherein the corner area is formed by the intersection of the first side wall and the second side wall on the hard ground; Step B: The robot walks in the opposite direction of the current walking direction without turning around. If the robot walks until a collision occurs and the ultrasonic sensor preliminarily detects the carpet, step C is executed; Step C, the robot rotates in the preset clockwise direction until the hard ground is preliminarily detected by the ultrasonic sensor, and then executes step D; Step D, the robot rotates in the reverse direction of the preset clockwise direction until the carpet is detected by the ultrasonic sensor, the robot obtains a second trigger position, and then executes step E; Step E, using the first trigger position and the second trigger position to calculate the edge fitting line; then using the distance the robot travels from the initial detection of the carpet to the trigger detection of the carpet, calculate the relative position of the edge of the carpet closest to the edge fitting line; then, the robot walks along the edge of the carpet closest to the edge fitting line in a direction away from the second side wall to prevent the robot from being trapped between the carpet and the corner area.

2. The robot escape method according to claim 1, characterized in that: In step A, when the robot walks along the first side wall, the first side wall is the nearest wall detected by the ultrasonic sensor or the wall closest to one side of the body, and the ultrasonic sensor is arranged on the side of the body away from the carpet; The first side wall and the second side wall intersect; the distance between the edge of the carpet closest to the robot and the first side wall is smaller than the body diameter of the robot; Among them, the robot moves away from the second side wall by rotating in a preset clockwise direction in step C; the direction in which the robot moves away from the second side wall in step E is set to be the direction from the first trigger position to the second trigger position.

3. The robot escape method according to claim 2, characterized in that: In step A, the robot walks along the first side wall until the minimum distance between the front edge of the robot and the second side wall is equal to the preset safety distance, and then determines that the robot has entered the corner area, and rotates in a preset clockwise direction to start walking along the second side wall and preliminarily detect the carpet until the carpet is detected.

4. The robot escape method according to claim 3, characterized in that: In step B, the robot starts walking from the first trigger position of the ultrasonic sensor in the opposite direction of the current walking direction without turning around until the robot collides with the first side wall. The carpet is preliminarily detected by the ultrasonic sensor, and it is determined that the detection position of the ultrasonic sensor is still inside the carpet, thereby determining that the robot has not completely exited the carpet.

5. The robot escape method according to claim 4, characterized in that: In step C, when the robot does not preliminarily detect the carpet through the ultrasonic sensor and does not trigger the detection of the carpet through the ultrasonic sensor, it is determined that the robot detects the hard floor through the ultrasonic sensor; Among them, the robot initially detects the carpet by performing threshold comparison on the detection data of the ultrasonic sensor.

6. The robot escape method according to claim 2, characterized in that: In step D, the robot rotates in the reverse direction of the preset clockwise direction until the carpet is detected by the ultrasonic sensor. The method for the robot to obtain the second trigger position includes: The robot starts from the position where the hard ground is detected in step C, and rotates in the reverse direction of the preset clockwise direction. When the robot preliminarily detects the carpet through the ultrasonic sensor, it is determined that the detection position of the ultrasonic sensor has changed from other ground media to the carpet. The robot continues to rotate on the carpet in the reverse direction of the preset clockwise direction, starts counting a detection cycle, and samples multiple frames of ultrasonic data in sequence within the detection cycle, and performs filtering processing on all the sampled frames of ultrasonic data, and then determines whether the robot triggers the detection of the carpet based on the relationship between the result of the filtering processing and the size of the filtering threshold; if the robot triggers the detection of the carpet, the installation position of the ultrasonic sensor is marked as the second trigger position.

7. The robot escape method according to claim 2, characterized in that: In step A, if the robot detects the carpet through the ultrasonic sensor, the method for obtaining the first trigger position includes: When the robot initially detects the carpet through the ultrasonic sensor during the rotation of the robot in the preset clockwise direction, it determines that the detection position of the ultrasonic sensor has entered the carpet from other ground media. Then, the robot continues to rotate on the carpet in the preset clockwise direction, and starts counting a detection cycle to sample multiple frames of ultrasonic data, and performs filtering on all the sampled frames of ultrasonic data, and then determines whether the robot triggers the detection of the carpet based on the relationship between the filtering result and the filtering threshold value; if the robot triggers the detection of the carpet, the installation position of the ultrasonic sensor is marked as the first trigger position.

8. The robot escape method according to claim 6 or 7, characterized in that: In the step E, the method of calculating the edge fitting line using the first trigger position and the second trigger position includes: In the map constructed by the robot, a straight line equation is constructed using the map coordinates of the first trigger position and the map coordinates of the second trigger position to obtain an edge fitting line, wherein the edge fitting line is a straight line represented by the constructed straight line equation in the map; and the direction from the first trigger position to the second trigger position is the extension direction of the edge fitting line.

9. The robot escape method according to claim 8, characterized in that: In step E, the method of calculating the relative position of the carpet edge closest to the edge fitting line by using the distance traveled by the robot from the initial detection of the carpet to the triggering of the detection of the carpet includes: When the time from the initial detection of the carpet to the trigger detection of the carpet is one detection cycle, the ultrasonic sensor is shifted from the position at which the carpet is initially detected to the trigger position, and the distance traveled by the robot in the vertical direction of the edge fitting line is calculated at a predetermined speed, and the calculated distance is marked as the pre-escape distance to indicate the distance between the edge fitting line and the nearest carpet edge; wherein the trigger position is the first trigger position or the second trigger position; When the edge fitting line is parallel to the carpet edge closest to it, the coordinate of the edge fitting line in the vertical direction is controlled to subtract the pre-escaping distance to obtain the relative position of the carpet edge closest to the edge fitting line; The carpet edge closest to the edge fitting line is the carpet edge crossed by the robot when the robot walks from the hard ground to initially detecting the carpet.

10. The robot escape method according to claim 9, characterized in that: In step E, the method in which the robot walks along the edge of the carpet closest to the edge fitting line in a direction away from the second side wall includes: After calculating the relative position of the carpet edge closest to the edge fitting line, the robot walks toward the relative position of the carpet edge closest to the edge fitting line until the installation position of the ultrasonic sensor or the body center of the robot is at the relative position of the carpet edge closest to the edge fitting line, and then adjusts the current walking direction of the robot to the extension direction of the edge fitting line by rotation, and then walks along the extension direction of the edge fitting line, so that the robot walks out of the corner area along the carpet edge closest to the edge fitting line.