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++)
386 vpERROR_TRACE(
"size mismatch between interaction matrix size " 387 "and feature dimension");
389 "and feature dimension"));
410 "and feature dimension");
412 "and feature dimension"));
431 "and feature dimension");
433 "and feature dimension"));
457 "and feature dimension");
459 "and feature dimension"));
485 "and feature dimension");
487 "and feature dimension"));
510 "and feature dimension");
512 "and feature dimension"));
534 "and feature dimension");
536 "and feature dimension"));
556 "and feature dimension");
558 "and feature dimension"));
577 "and feature dimension");
579 "and feature dimension"));
608 std::cout <<
"Generic Feature: ";
609 for (
unsigned int i = 0; i <
dim_s; i++)
611 std::cout <<
" s[" << i <<
"]=" <<
s[i];
614 std::cout << std::endl;
629 const vpColor & ,
unsigned int )
const 631 static int firsttime = 0;
633 if (firsttime == 0) {
644 const vpColor & ,
unsigned int )
const 646 static int firsttime = 0;
648 if (firsttime == 0) {
Implementation of a matrix and operations on matrices.
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
void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true, const bool recopy_=true)
Class to define 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
vpMatrix interaction(const unsigned int select=FEATURE_ALL)
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.
unsigned int getRows() const
static const unsigned int FEATURE_LINE[32]
Implementation of column vector and the associated operations.
void print(const unsigned int select=FEATURE_ALL) const
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 error(const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
vpColVector s
State of the visual feature.
void resize(const unsigned int i, const bool flagNullify=true)
void setError(const vpColVector &error_vector)