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 authored Nov 19, 2021
1 parent 3b9ebdb commit a9c5502
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 @@ -134,6 +134,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 @@ -448,6 +451,9 @@ SmacPlannerHybrid::dynamicParametersCallback(std::vector<rclcpp::Parameter> para
// 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 a9c5502

Please sign in to comment.