© 2023, The Author(s), under exclusive license to Springer Nature Switzerland AG.Multirotor Micro Aerial Vehicles (MAVs) can operate in confined environments that are complex and insufficient to Global Positioning System (GPS) signals. In addition, studies on the autonomous implementation of the desired tasks and the development of decision-making features against changing environmental conditions offer the opportunity to apply these robotic systems in a wide field. Operating in such environments presents a lot of problems such as positioning and mapping. In this paper, it is proposed to use the Simultaneous Localization and Mapping (SLAM) method in order to minimize the errors of GPS signal data while following the trajectory determined in the fruit garden of a flying robotic system developed for use in agricultural implementations. For this proposed solution, a lidar sensor is placed on the flying robotic system. As a result, the success of the SLAM method on the trajectory tracking performance of this robotic system between tree corridors was evaluated by testing it in the experimental model environment.