15 #ifndef NAV2_COSTMAP_2D__INFLATION_LAYER_INTERFACE_HPP_
16 #define NAV2_COSTMAP_2D__INFLATION_LAYER_INTERFACE_HPP_
22 #include "nav2_costmap_2d/layer.hpp"
23 #include "nav2_costmap_2d/costmap_2d.hpp"
24 #include "nav2_costmap_2d/costmap_2d_ros.hpp"
37 typedef std::recursive_mutex mutex_t;
74 std::shared_ptr<nav2_costmap_2d::Costmap2DROS> & costmap_ros,
75 const std::string layer_name =
"")
77 const auto layered_costmap = costmap_ros->getLayeredCostmap();
78 for (
auto layer = layered_costmap->getPlugins()->begin();
79 layer != layered_costmap->getPlugins()->end();
82 auto inflation_layer =
83 std::dynamic_pointer_cast<nav2_costmap_2d::InflationLayerInterface>(*layer);
84 if (inflation_layer) {
85 if (layer_name.empty() || inflation_layer->getName() == layer_name) {
86 return inflation_layer;
Abstract interface for inflation layers, providing common methods needed by navigation components reg...
virtual double getCostScalingFactor()=0
Get the cost scaling factor.
virtual unsigned char computeCost(double distance) const =0
Given a distance, compute a cost.
virtual double getInflationRadius()=0
Get the inflation radius.
virtual mutex_t * getMutex()=0
Get the mutex of the inflation information.
static std::shared_ptr< InflationLayerInterface > getInflationLayer(std::shared_ptr< nav2_costmap_2d::Costmap2DROS > &costmap_ros, const std::string layer_name="")
Get the inflation layer from a costmap, checking for both InflationLayer and LegacyInflationLayer imp...
Abstract class for layered costmap plugin implementations.