Method, device, computer equipment and storage medium for determining motion trajectory
By generating a connecting trajectory that conforms to the curve smoothing rules, the problems of velocity mutation and acceleration discontinuity when trajectories are connected in the prior art are solved, and simplified calculation and continuous and differentiable motion trajectory generation are achieved.
Patent Information
- Application Number
- CN202211096156.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-08
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-09-08
AI Technical Summary
Existing Cartesian space trajectory smoothing methods are prone to causing sudden changes in velocity direction and acceleration discontinuity when connecting two trajectories that are not in the same plane. In addition, the length calculation of Bezier curves and spline curves is complex and there are sudden changes in velocity near the endpoints.
By obtaining the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table and the connection smoothing level, a connection trajectory is generated according to the preset curve smoothing rules to ensure that the derivative modulus of the real-time length of the trajectory relative to the target cumulative distance is continuous and no more than 1, and the derivatives of the starting and ending points of the connection trajectory are consistent with the endpoints to avoid inflection points.
It achieves the generation of continuous and differentiable connection trajectories with lower computing power, avoids the problems of sudden speed changes and discontinuous acceleration, and simplifies the computational complexity.
Smart Images

Figure CN116300849B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of robotics technology, and in particular to a method, device, computer equipment, and storage medium for determining a motion trajectory. Background Art
[0002] The robot's motion within its workspace consists of trajectories generated by user-input motion commands. Mathematically, these trajectories must connect seamlessly, which is a requirement for continuity. However, in real-world scenarios, we want the trajectories generated by motion commands to maintain continuous velocity and acceleration without jumps. This means the curves must exhibit C2 continuity (C2 continuity).
[0003] Existing methods for smoothing Cartesian trajectories rely on special curve connections. Specifically, they use a special curve to connect the two preceding and succeeding trajectories within the robot's turning zone. For example, circular arcs, Bezier curves, and spline curves are used to connect two straight trajectories. This method is useful in some situations. For example, using a circular arc to connect two straight lines allows for continuous and simultaneous calculation of both velocity and acceleration, making it relatively simple. However, it also has some significant drawbacks. For example, while circular arc connection is very easy for two consecutive straight lines, it inevitably requires inflection points for two circular arcs or a straight line and an arc that are not in the same plane, resulting in sudden changes in velocity and acceleration. Similarly, Bezier and spline curves can address the aforementioned issues of sudden changes in velocity and acceleration when connecting circular arcs, but their length calculation is very complex. Calculating only their parameters will inevitably result in sudden changes in velocity and acceleration near their endpoints. Summary of the Invention
[0004] Based on this, it is necessary to address the technical problems that the length calculation of the existing trajectory smoothing method based on Bezier curves and spline curves is very complicated, and if only the parameters are calculated, there will inevitably be speed mutations and acceleration discontinuities near the endpoints. A method, device, computer equipment and storage medium for determining the motion trajectory are proposed.
[0005] A method for determining a motion trajectory, the method comprising:
[0006] Obtaining a first trajectory, a second trajectory, a first parametric curve, a second parametric curve, a smoothing parameter table, and a connection smoothing level, wherein an end point of the first trajectory overlaps with a start point of the second trajectory;
[0007] A converging trajectory is generated according to preset curve smoothing rules based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the converging smoothing level, wherein the curve smoothing rules include: a modulus of a derivative of the real-time length of the first trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the second trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance is continuous, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance does not have a jump, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance is not greater than 1, a derivative at a starting point of the converging trajectory is equal to a derivative of the first trajectory with respect to the target cumulative distance, and a derivative at an ending point of the converging trajectory is equal to a derivative of the second trajectory with respect to the target cumulative distance, where the target cumulative distance is the cumulative distance relative to the starting point of the first trajectory;
[0008] The first trajectory, the connecting trajectory and the second trajectory are combined to obtain a target motion trajectory.
[0009] Furthermore, the step of generating a connection trajectory according to a preset curve smoothing rule based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the connection smoothing level includes:
[0010] According to the connection smoothing level, searching the smoothing length from the smoothing parameter table to obtain an expected value of the smoothing length;
[0011] Inputting the expected smoothing length value, the total length of the first trajectory, and the total length of the first parametric curve into a preset smoothing length selection function to perform smoothing length selection to obtain a smoothing length target value;
[0012] Calculate a smoothing start point and a smoothing end point according to the smoothing length target value, the total length of the first trajectory, and the total length of the first parametric curve;
[0013] The connection trajectory is generated according to the curve smoothing rule based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing length target value, the smoothing start point and the smoothing end point.
[0014] Furthermore, the calculation formula F(x) of the connection trajectory is expressed as:
[0015]
[0016] L x =xL a
[0017] L b =L a +2L
[0018] Wherein, L is the target value of the smoothing length, L a is the smoothing starting point, L b is the smoothing end point, f1() is the first trajectory, f2() is the second trajectory, g1() is the first parametric curve, g2() is the second parametric curve, and x is the real-time length relative to the starting point of the first trajectory.
[0019] Furthermore, the first-order derivative of the first parameter curve continues to decrease, and the first-order derivative of the second parameter curve continues to increase;
[0020] g′1(y)+g′2(y)=2
[0021] g2(y)=2y-g1(y), y∈[0,1]
[0022] g″1(0)=0, g″1(1)=0, g′1(0)=2
[0023] g′1(1)=0, g1(0)=1, g1(1)=0
[0024] g″2(0)=0, g″2(1)=0, g′2(0)=0
[0025] g'2(1)=2, g2(0)=0, g2(1)=1
[0026] Wherein, g1(y) is the first parameter curve, g2(y) is the second parameter curve, g″1(0) is the second-order derivative of the first parameter curve when y is 0, g″1(1) is the second-order derivative of the first parameter curve when y is 1, g′1(0) is the first-order derivative of the first parameter curve when y is 0, g′1(1) is the first-order derivative of the first parameter curve when y is 1, g″2(0) is the second-order derivative of the second parameter curve when y is 0, g″2(1) is the second-order derivative of the second parameter curve when y is 1, g′2(0) is the first-order derivative of the second parameter curve when y is 0, and g′2(1) is the first-order derivative of the second parameter curve when y is 1.
[0027] Furthermore, the calculation formula g1(y) of the first parameter curve is expressed as:
[0028]
[0029] Furthermore, the calculation formula g1(y) of the first parameter curve is expressed as:
[0030]
[0031] Here, sin is the sine function and π is the radian of the semicircle.
[0032] Furthermore, the first trajectory and the second trajectory are both straight lines or arcs generated by a teaching pendant or a computer-aided tool.
[0033] A device for determining a motion trajectory, the device comprising:
[0034] a data acquisition module, configured to acquire a first trajectory, a second trajectory, a first parameter curve, a second parameter curve, a smoothing parameter table, and a connection smoothing level, wherein the end point of the first trajectory overlaps with the starting point of the second trajectory;
[0035] a connection trajectory generation module, configured to generate a connection trajectory according to preset curve smoothing rules based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the connection smoothing level, wherein the curve smoothing rules include: a modulus of a derivative of the real-time length of the first trajectory relative to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the second trajectory relative to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the connection trajectory relative to the target cumulative distance is continuous, a modulus of a derivative of the real-time length of the connection trajectory relative to the target cumulative distance does not jump, a modulus of a derivative of the real-time length of the connection trajectory relative to the target cumulative distance is not greater than 1, a derivative at a starting point of the connection trajectory is equal to a derivative of the first trajectory relative to the target cumulative distance, and a derivative at an ending point of the connection trajectory is equal to a derivative of the second trajectory relative to the target cumulative distance, where the target cumulative distance is the cumulative distance relative to the starting point of the first trajectory;
[0036] The trajectory combination module is used to combine the first trajectory, the connecting trajectory and the second trajectory to obtain a target motion trajectory.
[0037] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0038] Obtaining a first trajectory, a second trajectory, a first parametric curve, a second parametric curve, a smoothing parameter table, and a connection smoothing level, wherein an end point of the first trajectory overlaps with a start point of the second trajectory;
[0039] A converging trajectory is generated according to preset curve smoothing rules based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the converging smoothing level, wherein the curve smoothing rules include: a modulus of a derivative of the real-time length of the first trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the second trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance is continuous, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance does not have a jump, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance is not greater than 1, a derivative at a starting point of the converging trajectory is equal to a derivative of the first trajectory with respect to the target cumulative distance, and a derivative at an ending point of the converging trajectory is equal to a derivative of the second trajectory with respect to the target cumulative distance, where the target cumulative distance is the cumulative distance relative to the starting point of the first trajectory;
[0040] The first trajectory, the connecting trajectory and the second trajectory are combined to obtain a target motion trajectory.
[0041] A computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following steps:
[0042] Obtaining a first trajectory, a second trajectory, a first parametric curve, a second parametric curve, a smoothing parameter table, and a connection smoothing level, wherein an end point of the first trajectory overlaps with a start point of the second trajectory;
[0043] A converging trajectory is generated according to preset curve smoothing rules based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the converging smoothing level, wherein the curve smoothing rules include: a modulus of a derivative of the real-time length of the first trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the second trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance is continuous, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance does not have a jump, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance is not greater than 1, a derivative at a starting point of the converging trajectory is equal to a derivative of the first trajectory with respect to the target cumulative distance, and a derivative at an ending point of the converging trajectory is equal to a derivative of the second trajectory with respect to the target cumulative distance, where the target cumulative distance is the cumulative distance relative to the starting point of the first trajectory;
[0044] The first trajectory, the connecting trajectory and the second trajectory are combined to obtain a target motion trajectory.
[0045] The method for determining the motion trajectory of the present application generates a connection trajectory according to the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table and the connection smoothing level, according to preset curve smoothing rules, wherein the curve smoothing rules include: the modulus of the derivative of the real-time length of the first trajectory relative to the target cumulative distance is equal to 1, the modulus of the derivative of the real-time length of the second trajectory relative to the target cumulative distance is equal to 1, the modulus of the derivative of the real-time length of the connection trajectory relative to the target cumulative distance is continuous, and there is no jump in the modulus of the derivative of the real-time length of the connection trajectory relative to the target cumulative distance. The module of the derivative of the real-time length of the connecting trajectory relative to the target cumulative distance is not greater than 1, the derivative of the starting point of the connecting trajectory is equal to the derivative of the first trajectory relative to the target cumulative distance, and the derivative of the ending point of the connecting trajectory is equal to the derivative of the second trajectory relative to the target cumulative distance. The target cumulative distance is the cumulative distance relative to the starting point of the first trajectory. This achieves the goal of generating a connecting trajectory with less computing power. Based on the curve smoothing rule, the connecting trajectory is continuously differentiable with the front and rear ends without inflection points, avoiding the technical problems of speed mutation and acceleration discontinuity in trajectory smoothing methods based on Bezier curves and spline curves. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0047] in:
[0048] Figure 1 is a flow chart of a method for determining a motion trajectory in one embodiment;
[0049] Figure 2 is a structural block diagram of a method for determining a motion trajectory in one embodiment;
[0050] Figure 3 FIG. 1 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0051] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0052] As shown in the figure, in one embodiment, a method for determining a motion trajectory is provided. This method can be applied to both a terminal and a server. This embodiment uses the application to a terminal as an example. The method for determining a motion trajectory specifically includes the following steps:
[0053] : Obtain a first trajectory, a second trajectory, a first parameter curve, a second parameter curve, a smoothing parameter table, and a connection smoothing level, wherein the end point of the first trajectory overlaps with the starting point of the second trajectory;
[0054] Specifically, the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the connection smoothing level input by the user can be obtained, and the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the connection smoothing level can also be obtained from the storage space. The first trajectory and the second trajectory can also be obtained from the teach pendant and the first parameter curve, the second parameter curve, the smoothing parameter table, and the connection smoothing level input by the user can also be obtained. The first trajectory and the second trajectory can also be obtained from the teach pendant and the first parameter curve, the second parameter curve, the smoothing parameter table, and the connection smoothing level can be obtained from the storage space.
[0055] The first trajectory is the robot's motion trajectory, expressed as f1(x), where x is the cumulative distance to the target. Thus, we can use the length of the trajectory as a parameter to obtain the points on the trajectory. It is understood that the result of f1(x) calculation is the trajectory point (also called the curve point).
[0056] The second trajectory is the motion trajectory of the robot, and the second trajectory is expressed as f2(x). It can be understood that the result of calculating f2(x) is a trajectory point (also called a curve point).
[0057] The end point of the first trajectory overlaps with the starting point of the second trajectory, that is, f2(0)=f1(L1), L1 is the total length of the first trajectory, so the first trajectory and the second trajectory form a coherent motion trajectory.
[0058] The smoothing parameter table includes: smoothing level and smoothing length.
[0059] Optionally, the range of values for the smoothness level includes: level 1, level 2, level 3, level 4, and level 5. The smoothness level is the smoothness level of the curve (i.e., the trajectory). The higher the smoothness level, the greater the smoothness. It is understood that the smoothness level can be further divided into more levels, which are not limited here.
[0060] Optionally, the second parameter curve is a function obtained according to the first parameter curve, so that the first parameter curve and the second parameter curve are associated with each other.
[0061] Optionally, the first trajectory is a straight line or a circular arc, and the second trajectory is a straight line or a circular arc.
[0062] generating a connecting trajectory according to preset curve smoothing rules based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the connecting smoothing level, wherein the curve smoothing rules include: a modulus of a derivative of the real-time length of the first trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the second trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the connecting trajectory with respect to the target cumulative distance is continuous, a modulus of a derivative of the real-time length of the connecting trajectory with respect to the target cumulative distance does not have a jump, a modulus of a derivative of the real-time length of the connecting trajectory with respect to the target cumulative distance is not greater than 1, a derivative at a starting point of the connecting trajectory is equal to a derivative of the first trajectory with respect to the target cumulative distance, and a derivative at an ending point of the connecting trajectory is equal to a derivative of the second trajectory with respect to the target cumulative distance, where the target cumulative distance is the cumulative distance relative to the starting point of the first trajectory;
[0063] Specifically, to avoid sudden changes in velocity and discontinuous acceleration, a connecting trajectory is generated according to a preset curve smoothing rule based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the connecting smoothing level, so that the relationship between the connecting trajectory and the first trajectory and the second trajectory meets the requirements of the curve smoothing rule. A target smoothing length value is determined based on the smoothing parameter table and the connecting smoothing level, and the connecting trajectory is generated according to the curve smoothing rule based on the target smoothing length value, the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, and the target smoothing length value.
[0064] The modulus of the derivative of the real-time length of the first trajectory relative to the target cumulative distance is equal to 1, that is, |f′1(x)|=1.
[0065] The modulus of the derivative of the real-time length of the second trajectory with respect to the target cumulative distance is equal to 1, that is, |f′2(x)|=1.
[0066] The modulus of the derivative of the real-time length of the connecting trajectory relative to the target cumulative distance is continuous, the derivative of the starting point of the connecting trajectory is equal to the derivative of the first trajectory relative to the target cumulative distance, and the derivative of the ending point of the connecting trajectory is equal to the derivative of the second trajectory relative to the target cumulative distance, so that the connecting trajectory maintains speed continuity.
[0067] For the connecting trajectory, the real length of the connecting trajectory must be less than the sum of the lengths of the parts of the two curves replaced by the connecting trajectory. Therefore, the modulus of the derivative of the real-time length of the connecting trajectory relative to the target cumulative distance is not greater than 1.
[0068] It is understandable that the connection trajectory can be simply obtained by connecting and performing function calculation.
[0069] There is no jump in the modulus length of the derivative of the real-time length of the connection trajectory relative to the target cumulative distance, that is, it can be ensured that there is no acceleration mutation in the motion trajectory.
[0070] : Combine the first trajectory, the connecting trajectory and the second trajectory to obtain a target motion trajectory.
[0071] Specifically, a trajectory between the starting point of the first trajectory and the point in the first trajectory corresponding to the starting point of the connecting trajectory, the connecting trajectory, and the point in the second trajectory corresponding to the end point of the connecting trajectory to the end point of the second trajectory is formed into a smooth trajectory as the target motion trajectory.
[0072] The trajectory between the starting point of the first trajectory and the point in the first trajectory corresponding to the starting point of the connecting trajectory is the beginning segment of the first trajectory. The trajectory between the point in the second trajectory corresponding to the ending point of the connecting trajectory and the ending point of the second trajectory is the ending segment of the second trajectory.
[0073] That is, the starting point of the connecting track is located on the first track, and the ending point of the connecting track is located on the second track.
[0074] It can be understood that the robot can be controlled to work according to the target motion trajectory.
[0075] Before automatic operation, the teach pendant sends the first and second trajectories to the robot's motion controller. After receiving these trajectories, the motion controller generates curve instructions that can be executed by the motion controller. During automatic operation, the motion controller analyzes these curve instructions one by one, smoothly connecting the two currently running trajectories (i.e., the first and second trajectories) using a connecting trajectory to generate the target motion trajectory.
[0076] This embodiment achieves the generation of a connecting trajectory with less computing power. Based on the curve smoothing rule, the connecting trajectory is continuously differentiable with the front and rear ends without inflection points, avoiding the technical problems of speed mutation and acceleration discontinuity in trajectory smoothing methods based on Bezier curves and spline curves.
[0077] In one embodiment, the step of generating a connection trajectory according to a preset curve smoothing rule based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the connection smoothing level includes:
[0078] S21: searching for a smoothing length from the smoothing parameter table according to the connection smoothing level to obtain an expected smoothing length value;
[0079] Specifically, the smoothing level of the connection is searched for in the smoothing parameter table, and the smoothing length corresponding to the smoothing level found in the smoothing parameter table is used as the expected smoothing length.
[0080] S22: Inputting the expected smoothing length value, the total length of the first trajectory, and the total length of the first parametric curve into a preset smoothing length selection function to perform smoothing length selection to obtain a smoothing length target value;
[0081] Specifically, the expected smoothing length value, the total length of the first trajectory, and the total length of the first parametric curve are input into a preset smoothing length selection function to select a smoothing length, and the selected smoothing length is used as a smoothing length target value.
[0082] The smoothing length selection function is expressed as select(A1, A2, A3), where A1 is the desired smoothing length, A2 is the total length of the first trajectory, and A3 is the total length of the first parametric curve. The smoothing length selection function combines the desired smoothing length, the total length of the first trajectory, and the total length of the first parametric curve to determine an appropriate smoothing length as a target smoothing length value. In other words, the smoothing length selection function combines these three length values and determines an appropriate smoothing length according to a preset smoothing length determination rule.
[0083] S23: Calculating a smoothing start point and a smoothing end point according to the smoothing length target value, the total length of the first trajectory, and the total length of the first parametric curve;
[0084] Specifically, the smoothing length target value is subtracted from the total length of the first trajectory to obtain the end length; the point on the first trajectory corresponding to the end length is used as the smoothing start point; the smoothing length target value is subtracted from the total length of the first parametric curve to obtain the start length; and the point on the second trajectory corresponding to the start length is used as the smoothing end point.
[0085] : Based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing length target value, the smoothing start point and the smoothing end point, the connecting trajectory is generated according to the curve smoothing rule.
[0086] Specifically, in order to avoid sudden changes in speed and discontinuous acceleration, a connecting trajectory is generated based on the curve smoothing rule according to the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing length target value, the smoothing start point and the smoothing end point, so that the relationship between the connecting trajectory and the first trajectory and the second trajectory meets the requirements of the curve smoothing rule.
[0087] This embodiment achieves the generation of a connecting trajectory with less computing power. Based on the curve smoothing rule, the connecting trajectory is continuously differentiable with the front and rear ends without inflection points, avoiding the technical problems of speed mutation and acceleration discontinuity in trajectory smoothing methods based on Bezier curves and spline curves.
[0088] In one embodiment, the calculation formula F(x) of the connection trajectory is expressed as:
[0089]
[0090] L x =xL a
[0091] L b =L a +2L
[0092] Wherein, L is the target value of the smoothing length, L a is the smoothing starting point, L b is the smoothing end point, f1() is the first trajectory, f2() is the second trajectory, g1() is the first parametric curve, g2() is the second parametric curve, and x is the real-time length relative to the starting point of the first trajectory.
[0093] Specifically, the calculation formula for the connection trajectory shows that its computational complexity is solely dependent on the first and second parametric curves. As long as the computational complexity of the first and second parametric curves is low, the overall computational complexity of the process remains unchanged. Because both the first and second trajectories are either straight lines or circular arcs, both of which have extremely low computational complexity, the computational complexity of the entire smoothing process achieved by the connection trajectory is also extremely low. Throughout the smoothing process, the calculation of curve points is solely dependent on the target smoothing length and the connection smoothing level. Therefore, the connection trajectory does not change with speed.
[0094] In this embodiment, when L x =0, x=L a When:
[0095] F(L a )=f1(L a +Lg1(0))+(f2(Lg2(0))-f2(0))=f1(L a )+f2(0)-f2(0)=f1(L a )
[0096] At this time, F(x)=f1(x), the connecting trajectory is exactly connected with the first trajectory, and the connecting point is: x=L a ;
[0097] When L x =2L, x=L b When:
[0098] F(L a )=f1(L a +Lg1(1))+(f2(Lg2(1))-f2(0))=f1(L1)+f2(L)-f2(0)=f2(L)
[0099] At this time, F(x)=f2(x), the connecting trajectory is exactly connected with the second trajectory, and the connecting point is: x=L b ;
[0100] The calculation formula F′(x) of the derivative of the connection trajectory is expressed as:
[0101]
[0102] When L x =0, x=L a When:
[0103]
[0104] At this time, F(x)=f1(x), the connection trajectory and the derivative of the first trajectory are just connected, the connection point: x=L a ;
[0105] When L x =2L, x=L b When:
[0106]
[0107] At this time, F(x)=f2(x), the connection trajectory and the derivative of the second trajectory are just connected, the connection point: x=L b ;
[0108] The calculation formula of the modulus of the derivative of the connection trajectory |F′(x)| is expressed as:
[0109]
[0110] That is, |F′(x)| is not greater than 1, that is, the modulus of the derivative of the real-time length of the connecting trajectory relative to the target cumulative distance in the curve smoothing rule is not greater than 1;
[0111] The second-order derivative calculation formula F″(x) of the connection trajectory is expressed as:
[0112]
[0113] When L x =0, x=L a When:
[0114]
[0115] At this time, F(x)=f1(x), the second-order derivative of the connection trajectory is exactly connected with the second-order derivative of the first trajectory, and the connection point is: x=L a ;
[0116] When L x =2L, x=L b When:
[0117]
[0118] At this time, F(x)=f2(x), the second-order derivative of the connection trajectory is exactly connected with the second-order derivative of the second trajectory, and the connection point is: x=L b ;
[0119] Through the above verification process, it can be determined that the connection trajectory of this embodiment meets the requirements of the curve smoothing rule. The above connection trajectory is second-order continuous and differentiable at the two endpoints (that is, the smoothing starting point and the smoothing ending point), there is no sudden change in speed, and there is no inflection point in acceleration. It is a normal and usable smooth curve.
[0120] This embodiment achieves the generation of a connecting trajectory with less computing power. Based on the curve smoothing rule, the connecting trajectory is continuously differentiable with the front and rear ends without inflection points, avoiding the technical problems of speed mutation and acceleration discontinuity in trajectory smoothing methods based on Bezier curves and spline curves.
[0121] In one embodiment, the first-order derivative of the first parameter curve continuously decreases, and the first-order derivative of the second parameter curve continuously increases;
[0122] g′1(y)+g′2(y)=2
[0123] g2(y)=2y-g1(y), y∈[0,1]
[0124] g″1(0)=0, g″1(1)=0, g′1(0)=2
[0125] g′1(1)=0, g1(0)=1, g1(1)=0
[0126] g″2(0)=0, g″2(1)=0, g′2(0)=0
[0127] g'2(1)=2, g2(0)=0, g2(1)=1
[0128] Wherein, g1(y) is the first parameter curve, g2(y) is the second parameter curve, g″1(0) is the second-order derivative of the first parameter curve when y is 0, g″1(1) is the second-order derivative of the first parameter curve when y is 1, g′1(0) is the first-order derivative of the first parameter curve when y is 0, g′1(1) is the first-order derivative of the first parameter curve when y is 1, g″2(0) is the second-order derivative of the second parameter curve when y is 0, g″2(1) is the second-order derivative of the second parameter curve when y is 1, g′2(0) is the first-order derivative of the second parameter curve when y is 0, and g′2(1) is the first-order derivative of the second parameter curve when y is 1.
[0129] The computational complexity of the connection trajectory is only related to the first parameter curve and the second parameter curve. In this embodiment, the second parameter curve is a function obtained based on the first parameter curve, thereby further reducing the computational complexity.
[0130] In one embodiment, the calculation formula g1(y) of the first parameter curve is expressed as:
[0131]
[0132] The first parameter curve of this embodiment uses different functions with whether y is greater than 0.5 as the dividing point, so that the starting segment of the connection trajectory determined based on the first parameter curve is closer to the first trajectory, and the ending segment of the connection trajectory determined based on the first parameter curve is closer to the second trajectory.
[0133] In one embodiment, the calculation formula g1(y) of the first parameter curve is expressed as:
[0134]
[0135] Here, sin is the sine function and π is the radian of the semicircle.
[0136] In this embodiment, the first parameter curve is determined based on the sine function and the arc of the semicircle, so that the rate of change of the curvature of the connection trajectory determined based on the first parameter curve is less than a preset value.
[0137] In one embodiment, the first trajectory and the second trajectory are both straight lines or arcs generated by a teaching pendant or a computer-aided tool.
[0138] Specifically, the operator generates the first and second trajectories using the robot's teach pendant based on the specific scenario. When generating the first and second trajectories, the smoothing level and speed are set. In this embodiment, both the first and second trajectories are generated using the teach pendant, thereby simplifying the generation method of both the first and second trajectories.
[0139] The computer-aided tool may be a software selected from the prior art that can be used for graphically assisting in generating trajectories.
[0140] As shown in the figure, in one embodiment, a device for determining a motion trajectory is provided, the device comprising:
[0141] A data acquisition module 801 is configured to acquire a first trajectory, a second trajectory, a first parameter curve, a second parameter curve, a smoothing parameter table, and a connection smoothing level, wherein the end point of the first trajectory overlaps with the start point of the second trajectory;
[0142] A connection trajectory generation module 802 is configured to generate a connection trajectory according to preset curve smoothing rules based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the connection smoothing level, wherein the curve smoothing rules include: the modulus of the derivative of the real-time length of the first trajectory relative to the target cumulative distance is equal to 1, the modulus of the derivative of the real-time length of the second trajectory relative to the target cumulative distance is equal to 1, the modulus of the derivative of the real-time length of the connection trajectory relative to the target cumulative distance is continuous, the modulus of the derivative of the real-time length of the connection trajectory relative to the target cumulative distance does not jump, the modulus of the derivative of the real-time length of the connection trajectory relative to the target cumulative distance is not greater than 1, the derivative of the starting point of the connection trajectory is equal to the derivative of the first trajectory relative to the target cumulative distance, and the derivative of the ending point of the connection trajectory is equal to the derivative of the second trajectory relative to the target cumulative distance, where the target cumulative distance is the cumulative distance relative to the starting point of the first trajectory;
[0143] The trajectory combination module 903 is configured to combine the first trajectory, the connecting trajectory, and the second trajectory to obtain a target motion trajectory.
[0144] This embodiment achieves the generation of a connecting trajectory with less computing power. Based on the curve smoothing rule, the connecting trajectory is continuously differentiable with the front and rear ends without inflection points, avoiding the technical problems of speed mutation and acceleration discontinuity in trajectory smoothing methods based on Bezier curves and spline curves.
[0145] Figure 3 FIG1 shows an internal structure diagram of a computer device in an embodiment. The computer device can be a terminal or a server. Figure 3 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the method for determining the motion trajectory. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can implement the method for determining the motion trajectory. It will be understood by those skilled in the art that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0146] In one embodiment, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0147] Obtaining a first trajectory, a second trajectory, a first parametric curve, a second parametric curve, a smoothing parameter table, and a connection smoothing level, wherein an end point of the first trajectory overlaps with a start point of the second trajectory;
[0148] A converging trajectory is generated according to preset curve smoothing rules based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the converging smoothing level, wherein the curve smoothing rules include: a modulus of a derivative of the real-time length of the first trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the second trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance is continuous, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance does not have a jump, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance is not greater than 1, a derivative at a starting point of the converging trajectory is equal to a derivative of the first trajectory with respect to the target cumulative distance, and a derivative at an ending point of the converging trajectory is equal to a derivative of the second trajectory with respect to the target cumulative distance, where the target cumulative distance is the cumulative distance relative to the starting point of the first trajectory;
[0149] The first trajectory, the connecting trajectory and the second trajectory are combined to obtain a target motion trajectory.
[0150] This embodiment achieves the generation of a connecting trajectory with less computing power. Based on the curve smoothing rule, the connecting trajectory is continuously differentiable with the front and rear ends, with no inflection points in speed and no sudden changes in acceleration. This avoids the technical problems of sudden changes in speed and discontinuous acceleration in trajectory smoothing methods based on Bezier curves and spline curves.
[0151] In one embodiment, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by a processor, the processor performs the following steps:
[0152] Obtaining a first trajectory, a second trajectory, a first parametric curve, a second parametric curve, a smoothing parameter table, and a connection smoothing level, wherein an end point of the first trajectory overlaps with a start point of the second trajectory;
[0153] A converging trajectory is generated according to preset curve smoothing rules based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the converging smoothing level, wherein the curve smoothing rules include: a modulus of a derivative of the real-time length of the first trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the second trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance is continuous, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance does not have a jump, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance is not greater than 1, a derivative at a starting point of the converging trajectory is equal to a derivative of the first trajectory with respect to the target cumulative distance, and a derivative at an ending point of the converging trajectory is equal to a derivative of the second trajectory with respect to the target cumulative distance, where the target cumulative distance is the cumulative distance relative to the starting point of the first trajectory;
[0154] The first trajectory, the connecting trajectory and the second trajectory are combined to obtain a target motion trajectory.
[0155] This embodiment achieves the generation of a connecting trajectory with less computing power. Based on the curve smoothing rule, the connecting trajectory is continuously differentiable with the front and rear ends without inflection points, avoiding the technical problems of speed mutation and acceleration discontinuity in trajectory smoothing methods based on Bezier curves and spline curves.
[0156] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous RAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0157] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0158] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A method for determining a motion trajectory, the method comprising: Obtaining a first trajectory, a second trajectory, a first parametric curve, a second parametric curve, a smoothing parameter table, and a connection smoothing level, wherein an end point of the first trajectory overlaps with a start point of the second trajectory; A converging trajectory is generated according to preset curve smoothing rules based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the converging smoothing level, wherein the curve smoothing rules include: a modulus of a derivative of the real-time length of the first trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the second trajectory with respect to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance is continuous, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance does not have a jump, a modulus of a derivative of the real-time length of the converging trajectory with respect to the target cumulative distance is not greater than 1, a derivative at a starting point of the converging trajectory is equal to a derivative of the first trajectory with respect to the target cumulative distance, and a derivative at an ending point of the converging trajectory is equal to a derivative of the second trajectory with respect to the target cumulative distance, where the target cumulative distance is the cumulative distance relative to the starting point of the first trajectory; The first trajectory, the connecting trajectory and the second trajectory are combined to obtain a target motion trajectory.
2. The method for determining a motion trajectory according to claim 1, wherein: The step of generating a connection trajectory according to a preset curve smoothing rule based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the connection smoothing level includes: According to the connection smoothing level, searching the smoothing length from the smoothing parameter table to obtain an expected value of the smoothing length; Inputting the expected smoothing length value, the total length of the first trajectory, and the total length of the first parametric curve into a preset smoothing length selection function to perform smoothing length selection to obtain a smoothing length target value; Calculate a smoothing start point and a smoothing end point according to the smoothing length target value, the total length of the first trajectory, and the total length of the first parametric curve; The connection trajectory is generated according to the curve smoothing rule based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing length target value, the smoothing start point and the smoothing end point.
3. The method for determining a motion trajectory according to claim 2, wherein: The calculation formula F(x) of the connection trajectory is expressed as: L x =x-L a L b =L a +2L Wherein, L is the target value of the smoothing length, L a is the smoothing starting point, L b is the smoothing end point, f1() is the first trajectory, f2() is the second trajectory, g1() is the first parametric curve, g2() is the second parametric curve, and x is the real-time length relative to the starting point of the first trajectory.
4. The method for determining a motion trajectory according to claim 2, wherein: The first-order derivative of the first parameter curve continues to decrease, and the first-order derivative of the second parameter curve continues to increase; g′1(y)+g′2(y)=2 g2(y)=2y-g1(y), y∈[0,1] g″1(0)=0, g″1(1)=0, g′1(0)=2 g′1(1)=0, g1(0)=1, g1(1)=0 g″2(0)=0, g″2(1)=0, g′2(0)=0 g'2(1)=2, g2(0)=0, g2(1)=1 Wherein, g1(y) is the first parameter curve, g2(y) is the second parameter curve, g″1(0) is the second-order derivative of the first parameter curve when y is 0, g″1(1) is the second-order derivative of the first parameter curve when y is 1, g′1(0) is the first-order derivative of the first parameter curve when y is 0, g′1(1) is the first-order derivative of the first parameter curve when y is 1, g″2(0) is the second-order derivative of the second parameter curve when y is 0, g″2(1) is the second-order derivative of the second parameter curve when y is 1, g′2(0) is the first-order derivative of the second parameter curve when y is 0, and g′2(1) is the first-order derivative of the second parameter curve when y is 1.
5. The method for determining a motion trajectory according to claim 4, wherein: The calculation formula g1(y) of the first parameter curve is expressed as:
6. The method for determining a motion trajectory according to claim 4, wherein: The calculation formula of the first parameter curve is g1(y) is expressed as: Here, sin is the sine function and π is the radian of the semicircle.
7. The method for determining a motion trajectory according to claim 1, wherein: The first trajectory and the second trajectory are both straight lines or arcs generated by a teaching pendant or a computer-aided tool.
8. A device for determining a motion trajectory, characterized in that: The device comprises: a data acquisition module, configured to acquire a first trajectory, a second trajectory, a first parameter curve, a second parameter curve, a smoothing parameter table, and a connection smoothing level, wherein the end point of the first trajectory overlaps with the starting point of the second trajectory; a connection trajectory generation module, configured to generate a connection trajectory according to preset curve smoothing rules based on the first trajectory, the second trajectory, the first parameter curve, the second parameter curve, the smoothing parameter table, and the connection smoothing level, wherein the curve smoothing rules include: a modulus of a derivative of the real-time length of the first trajectory relative to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the second trajectory relative to the target cumulative distance is equal to 1, a modulus of a derivative of the real-time length of the connection trajectory relative to the target cumulative distance is continuous, a modulus of a derivative of the real-time length of the connection trajectory relative to the target cumulative distance does not jump, a modulus of a derivative of the real-time length of the connection trajectory relative to the target cumulative distance is not greater than 1, a derivative at a starting point of the connection trajectory is equal to a derivative of the first trajectory relative to the target cumulative distance, and a derivative at an ending point of the connection trajectory is equal to a derivative of the second trajectory relative to the target cumulative distance, where the target cumulative distance is the cumulative distance relative to the starting point of the first trajectory; The trajectory combination module is used to combine the first trajectory, the connecting trajectory and the second trajectory to obtain a target motion trajectory.
9. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Smooth transition method and system for straight line section and arc
CN112276957A
Three-dimensional path planning and navigation method suitable for under-actuated robot
CN114237256A