**4. The Localization Switching Method in the Structure-Less Environment**

#### *4.1. Two-Dimensional (2D) LiDAR SLAM*

2D LiDAR SLAM technology uses LiDAR sensors to collect point-cloud data and scan matches. The SLAM technology then uses algorithms to optimize and loop closure detection for map building (Figure 9) and localization. However, in a structure-less environment as a long corridor, SLAM cannot determine its position on the map, leading to cause unexpected accidents easily. To avoid the mislocalization problem, we use the characteristics of 2D LiDAR data to recognize where the mobile robot is lost.

**Figure 9.** The environment map constructed by 2D LiDAR; black indicates obstacles (e.g., walls); white indicates no obstacles and gray represents unknown areas.

In scan matching, SLAM will match the point clouds with the map features. If the localization is successful, the point clouds are superimposed on the black edge of the SLAM map. At this time, we can use all point clouds and the point clouds superimposed on the black edge of the map to determine whether the AGV is mislocalized as follows:

$$m\_r = 1 - \frac{p\_{match}}{p\_{all}}\tag{11}$$

where *mr* represents the missing rate (ranged from 0 to 1). If *mr* is greater than 50%, most of the point clouds are not superimposed on the map features. In this case, it can be judged that the mobile robot is getting lost; otherwise, it represents localization success. *pall* represents the number of all point clouds in a frame, and *pmatch* represents the number of point clouds in a frame superimposed on the map features.

However, this judgment method cannot detect the localization status under all conditions. when the surrounding environment has s repetitive pattern, the map features will be too consistent despite the point-cloud is superimposed on the map features. This makes SLAM localization impossible to confirm. For example, in the corridor part of the map (Figure 9), the point clouds extracted from the walls on both sides are too sparse, making it impossible to determine where the mobile robot is in the corridor.
