TwoDofController.h
Go to the documentation of this file.
1 // -*- C++ -*-
10 #ifndef TWO_DOF_CONTROLLER_H
11 #define TWO_DOF_CONTROLLER_H
12 
13 // </rtc-template>
14 
15 #include "Integrator.h"
16 #include <string>
17 
18 // interface class for TwoDofController
20 public:
22  virtual void reset() = 0; // initialze controller
23  virtual void setup() = 0; // setup parameters
24  virtual bool getParameter() = 0; // get prameter of controller
25  virtual double update(double _x, double _xd) = 0; // calculate input from current value(_x) and target value(_xd)
26  void setErrorPrefix(const std::string& _error_prefix); // set prefix string for error message
27 protected:
28  std::string error_prefix;
29 };
30 
31 
33 public:
35  public:
37  ke = tc = dt = 0.0; // set default param
38  }
40  }
41  static int getControllerParamNum() {
42  return 2;
43  }
44  double ke; // gain
45  double tc; // time constant
46  double dt; // control cycle (not controller but system parameter)
47  };
49  TwoDofController(TwoDofControllerParam &_param, unsigned int _range = 0);
51  void setup();
52  void setup(TwoDofControllerParam &_param, unsigned int _range = 0);
53  void reset();
54  double update(double _x, double _xd);
55  bool getParameter();
57 
58  // for compatibility of Stabilizer. TODO: replace to new parameter argument
59  TwoDofController(double _ke, double _tc, double _dt, unsigned int _range = 0);
60  void setup(double _ke, double _tc, double _dt, unsigned int _range = 0);
61 
62 private:
64  Integrator integrator; // integrated (xd - x)
65 };
66 
67 #endif // TWO_DOF_CONTROLLER_H
Integrator integrator
virtual bool getParameter()=0
void setErrorPrefix(const std::string &_error_prefix)
virtual double update(double _x, double _xd)=0
Calcurate Integration.
TwoDofControllerParam param
virtual void setup()=0
virtual void reset()=0


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:51