Control method and navigation method for self-moving device, and method for configuring virtual forbidden zone
By assigning different values to restricted areas in the cost map of self-moving devices, updating path planning, and setting virtual collision detection, the efficiency and safety issues of self-moving devices in isolated areas and virtual restricted zones are solved, enabling efficient and safe navigation and cutting tasks.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- JIANGSU DONGCHENG M&E TOOLS CO LTD
- Filing Date
- 2025-12-29
- Publication Date
- 2026-07-09
AI Technical Summary
When mobile devices set up multiple isolated areas and virtual restricted zones in the work area, the work area becomes fragmented, affecting navigation and segmentation behavior, making it difficult to ensure normal operation.
By obtaining the location information of the restricted area, determining the associated areas of the restricted area, assigning different values to them in the cost map, updating the movement path and navigation route of the mobile device, avoiding the restricted area, setting virtual collision detection points for real-time obstacle avoidance, and verifying the legality of the virtual restricted area.
Ensure that mobile devices function properly in restricted areas to improve work efficiency and security, reduce missed cuts, and enhance user experience.
Smart Images

Figure CN2025146633_09072026_PF_FP_ABST
Abstract
Description
Methods for controlling and navigating self-moving devices, and methods for setting virtual restricted areas. Technical Field
[0001] This application relates to the field of self-moving device technology, and in particular to a control method, navigation method, and virtual restricted area setting method for self-moving devices. Background Technology
[0002] In related technologies, self-moving devices, such as automatic lawnmowers, can create isolated areas (like swimming pools or flowerbeds) by remotely controlling the device to create islands. For areas temporarily off-limits, such as children's play areas or picnic mats, users can set temporary virtual no-go zones via a mobile app. However, setting multiple islands and virtual no-go zones fragments the self-moving device's work area, making the cutting area more irregularly shaped. Furthermore, setting virtual no-go zones inevitably affects the device's navigation and cutting behavior. Summary of the Invention
[0003] This application provides a control method, a navigation method, and a method for setting up a virtual restricted area for a self-moving device.
[0004] In a first aspect, this application provides a control method for a self-moving device, comprising:
[0005] Obtain the location information of the restricted area, wherein the restricted area includes a virtual restricted area and / or an island, the virtual restricted area is a temporary inaccessible area set by the user in the working area of the self-mobile device, and the island is a fixed inaccessible area preset by the user in the working area of the self-mobile device;
[0006] Based on the location information of the restricted area, the associated area of the restricted area is determined;
[0007] Update the cost value of the corresponding grid cell in the cost map of the restricted area associated with the restricted area, wherein the cost map is a grid map constructed based on the working area of the self-moving device, and the cost value is used to represent the passage cost of each grid cell in the working area;
[0008] Based on the cost map, the movement path of the self-moving device during operation is determined.
[0009] In some implementations, determining the associated area of the restricted zone based on the location information of the restricted zone includes:
[0010] Based on the location information of the restricted area, the internal area of the restricted area, the boundary area of the restricted area, and the expansion area of the restricted area are determined, wherein the expansion area of the restricted area is the area obtained by expanding the boundary of the restricted area outward by a preset range;
[0011] The cost of updating the corresponding grid cell in the cost map for the restricted area includes:
[0012] Assign a first-generation value to the corresponding grid cell in the cost map for the area inside the restricted zone, assign a second-generation value to the corresponding grid cell in the cost map for the boundary area of the restricted zone, and assign a third-generation value to the corresponding grid cell in the cost map for the expanded area of the restricted zone.
[0013] In some implementations, determining the movement path of the self-moving device during operation based on the cost map includes:
[0014] Based on the cost value of each grid in the cost map, the cutting path is determined when the self-moving device performs the cutting task, and the cutting path does not pass through the grid with the first cost value and the second cost value.
[0015] Based on the cost value of each grid in the cost map, the navigation route for the self-moving device is determined, and the navigation route does not pass through grids with the first generation value, the second generation value, and the third cost value.
[0016] In some embodiments, the control method for the self-moving device further includes:
[0017] At least one virtual collision detection point is preset on the self-moving device;
[0018] During the operation of the self-moving device, the cost value of the virtual collision detection point corresponding to the grid in the cost map is detected in real time.
[0019] In response to the value of generation being equal to the first generation value and the second generation value, a virtual collision signal is generated, and the self-moving device is controlled to perform a preset collision response operation.
[0020] In some embodiments, the control method for the self-moving device further includes:
[0021] A local grid map is created based on the current location of the self-moving device;
[0022] Detect the cost value of each grid cell in the local grid map;
[0023] Mark the grid cells in the local grid map whose cost value is equal to the first cost value or the second cost value as obstacle grid cells;
[0024] In response to the distance between the self-moving device and the obstacle grid being less than or equal to a preset distance, the self-moving device is controlled to perform a non-contact obstacle avoidance operation.
[0025] In some embodiments, the control method for the self-moving device further includes:
[0026] The virtual restricted area is verified according to preset verification conditions. If the virtual restricted area does not meet the preset verification conditions, the verification fails and the virtual restricted area setting fails.
[0027] The preset verification conditions include at least one of the first preset condition, the second preset condition, and the third preset condition;
[0028] The first preset condition is configured such that at least a portion of the virtual restricted area is within the map boundary corresponding to the work area;
[0029] The second preset condition is configured as follows: the virtual restricted area does not overlap with the charging station associated area, and the charging station associated area is a region determined based on the location information of the charging station, used to characterize the area affecting the return of the mobile device to the charging station;
[0030] The third preset condition is configured as follows: the virtual restricted area has a preset shape.
[0031] In some implementations, the virtual restricted area is verified according to the first preset condition, including:
[0032] Obtain all vertices of the virtual restricted area;
[0033] Determine if any of the vertices in the virtual restricted area are outside the map boundary corresponding to the working area; if so, the verification fails.
[0034] In some implementations, the virtual restricted area is verified according to the third preset condition, including:
[0035] Obtain all vertices of the virtual restricted area;
[0036] Verify whether all vertices satisfy the preset relationship corresponding to the preset shape. If they do not satisfy the preset relationship, the verification fails.
[0037] In some embodiments, the control method for the self-moving device further includes:
[0038] During global navigation of the self-mobile device, the navigation destination is verified according to the cost map;
[0039] When the value of the grid where the navigation endpoint is located is equal to any one of the first generation value, the second generation value, and the third generation value, the navigation endpoint is moved according to a preset rule until the value of the grid where the navigation endpoint is located is not equal to any one of the first generation value, the second generation value, and the third generation value, and path planning is performed based on the new navigation endpoint.
[0040] If all points are traversed according to the preset rules and no navigation endpoint is found that meets the conditions, then the current global navigation ends.
[0041] In some implementations, when the global navigation is performed during the overlay cutting task by the self-moving device, the preset rule is configured as follows:
[0042] Starting from the original navigation endpoint, along the target cutting path, a point is selected at preset intervals, and the value of the point is judged until a point is selected whose value is not equal to any of the first generation value, the second generation value, and the third generation value. The selected point is used as the new navigation endpoint for path planning.
[0043] If no navigation endpoint that meets the conditions is found after traversing all points of the target cutting path, then the current coverage cutting task ends.
[0044] In some implementations, when the global navigation is performed during the edge-cutting task by the self-moving device, the preset rule is configured as follows:
[0045] Starting from the original edge cutting point, update the points according to the boundary point index and judge the value of the updated points until a point is selected whose value is not equal to any of the first generation value, the second generation value, and the third generation value. The selected point is used as the new navigation endpoint for path planning.
[0046] If no points meet the conditions after updating all points according to the boundary point index, then the current edge cutting task ends.
[0047] In some embodiments, the control method for the self-moving device further includes:
[0048] During the navigation process of the self-mobile device returning to the charging station, the navigation destination is verified according to the cost map;
[0049] If the value of the grid where the navigation endpoint is located is equal to any one of the first generation value, the second generation value, or the third generation value, an error message is output. The error message is used to indicate to the user that the restricted area setting is abnormal.
[0050] Secondly, this application provides a method for setting up a virtual restricted area, including:
[0051] Obtain the location information of the virtual restricted area, which is a temporary inaccessible area set by the user in the work area of the self-moving device;
[0052] The virtual restricted area is determined based on its location information;
[0053] Obtain the location information of the charging station, and determine the associated area of the charging station based on the location information of the charging station. The associated area of the charging station is used to characterize the area that affects the return of the self-moving device to the charging station.
[0054] The virtual restricted area is verified to determine whether it overlaps with the area associated with the charging station. If there is an overlap, the verification fails and the virtual restricted area setting fails.
[0055] In some implementations, determining whether the virtual restricted area overlaps with the charging station's associated area, and if so, failing the verification, includes:
[0056] A coordinate system for the charging station is established with the location of the charging station as the origin.
[0057] Define the associated region of the charging station in the coordinate system of the charging station;
[0058] Transform each point in the virtual restricted area to the coordinate system of the charging station;
[0059] If the coordinates of any point corresponding to the virtual restricted area fall into the area associated with the charging station, the verification fails.
[0060] In some embodiments, the method for setting the virtual restricted area further includes:
[0061] Obtain all vertices of the virtual restricted area;
[0062] Determine if any of the vertices of the virtual restricted area are within the map boundary corresponding to the working area; if not, the verification fails.
[0063] In some embodiments, the method for setting the virtual restricted area further includes:
[0064] Obtain all vertices of the virtual restricted area;
[0065] Verify whether all vertices satisfy the preset relationship corresponding to the preset shape. If not, the verification fails.
[0066] Thirdly, this application provides a navigation method for a self-moving device, comprising:
[0067] Obtain the location information of the restricted area, wherein the restricted area includes a virtual restricted area and / or an island, the virtual restricted area is a temporary inaccessible area set by the user in the working area of the self-mobile device, and the island is a fixed inaccessible area preset by the user in the working area of the self-mobile device;
[0068] Based on the location information of the restricted area, the associated area of the restricted area is determined;
[0069] During the global navigation process of the self-moving device, the navigation destination is verified;
[0070] If the navigation destination falls into the restricted area associated with the restricted area, the navigation destination will be moved according to the preset rules until the navigation destination does not fall into the restricted area associated with the restricted area, and a path will be planned according to the new navigation destination.
[0071] If all points are traversed according to the preset rules and no navigation endpoint is found that meets the conditions, then the current global navigation ends.
[0072] In some implementations, determining the associated area of the restricted zone based on the location information of the restricted zone includes:
[0073] Based on the location information of the restricted area, the internal area of the restricted area, the boundary area of the restricted area, and the expansion area of the restricted area are determined, wherein the expansion area of the restricted area is the area obtained by expanding the boundary of the restricted area outward by a preset range;
[0074] The process of verifying the navigation destination during global navigation on the self-mobile device includes:
[0075] The corresponding grid cells in the cost map of the area inside the restricted zone are assigned a first-generation value, the corresponding grid cells of the boundary area of the restricted zone are assigned a second-generation value, and the corresponding grid cells of the expanded area of the restricted zone are assigned a third-generation value; wherein, the cost map is a grid map constructed based on the working area of the self-moving device, and the generation value is used to characterize the passage cost of each grid cell in the working area.
[0076] If the value of the grid cell containing the navigation endpoint is equal to any one of the first generation value, the second generation value, or the third generation value, then the navigation endpoint is moved according to a preset rule until the value of the grid cell containing the navigation endpoint is no longer equal to any one of the first generation value, the second generation value, or the third generation value, and then path planning is performed based on the new navigation endpoint.
[0077] In some implementations, when the global navigation is performed during the overlay cutting task by the self-moving device, the preset rule is configured as follows:
[0078] Starting from the original navigation endpoint, along the target cutting path, a point is selected at preset intervals, and the value of the point is judged until a point is selected whose value is not equal to any of the first generation value, the second generation value, and the third generation value. The selected point is used as the new navigation endpoint for path planning.
[0079] If no navigation endpoint that meets the conditions is found after traversing all points of the target cutting path, then the current coverage cutting task ends.
[0080] In some implementations, when the global navigation is performed during the edge-cutting task by the self-moving device, the preset rule is configured as follows:
[0081] Starting from the original edge cutting point, update the points according to the boundary point index and judge the value of the updated points until a point is selected whose value is not equal to any of the first generation value, the second generation value, and the third generation value. The selected point is used as the new navigation endpoint for path planning.
[0082] If no points meet the conditions after updating all points according to the boundary point index, then the current edge cutting task ends.
[0083] Compared with the prior art, this application has the following beneficial effects: This application can ensure the normal operation of the self-moving device in the scenario of setting a restricted area, making the self-moving device perform work tasks and global navigation process more efficient and safe. Attached Figure Description
[0084] Figure 1 is a flowchart of a control method for a self-moving device according to an embodiment of this application;
[0085] Figure 2 is a flowchart of a method for setting a virtual restricted area according to an embodiment of this application;
[0086] Figure 3 is a flowchart of a navigation method for a self-moving device according to an embodiment of this application;
[0087] Figure 4 is a cost map generated based on a virtual restricted area according to an embodiment of this application;
[0088] Figure 5 is a cost map based on island generation according to an embodiment of this application;
[0089] Figure 6 is a schematic diagram of the mapping of the restricted area from the local coordinate system to the global coordinate system according to an embodiment of this application;
[0090] Figure 7 is a schematic diagram of the boundary grid range taken by column according to an embodiment of this application;
[0091] Figure 8 is a schematic diagram of virtual collision detection based on islands and virtual restricted areas according to an embodiment of this application;
[0092] Figure 9 is a flowchart of a control method for a self-moving device according to another embodiment of this application;
[0093] Figure 10 is a schematic diagram of a rectangular region constructed based on isolated islands according to an embodiment of this application;
[0094] Figure 11 is a schematic diagram of the structure of a computer device according to an embodiment of this application. Detailed Implementation
[0095] The terminology used in this invention / application is for the purpose of describing particular embodiments only and is not intended to limit this application. For example, terms such as "upper," "lower," "front," and "rear" that indicate orientation or positional relationship are based solely on the orientation or positional relationship shown in the drawings and are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device / component referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore should not be construed as limiting this application.
[0096] Self-moving devices, such as automatic lawnmowers (also known as smart lawnmowers), become more fragmented and irregularly shaped when multiple islands and virtual no-go zones are set up in their working area. Furthermore, setting up temporary virtual no-go zones will inevitably affect the navigation and cutting behavior of self-moving devices. For example, the original path planning strategy may fail due to reasons such as the navigation destination being unreachable, making it difficult to ensure that the navigation and cutting work of self-moving devices can proceed normally.
[0097] Referring to Figure 1, to solve the above problems, this application provides a control method for a self-moving device, including:
[0098] S11. Obtain the location information of the restricted area (also known as the obstacle zone), wherein the restricted area includes virtual restricted areas and / or isolated areas. Virtual restricted areas are temporary inaccessible areas set by the user in the working area of the self-moving device, and isolated areas are fixed inaccessible areas preset by the user in the working area of the self-moving device.
[0099] S12. Based on the location information of the restricted area, determine the associated areas of the restricted area;
[0100] S13. Update the cost value of the corresponding grid in the cost map of the restricted area. The cost map is a grid map built based on the working area of the self-moving device. The cost value is used to represent the passage cost of each grid in the working area.
[0101] S14. Based on the cost map, determine the movement path of the self-moving device when it is working.
[0102] Self-moving devices can include automatic lawnmowers, automatic cleaning equipment, etc. Taking an automatic lawnmower as an example, in its working area, there may be persistent obstacles or impassable areas, such as swimming pools or flower beds. Users can remotely control the lawnmower to move around these restricted or impassable areas, creating "islands." There are also areas that users temporarily restrict the lawnmower from entering, such as children's play areas or picnic mat areas. Users can set temporary virtual restricted zones through a mobile app. Restricted areas include islands and virtual restricted zones, which are areas set by the user where the automatic lawnmower is not allowed to enter.
[0103] The location information for restricted areas includes: the location information of virtual restricted zones and / or the location information of isolated islands. The location data for virtual restricted zones is determined based on the location set by the user through the mobile app, while the location information for isolated islands is determined based on their location. Specifically, the location information for virtual restricted zones can be the location information of the vertex set of the virtual restricted zone's graphic, the location information of the boundary set of the virtual restricted zone, the location information of the boundary and all points within the internal area of the virtual restricted zone, or the relative position of the entire virtual restricted zone area on the map rather than a set of points. The location information for isolated islands is similar and will not be elaborated further here.
[0104] It is understood that by marking the restricted area associated with the restricted area in the cost map, this embodiment can determine the movement path of the self-moving device when it is working based on the cost value of each grid in the cost map, avoid the restricted area, ensure the normal operation of the self-moving device, and make the self-moving device perform its work tasks and global navigation process more efficient and safe.
[0105] Step S12 further includes: determining the internal area of the restricted area, the boundary area of the restricted area, and the expanded area of the restricted area based on the location information of the restricted area. The expanded area is a region obtained by extending a preset range outward from the boundary of the restricted area. In other words, the associated area of the restricted area includes the internal area of the restricted area, the boundary area of the restricted area, and the expanded area of the restricted area.
[0106] Referring to Figure 4, in the grid map, based on the location information of the virtual restricted area, the associated regions of the virtual restricted area are determined. These associated regions include the virtual restricted area interior region 41, the virtual restricted area boundary region 42, and the virtual restricted area expansion region 43. Referring to Figure 5, in the grid map, based on the location information of the isolated islands, the associated regions of the isolated islands are determined. These associated regions include the isolated island interior region 51, the isolated island boundary region 52, and the isolated island expansion region 53.
[0107] Step S13 further includes: assigning first-generation values to the corresponding grid cells in the cost map of the area inside the restricted zone, assigning second-generation values to the corresponding grid cells in the cost map of the boundary area of the restricted zone, and assigning third-generation values to the corresponding grid cells in the cost map of the expanded area of the restricted zone.
[0108] It should be noted that virtual restricted areas and isolated islands are assigned different costs. For example, the virtual restricted area's internal region 41, virtual restricted area's boundary region 42, and virtual restricted area's expanded region 43 are assigned the costs of `RESTRICTED_AREA_COST`, `RESTRICTED_BOUNDARY_COST`, and `RESTRICTED_INFLATE_COST`, respectively. Similarly, the isolated island's internal region 51, isolated island's boundary region 52, and isolated island's expanded region 53 are assigned the costs of `ISLAND_AREA_COST`, `ISLAND_BOUNDARY_COST`, and `ISLAND_INFLATE_COST`, respectively.
[0109] For virtual restricted areas, in one specific embodiment, the cost of updating the corresponding grid cell in the cost map for the associated virtual restricted area includes:
[0110] Step 1: Referring to Figure 6, establish a local coordinate system with the first vertex of the virtual restricted area as the origin and the direction from the first vertex to the second vertex as the positive X-axis. Find the coordinates (x3, y3) of the third vertex in this local coordinate system.
[0111] Step 2: Expand the virtual restricted area in the local coordinate system, for example, by setting the expansion range to N. inflate When y3 > 0, the virtual restricted area expands to -N. inflate <=x local <= x3+N inflate -N inflate <=y local <= y3+N inflate
[0112] When y3 < 0, the virtual restricted area expands to -N. inflate <=x local <= x3+N inflate y3-N inflate <=y local <= N inflate
[0113] Step 3: Traverse the expanded virtual restricted area, then convert the local raster coordinates to global raster coordinates, and in the local coordinate system, x... local =x3 or x local =0 or y local =y3 or y localFor graticules with a value of 0, the cost value of the corresponding graticule on the cost map is refreshed to RESTRICTED_BOUNDARY_COST. For graticules in the local coordinate system that meet the following conditions, the cost value of the corresponding graticule on the cost map is refreshed to RESTRICTED_AREA_COST:
[0114] When y3 > 0, 0 <= x local <= x3 0 <= y local <= y3
[0115] When y3 < 0, 0 <= x local <= x3 y3 <= y local <=0
[0116] The cost values of other virtual restricted area grids in the local coordinate system are refreshed to `RESTRICTED_INFLATE_COST` on the corresponding cost map. The final cost map generated for the virtual restricted areas is shown in Figure 4.
[0117] In another specific embodiment, as shown in Figure 7, the cost of updating the corresponding grid cell of the virtual restricted area in the cost map includes:
[0118] Step 1: Filling the boundary points. Interpolate between each pair of the four vertices of the virtual restricted area in a clockwise or counterclockwise direction to fill in the gaps, creating a closed shape from all the scattered points.
[0119] Step 2: Find the maximum and minimum values of the closed figure in the X and Y axes of the grid coordinate system, respectively: MaxX, MinX, MaxY, and MinY.
[0120] Step 3: Starting from MinX and ending at MaxX, find the point corresponding to each Xi in the closed graph. Compare the Y coordinates of the corresponding points; the minimum value is BoundaryMinY, and the maximum value is BoundaryMaxY. Assign values to the raster coordinates of the column corresponding to Xi, for example, with a preset expansion range of N. inflate The range of points in the virtual restricted area extension region is:
[0121] (x i BoundaryMinY-N inf late ) to (x i BoundaryMinY-1)
[0122] (x i From (BoundaryMaxY+1) to (x i BoundaryMaxY+N inf late )
[0123] The cost of the grid points within these two ranges is refreshed to RESTRICTED_INFLATE_COST.
[0124] The boundary point is (x i BoundaryMinY), (x i The cost of these two grid points (BoundaryMaxY) is refreshed to RESTRICTED_BOUNDARY_COST.
[0125] The range of points inside the virtual restricted area is:
[0126] (x i BoundaryMinY+1) to (x i BoundaryMaxY-1)
[0127] Set the cost of the grid points within this range to RESTRICTED_AREA_COST.
[0128] Step three above describes the method of extracting the boundary grid range by column. By swapping X and Y, it becomes the method of extracting the boundary grid range by row. When calculating the virtual restricted area expansion region, both the column-based and row-based methods need to be executed once. When calculating the boundary or internal region of the virtual restricted area, only either the column-based or row-based method needs to be executed once.
[0129] For isolated islands, in one specific embodiment, the cost of updating the corresponding raster in the cost map for the island's associated region includes:
[0130] Step 1: Traverse all grids of the island map, determine the coordinates of each grid, and if it is inside the island, convert the local grid coordinates to global grid coordinates and update the cost value of the corresponding grid point on the cost map to ISLAND_AREA_COST; if it is on the island boundary, convert the local grid coordinates to global grid coordinates and update the cost value of the corresponding grid point on the cost map to ISLAND_BOUNDARY_COST; if it is outside the island, no modification to the cost map is required.
[0131] Step two, create a local map around the boundary points of the isolated island, with the following boundaries: -x max <=x local <=x max -y max <=y local <=y max
[0132] Iterate through all the grids within this local map, read the cost value of the corresponding grid point on the cost map, and if its cost value is not equal to ISLAND_AREA_COST and not equal to ISLAND_BOUNDARY_COST, then refresh the cost value of the corresponding grid point on the cost map to ISLAND_INFLATE_COST. Finally, the cost map generated for the island is shown in Figure 5.
[0133] After setting up multiple isolated islands and virtual no-go zones in the working area of an automatic lawnmower, the working area becomes more fragmented, and the cutting area becomes more irregular, which increases the difficulty of cutting, reduces cutting efficiency, and makes it easier to miss cuts, thus reducing the user experience.
[0134] To address the aforementioned issues, in some embodiments, the self-moving device is an automatic lawnmower, and step S14 further includes: determining the cutting path when the self-moving device performs the cutting task based on the cost value of each grid in the cost map, wherein the cutting path does not pass through grids with a first generation value and a second cost value; and determining the navigation route when the self-moving device performs navigation based on the cost value of each grid in the cost map, wherein the navigation route does not pass through grids with a first generation value, a second generation value, and a third cost value.
[0135] For example, when an automatic lawnmower is performing a cutting task, it will not enter grid areas with cost values of RESTRICTED_AREA_COST, RESTRICTED_BOUNDARY_COST, ISLAND_AREA_COST, and ISLAND_BOUNDARY_COST; and when the automatic lawnmower is performing global navigation, it will not enter grid areas with cost values of RESTRICTED_AREA_COST, RESTRICTED_BOUNDARY_COST, RESTRICTED_INFLATE_COST, ISLAND_AREA_COST, ISLAND_BOUNDARY_COST, and ISLAND_INFLATE_COST.
[0136] It should be noted that navigation can be during the coverage cutting process, from the current point to the starting point of the coverage cutting area, navigation after handling the bow-shaped anomaly, navigation from the current point to the vertical cutting starting point, navigation from the current point to the filling cutting starting point, and navigation again after the navigation endpoint is unreachable; it can also be during the edge cutting process, the process of navigating to the edge cutting starting point, and the process of updating the edge cutting starting point after the navigation to the edge cutting starting point is unreachable, etc.
[0137] It can be understood that the grids with first-generation value and second-generation cost value represent the internal and boundary areas of the restricted zone, while the grids with third-generation cost value represent the external expansion area of the restricted zone. Navigation considers the expansion area of the restricted zone, ensuring the automatic lawnmower stays away from the restricted zone and is less likely to collide or get stuck during navigation, thus preventing work interruptions and ensuring the automatic lawnmower can complete its task efficiently and safely. During cutting, the expansion area of the restricted zone is not considered, allowing the automatic lawnmower to get closer to the restricted zone and reduce missed cuts. Therefore, by planning paths based on different cost values during navigation and cutting, both work efficiency and missed cuts can be improved, and cutting quality can be enhanced.
[0138] In some embodiments, the control method for the self-moving device further includes: presetting at least one virtual collision detection point on the self-moving device; during the operation of the self-moving device, detecting in real time the cost value of the corresponding grid in the cost map of the virtual collision detection point; in response to the cost value being equal to the first generation value or the second generation value, generating a virtual collision signal, and controlling the self-moving device to perform a preset collision response operation.
[0139] The preset collision response operation can be an obstacle avoidance operation or other response operations that control the self-moving device to move away from the current grid. For example, it can be a backflip followed by a spin, with the rotation direction determined according to the path direction of the self-moving device performing the task.
[0140] It is understandable that the grid with the first-generation value and the second-cost value represents the internal and boundary areas of the restricted area. By detecting the cost value of the grid to generate a virtual collision signal, it is possible to prevent mobile devices from entering the restricted area and affecting the user experience.
[0141] For example, referring to Figure 8, the shape of the automatic lawnmower is equivalent to a rectangle. The four vertices of the rectangle and points spaced a certain distance (e.g., 20cm) between the vertices are taken as virtual collision detection points, resulting in multiple virtual collision detection points. During the operation of the automatic lawnmower, the grid map cost value of the multiple virtual collision detection points is detected in real time. If the cost value is equal to ISLAND_AREA_COST or ISLAND_BOUNDARY_COST, it is determined that the automatic lawnmower has caused a virtual collision with an isolated island; if the cost value is equal to RESTRICTED_AREA_COST or RESTRICTED_BOUNDARY_COST, it is determined that the automatic lawnmower has caused a virtual collision with a virtual restricted area.
[0142] In some embodiments, the control method for the self-moving device further includes: establishing a local grid map based on the current location of the self-moving device; detecting the cost value of each grid in the local grid map; marking grids in the grid map whose cost value is equal to a first cost value and a second cost value as obstacle grids; and controlling the self-moving device to perform a non-contact obstacle avoidance operation in response to the distance between the self-moving device and the obstacle grid being less than or equal to a preset distance.
[0143] For example, a 3m*3m local grid map is created with the motion center of the self-moving device as the geometric center. The cost value of each point in the local grid map is detected. If the cost value of a grid is equal to any one of ISLAND_AREA_COST, ISLAND_BOUNDARY_COST, RESTRICTED_AREA_COST, or RESTRICTED_BOUNDARY_COST, then this grid is added as a virtual obstacle point to the obstacle point set, i.e., marked as an obstacle grid. When the distance between the self-moving device and the obstacle grid is less than or equal to a preset distance, the self-moving device will perform a non-contact obstacle avoidance operation and move away from the obstacle grid.
[0144] It is understood that the grid with first-generation value and second-cost value is the inner area and boundary area of the restricted area. By marking the inner area and boundary area of the restricted area as obstacle grids, and enabling the self-moving device to perform non-contact obstacle avoidance operation when the preset distance condition is met, it is possible not only to prevent the self-moving device from entering the restricted area and affecting the user experience, but also to avoid potential collisions or getting stuck that would cause the self-moving device to stop working, thus ensuring that the self-moving device can complete the task efficiently and safely.
[0145] For example, when an automated lawnmower performs coverage cutting, a bow-shaped path is planned without considering virtual no-go zones and isolated areas. The planned area includes virtual no-go zones and isolated areas, and the bow-shaped path will pass through these areas. During the cutting process, the virtual collision logic and non-contact obstacle avoidance logic from the two embodiments described above are used to bypass the virtual no-go zones and isolated areas.
[0146] In some scenarios, the virtual restricted areas set by users may not meet the conditions, resulting in the setting failure. Users often cannot know whether the virtual restricted areas have been set successfully. For example, the virtual restricted areas may not be set entirely within the effective area of the map, or the setting may fail due to reasons such as not being recognized. In this case, when the mobile device is working, it may enter the virtual restricted area, affecting user activities, and even causing security risks and reducing the user experience.
[0147] To address the aforementioned issues, in some embodiments, the control method for the self-moving device further includes: verifying the virtual restricted area according to preset verification conditions; if the virtual restricted area does not meet the preset verification conditions, the verification fails and the virtual restricted area setting fails; the preset verification conditions include at least one of a first preset condition, a second preset condition, and a third preset condition; wherein, the first preset condition is configured as follows: at least a portion of the virtual restricted area is within the map boundary corresponding to the working area; the second preset condition is configured as follows: the virtual restricted area does not overlap with the charging station associated area, the charging station associated area is an area determined based on the location information of the charging station (also known as a charging pile), used to characterize the area affecting the self-moving device's return to the charging station; the third preset condition is configured as follows: the virtual restricted area has a preset shape.
[0148] Understandably, to ensure that the mobile device can still successfully return to the charging station after a virtual restricted area is set, the virtual restricted area cannot be set within a certain range directly in front of the charging pile. Verifying the virtual restricted area according to the second preset condition ensures that its location does not affect the mobile device's return to the charging station or its normal operation.
[0149] Furthermore, the virtual restricted area is validated according to the first preset condition, including: obtaining all vertices of the virtual restricted area; determining whether any vertex of the virtual restricted area lies within the map boundary corresponding to the working area; if not, the validation fails. In other words, in this embodiment, the virtual restricted area only needs to overlap with the map corresponding to the working area.
[0150] In other embodiments, the virtual restricted area is validated according to a first preset condition, including: obtaining all vertices of the virtual restricted area; determining whether any vertex of the virtual restricted area is outside the map boundary corresponding to the working area; if so, the validation fails. That is, in this embodiment, virtual restricted areas are only allowed to be set within the map boundary.
[0151] Furthermore, the virtual restricted area is verified according to the second preset condition, including: establishing a charging station coordinate system with the location of the charging station as the origin; defining the charging station associated region in the charging station coordinate system; transforming each point in the virtual restricted area to the charging station coordinate system; if the coordinate value of any point corresponding to the virtual restricted area falls into the charging station associated region, the verification fails.
[0152] Furthermore, the virtual restricted area is verified according to the third preset condition, including: obtaining all vertices of the virtual restricted area; verifying whether all vertices satisfy the preset relationship corresponding to the preset shape; if not, the verification fails.
[0153] For example, the virtual restricted area is presented in the form of a rectangle, and the preset shape in the third preset condition is a rectangle, with four vertices in the virtual restricted area. The steps for validating the virtual restricted area include:
[0154] Obtain the coordinates of the four vertices of the virtual restricted area;
[0155] The virtual restricted area is verified according to the first preset condition: it is determined whether any of the four vertices of the virtual restricted area are within the map boundary corresponding to the working area, and the cost value of the virtual restricted area vertex in the cost map is determined by the coordinates of the vertex. If no vertex is within the map boundary, the verification fails.
[0156] The virtual restricted area is verified according to the second preset condition: A right-handed coordinate system, i.e., the charging station coordinate system, is established with the location of the charging station as the origin and the orientation of the charging station as the positive X-axis. An associated region of the charging station is defined within this coordinate system, such as a certain range directly in front of the charging pile. Each point in the virtual restricted area is transformed to the charging station coordinate system. If the coordinate value of any point corresponding to the virtual restricted area meets the following condition—that is, it falls within the associated region of the charging station—the verification fails. 0 <= x local <=x max y min <=y local <=y max
[0157] Where Xmax, Ymin, and Ymax are all set constants, and Xlocal and Ylocal are the x and y coordinates of the local coordinates of each point within the virtual restricted area.
[0158] The virtual restricted area is validated according to the third preset condition: It is verified whether it is a rectangle based on the coordinates of its four vertices. For example, it is verified whether two pairs of opposite sides are equal and the diagonals are equal. Assuming the four vertices of the virtual restricted area are p1, p2, p3, and p4, then these four vertices must satisfy the following relationship; otherwise, the validation fails: |p1p2|=|p3p4| |p1p4|=|p2p3| |p1p3|=|p2p4|
[0159] If all three preset conditions are met, the verification is successful, the virtual restricted area data is stored, the virtual restricted area is updated to the cost map, and the user is notified via the app that the virtual restricted area has been successfully set. If the verification fails, the virtual restricted area information is deleted, and the user is notified via the app that the virtual restricted area has been set.
[0160] This embodiment verifies the virtual restricted area and outputs the verification result, allowing users to know whether the virtual restricted area has been set successfully, thus avoiding the impact on user experience due to the failure to set the virtual restricted area.
[0161] In some embodiments, the control method for the self-moving device further includes: during the global navigation process of the self-moving device, verifying the navigation endpoint according to the cost map; when the cost value of the grid where the navigation endpoint is located is equal to any one of the first-generation value, the second-generation value, and the third-generation value, then performing a point-shifting operation on the navigation endpoint according to a preset rule until the cost value of the grid where the navigation endpoint is located is not equal to any one of the first-generation value, the second-generation value, and the third-generation value, and performing path planning according to the new navigation endpoint; if all points have been traversed according to the preset rule and there is no navigation endpoint that meets the conditions, then the current global navigation ends.
[0162] For example, when performing global navigation during the overlay cutting task on the self-mobile device, the preset rules are configured as follows: starting from the original navigation endpoint, along the target cutting path, select a point at preset intervals and judge the value of the point until a point whose value is not equal to any of the first-generation value, second-generation value, or third-generation value is selected. The selected point is then used as the new navigation endpoint for path planning. If no navigation endpoint that meets the conditions is found after traversing all points on the target cutting path, the current overlay cutting task ends.
[0163] For example, when performing global navigation during an edge cutting task on a self-moving device, the preset rules are configured as follows: starting from the original edge cutting starting point, update points according to the boundary point index, and judge the value of the updated points until a point whose value is not equal to any of the first-generation value, second-generation value, or third-generation value is selected. The selected point is then used as the new navigation endpoint for path planning. If no point meets the conditions after updating all points according to the boundary point index, the current edge cutting task ends.
[0164] In some embodiments, the control method for the self-moving device further includes: during the navigation process of the self-moving device returning to the charging station, verifying the navigation endpoint according to the cost map; when the cost value of the grid where the navigation endpoint is located is equal to any one of the first-generation value, the second-generation value, and the third-generation value, outputting an abnormal prompt message, which is used to indicate to the user that the restricted area setting is abnormal.
[0165] Referring to Figure 2, to address the aforementioned problem of mobile devices entering a virtual restricted area due to failed virtual restricted area settings, thus affecting user experience, this application also provides a method for setting a virtual restricted area in some embodiments, including:
[0166] S21. Obtain the location information of the virtual restricted area. The virtual restricted area is a temporary inaccessible area set by the user in the working area of the self-moving device.
[0167] S22. Determine the virtual restricted area based on the location information of the virtual restricted area;
[0168] S23. Obtain the location information of the charging station, and determine the associated area of the charging station based on the location information of the charging station. The associated area of the charging station is used to characterize the area that affects the return of the self-moving device to the charging station.
[0169] S24. Verify the virtual restricted area to determine if the virtual restricted area overlaps with the area associated with the charging station. If there is an overlap, the verification fails and the virtual restricted area setting fails.
[0170] Further, step S24 includes: establishing a charging station coordinate system with the location of the charging station as the origin; defining a charging station associated region in the charging station coordinate system; transforming each point in the virtual restricted area to the charging station coordinate system; if the coordinate value of any point corresponding to the virtual restricted area falls into the charging station associated region, the verification fails.
[0171] Furthermore, the method for setting up a virtual restricted area also includes: obtaining all vertices of the virtual restricted area; determining whether any vertex of the virtual restricted area is outside the map boundary corresponding to the working area; if so, the verification fails.
[0172] Furthermore, the method for setting up a virtual restricted area also includes: obtaining all vertices of the virtual restricted area; verifying whether all vertices satisfy the preset relationship corresponding to the preset shape; if not, the verification fails.
[0173] Setting up temporary virtual restricted areas may cause the original navigation destination to fall into the virtual restricted area and become invalid, making it impossible to plan the route according to the original navigation strategy and affecting the normal operation of the mobile device.
[0174] Referring to Figure 3, to address the above problems, in some embodiments, this application also provides a navigation method for a self-moving device, including:
[0175] S31. Obtain the location information of the restricted area, wherein the restricted area includes a virtual restricted area and / or an isolated island, the virtual restricted area is a temporary inaccessible area set by the user in the working area of the self-moving device, and the isolated island is a fixed inaccessible area preset by the user in the working area of the self-moving device;
[0176] S32. Determine the associated area of the restricted zone based on the location information of the restricted zone;
[0177] S33. During the global navigation process of the self-moving device, the navigation destination is verified;
[0178] S34. When the navigation endpoint falls into the restricted area associated with the restricted area, the navigation endpoint is moved according to the preset rules until the navigation endpoint does not fall into the restricted area associated with the restricted area, and path planning is performed according to the new navigation endpoint; if all points are traversed according to the preset rules and no navigation endpoint meets the conditions, the current global navigation ends.
[0179] Further, step S32 includes: determining the internal area of the restricted area, the boundary area of the restricted area, and the expansion area of the restricted area based on the location information of the restricted area, wherein the expansion area of the restricted area is the area obtained by expanding a preset range outward from the boundary of the restricted area.
[0180] Step S33 includes: assigning a first-generation value to the corresponding grid cells in the cost map of the area inside the restricted zone, assigning a second-generation value to the corresponding grid cells in the cost map of the boundary area of the restricted zone, and assigning a third-generation value to the corresponding grid cells in the cost map of the expanded area of the restricted zone; wherein, the cost map is a grid map constructed based on the working area of the self-moving device, and the cost value is used to characterize the passage cost of each grid cell in the working area.
[0181] Step S34 includes: when the value of the grid where the navigation endpoint is located is equal to any one of the first-generation value, the second-generation value, or the third-generation value, then the navigation endpoint is moved according to a preset rule until the value of the grid where the navigation endpoint is located is not equal to any one of the first-generation value, the second-generation value, or the third-generation value, and then path planning is performed based on the new navigation endpoint.
[0182] Specifically, in the coverage cutting process, the following scenarios involve the global navigation process: from the current point to the starting point of the coverage cutting area, navigation after handling the bow-shaped anomaly, navigation from the current point to the vertical cutting starting point, navigation from the current point to the filling cutting starting point, and navigation again after the navigation endpoint is unreachable. Before these types of navigation, the cost of the grid where the navigation endpoint is located is first determined. If the cost is equal to any one of ISLAND_AREA_COST, ISLAND_BOUNDARY_COST, ISLAND_INFLATE_COST, RESTRICTED_AREA_COST, RESTRICTED_BOUNDARY_COST, or RESTRICTED_INFLATE_COST, then global path planning cannot be performed directly, and a point shifting operation is required for the navigation endpoint. For example, for a bow-shaped cutting path, starting from the original endpoint, a point is selected every 10cm along the target bow-shaped path. The cost of each point is then evaluated until a point is selected whose cost is not equal to any of the following: ISLAND_AREA_COST, ISLAND_BOUNDARY_COST, ISLAND_INFLATE_COST, RESTRICTED_AREA_COST, RESTRICTED_BOUNDARY_COST, or RESTRICTED_INFLATE_COST. The selected point is then used as the new global navigation endpoint for path planning. If no navigation endpoint meets the conditions after selecting all points along the target bow-shaped path, the current coverage cutting task ends, and the process moves to subsequent logic.
[0183] For example, when performing global navigation during an edge cutting task on a self-moving device, the preset rules are configured as follows: starting from the original edge cutting starting point, update points according to the boundary point index, and judge the value of the updated points until a point whose value is not equal to any of the first-generation value, second-generation value, or third-generation value is selected. The selected point is then used as the new navigation endpoint for path planning. If no point meets the conditions after updating all points according to the boundary point index, the current edge cutting task ends.
[0184] Specifically, during edge cutting, there are two scenarios requiring global navigation: one is navigating to the edge cutting start point, and the other is updating the navigation to the edge cutting start point after it becomes unreachable. Before planning these two types of navigation, the cost of the grid where the navigation endpoint is located is determined. If the cost equals any one of ISLAND_AREA_COST, ISLAND_BOUNDARY_COST, ISLAND_INFLATE_COST, RESTRICTED_AREA_COST, RESTRICTED_BOUNDARY_COST, or RESTRICTED_INFLATE_COST, global path planning cannot be performed directly, and a point shifting operation is required for the navigation endpoint. Starting from the original edge cutting origin, points are updated according to the boundary point index, while simultaneously determining the cost value of each point. This process continues until a point is selected whose cost value is not equal to any of the following: ISLAND_AREA_COST, ISLAND_BOUNDARY_COST, ISLAND_INFLATE_COST, RESTRICTED_AREA_COST, RESTRICTED_BOUNDARY_COST, or RESTRICTED_INFLATE_COST. The selected point then becomes the new global navigation endpoint for path planning. If, after updating all points according to the boundary point index, no point still meets the conditions, the edge cutting task ends, and subsequent logic begins.
[0185] In some embodiments, the control method for the self-moving device further includes: during the navigation process of the self-moving device returning to the charging station, verifying the navigation endpoint according to the cost map; when the cost value of the grid where the navigation endpoint is located is equal to any one of the first-generation value, the second-generation value, and the third-generation value, outputting an abnormal prompt message, which is used to indicate to the user that the restricted area setting is abnormal.
[0186] For example, during the process of the self-mobile device returning to the guide docking point, if the cost value of the navigation endpoint is any one of ISLAND_AREA_COST, ISLAND_BOUNDARY_COST, ISLAND_INFLATE_COST, RESTRICTED_AREA_COST, RESTRICTED_BOUNDARY_COST, or RESTRICTED_INFLATE_COST, the self-mobile device will output an error message to remind the user that the island or virtual restricted area settings have failed.
[0187] In one specific embodiment, as shown in FIG9, the control method of the self-moving device specifically includes the following steps.
[0188] Step 101: Obtain the data (i.e., location information) of the restricted area.
[0189] The restricted areas include virtual restricted zones and / or isolated islands. Both virtual restricted zones and isolated islands are areas that the automatic lawnmower needs to avoid.
[0190] The data for restricted areas includes: data from virtual restricted areas and / or data from isolated islands. Data from virtual restricted areas can be set by the user via a mobile app, while data from isolated islands is automatically generated when the island map is built. The island map is created by the user remotely controlling an automatic lawnmower.
[0191] Step 102: Based on the restricted area data, refresh the restricted area onto the cost map.
[0192] In the path planning of automated lawnmowers, a cost map is a tool used to represent environmental obstacles and feasible paths to reflect changes in the surrounding environment. When new obstacles (such as no-entry zones) appear, the cost map needs to be updated accordingly to ensure that the automated lawnmower's navigation path can avoid these new obstacles.
[0193] After obtaining the restricted area data, this data needs to be converted into updated data for the cost map, thereby updating the cost map. In this embodiment, different cost values can be set in the cost map to refresh the restricted area onto the cost map.
[0194] The cost value of the grid cells within the restricted area in the cost map (also known as the area inside the restricted area) can be set as the value within the restricted area (also known as the first-generation value), and the cost value of the grid cells at the boundary of the restricted area in the cost map (also known as the boundary area of the restricted area) can be set as the boundary value of the restricted area (also known as the second-generation value).
[0195] Step 103: Select a grid from the map boundary of the restricted area in the cost map and expand it to obtain an expanded grid.
[0196] The expansion process involves extending the map boundary of the restricted area outward by a preset distance to obtain an expanded grid. This operation considers not only the restricted area but also the surrounding space to prevent the automatic lawnmower from encountering obstacles or entering dangerous areas during path planning.
[0197] In path planning and obstacle avoidance tasks, the inflated grid is used to ensure that the automatic lawnmower avoids restricted areas. It is obtained by inflating the restricted areas in the cost map. This step effectively prevents the automatic lawnmower from getting too close to obstacles, especially when the obstacles are irregular, allowing the automatic lawnmower to maintain a safe distance around the obstacles.
[0198] Step 104: Determine the boundary expansion zone (also known as the restricted area expansion zone) based on the expansion grid to form the target cost map.
[0199] Step 105: Based on the target cost map, control the self-moving device to work, wherein the self-moving device's work includes obstacle avoidance, collision, cutting navigation, return navigation, etc., which are not limited in this application.
[0200] In this embodiment, all dilated grids can be merged to obtain a boundary dilation region. This boundary dilation region is then refreshed into the cost map to obtain the target cost map.
[0201] In this embodiment, a boundary expansion zone is established by expanding the boundary of the restricted area in the cost map. This allows for path planning of the automatic lawnmower based on the boundary expansion zone and the map of the restricted area, ensuring that the automatic lawnmower does not get too close to the restricted area, avoiding potential collisions or getting stuck that could cause work interruption, and ensuring that the automatic lawnmower can complete the task efficiently and safely.
[0202] The embodiments of this application also provide a method for obtaining an expanded grid. Step 103 above, which selects grids from the map boundary of the restricted area in the cost map and expands them to obtain an expanded grid, specifically includes: determining all boundary grids on the map boundary of the restricted area in the cost map; obtaining a preset range area centered on each boundary grid; and determining the expanded grid of each boundary grid based on the preset range area centered on each boundary grid.
[0203] In this embodiment of the application, the cost value of the grid cells of the restricted area map boundary in the cost map is set as the restricted area boundary value. Then, optionally, all grid cells in the cost map whose cost value is the restricted area boundary value can be used as all boundary grid cells on the map boundary of the restricted area.
[0204] The core idea of expansion is to extend outward from the boundary grid to form an expansion zone. To achieve this, a preset expansion radius needs to be set, which can be determined by factors such as the size of the automatic lawnmower and the complexity of the environment. A suitable expansion radius (r) is chosen; this is a unit of distance representing the range of expansion starting from the boundary grid. For example, assuming an expansion radius of 1, it means that the area within 1 unit radius around each boundary grid will be expanded. The preset range area for each boundary grid is then obtained as follows: For each boundary grid, a rectangular or circular range with radius r is defined around it (for rectangular expansion: a rectangular area can simply be formed by r grids around the boundary grid; for circular expansion: distances can be calculated in various directions from the boundary grid to form a circular area). The grids within this range may include boundary grids of restricted areas, grids within the restricted area map, and grids outside the restricted area map. The grids outside the restricted area map within this range are used as the expansion grids for each boundary grid, and the cost of these expansion grids is set as the expansion value (also called the third-generation value).
[0205] In this embodiment, by selecting and expanding the boundary grid of the restricted area, the influence range of the restricted area can be effectively expanded, generating an expanded grid and updating the cost map. This is particularly important for the path planning of automated lawnmowers, as it provides more information for obstacle avoidance and path optimization, ensuring that the automated lawnmower can safely bypass the restricted area.
[0206] An embodiment of this application also provides a method for updating an isolated island onto a cost map. When the isolated island is not a rectangular area and the restricted area includes the isolated island, step 102 above is as follows: Based on the data of the isolated island, update the isolated island onto the cost map, specifically including: determining the rectangular area surrounding the isolated island, as shown in Figure 10; wherein, the rectangular area includes a first grid, a second grid, and a third grid; the first grid is located inside the isolated island within the rectangular area, the second grid is located at the boundary of the isolated island within the rectangular area, and the third grid is located inside the rectangular area and outside the boundary of the isolated island; traversing all grids within the rectangular area; if the first grid is encountered, converting the local coordinates of the first grid in the rectangular area to global coordinates on the cost map, and updating the grid with the global coordinates corresponding to the first grid on the cost map to be a grid inside the isolated island; if the second grid is encountered, converting the local coordinates of the second grid in the rectangular area to global coordinates on the cost map, and updating the grid with the global coordinates corresponding to the second grid on the cost map to be a grid at the island boundary; if the third grid is encountered, not updating the cost map.
[0207] The island map can be an area of any shape. Based on the island map, the smallest rectangle surrounding the island can be determined as the rectangular area. Of course, the rectangular area can also be a larger rectangle surrounding the island. No specific restrictions are imposed in this embodiment.
[0208] Figure 10 is a schematic diagram of a rectangular area provided in an embodiment of this application. As shown in Figure 10, it is a rectangular area surrounding an island. Both the island map and the rectangular area are local maps. Each grid cell in this local map is set with a value to represent the interior of the island, the boundary of the island, and the exterior of the island.
[0209] Traverse all grids on the island map, determining the value of each grid. If the value of the traversed grid represents the interior of the island, then that grid is designated as the first grid. Convert the local coordinates of this first grid within the rectangular area to its global coordinates on the cost map (the coordinate transformation relationship between local and global coordinates can be obtained when generating the island map). Update the cost value of the grid corresponding to the first grid on the cost map to ISLAND_AREA_COST. This grid is now considered an island grid within the cost map. Here, local coordinates refer to the coordinates in the local coordinate system of the rectangular area, while global coordinates refer to the coordinates in the global coordinate system of the cost map.
[0210] If the value of the traversed grid represents the island boundary, then the grid is the second grid. The local coordinates of the second grid in the rectangular area are converted to global coordinates in the cost map. The cost value of the grid corresponding to the global coordinates of the second grid on the cost map is refreshed to ISLAND_BOUNDARY_COST. This grid is the island boundary grid in the cost map.
[0211] If the value of the traversed grid represents the outside of the island, then the grid is the third grid, and in this case, there is no need to modify the cost map.
[0212] In this embodiment of the application, Figure 5 is a schematic diagram of a target cost map provided in this embodiment of the application. As shown in Figure 5, the innermost region 51 is the grid inside the island, the middle region 52 is the grid at the boundary of the island, and the outermost region 53 is the grid of expansion.
[0213] Expand the grids by selecting grids from the map boundaries of restricted areas in the cost map. This process involves: establishing a coordinate system with each map boundary point as the origin; finding all grids in each coordinate system whose x-coordinate is between -Xmax and Xmax and whose y-coordinate is between -Ymax and Ymax; subtracting grids inside islands and grids on island boundaries to obtain expanded grids of boundary grids. (Iterate through all grids and read the cost value of the corresponding grid point on the cost map. If the cost value is not equal to ISLAND_AREA_COST and not equal to ISLAND_BOUNDARY_COST, then refresh the cost value of the corresponding grid point on the cost map to ISLAND_INFLATE_COST. The grid with a cost value of ISLAND_INFLATE_COST is the expanded grid.)
[0214] Specifically, a preset range area centered on each map boundary point is obtained in each coordinate system (i.e., all grid cells with horizontal coordinates between -Xmax and Xmax and vertical coordinates between -Ymax and Ymax are found in each coordinate system), and its range is as follows.
[0215] Where Xmax and Ymax are both constants, and Xlocal and Ylocal are the x and y coordinates of the raster within the preset range.
[0216] In this embodiment, a rectangular area surrounding the island is determined. Refreshing the rectangular area is simpler, more convenient, and faster than directly refreshing the map of an irregularly shaped island.
[0217] This application relates to an electronic device. FIG11 is a schematic diagram of the structure of a computer device provided in this application embodiment. As shown in FIG11, it includes: at least one processor 701; and a memory 702 communicatively connected to at least one processor 701. The memory 702 stores instructions that can be executed by at least one processor 701. The instructions are executed by at least one processor 701 to enable at least one processor 701 to execute the cost map processing method and navigation method in the above embodiments.
[0218] The memory 702 and the processor 701 are connected by a bus, which can include any number of interconnected buses and bridges, and connect various circuits of one or more processors and the memory together.
[0219] This application relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the method embodiments described above.
[0220] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0221] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of protection of the claims.
Claims
1. A control method for a self-moving device, characterized in that, include: Obtain the location information of the restricted area, wherein the restricted area includes a virtual restricted area and / or an island, the virtual restricted area is a temporary inaccessible area set by the user in the working area of the self-mobile device, and the island is a fixed inaccessible area preset by the user in the working area of the self-mobile device; Based on the location information of the restricted area, the associated area of the restricted area is determined; Update the cost value of the corresponding grid cell in the cost map of the restricted area associated with the restricted area, wherein the cost map is a grid map constructed based on the working area of the self-moving device, and the cost value is used to represent the passage cost of each grid cell in the working area; Based on the cost map, the movement path of the self-moving device during operation is determined.
2. The control method for a self-moving device according to claim 1, characterized in that, The step of determining the associated area of the restricted zone based on the location information of the restricted zone includes: Based on the location information of the restricted area, the internal area of the restricted area, the boundary area of the restricted area, and the expansion area of the restricted area are determined, wherein the expansion area of the restricted area is the area obtained by expanding the boundary of the restricted area outward by a preset range; The cost of updating the corresponding grid cell in the cost map for the restricted area includes: Assign a first-generation value to the corresponding grid cell in the cost map for the area inside the restricted zone, assign a second-generation value to the corresponding grid cell in the cost map for the boundary area of the restricted zone, and assign a third-generation value to the corresponding grid cell in the cost map for the expanded area of the restricted zone.
3. The control method for a self-moving device according to claim 2, characterized in that, Determining the movement path of the self-moving device during operation based on the cost map includes: Based on the cost value of each grid in the cost map, the cutting path is determined when the self-moving device performs the cutting task, and the cutting path does not pass through the grid with the first cost value and the second cost value. Based on the cost value of each grid in the cost map, the navigation route for the self-moving device is determined, and the navigation route does not pass through grids with the first generation value, the second generation value, and the third cost value.
4. The control method for a self-moving device according to claim 2, characterized in that, Also includes: At least one virtual collision detection point is preset on the self-moving device; During the operation of the self-moving device, the cost value of the virtual collision detection point corresponding to the grid in the cost map is detected in real time. In response to the value of the generation being equal to the first generation value or the second generation value, a virtual collision signal is generated, and the self-moving device is controlled to perform a preset collision response operation.
5. The control method for a self-moving device according to claim 2, characterized in that, Also includes: A local grid map is created based on the current location of the self-moving device; Detect the cost value of each grid cell in the local grid map; In the local grid map, grid cells whose cost value equals the first cost value and the second cost value are marked as obstacle grid cells; In response to the distance between the self-moving device and the obstacle grid being less than or equal to a preset distance, the self-moving device is controlled to perform a non-contact obstacle avoidance operation.
6. The control method for a self-moving device according to claim 1, characterized in that, Also includes: The virtual restricted area is verified according to preset verification conditions. If the virtual restricted area does not meet the preset verification conditions, the verification fails and the virtual restricted area setting fails. The preset verification conditions include at least one of the first preset condition, the second preset condition, and the third preset condition; The first preset condition is configured such that at least a portion of the virtual restricted area is within the map boundary corresponding to the work area; The second preset condition is configured as follows: the virtual restricted area does not overlap with the charging station associated area, and the charging station associated area is a region determined based on the location information of the charging station, used to characterize the area affecting the return of the mobile device to the charging station; The third preset condition is configured as follows: the virtual restricted area has a preset shape.
7. The control method for a self-moving device according to claim 2, characterized in that, Also includes: During global navigation of the self-mobile device, the navigation destination is verified according to the cost map; When the value of the grid where the navigation endpoint is located is equal to any one of the first generation value, the second generation value, and the third generation value, the navigation endpoint is moved according to a preset rule until the value of the grid where the navigation endpoint is located is not equal to any one of the first generation value, the second generation value, and the third generation value, and path planning is performed based on the new navigation endpoint. If all points are traversed according to the preset rules and no navigation endpoint is found that meets the conditions, then the current global navigation ends.
8. A method for setting up a virtual restricted area, characterized in that, include: Obtain the location information of the virtual restricted area, which is a temporary inaccessible area set by the user in the work area of the self-moving device; The virtual restricted area is determined based on its location information; Obtain the location information of the charging station, and determine the associated area of the charging station based on the location information of the charging station. The associated area of the charging station is used to characterize the area that affects the return of the self-moving device to the charging station. The virtual restricted area is verified to determine whether it overlaps with the area associated with the charging station. If there is an overlap, the verification fails and the virtual restricted area setting fails.
9. A navigation method for a self-moving device, characterized in that, include: Obtain the location information of the restricted area, wherein the restricted area includes a virtual restricted area and / or an island, the virtual restricted area is a temporary inaccessible area set by the user in the working area of the self-mobile device, and the island is a fixed inaccessible area preset by the user in the working area of the self-mobile device; Based on the location information of the restricted area, the associated area of the restricted area is determined; During the global navigation process of the self-moving device, the navigation destination is verified; If the navigation destination falls into the restricted area associated with the restricted area, the navigation destination will be moved according to the preset rules until the navigation destination does not fall into the restricted area associated with the restricted area, and a path will be planned according to the new navigation destination. If all points are traversed according to the preset rules and no navigation endpoint is found that meets the conditions, then the current global navigation will end.
10. The navigation method for a self-moving device according to claim 9, characterized in that, The step of determining the associated area of the restricted zone based on the location information of the restricted zone includes: Based on the location information of the restricted area, the internal area of the restricted area, the boundary area of the restricted area, and the expansion area of the restricted area are determined, wherein the expansion area of the restricted area is the area obtained by expanding the boundary of the restricted area outward by a preset range; The process of verifying the navigation destination during global navigation on the self-mobile device includes: The corresponding grid cells in the cost map of the area inside the restricted zone are assigned a first-generation value, the corresponding grid cells of the boundary area of the restricted zone are assigned a second-generation value, and the corresponding grid cells of the expanded area of the restricted zone are assigned a third-generation value; wherein, the cost map is a grid map constructed based on the working area of the self-moving device, and the generation value is used to characterize the passage cost of each grid cell in the working area. If the value of the grid cell containing the navigation endpoint is equal to any one of the first generation value, the second generation value, or the third generation value, then the navigation endpoint is moved according to a preset rule until the value of the grid cell containing the navigation endpoint is no longer equal to any one of the first generation value, the second generation value, or the third generation value, and then path planning is performed based on the new navigation endpoint.