Closed nhatao closed 8 months ago
Merging #726 (c3e88be) into master (e632876) will decrease coverage by
0.37%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #726 +/- ##
==========================================
- Coverage 88.98% 88.62% -0.37%
==========================================
Files 62 62
Lines 4584 4596 +12
==========================================
- Hits 4079 4073 -6
- Misses 505 523 +18
Files | Coverage Δ | |
---|---|---|
...nclude/costmap_cspace/costmap_3d_layer/footprint.h | 88.88% <100.00%> (+0.94%) |
:arrow_up: |
Assume that there are 3 consecutive occupied grid cells on an
OccupancyGrid
, andcostmap_3d
expands these cells. The black cells in the diagram above are the occupied cells, and the yellow, green, and red cells are expanded cells. The nearest occupied cell from the yellow cells is the left one, the nearest occupied cell from the green cells is the center one, and the nearest occupied cell from the red cell is the right one. Therefore, the expansion process for the left cell should be performed on the yellow cells, the process for the center cell on the green cells, and the process for the right cell on the red cells respectively. By this PR, the expansion ranges are limited when adjacent cells have the same or larger costs than the expanding cell. Since occupied cells on the occupancy grid map are rarely isolated, this algorithm can speed up the expansion process. Note that this algorithm is effective only when the costmap and theOccupancyGrid
have the same resolution.The calculation time of
Costmap3dLayerFootprint::updateCSpace()
on my laptop (Map size: 4.5K x 2.4K x 16, the number of occupied cells: 188K) Master branch: 5.118 seconds This PR: 0.335 seconds