## 3 Dynamic Object Identification and Tracking
### Object Identification
\[\text{WMA}_{X}=\frac{n\cdot x_{k1}+(n-1)\cdot x_{k2}+\ldots+N\cdot x_{N}}{w_{1}+ w_{2}+\ldots+w_{N}} \tag{6}\]  
In this context, \(x\) represents the position along the \(X\) or \(Y\) axis, while \(n\) denotes the window size. The filter smooths the data by calculating a weighted average of the positions within a sliding window, thereby reducing noise and improving the accuracy of the detected object positions. This process is further enhanced by using a 3D array, referred to as the window set, which stores historical data points for each detected object, as shown in Figure 3c. By employing this method, the system achieves more accurate object detection and ensures reliable obstacle tracking in radar-based systems. Each window corresponds to an object being tracked, and each window has 'n' number of elements represented as a center point of the cluster. The function iterates through the existing windows and calculates the distance between each new center point received and the first element of each window. If the distance is smaller than the 'filtering range' (set to 0.35), the 'CenterPoint' is added to that window, becoming the first element, and the previous elements of the window are shifted down one by one. If an appropriate window cannot be identified, a new window is created for the point, indicating the possibility of a new object or noise. The algorithm updates the velocity information for each window using the filtered locations, as specified in Equation (7). The revised velocity data are subsequently saved in the VelWindowSet. Finally, if a window is marked as inactive, it is removed from the window set. \[v_{\text{obj}}=\frac{p_{\text{f}}-p_{\text{o}}}{t_{\text{f}}-t_{\text{o}}} \tag{7}\]  
where \(v_{\text{obj}}\) represents the velocity of the detected object after filtering, \(p_{\text{o}}\) and \(p_{\text{f}}\) denote the current and previous positions of the object after filtering, respectively, while \(t_{\text{o}}\) and \(t_{\text{f}}\) correspond to the current and previous timestamps. This formulation allows the algorithm to compute velocity accurately for each detected object. The algorithm returns the updated WindowSet and VelWindowSet, which now contain the filtered position and velocity information for the detected objects. Figure 3d summarizes the steps described in this section. After accurately identifying the objects in the scenario, we can proceed to ensure consistent tracking of these objects across different frames. Algorithm 1 outlines the radar data processing workflow for clustering and filtering object detections. This system utilizes the DBSCAN algorithm to identify object clusters from radar point clouds and applies a moving average filter to refine the detected positions. The filtered data are then published to the ROS topic for further use in tracking and navigation tasks. The procedure ensures robust detection by handling noisy data, eliminating duplicate points, and maintaining accurate object trajectories over time. In the algorithm, \(C\) refers to the cluster centers detected by DBSCAN, while \(W\) represents the WindowSet containing historical data for each object. The function \(d(p,W)\) calculates the distance between a point \(p\) and the nearest window \(W\). ```
1:Initialize ROS node, subscribe to /ti_mmwave/radar_scan
2:while ROS running do
3: Receive radar data \((x,y,z,t)\)
4:if\(zerocnt\geq maxZeroCnt\)then
5: Cluster points using DBSCAN
6: Compute cluster centers \(C\)
7:for\(p\in C\)do
8: Compute distance \(d(p,W)\)
9:if\(d<filteringRange\)then
10: Update corresponding window with \(p\)
11:else
12: Create new window for \(p\)
13:endif
14:endfor
15: Remove windows with skipped frames \(>maxNumOfSkip\)
16: Apply Weighted Moving Average (WMA) to valid windows
17: Filter duplicate detections
18: Publish filtered results
19: Update \(WindowSet\) and \(VelWindowSet\)
20:endif
21: Store radar points and timestamps
22:endwhile
```  
**Algorithm 1** Radar clustering and object filtering