29 FeatureVisualPoint::FeatureVisualPoint(
const string &pointName)
32 xySIN(NULL,
"sotFeatureVisualPoint(" +
name +
")::input(vector)::xy"),
33 ZSIN(NULL,
"sotFeatureVisualPoint(" +
name +
")::input(double)::Z"),
35 NULL,
"sotFeatureVisualPoint(" +
name +
")::input(matrix)::Jq") {
81 sotDEBUG(15) <<
"Get selection flags." << endl;
86 unsigned int cursorL = 0;
90 const double &
Z =
ZSIN(time);
92 const double &
x =
xySIN(time)(0);
93 const double &
y =
xySIN(time)(1);
97 "VisualPoint is behind the camera",
" (Z=%.1f).",
101 if (fabs(Z) < 1e-6) {
103 "VisualPoint Z coordinates is null",
" (Z=%.3f)",
108 L(cursorL, 0) = -1 / Z;
110 L(cursorL, 2) = x / Z;
111 L(cursorL, 3) = x * y;
112 L(cursorL, 4) = -(1 + x * x);
120 L(cursorL, 1) = -1 / Z;
121 L(cursorL, 2) = y / Z;
122 L(cursorL, 3) = 1 + y * y;
123 L(cursorL, 4) = -x * y;
128 sotDEBUG(15) <<
"L:" << endl <<
L << endl;
144 unsigned int cursorL = 0;
148 "S* is not of adequate type."));
163 os <<
"VisualPoint <" <<
name <<
">:";
168 if (fl(0)) os <<
" x=" << xy(0);
169 if (fl(1)) os <<
" y=" << xy(1);
171 os <<
" XY or select not set.";
176 os <<
" Z=" << z <<
" ";
virtual void removeDependenciesFromReference(void)=0
dynamicgraph::SignalPtr< dynamicgraph::Matrix, int > articularJacobianSIN
SignalPtr< Flags, int > selectionSIN
This vector specifies which dimension are used to perform the computation. For instance let us assume...
SignalTimeDependent< unsigned int, int > dimensionSOUT
Returns the dimension of the feature as an output signal.
void signalRegistration(const SignalArray< int > &signals)
#define sotDEBUGOUT(level)
virtual bool isReferenceSet(void) const
#define sotDEBUGIN(level)
SignalTimeDependent< dynamicgraph::Matrix, int > jacobianSOUT
Jacobian of the error wrt the robot state: .
unsigned int getDimension(void) const
Shortest method.
virtual void display(std::ostream &os) const
Class that defines 2D visualPoint visual feature.
virtual const T & access(const Time &t)
virtual void removeDependency(const SignalBase< Time > &signal)
virtual void addDependency(const SignalBase< Time > &signal)
virtual dynamicgraph::Vector & computeError(dynamicgraph::Vector &res, int time)
dynamicgraph::SignalPtr< double, int > ZSIN
virtual const T & accessCopy() const
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(FeatureVisualPoint, "FeatureVisualPoint")
virtual dynamicgraph::Matrix & computeJacobian(dynamicgraph::Matrix &res, int time)
This class gives the abstract definition of a feature.
dynamicgraph::SignalPtr< dynamicgraph::Vector, int > xySIN
virtual void addDependenciesFromReference(void)=0
FeatureVisualPoint * getReference(void)
SignalTimeDependent< dynamicgraph::Vector, int > errorSOUT
This signal returns the error between the desired value and the current value : . ...