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