# Vehicle-in-the-Loop in Global Coordinates for Advanced Driver Assistance System
## 3 Field Test  
Except for the visualization module, we implemented the VIL system based on MATLAB/Simulink. This program is a widely used tool for vehicle controller development and has a low barrier to entry. The 3D visualization module is programmed with Unreal Engine 4, developed by Epic Games, which allows the development of games efficiently. In recent years, it has been widely used outside of gaming, especially for visualization of computer simulation [41; 42; 43]. Unreal Engine 4 also has a programming language called Blueprint, similar to MATLAB/Simulink. Therefore, the same benefits exist with development accessibility. The following hardware is equipped to configure for the VIL evaluation environment:  
* GPS/INS: RT3100 by OxTS
* RCP: MicroAutoBoxII by dSPACE
* Laptop: ALIENWARE by Dell
* HMD: Oculus Rift by Oculus  
VIL must ensure real-time stability. For this purpose, modules programmed with MATLAB/Simulink (virtual environment, synchronization, and sensor emulation) work on a Rapid Control Prototyping (RCP) device. RCP is highly integrated with MATLAB/Simulink, which helps to reduce development costs. It also uses high-resolution GPS/INS to synchronize the test vehicle to the virtual environment. To increase driver realism, we use high-performance gaming laptops and head-mounted display (HMD) devices. As can be seen in Figure 2b, each hardware device is connected in several ways. The pose information of the test vehicle, measured by GPS/INS, is transmitted to the RCP via CAN messages The RCP synchronizes the test vehicle with the virtual environment, emulates sensor data and sends the results to the real-world ADAS controller every 10 to 20 ms depending on the requirements. At the same time, the visualization program receives the pose information of all objects via ethernet every 10 ms. The data contain each position \(x\) and \(y\) in 0.01 m resolution with more than thousands of km coverage, and yaw angle \(\psi\) in 0.01\({}^{\circ}\) resolution with 360\({}^{\circ}\) coverage. Scheme 1 shows the VIL hardware configuration and the VIL test scene. Figure 5: Perceptible and imperceptible points with impact area. In order to verify the proposed VIL in the global coordinates system, tests were performed on AEB and LKAS controllers. The Hyundai Genesis DH model equipped with the ADAS controllers was used as the test vehicle. First, the AEB test was repeated five times for each real and VIL environment in the same scenario. The scenario is selected as Car-to-Car Rear Stationary (CCR) according to the Euro (European New Car Assessment Programme) NCAP protocol. The ego vehicle travels at a speed of 10 m/s to the stationary target vehicle. As a result of the test, after the vehicle was stopped by AEB, the average distance to the target vehicle was measured. As Figure 6a shows, it is 2.46 m in the real target testing and 2.38 m in the testing with VIL. The difference in the results between the two environments is about 0.08 m, which is very reliable. In particular, it is shown that the maximum error occurs in 1.24 m and 0.63 m respectively in five tests performed in each test environment. If the sensor emulator is very ideal, the two maximum errors are considered due to the vehicle's dynamics uncertainty. In other words, the difference in results can be acceptable. The LKAS test was performed at a speed of about 20 m/s and a width of 3.65 m in a straight lane approaching the left line with a lateral speed of 0.4 m/s. At this time, the distances between the vehicle and the left and right lines measured by the real vision sensor and vision sensor emulator were compared. The distance between the left and right lines recognized in Figure 6b is very similar; the maximum distance error is 0.05 m where the ground truth is about 1.22 m. This is about a 4% error, which is lower than the error of the actual vision sensor, so it does not affect the whole system. It is necessary to confirm driver heterogeneity according to the latency of the visualization module.