Skip to content
Snippets Groups Projects
Unverified Commit dcc1d4da authored by justinIRBT's avatar justinIRBT Committed by GitHub
Browse files

Fix max path cycles for case where map has larger Y dimension than X dimension (#2017)

* Fix max path cycles for case where map has larger Y dimension than X dimension

* Improve readability

* fix ament_cpplint and ament_uncrustify issues
parent 63aa0add
No related branches found
No related tags found
No related merge requests found
......@@ -320,7 +320,10 @@ NavfnPlanner::getPlanFromPotential(
planner_->setStart(map_goal);
int path_len = planner_->calcPath(costmap_->getSizeInCellsX() * 4);
const int & max_cycles = (costmap_->getSizeInCellsX() >= costmap_->getSizeInCellsY()) ?
(costmap_->getSizeInCellsX() * 4) : (costmap_->getSizeInCellsY() * 4);
int path_len = planner_->calcPath(max_cycles);
if (path_len == 0) {
return false;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment