## 2 Collision Avoidance System
### Obstacle Detection Module
#### Phase 2: Positioning the Vehicle  
The vehicle equipped with the perception system must be positioned on the road with the purpose of determining the area of interest in which the presence of obstacles will be analyzed [43], together with the obstacle-free road areas to which the vehicle can move without danger [45]. This positioning is performed using a GPS receiver. However, numerous publications have shown that on many occasions GPS positioning is lacking in the reliability and precision required by safety applications [46], showing errors that are unacceptable for positioning on lanes or crossings. For this reason, we have used the information supplied by an RTK DGPS Topcon GB-300 receiver with an update frequency of 10 Hz and the possibility of using American GPS and Russian GLONASS that generates positions with an accuracy of less than 1 m. The GPS receiver transmits latitude/longitude positions to the computer. However, to deal with this data in an effective way it is necessary to transform it into Cartesian coordinates. In this case, Gauss-Kruger transformation is applied to the latitude/longitude coordinates to transform them into Universal Transverse Mercator (UTM) North/East Cartesian ones. The vehicle is positioned on a digital map using map-matching algorithms that ensure robust solutions even under adverse environmental circumstances [47,48].  
**Phase 3: Positioning Obstacles on the Digital Map**  
Finally, the obstacles must be located on the digital map so that the system can analyze which pose a risk as well as evaluating their movement over time. To do this, the angle/distance information provided by the laser scanner is transformed into UTM positions to be coherent with the GPS ones.  
To achieve this objective, two consecutive positions of this position provided by the vehicle's orientation are taken to calculate the laser scanner position since the distance between it and the GPS receiver in the vehicle is known. This is shown in Figure 1:  
\[\vec{u}=\left(\begin{array}{c}x_{u}\\ y_{u}\end{array}\right)=\frac{\vec{r}_{t}-\vec{r}_{r-1}}{\left|\vec{r}_{t}- \vec{r}_{r-1}\right|} \tag{5}\]  
\[\vec{r}_{laser}=\left(\begin{array}{c}x_{laser}\\ y_{laser}\end{array}\right)=\vec{r}_{t}+d\cdot\vec{u} \tag{6}\]  
where \(\vec{u}\) represents the unitary vector in the direction of the vehicle, \(\vec{r}\) is the position of the GPS receiver of the vehicle, d is the distance between the GPS receiver and the laser scanner and \(\vec{r}_{laser}\) is the position of the laser scanner. It should be pointed out that it would be possible to substitute the information from two consecutive positions of the vehicle to obtain its orientation if a gyroscopic platform is available to provide these data directly.  
Figure 1: Diagram for positioning obstacles on the digital map.  
Once the laser scanner UTM coordinates have been calculated, we can use them to calculate the positions of the laser detected points that use the scanner as centre of coordinates, transforming angle (\(a_{i}\))-distance (\(d_{i}\)) coordinates into Cartesian coordinates. In consequence, the UTM laser coordinates for the ith beam \(\vec{r}_{obs}\) could be calculated as follows:  
\[\varphi=a\tan\left(\frac{y_{u}}{x_{u}}\right) \tag{7}\]  
\[\vec{r}_{obs}=\left(\begin{array}{c}x_{obs}\\ y_{obs}\end{array}\right)=\vec{r}_{laser}+d_{i}\cdot\left(\begin{array}{c} \cos(\alpha_{i}+\varphi)\\ \sin(\alpha_{i}+\varphi)\end{array}\right) \tag{8}\]  
Positioning of vehicle and obstacles is done on accurate and precise digital maps, developed using datalog vehicles [37,49]. The use of these kinds of maps provides the possibility of assessing free areas without obstacles where a movement is possible. It should be noted that current navigation digital maps are not accurate enough and few details for safety applications are included.