Simulation and application of cooperative driving sense systems using prescan software

The PreScan was used to construct and test environmental simulation sections for a vehicle sensor. It was employed to build simulation road sections or import real road sections and build virtual infrastructures, streets, and scenes, where vehicles, unexpected road incidents, traffic signals, human factors, light sources, and simulated weather changes were considered, which served as the basis for testing the vehicle sensor value using PreScan. The built-in PreScan vehicle modules were imported to the built virtual road sections and scenes, and cameras were installed at appropriate positions to measure the perspective of a moving vehicle. Furthermore, Simulink was used to model the vehicle sensors to be tested. Globally, tens of thousands of people have died in traffic accidents wherein more than half of the deaths were caused by drivers’ negligence. Therefore, traffic safety-related Advanced Driver Assistance Systems or autopilot systems have received increasing attention from vehicle manufacturers, with vehicle sensor performance being the key to safety. Previously, physical vehicles were mostly employed to test the vehicle sensors, which entailed high costs and risks. However, by employing PreScan in the tests, highly reliable real physical data can be obtained and high costs and risks associated with the use of physical vehicles could be avoided.


Introduction
This study used the PreScan software package in order to simulate the conditions of driving environments including roads, time, weather, the surrounding scenery, traffic flow, vehicles, and vehicle control. A driving simulator was built in order to evaluate the driving support system (Crohn and Birnbaum 2010), with the hope of presenting the most common driving environments in a loop road section, as well as the main causes of traffic events. Through different driving scenarios, the influence of the application of sensors in vehicles was examined for the purpose of enabling vehicles to resolve issues using sensors in response to different traffic lane conditions, as well as to provide advanced technologies (Mahony and Hamel 2005), as shown in Fig. 1.
Vehicle safety has traditionally been divided into passive and active safety; however, the boundary or sudden change between them has not been sufficiently distinct. There are interacting domains between the active and passive safety measures, i.e., vehicle pre-collision countermeasure systems (Wang et al. 2017). With advanced traffic control and detection technology, road users could be warned in a timely manner before vehicle emergency events happen, where the technology could even automatically adjust the vehicle speed to achieve automatic driving safety alert, which symbolized one of the important areas of the application of intelligent transportation systems.
If developed or examined, the system performance is totally based on the support of hardware in the loop and physical vehicle experiments in the process of development, so the said system might face problems such as a long development cycle, high development costs, and difficulties in simulating some scenarios or the possibility of involvement of other higher. However, the use of computer-aided technology analog development could help avoid these problems (Doi et al. 1994). In order to increase the simulation validity of the vehicle support system, we re-planned and updated the software used in this study. This was done to increase the authenticity of the simulation environment and the future expandability of the simulation system, for which a new physical program, PreScan, was used to design a lifelike road environment and appropriate road traffic characteristics, including dynamic traffic flows as well as pedestrian and road signal control. The degree of authenticity of the PreScan-based experimental environment has been considerably increased compared to that built previously. The experiments conducted in a virtual scene-based simulation environment could be repeated, and the external factors affecting the vehicles could be reduced. Therefore, using calculator simulation technology to support the development of the vehicle active safety collision avoidance system is meaningful and important (Doi et al. 1994).
The factors influencing vehicle safety distance mainly include (1) vehicle braking system performance, (2) road traffic information, and (3) drivers' response capability (Kobayashi and Shibata 2008). Aimed at employing the interrelationship between vehicles, road environments, and pedestrians, this experiment selected appropriate road systems, transportation environment, and a variety of common scenarios as study examples, where various parameters, such as different road environments, unexpected events, human factors, weather, and active as well as passive collision avoidance driving scenarios, were cross-presented in order to reflect a variety of test road conditions, and PreScan was used to simulate the real driving environment and recreate the road conditions. With the use of virtual environments to test a variety of functions and application aspects that cannot be tested in authentic environments, the experimental results could provide more complete guidelines for the application of depth sensors in vehicles and serve as a reference for the subsequent development and application of depth sensors.

