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

adding tolerance back in for smac lattice and hybrid-A* planners #3734

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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