With the increasing demand for automated production technology in national defense, industry, agriculture, and other fields, the status and role of mobile robots are becoming more and more pivotal. The intelligent technology of robots is becoming more and more demanding in terms of reliability, stability, efficiency, and adaptability, and the autonomous navigation technology of mobile robots is facing new challenges. This paper introduces the basic principle of traditional A∗ algorithm, points out the problems of this algorithm such as cumbersome calculation, large turning angle, and unsmooth derived trajectory planning, and proposes an improved A∗ algorithm. The improved algorithm introduces a two-way alternating search mechanism to improve the efficiency of the search path, and the improvement of the heuristic function solves the problem that the two-way alternating search A∗ algorithm takes more time when there are obstacles perpendicular to the path on the way to the encounter. Simulation experiments in different raster environments prove that compared with the traditional A∗ algorithm, genetic algorithm, and simulated annealing algorithm, the improved A∗ algorithm can significantly improve the search path speed, while overcoming the disadvantages of many path turning angles and large turning angles and is an efficient and feasible algorithm for raster map environments.