# TA-RRT*: Adaptive Sampling-Based Path Planning Using Terrain Analysis
## 4 Experiment
### Experiment in Dynamic Scenarios  
In dynamic environments, real-time path replanning is essential to ensure safe and efficient navigation when unexpected changes occur, such as the appearance of new obstacles. The TA-RRT* algorithm incorporates a dynamic replanning mechanism, allowing it to adapt to evolving scenarios while maintaining a collision-free path. Algorithm 4 presents the dynamic replanning process using TA-RRT*. At first, an initial path (\(T_{\text{init}}\)) is generated using the TA-RRT* algorithm from the starting node (\(q_{\text{init}}\)) to the goal node (\(q_{\text{goal}}\)). As the vehicle progresses along the path, its current position (\(z_{\text{current}}\)) is continuously updated (Line 3), and the surrounding terrain is monitored for changes (Line 4), including the appearance of dynamic obstacles. As dynamic obstacles (\(Obs_{\text{new}}\)) appear and obstruct the initial path (\(T_{\text{init}}\)), the algorithm identifies potential collision risks and recalculates a replanned path (\(T_{\text{new}}\)) from the current position to the goal node, considering updated environmental information (Lines 5-6). This enables robust navigation in dynamic and complex environments. The proposed algorithm leverages TA-RRT*'s terrain analysis and adaptive sampling capabilities to dynamically adjust the path in real time, enabling reliable performance in scenarios where environmental changes are frequent and unpredictable. ```
1:\(T_{\text{init}}\leftarrow\) TA-RRT*(\(q_{\text{init}},V,E\))
2:while!CheckGoalReached() do
3:\(z_{\text{current}}\leftarrow\text{UpdateLocation}()\)
4:\(Obs_{\text{new}}\leftarrow\text{UpdateTerrain}()\)
5:ifCheckPathCollision() then
6:\(T_{\text{new}}\leftarrow\) TA-RRT*(\(q_{\text{current}},V,E\))
7:endif
8:endwhile
```  
**Algorithm 4** Path Replanning Using TA-RRT* in Dynamic Scenario  
Figures 12 and 13 illustrate the path replanning results based on Algorithm 4. For a performance comparison, other RRT*-based algorithms also performed path replanning using the same approach. The blue and green dots represent the start and goal points, respectively, while the gray areas indicate static obstacles. It is assumed that the vehicle has generated an initial path (green line) and is navigating along it. At a certain point, a dynamic obstacle (red area) appears, prompting the vehicle to perceive the environmental change and generate a new path (orange line) from its current position (purple dot) to the goal. Following the steps of Algorithm 4, the vehicle dynamically updates the environment and recalculates a replanned path to ensure safe arrival at the goal. These results demonstrate that TA-RRT* effectively generates obstacle-avoiding paths in environments with both low and high obstacle densities. Regardless of the obstacle distribution, the proposed algorithm successfully adapts to dynamic changes and recalculates feasible paths, ensuring efficient navigation toward the goal. Figures 12 and 13 represent the results of path replanning in environments with relatively low and high obstacle densities, respectively. In low-density environments, the exploration space is wider, enabling the generation of simpler paths. Conversely, in high-density environments, the algorithm effectively avoids complex clusters of obstacles. These results highlight the ability of the TA-RRT* algorithm to reliably and efficiently generate paths through real-time replanning across various obstacle densities. This underscores its potential applicability in dynamic real-world environments, such as autonomous driving and robotic path planning. Table 5 presents the results of dynamic path replanning in two distinct scenarios: Scenario #1 with low-density obstacles, and Scenario #2 with high-density obstacles. In Scenario #1, where obstacles are sparsely distributed, TA-RRT* achieves the lowest replan path cost (9.2218), outperforming the other algorithms. This demonstrates its ability to adapt efficiently to dynamic changes.