A path generation method, electronic device and apparatus
By iteratively optimizing the coordinate information of control points in AGV path planning, an optimized path curve that satisfies precise constraints and smooth motion is generated, solving the problem of non-smooth path planning in existing technologies and improving the operational stability and positioning accuracy of AGVs.
Patent Information
- Application Number
- CN202611465008.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-20
- Publication Date
- 2026-11-03
AI Technical Summary
In existing technologies, the paths generated by AGV path planning methods cannot simultaneously meet the requirements of precise constraints on the necessary path points and continuous smooth motion, resulting in frequent acceleration and deceleration of the AGV and affecting positioning accuracy.
An initial path curve is generated based on the coordinate information of preset necessary points. The coordinate information of control points is then iteratively optimized using position constraints, obstacle avoidance constraints, and smoothness constraints to generate an optimized path curve, including a cubic quasi-uniform B-spline curve and random perturbation processing, to ensure the smoothness of the path and obstacle avoidance safety.
The generated optimized path curve satisfies the precise constraints and continuous smooth motion of the specified path points, improving the operational stability and positioning accuracy of the AGV, avoiding sharp turns and collisions, and ensuring the accuracy and real-time performance of path planning.
Smart Images

Figure CN123028610A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of path planning technology, and in particular to a path generation method, electronic device, and apparatus. Background Technology
[0002] Automated Guided Vehicles (AGVs) are widely used in modern industrial production. During navigation, AGVs need to travel from a starting point to a destination along a planned path. During this journey, AGVs must avoid obstacles to ensure safe operation.
[0003] The path planning methods provided in related technologies typically employ A Alternatively, the RRT algorithm may generate paths with sharp turns and broken lines, which do not conform to the kinematic characteristics of AGVs. This leads to frequent acceleration and deceleration of the AGV, resulting in large movement errors and even affecting positioning accuracy.
[0004] In related technologies, B-splines can be used to smooth the generated path to obtain a smoother path, but there is still a problem that cannot simultaneously meet the requirements of precise constraints on the specified path points and continuous smooth motion. Summary of the Invention
[0005] This invention provides a path generation method, electronic device, and apparatus to solve the problem that existing technologies cannot simultaneously satisfy the requirements of precise constraints on the specified path points and continuous smooth motion.
[0006] Firstly, this application provides a path generation method, which includes: Based on the coordinate information of the preset necessary points, the coordinate information of the intermediate control points is determined, wherein the necessary points include the starting point, the intermediate points, and the ending point; Based on the coordinate information of the intermediate control points and the coordinate information of the necessary points, an initial path curve is generated; Based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints, the coordinate information of control points on the initial path curve is iteratively optimized to generate optimized coordinate information of control points, wherein the control points include waypoints and intermediate control points; After generating the optimized path curve based on the optimized control point coordinate information, the generated optimized path curve is used as the planned path.
[0007] In one possible implementation, the position constraint loss function in the position constraint is obtained based on the coordinate information of each necessary point and the initial path curve; the obstacle avoidance constraint loss function in the obstacle avoidance constraint is generated based on the safety distance threshold, the distance between the discretized sampling point on the initial path curve and the nearest obstacle; the smoothing constraint loss function in the smoothing constraint is generated based on the included angle between adjacent control point line segments and the length of adjacent control point line segments, wherein the control point line segment is the line segment between two adjacent control points.
[0008] In one possible implementation, the iterative optimization of the coordinate information of the intermediate control point based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints to generate optimized coordinate information of the control point includes: Based on the three of the aforementioned position constraints, obstacle avoidance constraints, and smoothness constraints, the coordinate information of the intermediate control point is iteratively optimized to generate optimized coordinate information of the intermediate control point.
[0009] In one possible implementation, determining the coordinate information of intermediate control points based on preset necessary point coordinate information includes: For each path segment on the preset running trajectory, the coordinate information of each intermediate control point on the path segment is calculated based on the coordinate information of the two necessary points constituting the path segment and the number of intermediate control points to be inserted on the path segment.
[0010] In one possible implementation, the first [value] on the path segment is calculated based on the following formula. j Coordinate information of the intermediate control points:
[0011] in, For the path segment, the first j Coordinate information of the intermediate control points The coordinates of the first necessary point along the path segment. The coordinates of the second necessary point along the path segment. For the first segment of the path j One intermediate control point This represents the number of intermediate control points to be inserted on the path segment. lie in and Between the two endpoints.
[0012] In one possible implementation, after obtaining the coordinate information of the intermediate control point and before generating the initial path curve, the method further includes: Calculate the unit tangent vectors corresponding to several of the aforementioned path segments; Based on the unit tangent vector, calculate the unit normal vectors of several path segments; For a number of path segments, the coordinate information of the intermediate control points on the path segments is updated based on the random disturbance, the coordinate information of the intermediate control points on the path segments, and the unit normal vector corresponding to the path segments.
[0013] In one possible implementation, the path segment is updated based on the following formula: j Coordinate information of the intermediate control points:
[0014] in, For the updated number j Coordinate information of the intermediate control points Let be the unit normal vector. It represents a random disturbance.
[0015] In one possible implementation, the initial path curve is a cubic quasi-uniform B-spline curve.
[0016] In one possible implementation, the position constraint loss function is obtained by performing cubic quasi-uniform B-splines based on the coordinate information of each necessary point.
[0017] In one possible implementation, the position constraint loss function is expressed by the following formula:
[0018] in, Here, c represents the position constraint loss function value, and c is the index of the current must-see point. The time parameter corresponding to the c-th necessary point. For a cubic quasi-uniform B-spline curve in terms of time parameter Coordinate information at the location, For the first c The coordinates of each necessary point are given, where M is the number of necessary points.
[0019] In one possible implementation, the method further includes: From the intermediate control points on the cubic quasi-uniform B-spline curve, determine the target intermediate control point that has the greatest impact on the position constraint, and update the coordinate information of the target intermediate control point based on the coordinate offset corresponding to the target intermediate control point.
[0020] In one possible implementation, determining the target intermediate control point that has the greatest impact on the position constraints from the intermediate control points on the cubic quasi-uniform B-spline curve includes: Based on the time parameters corresponding to each necessary point on the cubic quasi-uniform B-spline curve, calculate the basis function value of each intermediate control point; The intermediate control point with the largest basis function value is taken as the target intermediate control point; The step of updating the coordinate information of the target intermediate control point based on the coordinate offset corresponding to the target intermediate control point includes: Based on the coordinate information of the necessary points, the coordinate information of the cubic quasi-uniform B-spline curve at the time parameter, and the preset constraint strength, the coordinate offset of the target intermediate control point is calculated. The sum of the current coordinates of the target intermediate control point and the coordinate offset is used as the updated coordinates of the target intermediate control point.
[0021] In one possible implementation, the target control point is determined using the following formula:
[0022] in, is the index of the intermediate control point with the largest basis function value, which is also the index of the target intermediate control point, and n is the total number of intermediate control points. The time parameter corresponding to the current necessary path point; The coordinate information of the intermediate control points of the target is updated using the following formula:
[0023] in, This represents the coordinate offset of the target's intermediate control point. Indicates the current necessary point The sequence number of the intermediate control point with the greatest impact. Indicates the first The intermediate control points are between parameters. The basis function values at that point, This represents the curve parameters corresponding to the current essential point. This indicates the coordinates of the currently necessary point. This indicates that on a cubic quasi-uniform B-spline curve, the time parameter... Coordinate information at the location, This indicates the preset constraint strength coefficient.
[0024] In one possible implementation, when the current necessary point is a start point or an end point, Take 2.0, when the current necessary point is a waypoint. Take 1.5.
[0025] In one possible implementation, the method further includes: Adaptive discretization sampling is performed on the cubic quasi-uniform B-spline curve to obtain multiple sampling points; Identify the obstacles corresponding to each sampling point; For each sampling point, the distance between the sampling point and its corresponding obstacle is determined. If the distance is less than a preset safe distance threshold, the sampling point is determined to be a collision point.
[0026] In one possible implementation, the method further includes: For each collision point, calculate the obstacle avoidance update vector of the collision point and its corresponding obstacle, determine the target control point that has the greatest impact on the collision point, and add the obstacle avoidance update vector to the coordinate information of the target control point to obtain the updated coordinate information of the target control point.
[0027] In one possible implementation, the obstacle avoidance update vector is computed as follows: For all obstacles near the collision point, calculate the weighted components along the "obstacle → collision point" direction and then average them to obtain the obstacle avoidance update vector.
[0028] In one possible implementation, the target control point that has the greatest influence on the collision point is determined in the following way: Based on the inverse geometric distance ratio, determine the control point closest to the collision point; The control point closest to the collision point is selected as the target control point that has the greatest impact on the collision point.
[0029] In one possible implementation, the control points participating in the iterative update are control points other than the start and end points; for each collision point, the target control point with the greatest impact on the collision point is determined from the control points other than the start and end points, and the obstacle avoidance update vector corresponding to the collision point is accumulated into the coordinate information of the target control point, so that the iteratively updated path curve is far away from the obstacle corresponding to the collision point.
[0030] In one possible implementation, the vector is updated smoothly by accumulating the included angle error component and the length error component in the following way: For each control point except the start and end points : The angle error component is max(0,C1-cosθi)×N( ), where N( )for The unit normal vector obtained by rotating the unit vector counterclockwise by 90°. for With control points The first vector of the line segment between; The length error component is [|‖ ‖-‖ || / max(||) ‖,‖ ||)]×( - ),in, for and The second vector of the line segment between them. , These are the coordinate information of the corresponding control points; The control point is obtained by multiplying the included angle error component and the length error component by the weights corresponding to the smoothing constraints, respectively. Smoothly update the vector.
[0031] In one possible implementation, the method further includes: The coordinate information of the target control point with the greatest impact on obstacle avoidance is iteratively updated; wherein, each iteration updates the coordinate information of the target control point based on the corresponding obstacle avoidance update vector, and updates the path curve based on the updated coordinate information of the target control point; the termination condition of the iteration update is that there are no collision points on the updated path curve or the number of iterations reaches the preset first iteration number.
[0032] In one possible implementation, an obstacle avoidance constraint loss function is generated based on a safety distance threshold, the distance between the discretized sampling point on the cubic quasi-uniform B-spline curve and the nearest obstacle, and the cubic quasi-uniform B-spline curve itself.
[0033] In one possible implementation, the obstacle avoidance constraint loss function is expressed by the following formula:
[0034] in, The loss function value represents the obstacle avoidance constraint, and m is the number of sampling points obtained after adaptive discretization of the cubic quasi-uniform B-spline curve. This represents the adaptive discretized coordinate information of the m-th sampling point on a cubic quasi-uniform B-spline curve. Let m be the distance between the adaptively discretized coordinates of the m-th sampling point and the nearest obstacle. This is the safe distance threshold.
[0035] In one possible implementation, the initial path curve is adjusted by balancing its included angle and length to provide a smooth constraint.
[0036] In one possible implementation, the included angle is... The angle between the (i-1)th control point line segment and the ith control point line segment is the common endpoint. The length includes the length of the (i-1)th control point line segment and the length of the ith control point line segment.
[0037] In one possible implementation, the smoothing constraint loss function is expressed by the following formula:
[0038] in, To smooth the value of the constraint loss function, i The control point number has a range of values. i =1, 2, 3, 4……q-2, the (i-1)th control point line segment is the control point. With control points The line segments between the control points, the i-th control point line segment is the control point. With control points The line segments between, The first quasi-uniform B-spline curve on a cubic curve i -1 control point line segment and the first i The included angle between the control point line segments, L i-1 Let be the length of the (i-1)th control point line segment. L i Let q be the length of the line segment of the i-th control point, q be the number of control points on the cubic quasi-uniform B-spline curve, and C1 be a value greater than or equal to -1 and less than or equal to 1.
[0039] In one possible implementation, the following formula is used for calculation. :
[0040] in, for With control points The first vector of the line segment between them. for and The second vector of the line segment between them. , , These are the coordinate information of the corresponding control points; Calculate the number using the following formula. i Length of the control point line segment:
[0041] Calculate the number using the following formula. Length of the control point line segment:
[0042] In one possible implementation, the method further includes: For each control point, the vector is updated smoothly by accumulating the included angle error component and the length error component; The sum of the obstacle avoidance update vector and the smooth update vector is used as the comprehensive update vector.
[0043] In one possible implementation, the coordinate information of the control points is iteratively updated; wherein, each iteration updates the coordinate information of the control points based on a comprehensive update vector, and updates the path curve based on the updated coordinate information of the control points, wherein the comprehensive update vector is the sum of the obstacle avoidance update vector and the smoothing update vector; the termination condition of the iterative update is that there are no collision points on the updated path curve, or the number of iterations reaches a preset second iteration number.
[0044] In one possible implementation, the method further includes: For each control point, the coordinate information of the control point is updated based on the coordinate information of the control point obtained in the previous iteration, the learning rate corresponding to the current iteration, and the comprehensive update vector.
[0045] In one possible implementation, the coordinate information of the control points is updated based on the following formula:
[0046] in, The control point corresponding to the (k+1)th iteration Coordinate information, The control point corresponding to the k-th iteration Coordinate information, Let k be the learning rate corresponding to the k-th iteration. This is the comprehensive update vector obtained in the k-th iteration.
[0047] In one possible implementation, the method further includes: Determine whether the number of collision points has not decreased in two consecutive iterations. This means that the number of collision points in the current iteration is not less than the number of collision points in the previous iteration, and the number of collision points in the previous iteration is not less than the number of collision points in the iteration before that. If so, the product of the current learning rate and the decay coefficient is used as the learning rate for the next iteration. Otherwise, the current learning rate is used as the learning rate for the next iteration.
[0048] Secondly, this application also provides an electronic device, comprising: Memory, used to store program instructions; The processor is configured to invoke the program instructions stored in the memory and execute the following steps according to the obtained program: Based on the coordinate information of the preset necessary points, the coordinate information of the intermediate control points is determined, wherein the necessary points include the starting point, the intermediate points, and the ending point; Based on the coordinate information of the intermediate control points and the coordinate information of the necessary points, an initial path curve is generated; Based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints, the coordinate information of control points on the initial path curve is iteratively optimized to generate optimized coordinate information of control points, wherein the control points include waypoints and intermediate control points; After generating the optimized path curve based on the optimized control point coordinate information, the generated optimized path curve is used as the planned path.
[0049] Thirdly, this application also provides a path generation apparatus, comprising: The determination module is used to determine the coordinate information of intermediate control points based on the preset coordinate information of necessary points, wherein the necessary points include the starting point, the intermediate points, and the ending point; The generation module is used to generate an initial path curve based on the coordinate information of the intermediate control points and the coordinate information of the necessary points; iteratively optimize the coordinate information of the control points on the initial path curve based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints to generate optimized coordinate information of the control points, wherein the control points include waypoints and intermediate control points; after generating the optimized path curve according to the optimized control point coordinate information, the generated optimized path curve is used as the planned path.
[0050] The beneficial effects of this invention are as follows: The path generation method, electronic device, and apparatus provided in this application include: first, obtaining the coordinate information of intermediate control points based on the coordinate information of preset necessary points; then, generating an initial path curve based on the coordinate information of the intermediate control points and the coordinate information of the necessary points; next, iteratively optimizing the coordinate information of the control points on the initial path curve based on at least one of position constraints, obstacle avoidance constraints, and smoothing constraints to generate optimized coordinate information of the control points; and finally, generating an optimized path based on the optimized coordinate information of the control points, using the generated optimized path as the planned path. The necessary points include a starting point, a waypoint, and an ending point, and the control points include intermediate control points and waypoints. Because the coordinate information of the control points on the initial path curve is iteratively optimized based on at least one of position constraints, obstacle avoidance constraints, and smoothing constraints after obtaining the initial path curve, and the final optimized path curve is obtained based on the optimized coordinate information, the final optimized path curve can satisfy the precise constraints of necessary points on the specified path and the continuous smoothness of the path, thereby improving the reliability of the path curve.
[0051] Furthermore, this application can generate a cubic quasi-uniform B-spline curve using the given information on necessary points and obstacle locations, due to its mathematical advantages. Continuity (curvature continuity) ensures the smoothness of the path, eliminating the abrupt curvature changes in traditional polyline paths. A curvature penalty term is introduced in gradient optimization, which applies when the angle between adjacent line segments... When the value is too large, a penalty is applied, combined with a length error penalty term, to avoid unnecessary sharp turns. A perturbation is added during control point initialization, introducing a random offset perpendicular to the path to prevent sharp corners in the initial path. Collision point detection uses quadtree space partitioning to accelerate queries. An adaptive learning rate based on changes in the number of collision points is adopted to avoid oscillations during iteration and accelerate convergence. The generated path ensures smoothness, obstacle avoidance safety, and mandatory pathpoint constraints, improving the operational stability and positioning accuracy of the automated guided vehicle. Through a visual interface, users can drag and drop control points to adjust the path, ensuring the accuracy and real-time performance of path planning. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0053] Figure 1 A flowchart illustrating a path generation method provided in an embodiment of this application; Figure 2A schematic diagram of a necessary point provided for an embodiment of this application; Figure 3 A schematic diagram of a necessary point and intermediate control point provided for an embodiment of this application; Figure 4 A schematic diagram of the necessary points and intermediate control points after adding disturbance, provided for an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application; Figure 6 This is a schematic diagram of a path generation device provided in an embodiment of this application. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0055] To meet the requirements of precise constraints and continuous smooth motion for specified path points, embodiments of this application provide a path generation method, electronic device, and apparatus. The path generation method, electronic device, and apparatus provided in this application will be described in detail below with reference to the accompanying drawings.
[0056] like Figure 1 The image shows a path generation method provided in an embodiment of this application. The method includes the following steps: S101. Based on the preset coordinate information of necessary points, determine the coordinate information of intermediate control points, wherein the necessary points include the starting point, the intermediate points, and the ending point; S102. Generate an initial path curve based on the coordinate information of the intermediate control point and the coordinate information of the necessary points. S103. Based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints, iteratively optimize the coordinate information of control points on the initial path curve to generate optimized coordinate information of control points, wherein the control points include intermediate control points and waypoints. S104. After generating the optimized path curve based on the optimized coordinate information, the generated optimized path curve is used as the planned path.
[0057] The path generation method provided in this application first obtains the coordinate information of intermediate control points based on the coordinate information of preset necessary points. Then, based on the coordinate information of the intermediate control points and the coordinate information of necessary points, an initial path curve is generated. Next, based on at least one of position constraints, obstacle avoidance constraints, and smoothing constraints, the coordinate information of control points on the initial path curve is iteratively optimized to generate optimized coordinate information of the control points. Finally, an optimized path is generated based on the optimized coordinate information of the control points, and the generated optimized path is used as the planned path. Necessary points include a start point, a waypoint, and an end point, and control points include intermediate control points and waypoints. Because the coordinate information of control points on the initial path curve is iteratively optimized based on at least one of position constraints, obstacle avoidance constraints, and smoothing constraints after obtaining the initial path curve, the final optimized path curve is obtained based on the optimized coordinate information. Therefore, the final optimized path curve can satisfy the precise constraints of necessary points on the specified path and the continuous smoothness of the path, thereby improving the reliability of the path curve.
[0058] In this embodiment, the coordinate information of intermediate control points is first generated based on the preset coordinate information of the starting point, the coordinate information of the ending point, and the coordinate information of the waypoints.
[0059] Specifically, for each path segment on the preset running trajectory, based on the coordinate information of the two essential points constituting the path segment and the number of intermediate control points to be inserted on the path segment, the coordinate information of each intermediate control point on the path segment is calculated. That is, at least one intermediate control point is set on the path segment between two adjacent essential points. When multiple intermediate control points are set, they can be evenly distributed.
[0060] In one embodiment, the first line segment on the path is calculated based on the following formula 1. j Coordinate information of the intermediate control points: Formula 1 in, For the first line segment on the path j Coordinate information of the intermediate control points This provides the coordinates of the first necessary point along the path segment. This provides the coordinates of the second necessary point along the path segment. For the first segment of the path j The serial number of each intermediate control point. This represents the number of intermediate control points to be inserted on the path segment. lie in and Between the two endpoints.
[0061] For example, refer to Figure 2The coordinates of the starting point on the preset running trajectory are: The coordinates of the destination are The coordinates of the waypoints are ,in, i =1,2,3,4. That is to say Figure 2 The preset running trajectory shown includes 6 essential points and 5 path segments. The 5 path segments are: starting point... With the first waypoint Path segments between The first waypoint With the second waypoint Path segments between The second waypoint With the third waypoint Path segments between The third waypoint With the fourth waypoint Path segments between The fourth waypoint and the finish line Path segments between .
[0062] If three intermediate control points are added to each path segment, then Formula 1 is used to calculate the coordinate information of each intermediate control point on each path segment. For example, Figure 3 In the middle, Formula 1 is used to calculate the path segments respectively. The coordinate information of the three intermediate control points and the path segments. The coordinate information of the three intermediate control points and the path segments. The coordinates of the three intermediate control points and the path segments The coordinate information of the three intermediate control points.
[0063] After calculating the coordinates of each intermediate control point on each path segment, random disturbances perpendicular to the path direction can be introduced to avoid local optima while ensuring that intermediate control points are not too concentrated.
[0064] Specifically, after obtaining the coordinate information of the intermediate control points, before generating the initial path curve, the unit tangent vectors corresponding to several path segments are calculated first. Then, based on the unit tangent vectors, the unit normal vectors of several path segments are calculated. Finally, for several path segments, the coordinate information of the intermediate control points on the path segments is updated based on the random disturbance, the coordinate information of the intermediate control points on the path segments, and the unit normal vectors corresponding to the path segments.
[0065] That is, for each path segment, first calculate the unit tangent vector corresponding to the path segment, then calculate the unit normal vector of the path segment based on the unit tangent vector, and finally update the coordinate information of each intermediate control point on the path segment based on the random disturbance, the coordinate information of the intermediate control point on the path segment, and the unit normal vector corresponding to the path segment.
[0066] In one embodiment, the unit tangent vector for each path segment can be calculated according to the following formula 2: Formula 2 in, T For path segments P k P k+1 The unit tangent vector, P k For path segments P k P k+1 The coordinate information of the first endpoint, P k+1 For path segments P k P k+1 The coordinate information of the second endpoint.
[0067] After calculating the unit tangent vector of the path segment, the unit normal vector of the path segment is calculated using the following formula 3: Formula 3 in, N For path segments P k P k+1 The unit normal vector, for T The component in the horizontal direction, for T The component in the vertical direction.
[0068] In other words, if the unit tangent vector of the path segment is Then, rotating it counterclockwise by 90° gives us the unit normal vector. Its function is to introduce random disturbances perpendicular to the path direction when generating the coordinate information of intermediate control points.
[0069] The unit normal vector of the path segment was calculated. N Then, based on the random disturbance Δ and the calculated unit normal vector NThe coordinate information of the intermediate control points on the path segment is updated by randomly perturbing the coordinate information of each intermediate control point on the path segment to obtain the coordinate information of the intermediate control points after perturbation. Specifically, the updated coordinate information of the intermediate control points can be obtained by referring to the following formula 4, that is, the coordinate information of the intermediate control points after perturbation is: Formula 4 in, For the first j The updated initial coordinate information of the intermediate control points. It represents a random disturbance.
[0070] random disturbance It can be calculated using the following formula 5: Formula 5 in, A random number within the interval [0, 1] This represents the length of the path segment.
[0071] In this embodiment, the length of the path segment is calculated from the coordinate information of the two endpoints of the path segment. For example, the path segment... The length is determined by the necessary point Coordinate information and necessary points The coordinate information is calculated.
[0072] In this embodiment of the application, firstly, in the path segment... The above determines the first j Coordinate information of each intermediate control point Then along the path segment unit normal vector The direction is offset by a small distance , obtained the j The updated coordinate information of each intermediate control point. That is, intermediate control points are evenly set on each path segment between the start and end points, and random perturbations perpendicular to the path direction are introduced to avoid local optima, while ensuring that the intermediate control points on the path segments are not too concentrated.
[0073] like Figure 4 The diagram shown is a schematic of a necessary point and intermediate control point after adding a disturbance, provided in an embodiment of this application.
[0074] After obtaining the coordinate information of the intermediate control points on the path segments of two adjacent necessary points, an initial path curve is generated based on the coordinate information of the necessary points and the coordinate information of the intermediate control points.
[0075] In one embodiment, the initial path curve can be a cubic quasi-uniform B-spline curve. Cubic quasi-uniform B-spline curves possess second-derivative continuity, meaning that positional continuity, tangent continuity, and curvature continuity are simultaneously guaranteed at the junctions of segments, making them highly suitable for generating smooth motion trajectories.
[0076] To further ensure the curve passes through a predetermined start and end point, a quasi-uniform node vector U with repeated endpoints is constructed to define the parameter range of the curve. For a quasi-uniform B-spline of degree k=3, the node vector generation rules are as follows: Start node: The first k+1 nodes are repeatedly set to 0, that is, u0=u1=u2=u3=0, that is, the curve starts near the first control point (start point); Intermediate nodes: uniformly distributed within the interval (0,1), calculated using the following formula: ,in, i =k+1, ...,n-1, where n is the number of control points to ensure the uniformity of the parameterization process. The number of control points is the total number of necessary points and intermediate control points. End node: The last 4 nodes are repeatedly set to 1, i.e. ,in, .
[0077] After the node vectors are determined, the De Boer recursive algorithm is used to calculate the basis functions. The recursive process starts from the zeroth-order basis function, referring to the following formula 6: Formula 6 That is, each zero-degree basis function takes the value 1 only within the corresponding node interval, and 0 otherwise.
[0078] For higher-order basis functions, they are obtained recursively through a linear combination of lower-order basis functions, as shown in Formula 7 below: Formula 7 Formula 6 is used to derive Formula 7. The essence of this recursive formula is to perform weighted interpolation on two adjacent low-order basis functions, thereby constructing higher-order basis functions layer by layer.
[0079] Since the cubic quasi-uniform B-spline curve is used in the embodiments of this application, k=3 in Formula 7, and the higher-order basis function is expressed by the following Formula 8: Formula 8 Based on the coordinate information of the control points and Formula 8, the cubic quasi-uniform B-spline curve function is obtained, as shown in Formula 9: Formula 9 in, For parameters t The coordinate information of the corresponding curve points, For the coordinate information of the control points, i =0, 1, 2...q-1, where q is the total number of necessary points and intermediate control points.
[0080] The cubic quasi-uniform B-spline curve function shown in Formula 9 represents any time parameter on the curve. t curve points Can be controlled by all control points The result is obtained by weighted summation of the corresponding cubic basis function values.
[0081] In this embodiment, the coordinate information of the control point includes the coordinate information of the necessary points and the coordinate information of intermediate control points.
[0082] A cubic quasi-uniform B-spline curve function was obtained, which is equivalent to obtaining a cubic quasi-uniform B-spline curve. After obtaining the cubic quasi-uniform B-spline curve, at least one of the position constraints, obstacle avoidance constraints, and smoothing constraints was used to iteratively optimize the coordinate information of the path points and intermediate control points on the cubic quasi-uniform B-spline curve, generating optimized coordinate information of the path points and optimized coordinate information of the intermediate control points.
[0083] Furthermore, after obtaining the cubic quasi-uniform B-spline curve, three of the following constraints—position constraint, obstacle avoidance constraint, and smoothing constraint—are used to iteratively optimize the coordinate information of the path points and intermediate control points on the cubic quasi-uniform B-spline curve, generating optimized coordinate information of the path points and intermediate control points.
[0084] The position constraints will be explained in detail below.
[0085] The position constraint loss function in position constraints is derived based on the coordinate information of each necessary point and the initial path curve. If the initial path curve is a cubic quasi-uniform B-spline curve, then the position constraint loss function is derived based on the coordinate information of the necessary points and the cubic quasi-uniform B-spline curve.
[0086] The position constraint loss function can be expressed by the following formula 10: Formula 10 in, The value of the position constraint loss function. c The sequence number of the current necessary point. For the first c The time parameters corresponding to each necessary point For a cubic quasi-uniform B-spline curve in terms of time parameter Coordinate information at the location, For the first c Coordinate information of a necessary point. M The number of necessary points.
[0087] In the location loss function For the time parameters corresponding to each necessary point, for example, This refers to the time parameter corresponding to the first necessary point (starting point). The time parameter value corresponding to the second necessary point. For the time parameter corresponding to the third necessary point, ... This is the time parameter corresponding to the last necessary point (end point).
[0088] In specific implementation, the time parameter corresponding to each necessary point can be determined by the chord length parameterization method. Of course, other methods can also be used to determine the time parameter corresponding to each necessary point. This application embodiment does not limit this.
[0089] It should be noted that the position constraint loss function can be obtained based on the coordinate information of each necessary point and the cubic quasi-uniform B-spline curve, and it can also be obtained based on the coordinate information of each path point and the cubic quasi-uniform B-spline curve.
[0090] For example, such as Figure 3 As shown, if the location constraint loss function is obtained based on the coordinate information of each necessary point and a cubic quasi-uniform B-spline curve, then for each necessary point (starting point P)... start End point P end , route point P way,1 , route point P way,2 , route point P way,3 and the route point P way,4 Assign time parameters, and then calculate the position constraint loss function value, E, according to Formula 10. pos = ; in, The cubic quasi-uniform B-spline curve calculated based on Formula 9 has the following time parameter. The location, The cubic quasi-uniform B-spline curve calculated based on Formula 9 has the following time parameter. The location, The cubic quasi-uniform B-spline curve calculated based on Formula 9 has the following time parameter. The location, The cubic quasi-uniform B-spline curve calculated based on Formula 9 has the following time parameter. The location, The cubic quasi-uniform B-spline curve calculated based on Formula 9 has the following time parameter. The location, The cubic quasi-uniform B-spline curve calculated based on Formula 9 has the following time parameter. The location; Time value To be related to the starting point P start Corresponding time parameters, time parameters For the first point P way,1 Corresponding time parameters, time parameters For the second waypoint P way,2 Corresponding time parameters, time parameters For the third waypoint P way,3 Corresponding time parameters, time parameters To connect with the fourth transit point P way,4 Corresponding time parameters, time parameters To reach the endpoint P end The corresponding time parameters; Starting point P start Coordinate information, Let P be the first point of passage. way,1 Coordinate information, For the second waypoint P way,2 Coordinate information, The third waypoint P way,3 Coordinate information, The fourth waypoint P way,4 Coordinate information, End point P end Coordinate information.
[0091] For example, such as Figure 3 As shown, if the position constraint loss function is obtained based on the coordinate information of each waypoint and a cubic quasi-uniform B-spline curve, then for each waypoint (waypoint P)... way,1 , route point P way,2 , route point P way,3 and the route point P way,4 Assign time parameters, and then calculate the position constraint loss function value, E, according to Formula 10. pos = ; in, The cubic quasi-uniform B-spline curve calculated based on Formula 9 has the following time parameter. The location, The cubic quasi-uniform B-spline curve calculated based on Formula 9 has the following time parameter. The location, The cubic quasi-uniform B-spline curve calculated based on Formula 9 has the following time parameter. The location, The cubic quasi-uniform B-spline curve calculated based on Formula 9 has the following time parameter. The location, The cubic quasi-uniform B-spline curve calculated based on Formula 9 has the following time parameter. The location; Time parameters For the first point P way,1 Corresponding time parameters, time parameters For the second waypoint P way,2 Corresponding time parameters, time parameters For the third waypoint P way,3 Corresponding time parameters, time parameters To connect with the fourth transit point P way,4 The corresponding time parameters; Let P be the first point of passage. way,1 Coordinate information, For the second waypoint P way,2 Coordinate information, The third waypoint P way,3 Coordinate information, The fourth waypoint P way,4 Coordinate information.
[0092] In each position constraint iteration, the position constraint loss function value of this iteration is calculated. The calculated position constraint loss function value is compared with the preset position constraint loss function value. If the calculated position constraint loss function value is greater than the preset position constraint loss function value, then for each necessary point, the target intermediate control point with the greatest impact on the position constraint is determined from the intermediate control points. The coordinate offset corresponding to the target intermediate control point is calculated. Based on the coordinate offset corresponding to the target intermediate control point, the coordinate information of the target intermediate control point is updated.
[0093] Specifically, in this position constraint iteration, each necessary point is traversed. Based on the time parameter corresponding to the current necessary point, the basis function value of each intermediate control point is calculated. Then, the intermediate control point with the largest basis function value is taken as the target intermediate control point corresponding to the current necessary point. Next, based on the preset constraint strength, the coordinate information of the current necessary point, and the time parameter corresponding to the current necessary point, the coordinate offset of the target intermediate control point is calculated. Finally, the sum of the current coordinate information and the coordinate offset of the target intermediate control point is used as the updated coordinate information of the target intermediate control point.
[0094] In one embodiment, the basis function value of each intermediate control point is calculated based on Formula 8, and the intermediate control point corresponding to the largest basis function value among the calculated basis function values is taken as the target intermediate control point.
[0095] For example, refer to Figure 4 , Figure 4It includes 15 intermediate control points, targeting the first waypoint P. way,1 Based on Formula 8, the basis function values of 15 intermediate control points are calculated. When calculating the basis function values of intermediate control points, the time parameter t is the same as that of the first transit point P. way,1 The corresponding time parameters. After calculating 15 basis function values, determine the largest basis function value from these 15 values. If the intermediate control point corresponding to the largest basis function value is... Figure 4 If the intermediate control point is numbered 5, then the intermediate control point with the sequence number 5 will be used as the first waypoint P. way,1 The corresponding intermediate control point of the target.
[0096] In practice, to save computing resources, when calculating the basis function values of intermediate control points, the basis function values of some intermediate control points can be calculated. For example, the basis function values of a preset number of intermediate control points can be calculated. The preset number is a positive integer greater than or equal to 2 and less than the total number of intermediate control points. The preset number of intermediate control points are the first preset number of intermediate control points in the sorted order of the distance between the intermediate control point and the current necessary point from smallest to largest.
[0097] For example, the preset quantity is 4, refer to Figure 4 For the first path point P way,1 The four intermediate control points are intermediate control point 2, intermediate control point 3, intermediate control point 4, and intermediate control point 5. The basis function value of each of the four intermediate control points is calculated based on Formula 8. When calculating the basis function value of the intermediate control points, the time parameter t is related to the first transit point P. way,1 The corresponding time parameters. After calculating the four basis function values, determine the largest basis function value from the four. If the intermediate control point corresponding to the largest basis function value is... Figure 4 If the intermediate control point is numbered 5, then the intermediate control point with the sequence number 5 will be used as the first waypoint P. way,1 The corresponding intermediate control point of the target.
[0098] The intermediate control point with the largest basis function value is also the intermediate control point that has the greatest impact on the position constraints. Specifically, the target intermediate control point is determined using the following formula 11: Formula 11 in, is the index of the intermediate control point with the largest basis function value, which is also the index of the target intermediate control point, and n is the total number of intermediate control points. This is the time parameter corresponding to the current necessary transit point.
[0099] for example, Figure 4In this process, 15 intermediate control points are numbered, starting from the intermediate control point closest to the starting point and ending at the intermediate control point farthest from the starting point.
[0100] After determining the sequence number of the intermediate control point of the target, the coordinate offset of the intermediate control point of the target is determined, that is... The coordinate offset of the intermediate control point of the target is calculated using the following formula 12: Formula 12 in, This represents the coordinate offset of the target's intermediate control point. Indicates the current necessary point The sequence number of the intermediate control point with the greatest impact is determined by taking the maximum value of the basis function. Indicates the first Intermediate control points in time parameters The basis function values at the point (i.e., the direction of the partial derivative of the position error with respect to the control point). This represents the time parameter corresponding to the current necessary point. This indicates the coordinates of the currently necessary point. This indicates that on a cubic quasi-uniform B-spline curve, the time parameter... Coordinate information at the location, This represents the preset constraint strength coefficient, which is 2.0 at the start and end points and 1.5 at the path points.
[0101] After calculating the coordinate offset of the target intermediate control point using Formula 12, the sum of the current coordinate information of the target intermediate control point and the coordinate offset is used as the updated coordinate information of the target intermediate control point.
[0102] After updating the coordinate information of each intermediate control point of the target in this iteration, return to the step of calculating the position constraint loss function value based on formula 10, until the calculated position constraint loss function value is less than the preset position constraint loss function value, and the position constraint ends.
[0103] If the coordinate information of the intermediate control points on the cubic quasi-uniform B-spline curve is iteratively optimized based only on the position constraints, then the coordinate information of the intermediate control points obtained after the position constraints are completed is the optimized coordinate information of the intermediate control points.
[0104] The obstacle avoidance constraints are explained in detail below.
[0105] In practice, the obstacle avoidance constraint loss function is generated based on the safety distance threshold, the distance between the discretized sampling point on the initial path curve and the nearest obstacle.
[0106] In one embodiment, if the initial path curve is a cubic quasi-uniform B-spline curve, the obstacle avoidance constraint loss function is generated based on a safety distance threshold and the distance between the discretized sampling points on the cubic quasi-uniform B-spline curve and the nearest obstacle.
[0107] Specifically, the obstacle avoidance constraint loss function is expressed by the following formula 13: Formula 13 in, The loss function value represents the obstacle avoidance constraint, and m is the number of sampling points obtained after adaptive discretization of the cubic quasi-uniform B-spline curve. This represents the adaptive discretized coordinate information of the m-th sampling point on a cubic quasi-uniform B-spline curve. Let m be the distance between the adaptively discretized coordinates of the m-th sampling point and the nearest obstacle. This is the safe distance threshold.
[0108] In the embodiments of this application, This provides the coordinate information of the m-th sampling point on a cubic quasi-uniform B-spline curve. Let m be the distance between the m-th sampling point and the nearest obstacle. That is, after adaptive discretization of the cubic quasi-uniform B-spline curve, multiple sampling points are obtained. For each sampling point, the distance between that sampling point and the nearest obstacle is calculated. Then, based on Equation 13, the obstacle avoidance constraint loss function value is calculated. .
[0109] In one embodiment, during the current obstacle avoidance iteration, the current three quasi-uniform B-spline curves are first adaptively discretized to obtain multiple sampling points. Then, the nearest obstacle corresponding to each sampling point is determined. Finally, for each sampling point, the distance between the sampling point and its nearest obstacle is determined. If the distance is less than a preset safe distance threshold, the sampling point is determined as a collision point.
[0110] Specifically, a quadtree spatial partitioning method can be used to detect collision points. Using a quadtree spatial partitioning method to detect collision points can speed up the query process.
[0111] After determining the collision point in this obstacle avoidance iteration, for each collision point, the obstacle avoidance update vector of that collision point is calculated, and the target control point with the greatest impact on that collision point is determined. The obstacle avoidance update vector is accumulated into the current coordinate information of the target control point, and the coordinate information of the target control point is updated. The control points include waypoints and intermediate control points. The target control point can be either a waypoint or an intermediate control point.
[0112] Specifically, the obstacle avoidance update vector at the collision point is calculated in the following way: For all obstacles near the collision point, calculate the weighted components along the direction of "obstacle → collision point" and then average them to obtain the obstacle avoidance update vector for that collision point.
[0113] It should be noted that all obstacles near the collision point are those whose distance from the collision point is less than a preset threshold.
[0114] In one embodiment, the target control point that has the greatest impact on the collision point is determined in the following manner: Based on the inverse geometric distance ratio, determine the control point closest to the collision point; The control point closest to the collision point is selected as the target control point that has the greatest impact on the collision point.
[0115] In this embodiment, for each collision point, the target control point with the greatest impact on that collision point is determined, and the obstacle avoidance update vector of that collision point is accumulated into the current coordinate information of the target control point. Different collision points may correspond to the same target control point. If multiple collision points correspond to one target control point, then the obstacle avoidance update vector of that collision point is the sum of the obstacle avoidance update vectors of each collision point.
[0116] In this embodiment of the application, the relationship between the control point and the collision point is as follows: Collision point: Among the discretized sampling points of a cubic quasi-uniform B-spline curve, the sampling point whose distance to the nearest obstacle is less than the safe distance threshold; Control points: including intermediate control points and waypoints, i.e., a sequence of control points. All control points except the starting and ending points; Relationship between control points and collision points: Find the control point that has the greatest impact on the collision point, and add the obstacle avoidance update vector of the collision point to the gradient of the control point with the greatest impact, so that the curve moves away from the corresponding obstacle in the next iteration.
[0117] After updating the coordinate information of each target control point, the cubic quasi-uniform B-spline curve is updated based on the updated coordinate information of the target control points, and the next obstacle avoidance iteration is executed, or the obstacle avoidance iteration is stopped.
[0118] Specifically, the updated cubic quasi-uniform B-spline curve is adaptively discretized and sampled to obtain multiple sampling points. Collision points are determined from these sampling points. If no collision points exist, the obstacle avoidance iteration is stopped. If collision points exist, the obstacle avoidance update vector for each collision point and the target control point that has the greatest impact on each collision point are determined. For each collision point, the coordinate information of the target control point is updated based on the obstacle avoidance update vector. Based on the updated coordinate information of the target control point, the cubic quasi-uniform B-spline curve is updated, and the next obstacle avoidance iteration is executed, or the obstacle avoidance iteration is stopped. If a collision point exists and the obstacle avoidance iteration count reaches the preset first iteration count, then the obstacle avoidance iteration stops.
[0119] In this embodiment of the application, the coordinate information of the target control point is iteratively updated. In each iteration, the coordinate information of the target control point is updated based on the obstacle avoidance update vector, and the quasi-uniform B-spline curve is updated based on the updated coordinate information of the target control point. The cutoff condition for the iterative update is that there are no collision points on the updated path curve, or the number of collision iterations reaches the preset first iteration number.
[0120] The following section provides a detailed explanation of the smoothing constraint loss function.
[0121] To avoid sharp turns and local unevenness in the path, smoothness constraints are introduced for the control points.
[0122] In practice, the smoothing constraint loss function is generated based on the angle and length of adjacent control point line segments, where each control point line segment is the line segment between two adjacent control points. In other words, the initial path curve is adjusted by balancing its angle and length to obtain this smoothing constraint loss function.
[0123] Specifically, the angle between adjacent control point line segments is... The angle between the (i-1)th path segment and the ith path segment is the common endpoint. The lengths of adjacent control point segments include... Let be the length of the (i-1)th control point line segment and the length of the ith control point line segment, where i = 1, 2, 3, 4...q-2, and q is the number of control points.
[0124] For example, refer to Figure 4 When i=2, the control point with index 2 is the common endpoint, the (i-1)th control point line segment is the line segment between the control point with index 1 and the control point with index 2, and the i-th control point line segment is the line segment between the control point with index 2 and the control point with index 3.
[0125] In one embodiment, the smoothing constraint loss function is expressed by the following formula 14: Formula 14 in, To smooth the value of the constraint loss function, i The control point number has a range of values. i =1, 2, 3, 4……q-2, the (i-1)th control point line segment is the control point. With control points The line segments between the control points, the i-th control point line segment is the control point. With control points The line segments between, The first quasi-uniform B-spline curve on a cubic curve i -1 control point line segment and the first i The included angle between the control point line segments, For the first i -1 control point line segment length, For the first i The length of the line segment containing the control points, q is the number of control points on the cubic quasi-uniform B-spline curve, and C1 is a value greater than or equal to -1 and less than or equal to 1. For example, C1 can be 0.8.
[0126] Formula 14 Used to penalize excessively large angles between adjacent control point line segments. Used to balance the length of adjacent control point segments and avoid local path jitter.
[0127] In practical implementation, calculations are performed using the following formulas 15, 16, and 17. : Formula 15 Formula 16 Formula 17 in, for With control points The first vector of the line segment between them, through Coordinate information and control points The coordinate information was calculated. Control points and The second vector of the line segment between them passes through the control point. coordinate information and The coordinate information was calculated. , These are the coordinates of the corresponding control points.
[0128] Calculate the following formula 18. i -Length of one control point line segment: Formula 18 Calculate the following formula 19. i +1 control point line segment length: Formula 19 In one embodiment, for each control point from the 2nd control point to the (n-1)th control point... First, based on this control point Coordinate information and the control point Adjacent first adjacent control point Coordinate information and its relationship with the control point Adjacent second adjacent control point Calculate the control point using the coordinate information. The included angle error component and the length error component are calculated, and then the sum of the included angle error component and the length error component is used as the control point. The corresponding smooth update vector is used to finally update the control point. The coordinate information is updated, that is, the smooth update vector is compared with the control point. The coordinate information is accumulated.
[0129] Specifically, based on this control point Coordinate information and the control point Adjacent first adjacent control point Coordinate information and its relationship with the control point Adjacent second adjacent control point Use the coordinate information to determine the control point. Adjacent control point The first vector of the line segment between and the second adjacent control point With control points The second vector of the line segment between Then based on the first vector With the second vector The angle between To determine the included angle error component, in one embodiment, if the included angle If the cosine value is less than the preset value C1, then it will be along the direction perpendicular to the first vector. The unit normal vector direction and magnitude are C1 and The correction component of the difference is used as the included angle error component; if the included angle If the cosine value is greater than or equal to the preset value C1, then the included angle error component is 0, that is, the included angle error component is max(0,C1-cosθi)×N(v1), where N(v1) is the unit normal vector obtained by rotating the unit vector of v1 counterclockwise by 90°; based on the length difference of the line segments of two adjacent control points, the length error component is determined. Specifically, the length error component is the product of the length error and the coordinate difference vector, where the length error is |‖v(1)‖-‖v(2)‖| / max(‖v(1)‖,‖v(2)‖), and the coordinate difference vector is the first adjacent control point. With the second adjacent control point The difference in coordinates That is, the length error component is [|‖v1‖-‖v2‖| / max(‖v1‖,‖v2‖)]×( - After obtaining the included angle error component and the length error component, multiply each component by the weight corresponding to the smoothing constraint and sum them to obtain the control point. Smoothly update the vector.
[0130] For each control point, the sum of the current coordinates of the control point and the smooth update vector of the control point is used as the updated coordinates of the control point. The updated coordinates of the control point are also the optimized coordinates of the control point. The optimized coordinates of the control point include the optimized coordinates of intermediate control points and the optimized coordinates of transit points.
[0131] In one embodiment, the coordinate information of control points on a cubic quasi-uniform B-spline curve is iteratively optimized based on position constraints, obstacle avoidance constraints, and smoothness constraints to generate optimized coordinate information of the control points. The control points on the cubic quasi-uniform B-spline curve include intermediate control points and waypoints. Based on the optimized coordinate information of the control points, an optimized path curve is generated, and the generated optimized path curve is used as the planned path.
[0132] Specifically, first, the target intermediate control point with the greatest impact on position constraints is identified among the intermediate control points. The coordinate information of this target intermediate control point is then corrected to obtain the corrected path curve. Next, collision detection is performed on the corrected path curve. If a collision point exists, the target control point with the greatest impact on obstacle avoidance is identified, and the obstacle avoidance update vector of this target control point is calculated. Then, the smooth update vector of each control point is calculated. The corresponding obstacle avoidance update vector and smooth update vector are accumulated to obtain the comprehensive update vector. The comprehensive update vector is updated according to the adaptive learning rate, and the current coordinate information of the control point is updated according to the updated comprehensive update vector. The above process is repeated until there are no collision points on the path curve, or the number of iterations reaches the preset second iteration number.
[0133] It should be noted that the first and second iteration counts mentioned above are the preset upper limits of the number of iterations in different implementation methods, and the two are independent of each other.
[0134] In this embodiment, step one involves assigning time parameters to each essential path point. Then, for each essential path point, based on its time parameters, the basis function value of each intermediate control point is calculated. The intermediate control point corresponding to the highest few function values is selected as the target intermediate control point. The coordinate offset corresponding to the target intermediate control point is calculated based on formula 12. This coordinate offset is then added to the current coordinate information of the target intermediate control point, updating its coordinate information. After the coordinate information of all target intermediate control points is updated, the current path curve is updated.
[0135] Step 2: Adaptively discretize the current path curve to obtain multiple sampling points. For each sampling point, calculate the distance between the sampling point and the nearest obstacle. Determine if there are sampling points with a distance less than the safe distance threshold. If so, take the sampling point with a distance less than the safe distance threshold as the collision point. Calculate the distance between the collision point and each control point. Take the control point with the largest distance as the target control point with the greatest impact on the collision point. Calculate the weighted components of all obstacles near the collision point along the direction of "nearest obstacle → collision point" and calculate the weighted average to obtain the obstacle avoidance update vector of the collision point. If there are no sampling points with a distance less than the safe distance threshold, the iteration ends, or the iteration count is greater than the second iteration count, the iteration ends.
[0136] Step 3, for each control point Let i = 1, 2, 3 ... q-2. First, determine the relationship with the control point. The angle between the line segments of two control points that share a common endpoint and length, if the included angle If the cosine value is less than the preset value C1, then based on this control point... Coordinate information and the control point Adjacent first adjacent control point Coordinate information and its relationship with the control point Adjacent second adjacent control point Use the coordinate information to determine the control point. Adjacent control point The first vector of the control point line segment between and the second adjacent control point With control points The second vector of the control point line segment between , perpendicular to the first vector And points to the first vector With the second vector The correction component tending towards the alignment direction is used as the included angle error component, if the included angle If the cosine value is greater than or equal to the preset value C1, then the included angle error component is 0; based on the length difference between the line segments of two adjacent control points, the length error component is determined, and the sum of the included angle error component and the length error component is taken as the value of the control point. Smoothly update vector; Step four: Take the sum of the corresponding obstacle avoidance update vector and smoothing update vector as the comprehensive update vector, calculate the product of the comprehensive update vector and the current learning rate, and then apply this to the control point. The current coordinates and the sum of the products are used as the control point. Updated coordinate information. After the coordinate information of all control points has been updated, return to step one.
[0137] In one embodiment, for each control point, the coordinate information of the control point is updated based on the coordinate information of the control point obtained in the previous iteration, the learning rate corresponding to the current iteration, and the comprehensive update vector.
[0138] In practice, the coordinate information of the control points is updated based on the following formula 20: Formula 20 in, The control point corresponding to the (k+1)th iteration Coordinate information, The control point corresponding to the k-th iteration Coordinate information, Let k be the learning rate corresponding to the k-th iteration. This is the combined update vector obtained in the k-th iteration. The combined update vector is the sum of the obstacle avoidance update vector and the smoothing update vector.
[0139] In this embodiment of the application, the (k+1)th iteration is the current iteration, and the kth iteration is the previous iteration.
[0140] In one embodiment, the method further includes: determining whether the number of collision points in two consecutive iterations has not decreased; if the number of collision points in two consecutive iterations has not decreased, then reducing the current learning rate and using the reduced learning rate as the learning rate for the next iteration; if the number of collision points in at least one of the two consecutive iterations has decreased, then using the current learning rate as the learning rate for the next iteration.
[0141] In another embodiment, the method further includes: determining whether the number of collision points in the current iteration is greater than the number of collision points in the previous iteration; if it is greater, then reducing the current learning rate and using the reduced learning rate as the learning rate for the next iteration; if it is not greater, then using the current learning rate as the learning rate for the next iteration.
[0142] In practice, reducing the current learning rate can be achieved by multiplying the current learning rate by a preset decay coefficient.
[0143] The total loss function in this embodiment is expressed by the following formula 21: Formula 21 in, The weights are those corresponding to the position constraint loss function. The weights corresponding to the obstacle avoidance constraint loss function. The weights are the weights corresponding to the smoothing constraint loss function.
[0144] An adaptive learning rate mechanism is employed to improve convergence efficiency, and the scaling factor of the control point update step size determines the convergence speed and stability of the optimization process. The change in the number of collision points (i.e., the number of sampling points that do not meet the safe distance requirement) is monitored in consecutive iterations. If the number of collision points does not decrease in two consecutive iterations, the learning rate is proportionally decayed to ensure that the path is smooth and collision-free. Assume... To determine the number of collision points in the k-th iteration, examine the two most recent changes: from the (k-2)-k-1 iteration and from the (k-1)-k iteration. If... and If the number of collision points does not decrease in two consecutive iterations, then learning rate decay is triggered, and the learning rate is updated. Specifically, the learning rate is updated using the following formula 22: Formula 22 in, The attenuation coefficient can take values ranging from 1 to 2. , Let be the number of collision points in the k-th iteration. This represents the number of collision points in the (k+1)th iteration. This represents the number of collision points in the (k+2)th iteration.
[0145] In this embodiment, the obstacle avoidance update vector and the smooth update vector can be determined based on the total loss function. The gradient of the corresponding control point is determined, and the position constraint is achieved by separately correcting the coordinate information of the intermediate control point of the target, which does not participate in the accumulation of the comprehensive update vector.
[0146] The constraint manager in this application embodiment: The constraint manager ensures that a path curve passes through specified start, end, and waypoints while avoiding obstacles. Constraints are divided into three categories: (1) Location Constraints: For each necessary point (including the starting point, ending point, and waypoints) and its corresponding time parameters, an iterative optimization method is used to adjust the coordinate information of intermediate control points. The error is minimized by adjusting the coordinate information of intermediate control points. The location constraint loss function is: In each iteration, for each necessary point, the target intermediate control point with the greatest impact (i.e., the intermediate control point with the largest basis function value) is calculated. The coordinate offset of this target intermediate control point is calculated, and the coordinate information of the intermediate control point is corrected based on this coordinate offset. The coordinate offset is... Where strength is the constraint strength (the starting and ending points can be 2.0, and the path points can be 1.5).
[0147] (2) Obstacle avoidance constraint: For all points on the path curve, the distance to the nearest obstacle must be greater than the safe distance threshold. The obstacle avoidance constraint loss function is defined using gradient descent optimization. ,in It is the distance between the m-th sampling point and the nearest obstacle.
[0148] (3) Smoothing constraint: To achieve path smoothness, a curvature penalty term is introduced, which is the smoothing constraint loss function. When the included angle between adjacent control point line segments Punish those that are too large to prevent sharp turns.
[0149] The total loss function is Among them, weight , , This represents the weights of the three constraints.
[0150] Collision detection in this application embodiment: Collision detection can use quadtrees for spatial partitioning, accelerating the search for obstacles near curve points. A quadtree recursively divides the two-dimensional space into four quadrants, with each node storing obstacle points within its boundaries. During a query, only the safe region centered on the curve point (with a side length of...) needs to be checked. The nodes that intersect with the squares improve the efficiency of path planning.
[0151] This application embodiment also provides a visualization interaction module. The visualization interaction module implements a visualization interface based on PIXI.js, displaying the start point, end point, path points, intermediate control points, cubic quasi-uniform B-spline curve, and obstacles. Users can adjust the curve shape by dragging control points, and the system updates the curve in real time and re-optimizes obstacle avoidance. It is necessary to map physical coordinates to canvas coordinates. , ,in, and The x and y coordinates of the image to be displayed (such as control points, start points, end points, and obstacles) in the physical coordinate system (the map coordinate system in the actual operating environment of the AGV); and The minimum and maximum values of the physical x-coordinate of the currently displayed left and right border objects; and The minimum and maximum values of the physical ordinates of all currently displayed objects to be displayed; and The width and height of the canvas (display interface), in pixels; Margins, measured in pixels, are reserved around the canvas to ensure that the displayed content is spaced apart from the canvas edges and not completely flush with them. and These are the pixel coordinates on the canvas after the physical coordinate system (x, y) is reticled. The user drags control points. To the new location When the time is right, local optimization is triggered (optimizing only adjacent control points), and the curve is recalculated and displayed in real time.
[0152] The path generation method provided in this application can generate a cubic quasi-uniform B-spline curve based on given necessary points and obstacle location information. This is due to its mathematical... Continuity (curvature continuity) ensures the smoothness of the path, eliminating the abrupt curvature changes in traditional polyline paths. A curvature penalty term is introduced in gradient optimization, which applies when the angle between adjacent control point segments... When the value is too large, a penalty is applied, combined with a length error penalty term, to avoid unnecessary sharp turns. When initializing intermediate control points, a perturbation is added, introducing a random offset perpendicular to the path to prevent sharp corners in the initial path. Collision point detection uses quadtree space partitioning to accelerate queries. An adaptive learning rate based on changes in the number of collision points is adopted to avoid oscillations during the iteration process and accelerate convergence. The generated path ensures smoothness, obstacle avoidance safety, and the constraint of mandatory designated waypoints, improving the operational stability and positioning accuracy of the automated guided vehicle. Through a visual interface, users can drag and drop control points to adjust the path, ensuring the accuracy and real-time performance of path planning.
[0153] 1. The position constraint loss function in the embodiments of this application: For necessary points (starting point, ending point, and waypoints), let their time parameters be... The corresponding coordinate information is Then the position constraint loss function can be expressed as: ,in, This indicates that the cubic quasi-uniform B-spline curve has the following time parameter. Coordinate information at the location, This represents the coordinates of the c-th necessary point. For position constraints, first find the target intermediate control point that has the greatest impact on the constraint. Then, the coordinate information of the intermediate control point of the target is directly corrected, that is, the sum of the coordinate information of the intermediate control point of the target and the coordinate offset of the intermediate control point of the target is used as the updated coordinate information of the intermediate control point of the target.
[0154] 2. The obstacle avoidance constraint loss function in the embodiments of this application: Discrete sampling points of the curve ,make This represents the distance from the sampling point to the nearest obstacle, with a safe distance threshold of [value missing]. Then the obstacle avoidance constraint loss function can be expressed as: The loss increases when the distance from the sampling point to the obstacle is less than the safe distance threshold; the loss is zero when the distance is greater than or equal to the safe distance threshold. An obstacle avoidance update vector is constructed for the collision point, and then this obstacle avoidance update vector is applied to the control point with the greatest impact.
[0155] 3. The smoothing constraint loss function in the embodiments of this application: To avoid sharp turns and local unevenness in the path, smoothness constraints are introduced for the control points. Let... Then the cosine of the included angle can be expressed as: The lengths of adjacent line segments are as follows: Then the smoothing constraint loss function can be written as: , of which the first item ( ) is used to punish excessively large angles, the second item ( This is used to balance the lengths of adjacent line segments and avoid local jitter in the path.
[0156] 4. The total loss function in the embodiments of this application: ,in, The weights are those corresponding to the position constraint loss function. The weights corresponding to the obstacle avoidance constraints. The weights corresponding to the smoothing constraints.
[0157] The path generation method provided in this application includes: first, obtaining the coordinate information of intermediate control points based on preset necessary path point coordinate information; then, generating an initial path curve based on the coordinate information of the intermediate control points and the necessary path points; next, iteratively optimizing the coordinate information of the control points on the initial path curve based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints to generate optimized coordinate information of the control points; and finally, generating an optimized path based on the optimized coordinate information of the control points, using the generated optimized path as the planned path. The necessary path points include a starting point, intermediate points, and an ending point, and the control points include intermediate control points and intermediate control points. Because the coordinate information of the control points on the initial path curve is iteratively optimized based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints after obtaining the initial path curve, and the final optimized path curve is obtained based on the optimized coordinate information of the control points, the final optimized path curve can simultaneously satisfy the precise constraint of necessary path points and continuous smooth motion, improving the reliability of the path curve.
[0158] Based on the same inventive concept, this application also provides an electronic device. The principle of this electronic device in solving the technical problem is similar to that of the path generation method described above. The implementation of the electronic device can refer to the implementation of the path generation method, and the repeated parts will not be described again.
[0159] like Figure 5 The diagram shown is a structural schematic of an electronic device provided in this application. The electronic device includes: Memory 31 is used to store program instructions; Processor 32 is configured to call the program instructions stored in the memory and execute them according to the obtained program: Based on the coordinate information of preset necessary points, the coordinate information of intermediate control points is determined, wherein the necessary points include a starting point, a path point, and an ending point; based on the coordinate information of the intermediate control points and the coordinate information of the necessary points, an initial path curve is generated; based on at least one of position constraints, obstacle avoidance constraints, and smoothing constraints, the coordinate information of control points on the initial path curve is iteratively optimized to generate optimized coordinate information of control points, wherein the control points include path points and intermediate control points; after generating the optimized path curve according to the optimized control point coordinate information, the generated optimized path curve is used as the planned path.
[0160] In one embodiment, the position constraint loss function in the position constraint is obtained based on the coordinate information of each necessary point and the initial path curve; the obstacle avoidance constraint loss function in the obstacle avoidance constraint is generated based on the safety distance threshold, the distance between the discretized sampling point on the initial path curve and the nearest obstacle; the smoothing constraint loss function in the smoothing constraint is generated based on the included angle between adjacent control point line segments and the length of adjacent control point line segments, wherein the control point line segment is the line segment between two adjacent control points.
[0161] In one embodiment, processor 32 is specifically used for: Based on the three of the aforementioned position constraints, obstacle avoidance constraints, and smoothness constraints, the coordinate information of the intermediate control point is iteratively optimized to generate optimized coordinate information of the intermediate control point.
[0162] In one embodiment, processor 32 is specifically used for: For each path segment on the preset running trajectory, the coordinate information of each intermediate control point on the path segment is calculated based on the coordinate information of the two necessary points constituting the path segment and the number of intermediate control points to be inserted on the path segment.
[0163] In one embodiment, the processor 32 calculates the first [value] on the path segment based on the following formula. j Coordinate information of the intermediate control points:
[0164] in, For the path segment, the first j Coordinate information of the intermediate control points The coordinates of the first necessary point along the path segment. The coordinates of the second necessary point along the path segment. For the first segment of the path j One intermediate control point This represents the number of intermediate control points to be inserted on the path segment. lie in and Between the two endpoints.
[0165] In one embodiment, after obtaining the coordinate information of the intermediate control point and before generating the initial path curve, the processor 32 is further configured to: Calculate the unit tangent vectors corresponding to several of the aforementioned path segments; Based on the unit tangent vector, calculate the unit normal vectors of several path segments; For a number of path segments, the coordinate information of the intermediate control points on the path segments is updated based on the random disturbance, the coordinate information of the intermediate control points on the path segments, and the unit normal vector corresponding to the path segments.
[0166] In one embodiment, the processor 32 updates the path segment based on the following formula: j Coordinate information of the intermediate control points:
[0167] in, For the updated number j Coordinate information of the intermediate control points Let be the unit normal vector. It represents a random disturbance.
[0168] In one embodiment, the initial path curve is a cubic quasi-uniform B-spline curve.
[0169] In one embodiment, the processor 32 performs cubic quasi-uniform B-splines based on the coordinate information of each necessary point to obtain the position constraint loss function.
[0170] In one embodiment, the position constraint loss function is expressed by the following formula:
[0171] in, Here, c represents the position constraint loss function value, and c is the index of the current must-see point. The time parameter corresponding to the c-th necessary point. For a cubic quasi-uniform B-spline curve in terms of time parameter Coordinate information at the location, For the first c The coordinates of each necessary point are given, where M is the number of necessary points.
[0172] In one embodiment, the processor 32 is further configured to: From the intermediate control points on the cubic quasi-uniform B-spline curve, determine the target intermediate control point that has the greatest impact on the position constraint, and update the coordinate information of the target intermediate control point based on the coordinate offset corresponding to the target intermediate control point.
[0173] In one embodiment, processor 32 is specifically used for: Based on the time parameters corresponding to each necessary point on the cubic quasi-uniform B-spline curve, the basis function value of each intermediate control point is calculated; the intermediate control point with the largest basis function value is taken as the target intermediate control point. Based on the coordinate information of the necessary points, the coordinate information of the cubic quasi-uniform B-spline curve at the time parameter, and the preset constraint strength, the coordinate offset of the target intermediate control point is calculated; the sum of the current coordinate information of the target intermediate control point and the coordinate offset is used as the updated coordinate information of the target intermediate control point.
[0174] In one embodiment, the processor 32 determines the target control point using the following formula:
[0175] in, is the index of the intermediate control point with the largest basis function value, which is also the index of the target intermediate control point, and n is the total number of intermediate control points. The time parameter corresponding to the current necessary path point; In one embodiment, the processor 32 updates the coordinate information of the target intermediate control point using the following formula:
[0176] in, This represents the coordinate offset of the target's intermediate control point. Indicates the current necessary point The sequence number of the intermediate control point with the greatest impact. Indicates the first The intermediate control points are between parameters. The basis function values at that point, This represents the curve parameters corresponding to the current essential point. This indicates the coordinates of the currently necessary point. This indicates that on a cubic quasi-uniform B-spline curve, the time parameter... Coordinate information at the location, This indicates the preset constraint strength coefficient.
[0177] In one embodiment, when the current necessary point is a start point or an end point, Take 2.0, when the current necessary point is a waypoint. Take 1.5.
[0178] In one embodiment, the processor 32 is further configured to: Adaptive discretization sampling is performed on the cubic quasi-uniform B-spline curve to obtain multiple sampling points; Identify the obstacles corresponding to each sampling point; For each sampling point, the distance between the sampling point and its corresponding obstacle is determined. If the distance is less than a preset safe distance threshold, the sampling point is determined to be a collision point.
[0179] In one embodiment, the processor 32 is further configured to: For each collision point, calculate the obstacle avoidance update vector of the collision point and its corresponding obstacle, determine the target control point that has the greatest impact on the collision point, and add the obstacle avoidance update vector to the coordinate information of the target control point to obtain the updated coordinate information of the target control point.
[0180] In one embodiment, the processor 32 calculates the obstacle avoidance update vector in the following manner: For all obstacles near the collision point, calculate the weighted components along the "obstacle → collision point" direction and then average them to obtain the obstacle avoidance update vector.
[0181] In one embodiment, the processor 32 determines the target control point that has the greatest impact on the collision point in the following manner: Based on the inverse geometric distance ratio, determine the control point closest to the collision point; The control point closest to the collision point is selected as the target control point that has the greatest impact on the collision point.
[0182] In one embodiment, the control points participating in the iterative update are control points other than the start point and the end point; for each collision point, the target control point with the greatest impact on the collision point is determined from the control points other than the start point and the end point, and the obstacle avoidance update vector corresponding to the collision point is accumulated into the coordinate information of the target control point, so that the iteratively updated path curve is far away from the obstacle corresponding to the collision point.
[0183] In one embodiment, the processor 32 updates the vector smoothly by accumulating the included angle error component and the length error component in the following manner: For each control point except the start and end points : The angle error component is max(0,C1-cosθi)×N( ), where N( )for The unit normal vector obtained by rotating the unit vector counterclockwise by 90°. for With control points The first vector of the line segment between; The length error component is [|‖ ‖-‖ || / max(||) ‖,‖ ||)]×( - ),in, for and The second vector of the line segment between them. , These are the coordinate information of the corresponding control points; The control point is obtained by multiplying the included angle error component and the length error component by the weights corresponding to the smoothing constraints, respectively. Smoothly update the vector.
[0184] In one embodiment, the processor 32 is further configured to: The coordinate information of the target control point with the greatest impact on obstacle avoidance is iteratively updated; wherein, each iteration updates the coordinate information of the target control point based on the corresponding obstacle avoidance update vector, and updates the path curve based on the updated coordinate information of the target control point; the termination condition of the iteration update is that there are no collision points on the updated path curve or the number of iterations reaches the preset first iteration number.
[0185] In one embodiment, processor 32 is specifically used for: Based on the safety distance threshold, the distance between the discretized sampling point on the cubic quasi-uniform B-spline curve and the nearest obstacle, and the cubic quasi-uniform B-spline curve, an obstacle avoidance constraint loss function is generated.
[0186] In one embodiment, the obstacle avoidance constraint loss function is expressed by the following formula:
[0187] in, The loss function value represents the obstacle avoidance constraint, and m is the number of sampling points obtained after adaptive discretization of the cubic quasi-uniform B-spline curve. This represents the adaptive discretized coordinate information of the m-th sampling point on a cubic quasi-uniform B-spline curve. Let m be the distance between the adaptively discretized coordinates of the m-th sampling point and the nearest obstacle. This is the safe distance threshold.
[0188] In one embodiment, the processor 32 adjusts the included angle and length of the initial path curve to apply a smooth constraint to the initial path curve.
[0189] In one embodiment, the included angle is... The angle between the (i-1)th control point line segment and the ith control point line segment is the common endpoint. The length includes the length of the (i-1)th control point line segment and the length of the ith control point line segment.
[0190] In one embodiment, the smoothing constraint loss function is expressed by the following formula:
[0191] in, To smooth the value of the constraint loss function, i The control point number has a range of values. i =1,2,3,4……q-2, where the (i-1)th control point segment is the segment between control point Pi-1 and control point Pi, and the ith control point segment is the segment between control point Pi and control point Pi+1. The first quasi-uniform B-spline curve on a cubic curve i -1 control point line segment and the first i The included angle between the control point line segments, L i-1 Let be the length of the (i-1)th control point line segment. L i Let q be the length of the line segment of the i-th control point, q be the number of control points on the cubic quasi-uniform B-spline curve, and C1 be a value greater than or equal to -1 and less than or equal to 1.
[0192] In one embodiment, the processor 32 calculates using the following formula :
[0193] in, for With control points The first vector of the line segment between them. for and The second vector of the line segment between them. , , These are the coordinate information of the corresponding control points; In one embodiment, the processor 32 calculates the first... using the following formula i Length of the control point line segment:
[0194] In one embodiment, the processor 32 calculates the first... using the following formula Length of the control point line segment:
[0195] In one embodiment, the processor 32 is further configured to: For each control point, the vector is updated smoothly by accumulating the included angle error component and the length error component; The sum of the obstacle avoidance update vector and the smooth update vector is used as the comprehensive update vector.
[0196] In one embodiment, the coordinate information of the control points is iteratively updated; wherein, each iteration updates the coordinate information of the control points based on a comprehensive update vector, and updates the path curve based on the updated coordinate information of the control points, wherein the comprehensive update vector is the sum of the obstacle avoidance update vector and the smoothing update vector; the termination condition of the iterative update is that there are no collision points on the updated path curve, or the number of iterations reaches a preset second iteration number.
[0197] In one embodiment, the processor 32 is further configured to: For each control point, the coordinate information of the control point is updated based on the coordinate information of the control point obtained in the previous iteration, the learning rate corresponding to the current iteration, and the comprehensive update vector.
[0198] In one embodiment, the processor 32 updates the coordinate information of the control point based on the following formula:
[0199] in, The control point corresponding to the (k+1)th iteration Coordinate information, The control point corresponding to the k-th iteration Coordinate information, Let k be the learning rate corresponding to the k-th iteration. This is the comprehensive update vector obtained in the k-th iteration.
[0200] In one embodiment, the processor 32 is further configured to: Determine whether the number of collision points has not decreased in two consecutive iterations. This means that the number of collision points in the current iteration is not less than the number of collision points in the previous iteration, and the number of collision points in the previous iteration is not less than the number of collision points in the iteration before that. If so, the product of the current learning rate and the decay coefficient is used as the learning rate for the next iteration. Otherwise, the current learning rate is used as the learning rate for the next iteration.
[0201] Based on the same inventive concept, this application also provides a path generation device. The principle of the path generation device in solving the technical problem is similar to that of the path generation method described above. The implementation of the path generation device can refer to the implementation of the path generation method, and the repeated parts will not be described again.
[0202] like Figure 6 The diagram shown is a schematic representation of a path generation device provided in an embodiment of this application, comprising: The determination module 61 is used to determine the coordinate information of intermediate control points based on the preset coordinate information of necessary points, wherein the necessary points include the starting point, the intermediate points, and the ending point; The generation module 62 is used to generate an initial path curve based on the coordinate information of the intermediate control points and the coordinate information of the necessary points; to iteratively optimize the coordinate information of the control points on the initial path curve based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints, to generate optimized coordinate information of the control points, wherein the control points include waypoints and intermediate control points; and to generate an optimized path curve based on the optimized control point coordinate information, and then use the generated optimized path curve as the planned path.
[0203] In one embodiment, the position constraint loss function in the position constraint is obtained based on the coordinate information of each necessary point and the initial path curve; the obstacle avoidance constraint loss function in the obstacle avoidance constraint is generated based on the safety distance threshold, the distance between the discretized sampling point on the initial path curve and the nearest obstacle; the smoothing constraint loss function in the smoothing constraint is generated based on the included angle between adjacent control point line segments and the length of adjacent control point line segments, wherein the control point line segment is the line segment between two adjacent control points.
[0204] In one embodiment, the iterative optimization of the coordinate information of the intermediate control point based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints to generate optimized coordinate information of the control point includes: Based on the three of the aforementioned position constraints, obstacle avoidance constraints, and smoothness constraints, the coordinate information of the intermediate control point is iteratively optimized to generate optimized coordinate information of the intermediate control point.
[0205] In one embodiment, the determining module 61 is specifically used for: For each path segment on the preset running trajectory, the coordinate information of each intermediate control point on the path segment is calculated based on the coordinate information of the two necessary points constituting the path segment and the number of intermediate control points to be inserted on the path segment.
[0206] In one embodiment, the determining module 61 calculates the first [value] on the path segment based on the following formula. j Coordinate information of the intermediate control points:
[0207] in, For the path segment, the first j Coordinate information of the intermediate control points The coordinates of the first necessary point along the path segment. The coordinates of the second necessary point along the path segment. For the first segment of the path j One intermediate control point This represents the number of intermediate control points to be inserted on the path segment. lie in and Between the two endpoints.
[0208] In one embodiment, after obtaining the coordinate information of the intermediate control point and before generating the initial path curve, the determining module 61 is further configured to: Calculate the unit tangent vectors corresponding to several of the aforementioned path segments; Based on the unit tangent vector, calculate the unit normal vectors of several path segments; For a number of path segments, the coordinate information of the intermediate control points on the path segments is updated based on the random disturbance, the coordinate information of the intermediate control points on the path segments, and the unit normal vector corresponding to the path segments.
[0209] In one embodiment, the determining module 61 updates the path segment based on the following formula: j Coordinate information of the intermediate control points:
[0210] in, For the updated number j Coordinate information of the intermediate control points Let be the unit normal vector. It represents a random disturbance.
[0211] In one embodiment, the initial path curve is a cubic quasi-uniform B-spline curve.
[0212] In one embodiment, the generation module 62 generates cubic quasi-uniform B-splines based on the coordinate information of each necessary point to obtain the position constraint loss function.
[0213] In one embodiment, the position constraint loss function is expressed by the following formula:
[0214] in, Here, c represents the position constraint loss function value, and c is the index of the current must-see point. The time parameter corresponding to the c-th necessary point. For a cubic quasi-uniform B-spline curve in terms of time parameter Coordinate information at the location, For the first c The coordinates of each necessary point are given, where M is the number of necessary points.
[0215] In one embodiment, the generation module 62 is further configured to: From the intermediate control points on the cubic quasi-uniform B-spline curve, determine the target intermediate control point that has the greatest impact on the position constraint, and update the coordinate information of the target intermediate control point based on the coordinate offset corresponding to the target intermediate control point.
[0216] In one embodiment, the generation module 62 is specifically used for: Based on the time parameters corresponding to each necessary point on the cubic quasi-uniform B-spline curve, calculate the basis function value of each intermediate control point; The intermediate control point with the largest basis function value is taken as the target intermediate control point; Based on the coordinate information of the necessary points, the coordinate information of the cubic quasi-uniform B-spline curve at the time parameter, and the preset constraint strength, the coordinate offset of the target intermediate control point is calculated. The sum of the current coordinates of the target intermediate control point and the coordinate offset is used as the updated coordinates of the target intermediate control point.
[0217] In one embodiment, the generation module 62 determines the target control point using the following formula:
[0218] in, is the index of the intermediate control point with the largest basis function value, which is also the index of the target intermediate control point, and n is the total number of intermediate control points. The time parameter corresponding to the current necessary path point; In one embodiment, the generation module 62 updates the coordinate information of the target intermediate control point using the following formula:
[0219] in, This represents the coordinate offset of the target's intermediate control point. Indicates the current necessary point The sequence number of the intermediate control point with the greatest impact. Indicates the first The intermediate control points are between parameters. The basis function values at that point, This represents the curve parameters corresponding to the current essential point. This indicates the coordinates of the currently necessary point. This indicates that on a cubic quasi-uniform B-spline curve, the time parameter... Coordinate information at the location, This indicates the preset constraint strength coefficient.
[0220] In one embodiment, when the current necessary point is a start point or an end point, Take 2.0, when the current necessary point is a waypoint. Take 1.5.
[0221] In one embodiment, the generation module 62 is further configured to: Adaptive discretization sampling is performed on the cubic quasi-uniform B-spline curve to obtain multiple sampling points; Identify the obstacles corresponding to each sampling point; For each sampling point, the distance between the sampling point and its corresponding obstacle is determined. If the distance is less than a preset safe distance threshold, the sampling point is determined to be a collision point.
[0222] In one embodiment, the generation module 62 is further configured to: For each collision point, calculate the obstacle avoidance update vector of the collision point and its corresponding obstacle, determine the target control point that has the greatest impact on the collision point, and add the obstacle avoidance update vector to the coordinate information of the target control point to obtain the updated coordinate information of the target control point.
[0223] In one embodiment, the generation module 62 calculates the obstacle avoidance update vector in the following manner: For all obstacles near the collision point, calculate the weighted components along the "obstacle → collision point" direction and then average them to obtain the obstacle avoidance update vector.
[0224] In one embodiment, the generation module 62 determines the target control point that has the greatest impact on the collision point in the following manner: Based on the inverse geometric distance ratio, determine the control point closest to the collision point; The control point closest to the collision point is selected as the target control point that has the greatest impact on the collision point.
[0225] In one embodiment, the control points participating in the iterative update are control points other than the start point and the end point; for each collision point, the target control point with the greatest impact on the collision point is determined from the control points other than the start point and the end point, and the obstacle avoidance update vector corresponding to the collision point is accumulated into the coordinate information of the target control point, so that the iteratively updated path curve is far away from the obstacle corresponding to the collision point.
[0226] In one embodiment, the generation module 62 updates the vector smoothly by accumulating the included angle error component and the length error component in the following manner: For each control point except the start and end points : The angle error component is max(0,C1-cosθi)×N( ), where N( )for The unit normal vector obtained by rotating the unit vector counterclockwise by 90°. for With control points The first vector of the line segment between; The length error component is [|‖ ‖-‖ || / max(||) ‖,‖ ||)]×( - ),in, for and The second vector of the line segment between them. , These are the coordinate information of the corresponding control points; The control point is obtained by multiplying the included angle error component and the length error component by the weights corresponding to the smoothing constraints, respectively. Smoothly update the vector.
[0227] In one embodiment, the generation module 62 is further configured to: The coordinate information of the target control point with the greatest impact on obstacle avoidance is iteratively updated; wherein, each iteration updates the coordinate information of the target control point based on the corresponding obstacle avoidance update vector, and updates the path curve based on the updated coordinate information of the target control point; the termination condition of the iteration update is that there are no collision points on the updated path curve or the number of iterations reaches the preset first iteration number.
[0228] In one embodiment, the generation module 62 is used to: Based on the safety distance threshold, the distance between the discretized sampling point on the cubic quasi-uniform B-spline curve and the nearest obstacle, and the cubic quasi-uniform B-spline curve, an obstacle avoidance constraint loss function is generated.
[0229] In one embodiment, the obstacle avoidance constraint loss function is expressed by the following formula:
[0230] in, The loss function value represents the obstacle avoidance constraint, and m is the number of sampling points obtained after adaptive discretization of the cubic quasi-uniform B-spline curve. This represents the adaptive discretized coordinate information of the m-th sampling point on a cubic quasi-uniform B-spline curve. Let m be the distance between the adaptively discretized coordinates of the m-th sampling point and the nearest obstacle. This is the safe distance threshold.
[0231] In one embodiment, the generation module 62 adjusts the included angle and length of the initial path curve to apply a smooth constraint to the initial path curve.
[0232] In one embodiment, the included angle is... The angle between the (i-1)th control point line segment and the ith control point line segment is the common endpoint. The length includes the length of the (i-1)th control point line segment and the length of the ith control point line segment.
[0233] In one embodiment, the smoothing constraint loss function is expressed by the following formula:
[0234] in, To smooth the value of the constraint loss function, i The control point number has a range of values. i =1,2,3,4……q-2, where the (i-1)th control point segment is the segment between control point Pi-1 and control point Pi, and the ith control point segment is the segment between control point Pi and control point Pi+1. The first quasi-uniform B-spline curve on a cubic curve i -1 control point line segment and the first i The included angle between the control point line segments, L i-1 Let be the length of the (i-1)th control point line segment. L i Let q be the length of the line segment of the i-th control point, q be the number of control points on the cubic quasi-uniform B-spline curve, and C1 be a value greater than or equal to -1 and less than or equal to 1.
[0235] In one embodiment, the generation module 62 calculates using the following formula :
[0236] in, for The first vector of the line segment between the control point Pi-1 and the control point Pi-1 for and The second vector of the line segment between them. , These are the coordinate information of the corresponding control points; In one embodiment, the generation module 62 calculates the first... i Length of the control point line segment:
[0237] In one embodiment, the generation module 62 calculates the first... Length of the control point line segment:
[0238] In one embodiment, the generation module 62 is further configured to: For each control point, the vector is updated smoothly by accumulating the included angle error component and the length error component; The sum of the obstacle avoidance update vector and the smooth update vector is used as the comprehensive update vector.
[0239] In one embodiment, the generation module 62 iteratively updates the coordinate information of the control points; wherein, each iteration updates the coordinate information of the control points based on the comprehensive update vector, and updates the path curve based on the updated coordinate information of the control points, wherein the comprehensive update vector is the sum of the obstacle avoidance update vector and the smoothing update vector; the termination condition of the iterative update is that there are no collision points on the updated path curve, or the number of iterations reaches a preset second iteration number.
[0240] In one embodiment, the generation module 62 is further configured to: For each control point, the coordinate information of the control point is updated based on the coordinate information of the control point obtained in the previous iteration, the learning rate corresponding to the current iteration, and the comprehensive update vector.
[0241] In one embodiment, the generation module 62 updates the coordinate information of the control points based on the following formula:
[0242] in, The control point corresponding to the (k+1)th iteration Coordinate information, The control point corresponding to the k-th iteration Coordinate information, Let k be the learning rate corresponding to the k-th iteration. This is the comprehensive update vector obtained in the k-th iteration.
[0243] In one embodiment, the generation module 62 is further configured to: Determine whether the number of collision points has not decreased in two consecutive iterations. This means that the number of collision points in the current iteration is not less than the number of collision points in the previous iteration, and the number of collision points in the previous iteration is not less than the number of collision points in the iteration before that. If so, the product of the current learning rate and the decay coefficient is used as the learning rate for the next iteration. Otherwise, the current learning rate is used as the learning rate for the next iteration.
[0244] The path generation method, electronic device, and apparatus provided in this application can generate a cubic quasi-uniform B-spline curve based on given necessary path points and obstacle location information. This is due to its mathematical... Continuity (curvature continuity) ensures the smoothness of the path, eliminating the abrupt curvature changes in traditional polyline paths. A curvature penalty term is introduced in gradient optimization, which applies when the angle between adjacent line segments... When the value is too large, a penalty is applied, combined with a length error penalty term, to avoid unnecessary sharp turns. A perturbation is added during control point initialization, introducing a random offset perpendicular to the path to prevent sharp corners in the initial path. Collision point detection uses quadtree space partitioning to accelerate queries. An adaptive learning rate based on changes in the number of collision points is adopted to avoid oscillations during iteration and accelerate convergence. The generated path ensures smoothness, obstacle avoidance safety, and mandatory pathpoint constraints, improving the operational stability and positioning accuracy of the automated guided vehicle. Through a visual interface, users can drag and drop control points to adjust the path, ensuring the accuracy and real-time performance of path planning.
[0245] The present application has been described above with reference to block diagrams and / or flowcharts illustrating methods, apparatus (systems), and / or computer program products according to embodiments of the present application. It should be understood that a block of a block diagram and / or flowchart, as well as combinations of blocks of block diagrams and / or flowcharts, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, and / or other programmable data processing means to produce a machine such that the instructions, executable via the computer processor and / or other programmable data processing means, create methods for implementing the functions / actions specified in the blocks of the block diagrams and / or flowcharts.
[0246] Accordingly, this application can also be implemented using hardware and / or software (including firmware, resident software, microcode, etc.). Furthermore, this application can take the form of a computer program product on a computer-usable or computer-readable storage medium, having computer-usable or computer-readable program code implemented in the medium for use by or in conjunction with an instruction execution system. In the context of this application, a computer-usable or computer-readable medium can be any medium that can contain, store, communicate, transmit, or deliver a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0247] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A path generation method, characterized in that, The method includes: Based on the coordinate information of the preset necessary points, the coordinate information of the intermediate control points is determined, wherein the necessary points include the starting point, the intermediate points, and the ending point; Based on the coordinate information of the intermediate control points and the coordinate information of the necessary points, an initial path curve is generated; Based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints, the coordinate information of control points on the initial path curve is iteratively optimized to generate optimized coordinate information of control points, wherein the control points include waypoints and intermediate control points; After generating the optimized path curve based on the optimized control point coordinate information, the generated optimized path curve is used as the planned path.
2. The method according to claim 1, characterized in that, The position constraint loss function in the position constraint is obtained based on the coordinate information of each necessary point and the initial path curve; the obstacle avoidance constraint loss function in the obstacle avoidance constraint is generated based on the safety distance threshold, the distance between the discretized sampling point on the initial path curve and the nearest obstacle; the smoothing constraint loss function in the smoothing constraint is generated based on the included angle between adjacent control point line segments and the length of adjacent control point line segments, where the control point line segment is the line segment between two adjacent control points.
3. The method according to claim 1, characterized in that, The method of iteratively optimizing the coordinate information of the intermediate control point based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints to generate optimized coordinate information of the control point includes: Based on the three of the aforementioned position constraints, obstacle avoidance constraints, and smoothness constraints, the coordinate information of the intermediate control point is iteratively optimized to generate optimized coordinate information of the intermediate control point.
4. The method according to claim 1, characterized in that, The determination of the coordinate information of intermediate control points based on preset necessary path coordinate information includes: For each path segment on the preset running trajectory, the coordinate information of each intermediate control point on the path segment is calculated based on the coordinate information of the two necessary points constituting the path segment and the number of intermediate control points to be inserted on the path segment.
5. The method according to claim 4, characterized in that, The first line segment on the path is calculated based on the following formula. j Coordinate information of the intermediate control points: in, For the path segment, the first j Coordinate information of the intermediate control points The coordinates of the first necessary point along the path segment. The coordinates of the second necessary point along the path segment. For the first segment of the path j One intermediate control point This represents the number of intermediate control points to be inserted on the path segment. lie in and Between the two endpoints.
6. The method according to any one of claims 1 to 5, characterized in that, After obtaining the coordinate information of the intermediate control points, before generating the initial path curve, the process further includes: Calculate the unit tangent vectors corresponding to several of the aforementioned path segments; Based on the unit tangent vector, calculate the unit normal vectors of several path segments; For a number of path segments, the coordinate information of the intermediate control points on the path segments is updated based on the random disturbance, the coordinate information of the intermediate control points on the path segments, and the unit normal vector corresponding to the path segments.
7. The method according to claim 6, characterized in that, Update the path segment based on the following formula. j Coordinate information of the intermediate control points: in, For the updated number j Coordinate information of the intermediate control points Let be the unit normal vector. It represents a random disturbance.
8. The method according to any one of claims 1 to 5, characterized in that, The initial path curve is a cubic quasi-uniform B-spline curve.
9. The method according to claim 8, characterized in that, Based on the coordinate information of each necessary point, a cubic quasi-uniform B-spline is generated to obtain the position constraint loss function.
10. The method according to claim 9, characterized in that, The location constraint loss function is expressed by the following formula: in, Here, c represents the position constraint loss function value, and c is the index of the current must-see point. The time parameter corresponding to the c-th necessary point. For a cubic quasi-uniform B-spline curve in terms of time parameter Coordinate information at the location, For the first c The coordinates of each necessary point are given, where M is the number of necessary points.
11. The method according to claim 8, characterized in that, The method further includes: From the intermediate control points on the cubic quasi-uniform B-spline curve, determine the target intermediate control point that has the greatest impact on the position constraint, and update the coordinate information of the target intermediate control point based on the coordinate offset corresponding to the target intermediate control point.
12. The method according to claim 11, characterized in that, The step of determining the target intermediate control point with the greatest impact on the position constraint from the intermediate control points on the cubic quasi-uniform B-spline curve includes: Based on the time parameters corresponding to each necessary point on the cubic quasi-uniform B-spline curve, calculate the basis function value of each intermediate control point; The intermediate control point with the largest basis function value is taken as the target intermediate control point; The step of updating the coordinate information of the target intermediate control point based on the coordinate offset corresponding to the target intermediate control point includes: Based on the coordinate information of the necessary points, the coordinate information of the cubic quasi-uniform B-spline curve at the time parameter, and the preset constraint strength, the coordinate offset of the target intermediate control point is calculated. The sum of the current coordinates of the target intermediate control point and the coordinate offset is used as the updated coordinates of the target intermediate control point.
13. The method according to claim 12, characterized in that, The target control points are determined using the following formula: in, is the index of the intermediate control point with the largest basis function value, which is also the index of the target intermediate control point, and n is the total number of intermediate control points. The time parameter corresponding to the current necessary path point; The coordinate information of the intermediate control points of the target is updated using the following formula: in, This represents the coordinate offset of the target's intermediate control point. Indicates the current necessary point The sequence number of the intermediate control point with the greatest impact. Indicates the first The intermediate control points are between parameters. The basis function values at that point, This represents the curve parameters corresponding to the current essential point. This indicates the coordinates of the currently necessary point. This indicates that on a cubic quasi-uniform B-spline curve, the time parameter... Coordinate information at the location, This indicates the preset constraint strength coefficient.
14. The method according to claim 13, characterized in that, When the current necessary point is the starting point or the ending point Take 2.0, when the current necessary point is a waypoint. Take 1.
5.
15. The method according to claim 8, characterized in that, The method further includes: Adaptive discretization sampling is performed on the cubic quasi-uniform B-spline curve to obtain multiple sampling points; Identify the obstacles corresponding to each sampling point; For each sampling point, the distance between the sampling point and its corresponding obstacle is determined. If the distance is less than a preset safe distance threshold, the sampling point is determined to be a collision point.
16. The method according to claim 15, characterized in that, The method further includes: For each collision point, calculate the obstacle avoidance update vector of the collision point and its corresponding obstacle, determine the target control point that has the greatest impact on the collision point, and add the obstacle avoidance update vector to the coordinate information of the target control point to obtain the updated coordinate information of the target control point.
17. The method according to claim 16, characterized in that, The obstacle avoidance update vector is calculated in the following way: For all obstacles near the collision point, calculate the weighted components along the "obstacle → collision point" direction and then average them to obtain the obstacle avoidance update vector.
18. The method according to claim 16, characterized in that, The target control point that has the greatest impact on the collision point is determined using the following methods: Based on the inverse geometric distance ratio, determine the control point closest to the collision point; The control point closest to the collision point is selected as the target control point that has the greatest impact on the collision point.
19. The method according to claim 18, characterized in that, The control points participating in the iterative update are control points other than the start and end points. For each collision point, the target control point with the greatest impact on the collision point is determined from the control points other than the start and end points. The obstacle avoidance update vector corresponding to the collision point is accumulated into the coordinate information of the target control point so that the path curve after the iterative update is far away from the obstacle corresponding to the collision point.
20. The method according to claim 8 or 19, characterized in that, The vector is updated smoothly by accumulating the angle error component and the length error component in the following way: For each control point except the start and end points : The angle error component is max(0,C1-cosθi)×N( ), where N( )for The unit normal vector obtained by rotating the unit vector counterclockwise by 90°. for With control points The first vector of the line segment between; The length error component is [|‖ ‖-‖ || / max(||) ‖,‖ ||)]×( - ),in, for and The second vector of the line segment between them. , These are the coordinate information of the corresponding control points; The control point is obtained by multiplying the included angle error component and the length error component by the weights corresponding to the smoothing constraints, respectively. Smoothly update the vector.
21. The method according to claim 8, characterized in that, The method further includes: The coordinate information of the target control point with the greatest impact on obstacle avoidance is iteratively updated; wherein, each iteration updates the coordinate information of the target control point based on the corresponding obstacle avoidance update vector, and updates the path curve based on the updated coordinate information of the target control point; the termination condition of the iteration update is that there are no collision points on the updated path curve or the number of iterations reaches the preset first iteration number.
22. The method according to claim 15, characterized in that, Based on the safety distance threshold, the distance between the discretized sampling point on the cubic quasi-uniform B-spline curve and the nearest obstacle, and the cubic quasi-uniform B-spline curve, an obstacle avoidance constraint loss function is generated.
23. The method according to claim 15, characterized in that, The obstacle avoidance constraint loss function is expressed by the following formula: in, The loss function value represents the obstacle avoidance constraint, and m is the number of sampling points obtained after adaptive discretization of the cubic quasi-uniform B-spline curve. This represents the adaptive discretized coordinate information of the m-th sampling point on a cubic quasi-uniform B-spline curve. Let m be the distance between the adaptively discretized coordinates of the m-th sampling point and the nearest obstacle. This is the safe distance threshold.
24. The method according to claim 20, characterized in that, The initial path curve is adjusted by balancing its included angle and length to provide a smooth constraint.
25. The method according to claim 24, characterized in that, The included angle is The angle between the (i-1)th control point line segment and the ith control point line segment is the common endpoint. The length includes the length of the (i-1)th control point line segment and the length of the ith control point line segment.
26. The method according to claim 24, characterized in that, The smoothing constraint loss function is expressed by the following formula: in, To smooth the value of the constraint loss function, i The control point number has a range of values. i =1, 2, 3, 4……q-2, the (i-1)th control point line segment is the control point. With control points The line segments between the control points, the i-th control point line segment is the control point. With control points The line segments between, The first quasi-uniform B-spline curve on a cubic curve i -1 control point line segment and the first i The included angle between the control point line segments, L i-1 Let be the length of the (i-1)th control point line segment. L i Let q be the length of the line segment of the i-th control point, q be the number of control points on the cubic quasi-uniform B-spline curve, and C1 be a value greater than or equal to -1 and less than or equal to 1.
27. The method according to claim 26, characterized in that, Calculate using the following formula : in, for With control points The first vector of the line segment between them. for and The second vector of the line segment between them. , , These are the coordinate information of the corresponding control points; Calculate the number using the following formula. i Length of the control point line segment: Calculate the number using the following formula. Length of the control point line segment: 。 28. The method according to claim 20, characterized in that, The method further includes: For each control point, the vector is updated smoothly by accumulating the included angle error component and the length error component; The sum of the obstacle avoidance update vector and the smooth update vector is used as the comprehensive update vector.
29. The method according to claim 8, characterized in that, The coordinate information of the control points is iteratively updated; wherein, each iteration updates the coordinate information of the control points based on the comprehensive update vector, and updates the path curve based on the updated coordinate information of the control points, wherein the comprehensive update vector is the sum of the obstacle avoidance update vector and the smoothing update vector; the termination condition of the iterative update is that there are no collision points on the updated path curve, or the number of iterations reaches the preset second iteration number.
30. The method according to claim 29, characterized in that, The method further includes: For each control point, the coordinate information of the control point is updated based on the coordinate information of the control point obtained in the previous iteration, the learning rate corresponding to the current iteration, and the comprehensive update vector.
31. The method according to claim 30, characterized in that, The coordinate information of the control points is updated based on the following formula: in, The control point corresponding to the (k+1)th iteration Coordinate information, The control point corresponding to the k-th iteration Coordinate information, Let k be the learning rate corresponding to the k-th iteration. This is the comprehensive update vector obtained in the k-th iteration.
32. The method according to claim 31, characterized in that, The method further includes: Determine whether the number of collision points has not decreased in two consecutive iterations. This means that the number of collision points in the current iteration is not less than the number of collision points in the previous iteration, and the number of collision points in the previous iteration is not less than the number of collision points in the iteration before that. If so, the product of the current learning rate and the decay coefficient is used as the learning rate for the next iteration. Otherwise, the current learning rate is used as the learning rate for the next iteration.
33. An electronic device, characterized in that, include: Memory, used to store program instructions; The processor is configured to invoke the program instructions stored in the memory and execute the following steps according to the obtained program: Based on the coordinate information of the preset necessary points, the coordinate information of the intermediate control points is determined, wherein the necessary points include the starting point, the intermediate points, and the ending point; Based on the coordinate information of the intermediate control points and the coordinate information of the necessary points, an initial path curve is generated; Based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints, the coordinate information of control points on the initial path curve is iteratively optimized to generate optimized coordinate information of control points, wherein the control points include waypoints and intermediate control points; After generating the optimized path curve based on the optimized control point coordinate information, the generated optimized path curve is used as the planned path.
34. A path generation apparatus, characterized in that, include: The determination module is used to determine the coordinate information of intermediate control points based on the preset coordinate information of necessary points, wherein the necessary points include the starting point, the intermediate points, and the ending point; The generation module is used to generate an initial path curve based on the coordinate information of the intermediate control points and the coordinate information of the necessary points; iteratively optimize the coordinate information of the control points on the initial path curve based on at least one of position constraints, obstacle avoidance constraints, and smoothness constraints to generate optimized coordinate information of the control points, wherein the control points include waypoints and intermediate control points; after generating the optimized path curve according to the optimized control point coordinate information, the generated optimized path curve is used as the planned path.
