From 7c1f439c26a72ba768648854f212016c252e8d1b Mon Sep 17 00:00:00 2001 From: stevedan Date: Mon, 18 Nov 2024 20:24:08 +0100 Subject: [PATCH] linter fixes Signed-off-by: stevedan --- nav2_smac_planner/src/a_star.cpp | 6 +++--- nav2_smac_planner/src/analytic_expansion.cpp | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/nav2_smac_planner/src/a_star.cpp b/nav2_smac_planner/src/a_star.cpp index d895984b94..d09fc92393 100644 --- a/nav2_smac_planner/src/a_star.cpp +++ b/nav2_smac_planner/src/a_star.cpp @@ -261,8 +261,8 @@ void AStarAlgorithm::setGoal( // we just have to check whether the x and y are the same because the dim3 is not used // in the computation of the obstacle heuristic - if (!_search_info.cache_obstacle_heuristic || - goals_coordinates != _goals_coordinates) + if (!_search_info.cache_obstacle_heuristic || + goals_coordinates != _goals_coordinates) { if (!_start) { throw std::runtime_error("Start must be set before goal."); @@ -291,7 +291,7 @@ bool AStarAlgorithm::areInputsValid() if (!_start || _goalsSet.empty()) { throw std::runtime_error("Failed to compute path, no valid start or goal given."); } - + // Check if ending point is valid if (getToleranceHeuristic() < 0.001) { // if a node is not valid, prune it from the goals set diff --git a/nav2_smac_planner/src/analytic_expansion.cpp b/nav2_smac_planner/src/analytic_expansion.cpp index 86fc0f4496..25d5b4aa42 100644 --- a/nav2_smac_planner/src/analytic_expansion.cpp +++ b/nav2_smac_planner/src/analytic_expansion.cpp @@ -74,7 +74,7 @@ typename AnalyticExpansion::NodePtr AnalyticExpansion::tryAnalytic int desired_iterations = std::max( static_cast(closest_distance / _search_info.analytic_expansion_ratio), static_cast(std::ceil(_search_info.analytic_expansion_ratio))); - + // If we are closer now, we should update the target number of iterations to go analytic_iterations = std::min(analytic_iterations, desired_iterations); @@ -82,10 +82,9 @@ typename AnalyticExpansion::NodePtr AnalyticExpansion::tryAnalytic // Always run the expansion on the first run in case there is a // trivial path to be found if (analytic_iterations <= 0) { - // Reset the counter and try the analytic path expansion analytic_iterations = desired_iterations; - + for (auto goal_node : goals_node) { AnalyticExpansionNodes analytic_nodes = getAnalyticPath(