Skip to content

Commit

Permalink
Update footprint iif changed
Browse files Browse the repository at this point in the history
  • Loading branch information
BriceRenaudeau authored Mar 18, 2024
1 parent aa849ae commit dcb060b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class AnalyticExpansion
* @brief Sets the collision checker and costmap to use in expansion validation
* @param collision_checker Collision checker to use
*/
void setCollisionChecker(GridCollisionChecker * & collision_checker);
void setCollisionChecker(GridCollisionChecker * collision_checker);

/**
* @brief Attempt an analytic path completion
Expand Down
2 changes: 1 addition & 1 deletion nav2_smac_planner/src/analytic_expansion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ AnalyticExpansion<NodeT>::AnalyticExpansion(

template<typename NodeT>
void AnalyticExpansion<NodeT>::setCollisionChecker(
GridCollisionChecker * & collision_checker)
GridCollisionChecker * collision_checker)
{
_collision_checker = collision_checker;
}
Expand Down
1 change: 1 addition & 0 deletions nav2_smac_planner/src/collision_checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ void GridCollisionChecker::setFootprint(
return;
}

oriented_footprints_.clear();
oriented_footprints_.reserve(angles_.size());
double sin_th, cos_th;
geometry_msgs::msg::Point new_pt;
Expand Down
4 changes: 4 additions & 0 deletions nav2_smac_planner/src/smac_planner_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ nav_msgs::msg::Path SmacPlannerHybrid::createPlan(
}

// Set collision checker and costmap information
_collision_checker.setFootprint(
_costmap_ros->getRobotFootprint(),
_costmap_ros->getUseRadius(),
findCircumscribedCost(_costmap_ros));
_a_star->setCollisionChecker(&_collision_checker);

// Set starting point, in A* bin search coordinates
Expand Down
4 changes: 4 additions & 0 deletions nav2_smac_planner/src/smac_planner_lattice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ nav_msgs::msg::Path SmacPlannerLattice::createPlan(
std::unique_lock<nav2_costmap_2d::Costmap2D::mutex_t> lock(*(_costmap->getMutex()));

// Set collision checker and costmap information
_collision_checker.setFootprint(
_costmap_ros->getRobotFootprint(),
_costmap_ros->getUseRadius(),
findCircumscribedCost(_costmap_ros));
_a_star->setCollisionChecker(&_collision_checker);

// Set starting point, in A* bin search coordinates
Expand Down

0 comments on commit dcb060b

Please sign in to comment.