## 3 QR Code Navigation and Construction of a Template Matching Library
### Construction of the Template Matching Library
 \tag{13}\]  
where \(\theta_{V}\) represents the direction of the AGV car and \(\varphi\) is the observation angle of the detected QR code landmark. Therefore, the estimated pose of the AGV car can be expressed as \(\mu_{V}=(x_{V},y_{V},z_{V})\). The estimated position of the AGV car can be obtained from Equations (12) and (13), and the position weight of the particle can be calculated as follows:  
\[d^{[i]}=\frac{1}{(2\pi)^{\frac{3}{2}}}\text{EXP}(-\frac{1}{2}(x_{t}^{[i]}-\mu _{V})^{\text{T}}(x_{t}^{[i]}-\mu_{V})) \tag{14}\]  
where the position and direction of the particle are \(x_{t}^{[i]}=(x_{t},y_{t},\varphi_{i})\). The AMCL algorithm covers the whole map evenly, and then the particles converge near the QR code according to the location of the QR code landmark. As shown in Figure 14a,b. When scanning the QR code landmark at a specific location, triangular matching joins to the QR code landmark. As in Figure 14c. The coordinates of \(a\), \(b\), and \(c\) are \((x_{a},y_{a})\), \((x_{b},y_{b})\), and \((x_{c},y_{c})\), respectively. The side lengths of the three measured triangles are \(l_{ab}\), \(l_{ac}\), and \(l_{bc}\), respectively. First, search for similar triangles in the QR code template library. As in Figure 14d. The three sides are unequal in length but proportional, and the angles are equal. Thus, the detected \(\Delta abc\) matches the A835 in the library. As in Figure 14e,f. Triangle detected:  
\[l_{ab},l_{ac},l_{bc},(x_{a}y_{a}),(x_{b}y_{b}),(x_{c}y_{c}) \tag{15}\]  
Matching template library:  
\[\begin{cases}l_{49},l_{48},l_{89},(x_{8},y_{8}),(x_{3},y_{3}),(x_{5},y_{5}),1 \\ &\vdots\\ l_{28},l_{29},l_{89},(x_{2},y_{2}),(x_{8},y_{8}),(x_{9},y_{9}),k\\ &\vdots\\ l_{35},l_{34},l_{55},(x_{1},y_{1}),(x_{3},y_{3}),(x_{9},y_{9})In the navigation process, the completeness and accuracy of the constructed map is one of the decisive factors in determining the accuracy of navigation and positioning [25]. Significant errors in map construction often directly lead to problems such as positioning failure and unguaranteed accuracy [26]. To improve the map-matching accuracy in navigation, the weight of the particles in the AMCL algorithm is increased in the code reading area. Then, the AGV position information is updated, and the data is estimated to be within the normal range according to the recognition of the new. Establish a simulation environment and analyze and improve the various types of problems that occur in the algorithm through simulation experiments to verify the algorithm. Figures 15 and 16 represent the fusion process of QR codes in the simulated state and in the improved algorithmic positioning shown simultaneously in the RVIZ and Gazebo environments, respectively. Figure 14: Process of AMCL particle distribution and triangulation matching. The number of the QR code reflection surface detected by (**a–c**) is the ID of the QR code landmark in the template library: (**a**) particles flatten the entire map; (**b**) the particle converges to the landmark position of the QR code; (**c**) use triangular matching positioning to increase the weight when scanning the QR code; (**d**) a b and c are the detected QR code reflecting surfaces; (**e**) there are all kinds of triangles in the template library; (**f**) the two triangles are proportional in length and match in shape.