Lawn mower out-of-bound detection method, device and equipment and storage medium
By building the grid map of the lawn mower and configuring the area attribute values, the complexity and real-time problems of existing geometric judgment methods in lawn mower out-bound detection are solved, and efficient and real-time lawn mower out-bound detection is achieved.
Patent Information
- Application Number
- CN202411652278.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-02-14
AI Technical Summary
The existing geometric judgment methods have high algorithm complexity, low real-time performance and weak adaptability in lawn mower out-bound detection, making it difficult to prevent the danger caused by lawn mower crossing boundary in a timely manner.
By determining the minimum external rectangle of the lawn mower, build a grid map, and configure corresponding area attribute values and grid resolution for each area in the grid map, use real-time position and heading to determine whether the lawn mower is out of bounds.
It reduces the complexity of the algorithm, improves the real-time and adaptability of detection, and can prevent lawn mowers from crossing the boundaries in a timely manner, ensuring safe operation.
Smart Images

Figure CN119440023A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robot technology, and in particular to a lawn mower out-of-bounds detection method, device, equipment and storage medium. Background Art
[0002] With the rapid development of technologies such as RTK (Real-time kinematic) technology and visual recognition technology, the boundary system of the lawn mower's working area has gradually changed from the traditional boundary line laid on the surface to a virtual boundary (collecting boundary data along the boundary of the working area for mapping). Among them, the traditional boundary line laying method is time-consuming and labor-intensive, and is not suitable for large scenes of thousands of square meters. The improved virtual boundary method is to collect boundary data along the boundary of the working area for mapping.
[0003] In order to ensure that the lawn mower can work normally within the preset working range, it is necessary to make real-time judgment and control whether the lawn mower is out of bounds to prevent the lawn mower from crossing the boundary and causing unpredictable dangers. For the virtual boundary method, geometric methods are currently used for out-of-bounds judgment, such as: ray method, area method, point-line judgment method, arc length method, etc. The algorithm complexity is O(n)-the larger the working area, the longer it takes, which affects the real-time performance of the lawn mower, and the area method, point-line judgment method, and arc length method are only applicable to convex polygons.
[0004] In summary, how to solve the shortcomings of the existing geometric judgment method, such as high algorithm complexity, low real-time performance, and weak adaptability, and timely prevent the lawn mower from crossing the boundary and causing unpredictable dangers, is an urgent problem to be solved. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a lawn mower out-of-bounds detection method, device, equipment and storage medium, which can solve the shortcomings of the existing geometric judgment method, such as high algorithm complexity, low real-time performance and weak adaptability, and timely prevent the lawn mower from crossing the boundary and causing unpredictable dangers. The specific scheme is as follows:
[0006] In a first aspect, the present application provides a method for detecting a lawn mower out of bounds, comprising:
[0007] Determine the minimum circumscribed rectangle of the lawn mower according to the shape of the lawn mower, construct a grid map based on the working area of the lawn mower and the driving direction of the lawn mower that meets the preset conditions, and configure corresponding regional attribute values and grid resolutions for each grid on the inner area, boundary area and outer area corresponding to the working area in the grid map;
[0008] Determine whether the current task of the lawn mower is completed, and if not, obtain the real-time position and heading of the lawn mower, and determine the first coordinates corresponding to each vertex of the minimum circumscribed rectangle in the world coordinate system according to the real-time position and heading;
[0009] Convert each of the first coordinates into each of the second coordinates corresponding to a grid coordinate system, and determine each of the grid numbers corresponding to each of the second coordinates on the grid map using the grid resolution;
[0010] Whether the lawn mower is out of bounds is determined based on the area attribute values of the grids corresponding to the grid numbers, so as to complete the out-of-bounds detection of the lawn mower.
[0011] Optionally, constructing a grid map based on the working area of the lawn mower and the driving direction of the lawn mower that meets preset conditions includes:
[0012] Collecting a plurality of boundary coordinates of the operation area by a preset acquisition device, and constructing a boundary coordinate set based on the plurality of boundary coordinates;
[0013] Fitting the boundary coordinate set to obtain a polygon corresponding to the operating area;
[0014] Determine the driving direction of the lawn mower when the number of U-turns of the lawn mower during the operation meets a preset condition by using the operating width of the lawn mower and the edges corresponding to the polygon;
[0015] Determining a grid resolution of the grid map according to the working width of the lawn mower;
[0016] The grid map is constructed based on the working area, the grid resolution, and the driving direction of the lawn mower.
[0017] Optionally, the acquiring the real-time position and heading of the lawn mower, and determining first coordinates corresponding to vertices of the minimum circumscribed rectangle in the world coordinate system according to the real-time position and heading, includes:
[0018] Determine the real-time position of the lawn mower according to the position of the center point of the minimum circumscribed rectangle, and obtain the heading of the lawn mower;
[0019] The first coordinates corresponding to the vertices of the minimum bounding rectangle in the world coordinate system are determined based on the real-time position, the heading, and the length and width of the minimum bounding rectangle.
[0020] Optionally, the converting each of the first coordinates into each of the second coordinates corresponding to a grid coordinate system includes:
[0021] Determine the target coordinates corresponding to the coordinate origin of the grid coordinate system in the world coordinate system, and determine the angle between the coordinate axes of the grid coordinate system and the coordinate axes of the world coordinate system;
[0022] The first coordinates corresponding to each vertex in the world coordinate system are converted into the second coordinates corresponding to the grid coordinate system based on the target coordinates and the angle.
[0023] Optionally, configuring corresponding regional attribute values and grid resolutions for each grid in the inner area, the boundary area, and the outer area corresponding to the operation area in the grid map includes:
[0024] configuring a first area attribute value for an in-bounds area corresponding to the operation area in the grid map, configuring a second area attribute value for a boundary area corresponding to the operation area in the grid map, and configuring a third area attribute value for an out-bounds area corresponding to the operation area in the grid map;
[0025] A first grid resolution is configured for the inner area and the outer area respectively, and a second grid resolution is configured for the boundary area according to the first grid resolution.
[0026] Optionally, the determining, by using the grid resolution, each grid number corresponding to each second coordinate on the grid map includes:
[0027] respectively determining the ratio of the coordinate value of each of the second coordinates to the first grid resolution;
[0028] The grid numbers corresponding to the second coordinates on the grid map are determined based on the ratios.
[0029] Optionally, the determining whether the lawn mower is out of bounds based on the area attribute value of the grid corresponding to each grid number includes:
[0030] If the area attribute values of the grids corresponding to the grid numbers are all the first area attribute values, it is determined that the lawn mower is not out of bounds;
[0031] If the area attribute value of the grid corresponding to any of the grid numbers is the third area attribute value, it is determined that the lawn mower is out of bounds;
[0032] If the area attribute value of the grid corresponding to any of the grid numbers is the second area attribute value, then determining the target grid number corresponding to the target vertex of the minimum circumscribed rectangle in the boundary area based on the grid number and the second grid resolution, and determining whether the lawn mower is out of bounds according to the area attribute value corresponding to the target grid number; the target vertex is a vertex whose area attribute value is the second area attribute value;
[0033] The step of determining whether the lawn mower is out of bounds according to the area attribute value corresponding to the target grid number includes:
[0034] If the area attribute value corresponding to any of the target grid numbers is the third area attribute value, it is determined that the lawn mower is out of bounds; otherwise, it is determined that the lawn mower is not out of bounds.
[0035] Optionally, after determining whether the lawn mower is out of bounds based on the area attribute value of the grid corresponding to each grid number, the method further includes:
[0036] If it is determined that the lawn mower is out of bounds, the lawn mower is controlled to stop running or to run to the in-bounds area;
[0037] If it is determined that the lawn mower is not out of bounds, determining whether the current task of the lawn mower is completed;
[0038] If not completed, jump back to the step of obtaining the real-time position and heading of the lawn mower;
[0039] If completed, it ends directly.
[0040] In a second aspect, the present application provides a lawn mower out-of-bounds detection device, comprising:
[0041] A grid map construction and configuration module, for determining the minimum circumscribed rectangle of the lawn mower according to the shape of the lawn mower, constructing a grid map based on the working area of the lawn mower and the driving direction of the lawn mower that meets the preset conditions, and configuring corresponding regional attribute values and grid resolutions for each grid on the inner area, boundary area and outer area corresponding to the working area in the grid map;
[0042] A first coordinate determination module, used for determining whether the current task of the lawn mower is completed, and if not completed, obtaining the real-time position and heading of the lawn mower, and determining the first coordinates corresponding to each vertex of the minimum circumscribed rectangle in the world coordinate system according to the real-time position and heading;
[0043] A grid number acquisition module, used for converting each of the first coordinates into each of the second coordinates corresponding to the grid coordinate system, and determining each of the grid numbers corresponding to each of the second coordinates on the grid map by using the grid resolution;
[0044] The out-of-bounds detection module is used to determine whether the lawn mower is out of bounds based on the area attribute value of the grid corresponding to each grid number, so as to complete the out-of-bounds detection of the lawn mower.
[0045] In a third aspect, the present application provides an electronic device, including:
[0046] Memory, used to store computer programs;
[0047] The processor is used to execute the computer program to implement the above-mentioned lawn mower out-of-bounds detection method.
[0048] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the lawn mower out-of-bounds detection method as described above is implemented.
[0049] In summary, the present application first determines the minimum circumscribed rectangle of the lawn mower according to the shape of the lawn mower, constructs a grid map based on the working area of the lawn mower and the driving direction of the lawn mower that meets preset conditions, and configures corresponding area attribute values and grid resolutions for each grid on the in-boundary area, boundary area and out-of-boundary area corresponding to the working area in the grid map; determines whether the current task of the lawn mower is completed, and if not, obtains the real-time position and heading of the lawn mower, and determines the first coordinates corresponding to each vertex of the minimum circumscribed rectangle in the world coordinate system according to the real-time position and the heading; converts each first coordinate into each second coordinate corresponding to the grid coordinate system, and uses the grid resolution to determine each grid number corresponding to each second coordinate on the grid map; determines whether the lawn mower is out of bounds based on the area attribute values of the grids corresponding to each grid number, so as to complete the out-of-bounds detection of the lawn mower. It can be seen that the present application first determines the minimum circumscribed rectangle corresponding to the lawn mower according to the shape of the lawn mower, constructs a grid map corresponding to the working area and the out-of-bounds area, and determines the regional attribute value and grid resolution in the grid map to determine whether the task of the lawn mower is completed. If not, the first coordinates of each vertex of the minimum circumscribed rectangle in the world coordinate system are determined according to the acquired real-time position and heading, and then the first coordinates are converted into the second coordinates of the grid coordinate system, and then the second coordinates are converted into the grid number in the grid map based on the grid resolution, and the lawn mower is determined whether it is out of bounds according to the regional attribute value corresponding to the grid number. In this way, by obtaining the regional attribute values of the vertices of the circumscribed rectangle to determine whether the lawn mower is out of bounds, no complex calculations are required in the whole process, which reduces the complexity of the algorithm, and is applicable to lawn mowers of various shapes, which improves the adaptability of the algorithm, and in the detection process, calculations are performed according to the real-time position of the lawn mower, which solves the problem of low real-time performance of the existing geometric judgment method algorithm, thereby preventing the lawn mower from crossing the boundary and causing unpredictable dangers. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0051] Figure 1 A flow chart of a lawn mower out-of-bounds detection method disclosed in the present invention;
[0052] Figure 2 A schematic diagram of a minimum circumscribed rectangle of a lawn mower disclosed in the present invention;
[0053] Figure 3 A schematic diagram of a grid map disclosed in the present invention;
[0054] Figure 4 It is a structural schematic diagram of a lawn mower out-of-bounds detection device disclosed in the present invention;
[0055] Figure 5 The present invention is a structural diagram of an electronic device disclosed in the present invention. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] At present, the traditional method of laying out the fence is time-consuming and labor-intensive, and is not suitable for large scenes of thousands of square meters. The improved virtual boundary method is to collect boundary data along the boundary of the working area for mapping, and the larger the working area, the longer it takes, which affects the real-time performance of the lawn mower. In order to solve the above technical problems, the application discloses a lawn mower out-of-bounds detection method, device, equipment and storage medium, which solves the problems of high algorithm complexity, low real-time performance and weak adaptability of the existing geometric judgment method, and can timely prevent the lawn mower from crossing the boundary and causing unpredictable dangers.
[0058] See also Figure 1 As shown, an embodiment of the present invention discloses a method for detecting a lawn mower out of bounds, comprising:
[0059] Step S11, determining the minimum circumscribed rectangle of the lawn mower according to the shape of the lawn mower, constructing a grid map based on the working area of the lawn mower and the driving direction of the lawn mower that meets preset conditions, and configuring corresponding area attribute values and grid resolutions for each grid on the in-boundary area, boundary area and out-boundary area corresponding to the working area in the grid map.
[0060] In this embodiment, in order to determine the minimum bounding rectangle of the lawn mower, the shape information of the lawn mower can be used to first collect the contour data of the lawn mower. This can be done by image processing algorithms, such as contour detection or edge detection in OpenCV, to identify the edge of the lawn mower and generate a contour point set. After obtaining the contour of the lawn mower, its minimum bounding rectangle can be calculated using the minimum enclosing rectangle algorithm to obtain a point set such as Figure 2 In addition, the circumscribed shape determined by the different shapes of the lawn mower is not limited to the minimum circumscribed rectangle, but can also be the minimum circumscribed circle. For example, if the lawn mower is circular, the minimum circumscribed circle or the minimum circumscribed rectangle of the lawn mower can be determined.
[0061] In this embodiment, after the minimum circumscribed rectangle of the lawn mower is determined, a grid map is constructed in combination with its preset working area. In the process of constructing the raster map, a plurality of boundary coordinates of the working area are collected by a preset acquisition device, and a boundary coordinate set is constructed based on the plurality of boundary coordinates; the boundary coordinate set is fitted to obtain a polygon corresponding to the working area; the working width of the lawn mower and the edges corresponding to the polygon are used to determine the direction of travel of the lawn mower when the number of U-turns of the lawn mower in the process of completing the operation meets the preset conditions; the raster resolution of the grid map is determined according to the working width of the lawn mower; and the grid map is constructed based on the working area, the raster resolution and the direction of travel of the lawn mower. Specifically, when constructing the raster map, the present application uses an acquisition device (which can be the lawn mower itself or other acquisition devices) to collect a set of coordinate points of the boundary of the working area. ; then at an angle right Perform straight line fitting and process it into a polygon S(n), where n is the number of sides of the polygon; use each line of S(n) as the operation direction to calculate the number of U-turns m. The side corresponding to m is the minimum value. That is, the direction of operation. , where B is the working width, which is also the first resolution of the raster map. In XO W The angle between the Y axis and the X axis in the world coordinate system . Then Rotation ,Right now:
[0062] ;
[0063] but Then calculate The maximum value in and minimum value . Then calculate the height of the grid map and width And assign the coordinate origin , where B is the first resolution of the grid map. It can be known that the grid map is a discretization of the continuous working area, and each grid represents a small area on the map and has a corresponding position, size, and specific resolution. The grid resolution is usually preset and is used to control the accuracy of the grid. A smaller resolution means higher accuracy, but it also brings a larger amount of data. The present application adopts dual resolution, that is, a larger resolution is used in the in-bounds area and the out-of-bounds area, and a smaller resolution is used in the boundary area. In addition, in order to reasonably plan the working path of the lawn mower, it is necessary to set the driving direction of the lawn mower. This direction can be selected according to various factors such as the working requirements, efficiency and path planning of the lawn mower to ensure that while covering the entire working area, the direction with the least number of U-turns is selected. Based on the determined driving direction, the grid can be further divided to ensure that the path of the lawn mower can adapt to the grid map.
[0064] It can be understood that in the constructed grid map, each grid unit will also be assigned different regional attribute values according to its position relative to the working area of the lawn mower. A first regional attribute value is configured for the in-bounds area corresponding to the working area in the grid map, a second regional attribute value is configured for the boundary area corresponding to the working area in the grid map, and a third regional attribute value is configured for the out-bounds area corresponding to the working area in the grid map; a first grid resolution is configured for the in-bounds area and the out-bounds area respectively, and a second grid resolution is configured for the boundary area according to the first grid resolution. In a specific embodiment, Figure 3 As shown, first the raster map The regional attribute value of all grids corresponding to the out-of-bounds area is marked as 2, the regional attribute value corresponding to the boundary area is set to 1, and the regional attribute value corresponding to the in-bounds area surrounded by attribute 1 is marked as 0. Assigning different attribute values to each type of grid cell helps to perform different processing in path planning and operation control, ensuring that the mower drives along the preset path in the in-bounds area, performing appropriate boundary detection and obstacle avoidance processing on the boundary area, and avoiding interference from the out-of-bounds area.
[0065] Step S12, determining whether the current task of the lawn mower is completed, if not completed, obtaining the real-time position and heading of the lawn mower, and determining the first coordinates corresponding to each vertex of the minimum circumscribed rectangle in the world coordinate system according to the real-time position and heading.
[0066] In this embodiment, when judging whether the task of the lawn mower is completed, if the task is not completed, the real-time position of the lawn mower is determined according to the position of the center point of the minimum enclosing rectangle, and the posture of the lawn mower is obtained (mainly the heading); based on the real-time position, heading, and the length and width of the minimum enclosing rectangle, the first coordinates corresponding to each vertex of the minimum enclosing rectangle in the world coordinate system are determined respectively. Among them, the heading can be obtained through the GNSS Global Navigation Satellite System, a global satellite navigation system, or through a vehicle-mounted IMU (Inertial Measurement Unit) or other angle sensors). After the real-time position, heading, and length and width information of the minimum enclosing rectangle of the lawn mower are known, the positions of each vertex of the enclosing rectangle in the world coordinate system can be calculated:
[0067] ;
[0068] Where W is the width of the minimum bounding rectangle; L is the length of the minimum bounding rectangle; is the heading of the lawn mower; x is the horizontal coordinate of the real-time position; y is the vertical coordinate of the real-time position; , , and It is the position of each vertex of the minimum circumscribed rectangle in the world coordinate system, that is, the first coordinate.
[0069] Step S13: convert each of the first coordinates into each of the second coordinates corresponding to the grid coordinate system, and use the grid resolution to determine each of the grid numbers corresponding to each of the second coordinates on the grid map.
[0070] In this embodiment, after obtaining the first coordinates, in order to convert the vertex coordinates of the minimum circumscribed rectangle of the lawn mower from the first coordinates to the second coordinates, it is necessary to determine the target coordinates corresponding to the coordinate origin of the grid coordinate system in the world coordinate system, and determine the angle between the coordinate axes of the grid coordinate system and the coordinate axes of the world coordinate system; based on the target coordinates and the angle, convert the first coordinates corresponding to each vertex in the world coordinate system into the second coordinates corresponding to the grid coordinate system. Specifically, determine the position of the coordinate origin of the grid coordinate system in the world coordinate system, and at the same time, determine the angle between the coordinate axes of the grid coordinate system and the coordinate axes of the world coordinate system, for example, determine the angle between the x-axis of the grid coordinate system and the x-axis of the world coordinate system. Next, based on the target coordinates and angle , transform the first coordinate of the vertex in the world coordinate system to the second coordinate in the grid coordinate system:
[0071] ;
[0072] in, is the horizontal coordinate of the origin of the grid coordinate system in the world coordinate system; is the ordinate of the origin of the grid coordinate system in the world coordinate system; is the angle between the world coordinate system and the grid coordinate system; W is the width of the minimum bounding rectangle; L is the length of the minimum bounding rectangle; is the heading of the lawn mower; x is the horizontal coordinate of the real-time position; y is the vertical coordinate of the real-time position; , , and It is the position of each vertex of the minimum circumscribed rectangle in the grid coordinate system, that is, the second coordinate.
[0073] In this embodiment, after the second coordinates are obtained, the ratios of the coordinate values of each second coordinate to the first grid resolution are determined respectively; and the grid numbers corresponding to each second coordinate on the grid map are determined based on the ratios. Specifically:
[0074] ;
[0075] Where B is the first resolution; x G and G are the horizontal and vertical coordinates in the second coordinate respectively; , , and It is the position of each vertex of the minimum circumscribed rectangle in the grid map, that is, the grid number.
[0076] Step S14: determining whether the lawn mower is out of bounds based on the area attribute values of the grids corresponding to the grid numbers, so as to complete the out-of-bounds detection of the lawn mower.
[0077] In this embodiment, when detecting whether the lawn mower is out of bounds, the regional attribute values corresponding to the vertices corresponding to the lawn mower in the grid map can be found through each grid number, and the position area of the lawn mower can be determined accordingly. Based on the above embodiment, it can be known that different regional attribute values have been assigned to each grid unit according to the position of the working area of the lawn mower, so as to identify the in-bounds area, the boundary area and the out-bounds area according to the regional attribute values. If the regional attribute values of the grids corresponding to each grid number are all the first regional attribute values, it is determined that the lawn mower is not out of bounds; if the regional attribute value of the grid corresponding to any grid number is the third regional attribute value, it is determined that the lawn mower is out of bounds; if the regional attribute value of the grid corresponding to any grid number is the second regional attribute value, then the target grid number corresponding to the target vertex of the minimum circumscribed rectangle in the boundary area is determined based on the grid number and the second grid resolution, and whether the lawn mower is out of bounds is determined according to the regional attribute value corresponding to the target grid number; the target vertex is a vertex whose regional attribute value is the second regional attribute value; if the regional attribute value corresponding to any target grid number is the third regional attribute value, it is determined that the lawn mower is out of bounds; otherwise, it is determined that the lawn mower is not out of bounds. Specifically, if the area attribute value corresponding to the grid number of the lawn mower is 0, it means that the lawn mower is within the safe operating range; if the area attribute value corresponding to any grid number of the lawn mower is 1, the lawn mower is at the edge of the operating area and further judgment is required; if the attribute value corresponding to any grid number of the lawn mower is 2, it means that the lawn mower has exceeded the designated operating area, triggering an out-of-bounds warning or control mechanism.
[0078] It can be understood that when the lawn mower is detected to be out of bounds, control measures must be taken immediately to ensure its safe operation. If it is determined that the lawn mower is out of bounds, the lawn mower is controlled to stop or to drive to the in-bounds area; if it is determined that the lawn mower is not out of bounds, it is determined whether the current task of the lawn mower is completed; if not, it jumps back to the step of obtaining the real-time position and heading of the lawn mower; if completed, it ends directly. Specifically, first, by detecting the regional attribute value of the grid where the lawn mower is currently located, if it is determined that the lawn mower has entered the out-of-bounds area, the lawn mower is immediately controlled to stop driving to prevent further deviation from the working area. Another strategy is to control the lawn mower to drive in the direction of the in-bounds area when it is out of bounds, so that it gradually returns to the working area. This automatic regression method can ensure that the lawn mower returns to the effective working area and continues the task. If the detection result shows that the mower is in the bounded area or the border area, indicating that the mower is not out of bounds, the system will determine whether the mower's task has been completed. If the task has not been completed, the steps of obtaining the mower's real-time position and heading will be re-executed to continue monitoring the mower. If the task is completed, the operation process will be terminated directly. This process realizes the comprehensive management of the mower's operation progress, driving status and out-of-bounds situation.
[0079] It can be seen that the present application first determines the minimum circumscribed rectangle corresponding to the lawn mower according to the shape of the lawn mower, constructs a grid map corresponding to the working area and the out-of-bounds area, and determines the regional attribute value and grid resolution in the grid map to determine whether the task of the lawn mower is completed. If not, the first coordinates of each vertex of the minimum circumscribed rectangle in the world coordinate system are determined according to the acquired real-time position and heading, and then the first coordinates are converted into the second coordinates of the grid coordinate system, and then the second coordinates are converted into the grid number in the grid map based on the grid resolution, and the lawn mower is determined whether it is out of bounds according to the regional attribute value corresponding to the grid number. In this way, by obtaining the regional attribute values of the vertices of the circumscribed rectangle to determine whether the lawn mower is out of bounds, no complex calculations are required in the whole process, which reduces the complexity of the algorithm, and is applicable to lawn mowers of various shapes, which improves the adaptability of the algorithm, and in the detection process, calculations are performed according to the real-time position of the lawn mower, which solves the problem of low real-time performance of the existing geometric judgment method algorithm, thereby preventing the lawn mower from crossing the boundary and causing unpredictable dangers.
[0080] Based on the previous embodiment, it can be known that the present application uses dual grid resolution to determine whether the lawn mower is out of bounds. The same resolution is used in the in-bounds area and the out-bounds area, and another resolution is used in the boundary area. When the lawn mower is in the boundary area, it is further determined whether the lawn mower is out of bounds based on the resolution used in the boundary area. Next, how to further determine whether the lawn mower is out of bounds will be described in detail.
[0081] First, when constructing raster map data, you can use a two-dimensional array ,Will All grids are marked as 2 (outside the boundary, non-drivable area), and the area attribute value corresponding to the boundary area is set to 1. Then the area within the boundary surrounded by attribute 1 is marked as 0 (drivable area). The first resolution B is used in the area within the boundary and the area outside the boundary, and the grid in the boundary area with attribute 1 is subdivided twice, that is, the second resolution of the boundary area is , (K ≥ 1, , where K is 3), to build a high-precision grid map ,in for The line in and column , For a submap that can take the form of a two-dimensional array ,but Expressed as , and then use the build methods, such as Figure 3 As shown, The corresponding grid is set to 0 / 1 / 2. Specifically, when K is 3, the first resolution is B, the second resolution is B / 3, the boundary area is converted based on the second resolution, and a boundary area with a resolution of B / 3 is obtained. The area attribute value corresponding to the grid adjacent to the out-of-bounds area in the boundary area is set to 2, the area attribute value corresponding to the grid adjacent to the in-bounds area in the boundary area is set to 0, and the area attribute value corresponding to the grid in the middle layer of the boundary area is set to 1.
[0082] In a specific embodiment, when the lawn mower is operating, if the area attribute values corresponding to all grid numbers of the vertices of the minimum circumscribed rectangle corresponding to the lawn mower are all 0, it is determined that the lawn mower is not out of bounds and can continue to operate. Secondly, if the area attribute value corresponding to any grid number is 2, it is determined that the lawn mower is out of bounds. This situation usually triggers an out-of-bounds alarm or controls the lawn mower to return to the in-bounds area. However, when the area attribute value corresponding to any grid number is 1, it is necessary to further determine the boundary situation of the lawn mower:
[0083] ;
[0084] in, is the grid number of the target vertex in the boundary area of the second resolution, i=1, 2, 3, 4; B is the first resolution of the grid map; B / K is the second resolution, K≥1; and They are the horizontal and vertical coordinates in the second coordinate respectively.
[0085] Afterwards, the target grid number of the target vertex corresponding to the boundary area in the minimum circumscribed rectangle in the boundary area of the second resolution is determined based on the grid number and the second grid resolution. By checking the region attribute value corresponding to the target grid number, it is determined whether the lawn mower is out of bounds. If the region attribute value corresponding to any target grid number is 2, it is determined that the lawn mower is out of bounds. Otherwise, if the region attribute value corresponding to the target grid number is 1 or 0, the lawn mower is still in the boundary area and can continue to work. This method of determining the region attribute value layer by layer ensures accurate detection of the position state of the lawn mower, especially when the lawn mower is in the boundary area, it can avoid misjudgment and take corresponding safety measures when necessary.
[0086] It can be seen that different regional attribute values and grid resolutions are set for each part of the grid map. The resolution inside and outside the boundary is unified to save computing resources, while the boundary area is configured with high resolution to ensure the accuracy of sensitive area identification. By comparing the regional attributes of the grid number, it is determined whether the mower exceeds the predetermined working limit. If it drives to the boundary area, the refinement inspection process is started, and the safety status of the position is further confirmed by combining high resolution, and finally an accurate cross-border prompt or warning is given to ensure safe and efficient mowing operations.
[0087] See also Figure 4 As shown, an embodiment of the present invention discloses a lawn mower out-of-bounds detection device, comprising:
[0088] A grid map construction and configuration module 11 is used to determine the minimum circumscribed rectangle of the lawn mower according to the shape of the lawn mower, construct a grid map based on the working area of the lawn mower and the driving direction of the lawn mower that meets the preset conditions, and configure corresponding area attribute values and grid resolutions for each grid on the inner area, boundary area and outer area corresponding to the working area in the grid map;
[0089] A first coordinate determination module 12 is used to determine whether the current task of the lawn mower is completed. If not, the real-time position and heading of the lawn mower are obtained, and the first coordinates corresponding to the vertices of the minimum circumscribed rectangle in the world coordinate system are determined according to the real-time position and heading.
[0090] A grid number acquisition module 13, used for converting each of the first coordinates into each of the second coordinates corresponding to the grid coordinate system, and determining each of the grid numbers corresponding to each of the second coordinates on the grid map by using the grid resolution;
[0091] The out-of-bounds detection module 14 is used to determine whether the lawn mower is out of bounds based on the area attribute value of the grid corresponding to each grid number, so as to complete the out-of-bounds detection of the lawn mower.
[0092] It can be seen that the present application first determines the minimum bounding rectangle corresponding to the lawn mower according to the shape of the lawn mower, constructs a grid map corresponding to the working area and the out-of-bounds area, and determines the regional attribute values and grid resolution in the grid map to determine whether the task of the lawn mower is completed. If not, the first coordinates of each vertex of the minimum bounding rectangle in the world coordinate system are determined according to the acquired real-time position and heading, and then the first coordinates are converted into the second coordinates of the grid coordinate system, and then the second coordinates are converted into the grid number in the grid map based on the grid resolution, and whether the lawn mower is out of bounds is determined according to the regional attribute values corresponding to the grid number. That is, by obtaining the regional attribute values of the vertices of the bounding rectangle to determine whether the lawn mower is out of bounds, the problems of high algorithm complexity, low real-time performance, and weak adaptability of the existing geometric judgment method are solved, and the lawn mower can be prevented from crossing the boundary and causing unpredictable dangers.
[0093] In some specific embodiments, the grid map construction and configuration module 11 may specifically include:
[0094] A boundary coordinate set construction unit, used to collect a plurality of boundary coordinates of the operation area through a preset collection device, and to construct a boundary coordinate set based on the plurality of boundary coordinates;
[0095] A polygon determination unit, used for fitting the boundary coordinate set to obtain a polygon corresponding to the operation area;
[0096] A lawn mower driving direction determining unit, used to determine the driving direction of the lawn mower when the number of U-turns of the lawn mower in the process of completing the operation meets a preset condition by using the working width of the lawn mower and the edges corresponding to the polygon;
[0097] A grid resolution determination unit, used to determine the grid resolution of the grid map according to the working width of the lawn mower;
[0098] A grid map construction unit is used to construct the grid map based on the working area, the grid resolution and the driving direction of the lawn mower.
[0099] In some specific embodiments, the first coordinate determination module 12 may specifically include:
[0100] A real-time position and heading determination unit, used to determine the real-time position of the lawn mower according to the position of the center point of the minimum circumscribed rectangle, and obtain the heading of the lawn mower;
[0101] The first coordinate acquisition unit is used to determine the first coordinates corresponding to each vertex of the minimum bounding rectangle in the world coordinate system based on the real-time position, the heading, and the length and width of the minimum bounding rectangle.
[0102] In some specific embodiments, the grid number acquisition module 13 may specifically include:
[0103] An angle determination unit, used to determine the target coordinates corresponding to the coordinate origin of the grid coordinate system in the world coordinate system, and to determine the angle between the coordinate axes of the grid coordinate system and the coordinate axes of the world coordinate system;
[0104] A second coordinate acquisition unit is configured to convert the first coordinates corresponding to each vertex in the world coordinate system into the second coordinates corresponding to the grid coordinate system based on the target coordinates and the angle.
[0105] In some specific embodiments, the grid number acquisition module 13 may specifically include:
[0106] A region attribute value configuration unit, configured to configure a first region attribute value for an inner region corresponding to the operation region in the grid map, configure a second region attribute value for a boundary region corresponding to the operation region in the grid map, and configure a third region attribute value for an outer region corresponding to the operation region in the grid map;
[0107] The grid resolution configuration unit is used to configure a first grid resolution for the inner area and the outer area respectively, and configure a second grid resolution for the boundary area according to the first grid resolution.
[0108] In some specific embodiments, the grid number acquisition module 13 may specifically include:
[0109] a ratio determination unit, used to respectively determine the ratio of the coordinate value of each second coordinate to the first grid resolution;
[0110] A grid number obtaining unit is used to determine each grid number corresponding to each second coordinate on the grid map based on each ratio.
[0111] In some specific embodiments, the out-of-bounds detection module 14 may specifically include:
[0112] a lawn mower not out of bounds determination unit, configured to determine that the lawn mower is not out of bounds if the area attribute values of the grids corresponding to the grid numbers are all the first area attribute values;
[0113] a lawnmower out-of-bounds determination unit, configured to determine that the lawnmower is out-of-bounds if the area attribute value of the grid corresponding to any of the grid numbers is the third area attribute value;
[0114] A unit for determining an area attribute value of a lawn mower boundary is configured to determine, based on the grid number and the second grid resolution, a target grid number corresponding to a target vertex of the minimum circumscribed rectangle in the boundary area, if the area attribute value of the grid corresponding to any of the grid numbers is the second area attribute value, and determine whether the lawn mower is out of bounds according to the area attribute value corresponding to the target grid number; the target vertex is a vertex whose area attribute value is the second area attribute value;
[0115] The area attribute value determination unit of the lawn mower boundary may specifically include:
[0116] a lawnmower out-of-bounds determination subunit, configured to determine that the lawnmower is out-of-bounds if the area attribute value corresponding to any of the target grid numbers is the third area attribute value;
[0117] The lawn mower is not out of bounds determining subunit is used to determine that the lawn mower is not out of bounds otherwise.
[0118] In some specific embodiments, the lawn mower out-of-bounds detection device may further include:
[0119] A lawn mower control unit, configured to control the lawn mower to stop running or to drive the lawn mower to the in-bounds area if it is determined that the lawn mower is out of bounds;
[0120] A task completion judgment unit, used for judging whether the current task of the lawn mower is completed if it is determined that the lawn mower is not out of bounds;
[0121] A real-time position and heading acquisition unit, used for jumping back to the step of acquiring the real-time position and heading of the lawn mower if the step is not completed;
[0122] The task ending unit is used to end the task directly if it is completed.
[0123] Furthermore, the present application also discloses an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0124] Figure 5 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the lawn mower out-of-bounds detection method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0125] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0126] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0127] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the lawn mower out-of-bounds detection method executed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.
[0128] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the above-disclosed lawn mower out-of-bounds detection method is implemented. The specific steps of the method can refer to the corresponding contents disclosed in the above-disclosed embodiments, and will not be repeated here.
[0129] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0130] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0131] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0132] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0133] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for detecting a lawn mower out of bounds, characterized in that: include: Determine the minimum circumscribed rectangle of the lawn mower according to the shape of the lawn mower, construct a grid map based on the working area of the lawn mower and the driving direction of the lawn mower that meets the preset conditions, and configure corresponding regional attribute values and grid resolutions for each grid on the inner area, boundary area and outer area corresponding to the working area in the grid map; Determine whether the current task of the lawn mower is completed, and if not, obtain the real-time position and heading of the lawn mower, and determine the first coordinates corresponding to each vertex of the minimum circumscribed rectangle in the world coordinate system according to the real-time position and heading; Convert each of the first coordinates into each of the second coordinates corresponding to a grid coordinate system, and determine each of the grid numbers corresponding to each of the second coordinates on the grid map using the grid resolution; Whether the lawn mower is out of bounds is determined based on the area attribute values of the grids corresponding to the grid numbers, so as to complete the out-of-bounds detection of the lawn mower.
2. The lawn mower out-of-bounds detection method according to claim 1, characterized in that: The step of constructing a grid map based on the working area of the lawn mower and the driving direction of the lawn mower that meets preset conditions includes: Collecting a plurality of boundary coordinates of the operation area by a preset acquisition device, and constructing a boundary coordinate set based on the plurality of boundary coordinates; Fitting the boundary coordinate set to obtain a polygon corresponding to the operating area; Determine the driving direction of the lawn mower when the number of U-turns of the lawn mower during the operation meets a preset condition by using the operating width of the lawn mower and the edges corresponding to the polygon; Determining a grid resolution of the grid map according to the working width of the lawn mower; The grid map is constructed based on the working area, the grid resolution, and the driving direction of the lawn mower.
3. The lawn mower out-of-bounds detection method according to claim 1, characterized in that: The step of acquiring the real-time position and heading of the lawn mower and determining first coordinates corresponding to vertices of the minimum circumscribed rectangle in the world coordinate system according to the real-time position and heading includes: Determine the real-time position of the lawn mower according to the position of the center point of the minimum circumscribed rectangle, and obtain the heading of the lawn mower; The first coordinates corresponding to the vertices of the minimum bounding rectangle in the world coordinate system are determined based on the real-time position, the heading, and the length and width of the minimum bounding rectangle.
4. The lawn mower out-of-bounds detection method according to claim 1, characterized in that: The converting each of the first coordinates into each of the second coordinates corresponding to the grid coordinate system comprises: Determine the target coordinates corresponding to the coordinate origin of the grid coordinate system in the world coordinate system, and determine the angle between the coordinate axes of the grid coordinate system and the coordinate axes of the world coordinate system; The first coordinates corresponding to each vertex in the world coordinate system are converted into the second coordinates corresponding to the grid coordinate system based on the target coordinates and the angle.
5. The lawn mower out-of-bounds detection method according to claim 1, characterized in that: The configuring corresponding regional attribute values and grid resolutions for each grid on the inner area, the boundary area and the outer area corresponding to the operation area in the grid map comprises: configuring a first area attribute value for an in-bounds area corresponding to the operation area in the grid map, configuring a second area attribute value for a boundary area corresponding to the operation area in the grid map, and configuring a third area attribute value for an out-bounds area corresponding to the operation area in the grid map; A first grid resolution is configured for the inner area and the outer area respectively, and a second grid resolution is configured for the boundary area according to the first grid resolution.
6. The lawn mower out-of-bounds detection method according to claim 5, characterized in that: The determining, by using the grid resolution, each grid number corresponding to each second coordinate on the grid map comprises: respectively determining the ratio of the coordinate value of each of the second coordinates to the first grid resolution; The grid numbers corresponding to the second coordinates on the grid map are determined based on the ratios.
7. The lawn mower out-of-bounds detection method according to claim 5, characterized in that: The determining whether the lawn mower is out of bounds based on the area attribute value of the grid corresponding to each grid number includes: If the area attribute values of the grids corresponding to the grid numbers are all the first area attribute values, it is determined that the lawn mower is not out of bounds; If the area attribute value of the grid corresponding to any of the grid numbers is the third area attribute value, it is determined that the lawn mower is out of bounds; If the area attribute value of the grid corresponding to any of the grid numbers is the second area attribute value, then determining the target grid number corresponding to the target vertex of the minimum circumscribed rectangle in the boundary area based on the grid number and the second grid resolution, and determining whether the lawn mower is out of bounds according to the area attribute value corresponding to the target grid number; the target vertex is a vertex whose area attribute value is the second area attribute value; The step of determining whether the lawn mower is out of bounds according to the area attribute value corresponding to the target grid number includes: If the area attribute value corresponding to any of the target grid numbers is the third area attribute value, it is determined that the lawn mower is out of bounds; otherwise, it is determined that the lawn mower is not out of bounds.
8. The lawn mower out-of-bounds detection method according to any one of claims 1 to 7, characterized in that: After determining whether the lawn mower is out of bounds based on the area attribute values of the grids corresponding to the grid numbers, the method further includes: If it is determined that the lawn mower is out of bounds, the lawn mower is controlled to stop running or to run to the in-bounds area; If it is determined that the lawn mower is not out of bounds, determining whether the current task of the lawn mower is completed; If not completed, jump back to the step of obtaining the real-time position and heading of the lawn mower; If completed, it ends directly.
9. A lawn mower out-of-bounds detection device, characterized in that: include: A grid map construction and configuration module, for determining the minimum circumscribed rectangle of the lawn mower according to the shape of the lawn mower, constructing a grid map based on the working area of the lawn mower and the driving direction of the lawn mower that meets the preset conditions, and configuring corresponding regional attribute values and grid resolutions for each grid on the inner area, boundary area and outer area corresponding to the working area in the grid map; A first coordinate determination module, used for determining whether the current task of the lawn mower is completed, and if not completed, obtaining the real-time position and heading of the lawn mower, and determining the first coordinates corresponding to each vertex of the minimum circumscribed rectangle in the world coordinate system according to the real-time position and heading; A grid number acquisition module, used for converting each of the first coordinates into each of the second coordinates corresponding to the grid coordinate system, and determining each of the grid numbers corresponding to each of the second coordinates on the grid map by using the grid resolution; The out-of-bounds detection module is used to determine whether the lawn mower is out of bounds based on the area attribute value of the grid corresponding to each grid number, so as to complete the out-of-bounds detection of the lawn mower.
10. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the lawn mower out-of-bounds detection method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the lawn mower out-of-bounds detection method as described in any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Lawn trimming and obstacle avoidance planning method and device for lawn mower
CN121050417A