## 4 Establishment of Co-Simulation Platform
### Co-Simulation Experiment  
The co-simulation experiment of CarSim and MATLAB is used to verify the rationality of path planning and tracking control effect with the experimental results shown in Figure 17. In the figure, the red curve refers to the planned parking path based on preview correction, and the blue curve represents the actual tracking path of the vehicle. It can be clearly seen that under the effect of the path planning and tracking control model designed in this paper, the model vehicle is able to track the optimized parking path well in the parking process, and the maximum deviation of coordinates does not exceed 15 cm.  
Figure 18 shows the data curve of the co-experiment process. It can be seen from (a) that the steering wheel can quickly track the requested angle. The stable slope during tracking indicates that the steering wheel is turning smoothly. The horizontal line segment in the figure represents the time period for the steering wheel to maintain the angle (such as 540\({}^{\circ}\), 540\({}^{\circ}\), and 0\({}^{\circ}\)), indicating that the steering wheel shows good angle retention. As the conclusion, the data in (a) shows that the steering wheel angle changes smoothly, evenly and has good angle maintenance. On the other hand, the data in (b) and (c) show that with the control model, the speed-tracking effect is good, and the variation range of vehicle yaw angle basically conforms to the driving habits of skilled drivers through comparison.  
Figure 16: Speed Control Module.  
Figure 19 shows the path tracking results of the method designed in Reference [22]. Compared with the simulation results in Figure 17, the path planning and tracking control model designed in this paper is more reasonable and effective. In terms of path planning, the black line in Figure 19 refers to a parallel parking path planned based on the method in Reference [22]. It can be seen that the positions near 3 m and 5 m on the \(x\)-axis show obvious curvature changes. The red line in Figure 17 represents the planned path obtained using this research method. The simulation results show that the path exhibits good smooth curvature at any point on the \(x\)-axis. It can be seen that the curvature of the parking path obtained by the path planning method and designed in this paper is smoother, that is, the method is more reasonable and effective in parking path planning. In terms of tracking control, by setting the same initial tracking error, comparison is done for the path tracking control effect. Under the tracking control of the method designed in Reference [22], the initial error is eliminated at the position of 1.3 m. There is overshoot and the convergence speed is slow, and the overshoot is eliminated at the position of 2.8 m. During the path tracking process, the maximum tracking error in \(x\)-axis exceeds 20 cm, and the error in \(y\)-axis also exceeds 15 cm. The research method in this paper is available to track the target position at 0.8 m, and eliminate the overshoot at 1.5 m. The overshoot is small, and the convergence speed is fast. In the whole path tracking process, the tracking error of the \(x\)-axis does not exceed 10 cm, and that of the \(y\)-axis does not exceed 5 cm. In contrast, the control method designed in this paper shows a better path tracking effect.  
Figure 17: Co-Simulation Experiment Results.  
Figure 18: Data Curve of the Experiment Process.