## 1 Introduction  
China is a large agricultural country, especially in recent years, and with the increase in market demand for fruits, the planting area of fruits has increased annually [1]. In particular, crabapples are widely planted in Northeast China because of their rich vitamins and unique taste [2, 3]. Currently, there are few studies on the automatic picking of crabapples in China, and manual picking remains the primary method. To achieve automatic picking, research is conducted on crabapple-picking robots. However, the fruit growth distribution on the tree is relatively random and is blocked by obstacles such as fruit tree branches, leading to issues such as low picking efficiency and difficulty in picking [4]. Therefore, in order to improve the picking efficiency of the picking robot on the tree and avoid the collision between the robot and the fruit tree branches during the picking process, the study of the multi-objective crabapple picking sequence planning and the obstacle avoidance problem of the picking robot has been conducted. In recent years, scholars both domestically and internationally have conducted extensive research and experiments on the planning of fruit-picking sequences and obstacle avoidance for picking machines. These studies have yielded promising results that have been effectively applied in practical production settings ([PERSON] et al., 2017; [PERSON] et al., 2017) used a target sequencing method to plan the picking order of densely planted bell peppers. Experimental verification under greenhouse conditions showed that the harvest cycle time is shortened by 12% compared with disordered random picking. [PERSON] et al. (2018) used a genetic algorithm to plan the order of multi-target fruit-picking tasks on trees, and compared with the disordered random method, the picking time was significantly shortened and the picking efficiency was improved. [PERSON] et al. (2019) used the target gravity and adaptive coefficient adjustment method to improve the Bi-RRT algorithm to achieve collision-free picking of lychees on the tree, and the planning speed of the improved Bi-RRT algorithm was faster than that before the improvement. [PERSON] et al. (2019) introduced target gravity into the RRT algorithm and used GA to optimize the path generated by the RRT algorithm, so as to plan the obstacle avoidance path of the lychee picking manipulator and improve the path quality and planning efficiency. In order to solve the problem of continuous picking of multi-objective clustered crabapples on crabapple trees and avoid a collision between the robotic arm and the tree branches during the picking process, this paper proposes a method for planning the picking sequence and the obstacle avoidance path for picking, implemented through improved ACO and improved RRT algorithms. The adaptive pheromone factor and heuristic function factor are used to improve transfer probability, and the adaptive volatility factor is introduced to optimize the pheromone update to improve the ACO algorithm, thereby increasing the convergence speed of the algorithm in order to achieve the planning of the picking order of multi-objective crabapples on the tree. By combining the APF algorithm with the RRT algorithm to introduce the gravitational field, the guidance of the RRT algorithm path search is enhanced, the unnecessary inflection point is reduced, the convergence speed is improved, and the superiority of the improved algorithm is verified by simulation analysis compared with the previous RRT algorithm. Finally, a test platform was constructed to conduct a picking test analysis to verify the effectiveness and feasibility of the improved algorithm proposed in this paper. The algorithm proposed in this paper can be applied to the obstacle avoidance of sand fruit picking. It can also be applied to other scenarios. For example, [PERSON] et al.