Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
Signed-off-by: stevedan <[email protected]>
  • Loading branch information
stevedanomodolor committed Nov 18, 2024
1 parent 18dba40 commit 7c1f439
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions nav2_smac_planner/src/a_star.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ void AStarAlgorithm<NodeT>::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)

Check warning on line 265 in nav2_smac_planner/src/a_star.cpp

View check run for this annotation

Codecov / codecov/patch

nav2_smac_planner/src/a_star.cpp#L265

Added line #L265 was not covered by tests
{
if (!_start) {
throw std::runtime_error("Start must be set before goal.");
Expand Down Expand Up @@ -291,7 +291,7 @@ bool AStarAlgorithm<NodeT>::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
Expand Down
5 changes: 2 additions & 3 deletions nav2_smac_planner/src/analytic_expansion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,17 @@ typename AnalyticExpansion<NodeT>::NodePtr AnalyticExpansion<NodeT>::tryAnalytic
int desired_iterations = std::max(
static_cast<int>(closest_distance / _search_info.analytic_expansion_ratio),
static_cast<int>(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);

// 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(
Expand Down

0 comments on commit 7c1f439

Please sign in to comment.