A method for robots to avoid carpets based on ultrasonic detection
By detecting the edge of the carpet and calculating the fitting line through ultrasonic sensors, the cleaning robot can exit the carpet without turning around, solving the problem of the cleaning robot maintaining the cleaning mode at the junction of carpet and hard floor, improving the cleaning effect and reducing the risk of carpet soiling.
Patent Information
- Application Number
- CN202411085092.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-08-08
AI Technical Summary
It is difficult for cleaning robots to maintain the established cleaning mode at the junction of carpets and hard floors, and cleaning robots equipped with wet mops are prone to dirtying carpets or missing areas to clean.
An ultrasonic sensor is used to detect the edge of the carpet. By calculating the edge fitting line and combining the robot's walking direction, safety distance and body radius, the target retreat distance and rotation angle are calculated, allowing the robot to exit the carpet without turning around and adjust its walking direction to be parallel to the carpet edge.
It improves the cleaning effect at the junction of carpet and hard floor, reduces the risk of wet mop staining carpet, and reduces the problem of low efficiency of repeated coverage of carpet by cleaning robots.
Smart Images

Figure CN119014766B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of carpet recognition, and in particular to a method for a robot to avoid carpets based on ultrasonic detection. Background Art
[0002] The Chinese invention patent application number CN202211238871.8 discloses an ultrasonic-based ground environment motion planning method. For a cleaning robot working in a ground environment with carpet, the cleaning robot divides the hard floor area into multiple carpet partitions after traversing an entire hard floor area or walking along the boundary line of the carpet. It will decide whether to traverse the carpet partition based on the ratio of the area of the carpet partition to the area of the hard floor area. After the cleaning robot completes the traversal within the carpet partition for a predetermined time, it repositions itself back to the current position of the cleaning robot by extracting the edge position information, and then retreats the carpet. When the cleaning robot returns to the hard floor area from the repositioned current position, it does not correct itself back to the cleaning trajectory parallel to the carpet edge, and cannot maintain the robot's established cleaning mode in the hard floor area.
[0003] In addition, since the cleaning robot disclosed in the Chinese invention patent with patent application number CN202211238871.8 decides to traverse the carpet partition by calculating the area of the area, it needs to calculate the cleaning time when walking in the carpet partition to be cleaned and can only exit the carpet after completing the traversal for a predetermined time (such as the standard cleaning time). However, the cleaning robot equipped with a wet mop needs to speed up 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 soiled by the wet mop due to its continuous walking in the carpet partition for a predetermined time. Summary of the Invention
[0004] This application discloses a method for a robot to avoid carpets based on ultrasonic detection, and proposes the following technical solutions:
[0005] A method for a robot to avoid carpet based on ultrasonic detection is applied to a robot equipped with an ultrasonic sensor. The method includes: step 1, when the robot detects a carpet through the ultrasonic sensor, obtaining the current trigger position; then executing step 2; step 2, using the current trigger position and the historical trigger position to calculate the edge fitting line to determine the position of the carpet edge currently crossed by the robot and the direction of the carpet edge; then executing step 3; 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, calculating the target retreat distance, so that the robot walks the target retreat distance in the opposite direction of the current walking direction without turning around, and then exits the carpet to a preset avoidance position; and calculating the target rotation angle 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 direction of the carpet edge by rotating the target rotation angle.
[0006] In summary, the method for robot avoiding carpet based on ultrasonic detection provided in the present application can be applied to the robot after it goes on the carpet. The current trigger position is obtained by triggering the carpet detection, and the edge fitting line is calculated using the current trigger position and the historical trigger position. Based on this, the placement position and trend of the carpet are inferred, and then the target retreat distance and 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, respectively, to facilitate the robot to move from the inside of the carpet to the outside of the carpet edge and plan the subsequent motion trajectory outside the carpet edge, so as to facilitate the robot to maintain the established cleaning mode in the hard floor area.
[0007] When the robot is used in a cleaning robot equipped with a wet mop, the robot obtains the posture parameters for completely exiting the carpet by executing steps 1 to 3, including the target retreat distance and the target rotation angle. The robot then walks the target retreat distance in the opposite direction of its current walking direction without turning around, exiting the carpet to a preset avoidance position. At the preset avoidance position, the robot then rotates the target rotation angle to adjust its walking direction to parallel with the edge of the carpet. The robot then walks in a direction parallel to the edge of the carpet, correcting the cleaning trajectory back to parallel with the carpet edge. This improves the cleaning effect at the interface between the carpet and other floor media, reduces the risk of the wet mop contaminating the carpet, and alleviates the low coverage efficiency of the cleaning robot repeatedly going up and down the carpet. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] 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.
[0009] Figure 2Schematic diagram of an application scenario in which a robot enters a carpet from different directions according to an embodiment of the present application.
[0010] Figure 3 A schematic diagram of the coordinate relationship between the ultrasonic sensor and the body center of the robot provided in one embodiment of the present application.
[0011] Figure 4 This is a schematic diagram of a robot provided in an embodiment of the present application triggering detection and fitting an edge fitting line on a carpet twice.
[0012] Figure 5 A schematic diagram of the positional relationship between a robot and an edge fitting line provided in one embodiment of the present application.
[0013] Figure 6 A planar geometric diagram showing a robot planning its exit direction and distance from a carpet according to an embodiment of the present application.
[0014] Figure 7 This is a schematic diagram of an embodiment of the present application showing that the walking direction of the robot at a turn in a bow-shaped motion is parallel to the edge of the carpet.
[0015] Figure 8 A schematic diagram of a robot provided in an embodiment of the present application showing the robot exiting a carpet and rotating back into the carpet during cleaning along the edge of the carpet.
[0016] Figure 9 A flowchart of a method for a robot to avoid carpet based on ultrasonic detection is provided in one embodiment of the present application. DETAILED DESCRIPTION
[0017] 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 are 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 limiting the present invention. If terms such as "first", "second", and "third" appear in the embodiments, it is to facilitate the distinction between related features and cannot be understood as indicating or implying their relative importance, order or the number of technical features.
[0018] The carpet described in this application is a broad concept and can be understood as a floor material different from hard materials such as wooden floors and tiles. When a cleaning robot walks on a carpet, the output power of the roller brush motor or the drive wheel motor may change, or the floor material may be unsuitable for the cleaning robot to clean in mopping mode. Specifically, the carpet can be: a short-pile carpet, a long-pile carpet, a plush mat, etc. The cleaning robot can be a robot with a cleaning mechanism and a mopping mechanism mounted on the chassis. During the cleaning process, the robot involved in this application can use one of the cleaning mechanism or the mopping mechanism or both to contact the cleaning surface to clean the cleaning surface. The mopping mechanism is generally used to clean hard floors such as floors and 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 floors and carpets, even a cleaning mechanism may damage the carpet or cause damage to the cleaning robot when adopting the same cleaning strategy.
[0019] Therefore, when the cleaning robot is cleaning in an indoor home environment, it travels back and forth between carpets and hard floors, two areas with different soft and hard ground media. Therefore, the cleaning robot needs to avoid carpets during autonomous planning of mopping. If the cleaning robot does not avoid carpets, the risk of the wet mop staining the carpet increases, and the continuity of the cleaning path and cleaning efficiency are also affected.
[0020] Currently, one of the sensors that can stably identify carpets and has a high degree of industrialization is the ultrasonic sensor. Generally, the number of sensors mounted on the chassis of cleaning robots is limited, which limits the detection range and creates blind spots. Subsequent cleaning plans will bypass blind spots, making it easy for cleaning robots to miss areas on hard surfaces. In carpet avoidance scenarios, cleaning robots may miss areas around the carpet. Excessive attempts to clean the carpet will cause the wet mop to soil the carpet. Specifically, the distances the cleaning robot enters the carpet vary, so in order to avoid the carpet, the robot will retreat at different distances. If the robot's retreat distance becomes shorter, it cannot completely exit the carpet, and subsequent cleaning actions may risk soiling the carpet with the wet mop. If the robot's retreat distance is too long, there is a risk of missing areas during subsequent cleaning.
[0021] This application discloses a method for a robot to avoid carpets based on ultrasonic detection. The method is applied to a robot equipped with an ultrasonic sensor. The ultrasonic sensor is installed 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, and 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.
[0022] In some embodiments, the ultrasonic sensor can continuously collect ultrasonic data of the detection plane area at intervals of 6 ms, and the robot can convert the regional position coordinate information detected by the ultrasonic sensor into a global map. The detection plane area generated by the ultrasonic sensor is formed by the ultrasonic transmission angle and the maximum detection distance constraint, preferably forming a conical area range, wherein the measurement signal returned by the ultrasonic reflection signal carries the ultrasonic data, and the intensity of the measurement signal returned by the ultrasonic reflection signal includes the ultrasonic signal intensity of the obstacle surface closest to the ultrasonic sensor within the conical area and the surface of the walking plane, which are generally expressed in terms of electrical level. The surface medium type can be distinguished based on the intensity of the ultrasonic signal.
[0023] Because carpet surfaces reflect sensor signals differently than hard surfaces such as wood floors or tiles, carpets can be identified based on ultrasonic data received by the ultrasonic sensor. In an exemplary embodiment, as the robot cleans the cleaning area along a cleaning path, the ultrasonic sensor transmits ultrasonic signals to the ground and receives signals reflected from the ground to identify the carpet. When the robot moves from a hard surface to a carpet, the reflected ultrasonic signal changes, thereby confirming that the carpet has been identified. If the robot's left and right drive wheels are on the hard surface and only the universal wheels are on the carpet, the ultrasonic sensor can detect the carpet. At this time, the robot's grip is still intact and has not yet slipped.
[0024] It should be noted that a global map is constructed during the robot's walking process. This global map is the first time the robot is used. It uses its own sensors (such as accelerometers, gyroscopes, ultrasonic rangefinders, cameras, single-line lidars, etc.) to search the walking environment area of each room, sense the position, shape, and size of each room, as well as the position, shape, and size of detected obstacles, and calculates the posture information based on the integration of relevant ranging information to draw a global map containing environmental information.
[0025] The method for avoiding carpets by robots based on ultrasonic detection disclosed in this application involves the following steps: Figure 9 As shown, including:
[0026] In step 1, when the robot detects a carpet through the ultrasonic sensor, it obtains the current trigger position; then proceeds to step 2. The trigger detection in step 1 occurs when the robot steps over the edge of the carpet, then walks within the carpet, and filters and processes the ultrasonic data reflected by the ground in real time. If a carpet is detected, the ultrasonic sensor's location on the ground is set as the current trigger position. This can also be understood as marking the ultrasonic sensor's installation location (relative to the center of the robot) as the current trigger position. It is worth noting that the carpet detection in step 1 is not based on real-time ultrasonic data reflected by the ground, but rather on filtering and matching over a period of detection.
[0027] The robot will identify the edge of the carpet when entering or exiting it. Specifically, it will determine 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 carpet being stepped into is greater than a preset distance threshold based on the ultrasonic data reflected from the ground received in real time. When the distance between the installation position of the ultrasonic sensor and the edge of the carpet being stepped into is greater than the preset distance threshold, carpet detection is triggered. Alternatively, it will determine whether the robot is currently stepping out of the edge of the carpet or whether the distance between the installation position of the ultrasonic sensor and the edge of the carpet being stepped out is greater than a preset distance threshold based on the ultrasonic data reflected from the ground received in real time. When the distance between the installation position of the ultrasonic sensor and the edge of the carpet being stepped out is greater than the preset distance threshold, hard floor detection is reset.
[0028] When the robot enters the carpet and detects the carpet, it is considered to have triggered ultrasonic detection. The coordinates of the current installation position of the ultrasonic sensor are recorded as the coordinates of the current trigger position and marked on the map. Schematically, as shown in Figure 3 As shown, the robot establishes a map coordinate system during its movement. The robot's center is the origin of the coordinate system, the robot's current movement direction (the direction of the robot's longitudinal axis) is the Y-axis, and the coordinate axis perpendicular to the Y-axis is the X-axis. The robot knows the position of its center in real time and reflects it in the map. Based on the pre-set relative position relationship, it calculates the installation position of the ultrasonic sensor, thereby obtaining the coordinates of the current trigger position in the map and updating the carpet information indicated on the map. If the robot does not trigger and detect the carpet and moves in the direction of exiting the carpet until it resets and detects a hard surface, this can be considered an ultrasonic detection reset. The robot / ultrasonic sensor has completely exited the carpet.
[0029] Step 2: Calculate an edge fitting line using the current trigger position and historical trigger positions to determine the position and direction of the carpet edge currently crossed by the robot; then proceed to step 3. The historical trigger position can be updated by the current trigger position. Step 2: Calculating the edge fitting line is performed based on the robot crossing the carpet edge from a hard surface. The edge fitting line can be directly constructed using a current trigger position and a historical trigger position to represent the line equation, or a line fitting process can be performed using at least one current trigger position and at least one historical trigger position to obtain the line. The edge fitting line can then be used to simulate the carpet edge currently crossed by the robot. The position of the carpet edge currently crossed by the robot is calculated based on the distance traveled within the carpet after crossing the carpet edge. The direction of the carpet edge corresponding to the historical trigger position is determined based on the direction of the historical trigger position toward the current trigger position. This carpet edge direction is set to accommodate the robot's travel direction. This determines the carpet's placement trend relative to the robot and its coverage boundary, ensuring that the robot, regardless of the angle from which it enters the carpet, can correct its trajectory to a parallel trajectory to the carpet edge upon exiting the carpet.
[0030] In step 2, each time an edge fitting line is calculated, the robot has crossed a carpet edge and is a certain distance away from the carpet edge. In some embodiments, when the robot travels this certain distance, it can distinguish between carpet and other ground detection results. Other ground detection results can be areas that the robot has already covered. Other ground detection results include carpet candidate results or hard ground candidate results. Taking into account detection errors, carpet candidate results can be located inside the carpet or at the edge of the carpet. A carpet is not truly detected until a trigger detects the carpet. Otherwise, it is classified as a candidate result for carpet detection before reaching the current trigger position. Hard ground candidate results can also be located at the edge of the hard ground or inside the hard ground. A hard ground is not truly detected until a reset detects the hard ground. Otherwise, it is classified as a candidate result for hard ground detection before the robot completely enters the hard ground or a preset avoidance position. Equivalently, both triggering detection of carpet and resetting detection of hard floor can start detecting adjacent areas from the same carpet edge, and start detection from carpet candidate results and hard floor candidate results (which can be understood as candidate results detected at the dividing line) respectively. The carpet edge can be regarded as the dividing line between carpet and hard floor. Triggering detection of carpet and resetting detection of hard floor can improve the recognition accuracy of carpet and hard floor respectively.
[0031] Step 3: Calculate the target retreat distance 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 the target retreat distance in the opposite direction of the current walking direction without turning around, and then exits the carpet to the preset avoidance position. That is, when the current walking direction is regarded as the forward direction, walking the target retreat distance in the opposite direction of the current walking direction is actually the robot retreating the target retreat distance to reach the preset avoidance position; combined with Figure 5 and Figure 6 It can be seen that according to the angle formed by the edge fitting line and the current walking direction of the robot, based on the triangular geometric relationship, the sum of 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 robot's body radius is converted into an equivalent distance value in the current walking direction, which is used as the avoidance distance configured by the robot based on the edge fitting line. The robot is made to completely withdraw from the carpet to the hard ground starting from the edge fitting line. 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 the robot walks from the edge fitting line must be converted from the current trigger position to the center of the body. Therefore, the target retreat distance required to be calculated in step 3 is regarded as the actual retreat distance of the body center.
[0032] In the indoor environment where this application is located, no carpets are added or removed, and the position of the carpets is not moved.
[0033] Based on the calculated avoidance distance and its equivalent distance in the current walking direction, the robot's redundant distance is calculated as the ratio of the distance from the robot's center to the edge fitting line to the sine of the angle between the edge fitting line and the robot's current walking direction. As the robot's center moves to drive the entire robot off the carpet, the target retreat distance is obtained by subtracting the redundant distance from the equivalent distance to ensure the robot's center moves past the avoidance distance, preventing the ultrasonic sensor from detecting the carpet. After pre-planning the target retreat distance, the robot retreats to a preset avoidance position by walking the target retreat distance in the opposite direction of its current walking direction.
[0034] In addition, step 3 calculates the target rotation angle based on the robot's current walking direction and the edge fitting line. The angle formed by the robot's current walking direction 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 by rotating the target rotation angle; if the robot exits the carpet to the preset avoidance position, the robot adjusts the walking direction to be parallel to the corresponding carpet edge at the preset avoidance position, and then the carpet edge strategy can be adopted to walk along the outside of the carpet edge.
[0035] In summary, the method for robot avoiding carpet based on ultrasonic detection provided in the present application can be applied to the robot after it goes on the carpet. The current trigger position is obtained by triggering the carpet detection, and the edge fitting line is calculated using the current trigger position and the historical trigger position. Based on this, the placement position and trend of the carpet are inferred, and then the target retreat distance and 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, respectively, to facilitate the robot to move from the inside of the carpet to the outside of the carpet edge and plan the subsequent motion trajectory outside the carpet edge, so as to facilitate the robot to maintain the established cleaning mode in the hard floor area.
[0036] When the robot is used in a cleaning robot equipped with a wet mop, the robot obtains the posture parameters for completely exiting the carpet by executing steps 1 to 3, including the target retreat distance and the target rotation angle. The robot then walks the target retreat distance in the opposite direction of its current walking direction without turning around, exiting the carpet to a preset avoidance position. At the preset avoidance position, the robot then rotates the target rotation angle to adjust its walking direction to parallel with the edge of the carpet. The robot then walks in a direction parallel to the edge of the carpet, correcting the cleaning trajectory back to parallel with the carpet edge. This improves the cleaning effect at the interface between the carpet and other floor media, reduces the risk of the wet mop contaminating the carpet, and alleviates the low coverage efficiency of the cleaning robot repeatedly going up and down the carpet.
[0037] As an embodiment, when the robot detects a candidate carpet during the execution of the target work behavior, it executes steps 1 to 3 or step 3 to obtain a target retreat distance. Specifically, the first time the robot executes steps 1 to 3, it obtains a target retreat distance to control the robot to move to a preset avoidance position. When the robot walks along the same edge of the carpet, in addition to the first execution of steps 1 to 3, it subsequently repeats step 3 multiple times to sequentially calculate multiple target retreat distances based on the same edge fitting line, so that the robot moves to each preset avoidance position. In addition, each time the robot walks along the same edge of the carpet and moves towards the other edge of the same carpet or the edge of another carpet, it repeats steps 1 to 3 to sequentially calculate the corresponding target retreat distance based on each edge fitting line, so that the robot moves to the corresponding preset avoidance position at each carpet edge.
[0038] After obtaining the corresponding target retreat distance, the robot walks the corresponding target retreat distance in the opposite direction of the current walking direction without turning around to the corresponding preset avoidance position. Figure 6It can be seen that the body center R can move in the opposite direction of the arrow corresponding to the current walking direction to the preset avoidance position H shown in the figure. It can be understood that the body center of the robot retreats from the carpet to the preset avoidance position H, driving the ultrasonic sensor to follow the body to move to the lower right to deviate from the current trigger position. The target retreat distance shown in the figure is represented by the length of the line segment RH, and the distance between the preset avoidance position shown in the figure and the edge fitting line shown in the figure is the avoidance distance.
[0039] After the robot's body center 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. Schematically, the robot's latest walking direction at the preset avoidance position becomes parallel to the direction of the carpet edge. Then, the robot continues to execute the target work behavior, so that the trajectory formed by the target work behavior extends along the direction of the carpet edge, that is, the trajectory direction of the target work 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 direction of the carpet edge, and the trajectory direction of the target work behavior at the preset avoidance position is the direction of the carpet edge, schematically represented as Figure 6 In the right-to-left direction, if the robot's target working behavior is to clean from right to left, the cleaning trajectory at the preset avoidance position will extend from right to left along the arrow direction of the edge fitting line, so as to complete the left cleaning of the carpet edge and its surrounding area.
[0040] It should be noted that each time step 3 is executed, 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 a carpet candidate, it enters the carpet and walks along it in its current walking direction until the carpet is detected. This means that the robot detects the carpet candidate after crossing the boundary between the hard surface and the carpet; however, the robot performs the target work behavior before detecting the carpet candidate using the ultrasonic sensor.
[0042] The target work 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 side edges of different carpets to perform edge work, extending along the same side edge of the carpet or different side edges of the same carpet or different side edges of different carpets in a bow-shaped motion.
[0043] To account for detection errors, the carpet candidate can be located inside the carpet or at the carpet edge. A carpet is not considered truly detected until carpet detection is triggered. Otherwise, it is classified as a carpet candidate detected before the current trigger position. Equivalently, once carpet detection is triggered, adjacent areas can be detected starting from the same carpet edge, and detection begins from the carpet candidate (which can be understood as the candidate detected at the boundary). The carpet edge can be considered the boundary between the carpet and the hard floor. This improves carpet recognition accuracy during repeated entry and exit of the target work behavior between the carpet and the hard floor.
[0044] As an example, when the target work behavior is walking along the same edge of a carpet, there are:
[0045] Action 1: When the robot detects the carpet candidate, it suspends the target work behavior and switches to walking in a straight line. This can be understood as the robot walking in a straight line when it detects the edge of the carpet. Figure 8 The rightmost robot walks along the vertical upward arrow, making the robot step from the hard ground into the carpet until the carpet is detected. Then, the target retreat distance is obtained by executing step 3, and the robot is controlled to walk to the preset avoidance position to completely exit the carpet. Figure 8 The rightmost robot walks along the vertical downward arrow until its body is completely outside the carpet. Then the robot performs action 2.
[0046] Action 2: 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 by the most recently executed step 2, so that the direction in which the robot starts walking from the preset avoidance position is parallel to the edge of the carpet; 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 where the robot crosses the same side edge of the carpet and enters the carpet, and is parallel to the same side edge of the carpet. Corresponding to Figure 8 The target rotation angle is the angle between the vertical arrow and the horizontal edge of the carpet, which is equal to 90 degrees. After the robot rotates 90 degrees, it moves parallel to the horizontal arrow from the preset avoidance position. The robot then performs action three.
[0047] Action 3: The robot walks along the same side edge of the carpet in the adjusted current walking direction for a preset edge distance, wherein the preset edge distance is greater than or equal to the robot's body diameter. Then, the robot performs Action 4.
[0048] Action 4: Walk in a circular arc towards the same edge of the carpet, corresponding to Figure 8 In the figure, the second robot on the left rotates to the upper left and enters the carpet; then repeats action 1 to trigger the detection of the carpet, such as Figure 8 As shown in the position 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 is triggered to detect the carpet. 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. Among them, the current walking direction of the first robot on the left is Figure 8 The first straight arrow on the left points to the upper left. While keeping the edge fitting line unchanged, perform step 3 to calculate a new target retreat distance and a new target rotation angle. This allows the robot to travel the target retreat distance in the opposite direction of its current walking direction without turning around, then exit the carpet to the preset avoidance position. The robot then adjusts its current walking direction to be parallel to the same edge of the carpet by rotating the target rotation angle.
[0049] Therefore, by executing actions one to four, the robot is controlled to perform edge cleaning movements along the carpet edge as it repeatedly enters and exits the carpet, and by introducing a target retreat distance and a preset avoidance position, the robot is prevented from going too deep into the carpet and causing damage to the carpet, which also facilitates maintaining the working efficiency of the robot's edge cleaning behavior along the carpet edge.
[0050] Based on the above embodiment, after the robot walks along the same side edge of the same carpet, it walks in a circular arc to the other side edge of the same carpet (if the same carpet is a rectangular carpet, when the robot walks along the bottom edge of the carpet and reaches the left edge of the carpet, the carpet edge detected by the robot changes by 90 degrees, and an error occurs when the previous current trigger position or historical trigger position is used) or the side edge of another carpet (there are multiple carpets in the environment, and other carpets are placed again). When the robot detects a carpet candidate result, since it has already walked along the same side edge of the same carpet, the currently detected carpet candidate result is from the same carpet. The robot enters the other side edge of the carpet or the other side edge of the carpet, and determines that the robot has begun to cross the other side edge of the same carpet or the other side edge of the 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 the robot enters the edge of the current carpet until the carpet is triggered and detected, and then steps 1 to 3 are performed to maintain the robot continuing to walk along the other side edge of the same carpet or the other side edge of the carpet by updating the edge fitting line. When the robot enters the edge of the current carpet again, the historical data of the edge fitting line is directly used to maintain the edge-following behavior.
[0051] As an example, when the target working behavior is a bow-shaped motion extending along the same side edge of the carpet, there are:
[0052] Whenever the robot is triggered to detect the carpet, it controls the robot to walk to the preset avoidance position by executing step 3 to completely exit the carpet, and then adjusts 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. Since the robot is currently performing a bow-shaped motion along the same side edge of the carpet, it corresponds to Figure 7 In the figure, the robot performs a bow-shaped motion along the actual carpet edge or the edge fitting line shown in the figure. The trajectory formed by the bow-shaped motion is shown outside the actual carpet edge shown in the figure. Therefore, the edge fitting line required to execute step 3 in the process of entering and exiting the same side edge is the same, that is, the pre-calculated 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 bow-shaped movement extending along the same side edge of the carpet is parallel to the same side edge of the carpet at its turning trajectory, corresponding to Figure 7 The trajectory formed by the bow-shaped motion extends from the upper right to the lower left, so the current walking direction after the above adjustment is also from the upper right to the lower left and parallel to the edge fitting line shown in the figure, especially the straight line trajectory of the bow-shaped motion at the turning point of its short side is parallel to the edge fitting line shown in the figure.
[0054] In order to meet the area coverage, the preset bending distance can be set to be less than or equal to the body radius of the robot, shortening the distance between the adjacent long straight tracks on both sides of the short side track formed by the bow-shaped motion.
[0055] It should be noted that when the target work behavior is a bow-shaped path, the robot may be a cleaning robot, and the cleaning trajectory generated on the hard surface other than the carpet is a bow-shaped cleaning path. Specifically, the bow-shaped path generated by the cleaning robot is composed of multiple parallel motion trajectory segments, wherein the vertical distance between two adjacent parallel motion trajectory segments (positionally adjacent) can be less than the body diameter of the cleaning robot, and each of the two adjacent parallel motion trajectory segments has an endpoint connected by a bend line or a short line segment (shorter than the parallel motion trajectory segment). In this application, the bend line or short line segment is adjusted to be parallel to the edge of the carpet currently being moved by the robot.
[0056] Those skilled in the art will understand that these mutually parallel motion trajectory segments are the long side routes of the bow-shaped motion, and the aforementioned bending lines or short line segments are the short side routes between two adjacent motion trajectory segments, so that these mutually parallel motion trajectory segments cover the reachable area of the robot. The aforementioned short side routes are initially set to be perpendicular to the motion trajectory segments or the initial cleaning direction, but in this application, when the robot triggers and detects the carpet and controls the robot to walk to the preset avoidance position by executing step 3, after rotating the target rotation angle, the current walking direction is adjusted to be parallel to the pre-calculated edge fitting line.
[0057] Based on the above embodiment, after the robot walks along the same side edge of the same carpet by performing the bow-shaped motion, when continuing to perform the bow-shaped motion, steps 1 to 3 are performed to configure the bow-shaped motion performed by the robot to extend successively along different side edges of the same carpet or successively along edges of different carpets by updating the edge fitting line; wherein the carpet edge along which the bow-shaped motion extends is the carpet edge along which the robot walks.
[0058] When the robot walks over the bottom edge of the carpet in a bow-shaped motion and reaches the left edge of the carpet, the carpet edge detected by the robot changes by 90 degrees, and an error occurs when using the previous current trigger position or historical trigger position) or the side edge of another carpet (if there are multiple carpets in the environment and other carpets are put on again). When the robot triggers and detects the carpet during the bow-shaped motion, since the same side edge of the same carpet has been walked, the currently detected carpet candidate result 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 begun 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, by executing steps 1 to 3 to update the edge fitting line, the bow-shaped motion performed by the robot is configured to extend successively along different side edges of the same carpet or successively along the edges of different carpets.
[0059] When the robot needs to execute step 1 at the edge of the carpet mentioned in the above embodiment, the more times step 1 is repeated, the more current trigger positions are obtained, and the more historical trigger positions are obtained in the subsequent step 2, the more times the edge fitting line is updated. The number of updates here is the cumulative number of calculations of the edge fitting lines at different carpet edges. In some embodiments, the edge fitting line is calculated once for the same carpet edge, and the number of trigger positions required for the calculation is at least two, including the current trigger position and the historical trigger position.
[0060] In some embodiments, the robot uses multiple ultrasonic sensors, each of which detects a current trigger position. When each ultrasonic sensor is triggered and detects the carpet at the same time, the installation positions of these ultrasonic sensors are considered to be located on a straight line parallel to the edge of the carpet, thereby achieving multiple current trigger positions in the carpet at the same time.
[0061] In the scenario where steps 1 to 3 are repeatedly executed or step 3 is repeatedly executed, the current trigger position obtained in the last execution of step 1 is updated to the historical trigger position in the current execution of step 2. A current trigger position and multiple historical trigger positions are provided to participate in straight line fitting, and an edge fitting line parallel to the edge of the same carpet or multiple edge fitting lines parallel to the edges of different carpets are calculated. As the historical trigger positions increase, the number of edge fitting lines can be increased to simulate carpet edges of different directions, and the edge fitting lines parallel to the edge of the same carpet can also be corrected to achieve the update of the edge fitting lines.
[0062] Therefore, as the current trigger position and historical trigger positions increase, a more comprehensive and accurate edge fitting line is inferred, which improves the accuracy of the inferred relative position of the carpet edge and the direction of the carpet edge (carpet placement trend). When used in cleaning scenarios near the carpet edge, the carpet shape and coverage range are inferred, and the cleaning coverage rate of the outside of the carpet area is improved, which also prevents the robot from entering the carpet too deeply and causing the risk of the wet mop dirtying the carpet.
[0063] As an embodiment, after the robot obtains the edge fitting line by executing step 2, when the robot triggers and detects the carpet and the current trigger position is in the carpet area between the edge of the carpet along which the robot is walking and the edge fitting line currently obtained, if the vertical 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, driving the center of the body to move toward the edge of the carpet along which the robot is walking, and then the robot can start to perform logical processing such as deceleration or early avoidance, including decelerating 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 too long into the carpet.
[0064] It should be noted that, combined with Figure 3It can be seen that the installation position of the ultrasonic sensor on the robot's body chassis is closer to the collision plate on the front side of the robot in the current walking direction relative to the center of the body. The front side here refers to the side of the robot's casing in the current walking direction. Along the current walking direction, when the installation position of the ultrasonic sensor crosses the edge of the carpet and reaches the edge fitting line, the carpet is triggered and detected, that is, the ultrasonic detection is triggered, and the center of the body is also close to the edge of the carpet along the current walking direction. In other words, when the center of the body reaches the edge of the carpet, the ultrasonic sensor has triggered and detected the carpet.
[0065] As an embodiment, after the robot currently obtains the edge fitting line by executing step 2, during the robot's walking process, if the robot does not trigger the detection of the carpet from the time the robot detects the carpet candidate result to the installation position of the ultrasonic sensor crossing the currently obtained edge fitting line, it is determined that the robot has walked to the corner position of the carpet; specifically, in the process of the robot using the target retreat distance obtained in the last step 3 to exit the carpet to the preset avoidance position, the robot may start from the carpet corner position and walk the target retreat distance to the outside of the carpet to the preset avoidance position, and then start from the preset avoidance position and walk back to the carpet in a straight line, for example, when starting to cross the edge of the carpet, the robot detects the carpet candidate result, but the installation position of the ultrasonic sensor moves to or even crosses the currently obtained edge If no carpet is detected during the line fitting process, a blind spot is determined to exist between the robot and the detected carpet edge, including the undetected carpet edge. A patching action is required, including at least one of the following: rotating by changing angular velocity, turning by changing angular velocity and linear velocity, or moving forward or backward by changing linear velocity. To perform the patching action, this embodiment uses a differential speed between the robot's left and right drive wheels to create a turning arc, forming an arc trajectory between the detected carpet edge and the blind spot. The robot then moves around the arc to the undetected carpet edge, adds carpet edge information to the carpet, and then executes steps 1 to 3. Based on the carpet detection, the edge fitting line and the preset avoidance position are sequentially updated. This allows the robot to traverse at least a portion of the blind spot. Alternatively, the robot can perform two circular arcs, with the trajectories formed by the two arcs being orthogonal, to ensure that most or all of the blind spot, i.e., the blind spot, is patched once.
[0066] From another perspective, when the robot reaches the corner of the carpet, it has already walked along one edge of the same carpet and needs to enter the other edge of the same carpet. Otherwise, it continues to perform the target work behavior along one edge of the same carpet and repeatedly enters and exits the carpet near one edge of the same carpet by repeating step 3. Each time the robot crosses the edge fitting line, the carpet is not triggered to be detected, which is considered to be walking to the corner of the carpet each time. The corner of the carpet can be located on the boundary line between the detected carpet and the working blind area. After the robot walks to the corner of the carpet, it does not regard the working blind area as a carpet area and does not continue to detect the working blind area. Therefore, it is necessary to fill the gap in the working blind area.
[0067] As an embodiment, in step 1, when the robot detects the carpet through the ultrasonic sensor, the method for obtaining the current trigger position includes: combining Figure 4 It can be seen that when the robot is triggered to detect 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 reset position to detect the hard ground without turning around, driving the installation position of the ultrasonic sensor back to the hard ground, detecting the corresponding change in the ultrasonic data caused by the ultrasonic reflection signal, and determining that the hard ground state has been restored; then, the robot rotates the preset trigger angle on the hard ground to obtain the longitudinal axis of the body after rotation, wherein the robot uses the extension direction of the longitudinal axis of the body toward the front side of the body to represent the current walking direction, so the direction of the longitudinal axis of the rotated body pointing to the front side of the robot 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 rotated body until the carpet is triggered and detected, and the installation position of the ultrasonic sensor is marked as the second trigger position, that is, the robot follows Figure 4 After the rotation, the robot moves in the direction shown until it reaches the ultrasonic sensor's installation location and enters the edge fitting line indicated by the arrow. The robot then detects the carpet again and marks the ultrasonic sensor's installation location as the second trigger position. The second trigger position is then marked as the current trigger position, and the first trigger position is marked as the historical trigger position. This allows the current trigger position to be set using the trigger positions obtained from two consecutive carpet detections.
[0068] After marking the second trigger position, if the robot walks in a straight line without turning around until it detects a hard surface, then rotates to a preset trigger angle (which can be less than 45 degrees), and then walks along the rotated longitudinal axis until it detects a carpet, the ultrasonic sensor's installation location is marked as the third trigger position. The third trigger position is then marked as the current trigger position, and the second trigger position is marked as the historical trigger position. This allows the current and historical trigger positions to be updated using the trigger positions obtained from two consecutive carpet detections.
[0069] Based on the above embodiment, in step 2, the method of calculating the edge fitting line using the current trigger position and the historical trigger position includes:
[0070] When a current trigger position and a historical trigger position are obtained by executing step 1 once, a straight line equation is constructed from the coordinates of the current trigger position and the coordinates of the historical trigger position to obtain an 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. After substituting them into the distance formula between the two points, the parameters are obtained, and then the straight line equation is constructed from the parameters and coordinate variables. Then, the straight line equation is represented as the edge fitting line in the map and is located within the carpet. The robot is equipped with an ultrasonic sensor, and a historical trigger position and a current trigger position detected successively 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 from the historical trigger position to the current trigger position. Schematically, as shown in FIG. Figure 4 As shown in the direction in which the edge fitting line in FIG extends to the left, the edge fitting line is preferably parallel to the lower edge of the carpet, so as to indicate the direction in which the robot walks along the edge of the carpet parallel to the edge fitting line.
[0072] Alternatively, a method for calculating an edge fitting line includes: when multiple current trigger positions and multiple historical trigger positions are accumulated by executing step 1 once, performing a straight line fitting process on 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 equipped with multiple ultrasonic sensors, and the robot can simultaneously obtain multiple current trigger positions by executing step 1 once. When the robot detects the carpet using 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. A straight line fitting process can be performed on all current trigger positions and the historical trigger positions. One ultrasonic sensor corresponds to one current trigger position, and the number of current trigger positions and the number of historical trigger positions are equal. When the robot detects the carpet using only some ultrasonic sensors, the number of ultrasonic sensors is greater than the number of current trigger positions, and a straight line fitting process can be performed on all current trigger positions. 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 of the carpet, the outline of the carpet can be formed, and the shape of the carpet can be inferred. Based on this, parameters such as the distance and rotation angle required for the robot to exit the carpet can be calculated, so as to facilitate the planning of the subsequent robot motion trajectory.
[0074] Specifically, in step 1, when the robot detects a carpet candidate using the ultrasonic sensor, it determines that the ultrasonic sensor's detection position has changed from other floor media to the carpet. This can also be understood as the ultrasonic sensor's installation position having moved from other floor media to the carpet. In some operating scenarios, the ultrasonic sensor's detection position remains within the carpet. The robot detects the carpet candidate by performing a 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 ultrasonic sensor's detection position remains on the hard floor. When the ultrasonic data received by the ultrasonic sensor is less than or equal to the preliminary judgment threshold, the ultrasonic sensor's detection position changes to the carpet, which is considered a carpet candidate. At this point, the robot preliminarily detects the carpet.
[0075] Then, as the robot walks on the carpet, it samples multiple frames of ultrasonic data by counting a detection cycle, and filters all the sampled frames. Schematically, the detection time for a frame of ultrasonic data is set to 18-20ms. By sequentially sampling 10 frames of ultrasonic data, a detection cycle of approximately 200ms can be counted. The filtering process disclosed in this application is configured to filter out interference from real-world scenarios, such as robot jitter and gaps between floor tiles. The filtering process disclosed in this application utilizes filtering algorithms pre-programmed within the ultrasonic sensor. These filtering algorithms include clipping, median filtering, arithmetic averaging, recursive averaging (sliding average filtering), median averaging (pulse interference-proof averaging), and clipping averaging. This approach is applicable to applications where ultrasonic sensors collect ultrasonic data and the accuracy requirements of ultrasonic detection of ground media are required.
[0076] From the moment the ultrasonic sensor enters the carpet, it can already distinguish between carpet and hard surfaces. However, it typically performs a counter filter to eliminate false positives. The robot then determines whether it has triggered carpet detection based on the filtering result. Specifically, the filtering result is compared with a preset threshold. If the filtering result is greater than the threshold, the robot has not triggered carpet detection. This may be because the robot was walking on carpet but the ultrasonic sensor's detection position has already entered the hard surface. If the filtering result is less than or equal to the threshold, the robot has triggered carpet detection.
[0077] If the robot is triggered and detects a carpet, the ultrasonic sensor's installation location is marked as the first trigger location or the second trigger location. Specifically, when the robot is triggered and detects a carpet for the first time, the ultrasonic sensor's installation location is marked as the first trigger location. The robot then moves back in a straight line to a hard surface, rotates its longitudinal axis by a preset trigger angle, and then moves to the carpet. When the robot is triggered and detects a carpet again, the ultrasonic sensor's installation location is marked as the second trigger location. Preferably, the ultrasonic sensor's detection location covers the ultrasonic sensor's installation location.
[0078] The ultrasonic sensor's reflected signal intensity (represented by ultrasonic data) is the signal reflected from the robot's walking surface, converted to a level signal through analog-to-digital conversion. The robot uses the ultrasonic sensor to detect the strength of the signal reflected from the surface, particularly carpets, to prevent them from accidentally entering and reduce carpet contamination.
[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 preset safety distance, and the body radius of the robot includes:
[0080] When the robot detects a carpet candidate result through the ultrasonic sensor, it determines that the robot has entered the carpet from other ground media. Specifically, it determines that the robot has crossed one side edge of the carpet, counts one detection cycle, and calculates in real time the distance the robot has traveled in the current walking direction. When the robot triggers and detects 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 is expressed as the distance from the edge fitting line to the side edge crossed by the robot; specifically, the time from the detection of the carpet candidate result to the triggering of the carpet detection is one detection cycle, and the distance traveled by the robot in the current walking direction within one detection cycle is calculated, that is, the speed measured by the control robot is multiplied by the detection cycle to obtain the distance traveled by the robot in the current walking direction.
[0081] It should be noted that since the mark of the current trigger position needs to be filtered, and the filtering process needs to go through a detection cycle, the robot will walk the distance it enters the carpet within the detection cycle based on its walking speed, that is, the robot trigger distance.
[0082] Combine Figure 6 It can be seen that the angle between the current walking direction of the robot and the edge fitting line is marked as the target rotation angle, and the projection distance of the robot trigger distance in the vertical direction of the edge fitting line is calculated, and then the projection distance is equivalent to Figure 5The sensor trigger distance shown is equivalent to calculating Figure 6 The distance between the mid-edge fitting line and its nearest carpet edge is also equivalent to Figure 5 The distance between the true edge line and the edge fitting line.
[0083] When the edge fitting line is parallel to the nearest carpet edge, the map coordinates of the edge fitting line are controlled to be subtracted from the sensor trigger 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 in the process of walking from the hard ground to detecting the carpet candidate result.
[0084] Combine Figure 5 and Figure 6 It can be seen that the sum of the sensor trigger distance, the safety distance and the robot's body radius is marked as the avoidance distance; among them, the safety distance can be set with an empirical value of 2cm to 5cm, so that when the cleaning robot performs the target work behavior (for example, planning to clean near the edge of the carpet), a certain gap is reserved between the mop installed by the cleaning robot and the carpet.
[0085] Then, based on the trigonometric relationship between the avoidance distance and the geometric model of the target rotation angle, the ratio between the avoidance distance and the sine value of the target rotation angle is calculated to obtain the retreat planning distance, that is, a slant line from the preset avoidance position to the edge fitting line passing through the center R of the body, where the line segment RH is located in the slant line, and the angle formed by the slant line and the edge fitting line in the directions of their respective arrows is the target rotation angle.
[0086] The ratio of the distance from the robot's body center to the edge fitting line to the sine value of the target rotation angle is calculated to obtain the body redundant distance, wherein a line segment extending from the body center R with a length of the body redundant distance is located on the oblique line, so that the line segment with a length of the body redundant distance and the line segment RH constitute the oblique line.
[0087] Then, the planned retreat distance is controlled to be subtracted from the redundant distance of the aircraft body, and the difference obtained by the subtraction is marked as the target retreat distance, that is, Figure 6 The length of the line segment RH shown; after the robot walks the target backward distance in the opposite direction of the current walking direction without turning around, the center of the robot's body 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 robot body relative to the center of the robot body, which is schematically represented as Figure 6 The current trigger position (the current installation position of the ultrasonic sensor) is located at the upper right of the center of the robot's body.
[0089] Combine Figure 2 It can be seen that the robot walks on the carpet from different angles, forming Figure 2 Current walking direction, which is slightly to the left, Figure 2 The current walking direction in the middle and Figure 2 In the current walking direction, slightly to the right of the center, when the ultrasonic sensor is triggered and detects the carpet, the distance the robot enters the carpet varies. By executing step 3, the robot dynamically calculates the target retreat distance based on the edge fitting line, the robot's current walking direction, the preset safety distance, and the robot's body radius, using trigonometric functions to calculate the target retreat distance. This ensures that the robot can retreat to the edge of the carpet from any direction. This prevents the robot from not fully retreating to the carpet due to a shortened distance from the carpet back to the hard floor, which could result in the robot's subsequent cleaning action potentially soiling the carpet with a wet mop. It also prevents the robot from retreating too far from the carpet back to the hard floor, which increases the gap between the robot and the carpet, resulting in the risk of missing areas near the carpet when cleaning.
[0090] As an embodiment, in 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: combining Figure 6 It can be seen that when the robot triggers and detects the carpet and calculates the target retreat distance RH, the center of the robot body walks the target retreat distance in the opposite direction of the current walking direction to the preset avoidance position, and then calculates the angle between the current walking direction of the robot and the edge fitting line, and then marks the angle 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 Figure 6 In the figure, after the robot's body center retreats from position R to the preset avoidance position shown in the figure, it rotates counterclockwise by the target rotation angle shown in the figure. The current walking direction after the rotation becomes parallel to the edge fitting line. Starting from the preset avoidance position shown in the figure, the robot walks from right to left. The arrow of the edge fitting line in the figure points horizontally to the left, that is, the edge of the carpet 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 preset avoidance position in the aforementioned target working behavior.
[0091] Although the present invention has been described in detail with reference to preferred embodiments, ordinary technicians in the field should understand that the specific implementation methods 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, they should all be included in the scope of the technical solution for protection of the present invention.
Claims
1. A method for avoiding carpets by a robot 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 the carpet through the ultrasonic sensor, it obtains the current trigger position; then proceeds to step 2; Step 2: Calculate the edge fitting line using the current trigger position and the historical trigger position to determine the position and direction of the carpet edge that the robot is currently crossing; then proceed to step 3; Step 3: Calculate a target retreat distance based on the edge fitting line, the robot's current walking direction, a preset safety distance, and the robot's body radius, so that the robot walks the target retreat distance in the opposite direction of the current walking direction without turning around, and then exits the carpet to a preset avoidance position; and calculate a target rotation angle based on the robot's current walking direction and the edge fitting line, so that the robot adjusts the current walking direction to be parallel to the edge of the carpet by rotating the target rotation angle.
2. The method according to claim 1, characterized in that During the process of the robot performing the target work behavior, when the robot detects a carpet candidate result, the robot executes steps 1 to 3 or executes step 3 to obtain a target retreat distance, and then the robot walks the target retreat distance in the opposite direction of the current walking direction to the preset avoidance position without turning around, 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 work behavior, so that the trajectory formed by the target work behavior extends along the edge of the carpet; Each time step 3 is executed, the target retreat distance and the target rotation angle are updated once, so that the preset avoidance position is updated once; When the robot detects a carpet candidate, it enters the carpet and walks on the carpet in the current walking direction until the carpet is triggered and detected.
3. The method according to claim 2, characterized in that When the target working behavior is to walk along the same side edge of the carpet, when the robot detects a carpet candidate result, the target working behavior is suspended and a straight-line walking is performed instead until the carpet is triggered and detected. Then, step 3 is performed to obtain the target retreat distance, and the robot is controlled to walk to a preset avoidance position to completely exit the carpet. Then, at the preset avoidance position, the current walking direction is adjusted to be parallel to the pre-calculated edge fitting line by rotating the target rotation angle. Then, the robot walks along the same side edge of the carpet for a preset edge distance according to the adjusted current walking direction, and then walks toward the same side edge of the carpet in a circular arc manner until the carpet is triggered and detected. Then, step 3 is performed while keeping the edge fitting line unchanged.
4. The method according to claim 3, characterized in that After the robot walks along the same side edge of the same carpet, and then walks in an arc toward the other side edge of the same carpet or one side edge of another carpet, when the robot detects a carpet candidate result, it performs straight-line walking until a carpet is detected, and then executes steps 1 to 3 to walk along the other side edge of the same carpet or one side edge of another carpet by updating the edge fitting line.
5. The method according to claim 2, characterized in that When the target working behavior is a bow-shaped motion extending along the same side edge of the carpet, each time the robot is triggered and detects the carpet, step 3 is executed to control the robot to walk to a 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. Then, the robot walks a preset bending distance along the same side edge of the carpet in the adjusted current walking direction, so that the trajectory of the bow-shaped motion extending along the same side edge of the carpet at its turning point is parallel to the same side edge of the carpet.
6. The method according to claim 5, characterized in that After the robot has walked along the same side edge of the same carpet by performing the bow-shaped motion, when continuing to perform the bow-shaped motion, steps 1 to 3 are performed to configure the bow-shaped motion performed by the robot to extend successively along different side edges of the same carpet or successively along edges of different carpets by updating the edge fitting line; wherein the carpet edge along which the bow-shaped motion extends is the carpet edge along which the robot is walking.
7. The method according to claim 4 or 6, characterized in that The more times step 1 is repeated, the more current trigger positions are obtained, and the more historical trigger positions are obtained in the subsequent step 2, so that the edge fitting line is updated more often; The current trigger position obtained in the last executed step 1 is updated to the historical trigger position in the current executed step 2.
8. The method according to claim 7, characterized in that After the robot obtains the edge fitting line by executing step 2, when the robot triggers and detects the carpet and the current trigger position is in the carpet area between the edge of the carpet along which the robot is walking and the edge fitting line currently obtained, if the vertical distance from the current trigger position to the edge fitting line is less than or equal to the preset detection distance, the robot decelerates and walks or starts walking in the opposite direction of the current walking direction without turning around.
9. The method according to claim 7, characterized in that After the robot obtains the edge fitting line by executing step 2, during the robot's walking process, if the robot does not trigger the detection of the carpet from the time the robot detects the carpet candidate to the installation position of the ultrasonic sensor crossing the currently obtained edge fitting line, it is determined that the robot has walked to the corner of the carpet.
10. The method according to claim 7, characterized in that In step 1, when the robot detects the carpet through the ultrasonic sensor, the method for obtaining the current trigger position includes: When the robot is triggered and detects a 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 without turning around until it resets and detects a hard ground. Then, it rotates to a preset trigger angle and walks along the rotated longitudinal axis of the body until the carpet is triggered and detected. At this time, the installation position of the ultrasonic sensor is marked as the second trigger position. The second trigger position is then marked as the current trigger position, and the first trigger position is marked as the historical trigger position. The robot then uses the extension direction of the longitudinal axis of the body toward the front side of the body to represent the current walking direction.
11. The method according to claim 10, characterized in that In step 2, the method for calculating the edge fitting line using the current trigger position and the historical trigger position includes: When a current trigger position and a historical trigger position are obtained by executing step 1 once, a straight line equation is constructed from the coordinates of the current trigger position and the coordinates of the historical trigger position to obtain an edge fitting line, wherein the robot is equipped with an ultrasonic sensor; Alternatively, when multiple current trigger positions and multiple historical trigger positions are accumulated by executing step 1 once, the coordinates of the multiple current trigger positions and the coordinates of the multiple historical trigger positions are subjected to straight line fitting processing to obtain an edge fitting line, wherein the robot is equipped with multiple ultrasonic sensors.
12. The method according to claim 10, characterized in that In step 1, when the robot detects a carpet candidate through the ultrasonic sensor, it determines that the detection position of the ultrasonic sensor has changed from other ground media to the carpet. Then, while the robot walks on the carpet, it samples multiple frames of ultrasonic data by counting one detection cycle, and filters all the sampled frames of ultrasonic data. Then, based on the filtering results, it determines whether the robot has triggered the detection of the carpet. If the robot is triggered and detects the carpet, the installation position of the ultrasonic sensor is marked as the first trigger position or the second trigger position; The robot detects the carpet candidate result by performing threshold comparison on the ultrasonic data received by the ultrasonic sensor.
13. The method according to claim 12, characterized in that 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 preset safety distance, and the body radius of the robot includes: After the robot detects a carpet candidate using the ultrasonic sensor, it counts one detection cycle and calculates in real time the distance the robot has traveled in its current walking direction. When the robot detects a carpet, the distance calculated in real time is marked as the robot trigger distance, which is the distance from the edge fitting line to the edge of the side that the robot has crossed. The angle between the robot's current walking direction and the edge fitting line is marked as the target rotation angle. The projection distance of the robot's trigger distance in the vertical direction of the edge fitting line is calculated and marked as the sensor trigger distance. The sum of the sensor trigger distance, the safety distance, and the robot's body radius is marked as the avoidance distance. The ratio of the avoidance distance to the sine of the target rotation angle is then calculated to obtain the planned retreat distance. Calculating the ratio of the distance from the center of the robot body to the edge fitting line to the sine value of the target rotation angle to obtain the body redundant distance; Then, the planned retreat distance is controlled to be subtracted from the redundant distance of the body, and the difference obtained by subtraction is marked as the target retreat distance, so that the robot walks the target retreat distance in the opposite direction of the current walking direction without turning around, and the center of the robot's body reaches the preset avoidance position.
14. The method according to claim 1, wherein In 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 triggers and detects the carpet and calculates the target retreat distance, the robot's body center walks the target retreat distance in the opposite direction of the current walking direction to the preset avoidance position, and then calculates the angle between the robot's current walking direction and the edge fitting line, and then marks the angle 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
Ultrasonic-based motion planning method for ground environments
CN115755881B
Carpet detection method and device of cleaning robot, cleaning robot and medium
CN113974507A
Carpet detection method, carpet detection device, cleaning robot and storage medium
CN117179637A