Skip to main content

Module clustering

Module clustering 

Source
Expand description

Shared spatial-hash clustering with union-find.

Used by the obstacle detector, scene graph builder, and perception pipeline to avoid duplicating the same algorithm.

§Optimizations

  • Union-by-rank prevents tree degeneration, keeping find near O(α(n)).
  • Path halving in find for efficient path compression.
  • #[inline] on hot helpers to ensure inlining in tight loops.

Functions§

cluster_point_cloud
Cluster a point cloud using spatial hashing and union-find over adjacent cells.