param_helper.h
Go to the documentation of this file.
1 
18 #include <ros/ros.h>
19 
21 {
23 public:
24  ParamHelper(std::string class_name, ros::NodeHandle nh) : class_name_(class_name), nh_(nh)
25  {}
26 
27  template <typename T>
28  void getParam(std::string param_name, T *variable, T default_value)
29  {
30  T d = default_value;
31  if (!nh_.getParam(param_name, d))
32  ROS_WARN_STREAM(class_name_ << ": " << param_name << " not set, using default!");
33 
34  ROS_DEBUG_STREAM_NAMED(class_name_, class_name_ << " parameter: " << param_name << " = " << d);
35  *variable = d;
36  }
37 
38 
39 private:
40  std::string class_name_;
42 };
43 template <>
44 void ParamHelper::getParam<unsigned int>(std::string param_name, unsigned int *variable, unsigned int default_value);
45 }
d
#define ROS_DEBUG_STREAM_NAMED(name, args)
def default_value(type)
void getParam(std::string param_name, T *variable, T default_value)
Definition: param_helper.h:28
#define ROS_WARN_STREAM(args)
bool getParam(const std::string &key, std::string &s) const
ParamHelper(std::string class_name, ros::NodeHandle nh)
Definition: param_helper.h:24


asr_recognizer_prediction_ism
Author(s): Aumann Florian, Heller Florian, Hutmacher Robin, Meißner Pascal, Stöckle Patrick, Stroh Daniel
autogenerated on Wed Jan 8 2020 03:18:32