Forbidden zone identification method, cleaning robot and storage medium
By obtaining the set of trajectory points of the cleaning robot and identifying the restricted area, the problem of cleaning robot being trapped in complex environments is solved, cleaning efficiency is improved, and repeated cleaning is avoided.
Patent Information
- Application Number
- CN202411991918.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-09-02
AI Technical Summary
Cleaning robots are easily trapped in narrow areas in complex environments, resulting in low cleaning efficiency and cannot be effectively avoided when repeatedly trapped.
By obtaining the set of current trajectory points of the cleaning robot, using convex hull detection and preset thresholds to determine whether it is trapped, identify the trapped area, and expand the restricted area based on the trajectory point, determine the trapped area of the robot, and control the robot to bypass the restricted area for cleaning.
Timely identification and avoiding cleaning robots being trapped, improving cleaning efficiency and reducing the probability of repeated cleaning.
Smart Images

Figure CN120570518A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of robotics technology, and in particular to a restricted area identification method, a cleaning robot, and a storage medium. Background Art
[0002] In recent years, more and more households have adopted cleaning robots for housecleaning. However, when cleaning in complex environments, such as those between stool legs, cluttered areas, or narrow areas between beds, cabinets, and walls, robots can easily become trapped and unable to continue cleaning. Once a robot is freed and returns to the same location through a global clean, it has a high probability of becoming trapped again because the cleaning environment and cleaning logic remain unchanged, resulting in lower cleaning efficiency. Summary of the Invention
[0003] The embodiments of the present application aim to provide a restricted area identification method, a cleaning robot, and a storage medium, which can promptly identify restricted areas and improve cleaning efficiency.
[0004] In a first aspect, some embodiments of the present application provide a restricted area identification method, which is applied to a cleaning robot, comprising:
[0005] Acquire a first point set, wherein the first point set is a set of a preset number of trajectory points of the cleaning robot starting from a current trajectory point of the cleaning robot;
[0006] determining whether the cleaning robot is trapped according to the first point set;
[0007] If the cleaning robot is trapped, a restricted area is identified based on the first point set, wherein the restricted area is the area where the robot is trapped.
[0008] In some embodiments, determining whether the cleaning robot is trapped according to the first point set includes:
[0009] Obtaining the maximum distance between each trajectory point in the first point set;
[0010] If the maximum distance is greater than a first preset threshold, it is determined that the cleaning robot is not trapped;
[0011] If the maximum distance is less than or equal to the first preset threshold, it is determined that the cleaning robot is trapped.
[0012] In some embodiments, obtaining the maximum distance between trajectory points in the first point set includes:
[0013] Obtaining a first straight-line distance between each trajectory point in the first point set;
[0014] The maximum value among the first straight-line distances is determined as the maximum distance.
[0015] In some embodiments, obtaining the maximum distance between trajectory points in the first point set further includes:
[0016] Performing convex hull detection on the first point set to obtain a convex hull polygon;
[0017] Determine each first target trajectory point, wherein the first target trajectory point is a trajectory point located on an edge of the convex hull polygon;
[0018] Obtaining a second straight-line distance between each of the first target trajectory points;
[0019] The maximum value among the second straight-line distances is determined as the maximum distance.
[0020] In some embodiments, identifying a restricted area based on the first point set includes:
[0021] Performing convex hull detection on the first point set to obtain a convex hull polygon and a first region, wherein the first region is a region enclosed by the convex hull polygon;
[0022] The restricted area is obtained according to the first area.
[0023] In some embodiments, obtaining the restricted area according to the first area includes:
[0024] Expanding the first area according to a first preset distance to obtain a second area;
[0025] A circumscribed rectangle of the second area is determined as the restricted area.
[0026] In some embodiments, obtaining the restricted area according to the first area further includes:
[0027] Searching for obstacles outside the first area at a second preset distance;
[0028] If an obstacle exists, the first area is expanded to the obstacle to obtain the restricted area.
[0029] In some embodiments, searching for obstacles outside the first area at a second preset distance includes:
[0030] Obtaining the centroid of the first region;
[0031] With the center of mass as the center of a circle and the second preset distance as the radius, search whether there is any obstacle outside the first area.
[0032] In some embodiments, expanding the first area to the obstacle to obtain the restricted area includes:
[0033] Acquire a third area enclosed by the obstacle point corresponding to the obstacle and the contour points of the first area;
[0034] The circumscribed rectangle of the third area is determined as the restricted area.
[0035] In some embodiments, the method further comprises:
[0036] determining whether there is a cleaning path for the cleaning robot to enter the target cleaning area, wherein the cleaning path bypasses the restricted area;
[0037] If so, the restricted area is determined as a target restricted area;
[0038] If not, the restricted area is reduced in scope until the cleaning path exists, and the reduced restricted area is determined as the target restricted area.
[0039] In some embodiments, the method further comprises:
[0040] Acquire a second point set, wherein the second point set is a trajectory point set sorted by time, and the starting trajectory point in the second point set is the trajectory point closest in time to the target restricted area;
[0041] Determining an escape navigation point based on the second point set;
[0042] The cleaning robot is controlled to move to the escape navigation point.
[0043] In some embodiments, determining an escape navigation point according to the second point set includes:
[0044] Starting from the starting track point in the second point set, searching the second point set in sequence to search for a second target track point that meets a preset condition, and determining the second target track point as the escape navigation point;
[0045] The preset condition is that there are no obstacles in the preset area where the second target trajectory point is located, and the preset area has no intersection with the target restricted area.
[0046] In a second aspect, some embodiments of the present application provide a cleaning robot, comprising:
[0047] at least one processor;
[0048] A memory communicatively connected to at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the restricted area identification method as described above.
[0049] In a third aspect, some embodiments of the present application provide a computer-readable storage medium, which stores computer-executable instructions. The computer-executable instructions are used to enable a computer device to execute the restricted area identification method as described above.
[0050] Beneficial effects of the embodiments of the present application: Different from the prior art, the restricted area identification method provided by the embodiments of the present application is applied to a cleaning robot. The method includes: obtaining a first point set, wherein the first point set is a collection of a preset number of cleaning robot trajectory points starting from the cleaning robot's current trajectory point; then determining whether the cleaning robot is trapped based on the first point set; if the cleaning robot is trapped, identifying a restricted area based on the first point set, wherein the restricted area is the area where the robot is trapped. Therefore, the restricted area identification method can promptly detect whether the cleaning robot is trapped, and when the cleaning robot is trapped, promptly identify the trapped area to avoid repeated entrapment during subsequent cleaning, thereby improving cleaning efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0052] Figure 1 A schematic diagram of the application environment of one of the restricted area identification methods provided in this application;
[0053] Figure 2 A schematic diagram of the structure of one of the cleaning robots provided in this application;
[0054] Figure 3 A flowchart of one of the restricted area identification methods provided in this application;
[0055] Figure 4 A schematic diagram of one of the environmental maps provided for this application;
[0056] Figure 5 Provided for this application Figure 3 Flow diagram of step S20;
[0057] Figure 6 Provided for this application Figure 5 Flow diagram of step S201;
[0058] Figure 7A schematic diagram of a first point set and a first area provided in this application;
[0059] Figure 8 Provided for this application Figure 3 Schematic diagram of the process of step S30;
[0060] Figure 9 Provided for this application Figure 8 Flow diagram of step S302;
[0061] Figure 10 This is a schematic diagram of the structure of the outward expansion of the first area provided in this application;
[0062] Figure 11 This is a schematic diagram of a structure in which the first area is expanded provided in this application;
[0063] Figure 12 One of the provided Figure 8 Flow diagram of step S302;
[0064] Figure 13 A schematic diagram of one of the second areas and obstacle points provided in this application;
[0065] Figure 14 A schematic diagram of one of the third areas and obstacle points provided in this application;
[0066] Figure 15 A schematic diagram of the structure of one of the target restricted areas provided in this application;
[0067] Figure 16 This is a flowchart of one of the restricted area identification methods provided in this application. DETAILED DESCRIPTION
[0068] The present application is described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the present application, but are not intended to limit the present application in any form. It should be noted that those skilled in the art may make several variations and improvements without departing from the scope of the present application. These all fall within the scope of protection of the present application.
[0069] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0070] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other and are all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order than the module division in the device or the order in the flow chart. In addition, the words "first", "second", "third", etc. used herein do not limit the data and execution order, but only distinguish between the same items or similar items with basically the same functions and effects.
[0071] Unless otherwise defined, all technical and scientific terms used in this specification have the same meanings as those commonly understood by those skilled in the art to which this application belongs. The terms used in this specification and in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" as used in this specification includes any and all combinations of one or more of the relevant listed items.
[0072] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0073] In the embodiment of the present application, the cleaning robot includes but is not limited to a vacuum cleaning robot, a mopping robot, or a floor washing robot.
[0074] See also Figure 1 , Figure 1 This is a schematic diagram of the application environment of a restricted area identification method provided in an embodiment of the present application. Figure 1 As shown, the cleaning robot 100 is located on the ground, which may be the ground of a living room or office, etc. The place where the cleaning robot 100 is located includes objects such as a base station 200, a desk, a flower pot, a sofa, a bed, and a bedside table 300.
[0075] The cleaning robot 100's free movement is primarily accomplished through the mapping, positioning, navigation, and obstacle avoidance modules. As will be appreciated, after sensing its surroundings, the cleaning robot 100 plans one or more collision-free paths that achieve full area coverage, following a specific cleaning sequence or planning method. These modules are implemented by sensors and corresponding control programs.
[0076] In some embodiments, the cleaning robot 100 is equipped with a laser radar and / or a visible light camera, wherein the laser radar scans the surrounding environment of the cleaning robot 100 to obtain a laser point cloud. The visible light camera shoots the surrounding environment of the cleaning robot 100 to obtain an image. The laser radar and the visible light camera are respectively connected to the controller for communication, and the laser point cloud and the image are sent to the controller respectively. The controller calls the program for building a map pre-installed in the memory of the cleaning robot 100, and builds a map based on the laser point cloud and / or image. Figure 2 The cleaning environment map shown in FIG. The program for constructing the map may include a program corresponding to the SLAM (Simultaneous Localization and Mapping) algorithm, which will not be described in detail here. The map is stored in the memory of the cleaning robot 100. When the robot moves, the controller uses the map as the basis for autonomous positioning, path planning, and obstacle avoidance.
[0077] It is understandable that the SLAM algorithm has both positioning and navigation functions. During the positioning process, the laser radar is controlled to rotate at high speed to emit laser light, measure the distance between the cleaning robot and the obstacle, and use the map to determine the relative position between the cleaning robot and the obstacle, thereby achieving positioning. In some embodiments, the cleaning robot 100 can perform visual positioning based on a visible light camera. During the navigation process, cleaning control is performed based on positioning and cleaning tasks, and each area to be cleaned is cleaned one by one. A full-coverage cleaning path is planned in each area to be cleaned to complete the corresponding cleaning task.
[0078] The cleaning robot 100 can be configured into any suitable shape to implement specific business functions. For example, in some embodiments, the cleaning robot 100 can be a cleaning robot based on a SLAM system.
[0079] In some embodiments, the cleaning robot 100 may include a robot body, a laser radar, a controller, and a walking mechanism. The robot body is the main structure of the cleaning robot 100 and can be configured in a suitable shape, structure, and manufacturing material (e.g., hard plastic or metal such as aluminum or iron) according to the actual needs of the cleaning robot 100. For example, it may be configured in a relatively flat cylindrical shape, which is common for cleaning robots 100.
[0080] The walking mechanism is a structural device provided on the robot body to provide mobility for the cleaning robot 100. The walking mechanism can be implemented using any type of mobile device, such as rollers, crawlers, etc.
[0081] The laser radar is mounted on the body of the cleaning robot 100 and is used to sense obstacles in the environment surrounding the mobile cleaning robot 100, scan and obtain laser point cloud data, and transmit it to the controller so that the controller can build a map based on the laser point cloud data and perform obstacle avoidance operations. In some embodiments, the laser radar includes pulsed laser radar, continuous wave laser radar, and other radars.
[0082] The controller is the electronic computing core built into the robot's body, executing logical operations to achieve intelligent control of the cleaning robot. It communicates with the LiDAR and creates maps based on laser point cloud data, controlling the robot's movements. It also controls cleaning tasks based on the map and the cleaning task, such as controlling the robot to operate in a brick crevices cleaning mode.
[0083] It is understood that the controller can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. The controller can also be any traditional processor, controller, microcontroller, or state machine. The controller can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration, or one or more combinations of a microcontroller unit (MCU), a field-programmable gate array (FPGA), and a system on a chip (SoC).
[0084] It can be understood that the robot 10 in the embodiment of the present invention also includes a storage module, which includes but is not limited to: Flash flash memory, NAND flash memory, vertical NAND flash memory (VNAND), NOR flash memory, resistive random access memory (RRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), spin transfer torque random access memory (STT-RAM) and other devices. One or more.
[0085] It is understood that in some embodiments, in addition to the above functional modules, the robot body may also be equipped with one or more other different functional modules depending on the task to be completed. For example, the robot body may also include a water tank, a sewage tank, a detergent box, a dust box, etc. The robot's docking device may include an interface for the water tank, the sewage tank, the detergent box, the dust box, or a charging electrode, etc.
[0086] The above application environment is only for illustrative purposes. In actual applications, the recharge method and related devices provided in the following embodiments of the present invention can be further expanded to other suitable application environments, not limited to Figure 1 The application environment shown in .
[0087] When cleaning robots clean in complex environments, Figure 1 The robot can easily get stuck in areas like the bedside table, cluttered areas, or stool legs, preventing it from continuing to clean. Once the robot is freed, it can perform a global clean and return to the same location. However, since the cleaning environment and cleaning logic remain unchanged, the robot is more likely to get stuck again, resulting in lower cleaning efficiency.
[0088] In response to the above problems, some embodiments of the present application provide a restricted area identification method, which is applied to a cleaning robot. The method includes: obtaining a first point set, wherein the first point set is a collection of a preset number of cleaning robot trajectory points starting from the current cleaning trajectory point of the cleaning robot, and then determining whether the cleaning robot is trapped based on the first point set. If the cleaning robot is trapped, identifying the restricted area based on the first point set, wherein the restricted area is the area where the robot is trapped.
[0089] Therefore, the restricted area recognition method can timely detect whether the cleaning robot is trapped, and when the cleaning robot is trapped, timely identify the trapped area to avoid being trapped again during subsequent cleaning, thereby improving cleaning efficiency.
[0090] Some embodiments of the present application provide a cleaning robot. Figure 2 The cleaning robot 100 includes at least one processor 102 and a memory 103 ( Figure 2 (a bus connection and a processor are used as an example).
[0091] It can be understood that the processor 102 is used to provide computing and control capabilities to control the cleaning robot to execute any of the restricted area identification methods provided in the following embodiments.
[0092] It is understandable that the processor 102 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0093] The memory 103 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the restricted area identification method in the embodiment of the present application. The processor 102 can implement any of the restricted area identification methods provided in the following embodiments by running the non-transient software programs, instructions and modules stored in the memory 103. Specifically, the memory 103 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 103 may also include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0094] In some embodiments, the cleaning robot 100 may further include sensors such as a laser radar, a camera, a gyroscope, an odometer, a magnetometer, an accelerometer, or a speedometer. These sensors help the cleaning robot 100 sense the environment, build an environmental map, or perform other controls. It will be appreciated that the structure of the present embodiment examples does not constitute a limitation to the cleaning robot 100. In some implementations, the cleaning robot 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0095] As can be understood from the above, the restricted area identification method provided in the embodiments of the present application can be implemented by a cleaning robot, for example, by one or more processors of the cleaning robot. In some embodiments, the restricted area identification method provided in the embodiments of the present application can also be implemented by other devices with computing and processing capabilities. Other devices with computing and processing capabilities can be intelligent devices that are communicatively connected to the cleaning robot, such as servers.
[0096] The following describes the restricted area identification method provided by the embodiment of the present application in conjunction with the exemplary application and implementation of the cleaning robot provided by the embodiment of the present application. Figure 3 , Figure 3 1 is a flow chart of a restricted area identification method provided in an embodiment of the present application. It is understandable that the execution subject of the restricted area identification method may be one or more processors of the cleaning robot.
[0097] like Figure 3 As shown, the method S100 includes but is not limited to the following steps:
[0098] S10: Acquire a first point set, wherein the first point set is a set of a preset number of trajectory points of the cleaning robot starting from a current trajectory point of the cleaning robot;
[0099] Track points or cleaning track points refer to a series of position points that the cleaning robot passes through while cleaning according to a predetermined cleaning path. In some embodiments, track points or cleaning track points can also be called the route points that the cleaning robot has traveled, or historical track points.
[0100] Specifically, the cleaning robot creates an environmental map for the current cleaning area. Figure 4 As shown, the cleaning path is then planned based on the environment map, and the robot cleans along the planned cleaning path. During cleaning, the robot starts from the starting point and cleans along the cleaning path until it reaches the target point. The series of locations passed by the robot from the starting point to the target point are all trajectory points, cleaning trajectory points, or historical trajectory points.
[0101] Trajectory points are represented by the robot's pose, which includes both its position and its posture. For example, before starting to clean, the robot establishes a coordinate system, where the origin of the coordinate system is the robot's starting point. It then begins moving and cleaning. The robot's position refers to the coordinates of the robot's center point in space, typically represented by three coordinate values (x, y, z). The robot's posture refers to its orientation relative to the coordinate system, typically described by angles (such as rotation angles around the X, Y, and Z axes). Therefore, using position and posture can accurately and uniquely represent the robot's positional state.
[0102] During the cleaning process, the cleaning robot acquires the current track point every preset time and stores it in memory. The collection of track points is called a track point set. The preset time is the frequency of recording track points and can be adjusted based on the robot's cleaning speed and accuracy requirements. For example, if the preset time is 1 second, the cleaning robot acquires the current track point every 1 second and stores it in memory.
[0103] A trajectory point set is the collection of all trajectory points of the cleaning robot from its starting point to its current trajectory point. For example, a trajectory point set is the first trajectory point, the second trajectory point, ..., the Nth trajectory point, where the first trajectory point is the starting point of the cleaning robot, the Nth trajectory point is the current trajectory point of the cleaning robot, and N is a positive integer.
[0104] The track point set can be stored in chronological order, such as the first track point, the second track point, ..., the Nth track point, or in reverse chronological order, such as the Nth track point, the N-1th track point, ..., the first track point.
[0105] The display of the trajectory point set on the environment map can be as follows Figure 4 As shown in the white dots in the figure, point A indicated by the arrow is the starting point of the cleaning robot and also the first trajectory point. If the cleaning robot is surrounded by scattered obstacles, these scattered obstacles can be low objects such as shoes, socks, stool legs or bedside table legs, dynamic obstacles, etc., then the cleaning robot will be trapped in these scattered obstacle areas, resulting in its trajectory points being more concentrated, such as Figure 4 Therefore, it is possible to determine whether the cleaning robot is trapped based on the trajectory points of the cleaning robot in the recent period of time.
[0106] The first point set is the trajectory point set of the cleaning robot in the most recent period of time. Specifically, starting from the current trajectory point, a preset number of cleaning robot trajectory points are obtained. For example, if the time interval between trajectory points is 1 second, the current trajectory point is the Nth trajectory point, and the preset value is 600, then starting from the Nth trajectory point and ending at the N-599th trajectory point, 600 trajectory points are taken out from the trajectory point set. The set of these 600 trajectory points constitutes the first point set. The starting trajectory point in the first point set is the Nth trajectory point, and the ending trajectory point is the N-599th trajectory point. The first point set is a set of trajectory points within the past 10 minutes.
[0107] S20: Determining whether the cleaning robot is trapped according to the first point set;
[0108] If the cleaning robot is trapped, its corresponding track points will be concentrated in large numbers near a certain location (obstacle) for a long time. If the cleaning robot is not trapped, its corresponding track points will be more stretched or discrete. Therefore, the degree of convergence and dispersion of the track points can be used to determine whether the cleaning robot is trapped.
[0109] In some embodiments, as Figure 5 As shown, step S20 includes:
[0110] S201: Obtaining the maximum distance between each trajectory point in the first point set;
[0111] The distance between each trajectory point refers to the Euclidean distance or straight-line distance between each trajectory point. In some embodiments, firstly, the first straight-line distance between each trajectory point in the first point set is obtained, and then the maximum value among each first straight-line distance is determined as the maximum distance.
[0112] The Euclidean distance formula is used to calculate the first straight-line distance. For each trajectory point in the first point set, the first straight-line distance between it and other trajectory points is calculated. For example, the first straight-line distance between the Nth trajectory point and other trajectory points is first calculated, and then the first straight-line distance between the N-1th trajectory point and other trajectory points except the Nth trajectory point is calculated. This process is repeated until the first straight-line distances between all trajectory points are calculated. The maximum value is then selected from the first straight-line distances and determined as the maximum distance.
[0113] If the number of trajectory points in the first point set is large, the amount of calculation required to obtain the first straight-line distance using the above method is large and the process is cumbersome. Therefore, in order to save computing resources and improve computing efficiency, in some embodiments, such as Figure 6 As shown, step S201 further includes:
[0114] S2011: performing convex hull detection on the first point set to obtain a convex hull polygon;
[0115] A convex hull detection algorithm is used to perform convex hull detection on the first point set to obtain a convex hull polygon. The convex hull polygon is the minimum circumscribed convex hull polygon of each trajectory point in the first point set, and can completely include each trajectory point in the first point set.
[0116] If the trajectory of the mobile robot is Figure 4 As shown, the first point set is Figure 4 The set of trajectory points included in the box, the convex hull detection of the first point set can be obtained as follows Figure 7 The convex hull polygon shown has sides of Figure 7 The gray line in .
[0117] S2012: Determine each first target trajectory point, wherein the first target trajectory point is a trajectory point located on an edge of the convex hull polygon;
[0118] The edge of the convex hull polygon is also called the side segment of the convex hull polygon, such as Figure 7 As shown by the gray line segments in , the trajectory points in the first point set are located on the edge of the convex hull polygon, as shown in Figure 7 Points B and C in , or are located within the convex hull polygon, such as Figure 7 Point D in .
[0119] The first target trajectory point is a trajectory point located on the edge of the convex hull polygon, such as Figure 7 Points B and C in the diagram.
[0120] S2013: Obtaining a second straight-line distance between each of the first target trajectory points;
[0121] S2014: Determine the maximum value of each of the second straight-line distances as the maximum distance.
[0122] The Euclidean distance formula is used to calculate the straight-line distance or Euclidean distance between each pair of first target trajectory points to obtain each second straight-line distance. The maximum value is then selected from each second straight-line distance and determined as the maximum distance.
[0123] S202: If the maximum distance is greater than a first preset threshold, determining that the cleaning robot is not trapped;
[0124] S203: If the maximum distance is less than or equal to the first preset threshold, it is determined that the cleaning robot is trapped.
[0125] If the maximum distance is greater than the first preset threshold, it indicates that the track points in the first point set are relatively dispersed, the cleaning robot is in a normal cleaning state, and the cleaning robot is not trapped. If the maximum distance is less than or equal to the first preset threshold, it indicates that the track points in the first point set are relatively concentrated, the cleaning robot has been circling around an obstacle for a long time, or the cleaning robot has been wandering in the area where the obstacle is located for a long time, indicating that the cleaning robot is trapped in that area.
[0126] Among them, the first preset threshold can be set as needed. In the embodiment of the present application, the first preset threshold is a value between [Φ, 2Φ], where Φ is the diameter of the cleaning robot. For example, if the diameter Φ of the cleaning robot is 0.35 meters, the first preset threshold can be 0.8 meters.
[0127] S30: If the cleaning robot is trapped, identifying a restricted area according to the first point set, wherein the restricted area is the area where the robot is trapped.
[0128] If the cleaning robot is trapped, it indicates that the cleaning robot is trapped in Figure 7 The area enclosed by the convex hull polygon shown is as follows. Therefore, the corresponding convex hull polygon is obtained according to the first point set, and then the restricted area is obtained according to the area of the convex hull polygon.
[0129] Specifically, if Figure 8 As shown, step S30 includes:
[0130] S301: Perform convex hull detection on the first point set to obtain a convex hull polygon and a first region, wherein the first region is a region enclosed by the convex hull polygon;
[0131] S302: Obtain the restricted area according to the first area.
[0132] The edges of the convex hull polygon are Figure 7 As shown by the gray line in Figure 7 Area S1 is enclosed by the medium-gray line. Since the trajectory points correspond to the center points of the cleaning robot, the first area is defined by the points corresponding to the center points of the cleaning robot. However, the cleaning robot has a certain size, and the center point alone cannot fully cover the space actually occupied by the cleaning robot. During movement, the edge of the cleaning robot will sweep out an area larger than the first area. Therefore, expanding the first area can obtain a more accurate restricted area.
[0133] In some embodiments, as Figure 9 As shown, step S302 includes:
[0134] S3021: Expand the first area according to a first preset distance to obtain a second area;
[0135] In some embodiments, a circular area is first drawn with each first target trajectory point as the center and a first predetermined distance as the radius. The circular area represents the area that the cleaning robot may cover when it is at the first target trajectory point. The circular areas are then merged, removing any areas that exceed the actual boundary of the cleaning environment. The remaining area constitutes the second area.
[0136] For example, Figure 10 As shown, Figure 7 Taking point B and point C in the figure as an example, first, with point B as the center and the first preset distance d1 as the radius, draw the first circular area corresponding to point B. Then, with point C as the center and the first preset distance d1 as the radius, draw the second circular area corresponding to point C. Similarly, draw the remaining circular areas corresponding to the remaining first target trajectory points in turn, and then merge the first circular area, the second circular area and the remaining circular areas to obtain the second area.
[0137] In some embodiments, as Figure 11 As shown, each side of the convex hull polygon that encloses the first area can also be translated outward in the first direction. The translation distance is the first preset distance d1. The first direction is the direction perpendicular to the corresponding side. Taking the side where the trajectory point B is located as an example, the first direction is as follows: Figure 11 As shown by the arrows in , the area formed by the translated edges is the second area.
[0138] In some embodiments, the first target track point can also be translated outward in the first direction, the translation distance is the first preset distance, and the area enclosed by the convex hull polygon corresponding to each first target track point after translation is the second area. Figure 11 Similar, no further description is given here.
[0139] It should be noted that, in order to consider the size and cleaning range of the cleaning robot, the first preset distance is greater than or equal to the radius of the cleaning robot, or the first preset distance is greater than or equal to half of the maximum axis length of the cleaning robot.
[0140] S3022: Determine a circumscribed rectangle of the second area as the restricted area.
[0141] The bounding rectangle of the second area may also be referred to as a minimum bounding rectangle or a minimum bounding rectangular frame. This bounding rectangle is the smallest rectangle that can contain the entire second area. In some embodiments, the bounding rectangle of the second area is determined by using the contour points of the second area. Specifically, the contour point with the largest horizontal coordinate, the contour point with the smallest horizontal coordinate, the contour point with the largest vertical coordinate, and the contour point with the smallest vertical coordinate are obtained from the contour points. These four contour points constitute the four vertices of the bounding rectangle, and the line connecting the four contour points constitutes the boundary of the bounding rectangle.
[0142] In some embodiments, since the trajectory points are the locations corresponding to the center point of the cleaning robot, the first area cannot fully reflect the area trapped by the cleaning robot. In addition to expanding the first area, the restricted area can also be determined by discrete obstacles (i.e., small, non-wall obstacles) outside the first area. If there are discrete obstacles outside the first area, and the discrete obstacles are close to the first area, the cleaning robot may not be able to pass between the first area and the discrete obstacles. Therefore, the obstacle points corresponding to the discrete obstacles should also be expanded into the restricted area.
[0143] Specifically, if Figure 12 As shown, step S302 further includes:
[0144] S3023: Searching for obstacles outside the first area at a second preset distance;
[0145] According to the second preset distance, the search range is set. First, the centroid of the first area is obtained. Then, a circular area with the centroid as the center and the second preset distance as the radius is obtained. The circular area includes the first area and the search area. If the centroid of the first area is Figure 13 As shown by the n points in the figure, the search area S2 is as follows: Figure 13 As shown in the shaded area in the figure, the first area S1 and the search area S2 together form a circular area, and the radius of the circular area is the second preset distance d2. Finally, the search area is searched for obstacles. If there is an obstacle, and the obstacle point is point E, the first area is expanded to point E, and the search is continued until no other obstacles can be found or the search point has exceeded the search area. The search is terminated to obtain the expanded first area.
[0146] The second preset distance d2 determines the range of the search area. If it is too large, it will easily affect normal cleaning. If it is too small, it may cause the cleaning robot to be unable to pass normally. Therefore, the second preset distance d2 is generally set to 2 times the diameter of the cleaning robot or 2 times the maximum axis length of the cleaning robot, that is, the width of the search area is approximately the diameter of the cleaning robot or the maximum axis length of the cleaning robot. For example: the diameter of the cleaning robot is 0.35 meters, then the second preset distance is 0.7 meters. This can ensure that the cleaning robot can pass normally, and will not search too far or the scope of the search area is too large.
[0147] S3024: If an obstacle exists, the first area is expanded to the obstacle to obtain the restricted area.
[0148] If there is an obstacle, the outline of the first area is expanded to the obstacle point corresponding to the obstacle, and the obstacle point is also placed within the trapped area to obtain a more optimized restricted area.
[0149] Specifically, first, a third area enclosed by obstacle points corresponding to the obstacle and contour points of the first area is obtained, and a circumscribed rectangle of the third area is determined as a restricted area.
[0150] like Figure 14 As shown in the figure, if the contour points of the first area are points B, C, F to J, and the obstacle point is point E, then point E is included in the trapped area, and the area enclosed by point E and points B, C, F to J is the third area S3. Then, the circumscribed rectangle of the third area S3 is obtained to obtain the restricted area. The restricted area S is as follows: Figure 15 The area enclosed by the yellow dotted line is shown in the figure.
[0151] It should be noted that the above embodiment uses a single obstacle point as an example. In other embodiments, if there are multiple obstacles, the corresponding multiple obstacle points are included in the trapped area, and a third area is obtained by obtaining the third area enclosed by the multiple obstacle points and the contour points of the first area. Finally, the circumscribed rectangle of the third area is determined as the restricted area. The process of determining the restricted area is similar to that of the above embodiment and will not be repeated here.
[0152] In some embodiments, if the restricted area is too large, the cleaning robot may not be able to pass through the area to enter the room or cleaning area where the restricted area is located for cleaning, affecting the normal cleaning function. It is necessary to narrow the scope of the restricted area so that the cleaning robot can pass normally.
[0153] Specifically, first determine whether there is a cleaning path for the cleaning robot to enter the target cleaning area, where the cleaning path bypasses the restricted area. If so, the restricted area is determined as the target restricted area. If not, the scope of the restricted area is narrowed until a cleaning path exists, and the narrowed restricted area is determined as the target restricted area.
[0154] The target cleaning area can be the area to be cleaned where the restricted area is located, or it can be other areas to be cleaned where no restricted area exists. The following takes the target cleaning area as the area to be cleaned where the restricted area is located as an example to illustrate the process of adjusting the restricted area.
[0155] like Figure 15 As shown, if the restricted area S is Figure 15 As shown in the area surrounded by the yellow frame in the figure, the target cleaning area is room P. When the cleaning robot wants to enter room P from outside to clean, it must first use the starting point of the cleaning robot as the starting point and the center point of room P as the end point, and regard the restricted area S as an obstacle to perform path planning to plan a cleaning path. If there is a cleaning path that bypasses the restricted area, the restricted area S is determined as the target restricted area. If there is no cleaning path that bypasses the restricted area, it indicates that the cleaning robot cannot enter room P to clean. The scope of the restricted area S is reduced by a preset value each time. For example, the scope of the restricted area S is reduced by 0.1 meters each time. After reduction, path planning is performed again. If there is still no cleaning path that bypasses the reduced restricted area, the scope of the restricted area is continued to be reduced until a cleaning path is found. The reduced restricted area is determined as the target restricted area. The target restricted area S' is shown in FIG. Figure 15 The area enclosed by the red frame is shown in the figure.
[0156] In some embodiments, after obtaining the target restricted area, it is necessary to guide the cleaning robot to escape so as to start the next cleaning work. Figure 16 As shown, the restricted area identification method further includes:
[0157] S40: Acquire a second point set, wherein the second point set is a trajectory point set sorted by time, and the starting trajectory point in the second point set is the trajectory point closest to the target restricted area in time;
[0158] The cleaning robot's escape navigation point should be outside the target restricted area so that the cleaning robot can escape effectively. Therefore, it is necessary to screen out the target escape point from various trajectory points outside the target restricted area.
[0159] If the set of trajectory points of the cleaning robot from its departure to its entrapment includes the first trajectory point, the second trajectory point, ..., the Mth trajectory point, ..., the N-1th trajectory point, and the Nth trajectory point, where M and N are both positive integers and the trajectory points in the trajectory point set are arranged in reverse chronological order, then if the first point set consists of the Nth trajectory point, the N-1th trajectory point, ..., the M+1th trajectory point, then the target restricted area includes all trajectory points in the first point set, and the trajectory point closest in time to the target restricted area is the Mth trajectory point. Therefore, the second point set consists of the Mth trajectory point, the M-1th trajectory point, ..., the Lth trajectory point, where the Mth trajectory point is the starting trajectory point of the second point set and the Lth trajectory point is the ending trajectory point of the second point set. The number of trajectory points in the second point set is M-L+1, and the number of trajectory points in the second point set can be set as needed, where L is a positive integer greater than or equal to 1.
[0160] All the track points in the second point set are not in the target restricted area, and escape navigation points are selected from the track points in the second point set to guide the cleaning robot to escape.
[0161] S50: Determine an escape navigation point according to the second point set;
[0162] Starting from the starting trajectory point in the second point set, the second point set is searched in sequence to search for a second target trajectory point that meets the preset conditions, and the second target trajectory point is determined as the escape navigation point, wherein the preset conditions are that there are no obstacles in the preset area where the second target trajectory point is located, and the preset area has no intersection with the target restricted area.
[0163] Please continue reading Figure 15 , the target restricted area S' is the area surrounded by the red frame, then the trajectory point closest to the target restricted area in time is the Mth trajectory point pointed by the arrow, and the point from the Mth trajectory point to the starting point of the cleaning robot (point A) is the second point set. Start searching from the Mth trajectory point to search whether there is an obstacle in its preset area. If so, abandon the Mth trajectory point and continue searching forward, searching the M-1th trajectory point until the second target trajectory point that meets the preset conditions is found, and the second target trajectory point is determined as the escape navigation point. For example, if the M-1th trajectory point meets the preset conditions, the target escape point is the M-1th trajectory point.
[0164] In order for the cleaning robot to escape successfully, the preset area should enable the cleaning robot to pass normally. In some embodiments, the preset area is a circular area with the second target trajectory point as the center and the diameter of the cleaning robot as the radius, or a circular area with the maximum axis length of the cleaning robot as the radius.
[0165] If the preset area intersects with the target restricted area, the cleaning robot may be trapped in the restricted area again when trying to escape, and will not be able to escape successfully. Therefore, the absence of obstacles in the preset area and the absence of intersection between the preset area and the target restricted area will ensure that the cleaning robot can move smoothly to the navigation point and escape successfully.
[0166] S60: Control the cleaning robot to move to the escape navigation point.
[0167] Taking the current position of the cleaning robot as the starting point and the escape navigation point as the target point, the cleaning robot plans the path and controls the cleaning robot to escape the target restricted area by navigation or following the wall, reach the escape navigation point, and escape smoothly.
[0168] After escaping, the cleaning robot will report the target restricted area to the client or cloud. The user can choose whether to add the target restricted area to the real restricted area according to the actual situation. For example, if the user confirms that the target restricted area is indeed a restricted area, it will be added to the real restricted area. In the subsequent cleaning process, the cleaning robot can avoid the area to prevent it from being trapped again, thereby improving cleaning efficiency.
[0169] In some embodiments, after determining the target restricted area, the cleaning robot can report the target restricted area, or, after determining the target restricted area, the target restricted area is directly displayed on the client, and in the subsequent cleaning process, the target restricted area is used as an obstacle area to plan a suitable cleaning path to prevent the cleaning robot from being trapped again.
[0170] In summary, the restricted area recognition method can promptly detect whether the cleaning robot is trapped, and when the cleaning robot is trapped, promptly identify the trapped area to avoid being trapped again during subsequent cleaning, thereby improving cleaning efficiency.
[0171] An embodiment of the present application further provides a computer-readable storage medium, which stores computer-executable instructions. The computer-executable instructions are used to enable an electronic device to execute the restricted area identification method provided in the embodiment of the present application.
[0172] In some embodiments, the storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EE PROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories.
[0173] In some embodiments, executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0174] As an example, executable instructions may, but do not necessarily, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (for example, files storing one or more modules, subroutines, or code portions).
[0175] As an example, executable instructions may be deployed to be executed on one computing device (including devices such as smart terminals and servers), or on multiple computing devices located in one location, or on multiple computing devices distributed in multiple locations and interconnected by a communication network.
[0176] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0177] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, or of course by hardware. Those skilled in the art can understand that all or part of the processes in the above embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0178] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Based on the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the present application as described above. For the sake of simplicity, they are not provided in detail. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A restricted area recognition method, applied to a cleaning robot, characterized in that: include: Acquire a first point set, wherein the first point set is a set of a preset number of trajectory points of the cleaning robot starting from a current trajectory point of the cleaning robot; determining whether the cleaning robot is trapped according to the first point set; If the cleaning robot is trapped, a restricted area is identified based on the first point set, wherein the restricted area is the area where the robot is trapped.
2. The method according to claim 1, characterized in that The determining whether the cleaning robot is trapped according to the first point set includes: Obtaining the maximum distance between each trajectory point in the first point set; If the maximum distance is greater than a first preset threshold, it is determined that the cleaning robot is not trapped; If the maximum distance is less than or equal to the first preset threshold, it is determined that the cleaning robot is trapped.
3. The method according to claim 2, characterized in that The obtaining of the maximum distance between each trajectory point in the first point set includes: Obtaining a first straight-line distance between each trajectory point in the first point set; The maximum value among the first straight-line distances is determined as the maximum distance.
4. The method according to claim 2, characterized in that The obtaining of the maximum distance between each trajectory point in the first point set further includes: Performing convex hull detection on the first point set to obtain a convex hull polygon; Determine each first target trajectory point, wherein the first target trajectory point is a trajectory point located on an edge of the convex hull polygon; Obtaining a second straight-line distance between each of the first target trajectory points; The maximum value among the second straight-line distances is determined as the maximum distance.
5. The method according to claim 1, wherein The identifying a restricted area according to the first point set includes: Performing convex hull detection on the first point set to obtain a convex hull polygon and a first region, wherein the first region is a region enclosed by the convex hull polygon; The restricted area is obtained according to the first area.
6. The method according to claim 5, characterized in that The obtaining of the restricted area according to the first area includes: Expanding the first area according to a first preset distance to obtain a second area; A circumscribed rectangle of the second area is determined as the restricted area.
7. The method according to claim 5, characterized in that The step of obtaining the restricted area according to the first area further includes: Searching for obstacles outside the first area at a second preset distance; If an obstacle exists, the first area is expanded to the obstacle to obtain the restricted area.
8. The method according to claim 7, characterized in that The step of searching for obstacles outside the first area at a second preset distance includes: Obtaining the centroid of the first region; Acquire a circular area with the centroid as the center and the second preset distance as the radius, wherein the circular area includes the first area and the search area; Search whether there are any obstacles in the search area.
9. The method according to claim 7, characterized in that The step of expanding the first area to the obstacle to obtain the restricted area includes: Acquire a third area enclosed by the obstacle point corresponding to the obstacle and the contour points of the first area; The circumscribed rectangle of the third area is determined as the restricted area.
10. The method according to claim 1, characterized in that The method further comprises: determining whether there is a cleaning path for the cleaning robot to enter the target cleaning area, wherein the cleaning path bypasses the restricted area; If so, the restricted area is determined as a target restricted area; If not, the restricted area is reduced in scope until the cleaning path exists, and the reduced restricted area is determined as the target restricted area.
11. The method according to claim 10, characterized in that The method further comprises: Acquire a second point set, wherein the second point set is a trajectory point set sorted by time, and the starting trajectory point in the second point set is the trajectory point closest in time to the target restricted area; Determining an escape navigation point based on the second point set; The cleaning robot is controlled to move to the escape navigation point.
12. The method according to claim 11, characterized in that The determining of an escape navigation point according to the second point set includes: Starting from the starting track point in the second point set, searching the second point set in sequence to search for a second target track point that meets a preset condition, and determining the second target track point as the escape navigation point; The preset condition is that there are no obstacles in the preset area where the second target trajectory point is located, and the preset area has no intersection with the target restricted area.
13. A cleaning robot, characterized in that: include: at least one processor; A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor so as to enable the at least one processor to execute the restricted area identification method according to any one of claims 1 to 12.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer device to execute the restricted area identification method according to any one of claims 1 to 12.