# A Two-Stage Local Path Planning Algorithm Based on Sampling and Optimization Methods
## 1 Introduction  
The rapid development of mobile robots offers extensive possibilities for addressing a variety of tasks. However, achieving autonomous navigation for mobile robots remains a challenging endeavor. One critical factor in ensuring the safe and efficient completion of navigation tasks is local path planning [1, 2]. Current local path planning algorithms primarily focus on enabling mobile robots to reach their destinations quickly and safely, often overlooking the significance of the global path in robotic navigation applications. For instance, robots such as disinfection robots [3], vacuum cleaning robots [4], inspection robots [5], and tour guiding robots [6] must operate along designated global paths to perform their tasks effectively. Therefore, this paper focuses on how local path planning algorithms can achieve obstacle avoidance and adherence to the global path in navigation tasks where the global path cannot be arbitrarily altered.  
To enable mobile robots to navigate around obstacles while closely following the global path, the core idea of the method proposed in this paper is to simulate the stamping forming technique used in metalworking. Stamping forming involves placing a metal sheet between models and then applying high pressure with a punch press. This process deforms the metal sheet, shaping it along the indentations of the mold. In the context of local path planning for mobile robots, obstacles are analogous to molds, the global path isanalogous to the punch, and the local path is analogous to the metal sheet. By simulating the stamping process, the local path can be shaped to contour around obstacles while adhering to the global path. Therefore, the proposed method is termed the path stamping forming (PSF) algorithm.  
The PSF algorithm is a two-stage local path planning method based on sampling and optimization, as illustrated in Figure 1. Initially, the PSF algorithm employs a sampling approach to generate a preliminary path that runs parallel to the global path without colliding with obstacles, similar to the initial position of the metal sheet in the stamping process. Subsequently, the PSF algorithm establishes constraints for path deviation, obstacle avoidance, and velocity, similar to the downward pressure exerted by the punch, the resistance from the molds, and the deformation limits of the metal sheet during stamping. Finally, an optimization method is employed to compute the optimal local path that satisfies these constraints.  
The contributions of this study are as follows:  
1. The PSF algorithm comprehensively considers the significance of the global path in navigation tasks. It ensures that mobile robots can quickly return to the global path after deviating from it and then continue following the global path.  
2. During the optimization stage, we only consider obstacles relevant to the global path, rather than all obstacles in the environment. Additionally, we optimize only the longitudinal distance between the mobile robot and the global path, thereby reducing the computational complexity of the optimization process.  
3. This paper conducts extensive experiments on the PSF algorithm, comparing its navigation performance with existing advanced navigation algorithms, and demonstrating the superior performance of the PSF algorithm in following the global path. Furthermore, the effectiveness of the PSF algorithm is validated on real robots and in typical tasks.  
The rest of this paper is organized as follows. Section 2 reviews the related work. Section 3 presents the proposed path stamping forming algorithm. In Section 4, simulations and experiments illustrate the effectiveness and performance of the proposed algorithm, and finally, Section 5 concludes this paper.