Sweeping robot and control device and control method thereof
By constructing the virtual boundary and equidistant path of the sweeping robot, the problem of the sweeping robot stepping out of the virtual boundary at the boundary without real walls is solved, and the cleaning effect and efficiency are improved.
Patent Information
- Application Number
- CN202510463707.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-08-12
AI Technical Summary
During the cleaning process along the wall, the sweeping robot may accidentally walk to the boundary without real walls, such as the door of the room, causing it to walk out of the preset virtual boundary, interrupt the cleaning task and enter unnecessary areas, affecting the overall cleaning effect and efficiency.
By obtaining the raster map of the target area, building a virtual boundary and generating an equidistant path, the sweeping robot is controlled to detect the distance between the virtual boundary, and if the distance is less than the preset value, follow and clean along the equidistant path of the virtual boundary.
The sweeping robot is able to walk along the virtual boundary with the same effect as the real wall, improves the cleaning effect and efficiency, and avoids the phenomenon of walking out of the virtual boundary.
Smart Images

Figure CN120458436A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of sweeping robots, and in particular to a sweeping robot and a control device and a control method thereof. Background Art
[0002] Robot vacuums have gained widespread adoption in household cleaning and personal care due to their convenience and automation. With the widespread adoption of robot vacuums and their increasing functionality, users can customize the cleaning environment to suit their individual needs, by partitioning or dividing the room into different areas. However, in practice, when a room is designated as the cleaning area, the robot vacuum may accidentally stray outside the pre-set virtual boundary if it encounters a boundary without a physical wall, such as a doorway, while cleaning along a wall. This situation not only interrupts the normal cleaning task but can also cause the robot to enter unnecessary areas, impacting overall cleaning effectiveness and efficiency. Summary of the Invention
[0003] In view of this, the embodiments of the present application provide a robot vacuum cleaner and its control device and method, which can effectively solve the problem in the prior art that when a robot vacuum cleaner reaches a boundary without a real wall, such as a room door, while cleaning along a wall, it may accidentally go beyond the preset virtual boundary. This not only interrupts the normal cleaning task, but may also cause the robot to enter unnecessary areas, thereby affecting the overall cleaning effect and efficiency.
[0004] In a first aspect, an embodiment of the present application provides a control method for a sweeping robot, comprising:
[0005] Get the grid map of the target area;
[0006] Constructing a virtual boundary of the target area according to the grid map, wherein the virtual boundary includes one or more combinations of: a map boundary, a room boundary, a zone boundary, and a restricted area boundary;
[0007] constructing a virtual boundary equidistant path according to the virtual boundary;
[0008] Controlling the cleaning robot to start cleaning the area to be cleaned and perform distance detection on the virtual boundary;
[0009] If the distance between the cleaning robot and the virtual boundary is less than a first preset distance, the cleaning robot is controlled to follow and clean along an equidistant path along the virtual boundary.
[0010] In some embodiments, constructing a virtual boundary of the target area according to the grid map includes:
[0011] Acquiring the target area according to the grid map;
[0012] Traversing all points in the target area to screen out all points that meet the requirements for constructing the virtual boundary and forming a point set;
[0013] Constructing a first image data object, wherein global pixels of the first image data object are set to a first preset color;
[0014] The point set is written into the first image data object in a second preset color, and then contour detection is performed on the first image data object, and the obtained first contour is used as a virtual boundary.
[0015] In some embodiments, constructing a virtual boundary equidistant path according to the virtual boundary includes:
[0016] Constructing a second image data object, wherein global pixels of the second image data object are set to the first preset color, and the raster precision of the second image data object is higher than the raster precision of the first image data object;
[0017] writing the first outline into the second image data object in the second preset color, and writing the first outline after the thickness is changed into the second image data object again;
[0018] Then, contour detection is performed on the second image data object, and the obtained second contour is used as the virtual boundary equidistant path.
[0019] In some embodiments, controlling the cleaning robot to clean the area to be cleaned and detecting the distance to the virtual boundary includes:
[0020] Based on the coordinates of the cleaning robot, construct a third image data object, wherein the global pixel of the third image data object is set to the first preset color, and the coordinates of the cleaning robot are the center point of the third image data object;
[0021] Constructing at least two circular rings with different radii with the center point of the third image data object as the center of the circle;
[0022] writing the first outline into the third image data object in the second preset color;
[0023] The first contour is checked using each of the circles in a preset order. If the second preset color does not exist in the current circle, the radius of the previous circle that is larger than the radius of the current circle is used as the detection distance between the sweeping robot and the virtual boundary.
[0024] In some embodiments, if the distance between the cleaning robot and the virtual boundary is less than a first preset distance, controlling the cleaning robot to follow and clean along an equidistant path along the virtual boundary includes:
[0025] If the distance between the cleaning robot and the virtual boundary is less than a first preset distance, controlling the cleaning robot to search for an equidistant path to the virtual boundary;
[0026] After the cleaning robot selects the virtual boundary equidistant path, controlling the cleaning robot to select an initial target point on the selected virtual boundary equidistant path;
[0027] After the initial target point is selected, the cleaning robot is controlled to follow and clean along the selected virtual boundary equidistant path from the initial target point according to a preset following distance.
[0028] In some embodiments, if the distance between the cleaning robot and the virtual boundary is less than a first preset distance, controlling the cleaning robot to search for an equidistant path to the virtual boundary includes:
[0029] Taking the current coordinate point of the sweeping robot in the grid map as the center, searching for the virtual boundary equidistant path within the neighborhood coordinates of the current coordinate point;
[0030] If there is only one virtual boundary equidistant path within the neighborhood coordinates of the current coordinate point, controlling the cleaning robot to use the current virtual boundary equidistant path as the selected virtual boundary equidistant path;
[0031] If there are at least two virtual boundary equidistant paths within the neighborhood coordinates of the current coordinate point, the sweeping robot is controlled to select at least two virtual boundary equidistant paths according to the priority of the virtual boundary equidistant paths, and the sweeping robot is controlled to use the selected virtual boundary equidistant path as the selected virtual boundary equidistant path.
[0032] In some embodiments, after the cleaning robot selects the virtual boundary equidistant path, controlling the cleaning robot to select an initial target point on the selected boundary equidistant path includes:
[0033] Taking the current coordinate point of the cleaning robot in the grid map as the center, searching for the selected virtual boundary equidistant path in the neighborhood coordinates corresponding to the current angle of the cleaning robot;
[0034] If there is only one virtual boundary equidistant path point of the selected virtual boundary equidistant path in the corresponding neighborhood coordinates, controlling the cleaning robot to use the current virtual boundary equidistant path point as the initial target point of the cleaning robot;
[0035] If there are at least two virtual boundary equidistant path points of the selected virtual boundary equidistant path in the corresponding neighborhood coordinates, the sweeping robot is controlled to calculate the distance between the current coordinate point and each of the virtual boundary equidistant path points, and the virtual boundary equidistant path point whose distance is within the preset following distance and closest to the preset following distance is used as the initial target point of the sweeping robot.
[0036] In some embodiments, the method further includes: if the cleaning robot abnormally enters a non-cleaning area, controlling the cleaning robot to determine whether the virtual boundary of the to-be-cleaned area exists at each azimuth angle with the current coordinate point as the center;
[0037] When it is determined that the virtual boundary of the area to be cleaned exists at the current azimuth angle, controlling the cleaning robot to determine whether there is an obstacle at the current azimuth angle;
[0038] When it is determined that there is no obstacle at the current azimuth angle, the cleaning robot is controlled to move forward in a straight line along the current azimuth angle to leave the non-cleaning area.
[0039] In a second aspect, an embodiment of the present application provides a control device for a sweeping robot, comprising:
[0040] A map acquisition module is used to obtain a grid map of the target area;
[0041] A virtual boundary construction module is used to construct a virtual boundary of the target area according to the grid map, wherein the virtual boundary includes one or more combinations of: a map boundary, a room boundary, a zone boundary, and a restricted area boundary;
[0042] A virtual boundary equidistant path construction module, configured to construct a virtual boundary equidistant path according to the virtual boundary;
[0043] A cleaning control and distance detection module, used to control the cleaning robot to start cleaning the area to be cleaned and perform distance detection with the virtual boundary;
[0044] The following cleaning control module is used to control the cleaning robot to follow and clean along an equidistant path along the virtual boundary if the distance between the cleaning robot and the virtual boundary is less than a first preset distance.
[0045] In a third aspect, an embodiment of the present application provides a sweeping robot, which includes a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the computer program to implement the above-mentioned sweeping robot control method.
[0046] The embodiments of the present application have the following beneficial effects:
[0047] The control method of the sweeping robot of the embodiment of the present application is as follows: obtaining a grid map of the target area; constructing a virtual boundary of the target area according to the grid map, the virtual boundary including: one or more combinations of map boundaries, room boundaries, zone boundaries and restricted area boundaries; constructing a virtual boundary equidistant path according to the virtual boundary; controlling the sweeping robot to start cleaning the area to be cleaned and perform distance detection with the virtual boundary; if the distance between the sweeping robot and the virtual boundary is less than a first preset distance, controlling the sweeping robot to follow and clean along the virtual boundary equidistant path. Prevent the sweeping robot from walking out of the virtual boundary. This method achieves the same effect of the sweeping robot walking along the virtual boundary as walking along a real wall, greatly improving the cleaning effect and efficiency of the sweeping robot. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0049] Figure 1 A first structural diagram of the sweeping robot according to an embodiment of the present application is shown;
[0050] Figure 2 A first flow chart showing a method for controlling a sweeping robot according to an embodiment of the present application is shown;
[0051] Figure 3 A second flow chart showing the control method of the sweeping robot according to an embodiment of the present application is shown;
[0052] Figure 4 A third flow chart showing the control method of the sweeping robot according to an embodiment of the present application is shown;
[0053] Figure 5 A fourth flow chart showing the control method of the sweeping robot according to an embodiment of the present application is shown;
[0054] Figure 6 A schematic diagram illustrating an application of a sweeping robot according to an embodiment of the present application detecting a distance from a virtual boundary is shown;
[0055] Figure 7 A fifth flow chart showing the control method of the sweeping robot according to an embodiment of the present application is shown;
[0056] Figure 8 A sixth flow chart showing the control method of the sweeping robot according to an embodiment of the present application is shown;
[0057] Figure 9A seventh flow chart showing the control method of the sweeping robot according to an embodiment of the present application is shown;
[0058] Figure 10 An eighth flow chart showing the control method of the sweeping robot according to an embodiment of the present application is shown;
[0059] Figure 11 A structural schematic diagram of a control device of a sweeping robot according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0060] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0061] The components of the embodiments of the present application generally described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but rather merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.
[0062] Hereinafter, the terms "including", "having" and their cognates used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the aforementioned items, and should not be understood as excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the aforementioned items or adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the aforementioned items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and should not be understood as indicating or implying relative importance.
[0063] Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meaning as in the context of the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning unless clearly defined in the various embodiments of the present application.
[0064] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.
[0065] Considering that the sweeping robot in the prior art may accidentally walk out of the preset virtual boundary when it moves to a boundary without a real wall, such as a room door, during the process of cleaning along the wall. Not only will it interrupt the normal cleaning task, it may also cause the robot to enter unnecessary areas, thereby affecting the overall cleaning effect and efficiency. The present application provides a sweeping robot and its control device and control method, which controls the sweeping robot to clean the area to be cleaned and detect the distance with the virtual boundary; if the distance between the sweeping robot and the virtual boundary is less than a first preset distance, the sweeping robot is controlled to follow and clean along an equidistant path along the virtual boundary according to a preset following distance. This method achieves the same effect of the sweeping robot walking along the virtual boundary as along a real wall, greatly improving the cleaning effect and efficiency of the sweeping robot.
[0066] Please refer to Figure 1 , is a structural diagram of a sweeping robot 10 provided in an embodiment of the present application. In this embodiment, the sweeping robot 10 includes a processor 11, a memory 12, a sensing unit 13, and an execution unit 14, among others, wherein the memory 12, the sensing unit 13, and the execution unit 14 are all connected to the processor 11, the memory 12 stores a corresponding computer program, and the processor 11 is used to execute the computer program to implement the control method in the embodiment of the present application, that is, by controlling the sweeping robot to clean the area to be cleaned and detect the distance with the virtual boundary; if the distance between the sweeping robot and the virtual boundary is less than a first preset distance, the sweeping robot is controlled to follow and clean along an equidistant path along the virtual boundary according to a preset following distance. This method achieves the same effect of the sweeping robot walking along the virtual boundary as walking along a real wall, greatly improving the cleaning effect of the sweeping robot.
[0067] Among them, the processor 11 can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), 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. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application.
[0068] The memory 12 may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store computer programs, and the processor can execute the computer programs accordingly after receiving an execution instruction.
[0069] Among them, the perception unit 13 is mainly used to transmit necessary external environmental information to the control system of the sweeping robot 10, thereby providing the necessary conditions for the sweeping robot 10 in scenarios such as cleaning, building maps or recharging. For example, the perception unit 13 may include but is not limited to, laser radar, camera, infrared sensor, etc. Among them, the infrared sensor can be used to obtain distance information from the external environment, and the laser radar can be used to obtain external obstacle information, etc., but is not limited to this function; and the camera can be used to obtain image information of the sweeping robot 10 during the walking process. Furthermore, the robot can use these distance and / or image information to perform corresponding control to achieve various working modes. For example, the working mode may include but is not limited to obstacle avoidance walking, wall cleaning, bow-shaped cleaning, area mapping, etc.
[0070] The execution unit 14 is primarily used to implement the cleaning function of the sweeping robot 10. For example, it may include, but is not limited to, a spray cleaning component and a dirt removal component. The specific structure of the execution unit 14 can be determined according to actual needs. Generally, the more types of cleaning modes, the more corresponding execution components are set. Detailed description is not provided here.
[0071] Based on the structure of the above-mentioned sweeping robot 10 , the method for extracting the cleanable area will be described below in conjunction with some specific embodiments.
[0072] The control method of the sweeping robot is described below with reference to some specific embodiments.
[0073] Figure 2 A schematic diagram of a control method for a sweeping robot according to an embodiment of the present application is shown. Exemplarily, the control method includes the following steps:
[0074] Step S100: Acquire a grid map of the target area.
[0075] For example, the robot is controlled to move and utilizes a sensor unit mounted on the robot to collect environmental information. This information is then converted into gridded map data using a SLAM (Simultaneous Localization and Mapping) algorithm. For example, the sensor unit can be a radar, ultrasonic sensor, camera, infrared sensor, etc. The grid resolution can be set based on the actual application.
[0076] Step S110 : constructing a virtual boundary of the target area according to the grid map.
[0077] Exemplarily, the virtual boundary includes one or more of a map boundary, a room boundary, a zone boundary, and a restricted area boundary. It is understood that only one virtual boundary can be set according to the grid map, or multiple virtual boundaries can be set according to the grid map.
[0078] For example, if the room boundaries are set, the range of the room can be obtained according to the grid map, and the grid points that meet the room division requirements can be saved as a point set. The room boundaries can be obtained after contour detection is performed on the point set.
[0079] For example, in one embodiment, Figure 3 As shown, step S110 includes the following sub-steps:
[0080] Step S200: Acquire the target area according to the grid map.
[0081] Exemplarily, the virtual boundary is a room boundary, and the area range of the room is obtained according to the grid map.
[0082] Step S210 traverses all points in the target area to screen out points that meet the requirements for constructing a virtual boundary and form a point set.
[0083] Traverse all coordinate points within the room area and save the coordinate points that meet the room division requirements to obtain a point set. You can determine whether the current coordinate point meets the requirements based on features such as location, connectivity, and occupancy status.
[0084] It is understandable that the entire grid map can be traversed in units of rows and columns to detect each coordinate point of the grid map, and multi-threading or parallel computing can also be used to accelerate the traversal process.
[0085] Step S220 : constructing a first image data object, and setting the global pixels of the first image data object to a first preset color.
[0086] For example, construct an OpenCV Mat object as the first image data object. You can set the global pixel of the first image data object based on the actual application. For example, set the global pixel of the first image data object to black, i.e., a black background. The Mat (matrix) object is the memory data object of the image file in OpenCV.
[0087] Step S230 : writing the point set into the first image data object in a second preset color, performing contour detection on the first image data object, and using the obtained first contour as a virtual boundary.
[0088] The color of the point set can be any color. It is understandable that the color of the point set should be different from the color of the global pixel of the first image data object. Exemplarily, the color of the point set is white, and the point set is drawn into the first image data object as white.
[0089] Exemplarily, a function is used to find the outline of the first image data object and draw it to obtain a first outline, which is the room boundary.
[0090] It is understandable that if the virtual boundary includes at least two types of boundaries, the two virtual boundaries should be set separately according to the grid map. For example, the virtual boundary includes the room boundary and the map boundary. The range of the room should be obtained first, and the coordinate points that meet the room division requirements should be saved as the room division point set. The room boundary should be obtained after contour detection of the room division point set; then the range of the map should be obtained, and the coordinate points that meet the requirements should be saved as the map point set. The map boundary should be obtained after contour detection of the map point set.
[0091] Step S120 : constructing a virtual boundary equidistant path according to the virtual boundary.
[0092] It is understood that a virtual boundary equidistant path is a new path formed by moving inward or outward by a certain distance relative to the virtual boundary. The distance between the virtual boundary and the virtual boundary equidistant path can be set according to actual application conditions. It is understood that different virtual boundaries correspond to different virtual boundary equidistant paths, and the distances between each virtual boundary and the corresponding virtual boundary equidistant path can be the same or different. Each virtual boundary equidistant path can be formed by expanding each virtual boundary or contracting each virtual boundary.
[0093] Exemplarily, the virtual boundary equidistant paths corresponding to the map boundary, room boundary and zone boundary are obtained by shrinking the map boundary, room boundary and zone boundary, and the virtual boundary equidistant path corresponding to the restricted area boundary is obtained by expanding the restricted area boundary.
[0094] For example, in one embodiment, Figure 4As shown, step S120 includes the following sub-steps:
[0095] Step S300 : constructing a second image data object, setting global pixels of the second image data object to a first preset color, and having a grid accuracy higher than that of the first image data object.
[0096] Exemplarily, the global pixels of the second image data object are black, that is, the second image data object has a black background, and the grid accuracy of the second image data object is set higher than the grid accuracy of the first image data object, thereby reducing the spacing between the coordinate points in the virtual boundary point set, making the path planning of the sweeping robot more accurate.
[0097] Step S310 , writing the first outline into the second image data object in a second preset color, and writing the first outline after the thickness is changed into the second image data object again.
[0098] Exemplarily, the color of the first outline is white, and the first outline is drawn in the second image data object as white.
[0099] The thickness and color of the rewritten first outline can be set according to the actual application. If the thickness of the first outline is increased and the first outline with increased thickness is drawn again in white into the second image data object, the outline in the second image data object will expand outward; if the thickness of the first outline is increased and the first outline with increased thickness is drawn again in black into the second image data object, the outline in the second image data object will shrink inward.
[0100] Step S330 : performing contour detection on the second image data object, and using the obtained second contour as a virtual boundary equidistant path.
[0101] The contour of the second image data object is found by using a function and drawn to obtain a second contour, which is an equidistant path of the virtual boundary.
[0102] By changing the color and thickness of the virtual boundary, you can set the virtual boundary equidistant path. It is easy to operate and does not require complex geometric calculations. It greatly simplifies the development process and has strong adaptability.
[0103] Step S130 : Control the cleaning robot to start cleaning the area to be cleaned and detect the distance with the virtual boundary.
[0104] Specifically, the area to be cleaned can be set according to the actual application situation. For example, the user can set the current room as the area to be cleaned. Furthermore, the sweeping robot can be set to clean along the wall and not along the wall. When the sweeping robot is cleaning not along the wall, it can clean back and forth in the uncleaned area step by step in a "bow" shape.
[0105] When the robot vacuum is cleaning along a wall, it uses sensors to clean along the actual wall. When cleaning non-wall-based areas, it uses its position information to detect the distance to the virtual boundary in real time. It should be understood that since the robot vacuum is in motion, detection of the virtual boundary should be periodic, and the duration of the detection cycle can be set according to actual application conditions.
[0106] For example, in one embodiment, Figure 5 As shown, the distance detection between the cleaning robot and the virtual boundary in step S130 includes the following sub-steps:
[0107] Step S400: construct a third image data object based on the coordinates of the sweeping robot, wherein the global pixels of the third image data object are set to a first preset color, and the coordinates of the sweeping robot are the center point of the third image data object.
[0108] A third image data object is constructed based on the coordinates of the robot vacuum cleaner, with the robot vacuum cleaner's coordinates serving as the center point of the third image data object. The third image data object is a distance detection map based on the robot vacuum cleaner's coordinates. Exemplarily, the third image data object has a global pixel color of black, i.e., the third image data object has a black background.
[0109] Step S410 : constructing at least two circular rings with different radii with the center point of the third image data object as the center of the circle.
[0110] The number and radius of the rings can be set according to the actual application. The detection accuracy can be set by controlling the difference between the ring radii, and the detection range can be set by controlling the number of rings.
[0111] Step S420: writing the first outline into the third image data object in a second preset color.
[0112] It is understandable that the first outline is a virtual boundary, and if the virtual boundaries include multiple types, the first outline is multiple virtual boundaries. The first outline is drawn in white into the third image data object.
[0113] In step S430, the first outline is checked using each circle in a preset order. If the second preset color does not exist in the current circle, the radius of the previous circle larger than the radius of the current circle is used as the detection distance between the sweeping robot and the virtual boundary.
[0114] For example, in one embodiment, the circles are sorted from large to small according to their radius, and the circles are checked in order based on the sorting to see whether there are white coordinate points. If there are no white coordinate points on the point of the circle with the largest radius, then the point of the circle with the largest radius among the remaining circles is checked to see whether there are white coordinate points, and so on. When it is checked that there are no white coordinate points in the current circle, the radius of the previous circle with a larger radius than the current circle is set as the detection distance between the sweeping robot and the virtual boundary.
[0115] For example, Figure 6 As shown, the upper right corner rectangle is the virtual boundary. When checking the coordinate points with a radius of 5 units, it is found that there are white coordinate points in the 5-unit circle; when checking the coordinate points with a radius of 4 units, it is found that there are white coordinate points in the 4-unit circle; when checking the coordinate points with a radius of 3 units, it is found that there are no white coordinate points in the 3-unit circle. Therefore, the detection distance between the sweeping robot and the virtual boundary is 4 units. It is understandable that in actual application, the virtual boundary and the circle may be irregular shapes. Figure 6 Only the detection distance is described.
[0116] If all the circles have white coordinate points, the distance between the robot vacuum cleaner and the virtual boundary is zero. If no white coordinate points exist on all the circles, the distance between the robot vacuum cleaner and the virtual boundary exceeds the detection range. Furthermore, to optimize efficiency, a binary search method can be used for the check.
[0117] By setting a circular ring centered on the sweeping robot, the sweeping robot is controlled to detect the distance between it and the virtual boundary. The circular ring is a symmetrical shape that can achieve uniform detection in any direction. Due to the symmetry of the circular ring, there is no need to consider the differences in different directions, making the relevant calculations and algorithms simpler and more efficient. At the same time, the circular ring can also reduce blind spots and better adapt to complex environments.
[0118] Step S140 : If the distance between the cleaning robot and the virtual boundary is less than the first preset distance, the cleaning robot is controlled to follow and clean along an equidistant path along the virtual boundary.
[0119] The threshold between the robot vacuum and the virtual boundary, as well as the preset following distance, can be set based on actual application conditions. When the distance between the robot vacuum and the virtual boundary is less than the threshold, the robot vacuum is controlled to detect the virtual boundary path and follow and clean along the equidistant path of the virtual boundary according to the preset following distance. Furthermore, the priority of each equidistant path of the virtual boundary can be set. If the robot vacuum detects multiple virtual boundary paths, the equidistant path of the virtual boundary can be selected based on the preset priority, and the robot vacuum will clean according to the selected equidistant path of the virtual boundary.
[0120] A grid point comparison list can be constructed. Since the sweeping robot can obtain the coordinate points of the grid map of its current position in real time, the virtual boundary equidistant path is compared to the coordinate points based on the coordinate points of the grid map, which makes it easier for the sweeping robot to find the virtual boundary equidistant path points of the virtual boundary equidistant path and follow and clean along the virtual boundary equidistant path.
[0121] The virtual boundary equidistant paths corresponding to the map boundary, room boundary, and zone boundary are derived by indenting the map boundary, room boundary, and zone boundary, respectively. The virtual boundary equidistant paths corresponding to the restricted area boundary are derived by expanding the restricted area boundary. Therefore, the robot vacuum cleaner can clean along the virtual boundary equidistant paths, preventing it from colliding with or even stepping outside the virtual boundary. This ensures that the robot's movement along the virtual boundary is equivalent to walking along a real wall.
[0122] Exemplarily, the sweeping robot is a two-wheel differential sweeping robot, and various parameters for the sweeping robot to follow an equidistant path along a virtual boundary can be set according to actual application conditions, such as the sweeping robot's straight-line acceleration time, straight-line deceleration time, straight-line linear speed, steering linear speed, minimum wheel speed, maximum wheel speed, minimum angular velocity, maximum angular velocity and minimum following distance, etc.
[0123] For example, if the sweeping robot moves according to the steering linear speed, in order to further optimize the cleaning efficiency of the sweeping robot when the path is straight, the difference between the current azimuth angle of the sweeping robot and the azimuth angle of the following target point is judged. If the difference is small, for example, the difference is between ±5° and the duration reaches the linear acceleration time, the current speed can be accelerated to the linear speed within the linear slow acceleration time, thereby improving the cleaning efficiency of the sweeping robot.
[0124] Exemplarily, the following target point can be obtained according to the preset following distance, and the angular velocity of the sweeping robot can be obtained by the difference between the azimuth angle of the sweeping robot to the following target point and the current azimuth angle of the sweeping robot. Specifically, angular velocity = proportional coefficient * azimuth angle difference / distance between the two wheels of the sweeping robot. It can be understood that the angular velocity should be between the minimum angular velocity and the maximum angular velocity.
[0125] Calculate the speed difference based on the angular velocity and linear velocity, and then calculate the wheel speeds based on the speed difference. Specifically, speed difference = 0.5 * angular velocity * wheel spacing; left wheel speed = left wheel linear velocity + speed difference; right wheel speed = right wheel linear velocity - speed difference. The left wheel linear velocity is the straight-line velocity, and the right wheel linear velocity is the steering velocity.
[0126] The sweeping robot of this embodiment follows along the virtual boundary path according to the preset following distance, which can ensure that the sweeping robot evenly covers the area to be cleaned along the path and avoids blind spots. At the same time, it can also control the sweeping robot to slow down or stop in time before approaching an obstacle to avoid collision and ensure the safety of itself and the surrounding environment.
[0127] Furthermore, if the distance between the sweeping robot and the virtual boundary is less than a threshold, the sweeping robot cannot detect the virtual boundary path, and the sweeping robot is controlled to perform a small-angle counterclockwise rotation action, that is, repeating the action of moving away from the boundary and approaching the boundary, and walking along the virtual boundary in a wavy line-like walking route, so as to avoid the sweeping robot colliding with the virtual boundary, thereby further ensuring the stability of the sweeping robot.
[0128] In an optional embodiment, as Figure 7 As shown, in step S140, if the distance between the cleaning robot and the virtual boundary is less than the first preset distance, controlling the cleaning robot to follow and clean along an equidistant path along the virtual boundary includes:
[0129] Step S500 : If the distance between the cleaning robot and the virtual boundary is less than a first preset distance, the cleaning robot is controlled to search for an equidistant path to the virtual boundary.
[0130] If the distance between the sweeping robot and the virtual boundary is less than a threshold, the sweeping robot can be controlled to detect whether there is a virtual boundary equidistant path around it. A circle can be set with the sweeping robot as the center to detect whether there is a virtual boundary equidistant path in the circle. Alternatively, the sweeping robot can be used as the center to search for a virtual boundary equidistant path in the neighboring coordinates.
[0131] For example, in one embodiment, Figure 8 As shown, step S500 includes the following sub-steps:
[0132] Step S600 , taking the current coordinate point of the sweeping robot in the grid map as the center, searching for a virtual boundary equidistant path within the neighborhood coordinates of the current coordinate point.
[0133] Specifically, the neighborhood coordinates can be four neighborhoods, that is, the four directly adjacent points above, below, left, and right of the current coordinate point. The neighborhood coordinates can also be eight neighborhoods, that is, the eight adjacent points above, below, left, right, and diagonal directions of the current coordinate point. Exemplarily, the neighborhood coordinates are eight neighborhoods.
[0134] Step S610 : If there is only one virtual boundary equidistant path in the neighborhood coordinates of the current coordinate point, control the cleaning robot to use the current virtual boundary equidistant path as the selected virtual boundary equidistant path.
[0135] If the neighborhood coordinates of the current coordinate point have only one virtual boundary equidistant path, the current virtual boundary equidistant path is used as the selected virtual boundary equidistant path, and the sweeping robot is controlled to follow and clean along this virtual boundary equidistant path.
[0136] Step S620: If there are at least two virtual boundary equidistant paths within the neighborhood coordinates of the current coordinate point, control the sweeping robot to select the at least two virtual boundary equidistant paths according to the priorities of the virtual boundary equidistant paths, and control the sweeping robot to use the selected virtual boundary equidistant path as the selected virtual boundary equidistant path.
[0137] If multiple virtual boundary equidistant paths exist in the neighborhood coordinates, their priorities can be set based on the actual application. For example, the priority of the virtual boundary equidistant path corresponding to the map boundary can be set higher than the priority of the virtual boundary equidistant path corresponding to the district boundary. Based on the set priority, one of the virtual boundary equidistant paths is selected as the selected virtual boundary equidistant path.
[0138] Step S510 : After the cleaning robot selects the virtual boundary equidistant path, the cleaning robot is controlled to select an initial target point on the selected virtual boundary equidistant path.
[0139] After the sweeping robot selects the virtual boundary equidistant path, an initial target point is selected from each coordinate point on the virtual boundary equidistant path, so that the sweeping robot can travel to the virtual boundary equidistant path and clean according to the virtual boundary equidistant path.
[0140] In one embodiment, if Figure 9 As shown, step S510 includes the following sub-steps:
[0141] Step S700 : Taking the current coordinate point of the cleaning robot in the grid map as the center, searching for a selected virtual boundary equidistant path in the neighborhood coordinates corresponding to the current angle of the cleaning robot.
[0142] Exemplarily, the cleaning robot currently faces the upper side of the current coordinate point, and searches for coordinate points above the current coordinate point to see whether there are coordinate points of the selected virtual boundary equidistant path.
[0143] Step S710 : If there is only one virtual boundary equidistant path point of the selected virtual boundary equidistant path in the corresponding neighborhood coordinates, the cleaning robot is controlled to use the current virtual boundary equidistant path point as the initial target point of the cleaning robot.
[0144] If the grid accuracy of the virtual boundary equidistant path is the same as the grid accuracy of the grid map, there is only one virtual boundary equidistant path point of the selected virtual boundary equidistant path among the coordinate points above the current coordinate point, and this virtual boundary equidistant path point is used as the initial target point.
[0145] In step S720, if there are at least two selected virtual boundary equidistant path points of the corresponding neighborhood coordinates, the sweeping robot is controlled to calculate the distance between the current coordinate point and each virtual boundary equidistant path point, and the virtual boundary equidistant path point that is within the preset following distance and closest to the preset following distance is used as the initial target point of the sweeping robot.
[0146] If the grid accuracy of the virtual boundary equidistant path is higher than the grid accuracy of the grid map, there may be multiple virtual boundary equidistant path points of the selected virtual boundary equidistant path among the coordinate points above the current coordinate point. The straight-line distance between the coordinate point of the sweeping robot and each virtual boundary equidistant path point is calculated, and the points whose straight-line distance exceeds the preset following distance are excluded. The remaining points are screened. For example, the virtual boundary equidistant path point whose straight-line distance is closest to the preset following distance is selected as the initial target point.
[0147] Step S520: After the initial target point is selected, the cleaning robot is controlled to follow and clean along the selected virtual boundary equidistant path from the initial target point according to a preset following distance.
[0148] The robot is controlled to reach the initial target point first, and then follows the equidistant path along the selected virtual boundary at the initial target point.
[0149] In this embodiment, when the sweeping robot is controlled to be less than a first preset distance from the virtual boundary, an equidistant path of the virtual boundary is selected in the neighborhood coordinates, which simplifies the search space, reduces the computational complexity, and improves the computational efficiency. The neighborhood coordinate method is based on the distance measurement of the entire area and has higher noise resistance. At the same time, the neighborhood coordinate method can also maintain a consistent behavior pattern and has better stability.
[0150] In an optional embodiment, as Figure 10 As shown, the control method further includes:
[0151] In step S800 , if the cleaning robot abnormally enters a non-cleaning area, the cleaning robot is controlled to determine whether there is a virtual boundary of the area to be cleaned at each azimuth angle with the current coordinate point as the center.
[0152] For example, the user can set the current room as the designated cleaning area. If the robot vacuum moves out of the room abnormally, it is considered to have entered a non-cleaning area. The robot vacuum can use the current coordinate point as the center to determine whether there is a virtual boundary corresponding to the current room in each azimuth.
[0153] Step S810: When it is determined that a virtual boundary of the area to be cleaned exists at the current azimuth angle, the sweeping robot is controlled to determine whether an obstacle exists at the current azimuth angle.
[0154] When it is determined that a virtual boundary corresponding to the current azimuth exists at the current azimuth, it is determined whether there is an obstacle at the current azimuth.
[0155] Step S820: When it is determined that there is no obstacle at the current azimuth angle, the sweeping robot is controlled to move forward in a straight line along the current azimuth angle to leave the non-cleaning area.
[0156] If it is determined that there is no obstacle at the current azimuth angle, the sweeping robot is controlled to move in a straight line along the current azimuth angle to leave the non-cleaning area; if it is determined that there is an obstacle at the current azimuth angle, search for virtual boundaries of the cleaning area at other azimuth angles until the sweeping robot leaves the non-cleaning area.
[0157] like Figure 11 As shown, based on the method of the above embodiment, this embodiment proposes a control device 100 for a sweeping robot. Exemplarily, the control device 100 for the sweeping robot includes:
[0158] A map acquisition module 110 is used to acquire a grid map of a target area;
[0159] A virtual boundary construction module 120 is used to construct a virtual boundary of the target area based on the grid map, where the virtual boundary includes one or more combinations of: a map boundary, a room boundary, a zone boundary, and a restricted area boundary;
[0160] A virtual boundary equidistant path construction module 130 is configured to construct a virtual boundary equidistant path according to the virtual boundary;
[0161] The cleaning control and distance detection module 140 is used to control the cleaning robot to start cleaning the area to be cleaned and perform distance detection with the virtual boundary;
[0162] The following cleaning control module 150 is configured to control the cleaning robot to perform following cleaning along an equidistant path along the virtual boundary if the distance between the cleaning robot and the virtual boundary is less than a first preset distance.
[0163] It can be understood that the device of this embodiment corresponds to the control method of the above embodiment, and the optional items in the above embodiment are also applicable to this embodiment, so they will not be described again here.
[0164] The present application also provides a computer-readable storage medium for storing the computer program used in the cleaning robot. For example, the computer storage medium includes: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., which can store program code.
[0165] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or flowchart, and the combination of boxes in the structure diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0166] In addition, the functional modules or units in the various embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0167] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a smart phone, personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.
[0168] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
Claims
1. A control method for a sweeping robot, characterized in that: include: Get the grid map of the target area; Constructing a virtual boundary of the target area according to the grid map, wherein the virtual boundary includes one or more combinations of: a map boundary, a room boundary, a zone boundary, and a restricted area boundary; constructing a virtual boundary equidistant path according to the virtual boundary; Controlling the cleaning robot to start cleaning the area to be cleaned and perform distance detection on the virtual boundary; If the distance between the cleaning robot and the virtual boundary is less than a first preset distance, the cleaning robot is controlled to follow and clean along an equidistant path along the virtual boundary.
2. The control method of the sweeping robot according to claim 1, characterized in that: The constructing of a virtual boundary of a target area according to the grid map comprises: Acquiring the target area according to the grid map; Traversing all points in the target area to screen out all points that meet the requirements for constructing the virtual boundary and forming a point set; Constructing a first image data object, wherein global pixels of the first image data object are set to a first preset color; The point set is written into the first image data object in a second preset color, and then contour detection is performed on the first image data object, and the obtained first contour is used as a virtual boundary.
3. The control method of the sweeping robot according to claim 2, characterized in that: The constructing of a virtual boundary equidistant path according to the virtual boundary comprises: Constructing a second image data object, wherein global pixels of the second image data object are set to the first preset color, and the raster precision of the second image data object is higher than the raster precision of the first image data object; writing the first outline into the second image data object in the second preset color, and writing the first outline after the thickness is changed into the second image data object again; Then, contour detection is performed on the second image data object, and the obtained second contour is used as the virtual boundary equidistant path.
4. The control method of the sweeping robot according to claim 2, characterized in that: The controlling the cleaning robot to start cleaning the area to be cleaned and performing distance detection on the virtual boundary includes: Based on the coordinates of the sweeping robot, construct a third image data object, wherein the global pixel of the third image data object is set to a first preset color, and the coordinates of the sweeping robot are the center point of the third image data object; Constructing at least two circular rings with different radii with the center point of the third image data object as the center of the circle; writing the first outline into the third image data object in the second preset color; The first contour is checked using each of the circles in a preset order. If the second preset color does not exist in the current circle, the radius of the previous circle that is larger than the radius of the current circle is used as the detection distance between the sweeping robot and the virtual boundary.
5. The control method of the sweeping robot according to claim 3, characterized in that: If the distance between the cleaning robot and the virtual boundary is less than a first preset distance, controlling the cleaning robot to follow and clean along an equidistant path along the virtual boundary includes: If the distance between the cleaning robot and the virtual boundary is less than a first preset distance, controlling the cleaning robot to search for an equidistant path to the virtual boundary; After the cleaning robot selects the virtual boundary equidistant path, controlling the cleaning robot to select an initial target point on the selected virtual boundary equidistant path; After the initial target point is selected, the cleaning robot is controlled to follow and clean along the selected virtual boundary equidistant path from the initial target point according to a preset following distance.
6. The control method of the sweeping robot according to claim 5, characterized in that: If the distance between the cleaning robot and the virtual boundary is less than a first preset distance, controlling the cleaning robot to search for an equidistant path to the virtual boundary includes: Taking the current coordinate point of the sweeping robot in the grid map as the center, searching for the virtual boundary equidistant path within the neighborhood coordinates of the current coordinate point; If there is only one virtual boundary equidistant path within the neighborhood coordinates of the current coordinate point, controlling the cleaning robot to use the current virtual boundary equidistant path as the selected virtual boundary equidistant path; If there are at least two virtual boundary equidistant paths within the neighborhood coordinates of the current coordinate point, the sweeping robot is controlled to select at least two virtual boundary equidistant paths according to the priority of the virtual boundary equidistant paths, and the sweeping robot is controlled to use the selected virtual boundary equidistant path as the selected virtual boundary equidistant path.
7. The control method of the sweeping robot according to claim 5, characterized in that: After the cleaning robot selects the virtual boundary equidistant path, controlling the cleaning robot to select an initial target point on the selected boundary equidistant path includes: Taking the current coordinate point of the cleaning robot in the grid map as the center, searching for the selected virtual boundary equidistant path in the neighborhood coordinates corresponding to the current angle of the cleaning robot; If there is only one virtual boundary equidistant path point of the selected virtual boundary equidistant path in the corresponding neighborhood coordinates, controlling the cleaning robot to use the current virtual boundary equidistant path point as the initial target point of the cleaning robot; If there are at least two virtual boundary equidistant path points of the selected virtual boundary equidistant path in the corresponding neighborhood coordinates, the sweeping robot is controlled to calculate the distance between the current coordinate point and each of the virtual boundary equidistant path points, and the virtual boundary equidistant path point whose distance is within the preset following distance and closest to the preset following distance is used as the initial target point of the sweeping robot.
8. The control method of the sweeping robot according to claim 1, characterized in that: Also includes: If the cleaning robot abnormally enters a non-cleaning area, controlling the cleaning robot to determine whether the virtual boundary of the to-be-cleaned area exists at each azimuth angle with the current coordinate point as the center; When it is determined that the virtual boundary of the area to be cleaned exists at the current azimuth angle, controlling the cleaning robot to determine whether there is an obstacle at the current azimuth angle; When it is determined that there is no obstacle at the current azimuth angle, the cleaning robot is controlled to move forward in a straight line along the current azimuth angle to leave the non-cleaning area.
9. A control device for a sweeping robot, characterized in that: include: A map acquisition module is used to obtain a grid map of the target area; A virtual boundary construction module is used to construct a virtual boundary of the target area according to the grid map, wherein the virtual boundary includes one or more combinations of: a map boundary, a room boundary, a zone boundary, and a restricted area boundary; A virtual boundary equidistant path construction module, configured to construct a virtual boundary equidistant path according to the virtual boundary; A cleaning control and distance detection module, used to control the cleaning robot to start cleaning the area to be cleaned and perform distance detection with the virtual boundary; The following cleaning control module is used to control the cleaning robot to follow and clean along an equidistant path along the virtual boundary if the distance between the cleaning robot and the virtual boundary is less than a first preset distance.
10. A sweeping robot, characterized in that: The cleaning robot includes a processor and a memory, the memory stores a computer program, and the processor is configured to execute the computer program to implement the control method for the cleaning robot according to any one of claims 1 to 8.