Path planning method and device, computer equipment, storage medium and program product
By generating and connecting multi-directional sub-coverage paths, the problem that traditional path planning methods are difficult to fully cover the target area is solved, and more efficient and safe path planning is achieved to ensure that computer equipment avoids static obstacles during movement.
Patent Information
- Application Number
- CN202411135114.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-03
AI Technical Summary
Traditional path planning methods are difficult to fully cover the target area where computer equipment moves, especially in the presence of static obstacles, and it is difficult to avoid collisions and achieve effective coverage.
By determining the target area, a sub-coverage path in at least two directions is generated and connected to form a target coverage path, ensuring that the path covers the entire area and avoids static obstacles, adopting a combination of the main and non-main directions and a segment connection strategy , ensure the security and coverage of the path.
It achieves a more comprehensive coverage of the target area, enhances the coverage and security of computer equipment in cleaning and data acquisition tasks, avoids collisions with static obstacles, and improves the effectiveness of path planning.
Smart Images

Figure CN119063726A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a path planning method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of artificial intelligence technology and robotics technology, various mobile computer devices have emerged, such as sweeping robots, driverless vehicles, automatic food delivery vehicles, etc. These computer devices can automatically move along predetermined paths and trajectories to complete corresponding tasks.
[0003] Therefore, before the computer device is operated, it is necessary to plan the path of the mobile computer device. The traditional path planning method usually plans the path according to the ox-ploughing method or the bow-shaped road, but the planned path is difficult to fully cover the entire area. Summary of the invention
[0004] Based on this, it is necessary to provide a path planning method, device, computer equipment, computer-readable storage medium and computer program product that can fully cover the target area in order to solve the above technical problems.
[0005] In a first aspect, the present application provides a path planning method, comprising:
[0006] Determine the target area for path planning;
[0007] For at least two directions, generating a sub-coverage path corresponding to each direction in the target area;
[0008] The sub-coverage paths corresponding to the at least two directions are connected to obtain a target coverage path for the target area.
[0009] In one of the embodiments, generating a sub-coverage path corresponding to each direction in the target area includes:
[0010] Determining a main direction of path planning in the target area;
[0011] Determine a non-main direction for path planning based on the main direction;
[0012] For each of the main direction and the non-main direction, a corresponding sub-covering path is generated.
[0013] In one of the embodiments, generating a corresponding sub-coverage path for each of the main direction and the non-main direction includes:
[0014] For each of the main direction and the non-main direction, generating at least two line segments along the direction in the target area;
[0015] The at least two line segments are connected to obtain a sub-covering path corresponding to the direction.
[0016] In one embodiment, applied to a computer device, connecting the at least two line segments to obtain a sub-coverage path corresponding to the direction includes:
[0017] Connecting the at least two line segments in sequence to obtain a candidate subpath corresponding to the direction;
[0018] If there is a static obstacle in the target area, and the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is greater than the target distance, the candidate sub-path corresponding to the direction is used as the sub-coverage path; the target distance is greater than or equal to the radius of the computer device;
[0019] If there is a static obstacle in the target area, and the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is less than or equal to the target distance, the step of generating at least two line segments along the direction in the target area is re-executed until the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is greater than the target distance, and the sub-coverage path corresponding to the direction is obtained.
[0020] In one of the embodiments, connecting the sub-coverage paths corresponding to at least two directions to obtain the target coverage path of the target area includes:
[0021] According to the generation order of each sub-covering path, determine the endpoints connected between the sub-covering paths corresponding to two directions adjacent in the generation order;
[0022] The endpoints connected between the sub-coverage paths are connected to obtain the target coverage path of the target area.
[0023] In one of the embodiments, generating a sub-coverage path corresponding to each direction in the target area includes:
[0024] If there is a static obstacle in the target area, a sub-coverage path corresponding to each direction is generated in the target area; the sub-coverage path does not pass through the area where the static obstacle is located.
[0025] In a second aspect, the present application also provides a path planning device, comprising:
[0026] A target area determination module is used to determine the target area to be planned;
[0027] A sub-coverage path generation module, used for generating a sub-coverage path corresponding to each direction in the target area for at least two directions;
[0028] The sub-coverage path connecting module is used to connect the sub-coverage paths corresponding to the at least two directions to obtain the target coverage path of the target area.
[0029] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0030] Determine the target area for path planning;
[0031] For at least two directions, generating a sub-coverage path corresponding to each direction in the target area;
[0032] The sub-coverage paths corresponding to the at least two directions are connected to obtain a target coverage path for the target area.
[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0034] Determine the target area for path planning;
[0035] For at least two directions, in the target area, generate a sub-coverage path corresponding to each direction;
[0036] The sub-coverage paths corresponding to the at least two directions are connected to obtain a target coverage path for the target area.
[0037] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0038] Determine the target area for path planning;
[0039] For at least two directions, generating a sub-coverage path corresponding to each direction in the target area;
[0040] The sub-coverage paths corresponding to the at least two directions are connected to obtain a target coverage path for the target area.
[0041] The above-mentioned path planning method, apparatus, computer equipment, computer-readable storage medium and computer program product determine the target area to be path planned, and generate a sub-coverage path corresponding to each direction in the target area for at least two directions; then, the sub-coverage paths corresponding to at least two directions are connected to obtain a target coverage path of the target area, and the target coverage path includes the sub-coverage paths in at least two directions, which can cover the target area more comprehensively. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions 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 related drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 A schematic diagram of a process flow of a path planning method in one embodiment;
[0044] Figure 2 is a flow chart of a path planning method in another embodiment;
[0045] Figure 3 A schematic diagram of a target coverage path in one embodiment;
[0046] Figure 4 is a structural block diagram of a path planning device in one embodiment;
[0047] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution 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 used to limit the present application.
[0049] In one embodiment, Figure 1As shown, a path planning method is provided. This embodiment uses the method applied to a computer device as an example. It can be understood that it can also be applied to a system including a terminal and a server, and implemented through the interaction between the terminal and the server. The computer device can be a mobile terminal or a server; wherein the terminal can be, but is not limited to, various robots, unmanned vehicles, automatic food delivery vehicles, personal computers, laptops, smart phones, tablet computers, Internet of Things devices, and portable wearable devices, and the robot can be a cleaning robot, a distribution robot, a logistics robot, an inspection robot, and a disinfection robot, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server.
[0050] In this embodiment, taking the path planning method applied to a robot as an example, the method includes the following steps:
[0051] Step S102: determine the target area for path planning.
[0052] The target area is the area to be path planned, that is, the area to be covered by the planned target coverage path.
[0053] Optionally, the robot obtains an area specified by the user as a target area for path planning. The target area can be a certain area specified in the grid map, or a polygonal area consisting of multiple vertices. The shape of the target area can be regular or irregular, which is not limited here.
[0054] Step S104: for at least two directions, generate a sub-coverage path corresponding to each direction in the target area.
[0055] Among them, the sub-coverage path is the coverage path corresponding to a direction in the target area. The target area includes paths in at least two directions to be planned. At least two directions can be set as needed. Exemplarily, the robot can set at least two directions including horizontal and vertical directions, or at least two directions including horizontal, vertical and 45-degree directions. Optionally, the target area includes paths in four directions to be planned, and may also include paths in three directions to be planned, and may also include paths in other numbers of directions to be planned, which are not limited here.
[0056] Optionally, the robot generates at least two line segments corresponding to each direction in the target area, and connects the at least two line segments corresponding to each direction to obtain a sub-coverage path corresponding to each direction. Exemplarily, the robot connects the end points of the at least two line segments corresponding to each direction to obtain a sub-coverage path corresponding to each direction. Exemplarily, the robot connects the endpoints of the at least two line segments corresponding to each direction in sequence to obtain a sub-coverage path corresponding to each direction. Exemplarily, the robot connects the endpoints of the at least two line segments corresponding to each direction at intervals to obtain a sub-coverage path corresponding to each direction.
[0057] Optionally, in the target area, a sub-coverage path corresponding to each direction is generated, including: if there is a static obstacle in the target area, a sub-coverage path corresponding to each direction is generated in the target area; and the sub-coverage path does not pass through the area where the static obstacle is located.
[0058] Among them, static obstacles refer to stationary obstacles, such as stones, tables, etc.
[0059] If there are static obstacles in the target area, the area where the static obstacles are located is regarded as a non-path planning area. In the target area, a sub-coverage path corresponding to each direction is generated, and the sub-coverage path does not pass through the area where the static obstacles are located. Then, when the robot moves according to the target coverage path, it can avoid static obstacles.
[0060] If there are no static obstacles in the target area, the target coverage path can cover the entire target area.
[0061] If there is a dynamic obstacle in the target area, the robot will give a prompt when it moves to the range of the dynamic obstacle according to the target coverage path until the dynamic obstacle is removed. The robot can give prompts in any way, which can be voice prompts, text prompts, light prompts, or a combination of at least two prompt methods.
[0062] Step S106: Connect the sub-coverage paths corresponding to at least two directions to obtain a target coverage path of the target area.
[0063] The target coverage path is a sub-coverage path corresponding to at least two directions in the target area.
[0064] Optionally, the robot connects the sub-coverage paths corresponding to at least two directions according to the nearest point principle to obtain a target coverage path for the target area.
[0065] Optionally, the robot determines endpoints between each sub-coverage path corresponding to at least two directions, and connects each endpoint in sequence to obtain a target coverage path for the target area.
[0066] Optionally, the sub-coverage paths corresponding to at least two directions are connected to obtain the target coverage path of the target area, including: determining the endpoints of the sub-coverage paths corresponding to two directions adjacent in the generation order according to the generation order of the sub-coverage paths; and connecting the endpoints of the sub-coverage paths to obtain the target coverage path of the target area.
[0067] The endpoints of each sub-covering path include a start point and an end point. The start point is the endpoint where the sub-covering path starts, and the end point is the endpoint where the sub-covering path ends.
[0068] For the sub-covering paths corresponding to two adjacent directions in the generation order, the robot determines the first end point of the sub-covering path generated first, determines the endpoint of the sub-covering path generated later that is closer to the first end point, and connects the first end point and the closer endpoint.
[0069] Optionally, the endpoint of the later generated sub-coverage path that is closer to the first end point can be the starting point of the later generated sub-coverage path, that is, according to the generation order of each sub-coverage path, the sub-coverage paths corresponding to two adjacent directions in the generation order are connected end to end to obtain the target coverage path of the target area.
[0070] Optionally, for each sub-coverage path, determine the endpoint closest to the end point of the sub-coverage path from each unconnected endpoint in the target area, and connect the end point of the sub-coverage path and the nearest endpoint. Connect each sub-coverage path in the order of generation until the sub-coverage paths in all directions are connected to obtain the target coverage path.
[0071] The above path planning method determines the target area to be path planned, and generates a sub-coverage path corresponding to each direction in the target area for at least two directions; then, the sub-coverage paths corresponding to at least two directions are connected to obtain a target coverage path of the target area, which includes sub-coverage paths in at least two directions and can cover the target area more comprehensively. Moreover, for cleaning application scenarios, a more detailed cleaning effect can be achieved, and the coverage rate of the cleaning path can be increased. For data collection application scenarios, application data in more directions can be collected.
[0072] In one embodiment, a sub-coverage path corresponding to each direction is generated in a target area, including: determining a main direction of path planning in the target area; determining a non-main direction of path planning based on the main direction; and generating a corresponding sub-coverage path for each direction in the main direction and the non-main direction.
[0073] The main direction is the direction of the main planned path in the target area, and the non-main direction is the other direction of at least two directions except the main direction.
[0074] Optionally, the main direction may be the direction corresponding to the longest side in the target area. For example, if the target area is a rectangle, the direction corresponding to the longest side of the rectangle is the main direction.
[0075] Optionally, the robot rotates the main direction by a preset angle to obtain a non-main direction. For example, the main direction is rotated by 45 degrees in sequence to obtain at least one non-main direction. Of course, other angles, such as 60 degrees, may also be rotated.
[0076] Optionally, for each of the main direction and the non-main direction, a corresponding sub-coverage path is generated, including: for each of the main direction and the non-main direction, generating at least two line segments along the corresponding direction in the target area; connecting the at least two line segments to obtain the sub-coverage path corresponding to the direction.
[0077] Optionally, at least two line segments corresponding to each direction in the main direction and the non-main direction satisfy at least one of the following conditions: two adjacent line segments are separated by a preset distance, the distance between the line segment and the static obstacle is greater than the target distance, at least two line segments reach a preset coverage rate, and the length of the line segment is greater than a preset length.
[0078] Among them, the preset distance, preset length and preset coverage rate can all be set as needed, and the target distance is greater than or equal to the radius of the robot.
[0079] It can be understood that the distance between the line segment and the static obstacle is greater than the target distance in order to avoid the robot from colliding with the static obstacle during movement; at least two line segments reach the preset coverage rate in order to cover the target area as comprehensively as possible; the length of the line segment is greater than the preset length, such as 50cm, in order to ensure the necessity of path coverage. Only line segments of a certain length need to be set up with paths to cover, otherwise there is no need for coverage.
[0080] Optionally, at least two line segments are connected to obtain a sub-covering path corresponding to the direction, including: connecting at least two line segments in sequence to obtain a candidate sub-path corresponding to the direction; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting at least two line segments and the static obstacle is greater than the target distance, then the candidate sub-path corresponding to the direction is used as the sub-covering path; the target distance is greater than or equal to the radius of the robot; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting at least two line segments and the static obstacle is less than or equal to the target distance, then re-execute the step of generating at least two line segments along the direction in the target area until the minimum distance between the connecting line connecting at least two line segments and the static obstacle is greater than the target distance, and the sub-covering path corresponding to the direction is obtained.
[0081] Optionally, the connecting line may be a straight line or a curve, which is not limited here.
[0082] It is understandable that the shape of the static obstacle can be regular or irregular. The minimum distance between the connecting line and the static obstacle is to connect the point on the side of the static obstacle close to the connecting line with the connecting line, and select the length of the shortest connecting line as the minimum distance. In this way, it can be ensured that the robot does not collide with the static obstacle during movement.
[0083] Optionally, if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting at least two line segments and the static obstacle is greater than the target distance, the connection of the at least two line segments is considered to be a safe connection, the robot will not collide with the static obstacle in subsequent movement, and the candidate sub-path corresponding to this direction is used as the sub-coverage path; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting at least two line segments and the static obstacle is less than or equal to the target distance, the connection of the at least two line segments is considered to be an unsafe connection, and the path planning algorithm is used to regenerate at least two line segments until at least two line segments are safely connected.
[0084] In this embodiment, a main direction of the path planning is determined in the target area, and a non-main direction of the path planning is determined based on the main direction. For each of the main direction and the non-main direction, a corresponding sub-coverage path can be accurately generated.
[0085] Furthermore, for each of the main direction and the non-main direction, at least two line segments are generated along the corresponding direction in the target area, and the at least two line segments are connected to accurately obtain the sub-coverage path corresponding to the corresponding direction, thereby fully covering the target area.
[0086] Furthermore, if there is a static obstacle in the target area, it is determined whether the minimum distance between the connecting line connecting at least two line segments and the static obstacle is greater than the target distance, thereby ensuring that the robot avoids collision with the static obstacle during subsequent movement.
[0087] In one embodiment, Figure 2As shown, taking four directions as an example, the robot obtains the input target area; generates four clusters of line segments with different directions in the target area, each cluster of line segments corresponds to one direction, and each cluster of line segments includes at least two line segments; each cluster of line segments selects the endpoints in the most edge segments as the starting point, connects them according to the closest point principle to obtain a sub-covering path, and outputs four sub-covering paths; selects an appropriate point as the starting point of the target coverage path to be generated, and connects the four sub-covering paths in sequence according to the closest point principle to generate the target coverage path of the target area. Specifically, the robot can select the endpoint closest to the current position of the robot from the endpoints of each sub-covering path as the starting point of the target coverage path to be generated, or the starting point of the first generated sub-covering path as the starting point of the target coverage path to be generated, or any endpoint can be selected from the endpoints of each sub-covering path as the starting point of the target coverage path to be generated.
[0088] For each cluster of line segments, select the endpoint in the outermost line segment as the starting point, and the other endpoint in the outermost line segment is the end point. Select the endpoint closest to the end point for connection, and the other endpoint of the line segment to which the endpoint closest to the end point belongs is used as the new end point. Continue to select the endpoint closest to the new end point for connection, and so on, until the cluster of line segments is connected and a sub-covering path is obtained.
[0089] After the robot selects the starting point of the target coverage path to be generated, the other endpoint of the sub-coverage path to which the starting point belongs is the end point. The endpoint closest to the end point is selected for connection, and the other endpoint of the sub-coverage path to which the endpoint closest to the end point belongs is used as the new end point. The endpoint closest to the new end point is continued to be selected for connection, and so on, until all sub-coverage paths are connected to obtain the target coverage path.
[0090] In one embodiment, the target coverage path is as follows Figure 3 As shown in the figure, the target area is an irregular shape. Four sub-coverage paths in different directions are generated in the target area in sequence. The first picture in the upper left corner is the sub-coverage path in the horizontal direction; the second picture in the upper right corner is the sub-coverage path generated after rotating 45° clockwise based on the horizontal direction, and it is superimposed on the first picture; the third picture in the lower left corner is the sub-coverage path in the vertical direction generated by rotating 45° clockwise based on the second picture; the fourth picture in the lower right corner is the sub-coverage path generated by rotating 45° clockwise based on the third picture. According to the generation order of the sub-coverage paths (the direction of the connecting arrows between the sub-coverage paths in four different directions), the sub-coverage paths in different directions are connected in sequence to obtain the target coverage path (the fourth picture in the lower right corner), which can cover the target area more comprehensively. Among them, the parameters such as coverage interval, direction, and distance from the edge can all be adjusted.
[0091] In other embodiments, the target coverage path shown in the fourth figure in the lower right corner can be directly generated in the target area.
[0092] In one embodiment, another path planning method is provided, which is applied to a robot and includes the following steps:
[0093] Step A1, determining the target area to be path planned;
[0094] Step A2, determining the main direction of path planning in the target area;
[0095] Step A3, determining a non-main direction of path planning based on the main direction;
[0096] Step A4, for each direction in the main direction and the non-main direction, generate at least two line segments along the direction in the target area; connect the at least two line segments in sequence to obtain a candidate sub-path corresponding to the direction; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is greater than the target distance, then use the candidate sub-path corresponding to the direction as a sub-covering path; the target distance is greater than or equal to the radius of the computer device; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is less than or equal to the target distance, then re-execute the step of generating at least two line segments along the direction in the target area until the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is greater than the target distance, and the sub-covering path corresponding to the direction is obtained; the sub-covering path does not pass through the area where the static obstacle is located.
[0097] Step A5, according to the generation order of each sub-coverage path, determine the endpoints of the sub-coverage paths corresponding to two directions adjacent in the generation order; connect the endpoints of each sub-coverage path to obtain the target coverage path of the target area.
[0098] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0099] Based on the same inventive concept, the embodiment of the present application also provides a path planning device for implementing the path planning method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more path planning device embodiments provided below can refer to the limitations of the path planning method above, and will not be repeated here.
[0100] In an exemplary embodiment, Figure 4 As shown, a path planning device is provided, including: a target area determination module 402, a sub-coverage path generation module 404 and a sub-coverage path connection module 406, wherein:
[0101] The target area determination module 402 is used to determine the target area to be planned.
[0102] The sub-covering path generating module 404 is used to generate a sub-covering path corresponding to each direction in the target area.
[0103] The sub-coverage path connecting module 406 is used to connect the sub-coverage paths corresponding to at least two directions to obtain a target coverage path of the target area.
[0104] The above-mentioned path planning device determines the target area to be path planned, and generates a sub-coverage path corresponding to each direction in the target area for at least two directions; then, the sub-coverage paths corresponding to at least two directions are connected to obtain a target coverage path of the target area, which includes the sub-coverage paths in at least two directions and can cover the target area more comprehensively.
[0105] In one embodiment, the sub-coverage path generation module 404 is also used to determine the main direction of the path planning in the target area; determine the non-main direction of the path planning based on the main direction; and generate a corresponding sub-coverage path for each direction in the main direction and the non-main direction.
[0106] In one embodiment, the sub-coverage path generation module 404 is further used to generate at least two line segments along the direction in the target area for each of the main direction and the non-main direction; and connect the at least two line segments to obtain the sub-coverage path corresponding to the direction.
[0107] In one embodiment, the above-mentioned sub-covering path generation module 404 is also used to connect at least two line segments in sequence to obtain a candidate sub-path corresponding to the direction; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting at least two line segments and the static obstacle is greater than the target distance, then the candidate sub-path corresponding to the direction is used as the sub-covering path; the target distance is greater than or equal to the radius of the computer device; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting at least two line segments and the static obstacle is less than or equal to the target distance, then the step of generating at least two line segments along the direction in the target area is re-executed until the distance between the connecting line connecting at least two line segments and the static obstacle is greater than the target distance, and the sub-covering path corresponding to the direction is obtained.
[0108] In one embodiment, the sub-coverage path connection module 406 is further used to determine the endpoints of the sub-coverage paths corresponding to two adjacent directions in the generation order of the sub-coverage paths; and connect the endpoints of the sub-coverage paths to obtain the target coverage path of the target area.
[0109] In one embodiment, the sub-coverage path generation module 404 is further configured to generate a sub-coverage path corresponding to each direction in the target area if there is a static obstacle in the target area; the sub-coverage path does not pass through the area where the static obstacle is located.
[0110] Each module in the above-mentioned path planning device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0111] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a path planning method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0112] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0113] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: determining a target area to be path planned; generating a sub-coverage path corresponding to each direction in the target area for at least two directions; and connecting the sub-coverage paths corresponding to the at least two directions to obtain a target coverage path for the target area.
[0114] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining a main direction of the path planning in the target area; determining a non-main direction of the path planning based on the main direction; and generating a corresponding sub-coverage path for each of the main direction and the non-main direction.
[0115] In one embodiment, when the processor executes the computer program, the following steps are also implemented: for each of the main direction and the non-main direction, at least two line segments are generated along the direction in the target area; and the at least two line segments are connected to obtain a sub-coverage path corresponding to the direction.
[0116] In one embodiment, when the processor executes the computer program, the following steps are also implemented: connecting the at least two line segments in sequence to obtain a candidate sub-path corresponding to the direction; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is greater than the target distance, then taking the candidate sub-path corresponding to the direction as a sub-covering path; the target distance is greater than or equal to the radius of the computer device; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is less than or equal to the target distance, then re-executing the step of generating at least two line segments along the direction in the target area until the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is greater than the target distance, thereby obtaining the sub-covering path corresponding to the direction.
[0117] In one embodiment, when the processor executes the computer program, the following steps are also implemented: according to the generation order of each sub-coverage path, the endpoints of the sub-coverage paths corresponding to two directions adjacent in the generation order are determined; the endpoints of each sub-coverage path are connected to obtain the target coverage path of the target area.
[0118] In one embodiment, when the processor executes the computer program, the following steps are further implemented: if there is a static obstacle in the target area, a sub-coverage path corresponding to each direction is generated in the target area; the sub-coverage path does not pass through the area where the static obstacle is located.
[0119] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: determining a target area to be path planned; generating a sub-coverage path corresponding to each direction in the target area for at least two directions; and connecting the sub-coverage paths corresponding to the at least two directions to obtain a target coverage path for the target area.
[0120] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: determining a main direction of the path planning in the target area; determining a non-main direction of the path planning based on the main direction; and generating a corresponding sub-coverage path for each of the main direction and the non-main direction.
[0121] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: for each of the main direction and the non-main direction, at least two line segments are generated along the direction in the target area; and the at least two line segments are connected to obtain a sub-coverage path corresponding to the direction.
[0122] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: connecting the at least two line segments in sequence to obtain a candidate sub-path corresponding to the direction; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is greater than the target distance, then using the candidate sub-path corresponding to the direction as a sub-covering path; the target distance is greater than or equal to the radius of the computer device; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is less than or equal to the target distance, then re-executing the step of generating at least two line segments along the direction in the target area until the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is greater than the target distance, thereby obtaining the sub-covering path corresponding to the direction.
[0123] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to the generation order of each sub-coverage path, the endpoints of the sub-coverage paths corresponding to two directions adjacent in the generation order are determined; the endpoints of each sub-coverage path are connected to obtain the target coverage path of the target area.
[0124] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if there is a static obstacle in the target area, a sub-coverage path corresponding to each direction is generated in the target area; the sub-coverage path does not pass through the area where the static obstacle is located.
[0125] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps: determining a target area to be path planned; generating, for at least two directions, a sub-coverage path corresponding to each direction in the target area; and connecting the sub-coverage paths corresponding to the at least two directions to obtain a target coverage path for the target area.
[0126] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: determining a main direction of the path planning in the target area; determining a non-main direction of the path planning based on the main direction; and generating a corresponding sub-coverage path for each of the main direction and the non-main direction.
[0127] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: for each of the main direction and the non-main direction, at least two line segments are generated along the direction in the target area; and the at least two line segments are connected to obtain a sub-coverage path corresponding to the direction.
[0128] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: connecting the at least two line segments in sequence to obtain a candidate sub-path corresponding to the direction; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is greater than the target distance, then using the candidate sub-path corresponding to the direction as a sub-covering path; the target distance is greater than or equal to the radius of the computer device; if there is a static obstacle in the target area, and the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is less than or equal to the target distance, then re-executing the step of generating at least two line segments along the direction in the target area until the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is greater than the target distance, thereby obtaining the sub-covering path corresponding to the direction.
[0129] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to the generation order of each sub-coverage path, the endpoints of the sub-coverage paths corresponding to two directions adjacent in the generation order are determined; the endpoints of each sub-coverage path are connected to obtain the target coverage path of the target area.
[0130] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if there is a static obstacle in the target area, a sub-coverage path corresponding to each direction is generated in the target area; the sub-coverage path does not pass through the area where the static obstacle is located.
[0131] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0132] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0133] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0134] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A path planning method, characterized in that: The method comprises: Determine the target area for path planning; For at least two directions, generating a sub-coverage path corresponding to each direction in the target area; The sub-coverage paths corresponding to the at least two directions are connected to obtain a target coverage path for the target area.
2. The method according to claim 1, characterized in that Generating a sub-coverage path corresponding to each direction in the target area includes: Determining a main direction of path planning in the target area; Determine a non-main direction for path planning based on the main direction; For each of the main direction and the non-main direction, a corresponding sub-covering path is generated.
3. The method according to claim 2, characterized in that The generating a corresponding sub-coverage path for each of the main direction and the non-main direction includes: For each of the main direction and the non-main direction, generating at least two line segments along the direction in the target area; The at least two line segments are connected to obtain a sub-covering path corresponding to the direction.
4. The method according to claim 3, characterized in that The connecting the at least two line segments to obtain a sub-coverage path corresponding to the direction includes: Connecting the at least two line segments in sequence to obtain a candidate subpath corresponding to the direction; If there is a static obstacle in the target area, and the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is greater than the target distance, the candidate sub-path corresponding to the direction is used as the sub-coverage path; the target distance is greater than or equal to the radius of the computer device; If there is a static obstacle in the target area, and the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is less than or equal to the target distance, the step of generating at least two line segments along the direction in the target area is re-executed until the minimum distance between the connecting line connecting the at least two line segments and the static obstacle is greater than the target distance, and the sub-coverage path corresponding to the direction is obtained.
5. The method according to any one of claims 1 to 4, characterized in that: The connecting the sub-coverage paths corresponding to at least two directions to obtain the target coverage path of the target area includes: According to the generation order of each sub-covering path, determine the endpoints of the sub-covering paths corresponding to two directions adjacent in the generation order; The endpoints of each sub-coverage path are connected to obtain the target coverage path of the target area.
6. The method according to any one of claims 1 to 4, characterized in that: Generating a sub-coverage path corresponding to each direction in the target area includes: If there is a static obstacle in the target area, a sub-coverage path corresponding to each direction is generated in the target area; the sub-coverage path does not pass through the area where the static obstacle is located.
7. A path planning device, characterized in that: The device comprises: A target area determination module is used to determine the target area to be planned; A sub-coverage path generation module, used to generate a sub-coverage path corresponding to each direction in the target area; The sub-coverage path connecting module is used to connect the sub-coverage paths corresponding to at least two directions to obtain the target coverage path of the target area.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
