Charging method of robot, robot and computer readable storage medium
By obtaining the environmental map and location in the robot, determining the reachable target area and calculating the charging amount, the problem of excessive charging time in the prior art is solved, and a more efficient cleaning and charging process is achieved.
Patent Information
- Application Number
- CN202311637348.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2025-06-06
AI Technical Summary
In the prior art, when calculating the charging capacity of a robot, it is easy to charge too long due to the restricted area or obstacle set by the user, which affects the cleaning efficiency.
By obtaining the environment map and the location of the robot, determining the target area that the robot can reach, calculating the area of the target area and calculating the charging amount based on the area, and then controlling the robot to perform the charging operation.
This method can accurately calculate the charging capacity, avoid affecting the power calculation due to unreachable areas, and improve charging efficiency and cleaning efficiency.
Smart Images

Figure CN120109938A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of robot technology, and in particular, to a robot charging method, a robot, and a computer-readable storage medium. Background Art
[0002] When the robot provided by the related technology performs cleaning operations in the continuous cleaning mode, it is easy to run out of power and cannot complete the cleaning task in one go. At this time, the robot enters the breakpoint continuous cleaning mode, records the current position and cleaning status of the robot, and returns to the charging pile for charging. Among them, the robot will calculate the area to be cleaned, and calculate the charging power required to clean the area to be cleaned in one go based on the area to be cleaned. During the charging process, when the robot detects that the current power is greater than the charging power, the robot ends the charging operation and continues to go to the area to be cleaned to perform the cleaning operation.
[0003] The robots provided by the related technology usually subtract the current cleaned area from the maximum area when the last global cleaning was completed to obtain the area to be cleaned. However, users often restrict the robot from entering certain areas by directly closing the door or setting up restricted areas, resulting in the total area currently required to be cleaned by the robot being smaller than the maximum area when the last global cleaning was completed. As a result, the calculated area to be cleaned is smaller than the actual area to be cleaned, which in turn causes the robot to take a long time to charge, which is not conducive to improving cleaning efficiency. Summary of the invention
[0004] One purpose of the embodiments of the present application is to provide a robot charging method, a robot and a computer-readable storage medium to solve the technical problem of inaccurate calculation of charging power in related technologies.
[0005] In a first aspect, an embodiment of the present application provides a charging method for a robot, comprising:
[0006] Get the environment map and the robot's machine position;
[0007] Determining a target area reachable by the robot in the environment map according to the machine position;
[0008] determining the area of the target area;
[0009] Calculating the charging capacity according to the area of the target area;
[0010] The robot is controlled to perform a charging operation according to the charging amount.
[0011] Optionally, determining, in the environment map according to the machine position, a target area that the robot can reach comprises:
[0012] Segment the environment map according to the size of the robot to obtain at least one sub-area;
[0013] In at least one of the sub-areas, a sub-area including the machine location is determined as a target area.
[0014] Optionally, determining the area of the target region includes:
[0015] determining a maximum contour of the target area;
[0016] The area of the maximum contour is calculated, and the area of the maximum contour is the area of the target area.
[0017] Optionally, the environment map includes cleaned areas, obstacle areas, and unscannable areas. Before calculating the charging power, the method further includes:
[0018] Determine the area of the cleaned area, the area of the obstacle area, and the area of the unsweepable area;
[0019] Then: the calculation of the charging power according to the area of the target area includes:
[0020] Subtract the area of the cleaned area, the area of the obstacle area and the area of the unsweepable area from the area of the target area to obtain the area to be cleaned;
[0021] The charging amount is calculated according to the area to be cleaned.
[0022] Optionally, the unscannable area includes a wall gap area, and determining the area of the unscannable area includes:
[0023] determining a maximum contour of the target area;
[0024] Performing an indentation process on the maximum contour according to a preset indentation distance to obtain an indentation contour;
[0025] The difference between the area of the maximum contour and the area of the indented contour is calculated to obtain the area of the wall gap region.
[0026] Optionally, the maximum contour includes a plurality of contour points, and the maximum contour is subjected to indentation processing according to a preset indentation distance to obtain the indented contour, including:
[0027] Determine a retraction direction corresponding to a target contour point, wherein the target contour point is one of the plurality of contour points;
[0028] According to a preset retraction distance, the target contour point is translated along the retraction direction to obtain a retraction point;
[0029] All the indentation points are sequentially connected to obtain an indentation contour.
[0030] Optionally, determining the retraction direction corresponding to the target contour point includes:
[0031] Taking the target contour point as the center point, a specified number of reference contour points are collected in directions on both sides of the target contour point to obtain a local contour set;
[0032] Perform a straight line fitting operation according to the local contour set to obtain a straight line;
[0033] A target vertical vector is determined, wherein the target vertical vector is perpendicular to the straight line and has a vector direction toward the inside of the maximum contour, and the vector direction of the target vertical vector is an inward contraction direction.
[0034] Optionally, the unscannable area includes an obstacle gap area corresponding to the obstacle area, and determining the area of the unscannable area includes:
[0035] Determining the size and type of the obstacle area;
[0036] According to the size type of the obstacle area, the area of the obstacle gap area is calculated.
[0037] Optionally, calculating the area of the obstacle gap region according to the size type of the obstacle region includes:
[0038] If the size type of the obstacle area is a small obstacle type, performing an expansion operation on the obstacle area according to a first preset expansion distance to obtain a first expansion area;
[0039] Determining an area of the first expansion region and an area of the obstacle region;
[0040] The area of the obstacle region is obtained by subtracting the area of the obstacle region from the area of the first expansion region.
[0041] Optionally, calculating the area of the obstacle gap region according to the size type of the obstacle region includes:
[0042] If the size type of the obstacle area is a large obstacle type, an expansion operation is performed on the obstacle area according to a second preset expansion distance to obtain a second expansion area, a first contour of the obstacle area and a second contour of the second expansion area are determined, and an area of the obstacle gap area is obtained by subtracting an area of the first contour from an area of the second contour.
[0043] In a second aspect, an embodiment of the present application provides a robot comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory. When the processor executes the one or more computer programs, the robot implements the above-mentioned robot charging method.
[0044] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the above-mentioned robot charging method.
[0045] The embodiments of the present application can achieve the following technical effects: in the robot charging method provided in the embodiments of the present application, the environment map and the machine position of the robot are obtained, and the target area that the robot can reach is determined in the environment map according to the machine position, the area of the target area is determined, the charging power is calculated according to the area of the target area, and the robot is controlled to perform the charging operation according to the charging power. This embodiment can calculate the charging power according to the target area that the robot can reach, exclude the area that the robot cannot reach from the calculation of the charging power or include the new reachable area into the target area, so as to eliminate the influence caused by other factors that cause the reachable area to become an unreachable area or the unreachable area to become a reachable area, so that the charging power can be reliably and accurately calculated, and the robot can be prevented from unreasonably charging for too long or too short a time to reduce the cleaning efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0047] Figure 1 A schematic diagram of a flow chart of a charging method for a robot provided in an embodiment of the present application;
[0048] Figure 2 A schematic diagram showing that the robot provided in the embodiment of the present application performs cleaning operations on area A, area B and area C respectively in the last global cleaning operation;
[0049] Figure 3 for Figure 2 A schematic diagram of the door of area C is provided when it is closed;
[0050] Figure 4 for Figure 2A schematic diagram of the door of area A is provided when it is closed;
[0051] Figure 5 A schematic diagram of a second contour obtained by dilating a first contour provided in an embodiment of the present application;
[0052] Figure 6 A schematic diagram of an environment map provided in an embodiment of the present application;
[0053] Figure 7 For Figure 6 Schematic diagram of the provided environmental map after the corrosion operation;
[0054] Figure 8 For Figure 7 The region K2 obtained by the provided corrosion is expanded to obtain a schematic diagram of the region K2 in an initial state;
[0055] Fig. 9 Based on Figure 8 A schematic diagram of extracting the maximum contour and the first contour in area K2 is provided;
[0056] Fig.10 For Fig. 9 A schematic diagram of providing a maximum contour for shrinking and a first contour for expanding;
[0057] Fig.11 A schematic diagram of determining a retraction direction provided in an embodiment of the present application;
[0058] Fig.12 A schematic diagram of widening a line segment provided in an embodiment of the present application;
[0059] Fig.13 for Figure 6 A schematic diagram of the door of area K1 being closed is provided;
[0060] Fig.14 A schematic diagram of the structure of a charging device for a robot provided in an embodiment of the present application;
[0061] Fig.15 A schematic diagram of the structure of a robot provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0063] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in this application do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0064] The present application embodiment provides a method for charging a robot. Figure 1 , the charging method of the robot includes the following steps:
[0065] S11: Obtain the environment map and the machine position of the robot.
[0066] In this step, the environment map is generated by the robot by processing the collected environment data according to the preset map building algorithm, or obtained from the local or requested from the cloud server, wherein the preset map building algorithm includes Simultaneous Localization and Mapping (SLAM), etc. The environment data is collected by the robot's laser radar, camera, inertial detection unit or odometer and other sensors. The environment map can be a grid map or other graphical map.
[0067] The machine position is the position of the robot on the environment map. The robot determines the machine position according to a preset positioning algorithm, wherein the preset positioning algorithm includes a SLAM algorithm or a UWB positioning algorithm, etc.
[0068] Before acquiring the environmental map, when the robot detects that the battery level of the robot is lower than a preset battery threshold, the robot pauses the current cleaning task, returns to the charging station, and enters the step of acquiring the environmental map.
[0069] S12: Based on the machine position, determine the target area that the robot can reach in the environment map.
[0070] In this step, the target area is the area that the robot can navigate into. Usually, the robot has a certain physical size, such as the shape of the robot is round with a diameter of 30 cm. If the area is a blank area, which is an area not occupied by obstacles, but the entrance to the blank area is less than 30 cm, the robot cannot navigate into the blank area, and the blank area is not the target area. If the entrance to the blank area is greater than or equal to 30 cm, the robot can navigate into the blank area, and the blank area is the target area. Alternatively, although the entrance to the blank area is greater than 30 cm, the entrance to the blank area is blocked by a door, and the robot cannot navigate into the blank area, so the blank area is not the target area.
[0071] S13: Determine the area of the target region.
[0072] In this step, in some embodiments, determining the area of the target region includes: determining the maximum contour of the target region, calculating the area of the maximum contour, and the area of the maximum contour is the area of the target region. The maximum contour is the contour that frames the target region.
[0073] In some embodiments, the environment map is a grid map, and determining the area of the target region includes: determining the total number of grids included in the target region, and calculating the area of the target region according to the unit area and the total number of grids.
[0074] S14: Calculate the charging capacity according to the area of the target area.
[0075] In this step, in some embodiments, calculating the charging power according to the area of the target area includes: obtaining a preset cleaning gear and the power required for cleaning a unit area, and calculating the charging power according to the area of the target area, the preset cleaning gear and the power required for cleaning a unit area.
[0076] The environment map includes cleaned areas, obstacle areas and un-swept areas. The cleaned areas are areas that have been cleaned by the robot, the obstacle areas are areas occupied by obstacles, and the un-swept areas are walking areas that the robot cannot clean.
[0077] In some embodiments, before calculating the charging power, the method further includes: determining the area of the cleaned area, the area of the obstacle area, and the area of the unsweepable area. Then: calculating the charging power according to the area of the target area includes the following steps: subtracting the area of the cleaned area, the area of the obstacle area, and the area of the unsweepable area from the area of the target area to obtain the area to be cleaned, and calculating the charging power according to the area to be cleaned.
[0078] This embodiment can not only eliminate the area of the cleaned area from the area of the target area, but also eliminate the area of the obstacle area and the area of the un-swept area from the area of the target area, thereby ensuring that the area to be cleaned can accurately and reliably reflect the area that the robot needs to clean, which is beneficial for the robot to reliably and accurately calculate the charging power based on the area to be cleaned.
[0079] Calculating the charging power according to the area to be cleaned includes: obtaining a preset cleaning gear and a power required for cleaning a unit area, and calculating the charging power according to the area to be cleaned, the preset cleaning gear, and the power required for cleaning a unit area. For example, in this embodiment, the area to be cleaned is divided by the preset cleaning gear and the power required for cleaning a unit area to obtain the charging power, wherein the unit of the power required for cleaning a unit area is AH / m 2 .
[0080] The cleaning gear is the intensity of the robot's cleaning of the ground. The greater the intensity, the easier it is to clean the garbage on the ground, and the smaller the intensity, the more difficult it is to clean the garbage on the ground. The intensity includes the suction force of the robot to absorb the garbage on the ground based on the negative pressure principle, the friction force of scraping the ground, or the amount of clean water provided to the robot's mopping parts.
[0081] It is understandable that in some embodiments, the cleaning gear is positively correlated with the intensity, the larger the cleaning gear, the greater the intensity, the smaller the cleaning gear, the smaller the intensity. In some embodiments, the cleaning gear is negatively correlated with the intensity, the smaller the cleaning gear, the greater the intensity, the larger the cleaning gear, the smaller the intensity.
[0082] It can also be understood that, under the premise that other conditions are the same, the greater the intensity, the greater the power consumption of the robot, and the smaller the intensity, the smaller the power consumption of the robot. When the robot cleans the same area to be cleaned, the charging power required to perform the cleaning operation at high intensity will be greater than the charging power required to perform the cleaning operation at low intensity.
[0083] S15: Control the robot to perform charging operations according to the charging power.
[0084] In this step, the charging operation is an operation in which the robot enters the charging pile to receive power provided by the charging pile.
[0085] In some embodiments, controlling the robot to perform a charging operation according to the charging power includes: calculating a first target time according to the charging power, controlling the robot to dock with the charging pile for charging and calculating the charging time; when the charging time is equal to the first target time, controlling the robot to leave the charging pile to continue to perform the cleaning operation; when the charging time is less than the first target time, controlling the robot to continue to dock with the charging pile for charging.
[0086] In some embodiments, controlling the robot to perform a charging operation according to the charging power includes: calculating a target power according to the charging power and a preset margin, calculating a second target time according to the target power, controlling the robot to dock with the charging pile for charging and calculating the charging time, when the charging time is equal to the second target time, controlling the robot to leave the charging pile to continue to perform the cleaning operation, and when the charging time is less than the second target time, controlling the robot to continue to dock with the charging pile for charging.
[0087] In order to explain in detail the working principle of the robot charging method provided in the embodiment of the present application, this embodiment combines Figure 2 , Figure 3 and Figure 4 This is elaborated in detail as follows:
[0088] See also Figure 2 , in the last global cleaning operation, the robot performed cleaning operations on area A, area B and area C respectively, where area C is equipped with a charging pile 21, and the robot 22 is in area C, and areas A, B and C have not been cleaned, that is, areas A, B and C are all areas to be cleaned, the area of area A is 20 square meters, the area of area B is 20 square meters, and the area of area C is 10 square meters. Therefore, the maximum area when the last global cleaning was completed is 20+20+10=50 square meters. The robot 22 performs cleaning operations in the indoor space according to the first cleaning gear, where the power consumed for cleaning one square meter is 1% of the full charge.
[0089] When the robot needs to clean area A, area B and area C, the robot detects that the power is less than 20%, so it interrupts the current cleaning task and returns to the charging station for charging.
[0090] See also Figure 3 , when the user closes the door 23 of area C, the robot cannot navigate from area C to area B or area A. According to the practice of the related art, since the maximum area when the last global cleaning was completed was 50 square meters and the area of the area to be cleaned was 0, the robot needs to be charged to 50% before it can continue to clean areas A, B and C.
[0091] In the embodiment of the present application, since the robot detects that the door 23 blocks the robot's progress, area A and area B are not areas that the robot can reach, and only area C is an area that the robot can reach. Therefore, the robot only needs to charge the power to 10% to perform cleaning operations on area C.
[0092] Since the time required to charge the battery to 50% is longer than the time required to charge the battery to 10%, the present embodiment can flexibly and adaptively shorten the charging time, thereby improving the charging efficiency.
[0093] See also Figure 4 , assuming that the user closes the door 24 of area A, the robot performed cleaning operations on areas B and C respectively in the last global cleaning operation, and did not perform cleaning operations on area A. Therefore, the maximum area when the last global cleaning was completed was 20+10=30 square meters.
[0094] At this time, the user reopens the door 24 of area A. When the robot detects that the power is less than 20%, it interrupts the current cleaning task and returns to the charging station for charging. According to the practice of the relevant technology, since the maximum area when the last global cleaning was completed was 30 square meters and the area of the area to be cleaned is 0, the robot needs to charge to 30% before it can continue to clean areas B and C.
[0095] Since the robot can navigate from area B to area A, area A, area B and area C are all areas that the robot can reach. Therefore, the robot only needs to charge the battery to 50% before it can clean area A, area B and area C. This can avoid the problem of returning to the charging station for charging due to insufficient power, thereby improving cleaning efficiency.
[0096] In general, this embodiment can calculate the charging power according to the target area that the robot can reach, exclude the area that the robot cannot reach from the calculation of the charging power, or include the new reachable area into the target area. This can eliminate the impact of other factors that cause the reachable area to become an unreachable area or the unreachable area to become a reachable area, so that the charging power can be calculated reliably and accurately, avoiding the robot from unreasonably charging for too long or too short a time, thereby reducing the cleaning efficiency.
[0097] In some embodiments, determining a target area reachable by the robot in the environment map based on the machine position includes the following steps:
[0098] S121: Segment the environment map according to the size of the robot to obtain at least one sub-area.
[0099] S122: In at least one sub-area, determine a sub-area including a machine location as a target area.
[0100] In S121, segmenting the environment map according to the size of the robot to obtain at least one sub-area includes the following steps: extracting the walking area of the environment map, segmenting the walking area according to the size of the robot, and obtaining at least one sub-area. The walking area is an area where the robot can walk, but for the robot, when the robot needs to go to the walking area, it is restricted by some blocking factors and cannot enter the walking area. At this time, the walking area becomes an area that the robot cannot reach. The blocking factors include that the door of the walking area is closed or a blocking object is set on the path to the walking area, or the entrance of the walking area has no door but the width does not allow the robot to pass through, etc. When the robot can go to enter the walking area, the walking area is an area that the robot can reach.
[0101] Extracting the walking area of the environmental map includes: obtaining each blank grid of the environmental map, the blank grid is a grid not occupied by obstacles, searching for the target blank grid in each blank grid, determining the grid connected to the target blank grid according to a preset connected domain algorithm, and putting the grid connected to the target blank grid into a preset queue, and determining the walking area according to the blank grids in the preset queue.
[0102] In S122, the robot is configured with a corrosion coefficient, and segmenting the environment map according to the size of the robot to obtain at least one sub-area includes: performing a corrosion operation on the walking area of the environment map according to the corrosion coefficient to obtain at least one sub-area.
[0103] The size of the robot includes diameter, radius, width or length, etc. If the shape of the robot shell is circular, the size of the robot is the diameter or radius, and the diameter of the robot is usually 30 cm or 35 cm, etc.
[0104] The erosion operation is used to eliminate the boundary points of the walking area, so that the walking area shrinks inward along the boundary.
[0105] The corrosion coefficient can be customized by the designer according to engineering experience. For example, if the diameter of the robot is 35 cm and the width of a grid is 5 cm, the corrosion coefficient is the width of 7 grids. In this embodiment, the corrosion operation is performed on the walking area according to the width of 7 grids.
[0106] The sub-region is a region obtained after the walking region is segmented. It can be understood that when the number of sub-regions is one, the size of the sub-region is equal to the walking region. When the number of sub-regions is at least two, the sub-region is a local region of the walking region.
[0107] In S123, the robot is also configured with an expansion coefficient, and determining the sub-region including the machine position as the target region includes: performing an expansion operation on the sub-region including the machine position according to the expansion coefficient to obtain an expanded sub-region, determining the expanded sub-region including the machine position, and obtaining the target region. After the expansion operation, the present embodiment can restore the sub-region obtained in the corrosion stage to obtain an expanded sub-region, and then determine the target region, which is conducive to reliably and accurately calculating the area of the target region.
[0108] The dilation operation is used to expand the boundaries of the sub-region.
[0109] The expansion coefficient is equal to the erosion coefficient. For example, when the erosion coefficient is 7 grid widths, the expansion coefficient is 7 grid widths.
[0110] In some embodiments, determining the area of the target region includes the following steps: determining the maximum contour of the target region, calculating the area of the maximum contour, and the area of the maximum contour is the area of the target region. The target region is configured with a coordinate system, and in this embodiment, the area of the maximum contour can be calculated according to Green's formula.
[0111] In some embodiments, the unscannable area includes a wall gap area, where the wall gap area is an area where the wall intersects with the target area, and determining the area of the unscannable area includes the following steps:
[0112] S141: Determine the maximum contour of the target area.
[0113] S142: Performing indentation processing on the maximum contour according to a preset indentation distance to obtain an indented contour.
[0114] S143: Calculate the difference between the area of the maximum contour and the area of the indented contour to obtain the area of the wall gap area.
[0115] In S141, this embodiment determines the maximum contour of the target area according to an edge detection algorithm. The edge detection algorithm may be a gradient descent algorithm, a deep learning algorithm, or the like.
[0116] In S142, the preset retraction distance is customized by the designer according to engineering experience, for example, the preset retraction distance is 2 cm or 3 cm, etc. The retraction contour is the contour obtained by retraction processing of the maximum contour.
[0117] In S143, the area between the maximum contour and the indented contour is the wall gap area. In this embodiment, the difference between the area of the maximum contour and the area of the indented contour is obtained to obtain the area of the wall gap area. When calculating the area to be cleaned in this embodiment, the area of the target area can be subtracted from the area of the cleaned area, the area of the obstacle area, and the area of the wall gap area to obtain the area to be cleaned.
[0118] Usually, in order to avoid collision between the robot and the wall, the robot does not walk close to the wall all the time, but walks at a certain distance from the wall. The area between 0-3 cm from the wall is the wall gap area, which is the area that the robot's side sweep cannot reach. Therefore, the robot can subtract the area of the wall gap area from the area of the target area to avoid adding the area of the wall gap area and falsely increasing the charging power, thereby avoiding the problem of reducing the cleaning efficiency due to charging too long.
[0119] In some embodiments, the maximum contour includes a plurality of contour points, and performing an indentation process on the maximum contour according to a preset indentation distance to obtain the indented contour includes the following steps:
[0120] S1421: Determine the retraction direction corresponding to the target contour point.
[0121] S1422: translating the target contour point in the retraction direction according to the preset retraction distance to obtain the retraction point.
[0122] S1423: Connect all the indentation points in sequence to obtain an indentation contour.
[0123] In S1421, the retraction direction is the direction of translating the target contour point to complete the retraction process. The target contour point is a contour point among multiple contour points. For example, the maximum contour includes contour points p0, p1, p2, p3, p4, p5, ..., pn, where the target contour point is contour point pi, i is an integer and i is any integer in [0, n].
[0124] In S1422, when the target contour point is p0, the inward direction of the target contour point p0 is In this embodiment, the retraction direction The target contour point p0 is translated by the preset inward distance to obtain the inward point P 0 '. When the target contour point is p1, the inward direction of the target contour point p1 is In this embodiment, the retraction direction The target contour point p1 is translated by the preset inward distance to obtain the inward point P 1 '.
[0125] In S1423, this embodiment sets the indentation point P 0 ', indentation point P 1 ', ..., indentation point P n 'Concatenate to get the indented contour.
[0126] This embodiment performs targeted inward translation on each contour point according to the inward translation direction corresponding to the contour point, rather than performing inward translation on a group of multiple contour points in the same inward translation direction. This embodiment can effectively keep the shape of the inward wheel consistent with the shape of the maximum contour, avoiding deformation of the shape of the inward contour, which is beneficial to improving the accuracy and reliability of calculating the area of the wall gap area.
[0127] In some embodiments, determining the indentation direction corresponding to the target contour point comprises the following steps:
[0128] S14221: Taking the target contour point as the center point, a specified number of reference contour points are collected in directions on both sides of the target contour point to obtain a local contour set.
[0129] S14222: Perform a straight line fitting operation based on the local contour set to obtain a straight line.
[0130] S14223: Determine a target vertical vector. The target vertical vector is perpendicular to the straight line and its vector direction is toward the inside of the maximum contour. The vector direction of the target vertical vector is the inward contraction direction.
[0131] In S14221, the local contour set includes the target contour point and 2 times the specified number of reference contour points, wherein the reference contour point is a contour point collected from the target contour point as the center point and toward one side of the target contour point. For example, the specified number is 5. If the target contour point is p0, since the maximum contour is a closed-loop contour, 5 contour points collected in the left direction of the target contour point p0 are all used as 5 reference contour points, and the 5 reference contour points are pn, pn-1, pn-2, pn-3, and pn-4. 5 contour points collected in the right direction of the target contour point p0 are all used as 5 reference contour points, and the 5 reference contour points are p1, p2, p3, p4, and p5, respectively. Therefore, the local contour set R = {pn-4, pn-3, pn-2, pn-1, pn, p0, p1, p2, p3, p4, and p5}, and so on, which will not be repeated here.
[0132] In S14222, this embodiment performs a straight line fitting operation on the local contour set according to the PCA principal component algorithm to obtain a straight line.
[0133] In S14223, determining a vertical vector that is perpendicular to the straight line and whose vector direction is toward the inside of the maximum contour as a target vertical vector includes: determining a first vertical vector and a second vertical vector that are perpendicular to the straight line, the vector direction of the first vertical vector is opposite to the vector direction of the second vertical vector, and judging whether the vector direction of the first vertical vector is toward the inside of the maximum contour; if so, determining the first vertical vector as the target vertical vector; if not, determining the second vertical vector as the target vertical vector.
[0134] In some embodiments, the unscannable area includes an obstacle gap area corresponding to the obstacle area, and the obstacle gap area is an area where the obstacle area intersects with the target area. Determining the area of the unscannable area includes the following steps:
[0135] S144: Determine the size and type of the obstacle area;
[0136] S145: Calculate the area of the obstacle gap region according to the size and type of the obstacle region.
[0137] In S144, determining the size type of the obstacle area includes the following steps: determining the area of the obstacle area, judging whether the area of the obstacle area is less than a preset area threshold, if so, determining the size type of the obstacle area as a small obstacle type, if not, determining the size type of the obstacle area as a large obstacle type. The preset area threshold is customized by the designer based on engineering experience.
[0138] In S145, this embodiment can calculate the area of the obstacle gap area according to the size and type of the obstacle area, so that it can adaptively fit the specific situation of the obstacle area, which can not only improve the efficiency of determining the area of the obstacle gap area, but also reliably and accurately determine the area of the obstacle gap area. In addition, since the robot's side sweeping cannot touch the obstacle gap area, the robot can eliminate the area of the obstacle gap area from the area of the target area, avoiding the addition of the area of the obstacle gap area to increase the charging power, thereby avoiding the problem of the robot charging for too long and reducing the cleaning efficiency.
[0139] In some embodiments, according to the size type of the obstacle area, calculating the area of the obstacle gap area includes the following steps:
[0140] S1451: If the size type of the obstacle region is a small obstacle type, performing an expansion operation on the obstacle region according to a first preset expansion distance to obtain a first expansion region.
[0141] S1452: Determine the area of the first expansion region and the area of the obstacle region.
[0142] S1453: Subtract the area of the obstacle area from the area of the first expansion area to obtain the area of the obstacle gap area.
[0143] In S1451, the first expansion area is the expanded obstacle area, and the first preset expansion distance can be customized by the designer according to engineering experience, for example, the first preset expansion distance is the width of 1 grid.
[0144] In S1452, determining the area of the first expansion region and the area of the obstacle region includes: determining a first number of grids included in the first expansion region and a second number of grids included in the obstacle region, multiplying the first number by the area of a single grid to obtain the area of the first expansion region, and multiplying the second number by the area of the single grid to obtain the area of the obstacle region.
[0145] In S1453, the area of the obstacle region is subtracted from the area of the first expansion region to obtain the area of the obstacle gap region, including: subtracting the second number from the first number to obtain the number difference, and multiplying the number difference by the area of a single grid to obtain the area of the obstacle gap region. The area of a single grid can be determined by the designer based on engineering experience, for example, the area of a single grid is 0.0025m 2 .
[0146] The area occupied by obstacles of the small obstacle type is usually relatively small. In this embodiment, there is no need to use Green's formula to calculate the area of the gap area of such obstacles. It is only necessary to accumulate the number of grids. According to the first number of grids included in the first expansion area and the second number of grids included in the obstacle area, the area of the gap area of the obstacles can be obtained quickly, efficiently and accurately, which is beneficial to improving the efficiency of calculating the charging power, and thus beneficial to improving the cleaning efficiency.
[0147] In some embodiments, according to the size type of the obstacle area, calculating the area of the obstacle gap area includes the following steps:
[0148] S1454: If the size type of the obstacle region is a large obstacle type, performing an expansion operation on the obstacle region according to a second preset expansion distance to obtain a second expansion region.
[0149] S1455: Determine a first contour of the obstacle region and a second contour of the second dilation region.
[0150] S1456: Subtract the area of the first contour from the area of the second contour to obtain the area of the obstacle gap.
[0151] In S1454, the second expansion area is the expanded obstacle area, and the second preset expansion distance can be customized by the designer according to engineering experience, for example, the second preset expansion distance is 2 cm. In some embodiments, the second preset expansion distance is less than the width of a single grid.
[0152] In S1455, determining the first contour of the obstacle area includes: detecting the obstacle area according to an edge detection algorithm to obtain the first contour.
[0153] In some embodiments, determining the second contour of the second dilated region includes determining the second contour of the second dilated region according to an edge detection algorithm.
[0154] In some embodiments, determining the second contour of the second dilation area includes: determining a dilation direction corresponding to a candidate contour point, where the candidate contour point is a contour point in the first contour, translating the candidate contour point along the dilation direction according to the second dilation distance to obtain a dilation point, and sequentially concatenating all the dilation points to obtain the second contour.
[0155] Determining the expansion direction corresponding to the candidate contour point includes: taking the candidate contour point as the center point, collecting a specified number of reference contour points in the directions on both sides of the candidate contour point to obtain an expansion contour set, performing a straight line fitting operation according to the expansion contour set to obtain a fitting line, and determining a candidate vertical vector, the candidate vertical vector is perpendicular to the fitting line and the vector direction is back to the inside of the maximum contour, and the vector direction of the candidate vertical vector is the expansion direction.
[0156] The area between the first and second contours is the obstacle gap area. Figure 5 After the first contour 51 of the obstacle area of the large obstacle type is expanded, a second contour 52 can be obtained, and the area between the second contour 52 and the first contour 51 is the obstacle gap area 53.
[0157] In S1456, this embodiment calculates the area of the first contour according to the Green's formula, calculates the area of the second contour according to the Green's formula, and subtracts the area of the first contour from the area of the second contour to obtain the area of the obstacle gap region.
[0158] The area occupied by obstacles of the large obstacle type is usually relatively large. If the area of the obstacle gap area corresponding to the obstacle area of the large obstacle type is calculated by using the cumulative grid method, this method requires more computing power and the efficiency of calculating the area of the obstacle gap area is low. And when the second preset expansion distance is less than the width of a single grid, the area of the obstacle gap area obtained by using the cumulative grid method is not accurate enough. Therefore, this embodiment can use Green's formula to calculate the area of such obstacle gap area, which can not only quickly and efficiently calculate the area of such obstacle gap area, but also meet the premise that the second preset expansion distance is less than the width of a single grid, and can also accurately calculate the area of such obstacle gap area.
[0159] In some embodiments, determining the area of the cleaned region includes: when the robot performs a cleaning operation, recording a cleaning path that the robot has traveled, and determining the cleaned region and the area of the cleaned region based on the cleaning path that the robot has traveled.
[0160] The traveled cleaning path includes multiple path points. Determining the cleaned area and the area of the cleaned area based on the traveled cleaning path includes the following steps: determining any two adjacent path points, the two adjacent path points can form a target line segment, widening the target line segment according to the size of the robot to obtain the widened target line segment, all the widened target line segments form the cleaned area, calculating the area of all the widened target line segments, and obtaining the area of the cleaned area.
[0161] The size of the robot corresponds to a widening coefficient, and widening the target line segment according to the size of the robot includes: widening the target line segment according to the widening coefficient.
[0162] The widening coefficient can be defined by the designer based on engineering experience and the size of the robot. For example, if the diameter of the robot is 35 cm and the width of a single grid is 5 cm, the widening coefficient can be the width of 7 grids.
[0163] Calculating the areas of all widened target line segments includes: determining the total number of grids covered by all widened target line segments, and multiplying the total number by the area of a single grid to obtain the area of the cleaned region.
[0164] In order to understand in detail the charging method of the robot provided in the embodiment of the present application, this embodiment is combined with Figures 6 to 12 The specific process is as follows:
[0165] S61: When the robot enters the breakpoint scanning mode, it obtains the current environment map and extracts the walking area from the environment map, such as Figure 6 As shown, the environment map includes area K1 and area K2, and both area K1 and area K2 are sub-areas.
[0166] S62: Perform an erosion operation on the walking area according to the erosion coefficient, so as to divide the walking area into at least one sub-area. The erosion coefficient is 7 grid widths. Figure 7 As shown, area K1 is a sub-area that is inaccessible to the robot 71 , and area K2 is a sub-area that is accessible to the robot 71 .
[0167] S63: Get the machine position of the robot and find the sub-area containing the machine position. Figure 7 The area K2 is a sub-area including the machine location.
[0168] S64: Perform an expansion operation on the sub-region including the machine position according to the expansion coefficient to obtain an expanded sub-region, and the expanded sub-region can be used as the target region. Figure 8 As shown, the expansion coefficient is 7 grid widths. After expansion, the eroded area K2 can be restored to the area K2 in the initial state.
[0169] S65: Determine the maximum contour of the target area and calculate the area maxArea of the maximum contour. Figure 8 As shown, this embodiment determines the maximum contour of the area K2 and calculates the area maxArea of the maximum contour.
[0170] S66: Determine the area of the obstacle region within the target area. Figure 8 As shown, this embodiment calculates the total number of grids occupied by the obstacle area, and multiplies the total number by the area of a single grid to obtain the area obs_area of the obstacle area.
[0171] S67: Obtain the first contour of all obstacle areas. At this point, the robot has obtained the maximum contour of the target area and the first contour of all obstacle areas. Fig. 9 As shown, this embodiment can obtain the maximum contour 91 of the target area and the first contour 92 of the entire obstacle area.
[0172] S68: Determine the area of the unscannable region.
[0173] S681: When the unscannable area includes a wall gap area, determine the area of the wall gap area. In this embodiment, the maximum contour of the target area is shrunk to obtain the shrunk contour, and the difference between the area of the maximum contour and the area of the shrunk contour is calculated to obtain the area of the wall gap area unreachedArea1. Fig.10 As shown, after the maximum contour 91 of the target area is shrunk, a shrunk contour 93 can be obtained, and the area between the maximum contour 91 and the shrunk contour 93 is the wall gap area.
[0174] When determining the retraction direction, Fig.11 As shown, the specified number is 5. If the target contour point is p6, this embodiment collects 5 contour points on the left side of the target contour point p6 as 5 reference contour points, and the 5 reference contour points are p5, p4, p3, p2, and p1. Five contour points are collected on the right side of the target contour point p6 as 5 reference contour points, and the 5 reference contour points are p7, p8, p9, p10, and p11. Therefore, the local contour set R = {p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, and p11}. This embodiment performs linear fitting on the local contour set R based on the PCA algorithm to obtain a straight line 110 and a first vertical vector n1 and a second vertical vector n2 perpendicular to the straight line 110. Since the second vertical vector n2 is toward the inside of the maximum contour, the vector direction of the second vertical vector n2 is the inward contraction direction. In this embodiment, the target contour point p6 can be translated by 2 cm in the inward direction to obtain the inward point, and finally all the inward points can be serially connected in sequence to obtain the inward contour.
[0175] S682: When the unscannable area includes the obstacle gap area, determine the area of the obstacle gap area unreachedArea2.
[0176] S6821: When the size type of the obstacle area is a small obstacle type, the obstacle area is expanded according to the width of one grid to obtain a first expanded area, a first number of grids included in the first expanded area and a second number of grids included in the obstacle area are determined, the first number is multiplied by the area of a single grid to obtain the area of the first expanded area, and the second number is multiplied by the area of a single grid to obtain the area of the obstacle area unreachedArea2.
[0177] S6822: When the size type of the obstacle area is a large obstacle type, perform an expansion operation on the obstacle area according to the second preset expansion distance of 2 cm to obtain a second expansion area, determine the first contour of the obstacle area and the second contour of the second expansion area, calculate the area of the first contour and the area of the second contour according to Green's formula, subtract the area of the first contour from the area of the second contour, and obtain the area of the obstacle gap area. Fig.10 As shown, after the first contour 92 of the obstacle area is expanded, a second contour 94 can be obtained. The area of the wall gap area is obtained by subtracting the area of the first contour 92 from the area of the second contour 94.
[0178] Therefore, the area of the unswept area unreachedArea=unreachedArea1+unreachedArea2...
[0179] S69: Determine the area of the cleaned area. Fig.12 As shown, two adjacent lines are set as the starting point 121 and the end point 122 on the environment map, and then the starting point 121 and the end point 122 are connected by a line segment 123, and the line width of the line segment is set to the width of 7 grids, thereby obtaining the widened line segment 123. The total number of grids covered by all widened target line segments is determined, and the total number is multiplied by the area of a single grid to obtain the area S_cleaned of the cleaned area.
[0180] S610: Calculate the area to be cleaned, where the area to be cleaned area=maxArea-unreachedArea-S_cleaned.
[0181] S611: Calculate the charging power according to the area to be cleaned.
[0182] As can be seen from the aforementioned workflow, in this embodiment, the area that the robot can reach is taken as the target area, and the walking area that the robot cannot reach is not included in the target area.
[0183] See also Fig.13 Although both area K1 and area K2 are walking areas, the door of area K1 is closed, which prevents the robot from entering area K1 through area K2. Therefore, area K1 changes from a reachable area of the robot to an unreachable area. However, when calculating the charging power, the related technology still regards area K1 as the area to be cleaned, and includes the area of area K1 in the operation of calculating the charging power. This will falsely increase the charging power, causing the robot to store relatively too much power on the charging pile before it can continue to perform cleaning operations, resulting in low cleaning efficiency of the robot. For example, cleaning area K2 only consumes 30% of the power. However, in the related technology, the robot needs to charge to 50% before it can leave the charging pile and go to area K2 to perform cleaning operations. This causes the robot to need a longer charging time before it can continue to clean the cleaning area K2.
[0184] However, the embodiment of the present application will exclude area K1 from the area to be cleaned, and will not regard area K1 as part of the area to be cleaned, so there will be no phenomenon of falsely increasing the charging power. For example, since the robot does not regard area K1 as part of the area to be cleaned, the robot only needs to calculate the charging power of 20% based on the area of area K2. The robot only needs to charge the power to 20% before leaving the charging pile and going to area K2 to perform cleaning operations, which is conducive to improving cleaning efficiency.
[0185] In addition, this embodiment can exclude the area of the obstacle region from the area to be cleaned, and will not regard the obstacle region as part of the area to be cleaned, thereby preventing the phenomenon of falsely increasing the charging power.
[0186] In addition, the present embodiment can also classify the corner areas, gap areas and other areas that cannot be reached, as well as the gap areas of obstacles that are 2 cm away from the side brush of the robot as unsweepable areas, and exclude such unsweepable areas from the area to be cleaned. In this way, the real area to be cleaned can be calculated reliably and accurately, and the phenomenon of falsely increasing the charging power will not occur, which is conducive to reliably and accurately calculating the charging power and improving the cleaning efficiency.
[0187] It should be noted that, in each of the above-mentioned embodiments, there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present application, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.
[0188] As another aspect of the embodiment of the present application, the embodiment of the present application provides a charging device for a robot, wherein the charging device for the robot may be a software module, wherein the software module includes a plurality of instructions stored in a memory, and a processor may access the memory, call the instructions for execution, so as to complete the charging method for the robot described in each of the above embodiments.
[0189] In some embodiments, the charging device of the robot can also be constructed by hardware devices. For example, the charging device of the robot can be constructed by one or more chips, and the chips can work in coordination with each other to complete the charging method of the robot described in the above embodiments. For another example, the charging device of the robot can also be constructed by various logic devices, such as a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components.
[0190] See also Fig.14 The charging device 140 of the robot includes: a map acquisition module 141, a region determination module 142, an area determination module 143, a power determination module 144 and a charging control module 145.
[0191] The map acquisition module 141 is used to acquire the environment map and the machine position of the robot. The area determination module 142 is used to determine the target area that the robot can reach in the environment map according to the machine position. The area determination module 143 is used to determine the area of the target area. The power determination module 144 is used to calculate the charging power according to the area of the target area. The charging control module 145 is used to control the robot to perform the charging operation according to the charging power.
[0192] This embodiment can calculate the charging power according to the target area that the robot can reach, exclude the area that the robot cannot reach from the calculation of the charging power, or include the new reachable area into the target area. This can eliminate the impact of other factors causing the reachable area to become an unreachable area or the unreachable area to become a reachable area, so that the charging power can be calculated reliably and accurately, avoiding the robot from unreasonably charging for too long or too short a time, thereby reducing the cleaning efficiency.
[0193] In some embodiments, the area determination module 142 is specifically used to: segment the environment map according to the size of the robot to obtain at least one sub-area, and in the at least one sub-area, determine the sub-area containing the machine position as the target area.
[0194] In some embodiments, the area determination module 143 is specifically used to: determine the maximum contour of the target area, calculate the area of the maximum contour, and the area of the maximum contour is the area of the target area.
[0195] In some embodiments, the environment map includes cleaned areas, obstacle areas, and unsweepable areas. Before calculating the charging power, the area determination module 143 is further specifically used to: determine the area of the cleaned area, the area of the obstacle area, and the area of the unsweepable area. Then: the power determination module 144 is specifically used to: subtract the area of the cleaned area, the area of the obstacle area, and the area of the unsweepable area from the area of the target area to obtain the area to be cleaned, and calculate the charging power according to the area to be cleaned.
[0196] In some embodiments, the unscannable area includes a wall gap area, and the area determination module 143 is further specifically used to: determine the maximum contour of the target area, shrink the maximum contour according to a preset shrinkage distance to obtain a shrinkage contour, calculate the difference between the area of the maximum contour and the area of the shrinkage contour, and obtain the area of the wall gap area.
[0197] In some embodiments, the maximum contour includes multiple contour points, and the area determination module 143 is also specifically used to: determine the retraction direction corresponding to the target contour point, the target contour point is one of the multiple contour points, and translate the target contour point in the retraction direction according to a preset retraction distance to obtain the retraction point, and concatenate all the retraction points in sequence to obtain the retraction contour.
[0198] In some embodiments, the area determination module 143 is also specifically used to: take the target contour point as the center point, collect a specified number of reference contour points on both sides of the target contour point, obtain a local contour set, perform a straight line fitting operation based on the local contour set to obtain a straight line, and determine a target vertical vector, the target vertical vector is perpendicular to the straight line and the vector direction is toward the inside of the maximum contour, and the vector direction of the target vertical vector is the inward contraction direction.
[0199] In some embodiments, the unscannable area includes an obstacle gap area corresponding to the obstacle area, and the area determination module 143 is further specifically used to: determine the size type of the obstacle area, and calculate the area of the obstacle gap area according to the size type of the obstacle area.
[0200] In some embodiments, the area determination module 143 is further specifically used to: if the size type of the obstacle area is a small obstacle type, perform an expansion operation on the obstacle area according to a first preset expansion distance to obtain a first expansion area, determine the area of the first expansion area and the area of the obstacle area, and subtract the area of the obstacle area from the area of the first expansion area to obtain the area of the obstacle gap area.
[0201] In some embodiments, the area determination module 143 is further specifically used to: if the size type of the obstacle area is a large obstacle type, perform an expansion operation on the obstacle area according to a second preset expansion distance to obtain a second expansion area, determine a first contour of the obstacle area and a second contour of the second expansion area, and subtract the area of the first contour from the area of the second contour to obtain the area of the obstacle gap area.
[0202] It should be noted that the charging device of the robot can execute the charging method of the robot provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in the embodiment of the charging device of the robot, please refer to the charging method of the robot provided in the embodiment of the present application.
[0203] See also Fig.15 , Fig.15 A schematic diagram of the structure of a robot provided in an embodiment of the present application. The robot 150 includes one or more processors 151 and a memory 152. The memory 152 is connected to the one or more processors 151, for example, connected to the processor 151 via a bus.
[0204] The processor 151 is configured to support the robot to perform the corresponding functions in the method in the above method embodiment. The processor can be a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof. The above hardware chip can be an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0205] The memory 152 is used to store program codes, etc. The memory may include a volatile memory (VM), such as a random access memory (RAM); the memory may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory may also include a combination of the above types of memory.
[0206] The memory 152 can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the robot charging method in the embodiment of the present application. The processor executes the various functional applications and data processing of the robot charging method and the robot charging device by running the non-volatile software programs, instructions and modules stored in the memory, that is, realizes the functions of the various modules or units of the robot charging method and the robot charging device provided in the above method embodiment.
[0207] The memory 152 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function. The data storage area may store data created according to the use of the charging device of the robot, etc. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the charging device of the robot via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0208] The one or more modules are stored in the memory, and when executed by the one or more processors, the robot charging method in any of the above method embodiments is executed, for example, the method steps described in the above method embodiments are executed to realize the functions of the modules described in the above device embodiments.
[0209] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method described in the above embodiment.
[0210] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0211] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for charging a robot, It is characterized in that include: Get the environment map and the robot's machine position; Determining a target area reachable by the robot in the environment map according to the machine position; determining the area of the target area; Calculating the charging capacity according to the area of the target area; The robot is controlled to perform a charging operation according to the charging amount.
2. The charging method according to claim 1, It is characterized in that Determining the target area reachable by the robot in the environment map according to the machine position includes: Segment the environment map according to the size of the robot to obtain at least one sub-area; In at least one of the sub-areas, a sub-area including the machine location is determined as a target area.
3. The charging method according to claim 1, It is characterized in that Determining the area of the target region comprises: determining a maximum contour of the target area; The area of the maximum contour is calculated, and the area of the maximum contour is the area of the target area.
4. The charging method according to any one of claims 1 to 3, It is characterized in that The environment map includes cleaned areas, obstacle areas, and unscannable areas. Before calculating the charging power, the method further includes: Determine the area of the cleaned area, the area of the obstacle area, and the area of the unsweepable area; Then: the calculation of the charging power according to the area of the target area includes: Subtract the area of the cleaned area, the area of the obstacle area and the area of the unsweepable area from the area of the target area to obtain the area to be cleaned; The charging amount is calculated according to the area to be cleaned.
5. The charging method according to claim 4, It is characterized in that The unscannable area includes a wall gap area, and determining the area of the unscannable area includes: determining a maximum contour of the target area; Performing an indentation process on the maximum contour according to a preset indentation distance to obtain an indentation contour; The difference between the area of the maximum contour and the area of the indented contour is calculated to obtain the area of the wall gap region.
6. The charging method according to claim 5, It is characterized in that The maximum contour includes a plurality of contour points, and the maximum contour is subjected to indentation processing according to a preset indentation distance, so that the indented contour is obtained, including: Determine a retraction direction corresponding to a target contour point, wherein the target contour point is one of the plurality of contour points; According to a preset retraction distance, the target contour point is translated along the retraction direction to obtain a retraction point; All the indentation points are sequentially connected to obtain an indentation contour.
7. The charging method according to claim 6, It is characterized in that Determining the indentation direction corresponding to the target contour point includes: Taking the target contour point as the center point, a specified number of reference contour points are collected in directions on both sides of the target contour point to obtain a local contour set; Perform a straight line fitting operation according to the local contour set to obtain a straight line; A target vertical vector is determined, wherein the target vertical vector is perpendicular to the straight line and has a vector direction toward the inside of the maximum contour, and the vector direction of the target vertical vector is an inward contraction direction.
8. The charging method according to claim 4, It is characterized in that The unscannable area includes an obstacle gap area corresponding to the obstacle area, and determining the area of the unscannable area includes: Determining the size and type of the obstacle area; According to the size type of the obstacle area, the area of the obstacle gap area is calculated.
9. The charging method according to claim 8, It is characterized in that Calculating the area of the obstacle gap region according to the size type of the obstacle region includes: If the size type of the obstacle area is a small obstacle type, performing an expansion operation on the obstacle area according to a first preset expansion distance to obtain a first expansion area; Determining an area of the first expansion region and an area of the obstacle region; The area of the obstacle region is obtained by subtracting the area of the obstacle region from the area of the first expansion region.
10. The charging method according to claim 8, It is characterized in that Calculating the area of the obstacle gap region according to the size type of the obstacle region includes: If the size type of the obstacle area is a large obstacle type, performing an expansion operation on the obstacle area according to a second preset expansion distance to obtain a second expansion area; Determining a first contour of the obstacle region and a second contour of the second dilation region; The area of the obstacle gap region is obtained by subtracting the area of the first contour from the area of the second contour.
11. A robot, It is characterized in that It includes a memory and a processor, the memory is connected to the processor, the processor is used to execute one or more computer programs stored in the memory, and when the processor executes the one or more computer programs, the robot implements the robot charging method as described in any one of claims 1-10.
12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the robot charging method according to any one of claims 1 to 10.