# Improving Smartphone GNSS Positioning Accuracy Using Inequality Constraints
## 3 Kalman Filter with Inequality Constraints
### Solution of Inequality Constraint
Figure 13 displays the result trajectories of the three smartphones, in which the green points are the references, the blue points are original results, and the red points are the results using direction constraints. Intuitively, the red line is much closer to the green line than to the blue line. This means that the horizontal accuracy after constraining is obviously improved. Specifically, it can be seen in the figure that the original results are not as satisfactory as those of the car traveling among the buildings. In this area, smartphones suffer from considerable multipath error. As the method in this paper constrains the direction in the kinematic dataset, the positioning performance can be enhanced. Figure 11: PDOP value series of HP30 dynamic dataset. Shown in Table 3 are the RMSE results and improvement percentages for the three smartphones before and after applying the direction constraint. In contrast to using vertical velocity constraints, using direction constraints provides horizontal positioning improvement. In detail, we can see in Table 3 that this benefit is considerably reflected in the north component. The reason for this is that the vehicle was driving on an east-west road during the data collection period, and two tall buildings stood on both sides of the road. In this case, the north-south direction error is the major cause of the positioning offset. As a result, it is significantly influenced by the constraints. Specifically, the improvement percentages of the horizontal position accuracy for HP30, HP40, and XMI8 are 16.77%, 14.57%, and 31.09%, respectively. It should be noted that the direction threshold is vital in the actual application of direction constraints. On the one hand, precise constraint could result in a perfect effect and increase the positioning accuracy. On the other hand, excessive constraint could lead to over-constraining and decrease the positioning accuracy. In fact, applying relaxed conditions could result in stable positioning. For direction information acquisition, for instance, we can extract road information from an OSM or set direction constraints using the yaw, which can be computed by performing inertial measurements of smartphones. ### Performance of Distance Constraint

The previous analysis verified the effects of vertical velocity constraints and direction constraints. In this section, we detail our investigation of the performance of the inter-smartphone distance constraint. The relative position of the three smartphones is shown in Figure 7b,d. To ensure the effect of constraint, the distance range was set to 0-2 m. In addition, the smartphones were installed in a car for the dynamic data collection, and we consistently set the distance range to 0-1 m over the data collection period. For the \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Smartphone**} & \multirow{2}{*}{**Method**} & \multicolumn{4}{c}{**Position RMSE (m)**} & \multicolumn{4}{c}{**Imp**} \\ \cline{3-8}  & & **E** & **N** & **U** & **E** & **N** & **U** & **2D** \\ \hline \multirow{2}{*}{HP30} & Original & 3.14 & 6.12 & 3.24 & 1.66\% & 21.20\% & \(-\)0.12\% & 16.77\% \\  & Constrained & 3.08 & 4.83 & 3.25 & 1.66\% & 21.20\% & \(-\)0.12\% & 16.77\% \\ \hline \multirow{2}{*}{HP40} & Original & 4.02 & 2.79 & 18.60 & \multirow{2}{*}{2.47\%} & \multirow{2}{*}{48.09\%} & \multirow{2}{*}{5.05\%} & \multirow{2}{*}{14.57\%} \\  & Constrained & 3.92 & 1.45 & 17.67 & & & & \\ \hline \multirow{2}{*}{XMI8} & Original & 2.94 & 5.13 & 21.07 & \multirow{2}{*}{2.69\%} & \multirow{2}{*}{43.43\%} & \multirow{2}{*}{\(-\)1.78\%} & \multirow{2}{*}{31.09\%} \\  & Constrained & 2.86 & 2.90 & 21.44 & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: RMSE results and improvement percentages of dynamic datasets using the direction constraint. Figure 12: A period of data was selected to clearly depict the performance of the method; (**a**) shows the environment of the selected data, and (**b**) shows the yaw of the car during data collection.