26 param.ke = _param.
ke; param.tc = _param.
tc; param.dt = _param.
dt;
36 param.ke = 0; param.tc = 0; param.dt = 0;
42 param.ke = _param.
ke; param.tc = _param.
tc; param.dt = _param.
dt;
71 if (!param.ke || !param.tc || !param.dt){
72 std::cerr <<
"[" <<
error_prefix <<
"]" <<
"TwoDofController parameters are not set." << std::endl;
78 integrator.update(_xd - _x);
81 velocity = (-_x + (_xd - _x) + (integrator.calculate() / param.tc)) / (-param.ke * param.tc);
83 return -velocity * param.dt;
89 param.ke = _ke; param.tc = _tc; param.dt = _dt;
96 param.ke = _ke; param.tc = _tc; param.dt = _dt;
Feedback and Feedforward Controller.
double update(double _x, double _xd)
void setErrorPrefix(const std::string &_error_prefix)