# Optimization Algorithm for 3D Smooth Path of Robotic Arm in Dynamic Obstacle Environments
## 3 Method Description
### Static Path Planning Module  
This section focuses on the study of trajectory planning algorithms in static obstacle environments. It proposes a random tree path backtracking and updating method for static environments, establishes related robotic arm motion models and collision detection methods, and improves the rapidly exploring random tree star (RRT*) algorithm through the following strategies: an adaptive angle guidance strategy between search tree nodes, a backtracking and updating path simplification strategy targeting redundant nodes, and Catmull-Rom path smoothing and continuity optimization. Finally, through simulation experiments, the following conclusions are drawn:  
1. The adaptive angle guidance strategy emphasizes the guidance of the random search tree towards the target node, effectively influencing both path quality and path convergence time. 2. The backtracking and updating strategy for redundant nodes in historical search nodes significantly reduces the length of the trajectory path at the cost of decreased computational complexity. Figure 1: Algorithm overall design framework. Catmull-Rom path processing enhances the smoothness and continuity of the trajectory. In summary, this design not only improves the efficiency of trajectory planning but also ensures a lower damage rate for the robotic arm and stability in task execution. Since the RRT* algorithm inherits the spatial random sampling method of the traditional RRT algorithm without any improvement, it results in lower planning efficiency and poor target orientation. Consequently, a large number of ineffective nodes are generated during the expansion of the random tree, which increases the computational burden of the algorithm. Therefore, the ideal scenario would be to ensure a correct and efficient obstacle-avoiding path within a limited computation time, with the expanded nodes being as effective as possible. In the literature [42], target biasing has been introduced, where the expansion direction towards the target or a random point is determined by the ratio of a biasing coefficient to a random number in the range [0, 1]. This approach enhances the directionality of path planning by allowing expansion in both directions. Additionally, it controls the generation of new nodes by dynamically adjusting the weight allocation ratio between the target point and random sampling points. Therefore, in this section's research, to further improve the path planning efficiency of the RRT* algorithm, based on the collected obstacle information, an adaptive angle guidance expansion strategy for the search tree is designed as the expansion direction for random tree nodes. \[q_{\text{new}}=q_{\text{near}}+s\cdot\cos\beta\cdot\frac{(q_{\text{goal}}-q_ {\text{near}})}{\|q_{\text{goal}}-q_{\text{near}}\|}+s\cdot\sin\beta\cdot \frac{(q_{\text{rand}}-q_{\text{near}})}{\|q_{\text{rand}}-q_{\text{near}}\|} \tag{1}\]  
\[\beta= \begin{cases}\beta-\frac{\beta_{\text{init}}}{\frac{1}{|q_{\text{goal}} -q_{\text{init}}|}},&\text{no obstacle}\\ \beta_{\text{init}}+\frac{\beta_{\text{init}}}{\frac{1}{|q_{\text{goal}}-q_{ \text{final}}|}}\times(j-1),&\text{obstacle}\end{cases}  \tag{2}\]  
The expansion node is expressed as shown in Equation (1), and the guidance direction \(\beta\) is given by Equation (2), which exhibits different orientations in various scenarios. If there are no obstacles between a newly expanded node of the random tree and its parent node, it indicates that this direction temporarily has good safety for expansion. In this case, the newly generated node should move more towards the target point, reducing the expansion deviation angle to control the expansion of the random tree in the direction of the target point, enhancing the orientation of the random tree, and reducing the computation time and length of path planning. The reduction in angle is controlled by the initial point, target point, and step size.