## 2 Autonomous Driving Path-Generation Algorithm for a Ridge-Forming Robot
### Autonomous Driving Path-Generation Algorithm
#### 2.2.4 Waypoints Generation  
In this step, autonomous driving paths for ridge-forming work are generated according to autonomous driving operation scenarios using the inner and outer working line segments generated in the working line generation step. An autonomous driving path is a series of waypoints that are sequential points to which the robot must drive, and location coordinates and work methods at those waypoints are described. In this study, the information included in a waypoint included a waypoint number, waypoint coordinates (latitude, longitude), and waypoint type. The waypoint type is defined by dividing it into a starting waypoint, straight waypoint, turning waypoint, work-starting waypoint, work-ending waypoint, and ending waypoint, considering the operation of a ridge-forming robot. In this study the autonomous driving scenarios for an autonomous crawler-type ridge-forming robot were divided into three types: autonomous ridge-forming in the inner field, autonomous driving for returning to the starting point, and autonomous ridge-forming in the headland area. Therefore, the proposed algorithm generates waypoints corresponding to each autonomous driving scenario. The first autonomous driving scenario, autonomous ridge-forming in the inner field, starts from the endpoint of the inner working line segment, which is the nearest to the coordinates of the first outer-field boundary point, and sequentially drives along the inner working line segments that are near to each other, to perform autonomous ridge-forming work. The method of generating waypoints for the scenario of autonomous ridge-forming in the inner field is as follows. To define the reference point for generating waypoints, the inner working line segment closest to the first outer-field boundary point is extracted. Then, among the two endpoints of the extracted inner working line, the endpoint nearest to the first outer-field boundary point is defined as the reference point. Next, the distance between each inner working line segment and the reference point is calculated and the inner working line segments are sorted in order of the closest distance to the reference point. To be sure the shortest distance is driven via all inner working line segments starting from the reference point, the two endpoints of each inner working line segment are defined as the starting or ending point, respectively. Next, four waypoints for each inner working segment are created by using the coordinates of the  
where \((x_{i},\ y_{i})\) are the coordinates of the internal dividing point, \((x_{1},\ y_{1})\) are the coordinates of the starting point of the inner working line segment, \((x_{2},\ y_{2})\) are the coordinates of the ending point of the inner working line segment, and \(m_{i}\) and \(n_{i}\) are the ratio values at which the internal dividing point divides the line internally. The waypoint to end the ridge-forming operation, when the operation for the ridge-forming line is completed, is located outside of the ending point of the inner working line segments. The coordinates of the waypoint to end the ridge-forming operation are calculated using Equation (7) by setting the ratio values \(m_{e}\) and \(n_{e}\) to the sum of the half-length of the robot, the length of the implement, and the length of the inner working line segment as well as the sum of the half-length of the robot and the length of the implement. A waypoint to move to the next inner working line is a point where the robot rotates in place to move near the next straight line. When rotating in place, track slip may occur, so taking this into account, the coordinates of the waypoint are calculated to be offset a certain way away from the waypoint to end the ridge-forming operation.