Operation mode
The simulation function of PreScan was used to build a virtual experiment environment in order to conduct experiments, through which data that cannot be easily obtained are generated. The authenticity of the physical data obtained using PreScan was verified, and the vehicle safety collision test standards from the European New Car Assessment Programmed were referred to in the test, wherein the authenticity of the physical data was continuously evaluated.
Mainly aimed toward testing the vehicle sensors, this study imported real map routes into PreScan to draw the whole street, where virtual roads suitably meeting the test requirements could be self-created. Then, based on the test items, the imported road was revised, adjusted, modeled, and mapped in order to generate the whole street configuration, which was also employed to produce a virtual reality interface. In order to more accurately perform the tests, we produced a semi-real street environment wherein various conditions, such as vehicle traffic flows, pedestrians, roadblocks, plants, and weather, were cross-combined and used as variables to build a virtual vehicle sensor test system. This system aimed to re-plan and update the software and hardware, with the goal of increasing the authenticity of the simulation environment along with the future expandability of the vehicle sensor test system. PreScan provides a simulation platform based on a real physical design, and is used in the automotive industry to develop and test sensors for advanced driver assistance systems (ADAS), such as radars, LIDARs, cameras, and GPS. Additionally, it is used to test the application of vehicle-to-vehicle (V2V) and vehicle-to-infrastructure (V2I) in the design of model controllers as well as in a hardware system using software. The planning process of practical applications should consider the research focusing on interactions between people, vehicles, and roads (Kaewtrakulpong and Bowden 2003), where appropriate road systems and scenarios are selected as study examples.
In this project, real street scenes were created based on lifelike scenarios, followed by the evaluation of drivers' behavior and vehicle products, which easily presented different visual effects, effectively reduced the error rate, considerably increased the reliability and authenticity of this project, and increased the test safety. Using this technology, parameters such as the vehicle driving tests, vehicle equipment development, and vehicle driving environment factors were combined in order to simulate and evaluate the design of different scenarios so as to increase the development efficiency and provide more verification and test platforms (Hung et al. 2002).

