In view of problems of slow iterative speed and low solution accuracy of standard particle swarm optimization algorithm used in the path planning of mine search and rescue robot in complex terrain, a path planning method for mine search and rescue robot based on two-particle swarm optimization algorithm was proposed. Firstly, the obstacles are expanded into regular polygons to build an environment model, and then the improved two-particle swarm optimization algorithm is used as the path optimization algorithm. When the sensor detects obstacles within a certain distance in front of the search and rescue robot, it starts to run the improved two-particle swarm optimization algorithm: particle swarm optimization algorithm with improved learning factor (CPSO) grows in steps, which is suitable for finding paths in relatively open areas, while particle swarm optimization algorithm with dynamic velocity weight (PPSO) has small particle steps, which makes it good at finding paths in complex and variable areas of obstacle shapes. Then the algorithm evaluates the paths obtained by the two particle swarm optimization algorithms whether meet the obstacle avoidance requirements or not. If both meet the obstacle avoidance requirements, the shortest path is selected as the final path. Finally, the optimal driving path of the mine search and rescue robot in the whole road condition model is obtained. The simulation results show that the convergence speed of particle swarm optimization algorithm is improved by improving the learning factor and adding the dynamic velocity weight, and the optimal solution fluctuation range is reduced; the improved two-particle swarm optimization algorithm can be effectively combined with the path planning model, and the optimal path can be found in the complex road section, which improves the success rate of path planning and shortens the path length.