Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Incorrect exploration algorithm in map_grid.cpp #1193

@lucamozza

Description

@lucamozza

In base_local_planner/src/map_grid.cpp the function computeTargetDistance is used to compute the minimum distance between each cell and the plan/goal.
From my understanding, in the following lines we are exploring from current_cell and checking its four neighbors, which are represented by the check_cell variable.
Checking a cell consists in updating its distance if the distance coming from current_cell is lower than the current minimum one, and adding the check_cell to the queue of cells from which the expansion has to be performed.
The distance is not updated if the cell was already marked as explored.

if(current_cell->cx > 0){
check_cell = current_cell - 1;
if(!check_cell->target_mark){
//mark the cell as visisted
check_cell->target_mark = true;
if(updatePathCell(current_cell, check_cell, costmap)) {
dist_queue.push(check_cell);
}
}
}

In this line of reasoning, I think that the cell should be marked as explored once we explore from it, that is we should mark current_cell, not check_cell as it is done currently.

check_cell->target_mark = true;

In the current version, distances are never updated, they will remain to the value set in the first iteration.

Am I getting this right?
Are there any other reasons why this choice was made?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions