From 25d5e005371affff2212543dc8d72e58aa08a532 Mon Sep 17 00:00:00 2001 From: Nisarg Panchal <71684502+Nisarg236@users.noreply.github.com> Date: Sat, 7 Dec 2024 11:11:26 +0530 Subject: [PATCH] Update obstacle_layer.cpp --- costmap_2d/plugins/obstacle_layer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/costmap_2d/plugins/obstacle_layer.cpp b/costmap_2d/plugins/obstacle_layer.cpp index ab9af72b8..458d3e669 100644 --- a/costmap_2d/plugins/obstacle_layer.cpp +++ b/costmap_2d/plugins/obstacle_layer.cpp @@ -242,6 +242,10 @@ void ObstacleLayer::reconfigureCB(costmap_2d::ObstaclePluginConfig &config, uint reduced_footprint_enabled_ = config.reduced_footprint_enabled; footprint_reduction_size_ = config.footprint_reduction_size; } + else{ + reduced_footprint_enabled_ = false; + footprint_reduction_size_ = 0.0; + } max_obstacle_height_ = config.max_obstacle_height; combination_method_ = config.combination_method; raytrace_outside_map_ = config.raytrace_outside_map; @@ -511,10 +515,7 @@ void ObstacleLayer::updateCosts(costmap_2d::Costmap2D& master_grid, int min_i, i { if (footprint_clearing_enabled_) { - const std::vector& footprint_to_use = (reduced_footprint_enabled_) - ? reduced_footprint_ - : transformed_footprint_; - setConvexPolygonCost(footprint_to_use, costmap_2d::FREE_SPACE); + setConvexPolygonCost(transformed_footprint_, costmap_2d::FREE_SPACE); } switch (combination_method_)