36 #include <visp3/visual_features/vpGenericFeature.h>
39 #include <visp3/core/vpException.h>
40 #include <visp3/visual_features/vpFeatureException.h>
43 #include <visp3/core/vpDebug.h>
57 vpGenericFeature::vpGenericFeature() : L(), err(), errorStatus(errorNotInitalized)
76 vpGenericFeature::vpGenericFeature(
unsigned int dimension_gen_s) : L(), err(), errorStatus(errorNotInitalized)
78 this->
dim_s = dimension_gen_s;
95 "and feature dimension");
97 "and feature dimension"));
99 errorStatus = errorInitialized;
162 "and feature dimension");
164 "and feature dimension"));
170 if (errorStatus == errorHasToBeUpdated) {
171 vpERROR_TRACE(
"Error has no been updated since last iteration"
172 "you should have used vpGenericFeature::setError"
173 "in you visual servoing loop");
175 "Error has no been updated since last iteration"));
177 else if (errorStatus == errorInitialized) {
179 errorStatus = errorHasToBeUpdated;
180 for (
unsigned int i = 0; i <
dim_s; i++)
191 for (
unsigned int i = 0; i <
dim_s; i++)
194 ex[0] =
s[i] - s_star[i];
251 if (errorStatus == errorHasToBeUpdated) {
252 vpERROR_TRACE(
"Error has no been updated since last iteration"
253 "you should have used vpGenericFeature::setError"
254 "in you visual servoing loop");
256 "Error has no been updated since last iteration"));
258 else if (errorStatus == errorInitialized) {
259 errorStatus = errorHasToBeUpdated;
260 for (
unsigned int i = 0; i <
dim_s; i++)
270 for (
unsigned int i = 0; i <
dim_s; i++)
339 std::cout <<
"interaction matrix " << L << std::endl;
341 std::cout <<
"A possible reason (may be) is that you have set" << std::endl;
342 std::cout <<
"the interaction matrix for s and compute a control " << std::endl;
343 std::cout <<
"with Ls=s* (default) or vice versa" << std::endl;
346 "and feature dimension"));
353 for (
unsigned int i = 0; i <
dim_s; i++)
358 for (
int j = 0; j < 6; j++)
380 vpERROR_TRACE(
"size mismatch between interaction matrix size "
381 "and feature dimension");
383 "and feature dimension"));
404 "and feature dimension");
406 "and feature dimension"));
425 "and feature dimension");
427 "and feature dimension"));
451 "and feature dimension");
453 "and feature dimension"));
479 "and feature dimension");
481 "and feature dimension"));
504 "and feature dimension");
506 "and feature dimension"));
528 "and feature dimension");
530 "and feature dimension"));
550 "and feature dimension");
552 "and feature dimension"));
571 "and feature dimension");
573 "and feature dimension"));
602 std::cout <<
"Generic Feature: ";
603 for (
unsigned int i = 0; i <
dim_s; i++)
605 std::cout <<
" s[" << i <<
"]=" <<
s[i];
608 std::cout << std::endl;
623 const vpColor & ,
unsigned int )
const
625 static int firsttime = 0;
627 if (firsttime == 0) {
638 const vpColor & ,
unsigned int )
const
640 static int firsttime = 0;
642 if (firsttime == 0) {
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
unsigned int getRows() const
class that defines what is a visual feature
vpColVector s
State of the visual feature.
static const unsigned int FEATURE_LINE[32]
vpColVector get_s(unsigned int select=FEATURE_ALL) const
Get the feature vector .
unsigned int dim_s
Dimension of the visual feature.
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
void resize(unsigned int i, bool flagNullify=true)
Class to define RGB colors available for display functionalities.
Error that can be emitted by the vpBasicFeature class and its derivates.
@ notInitializedError
Feature not initialized.
@ badErrorVectorError
Feature list or desired feature list is empty.
@ sizeMismatchError
Size mismatch error.
Class that enables to define a feature or a set of features which are not implemented in ViSP as a sp...
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const vp_override
void print(unsigned int select=FEATURE_ALL) const vp_override
void setInteractionMatrix(const vpMatrix &L)
set the value of the interaction matrix.
void get_s(vpColVector &s) const
get the value of all the features.
vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL) vp_override
vpGenericFeature * duplicate() const vp_override
vpMatrix interaction(unsigned int select=FEATURE_ALL) vp_override
void set_s(const vpColVector &s)
set the value of all the features.
void setError(const vpColVector &error_vector)
Implementation of a matrix and operations on matrices.
void stack(const vpMatrix &A)