Keep an unknown state.
The tracker waits for five measured positions and checks the path's straightness and speed. Before enough evidence arrives, velocity stays zero and the motion state stays unknown. Coasting does not manufacture measurements.
Radar perception · Tracking · CPU / GPU computation
Follow the returns.
Question the motion.
A ROS 2 pipeline that turns marine radar returns into tracks and occupancy. Its hardest problem appears along the shoreline: a changing cluster can look like a moving object even when its returns stay in place.
01 / A rotating view of a moving world
The Halo radar reports a planar scan about once every 1.05 seconds. Between scans, the vessel moves, a boat moves, and the visible section of a quay changes.
I built and maintain the radar repository and its integration into the Perception Stack. The pipeline filters XYZI returns, aligns them in a world frame, clusters individual scans, tracks objects and publishes occupancy, collision risk and structured observations.
The implementation has a readable CPU reference graph, a single-node CPU/GPU path, and a cluttered-scene variant with a static map. These share output contracts so the surrounding stack can consume any backend.
02 / Different questions, different outputs
A moving boat may never hit the same voxel twice. Detection therefore uses the current scan; persistent returns build the temporal view. Requiring persistence before detection would erase exactly the targets the vessel needs to notice.
Finite values, range and hull filters; heading and position at the scan stamp
Range measured from the radar; persistence retained as an attribute
Two scan hits qualify a voxel for persistent occupancy
Explicit unknown / static / moving states; shared outputs for fusion
The default 3–300 m filter removes the driver's near-field disc and limits computation. Detection reaches that radius; the default occupancy window is 300 m across. A grid's unknown cells remain unknown because an absence of radar returns does not establish free water.
03 / A stable identity needs more than a centroid
The tracker waits for five measured positions and checks the path's straightness and speed. Before enough evidence arrives, velocity stays zero and the motion state stays unknown. Coasting does not manufacture measurements.
Clusters carry the share of returns overlapping older scans. Repeated high overlap marks standing structure even when the visible centroid slides along a bank. Entry and exit thresholds differ to reduce flicker; long footprints are excluded from this rule.
A fixed 4 m extent gate split the yacht as its radar box changed. Moving tracks now allow a proportional size change, while position agreement remains gated by covariance.
A detection explained by a confirmed track does not start another identity. Confirmed tracks merge when their boxes overlap and their positions agree under the covariance gate. The older identity survives.
The core tracker uses constant-velocity Kalman prediction and Hungarian assignment. Clock rewinds and long input gaps reset its state rather than extrapolating across an outage. This timestamp discipline also matters downstream in Sensor Fusion.
04 / Two replays of one harbour window
The retained regression runs cover 130 seconds of a harbour transit with a yacht ahead and structures along both banks. Both runs produce the same yacht association result: 82 of 84 eligible radar batches contain exactly one track within 15 m of its interpolated AIS position.
82 / 84 eligible radar batches, in each run
Eligible batches with two or more tracks, in each run
Motion state remains undecided in roughly half the updates
The historical review reported exactly one yacht track in 38% of batches. That baseline comes from the retained review summary; the two current report files are included below. The 15 m association rule and sparse AIS interpolation make this an identity regression check, not a precision or recall score for all vessels.
The vessel advances between banks of amber radar returns. Green boxes mark clusters; blue tracks are static and orange tracks are moving or unknown. The right-hand view shows returns persistent across several scans over a 400 m-wide area. Dark cells show occupancy. The clip is actual RViz output from a CPU replay of the recorded vessel bag, encoded at the original 10 frames per second.
05 / Audit the work included in a timing
CuPy moves filtering, transformation, incremental persistence and clustering onto the GPU. A cell-indexed neighbor graph avoids a dense all-pairs distance matrix. The default tracker stays on the CPU, so speeding up point processing leaves a substantial shared cost.
The collector's GPU subtotal omits neighbor-graph construction. Including that recorded stage changes 99.6 ms to 113.4 ms at 150,000 points. The page preserves the original JSON and shows the corrected sum. Neither figure is a measured end-to-end sensor latency.
The benchmark times stages separately, and its tracking stage creates a tracker and applies three updates. At 10,000 input points, the same audited sum is 9.1 ms on CPU and 14.8 ms on GPU. Backend choice depends on workload; these synthetic measurements do not establish a universal crossover point.
Automatic mode can reprocess a failed scan on the CPU, transfer persistence history and retain the cluttered pipeline's static map. Diagnostics report the failure and backend state. Required-GPU mode instead treats unavailable startup as fatal.
Both paths publish the same messages. The reference graph supplies behavior for parity tests; the fused node reduces message and transfer overhead. A configurable retry delay backs off after GPU failures.
06 / What remains unresolved
Short-lived and coasting tracks often fail to collect enough measured positions. Zero published velocity preserves the interface contract, but an unknown track has not been shown to be stationary.
The regression has one AIS reference vessel and approximate land polygons. Wider weather, sea-state, target-size and encounter coverage is needed to assess missed targets and generalize the tuned gates.
Radar grids mark occupied evidence and leave other cells unknown. The shared risk calculation assumes point targets and constant velocity; it does not model hull clearance, uncertainty propagation or marine right-of-way rules.
07 / Source and measurement trail
The displayed footage and regression measurements were collected on October 21–22, 2026 from the May 16, 2025 vessel bag. The October 25 source audit found only README and media additions after the recorded radar revision. Runtime code matches that revision.
Repository development and maintenance: Jerry Chang. The implementation uses ROS 2, NumPy, SciPy and CuPy. Figures derive from retained measurements; video and screenshots come from the implemented system in RViz. The sensor hardware, middleware and numerical libraries are third-party components.
Radar Processing / Perception Stack