# Trajectory Tracking of Autonomous Vehicle Using Clothoid Curve
## 3 Tracking Control Method Using Clothoid Curve
### Vehicle State Prediction Based on Communication Delay  
Due to the communication delay \(t_{1}\) of the control system, the control command sent at the current time cannot be responded to until \(t_{1}\). Therefore, the sent control command should also be calculated according to the state relationship between the vehicle and the reference path after \(t_{1}\), so it is necessary to predict the vehicle state after \(t_{1}\). [PERSON] et al. proposed to move forward along the current longitudinal axis of the vehicle to predict the future state of the vehicle for tracking error calculation [20]. [PERSON] et al. proposed to predict the vehicle state in the following control cycles by using the vehicle's current state vector \(\left[X_{f},Y_{f},\theta,V,\delta\right]\), which are the vehicle's current horizontal and coordinate position, heading angle, speed, and front wheel angle [21]. [PERSON] et al. used the optimal control theory of the discrete time-delay system for reference, used the vehicle dynamics model to predict the state of vehicles in each cycle of the delay time in turn according to the control cycle, and also used the same front wheel angle in the prediction space of each control cycle, but the prediction accuracy of this method is affected by the accuracy of the vehicle dynamics model [19]. ```
1 Get \(referencePath\) from planning module
2 If \(referencePointsCount>1\) then
3 Predict the state of the vehicle after \(t_{1}\) as \(pointPredicted\)
4 Find the nearest point along the \(referencePath\) to \(pointPredicted\) as \(startPoint\)
5 Determin the preview range of the \(endPoint\)
6 For \(pointIteration=endPoint,endPoint-1,...,startPoint\) do
7 Caculate clothoid curves from \(pointPredicted\) to \(pointIteration\)
8 If \(clothoid\_curve\)\(S[0]\) satisfy constraints then
9\(SReady=S[0]\)
10 end
11 else
12 If \(length(SReady)>0\) then
13\(SAction=SReady\)
14 end
15 else
16 Output \(curvature\_limit\) as parameter of the control curve
17 end
18 break
19 end
20 end
21 Preview the curvature on the control curve after \(t_{2}\) at the current speed
22 end
23 else
24 Output the \(steering\_wheel\_target\_angle\) caculated in the previous cycle
25 end
26\(Steering\_wheel\_target\_angle\) processing using moving average filtering method
27 Output \(steering\_wheel\_target\_angle\)
```  
**Algorithm 1**Trajectory tracking of autonomous vehicle using clothoid curve  
This paper needs to predict the state of the vehicle after the communication delay time \(t_{1}\) of the control system. The communication delay time \(t_{1}\) is about 0.1 s according to the test. During this time, the change in vehicle speed and front wheel angle are very small and can be ignored. Therefore, this paper uses the current state \([X,Y,\theta,\delta,v]\) of the vehicle to predict the state of the vehicle after \(t_{1}\), which can ensure the calculation error in a small range. Firstly, the position of the vehicle after \(t_{1}\) in the current vehicle frame is predicted, as shown in Figure 3. The state of the vehicle after \(t_{1}\) is calculated from the following geometric relationship:  
\[\left\{ \begin{array}{l}s=v*t_{1}\\ r=L/\tan\delta\\ \Delta\theta=s/r\\ \Delta x=-(1-\cos(\Delta\theta))*r\\ \Delta y=r*\sin\Delta\theta\\ \kappa=\kappa_{v}\end{array} \right., \tag{8}\]  
Suppose that the vehicle keeps the current front wheel angle moving at a constant speed in time \(t_{1}\), where \(r\) is the current turning radius, \(L\) is the wheelbase, \(\kappa\) and \(\kappa_{v}\) are the current turning curvature, \(v\) is the speed, and \(\delta\) is the front wheel angle. At \(t_{1}\), \(s\) is the arc length, and the vehicle state can be expressed as \(\left[\Delta x,\Delta y,\Delta\theta,\kappa\right]\), namely, the state of the vehicle in the current vehicle frame after time \(t_{1}\). Since the frame of the reference path is the global coordinate system, the predicted vehicle state after time \(t_{1}\) in the current vehicle frame should also be converted to the global coordinate system. \[\left\{