*4.2. Deep Learning-Based Corridor Recognition for Switching Localization Systems*

To avoid the corridor effect, this paper proposes to use deep learning to identify where is corridor area to switch the localization system. Because we need to know whether the current environment belong to corridor area or not, we will define the corridor recognition problem as the binary classification problem. The process will be following as below:

1. First, to collect images that represent the current area, we need to convert the LiDAR point-cloud data into 2D images by the following formula:

$$p\_{pic} = r \underbrace{\begin{bmatrix} \cos \operatorname{pic}\_{\theta} & -\sin \operatorname{pic}\_{\theta} \\ \sin \operatorname{pic}\_{\theta} & \cos \operatorname{pic}\_{\theta} \end{bmatrix}}\_{R\_{pi}} p\_{lidar} + \underbrace{\begin{bmatrix} \operatorname{pic}\_{x} \\ \operatorname{pic}\_{y} \end{bmatrix}}\_{t\_{pic}} \tag{12}$$

where *ppic* is the position of the point-cloud on the picture, *plidar* is the position of the point-cloud on real world, *Rpic* is the transfer matrix from the LiDAR point-cloud position to the image point-cloud position and *tpic* is the offset of the LiDAR pointcloud position from the image point-cloud position. To convert the real scale to image pixels, and we set a pixel equal to 0.05 m with *r* is the image resolution. The pointcloud range is set within a square of 10 m × 10 m with the center of the mobile robot as the base, as shown in Figure 10a. Finally, the point-cloud information is drawn on the two-dimensional picture with the map coordinates (100, 200) as the center of the mobile robot through a conversion matrix, as shown in Figure 10b.



**Table 1.** The LeNet-inspired architecture for corridor recognition.

**Figure 10.** (**a**) Mobile robot receives point-cloud range. (**b**) Point-cloud is drawn on picture.

**Figure 11.** The preprocessing for 2D LiDAR images.

#### **5. Experimental Results**

This paper includes three main experiments to verify the performance of the improved Pure Pursuit algorithm and the effectiveness of the LiDAR point-cloud feature-based deep learning classifier for switching localization systems. The first part is a trajectory-tracking accuracy experiment. The second part is a trajectory-tracking speed experiment. The third part verifies the deep learning-based classifier to recognize long corridor terrain using the LiDAR point-cloud feature for switching localization systems.

#### *5.1. Trajectory-Tracking Accuracy Experiment*

This experiment will verify the trajectory-tracking accuracy of the proposed method in this paper. The experimental method sets two preset paths. The first is the Double-L-shaped path, as shown in Figure 12a, and the second is the S-shaped path, as shown in Figure 13a. The coordinates reached by the mobile robot during navigation and the trajectory errors of the preset paths are recorded. The experiment is repeated 10 times on each path from the same starting point. The Model Predictive Control (MPC) and the original Pure Pursuit (PP) are used to compare in this paper, as shown in Table 2. Because the starting point is joystick migration, there is a slight artificial error at the starting point, and the error data are calculated after 5 s. The results verified that the maximum error of the improved Pure Pursuit is within 45 mm, with a 77% improvement rate compared to the original Pure Pursuit, while our method has a similar error rate as the MPC method.

**Figure 12.** The path error comparison between MPC (purple), original PP (blue) and proposed improved PP (green) methods in Double-L-shaped path (red): (**a**) Trajectory comparison chart. (**b**) MPC trajectory error path. (**c**) Original PP trajectory error graph. (**d**) Improved PP trajectory error graph.

**Figure 13.** The path error comparison between MPC (purple), original PP (blue) and proposed improved PP (green) methods in S-shaped path (red): (**a**) Trajectory comparison chart. (**b**) MPC trajectory error path. (**c**) Original PP trajectory error graph. (**d**) Improved PP trajectory error graph.


**Table 2.** Results of Trajectory-Tracking Accuracy Experiment. MPC stands for Model Predictive Control method, PP stands for Pure Pursuit method.

#### *5.2. Trajectory-Tracking Speed Experiment*

Besides accuracy, speed is also an essential factor. Thus, the verification experiment was conducted. According to Figures 14 and 15, and Table 3, the average speed, task time and speed standard deviation of the improved PP are better than those of the original PP. The speed performance of the Double-L-shaped path increases by 11.2% and the speed of the S-shaped path increases by 5.6%. The performance of the improved PP is similar MCP method. This experiment proves that the improved PP performs tasks more efficiently.

**Figure 14.** The speed comparison between MPC, original PP and proposed improved PP methods in Double-L-shaped path: (**a**) MPC speed curve. (**b**) Original PP speed curve. (**c**) Improved PP speed curve.

**Figure 15.** The speed comparison between MPC, original PP and proposed improved PP methods in S-shaped path: (**a**) MPC speed curve. (**b**) Original PP speed curve. (**c**) Improved PP speed curve.


**Table 3.** Results of Trajectory-Tracking Speed Experiment. MPC stands for Model Predictive Control method, PP stands for Pure Pursuit method.
