## 3 Proposed Method
### Enhanced Berth Mapping  
This paper utilized the node-based map representation model to generate a lightweight map. The method of lightweight map generation is illustrated in Figure 2. \(M_{k}\) represents a map block constructed based on the \(k\)-th key berth, which contained a certain number of map nodes. The map nodes \(\{M_{(k,i)}\ |\ I\in[1,n]\}\) were discretely distributed with a resolution of \(\Delta m\), which represented the Euclidean distance between the adjacent map nodes. In each map node \(M_{(k,i)}\), an around-view image was captured using an around-view monitor (AVM). It should be noted that the around-view image needed to include two outer corner points of the key berth. The pose of the mapping vehicle was calculated based on the positions of the key berth's corner points:  
\[\mathbf{R}^{\text{ G}}_{(k,i)}\mathbf{X}^{\text{ V}}_{(k,i)}+\mathbf{t}^{\text{ G}}_{(k,i)}=\mathbf{X}^{\text{ G}}_{(k,i)},\ \ j=1,\ 2, \tag{1}\]  
where \(\mathbf{X}^{\text{ V}}_{(k,i)}\) and \(\mathbf{X}^{\text{ G}}_{(k,i)}\) are the coordinates of the key berth's \(j\)-th corner point, indicating the coordinates in the coordinate system of the mapping vehicle and the global coordinate system, respectively. \(\mathbf{P}^{\text{ G}}_{(k,i)}=[\mathbf{R}^{\text{ G}}_{(k,i)},\mathbf{t}^{\text{ G}}_{(k,i)}]\) represents the global pose of the mapping vehicle, which is also the global pose of the map node \(M_{(k,i)}\), where \(\mathbf{R}^{\text{ G}}_{(k,i)}\) is the rotation matrix and \(\mathbf{t}^{\text{ G}}_{(k,i)}\) is the translation vector. As shown in Figure 3, the global coordinates of the key berth's corner points were collected using a total station that was integrated with a global positioning system (GPS). As shown in Figure 4, the coordinate \(\mathbf{X}^{\text{ V}}_{(k,j)}\) was obtained by converting the pixel coordinate \(\mathbf{U}_{(k,i)}=[u_{(k,i)},v_{(k,i)}]\)  
\[\mathbf{X}^{\text{ V}}_{(k,i)}= \begin{bmatrix}-\left(v\ _{(k,i)}-v\ _{\text{ r}}\right)\cdot\lambda\\ -\left(u\ _{(k,i)}-u\ _{\text{ r}}\right)\cdot\lambda\end{bmatrix} ,\ \ j=1,\ 2, \tag{2}\]  
where \(\mathbf{U}_{\text{ r}}=[u_{\text{r}},v_{\text{r}}]\) is the pixel coordinates of the mapping vehicle's rear axle center, and \(\lambda\) is the physical scale of a single pixel in the around-view image. Figure 1: The illustration of the proposed localization method. The selection of the key berths should prioritize improving the localization accuracy. On straight roads, the position of the vehicle (x-coordinate, y-coordinate) constantly changes, while its heading angle remains unchanged or changes very little. On curved roads, both the position and the angle of the vehicle change, making high-precision localization more challenging. Therefore, the key berths should be distributed near the curves of the driving path to make the map cover more of the curved areas. As shown in Figure 2, the red berths are the selected key berths. There is no fixed standard for setting the density of the key berths and the density is proportional to the map coverage area and the mapping workload, which should be set based on the actual needs. Figure 3: The illustration of global position collection for the key berths’ corner points. Figure 2: The illustration of the enhanced berth mapping. Each key berth is associated with a map block, which consists of a certain number of map nodes. Each node contains information on three elements: holistic features, local features, and the pose of the mapping vehicle. It is important to note that the SURF feature descriptor is a 64-dimensional vector, while the ORB feature descriptor is a 256-bit binary string. As shown in Figure 1, during the online localization process using a lightweight map, the first step for the vehicle was to locate the nearest map node. Subsequently, the global pose of the vehicle was calculated based on the matching results of the local features and the global pose of the nearest map node. This paper employed holistic feature matching results to determine the nearest map node.