# Wheel Odometry with Deep Learning-Based Error Prediction Model for Vehicle Localization
## 2 Dead Reckoning Based on Wheel Odometry  
The dead reckoning (DR) system relies on odometry, which measures the distance traveled by the vehicle, and the angular velocity obtained from the chassis or a gyroscope in IMUs, to estimate the relative position forward from the current position. The wheel odometry is based on wheel encoders to track the number of revolutions each wheel has made, and each wheel's measured angular velocity can be derived. Then, the distance traveled by each wheel per unit of time is calculated by combining the wheel radius. According to wheel odometry, the vehicle's measured travel distance from moment \(t-1\) to moment \(t\) can be expressed as:  
\[x_{maa}=\int\limits_{t-1}^{t}\left(w_{rl}r+w_{rr}r\right)/2\;\mathrm{d}t \tag{1}\]  
where \(w_{rl}\) and \(w_{rr}\) are the measured left and right rear wheel angular velocities, respectively, and \(r\) is the nominal wheel radius. Many factors influence the measurement accuracy of wheel odometry. First, the measurement of wheel angular velocity contains errors; second, some factors, such as the vehicle load changes, change the wheel radius dynamic; third, some aspects, such as wheel slip and road potholes, lead to the wheel rolling distance not being equal to the actual distance the vehicle travels. The vehicle's real travel distance from moment \(t-1\) to moment \(t\) can be expressed as:  
\[x_{real}=\int\limits_{t-1}^{t}\left(\left(w_{rl}+\varepsilon_{w_{rl}}\right) \left(r+\varepsilon_{rl}\right)+\left(w_{rr}+\varepsilon_{w_{rr}}\right) \left(r+\varepsilon_{rr}\right)\right)\;\mathrm{d}t/2+\varepsilon_{s} \tag{2}\]  
where \(\varepsilon_{w_{rl}}\) is the error of the actual left rear wheel angular velocity compared with \(w_{rl}\), \(\varepsilon_{w_{rr}}\) is the error of the real right rear wheel angular velocity compared with \(w_{rr}\), \(\varepsilon_{rl}\) is the error between \(r\) and the real left rear wheel radius during vehicle driving, \(\varepsilon_{rr}\) is the error between \(r\) and the real right rear wheel radius during vehicle driving, and \(\varepsilon_{s}\) is the error between the rolling distance and the actual travel distance. Let \(x_{bias}\) be the error of the travel distance:  
\[x_{bias}=x_{mean}-x_{real} \tag{3}\]  
where \(x_{mean}\) is the measured travel distance. In practice, the point coordinates measured by RTK-GPS have centimeter-level accuracy and can be regarded as the true value of the localization coordinates. Suppose \(p_{1},p_{2},\ldots,p_{k}\) are the recorded points from moment \(t-1\) to moment \(t\), then \(x_{real}\) can be expressed as:  
\[x_{real}=\sum_{i=1}^{k-1}|p_{i+1}-p_{i}| \tag{4}\]  
where \(|p_{i+1}-p_{i}|\) is the distance between \(p_{i}\) and \(p_{i+1}\) on the Earth's surface, which can be calculated according to the Vincenty formula given in [24]. Suppose the vehicle's travel distance in a short time \(\Delta t\) is \(\Delta s\) and the vehicle's heading angle is \(\psi\), the transverse and longitudinal displacements \(\Delta x\) and \(\Delta y\) are:  
\[\Delta x=\Delta s\cos\psi \tag{5}\]  
\[\Delta y=\Delta s\sin\psi \tag{6}\]  
The relative displacements between two moments \(t_{1}\) and \(t_{2}\) can be regarded as accumulating relative displacements in a very short time \(\Delta t\). Therefore, the transverse displacement \(x_{12}\) and the longitudinal displacement \(y_{12}\) from moment \(t_{1}\) to moment \(t_{2}\) can be expressed as:  
\[x_{12}=\sum_{i=1}^{n}\Delta s_{i}\cos\psi_{i} \tag{7}\]  
\[y_{12}=\sum_{i=1}^{n}\Delta s_{i}\sin\psi_{i} \tag{8}\]  
According to Equations (5)-(8), after obtaining the travel distance between adjacent moments with the wheel odometry, the vehicle's relative displacement between two moments can be calculated by combining the vehicle's heading angle. Figure 1 shows the role of the wheel odometry error prediction model in the localization system.