Trajectory planning methods, apparatus, computer equipment, and computer-readable storage media
By dynamically configuring the maximum curvature and the rate of change of curvature, a combination of spiral trajectory and circular trajectory is constructed, which solves the problem of curvature abrupt change in traditional trajectory planning, realizes the continuous connection of trajectory, improves control accuracy and motion stability, and enhances the flexibility and adaptability of trajectory planning.
Patent Information
- Application Number
- CN202511142285.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-15
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-08-15
AI Technical Summary
In traditional trajectory planning methods, the trajectories generated by Dubins curves and Reeds-Shepp curves exhibit abrupt changes in curvature, leading to unstable control in high-speed motion scenarios and affecting task execution efficiency and platform security.
By generating a basic trajectory and utilizing dynamically set curvature-related parameters, including maximum curvature and rate of change of curvature, a combination of spiral trajectory and circular arc trajectory is constructed. Combined with a quadratic function heading angle model, the maximum curvature circular arc trajectory is smoothly connected, and the tangent is determined based on the relationship between the distance between the two centers and the sum of the radii, forming a continuous overall planned trajectory.
It achieves continuous connection of trajectory curvature, improves control accuracy and motion stability, enhances the flexibility and adaptability of trajectory planning, and meets the curvature characteristic requirements in different scenarios.
Smart Images