Scenario construction
The experimental scenes in this study were constructed based on general urban roads, where each object was placed by following the relevant regulations and considering the influence of the object number on the image execution efficiency. To this end, the objects in the scene were simplified as much as possible in order to improve the execution efficiency of the screen while maintaining the integrity of roads and maximizing the degree of authenticity of the experimental scenes. Roads themselves are the most important parts of these experimental scenes, followed by surrounding street trees and houses. The roads included relevant traffic signs, markings, and signals. In constructing such scenes, special attention should be given to roads, clarity of the related traffic signs, markings, and signals, and drivers' line-of-sight distance in order to reduce the visual difference between the main constructed roads in the entire visual simulation scenes and their actual counterparts to a minimum level (Kim et al. 2005), as shown in Fig. 2.
In order to obtain results of the simulated sensors that approximate those collected from actual tests, we assumed that different numbers of other vehicles also ran on the roads when constructing the experimental scenes used to simulate the loop test road sections placed on various traffic lanes. However, considering the functions of the actual and experiment sensors, not all vehicles were driven according to the regulations. An appropriate number of rule-violating vehicles were arranged depending on the conditions, under which the reaction of the vehicle sensors to unexpected events was tested.
The objects in the experimental scenes were divided into two major categories: (1) basic objects in the scenes (e.g., roads and buildings, which created the visual appearance effects of the main scenes) and (2) test objects in the experiments. Both were designed and built based on the sizes and colors of actual objects. Although a difference in the visual effects between the virtual and actual objects remained, the experimental data could be closer to the actual data if the difference in visual effect and physical appearance of the virtual and actual objects could be minimized.
In terms of road-, weather-, and environment-related issues, the colors, sizes, positions, and contents of road traffic control facilities designed in the form of traffic signs and traffic markings to warn, prohibit, and instruct drivers could influence driver behavior and safety. Moreover, the geometric design of the roads, such as the road line shape, line-of-sight distance, traffic lane width, and other factors, could influence drivers' judgement and decision-making in terms of their driving behaviors. This indirectly influences driving safety. In order to investigate the influence of road diets on driving safety in Taiwan, this study turned two lane-non-separated roads into two traffic lanes (two straight traffic lanes and one curved traffic lane), one sidewalk, and one parking lane, mainly to test the response capability and effects of the sensors in the face of a part of specific road environments.
The general vehicles moving on the roads encountered ever-changing situations, and the vehicle sensor functions should not be disabled due to other factors. For example, when a vehicle is ready to change lanes, driving information, such as speed and relative displacement of its surrounding vehicles, can be obtained through vehicle sensors (e.g., radars, ultrasonic, and camera). Such information was first transmitted to the pre-established warning system that classifies early warning signals, then sent to the driver in a timely manner. These considerably reduced the occurrence of lane change incidents (Pan et al. 2006). The situations that could likely be encountered were considered in order to test whether a variety of vehicle sensors could, as expected, react appropriately to different situations. First, in terms of drivers' subjective perspective, a considerable impact on the line-of-sight distance could possibly be exerted by the weather, the most common factor that causes the most obvious changes. In terms of the direction of the moving vehicle and sunlight, insufficient sunrays and poor visibility greatly influenced the line-of-light distance on sunny and cloudy days, respectively. On rainy days, the amount of rainfall greatly influenced the line-of-sight distance and the tire grip force. In Fig. 3, it can be seen that during typhoons, the wind drag was greatly affected by wind speed and wind direction. Furthermore, foggy days reduced the visibility. While driving, the line of sight is mainly influenced by sunlight, which changes over time and with the direction of the vehicle; other vehicle light irradiating from each direction; street lights; and advertising light sources. In terms of road materials, only the most common materials in urban areas, such as asphalt concrete, cement concrete, and bricks, were considered. Road intersections were classified into crossroads, roundabouts, and gate crossing arc bending, as shown in Fig. 4. Furthermore, the distance maintained between the neighboring vehicles and various unexpected interactions between vehicles and pedestrians was considered as well. Considering the typical dangerous conditions concerning the conflicts between vehicles and pedestrians during the high-speed driving of vehicles, Chu et al. proposed a steering collision avoidance control strategy (Crundall et al. 2010;Hsu et al. 2016) shown in Fig. 5.
In summary, this study used common road traffic environments as the main design scenes, for which the test simulation platform or other compatible software, such as GOOGLE Sketchup, Google 3D Warehouse, and CarSim, were used to model and draft the scenes in order to increase the accuracy of scene construction. Moreover, photo mapping could be used to generate the models of the entire urban buildings and streets, traffic signals, vehicles, and trees. Upon completion of the model drawing of all buildings, streets, and vehicles, PreScan was employed in order to produce a virtual environment interface that was used for testing in the experiments.

