The rapid development of robotics technology has driven the growth of robot types and the development of related technologies. As an important aspect of robot research, path planning technology plays an irreplaceable role in practical production and application. Ant colony algorithm has a wide range of applications in robot path planning, but there is also a problem of performance overly relying on initial parameter selection. In order to solve this problem and improve the performance of mobile robot path planning, an improved ant colony algorithm based on firefly algorithm was studied and designed in a two-dimensional environment. In order to further explore the performance of ant colony algorithm in solving robot coordinated path planning problems, an improved ant colony algorithm based on heuristic function was also designed. In a three-dimensional environment, an improved ant colony algorithm based on the improved artificial potential field method was designed. The research results show that the maximum running time of the improved ant colony algorithm based on the firefly algorithm in different grid environments is 819.36 s, 847.01 s, and 811.54 s, respectively. The average running time of the improved ant colony algorithm based on heuristic function in different grid environments is 5.19 s, 5.97 s, and 9.09 s, with average path lengths of 29.90 cm, 31.08 cm, and 37.01 cm, and path length variances of 0.35, 0.87, and 2.21, respectively. The ant colony algorithm based on the improved artificial potential field method has a running time of 1.930 s, 3.182 s, and 4.662 s in different grid environments, and a path length of 29.275 cm, 49.447 cm, and 67.057 cm, respectively. The ant colony algorithm for research and design optimization has good performance. The contribution of the research lies in the design of three path planning methods for mobile robots, including two-dimensional path planning and three-dimensional path planning, which improves the time of path planning and shortens the average path length. The novelty of the research is reflected in the design of a path planning method for mobile robots in two-dimensional and three-dimensional environments, which improves the ant colony algorithm through firefly algorithm and heuristic function, and combines the ant colony algorithm with the improved artificial potential field method. The method designed by the research institute can provide technical support for path planning of mobile robots.