PidConfig.h
Go to the documentation of this file.
1 //#line 2
2 //"/opt/ros/indigo/share/dynamic_reconfigure/cmake/../templates/ConfigType.h.template"
3 // *********************************************************
4 //
5 // File autogenerated for the pid package
6 // by the dynamic_reconfigure package.
7 // Please do not edit.
8 //
9 // ********************************************************/
10 
11 #ifndef __pid__PIDCONFIG_H__
12 #define __pid__PIDCONFIG_H__
13 
14 namespace pid
15 {
16 class PidConfigStatics;
17 
18 class PidConfig
19 {
20 public:
21  class AbstractParamDescription : public dynamic_reconfigure::ParamDescription
22  {
23  public:
24  AbstractParamDescription(std::string n, std::string t, uint32_t l, std::string d, std::string e)
25  {
26  name = n;
27  type = t;
28  level = l;
29  description = d;
30  edit_method = e;
31  }
32 
33  virtual void clamp(PidConfig& config, const PidConfig& max, const PidConfig& min) const = 0;
34  virtual void calcLevel(uint32_t& level, const PidConfig& config1, const PidConfig& config2) const = 0;
35  virtual void fromServer(const ros::NodeHandle& nh, PidConfig& config) const = 0;
36  virtual void toServer(const ros::NodeHandle& nh, const PidConfig& config) const = 0;
37  virtual bool fromMessage(const dynamic_reconfigure::Config& msg, PidConfig& config) const = 0;
38  virtual void toMessage(dynamic_reconfigure::Config& msg, const PidConfig& config) const = 0;
39  virtual void getValue(const PidConfig& config, boost::any& val) const = 0;
40  };
41 
44 
45  template <class T>
47  {
48  public:
49  ParamDescription(std::string name, std::string type, uint32_t level, std::string description,
50  std::string edit_method, T PidConfig::*f)
51  : AbstractParamDescription(name, type, level, description, edit_method), field(f)
52  {
53  }
54 
55  T(PidConfig::*field);
56 
57  virtual void clamp(PidConfig& config, const PidConfig& max, const PidConfig& min) const
58  {
59  if (config.*field > max.*field)
60  config.*field = max.*field;
61 
62  if (config.*field < min.*field)
63  config.*field = min.*field;
64  }
65 
66  virtual void calcLevel(uint32_t& comb_level, const PidConfig& config1, const PidConfig& config2) const
67  {
68  if (config1.*field != config2.*field)
69  comb_level |= level;
70  }
71 
72  virtual void fromServer(const ros::NodeHandle& nh, PidConfig& config) const
73  {
74  nh.getParam(name, config.*field);
75  }
76 
77  virtual void toServer(const ros::NodeHandle& nh, const PidConfig& config) const
78  {
79  nh.setParam(name, config.*field);
80  }
81 
82  virtual bool fromMessage(const dynamic_reconfigure::Config& msg, PidConfig& config) const
83  {
84  return dynamic_reconfigure::ConfigTools::getParameter(msg, name, config.*field);
85  }
86 
87  virtual void toMessage(dynamic_reconfigure::Config& msg, const PidConfig& config) const
88  {
89  dynamic_reconfigure::ConfigTools::appendParameter(msg, name, config.*field);
90  }
91 
92  virtual void getValue(const PidConfig& config, boost::any& val) const
93  {
94  val = config.*field;
95  }
96  };
97 
98  class AbstractGroupDescription : public dynamic_reconfigure::Group
99  {
100  public:
101  AbstractGroupDescription(std::string n, std::string t, int p, int i, bool s)
102  {
103  name = n;
104  type = t;
105  parent = p;
106  state = s;
107  id = i;
108  }
109 
110  std::vector<AbstractParamDescriptionConstPtr> abstract_parameters;
111  bool state;
112 
113  virtual void toMessage(dynamic_reconfigure::Config& msg, const boost::any& config) const = 0;
114  virtual bool fromMessage(const dynamic_reconfigure::Config& msg, boost::any& config) const = 0;
115  virtual void updateParams(boost::any& cfg, PidConfig& top) const = 0;
116  virtual void setInitialState(boost::any& cfg) const = 0;
117 
119  {
120  for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = abstract_parameters.begin();
121  i != abstract_parameters.end(); ++i)
122  {
123  parameters.push_back(dynamic_reconfigure::ParamDescription(**i));
124  }
125  }
126  };
127 
130 
131  template <class T, class PT>
133  {
134  public:
135  GroupDescription(std::string name, std::string type, int parent, int id, bool s, T PT::*f)
136  : AbstractGroupDescription(name, type, parent, id, s), field(f)
137  {
138  }
139 
141  : AbstractGroupDescription(g.name, g.type, g.parent, g.id, g.state), field(g.field), groups(g.groups)
142  {
143  parameters = g.parameters;
144  abstract_parameters = g.abstract_parameters;
145  }
146 
147  virtual bool fromMessage(const dynamic_reconfigure::Config& msg, boost::any& cfg) const
148  {
149  PT* config = boost::any_cast<PT*>(cfg);
150  if (!dynamic_reconfigure::ConfigTools::getGroupState(msg, name, (*config).*field))
151  return false;
152 
153  for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = groups.begin(); i != groups.end(); ++i)
154  {
155  boost::any n = &((*config).*field);
156  if (!(*i)->fromMessage(msg, n))
157  return false;
158  }
159 
160  return true;
161  }
162 
163  virtual void setInitialState(boost::any& cfg) const
164  {
165  PT* config = boost::any_cast<PT*>(cfg);
166  T* group = &((*config).*field);
167  group->state = state;
168 
169  for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = groups.begin(); i != groups.end(); ++i)
170  {
171  boost::any n = boost::any(&((*config).*field));
172  (*i)->setInitialState(n);
173  }
174  }
175 
176  virtual void updateParams(boost::any& cfg, PidConfig& top) const
177  {
178  PT* config = boost::any_cast<PT*>(cfg);
179 
180  T* f = &((*config).*field);
181  f->setParams(top, abstract_parameters);
182 
183  for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = groups.begin(); i != groups.end(); ++i)
184  {
185  boost::any n = &((*config).*field);
186  (*i)->updateParams(n, top);
187  }
188  }
189 
190  virtual void toMessage(dynamic_reconfigure::Config& msg, const boost::any& cfg) const
191  {
192  const PT config = boost::any_cast<PT>(cfg);
193  dynamic_reconfigure::ConfigTools::appendGroup<T>(msg, name, id, parent, config.*field);
194 
195  for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = groups.begin(); i != groups.end(); ++i)
196  {
197  (*i)->toMessage(msg, config.*field);
198  }
199  }
200 
201  T(PT::*field);
202  std::vector<PidConfig::AbstractGroupDescriptionConstPtr> groups;
203  };
204 
205  class DEFAULT
206  {
207  public:
209  {
210  state = true;
211  name = "Default";
212  }
213 
214  void setParams(PidConfig& config, const std::vector<AbstractParamDescriptionConstPtr> params)
215  {
216  for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator _i = params.begin(); _i != params.end(); ++_i)
217  {
218  boost::any val;
219  (*_i)->getValue(config, val);
220 
221  if ("Kp_scale" == (*_i)->name)
222  {
223  Kp_scale = boost::any_cast<double>(val);
224  }
225  if ("Kp" == (*_i)->name)
226  {
227  Kp = boost::any_cast<double>(val);
228  }
229  if ("Ki_scale" == (*_i)->name)
230  {
231  Ki_scale = boost::any_cast<double>(val);
232  }
233  if ("Ki" == (*_i)->name)
234  {
235  Ki = boost::any_cast<double>(val);
236  }
237  if ("Kd_scale" == (*_i)->name)
238  {
239  Kd_scale = boost::any_cast<double>(val);
240  }
241  if ("Kd" == (*_i)->name)
242  {
243  Kd = boost::any_cast<double>(val);
244  }
245  }
246  }
247 
248  double Kp_scale;
249  double Kp;
250  double Ki_scale;
251  double Ki;
252  double Kd_scale;
253  double Kd;
254 
255  bool state;
256  std::string name;
257 
258  } groups;
259 
260  //#line 262
261  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
262  double Kp_scale;
263  //#line 262
264  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
265  double Kp;
266  //#line 262
267  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
268  double Ki_scale;
269  //#line 262
270  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
271  double Ki;
272  //#line 262
273  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
274  double Kd_scale;
275  //#line 262
276  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
277  double Kd;
278  //#line 218
279  //"/opt/ros/indigo/share/dynamic_reconfigure/cmake/../templates/ConfigType.h.template"
280 
281  bool __fromMessage__(dynamic_reconfigure::Config& msg)
282  {
283  const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__ = __getParamDescriptions__();
284  const std::vector<AbstractGroupDescriptionConstPtr>& __group_descriptions__ = __getGroupDescriptions__();
285 
286  int count = 0;
287  for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = __param_descriptions__.begin();
288  i != __param_descriptions__.end(); ++i)
289  if ((*i)->fromMessage(msg, *this))
290  count++;
291 
292  for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = __group_descriptions__.begin();
293  i != __group_descriptions__.end(); i++)
294  {
295  if ((*i)->id == 0)
296  {
297  boost::any n = boost::any(this);
298  (*i)->updateParams(n, *this);
299  (*i)->fromMessage(msg, n);
300  }
301  }
302 
303  if (count != dynamic_reconfigure::ConfigTools::size(msg))
304  {
305  ROS_ERROR("PidConfig::__fromMessage__ called with an unexpected parameter.");
306  ROS_ERROR("Booleans:");
307  for (unsigned int i = 0; i < msg.bools.size(); i++)
308  ROS_ERROR(" %s", msg.bools[i].name.c_str());
309  ROS_ERROR("Integers:");
310  for (unsigned int i = 0; i < msg.ints.size(); i++)
311  ROS_ERROR(" %s", msg.ints[i].name.c_str());
312  ROS_ERROR("Doubles:");
313  for (unsigned int i = 0; i < msg.doubles.size(); i++)
314  ROS_ERROR(" %s", msg.doubles[i].name.c_str());
315  ROS_ERROR("Strings:");
316  for (unsigned int i = 0; i < msg.strs.size(); i++)
317  ROS_ERROR(" %s", msg.strs[i].name.c_str());
318  // @todo Check that there are no duplicates. Make this error more
319  // explicit.
320  return false;
321  }
322  return true;
323  }
324 
325  // This version of __toMessage__ is used during initialization of
326  // statics when __getParamDescriptions__ can't be called yet.
327  void __toMessage__(dynamic_reconfigure::Config& msg,
328  const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__,
329  const std::vector<AbstractGroupDescriptionConstPtr>& __group_descriptions__) const
330  {
331  dynamic_reconfigure::ConfigTools::clear(msg);
332  for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = __param_descriptions__.begin();
333  i != __param_descriptions__.end(); ++i)
334  (*i)->toMessage(msg, *this);
335 
336  for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = __group_descriptions__.begin();
337  i != __group_descriptions__.end(); ++i)
338  {
339  if ((*i)->id == 0)
340  {
341  (*i)->toMessage(msg, *this);
342  }
343  }
344  }
345 
346  void __toMessage__(dynamic_reconfigure::Config& msg) const
347  {
348  const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__ = __getParamDescriptions__();
349  const std::vector<AbstractGroupDescriptionConstPtr>& __group_descriptions__ = __getGroupDescriptions__();
350  __toMessage__(msg, __param_descriptions__, __group_descriptions__);
351  }
352 
353  void __toServer__(const ros::NodeHandle& nh) const
354  {
355  const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__ = __getParamDescriptions__();
356  for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = __param_descriptions__.begin();
357  i != __param_descriptions__.end(); ++i)
358  (*i)->toServer(nh, *this);
359  }
360 
362  {
363  static bool setup = false;
364 
365  const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__ = __getParamDescriptions__();
366  for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = __param_descriptions__.begin();
367  i != __param_descriptions__.end(); ++i)
368  (*i)->fromServer(nh, *this);
369 
370  const std::vector<AbstractGroupDescriptionConstPtr>& __group_descriptions__ = __getGroupDescriptions__();
371  for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = __group_descriptions__.begin();
372  i != __group_descriptions__.end(); i++)
373  {
374  if (!setup && (*i)->id == 0)
375  {
376  setup = true;
377  boost::any n = boost::any(this);
378  (*i)->setInitialState(n);
379  }
380  }
381  }
382 
383  void __clamp__()
384  {
385  const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__ = __getParamDescriptions__();
386  const PidConfig& __max__ = __getMax__();
387  const PidConfig& __min__ = __getMin__();
388  for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = __param_descriptions__.begin();
389  i != __param_descriptions__.end(); ++i)
390  (*i)->clamp(*this, __max__, __min__);
391  }
392 
393  uint32_t __level__(const PidConfig& config) const
394  {
395  const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__ = __getParamDescriptions__();
396  uint32_t level = 0;
397  for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = __param_descriptions__.begin();
398  i != __param_descriptions__.end(); ++i)
399  (*i)->calcLevel(level, config, *this);
400  return level;
401  }
402 
403  static const dynamic_reconfigure::ConfigDescription& __getDescriptionMessage__();
404  static const PidConfig& __getDefault__();
405  static const PidConfig& __getMax__();
406  static const PidConfig& __getMin__();
407  static const std::vector<AbstractParamDescriptionConstPtr>& __getParamDescriptions__();
408  static const std::vector<AbstractGroupDescriptionConstPtr>& __getGroupDescriptions__();
409 
410 private:
411  static const PidConfigStatics* __get_statics__();
412 };
413 
414 template <> // Max and min are ignored for strings.
416  const PidConfig& min) const
417 {
418  return;
419 }
420 
422 {
423  friend class PidConfig;
424 
426  {
428  //#line 262
429  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
430  __min__.Kp_scale = 0.1;
431  //#line 262
432  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
433  __max__.Kp_scale = 100.0;
434  //#line 262
435  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
436  __default__.Kp_scale = 10.0;
437  //#line 262
438  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
440  new PidConfig::ParamDescription<double>("Kp_scale", "double", 0, "Kp scale",
441  "{'enum_description': 'Scale factor for K setting', 'enum': "
442  "[{'srcline': 7, 'description': 'Scale by 0.1', 'srcfile': "
443  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
444  "'cconsttype': 'const double', 'value': 0.1, 'ctype': "
445  "'double', 'type': 'double', 'name': 'scale_tenth'}, "
446  "{'srcline': 8, 'description': 'No scaling', 'srcfile': "
447  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
448  "'cconsttype': 'const double', 'value': 1.0, 'ctype': "
449  "'double', 'type': 'double', 'name': 'scale_unity'}, "
450  "{'srcline': 9, 'description': 'Scale by 10', 'srcfile': "
451  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
452  "'cconsttype': 'const double', 'value': 10.0, 'ctype': "
453  "'double', 'type': 'double', 'name': 'scale_ten'}, {'srcline': "
454  "10, 'description': 'Scale by 100', 'srcfile': "
455  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
456  "'cconsttype': 'const double', 'value': 100.0, 'ctype': "
457  "'double', 'type': 'double', 'name': 'scale_hundred'}]}",
459  //#line 262
460  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
461  __param_descriptions__.push_back(PidConfig::AbstractParamDescriptionConstPtr(
462  new PidConfig::ParamDescription<double>("Kp_scale", "double", 0, "Kp scale",
463  "{'enum_description': 'Scale factor for K setting', 'enum': "
464  "[{'srcline': 7, 'description': 'Scale by 0.1', 'srcfile': "
465  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
466  "'cconsttype': 'const double', 'value': 0.1, 'ctype': "
467  "'double', 'type': 'double', 'name': 'scale_tenth'}, "
468  "{'srcline': 8, 'description': 'No scaling', 'srcfile': "
469  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
470  "'cconsttype': 'const double', 'value': 1.0, 'ctype': "
471  "'double', 'type': 'double', 'name': 'scale_unity'}, "
472  "{'srcline': 9, 'description': 'Scale by 10', 'srcfile': "
473  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
474  "'cconsttype': 'const double', 'value': 10.0, 'ctype': "
475  "'double', 'type': 'double', 'name': 'scale_ten'}, {'srcline': "
476  "10, 'description': 'Scale by 100', 'srcfile': "
477  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
478  "'cconsttype': 'const double', 'value': 100.0, 'ctype': "
479  "'double', 'type': 'double', 'name': 'scale_hundred'}]}",
481  //#line 262
482  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
483  __min__.Kp = 0.0;
484  //#line 262
485  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
486  __max__.Kp = 1.0;
487  //#line 262
488  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
489  __default__.Kp = 0.1;
490  //#line 262
491  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
493  new PidConfig::ParamDescription<double>("Kp", "double", 0, "Kp", "", &PidConfig::Kp)));
494  //#line 262
495  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
496  __param_descriptions__.push_back(PidConfig::AbstractParamDescriptionConstPtr(
497  new PidConfig::ParamDescription<double>("Kp", "double", 0, "Kp", "", &PidConfig::Kp)));
498  //#line 262
499  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
500  __min__.Ki_scale = 0.1;
501  //#line 262
502  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
503  __max__.Ki_scale = 100.0;
504  //#line 262
505  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
506  __default__.Ki_scale = 10.0;
507  //#line 262
508  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
510  new PidConfig::ParamDescription<double>("Ki_scale", "double", 0, "Ki scale",
511  "{'enum_description': 'Scale factor for K setting', 'enum': "
512  "[{'srcline': 7, 'description': 'Scale by 0.1', 'srcfile': "
513  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
514  "'cconsttype': 'const double', 'value': 0.1, 'ctype': "
515  "'double', 'type': 'double', 'name': 'scale_tenth'}, "
516  "{'srcline': 8, 'description': 'No scaling', 'srcfile': "
517  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
518  "'cconsttype': 'const double', 'value': 1.0, 'ctype': "
519  "'double', 'type': 'double', 'name': 'scale_unity'}, "
520  "{'srcline': 9, 'description': 'Scale by 10', 'srcfile': "
521  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
522  "'cconsttype': 'const double', 'value': 10.0, 'ctype': "
523  "'double', 'type': 'double', 'name': 'scale_ten'}, {'srcline': "
524  "10, 'description': 'Scale by 100', 'srcfile': "
525  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
526  "'cconsttype': 'const double', 'value': 100.0, 'ctype': "
527  "'double', 'type': 'double', 'name': 'scale_hundred'}]}",
529  //#line 262
530  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
531  __param_descriptions__.push_back(PidConfig::AbstractParamDescriptionConstPtr(
532  new PidConfig::ParamDescription<double>("Ki_scale", "double", 0, "Ki scale",
533  "{'enum_description': 'Scale factor for K setting', 'enum': "
534  "[{'srcline': 7, 'description': 'Scale by 0.1', 'srcfile': "
535  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
536  "'cconsttype': 'const double', 'value': 0.1, 'ctype': "
537  "'double', 'type': 'double', 'name': 'scale_tenth'}, "
538  "{'srcline': 8, 'description': 'No scaling', 'srcfile': "
539  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
540  "'cconsttype': 'const double', 'value': 1.0, 'ctype': "
541  "'double', 'type': 'double', 'name': 'scale_unity'}, "
542  "{'srcline': 9, 'description': 'Scale by 10', 'srcfile': "
543  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
544  "'cconsttype': 'const double', 'value': 10.0, 'ctype': "
545  "'double', 'type': 'double', 'name': 'scale_ten'}, {'srcline': "
546  "10, 'description': 'Scale by 100', 'srcfile': "
547  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
548  "'cconsttype': 'const double', 'value': 100.0, 'ctype': "
549  "'double', 'type': 'double', 'name': 'scale_hundred'}]}",
551  //#line 262
552  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
553  __min__.Ki = 0.0;
554  //#line 262
555  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
556  __max__.Ki = 1.0;
557  //#line 262
558  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
559  __default__.Ki = 0.1;
560  //#line 262
561  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
563  new PidConfig::ParamDescription<double>("Ki", "double", 0, "Ki", "", &PidConfig::Ki)));
564  //#line 262
565  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
566  __param_descriptions__.push_back(PidConfig::AbstractParamDescriptionConstPtr(
567  new PidConfig::ParamDescription<double>("Ki", "double", 0, "Ki", "", &PidConfig::Ki)));
568  //#line 262
569  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
570  __min__.Kd_scale = 0.1;
571  //#line 262
572  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
573  __max__.Kd_scale = 100.0;
574  //#line 262
575  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
576  __default__.Kd_scale = 10.0;
577  //#line 262
578  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
580  new PidConfig::ParamDescription<double>("Kd_scale", "double", 0, "Kd scale",
581  "{'enum_description': 'Scale factor for K setting', 'enum': "
582  "[{'srcline': 7, 'description': 'Scale by 0.1', 'srcfile': "
583  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
584  "'cconsttype': 'const double', 'value': 0.1, 'ctype': "
585  "'double', 'type': 'double', 'name': 'scale_tenth'}, "
586  "{'srcline': 8, 'description': 'No scaling', 'srcfile': "
587  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
588  "'cconsttype': 'const double', 'value': 1.0, 'ctype': "
589  "'double', 'type': 'double', 'name': 'scale_unity'}, "
590  "{'srcline': 9, 'description': 'Scale by 10', 'srcfile': "
591  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
592  "'cconsttype': 'const double', 'value': 10.0, 'ctype': "
593  "'double', 'type': 'double', 'name': 'scale_ten'}, {'srcline': "
594  "10, 'description': 'Scale by 100', 'srcfile': "
595  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
596  "'cconsttype': 'const double', 'value': 100.0, 'ctype': "
597  "'double', 'type': 'double', 'name': 'scale_hundred'}]}",
599  //#line 262
600  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
601  __param_descriptions__.push_back(PidConfig::AbstractParamDescriptionConstPtr(
602  new PidConfig::ParamDescription<double>("Kd_scale", "double", 0, "Kd scale",
603  "{'enum_description': 'Scale factor for K setting', 'enum': "
604  "[{'srcline': 7, 'description': 'Scale by 0.1', 'srcfile': "
605  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
606  "'cconsttype': 'const double', 'value': 0.1, 'ctype': "
607  "'double', 'type': 'double', 'name': 'scale_tenth'}, "
608  "{'srcline': 8, 'description': 'No scaling', 'srcfile': "
609  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
610  "'cconsttype': 'const double', 'value': 1.0, 'ctype': "
611  "'double', 'type': 'double', 'name': 'scale_unity'}, "
612  "{'srcline': 9, 'description': 'Scale by 10', 'srcfile': "
613  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
614  "'cconsttype': 'const double', 'value': 10.0, 'ctype': "
615  "'double', 'type': 'double', 'name': 'scale_ten'}, {'srcline': "
616  "10, 'description': 'Scale by 100', 'srcfile': "
617  "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
618  "'cconsttype': 'const double', 'value': 100.0, 'ctype': "
619  "'double', 'type': 'double', 'name': 'scale_hundred'}]}",
621  //#line 262
622  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
623  __min__.Kd = 0.0;
624  //#line 262
625  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
626  __max__.Kd = 1.0;
627  //#line 262
628  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
629  __default__.Kd = 0.1;
630  //#line 262
631  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
633  new PidConfig::ParamDescription<double>("Kd", "double", 0, "Kd", "", &PidConfig::Kd)));
634  //#line 262
635  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
636  __param_descriptions__.push_back(PidConfig::AbstractParamDescriptionConstPtr(
637  new PidConfig::ParamDescription<double>("Kd", "double", 0, "Kd", "", &PidConfig::Kd)));
638  //#line 233
639  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
640  Default.convertParams();
641  //#line 233
642  //"/opt/ros/indigo/lib/python2.7/dist-packages/dynamic_reconfigure/parameter_generator_catkin.py"
643  __group_descriptions__.push_back(PidConfig::AbstractGroupDescriptionConstPtr(
645  //#line 353
646  //"/opt/ros/indigo/share/dynamic_reconfigure/cmake/../templates/ConfigType.h.template"
647 
648  for (std::vector<PidConfig::AbstractGroupDescriptionConstPtr>::const_iterator i = __group_descriptions__.begin();
649  i != __group_descriptions__.end(); ++i)
650  {
651  __description_message__.groups.push_back(**i);
652  }
653  __max__.__toMessage__(__description_message__.max, __param_descriptions__, __group_descriptions__);
654  __min__.__toMessage__(__description_message__.min, __param_descriptions__, __group_descriptions__);
655  __default__.__toMessage__(__description_message__.dflt, __param_descriptions__, __group_descriptions__);
656  }
657  std::vector<PidConfig::AbstractParamDescriptionConstPtr> __param_descriptions__;
658  std::vector<PidConfig::AbstractGroupDescriptionConstPtr> __group_descriptions__;
662  dynamic_reconfigure::ConfigDescription __description_message__;
663 
665  {
666  // Split this off in a separate function because I know that
667  // instance will get initialized the first time get_instance is
668  // called, and I am guaranteeing that get_instance gets called at
669  // most once.
670  static PidConfigStatics instance;
671  return &instance;
672  }
673 };
674 
675 inline const dynamic_reconfigure::ConfigDescription& PidConfig::__getDescriptionMessage__()
676 {
678 }
679 
681 {
682  return __get_statics__()->__default__;
683 }
684 
686 {
687  return __get_statics__()->__max__;
688 }
689 
691 {
692  return __get_statics__()->__min__;
693 }
694 
695 inline const std::vector<PidConfig::AbstractParamDescriptionConstPtr>& PidConfig::__getParamDescriptions__()
696 {
698 }
699 
700 inline const std::vector<PidConfig::AbstractGroupDescriptionConstPtr>& PidConfig::__getGroupDescriptions__()
701 {
703 }
704 
706 {
707  const static PidConfigStatics* statics;
708 
709  if (statics) // Common case
710  return statics;
711 
712  boost::mutex::scoped_lock lock(dynamic_reconfigure::__init_mutex__);
713 
714  if (statics) // In case we lost a race.
715  return statics;
716 
717  statics = PidConfigStatics::get_instance();
718 
719  return statics;
720 }
721 
722 //#line 7 "/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg"
723 const double Pid_scale_tenth = 0.1;
724 //#line 8 "/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg"
725 const double Pid_scale_unity = 1.0;
726 //#line 9 "/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg"
727 const double Pid_scale_ten = 10.0;
728 //#line 10 "/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg"
729 const double Pid_scale_hundred = 100.0;
730 }
731 
732 #endif // __PIDRECONFIGURATOR_H__
virtual void calcLevel(uint32_t &level, const PidConfig &config1, const PidConfig &config2) const =0
virtual void setInitialState(boost::any &cfg) const
Definition: PidConfig.h:163
void __toMessage__(dynamic_reconfigure::Config &msg) const
Definition: PidConfig.h:346
static const PidConfig & __getDefault__()
Definition: PidConfig.h:680
boost::shared_ptr< AbstractGroupDescription > AbstractGroupDescriptionPtr
Definition: PidConfig.h:128
f
void __toMessage__(dynamic_reconfigure::Config &msg, const std::vector< AbstractParamDescriptionConstPtr > &__param_descriptions__, const std::vector< AbstractGroupDescriptionConstPtr > &__group_descriptions__) const
Definition: PidConfig.h:327
static const std::vector< AbstractParamDescriptionConstPtr > & __getParamDescriptions__()
Definition: PidConfig.h:695
const double Pid_scale_hundred
Definition: PidConfig.h:729
static const PidConfigStatics * __get_statics__()
Definition: PidConfig.h:705
double state
Definition: autotune.cpp:65
virtual void toServer(const ros::NodeHandle &nh, const PidConfig &config) const =0
static const std::vector< AbstractGroupDescriptionConstPtr > & __getGroupDescriptions__()
Definition: PidConfig.h:700
const double Pid_scale_tenth
Definition: PidConfig.h:723
virtual void getValue(const PidConfig &config, boost::any &val) const =0
AbstractParamDescription(std::string n, std::string t, uint32_t l, std::string d, std::string e)
Definition: PidConfig.h:24
GroupDescription(std::string name, std::string type, int parent, int id, bool s, T PT::*f)
Definition: PidConfig.h:135
virtual bool fromMessage(const dynamic_reconfigure::Config &msg, boost::any &cfg) const
Definition: PidConfig.h:147
virtual void getValue(const PidConfig &config, boost::any &val) const
Definition: PidConfig.h:92
double Ki_scale
Definition: PidConfig.h:268
static const PidConfig & __getMin__()
Definition: PidConfig.h:690
virtual bool fromMessage(const dynamic_reconfigure::Config &msg, PidConfig &config) const =0
boost::shared_ptr< const AbstractParamDescription > AbstractParamDescriptionConstPtr
Definition: PidConfig.h:43
double Kd_scale
Definition: PidConfig.h:274
dynamic_reconfigure::ConfigDescription __description_message__
Definition: PidConfig.h:662
std::vector< PidConfig::AbstractParamDescriptionConstPtr > __param_descriptions__
Definition: PidConfig.h:657
PidConfig __default__
Definition: PidConfig.h:661
virtual bool fromMessage(const dynamic_reconfigure::Config &msg, PidConfig &config) const
Definition: PidConfig.h:82
void __clamp__()
Definition: PidConfig.h:383
void __toServer__(const ros::NodeHandle &nh) const
Definition: PidConfig.h:353
virtual void fromServer(const ros::NodeHandle &nh, PidConfig &config) const
Definition: PidConfig.h:72
AbstractGroupDescription(std::string n, std::string t, int p, int i, bool s)
Definition: PidConfig.h:101
virtual void toServer(const ros::NodeHandle &nh, const PidConfig &config) const
Definition: PidConfig.h:77
void setParams(PidConfig &config, const std::vector< AbstractParamDescriptionConstPtr > params)
Definition: PidConfig.h:214
static const PidConfigStatics * get_instance()
Definition: PidConfig.h:664
virtual void clamp(PidConfig &config, const PidConfig &max, const PidConfig &min) const
Definition: PidConfig.h:57
uint32_t __level__(const PidConfig &config) const
Definition: PidConfig.h:393
virtual void toMessage(dynamic_reconfigure::Config &msg, const PidConfig &config) const
Definition: PidConfig.h:87
const double Pid_scale_unity
Definition: PidConfig.h:725
static const PidConfig & __getMax__()
Definition: PidConfig.h:685
static const dynamic_reconfigure::ConfigDescription & __getDescriptionMessage__()
Definition: PidConfig.h:675
class pid::PidConfig::DEFAULT groups
int min(int a, int b)
bool getParam(const std::string &key, std::string &s) const
GroupDescription(const GroupDescription< T, PT > &g)
Definition: PidConfig.h:140
double Kp_scale
Definition: PidConfig.h:262
ParamDescription(std::string name, std::string type, uint32_t level, std::string description, std::string edit_method, T PidConfig::*f)
Definition: PidConfig.h:49
boost::shared_ptr< const AbstractGroupDescription > AbstractGroupDescriptionConstPtr
Definition: PidConfig.h:129
std::vector< AbstractParamDescriptionConstPtr > abstract_parameters
Definition: PidConfig.h:110
virtual void toMessage(dynamic_reconfigure::Config &msg, const PidConfig &config) const =0
void __fromServer__(const ros::NodeHandle &nh)
Definition: PidConfig.h:361
bool __fromMessage__(dynamic_reconfigure::Config &msg)
Definition: PidConfig.h:281
std::vector< PidConfig::AbstractGroupDescriptionConstPtr > groups
Definition: PidConfig.h:202
#define ROS_ERROR(...)
void setParam(const std::string &key, const XmlRpc::XmlRpcValue &v) const
virtual void toMessage(dynamic_reconfigure::Config &msg, const boost::any &cfg) const
Definition: PidConfig.h:190
virtual void updateParams(boost::any &cfg, PidConfig &top) const
Definition: PidConfig.h:176
boost::shared_ptr< AbstractParamDescription > AbstractParamDescriptionPtr
Definition: PidConfig.h:42
std::vector< PidConfig::AbstractGroupDescriptionConstPtr > __group_descriptions__
Definition: PidConfig.h:658
virtual void clamp(PidConfig &config, const PidConfig &max, const PidConfig &min) const =0
virtual void fromServer(const ros::NodeHandle &nh, PidConfig &config) const =0
Definition: PidConfig.h:14
virtual void calcLevel(uint32_t &comb_level, const PidConfig &config1, const PidConfig &config2) const
Definition: PidConfig.h:66
const double Pid_scale_ten
Definition: PidConfig.h:727


pid
Author(s): Andy Zelenak , Paul Bouchier
autogenerated on Mon Apr 15 2019 02:41:32