Auxiliary setting and application
The order of establishing a special PreScan project is approximately as follows: first, virtual road scenes were constructed using PreScan. Then, the functions concerning the relevant scene effects were set to create special effects of trees, turfs, buildings, weather, light, and shadow, while variables such as unexpected vehicle events, human factors, and special weather (involving rain and snow) were  also considered in order to increase the authenticity of the simulation environments. Finally, a virtual vehicle simulation system was established using these settings in which the built-in environment construction tool of PreScan was employed in conjunction with the 100 aforementioned environmental conditions so as to construct the main scenes of the road loops, as shown in Fig. 6. In order to increase the accuracy of scene construction, we collected sufficient information and created certain representative objects concerning the daily streets that were used in the testing after discussions. The semi-real virtual streets shown in Fig. 7 were used as the main scenes, for which the built-in model database of the PreScan graphical user interface (GUI) and external mapping of actual buildings were used to model the architecture of an entire city and streets. In order to increase the accuracy of scene construction, we collected sufficient information and created some representative objects concerning the daily streets that were used in the testing after discussions.
The most important step was installing the sensors, the numerical setting of which was performed using the Simulink toolbox provided by Matlab. Simulink, the most widely used software package in academic and industrial circles for constructing, simulating, and analyze dynamic systems, supports the linear and non-linear systems and can establish a continuous-time model, a discrete-time model, or a combination of these two models. The system adopts multirate, which allows different systems to be combined using different sampling frequencies.
Simulink provides a GUI. A model can be easily constructed using the click-and-drag function of a mouse in a Windows environment, which is similar to assembling block diagrams, as shown in Fig. 8. Some of the variable values simulated by Simulink can be returned to the Matlab window and are further analyzed using the functions provided by the control toolbox and/or other toolboxes, indicating that Simulink can provide faster as well as more convenient tools and methods for simulating control systems.  There are two aspects in terms of using Simulink: model definition (construction) and model analysis. First, a model was defined, and constructed models were called for. Then, the simulation function was activated in order to analyze these models to obtain the simulation results. Through the interactive use of the definitions and analysis of the models, the models were constantly modified in order to change the reference values of the model block diagrams. With constant simulations, the required control system performance and specifications were obtained, as shown in Fig. 9.
The PreScan simulation software is capable of providing a design, verification, and evaluation environment for vehicle intelligent systems, with a relatively realistic vehicle dynamics model, where the ADAS system control strategy can be added, or HMI can be constructed in the Simulink model. Additionally, PreScan, as it is capable of providing a lifelike 3D simulation environment, is applicable to simulating driving environments and vehicle  control (Crohn and Birnbaum 2010). The main function of Simulink in PreScan is to adjust sensor values and make revisions in terms of numerical aspects based on the differences in each sensor. In light of tests, the required conditions and sensor values can be created according to the requirements, and this process is both free and fast.
Other use cases of Simulink in PreScan mainly involve the time period after the construction of scenes. It is used to design the control system relevant to the physical properties as well as operability of vehicles and pedestrians, and sensors, where different surrounding environment information was obtained through various sensors in response to different road conditions in order to construct a more complete test module in a driving environment, containing vehicles, pedestrians, weather, roadblocks, line-of-sight distance, road environments, road conditions, etc.

Vehicle sensor simulation platform (PreScan)
PreScan, a simulation platform, provides a GUI and consists of a pre-processor used to define scenes and an operating environment used to execute these scenes. The main interfaces for creating and testing the algorithm include Matlab and Simulink. PreScan, capable of being applied in applications such as designing model controllers [Model in the Loop (MIL)] and conducting real-time tests using Software in the Loop (SIL) and Hardware in the Loop (HIL) systems, is operable in an open loop mode, a closed loop mode, an offline mode, and an online mode. It is an open software platform with a flexible interface, which allows the platform to be connected to the vehicle dynamics model [such as CarSim and dSPACE Automotive Simulation Models (ASM)] and HIL simulators/hardware (such as ETAS, dSPACE, and Vector) of the subcontractors. PreScan is widely used in the testing and development of vehicles' ADAS and autopilot systems. The software is applicable to various radars, LIDAR, cameras, GPS, and intelligent driving applications in the internet of vehicles-based V2V and V2I communications.
PreScan consists of numerous modules, which are intended to meet all of the requirements of ADAS system developers, where the intuitive GUI allows the users to create scenes and to model sensors, while the Matlab/ Simulink interface allows for the addition of control systems. Moreover, this interface can be used to import existing Matlab/Simulink models, such as the vehicle dynamics model. When testing is in progress, visualizers show lifelike scenes with 3D effects. In addition, tools such as dSPACE Control Desk and NI LabVIEW are applicable to activities such as data acquisition and test automation.

Implementation method
The simple process of PreScan consists of the following four steps.

Scene creation
A professional pre-processor (GUI) allows the users to create and modify traffic scenes within minutes using the database of road sections, infrastructure components (trees, buildings, and traffic signs), participants (sedans, trucks, bicycles, and pedestrians), weather conditions (such as rain, snow, and fog), and light sources (such as sunlight, headlights, and street lights), where real roads can be quickly compared through reading relevant information from OpenStreetMap, Google Earth, Google 3D Warehouse, and/or GPS navigation equipment.

Sensor modelling
A vehicle model can be equipped with various types of sensors, including radars, lasers, cameras, ultrasounds, infrared, GPS, and antennas for communication with other devices ]. In Fig. 10, it can be seen that the sensor designs and benchmark detection are very convenient, in that it is easy to replace and change sensor types and sensor characteristics.

