Path Planning for Autonomous Robotic Platform based on Created Sampling Maps Gabriela Asiminari 1,2, Dimitrios Kateris 1, Vasileios Moysiadis 1,3, Ioannis Menexes 1, Aristotelis C. Tagarakis 1 and Dionysis Bochtis 1 1 Institute for Bio-Economy and Agri-Technology (iBO), Centre for Research and Technology-Hellas (CERTH), 6th km Charilaou-Thermi Rd, 57001, Thessaloniki, Greece 2 Department of Supply Chain Management, International Hellenic University, 60100, Katerini, Greece 3 Department of Computer Science & Telecommunications, University of Thessaly, 35131 Lamia, Greece Abstract 1 Soil properties are of great importance in crop management, as they highly affect plant growth, crop production and product quality. In order to examine these properties, soil samples must be collected from the entire surface of the field. An effective soil sampling requires careful selection of the total number and the location of the samples. Therefore, soil properties can present heterogeneity along the field. For that reason, distributing sampling points evenly along the field is not considered as a best practice. In this research, in order to define the location of sampling points, the field was divided into homogenous management zones based on electrical conductivity (ECa) values. An equal number of points was distributed in each zone and a sampling map was created. Subsequently, a path for autonomous navigation was generated based on the created sampling map. More specifically, points of the map were distributed in the shortest possible distance order for the robotic platform to move while collecting the samples. In order to test the accuracy of the path planning, the proposed path was uploaded to the robotic platform and the movement was mapped. The path that was followed by the robotic platform was quite similar to the simulated path. The results of this research suggest that sensors such as a penetrometer can be mounted on an autonomous robotic platform in order to collect data from sampling points by moving along the created path. Keywords Soil sampling, soil mapping, path planning, UGV, management zones 1. Introduction Soil sampling plays an important role in the collection of information about soil properties which highly affect plant growth, crop production and product quality. In order to succeed an effective soil sampling, it is crucial to find different methods to collect soil samples fast and with low cost [1]. New technologies, such as innovative sensors for mapping agricultural parameters as well as geolocation devices (GPS), can help the achievement of this goal. Furthermore, successful soil sampling depends on the wise selection of the total number and the location of samples in the field [2]. Nowadays, a common practice is to be collected soil samples from random locations in the field. However, soil properties present heterogeneity even over small distances thus soil can show significant variability along the field. For that reason, a good practice is to divide the field into homogenous management zones based on certain parameters and create variability maps. Generally, in precision agriculture, these maps are developed according to data collection, data analysis and interpolation [3]. By consulting these Proceedings of HAICTA 2022, September 22–25, 2022, Athens, Greece EMAIL: g.asiminari@certh.gr (A. 1); d.kateris@certh.gr (A. 2); v.moisiadis@certh.gr (A. 3); i.menexes@certh.gr (A. 4); a.tagarakis@certh.gr (A. 5); d.bochtis@certh.gr (A. 6) ORCID: 0000-0001-8716-2173 (A. 1); 0000-0002-5731-9472 (A. 2); 0000-0001-5772-1392 (A. 3); 0000-0001-5743-625X (A. 5); 0000- 0002-7058-5986 (A. 6) ©️ 2022 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) 337 variability maps, sampling points can be distributed more effectively along the field by taking into consideration the needs of each area of the field. In this study, a use case of path planning for an autonomous robotic platform according to created sampling maps has been performed. The final path contains all the sampling points sorted in such an order that the robotic platform moves the shortest possible distance to collect the samples. The path was uploaded to the robotic platform (Thorvald, Saga Robotics) and the movement was mapped to examine the tracking accuracy. This procedure of soil sample collection can be very useful as it can be inserted into automated steering systems and mobile platforms. Smart farming tries to integrate agricultural technologies of that kind as they are still not widely prevalent at the field [4]. The selected points can be uploaded in an Android app which will guide the user in the field to collect samples or in an unmanned ground vehicle (UGV) for autonomously collecting of soil samples. The use of an autonomous robotic system has many advantages. More especially, each sample is georeferenced and can be analyzed separately from the rest. Consequently, a map that presents the path of the robotic platform can be created resulting in the procedure can become completely autonomous [5]. 2. Methodology The methodology that was followed in this work can be separated into five parts. Initially, soil electrical conductivity (ECa) data were collected from the entire surface of the field and it was divided into three homogenous management zones. Afterwards, 10 sampling points were selected in each management zone. Consequently, at the end of the process 30 sampling points were selected along the field. These sampling points was selected empirically according to the field size so that points cover all the area of the field adequately. Then, a greedy algorithm was applied to solve a traveling salesman problem (TSP). At the end of the procedure, the shortest distance possible path was created, for the robotic platform to follow all the points only once. Finally, the generated path was uploaded to the robotic platform and the traveled distance was mapped. 2.1. Data Acquisition The ECa values were collected by scanning the field surface with an EM38 sensor. The ECa expresses the ability of soil to conduct electrical current. In general, it is affected by many physico- chemical properties such as soil salinity, bulk density, soil temperature, organic matter etc. For that reason, analysis of ECa has been applied to determine the spatial variation of plenty of edaphic properties. Moreover, it can be measured quite easily and fast and usually is related to crop yield. Consequently, ECa is a common tool in the research of spatio-temporal characterization of properties that affect crop yield [6]. The EM38 device is a sensor that carries dense datasets and it is the most extensively used electromagnetic interference (EMI) sensor. The measurement unit for the ECa was Β΅Siemens cm-1. Figure 1 presents the points where ECa was measured in the field. Figure 1: ECa measurement points in the field. 338 2.2. Creation of Management Zones For the creation of the management zones, a rectangular grid was generated around the entire surface of the field. Then the values that were outside the boundaries of the field were discarded. In order to assign ECa values to the points of the grid, the inverse distance weighted (IDW) interpolation method was applied. According to this method, the value of ECa for each grid point was estimated by averaging the weighted ECa values of known sample points that are close to the grid point. The closer a known sample point was, the more weight it had to the process. At the end of this procedure, each point of the grid acquired an ECa value based on the nearest known values of samples. The next step was to be decided to which of the three management zones each grid point belongs. For that reason, the quantiles classification method was implemented. This method distributes a set of values into groups that contain an equal number of values. The quantiles method equation is presented below. π‘‘π‘œπ‘‘π‘Žπ‘™ π‘π‘œπ‘–π‘›π‘‘π‘  π‘œπ‘“ π‘”π‘Ÿπ‘–π‘‘ π‘π‘œ π‘œπ‘“ π‘π‘œπ‘–π‘›π‘‘π‘  π‘π‘’π‘Ÿ π‘§π‘œπ‘›π‘’ = , (1) π‘‘π‘œπ‘‘π‘Žπ‘™ π‘›π‘œ π‘œπ‘“ π‘§π‘œπ‘›π‘’π‘  According to the equation, the total number of points that belong to each zone is calculated by dividing the total number of grid points with the number of classes. Based on the values of ECa of the grid, a contour plot was created to display the relationship between x, y coordinates of grid points and the value of ECa. Each zone is extracted as a polygon and is projected on a map. Simultaneously with the map, a legend is also produced which indicates the boundaries of ECa in each zone (Figure 2). Figure 2: Contour plot of ECa in the field and. 2.3. Creation of Sampling Points In this section equally distributed sample points were created in each zone. The concept was to create a new grid for each zone, then partition the grid into 10 equal clusters and obtain the centroid of each cluster. Generally, clustering is a method that divides a set of points into groups (clusters). In this study, the number of clusters was set equal to the number of sampling points. In order to create clusters, k- means clustering method was implemented. Given a set of points (x 1,…,xn), where xi was a 2- dimensional real vector, k-means clustering tries to divide the n points into k(≀n) sets S={S 1,…,Sk }. The algorithm initially chooses k points as initial cluster centers. Then, Euclidean distance between each point and each cluster center was calculated and points were assigned to the nearest cluster. Finally, the averages of all clusters were updated, and the process was repeated until the inertia or within-cluster sum-of-squares criterion was minimized [7]. π‘˜ 2 π‘–π‘›π‘’π‘Ÿπ‘‘π‘–π‘Ž = π‘Žπ‘Ÿπ‘”π‘  π‘šπ‘–π‘› βˆ‘ βˆ‘ β€–π‘₯𝑗 βˆ’ πœ‡πœ„ β€– , (2) 𝑖=1 π‘₯𝑗 βˆˆπ‘†π‘– Where ΞΌi is the center of all the points xj in Si. After the creation of clusters, the coordinates of cluster centers were calculated. Figure 3(a) presents the scatter plot of clusters with their centroids and Figure 3(b) present the centroids. 339 a) b) Figure 3: a) Scatter plot of clusters with their centroids and b) The centroids on the contour plot. 3. Results After the generation of the sampling points, the shortest possible path in order the robotic platform to approach each point exactly once, was calculated by solving a Travelling Salesman problem (TSP). To succeed that, the Greedy algorithm was applied. Greedy is a heuristic algorithm that seeks the local optimum at each stage assuming that it is part of the global optimum [8]. This algorithm was ideal for this study as it requires minimal computational time. This is due to the fact that it does not take into consideration all points and edges but it only picks points that have the lowest weight for each iteration [9]. Subsequently, the created path was uploaded to the autonomous robotic platform (Figure 4a). The robotic platform was moved autonomously in a field that was in an early stage of cultivation hence it could navigate without row restrictions. The complete traveled distance of the robot was recorded and projected onto the map (Figure 4b). As can be seen, the robot platform, autonomously followed a complete path through the entire area of the field. This indicates that any sensor will be mounted on the robotic platform can collect samples from the selected sampling points completely autonomously. a) b) Figure 4: a) The autonomous robotic platforming and b) The complete travelled distance in the field. 4. Discussion and Conclusion In conclusion, this work presents an innovative way to create paths for autonomous robotic platforms navigation based on created sampling maps. More specifically, sampling points were generated in specific locations in the field. To select the most appropriate locations, variability maps were created based on the values of electrical conductivity in the field. The field was divided into three management zones and 10 points were created in each zone. Finally, by solving a TSP problem these points were rearranged in such an order that the robotic platform traversed all the points once at the least possible 340 distance. The completed path was uploaded in an autonomous robotic platform (Thorvald, Saga Robotics) and its traveled distance was recorded. This research suggests that sensors can be mounted on an autonomous robotic platform to acquire data from different soil properties by following the created path of sampling points. More especially, a digital penetrometer can be attached to the robot to collect data for soil compaction. Measurements of pH can also be obtained from the created sampling points. In addition, usage of the sampling points in mobile application should be further investigated as it can become a useful tool for farmers. Finally, future research is needed for path planning in orchards as trees can be considered obstacles and consequently an automatic obstacle avoidance system must be generated. 5. Acknowledgements This research was carried out as part of the project Β«Soil information management system – SIMSΒ» (Project code: ΚΜΑ6-0190726) under the framework of the Action Β«Investment Plans of InnovationΒ» of the Operational Program Β«Central Macedonia 2014-2020Β», that is co-funded by the European Regional Development Fund and Greece”. 6. References [1] V. I. Adamchuk, J. W. Hummel, M. T. Morgan, and S. K. Upadhyaya, On-the-go soil sensors for precision agriculture, Comput. Electron. Agric. (2004). doi: 10.1016/j.compag.2004.03.002. [2] J. Huuskonen and T. Oksanen, Soil sampling with drones and augmented reality in precision agriculture, Comput. Electron. Agric. (2018). doi: 10.1016/j.compag.2018.08.039. [3] N. M. Betzek, E. G. de Souza, C. L. Bazzi, K. Schenatto, A. Gavioli, and P. S. G. MagalhΓ£es, Computational routines for the automatic selection of the best parameters used by interpolation methods to create thematic maps, Comput. Electron. Agric. (2019). doi: 10.1016/j.compag.2018.12.004. [4] A. Lukowska, P. Tomaszuk, K. Dzierzek, and L. Magnuszewski, Soil sampling mobile platform for Agriculture 4.0, (2019). doi: 10.1109/CarpathianCC.2019.8765937. [5] G. KitiΔ‡, D. KrkljeΕ‘, M. PaniΔ‡, C. Petes, S. Birgermajer, and V. CrnojeviΔ‡, Agrobot Lala—An Autonomous Robotic System for Real-Time, In-Field Soil Sampling, and Analysis of Nitrates, Sensors, 22(11) (2022). doi: 10.3390/s22114207. [6] D. L. Corwin and S. M. Lesch, Apparent soil electrical conductivity measurements in agriculture,” Comput. Electron. Agric. (2005). doi: 10.1016/j.compag.2004.10.005. [7] P. Ng and C. M. Pun, Skin color segmentation by texture feature extraction and K-mean clustering, (2011). doi: 10.1109/CICSyN.2011.54. [8] H. Abdulkarim and I. F. Alshammari, Comparison of Algorithms for Solving Traveling Salesman Problem, Int. J. Eng. Adv. Technol. (2015) 2249 – 8958. [9] H. Azis, R. dg. Mallongi, D. Lantara, and Y. Salim, Comparison of Floyd-Warshall Algorithm and Greedy Algorithm in Determining the Shortest Route, in Proceedings of the 202nd East Indonesia Conference on Computer and Information Technology (EIConCIT), 2018, pp. 294–298, doi: 10.1109/EIConCIT.2018.8878582. 341