9 #include <dynamic-graph/entity.h> 10 #include <dynamic-graph/factory.h> 37 std::ostringstream forceName, positionName;
38 forceName << CLASS_NAME <<
"::input(vector6)::force_" <<
i;
39 positionName << CLASS_NAME <<
"::input(MatrixHomo)::sensorPosition_" << i;
50 std::string docstring =
51 "Compute ZMP from force sensor measures and positions\n" 53 " Takes 4 signals as input:\n" 54 " - force_0: wrench measured by force sensor 0 as a 6 dimensional " 56 " - force_0: wrench measured by force sensor 1 as a 6 dimensional " 58 " - sensorPosition_0: position of force sensor 0\n" 59 " - sensorPosition_1: position of force sensor 1\n" 61 " compute the Zero Momentum Point of the contact forces as measured " 63 " input signals under the asumptions that the contact points between " 65 " robot and the environment are located in the same horizontal " 86 double fx = M(0, 0) * f(0) + M(0, 1) * f(1) + M(0, 2) * f(2);
87 double fy = M(1, 0) * f(0) + M(1, 1) * f(1) + M(1, 2) * f(2);
88 double fz = M(2, 0) * f(0) + M(2, 1) * f(1) + M(2, 2) * f(2);
91 double Mx = M(0, 0) * f(3) + M(0, 1) * f(4) + M(0, 2) * f(5) +
92 M(1, 3) * fz - M(2, 3) * fy;
93 double My = M(1, 0) * f(3) + M(1, 1) * f(4) + M(1, 2) * f(5) +
94 M(2, 3) * fx - M(0, 3) * fz;
98 sumZmpz += fz * M(2, 3);
102 zmp(0) = sumZmpx / fnormal;
103 zmp(1) = sumZmpy / fnormal;
104 zmp(2) = sumZmpz / fnormal;
Eigen::Transform< double, 3, Eigen::Affine > SOT_CORE_EXPORT MatrixHomogeneous
Eigen::Transform< double, 3, Eigen::Affine > MatrixHomogeneous
void signalRegistration(const SignalArray< int > &signals)
Vector & computeZmp(Vector &zmp, int time)
SignalPtr< MatrixHomogeneous, int > * sensorPositionsSIN_[footNumber]
SignalTimeDependent< Vector, int > zmpSOUT_
static const unsigned int footNumber
virtual void addDependency(const SignalBase< int > &signal)
virtual std::string getDocString() const
ZmpFromForces(const std::string &name)
SignalPtr< Vector, int > * forcesSIN_[footNumber]
DYNAMIC_GRAPH_ENTITY_DECL()
virtual const T & access(const Time &t)