Path planning methods, computer equipment and storage media
By acquiring path point location information and performing smoothing processing, a target path that fits the boundary of the area to be worked on is generated, solving the problem of missed areas in existing path planning algorithms and achieving higher work accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-17
- Publication Date
- 2026-03-13
AI Technical Summary
Existing path planning algorithms suffer from inaccurate planning of the edges, causing the mobile device to miss certain areas during operation and affecting the accuracy of the work area.
By obtaining the location information of path points in the initial path, the initial path segment points are determined, and supplementary path segment points are determined between adjacent path segment points. Combined with smoothing processing, the target path is generated to fit the actual boundary of the area to be worked on.
It improves the accuracy of path planning, enabling self-moving equipment to stay closer to the boundary of the work area, reducing missed areas and improving the accuracy of the work area.
Smart Images

Figure CN115280102B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of path planning, and more particularly to a path planning method, computer device, and storage medium. Background Technology
[0002] The statements herein are provided only as background information in connection with this application and do not necessarily constitute exemplary technology.
[0003] As the functionality and performance of self-moving devices continue to improve, more and more fields are gradually adopting them for work. For example, using robotic vacuum cleaners to clean rooms, robotic lawnmowers to mow lawns, and drones to spray or seed crops—these self-moving devices do not require direct human control or operation, and can greatly improve work efficiency.
[0004] Currently, self-propelled mobile devices can perform tasks such as mowing, sweeping, spraying, or spreading along the edges of a work area according to a planned edge-planning path. However, existing path planning algorithms suffer from inaccurate edge-planning paths, causing self-propelled mobile devices to miss certain areas when performing edge-planning operations, thus affecting the accuracy of edge-planning operations within the work area. Summary of the Invention
[0005] According to various embodiments of this application, a path planning method, a computer device, and a storage medium are provided.
[0006] In a first aspect, embodiments of this application provide a path planning method, including:
[0007] Obtain the initial path to be executed, which includes multiple path points;
[0008] Obtain the position information corresponding to each path point in the initial path; the position information is used to characterize the positional relationship of the path point relative to two adjacent path points.
[0009] Based on the location information corresponding to each path point in the initial path, the initial path segmentation point is determined from the plurality of path points;
[0010] Determine the supplementary path segment point of the initial path from among multiple path points between any two adjacent initial path segment points;
[0011] Both the initial path segment point and the supplementary path segment point are used as target path segment points, and the target path segment points are smoothed to obtain the target path to be executed.
[0012] Secondly, embodiments of this application also provide a path planning device, the path planning device comprising:
[0013] The acquisition module is configured to acquire the initial path to be executed, the initial path including multiple path points;
[0014] The acquisition module is also configured to acquire position information corresponding to each path point in the initial path; the position information is used to characterize the positional relationship of the path point relative to two adjacent path points;
[0015] The determination module is configured to determine the initial path segmentation point from the plurality of path points based on the position information corresponding to each path point in the initial path;
[0016] The determining module is further configured to determine the supplementary path segment point of the initial path among multiple path points between any two adjacent initial path segment points;
[0017] The smoothing module is configured to use both the initial path segmentation point and the supplementary path segmentation point as target path segmentation points, and to perform smoothing processing on the target path segmentation points to obtain the target path to be executed.
[0018] Thirdly, embodiments of this application also provide a computer device, the computer device including a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for implementing communication between the processor and the memory, wherein when the computer program is executed by the processor, it implements the path planning method as described above.
[0019] Fourthly, embodiments of this application also provide a storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, which can be executed by one or more processors to implement the path planning method as described above.
[0020] Details of one or more embodiments of this application are set forth in the following drawings and description. Other features, objects, and advantages of this application will become apparent from the specification, drawings, and claims. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating a path planning method provided in an embodiment of this application.
[0023] Figure 2 This is a schematic diagram of the initial path in an embodiment of this application.
[0024] Figure 3 This is another schematic diagram of the initial path in the embodiments of this application.
[0025] Figure 4 This is another schematic diagram of the initial path in the embodiments of this application.
[0026] Figure 5 for Figure 1 A flowchart illustrating the sub-steps of the path planning method in [the text].
[0027] Figure 6 This is a schematic diagram of a scenario for determining supplementary path segmentation points in an embodiment of this application.
[0028] Figure 7 This is a schematic block diagram of a path planning device provided in an embodiment of this application.
[0029] Figure 8 This is a schematic block diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0031] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0032] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0033] Currently, self-propelled mobile devices can perform tasks such as mowing, sweeping, spraying, or spreading along the boundaries of a work area according to a planned edge-planning path. However, existing path planning algorithms suffer from inaccurate edge-planning paths, causing self-propelled mobile devices to miss certain areas when performing operations along the planned edge-planning path, thus affecting the accuracy of edge-planning operations within the work area.
[0034] To address the aforementioned issues, this application provides a path planning method, device, and storage medium. The path planning method can be applied to computer devices such as servers, terminal devices, or self-moving devices. The server can be a standalone server, a server cluster consisting of multiple servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminal devices can be remote control devices, mobile phones, tablets, laptops, desktop computers, personal digital assistants, and wearable devices, while self-moving devices can be robotic vacuum cleaners, lawnmowers, drones, etc.
[0035] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0036] Please see Figure 1 , Figure 1 This is a flowchart illustrating a path planning method provided in an embodiment of this application.
[0037] like Figure 1 As shown, the path planning method includes steps S101 to S105.
[0038] Step S101: Obtain the initial path to be executed.
[0039] The initial path to be executed is the work path of the self-moving device within a certain work area. The work area can be a plot of land, room, green space, or grassland where the self-moving device will perform operations along its edge. The work area can be manually selected by the user or selected based on the location information of the self-moving device. The work area can be a closed or open work area. The initial path is the movement path of the self-moving device to perform the complete operation within the work area. The initial path can be generated in real time or pre-generated; this embodiment does not specifically limit this. The initial path includes multiple waypoints.
[0040] For example, the initial path to be executed can be retrieved from the cloud or storage. By storing the pre-planned initial path in the cloud and local storage, the initial path to be executed can be quickly retrieved when needed.
[0041] For example, the boundary of the area to be worked on is obtained from a map containing the area to be worked on, and the boundary is indented by a preset distance to obtain the initial path of the mobile device on the boundary of the area to be worked on. The map containing the area to be worked on can be a raster map, and the preset distance can be set based on actual conditions, such as the coverage width of the mobile device during a single operation. Specifically, the preset distance can be set to half the coverage width of the mobile device during a single operation. This embodiment does not specifically limit this; for example, the preset distance is 30 centimeters. Figure 2 As shown, after the boundary 11 of the work area is shrunken by a preset distance, the initial path 12 of the self-moving device on the boundary of the work area is obtained.
[0042] For example, the boundary of the area to be worked on is obtained from a map containing the area to be worked on. A path start point and a path end point are selected around the boundary. Starting from the path start point, path points are sampled along the boundary in a clockwise or counterclockwise direction at a preset sampling distance until the path end point is reached, resulting in multiple path points. Each path point is then connected sequentially according to its position to obtain the initial path of the self-moving device on the boundary of the area to be worked on. The preset sampling distance can be set based on actual conditions; this embodiment does not specifically limit it. For example, the preset sampling distance is 50 centimeters. Figure 3 As shown, by sampling path points on the boundary 11 of the work area, multiple path points 13 can be obtained, and multiple path points 13 can form an initial path.
[0043] Step S102: Obtain the location information corresponding to each path point in the initial path.
[0044] The location information is used to characterize the positional relationship of a path point relative to two adjacent path points. This positional relationship may include the angle corresponding to the path point or the distance of the path point relative to the adjacent path points. The angle corresponding to the path point is the angle formed by the line connecting the path point and the two adjacent path points, with one path point corresponding to one angle.
[0045] Step S103: Determine the initial path segmentation points from multiple path points based on the location information corresponding to each path point in the initial path.
[0046] like Figure 4As shown, path points a, b, and c form line segments ab and bc. The angle θ2 between line segments ab and bc is taken as the angle of path point b. Similarly, path points b, c, and d form line segments bc and cd. The angle θ3 between line segments bc and cd is taken as the angle of path point c. Following the same method, the angles of path points d, e, f, g, h, i, j, k, l, m, n, o, p, and q can be obtained as θ4, θ5, θ6, θ7, θ8, θ9, θ... 10 θ 11 θ 12 θ 13 θ 14 θ 15 θ 16 θ 17 When the initial path is a closed path, the angle of path point a is the angle θ1 between the line segment qa formed by path points q, a, and b and the line segment ab. When the initial path is an open path, the angle of path point a can be a default value or 0.
[0047] In one embodiment, the change in position information of each path point relative to its adjacent path points is obtained; when the change in position information exceeds a preset change in position information, the path point corresponding to the change in position information exceeding the preset change in position information is determined as the initial path segmentation point; or when the position information exceeds a preset position threshold, the path point is determined as the initial path segmentation point. The initial path segmentation point can be accurately determined by the change in position information or positional relationship of the path point relative to its adjacent path points.
[0048] The change in positional information of a path point relative to its adjacent path points includes the change in angle or position coordinates of the path point relative to its adjacent path points. For example, Figure 4 As shown, if path point a is adjacent to path point q, then the change in angle between path point a and path point q is |θ1-θ|. 17 If path point a is adjacent to both path point q and path point b, then the change in position coordinates of path point a(x1, y1) relative to path point b(x2, y2) is (y2-y1) / (x2-x1). The preset position change may include a preset angle change or a preset position coordinate change. These preset angle and position coordinate changes can be set based on actual conditions, and this embodiment does not impose specific limitations on them. For example, the preset angle change could be 30 degrees or 50 degrees.
[0049] For example, the angle change of each path point relative to its adjacent path points is obtained, and the path point corresponding to the angle change exceeding the preset angle change is determined as the initial path segmentation point.
[0050] In another embodiment, the change in position coordinates of each path point relative to its adjacent path points is obtained, and the path point whose change in position coordinates exceeds a preset change in position coordinates is determined as the initial path segmentation point.
[0051] The location information includes the angle corresponding to the path point, and the preset location threshold may include a preset angle threshold. The preset angle threshold can be set based on the actual situation, and this application embodiment does not specifically limit it. For example, the preset distance threshold is 50 centimeters, and the preset angle range is 25° to 135°, 20° to 130°, or 15° to 130°, etc.
[0052] For example, the angles corresponding to each path point are obtained, and the path points whose angles exceed a preset angle threshold are determined as the initial path segmentation points.
[0053] In one embodiment, such as Figure 5 As shown, step S103 includes sub-steps S1031 to S1033.
[0054] Sub-step S1031: Obtain the angle corresponding to each path point.
[0055] For example, for each path point on the initial path, the two adjacent path points on the initial path are determined; the angle formed by the line connecting the path point and the two adjacent path points is calculated, and the angle formed by the line connecting the path point and the two adjacent path points is determined as the angle corresponding to the path point.
[0056] In this system, each path point corresponds to an angle, which is the angle formed by the path point and the lines connecting it to its two adjacent path points. For example... Figure 4 As shown, the angles of path points a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, and q are θ1, θ2, θ3, θ4, θ5, θ6, θ7, θ8, θ9, and θ1, respectively. 10 θ 11 θ 12 θ 13 θ 14 θ 15 θ 16 θ 17 .
[0057] Sub-step S1032: Fit the angles corresponding to each path point to obtain multiple target fitting lines.
[0058] This can be achieved by linearly fitting the angles corresponding to each path point to obtain multiple target fitted lines, or by curve fitting the angles corresponding to each path point to obtain multiple target fitted curves. The change in the slope between the last two angles in the angle queue corresponding to the target fitted line relative to the slope between any two adjacent angles is greater than or equal to a slope change threshold. This slope change threshold can be set based on actual conditions, and this embodiment does not impose a specific limitation on it. For example, the slope change threshold is 0.3.
[0059] For example, fitting angles corresponding to each path point to obtain multiple target fitting lines can be done as follows: based on the layout order of the path points in the initial path, fit the angle θ corresponding to each path point one by one to obtain the angle queue [θ1, θ2, ..., θ] corresponding to the fitting lines. i-1 θ i ], where N≥i≥2, and N is the number of angles; when θ is detected i With θ i-1 When the change in the slope between two angles relative to the slope between any two adjacent angles is greater than or equal to the slope change threshold, the angle queue [θ1, θ2, ..., θ] is created. i-1 θ i The corresponding fitted line is determined as the target fitted line; the remaining angles that have not yet been fitted are fitted one by one according to the layout order of the path points on the initial path, to obtain the angle queue [θ] corresponding to the fitted line. i+1 θ i+2 , ..., θ i+m-1 θ i+m The steps are repeated to obtain multiple target fitting lines, where i+m≤N. By determining the layout order of path points on the initial path, the angles corresponding to each path point can be quickly fitted, which can improve the accuracy of determining the target fitting line and thus improve the accuracy of the initial path segment points.
[0060] For example, when i is 2, based on Figure 4 The initial path shown allows us to determine the layout order of the path points. Based on this layout order, we can first perform fitting on angles θ1 and θ2 to obtain the fitted line L. 11 Fitted line L 11 The corresponding angle queue [θ1, θ2] contains only one pair of adjacent angles, making it impossible to compare the slope changes with the other two adjacent angles. Therefore, based on the layout order of the path points on the initial path, fitting is performed on angles θ1, θ2, and θ3 to obtain the fitted line L. 12 Fitted line L 12The corresponding angle queue is [θ1, θ2, θ3]. If the slope change between θ2 and θ3 is greater than or equal to the slope change between θ1 and θ2 relative to the slope change threshold, then the fitted line L will be... 12 This is determined to be the target fitted line.
[0061] Then the remaining unfitted angles θ4, θ5, θ6, θ7, θ8, θ9, θ 10 θ 11 θ 12 θ 13 θ 14 θ 15 θ 16 θ 17 Continuing with the arrangement of path points on the initial path, fit is performed on each corresponding angle θ, starting with angles θ4 and θ5, to obtain the fitted line L. 13 The corresponding angle queue [θ4, θ5] is not compared since there are no other two adjacent angles in the angle queue [θ4, θ5]. Instead, based on the layout order of the path points on the initial path, angles θ4, θ5, and θ6 are fitted to obtain the fitted line L. 14 Fitted line L 14 The corresponding angle queue is [θ4, θ5, θ6]. If the change in the slope between θ6 and θ5 relative to the change in the slope between θ5 and θ4 is greater than or equal to the slope change threshold, then the fitted line L will be... 14 The target fitting line is determined. Following the same method described above, the remaining unfitted angles are fitted one by one according to the layout order of the path points on the initial path, until the angles involved in the fitting include θ. 17 This completes the fitting of angles, resulting in multiple target fitting lines.
[0062] Similarly, when i is 3, based on Figure 4 The initial path shown allows us to determine the layout order of the path points. Based on this layout order, we can first perform fitting on angles θ1, θ2, and θ3 to obtain the fitted line L. 12 For the corresponding angle queue [θ1, θ2, θ3], if the change in slope between θ3 and θ2 relative to the change in slope between θ2 and θ1 is greater than the slope change threshold, then the fitted line L will be... 21 The target fitted line is determined. Then, the remaining angles θ4, θ5, θ6, θ7, θ8, θ9, θ... 10 θ 11 θ 12 θ 13 θ 14 θ 15 θ 16 θ17 Continuing with the arrangement of path points on the initial path, fit the angles θ corresponding to each path point one by one, that is, first fit angles θ4, θ5, and θ6 to obtain the fitted line L. 21 For the corresponding angle queue [θ4, θ5, θ6], if the change in the slope between θ6 and θ5 relative to the change in the slope between θ5 and θ4 is greater than or equal to the slope change threshold, then the fitted line L will be... 21 Once the target fitting line is identified, continue in the same manner as above, fitting the remaining unfitted angles one by one according to the layout order of the path points on the initial path, until the angles involved in the fitting include θ. 17 This completes the fitting of angles, resulting in multiple target fitting lines.
[0063] Sub-step S1033: Obtain the angles at the ends of each target fitting line, and use the path points corresponding to the end angles as the initial path segmentation points.
[0064] In this embodiment, due to the irregularity of the actual boundary of the area to be worked on, the generated initial path cannot closely adhere to the actual boundary of the area to be worked on. By fitting the angles corresponding to each path point, multiple target fitting lines are obtained. Since the change in slope between angles can represent the degree of consistency of the angles involved in the fitting, the change in slope between the last two angles in the angle queue corresponding to the target fitting line relative to the slope between the other two adjacent angles is greater than or equal to the slope change threshold. The angles located at the ends of each target fitting line are obtained, and the path points corresponding to the end angles are determined as the initial path segment points. This can identify angles that have a significant impact on consistency among the multiple angles involved in the fitting. The path points corresponding to the angles that have a significant impact on consistency are the path segment points. This can accurately determine the path segment points, thereby improving the accuracy of subsequent filtering of path points between path segment points. It can reduce the problem of missing actual edge path points on irregular edge paths, so that the edge path can closely adhere to the actual boundary of the area to be worked on.
[0065] For example, the angle at the tail of the angle queue corresponding to each target fitted line is obtained, and the angle at the tail of the queue is taken as the target angle; the path point corresponding to the target angle is taken as the initial path segment point. For example, the target fitted line includes the fitted line corresponding to the angle queue [θ1, θ2, θ3]. Since angle θ3 in the angle queue [θ1, θ2, θ3] is located at the end of the corresponding fitted line, the path point c corresponding to angle θ3 is determined as the initial path segment point. The target fitted line also includes the fitted line corresponding to the angle queue [θ4, θ5, θ6]. Since angle θ6 in the angle queue [θ4, θ5, θ6] is located at the end of the corresponding fitted line, the path point e corresponding to angle θ6 is determined as the initial path segment point.
[0066] Step S104: Determine the supplementary path segment point of the initial path from among multiple path points between any two adjacent initial path segment points.
[0067] Since the initial path is not absolutely continuous and is generated based on a raster map, the distance between adjacent path points on the initial path is related to the resolution of the raster map. Usually, the resolution of the raster map is high, which results in many unnecessary path points on the generated initial path. This causes the initial path to fail to fit the actual boundary of the area to be worked on. Therefore, after determining the initial path segment points, supplementary path segment points are determined from the multiple path points between any two adjacent initial path segment points. This can eliminate some unnecessary path points on the initial path and reduce the problem of missing path points on irregular paths, thereby improving the accuracy of path points.
[0068] In one embodiment, the perpendicular distance from a path point between any two adjacent initial path segment points to the corresponding sub-path is obtained, where the sub-path is formed by connecting any two adjacent initial path segment points. Path points with a perpendicular distance greater than or equal to a preset reference threshold are designated as supplementary path segment points. Path points with a perpendicular distance less than the preset reference threshold are deleted. For each supplementary path segment point and multiple path points between it and its adjacent initial path segment points, the step of obtaining the perpendicular distance from a path point between any two adjacent initial path segment points to the corresponding sub-path is performed until no other path points exist on the corresponding sub-path. The preset reference threshold can be set based on actual conditions, and this embodiment does not impose a specific limitation on it. For example, the preset reference threshold is 0.1 meters. By deleting path points with a perpendicular distance less than the preset reference threshold, some unnecessary path points on the initial path can be eliminated, while designating path points with a perpendicular distance greater than or equal to the preset reference threshold as supplementary path segment points can reduce the omission of path points on irregular paths.
[0069] For example, such as Figure 6As shown, two adjacent initial path segment points are initial path segment point P1 and initial path segment point P2, respectively. Path segment P1P2 is the corresponding sub-path, and there are path points A, B, and C between path segment P1P2. The vertical distances between path points A, B, and C and path segment P1P2 are determined. Since the vertical distances between path points B and C and path segment P1P2 are greater than a preset reference threshold, path points B and C are determined as supplementary path segment points. However, the vertical distance between path point A and path segment P1P2 is less than the preset reference threshold, so path point A is deleted. Since there are no other path points between supplementary path segment point B and initial path segment point P1, and there are no other path points between supplementary path segment point B and initial path segment point P2, no filtering is performed. Similarly, there are no other path points between supplementary path segment point C and initial path segment point P1, and there are no other path points between supplementary path segment point C and initial path segment point P2, so no filtering is performed.
[0070] In another embodiment, path points A, B, and C between path segments P1 and P2 are traversed to obtain the perpendicular distances from path points A, B, and C to path segment P1 and P2. Among path points A, B, and C, B is determined to be the path point farthest from path segment P1 and P2. If the perpendicular distance from path point B to path segment P1 and P2 is less than a preset reference threshold, then path points A, B, and C are deleted. If the perpendicular distance from path point B to path segment P1 and P2 is greater than or equal to the preset reference threshold, B is used as a supplementary path segment point. At this time, the supplementary path segment point B, together with the initial path segment points P1 and P2, forms path segments P1B and BP2. At this point, by traversing the path points between the supplementary path segment point B and the initial path segment point P1, the distance from path point A to path segment P1B can be obtained. If this distance is less than a preset reference threshold, the path point is deleted; otherwise, A is designated as a new supplementary path segment point. The path points between each path segment point are then evaluated again until no other path points exist between P1B. Similarly, the points between the supplementary path segment point B and the initial path segment point P2 are evaluated. For example, the distance to point C is evaluated; if it is greater than a preset reference threshold, it is designated as a supplementary path segment point; otherwise, it is deleted.
[0071] Step S105: Use both the initial path segment point and the supplementary path segment point as target path segment points, and smooth the target path segment points to obtain the target path to be executed.
[0072] The target path segment points can be smoothed using a preset smoothing algorithm. This algorithm may include least squares, spline interpolation, polynomial interpolation, Floyd's algorithm, Bézier curve algorithm, B-spline curve algorithm, etc., and this embodiment does not specifically limit the algorithm. For example, the B-spline curve algorithm can be used to smooth the target path segment points to obtain the target path to be executed. Specifically, a target path point is selected from all target path segment points as the path point to be processed, and multiple control points are selected from all target path segment points. Based on the selected control points, a B-spline curve corresponding to the path point to be processed is generated. Collision detection is performed on the B-spline curve. The purpose of collision detection is to ensure that the self-moving device does not collide with obstacles while traveling on the planned path. When the B-spline curve fails the line segment collision detection, adjust the control points of the B-spline curve to update the B-spline curve until the B-spline curve passes the line segment collision detection. Replace the path points to be processed and the path segments between the selected control points with the B-spline curves that have passed the line segment collision detection. Iterate through the remaining target path segment points and repeat the above process to complete the smoothing of the target path segment points and obtain the target path to be executed.
[0073] In one embodiment, the curvature of each path segment on the target path is obtained, where a path segment is any path segment between two adjacent target path segmentation points. Based on the curvature of each path segment, the moving speed of the self-moving device on the corresponding path segment is configured. By configuring the moving speed of the self-moving device on each path segment using the curvature, the self-moving device can further work along the boundary of the area to be worked on when performing tasks, thereby improving the work efficiency.
[0074] For example, the curvature of a path segment can be determined by: fitting the path points located in the path segment, i.e., between two adjacent path segment points, to obtain a path fitting line; determining the curvature of the path fitting line, and using the curvature of the path fitting line as the curvature of the path segment.
[0075] For example, a pre-stored correspondence between curvature and movement speed is obtained, and the movement speed of the self-moving device on each path segment is configured based on the pre-stored correspondence and the curvature of each path segment. The correspondence between curvature and movement speed can be obtained in advance through multiple experiments; this embodiment does not impose specific limitations on it.
[0076] In one embodiment, the angle of each target path segment point on the target path is obtained; and based on the angle of each target path segment point on the target path, the angular velocity of the self-moving device at each target path segment point on the target path is configured. By configuring the corresponding angular velocity of the self-moving device at the path segment points, the self-moving device can further work along the boundary of the work area when performing the task, thereby further improving the work efficiency.
[0077] For example, the pre-stored correspondence between angles and angular velocities is obtained; based on the correspondence between angles and angular velocities and the angle of each path segment point on the target path, the angular velocity of the self-moving device at each path segment point on the target path is configured. The correspondence between angles and angular velocities can be obtained in advance through multiple experiments; this embodiment does not impose specific limitations on it.
[0078] The path planning method provided in the above embodiments determines initial path segment points from each path point in the initial path to be executed based on the location information of each path point in the initial path. It also determines supplementary path segment points from multiple path points between any two adjacent initial path segment points. While filtering path points, this avoids missing actual path points on irregular paths. Both the initial path segment points and the supplementary path segment points are used as target path segment points, and these target path segment points are smoothed to obtain the target path to be executed. This results in a target path that more closely fits the actual edge of the work area, greatly improving the accuracy of path planning. This allows the self-moving device to closely follow the edge of the work area when performing operations according to the target path, thereby reducing missed areas and significantly improving the accuracy of the self-moving device's operations in the work area.
[0079] Please see Figure 7 , Figure 7 This is a schematic block diagram of a path planning device provided in an embodiment of this application.
[0080] like Figure 7 As shown, the path planning device 200 includes:
[0081] The acquisition module 210 is configured to acquire the initial path to be executed, the initial path including multiple path points;
[0082] The acquisition module 210 is further configured to acquire position information corresponding to each path point in the initial path; the position information is used to characterize the positional relationship of the path point relative to two adjacent path points.
[0083] The determining module 220 is configured to determine initial path segmentation points from the plurality of path points based on the position information corresponding to each path point in the initial path; the position information is used to characterize the positional relationship of the path point relative to two adjacent path points.
[0084] The determining module 220 is further configured to determine the supplementary path segment point of the initial path among multiple path points between any two adjacent initial path segment points;
[0085] The smoothing module 230 is configured to use both the initial path segment point and the supplementary path segment point as target path segment points, and to perform smoothing processing on the target path segment points to obtain the target path to be executed.
[0086] In one embodiment, the path planning device 200 further includes a speed configuration module, wherein:
[0087] The acquisition module 210 is further configured to acquire the curvature of each path segment on the target path, wherein the path segment is the path segment between any two adjacent segment points of the target path;
[0088] The speed configuration module is configured to configure the moving speed of the self-moving device on the corresponding path segment according to the curvature of each path segment.
[0089] In one embodiment, the determining module 220 is further configured to:
[0090] Obtain the change in position information of each path point relative to its adjacent path points; when the change in position information exceeds a preset change in position, determine the path point as the initial path segmentation point; or
[0091] When the location information exceeds a preset location threshold, the path point is determined as the initial path segmentation point.
[0092] In one embodiment, the location information includes an angle; the angle is the angle formed by the line connecting the path point and two adjacent path points; the determining module 220 is further configured to:
[0093] Obtain the angle corresponding to each of the path points;
[0094] The angles corresponding to each of the path points are fitted to obtain multiple target fitting lines;
[0095] Obtain the angles located at the ends of each of the target fitting lines, and use the path points corresponding to the angles at the ends as the initial path segmentation points.
[0096] In one embodiment, the determining module 220 is further configured to:
[0097] Based on the layout order of the path points on the initial path, the angle θ corresponding to each path point is fitted one by one to obtain the angle queue [θ1, θ2, ..., θ] corresponding to the fitted line. i-1 θ i ], where N≥i≥2, and N is the number of angles;
[0098] When θ is detected i With θ i-1 When the change in slope between two angles relative to the slope between any two adjacent angles is greater than or equal to a slope change threshold, the angle queue [θ1, θ2, ..., θ] is... i-1 θ i The corresponding fitted line is determined as the target fitted line;
[0099] For the remaining angles that have not yet been fitted, continue fitting each angle θ corresponding to the path point according to the layout order of the path points on the initial path, to obtain the angle queue [θ] corresponding to the fitted line. i+1 θ i+2 , ..., θ i+m-1 θ i+m The steps are repeated to obtain multiple target fitting lines, where i+m≤N.
[0100] In one embodiment, the determining module 220 is further configured to:
[0101] Obtain the angle at the tail position of the angle queue corresponding to each of the target fitting lines, and use the angle at the tail position as the target angle;
[0102] Use the path points corresponding to the target angle as the initial path segmentation points.
[0103] In one embodiment, the determining module 220 is further configured to:
[0104] Obtain the perpendicular distance from any path point between any two adjacent initial path segment points to the corresponding sub-path, wherein the sub-path is obtained by connecting any two adjacent initial path segment points;
[0105] Path points whose vertical distance is greater than or equal to a preset reference threshold are used as supplementary path segmentation points;
[0106] Delete path points whose vertical distance is less than a preset reference threshold;
[0107] For the supplementary path segment point and multiple path points between it and its adjacent initial path segment point, perform the step of obtaining the vertical distance from any two adjacent initial path segment points to the corresponding sub-path, until there are no other path points on the corresponding sub-path.
[0108] In one embodiment, the smoothing module 230 is further configured to:
[0109] The target path segment points are smoothed based on a preset smoothing algorithm to obtain the target path to be executed. The preset smoothing algorithm includes any one of the following: least squares method, spline interpolation method, polynomial interpolation method, Floyd algorithm, Bézier curve algorithm, and B-spline curve algorithm.
[0110] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the path planning device described above can be referred to the corresponding process in the aforementioned path planning method embodiments, and will not be repeated here.
[0111] Please see Figure 8 , Figure 8 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application.
[0112] like Figure 8 As shown, computer device 300 includes a processor 310 and a memory 320, which are connected via a bus 330, such as an I2C (Inter-integrated Circuit) bus. Computer device 300 may include self-moving devices, terminal devices, or servers.
[0113] Specifically, processor 310 provides computing and control capabilities to support the operation of the entire path planning device. Processor 310 can be a Central Processing Unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0114] Specifically, the memory 320 can be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a portable hard drive, etc.
[0115] Those skilled in the art will understand that Figure 8The structures shown are merely block diagrams of some structures related to the embodiments of this application and do not constitute a limitation on the computer devices on which the embodiments of this application are applied. Specific computer devices may include more or fewer components than those shown in the figures, or combine certain components, or have different component arrangements.
[0116] The processor is used to run a computer program stored in a memory, and implements any of the path planning methods provided in the embodiments of this application when executing the computer program.
[0117] In one embodiment, the processor is configured to run a computer program stored in memory, and to perform the following steps when executing the computer program:
[0118] Obtain the initial path to be executed, which includes multiple path points;
[0119] Based on the position information corresponding to each path point in the initial path, the initial path segmentation point is determined from the plurality of path points; the position information is used to characterize the positional relationship of the path point relative to two adjacent path points;
[0120] Determine the supplementary path segment point of the initial path from among multiple path points between any two adjacent initial path segment points;
[0121] Both the initial path segment point and the supplementary path segment point are used as target path segment points, and the target path segment points are smoothed to obtain the target path to be executed.
[0122] In one embodiment, after the processor performs smoothing processing on the target path segment points to obtain the target path to be executed, it is further configured to:
[0123] Obtain the curvature of each path segment on the target path, where the path segment is the path segment between any two adjacent segmentation points of the target path;
[0124] Configure the self-moving device's speed on the corresponding path segment based on the curvature of each path segment.
[0125] In one embodiment, when the processor determines the initial path segmentation point from the plurality of path points based on the position information corresponding to each path point in the initial path, it is configured to:
[0126] Obtain the change in position information of each path point relative to its adjacent path points; when the change in position information exceeds a preset change in position, determine the path point as the initial path segmentation point; or
[0127] When the location information exceeds a preset location threshold, the path point is determined as the initial path segmentation point.
[0128] In one embodiment, the position information includes an angle; the angle is the angle formed by the line connecting the path point and two adjacent path points; when the processor determines the initial path segment point from the plurality of path points based on the position information corresponding to each path point in the initial path, it is configured to:
[0129] Obtain the angle corresponding to each of the path points;
[0130] The angles corresponding to each of the path points are fitted to obtain multiple target fitting lines;
[0131] Obtain the angle at the end of each of the target fitting lines, and use the path point corresponding to the angle at the end as the initial path segment point.
[0132] In one embodiment, when the processor fits the angles corresponding to each of the path points to obtain multiple target fitting lines, it is configured to:
[0133] Based on the layout order of the path points on the initial path, the angle θ corresponding to each path point is fitted one by one to obtain the angle queue [θ1, θ2, ..., θ] corresponding to the fitted line. i-1 θ i ], where N≥i≥2, and N is the number of angles;
[0134] When θ is detected i With θ i-1 When the change in slope between two angles relative to the slope between any two adjacent angles is greater than or equal to a slope change threshold, the angle queue [θ1, θ2, ..., θ] is... i-1 θ i The corresponding fitted line is determined as the target fitted line;
[0135] For the remaining angles that have not yet been fitted, continue fitting each angle θ corresponding to the path point according to the layout order of the path points on the initial path, to obtain the angle queue [θ] corresponding to the fitted line. i+1 θ i+2 , ..., θ i+m-1 θ i+m The steps are repeated to obtain multiple target fitting lines, where i+m≤N.
[0136] In one embodiment, when the processor acquires the angles located at the ends of each of the target fitting lines and uses the path points corresponding to the angles at the ends as initial path segmentation points, it is configured to:
[0137] Obtain the angle at the tail position of the angle queue corresponding to each of the target fitting lines, and use the angle at the tail position as the target angle;
[0138] Use the path points corresponding to the target angle as the initial path segmentation points.
[0139] In one embodiment, when the processor determines a supplementary path segment point of the initial path from among a plurality of path points between any two adjacent initial path segment points, it is configured to:
[0140] Obtain the perpendicular distance from any path point between any two adjacent initial path segment points to the corresponding sub-path, wherein the sub-path is obtained by connecting any two adjacent initial path segment points;
[0141] Path points whose vertical distance is greater than or equal to a preset reference threshold are used as supplementary path segmentation points;
[0142] Delete path points whose vertical distance is less than a preset reference threshold;
[0143] The supplementary path segment point and multiple path points between it and the adjacent initial path segment point are filtered until there are no other path points on the corresponding sub-path.
[0144] In one embodiment, when the processor performs smoothing processing on the segment points of the target path to obtain the target path to be executed, it is configured to:
[0145] The target path segment points are smoothed based on a preset smoothing algorithm to obtain the target path to be executed. The preset smoothing algorithm includes any one of the following: least squares method, spline interpolation method, polynomial interpolation method, Floyd algorithm, Bézier curve algorithm, and B-spline curve algorithm.
[0146] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the computer device described above can be referred to the corresponding process in the aforementioned path planning method embodiments, and will not be repeated here.
[0147] This application also provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs that can be executed by one or more processors to implement any of the path planning methods provided in the specification of this application.
[0148] The storage medium can be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0149] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware embodiments, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0150] It should be understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, herein, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0151] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. The above descriptions are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A path planning method, comprising: Obtain the initial path to be executed, which includes multiple path points; Obtain the location information corresponding to each path point in the initial path; The location information is used to characterize the positional relationship of the path point relative to two adjacent path points. The location information includes an angle, which is the angle formed by the line connecting the path point to the two adjacent path points. Based on the angles corresponding to each path point in the initial path, determine the initial path segmentation points from the plurality of path points; Among multiple path points between any two adjacent initial path segment points, determine the supplementary path segment point of the initial path; Both the initial path segment point and the supplementary path segment point are used as target path segment points, and the target path segment points are smoothed to obtain the target path to be executed. The step of determining the initial path segmentation point from the plurality of path points based on the angles corresponding to each path point in the initial path includes: The angles corresponding to each of the path points are fitted to obtain multiple target fitting lines; Obtain the angles located at the ends of each of the target fitting lines, and use the path points corresponding to the angles at the ends as the initial path segmentation points.
2. The path planning method according to claim 1, wherein, After smoothing the target path segment points to obtain the target path to be executed, the process further includes: Obtain the curvature of each path segment on the target path, where the path segment is the path segment between any two adjacent segmentation points of the target path; Configure the self-moving device's speed on the corresponding path segment based on the curvature of each path segment.
3. The path planning method according to claim 1, wherein, The step of determining the initial path segmentation point from the plurality of path points based on the position information corresponding to each path point in the initial path includes: Obtain the change in position information of each path point relative to its adjacent path points; when the change in position information exceeds a preset change in position, determine the path point as the initial path segmentation point; or When the location information exceeds a preset location threshold, the path point is determined as the initial path segmentation point.
4. The path planning method according to claim 1, wherein, The fitting of angles corresponding to each of the path points yields multiple target fitting lines, including: Based on the layout order of the path points on the initial path, the angle θ corresponding to each path point is fitted one by one to obtain the angle queue [θ1, θ2, ..., θ] corresponding to the fitted line. i-1 θ i ], where N≥i≥2, and N is the number of angles; When θ is detected i With θ i-1 When the change in slope between two angles relative to the slope between any two adjacent angles is greater than or equal to a slope change threshold, the angle queue [θ1, θ2, ..., θ] is... i-1 θ i The corresponding fitted line is determined as the target fitted line; For the remaining angles that have not yet been fitted, continue fitting each angle θ corresponding to the path point according to the layout order of the path points on the initial path, to obtain the angle queue [θ] corresponding to the fitted line. i+1 θ i+2 , ..., θ i+m-1 θ i+m The steps are repeated to obtain multiple target fitting lines, where i+m≤N.
5. The path planning method according to claim 1, wherein, The step of obtaining the angles located at the ends of each of the target fitting lines, and using the path points corresponding to the angles at the ends as the initial path segmentation points, includes: Obtain the angle at the tail position of the angle queue corresponding to each of the target fitting lines, and use the angle at the tail position as the target angle; Use the path points corresponding to the target angle as the initial path segmentation points.
6. The path planning method according to any one of claims 1-5, wherein, The step of determining the supplementary path segment point of the initial path from among multiple path points between any two adjacent initial path segment points includes: Obtain the perpendicular distance from any path point between any two adjacent initial path segment points to the corresponding sub-path, wherein the sub-path is obtained by connecting any two adjacent initial path segment points; Path points whose vertical distance is greater than or equal to a preset reference threshold are used as supplementary path segmentation points; Delete path points whose vertical distance is less than a preset reference threshold; For the supplementary path segment point and multiple path points between it and its adjacent initial path segment point, perform the step of obtaining the vertical distance from any two adjacent initial path segment points to the corresponding sub-path, until there are no other path points on the corresponding sub-path.
7. The path planning method according to claim 1, wherein, The smoothing process of the target path segment points to obtain the target path to be executed includes: The target path segment points are smoothed based on a preset smoothing algorithm to obtain the target path to be executed. The preset smoothing algorithm includes any one of the following: least squares method, spline interpolation method, polynomial interpolation method, Floyd algorithm, Bézier curve algorithm, and B-spline curve algorithm.
8. A computer device comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for enabling communication between the processor and the memory, wherein the computer program, when executed by the processor, implements the path planning method as described in any one of claims 1 to 7.
9. A storage medium for computer-readable storage, the storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the path planning method of any one of claims 1 to 7.
Citation Information
Patent Citations
Heuristic RRT mechanical arm motion planning method based on target deviation optimization
CN110962130A
Robot mapping method, equipment and storage medium
CN111158384A
Navigation path planning method and system based on parameter curve optimization
CN113847924A