Skip to content

Use atan2 approximation for ray binning

Ray binning in the ray aggregator was identified as a bottleneck of the application, which is mainly caused by the overhead of atan2f. Using an approximation that still has sufficient accuracy reduces the overhead of the binning.

While we do see some unexpected variations in our measurements (especially for the total runtime of each module) which we are still investigating, generally this set of patches improves the performance for us. For example, for our test system (Intel Core i7-6700HQ @ 2.60GHz × 8, 40 GB RAM, Ubuntu 18.04, ROS 2 Dashing, Autoware.auto (Hash: dba2158e)), the following performance improvements could be measured:

  • ray_ground_classifier: ~x1.7
  • velodyne_cloud: ~x1.7 (as a combination of the branches: walbroel.add_point, walbroel.iterative_quick_sort, walbroel.less_operator and walbroel.fast_atan2).

Merge request reports