Trajectory processing method and apparatus and computer-readable storage medium
Through a trajectory processing method, by obtaining and calculating the deviation data between trajectory points, iteratively correcting the trajectory points, the deviation problem of intelligent devices when generating trajectory maps is solved, and the closed loop of trajectory and the accuracy of the map is achieved.
Patent Information
- Application Number
- PCT/CN2024/094090
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-25
- Filing Date
- 2024-05-18
- Publication Date
- 2025-03-06
AI Technical Summary
In the prior art, when an intelligent device generates a trajectory map, due to equipment walking deviations and sensor errors, the trajectory generation process is caused, and a closed-loop trajectory route cannot be formed, resulting in the failure or inaccurate construction of the work area.
A trajectory processing method is proposed, by obtaining target deviation data, calculating target deviation correction data, and iteratively correcting track points so that the target deviation data meets the preset threshold. The method includes obtaining deviation data between trajectory points, calculating deviation correction data, and correcting the coordinates of the trajectory points to form a closed-loop trajectory.
It improves the accuracy and work efficiency of trajectory generation maps, solves the problem of trajectory not closed loops, and ensures the accuracy and controllability of smart devices during autonomous driving.
Smart Images

Figure CN2024094090_06032025_PF_FP_ABST
Abstract
Description
Trajectory processing method, device and computer-readable storage medium
Technical field
[0001] The present application relates to the field of computer technology, and in particular, to a trajectory processing method, device, and computer-readable storage medium. [Background Technology]
[0002] With the rapid development of the new energy field, the use of automatic control equipment is becoming more and more popular.
[0003] The device will complete the instructions according to the preset route. However, in the existing technology, the preset route will deviate during the generation process due to the influence of device walking deviation and sensor error, causing the trajectory to deviate during the generation process. For example, it is impossible to generate a closed-loop trajectory route, which ultimately leads to technical problems such as failed or inaccurate mapping of the work area.
[0004] [Summary of the invention]
[0005] The main purpose of this invention is to propose a trajectory processing method, which aims to realize the correction processing in the process of generating trajectory maps of smart devices, thereby improving the accuracy and work efficiency of generating maps based on trajectories.
[0006] A first aspect of an embodiment of the present application provides a trajectory processing method, the method comprising:
[0007] acquiring target deviation data, the target deviation data being used to indicate a deviation between a first trajectory point and a second trajectory point;
[0008] Calculate the target deviation correction data for this iteration based on the target deviation data;
[0009] At least one of the N trajectory points in a first boundary is iteratively corrected using the target correction data so that the target deviation data meets a preset threshold, where the first boundary refers to a boundary consisting of a second trajectory point in the initial trajectory and a plurality of trajectory points within a preset range from the second trajectory point.
[0010] In an optional embodiment, the iterative correction of the N trajectory points in the first boundary in the above method includes:
[0011] Calculate the displacement data of each of the N trajectory points in the first boundary after the iteration correction using the target correction data of the iteration;
[0012] Calculating a deviation value between the first track point and the second track point according to the displacement data, and updating target deviation data;
[0013] If the target deviation data is greater than or equal to a preset threshold, the target correction data of this iteration is calculated according to the target deviation data, and the N trajectory points in the first boundary are iteratively corrected using the target correction data;
[0014] If the target deviation data is less than a preset threshold, the iterative correction process is stopped.
[0015] In an optional embodiment, the calculating of the target correction data for this iteration in the above method includes:
[0016] Based on the target coordinate system, sequentially obtaining deviation values corresponding to the first trajectory point and the second trajectory point in at least one coordinate axis;
[0017] Based on the target deviation data corresponding to the first track point and the second track point in each coordinate axis, the target deviation correction data corresponding to the track point of this iteration in at least one coordinate axis is calculated.
[0018] In an optional embodiment, the iterative correction of the N trajectory points in the first boundary in the above method includes:
[0019] Based on the target correction data corresponding to the trajectory point of this iteration in at least one coordinate axis of the target coordinate system, the coordinate values of the trajectory point in at least one axis in the target coordinate system are corrected in sequence.
[0020] In an optional embodiment, the calculation of the target correction data for this iteration in the above method includes:
[0021] Based on the target coordinate system, obtaining coordinate information of the first track point and the second track point;
[0022] According to the coordinate information of the first track point and the second track point, interpolation point coordinate data of the first track point and the second track point in the target coordinate system are determined, and target correction data is generated.
[0023] In an optional embodiment, the iterative correction of the N trajectory points in the first boundary in the above method includes:
[0024] According to the insertion point coordinate data, the interpolation point is added to the position between the first track point and the second track point to complete the correction.
[0025] In an optional embodiment, the standard deviation data in the above method is used to indicate the angle deviation. The method calculates the target deviation correction data of this iteration, including:
[0026] If the target deviation value exceeds the preset angle, the position information of the center of gravity and the offset point of the preset trajectory is obtained;
[0027] Obtaining position information of the intersection point based on the position information of the center of gravity and the position information of the trajectory points in the first boundary;
[0028] Target correction data is generated according to the position information of the intersection point and the position information of the offset point.
[0029] In an optional embodiment, the iterative correction of the N trajectory points in the first boundary in the above method includes:
[0030] The coordinates of the offset points of the trajectory points in the first boundary are replaced according to the position information of the intersection point to complete the correction.
[0031] A second aspect of the embodiments of the present application provides a trajectory processing device, comprising: a trajectory acquisition module, a data processing module, and a deviation correction processing module;
[0032] The trajectory acquisition module is used to acquire target deviation data, where the target deviation data is used to indicate the deviation between the first trajectory point and the second trajectory point;
[0033] The data processing module is used to calculate the target deviation correction data of this iteration based on the target deviation data;
[0034] The correction processing module is used to iteratively correct at least one trajectory point among N trajectory points in a first boundary using the target correction data so that the target deviation data meets a preset threshold, where the first boundary refers to a boundary consisting of a second trajectory point in the initial trajectory and multiple trajectory points within a preset range from the second trajectory point.
[0035] According to a third aspect of an embodiment of the present application, a device is provided, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program.
[0036] A fourth aspect of the embodiments of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of any of the above methods when executed by a processor.
[0037] An embodiment of the present application provides a trajectory processing method. After obtaining trajectory data, for trajectories whose starting and ending points are not closed, the trajectory points can be corrected by moving the trajectory near the end point; for trajectories with too large a gap between the front and rear trajectory points, the trajectory can be avoided from being discontinuous by adding coordinate points between the two front and rear trajectory points; for sharp-angle boundaries in the trajectory, the intersection points in the boundary can be filtered by the center of gravity in the trajectory, and the offset point can be deleted. Then, at the corresponding position of the offset point in the initial corrected trajectory, the first boundary is updated to form a complete trajectory. Through the above-mentioned multiple trajectory correction processing strategies, different errors in the trajectory can be resolved, and the efficiency and accuracy of trajectory generation can be improved.
Brief Description of the Drawings
[0038] The specific embodiments of the present invention are further described in detail below with reference to the accompanying drawings:
[0039] FIG1 is a schematic diagram of an application scenario of a trajectory processing method provided by an embodiment of the present application;
[0040] FIG2 is a flow chart 1 of a trajectory processing method provided by one embodiment of the present application;
[0041] FIG3 a is a trajectory schematic diagram 1 of a trajectory processing method provided by an embodiment of the present application;
[0042] FIG3 b is a trajectory diagram 2 of a trajectory processing method provided by an embodiment of the present application;
[0043] FIG4 a is a trajectory diagram 3 of a trajectory processing method provided by an embodiment of the present application;
[0044] FIG4 b is a trajectory schematic diagram 4 of a trajectory processing method provided by an embodiment of the present application;
[0045] FIG5 is a trajectory diagram 5 of a trajectory processing method provided by an embodiment of the present application;
[0046] FIG6 is a schematic structural diagram of a trajectory processing device provided by one embodiment of the present application;
[0047] FIG7 is a schematic diagram of the computer device structure provided by one embodiment of the present application. [Specific implementation method]
[0048] In the process of implementing this application, the inventors found that in the process of constructing a map based on the trajectory, the starting point and the end point may not overlap and the path may not be closed due to the misalignment or error of the trajectory points.
[0049] To address the above issues, a trajectory processing method is provided in an embodiment of the present application.
[0050] In existing technology, smart devices follow a boundary line, starting from a preset starting point, completing a designated route, and then returning to the preset starting point. After traveling along the route, a map describing the trajectory is created based on the actual walking environment of the smart device, i.e., the trajectory route simulated by the smart device. However, due to limitations in sensor accuracy and accumulated errors in the odometer, the map created by the smart device returning to the starting position along the boundary line is not a closed-loop environmental map.
[0051] In response to the deviation problem caused by the process of generating a map of the driving trajectory of the above-mentioned intelligent machine, an embodiment of the present application provides a trajectory processing method. By obtaining multiple trajectory points, if the target deviation data between the multiple trajectory points does not meet the preset requirements, correction processing is performed, correction data is obtained, and correction processing of the trajectory points is completed based on the correction data, thereby achieving the technical effect of accurately correcting the trajectory map and improving the efficiency and accuracy of trajectory generation.
[0052] The embodiment of the present application corrects the trajectory of the smart device to the initial position by adopting a proportional correction method, and improves the map created by the smart device after walking along the line through methods such as scattered point filling and angle threshold correction, so that it forms a closed loop in the form of an obtuse angle, effectively solving the problem of low working efficiency caused by a non-closed map or an uneven map with large fluctuations, and improving the realization of the lawn mower's cutting task along the line.
[0053] The solutions in the embodiments of the present application can be implemented using various computer languages, for example, the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0054] In order to make the technical solutions and advantages of the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, and are not an exhaustive list of all the embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other unless they conflict.
[0055] The following is a brief description of the application environment of the trajectory processing method provided in the embodiment of the present application:
[0056] Please refer to Figure 1. An embodiment of the present application provides a trajectory processing method, which is applied to a trajectory processing system 10. The trajectory processing system includes: a processor 101, a positioning module 102, and a navigation module 103. After the processor 101 establishes a connection with the positioning module 102, the processor 101 obtains the real-time position information sent by the positioning module 102, and generates trajectory information based on the real-time position information. The trajectory information is further corrected according to a preset algorithm to generate a closed-loop navigation map. The navigation module 103 guides the machine operation according to the navigation map.
[0057] The processor 101, when performing the correction process, at least includes: first filtering the trajectory data in sequence, correcting fork-wrapped errors, and performing a denoising operation to correct the trajectory points whose trajectory deviation exceeds a preset threshold; secondly, smoothing the denoised trajectory data; and then performing thinning and interruption compensation on the smoothed trajectory data in sequence;
[0058] The above-mentioned trajectory processing system can be deployed in an intelligent device, or in a server or terminal device. The intelligent device can complete autonomous driving on a fixed route based on the navigation module. The server or terminal device can obtain the navigation information after the processor correction processing based on the navigation module, and command the intelligent tool to complete autonomous driving. The intelligent device can at least include: intelligent gardening tools or intelligent robots.
[0059] Please refer to Figure 2. The following embodiment uses the processor 101 in the above-mentioned trajectory processing system 10 as the execution body, and specifically describes the method provided in the embodiment of the present application as an example of applying the method provided in the embodiment of the present application to the case where the trajectory cannot be closed. The trajectory processing method provided in the embodiment of the present application includes the following steps 201 to 203:
[0060] Step 201: Obtain target deviation data.
[0061] The target deviation data is used to indicate a deviation between a first track point and a second track point.
[0062] The target deviation data between the first track point and the second track point can be the coordinate deviation between the two in the target coordinate system, the deviation in distance between the two, or the deviation in the intersection angle between the two. Here, the actual deviation in the map generated by the device's driving trajectory can be used to determine it.
[0063] Step 202: Calculate the target deviation correction data for this iteration based on the target deviation data.
[0064] The target correction data is used to indicate data that can correct the deviation between the first track point and the second track point. The target correction data may include coordinate data, numerical data, angle data, etc., and can be determined according to different correction algorithms.
[0065] After obtaining the target deviation data, the embodiment of the present application can also perform a preliminary judgment. If the target deviation data is greater than a preset threshold, correction processing can be performed. For example, a prompt message can be generated, and the user can determine the next operation based on the prompt message, such as performing map optimization, trajectory correction, or actual survey to analyze the reasons for the trajectory point deviation.
[0066] Step 203: Iteratively correct at least one of the N trajectory points in the first boundary using the target deviation correction data so that the target deviation data meets a preset threshold.
[0067] The first boundary refers to a boundary formed by the second trajectory point in the initial trajectory and multiple trajectory points within a preset range of the second trajectory point.
[0068] The preset trajectory is generated based on the path preset by the smart device. The smart device will walk from the starting point to the end point according to the preset trajectory, and capture the trajectory points of the smart device in real time to generate the initial trajectory.
[0069] The iterative correction of N trajectory points in the first boundary in the embodiment of the present application includes:
[0070] Calculate the displacement data of each of the N trajectory points in the first boundary after the iteration correction using the target correction data of the iteration;
[0071] Calculating a deviation value between the first track point and the second track point according to the displacement data, and updating target deviation data;
[0072] If the target deviation data is greater than or equal to a preset threshold, the target deviation correction data of this iteration is calculated according to the target deviation data, and the N trajectory points in the first boundary are iteratively corrected using the target deviation correction data;
[0073] If the target deviation data is less than a preset threshold, the iterative correction process is stopped.
[0074] The embodiment of the present application completes the deviation correction processing of the trajectory data by acquiring the deviation correction data between the first trajectory point and the second trajectory point, and processing the data adjacent to the second trajectory point through the deviation correction data.
[0075] In an optional embodiment of the present application, obtaining target deviation data in step 201 includes steps 301 to 302:
[0076] Step 301: Obtain the position information of the starting point in the preset trajectory and the position information of N trajectory points in the first boundary.
[0077] The first boundary refers to a boundary consisting of the end point in the initial trajectory and multiple trajectory points within a preset range of the end point.
[0078] The number of track points selected in the preset range can be determined based on the device parameters of the smart device. For example, X track points are selected near the preset end point, and the value range of X is determined based on the walking positioning error of the smart device. 2In the scenario, the error is set to δ = 1m, and the recording frequency of the robot trajectory point is F = 30 times / m, then R = 40. In general, the value range of R is F ≤ R ≤ 2F .
[0079] Select R trajectory points near the end point, and the size of R depends on the size of the robot's positioning error.
[0080] The positioning error is determined based on the overall length of the actual trajectory. The simulated end point in the actual walking trajectory of the robot is used as the center of the circle and R trajectory points are used as the radius to determine the range of trajectory points to be corrected.
[0081] Step 302: Acquire target deviation data between the end point and the starting point based on the position information of the starting point and the position information of the end point in the first boundary.
[0082] The target deviation data in step 201 may include multiple data, and angle and distance data are listed here as examples for illustration:
[0083] If the target deviation data is used to indicate the distance deviation between the second trajectory point and the first trajectory point, it can be completed by using various distance calculation algorithms such as Euclidean distance, Manhattan distance, and Chebyshev distance.
[0084] Here we take the Euclidean distance as an example to calculate the distance deviation: According to formula 1: Lx = x end -x start Calculate the first distance between the second track point and the first track point in the x-axis direction, according to the formula Ly = y end -y start A second distance in the y-axis direction between the second trajectory point and the first trajectory point is calculated.
[0085] In the embodiment of the present application, by calculating the distance deviation between the second trajectory point and the first trajectory point, the deviation degree between the current trajectory and the preset trajectory can be obtained, and the trajectory correction can be completed more accurately.
[0086] If the target deviation data is used to indicate the angular deviation between the second trajectory point and the first trajectory point, the angle between the second trajectory point and the first trajectory point can be used for calculation.
[0087] By analyzing the target deviation data between the second trajectory point and the first trajectory point, it is possible to easily determine whether the end point of the trajectory coincides with the starting point, and the smoothness of the trajectory is improved by performing deviation correction processing on multiple trajectory points in the first boundary.
[0088] In an optional embodiment of the present application, the calculation of the target correction data of this iteration in step 202 may include steps 401 to 402:
[0089] Step 401: Based on the target coordinate system, sequentially obtain the deviation values corresponding to the first track point and the second track point in at least one coordinate axis.
[0090] In an embodiment of the present application, the target deviation values of the first trajectory point and the second trajectory point can be obtained based on the target coordinate system, where the target coordinate system includes at least X-axis coordinates and Y-axis coordinates; the target deviation values are parsed to obtain a first deviation value of the target deviation value in the X-axis coordinate and a second deviation value in the Y-axis coordinate.
[0091] Step 402: Calculate target deviation correction data corresponding to the trajectory point of this iteration in at least one coordinate axis based on the target deviation data corresponding to the first trajectory point and the second trajectory point in each coordinate axis.
[0092] Based on a first deviation value of the target deviation value in the X-axis coordinate and a second deviation value in the Y-axis coordinate in the target coordinate system; a first correction value in the X-axis coordinate and a second correction value in the Y-axis coordinate of the target correction data of this iteration are calculated.
[0093] Here, the correction value can be represented by a weighted distance. The deviation distance in the embodiment of the present application may include the distance in the x-axis and y-axis directions in the target coordinate system. Calculating the weighted distance of each trajectory point may include:
[0094] Obtaining a distance deviation between the second track point and the first track point, the distance deviation comprising: a distance deviation value in the x-direction and a deviation value in the y-direction;
[0095] According to the distance deviation, first distance weights in the x direction and second distance weights in the y direction of the N trajectory points in the first boundary are calculated in sequence.
[0096] For example, the formula Calculate the first distance weight in the x direction, where Wx represents the first distance weight, lx represents the distance deviation between the first track point and the second track point in the x direction, i represents the sequence number of the track point, and r represents the total number of track points in the first boundary;
[0097] By formula Calculate the second distance weight in the y direction, where Wy represents the first distance weight, ly represents the distance deviation between the first and second trajectory points in the y direction, i represents the sequence number of the trajectory point, and r represents the total number of trajectory points in the first boundary.
[0098] By calculating the distance weight of each track point, the size of the deviation of each track point can be quantified, and the correction strategy for each track point can be accurately determined based on the position and deviation distance of each track point, thereby improving the accuracy of correction.
[0099] Based on the distance weight of each of the N trajectory points, the position information of the N trajectory points in the first boundary line is corrected so that the position of the first trajectory point coincides with the position of the second trajectory point.
[0100] In the embodiment of the present application, when it is determined that the deviation distance between the second trajectory point and the first trajectory point is greater than a preset distance, the deviation correction process can be automatically performed, or the deviation correction process can be performed after recording the current offset trajectory information. By recording the offset trajectory information, iterative optimization of the trajectory data is facilitated, thereby improving the accuracy of trajectory generation.
[0101] In an optional embodiment of the present application, calculating the target correction data of this iteration in step 203 may include steps 501 to 502:
[0102] Step 501: Obtain target correction data corresponding to the trajectory point of this iteration in at least one coordinate axis.
[0103] Step 502: Based on the target correction data corresponding to the trajectory point of this iteration in at least one coordinate axis of the target coordinate system, the coordinate values of the trajectory point in at least one axis in the target coordinate system are corrected in sequence.
[0104] The distance weight of each trajectory point can quantify the position where each trajectory point needs to be moved. After moving N trajectory points in the first boundary line, the first boundary line is corrected.
[0105] As shown in Figure 3a, when the smart device moves according to the preset trajectory, the starting point and the end point cannot be closed due to device deviation or positioning deviation. Therefore, the driving trajectory needs to be corrected to return to the correct first trajectory point.
[0106] In the implementation of this application, correcting the coordinate value of at least one axis of the trajectory point in the target coordinate system may include:
[0107] Based on the target coordinate system, the position information (X, Y) and target distance weight of the Mth track point among the N track points are obtained in sequence;
[0108] Correcting the distance in the X direction of the M-th trajectory point according to the first target weight, and correcting the distance in the Y direction of the M-th trajectory point according to the second target weight;
[0109] Until all the N track points are corrected, the first boundary line is corrected.
[0110] The embodiment of the present application can quantify the size of the deviation of each trajectory point by calculating the distance weight of each trajectory point, and accurately determine the correction strategy for each trajectory point based on the position and deviation distance of each trajectory point, thereby improving the accuracy of correction.
[0111] In an optional embodiment of the present application, calculating the target correction data of this iteration in step 202 may include steps 601 to 602:
[0112] Step 601: Based on a target coordinate system, obtain coordinate data of the first track point and the second track point.
[0113] The first track point may be a track adjacent to the second track.
[0114] In the process of capturing the actual walking path points of the smart device in the embodiment of the present application, some track points are not collected due to unstable signals or other reasons, resulting in a large distance displacement between two adjacent track points in the driving trajectory; or, after the track point correction processing in step 203, the distance between two adjacent track points is greatly displaced due to position correction. The large distance between two adjacent track points will affect the construction of the map, such as defects or unevenness, and even affect the accuracy and controllability of the subsequent walking of the device, so further follow-up correction is required.
[0115] Step 602: Determine interpolation point coordinate data of the first track point and the second track point in a target coordinate system based on the coordinate information of the first track point and the second track point, and generate target correction data.
[0116] In the embodiment of the present application, the coordinates of the first and second trajectory points may be processed by averaging to generate target correction data, for example:
[0117] Get the position information of the Mth track point and the coordinates of the M+1th track point, perform interpolation processing, get the coordinates of the two, and after averaging according to the formula, generate the coordinates of the Pth track point in the simulated track, that is, the position information of the Mth track point and the coordinates of the M+1th track point, and add the coordinate point to the track. If the coordinate information of the M track point is (x i ,y i ), the coordinate point of the M+1 trajectory point (x i+1 ,y i+1 ), then the x-axis value of the P-th trajectory point is The value of the y-axis coordinate of the Pth trajectory point is
[0118] In an optional embodiment of the present application, calculating the target correction data of this iteration in step 203 may include steps 701 to 702:
[0119] Step 701: Obtain interpolation point coordinate data.
[0120] The acquisition of the interpolation point coordinate data is as described in step 602 and will not be repeated here.
[0121] Step 702: According to the insertion point coordinate data, the interpolation point is added to the position between the first track point and the middle of the second track point to complete the correction.
[0122] In the embodiment of the present application, when performing difference optimization, the position information of the P point trajectory can be obtained by calculating the X-axis coordinate value and the Y-axis coordinate value in the position information of the Mth trajectory point and the position information of the M+1th trajectory point, and supplemented to the first boundary based on the position information of the P point trajectory to make the trajectory points of the first boundary more evenly distributed and the trajectory smoother.
[0123] The trajectory diagram shown in Figure 3a is the initial trajectory diagram without trajectory processing. It can be clearly seen that the first trajectory point and the second trajectory point do not overlap, which causes the smart device to be unable to travel smoothly and normally. If the first trajectory point is the starting point and the second trajectory point is the end point, the device will not be able to return to the starting point normally, affecting the automatic control of the device. The trajectory diagram shown in Figure 3b is the initial trajectory diagram after trajectory processing. In the figure, because the first trajectory point and the second trajectory point have overlapped, the second trajectory point is not marked for clarity. After the correction processing, a closed trajectory line is achieved, and the trajectory formed by the trajectory points is smooth, which is conducive to the walking of the robot.
[0124] In the embodiments of the present application, further correction processing is performed on adjacent trajectory points, thereby solving the problem of discontinuity of trajectory points caused by the correction process or positioning deviation during the map generation process. The coordinates of the Nth trajectory point and the coordinates of the N+1th trajectory point are obtained, interpolated, and the sum of the two coordinates is averaged to generate the coordinate point of the midpoint between the Nth trajectory point and the N+1th trajectory point in the simulated trajectory. This coordinate point is then added to the trajectory to complete the trajectory correction.
[0125] In an optional embodiment of the present application, calculating the target correction data of this iteration in step 202 may include steps 801 to 802:
[0126] Step 801: Acquire target rays.
[0127] The target ray is generated at least according to the starting point and the center of gravity of the preset trajectory.
[0128] Before obtaining the target ray, the angle indicated by the target deviation value can be determined and the target deviation value can be calculated. The angle formed by the first trajectory point, the second trajectory point and at least one trajectory point in the first boundary can be obtained first, and then it can be determined whether the angle is greater than the preset angle.
[0129] The center of gravity can be used as the emission direction of the angle ray, and the focus can be used to indicate that the ray obtains the average position of all trajectory points in the x-direction and the y-direction in all trajectories in the preset trajectory.
[0130] For example, the formula: Calculate the coordinate value of the center of gravity in the x-direction, where Xi represents the coordinate value of the current coordinate point in the x-direction, and n represents the number of all track points in the track map. The coordinate value of the center of gravity in the x-axis direction is obtained by averaging the x-direction coordinate values of all track points.
[0131] For example, the formula: Calculate the coordinate value of the center of gravity in the y direction, where yi represents the coordinate value of the current coordinate point in the y direction, and n represents the number of all track points in the track map. The coordinate value of the center of gravity in the y direction is obtained by averaging the y-axis coordinate values of all track points.
[0132] By calculating the center of gravity, the trajectory can be considered in terms of the direction of the angle launch as a whole, while also taking into account the offset of the center of gravity value, thereby improving the generation of effective points.
[0133] As shown in Figure 4a, during the trajectory correction process, due to the long distance between the end point and the starting point or other positioning reasons, a sharp angle intersection will be formed in the closed-loop map after trajectory correction. That is, the angle between the two boundary lines is less than 90 degrees, which is not conducive to robot operation.
[0134] If the target angle of the current trajectory point exceeds the preset angle threshold, the center of gravity point is obtained, and a ray is emitted based on the center of gravity point. The point where the ray intersects the first boundary is marked as a valid point, and the trajectory point and the valid point in the first boundary are connected to update the first boundary.
[0135] If the target angle of the current trajectory point does not exceed the preset angle threshold, the current trajectory point is determined to be a normal trajectory point and no trajectory offset correction is required. The trajectory deviation correction process of the next trajectory point is directly performed referring to the above method until the trajectory deviation correction process of each trajectory point in the trajectory data to be processed is completed.
[0136] When generating rays in the embodiment of the present application, reference will be made to the starting point and center of gravity of the trajectory, including: taking the starting point, i.e. the starting point of the smart device, as the origin, and emitting a ray r with an angle α with the starting running direction in the direction of the mean point of the trajectory.
[0137] Step 802: If the target ray intersects with the first boundary, obtain real-time intersection point coordinate data.
[0138] Based on the target coordinate system, starting from the coordinates of the starting point of the trajectory, the target ray is emitted along the direction of the center of gravity, and the target ray is detected to see if it intersects with the first boundary. For example, a ray with an angle of 120° with the first coordinate axis of the target coordinate system along the center of gravity is selected, and the ray is detected to see if it intersects with the first boundary at the last trajectory, and the intersection is recorded.
[0139] In order to improve the accuracy of the correction and avoid the excessive length error caused by the ray, if the target ray intersects with the second boundary in the preset trajectory, deleting the trajectory between the intersection point and the starting point will cause the trajectory route to change, so the length of the ray will be set. When setting the length of the ray, it can be set according to the trajectory travel distance and positioning error. For example, a line segment with a length of lr is intercepted on the ray r, and one of the endpoints of the line segment is the origin. When judging the intersection, it is only necessary to judge whether the ray segment within the length intersects with the first boundary. Among them, the length lr is related to the positioning error, for example, in 500m 2 In the map, the error is set to δ = 1m, so the length lr is selected to be 3δ.
[0140] In order to improve the accuracy of the correction and avoid the acute angle between the starting point and the first boundary, the angle of the first ray emission along the emission direction of the center of gravity will be set, so that the angle of the trajectory point in the trajectory regenerated by the intersection point and the starting point can be an obtuse angle, which is convenient for the driving and operation of the equipment.
[0141] If the target ray does not intersect the first boundary, no trajectory deviation correction is required, and the trajectory deviation correction process for the next trajectory point is directly performed referring to the above method until the trajectory deviation correction process for each trajectory point in the trajectory data to be processed is completed.
[0142] If the target ray does not intersect the first boundary, the trajectory points are corrected based on the coordinates of the intersection point, and the trajectory map is updated.
[0143] The above method for determining whether an intersection exists can be implemented through line segment mutual repulsion experiments and line segment straddling experiments. If an intersection exists, the trajectory points after the intersection number are deleted, and the line segment from the origin to the intersection is integrated into the total trajectory as a compensation trajectory, thereby achieving angle threshold limitation to correct acute angles.
[0144] The above-mentioned line segment mutual exclusion experiment can be carried out by determining whether the rectangles formed by the two line segments intersect. If the rectangles intersect, it is necessary to continue to determine whether the subsequent line segments intersect; the above-mentioned line segment straddling experiment determines the positional relationship between the two vectors based on the line segment cross product.
[0145] Step 803: Generate target correction data according to the position information of the intersection point.
[0146] The position information of the intersection point may include coordinate data (x, y) in the target coordinate system.
[0147] The embodiment of the present application obtains the ray generated by the starting point and the center of gravity in the preset trajectory, and determines whether the ray intersects with the trajectory boundary, so as to correct the trajectory points in the preset trajectory with an angle less than a threshold. This avoids the trajectory angle problem in the preset trajectory, which causes the device to malfunction during automatic driving, and improves the accuracy of trajectory generation.
[0148] In an optional embodiment of the present application, calculating the target correction data of this iteration in step 203 may include steps 901 to 902:
[0149] Step 901: Obtain the location information of the intersection point.
[0150] The method for obtaining the location information of the intersection point is as described in step 803 and will not be repeated here.
[0151] Furthermore, the coordinate data of at least one coordinate trajectory point between the intersection point and the starting point can be generated based on the coordinate data of the intersection point and the coordinate data of the starting point, thereby making the trajectory between the two smoother and improving the stability and controllability of the equipment.
[0152] Step 902: Delete the track points in the first boundary according to the position information of the intersection point to complete the deviation correction.
[0153] When deleting a track point in the first boundary, you first need to determine the intersection point of the center of gravity and the first boundary. Based on the intersection point, determine the offset point between the starting point coordinates and the intersection point coordinates, delete the offset point coordinates in the track map, and finally regenerate the track map based on the intersection point and the starting point, avoiding the back-trip problem caused by angle problems.
[0154] As shown in Figure 5, with the starting point as the starting point for ray emission, a ray of a preset length (set according to the positioning error) is emitted along the coordinate direction of the centroid trajectory at a preset angle (e.g., 120°). If the ray intersects the first boundary, the point is marked as a valid point and the position information of the valid point is obtained. For example, in Figure 5, the ray intersects the trajectory point D of the first boundary. The trajectory points where the angle between the trajectory point B and the original trajectory point is less than the preset angle are deleted, and the trajectory points B and D are connected to generate a new boundary.
[0155] The intersection point determined in step 803 is connected to the adjacent trajectory points, and the first auxiliary line is deleted. The boundary line is regenerated using the coordinate data of the intersection point and the coordinate data of the first trajectory point, and is updated to the first boundary, completing the trajectory point correction process. The first boundary is corrected according to the coordinate position of the center of gravity so that the target angle is less than the preset angle.
[0156] As shown in Figure 4a, the trajectory diagram shown is an initial trajectory diagram that has not been processed. It can be clearly seen that after the preliminary correction processing or in the map generated by the positioning error, the trajectory in the starting direction and the trajectory in the return direction form an acute angle, which is not conducive to the operation of the power tool.
[0157] As shown in Figure 4b, the trajectory map is a target trajectory map after angle processing. The angle correction formed by the trajectory of the starting direction and the trajectory of the return direction is completed. The angle correction is obtuse, so that the angle formed by the starting direction and the return direction at the starting position is an obtuse angle, which improves the working efficiency of the intelligent tool.
[0158] In the embodiment of the present application, the acute angle at the starting point of the trajectory is corrected into an obtuse angle by using the angle threshold limiting method, which will be more conducive to the efficient operation of the device and the smooth return of the device to the station.
[0159] The trajectory processing method provided in the embodiment of the present application, after obtaining trajectory data, can complete the trajectory point correction processing by moving the trajectory near the end point for trajectories with non-closed starting and ending points; for trajectories with too large gaps between the front and rear trajectory points, coordinate points can be added between the two front and rear trajectory points to avoid trajectory discontinuity; for sharp-angle boundaries in the trajectory, the intersection points in the boundary can be filtered by the center of gravity in the trajectory, and the offset point can be deleted. Then, the first boundary is updated at the corresponding position of the offset point in the initial corrected trajectory to form a complete trajectory. Through the above-mentioned multiple trajectory correction processing strategies, different errors in the trajectory can be resolved, and the efficiency and accuracy of trajectory generation can be improved.
[0160] It should be understood that, although the various steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps may be performed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily to be performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0161] Referring to FIG6 , an embodiment of the present application provides a trajectory processing device 60 , including: a trajectory acquisition module 601 , a data processing module 602 , and a deviation correction processing module 603 ;
[0162] The trajectory acquisition module 601 is used to acquire target deviation data, where the target deviation data is used to indicate the deviation between the first trajectory point and the second trajectory point;
[0163] The data processing module 602 is used to calculate the target deviation correction data of this iteration based on the target deviation data;
[0164] The correction processing module 603 is used to iteratively correct at least one trajectory point among N trajectory points in a first boundary using the target correction data so that the target deviation data meets a preset threshold. The first boundary refers to a boundary consisting of a second trajectory point in the initial trajectory and multiple trajectory points within a preset range of the second trajectory point.
[0165] The trajectory processing device provided in the embodiment of the present application obtains multiple trajectory points. If the target deviation data between the multiple trajectory points does not meet the preset requirements, correction processing is performed to obtain correction data, and correction processing of the trajectory points is completed based on the correction data, thereby achieving the technical effect of accurately generating a map based on the trajectory points, thereby improving the efficiency and accuracy of trajectory generation.
[0166] In an optional embodiment, the present application provides a device that includes at least a trajectory processing device 60. This device corrects the trajectory of the intelligent device to its initial position using a proportional correction method, and improves the map created by the intelligent device after traveling along the route through methods such as scattered point filling and angle threshold correction, thereby forming a closed loop with an obtuse angle. This effectively solves the problem of low working efficiency caused by a non-closed map, an uneven map, or large fluctuations, and improves the performance of the lawn mower's cutting tasks along the route.
[0167] For the specific limitations of the above-mentioned device, please refer to the limitations of the trajectory processing method above and will not be repeated here. Each module in the above-mentioned device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.
[0168] In one embodiment, a computer device is provided, and the internal structure diagram of the computer device can be shown in Figure 7. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a trajectory processing method as described above, including: a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements any step in the trajectory processing method as described above.
[0169] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any step in the above trajectory processing method can be implemented.
[0170] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0171] The present application is described with reference to the flow chart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present application. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart flow or multiple flows and / or one box or multiple boxes of the block diagram.
[0172] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0173] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A trajectory processing method, characterized in that: The trajectory processing method is applied to a processor, comprising: Acquire target deviation data, where the target deviation data is used to indicate a deviation between a first trajectory point and a second trajectory point; Calculate the target deviation correction data of this iteration according to the target deviation data; At least one of the N trajectory points in the first boundary is iteratively corrected through the target correction data so that the target deviation data meets a preset threshold, wherein the first boundary refers to a boundary consisting of a second trajectory point in the initial trajectory and a plurality of trajectory points within a preset range of the second trajectory point.
2. The trajectory processing method according to claim 1, characterized in that: The iterative correction of the N trajectory points in the first boundary includes: Calculate the displacement data of each of the N trajectory points in the first boundary corrected by this iteration through the target deviation correction data of this iteration; Calculate the deviation value between the first track point and the second track point according to the displacement data, and update the target deviation data; If the target deviation data is greater than or equal to a preset threshold, the target deviation correction data of this iteration is calculated according to the target deviation data, and the N trajectory points in the first boundary are iteratively corrected by using the target deviation correction data; If the target deviation data is less than a preset threshold, the iterative correction process is stopped.
3. The trajectory processing method according to claim 1, characterized in that: The calculation of the target deviation correction data of this iteration includes: Based on the target coordinate system, sequentially obtaining deviation values corresponding to the first trajectory point and the second trajectory point in at least one coordinate axis; Based on the target deviation data corresponding to the first trajectory point and the second trajectory point in each coordinate axis, the target deviation correction data corresponding to the trajectory point of this iteration in at least one coordinate axis is calculated.
4. The trajectory processing method according to claim 3, characterized in that: The iterative correction of the N trajectory points in the first boundary includes: Based on the target correction data corresponding to the trajectory point of this iteration in at least one coordinate axis of the target coordinate system, the coordinate values of the trajectory point in at least one axis in the target coordinate system are corrected in sequence.
5. The trajectory processing method according to claim 1, characterized in that: The method calculates the target deviation correction data of this iteration, including: Based on the target coordinate system, obtaining coordinate information of the first trajectory point and the second trajectory point; According to the coordinate information of the first track point and the second track point, interpolation point coordinate data of the first track point and the second track point in the target coordinate system are determined, and target correction data is generated.
6. The trajectory processing method according to claim 5, characterized in that: The iterative correction of the N trajectory points in the first boundary includes: According to the insertion point coordinate data, the interpolation point is added to the position between the first track point and the second track point to complete the correction.
7. The trajectory processing method according to claim 1, characterized in that: include: Acquire a target ray, where the target ray is generated at least according to a starting point and a center of gravity of a preset trajectory; If the target ray intersects with the first boundary, obtaining the coordinate data of the intersection point where the two intersect; Target correction data is generated according to the intersection point coordinate data.
8. The trajectory processing method according to claim 7, characterized in that: The iterative correction of the N trajectory points in the first boundary includes: According to the coordinate data of the intersection point, the track points in the first boundary are replaced, and the N track points in the first boundary are iteratively corrected.
9. A trajectory processing device, characterized in that: include: Trajectory acquisition module, data processing module and deviation correction processing module; The trajectory acquisition module is used to acquire target deviation data, wherein the target deviation data is used to indicate the deviation between the first trajectory point and the second trajectory point; The data processing module is used to calculate the target deviation correction data of this iteration according to the target deviation data; The correction processing module is used to iteratively correct at least one trajectory point among N trajectory points in a first boundary through the target correction data so that the target deviation data meets a preset threshold value, wherein the first boundary refers to a boundary composed of a second trajectory point in an initial trajectory and a plurality of trajectory points within a preset range of the second trajectory point.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the trajectory processing method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Positioning equipment track optimizing and boundary extracting method and device thereof
CN108931795A
Vehicle track deviation rectifying method and device and electronic equipment
CN113155139A
Track deviation rectification processing method and device
CN115002679A
Coincident trajectory extraction method and device, electronic equipment and storage medium
CN115983007A
Track point processing method, electronic equipment and storage medium
CN116414817A
Cited By
Particle motion trail simulation method and electronic equipment
CN120217814A
Positioner multi-source track transmission deviation correction method and device and computer equipment
CN120559681A
Offset correction method, system and equipment based on tool bit
CN121254743A
Robot steering wheel zero deflection angle calibration method, device and equipment and storage medium
CN121340250A
Track data processing method and device and electronic equipment
CN121478894A