## 3 RRT-Based Guideline Planner  
### RRT-Based Guideline Searching Process  
The guideline is generated by an RRT-based guideline planner with multiple constraints considered. This guideline is responsible for two factors: defining virtual driving behavior and reducing the wide planning area. The RRT-based planning process is shown in Algorithm 1. ```
Input: Vehicle model, environment model \(M_{E}\), start point \(\mathbf{Lo}_{fre}\), and goal points \(\mathbf{p}_{gk}\). Output: A collision-free, dynamical driving path. \(\mathbf{\Gamma}\leftarrow\) InitializeTree(); while ExecutionCount \(\leq\) MaxIterationNumber \(\mathbf{\tau}_{new}\leftarrow\) SampleNewNode(); if Assessment(\(\mathbf{\tau}_{new}\), \(\mathbf{\tau}_{prev}\)) \(\geq\) Constraints \(\mathbf{\zeta}\) CONTINUE;//////\(\mathbf{\tau}_{new}\) is not a valid new node \(\mathbf{\zeta}\) endif  Insert \(\mathbf{\tau}_{new}\) to \(\mathbf{\Gamma}\)// Add\(\mathbf{\tau}_{new}\) into RRT-Tree if its valid \(\mathbf{\zeta}\)  if Distance(\(\mathbf{\tau}_{new}\), \(\mathbf{p}_{gk}\)) \(\leq\)\(\mathit{thr}_{end}\)  BREAK;  endif  BackRRTPath( ); return\(\mathbf{P}_{R}\);
```  
**Algorithm 1** RRT searching process  
**Definition 1**. : _Function Initialize Tree ( ) is a function used for generating a basic RRT-tree \(\mathbf{\Gamma}\) with all the node being set to zero. Especially, the first node of \(\mathbf{\Gamma}\) should be updated to the location \(\mathbf{Lo}_{fre}\)._  
**Definition 2**. : _Function Sample New Node ( ) is a function that generates a random new node \(\mathbf{\tau}_{new}=(s_{new},\ d_{new})\) in \(\mathbf{M}_{E}\) through a random sampling method [22]._  
\[\mathbf{\tau}_{new}= \begin{cases}\mathbf{\tau}_{new}\in M_{E}&(randval_{0}\leq\mathit{ thr}_{\tau})\\ \mathbf{p}_{gk}&(randval_{0}>\mathit{thr}_{\tau})\end{cases}  \tag{5}\]  
_where \(randval_{0}\) is a random number in \([0,\ 1]\). \(\mathit{thr}_{\tau}\) is a switching threshold that determines the convergence speed. Since this process is a rough search process, \(\mathit{thr}_{\tau}\) can be 0.3._  
**Definition 3**. : _Function Distance (\(\mathbf{\tau}_{new}\), \(\mathbf{p}_{gk}\)) is a function that calculates the Euclidean distance between the two input points._  
**Definition 4**. : _Function Assessment (\(\mathbf{\tau}_{new}\), \(\mathbf{\tau}_{prev}\)) is a function to assess whether the new sampled point meets the constraints or not. The point that meets all the constraints will be adapted and added to \(\mathbf{\Gamma}\)._  
**Definition 5**. : _Function BackRRTPath ( ) is a function that sorts \(\mathbf{\Gamma}\) and obtains the final feasible path \(\mathbf{P}_{R}\)._  
Constraints that are mentioned in Definition 4:  
1. Maximum distance constraint. The value of function Distance (\(\mathbf{\tau}_{new}\), \(\mathbf{\tau}_{prev}\)) should meet a distance threshold \(\mathit{thr}_{dis}\). If Distance (\(\mathbf{\tau}_{new}\), \(\mathbf{\tau}_{prev}\)) \(\geq\)\(\mathit{thr}_{dis}\), \(\mathbf{\tau}_{new}\) should be resampled on the connection between \(\mathbf{\tau}_{new}\) and \(\mathbf{\tau}_{prev}\) at where Distance (\(\mathbf{\tau}_{new}\), \(\mathbf{\tau}_{prev}\)) \(=\)\(\mathit{thr}_{dis}\). The RRT process in this work is a rough search process. And our initial planning area is larger than \(60m\times 20m\). in this work, \(\mathit{thr}_{dis}=2.5m\). 2. Minimum distance constraint. The value of function Distance (\(\mathbf{\tau}_{new}\), \(\mathbf{\tau}_{prev}\)) should be bigger than a minimum distance threshold \(\mathit{thr}_{same}\). That is, if Distance (\(\mathbf{\tau}_{new}\), \(\mathbf{\tau}_{prev}\)) \(\leq\)\(\mathit{thr}_{same}\), \(\mathbf{\tau}_{new}\) locates too close to the points on \(\mathbf{\Gamma}\), \(\mathbf{\tau}_{new}\) should be abandoned. \(\mathit{thr}_{same}\) can be choose as \(\mathit{thr}_{same}=0.2\mathit{thr}_{dis}\). 3. Process termination constraint. This constraint is used to determine whether \(\mathbf{\Gamma}\) have reached \(\mathbf{p}_{gk}\) or not. If yes, the while loop should be terminated.