The Large Sky Area Multi-Object Fiber Spectroscopy Telescope (LAMOST) is one of the most effective multiobject spectroscopic instruments. Its survey efficiency is guaranteed by simultaneously positioning multiple fibers via 4000 robotic fiber positioners (RFPs). With the further updates to LAMOST, the new-generation RFPs will be smaller, and the number of RFPs will increase to 5000. The RFPs are densely packed with shared working space. Thus, they may collide with each other, leading to them damaged and reducing the survey speed. In this study, we propose a new motion planning algorithm that prevents the collision of RFPs. To simplify the collision avoidance problem, we transform the motion planning process from a dynamic one into a static one by selecting one of the RFPs in each collision pair as the waiting robot. Accordingly, we design a method for choosing the waiting robot, and use a rapidly exploring random tree to plan a collision-free path for the waiting robot. However, there may be blocks between the waiting robots and their neighbors. Therefore, we also design methods to resolve these blocks. Simulations suggest that the proposed algorithm can prevent 98.4% of the collisions. About 99.9% of the positioners can reach their targets without collisions. Although developed for LAMOST, we believe that our algorithm can also be used for other instruments with equal-arm theta-phi positioners, such as the Dark Energy Spectroscopic Instrument.