@@ -54,9 +54,8 @@ bool Smoother::smooth(
5454 nav_msgs::msg::Path & path,
5555 const nav2_costmap_2d::Costmap2D * costmap,
5656 const double & max_time,
57- const double & max_time,
58- const nav2_costmap_2d::Footprint & footprint = nav2_costmap_2d::Footprint(),
59- const bool & use_radius = true)
57+ const std::vector<geometry_msgs::msg::Point> & footprint,
58+ const bool & use_radius)
6059{
6160 // by-pass path orientations approximation when skipping smac smoother
6261 if (max_its_ == 0 ) {
@@ -90,7 +89,8 @@ bool Smoother::smooth(
9089 const geometry_msgs::msg::Pose start_pose = curr_path_segment.poses .front ().pose ;
9190 const geometry_msgs::msg::Pose goal_pose = curr_path_segment.poses .back ().pose ;
9291 bool local_success =
93- smoothImpl (curr_path_segment, reversing_segment, costmap, time_remaining,
92+ smoothImpl (
93+ curr_path_segment, reversing_segment, costmap, time_remaining,
9494 footprint, use_radius);
9595 success = success && local_success;
9696
@@ -115,9 +115,8 @@ bool Smoother::smoothImpl(
115115 nav_msgs::msg::Path & path,
116116 bool & reversing_segment,
117117 const nav2_costmap_2d::Costmap2D * costmap,
118- const double & max_time,
119118 const double & max_time,
120- const nav2_costmap_2d::Footprint & footprint,
119+ const std::vector<geometry_msgs::msg::Point> & footprint,
121120 const bool & use_radius)
122121{
123122 steady_clock::time_point a = steady_clock::now ();
@@ -192,21 +191,21 @@ bool Smoother::smoothImpl(
192191 return false ;
193192 }
194193 }
195-
194+
196195 if (costmap && !use_radius) {
197196 nav2_util::updateApproximatePathOrientations (new_path, reversing_segment, is_holonomic_);
198197
199- nav2_costmap_2d::FootprintCollisionChecker<const nav2_costmap_2d::Costmap2D *>
200- footprint_checker (costmap);
198+ nav2_costmap_2d::FootprintCollisionChecker<nav2_costmap_2d::Costmap2D *>
199+ footprint_checker (const_cast <nav2_costmap_2d::Costmap2D *>( costmap) );
201200
202201 for (const auto & pose : new_path.poses ) {
203202 const double footprint_cost = footprint_checker.footprintCostAtPose (
204- pose.pose .position .x ,
205- pose.pose .position .y ,
206- f2f ::getYaw (pose.pose .orientation ),
203+ pose.pose .position .x ,
204+ pose.pose .position .y ,
205+ tf2 ::getYaw (pose.pose .orientation ),
207206 footprint);
208-
209- if (footprint_cost >= nav2_costmap_2d:: LETHAL_OBSTACLE ) {
207+
208+ if (footprint_cost > MAX_NON_OBSTACLE_COST && footprint_cost != UNKNOWN_COST ) {
210209 RCLCPP_DEBUG (
211210 rclcpp::get_logger (" SmacPlannerSmoother" ),
212211 " Smoothing process resulted in an infeasible footprint collision. "
0 commit comments