## 3 The Proposed Algorithm
### Input Lookup Table (LUT)  
In this work, we use the KITTI dataset [31], a widely recognized benchmark in the field of autonomous vehicles. The dataset consists of 10 sequences that provide publicly available ground truth for evaluation. Initially, a set of candidate seeds \(M_{k}\) is randomly generated. Each seed represents a potential movement characterized by small displacements in the \(x\) and \(y\) directions, as well as a rotation angle defined as follows:  
\[M_{k}=\{(dx_{k},dy_{k},\theta_{k})\}\quad\text{for }k=1,2,\ldots,N \tag{1}\]  
where \(dx_{k}\) and \(dy_{k}\) represent the displacements in the \(x\) and \(y\) axes, respectively, and \(\theta_{k}\) denotes the rotation angle.  
Figure 1: Block diagram of the proposed algorithm.  
To ensure that the movements are representative of the actual dynamics observed in the KITTI sequences, we propose a strategy for selecting a subset of movements. This involves analyzing ground-truth data to extract key movements that capture the range of potential maneuvers a vehicle may experience in multiple scenarios. We can define a representative movement set \(R\) as  
\[R=\{M_{j}\in M_{k}\,|\,\text{movement is statistically significant}\} \tag{2}\]  
where \(M_{j}\) are the selected representative movements.  
To select a representative set of ego-motion movements from the ground truth data, we propose an approach based on clustering as follows:  
1. Clustering: Cluster the ego-motion data based on movement characteristics (we proposed direction and speed.
2. Representative Selection: From each cluster, select a representative movement that captures the key features of that cluster. For more details please see Algorithm 1.  
Figure 2: Flow chart of the proposed algorithm.  
```
1:Input: Ground truth ego-motion data \(GT\), number of clusters \(K\)
2:Output: Representative movement set \(R\)
3: Extract direction and velocity from \(GT\)
4:\(\theta\leftarrow\text{ComputeDirection}(GT)\)
5:\(v\leftarrow\text{ComputeVelocity}(GT)\)
6: Perform clustering on \((\theta,v)\) into \(K\) clusters
7:\(Clusters\leftarrow\text{ClusterEgoMotion}((\theta,v),K)\)
8: Initialize \(R\leftarrow\emptyset\)
9:for each cluster \(C_{k}\in Clusters\)do
10: Select a representative movement \(M_{j}\) from cluster \(C_{k}\)
11: Add \(M_{j}\) to \(R\)
12:endfor
13:return\(R\)
```  
**Note:** For practical purposes, it is recommended to use values of \(K\) in the form of \(2^{\alpha}\) to ensure efficient utilization of GPU resources. For more details see Section 3.1.  
In order to calculate the direction and velocity of ego-motion from the ground truth data, we analyze the position and orientation information associated with ego-motion at different time frames. Given the positions in two consecutive time frames, \(P(t)=(x(t),y(t))\) and \(P(t+\Delta t)=(x(t+\Delta t),y(t+\Delta t))\), we can compute the direction and velocity as follows: The direction \(\theta\) of the ego-motion can be determined using the change in position over time, calculated as  
\[\theta=\tan^{-1}\biggl{(}\frac{y(t+\Delta t)-y(t)}{x(t+\Delta t)-x(t)}\biggr{)} \tag{3}\]  
This angle \(\theta\) represents the direction of motion relative to the \(x\)-axis.  
The velocity \(v\) of the ego-motion is computed based on the displacement over a specified time interval. The displacement \(D\) is given by  
\[D=\sqrt{(x(t+\Delta t)-x(t))^{2}+(y(t+\Delta t)-y(t))^{2}} \tag{4}\]  
Then, the velocity can be calculated as follows  
\[v=\frac{D}{\Delta t} \tag{5}\]  
where \(\Delta t=t_{2}-t_{1}\), \(t_{n}\) are the timestamps in the KITTI dataset.  
Once representative movements are established, we construct a lookup table (LUT) that encodes the relationships between these movements and their corresponding outcomes. The LUT is defined as follows:  
\[\text{LUT}(M_{j})=\{(x^{\prime},y^{\prime},\theta^{\prime})\}\quad\text{for each }M_{j}\in R \tag{6}\]  
where \((x^{\prime},y^{\prime},\theta^{\prime})\) are the new states that result from applying the movements \(M_{j}\).