It is important to consider the environment in three dimensions in order for it to be applicable to real-world applications and projects in complex environments. Furthermore, when it comes to mobile robots, three-dimensional movements and areas seem more acceptable. In real application areas, considering the resources of mobile robots, such as energy, finding the optimal path is important. Optimal path planning means that the shortest path length, where the selected path is as far as possible from obstacles, must be smooth without sharp turns and must consider motion constraints. Finding an optimal 3D path planning is a Non-deterministic Polynomial-time (NP-hard) problem [5; 6]. This makes metaheuristic algorithms a good choice for designing a solution to such a problem. Considering that large-scale environments in 3D environments increase the applicability of this study in real applications, as such, one of the fundamental problems related to robots from past to present is 3D path planning for aerial robots. This problem can become even more complex in large-scale agricultural areas with many obstacles. In this study, we focused on Gray Wolf Optimizer (GWO)-based algorithms to solve the mentioned problem. In general, GWO-based algorithms have a balanced behavior transition between discovery and use phases because they use the hierarchical group working mechanism of wolves, and they also use a minimum number of control mathematical parameters. In this way, the chance of finding the optimal solution in a short time is high; in addition, the use of resources is also efficient. On the other hand, a GWO-based method was proposed in [18] for solving the mentioned problem, and they proved it was better than other metaheuristic-based algorithms. In this study, two methods, inspired by Incremental Gray Wolf Optimization (I-GWO) [19] and Expanded Gray Wolf Optimization (Ex-GWO) [19], are proposed to address the above issue. The classical GWO algorithm can behave more stably in normal situations (for a somewhat standard environment without many obstacles). The Ex-GWO-based path planning method may be performed more successfully in larger and more crowded environments with larger populations and iterations, and the I-GWO-based path planning method may give good results in medium and smaller, less populated environments. However, the I-GWO is faster than other algorithms. These methods can be applied in different and diverse agricultural application areas and thus can be useful work for farming and smart agriculture. This paper presents optimized, reliable, and shortest pathfinding mechanisms for smart agricultural robots (e.g., autonomous tractors and agricultural drones) that track crops on large-scale farmlands without the need for the intervention of any human using distributed IoT [20] and WSN technologies. Thanks to the algorithms proposed in this study, efficient resource consumption and product growth rate can be achieved with low risk and cost. On the other hand, avoiding obstacles in the path planning of agricultural areas is more complex than in other path planning areas because of a dense population of objects that can serve as obstacles such as trees, plants, and buildings. As mentioned above, the most critical problem these mobile robots face is the efficient use of resources such as energy, so this issue is given importance in this paper. In other words, the management of resources with minimal loss is the aim of the paper. In addition, a smooth and efficient pathfinding mechanism is very important for robots; because of this, the system must showcase a sustainable performance. Therefore, the method used with the mobile robots must deliver them to the destination point using the best path. To achieve all these purposes, two different algorithms based on metaheuristic algorithms are presented for each autonomous mobile robot. Indeed, the proposed methods find collision-free optimal paths in an acceptable time with the lowest process costs in different environments containing various obstacles.