Addition of control system
The Matlab/Simulink interface allows the users to design and verify the algorithms used in data processing, sensor fusion, decision-making, and control, and to repeatedly use the existing Simulink models (such as the vehicle dynamics model from CarSim, Dyna4, or ASM).

Test
A 3D visualizer allows the users to analyse the test results. This visualizer is capable of providing a variety of perspectives, as well as realizing intuitive navigation control and the function of picture and image generation. Beyond that, the ControlDesk and LabView interfaces are applicable to automatically conducting tests of batch scenes, as well as to activating the HIL simulation.

Results
In terms of sensors, various conditions corresponding to different functions of various types of sensors should be created, where the conditions of path planning, rapid construction of simulation scenarios, infrastructure components (trees, buildings, and traffic signs), participants (sedans, trucks, bicycles, and pedestrians), weather (such as rain, snow, and fog) and light sources (such as sunlight, headlights, and street lights), etc. should be created in order to produce an environment simulation path loop, which served as the basis for testing vehicle sensors. Simulink was then used to fine tune the sensor values, which, together with the addition of the physical properties required by vehicles and pedestrians in this special project, was meant to achieve the purpose of testing various types of sensors. Moreover, tests under different conditions generated a large amount of data, which was used to improve the tested sensors, and to better the setting of each aspect of the vehicle sensors.
Using physical vehicles to test vehicle sensors entails high costs and high risks, which deters some from adopting this method. PreScan not only greatly reduced the costs, but also maintained the authenticity of the physical data. In addition, PreScan allows the testing of a wider range of scenario changes in such cases where efficiency, low costs, and low risks are too difficult to achieve in a physical vehicle test.
Based on the recommendations of the review, this paper simulates the use of PreScan software for cooperative driving sense systems. It will use four steps for scene creation, sensor modeling, control system addition, and position and velocity values in order to make decisions regarding vehicle safety. This study will use an advanced driving assistance system based on active parking assistance, APA, which is used to create environment simulation road conditions in the sensor simulation platform PreScan and is aimed at finding parking spaces, identifying, judging and executing the road environment faced by parking, and creating and testing algorithms using MATLAB and Simulink. The interface, using the PreScan controller for the model, is designed for instant testing and other applications in software simulation.

Conclusions
Aimed at the test scenes constructed for the simulation environment platform of testing vehicle sensors, PreScan can be used to test the sensors under extensive and varied simulation scenes provided at the test stage, where the returned physical data was employed in order to improve each setting of vehicle sensors. This could serve as a reference for the subsequent development of active support systems. For example, the simulation design for testing the sensing and decision-making functions of vehicle sensors to traffic vehicle flow, vehicle conditions, unexpected events, and so on. Each sensor has its own advantages and disadvantages, for example, the image quality of the camera is low when the light source is low or the weather is poor. Optical sensors provide better stereo images, but when the weather is not good, such as in cases of rain, snow, or hail, the sensor's sensing capability will be reduced. Satellite positioning accuracy is poor, and instant information on short distances (of less than 1 m) cannot be obtained.
In order to repeat the tests with an eye so as to acquire a large amount of results and data, we mainly used the loop road sections with a high degree of simulation as the main scenes, where conditions of the whole streets, traffic signals, plants, vehicles, pedestrians, building models and mapping, etc. were established on the GUI of PreScan, and particle effects were written on the general settings interface in order to create special effects of trees, plants, buildings, and weather, as well as light and shadow in the area. Note that unexpected events of vehicles, human factors, and special weather involving rain, snow, and so on were also considered in order to increase the authenticity of the simulation environments. Compared with the physical vehicle tests, the PreScan-based tests enabled a more convenient and faster adjustment in the values of sensors in terms of simulation and development of active support systems with lower costs and lower risks. Beyond that, the virtual scenes in PreScan were not easily vulnerable to the influence of real environments. With the use of PreScan, independent variables and dependent variables could be more accurately controlled in order to afford better control of the accuracy of experiment results. The simulation of conditions can be performed through the vehicle sensors provided by this system in order to allow unique pre-development tests to be conducted.