Skip to content

Commit caa695a

Browse files
tonynajjarSteveMacenski
authored andcommitted
Warn if inflation_radius_ < inscribed_radius_ (#4423)
* Warn if inflation_radius_ < inscribed_radius_ Signed-off-by: Tony Najjar <[email protected]> * convert to error Signed-off-by: Tony Najjar <[email protected]> --------- Signed-off-by: Tony Najjar <[email protected]>
1 parent 799e159 commit caa695a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

nav2_costmap_2d/plugins/inflation_layer.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ InflationLayer::onFootprintChanged()
170170
computeCaches();
171171
need_reinflation_ = true;
172172

173+
if (inflation_radius_ < inscribed_radius_) {
174+
RCLCPP_ERROR(
175+
logger_,
176+
"The configured inflation radius (%.3f) is smaller than "
177+
"the computed inscribed radius (%.3f) of your footprint, "
178+
"it is highly recommended to set inflation radius to be at "
179+
"least as big as the inscribed radius to avoid collisions",
180+
inflation_radius_, inscribed_radius_);
181+
}
182+
173183
RCLCPP_DEBUG(
174184
logger_, "InflationLayer::onFootprintChanged(): num footprint points: %zu,"
175185
" inscribed_radius_ = %.3f, inflation_radius_ = %.3f",

0 commit comments

Comments
 (0)