In the next years the world of transport systems is expected to be revolutionized by the development of connected and autonomous vehicles (CAVs), promising more efficiency and safety on our roads. Wireless exchanges of information will enable cars and trucks to not only see each others, but also coordinate and optimize their actions, and a vast number of new applications is already being developed. One of the major challenges in testing and demonstrating the benefits of vehicle-to-anything (V2X) technologies is the exorbitant cost of large-scale, multi-vehicle demonstrations. Often, only a limited number of vehicles can be used during the experiments and all tests must be performed with precautions (e.g., slow speed, absence of other cars) that somehow reduce the validity.

It is thus of key importance to include proper simulation environments within the validation and optimization process of novel applications, as a preliminary or a complement to real testbeds. To this aim, a huge effort has been spent in the past years to develop simulators able to replicate realistic movements of vehicles, possibly based on the available maps, and the presence of wireless communications, with constraints, based on the specific technology adopted, on bandwidth, delay, and reliability. Such simulators, however, do not include the exchange of all messages, bit-by-bit, between the involved nodes and are not designed to validate real applications.
A different approach is the use of hardware-in-the-loop (HIL) tools that enable physical objects to interact with virtual ones, normally with the support of traffic simulators. This different methodology provides an environment that can replicate realistic deployment conditions, without incurring the prohibitive cost of handling the presence of multiple vehicles really driving on the roads.
We developed a new HIL simulator, called testing environment for vehicular applications running with devices in the loop (TRUDI) to provide a flexible solution for the testing of V2X applications with real wireless communication devices in the loop. Starting from a logical separation of the communication device, hereafter called intelligent transport system station (ITS-S), from the processing and visualization unit, hereafter on-board computer (OBC), the idea is that TRUDI works in the middle of the two layers, with a man-in-the-middle approach. Once the application is tested, TRUDI is removed, the hardware is mounted on-board of the vehicle, and the application is ready to run.