In order to realize the technique of quick picking and obstacle avoidance, this work proposes a trajectory optimization method for the pickup manipulator under the obstacle condition. The proposed method is based on the improved artificial potential field method and the cosine adaptive genetic algorithm. Firstly, the Denavit–Hartenberg (D-H) method is used to carry out the kinematics modeling of the pickup manipulator. Taking into account the motion constraints, the cosine adaptive genetic algorithm is utilized to complete the time-optimal trajectory planning. Then, for the collision problem in the obstacle environment, the artificial potential field method is used to establish the attraction, repulsion, and resultant potential field functions. By improving the repulsion potential field function and increasing the sub-target point, obstacle avoidance planning of the improved artificial potential field method is completed. Finally, combined with the improved artificial potential field method and cosine adaptive genetic algorithm, the movement simulation analysis of the five-Degree-of-Freedom pickup manipulator is carried out. The trajectory optimization under the obstacle environment is realized, and the picking efficiency is improved.