iCub-main
eomcParser.h
Go to the documentation of this file.
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 
4 /* Copyright (C) 2012 iCub Facility, Istituto Italiano di Tecnologia
5  * Author: Valentina Gaggero
6  * email: valentina.gaggero@iit.it
7  * Permission is granted to copy, distribute, and/or modify this program
8  * under the terms of the GNU General Public License, version 2 or any
9  * later version published by the Free Software Foundation.
10  *
11  * A copy of the license can be found at
12  * http://www.robotcub.org/icub/license/gpl.txt
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17  * Public License for more details
18  */
19 
20 #ifndef __mcParserh__
21 #define __mcParserh__
22 
23 
24 
25 #include <string>
26 #include <vector>
27 #include <array>
28 #include <map>
29 #include <memory>
30 
31 // Yarp stuff
32 #include <yarp/os/Bottle.h>
33 //#include <yarp/os/Time.h>
34 #include <yarp/os/Bottle.h>
35 #include <yarp/dev/ControlBoardPid.h>
36 #include <yarp/dev/ControlBoardHelper.h>
37 
38 #include <yarp/dev/PidEnums.h>
39 #include <yarp/dev/ControlBoardInterfacesImpl.h>
40 
41 #include "EoMotionControl.h"
42 #include <yarp/os/LogStream.h>
43 
44 
45 // - public #define --------------------------------------------------------------------------------------------------
46 
47 
48 namespace yarp {
49  namespace dev {
50  namespace eomc {
51 
52 
53 //typedef enum
54 //{
55 // PidAlgo_simple = 0,
56 // PIdAlgo_velocityInnerLoop = 1,
57 // PidAlgo_currentInnerLoop =2
58 //} PidAlgorithmType_t;
59 
60 typedef enum
61 {
66 
68 {
69 
70 public:
71 
72  virtual double convertTempCelsiusToRaw(const double temperature) = 0;
73 
74  virtual double convertRawToTempCelsius(const double temperature) = 0;
75 
77 };
78 
80 {
81 private:
82  // resistors of the voltage divider bridge
83  int _r_1;
84  int _r_2;
85  int _r_3;
86 
87 
88  double _ptc_offset; // offset of the temperature sensor line
89  double _ptc_gradient; // slope/gradient of the temperature sensor line
90  double _pga_gain; // ADC gain set for the tdb (temperature detection board)
91 
92  int _vcc; // vcc that enters the voltage divider bridge
93  double _resolution_pga; // resolution of the internal pga of the tdb
94  double _resolution_tdb; // resolution used for the raw value for the output of the tdb
95 
96  double _half_bridge_resistor_coeff;
97  double _first_res_coeff;
98  double _second_res_coeff;
99 
100 public:
101 
103  {
104  _r_1 = 4700;
105  _r_2 = 4700;
106  _r_3 = 100;
107 
108  _ptc_offset = 100.0;
109  _ptc_gradient = 0.3851;
110  _pga_gain = 2;
111  _vcc = 5;
112  _resolution_pga = 2.048;
113  _resolution_tdb = 32767;
114 
115  // define here and calculate when the class object is built to speed up calculations
116  // since the value does not change in the sensor type class object
117  _half_bridge_resistor_coeff = (double)_r_3 / (double)(_r_2 + _r_3);
118  _first_res_coeff = _r_1*_r_2 + _r_1*_r_3 + _ptc_offset*_r_2 + _ptc_offset*_r_3;
119  _second_res_coeff = _r_3*_r_1 - _r_2*_ptc_offset;
120  }
121 
122  TemperatureSensorPT100(const TemperatureSensorPT100& other) = default; // const copy constructor
123  TemperatureSensorPT100& operator=(const TemperatureSensorPT100& other) = default; // const copy assignment operator
124  TemperatureSensorPT100(TemperatureSensorPT100&& other) = default; // move constructor
125  TemperatureSensorPT100& operator=(TemperatureSensorPT100&& other) = default; // move assignment operator
126 
127  ~TemperatureSensorPT100() = default; // destructor
128 
129  virtual double convertTempCelsiusToRaw(const double temperature) override
130  {
131  double res = 0;
132 
133  double tmp = (( (_ptc_offset + _ptc_gradient * temperature) / ((double)_r_1 + (_ptc_offset + _ptc_gradient * temperature))) - _half_bridge_resistor_coeff) * (double)_vcc;
134  res = (_resolution_tdb + 1) * ((_pga_gain * tmp) / _resolution_pga);
135 
136  yDebug("Converted temperature limit to raw value:%f", res);
137  return res;
138  }
139 
140  virtual double convertRawToTempCelsius(const double temperature) override
141  {
142  double res = 0;
143 
144  double tmp = temperature * ((_resolution_pga) / (_pga_gain * _vcc * (_resolution_tdb + 1)));
145  double den = _ptc_gradient * (_r_2 - _r_2*tmp - _r_3*tmp);
146 
147  res = (tmp * (_first_res_coeff) / den) + ((_second_res_coeff) / den);
148 
149  return res;
150  }
151 
154 };
155 
156 
158 {
159 
160 private:
161  // resistors of the voltage divider bridge
162  int _r_1;
163  int _r_2;
164  int _r_3;
165 
166  double _ptc_offset; // offset of the temperature sensor line
167  double _ptc_gradient; // slope/gradient of the temperature sensor line
168  double _pga_gain; // ADC gain set for the tdb (temperature detection board)
169 
170  int _vcc; // vcc that enters the voltage divider bridge
171  double _resolution_pga; // resolution of the internal pga of the tdb
172  double _resolution_tdb; // resolution used for the raw value for the output of the tdb
173 
174  // define here and calculate when the class object is built to speed up calculations
175  // since the value does not change in the sensor type class object
176  double _half_bridge_resistor_coeff;
177  double _first_res_coeff;
178  double _second_res_coeff;
179 
180 public:
181 
183  {
184  _r_1 = 4700;
185  _r_2 = 4700;
186  _r_3 = 1000;
187 
188  _ptc_offset = 1000;
189  _ptc_gradient = 3.851;
190  _pga_gain = 2;
191  _vcc = 5;
192  _resolution_pga = 2.048;
193  _resolution_tdb = 32767;
194 
195  _half_bridge_resistor_coeff = (double)_r_3 / (double)(_r_2 + _r_3);
196 
197  _first_res_coeff = _r_1*_r_2 + _r_1*_r_3 + _ptc_offset*_r_2 + _ptc_offset*_r_3;
198  _second_res_coeff = _r_3*_r_1 - _r_2*_ptc_offset;
199  }
200 
201  TemperatureSensorPT1000(const TemperatureSensorPT1000& other) = default; // const copy constructor
202  TemperatureSensorPT1000& operator=(const TemperatureSensorPT1000& other) = default; // const copy assignment operator
203  TemperatureSensorPT1000(TemperatureSensorPT1000&& other) = default; // move constructor
204  TemperatureSensorPT1000& operator=(TemperatureSensorPT1000&& other) = default; // move assignment operator
205 
206  ~TemperatureSensorPT1000() = default; // destructor
207 
208  virtual double convertTempCelsiusToRaw(const double temperature) override
209  {
210  double res = 0;
211 
212  double tmp = (( (_ptc_offset + _ptc_gradient * temperature) / ((double)_r_1 + (_ptc_offset + _ptc_gradient * temperature))) - _half_bridge_resistor_coeff) * (double)_vcc;
213  res = (_resolution_tdb + 1) * ((_pga_gain * tmp) / _resolution_pga);
214 
215  yDebug("Converted temperature limit to raw value:%f", res);
216  return res;
217  }
218 
219  virtual double convertRawToTempCelsius(const double temperature) override
220  {
221  double res = 0;
222 
223  double tmp = temperature * ((_resolution_pga) / (_pga_gain * _vcc * (_resolution_tdb + 1)));
224  double den = _ptc_gradient * (_r_2 - _r_2*tmp - _r_3*tmp);
225 
226  res = (tmp * (_first_res_coeff) / den) + ((_second_res_coeff) / den);
227 
228  return res;
229  }
230 
233 };
234 
235 
237 {
238 
239 public:
240 
242  {
243  yInfo("Private varibales NOT DEFINED for class TemperatureSensorNONE");
244  }
245 
247 
248  virtual double convertTempCelsiusToRaw(const double temperature) override
249  {
250  yInfo("convertTempCelsiusToRaw METHOD, NOT IMPLEMENTED for class TemperatureSensorNONE");
251  return 0;
252  }
253 
254  virtual double convertRawToTempCelsius(const double temperature) override
255  {
256  return 0;
257  }
258 
261 };
262 
263 
265 {
266 public:
267  //PidAlgorithmType_t type;
268 
269  yarp::dev::PidFeedbackUnitsEnum fbk_PidUnits;
270  yarp::dev::PidOutputUnitsEnum out_PidUnits;
271  eOmc_ctrl_out_type_t out_type;
272 
273  virtual ~Pid_Algorithm(){}
274 
275  eOmc_ctrl_out_type_t getOutputType() { return out_type; }
276 
277  void setUnits(yarp::dev::PidFeedbackUnitsEnum fu, yarp::dev::PidOutputUnitsEnum ou)
278  {
279  fbk_PidUnits = fu;
280  out_PidUnits = ou;
281  }
282 
283  virtual yarp::dev::Pid getPID(int joint) = 0;
284 };
285 
286 
288 {
289 public:
290  yarp::dev::Pid *pid;
291 
292  Pid_Algorithm_simple(int nj, eOmc_ctrl_out_type_t ot)
293  {
294  out_type = ot;
295 
296  pid = new yarp::dev::Pid[nj];
297  };
298 
300  {
301  if (pid) delete[] pid;
302  };
303 
304  yarp::dev::Pid getPID(int joint) override
305  {
306  return pid[joint];
307  }
308 };
309 
310 /*
311 class PidAlgorithm_VelocityInnerLoop: public Pid_Algorithm
312 {
313 public:
314  yarp::dev::Pid *extPid; //pos, trq, velocity
315  //yarp::dev::Pid *innerVelPid;
316  PidAlgorithm_VelocityInnerLoop(int nj)
317  {
318  extPid = new yarp::dev::Pid[nj];
319  //innerVelPid = new yarp::dev::Pid[nj];
320  };
321  ~PidAlgorithm_VelocityInnerLoop()
322  {
323  if(extPid)
324  {
325  delete[]extPid;
326  }
327  //if(innerVelPid)
328  //{
329  // delete[]innerVelPid;
330  //}
331  }
332 
333  eOmc_ctrl_out_type_t getOutputType() override
334  {
335  return eomc_ctrl_out_type_vel;
336  }
337 };
338 
339 
340 class PidAlgorithm_CurrentInnerLoop: public Pid_Algorithm
341 {
342  public:
343  yarp::dev::Pid *extPid;
344  yarp::dev::Pid *innerCurrLoop;
345  PidAlgorithm_CurrentInnerLoop(int nj)
346  {
347  extPid = allocAndCheck<yarp::dev::Pid>(nj);
348  innerCurrLoop = allocAndCheck<yarp::dev::Pid>(nj);
349  };
350  ~PidAlgorithm_CurrentInnerLoop()
351  {
352  checkAndDestroy(extPid);
353  checkAndDestroy(innerCurrLoop);
354  }
355 
356  eOmc_ctrl_out_type_t getOutputType() override
357  {
358  return eomc_ctrl_out_type_cur;
359  }
360 };
361 */
362 
363 class PidInfo
364 {
365 public:
366 
367  yarp::dev::Pid pid;
368  yarp::dev::PidFeedbackUnitsEnum fbk_PidUnits;
369  yarp::dev::PidOutputUnitsEnum out_PidUnits;
370  eOmc_ctrl_out_type_t out_type;
371 
372  //PidAlgorithmType_t controlLaw;
373 
374  std::string usernamePidSelected;
375  bool enabled;
376 
377  PidInfo()//:usernamePidSelected("none")
378  {
379  enabled = false;
380  //controlLaw = PidAlgo_simple;
381 
382  out_type = eomc_ctrl_out_type_n_a;
383  fbk_PidUnits = yarp::dev::PidFeedbackUnitsEnum::RAW_MACHINE_UNITS;
384  out_PidUnits = yarp::dev::PidOutputUnitsEnum::RAW_MACHINE_UNITS;
385  }
387  {
388  //delete (usernamePidSelected);
389  }
390 
391  //void dumpdata(void);
392 
393 };
394 
395 class TrqPidInfo : public PidInfo
396 {
397 public:
398  double kbemf;
399  double ktau;
400  double viscousPos;
401  double viscousNeg;
402  double coulombPos;
403  double coulombNeg;
406 };
407 
408 typedef struct
409 {
416  bool hasSpeedEncoder ; //facoltativo
417  bool verbose;
419 
420 
422 {
423 public:
424  int id; //num of set. it can be between 0 and max number of joint (_njoints)
425  std::vector<int> joints; //list of joints belongig to this set2joint
426 
427  eOmc_jointset_configuration_t cfg;
428 
429  JointsSet(int num=0)
430  {
431  id=num;
432  joints.resize(0);
433  cfg.candotorquecontrol=0;
434  cfg.usespeedfeedbackfrommotors=0;
435  cfg.pidoutputtype=eomc_pidoutputtype_unknown;
436  cfg.dummy=0;
437  cfg.constraints.type=eomc_jsetconstraint_unknown;
438  cfg.constraints.param1=0;
439  cfg.constraints.param2=0;
440  }
441 public:
442  int getNumberofJoints(void) {return (joints.size());}
443  eOmc_jointset_configuration_t* getConfiguration(void) {return &cfg;}
444  void setUseSpeedFeedbackFromMotors(bool flag){cfg.usespeedfeedbackfrommotors = flag;}
445  void setPidOutputType(eOmc_pidoutputtype_t type){cfg.pidoutputtype = type;}
446  void setCanDoTorqueControl(bool flag) {cfg.candotorquecontrol = flag;}
447  void dumpdata();
448 };
449 
450 typedef struct
451 {
452  int velocity;
453 } timeouts_t;
454 
455 typedef struct
456 {
458  double peakCurrent;
461 
462 
463 typedef struct
464 {
465  double posMin;
466  double posMax;
467  double posHwMax;
468  double posHwMin;
469  double velMax;
470 } jointLimits_t;
471 
472 typedef struct
473 {
474  double posMin;
475  double posMax;
476  double pwmMax;
477 } rotorLimits_t;
478 
479 
480 typedef struct
481 {
482  std::vector<double> matrixJ2M;
483  std::vector<double> matrixM2J;
484  std::vector<double> matrixE2J;
486 
487 typedef struct
488 {
489  int mappedto;
490  std::string name;
491  JointTypeEnum type;
492 } axisInfo_t;
493 
494 typedef struct
495 {
496  double min_stiff;
497  double max_stiff;
498  double min_damp;
499  double max_damp;
500  double param_a;
501  double param_b;
502  double param_c;
504 
505 
506 typedef struct
507 {
508  double stiffness;
509  double damping;
512 
513 typedef struct
514 {
515  bool enabled;
516  std::array<float32_t, 3> x0;
517  std::array<float32_t, 3> Q;
518  float32_t R;
519  float32_t P0;
521 
522 
523 typedef struct
524 {
527 } temperatureLimits_t; // limits expressed as raw values after conversion is applied
528 
529 //template <class T>
530 
531 class Parser
532 {
533 
534 private:
535  int _njoints;
536  std::string _boardname;
537  bool _verbosewhenok;
538 
539  std::map<std::string, Pid_Algorithm*> minjerkAlgoMap;
540  //std::map<std::string, Pid_Algorithm*> directAlgoMap;
541  std::map<std::string, Pid_Algorithm*> torqueAlgoMap;
542 
543  //std::map<std::string, Pid_Algorithm*> currentAlgoMap;
544  //std::map<std::string, Pid_Algorithm*> speedAlgoMap;
545 
546  std::vector<std::string> _positionControlLaw;
547  std::vector<std::string> _velocityControlLaw;
548  std::vector<std::string> _mixedControlLaw;
549  //std::vector<std::string> _posDirectControlLaw;
550  //std::vector<std::string> _velDirectControlLaw;
551  std::vector<std::string> _torqueControlLaw;
552  std::vector<std::string> _currentControlLaw;
553  std::vector<std::string> _speedControlLaw;
554 
555  double *_kbemf;
556  double *_ktau;
557  int *_filterType;
558  double *_viscousPos;
559  double *_viscousNeg;
560  double *_coulombPos;
561  double *_coulombNeg;
562  double *_velocityThres;
563 
564 
565 
566 
567 
568  //PID parsing functions
569  bool parseControlsGroup(yarp::os::Searchable &config);
570 
571  bool parseSelectedPositionControl(yarp::os::Searchable &config);
572  bool parseSelectedVelocityControl(yarp::os::Searchable &config);
573  bool parseSelectedMixedControl(yarp::os::Searchable &config);
574  //bool parseSelectedPosDirectControl(yarp::os::Searchable &config);
575  //bool parseSelectedVelDirectControl(yarp::os::Searchable &config);
576  bool parseSelectedTorqueControl(yarp::os::Searchable &config);
577 
578  bool parseSelectedCurrentPid(yarp::os::Searchable &config, bool pidisMandatory, PidInfo *pids);
579  bool parseSelectedSpeedPid(yarp::os::Searchable &config, bool pidisMandatory, PidInfo *pids);
580 
581  bool parsePid_minJerk_outPwm(yarp::os::Bottle &b_pid, std::string controlLaw);
582  bool parsePid_minJerk_outCur(yarp::os::Bottle &b_pid, std::string controlLaw);
583  bool parsePid_minJerk_outVel(yarp::os::Bottle &b_pid, std::string controlLaw);
584 
585  //bool parsePid_direct_outPwm(yarp::os::Bottle &b_pid, std::string controlLaw);
586  //bool parsePid_direct_outCur(yarp::os::Bottle &b_pid, std::string controlLaw);
587  //bool parsePid_direct_outVel(yarp::os::Bottle &b_pid, std::string controlLaw);
588 
589  bool parsePid_torque_outPwm(yarp::os::Bottle &b_pid, std::string controlLaw);
590  bool parsePid_torque_outCur(yarp::os::Bottle &b_pid, std::string controlLaw);
591  bool parsePid_torque_outVel(yarp::os::Bottle &b_pid, std::string controlLaw);
592 
593  bool parsePidsGroup2FOC(yarp::os::Bottle& pidsGroup, Pid myPid[]);
594  bool parsePidsGroupSimple(yarp::os::Bottle& pidsGroup, Pid myPid[]);
595  bool parsePidsGroupExtended(yarp::os::Bottle& pidsGroup, Pid myPid[]);
596  bool parsePidsGroupDeluxe(yarp::os::Bottle& pidsGroup, Pid myPid[]);
597 
598  bool parsePidsGroup(yarp::os::Bottle& pidsGroup, yarp::dev::Pid myPid[], std::string prefix);
599  bool getCorrectPidForEachJoint(PidInfo *ppids/*, PidInfo *vpids*/, TrqPidInfo *tpids);
600  bool parsePidUnitsType(yarp::os::Bottle &bPid, yarp::dev::PidFeedbackUnitsEnum &fbk_pidunits, yarp::dev::PidOutputUnitsEnum& out_pidunits);
601 
602  bool checkJointTypes(PidInfo *pids, const std::string &pid_type);
603  bool checkSinglePid(PidInfo &firstPid, PidInfo &currentPid, const int &firstjoint, const int &currentjoint, const std::string &pid_type);
604 
605  bool convert(std::string const &fromstring, eOmc_jsetconstraint_t &jsetconstraint, bool& formaterror);
606  bool convert(yarp::os::Bottle &bottle, std::vector<double> &matrix, bool &formaterror, int targetsize);
607 
608  //general utils functions
609  bool extractGroup(yarp::os::Bottle &input, yarp::os::Bottle &out, const std::string &key1, const std::string &txt, int size, bool mandatory=true);
610  template <class T>
611  bool checkAndSetVectorSize(std::vector<T> &vec, int size, const std::string &funcName)
612  {
613  if(size > (int)vec.capacity())
614  {
615  yError() << "embObjMC BOARD " << _boardname << " in " << funcName.c_str() << ": try to insert " << size << "element in vector with " << vec.capacity() << " elements";
616  return false;
617  }
618 
619  vec.resize(size);
620  return true;
621  }
622 
624  void debugUtil_printControlLaws(void);
625 
626 
627 public:
628  Parser(int numofjoints, std::string boardname);
629  ~Parser();
630 
631  bool parsePids(yarp::os::Searchable &config, PidInfo *ppids/*, PidInfo *vpids*/, TrqPidInfo *tpids, PidInfo *cpids, PidInfo *spids, bool lowLevPidisMandatory);
632  bool parseFocGroup(yarp::os::Searchable &config, focBasedSpecificInfo_t *foc_based_info, std::string groupName, std::vector<std::unique_ptr<eomc::ITemperatureSensor>>& temperatureSensorsVector);
633  //bool parseCurrentPid(yarp::os::Searchable &config, PidInfo *cpids);//deprecated
634  bool parseJointsetCfgGroup(yarp::os::Searchable &config, std::vector<JointsSet> &jsets, std::vector<int> &jointtoset);
635  bool parseTimeoutsGroup(yarp::os::Searchable &config, std::vector<timeouts_t> &timeouts, int defaultVelocityTimeout);
636  bool parseCurrentLimits(yarp::os::Searchable &config, std::vector<motorCurrentLimits_t> &currLimits);
637  bool parseTemperatureLimits(yarp::os::Searchable &config, std::vector<temperatureLimits_t> &temperatureLimits);
638  bool parseJointsLimits(yarp::os::Searchable &config, std::vector<jointLimits_t> &jointsLimits);
639  bool parseRotorsLimits(yarp::os::Searchable &config, std::vector<rotorLimits_t> &rotorsLimits);
640  bool parseCouplingInfo(yarp::os::Searchable &config, couplingInfo_t &couplingInfo);
641  bool parseMotioncontrolVersion(yarp::os::Searchable &config, int &version);
642  bool parseBehaviourFalgs(yarp::os::Searchable &config, bool &useRawEncoderData, bool &pwmIsLimited );
643  bool isVerboseEnabled(yarp::os::Searchable &config);
644  bool parseAxisInfo(yarp::os::Searchable &config, int axisMap[], std::vector<axisInfo_t> &axisInfo);
645  bool parseEncoderFactor(yarp::os::Searchable &config, double encoderFactor[]);
646  bool parsefullscalePWM(yarp::os::Searchable &config, double dutycycleToPWM[]);
647  bool parseAmpsToSensor(yarp::os::Searchable &config, double ampsToSensor[]);
648  bool parseGearboxValues(yarp::os::Searchable &config, double gearbox_M2J[], double gearbox_E2J[]);
649  bool parseMechanicalsFlags(yarp::os::Searchable &config, int useMotorSpeedFbk[]);
650  bool parseImpedanceGroup(yarp::os::Searchable &config,std::vector<impedanceParameters_t> &impedance);
651  bool parseDeadzoneValue(yarp::os::Searchable &config, double deadzone[], bool *found);
652  bool parseKalmanFilterParams(yarp::os::Searchable &config, std::vector<kalmanFilterParams_t> &kalmanFilterParams);
653 };
654 
655 }}}; //close namespaces
656 
657 #endif // include guard
virtual double convertRawToTempCelsius(const double temperature)=0
virtual double convertTempCelsiusToRaw(const double temperature)=0
virtual motor_temperatureSensorTypeEnum_t getType()=0
void setPidOutputType(eOmc_pidoutputtype_t type)
Definition: eomcParser.h:445
eOmc_jointset_configuration_t cfg
Definition: eomcParser.h:427
void setUseSpeedFeedbackFromMotors(bool flag)
Definition: eomcParser.h:444
std::vector< int > joints
Definition: eomcParser.h:425
eOmc_jointset_configuration_t * getConfiguration(void)
Definition: eomcParser.h:443
void setCanDoTorqueControl(bool flag)
Definition: eomcParser.h:446
bool parseJointsetCfgGroup(yarp::os::Searchable &config, std::vector< JointsSet > &jsets, std::vector< int > &jointtoset)
bool parseJointsLimits(yarp::os::Searchable &config, std::vector< jointLimits_t > &jointsLimits)
bool parseAmpsToSensor(yarp::os::Searchable &config, double ampsToSensor[])
Parser(int numofjoints, std::string boardname)
Definition: eomcParser.cpp:38
bool parseMechanicalsFlags(yarp::os::Searchable &config, int useMotorSpeedFbk[])
bool parseMotioncontrolVersion(yarp::os::Searchable &config, int &version)
bool parseAxisInfo(yarp::os::Searchable &config, int axisMap[], std::vector< axisInfo_t > &axisInfo)
bool parseFocGroup(yarp::os::Searchable &config, focBasedSpecificInfo_t *foc_based_info, std::string groupName, std::vector< std::unique_ptr< eomc::ITemperatureSensor >> &temperatureSensorsVector)
bool parseCouplingInfo(yarp::os::Searchable &config, couplingInfo_t &couplingInfo)
bool parsePids(yarp::os::Searchable &config, PidInfo *ppids, TrqPidInfo *tpids, PidInfo *cpids, PidInfo *spids, bool lowLevPidisMandatory)
Definition: eomcParser.cpp:79
bool parseTemperatureLimits(yarp::os::Searchable &config, std::vector< temperatureLimits_t > &temperatureLimits)
bool parseDeadzoneValue(yarp::os::Searchable &config, double deadzone[], bool *found)
bool isVerboseEnabled(yarp::os::Searchable &config)
bool parseTimeoutsGroup(yarp::os::Searchable &config, std::vector< timeouts_t > &timeouts, int defaultVelocityTimeout)
bool parseCurrentLimits(yarp::os::Searchable &config, std::vector< motorCurrentLimits_t > &currLimits)
bool parseEncoderFactor(yarp::os::Searchable &config, double encoderFactor[])
bool parsefullscalePWM(yarp::os::Searchable &config, double dutycycleToPWM[])
bool parseRotorsLimits(yarp::os::Searchable &config, std::vector< rotorLimits_t > &rotorsLimits)
bool parseImpedanceGroup(yarp::os::Searchable &config, std::vector< impedanceParameters_t > &impedance)
bool parseKalmanFilterParams(yarp::os::Searchable &config, std::vector< kalmanFilterParams_t > &kalmanFilterParams)
bool parseGearboxValues(yarp::os::Searchable &config, double gearbox_M2J[], double gearbox_E2J[])
bool parseBehaviourFalgs(yarp::os::Searchable &config, bool &useRawEncoderData, bool &pwmIsLimited)
yarp::dev::Pid pid
Definition: eomcParser.h:367
std::string usernamePidSelected
Definition: eomcParser.h:374
yarp::dev::PidFeedbackUnitsEnum fbk_PidUnits
Definition: eomcParser.h:368
eOmc_ctrl_out_type_t out_type
Definition: eomcParser.h:370
yarp::dev::PidOutputUnitsEnum out_PidUnits
Definition: eomcParser.h:369
yarp::dev::Pid getPID(int joint) override
Definition: eomcParser.h:304
Pid_Algorithm_simple(int nj, eOmc_ctrl_out_type_t ot)
Definition: eomcParser.h:292
yarp::dev::PidFeedbackUnitsEnum fbk_PidUnits
Definition: eomcParser.h:269
eOmc_ctrl_out_type_t getOutputType()
Definition: eomcParser.h:275
void setUnits(yarp::dev::PidFeedbackUnitsEnum fu, yarp::dev::PidOutputUnitsEnum ou)
Definition: eomcParser.h:277
eOmc_ctrl_out_type_t out_type
Definition: eomcParser.h:271
yarp::dev::PidOutputUnitsEnum out_PidUnits
Definition: eomcParser.h:270
virtual yarp::dev::Pid getPID(int joint)=0
virtual double convertRawToTempCelsius(const double temperature) override
Definition: eomcParser.h:254
virtual double convertTempCelsiusToRaw(const double temperature) override
Definition: eomcParser.h:248
virtual motor_temperatureSensorTypeEnum_t getType() override
Definition: eomcParser.h:259
virtual double convertTempCelsiusToRaw(const double temperature) override
Definition: eomcParser.h:208
virtual motor_temperatureSensorTypeEnum_t getType() override
Definition: eomcParser.h:231
TemperatureSensorPT1000 & operator=(const TemperatureSensorPT1000 &other)=default
TemperatureSensorPT1000 & operator=(TemperatureSensorPT1000 &&other)=default
virtual double convertRawToTempCelsius(const double temperature) override
Definition: eomcParser.h:219
TemperatureSensorPT1000(const TemperatureSensorPT1000 &other)=default
TemperatureSensorPT1000(TemperatureSensorPT1000 &&other)=default
virtual double convertRawToTempCelsius(const double temperature) override
Definition: eomcParser.h:140
TemperatureSensorPT100(TemperatureSensorPT100 &&other)=default
TemperatureSensorPT100 & operator=(TemperatureSensorPT100 &&other)=default
virtual double convertTempCelsiusToRaw(const double temperature) override
Definition: eomcParser.h:129
TemperatureSensorPT100 & operator=(const TemperatureSensorPT100 &other)=default
TemperatureSensorPT100(const TemperatureSensorPT100 &other)=default
virtual motor_temperatureSensorTypeEnum_t getType() override
Definition: eomcParser.h:152
double viscousPos
motor torque constant
Definition: eomcParser.h:400
double ktau
back-emf compensation parameter
Definition: eomcParser.h:399
motor_temperatureSensorTypeEnum_t
Definition: eomcParser.h:61
@ motor_temperature_sensor_pt100
Definition: eomcParser.h:62
@ motor_temperature_sensor_pt1000
Definition: eomcParser.h:63
@ motor_temperature_sensor_none
Definition: eomcParser.h:64
Copyright (C) 2008 RobotCub Consortium.
out
Definition: sine.m:8
std::vector< double > matrixM2J
Definition: eomcParser.h:483
std::vector< double > matrixE2J
Definition: eomcParser.h:484
std::vector< double > matrixJ2M
Definition: eomcParser.h:482
double posHwMax
user joint limits, min
Definition: eomcParser.h:467
double posHwMin
hardaware joint limits, max
Definition: eomcParser.h:468
double velMax
hardaware joint limits, min
Definition: eomcParser.h:469
double posMax
user joint limits, max
Definition: eomcParser.h:466
std::array< float32_t, 3 > x0
Definition: eomcParser.h:516
std::array< float32_t, 3 > Q
Definition: eomcParser.h:517