Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect exploration algorithm in map_grid.cpp #1193

Open
lucamozza opened this issue Mar 31, 2022 · 0 comments
Open

Incorrect exploration algorithm in map_grid.cpp #1193

lucamozza opened this issue Mar 31, 2022 · 0 comments

Comments

@lucamozza
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant