File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
nav2_mppi_controller/src/critics
nav2_smac_planner/include/nav2_smac_planner Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,19 @@ float CostCritic::findCircumscribedCost(
9595 inflation_layer_name_);
9696 if (inflation_layer != nullptr ) {
9797 const double resolution = costmap->getCostmap ()->getResolution ();
98+ double inflation_radius = inflation_layer->getInflationRadius ();
99+ if (inflation_radius < circum_radius) {
100+ RCLCPP_ERROR (
101+ rclcpp::get_logger (" computeCircumscribedCost" ),
102+ " The inflation radius (%f) is smaller than the circumscribed radius (%f) "
103+ " If this is an SE2-collision checking plugin, it cannot use costmap potential "
104+ " field to speed up collision checking by only checking the full footprint "
105+ " when robot is within possibly-inscribed radius of an obstacle. This may "
106+ " significantly slow down planning times!" ,
107+ inflation_radius, circum_radius);
108+ result = 0.0 ;
109+ return result;
110+ }
98111 result = inflation_layer->computeCost (circum_radius / resolution);
99112 } else {
100113 RCLCPP_WARN (
Original file line number Diff line number Diff line change @@ -83,6 +83,19 @@ inline double findCircumscribedCost(std::shared_ptr<nav2_costmap_2d::Costmap2DRO
8383 if (inflation_layer != nullptr ) {
8484 double circum_radius = costmap->getLayeredCostmap ()->getCircumscribedRadius ();
8585 double resolution = costmap->getCostmap ()->getResolution ();
86+ double inflation_radius = inflation_layer->getInflationRadius ();
87+ if (inflation_radius < circum_radius) {
88+ RCLCPP_ERROR (
89+ rclcpp::get_logger (" computeCircumscribedCost" ),
90+ " The inflation radius (%f) is smaller than the circumscribed radius (%f) "
91+ " If this is an SE2-collision checking plugin, it cannot use costmap potential "
92+ " field to speed up collision checking by only checking the full footprint "
93+ " when robot is within possibly-inscribed radius of an obstacle. This may "
94+ " significantly slow down planning times!" ,
95+ inflation_radius, circum_radius);
96+ result = 0.0 ;
97+ return result;
98+ }
8699 result = static_cast <double >(inflation_layer->computeCost (circum_radius / resolution));
87100 } else {
88101 RCLCPP_WARN (
You can’t perform that action at this time.
0 commit comments