## 1 Introduction
Furthermore, the PIL layout is used to validate a hybrid fuzzy-RRT algorithm for indoor unmanned robots [25]. Although many applications involving autonomous ground vehicles exploit a hardware-in-the-loop (HIL) configuration, as in [26; 27], the PIL approach is widely used for the validation of different control strategies and algorithms for automated driving. In detail, a software architecture for dynamic path planning of an autonomous racecar at the limits of handling is presented in [28] with a PIL configuration, and a focus on software implementation of the same application is illustrated in [29]. Moreover, a PIL architecture for prototyping purposes of urban motion planning and control is discussed in [30]. However, to the best of the authors' knowledge, a study on the design and implementation of a PIL architecture for the experimental validation of trajectory planning and control algorithms for a full-electric autonomous racing prototype is still missing in the literature. Considering the reported framework about PIL applications, the main contribution of this paper consists in the experimental validation of a PIL architecture for a fully autonomous racing prototype using a high-performance real-time target computing machine and a low-cost card-sized computer. Furthermore, the splitting of the PIL phase into two complementary steps leads to a genuine V-cycle process for the slender and rapid software development process for automotive industry application. From the software point-of-view a complete and customized pipeline for the perception, planning and control of an autonomous racing platform is proposed. Moreover, the motion planning problem is validated with real data acquisition on-board a racing vehicle. Specifically, the autonomous pipeline includes a trajectory planner based on a modified RRT algorithm and a control strategy based on MPC. Both the investigated PIL layouts communicate with a properly connected personal computer via UDP protocol. In the paper, different driving situations are shown for the retained racing vehicle. Furthermore, the proposed PIL architecture is validated with respect to a model-in-the-loop (MIL) architecture that runs only on the personal computer during numerical simulations, as discussed in [31]. In fact, MIL architecture includes testing the modeled plant on a dedicated simulation platform only. By contrast, PIL implementation allows to test the designed model when deployed on a target processor, in a closed-loop simulation layout. This step helps to identify if the investigated control algorithm can be deployed on the considered processor. In detail, the retained real-time computing machine is a Speedgoat Baseline platform, while the considered low-cost computer is a Raspberry Pi 4B board. The environment perception data come from a vision-based perception pipeline that exploits a stereocamera and LiDAR sensors which are properly mounted onto the vehicle. Specifically, the vehicle moves in a structured racing environment and the path is defined by multiple traffic cones of different colors, as defined in the FSD competitions. The paper is structured as follows. Section 2 illustrates the general PIL architecture and the main modules of the retained autonomous system. Moreover, the hardware setup is discussed in detail and the considered computing platforms are described. Section 3 presents and discusses the obtained results on recorded experimental datasets for the MIL architecture and both the presented PIL layouts. Furthermore, a comparison with respect to the general autonomous pipeline that runs in parallel on the personal computer during simulation is presented. Finally, Section 4 concludes the paper.