Skip to content

Commit

Permalink
adding tolerance back in for smac lattice and hybrid-A* planners (#3734)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMacenski authored Aug 3, 2023
1 parent f424900 commit 762c99a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion nav2_smac_planner/src/smac_planner_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,10 @@ nav_msgs::msg::Path SmacPlannerHybrid::createPlan(
expansions = std::make_unique<std::vector<std::tuple<float, float>>>();
}
// Note: All exceptions thrown are handled by the planner server and returned to the action
if (!_a_star->createPath(path, num_iterations, 0, expansions.get())) {
if (!_a_star->createPath(
path, num_iterations,
_tolerance / static_cast<float>(costmap->getResolution()), expansions.get()))
{
if (num_iterations < _a_star->getMaxIterations()) {
throw nav2_core::NoValidPathCouldBeFound("no valid path found");
} else {
Expand Down
4 changes: 3 additions & 1 deletion nav2_smac_planner/src/smac_planner_lattice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ nav_msgs::msg::Path SmacPlannerLattice::createPlan(
std::string error;

// Note: All exceptions thrown are handled by the planner server and returned to the action
if (!_a_star->createPath(path, num_iterations, 0 /*no tolerance*/)) {
if (!_a_star->createPath(
path, num_iterations, _tolerance / static_cast<float>(_costmap->getResolution())))
{
if (num_iterations < _a_star->getMaxIterations()) {
throw nav2_core::NoValidPathCouldBeFound("no valid path found");
} else {
Expand Down

0 comments on commit 762c99a

Please sign in to comment.