47 nh.
param(
"neutral_cost", neutral_cost, 50);
48 if (neutral_cost < 0 || neutral_cost > std::numeric_limits<unsigned char>::max())
50 throw std::invalid_argument(
"neutral_cost (" + std::to_string(neutral_cost) +
") must be a valid unsigned char!");
56 nh.
param(
"scale", scale, 3.0
f);
59 if (nh.
hasParam(
"unknown_interpretation"))
63 ROS_ERROR(
"allow_unknown can't be specified at the same time as unknown_interpretation.");
64 ROS_ERROR(
"Using the value of unknown_interpretation.");
66 std::string unknown_str;
67 nh.
getParam(
"unknown_interpretation", unknown_str);
68 if (unknown_str ==
"lethal")
72 else if (unknown_str ==
"expensive")
76 else if (unknown_str ==
"free")
82 ROS_ERROR(
"Unknown value for unknown_interpretation '%s'. Using expensive instead.", unknown_str.c_str());
void setConfiguration(const unsigned char neutral_cost, const float scale, const UnknownInterpretation mode)
const float LETHAL_COST_F
static const unsigned char NO_INFORMATION
const unsigned char LETHAL_COST
nav_core2::Costmap::Ptr costmap_
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
void initialize(ros::NodeHandle &nh, nav_core2::Costmap::Ptr costmap)
unsigned char neutral_cost_
std::array< float, 256 > cached_costs_
bool getParam(const std::string &key, std::string &s) const
std::shared_ptr< Costmap > Ptr
bool hasParam(const std::string &key) const