Figure CN120740599B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of trajectory planning technology. Specifically, this application relates to a trajectory planning method, apparatus, computer device, and computer-readable storage medium. Background Technology
[0002] When working on unmanned mobile platforms (such as unmanned wheeled robots, unmanned vehicles, etc.), it is necessary to travel from the starting point to the target point to perform tasks. This process relies on the trajectory generated by global path planning to guide the mobile platform's route.
[0003] Traditional trajectory planning methods typically use Dubins or Reeds-Shepp curves to generate the base trajectory. However, trajectories generated by these two curves suffer from abrupt changes in curvature. Without subsequent trajectory smoothing optimization, such trajectories with abrupt curvature changes can lead to control instability in high-speed motion scenarios, affecting task execution efficiency and platform security. Summary of the Invention
[0004] Therefore, it is necessary to provide a trajectory planning method, apparatus, computer device, and computer-readable storage medium to address the aforementioned technical problems.
[0005] Firstly, this application provides a trajectory planning method. The method includes:
[0006] A basic trajectory is generated based on dynamically set curvature-related parameters; wherein, the curvature-related parameters include the maximum curvature and the rate of change of curvature; the basic trajectory is composed of a spiral trajectory with variable curvature and a circular arc trajectory with fixed curvature connected together, wherein the curvature of the spiral trajectory gradually increases from the initial value to the maximum curvature at the rate of change of curvature, the curvature of the circular arc trajectory is the maximum curvature, and the heading angle variation function of the spiral trajectory is a quadratic function of the distance from the trajectory point to the starting point;
[0007] Multiple basic trajectories for the starting point are generated by expanding outwards along multiple preset directions, centered on the starting point; multiple basic trajectories for the target point are generated by expanding outwards along multiple preset directions, centered on the target point; and the basic trajectories of the starting point and the target point are combined to form multiple trajectory combinations.
[0008] Each basic trajectory generated by diffusion is equivalent to a circular trajectory corresponding to the maximum curvature. For the starting point circular trajectory and the target point circular trajectory in each trajectory combination, the tangents corresponding to the two circles are determined according to the relationship between the distance between the two centers and the sum of the radii of the two circles. Tangents whose directions are consistent with the heading of the corresponding circular trajectory at the tangent point are selected. Sub-trajectories from the starting point basic trajectory from the starting point to the tangent point of the selected tangent on the corresponding starting point circular trajectory are extracted. Sub-trajectories from the target point basic trajectory from the tangent point of the selected tangent on the corresponding target point circular trajectory to the target point are extracted. The selected tangents are connected with the corresponding extracted starting point basic sub-trajectories and target point basic sub-trajectories to form the overall planned trajectory.
[0009] In one embodiment, the heading angle variation function of the spiral trajectory is as follows:
[0010] ;
[0011] in, The heading angle represents the trajectory. This represents the distance from the trajectory point to the starting point. Represents the coefficients of the function.
[0012] In one embodiment, the It is calculated using the following formula:
[0013] Calculate the heading angle corresponding to the point of maximum curvature. :
[0014] ;
[0015] in, Indicates the maximum turning radius. Indicates the rate of change of curvature;
[0016] Calculate the distance from the point of maximum curvature to the starting point. :
[0017] ;
[0018] Based on the heading angle variation function of the spiral trajectory, the first derivative is calculated to obtain... :
[0019] .
[0020] In one embodiment, multiple basic trajectories for the starting point are generated by expanding outwards along multiple preset directions, centered on the starting point; multiple basic trajectories for the target point are generated by expanding outwards along multiple preset directions, centered on the target point; and the basic trajectories of the starting point and the target point are combined to form multiple trajectory combinations, including:
[0021] Centered on the starting point, four basic trajectories are generated by spreading out in four directions: left front, right front, left back, and right back.
[0022] Centered on the target point, four basic trajectories for the target point are generated by expanding outwards in four directions: left front, right front, left rear, and right rear.
[0023] The four starting point base trajectories are combined with the four target point base trajectories to form sixteen trajectory combinations.
[0024] In one embodiment, determining the corresponding tangents of the two circles based on the relationship between the distance between their centers and the sum of their radii includes:
[0025] If the distance between the centers of the two circles is greater than the sum of their radii, then calculate the four tangents of the two circles;
[0026] If the distance between the centers of two circles is less than or equal to the sum of their radii, then calculate the two tangents to the two circles.
[0027] In one embodiment, the method further includes:
[0028] For each overall planning trajectory, check whether it intersects with environmental obstacles. If it intersects, discard the overall planning trajectory; if it does not intersect, mark the overall planning trajectory as a collision-free trajectory.
[0029] The cost function for each collision-free trajectory is calculated using a weighted method; wherein the cost function includes the number of gear shifts and the trajectory length.
[0030] The collision-free trajectory with the minimum cost function value is selected as the final planned trajectory for execution.
[0031] Secondly, this application provides a trajectory planning device. The device includes:
[0032] A basic trajectory generation module is used to generate a basic trajectory based on dynamically set curvature-related parameters. These curvature-related parameters include maximum curvature and rate of change of curvature. The basic trajectory is composed of a spiral trajectory with variable curvature and a circular arc trajectory with fixed curvature connected together. The curvature of the spiral trajectory gradually increases from an initial value to the maximum curvature using the rate of change of curvature. The curvature of the circular arc trajectory is the maximum curvature. The heading angle variation function of the spiral trajectory is a quadratic function of the distance from the trajectory point to the starting point.
[0033] The basic trajectory combination module is used to generate multiple basic trajectories of the starting point and spread them out in multiple preset directions, centered on the starting point; to generate multiple basic trajectories of the target point and spread them out in multiple preset directions, centered on the target point; and to combine the basic trajectories of the starting point and the target point to form a variety of trajectory combinations.
[0034] The overall trajectory planning module is used to convert each basic trajectory generated by diffusion into an equivalent circular trajectory corresponding to the maximum curvature. For the starting point circular trajectory and the target point circular trajectory in each trajectory combination, the tangents corresponding to the two circles are determined according to the relationship between the distance between the two center points and the sum of the radii of the two circles. The tangents whose directions are consistent with the heading of the corresponding circular trajectory at the tangent point are selected. The sub-trajectory from the starting point basic trajectory from the starting point to the tangent point of the selected tangent on the corresponding starting point circular trajectory is extracted. The sub-trajectory from the target point basic trajectory from the tangent point of the selected tangent on the corresponding target point circular trajectory to the target point is extracted. The selected tangents are connected with the corresponding extracted starting point basic sub-trajectory and target point basic sub-trajectory to form the overall planned trajectory.
[0035] In one embodiment, the device further includes a trajectory evaluation and selection module, used to check whether each overall planned trajectory intersects with environmental obstacles; if it intersects, the overall planned trajectory is discarded; if it does not intersect, the overall planned trajectory is marked as a collision-free trajectory; calculate the cost function of each collision-free trajectory in a weighted manner; wherein the cost function includes the number of gear shifts and the trajectory length; and select the collision-free trajectory with the smallest cost function value as the final planned trajectory to be executed.
[0036] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0037] A basic trajectory is generated based on dynamically set curvature-related parameters; wherein, the curvature-related parameters include the maximum curvature and the rate of change of curvature; the basic trajectory is composed of a spiral trajectory with variable curvature and a circular arc trajectory with fixed curvature connected together, wherein the curvature of the spiral trajectory gradually increases from the initial value to the maximum curvature at the rate of change of curvature, the curvature of the circular arc trajectory is the maximum curvature, and the heading angle variation function of the spiral trajectory is a quadratic function of the distance from the trajectory point to the starting point;
[0038] Multiple basic trajectories for the starting point are generated by expanding outwards along multiple preset directions, centered on the starting point; multiple basic trajectories for the target point are generated by expanding outwards along multiple preset directions, centered on the target point; and the basic trajectories of the starting point and the target point are combined to form multiple trajectory combinations.
[0039] Each basic trajectory generated by diffusion is equivalent to a circular trajectory corresponding to the maximum curvature. For the starting point circular trajectory and the target point circular trajectory in each trajectory combination, the tangents corresponding to the two circles are determined according to the relationship between the distance between the two centers and the sum of the radii of the two circles. Tangents whose directions are consistent with the heading of the corresponding circular trajectory at the tangent point are selected. Sub-trajectories from the starting point basic trajectory from the starting point to the tangent point of the selected tangent on the corresponding starting point circular trajectory are extracted. Sub-trajectories from the target point basic trajectory from the tangent point of the selected tangent on the corresponding target point circular trajectory to the target point are extracted. The selected tangents are connected with the corresponding extracted starting point basic sub-trajectories and target point basic sub-trajectories to form the overall planned trajectory.
[0040] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0041] A basic trajectory is generated based on dynamically set curvature-related parameters; wherein, the curvature-related parameters include the maximum curvature and the rate of change of curvature; the basic trajectory is composed of a spiral trajectory with variable curvature and a circular arc trajectory with fixed curvature connected together, wherein the curvature of the spiral trajectory gradually increases from the initial value to the maximum curvature at the rate of change of curvature, the curvature of the circular arc trajectory is the maximum curvature, and the heading angle variation function of the spiral trajectory is a quadratic function of the distance from the trajectory point to the starting point;
[0042] Multiple basic trajectories for the starting point are generated by expanding outwards along multiple preset directions, centered on the starting point; multiple basic trajectories for the target point are generated by expanding outwards along multiple preset directions, centered on the target point; and the basic trajectories of the starting point and the target point are combined to form multiple trajectory combinations.
[0043] Each basic trajectory generated by diffusion is equivalent to a circular trajectory corresponding to the maximum curvature. For the starting point circular trajectory and the target point circular trajectory in each trajectory combination, the tangents corresponding to the two circles are determined according to the relationship between the distance between the two centers and the sum of the radii of the two circles. Tangents whose directions are consistent with the heading of the corresponding circular trajectory at the tangent point are selected. Sub-trajectories from the starting point basic trajectory from the starting point to the tangent point of the selected tangent on the corresponding starting point circular trajectory are extracted. Sub-trajectories from the target point basic trajectory from the tangent point of the selected tangent on the corresponding target point circular trajectory to the target point are extracted. The selected tangents are connected with the corresponding extracted starting point basic sub-trajectories and target point basic sub-trajectories to form the overall planned trajectory.
[0044] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0045] A basic trajectory is generated based on dynamically set curvature-related parameters; wherein, the curvature-related parameters include the maximum curvature and the rate of change of curvature; the basic trajectory is composed of a spiral trajectory with variable curvature and a circular arc trajectory with fixed curvature connected together, wherein the curvature of the spiral trajectory gradually increases from the initial value to the maximum curvature at the rate of change of curvature, the curvature of the circular arc trajectory is the maximum curvature, and the heading angle variation function of the spiral trajectory is a quadratic function of the distance from the trajectory point to the starting point;
[0046] Multiple basic trajectories for the starting point are generated by expanding outwards along multiple preset directions, centered on the starting point; multiple basic trajectories for the target point are generated by expanding outwards along multiple preset directions, centered on the target point; and the basic trajectories of the starting point and the target point are combined to form multiple trajectory combinations.
[0047] Each basic trajectory generated by diffusion is equivalent to a circular trajectory corresponding to the maximum curvature. For the starting point circular trajectory and the target point circular trajectory in each trajectory combination, the tangents corresponding to the two circles are determined according to the relationship between the distance between the two centers and the sum of the radii of the two circles. Tangents whose directions are consistent with the heading of the corresponding circular trajectory at the tangent point are selected. Sub-trajectories from the starting point basic trajectory from the starting point to the tangent point of the selected tangent on the corresponding starting point circular trajectory are extracted. Sub-trajectories from the target point basic trajectory from the tangent point of the selected tangent on the corresponding target point circular trajectory to the target point are extracted. The selected tangents are connected with the corresponding extracted starting point basic sub-trajectories and target point basic sub-trajectories to form the overall planned trajectory.
[0048] The aforementioned trajectory planning method, apparatus, computer equipment, and computer-readable storage medium construct a basic trajectory consisting of a spiral trajectory generated by a quadratic function heading angle model and a circular arc trajectory with a fixed maximum curvature by dynamically configuring the maximum curvature and the rate of change of curvature. The curvature of the spiral trajectory starts from zero and increases uniformly to the maximum curvature at a constant rate of change, then smoothly connects to the circular arc trajectory with the maximum curvature. The basic trajectory generated by the multi-directional diffusion from the starting point and the target point is then equivalent to a circular trajectory corresponding to the maximum curvature. The tangent is determined using the relationship between the distance between the two centers and the sum of their radii, and tangents whose directions align with the heading of the circular trajectory at the tangent point are selected for trajectory connection. This effectively solves the problem of abrupt and discontinuous curvature changes in traditional trajectory planning, achieving continuous curvature connection throughout the entire trajectory from the starting point to the target point, thus improving control accuracy and motion stability. Simultaneously, the maximum curvature and the rate of change of curvature, as dynamically adjustable parameters, can be dynamically set before planning according to different vehicle and trajectory requirements, meeting diverse requirements for curvature characteristics in different scenarios and enhancing the flexibility and adaptability of trajectory planning. Attached Figure Description
[0049] Figure 1This is a flowchart illustrating a trajectory planning method in one embodiment;
[0050] Figure 2 This is a schematic diagram of the basic trajectories of the starting point and the target point in one embodiment;
[0051] Figure 3 This is a schematic diagram of the tangent trajectories of two arcs selected in one embodiment;
[0052] Figure 4 This is a schematic diagram of the final calculated overall planning trajectory in one embodiment;
[0053] Figure 5 This is a structural block diagram of a trajectory planning device in one embodiment;
[0054] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0056] In one embodiment, such as Figure 1 As shown, a trajectory planning method is provided, which includes the following steps S102-S106:
[0057] Step S102: Generate the basic trajectory based on the dynamically set curvature-related parameters.
[0058] The curvature-related parameters include maximum curvature and rate of change of curvature. The basic trajectory consists of a spiral trajectory with variable curvature and a circular arc trajectory with fixed curvature connected together. The curvature of the spiral trajectory gradually increases from its initial value to its maximum curvature at the rate of change of curvature, while the curvature of the circular arc trajectory is the maximum curvature. The heading angle variation function of the spiral trajectory is a quadratic function of the distance from the trajectory point to the starting point.
[0059] Specifically, firstly, based on the dynamically set maximum curvature and rate of change of curvature The spiral trajectory is calculated and represented as a curve. For trajectory simplification, the initial heading angle is set to 0° and the rate of curvature change is constant. The heading angle variation function of the spiral trajectory is determined as follows:
[0060] .
[0061] in, The heading angle represents the trajectory. This represents the distance (length) from the current trajectory point to the starting point of the trajectory. Represents the coefficients of the function.
[0062] The calculation is derived using the following original formula. coefficient:
[0063] Calculate the heading angle corresponding to the point of maximum curvature (the trajectory point with the greatest curvature). :
[0064] .
[0065] in, Indicates the maximum turning radius. , This represents the rate of change of curvature.
[0066] Calculate the distance from the point of maximum curvature to the starting point of the trajectory. :
[0067] .
[0068] Based on the heading angle variation function of the spiral trajectory, the first derivative is calculated to obtain... :
[0069] .
[0070] The resulting spiral trajectory is at a distance The inner curvature increases uniformly from 0 to .
[0071] When the curvature reaches its maximum curvature Subsequently, the spiral trajectory seamlessly connects to a fixed curvature. The circular arc trajectory forms the basic trajectory.
[0072] Step S104: Generate multiple basic trajectories of the starting point along multiple preset directions, centered on the starting point; generate multiple basic trajectories of the target point along multiple preset directions, centered on the target point; combine the basic trajectories of the starting point and the target point to form multiple trajectory combinations.
[0073] Specifically, the global planning considers both forward and backward directions. Therefore, starting from the starting point, four basic starting point trajectories are generated in the four directions of left-front, right-front, left-back, and right-back. Similarly, four basic target point trajectories are generated by expanding outwards in the four directions of left-front, right-front, left-back, and right-back from the target point. Combining these four starting point trajectories with the four target point trajectories results in sixteen possible trajectory combinations. Figure 2 This is an example of the basic trajectory for the starting point and the target point, respectively.
[0074] Step S106: Each basic trajectory generated by diffusion is equivalent to a circular trajectory corresponding to the maximum curvature; for the starting point circular trajectory and the target point circular trajectory in each trajectory combination, the tangents corresponding to the two circles are determined according to the relationship between the distance between the two center points and the sum of the radii of the two circles, and the tangents whose directions are consistent with the heading of the corresponding circular trajectory at the tangent point are selected, such as... Figure 3 As shown; the sub-trajectory from the starting point's basic trajectory, from the starting point to the point of tangency of the selected tangent lines on the starting circle, is extracted; the sub-trajectory from the target point's basic trajectory, from the point of tangency of the selected tangent lines on the target circle, is extracted to the target point. The selected tangent lines are then connected to the corresponding extracted sub-trajectories of the starting point and the target point to form the overall planned trajectory, as shown. Figure 4 As shown.
[0075] Specifically, sixteen trajectory combinations are calculated to find a reasonable trajectory. After the basic trajectory is expanded, it is simplified into a circular trajectory with maximum curvature. Therefore, it is necessary to calculate the center of the trajectory circle corresponding to the current starting point and the target point, and then calculate the corresponding tangent of the circular arc based on the distance relationship between the center. If the distance between the center is greater than twice the radius, then the two circles correspond to four tangents. If the distance between the center is less than or equal to twice the radius, then the two circles correspond to two tangents. Then, it is calculated whether the heading direction of the tangent is consistent with the heading direction of the circular arc. If they are consistent, the trajectory calculation is complete. The calculated overall planned trajectory includes the sub-trajectory from the starting point basic trajectory from the starting point to the point of tangency of the selected tangent on the starting circle, the straight tangent trajectory, and the sub-trajectory from the point of tangency of the selected tangent on the target circle to the target point from the selected target point basic trajectory.
[0076] The aforementioned trajectory planning method dynamically configures the maximum curvature and the rate of change of curvature to construct a basic trajectory consisting of a spiral trajectory generated by a quadratic function heading angle model and a circular arc trajectory with a fixed maximum curvature. The curvature of the spiral trajectory starts from zero and increases uniformly to the maximum curvature at a constant rate of change, then smoothly connects to the circular arc trajectory with the maximum curvature. The basic trajectory generated by the multi-directional diffusion from the starting point and the target point is then equivalent to a circular trajectory corresponding to the maximum curvature. The tangent is determined using the relationship between the distance between the two centers and the sum of their radii, and tangents whose directions align with the heading of the circular trajectory at the tangent point are selected for trajectory connection. This effectively solves the problem of abrupt and discontinuous curvature changes in traditional trajectory planning, achieving continuous curvature connection throughout the entire trajectory from the starting point to the target point, thus improving control accuracy and motion stability. Furthermore, the maximum curvature and the rate of change of curvature, as dynamically adjustable parameters, can be dynamically set before planning according to different vehicle and trajectory requirements, meeting diverse requirements for curvature characteristics in different scenarios and enhancing the flexibility and adaptability of trajectory planning.
[0077] In one embodiment, the method further includes the following steps S1082-S1086:
[0078] Step S1082: For each overall planning trajectory, check whether it intersects with environmental obstacles. If it intersects, discard the overall planning trajectory. If it does not intersect, mark the overall planning trajectory as a collision-free trajectory.
[0079] Step S1084: Calculate the cost function for each collision-free trajectory using a weighted method;
[0080] Step S1086: Select the collision-free trajectory with the minimum cost function value as the final planned trajectory to be executed.
[0081] The cost function includes the number of gear shifts and the trajectory length.
[0082] Specifically, collision detection and cost calculation are performed on all the successfully calculated overall planning trajectories. The cost calculation uses a weighted approach to calculate the overall cost function, which includes the number of trajectory shifts and the trajectory length. .in, This represents the weighting coefficient. Finally, the trajectory with no collisions and the minimum cost is selected as the output trajectory.
[0083] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0084] Based on the same inventive concept, this application also provides a trajectory planning device for implementing the trajectory planning method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more trajectory planning device embodiments provided below can be found in the limitations of the trajectory planning method described above, and will not be repeated here.
[0085] In one embodiment, such as Figure 5 As shown, a trajectory planning device is provided. The device includes:
[0086] The basic trajectory generation module 202 is used to generate a basic trajectory based on dynamically set curvature-related parameters. The curvature-related parameters include the maximum curvature and the rate of change of curvature. The basic trajectory is composed of a spiral trajectory with variable curvature and a circular arc trajectory with fixed curvature. The curvature of the spiral trajectory gradually increases from the initial value to the maximum curvature at the rate of change of curvature. The curvature of the circular arc trajectory is the maximum curvature. The heading angle variation function of the spiral trajectory is a quadratic function of the distance from the trajectory point to the starting point.
[0087] The basic trajectory combination module 204 is used to generate multiple basic trajectories of the starting point along multiple preset directions with the starting point as the center; to generate multiple basic trajectories of the target point along multiple preset directions with the target point as the center; and to combine the basic trajectories of the starting point and the target point to form multiple trajectory combinations.
[0088] The overall trajectory planning module 206 is used to convert each basic trajectory generated by diffusion into an equivalent circular trajectory corresponding to the maximum curvature. For the starting point circular trajectory and the target point circular trajectory in each trajectory combination, the tangents corresponding to the two circles are determined according to the relationship between the distance between the two center points and the sum of the radii of the two circles. The tangents whose directions are consistent with the heading of the corresponding circular trajectory at the tangent point are selected. The sub-trajectory from the starting point basic trajectory from the starting point to the tangent point of the selected tangent on the corresponding starting point circular trajectory is extracted. The sub-trajectory from the target point basic trajectory from the tangent point of the selected tangent on the corresponding target point circular trajectory to the target point is extracted. The selected tangents are connected with the corresponding extracted starting point basic sub-trajectory and target point basic sub-trajectory to form the overall planned trajectory.
[0089] In the aforementioned trajectory planning device, by dynamically configuring the maximum curvature and the rate of change of curvature, a basic trajectory is constructed, consisting of a spiral trajectory generated by a quadratic function heading angle model and a circular arc trajectory with a fixed maximum curvature. The curvature of the spiral trajectory starts from zero and increases uniformly to the maximum curvature at a constant rate of change, then smoothly connects to the circular arc trajectory with the maximum curvature. The basic trajectory generated by the multi-directional diffusion from the starting point and the target point is then equivalent to a circular trajectory corresponding to the maximum curvature. The tangent is determined using the relationship between the distance between the two centers and the sum of their radii, and tangents whose directions are consistent with the heading of the circular trajectory at the tangent point are selected for trajectory connection. This effectively solves the problem of abrupt and discontinuous curvature changes in traditional trajectory planning, achieving continuous curvature connection throughout the entire trajectory from the starting point to the target point, improving control accuracy and motion stability. Simultaneously, the maximum curvature and the rate of change of curvature, as dynamically adjustable parameters, can be dynamically set before planning according to different vehicle and trajectory requirements, meeting diverse requirements for curvature characteristics in different scenarios and enhancing the flexibility and adaptability of trajectory planning.
[0090] It should be noted that the trajectory planning device provided in the above embodiments is only illustrated by the division of the above functional modules when implementing the corresponding functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the trajectory planning device and the trajectory planning method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0091] According to one aspect of this application, embodiments of the present invention also provide a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication component. When the computer program is executed by a processor, the trajectory planning method provided in embodiments of this application is performed.
[0092] Furthermore, embodiments of the present invention also provide a computer device, which includes a processor and a memory. The memory stores a computer program, and the processor is capable of executing the computer program stored in the memory. When the computer program is executed by the processor, it can implement the trajectory planning method provided in any of the above embodiments.
[0093] For example, Figure 6 An embodiment of the present invention provides a computer device, which includes a bus 1110, a processor 1120, a transceiver 1130, a bus interface 1140, a memory 1150, and a user interface 1160.
[0094] In this embodiment of the invention, the device further includes a computer program stored in a memory 1150 and executable on a processor 1120, which, when executed by the processor 1120, implements the various processes of the above-described trajectory planning method embodiment.
[0095] Transceiver 1130 is used to receive and send data under the control of processor 1120.
[0096] In this embodiment of the invention, a bus architecture (represented by bus 1110) is used. Bus 1110 may include any number of interconnected buses and bridges. Bus 1110 connects various circuits, including one or more processors represented by processor 1120 and memory represented by memory 1150.
[0097] Bus 1110 represents one or more of several types of bus architectures, including memory buses and memory controllers, peripheral buses, Accelerated Graphics Port (AGP), processors, or local buses using any bus architecture from various bus architectures. As an example and not a limitation, such architectures include: Industry Standard Architecture (ISA) buses, Micro Channel Architecture (MCA) buses, Enhanced ISA (EISA) buses, Video Electronics Standards Association (VESA) buses, and Peripheral Component Interconnect (PCI) buses.
[0098] The processor 1120 can be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The processors mentioned above include: general-purpose processors, central processing units (CPUs), network processors (NPs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), complex programmable logic devices (CPLDs), programmable logic arrays (PLAs), microcontroller units (MCUs) or other programmable logic devices, discrete gates, transistor logic devices, and discrete hardware components. They can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. For example, the processor can be a single-core processor or a multi-core processor, and the processor can be integrated on a single chip or located on multiple different chips.
[0099] Processor 1120 can be a microprocessor or any conventional processor. The method steps disclosed in the embodiments of the present invention can be directly executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in readable storage media known in the art, such as Random Access Memory (RAM), Flash Memory, Read-Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), registers, etc. The readable storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0100] Bus 1110 can also connect various other circuits, such as peripheral devices, voltage regulators, or power management circuits. Bus interface 1140 provides an interface between bus 1110 and transceiver 1130, all of which are well known in the art. Therefore, embodiments of the present invention will not be described further.
[0101] Transceiver 1130 can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. For example, transceiver 1130 receives external data from other devices, and transceiver 1130 is used to send data processed by processor 1120 to other devices. Depending on the nature of the computer system, a user interface 1160 may also be provided, such as a touchscreen, physical keyboard, monitor, mouse, speaker, microphone, trackball, joystick, or stylus.
[0102] It should be understood that, in embodiments of the present invention, memory 1150 may further include memory remotely configured relative to processor 1120, and such remotely configured memory can be connected to a server via a network. One or more portions of the aforementioned network may be an ad hoc network, intranet, extranet, virtual private network (VPN), local area network (LAN), wireless local area network (WLAN), wide area network (WAN), wireless wide area network (WWAN), metropolitan area network (MAN), Internet, public switched telephone network (PSTN), ordinary old-style telephone service (POTS), cellular telephone network, wireless network, Wi-Fi network, and combinations of two or more of the aforementioned networks. For example, cellular telephone networks and wireless networks can be Global System for Mobile Communications (GSM), Code Division Multiple Access (CDMA), WiMAX, General Packet Radio Service (GPRS), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), LTE Frequency Division Duplex (FDD), LTE Time Division Duplex (TDD), Advanced Long Term Evolution (LTE-A), Universal Mobile Telecommunications System (UMTS), Enhanced Mobile Broadband (eMBB), Massive Machine Type Communication (mMTC), Ultra Reliable Low Latency Communications (uRLLC), etc.
[0103] It should be understood that the memory 1150 in the embodiments of the present invention may be volatile memory or non-volatile memory, or may include both volatile memory and non-volatile memory. Non-volatile memory includes: read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory.
[0104] Volatile memory includes random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (Synchlink DRAM, SLDRAM), and direct memory bus RAM (DRRAM). The memory 1150 described in this embodiment includes, but is not limited to, the above and any other suitable types of memory.
[0105] In this embodiment of the invention, the memory 1150 stores the following elements of the operating system 1151 and the application 1152: executable modules, data structures, or subsets thereof, or extended sets thereof.
[0106] Specifically, the operating system 1151 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 1152 includes various applications, such as a media player and a browser, used to implement various application functions. Programs implementing the methods of this embodiment of the invention can be included in the application program 1152. The application program 1152 includes applets, objects, components, logic, data structures, and other computer system executable instructions that perform specific tasks or implement specific abstract data types.
[0107] In addition, this embodiment of the invention also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the various processes of the above-described trajectory planning method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0108] Computer-readable storage media include: permanent and non-permanent, removable and non-removable media, which are tangible devices capable of retaining and storing instructions for use by an instruction execution device. Computer-readable storage media include: electronic storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, and any suitable combination thereof. Computer-readable storage media include: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, optical disc read-only memory (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape storage, magnetic disk storage or other magnetic storage devices, memory sticks, mechanical encoding devices (such as punched cards or raised structures in grooves on which instructions are recorded), or any other non-transfer medium that can be used to store information accessible by a computing device. As defined in the embodiments of the present invention, a computer-readable storage medium does not include the temporary signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses passing through optical fiber cables), or electrical signals transmitted through wires.
[0109] In the description of the embodiments of the present invention, those skilled in the art should understand that the embodiments of the present invention can be implemented as methods, apparatuses, devices, and storage media. Therefore, the embodiments of the present invention can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software. Furthermore, in some embodiments, the embodiments of the present invention can also be implemented as a computer program product in one or more computer-readable storage media, the computer-readable storage media containing computer program code.
[0110] The aforementioned computer-readable storage medium may be any combination of one or more computer-readable storage media. Computer-readable storage media include: electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, optical disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any combination thereof. In embodiments of the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0111] The computer program code contained in the aforementioned computer-readable storage medium may be transmitted using any suitable medium, including wireless, wire, optical fiber, radio frequency (RF), or any suitable combination thereof.
[0112] Computer program code for performing the operations of the embodiments of the present invention can be written in assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, integrated circuit configuration data, or in one or more programming languages or a combination thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The computer program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer or an external computer via any type of network, including a local area network (LAN) or a wide area network (WAN).
[0113] It should be understood that each block of a flowchart and / or block diagram, as well as combinations of blocks in a flowchart and / or block diagram, can be implemented by computer-readable program instructions. These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine that, when executed by a computer or other programmable data processing apparatus, creates means for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.
[0114] These computer-readable program instructions may also be stored in a computer-readable storage medium that enables a computer or other programmable data processing device to function in a particular manner. In this way, the instructions stored in the computer-readable storage medium produce an instruction apparatus product that includes the functions / operations specified in the blocks of a flowchart and / or block diagram.
[0115] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer-implemented process, such that the instructions that execute on the computer or other programmable data processing apparatus provide a process for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.
[0116] The above description is merely a specific implementation of the embodiments of the present invention, but the protection scope of the embodiments of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of the present invention should be included within the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention should be determined by the protection scope of the claims.
Claims
1. A trajectory planning method, characterized in that, The method includes: A basic trajectory is generated based on dynamically set curvature-related parameters; wherein, the curvature-related parameters include the maximum curvature and the rate of change of curvature; the basic trajectory is composed of a spiral trajectory with variable curvature and a circular arc trajectory with fixed curvature connected together, wherein the curvature of the spiral trajectory gradually increases from the initial value to the maximum curvature at the rate of change of curvature, the curvature of the circular arc trajectory is the maximum curvature, and the heading angle variation function of the spiral trajectory is a quadratic function of the distance from the trajectory point to the starting point; Multiple basic trajectories for the starting point are generated by expanding outwards along multiple preset directions, centered on the starting point; multiple basic trajectories for the target point are generated by expanding outwards along multiple preset directions, centered on the target point; and the basic trajectories for the starting point and the target point are combined to form multiple trajectory combinations. Each basic trajectory generated by diffusion is equivalent to a circular trajectory corresponding to the maximum curvature. For the starting point circular trajectory and the target point circular trajectory in each trajectory combination, the tangents corresponding to the two circles are determined according to the relationship between the distance between the two centers and the sum of the radii of the two circles. Tangents whose directions are consistent with the heading of the corresponding circular trajectory at the tangent point are selected. Sub-trajectories from the starting point basic trajectory from the starting point to the tangent point of the selected tangent on the corresponding starting point circular trajectory are extracted. Sub-trajectories from the target point basic trajectory from the tangent point of the selected tangent on the corresponding target point circular trajectory to the target point are extracted. The selected tangents are connected with the corresponding extracted starting point basic sub-trajectories and target point basic sub-trajectories to form the overall planned trajectory.
2. The method according to claim 1, characterized in that, The heading angle variation function of the spiral trajectory is as follows: ; in, The heading angle represents the trajectory. This represents the distance from the trajectory point to the starting point. Represents the coefficients of the function.
3. The method according to claim 2, characterized in that, The It is calculated using the following formula: Calculate the heading angle corresponding to the point of maximum curvature. : ; in, Indicates the maximum turning radius. Indicates the rate of change of curvature; Calculate the distance from the point of maximum curvature to the starting point. : ; Based on the heading angle variation function of the spiral trajectory, the first derivative is calculated to obtain... : 。 4. The method according to claim 3, characterized in that, Multiple basic trajectories for the starting point are generated by expanding outwards along multiple preset directions, centered on the starting point; and multiple basic trajectories for the target point are generated by expanding outwards along multiple preset directions, centered on the target point. By combining the basic trajectories of the starting point and the target point, various trajectory combinations can be formed, including: Centered on the starting point, four basic trajectories are generated by spreading out in four directions: left front, right front, left back, and right back. Centered on the target point, four basic trajectories for the target point are generated by expanding outwards in four directions: left front, right front, left rear, and right rear. The four starting point base trajectories are combined with the four target point base trajectories to form sixteen trajectory combinations.
5. The method according to claim 4, characterized in that, Based on the relationship between the distance between the centers of two circles and the sum of their radii, determine the corresponding tangents of the two circles, including: If the distance between the centers of the two circles is greater than the sum of their radii, then calculate the four tangents of the two circles; If the distance between the centers of two circles is less than or equal to the sum of their radii, then calculate the two tangents to the two circles.
6. The method according to claim 5, characterized in that, The method further includes: For each overall planning trajectory, check whether it intersects with environmental obstacles. If it intersects, discard the overall planning trajectory; if it does not intersect, mark the overall planning trajectory as a collision-free trajectory. The cost function for each collision-free trajectory is calculated using a weighted method; wherein the cost function includes the number of gear shifts and the trajectory length. The collision-free trajectory with the minimum cost function value is selected as the final planned trajectory for execution.
7. A trajectory planning device, characterized in that, The device includes: A basic trajectory generation module is used to generate a basic trajectory based on dynamically set curvature-related parameters. These curvature-related parameters include maximum curvature and rate of change of curvature. The basic trajectory is composed of a spiral trajectory with variable curvature and a circular arc trajectory with fixed curvature connected together. The curvature of the spiral trajectory gradually increases from an initial value to the maximum curvature using the rate of change of curvature. The curvature of the circular arc trajectory is the maximum curvature. The heading angle variation function of the spiral trajectory is a quadratic function of the distance from the trajectory point to the starting point. The basic trajectory combination module is used to generate multiple basic trajectories of the starting point and spread them out in multiple preset directions, centered on the starting point; to generate multiple basic trajectories of the target point and spread them out in multiple preset directions, centered on the target point; and to combine the basic trajectories of the starting point and the target point to form a variety of trajectory combinations. The overall trajectory planning module is used to convert each basic trajectory generated by diffusion into an equivalent circular trajectory corresponding to the maximum curvature. For the starting point circular trajectory and the target point circular trajectory in each trajectory combination, the tangents corresponding to the two circles are determined according to the relationship between the distance between the two center points and the sum of the radii of the two circles. The tangents whose directions are consistent with the heading of the corresponding circular trajectory at the tangent point are selected. The sub-trajectory from the starting point basic trajectory from the starting point to the tangent point of the selected tangent on the corresponding starting point circular trajectory is extracted. The sub-trajectory from the target point basic trajectory from the tangent point of the selected tangent on the corresponding target point circular trajectory to the target point is extracted. The selected tangents are connected with the corresponding extracted starting point basic sub-trajectory and target point basic sub-trajectory to form the overall planned trajectory.
8. The apparatus according to claim 7, characterized in that, The device also includes a trajectory evaluation and selection module, which checks whether each overall planned trajectory intersects with environmental obstacles. If it intersects, the overall planned trajectory is discarded; if it does not intersect, the overall planned trajectory is marked as a collision-free trajectory. The cost function of each collision-free trajectory is calculated in a weighted manner. The cost function includes the number of gear shifts and the trajectory length. The collision-free trajectory with the smallest cost function value is selected as the final planned trajectory to be executed.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Automatic driving track control method and related equipment
CN115230741A
Test fitting trajectory generation method and device, equipment and medium
CN117288487A