16 #include <dynamic-graph/factory.h> 31 #define __SOT_ControlPD_INIT 36 KpSIN(NULL,
"ControlPD(" + name +
")::input(vector)::Kp"),
37 KdSIN(NULL,
"ControlPD(" + name +
")::input(vector)::Kd"),
38 positionSIN(NULL,
"ControlPD(" + name +
")::input(vector)::position"),
40 NULL,
"ControlPD(" + name +
")::input(vector)::desired_position"),
41 velocitySIN(NULL,
"ControlPD(" + name +
")::input(vector)::velocity"),
43 NULL,
"ControlPD(" + name +
")::input(vector)::desired_velocity"),
45 KpSIN << KdSIN << positionSIN << desiredpositionSIN
46 << velocitySIN << desiredvelocitySIN,
47 "ControlPD(" + name +
")::output(vector)::control"),
49 boost::bind(&
ControlPD::getPositionError, this, _1, _2), controlSOUT,
50 "ControlPD(" + name +
")::output(vector)::position_error"),
52 boost::bind(&
ControlPD::getVelocityError, this, _1, _2), controlSOUT,
53 "ControlPD(" + name +
")::output(vector)::velocity_error") {
72 os <<
"ControlPD " <<
getName();
114 return position_error;
121 return velocity_error;
dynamicgraph::Vector velocity_error_
static const double TIME_STEP_DEFAULT
dynamicgraph::Vector & getVelocityError(dynamicgraph::Vector &velocity_error, int t)
dynamicgraph::Vector & getPositionError(dynamicgraph::Vector &position_error, int t)
SignalTimeDependent< dynamicgraph::Vector, int > velocityErrorSOUT
void signalRegistration(const SignalArray< int > &signals)
#define sotDEBUGOUT(level)
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(FeaturePosture, "FeaturePosture")
#define sotDEBUGIN(level)
dynamicgraph::Vector & computeControl(dynamicgraph::Vector &tau, int t)
ControlPD(const std::string &name)
SignalPtr< dynamicgraph::Vector, int > KpSIN
SignalPtr< dynamicgraph::Vector, int > desiredvelocitySIN
SignalPtr< dynamicgraph::Vector, int > desiredpositionSIN
virtual void display(std::ostream &os) const
void init(const double &step)
SignalPtr< dynamicgraph::Vector, int > velocitySIN
const std::string & getName() const
SignalPtr< dynamicgraph::Vector, int > KdSIN
SignalTimeDependent< dynamicgraph::Vector, int > controlSOUT
SignalTimeDependent< dynamicgraph::Vector, int > positionErrorSOUT
dynamicgraph::Vector position_error_
SignalPtr< dynamicgraph::Vector, int > positionSIN