Skip to content

Commit

Permalink
improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
stevedanomodolor committed Mar 25, 2024
1 parent 4f18771 commit 362a845
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nav2_smac_planner/include/nav2_smac_planner/a_star.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class AStarAlgorithm
* before applying the heading mode
* @return Coordinate to the first goal
*/
Coordinates getOriginalGoalCoordinate();
Coordinates getInitialGoalCoordinate();

protected:
/**
Expand Down
4 changes: 2 additions & 2 deletions nav2_smac_planner/src/a_star.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ bool AStarAlgorithm<NodeT>::createPath(
// 2.1) Use an analytic expansion (if available) to generate a path
expansion_result = _expander->tryAnalyticExpansion(
current_node, getGoals(),
getOriginalGoalCoordinate(), neighborGetter, analytic_iterations, closest_distance);
getInitialGoalCoordinate(), neighborGetter, analytic_iterations, closest_distance);
if (expansion_result != nullptr) {
current_node = expansion_result;
}
Expand Down Expand Up @@ -551,7 +551,7 @@ void AStarAlgorithm<NodeT>::clearStart()


template<typename NodeT>
typename AStarAlgorithm<NodeT>::Coordinates AStarAlgorithm<NodeT>::getOriginalGoalCoordinate()
typename AStarAlgorithm<NodeT>::Coordinates AStarAlgorithm<NodeT>::getInitialGoalCoordinate()
{
return _goals_coordinates[0];
}
Expand Down
4 changes: 2 additions & 2 deletions nav2_smac_planner/test/test_a_star.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ TEST(AStarTest, test_goal_heading_goals)
EXPECT_TRUE(a_star.createPath(path, num_it, tolerance, dummy_cancel_checker, expansions.get()));

EXPECT_TRUE(a_star.getGoals().size() == 2);
EXPECT_TRUE(a_star.getOriginalGoalCoordinate().theta == 40u);
EXPECT_TRUE(a_star.getInitialGoalCoordinate().theta == 40u);


// ALL_DIRECTION goal heading mode
Expand All @@ -423,7 +423,7 @@ TEST(AStarTest, test_goal_heading_goals)

EXPECT_TRUE(a_star.getGoals().size() == num_bins);
// first goal should be the same the one set by the user
EXPECT_TRUE(a_star.getOriginalGoalCoordinate().theta == 40u);
EXPECT_TRUE(a_star.getInitialGoalCoordinate().theta == 40u);

}

Expand Down

0 comments on commit 362a845

Please sign in to comment.