Aiming at the problem of difficult obstacle avoidance for unmanned ground vehicles (UGVs) in complex dynamic environments, an improved A*-APF algorithm (BA*-MAPF algorithm) is proposed in this paper. Addressing the A* algorithm’s challenges of lengthy paths, excess nodes, and lack of smoothness, the BA*-MAPF algorithm integrates a bidirectional search strategy, applies interpolation to remove redundant nodes, and uses cubic B-spline curves for path smoothing. To rectify the traditional APF algorithm’s issues with local optimization and ineffective dynamic obstacle avoidance, the BA*-MAPF algorithm revises the gravitational field function by incorporating a distance factor, and fine-tunes the repulsive field function to vary with distance. This adjustment ensures a reduction in gravitational force as distance increases and moderates the repulsive force near obstacles, facilitating more effective local path planning and dynamic obstacle navigation. Through our experimental analysis, the BA*-MAPF algorithm has been validated to significantly outperform existing methods in achieving optimal path planning and dynamic obstacle avoidance, thereby markedly boosting path planning efficiency in varied scenarios.