## 3 Collision Avoidance Strategy
### Behavior Replanning Based on Post-Encroachment Time (PET)  
Based on a safety indicator, this module is used to make behavior planning for the entire obstacle avoidance process for the ego vehicle. A widely used safety indicator of obstacle avoidance is time to collision (TTC) [27]. It indicates the time span left before two vehicles collide, if nobody takes evasive action. However, this method is based on the speed and heading angle of the vehicle at the current time, and does not take into account the acceleration of the vehicle, resulting in large judgment error. PET is another indicator that is used to estimate the criticality of a certain traffic situation. It has been defined as the elapsed time between the front of the lead vehicle passing a point on the roadway and the front of the following vehicle passing the same point [28]. This research adopts PET as a safety indicator for behavior re-planning due to the variability of the oncoming vehicle's speed.  
The site for calculating PET is set at the front side of the parked vehicle, shown as Line 1 in Figure 5. Here the PET represents the time difference between A and C passing through Line 1. As the scenario is the congested urban road with unpredictable future speed of oncoming vehicle, the safety of the ego vehicle in the process of obstacle avoidance is the highest priority. Therefore, we assume that the oncoming vehicle will accelerate to  
Figure 4: Control flow of proposed collision avoidance (CA) system.  
the allowable maximum speed without deceleration even when it is close to the ego vehicle. The safe distance \(D_{safety}\) is set as 20 m.  
The equivalent PET is defined as:  
\[PET_{safe}^{max}=D_{safety}/\
u_{a\_ini}+D_{safety}/\
u_{c\_max}\approx 3.33 \ s\to 3.5\ s \tag{1}\]  
\[PET_{safe}^{min}=D_{safety}/\
u_{a\_max}+D_{safety}/\
u_{c\_max}\approx 2.66 \ s\to 3\ s \tag{2}\]  
where \(PET_{safe}^{max}\) defines the maximum time difference between two vehicles passing through the set site while \(PET_{safe}^{min}\) defines the minimum time difference. These two items are close to each other so that the safe PET is set as 3.5 s for convenience. In order to visualize the result, the case where the initial speed of the ego vehicle is 11 m/s is selected. The result can be easily extended to the entire allowed speed span of the ego vehicle.  
As Figure 6 shows, the behavior re-planning module is obtained by the following steps. Firstly, after traversing all allowable speeds and allowable positions of the oncoming vehicle, the PET under the condition of the ego vehicle keeping the initial velocity unchanged (\(PET_{s1}\)) and accelerating (\(PET_{s2}\)) will be calculated separately. Then, the initial data of oncoming vehicle and calculated PET will be stored as two different arrays according to whether the ego vehicle needs to accelerate. In Figure 6, the blue surface consists of point set S1 while the red surface consists of point set S2. Finally, the logic of behavior re-planning is as follows:  
Case 1: If \(PET_{s2}\) > \(PET_{safe}\), then ego vehicle will keep speed as initial speed unchanged in the whole avoidance process.  
Case 2: If \(PET_{s2}\) < \(PET_{safe}\) and \(PET_{s1}\) > \(PET_{safe}\) which means the ego vehicle cannot avoid obstacles by an unchanged speed unless acceleration, then ego vehicle will be required to accelerate.  
Figure 5: The site for calculating post-encroachment time.  
Figure 6: Calculation flow of post-encroachment time (PET).  
Case 3: If \(PET_{s2}<PET_{safe}\) and \(PET_{s1}<PET_{safe}\) which means even if the ego vehicle accelerates to maximum allowable speed, it cannot avoid obstacles safely, then the ego vehicle will be required to decelerate.