00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __pid__PIDCONFIG_H__
00012 #define __pid__PIDCONFIG_H__
00013
00014 namespace pid
00015 {
00016 class PidConfigStatics;
00017
00018 class PidConfig
00019 {
00020 public:
00021 class AbstractParamDescription : public dynamic_reconfigure::ParamDescription
00022 {
00023 public:
00024 AbstractParamDescription(std::string n, std::string t, uint32_t l, std::string d, std::string e)
00025 {
00026 name = n;
00027 type = t;
00028 level = l;
00029 description = d;
00030 edit_method = e;
00031 }
00032
00033 virtual void clamp(PidConfig& config, const PidConfig& max, const PidConfig& min) const = 0;
00034 virtual void calcLevel(uint32_t& level, const PidConfig& config1, const PidConfig& config2) const = 0;
00035 virtual void fromServer(const ros::NodeHandle& nh, PidConfig& config) const = 0;
00036 virtual void toServer(const ros::NodeHandle& nh, const PidConfig& config) const = 0;
00037 virtual bool fromMessage(const dynamic_reconfigure::Config& msg, PidConfig& config) const = 0;
00038 virtual void toMessage(dynamic_reconfigure::Config& msg, const PidConfig& config) const = 0;
00039 virtual void getValue(const PidConfig& config, boost::any& val) const = 0;
00040 };
00041
00042 typedef boost::shared_ptr<AbstractParamDescription> AbstractParamDescriptionPtr;
00043 typedef boost::shared_ptr<const AbstractParamDescription> AbstractParamDescriptionConstPtr;
00044
00045 template <class T>
00046 class ParamDescription : public AbstractParamDescription
00047 {
00048 public:
00049 ParamDescription(std::string name, std::string type, uint32_t level, std::string description,
00050 std::string edit_method, T PidConfig::*f)
00051 : AbstractParamDescription(name, type, level, description, edit_method), field(f)
00052 {
00053 }
00054
00055 T(PidConfig::*field);
00056
00057 virtual void clamp(PidConfig& config, const PidConfig& max, const PidConfig& min) const
00058 {
00059 if (config.*field > max.*field)
00060 config.*field = max.*field;
00061
00062 if (config.*field < min.*field)
00063 config.*field = min.*field;
00064 }
00065
00066 virtual void calcLevel(uint32_t& comb_level, const PidConfig& config1, const PidConfig& config2) const
00067 {
00068 if (config1.*field != config2.*field)
00069 comb_level |= level;
00070 }
00071
00072 virtual void fromServer(const ros::NodeHandle& nh, PidConfig& config) const
00073 {
00074 nh.getParam(name, config.*field);
00075 }
00076
00077 virtual void toServer(const ros::NodeHandle& nh, const PidConfig& config) const
00078 {
00079 nh.setParam(name, config.*field);
00080 }
00081
00082 virtual bool fromMessage(const dynamic_reconfigure::Config& msg, PidConfig& config) const
00083 {
00084 return dynamic_reconfigure::ConfigTools::getParameter(msg, name, config.*field);
00085 }
00086
00087 virtual void toMessage(dynamic_reconfigure::Config& msg, const PidConfig& config) const
00088 {
00089 dynamic_reconfigure::ConfigTools::appendParameter(msg, name, config.*field);
00090 }
00091
00092 virtual void getValue(const PidConfig& config, boost::any& val) const
00093 {
00094 val = config.*field;
00095 }
00096 };
00097
00098 class AbstractGroupDescription : public dynamic_reconfigure::Group
00099 {
00100 public:
00101 AbstractGroupDescription(std::string n, std::string t, int p, int i, bool s)
00102 {
00103 name = n;
00104 type = t;
00105 parent = p;
00106 state = s;
00107 id = i;
00108 }
00109
00110 std::vector<AbstractParamDescriptionConstPtr> abstract_parameters;
00111 bool state;
00112
00113 virtual void toMessage(dynamic_reconfigure::Config& msg, const boost::any& config) const = 0;
00114 virtual bool fromMessage(const dynamic_reconfigure::Config& msg, boost::any& config) const = 0;
00115 virtual void updateParams(boost::any& cfg, PidConfig& top) const = 0;
00116 virtual void setInitialState(boost::any& cfg) const = 0;
00117
00118 void convertParams()
00119 {
00120 for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = abstract_parameters.begin();
00121 i != abstract_parameters.end(); ++i)
00122 {
00123 parameters.push_back(dynamic_reconfigure::ParamDescription(**i));
00124 }
00125 }
00126 };
00127
00128 typedef boost::shared_ptr<AbstractGroupDescription> AbstractGroupDescriptionPtr;
00129 typedef boost::shared_ptr<const AbstractGroupDescription> AbstractGroupDescriptionConstPtr;
00130
00131 template <class T, class PT>
00132 class GroupDescription : public AbstractGroupDescription
00133 {
00134 public:
00135 GroupDescription(std::string name, std::string type, int parent, int id, bool s, T PT::*f)
00136 : AbstractGroupDescription(name, type, parent, id, s), field(f)
00137 {
00138 }
00139
00140 GroupDescription(const GroupDescription<T, PT>& g)
00141 : AbstractGroupDescription(g.name, g.type, g.parent, g.id, g.state), field(g.field), groups(g.groups)
00142 {
00143 parameters = g.parameters;
00144 abstract_parameters = g.abstract_parameters;
00145 }
00146
00147 virtual bool fromMessage(const dynamic_reconfigure::Config& msg, boost::any& cfg) const
00148 {
00149 PT* config = boost::any_cast<PT*>(cfg);
00150 if (!dynamic_reconfigure::ConfigTools::getGroupState(msg, name, (*config).*field))
00151 return false;
00152
00153 for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = groups.begin(); i != groups.end(); ++i)
00154 {
00155 boost::any n = &((*config).*field);
00156 if (!(*i)->fromMessage(msg, n))
00157 return false;
00158 }
00159
00160 return true;
00161 }
00162
00163 virtual void setInitialState(boost::any& cfg) const
00164 {
00165 PT* config = boost::any_cast<PT*>(cfg);
00166 T* group = &((*config).*field);
00167 group->state = state;
00168
00169 for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = groups.begin(); i != groups.end(); ++i)
00170 {
00171 boost::any n = boost::any(&((*config).*field));
00172 (*i)->setInitialState(n);
00173 }
00174 }
00175
00176 virtual void updateParams(boost::any& cfg, PidConfig& top) const
00177 {
00178 PT* config = boost::any_cast<PT*>(cfg);
00179
00180 T* f = &((*config).*field);
00181 f->setParams(top, abstract_parameters);
00182
00183 for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = groups.begin(); i != groups.end(); ++i)
00184 {
00185 boost::any n = &((*config).*field);
00186 (*i)->updateParams(n, top);
00187 }
00188 }
00189
00190 virtual void toMessage(dynamic_reconfigure::Config& msg, const boost::any& cfg) const
00191 {
00192 const PT config = boost::any_cast<PT>(cfg);
00193 dynamic_reconfigure::ConfigTools::appendGroup<T>(msg, name, id, parent, config.*field);
00194
00195 for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = groups.begin(); i != groups.end(); ++i)
00196 {
00197 (*i)->toMessage(msg, config.*field);
00198 }
00199 }
00200
00201 T(PT::*field);
00202 std::vector<PidConfig::AbstractGroupDescriptionConstPtr> groups;
00203 };
00204
00205 class DEFAULT
00206 {
00207 public:
00208 DEFAULT()
00209 {
00210 state = true;
00211 name = "Default";
00212 }
00213
00214 void setParams(PidConfig& config, const std::vector<AbstractParamDescriptionConstPtr> params)
00215 {
00216 for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator _i = params.begin(); _i != params.end(); ++_i)
00217 {
00218 boost::any val;
00219 (*_i)->getValue(config, val);
00220
00221 if ("Kp_scale" == (*_i)->name)
00222 {
00223 Kp_scale = boost::any_cast<double>(val);
00224 }
00225 if ("Kp" == (*_i)->name)
00226 {
00227 Kp = boost::any_cast<double>(val);
00228 }
00229 if ("Ki_scale" == (*_i)->name)
00230 {
00231 Ki_scale = boost::any_cast<double>(val);
00232 }
00233 if ("Ki" == (*_i)->name)
00234 {
00235 Ki = boost::any_cast<double>(val);
00236 }
00237 if ("Kd_scale" == (*_i)->name)
00238 {
00239 Kd_scale = boost::any_cast<double>(val);
00240 }
00241 if ("Kd" == (*_i)->name)
00242 {
00243 Kd = boost::any_cast<double>(val);
00244 }
00245 }
00246 }
00247
00248 double Kp_scale;
00249 double Kp;
00250 double Ki_scale;
00251 double Ki;
00252 double Kd_scale;
00253 double Kd;
00254
00255 bool state;
00256 std::string name;
00257
00258 } groups;
00259
00260
00261
00262 double Kp_scale;
00263
00264
00265 double Kp;
00266
00267
00268 double Ki_scale;
00269
00270
00271 double Ki;
00272
00273
00274 double Kd_scale;
00275
00276
00277 double Kd;
00278
00279
00280
00281 bool __fromMessage__(dynamic_reconfigure::Config& msg)
00282 {
00283 const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__ = __getParamDescriptions__();
00284 const std::vector<AbstractGroupDescriptionConstPtr>& __group_descriptions__ = __getGroupDescriptions__();
00285
00286 int count = 0;
00287 for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = __param_descriptions__.begin();
00288 i != __param_descriptions__.end(); ++i)
00289 if ((*i)->fromMessage(msg, *this))
00290 count++;
00291
00292 for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = __group_descriptions__.begin();
00293 i != __group_descriptions__.end(); i++)
00294 {
00295 if ((*i)->id == 0)
00296 {
00297 boost::any n = boost::any(this);
00298 (*i)->updateParams(n, *this);
00299 (*i)->fromMessage(msg, n);
00300 }
00301 }
00302
00303 if (count != dynamic_reconfigure::ConfigTools::size(msg))
00304 {
00305 ROS_ERROR("PidConfig::__fromMessage__ called with an unexpected parameter.");
00306 ROS_ERROR("Booleans:");
00307 for (unsigned int i = 0; i < msg.bools.size(); i++)
00308 ROS_ERROR(" %s", msg.bools[i].name.c_str());
00309 ROS_ERROR("Integers:");
00310 for (unsigned int i = 0; i < msg.ints.size(); i++)
00311 ROS_ERROR(" %s", msg.ints[i].name.c_str());
00312 ROS_ERROR("Doubles:");
00313 for (unsigned int i = 0; i < msg.doubles.size(); i++)
00314 ROS_ERROR(" %s", msg.doubles[i].name.c_str());
00315 ROS_ERROR("Strings:");
00316 for (unsigned int i = 0; i < msg.strs.size(); i++)
00317 ROS_ERROR(" %s", msg.strs[i].name.c_str());
00318
00319
00320 return false;
00321 }
00322 return true;
00323 }
00324
00325
00326
00327 void __toMessage__(dynamic_reconfigure::Config& msg,
00328 const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__,
00329 const std::vector<AbstractGroupDescriptionConstPtr>& __group_descriptions__) const
00330 {
00331 dynamic_reconfigure::ConfigTools::clear(msg);
00332 for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = __param_descriptions__.begin();
00333 i != __param_descriptions__.end(); ++i)
00334 (*i)->toMessage(msg, *this);
00335
00336 for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = __group_descriptions__.begin();
00337 i != __group_descriptions__.end(); ++i)
00338 {
00339 if ((*i)->id == 0)
00340 {
00341 (*i)->toMessage(msg, *this);
00342 }
00343 }
00344 }
00345
00346 void __toMessage__(dynamic_reconfigure::Config& msg) const
00347 {
00348 const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__ = __getParamDescriptions__();
00349 const std::vector<AbstractGroupDescriptionConstPtr>& __group_descriptions__ = __getGroupDescriptions__();
00350 __toMessage__(msg, __param_descriptions__, __group_descriptions__);
00351 }
00352
00353 void __toServer__(const ros::NodeHandle& nh) const
00354 {
00355 const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__ = __getParamDescriptions__();
00356 for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = __param_descriptions__.begin();
00357 i != __param_descriptions__.end(); ++i)
00358 (*i)->toServer(nh, *this);
00359 }
00360
00361 void __fromServer__(const ros::NodeHandle& nh)
00362 {
00363 static bool setup = false;
00364
00365 const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__ = __getParamDescriptions__();
00366 for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = __param_descriptions__.begin();
00367 i != __param_descriptions__.end(); ++i)
00368 (*i)->fromServer(nh, *this);
00369
00370 const std::vector<AbstractGroupDescriptionConstPtr>& __group_descriptions__ = __getGroupDescriptions__();
00371 for (std::vector<AbstractGroupDescriptionConstPtr>::const_iterator i = __group_descriptions__.begin();
00372 i != __group_descriptions__.end(); i++)
00373 {
00374 if (!setup && (*i)->id == 0)
00375 {
00376 setup = true;
00377 boost::any n = boost::any(this);
00378 (*i)->setInitialState(n);
00379 }
00380 }
00381 }
00382
00383 void __clamp__()
00384 {
00385 const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__ = __getParamDescriptions__();
00386 const PidConfig& __max__ = __getMax__();
00387 const PidConfig& __min__ = __getMin__();
00388 for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = __param_descriptions__.begin();
00389 i != __param_descriptions__.end(); ++i)
00390 (*i)->clamp(*this, __max__, __min__);
00391 }
00392
00393 uint32_t __level__(const PidConfig& config) const
00394 {
00395 const std::vector<AbstractParamDescriptionConstPtr>& __param_descriptions__ = __getParamDescriptions__();
00396 uint32_t level = 0;
00397 for (std::vector<AbstractParamDescriptionConstPtr>::const_iterator i = __param_descriptions__.begin();
00398 i != __param_descriptions__.end(); ++i)
00399 (*i)->calcLevel(level, config, *this);
00400 return level;
00401 }
00402
00403 static const dynamic_reconfigure::ConfigDescription& __getDescriptionMessage__();
00404 static const PidConfig& __getDefault__();
00405 static const PidConfig& __getMax__();
00406 static const PidConfig& __getMin__();
00407 static const std::vector<AbstractParamDescriptionConstPtr>& __getParamDescriptions__();
00408 static const std::vector<AbstractGroupDescriptionConstPtr>& __getGroupDescriptions__();
00409
00410 private:
00411 static const PidConfigStatics* __get_statics__();
00412 };
00413
00414 template <>
00415 inline void PidConfig::ParamDescription<std::string>::clamp(PidConfig& config, const PidConfig& max,
00416 const PidConfig& min) const
00417 {
00418 return;
00419 }
00420
00421 class PidConfigStatics
00422 {
00423 friend class PidConfig;
00424
00425 PidConfigStatics()
00426 {
00427 PidConfig::GroupDescription<PidConfig::DEFAULT, PidConfig> Default("Default", "", 0, 0, true, &PidConfig::groups);
00428
00429
00430 __min__.Kp_scale = 0.1;
00431
00432
00433 __max__.Kp_scale = 100.0;
00434
00435
00436 __default__.Kp_scale = 10.0;
00437
00438
00439 Default.abstract_parameters.push_back(PidConfig::AbstractParamDescriptionConstPtr(
00440 new PidConfig::ParamDescription<double>("Kp_scale", "double", 0, "Kp scale",
00441 "{'enum_description': 'Scale factor for K setting', 'enum': "
00442 "[{'srcline': 7, 'description': 'Scale by 0.1', 'srcfile': "
00443 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00444 "'cconsttype': 'const double', 'value': 0.1, 'ctype': "
00445 "'double', 'type': 'double', 'name': 'scale_tenth'}, "
00446 "{'srcline': 8, 'description': 'No scaling', 'srcfile': "
00447 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00448 "'cconsttype': 'const double', 'value': 1.0, 'ctype': "
00449 "'double', 'type': 'double', 'name': 'scale_unity'}, "
00450 "{'srcline': 9, 'description': 'Scale by 10', 'srcfile': "
00451 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00452 "'cconsttype': 'const double', 'value': 10.0, 'ctype': "
00453 "'double', 'type': 'double', 'name': 'scale_ten'}, {'srcline': "
00454 "10, 'description': 'Scale by 100', 'srcfile': "
00455 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00456 "'cconsttype': 'const double', 'value': 100.0, 'ctype': "
00457 "'double', 'type': 'double', 'name': 'scale_hundred'}]}",
00458 &PidConfig::Kp_scale)));
00459
00460
00461 __param_descriptions__.push_back(PidConfig::AbstractParamDescriptionConstPtr(
00462 new PidConfig::ParamDescription<double>("Kp_scale", "double", 0, "Kp scale",
00463 "{'enum_description': 'Scale factor for K setting', 'enum': "
00464 "[{'srcline': 7, 'description': 'Scale by 0.1', 'srcfile': "
00465 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00466 "'cconsttype': 'const double', 'value': 0.1, 'ctype': "
00467 "'double', 'type': 'double', 'name': 'scale_tenth'}, "
00468 "{'srcline': 8, 'description': 'No scaling', 'srcfile': "
00469 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00470 "'cconsttype': 'const double', 'value': 1.0, 'ctype': "
00471 "'double', 'type': 'double', 'name': 'scale_unity'}, "
00472 "{'srcline': 9, 'description': 'Scale by 10', 'srcfile': "
00473 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00474 "'cconsttype': 'const double', 'value': 10.0, 'ctype': "
00475 "'double', 'type': 'double', 'name': 'scale_ten'}, {'srcline': "
00476 "10, 'description': 'Scale by 100', 'srcfile': "
00477 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00478 "'cconsttype': 'const double', 'value': 100.0, 'ctype': "
00479 "'double', 'type': 'double', 'name': 'scale_hundred'}]}",
00480 &PidConfig::Kp_scale)));
00481
00482
00483 __min__.Kp = 0.0;
00484
00485
00486 __max__.Kp = 1.0;
00487
00488
00489 __default__.Kp = 0.1;
00490
00491
00492 Default.abstract_parameters.push_back(PidConfig::AbstractParamDescriptionConstPtr(
00493 new PidConfig::ParamDescription<double>("Kp", "double", 0, "Kp", "", &PidConfig::Kp)));
00494
00495
00496 __param_descriptions__.push_back(PidConfig::AbstractParamDescriptionConstPtr(
00497 new PidConfig::ParamDescription<double>("Kp", "double", 0, "Kp", "", &PidConfig::Kp)));
00498
00499
00500 __min__.Ki_scale = 0.1;
00501
00502
00503 __max__.Ki_scale = 100.0;
00504
00505
00506 __default__.Ki_scale = 10.0;
00507
00508
00509 Default.abstract_parameters.push_back(PidConfig::AbstractParamDescriptionConstPtr(
00510 new PidConfig::ParamDescription<double>("Ki_scale", "double", 0, "Ki scale",
00511 "{'enum_description': 'Scale factor for K setting', 'enum': "
00512 "[{'srcline': 7, 'description': 'Scale by 0.1', 'srcfile': "
00513 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00514 "'cconsttype': 'const double', 'value': 0.1, 'ctype': "
00515 "'double', 'type': 'double', 'name': 'scale_tenth'}, "
00516 "{'srcline': 8, 'description': 'No scaling', 'srcfile': "
00517 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00518 "'cconsttype': 'const double', 'value': 1.0, 'ctype': "
00519 "'double', 'type': 'double', 'name': 'scale_unity'}, "
00520 "{'srcline': 9, 'description': 'Scale by 10', 'srcfile': "
00521 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00522 "'cconsttype': 'const double', 'value': 10.0, 'ctype': "
00523 "'double', 'type': 'double', 'name': 'scale_ten'}, {'srcline': "
00524 "10, 'description': 'Scale by 100', 'srcfile': "
00525 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00526 "'cconsttype': 'const double', 'value': 100.0, 'ctype': "
00527 "'double', 'type': 'double', 'name': 'scale_hundred'}]}",
00528 &PidConfig::Ki_scale)));
00529
00530
00531 __param_descriptions__.push_back(PidConfig::AbstractParamDescriptionConstPtr(
00532 new PidConfig::ParamDescription<double>("Ki_scale", "double", 0, "Ki scale",
00533 "{'enum_description': 'Scale factor for K setting', 'enum': "
00534 "[{'srcline': 7, 'description': 'Scale by 0.1', 'srcfile': "
00535 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00536 "'cconsttype': 'const double', 'value': 0.1, 'ctype': "
00537 "'double', 'type': 'double', 'name': 'scale_tenth'}, "
00538 "{'srcline': 8, 'description': 'No scaling', 'srcfile': "
00539 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00540 "'cconsttype': 'const double', 'value': 1.0, 'ctype': "
00541 "'double', 'type': 'double', 'name': 'scale_unity'}, "
00542 "{'srcline': 9, 'description': 'Scale by 10', 'srcfile': "
00543 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00544 "'cconsttype': 'const double', 'value': 10.0, 'ctype': "
00545 "'double', 'type': 'double', 'name': 'scale_ten'}, {'srcline': "
00546 "10, 'description': 'Scale by 100', 'srcfile': "
00547 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00548 "'cconsttype': 'const double', 'value': 100.0, 'ctype': "
00549 "'double', 'type': 'double', 'name': 'scale_hundred'}]}",
00550 &PidConfig::Ki_scale)));
00551
00552
00553 __min__.Ki = 0.0;
00554
00555
00556 __max__.Ki = 1.0;
00557
00558
00559 __default__.Ki = 0.1;
00560
00561
00562 Default.abstract_parameters.push_back(PidConfig::AbstractParamDescriptionConstPtr(
00563 new PidConfig::ParamDescription<double>("Ki", "double", 0, "Ki", "", &PidConfig::Ki)));
00564
00565
00566 __param_descriptions__.push_back(PidConfig::AbstractParamDescriptionConstPtr(
00567 new PidConfig::ParamDescription<double>("Ki", "double", 0, "Ki", "", &PidConfig::Ki)));
00568
00569
00570 __min__.Kd_scale = 0.1;
00571
00572
00573 __max__.Kd_scale = 100.0;
00574
00575
00576 __default__.Kd_scale = 10.0;
00577
00578
00579 Default.abstract_parameters.push_back(PidConfig::AbstractParamDescriptionConstPtr(
00580 new PidConfig::ParamDescription<double>("Kd_scale", "double", 0, "Kd scale",
00581 "{'enum_description': 'Scale factor for K setting', 'enum': "
00582 "[{'srcline': 7, 'description': 'Scale by 0.1', 'srcfile': "
00583 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00584 "'cconsttype': 'const double', 'value': 0.1, 'ctype': "
00585 "'double', 'type': 'double', 'name': 'scale_tenth'}, "
00586 "{'srcline': 8, 'description': 'No scaling', 'srcfile': "
00587 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00588 "'cconsttype': 'const double', 'value': 1.0, 'ctype': "
00589 "'double', 'type': 'double', 'name': 'scale_unity'}, "
00590 "{'srcline': 9, 'description': 'Scale by 10', 'srcfile': "
00591 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00592 "'cconsttype': 'const double', 'value': 10.0, 'ctype': "
00593 "'double', 'type': 'double', 'name': 'scale_ten'}, {'srcline': "
00594 "10, 'description': 'Scale by 100', 'srcfile': "
00595 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00596 "'cconsttype': 'const double', 'value': 100.0, 'ctype': "
00597 "'double', 'type': 'double', 'name': 'scale_hundred'}]}",
00598 &PidConfig::Kd_scale)));
00599
00600
00601 __param_descriptions__.push_back(PidConfig::AbstractParamDescriptionConstPtr(
00602 new PidConfig::ParamDescription<double>("Kd_scale", "double", 0, "Kd scale",
00603 "{'enum_description': 'Scale factor for K setting', 'enum': "
00604 "[{'srcline': 7, 'description': 'Scale by 0.1', 'srcfile': "
00605 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00606 "'cconsttype': 'const double', 'value': 0.1, 'ctype': "
00607 "'double', 'type': 'double', 'name': 'scale_tenth'}, "
00608 "{'srcline': 8, 'description': 'No scaling', 'srcfile': "
00609 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00610 "'cconsttype': 'const double', 'value': 1.0, 'ctype': "
00611 "'double', 'type': 'double', 'name': 'scale_unity'}, "
00612 "{'srcline': 9, 'description': 'Scale by 10', 'srcfile': "
00613 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00614 "'cconsttype': 'const double', 'value': 10.0, 'ctype': "
00615 "'double', 'type': 'double', 'name': 'scale_ten'}, {'srcline': "
00616 "10, 'description': 'Scale by 100', 'srcfile': "
00617 "'/home/andy/Desktop/catkin_ws/src/pid/cfg/Pid.cfg', "
00618 "'cconsttype': 'const double', 'value': 100.0, 'ctype': "
00619 "'double', 'type': 'double', 'name': 'scale_hundred'}]}",
00620 &PidConfig::Kd_scale)));
00621
00622
00623 __min__.Kd = 0.0;
00624
00625
00626 __max__.Kd = 1.0;
00627
00628
00629 __default__.Kd = 0.1;
00630
00631
00632 Default.abstract_parameters.push_back(PidConfig::AbstractParamDescriptionConstPtr(
00633 new PidConfig::ParamDescription<double>("Kd", "double", 0, "Kd", "", &PidConfig::Kd)));
00634
00635
00636 __param_descriptions__.push_back(PidConfig::AbstractParamDescriptionConstPtr(
00637 new PidConfig::ParamDescription<double>("Kd", "double", 0, "Kd", "", &PidConfig::Kd)));
00638
00639
00640 Default.convertParams();
00641
00642
00643 __group_descriptions__.push_back(PidConfig::AbstractGroupDescriptionConstPtr(
00644 new PidConfig::GroupDescription<PidConfig::DEFAULT, PidConfig>(Default)));
00645
00646
00647
00648 for (std::vector<PidConfig::AbstractGroupDescriptionConstPtr>::const_iterator i = __group_descriptions__.begin();
00649 i != __group_descriptions__.end(); ++i)
00650 {
00651 __description_message__.groups.push_back(**i);
00652 }
00653 __max__.__toMessage__(__description_message__.max, __param_descriptions__, __group_descriptions__);
00654 __min__.__toMessage__(__description_message__.min, __param_descriptions__, __group_descriptions__);
00655 __default__.__toMessage__(__description_message__.dflt, __param_descriptions__, __group_descriptions__);
00656 }
00657 std::vector<PidConfig::AbstractParamDescriptionConstPtr> __param_descriptions__;
00658 std::vector<PidConfig::AbstractGroupDescriptionConstPtr> __group_descriptions__;
00659 PidConfig __max__;
00660 PidConfig __min__;
00661 PidConfig __default__;
00662 dynamic_reconfigure::ConfigDescription __description_message__;
00663
00664 static const PidConfigStatics* get_instance()
00665 {
00666
00667
00668
00669
00670 static PidConfigStatics instance;
00671 return &instance;
00672 }
00673 };
00674
00675 inline const dynamic_reconfigure::ConfigDescription& PidConfig::__getDescriptionMessage__()
00676 {
00677 return __get_statics__()->__description_message__;
00678 }
00679
00680 inline const PidConfig& PidConfig::__getDefault__()
00681 {
00682 return __get_statics__()->__default__;
00683 }
00684
00685 inline const PidConfig& PidConfig::__getMax__()
00686 {
00687 return __get_statics__()->__max__;
00688 }
00689
00690 inline const PidConfig& PidConfig::__getMin__()
00691 {
00692 return __get_statics__()->__min__;
00693 }
00694
00695 inline const std::vector<PidConfig::AbstractParamDescriptionConstPtr>& PidConfig::__getParamDescriptions__()
00696 {
00697 return __get_statics__()->__param_descriptions__;
00698 }
00699
00700 inline const std::vector<PidConfig::AbstractGroupDescriptionConstPtr>& PidConfig::__getGroupDescriptions__()
00701 {
00702 return __get_statics__()->__group_descriptions__;
00703 }
00704
00705 inline const PidConfigStatics* PidConfig::__get_statics__()
00706 {
00707 const static PidConfigStatics* statics;
00708
00709 if (statics)
00710 return statics;
00711
00712 boost::mutex::scoped_lock lock(dynamic_reconfigure::__init_mutex__);
00713
00714 if (statics)
00715 return statics;
00716
00717 statics = PidConfigStatics::get_instance();
00718
00719 return statics;
00720 }
00721
00722
00723 const double Pid_scale_tenth = 0.1;
00724
00725 const double Pid_scale_unity = 1.0;
00726
00727 const double Pid_scale_ten = 10.0;
00728
00729 const double Pid_scale_hundred = 100.0;
00730 }
00731
00732 #endif // __PIDRECONFIGURATOR_H__