*3.2. Improved Pure Pursuit Algorithm*

In the original Pure Pursuit algorithm, the shorter the forward-looking distance, the higher the trajectory-tracking accuracy. As Equation (6) is adopted, the forward-looking distance *Lf* is longer when the velocity *υ* is high; by contrast, *Lf* is shorter when *υ* is slow. This leads that the turning time can be predicted when the angular velocity *ω* is large. However, the long forward-looking distance decreases trajectory-tracking accuracy, making it impossible to slow down the turn in time (Figure 6).

**Figure 6.** The impact forward-looking distance in trajectory-tracking.

To improve the PP algorithm, this paper adopts a fixed short forward-looking distance to increase the trajectory-tracking ability at any time. Then the proposed method judges the current turn to decelerate it and keeps the angular velocity *ω* as a deceleration basis at a certain level so that the mobile robot can better track the path when the path is more rugged, shown in Figure 7.

**Figure 7.** The turning decision strategy of the proposed improved forward-looking distance tracking. (**a**) Predict Turn: Predicting a front turn or not. (**b**) Turn Now: Making the turn action. (**c**) Rugged Route: Making a turn in the case of rugged route.

We separate the turning decision strategy into three steps. First, we predict the turning distance using an angle *a* between two vectors created from the current robot center to the two next forward-look points (shown in Figure 7a). Assume that two vectors & & & & *V*1 & & & & , & & & & *V*2 & & & & of angle *a* in the ideal situation (shown in Figure 8) as the following definition:

$$\left| \stackrel{\rightarrow}{V2} \right| = 2 \times \left| \stackrel{\rightarrow}{V1} \right| \tag{7}$$

where & & & & *V*1 & & & & is the predicted distance, and the ideal angle *α* is 60◦ . When the ideal situation is encountered, the AGV will decelerate. However, when the route has a radius of gyration *R*, the angle *a* will never reach *α* value and the AGV cannot decelerate. Without considering *R*, the maximum value of *α* can be obtained from & & & *V*1 & & & and & & & *V*2 & & & as below:

&

&

$$a \le \cos^{-1}\left(\frac{\left|\stackrel{\rightarrow}{V2}\right|}{\left|\stackrel{\rightarrow}{V1}\right|}\right) \tag{8}$$

&

&

**Figure 8.** The curve prediction in the ideal case and the actual case.

From Equation (8), we can clearly define the predicted turning distance with the corresponding radius of gyration *R*:

$$\cos^{-1}\left(\frac{\left|\stackrel{\rightarrow}{V2}\right|}{\left|\stackrel{\rightarrow}{V1}\right|}\right) > \tan^{-1}\left(\frac{R}{\left|\stackrel{\rightarrow}{V1}\right|}\right) \tag{9}$$

$$\alpha \le \cos^{-1}\left(\frac{\left|\stackrel{\rightarrow}{V2}\right|}{\left|\stackrel{\rightarrow}{V1}\right|}\right) - \tan^{-1}\left(\frac{R}{\left|\stackrel{\rightarrow}{V1}\right|}\right) \tag{10}$$

In the following step (shown in Figure 7b), to make a turn action, we define a current turning angle *b* between two vectors created from the current robot center to the next and the previous forward-looking points and ensure *<sup>b</sup>* ≤ *<sup>β</sup>* value, where *<sup>β</sup>* = <sup>135</sup>◦ in ideal case. When the vehicle is traveling on rugged terrain (shown in Figure 7c), this paper uses *γ* = 0.1 (rad/s) as the threshold to indicate that the angular velocity *ω* is too high if exceeding γ, helping the mobile robot can increase the tracking accuracy.
