This paper focuses on the problem that the current path planning algorithm is not mature enough to achieve the expected goal in a complex dynamic environment. In light of the ant colony optimization (ACO) with good robustness and strong search ability, and the dynamic window method (DWA) with better planning effect in local path planning problems, we propose a fusion algorithm named DACO that can quickly and safely reach the designated target area in a complex dynamic environment. This paper first improves the ant colony optimization, which greatly improves the convergence performance of the algorithm and shortens the global path length. On this basis, we propose a second-level safety distance determination rule to deal with the special problem of the research object encountering obstacles with unknown motion rules, in order to perfect the obstacle avoidance function of the fusion algorithm in complex environments. Finally, we carry out simulation experiments through MATLAB, and at the same time conduct three-dimensional simulation of algorithm functions again on the GAZEBO platform. It is verified that the algorithm proposed in this paper has good performance advantages in path planning and dynamic obstacle avoidance.INDEX TERMS Motion planning, path planning, ant colony optimization, dynamic window approach, mobile robot.