## 2 Collision Avoidance System
### Decision Module  
The proposed system focuses on avoiding obstacles on a single carriageway road. Therefore, the situation considered is one where a vehicle equipped with the system detects an obstacle in the lane along which it is moving. If an accident is to be avoided in this situation two manoeuvres can be performed: braking the vehicle to adapt its speed to that of the obstacle or turning the steering wheel so that the obstacle can be overtaken. Although the first option is the simplest, in circumstances where there is no other vehicle circulating in the opposite direction, a better option is to choose the second option so as not to interrupt the traffic flow. According to the vehicle surroundings information at every instant, the decision algorithm must choose the most advisable action. Vehicle surroundings include other obstacles detection or road characteristics included in the digital map, such as lane and road marking, visibility distance, _etc._ Deterministic vehicle tracking models are used for this purpose [50]. The algorithm's premise is to calculate the minimum distance that will ensure a safe action. Firstly, the minimum distance at which the deceleration action must be begun to adapt the speed to that of the obstacle \(v_{obs}\) is calculated. If a constant deceleration of \(a\) is assumed, the distance required for this reduction in speed is given by the following expression:  
\[d_{braing}=\frac{v^{2}-v_{obs}^{2}}{2a} \tag{9}\]  
The overtaking manoeuvre is also analyzed. The algorithm calculates whether the manoeuvre can be completed before the path of another vehicle moving in the opposite direction along the left-hand lane is interfered with. The manoeuvre comprises three phases: a lane change, moving along the parallel lane and returning to the initial lane. A scenario has been put forward where vehicle V1 with the laser scanner is moving at a constant speed along a straight lane where it encounters vehicle V2 at a distance d moving at a lower speed, while another vehicle V3 may be moving in the opposite direction along the left-hand lane at a distance d\({}_{3}\) (Figure 2). So the overtaking manoeuvre can be carried out, the sum of the distances travelled by vehicle 1 and vehicle 3 during the total time of the manoeuvre \(t_{T}\) must be less than or equal to the distance d\({}_{3}\), so that both vehicles complete their manoeuvres in the same cross section of the road:  
\[\left(v_{1}+v_{3}\right)\cdot t_{T}\leq d_{3} \tag{10}\]  
where \(v_{i}\) is the speed of vehicle \(i\). On the other hand, the distance travelled by vehicle V1 until it overtakes vehicle V2 \(d_{s}\) and the time taken \(t_{s}\) are given by:  
\[d_{s}=d+v_{2}\cdot t_{s}+L_{1}+L_{2}=v_{1}\cdot t_{s} \tag{11}\]  
\[t_{s}=\frac{d+L_{1}+L_{2}}{v_{1}-v_{2}} \tag{12}\]  
where \(L_{i}\) is the length of vehicle \(i\). In addition, \(t_{s}\) includes the lane-change time \(t_{LC}\) and the time taken by vehicle V1 moving along the left-hand lane, while \(t_{T}\) includes the previous time \(t_{s}\) and the second lane-change, that is:  
\[t_{T}=t_{s}+t_{LC} \tag{13}\]  
Therefore, by taking Equations (12) and (13) in Equation (10), an upper limit for the speed of V2 is obtained:  
\[v_{2}\leq v_{1}-\left(v_{1}+v_{3}\right)\cdot\frac{d+L_{1}+L_{2}}{d_{3}-\left( v_{1}+v_{3}\right)\cdot t_{LC}} \tag{14}\]  
Also to be taken into account is the fact that the distance d between V1 and V2 must be greater than a value that will allow the lane change to be made safely. This fact is reflected in the following equation:  
\[d\geq t_{LC}\cdot\left(v_{1}-v_{2}\right) \tag{15}\]  
From which the minimum speed for V2 can be deduced:  
\[v_{2}\geq v_{1}-\frac{d}{t_{LC}} \tag{16}\]  
Figure 2: Scenario for the decision whether or not to overtake the slow vehicle. If the system detects that the speed v\({}_{2}\) measured by the laser scanner confirms the disparities in Equations (14) and (16), it will decide to overtake.