Traditional path planning algorithms often encounter challenges in complex dynamic environments, including local optima, excessive path lengths, and inadequate dynamic obstacle avoidance. Thus, the development of innovative path planning algorithms is essential. This article addresses the challenges of mobile robot path planning in complex environments, where traditional methods often converge to local optima, leading to suboptimal path lengths, and struggle with dynamic obstacle avoidance. To overcome these limitations, we propose an integrated algorithm, the enhanced sparrow search algorithm combined with the dynamic window approach (ESSA-DWA). The algorithm first utilizes ESSA for global path planning, followed by local path planning facilitated by the DWA. Specifically, ESSA incorporates Tent chaotic initialization to enhance population diversity, effectively mitigating the risk of premature convergence to local optima. Moreover, dynamic adjustments to the inertia weight during the search process enable an adaptive balance between exploration and exploitation. The integration of a local search strategy further refines individual updates, thereby improving local search performance. To enhance path smoothness, the Floyd algorithm is employed for path optimization, ensuring a more continuous trajectory. Finally, the combination of ESSA and DWA uses key nodes from the global path generated by ESSA as reference points for the local planning process of DWA. This approach ensures that the local path closely follows the global path while also enabling real-time dynamic obstacle detection and avoidance. The effectiveness of the algorithm has been validated through both simulations and practical experiments, offering an efficient and viable solution to the path planning problem.