A trajectory compression method combining dynamic window and newton-raphson iteration
By combining dynamic windows and the Newton-Raphson iteration method, the problem that existing algorithms cannot process sampled data in real time is solved, achieving real-time trajectory compression and continuity while reducing computational load.
Patent Information
- Application Number
- CN202411477707.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-10-22
AI Technical Summary
Existing trajectory compression algorithms, such as Philip J. Schneider's method, cannot directly process real-time sampled data, making it difficult to achieve real-time trajectory fitting and compression.
By combining dynamic windows and the Newton-Raphson iteration method, the sampling points are processed in segments by setting an initial dynamic window. The Philip J. Schneider algorithm is used to calculate the Bézier curve, and the parameters are optimized within the error range. The Newton-Raphson iteration method is used to reduce the error and ensure the first-order continuity of the curve.
It achieves trajectory compression of real-time sampling data, reduces computational complexity, avoids repeated calculations of historical sampling points, and maintains the continuity of curves and compression efficiency.
Smart Images

Figure CN119557348B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of geographic information, and more specifically to a trajectory compression method that combines dynamic windows and the Newton-Raphson iterative method. Background Technology
[0002] As more and more applications adopt the real-time display of object trajectories, the amount of object trajectory data is increasing, and fitting and compressing object trajectories has become a necessary step before trajectory display. The algorithm proposed by Philip J. Schneider (Schneider, Philip J. "An algorithm for automatically fitting digitized curves." In Graphics gems, pp. 612-626. 1990.) has good results, but its characteristic of requiring all position points to be input to calculate the path makes it difficult to compress the object trajectory in real time. How to have the advantage of Philip J. Schneider's method [1] in its good effect on offline data, and also make it able to fit and compress real-time sampled data is a problem worth considering and solving. Summary of the Invention
[0003] The purpose of this invention is to propose a trajectory compression method that combines dynamic windowing and Newton-Raphson iteration to address the shortcomings of the trajectory compression algorithm proposed by Philip J. Schneider, which cannot directly process real-time sampled data.
[0004] The technical solution to achieve the purpose of this invention is: a trajectory compression method combining dynamic window and Newton-Raphson iteration method, the steps of which are as follows:
[0005] Step 1: Set the initial dynamic window size. Each sampling point within the dynamic window is treated as a whole input for the algorithm that generates the Bézier curve.
[0006] Step 2: After reading a new sampling point, calculate the Bézier curve within the current dynamic window;
[0007] Step 3: Determine if the number of sampling points exceeds the size of the dynamic window. If the number of sampling points is greater than or equal to the size of the dynamic window, proceed to step 4 to generate a new dynamic window; otherwise, proceed to step 5 to process the new sampling points.
[0008] Step 4: Generate a new dynamic window, ensuring that the starting point of the new dynamic window maintains first-order continuity with the ending point of the previous dynamic window.
[0009] Step 5: Determine if there are any new sampling points. If there are new sampling points, proceed to Step 2 to process them. If there are no new sampling points, end the path fitting calculation process. The resulting Bézier curve equation is the final output.
[0010] Furthermore, in step 1, the initial dynamic window size is set, and the sampling points within the initial dynamic window, starting from the first point, are not segmented. The specific method is as follows:
[0011] The initial dynamic window size is set to 100, which means that no segmentation will be performed from the first point until the 100th sampling point is accumulated.
[0012] Further, in step 2, after reading a new sampling point, the Bézier curve within the dynamic window is calculated. The specific method is as follows:
[0013] If the total number of sampling points is 1 after reading in a new sampling point, then no curve is generated and another sampling point is read in;
[0014] If the total number of sampling points is 2 after reading in a new sampling point, then directly connect the first sampling point and the second sampling point with a straight line and read in a new sampling point again;
[0015] If the total number of sampling points is greater than or equal to 3 after reading in new sampling points, the Philip J. Schneider algorithm is used to calculate the path of the sampling points within the dynamic window.
[0016] Furthermore, the path of the sampling points within the dynamic window is calculated using the Philip J. Schneider algorithm. The specific method is as follows:
[0017] Step 2.1: Update the unit tangent vector of the second-to-last sampling point
[0018] Using the newly read sampling point d n Location information, calculate the penultimate sampling point d n-1 Compared to the previous point d n-2 and point d n The average of the vectors formed is used to obtain the tangent vector at the penultimate sampling point.
[0019] Normalized tangent vector get This vector is the new tangent vector for the second-to-last sampling point:
[0020]
[0021] Calculate the unit tangent vector of the newly added sampling point.
[0022]
[0023] In addition, when there are only three sampling points and the current dynamic window is the first dynamic window, it is also necessary to calculate the penultimate sampling point d. n-2 unit tangent vector The formula is:
[0024]
[0025] Step 2.2: Parameterize the chord length to obtain the u corresponding to each point in the curve equation. i value
[0026] Calculate the chord length between two adjacent points, and obtain the parameter value u of each sampling point in the fitted curve equation based on the chord length. i The specific steps are as follows:
[0027] Step 2.2.1: Calculate the chord length between adjacent sampling points
[0028] For sampling point d i (x i ,y i ) and sampling point d i+1 (x i+1 ,y i+1 ), chord length L i Calculated using the following formula
[0029]
[0030] Step 2.2.2: Calculate the total chord length
[0031] Add the chord lengths between all adjacent points to obtain the total chord length L. total :
[0032]
[0033] Step 2.2.3: Assign parameter values
[0034] For each point P i The corresponding parameter value u is calculated using the following formula. i :
[0035]
[0036] Step 2.3: Fitting the Bézier curve
[0037] The four control points that minimize the error are calculated, and the formula for the third-order Bézier curve is obtained. The specific steps are as follows:
[0038] Step 2.3.1: Calculate the parameters of the two internal control points.
[0039] The parameters α1 and α2 that determine the positions of the two internal control points are solved using the following formula:
[0040]
[0041]
[0042] Where C1, C2 and X are:
[0043]
[0044]
[0045]
[0046] det(*) refers to the determinant of the matrix.
[0047] Where X1, X2, c 1,1 c 1,2 c 2,1 and c 2,2 for:
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054] Where, d i Represents the coordinates (x, y) of the i-th sampling point i ,y i ), d i -(*) represents the Euclidean distance between the coordinates of the sampling point and the coordinates of the point fitted by the formula, which is the square root of the sum of the squares of the differences in the horizontal coordinates and the squares of the differences in the vertical coordinates.
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061] in, Let be the unit tangent vector at the first sampling point on the curve. This is the unit tangent vector at the last sampling point of the curve;
[0062] Step 2.3.2: Determine the locations of the four control points
[0063] The first and last control points V0 and V3 are the first and last sampling points of the fitted path. The positions of the two inner control points V1 and V2 are determined by the following formula:
[0064]
[0065]
[0066] in, Let the unit tangent vector be the first sampling point. The unit tangent vector of the last sampling point;
[0067] Step 2.3.3: Obtain the formula for Bézier curves
[0068] Substitute the four control points into the following formula for the Bézier curve B(t):
[0069] B(t)=(1-t) 3 V0+3(1-t) 2 tV1+3(1-t)t 2 V2+t 3 V3
[0070] Where t is a variable between 0 and 1. As t gradually increases from 0 to 1, the calculated coordinates will gradually move from the starting point to the ending point along the trajectory of the Bézier curve.
[0071] Step 2.4: Calculate the error S and determine the range of the error.
[0072]
[0073] If the error S is greater than 5*e, proceed to step 2.5 to divide the Bézier curve into two segments from the point of maximum error; if the error S is between e and 5*e, proceed to step 2.6 to optimize parameter u. i If the error S is less than the preset value e or the number of iterations exceeds 5, record the formula for the Bézier curve obtained in step 2.3.3 and jump to step 3.
[0074] Step 2.5: Divide the curve into two segments at the point of maximum error;
[0075] Step 2.5.1: Calculate the maximum error point, and then divide the set of sampling points calculated in this round into two segments based on this point;
[0076] Step 2.5.2: For each segment, perform step 2.3 to calculate the Bézier curve for each segment;
[0077] Step 2.5.3: Record the Bézier curve formulas obtained for each segment for plotting or analysis, then skip to step 3;
[0078] Step 2.6: Use the Newton-Raphson iterative method to reduce errors.
[0079] By adjusting the u of the Bézier curve B(t) corresponding to each sampling point i The value further reduces the error between the curve and the sampling points;
[0080] The new u generated by the Newton-Raphson iterative method i The formula for the value is as follows:
[0081]
[0082] Among them, u iold For each sampling point d i The original parameter values between 0 and 1 corresponding to the Bézier curve B(t);
[0083] B(t) is the formula for the Bézier curve obtained in step 2.3.3;
[0084] Get the u corresponding to the new sampling point i After setting the value, return to step 2.3 to generate a Bézier curve with smaller error.
[0085] Furthermore, in step 4, a new dynamic window is generated, ensuring that the starting point of the new dynamic window maintains first-order continuity with the ending point of the previous dynamic window. The specific method is as follows:
[0086] 1. The number of sampling points in the dynamic window is between 20 and 200;
[0087] 2. The longer the time interval, the fewer the number of sampling points;
[0088] 3. The greater the distance between sampling points, the fewer sampling points are needed;
[0089] 4. The faster the sampling rate ds / dt, the fewer sampling points are required;
[0090] The specific formula for calculating the number of sampling points n contained in the new dynamic window is as follows:
[0091]
[0092] The formula for calculating c is:
[0093]
[0094] Where avg(dt) is the arithmetic mean of the time differences between all adjacent sampling points in the previous dynamic window, in minutes; avg(ds) is the arithmetic mean of the Euclidean distances between all adjacent sampling points in the previous dynamic window, in meters; and avg(ds / dt) is the arithmetic mean of the average velocity between all adjacent points in the previous dynamic window, in meters per minute.
[0095] Step 4.2: Ensure that the start point of the new dynamic window maintains first-order continuity with the end point of the previous dynamic window;
[0096] Set the first point of the new dynamic window to the last point of the previous dynamic window, and set the unit tangent vector of the first point of the new dynamic window to the normalized vector of the tangent vector of the last control point of the previous window, to ensure that the curves in the two windows maintain first-order continuity at the connection point.
[0097] A trajectory compression system combining dynamic window and Newton-Raphson iteration method is provided. The trajectory compression method combining dynamic window and Newton-Raphson iteration method is implemented to achieve trajectory compression combining dynamic window and Newton-Raphson iteration method.
[0098] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the trajectory compression method combining dynamic windows and the Newton-Raphson iteration method to achieve trajectory compression combining dynamic windows and the Newton-Raphson iteration method.
[0099] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the trajectory compression method combining dynamic windows and Newton-Raphson iteration is implemented to achieve trajectory compression combining dynamic windows and Newton-Raphson iteration.
[0100] Compared with existing technologies, the significant advantages of this invention are: 1) It removes the previous limitation that curves could only be generated after all sampling points were input, allowing the curve to be generated while sampling points are being input. 2) The curve trajectories generated by historical sampling points (sampling points outside the dynamic window) can be fixed. With new input points, it is not necessary to recalculate the trajectories of historical sampling points; only the paths generated by the most recent sampling points need to be updated. While ensuring the first-order continuity of the entire curve, the computational load required for curve compression is reduced, changing the computational approach from fitting all points at once to considering and stitching together segments. Attached Figure Description
[0101] Figure 1 This is a step-by-step diagram of the real-time compression curve.
[0102] Figure 2 A diagram illustrating the steps for calculating a Bézier curve within a dynamic window.
[0103] Figure 3 A diagram illustrating the steps involved in fitting a Bézier curve. Detailed Implementation
[0104] 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.
[0105] This invention, based on the trajectory compression algorithm proposed by Philip J. Schneider, introduces the concept of a dynamic window, enabling the continuously incoming sampling point data to be grouped and segmented, while maintaining the first-order continuity of the curve at the segmentation points. The specific process is as follows:
[0106] Step 1: Set the initial dynamic window size. Starting from the first point, the sampling points within the initial dynamic window will not be segmented.
[0107] The initial dynamic window size is set to 100. This means that from the first point until the 100th sampling point is accumulated, no segmentation is performed. Choosing the value of 100 is a result of balancing the computational cost within a single interval with the continuity of the curve: the larger the dynamic window size, the better the continuity and compression ratio of the simulated curve, but at the cost of a larger computational cost.
[0108] Step 2: After reading a new sampling point, calculate the Bézier curve within the dynamic window;
[0109] If the total number of sampling points is 1 after reading in a new sampling point, then no curve is generated and another sampling point is read in.
[0110] If the total number of sampling points is 2 after reading in a new sampling point, then directly connect the first sampling point and the second sampling point with a straight line and read in a new sampling point again.
[0111] If the total number of sampling points is greater than or equal to 3 after reading in the new sampling point, the algorithm proposed by Philip J. Schneider is used to calculate the path of the sampling points within the dynamic window. Specifically:
[0112] Step 2.1: Update the unit tangent vector of the second-to-last sampling point
[0113] Using the newly read sampling point d n Location information, calculate the penultimate sampling point d n-1 Compared to the previous point d n-2 and the next point d n The average of the vectors formed is used to obtain the tangent vector at the penultimate sampling point.
[0114] Normalized tangent vector get This vector is the new tangent vector for the second-to-last sampling point:
[0115]
[0116] Calculate the unit tangent vector of the newly added sampling point.
[0117]
[0118] Furthermore, when there are only three sampling points (n=3) and the current dynamic window is the first dynamic window, it is also necessary to calculate the third-to-last sampling point (d). n-2 unit tangent vector The formula is:
[0119]
[0120] Step 2.2: Parameterize the chord length to obtain the u corresponding to each point in the curve equation. i value
[0121] Calculate the chord length between two adjacent points, and obtain the parameter value u of each sampling point in the fitted curve equation based on the chord length. i The specific steps are as follows:
[0122] Step 2.2.1: Calculate the chord length between adjacent sampling points
[0123] For sampling point d i (x i ,y i) and sampling point d i+1 (x i+1 ,y i+1 ), chord length L i It can be calculated using the following formula
[0124]
[0125] Step 2.2.2: Calculate the total chord length
[0126] Add the chord lengths between all adjacent points to obtain the total chord length L. total :
[0127]
[0128] Step 2.2.3: Assign parameter values
[0129] For each point P i The corresponding parameter value u is calculated using the following formula. i :
[0130]
[0131] This value will be used in the subsequent step of fitting the Bézier curve.
[0132] Step 2.3: Fitting the Bézier curve
[0133] This step calculates the four control points that minimize the error and yields the formula for the third-order Bézier curve.
[0134] Step 2.3.1: Calculate the parameters of the two internal control points.
[0135] The parameters α1 and α2 that determine the positions of the two internal control points are solved using the following formula:
[0136]
[0137]
[0138] Where C1, C2 and X are:
[0139]
[0140]
[0141]
[0142] det(*) refers to the determinant of the matrix.
[0143] Where X1, X2, c 1,1 c 1,2 c2,1 and c 2,2 for:
[0144]
[0145]
[0146]
[0147]
[0148]
[0149]
[0150] Where, d i Represents the coordinates (x, y) of the i-th sampling point i ,y i ), d i -(*) represents the Euclidean distance between the coordinates of the sampling point and the coordinates of the point fitted by the formula, which is the square root of the sum of the squares of the differences in the horizontal coordinates and the squares of the differences in the vertical coordinates.
[0151] A and B are:
[0152]
[0153]
[0154]
[0155]
[0156]
[0157]
[0158] in, Let be the unit tangent vector at the first sampling point on the curve. This is the unit tangent vector at the last sampling point of the curve.
[0159] Step 2.3.2: Determine the locations of the four control points
[0160] The first and last control points, V0 and V3, are the first and last sampling points of the path being fitted. The positions of the two inner control points, V1 and V2, can be determined by the following formula:
[0161]
[0162]
[0163] in, This is the unit tangent vector for the first sampling point. This is the unit tangent vector of the last sampling point.
[0164] Step 2.3.3: Obtain the formula for Bézier curves
[0165] Substitute the four control points obtained in the previous step into the following formula for the Bézier curve B(t):
[0166] B(t)=(1-t) 3 V0+3(1-t) 2 tV1+3(1-t)t 2 V2+t 3 V3
[0167] Here, t is a variable ranging from 0 to 1. As t gradually increases from 0 to 1, the calculated coordinates will gradually move from the starting point to the endpoint along the trajectory of the Bézier curve.
[0168] Step 2.4: Calculate the error S and determine the range of the error.
[0169]
[0170] If the error S is greater than 5*e, proceed to step 2.5 to divide the Bézier curve into two segments from the point of maximum error; if the error S is between e and 5*e, proceed to step 2.6 to optimize parameter u. i If the error S is less than the preset value e or the number of iterations exceeds 5, record the formula for the Bézier curve obtained in step 2.3.3 and jump to step 3.
[0171] Step 2.5: Divide the curve into two segments at the point of maximum error;
[0172] Step 2.5.1: Calculate the maximum error point, and then divide the set of sampling points calculated in this round into two segments based on this point;
[0173] Step 2.5.2: For each segment, perform step 2.3 to calculate the Bézier curve for each segment;
[0174] Step 2.5.3: Record the Bézier curve formulas obtained for each segment for plotting or analysis, then skip to step 3;
[0175] Step 2.6: Use the Newton-Raphson iterative method to reduce errors.
[0176] This step involves adjusting the u of the Bézier curve B(t) corresponding to each sampling point. i The value (a number between 0 and 1) further reduces the error between the curve and the sampling point;
[0177] The new u generated by the Newton-Raphson iterative method i The formula for the value is as follows:
[0178]
[0179] Among them, u iold For each sampling point d i The original parameter values between 0 and 1 corresponding to the Bézier curve B(t);
[0180] B(t) is the formula for the Bézier curve obtained in step 2.3.3;
[0181] Get the u corresponding to the new sampling point i After setting the value, return to step 2.3 to generate a Bézier curve with smaller error.
[0182] Step 3: Determine whether the number of sampling points exceeds the size of the dynamic window, where:
[0183] If the number of sampling points is greater than or equal to the size of the dynamic window, proceed to step 4 to generate a new dynamic window; otherwise, proceed to step 5 to process the new sampling points.
[0184] Step 4, generate a new dynamic window, where:
[0185] Step 4.1: Calculate the size of the new dynamic window
[0186] The new dynamic window size should meet the following conditions:
[0187] 1. The number of sampling points in the dynamic window is between 20 and 200: this range balances computational performance with the accuracy of the fitted curve.
[0188] 2. The longer the time interval, the fewer sampling points are needed;
[0189] 3. The greater the distance between sampling points, the fewer sampling points are needed;
[0190] 4. The faster the sampling rate ds / dt, the fewer sampling points are needed.
[0191] Based on the above conditions, this invention constructs the following formula. This formula is used to calculate the number n of sampling points contained within the new dynamic window:
[0192]
[0193] The value of c is calculated using the following formula:
[0194]
[0195] Here, avg() represents the arithmetic mean of two adjacent sampling points within the previous dynamic window. dt represents the time difference between two adjacent points, and ds represents the arithmetic mean of the Euclidean distances between two adjacent points. ds / dt represents the distance difference between two adjacent points divided by the time difference.
[0196] avg(dt) is the arithmetic mean (in minutes) of the time differences between all adjacent sampling points within the previous dynamic window.
[0197] avg(ds) is the arithmetic mean (in meters) of the Euclidean distances between all adjacent sampling points in the previous dynamic window.
[0198] avg(ds / dt) is the arithmetic mean of the average velocities between all adjacent points in the previous dynamic window (unit: meters per minute).
[0199] Step 4.2: Ensure that the start point of the new dynamic window maintains first-order continuity with the end point of the previous dynamic window.
[0200] Set the first point of the new dynamic window to the last point of the previous dynamic window, and set the unit tangent vector of the first point of the new dynamic window to the normalized vector of the tangent vector of the last control point of the previous window.
[0201] By performing the above operations, we can ensure that the curves in the two windows maintain first-order continuity at the connection point during subsequent calculations.
[0202] Step 5: Determine if there are any new sampling points, where:
[0203] If new sampling points exist, proceed to step 2 to process them. If no new sampling points exist, the path fitting calculation process ends. The equation of each Bézier curve obtained in the algorithm is the final output.
[0204] In summary, this invention, by combining the trajectory compression algorithm proposed by Philip J. Schneider and the concept of dynamic windows, enables the continuous influx of sampling point data to be grouped and segmented, while maintaining the first-order continuity of the curve at the segmentation points. This not only achieves real-time trajectory calculation but also reduces computational complexity.
[0205] The advantages of this invention are as follows:
[0206] 1. It removes the previous limitation that a curve could only be generated after all sampling points were input. Now, sampling points can be input while the fitted and compressed curve is being generated.
[0207] 2. The curve trajectories generated by historical sampling points (sampling points outside the dynamic window) that are relatively old can be fixed. After a new input point, it is not necessary to recalculate the trajectory of historical sampling points. It is only necessary to update the paths generated by some recent sampling points.
[0208] 3. While ensuring the first-order continuity of the entire curve, reduce the computational cost required to compress the curve. The computational approach is changed from fitting the entire curve at once to considering and stitching together segments.
[0209] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.
[0210] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A trajectory compression method combining dynamic window and Newton-Raphson iteration method, characterized in that, The steps are as follows: Step 1: Set the initial dynamic window size. Each sampling point within the dynamic window is treated as a whole input for the algorithm that generates the Bézier curve. Step 2: After reading a new sampling point, calculate the Bézier curve within the current dynamic window. The specific method is as follows: If the total number of sampling points after reading the new sampling point is 1, then no curve is generated and another sampling point is read; if the total number of sampling points after reading the new sampling point is 2, then directly connect the first sampling point and the second sampling point with a straight line and read a new sampling point; if the total number of sampling points after reading the new sampling point is greater than or equal to 3, then use the Philip J. Schneider algorithm to calculate the path of the sampling points within the dynamic window, and finally use the Newton-Raphson iteration method to reduce the error. Step 3: Determine if the number of sampling points exceeds the size of the dynamic window. If the number of sampling points is greater than or equal to the size of the dynamic window, proceed to step 4 to generate a new dynamic window; otherwise, proceed to step 5 to process the new sampling points. Step 4: Generate a new dynamic window, ensuring that the starting point of the new dynamic window maintains first-order continuity with the ending point of the previous dynamic window; Step 5: Determine if there are any new sampling points. If there are new sampling points, proceed to Step 2 to process them. If there are no new sampling points, end the path fitting calculation process. The resulting Bézier curve equation is the final output.
2. The trajectory compression method combining dynamic window and Newton-Raphson iteration method according to claim 1, characterized in that, Step 1: Set the initial dynamic window size. Starting from the first point, the sampling points within the initial dynamic window are not segmented. The specific method is as follows: The initial dynamic window size is set to 100, which means that no segmentation processing will be performed from the first point until the 100th sampling point is accumulated.
3. The trajectory compression method combining dynamic window and Newton-Raphson iteration method according to claim 1, characterized in that, The path of the sampling points within the dynamic window is calculated using the Philip J. Schneider algorithm. The specific method is as follows: Step 2.1: Update the unit tangent vector of the second-to-last sampling point Using the newly read sampling point d n Location information, calculate the penultimate sampling point d n-1 Compared to the previous point d n-2 and point d n The average of the vectors formed is used to obtain the tangent vector at the penultimate sampling point. Normalized tangent vector get This vector is the new tangent vector for the second-to-last sampling point: Calculate the unit tangent vector of the newly added sampling point. In addition, when there are only three sampling points and the current dynamic window is the first dynamic window, it is also necessary to calculate the penultimate sampling point d. n-2 unit tangent vector The formula is: Step 2.2: Parameterize the chord length to obtain the u corresponding to each point in the curve equation. i value Calculate the chord length between two adjacent points, and obtain the parameter value u of each sampling point in the fitted curve equation based on the chord length. i The specific steps are as follows: Step 2.2.1: Calculate the chord length between adjacent sampling points For sampling point d i (x i ,y i ) and sampling point d i+1 (x i+1 ,y i+1 ), chord length L i Calculated using the following formula Step 2.2.2: Calculate the total chord length Add the chord lengths between all adjacent points to obtain the total chord length L. total : Step 2.2.3: Assign parameter values For each point P i The corresponding parameter value u is calculated using the following formula. i : Step 2.3: Fitting the Bézier curve The four control points that minimize the error are calculated, and the formula for the third-order Bézier curve is obtained. The specific steps are as follows: Step 2.3.1: Calculate the parameters of the two internal control points. The parameters α1 and α2 that determine the locations of the two internal control points are solved using the following formulas: Where C1, C2 and X are: det(*) refers to the determinant of the matrix. Where X1, X2, c 1,1 c 1,2 c 2,1 and c 2,2 for: Where, d i Represents the coordinates (x, y) of the i-th sampling point i ,y i ), d in X1 and X2 i -(...) represents the Euclidean distance between the coordinates of the sampling point and the coordinates of the point fitted by the formula, which is the square root of the square of the difference between the horizontal coordinates and the square of the difference between the vertical coordinates. in, Let be the unit tangent vector at the first sampling point on the curve. This is the unit tangent vector at the last sampling point of the curve; Step 2.3.2: Determine the locations of the four control points The first and last control points V0 and V3 are the first and last sampling points of the fitted path. The positions of the two inner control points V1 and V2 are determined by the following formula: in, Let the unit tangent vector be the first sampling point. The unit tangent vector of the last sampling point; Step 2.3.3: Obtain the formula for Bézier curves Substitute the four control points into the following formula for the Bézier curve B(t): B(t)=(1-t) 3 V0+3(1-t) 2 tV1+3(1-t)t 2 V2+t 3 V3 Where t is a variable between 0 and 1. As t gradually increases from 0 to 1, the calculated coordinates will gradually move from the starting point to the end point along the trajectory of the Bézier curve. Step 2.4: Calculate the error S and determine the range of the error. If the error S is greater than 5*e, proceed to step 2.5 to divide the Bézier curve into two segments from the point of maximum error; if the error S is between e and 5*e, proceed to step 2.6 to optimize parameter u. i If the error S is less than the preset value e or the number of iterations exceeds 5, record the formula for the Bézier curve obtained in step 2.3.3 and jump to step 3. Step 2.5: Divide the curve into two segments at the point of maximum error; Step 2.5.1: Calculate the maximum error point, and then divide the set of sampling points calculated in this round into two segments based on this point; Step 2.5.2: For each segment, perform step 2.3 to calculate the Bézier curve for each segment; Step 2.5.3: Record the Bézier curve formulas obtained for each segment for plotting or analysis, then skip to step 3; Step 2.6: Use the Newton-Raphson iterative method to reduce errors. By adjusting the u of the Bézier curve B(t) corresponding to each sampling point i The value further reduces the error between the curve and the sampling points; The new u generated by the Newton-Raphson iterative method i The formula for the value is as follows: Among them, u iold For each sampling point d i The original parameter values between 0 and 1 corresponding to the Bézier curve B(t); B(t) is the formula for the Bézier curve obtained in step 2.3.3; Get the u corresponding to the new sampling point i After setting the value, return to step 2.3 to generate a Bézier curve with smaller error.
4. The trajectory compression method combining dynamic window and Newton-Raphson iteration method according to claim 1, characterized in that, Step 4: Generate a new dynamic window, ensuring that the start point of the new dynamic window maintains first-order continuity with the end point of the previous dynamic window. The specific method is as follows:
1. The number of sampling points in the dynamic window is between 20 and 200; 2. The longer the time interval, the fewer the number of sampling points; 3. The greater the distance between sampling points, the fewer sampling points are needed; 4. The faster the sampling rate ds / dt, the fewer sampling points are required; The specific formula for calculating the number of sampling points n contained in the new dynamic window is as follows: The formula for calculating c is: Where avg(dt) is the arithmetic mean of the time differences between all adjacent sampling points in the previous dynamic window, in minutes; avg(ds) is the arithmetic mean of the Euclidean distances between all adjacent sampling points in the previous dynamic window, in meters; and avg(ds / dt) is the arithmetic mean of the average velocity between all adjacent points in the previous dynamic window, in meters per minute. Step 4.2: Ensure that the start point of the new dynamic window maintains first-order continuity with the end point of the previous dynamic window; Set the first point of the new dynamic window to the last point of the previous dynamic window, and set the unit tangent vector of the first point of the new dynamic window to the normalized vector of the tangent vector of the last control point of the previous window, to ensure that the curves in the two windows maintain first-order continuity at the connection point.
5. A trajectory compression system combining dynamic windows and the Newton-Raphson iterative method, characterized in that, The trajectory compression method combining dynamic window and Newton-Raphson iteration method as described in any one of claims 1-4 is implemented to achieve trajectory compression combining dynamic window and Newton-Raphson iteration method.
6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the trajectory compression method combining dynamic window and Newton-Raphson iteration method as described in any one of claims 1-4, thereby realizing trajectory compression combining dynamic window and Newton-Raphson iteration method.
7. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the trajectory compression method combining dynamic window and Newton-Raphson iteration method as described in any one of claims 1-4, thereby realizing trajectory compression combining dynamic window and Newton-Raphson iteration method.
Citation Information
Patent Citations
Terminal positioning track fitting method based on Bezier curve
CN102998684A
Track compression method based on sliding window
CN104598621A