The cultivation model for spindle-shaped apple trees is widely used in modern standard apple orchards worldwide and represents the direction of modern apple industry development. However, without an effective obstacle avoidance path, the robotic arm is prone to collision with obstacles such as fruit tree branches during the picking process, which may damage fruits and branches and even affect the healthy growth of fruit trees. To address the above issues, a three-dimensional path -planning algorithm for full-field fruit obstacle avoidance harvesting for spindle-shaped fruit trees, which are widely planted in modern apple orchards, is proposed in this study. Firstly, based on three typical tree structures of spindle-shaped apple trees (free spindle, high spindle, and slender spindle), a three-dimensional spatial model of fruit tree branches was established. Secondly, based on the grid environment representation method, an obstacle map of the apple tree model was established. Then, the initial pheromones were improved by non-uniform distribution on the basis of the original ant colony algorithm. Furthermore, the updating rules of pheromones were improved, and a biomimetic optimization mechanism was integrated with the beetle antenna algorithm to improve the speed and stability of path searching. Finally, the planned path was smoothed using a cubic B-spline curve to make the path smoother and avoid unnecessary pauses or turns during the harvesting process of the robotic arm. Based on the proposed improved ACO algorithm (ant colony optimization algorithm), obstacle avoidance 3D path planning simulation experiments were conducted for three types of spindle-shaped apple trees. The results showed that the success rates of obstacle avoidance path planning were higher than 96%, 86%, and 92% for free-spindle-shaped, high-spindle-shaped, and slender-spindle-shaped trees, respectively. Compared with traditional ant colony algorithms, the average planning time was decreased by 49.38%, 46.33%, and 51.03%, respectively. The proposed improved algorithm can effectively achieve three-dimensional path planning for obstacle avoidance picking, thereby providing technical support for the development of intelligent apple picking robots.