Method, device and system for generating curved path
By performing offset and smoothing on the base curve path, the target offset curve path is generated, which solves the problem of excessive requirements for the original curve path in the prior art, and improves the quality of the curve path and the automatic operation efficiency.
Patent Information
- Application Number
- CN201810407330.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-04-28
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2038-04-28
AI Technical Summary
When generating equidistant curve paths in the prior art, the requirements for the original curve paths are too high, resulting in poor quality of the generated curve paths, which cannot meet the needs of complex operating environments, and affects the efficiency and quality of automatic operation.
By obtaining the control point coordinate data on the base curve path, offset calculation is performed based on the preset offset distance and curvature radius, an offset curve path is generated, and smoothing is performed by the minimum curvature radius and the maximum heading angle to generate the target offset. Curve paths to meet the needs of complex operating environments.
The generated curve paths are of higher quality, which can meet the needs of complex operating environments and improve the efficiency and quality of automatic operation.
Smart Images

Figure CN110414706B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an information processing technology, and in particular to a method, device and system for generating a curved path. Background Art
[0002] In the process of agricultural machinery automation operation, equidistant straight line operation can greatly improve the operation speed and operation quality. However, the actual operation environment is very complex, and a simple straight line path cannot meet the actual operation needs. It is often necessary to design the operation path into an equidistant curve form.
[0003] The prior art method for generating an equidistant curved path includes: first, driving an agricultural machine to perform operations, obtaining real-time kinematic (RTK) positioning data, and drawing an original curved path according to the RTK positioning data; then, according to the original curved path, using interval arithmetic and a quadtree algorithm to eliminate biased curve self-intersections to generate an equidistant curved path.
[0004] However, in the process of implementing the present invention, the inventors found that the method of generating a curved path provided by the prior art has many requirements for the original curved path, for example, the original curve needs to satisfy RTK positioning and needs to form a closed-loop curve, etc., which makes the technical solution provided by the prior art inconvenient to use. Once the original curved path does not meet the conditions, the quality of the generated curved path is poor, which cannot meet the needs of the actual complex working environment and affects the actual automatic operation efficiency and quality. Summary of the invention
[0005] To solve the above problems, the embodiments of the present invention propose a method, device and system for generating a curved path. The generated curved path has high quality and can meet the needs of actual complex working environments.
[0006] The method for generating a curved path provided by an embodiment of the present invention includes: obtaining coordinate data of all first control points on a base curved path in a plane coordinate system; obtaining a shiftable control point from the first control point according to the obtained coordinate data and a preset offset distance; performing offset calculation on the shiftable control point according to the offset distance, obtaining coordinate data of a second control point after the shiftable control point is offset, and generating an offset curved path; smoothing the offset curved path according to a preset minimum curvature radius to generate a corrected offset curved path; smoothing the corrected offset curved path according to a preset maximum heading angle to generate a target offset curved path.
[0007] Further, the acquiring the shiftable control point from the first control point according to the preset offset distance and the coordinate data includes: acquiring the curvature K of the first control point according to the coordinate data of the first control point: Among them, x and y are the coordinate data of the first control point; if 1 / Ki<d and Ki*d>0, it is a non-shiftable control point. The non-shiftable control point is removed from the first control point to obtain the shiftable control point, wherein Ki is the curvature of the i-th first control point, and d is the offset distance.
[0008] Furthermore, the offset curve path is smoothed according to a preset minimum curvature radius to generate a corrected offset curve path, including: performing offset calculation on the second control point according to the minimum curvature radius, obtaining coordinate data of the third control point after the second control point is offset, and generating a curvature offset curve path; using a rapid rejection test and a straddle detection test to obtain intersection coordinates from the curvature offset curve path; obtaining tangent point coordinates on the offset curve path according to the intersection coordinates; and smoothing the offset curve path according to the tangent point coordinates to generate a corrected offset curve path.
[0009] Furthermore, the smoothing of the corrected offset curve path according to the preset maximum heading angle to generate the target offset curve path includes: obtaining the heading angle data of the second control point; if the heading angle is greater than the preset maximum heading angle, using interpolation to generate a Bezier curve, and smoothing the corrected offset curve path to generate the target offset curve path.
[0010] Furthermore, the method for generating a curved path may further include: uniformly sampling the target offset curved path, generating uniformly sampled fourth control points, and acquiring coordinates of the fourth control points.
[0011] The device for generating a curved path provided by an embodiment of the present invention includes:
[0012] A first acquisition module, used to acquire coordinate data of all first control points on the base curve path in a plane coordinate system;
[0013] A second acquisition module, configured to acquire a deflectable control point from the first control point according to the coordinate data acquired by the first acquisition module and a preset offset distance;
[0014] A third acquisition module is used to perform an offset calculation on the deflectable control point acquired by the second acquisition module according to the offset distance, acquire coordinate data of the second control point after the deflectable control point is offset, and generate an offset curve path;
[0015] A first processing module, configured to smooth the offset curve path generated by the third acquisition module according to a preset minimum curvature radius, to generate a corrected offset curve path;
[0016] The second processing module is used to smooth the offset curve path corrected by the first processing module according to a preset maximum heading angle to generate a target offset curve path.
[0017] Furthermore, the second acquisition module includes:
[0018] The first acquisition submodule is used to acquire the curvature K of the first control point according to the coordinate data of the first control point:
[0019]
[0020] Wherein, x and y are the coordinate data of the first control point;
[0021] The second acquisition submodule is used to remove the non-shiftable control point from the first control points if 1 / Ki<d and Ki*d>0, and obtain the shiftable control point, wherein Ki is the curvature of the i-th first control point and d is the offset distance.
[0022] Furthermore, the first processing module includes:
[0023] A third acquisition submodule, configured to perform an offset calculation on the second control point according to the minimum curvature radius, obtain coordinate data of the third control point after the second control point is offset, and generate a curvature offset curve path;
[0024] a fourth acquisition submodule, configured to acquire the intersection coordinates from the curvature offset curve path acquired by the third acquisition submodule by using a rapid rejection test and a straddle detection test;
[0025] A fifth acquisition submodule, used to acquire the tangent point coordinates on the offset curve path according to the intersection point coordinates acquired by the fourth acquisition submodule;
[0026] The first generating submodule is used to perform smoothing processing on the offset curve path according to the tangent point coordinates acquired by the fifth acquiring submodule to generate a corrected offset curve path.
[0027] Furthermore, the second processing module includes:
[0028] A sixth acquisition submodule, used to acquire the heading angle data of the second control point;
[0029] The second generating submodule is used to generate a Bezier curve by interpolation if the heading angle obtained by the sixth obtaining submodule is greater than a preset maximum heading angle, and to smooth the corrected offset curve path to generate a target offset curve path.
[0030] Furthermore, the device for generating a curved path may further include:
[0031] The fourth acquisition module is used to uniformly sample the target offset curve path generated by the second processing module, generate uniformly sampled fourth control points, and acquire the coordinates of the fourth control points.
[0032] The system for generating a curved path provided by an embodiment of the present invention includes the device for generating a curved path described above.
[0033] Compared with the prior art, the present invention does not restrict the base curve path, and the base curve path can be in any form. The technical solution provided by the embodiment of the present invention can generate an offset curve path according to the coordinate data of the first control point on the base curve path and the offset distance, and process the offset curve path according to the pre-set path constraints - the minimum radius of curvature and the maximum heading angle, to generate the final target offset curve path. It takes into account the influence of the path constraints on the offset curve path and the error influence caused by the inaccurate base curve path, so that the target offset curve path generated according to the technical solution provided by the embodiment of the present invention can better meet the needs of the actual complex working environment, and the generated target offset curve path has higher quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0035] Figure 1 is a flow chart of a method for generating a curved path provided by an embodiment of the present invention;
[0036] Figure 2 is a relationship diagram of a base curve path, an offset curve path, and a curvature offset curve path in the method for generating a curve path provided by an embodiment of the present invention;
[0037] Figure 3 yes Figure 1 The flowchart of step 102 in the method for generating a curved path provided by the embodiment of the present invention is shown;
[0038] Figure 4 yes Figure 1 The flowchart of step 104 in the method for generating a curved path provided by the embodiment of the present invention is shown;
[0039] Figure 5yes Figure 4 The curve diagram of the smoothing process in step 404 is shown;
[0040] Figure 6 yes Figure 1 The flowchart of step 105 in the method for generating a curved path provided by the embodiment of the present invention is shown;
[0041] Figure 7 yes Figure 6 The curve diagram of the smoothing process in step 602 is shown;
[0042] Figure 8 is a flow chart of a method for generating a curved path provided by another embodiment of the present invention;
[0043] Fig. 9 is a schematic diagram of a curved path obtained by using the method for generating a curved path provided by an embodiment of the present invention;
[0044] Fig.10 The structure of the device for generating a curved path provided by an embodiment of the present invention is schematically shown in FIG. Figure 1 ;
[0045] Fig.11 yes Fig.10 The structure diagram of the second acquisition module 1002 in the device for generating a curved path provided by an embodiment of the present invention is shown;
[0046] Fig.12 yes Fig.10 The structure diagram of the first processing module 1004 in the device for generating a curved path provided by an embodiment of the present invention is shown;
[0047] Fig.13 yes Fig.10 The structure diagram of the second processing module 1005 in the device for generating a curved path provided by an embodiment of the present invention is shown;
[0048] Fig.14 The structure of the device for generating a curved path provided by an embodiment of the present invention is schematically shown in FIG. Figure 2 . DETAILED DESCRIPTION
[0049] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.
[0050] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0051] In order to solve the problem that the prior art cannot meet the requirements of curved path design in complex working environments, embodiments of the present invention provide a method, device and system for generating a curved path.
[0052] like Figure 1 As shown, the method for generating a curved path provided by an embodiment of the present invention includes:
[0053] Step 101, obtaining coordinate data of all first control points on the base curve path in a plane coordinate system.
[0054] In this embodiment, the base curve path can be drawn by RTK positioning data obtained by real-time machine operation, or it can be designed on a map. Of course, the embodiment of the present invention does not limit the method for obtaining the base curve path. In actual use, the base curve path can be obtained by other means, and each case will not be described here one by one.
[0055] It should be noted that, in order to ensure the quality of the curve path, when the base curve path is obtained through RTK positioning data or designed on the map according to the curve function, no smoothing is required, otherwise the base curve path needs to be smoothed. This embodiment does not limit the specific smoothing method. In actual use, those skilled in the art can implement it through any feasible algorithm, which will not be described in detail here.
[0056] Specifically, step 101 may convert the positioning data of the first control point of the base curve path into coordinate data in a plane coordinate system.
[0057] Step 102: acquiring a deflectable control point from the first control point according to a preset offset distance and coordinate data.
[0058] like Figure 2 As shown, L0 is the base curve path, d is the signed offset distance, at this time, Figure 3 As shown, step 102 may include:
[0059] Step 301, obtaining the signed curvature K of the first control point according to the coordinate data of the first control point and formula (1):
[0060]
[0061] Among them, x and y are the coordinate data of the first control point.
[0062] Step 302: If 1 / Ki<d and Ki*d>0, it is a non-shiftable control point. The non-shiftable control point is removed from the first control points to obtain the shiftable control points, where Ki is the curvature of the i-th first control point.
[0063] In the actual working environment, when the curvature radius of the first control point is smaller than the minimum turning radius, and the curvature direction is the same as the offset direction, the direction of the first control point on the offset curve path will be opposite to the base curve path. Figure 3 In the steps shown, the first control point mentioned above can be defined as a non-deviable control point and deleted, thereby obtaining a deflectable control point in the first control point. Since the non-deviable control point in the base curve path is deleted, the deflected curve path generated by the technical solution of the present invention has better quality.
[0064] Step 103, performing an offset calculation on the offset control point according to the offset distance, obtaining coordinate data of the second control point after the offset control point is offset, and generating an offset curve path.
[0065] like Figure 2 As shown, the base curve path is L0, and the offset distance is d. In step 103, the offset curve path L1 can be obtained according to the following formula (2):
[0066] L1=L0±d*n0 (2)
[0067] Where n0 is the normal vector of L0, x and y are the coordinate data of the offset control point on L0.
[0068] In this embodiment, L1 has a local self-intersection. In this case, step 103 can directly obtain the coordinates of the intersection point and delete the second control point corresponding to the intersection point, thereby further improving the quality of the offset curve path.
[0069] Step 104 , smoothing the offset curve path according to a preset minimum curvature radius to generate a corrected offset curve path.
[0070] Specifically, Figure 4 As shown, step 104 may include:
[0071] Step 401 , performing offset calculation on the second control point according to the minimum curvature radius, obtaining coordinate data of the third control point after the second control point is offset, and generating a curvature offset curve path.
[0072] like Figure 2 As shown, in this embodiment, the minimum curvature radius is set to r, and step 401 can obtain the curvature offset curve path L2 by the following formula (3):
[0073] L2=L0±(d+r)*n0 (3)
[0074] Where n0 is the normal vector of L0, x and y are the coordinate data of the offset control point on L0.
[0075] Step 402 , using a rapid rejection test and a straddle detection test, obtain the intersection coordinates from the curvature offset curve path.
[0076] In order to enable those skilled in the art to more clearly understand the technical solution provided by the embodiments of the present invention, the rapid rejection test and the straddle detection test are described in detail below.
[0077] 1. Rapid rejection test
[0078] Assume that two consecutive points on L1 i =(x i ,y i ), L1 i+1 =(x i+1 ,y i+1 ) constitutes line segment L1 i L1 i+1 , with L1 i L1 i+1 The diagonal lines form a rectangle R1.
[0079] Assume that two other consecutive points on L1 k =(x k ,y k ), L1 k+1 =(x k+1 ,y k+1 ) formed by the line segment L1 k L1 k+1 , with L1 k L1 k+1 The rectangle formed by the diagonal lines is R2.
[0080] Then the minimum boundary of the x coordinate of rectangle R1 is minx=min(x i , x i+1 ), maxx=max(x i , x i+1 ), the minimum boundary of the y coordinate of rectangle R1 is miny=min(y i ,y i+1 ), maxy=max(y i ,y i+1 ). Therefore, rectangle R1 can be expressed as R1 = (minR1x, minR1y, maxR1x, maxR1y). Similarly, rectangle R2 can be expressed as R2 = (minR2x, minR2y, maxR2x, maxR2y). If R1 intersects with R2, the intersection points form a new matrix R3, and rectangle R3 can be expressed as the following formula (4)
[0081]
[0082] When minR3X>maxR3X or minR3Y>maxR3Y, a rectangle cannot be formed, and it can be concluded that R1 and R2 do not intersect, so line segment L1 i L1 i+1 With line segment L1 k L1 k+1 Do not intersect, otherwise the two line segments may intersect. At this time, the intersection can be further determined through a straddle test.
[0083] 2. Straddle test
[0084]
[0085] When the product of A and B is greater than or equal to 0, it is called L1 i L1 i+1 Straddling L1 k L1 k+1 , the two line segments intersect.
[0086] The L2 intersection coordinates can be quickly obtained through the above rapid rejection test and straddle detection test.
[0087] Step 403, obtaining the coordinates of the tangent point on the offset curve path according to the intersection point coordinates.
[0088] Specifically, Figure 5 As shown, at point P on L2 i , P i+1 The line segment and point P k-1 , P k The formed line segments intersect at point o. According to point o, i P i+1 With line segment P k-1 P k The relative position on L1 can be deduced from P i P i+1 and P k-1 P k Tangent points t1, t2 on the line segment.
[0089] Step 404 , smoothing the offset curve path according to the tangent point coordinates to generate a corrected offset curve path.
[0090] like Figure 5 As shown, after obtaining the intersection point o and the tangent points t1 and t2 in step 403, step 404 can use the minimum curvature circle method to smooth L1 so that all points on L1 meet the curvature radius constraint, thereby generating a corrected offset curve path.
[0091] Through Figure 4According to the steps shown, the technical solution provided by the embodiment of the present invention can generate an offset curve path that meets the requirements of an actual complex environment according to the constraints of the actual environment on the maximum curvature.
[0092] Step 105 , smoothing the corrected offset curve path according to a preset maximum heading angle to generate a target offset curve path.
[0093] Specifically, Figure 6 As shown, step 105 may include:
[0094] Step 601, obtaining heading angle data of a second control point.
[0095] Step 602: If the heading angle is greater than the preset maximum heading angle, a Bezier curve is generated by interpolation, and the corrected offset curve path is smoothed to generate a target offset curve path.
[0096] In this embodiment, the expression of the k-order Bezier curve is as follows:
[0097]
[0098] Where u∈[0,1], (i=0,1,…k), L i To control the polygon vertices, B n,i (u) is the Bernstein polynomial, and then the deCasteljua algorithm is used to obtain the exact Bezier curve position. By using the parameter u, a segmentation point is selected on each edge of the feature polygon, and the segment ratio after segmentation is u:1-u. Then the point vector after the jth segmentation of the i-th edge is obtained as
[0099]
[0100]
[0101] According to the above execution process and the input point number k, k points are evenly selected to obtain the smoothed second control point set and generate the target offset curve path, such as Figure 7 shown.
[0102] Through Figure 6 According to the steps shown, the technical solution provided by the embodiment of the present invention can generate an offset curve path that meets the requirements of an actual complex environment according to the constraints of the actual environment on the maximum heading angle.
[0103] In actual use, if two points on the curve path are neither parallel nor intersecting along the normal direction, as the offset distance increases, the distance between the two points on the offset curve path will become smaller and smaller until they intersect along the normal direction, or the distance between the two points will become larger and larger. These two distribution methods are not suitable for actual tracking control of the curve path. In order to solve the above problems, Figure 8 As shown, another embodiment of the present invention also provides a method for generating a curved path. Figure 1 The method is basically the same as shown, except that after step 105, it further includes:
[0104] Step 106 , uniformly sample the target offset curve path, generate uniformly sampled fourth control points, and obtain the coordinates of the fourth control points.
[0105] Specifically, in this embodiment, step 106 may perform parametric spline interpolation on the target offset curve, and the points obtained by the interpolation are evenly distributed according to the chord length so that the distance between two adjacent points is constant.
[0106]
[0107]
[0108]
[0109] Then, the interpolation functions are calculated using the accumulated chord length as a variable to obtain the parametric spline curve x=x(s); y=y(s);
[0110] Then divide s into n points, and use the interpolation function to find the coordinates of the new n equally distributed control points.
[0111] Of course, the above are only specific examples. In actual use, there are more ways to implement step 106, and each case will not be described here one by one.
[0112] The curve path obtained by the method for generating a curve path provided by the embodiment of the present invention is as follows: Fig. 9 As shown, compared with the prior art, the present invention does not restrict the base curve path, and the base curve path can be in any form. The technical solution provided by the embodiment of the present invention can generate an offset curve path according to the coordinate data of the first control point on the base curve path and the offset distance, and process the offset curve path according to the pre-set path constraints - the minimum curvature radius and the maximum heading angle, to generate the final target offset curve path. It takes into account the influence of the path constraints on the offset curve path, and the error influence caused by the inaccurate base curve path, so that the target offset curve path generated according to the technical solution provided by the embodiment of the present invention can better meet the needs of the actual complex working environment, and the generated target offset curve path is of higher quality.
[0113] like Fig.10 As shown, an embodiment of the present invention further provides a device for generating a curved path, comprising:
[0114] A first acquisition module 1001 is used to acquire coordinate data of all first control points on the base curve path in a plane coordinate system;
[0115] The second acquisition module 1002 is used to acquire the offset control point from the first control point according to the coordinate data acquired by the first acquisition module 1001 and the preset offset distance:
[0116] A third acquisition module 1003 is used to perform an offset calculation on the deflectable control point acquired by the second acquisition module 1002 according to the offset distance, acquire coordinate data of the second control point after the deflectable control point is offset, and generate an offset curve path;
[0117] A first processing module 1004 is used to smooth the offset curve path generated by the third acquisition module 1003 according to a preset minimum curvature radius to generate a corrected offset curve path;
[0118] The second processing module 1005 is used to smooth the offset curve path corrected by the first processing module 1004 according to a preset maximum heading angle to generate a target offset curve path.
[0119] Furthermore, if Fig.11 As shown, the second acquisition module 1002 includes:
[0120] The first acquisition submodule 1101 is used to acquire the signed curvature K of the first control point according to the coordinate data of the first control point:
[0121]
[0122] Wherein, x and y are the coordinate data of the first control point;
[0123] The second acquisition submodule 1102 is used to remove the non-shiftable control point from the first control points if 1 / Ki<d and Ki*d>0, and acquire the shiftable control point, wherein Ki is the curvature of the i-th first control point and d is the shift distance.
[0124] Furthermore, if Fig.12 As shown, the first processing module 1004 includes:
[0125] A third acquisition submodule 1201 is used to perform an offset calculation on the second control point according to the minimum curvature radius, obtain coordinate data of the third control point after the second control point is offset, and generate a curvature offset curve path;
[0126] The fourth acquisition submodule 1202 is used to acquire the intersection coordinates from the curvature offset curve path acquired by the third acquisition submodule 1201 by using a rapid rejection test and a straddle detection test;
[0127] A fifth acquisition submodule 1203, configured to acquire the coordinates of the tangent point on the offset curve path according to the coordinates of the intersection point acquired by the fourth acquisition submodule 1202;
[0128] The first generating submodule 1204 is used to perform smoothing processing on the offset curve path according to the tangent point coordinates acquired by the fifth acquiring submodule 1203 to generate a corrected offset curve path.
[0129] Furthermore, if Fig.13 As shown, the second processing module 1005 includes:
[0130] A sixth acquisition submodule 1301 is used to acquire the heading angle data of the second control point;
[0131] The second generating submodule 1302 is used to generate a Bezier curve by interpolation if the heading angle obtained by the sixth obtaining submodule 1301 is greater than a preset maximum heading angle, and to smooth the corrected offset curve path to generate a target offset curve path.
[0132] Furthermore, if Fig.14 As shown, the device for generating a curved path provided by an embodiment of the present invention further includes:
[0133] The fourth acquisition module 1006 is used to uniformly sample the target offset curve path generated by the second processing module 1005, generate uniformly sampled fourth control points, and acquire the coordinates of the fourth control points.
[0134] The specific implementation method of the device for generating a curved path provided in the embodiment of the present invention can refer to the method for generating a curved path provided in the embodiment of the present invention, which will not be described in detail here.
[0135] Compared with the prior art, the present invention does not restrict the base curve path, and the base curve path can be in any form. The technical solution provided by the embodiment of the present invention can generate an offset curve path according to the coordinate data of the first control point on the base curve path and the offset distance, and process the offset curve path according to the pre-set path constraints - the minimum radius of curvature and the maximum heading angle, to generate the final target offset curve path. It takes into account the influence of the path constraints on the offset curve path and the error influence caused by the inaccurate base curve path, so that the target offset curve path generated according to the technical solution provided by the embodiment of the present invention can better meet the needs of the actual complex working environment, and the generated target offset curve path has higher quality.
[0136] The embodiment of the present invention also provides a system for generating a curved path, the system comprising: Figure 10-14 The device for generating a curve provided by the embodiment of the present invention is shown.
[0137] Compared with the prior art, the present invention does not restrict the base curve path, and the base curve path can be in any form. The technical solution provided by the embodiment of the present invention can generate an offset curve path according to the coordinate data of the first control point on the base curve path and the offset distance, and process the offset curve path according to the pre-set path constraints - the minimum radius of curvature and the maximum heading angle, to generate the final target offset curve path. It takes into account the influence of the path constraints on the offset curve path and the error influence caused by the inaccurate base curve path, so that the target offset curve path generated according to the technical solution provided by the embodiment of the present invention can better meet the needs of the actual complex working environment, and the generated target offset curve path has higher quality.
[0138] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.
Claims
1. A method for generating a curved path, characterized in that, comprising: Obtaining the coordinate data of all first control points on the base curved path in the plane coordinate system; According to the obtained coordinate data and a preset offset distance, obtaining offsettable control points from the first control points; Performing an offset calculation on the offsettable control points according to the offset distance to obtain the coordinate data of the second control points after the offset of the offsettable control points, and generating an offset curved path; Smoothing the offset curved path according to a preset minimum curvature radius to generate a corrected offset curved path; Smoothing the corrected offset curved path according to a preset maximum heading angle to generate a target offset curved path; Wherein, the obtaining of the offsettable control points from the first control points according to the preset offset distance and the coordinate data includes: Obtaining the signed curvature K of the first control point according to the coordinate data of the first control point: Wherein, x and y are the coordinate data of the first control point; If 1 / Ki < d and Ki * d > 0, it is an non-offsettable control point, removing the non-offsettable control point from the first control points to obtain offsettable control points, where Ki is the curvature of the i-th first control point and d is the offset distance; Wherein, the smoothing the offset curved path according to a preset minimum curvature radius to generate a corrected offset curved path includes: Performing an offset calculation on the second control point according to the minimum curvature radius to obtain the coordinate data of the third control point after the offset of the second control point, and generating a curvature offset curved path; Using a quick rejection test and a straddle detection test to obtain the intersection coordinates from the curvature offset curved path; Obtaining the tangent point coordinates on the offset curved path according to the intersection coordinates; Smoothing the offset curved path according to the tangent point coordinates to generate a corrected offset curved path; Wherein, the smoothing the corrected offset curved path according to a preset maximum heading angle to generate a target offset curved path includes: Obtaining the heading angle data of the second control point; If the heading angle is greater than the preset maximum heading angle, using interpolation to generate a Bezier curve to smooth the corrected offset curved path to generate a target offset curved path.
2. The method according to claim 1, characterized in that, further comprising: Performing uniform sampling on the target offset curved path to generate uniformly sampled fourth control points, and obtaining the coordinates of the fourth control points.
3. An apparatus for generating a curved path, characterized in that, comprising: A first obtaining module for obtaining the coordinate data of all first control points on the base curved path in the plane coordinate system; A second obtaining module for obtaining offsettable control points from the first control points according to the coordinate data obtained by the first obtaining module and a preset offset distance; A third acquisition module, configured to perform an offset calculation on the offsettable control points acquired by the second acquisition module according to the offset distance, acquire the coordinate data of the second control points after the offset of the offsettable control points, and generate an offset curve path; A first processing module, configured to smooth the offset curve path generated by the third acquisition module according to a preset minimum curvature radius, and generate a corrected offset curve path; A second processing module, configured to smooth the offset curve path corrected by the first processing module according to a preset maximum heading angle, and generate a target offset curve path; Wherein, the second acquisition module includes: A first acquisition sub-module, configured to acquire the curvature K of the first control point according to the coordinate data of the first control point: Wherein, x and y are the coordinate data of the first control point; A second acquisition sub-module, configured to, if 1 / Ki < d and Ki * d > 0, then it is a non-offsettable control point, remove the non-offsettable control point from the first control points, and acquire offsettable control points, where Ki is the curvature of the i-th first control point, and d is the offset distance; Wherein, the first processing module includes: A third acquisition sub-module, configured to perform an offset calculation on the second control point according to the minimum curvature radius, acquire the coordinate data of the third control points after the offset of the second control point, and generate a curvature offset curve path; A fourth acquisition sub-module, configured to use a rapid rejection test and a straddle detection test to acquire the intersection coordinates from the curvature offset curve path acquired by the third acquisition sub-module; A fifth acquisition sub-module, configured to acquire the tangent point coordinates on the offset curve path according to the intersection coordinates acquired by the fourth acquisition sub-module; A first generation sub-module, configured to smooth the offset curve path according to the tangent point coordinates acquired by the fifth acquisition sub-module, and generate a corrected offset curve path; Wherein, the second processing module includes: A sixth acquisition sub-module, configured to acquire the heading angle data of the second control point; A second generation sub-module, configured to, if the heading angle acquired by the sixth acquisition sub-module is greater than the preset maximum heading angle, use interpolation to generate a Bezier curve, and smooth the corrected offset curve path to generate a target offset curve path.
4. The device according to claim 3, wherein, it further includes: A fourth acquisition module, configured to uniformly sample the target offset curve path generated by the second processing module, generate uniformly sampled fourth control points, and acquire the coordinates of the fourth control points.
5. A system for generating a curve path, wherein, it includes the device for generating a curve path according to claim 3 or 4.
