Carpet edge detection method based on ultrasonic waves, chip and robot
Through ultrasonic sensors to detect the carpet edge and calculate the edge fit line, the problem that cleaning robots find it difficult to identify the carpet edge is solved, and the carpet edges are accurately identified and avoided, improving cleaning fluency and efficiency.
Patent Information
- Application Number
- CN202411085319.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-12
AI Technical Summary
Existing cleaning robots have difficulty accurately identifying and avoiding carpet edges, resulting in possible staining of carpet during mopping.
The carpet edge detection method is adopted based on ultrasonic waves, and the carpet edge is detected through ultrasonic sensors. The edge fitting line is calculated using the current and historical trigger positions, the relative position of the carpet edge is determined, and the robot's walking direction is adjusted to avoid the carpet edge.
Improves the accuracy of carpet edge recognition and the robot's cleaning fluidity near carpets, reducing the degree of contamination of carpets.
Smart Images

Figure CN118937483A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of carpet recognition, and in particular to an ultrasonic-based carpet edge detection method, chip and robot. Background Art
[0002] The cleaning robot with mopping function is equipped with a wet mop on the chassis to mop the whole house. What needs to be avoided during the mopping process is the carpet. Whether it is an inertial navigation model, a visual model, a traditional laser model or even an ordinary line laser model, the sensor on the cleaning robot itself is difficult to identify the edge of the local carpet.
[0003] The Chinese invention patent with 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 area into multiple carpet partitions after traversing an entire hard floor area or walking along the boundary line of the carpet. The cleaning robot 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 completing the traversal of the carpet partition for a predetermined time, the cleaning robot will withdraw the carpet. Since the Chinese invention patent with patent application number CN202211238871.8 does not specifically identify the edges of the carpet partitions, but only walks along a cleaning trajectory parallel to the boundary line of the overall carpet area, it does not solve the problem of identifying the edge position of the local carpet. Summary of the invention
[0004] This application discloses a carpet edge detection method, chip and robot based on ultrasound, and proposes the following technical solutions: The method for detecting carpet edge based on ultrasonic wave is applied to a robot equipped with ultrasonic sensor, and the method for detecting carpet edge includes: step 1, when the robot detects the carpet through ultrasonic sensor trigger, the current trigger position is obtained through preprocessing; then step 2 is executed; step 2, the edge fitting line is calculated by using the current trigger position and the historical trigger position; then step 3 is executed; step 3, the relative position of the carpet edge crossed by the robot in the process is calculated by using the edge fitting line and the distance traveled by the robot from the initial detection of the carpet to the trigger detection of the carpet. Thus, the coverage boundary of the carpet relative to the robot is determined, so that the robot can identify the carpet edge when moving near the carpet at different angles and avoid the identified carpet edge in time.
[0005] Furthermore, in step 1, when the robot detects the carpet through the ultrasonic sensor, the method for obtaining the current trigger position through preprocessing includes: when the robot detects the carpet for the first time, the installation position of the ultrasonic sensor is marked as the first trigger position, and then the robot walks in a straight line without turning around until the hard ground is triggered and detected, and then rotates the preset trigger angle, and then walks in a straight line along the 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; then the second trigger position is updated as the current trigger position, and the first trigger position is updated as the historical trigger position; wherein the robot uses the extension direction of the longitudinal axis of the body to the front side of the body to represent the current walking direction. Thus, the current trigger position is set based on the trigger positions obtained by entering the carpet for trigger detection twice in a row.
[0006] Furthermore, 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 times; wherein, the current trigger position obtained in the previously executed step 1 is updated to the historical trigger position in the currently executed step 2.
[0007] As the number of historical trigger positions increases, the number of edge fitting lines can be increased to simulate carpet edges of different directions, and the edge fitting lines parallel to the same carpet edge can be corrected to update the edge fitting lines. Therefore, as the current trigger position and historical trigger positions increase, more comprehensive and more accurate edge fitting lines are inferred, which improves the accuracy of the inferred relative position of the carpet edge and the direction of the carpet edge (carpet placement trend). In cleaning scenarios near the carpet edge, the carpet shape and coverage are inferred, and the robot is reminded to avoid entering the carpet too deeply and causing the risk of the wet mop dirtying the carpet.
[0008] Further, in the step 2, the method of 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 the edge fitting line, wherein the edge fitting line is a straight line represented by the constructed straight line equation; therefore, when a current trigger position and multiple historical trigger positions are cumulatively obtained by executing step 1 multiple times, a straight line fitting process is performed on the coordinates of the current trigger position and the coordinates of multiple historical trigger positions to obtain the edge fitting line to simulate the edge shape of the carpet.
[0009] Alternatively, when multiple current trigger positions and multiple historical trigger positions are accumulated by executing step 1 once, the coordinates of one current trigger position and the coordinates of 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, and the robot can simultaneously obtain multiple current trigger positions by executing step 1 once, so that the relative position inferred by the edge fitting line becomes more accurate.
[0010] Furthermore, in step 1, when the robot initially detects the carpet through the ultrasonic sensor, it determines that the robot has entered the carpet from other ground media, and then, while the robot is walking on the carpet, it samples multiple frames of ultrasonic data by counting a 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 according to the filtering result; if the robot triggers the detection of the carpet, the position of the ultrasonic sensor is marked as the current trigger position. The robot can improve the carpet recognition accuracy by counting and filtering, reduce the probability of the robot mistakenly entering the carpet, and reduce the degree of contamination of the carpet.
[0011] Furthermore, in step 3, the method of calculating the relative position of the edge of the carpet crossed by the robot in the process 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 spent 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 changing from the position at the time of the initial detection of the carpet to the trigger position, calculating the distance traveled by the robot in the vertical direction of the edge fitting line according to a predetermined speed, and then marking the calculated distance as the pre-detection distance to indicate the distance between the edge fitting line and the edge of the carpet crossed by the robot in the process; wherein the trigger position is the current trigger position or the historical trigger position; when the edge fitting line is parallel to the edge of the carpet crossed by the robot in the process, controlling the map coordinates of the edge fitting line to subtract the pre-detection distance to obtain the relative position of the edge of the carpet crossed by the robot in the process. Thus, the positioning accuracy of the relative position of the edge of the carpet is improved by counting and filtering.
[0012] Furthermore, after the robot walks along the same side edge of the same carpet, it adjusts the current walking direction to walk to the other side of the same carpet or another carpet. When the robot triggers and detects the carpet, steps 1 to 3 are executed to identify the new carpet edge by updating the edge fitting line.
[0013] Furthermore, step 3 also includes: calculating the angle formed by the current body axis of the robot relative to the edge fitting line, and then marking the angle as the target rotation angle, so that the robot adjusts the current body axis 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.
[0014] A chip is used to store and execute a computer program, and the computer program is executed to implement the carpet edge detection method. The chip obtains an edge fitting line by executing steps 1 to 3, simulates the edge of the carpet, updates it to the map in time, and integrates it to form a carpet edge enclosed area.
[0015] A robot, the chip is installed inside the robot, an ultrasonic sensor is installed on one side of the robot body, and the robot is used to perform the carpet edge detection method; wherein the position layout of the ultrasonic sensor on the robot body is fixed in advance. By executing steps 1 to 3, the robot uses the coordinates of the edge fitting line in the map to subtract the distance the robot walks from the initial detection of the carpet to the trigger detection of the carpet, and obtains the coordinates of the relative position of the edge of the carpet crossed by the robot in the process. In this way, the coverage boundary of the carpet relative to the robot is determined, so that the robot can identify the edge of the carpet when moving near the carpet at different angles and avoid the identified carpet edge in time, so that the robot can walk more smoothly near the carpet. 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 a machine center of a robot provided in one embodiment of the present application.
[0018] Figure 3 A schematic diagram of a robot provided in an embodiment of the present application triggering and detecting a first trigger position and a second trigger position on a carpet in sequence, and fitting an edge fitting line.
[0019] Figure 4 A schematic flow chart of a carpet edge detection method based on ultrasound provided in one embodiment of the present application. DETAILED DESCRIPTION
[0020] 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.
[0021] The carpet described in this application is a broad concept, which can be understood as a floor material different from hard materials such as wooden floors and tiles. The walking of the cleaning robot on the carpet may cause the output power of the roller brush motor or the drive wheel motor to change, or the floor material is not suitable for the cleaning robot to clean in the mopping mode; specifically, the carpet can be: a short-haired carpet, a long-haired carpet, a plush mat, etc. The cleaning robot can be a robot with a cleaning mechanism and a mopping mechanism installed on the chassis. The robot involved in this application can use one of the cleaning mechanism or the mopping mechanism or both to contact the cleaning surface during the cleaning process 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 by the mopping mechanism itself may wet or damage the carpet. Therefore, it is necessary to identify the edge of the carpet in time to plan the cleaning range of the robot near the carpet.
[0022] The present application discloses a carpet edge detection method based on ultrasound, which 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 robot chassis position layout, 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 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 body (head). It should be noted that Figure 1 The bottom structure of the robot is shown in the upward perspective, but the left and right divisions are based on the top-down perspective.
[0023] In some embodiments, the ultrasonic sensor can continuously collect ultrasonic data of the detected plane area at intervals of 6 ms, and the robot can convert the regional position coordinate information detected by the ultrasonic sensor into a map. 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 and the surface feedback of the walking plane, which is generally expressed by the level size, and the medium type of the ground surface can be distinguished according to the intensity of the ultrasonic signal.
[0024] Since the surface of the carpet and the hard ground (wooden floors or tiles and other hard ground surfaces 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 walks along the planned path, 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, based on which it can be determined that the carpet is identified. If the left and right driving wheels of the robot are on the hard ground and only the universal wheel climbs onto the carpet, the ultrasonic sensor can detect the carpet. At this time, the robot's grip is still there and no slipping occurs.
[0025] It should be noted that a map will be constructed during the robot's walking process. The map is the first time the robot is used. It uses various sensors it carries (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 map containing environmental information.
[0026] The ultrasonic carpet edge detection method disclosed in this application involves the following steps: Figure 4 As shown, specifically including: Step 1: When the robot detects the carpet through the ultrasonic sensor, the current trigger position is obtained through preprocessing; then step 2 is executed. The trigger detection in step 1 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. The preprocessing in step 1 means that when the filtering processing result meets the threshold condition, the latest covered position of the ultrasonic sensor on the ground is set as the current trigger position, which can also be understood as marking the installation position of the ultrasonic sensor (relative to the center of the body) as the current trigger position; it is worth noting that the carpet is detected by triggering in step 1, 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. At this time, the ultrasonic sensor has been offset by a distance relative to the edge of the carpet.
[0027] In some embodiments, the robot will identify the edge of the carpet when entering or exiting the carpet; 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 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 edge of the stepped carpet is greater than the preset distance threshold, the carpet is detected; or it will distinguish 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 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 hard floor is detected.
[0028] When the robot enters the carpet and triggers the detection of the carpet, it is considered to trigger the ultrasonic detection, and the coordinates of the current installation position of the ultrasonic sensor are recorded as the coordinates of the current trigger position and marked on the map. Schematically, Figure 3 As shown, the robot will establish a map coordinate system during its walking process. The center of the robot is the origin of the coordinate system. The current walking direction of the robot (the direction of the longitudinal axis of the body) is the Y axis, and the coordinate axis perpendicular to the Y axis is the X axis. The robot knows the position of the center of the body in real time and reflects it in the map. 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 current trigger position in the map to update the carpet information marked on the map. The robot did not trigger the detection of the carpet and walked in the direction of exiting the carpet until the robot triggered the detection of the hard ground, which can be understood as the ultrasonic detection reset. The robot / ultrasonic sensor has completely exited the carpet.
[0029] Step 2, using the current trigger position and the historical trigger position to calculate the edge fitting line, including calculating the coordinate range spanned by the edge fitting line in the map and the corresponding straight line equation, the coordinate of the edge fitting line in one of the coordinate axis directions, and based on this, the position of the carpet edge currently crossed by the robot is deduced; then step 3 is executed. Among them, the historical trigger position can be updated by the current trigger position; step 2 calculates the edge fitting line based on the robot crossing the edge of the carpet from the hard ground, and can directly use a current trigger position and a historical trigger position to construct a straight line equation to represent the edge fitting line, or use at least one current trigger position and at least one historical trigger position to perform straight line fitting processing to obtain the edge fitting line. Then, the edge fitting line can be used to simulate the edge of the carpet currently crossed by the robot, and the position of the carpet edge currently crossed by the robot is calculated based on the distance the robot walks in the carpet after crossing the carpet edge, and the direction of the corresponding carpet edge is determined based on the direction from a historical trigger position to a current trigger position.
[0030] In step 2, each time the coordinates of an edge fitting line are 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, when the robot walks the certain distance, it can distinguish between carpet and other ground detection results. 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. Obtaining a carpet candidate result is described as preliminarily detecting a carpet, and obtaining a hard ground candidate result is described as preliminarily detecting a hard ground. 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 to be detected. Otherwise, it is classified as a candidate result for carpet detection before reaching the current 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 to be detected. Otherwise, it is classified as a candidate result for hard ground detection before the robot completely enters the hard ground or the preset avoidance position. Equivalently, both triggering the detection of carpet and triggering the detection of hard floor can 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 the detection of carpet and triggering the detection of hard floor can improve the recognition accuracy of carpet and hard floor respectively.
[0031] Step 3: Using the edge fitting line and the distance that 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 that the robot crosses during the process, which is equivalent to calculating the relative position of the edge of the carpet closest to the edge fitting line in some embodiments. Therefore, the robot uses the coordinates of the edge fitting line in the map minus the distance that the robot travels from the initial detection of the carpet to the trigger detection of the carpet to obtain the coordinates of the relative position of the edge of the carpet that the robot crosses during the process.
[0032] Specifically, in step 3, the carpet edge closest to the edge fitting line or the carpet edge crossed by the robot in the process is the carpet edge that is parallel to the edge fitting line and the robot's ultrasonic sensor reciprocates in and out in the process of obtaining the current trigger position and the historical trigger position; the ultrasonic sensor enters the carpet from the hard ground through the carpet edge in step 1, and then the distance walked by the robot in the carpet after crossing the carpet edge is regarded as the distance between the edge fitting line and the carpet edge currently crossed by the robot, based on which the position of the carpet edge currently crossed by the robot can be calculated, that is, the relative position of the carpet edge crossed by the robot in the process, thereby determining the coverage boundary of the carpet relative to the robot, so that the robot can identify the carpet edge when moving near the carpet at different angles and avoid the identified carpet edge in time.
[0033] As an embodiment, in step 1, when the robot detects a carpet through an ultrasonic sensor, the method for obtaining the current trigger position through preprocessing includes: when the robot detects the carpet for the first time, marking the installation position of the ultrasonic sensor as the first trigger position, and then the robot walks in a straight line without turning around until the hard ground is triggered and detected, and then rotates to a preset trigger angle, and then walks in a straight line along the rotated body axis until the carpet is triggered and detected, marking the installation position of the ultrasonic sensor as the second trigger position; then updating the second trigger position to the current trigger position, and updating the first trigger position to the historical trigger position; 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.
[0034] Indicatively, if Figure 3It 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 hard ground when it is triggered to detect the hard ground without turning around, driving the installation position of the ultrasonic sensor back to the hard ground, and detecting the corresponding changes in the ultrasonic data caused by the ultrasonic reflection signal, to determine 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, and therefore the direction in which the longitudinal axis of the rotated body points to the front side of the robot is configured as the walking direction after rotation as shown in the figure, and the preset trigger angle is preferably 45 degrees. Then, the robot walks along the longitudinal axis of the rotated body until the carpet is triggered to detect the carpet, and the installation position of the ultrasonic sensor is marked as the second trigger position, that is, the robot follows Figure 3 The robot moves forward in the direction of rotation shown to the installation position of the ultrasonic sensor and enters the edge fitting line with the arrow in the figure. The robot triggers and detects the carpet again, and marks the installation position of the ultrasonic sensor 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. Thus, the current trigger position is set based on the trigger positions obtained by entering the carpet for trigger detection twice in a row.
[0035] Preferably, on the basis of marking the second trigger position, if the robot walks in a straight line without turning around until the hard ground is detected, and then rotates to a preset trigger angle, the preset trigger angle at this time can be less than 45 degrees, and then walks along the rotated longitudinal axis of the body until the carpet is detected, the installation position of the ultrasonic sensor is marked as the third trigger position; then the third trigger position is marked as the current trigger position, and the second trigger position is marked as the historical trigger position. The current trigger position and the historical trigger position are updated using the trigger positions obtained by entering the carpet detection twice in a row.
[0036] Based on the above embodiment, the more times the robot repeats step 1, the more current trigger positions are obtained, the more historical trigger positions are obtained in the subsequent step 2, and the more times the edge fitting line is updated; wherein, the current trigger position obtained in the previously executed step 1 is updated to the historical trigger position in the currently executed step 2. The number of updates here is the cumulative number of calculations of the edge fitting line 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 calculation is at least two, including the current trigger position and the historical trigger position.
[0037] 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.
[0038] In the scenario where steps 1 to 3 are repeatedly executed or in the scenario where step 3 is repeatedly executed, the current trigger position obtained by the last executed step 1 is updated to the historical trigger position in the current executed step 2, and a current trigger position and multiple historical trigger positions are provided to participate in straight line fitting, and then 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. Then, 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 be corrected to achieve the update of the edge fitting lines.
[0039] Therefore, as the current trigger position and the historical trigger position 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). It is used in cleaning scenarios near the edge of the carpet to infer the shape and coverage of the carpet, and to remind the robot to avoid entering the carpet too deeply and causing the risk of dirtying the carpet with a wet mop.
[0040] As an embodiment, in the step 2, the method of 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 by the coordinates of a current trigger position and a historical 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 this embodiment, the straight line equation constructed by the robot is equivalent to the coordinates of a current trigger position and the coordinates of a historical trigger position. After substituting them into the distance formula between two points, the parameters are obtained, and then the straight line equation is constructed by the parameters and coordinate variables, and then the straight line equation is represented as the edge fitting line in the map and is located inside the carpet; preferably, the robot is equipped with an ultrasonic sensor, and a historical trigger position and a current trigger position detected successively by an ultrasonic sensor are both located on the edge fitting line.
[0041] Since the generation time of the coordinates of the historical trigger position is earlier than the generation time of the coordinates of the current trigger position, the straight line direction of the edge fitting line is the direction from the historical trigger position to the current trigger position. Schematically, as shown in Figure 3As shown in the direction in which the edge fitting line in FIG. 1 extends to the left, the edge fitting line is preferably parallel to the lower 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.
[0042] Therefore, when a current trigger position and multiple historical trigger positions are accumulated by executing step 1 multiple times, a straight line fitting process is performed on the coordinates of the current trigger position and the coordinates of the multiple historical trigger positions to obtain an edge fitting line to simulate the edge shape of the carpet.
[0043] In addition, there is also a method for calculating the edge fitting line, including, when a plurality of current trigger positions and a plurality of historical trigger positions are accumulated by executing step 1 once, a straight line fitting process is performed on the coordinates of the plurality of current trigger positions and the coordinates of the plurality of historical trigger positions to obtain the edge fitting line, wherein the robot is equipped with a plurality of ultrasonic sensors, and the carpet can be detected from a plurality of different viewing angles of the robot. The robot can obtain a plurality of current trigger positions at the same time by executing step 1 once, thereby increasing the carpet edge detection range of the robot.
[0044] When the robot detects the carpet through each ultrasonic sensor trigger, a current trigger position is obtained based on the result of each ultrasonic sensor trigger detection, so that the number of ultrasonic sensors is equal to the number of current trigger positions, and the current trigger position can be updated to the historical trigger position later, and then all the current trigger positions and historical trigger positions are linearly fitted. Preferably, one ultrasonic sensor corresponds to one current trigger position, and the number of current trigger positions is equal to the number of historical trigger positions. The multiple ultrasonic sensors can form an axisymmetric relationship with respect to the center line of the robot body (including the longitudinal axis of the body or the transverse axis of the body).
[0045] When the robot detects the carpet through some ultrasonic sensors, the number of ultrasonic sensors is greater than the number of current trigger positions, and all current trigger positions can be fitted with a straight line. All current trigger positions and all historical trigger positions are not necessarily located on the same edge fitting line. When the number of current trigger positions and historical trigger positions required for fitting processing is larger, the relative position inferred by the edge fitting line becomes more accurate.
[0046] As an embodiment, in step 1, when the robot initially detects the carpet through the ultrasonic sensor, it is determined that the robot has entered the carpet from other ground media, specifically determining 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. Then, in the process of the robot walking 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, and then it is determined whether the robot has triggered the detection of the carpet according to the filtering result; if the robot has triggered the detection of the carpet, the position of the ultrasonic sensor is marked as the current trigger position.
[0047] In some working scenarios, the detection position of the ultrasonic sensor remains in the carpet. The robot detects the carpet candidate result by comparing the threshold of the ultrasonic data received by the ultrasonic sensor. For example, when the ultrasonic data received by the ultrasonic sensor is greater than the preliminary judgment threshold, the detection position of the ultrasonic sensor is still on the hard ground; when the ultrasonic data received by the ultrasonic sensor is less than or equal to the preliminary judgment threshold, the detection position of the ultrasonic sensor becomes on the carpet, and the robot preliminarily detects the carpet. Then, in the process of the robot walking 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~20ms. By sampling 10 frames of ultrasonic data in sequence, a detection cycle of about 200ms can be counted, and the ultrasonic data in the detection cycle can be filtered; the filtering process disclosed in this embodiment is set to filter the interference of actual environmental scenes such as jitter in the robot and gaps between floor tiles. The filtering process disclosed in this application uses the filtering algorithm program pre-cured in the ultrasonic sensor, and the filtering algorithms include limiting filtering method, median filtering method, arithmetic mean filtering method, recursive average filtering method (sliding average filtering method), median average filtering method (anti-pulse interference average filtering method), limiting average filtering method, etc. It can be applicable to the application scenarios of ultrasonic sensors collecting ultrasonic data and the accuracy requirements of ultrasonic detection of ground media.
[0048] As soon as the ultrasonic sensor enters the carpet, it can distinguish the carpet from other ground media, but it usually counts and filters to filter out false positives. Then, based on the result of the filtering process, it determines whether the robot has triggered the carpet detection. Specifically, it compares the size relationship between the result of the filtering process and the preset filtering threshold. When the result of the filtering process is greater than the preset filtering threshold, the robot has not triggered the carpet detection. It is possible that the robot is walking on the carpet but the detection position of the ultrasonic sensor has entered the hard ground. When the result of the filtering process is less than or equal to the preset filtering threshold, the robot triggers the carpet detection.
[0049] If the robot is triggered to detect the carpet, the installation position of the ultrasonic sensor is marked as the first trigger position or the second trigger position; specifically, 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, and then the robot retreats straight to the hard ground, and then the longitudinal axis of the robot body rotates by a preset trigger angle, and then walks to the carpet, until the carpet is triggered again, the installation position of the ultrasonic sensor is marked as the second trigger position. Preferably, the detection position of the ultrasonic sensor covers the installation position of the ultrasonic sensor.
[0050] 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 surface medium, especially to identify the carpet, to prevent the robot from mistakenly entering the carpet, and to reduce the degree of contamination of the carpet.
[0051] As an embodiment, in step 3, the method of calculating the relative position of the edge of the carpet crossed by the robot in the process 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 spent 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 changing from the position at which the carpet is initially detected to the trigger position, calculating the distance traveled by the robot in the vertical direction of the edge fitting line at a predetermined speed, and then marking the calculated distance as a pre-detection distance to indicate the distance between the edge fitting line and the edge of the carpet crossed by the robot in the process; wherein the trigger position is the current trigger position or the historical trigger position; when the edge fitting line is parallel to the edge of the carpet crossed by the robot in the process, controlling the map coordinates of the edge fitting line to subtract the pre-detection distance to obtain the relative position of the edge of the carpet crossed by the robot in the process.
[0052] In this embodiment, 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 unchanged; when the installation position of the ultrasonic sensor reaches the first trigger position in step 1, the pre-escape distance is calculated by multiplying the 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 the detection cycle by the aforementioned speed. On this basis, the coordinates of the edge fitting line in its vertical direction are controlled to subtract the pre-escape 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 by counting and filtering.
[0053] It should be noted that the edge of the carpet closest to the edge fitting line is the edge of the carpet that the robot crosses when walking from other ground media to initially detecting the carpet. Therefore, the pre-escape distance is expressed as the distance from the edge fitting line to the edge of the carpet on one side that the robot crosses. 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 for the robot to trigger carpet detection.
[0054] Based on the above embodiment, after the robot walks along the same side edge of the same carpet, it adjusts the current walking direction to walk to the other side of the same carpet or another carpet. When the robot triggers and detects the carpet, it executes steps 1 to 3 to identify the new carpet edge by updating the edge fitting line. If an edge fitting line is calculated for each side edge of the carpet, the contour of the carpet can be enclosed, and the shape of the carpet can be inferred, so as to facilitate the planning of the subsequent robot motion trajectory.
[0055] In some embodiments, 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 walks to one side of the carpet, the edge of the carpet 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 put on again). When the robot initially detects the carpet, since it has already walked along the same side edge of the same carpet, the carpet currently initially detected is from the other side edge of the same carpet or one side edge of another carpet. side edge, and determine that the robot has begun to cross the other side edge of the same carpet or one side edge of another carpet and is detected by the ultrasonic sensor, at this time, the edge fitting line needs to be updated to represent the new carpet edge; then the robot performs straight-line walking, which is regarded as the first time the robot enters the edge of the current carpet, until the carpet is triggered to be detected, and then steps 1 to 3 are performed to maintain the robot to continue walking along the other side edge of the same carpet or one side edge of another carpet and identify the new side edge of the carpet by updating the edge fitting line, and 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 behavior of walking along the edge of the carpet.
[0056] As an embodiment, step 3 further includes: calculating the angle between the current body axis of the robot and the edge fitting line, and then marking the angle as the target rotation angle, so that the robot adjusts the current body axis 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 3 In the figure, the current walking direction of the robot after rotation becomes parallel to the edge fitting line after adjustment by the target rotation angle. If the robot is originally planned to walk from right to left, the arrow of the edge fitting line in the figure points horizontally to the left, that is, the direction of the carpet edge extends to the left, then the walking direction after rotation in the figure becomes parallel to the edge fitting line and points to the left after rotating counterclockwise by the target rotation angle, and the robot is maintained to walk along the originally planned path direction based on the identification of the carpet edge, so as to walk along the identified carpet edge.
[0057] The present application also discloses a chip, which is used to store a computer program and execute the computer program. When the computer program is executed, it can be understood that it is executed by a processor unit inside the chip to implement the carpet edge detection method. Based on the above embodiment, the chip obtains an edge fitting line by executing steps 1 to 3, simulates the edge of the carpet, updates it to the map in time, and integrates it to form a carpet edge enclosed area.
[0058] The chip integrated storage medium and processor disclosed in the present application, and the specific embodiments corresponding to the computer program executed by the chip are basically the same as the embodiments of the above-mentioned carpet edge detection method, and will not be described in detail here.
[0059] Based on the above embodiments, the present application also discloses a robot, the chip is installed inside the robot, an ultrasonic sensor is installed on one side of the robot body, and the robot is used to perform the carpet edge detection method. By performing steps 1 to 3, the robot uses the coordinates of the edge fitting line in the map to subtract the distance the robot walks from the initial detection of the carpet to the trigger detection of the carpet, and obtains the coordinates of the relative position of the edge of the carpet crossed by the robot in the process. In this way, the coverage boundary of the carpet relative to the robot is determined, so that the robot can identify the edge of the carpet when moving near the carpet at different angles and avoid the identified carpet edge in time, so that the robot can walk more smoothly near the carpet.
[0060] The position layout of the ultrasonic sensor on the body of the robot is pre-fixed. The ultrasonic sensor is set at the bottom of the robot body and can be used as a detector for detecting the material of the ground. Optionally, when multiple ultrasonic sensors are set at different positions on the robot, considering that the sensors set at different positions detect different positions of the carpet relative to the robot, the current trigger position obtained by the robot during the execution of the above steps 1 to 3 will be different.
[0061] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a cleaning robot to execute the methods described in each embodiment of the present invention.
[0062] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A carpet edge detection method based on ultrasound, characterized in that: The carpet edge detection method is applied to a robot equipped with an ultrasonic sensor, and the carpet edge detection method comprises: Step 1: When the robot detects the carpet through the ultrasonic sensor, the current trigger position is obtained through preprocessing; then step 2 is executed; Step 2, calculate the edge fitting line using the current trigger position and the historical trigger position; then execute step 3; Step 3: Using the edge fitting line and 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 edge of the carpet crossed by the robot in the process.
2. The carpet edge detection method according to claim 1, characterized in that: In step 1, when the robot detects the carpet through the ultrasonic sensor, the method for obtaining the current trigger position through preprocessing includes: 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 without turning around until it triggers and detects the hard ground. Then, it rotates to a preset trigger angle and walks in a straight line along the rotated body axis until it triggers and detects the carpet. The installation position of the ultrasonic sensor is marked as the second trigger position. Then, the second trigger position is updated as the current trigger position, and the first trigger position is updated as the historical trigger position. The robot uses the extension direction of the longitudinal axis of the body toward the front side of the body to indicate the current walking direction.
3. The carpet edge detection method according to claim 2, 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 previously executed step 1 is updated to the historical trigger position in the currently executed step 2.
4. The carpet edge detection method according to claim 2, characterized in that: In step 2, the method of 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 by the coordinates of the current trigger position and the coordinates of the historical trigger position to obtain an edge fitting line, wherein the edge fitting line is a straight line represented by the constructed straight line equation; Alternatively, when multiple current trigger positions and multiple historical trigger positions are accumulated by executing step 1 once, straight line fitting is performed on the coordinates of a current trigger position and the coordinates of multiple historical trigger positions to obtain an edge fitting line, wherein the robot is equipped with multiple ultrasonic sensors, and the robot can simultaneously obtain multiple current trigger positions by executing step 1 once.
5. The carpet edge detection method according to claim 2, characterized in that: In step 1, when the robot initially detects the carpet through the ultrasonic sensor, it is determined that the robot has entered the carpet from other ground media. Then, in the process of the robot walking 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, and then it is determined whether the robot triggers the detection of the carpet according to the filtering result; If the robot is triggered to detect the carpet, the position of the ultrasonic sensor is marked as the current trigger position.
6. The carpet edge detection method according to claim 5, characterized in that: In step 3, the method of calculating the relative position of the edge of the carpet crossed by the robot in the process of 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 calculates the distance traveled by the robot in the vertical direction of the edge fitting line according to a predetermined speed during the process from the position at which the carpet is initially detected to the trigger position, and then marks the calculated distance as the pre-detection distance to indicate the distance between the edge fitting line and the edge of the carpet crossed by the robot in the process; wherein the trigger position is the current trigger position or the historical trigger position; When the edge fitting line is parallel to the edge of the carpet crossed by the robot in the process, the map coordinates of the edge fitting line are controlled to subtract the pre-detection distance to obtain the relative position of the edge of the carpet crossed by the robot in the process.
7. The carpet edge detection method according to claim 1, characterized in that: After the robot walks along the same side edge of the same carpet, it walks to the other side of the same carpet or another carpet by adjusting the current walking direction. When the robot triggers and detects the carpet, steps 1 to 3 are executed to identify the new carpet edge by updating the edge fitting line.
8. The carpet edge detection method according to claim 1, characterized in that: The step 3 also includes: calculating the angle formed by the current body axis of the robot relative to the edge fitting line, and then marking the angle as the target rotation angle, so that the robot adjusts the current body axis 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.
9. A chip for storing a computer program and executing the computer program, characterized in that: When the computer program is executed, the carpet edge detection method according to any one of claims 1 to 8 is implemented.
10. A robot, characterized in that: The chip of claim 9 is installed inside the robot, an ultrasonic sensor is installed on one side of the robot body, and the robot is used to perform the carpet edge detection method of any one of claims 1 to 8; Wherein, the position layout of the ultrasonic sensors on the body of the robot is fixed in advance.
Citation Information
Cited By
Carpet area identification method, robot and chip
CN122261213A
Ultrasonic detection-based carpet avoidance method for robot
WO2026031803A1
