39 #include <visp3/visual_features/vpGenericFeature.h> 42 #include <visp3/core/vpException.h> 43 #include <visp3/visual_features/vpFeatureException.h> 46 #include <visp3/core/vpDebug.h> 68 vpGenericFeature::vpGenericFeature() : L(), err(), errorStatus(errorNotInitalized)
87 vpGenericFeature::vpGenericFeature(
unsigned int dimension_gen_s) : L(), err(), errorStatus(errorNotInitalized)
89 this->
dim_s = dimension_gen_s;
106 "and feature dimension");
108 "and feature dimension"));
110 errorStatus = errorInitialized;
173 "and feature dimension");
175 "and feature dimension"));
181 if (errorStatus == errorHasToBeUpdated) {
182 vpERROR_TRACE(
"Error has no been updated since last iteration" 183 "you should have used vpGenericFeature::setError" 184 "in you visual servoing loop");
186 "Error has no been updated since last iteration"));
187 }
else if (errorStatus == errorInitialized) {
189 errorStatus = errorHasToBeUpdated;
190 for (
unsigned int i = 0; i <
dim_s; i++)
200 for (
unsigned int i = 0; i <
dim_s; i++)
203 ex[0] =
s[i] - s_star[i];
259 if (errorStatus == errorHasToBeUpdated) {
260 vpERROR_TRACE(
"Error has no been updated since last iteration" 261 "you should have used vpGenericFeature::setError" 262 "in you visual servoing loop");
264 "Error has no been updated since last iteration"));
265 }
else if (errorStatus == errorInitialized) {
266 errorStatus = errorHasToBeUpdated;
267 for (
unsigned int i = 0; i <
dim_s; i++)
276 for (
unsigned int i = 0; i <
dim_s; i++)
344 std::cout <<
"interaction matrix " << L << std::endl;
346 std::cout <<
"A possible reason (may be) is that you have set" << std::endl;
347 std::cout <<
"the interaction matrix for s and compute a control " << std::endl;
348 std::cout <<
"with Ls=s* (default) or vice versa" << std::endl;
351 "and feature dimension"));
358 for (
unsigned int i = 0; i <
dim_s; i++)
363 for (
int j = 0; j < 6; j++)
385 vpERROR_TRACE(
"size mismatch between interaction matrix size " 386 "and feature dimension");
388 "and feature dimension"));
409 "and feature dimension");
411 "and feature dimension"));
430 "and feature dimension");
432 "and feature dimension"));
456 "and feature dimension");
458 "and feature dimension"));
484 "and feature dimension");
486 "and feature dimension"));
509 "and feature dimension");
511 "and feature dimension"));
533 "and feature dimension");
535 "and feature dimension"));
555 "and feature dimension");
557 "and feature dimension"));
576 "and feature dimension");
578 "and feature dimension"));
607 std::cout <<
"Generic Feature: ";
608 for (
unsigned int i = 0; i <
dim_s; i++)
610 std::cout <<
" s[" << i <<
"]=" <<
s[i];
613 std::cout << std::endl;
628 const vpColor & ,
unsigned int )
const 630 static int firsttime = 0;
632 if (firsttime == 0) {
643 const vpColor & ,
unsigned int )
const 645 static int firsttime = 0;
647 if (firsttime == 0) {
Implementation of a matrix and operations on matrices.
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
void set_s(const vpColVector &s)
set the value of all the features.
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const
Class to define RGB colors available for display functionnalities.
void stack(const vpMatrix &A)
unsigned int dim_s
Dimension of the visual feature.
feature list or desired feature list is empty
void get_s(vpColVector &s) const
get the value of all the features.
class that defines what is a visual feature
Error that can be emited by the vpBasicFeature class and its derivates.
virtual ~vpGenericFeature()
Generic class defining intrinsic camera parameters.
void setInteractionMatrix(const vpMatrix &L)
set the value of the interaction matrix.
void print(unsigned int select=FEATURE_ALL) const
unsigned int getRows() const
static const unsigned int FEATURE_LINE[32]
void resize(unsigned int i, bool flagNullify=true)
Implementation of column vector and the associated operations.
vpMatrix interaction(unsigned int select=FEATURE_ALL)
vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL)
vpGenericFeature * duplicate() const
Class that enables to define a feature or a set of features which are not implemented in ViSP as a sp...
vpColVector get_s(unsigned int select=FEATURE_ALL) const
Get the feature vector .
vpColVector s
State of the visual feature.
void setError(const vpColVector &error_vector)