diff --git a/nav2_smac_planner/include/nav2_smac_planner/a_star.hpp b/nav2_smac_planner/include/nav2_smac_planner/a_star.hpp index 376c5d3fc17..3fca0e8b558 100644 --- a/nav2_smac_planner/include/nav2_smac_planner/a_star.hpp +++ b/nav2_smac_planner/include/nav2_smac_planner/a_star.hpp @@ -200,7 +200,7 @@ class AStarAlgorithm * before applying the heading mode * @return Coordinate to the first goal */ - Coordinates getOriginalGoalCoordinate(); + Coordinates getInitialGoalCoordinate(); protected: /** diff --git a/nav2_smac_planner/src/a_star.cpp b/nav2_smac_planner/src/a_star.cpp index 2047e3891bc..f3fbea578b9 100644 --- a/nav2_smac_planner/src/a_star.cpp +++ b/nav2_smac_planner/src/a_star.cpp @@ -387,7 +387,7 @@ bool AStarAlgorithm::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; } @@ -551,7 +551,7 @@ void AStarAlgorithm::clearStart() template -typename AStarAlgorithm::Coordinates AStarAlgorithm::getOriginalGoalCoordinate() +typename AStarAlgorithm::Coordinates AStarAlgorithm::getInitialGoalCoordinate() { return _goals_coordinates[0]; } diff --git a/nav2_smac_planner/test/test_a_star.cpp b/nav2_smac_planner/test/test_a_star.cpp index 1f8b7cd2370..4c772debcaa 100644 --- a/nav2_smac_planner/test/test_a_star.cpp +++ b/nav2_smac_planner/test/test_a_star.cpp @@ -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 @@ -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); }