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

Remove start clear #4418

Merged
merged 1 commit into from
Jun 11, 2024
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
6 changes: 0 additions & 6 deletions nav2_smac_planner/include/nav2_smac_planner/a_star.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,6 @@ class AStarAlgorithm
inline void populateExpansionsLog(
const NodePtr & node, std::vector<std::tuple<float, float, float>> * expansions_log);

/**
* @brief Clear Start
*/
void clearStart();


bool _traverse_unknown;
int _max_iterations;
int _max_on_approach_iterations;
Expand Down
16 changes: 0 additions & 16 deletions nav2_smac_planner/src/a_star.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,6 @@ bool AStarAlgorithm<NodeT>::areInputsValid()
}

// Note: We do not check the if the start is valid because it is cleared
clearStart();

return true;
}

Expand Down Expand Up @@ -484,20 +482,6 @@ unsigned int & AStarAlgorithm<NodeT>::getSizeDim3()
return _dim3_size;
}

template<>
void AStarAlgorithm<Node2D>::clearStart()
{
auto coords = Node2D::getCoords(_start->getIndex());
_costmap->setCost(coords.x, coords.y, nav2_costmap_2d::FREE_SPACE);
}

template<typename NodeT>
void AStarAlgorithm<NodeT>::clearStart()
{
auto coords = NodeT::getCoords(_start->getIndex(), _costmap->getSizeInCellsX(), getSizeDim3());
_costmap->setCost(coords.x, coords.y, nav2_costmap_2d::FREE_SPACE);
}

// Instantiate algorithm for the supported template types
template class AStarAlgorithm<Node2D>;
template class AStarAlgorithm<NodeHybrid>;
Expand Down
Loading