cartographer-project / cartographer

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
Apache License 2.0
7.03k stars 2.24k forks source link

Purpose of kPadding in OccupiedSpaceCostFunction2D #1950

Open lss0815 opened 5 months ago

lss0815 commented 5 months ago

Hello, I am presently examining algorithms and implementations related to scan matching.

During my review, I encountered a constant variable within the cost function OccupiedSpaceCostFunction2D. Specifically, the variable is kPadding found on line 69 in the cartographer/mapping/internal/2d/scan_matching/occupied_space_cost_function_2d.cc file. I have been unable to discern the purpose behind summing and subtracting this variable when accessing grid data. Does anyone have insights into the intended use or purpose of this variable?