Skip to content

Commit

Permalink
If not downsampling costmap, default factor to 1 (#2695)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMacenski committed Dec 16, 2021
1 parent 28fbb9d commit 5ab15d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nav2_smac_planner/src/smac_planner_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ void SmacPlannerHybrid::configure(
}

// convert to grid coordinates
if (!_downsample_costmap) {
_downsampling_factor = 1;
}
const double minimum_turning_radius_global_coords = _search_info.minimum_turning_radius;
_search_info.minimum_turning_radius =
_search_info.minimum_turning_radius / (_costmap->getResolution() * _downsampling_factor);
Expand Down Expand Up @@ -449,6 +452,9 @@ void SmacPlannerHybrid::on_parameter_event_callback(
// Re-init if needed with mutex lock (to avoid re-init while creating a plan)
if (reinit_a_star || reinit_downsampler || reinit_collision_checker || reinit_smoother) {
// convert to grid coordinates
if (!_downsample_costmap) {
_downsampling_factor = 1;
}
const double minimum_turning_radius_global_coords = _search_info.minimum_turning_radius;
_search_info.minimum_turning_radius =
_search_info.minimum_turning_radius / (_costmap->getResolution() * _downsampling_factor);
Expand Down

0 comments on commit 5ab15d4

Please sign in to comment.