Abstract:Accurate row alignment harvesting of grapes can effectively reduce the collision between vibration mechanism of the harvester and the trellis, which is an important means to achieve large-scale mechanized harvesting. Based on the local driving scene model between grape rows in Frenet coordinate system, an automatic row alignment path planning algorithm for grape harvesters was proposed. Using the global operation path as a reference line, the algorithm utilized onboard LiDAR to identify grape rows ahead in real time, and applied the K-means algorithm to cluster the point cloud of grape rows. The Lattice algorithm was used to dynamically sample the driving area ahead according to the traveling speed, and then the local path clusters were generated based on fifth-order polynomials. The extreme steering positions of the front and rear wheels were taken as the feature points of the harvester, and then the collision detections were conducted between feature points and the lateral segmentation minimum bounding rectangle of grape rows, and the offset costs of each local path relative to grape rows and the global path were calculated. Based on the operating states and environment condition, the decision limits of the grape line deviating from the reference line were determined, and the weighted sum of the offset costs were optimized by dynamic programming algorithm, and then the path with the minimum cost in the path cluster can be obtained as the current local path. The algorithm was validated through simulation by using the robot simulation software Gazebo and Rviz, as well as real experimental tests. The results showed that the average lateral error of the planned local path relative to grape rows was 4.37 cm, and the maximum absolute curvature was 0.201 1 m-1. When the global path deviated significantly from the grape row, the local path can effectively correct the deviation and meet the driving requirements for grape harvesting operations. In the simulation test for planning a path of 6 m, the average processing time of this algorithm was 213 ms per iteration, with a maximum of 337 ms per iteration. In the experimental test for planning a path of 6 m, the average processing time was 577 ms per iteration, with a maximum of 816 ms per iteration. The relevant research methods can provide reference for local path planning of agricultural machinery in vineyard scenarios.