# Autonomous and Safe Navigation of Mobile Robots in Vineyard with Smooth Collision Avoidance
## 2 Pillar Detection from Lidar Sensor Data  
Navigation requires precise localization of the robot in the map. In order to localize the robot in the vineyard, robust feature detection is very essential. Many outdoor robots use GPS for localization. However, GPS is expensive and its induction adds to the overall cost of the system. Accurate localization without GPS requires extraction of robust features in the vineyard. Cameras can be used for feature localization, however, they suffer from the problems of occlusion and changes in pixel intensities at different times of the day. In this regard, this research proposes to use only Lidar for feature extraction. Most of the vineyards have stationary pillars, which are fixed to support the grapes and the plant. These pillars are good features to track for navigation in the vineyard. The algorithm for pillar detection from Lidar is given in Algorithm 1. The algorithm directly applies a symmetric derivative on Lidar data \(d\) as,  
\[L^{\prime}=\frac{d[i+1]-d[i-1]}{2}, \tag{1}\]  
where \(i\) is the \(i\)th Lidar data point. The symmetric derivative (\(L^{\prime}\)) gives a falling and rising edge from which the pillar is localized in the center position. ``` Data:L: Lidar data on_cylinder=False//Trueifrayoncylinder ray_idx={}//Listofrayindexesoncylinder \(\sum_{\text{idx}}=0\)//Sumofrayindexesoncylinder \(\sum_{\text{idx}}=0\)//Sumofdepthvalueofraysoncylinder \(\sum_{\text{idx}}=1\)//Result:tuple(rayindex,distance) marked={False}//Trueifrayprocessedforeachidxoflayereddistancescando Takederivativeoftastoredata ifderivative\(<-\delta\&\&\text{notmarked[idx]}\)then on_cylinder=True  marked[idx]=True  idix=idx whileon_cylinderdo  ray_idx.append(idx) \(\sum_{\text{idx}}=1\) \(\sum_{\text{idx}}+\text{



Hence, detection of a single pillar is also important, and the robot must navigate while tracking the single pillar. Figure 3h shows the scenario of two pillars on the left and right side of the Lidar sensor. Similarly, Figure 3i shows the actual scenario of two pillars in which one pillar is behind another pillar in the front. Here, the pillar in the front needs to be detected. It should be noted that the presence of obstacles (ex. weeds) in front of the pillars could induce noise in the Lidar data and the symmetric derivative could contain short falling and rising edges. However, this noise can easily be filtered by setting a threshold value, such that only those edges are recorded whose strength lies above and below a certain threshold. The threshold is shown in Figure 3 in the derivative graphs as dotted blue lines. The value of the threshold is determined empirically. Figure 4 shows the picture of actual weed in a vineyard. Although the type of weed may vary from region to region, in the context of the current research undertaken in a vineyard in Japan, the maximum height of the weeds was approximately 20 cm, while the lidar was set at a greater height. Hence, noise from the weeds did not affect the accuracy of pillar detection. Although it

Figure 3: Three different scenarios of pillar detection in a vineyard. The Lidar data and its symmetric derivate are shown on the right. (**a**) Single pillar case. (**b**) Two pillars on either side. (**c**) Occluded pillars. (**g-i**) show the actual pictures of the three scenarios in a vineyard. should be mentioned that very tall weed will adversely affect the detection, which is a limitation of the proposed method. Figure 5 shows the result of pillar detection in a simulation environment. The blue curve shows the Lidar data with random noise, whereas the orange curve shows the derivative with rising and falling edges. The pillar is detected between the edges and shown in red color. Once the pillars have been detected, the robot starts navigation in the lanes. Each lane is characterized by pillars on the left and right side, and the robot navigates the center of the lane keeping a maximum distance from grapes on either side.