21 #include <dynamic-graph/factory.h>    31 const double ControlGR::TIME_STEP_DEFAULT = .001;
    37 #define __SOT_ControlGR_INIT    39 ControlGR::ControlGR(
const std::string &
name)
    42       matrixASIN(NULL, 
"ControlGR(" + name + 
")::input(matrix)::matrixA"),
    44                       "ControlGR(" + name + 
")::input(vector)::acceleration"),
    45       gravitySIN(NULL, 
"ControlGR(" + name + 
")::input(vector)::gravity"),
    47                   matrixASIN << accelerationSIN << gravitySIN,
    48                   "ControlGR(" + name + 
")::output(vector)::control") {
    69   os << 
"ControlGR " << 
getName();
   106   tau = matrixA * acceleration;
   107   sotDEBUG(15) << 
"torque = A*ddot(q)= " << matrixA * acceleration << std::endl;
   116   sotDEBUG(15) << 
"matrixA =" << matrixA << std::endl;
   117   sotDEBUG(15) << 
"acceleration =" << acceleration << std::endl;
   118   sotDEBUG(15) << 
"gravity =" << gravity << std::endl;
   119   sotDEBUG(15) << 
"gravity compensation torque =" << tau << std::endl;
 dynamicgraph::Vector & computeControl(dynamicgraph::Vector &tau, int t)
void signalRegistration(const SignalArray< int > &signals)
#define sotDEBUGOUT(level)
static void openFile(const char *filename=DEBUG_FILENAME_DEFAULT)
#define sotDEBUGIN(level)
ControlGR__INIT ControlGR_initiator
SignalPtr< dynamicgraph::Vector, int > gravitySIN
SignalPtr< dynamicgraph::Vector, int > accelerationSIN
double & setsize(int dimension)
SignalPtr< dynamicgraph::Matrix, int > matrixASIN
virtual void display(std::ostream &os) const
const std::string & getName() const
SignalTimeDependent< dynamicgraph::Vector, int > controlSOUT
void init(const double &step)
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(ControlGR, "ControlGR")