# A Novel Maneuver-Based Driving Envelope Generation Approach for Driving Safety Assessment
## 4 The Applications of the Driving Envelope
### Motion Planning  
The driving envelope can be utilized in motion planning. The polynomial method is used to generate trajectories with kinematic constraints. Each trajectory is evaluated according to a cost function, which is designed considering the cost of path smoothness, safe distance to obstacles, etc [4; 40]. The proposed driving envelope has been combined with the polynomial methods to generate a set of trajectories in our previous work [41]. The fifth-order polynomial for the lateral motion and the longitudinal motion in a reference frame is used to generate the trajectories. \[d(t)= c_{5}t^{5}+c_{4}t^{4}+c_{3}t^{3}+c_{2}t^{2}+c_{1}t+c_{0} \tag{21a}\] \[s(t)= a_{5}t^{5}+a_{4}t^{4}+a_{3}t^{3}+a_{2}t^{2}+a_{1}t+a_{0} \tag{21b}\]  
Figure 14: The generated particles and the driving envelope. Figure 15: One generated particle and the driving envelope in the reference frame. The coefficients \(c_{i}(i=0,1,...5)\) and \(a_{i}(i=0,1,...5)\) can be obtained according to the initial and terminal states in the reference frame. The points on each trajectory is generated according to Equation (21). When the sampling time is determined and the vehicle moves at a high speed, the distance between the generated points may be too far away for checking collision with obstacles, as shown in Figure 16. This problem can be avoided by decreasing sampling time, but the cost for generating the trajectories will increase. If the safe driving envelope is generated according to the obstacles, and trajectories are generated in the driving envelope, this problem will be solved. An important parameter in the polynomial methods is the total time \(T\) used to move from the initial state to the terminal state. For each trajectory, the each component is generated by sampling the time \(t\) in total \(T\). Generally, the \(T\) is also sampled, the invalid trajectories are deleted if the trajectories violate kinematic constraints, or collide with obstacles. Collision checking is time-consuming, which influence the computational efficiency of the polynomial methods [42]. In the worst case, collision check with every traffic participant and obstacle during all prediction horizon for each trajectory is needed. In the proposed driving envelope, the kinematic constraints and collision avoidance are already considered. By using the driving envelope, the time for collision check and constraint check will be reduced. In this paper, the motion model in Section 2.2 can be used to get the range of time \(T\in[T_{min},T_{max}]\) for generating trajectories. \[T_{min}= t_{arrive}-\mathcal{E}\] \[T_{max}= max(t_{max},t_{bound}+t_{arrive}+\mathcal{E})\]  
where \(t_{max}\) is the predefined maximum time for \(T\), \(\mathcal{E}\) is a constant for tuning time \(T\). Given the longitudinal velocity profile and the longitudinal distance \(d_{bound}\) from the current position to the boundary path of the driving envelope, \(t_{bound}\) is the time for longitudinal motion to arrive at the boundary path of the driving envelope. \(t_{arrive}\) is the time to move laterally to the target lateral position. According to the relationship of the heading angle in reference frame and the target lateral position, there are three cases of calculating \(t_{arrive}\), as shown in Figure 17.  
(1) Case I, the host vehicle is under the process of driving towards the target lateral position, and the host vehicle faces the direction of the target lateral position, as shown in Figure 17a. Given the current state in the reference frame, we can obtain the total time \(t_{lat}\) of lateral motion and the time \(t_{\varphi}\), which has been discussed in Section 2.3.2. The remaining time to finish the lateral motion is \(t_{arrive}=t_{lat}-t_{\varphi}\). (2) Case II, the host vehicle is under the process of driving away from the target lateral position, and the heading of the host vehicle faces the opposite direction of the target lateral position, as shown in Figure 17b. This case is similar to lane-change abortion maneuver discussed in Section 2.3.4.