![]() |
Visual Servoing Platform version 3.6.0
|
#include <vpFeatureTranslation.h>
Public Types | |
enum | vpFeatureTranslationRepresentationType { cdMc , cMcd , cMo } |
enum | { FEATURE_ALL = 0xffff } |
enum | vpBasicFeatureDeallocatorType { user , vpServo } |
Static Public Member Functions | |
static unsigned int | selectTx () |
static unsigned int | selectTy () |
static unsigned int | selectTz () |
Static Public Attributes | |
static const unsigned int | FEATURE_LINE [32] |
Protected Attributes | |
vpColVector | s |
unsigned int | dim_s |
bool * | flags |
unsigned int | nbParameters |
Inherited functionalities from vpBasicFeature | |
unsigned int | dimension_s () |
vpColVector | get_s (unsigned int select=FEATURE_ALL) const |
vpBasicFeatureDeallocatorType | getDeallocate () |
unsigned int | getDimension (unsigned int select=FEATURE_ALL) const |
virtual double | operator[] (unsigned int i) const |
void | setDeallocate (vpBasicFeatureDeallocatorType d) |
void | setFlags () |
static unsigned int | selectAll () |
vpBasicFeatureDeallocatorType | deallocate |
void | resetFlags () |
Class that defines the translation visual feature
It is convenient to consider two coordinate frames noted here
Let
with
This class can be used to manipulate three kind of visual features:
To initialize the feature
The interaction() method allows to compute the interaction matrix
The code below shows how to create a eye-in hand visual servoing task using a 3D translation feature
If you want to deal only with the
If you want to build your own control law, this other example shows how to create a current (
The code below shows how to create an eye-in hand visual servoing task using a 3D translation feature
Definition at line 272 of file vpFeatureTranslation.h.
|
inherited |
Enumerator | |
---|---|
FEATURE_ALL |
Definition at line 81 of file vpBasicFeature.h.
|
inherited |
Indicates who should deallocate the feature.
Enumerator | |
---|---|
user | |
vpServo |
Definition at line 87 of file vpBasicFeature.h.
Kind of implemented 3D translation feature.
Definition at line 279 of file vpFeatureTranslation.h.
vpFeatureTranslation::vpFeatureTranslation | ( | ) |
Default constructor that builds a visual feature and initialize it to zero. The type of the translation feature will be vpFeatureTranslation::cdMc by default. Use the function setFeatureTranslationType() to set the desired type of feature.
Definition at line 84 of file vpFeatureTranslation.cpp.
References init().
Referenced by duplicate().
|
explicit |
Default constructor that builds a visual feature and initialize it to zero specifying the type.
r | : Type of considered 3D translation feature. |
Definition at line 93 of file vpFeatureTranslation.cpp.
References init().
vpFeatureTranslation::vpFeatureTranslation | ( | vpHomogeneousMatrix & | f2Mf1_, |
vpFeatureTranslationRepresentationType | r ) |
Constructor that builds a 3D visual feature from an homogeneous matrix
f2Mf1_ | [in] : 3D displacement that the camera has to achieve to move from the frame ![]() ![]() ![]() |
r | : type of feature. It can be vpFeature::cdMc or vpFeature::cMo. |
Definition at line 110 of file vpFeatureTranslation.cpp.
References buildFrom(), and init().
|
inlinevirtual |
Destructor. Does nothing.
Definition at line 302 of file vpFeatureTranslation.h.
void vpFeatureTranslation::buildFrom | ( | const vpHomogeneousMatrix & | f2Mf1_ | ) |
Build a 3D translation visual feature from an homogeneous matrix
f2Mf1_ | [in] : 3D displacement that the camera has to achieve to move from the frame ![]() ![]() ![]() |
Definition at line 127 of file vpFeatureTranslation.cpp.
References vpBasicFeature::flags, and vpBasicFeature::s.
Referenced by vpFeatureTranslation().
|
inlineinherited |
Return the dimension of the feature vector
Definition at line 109 of file vpBasicFeature.h.
|
virtual |
Not implemented.
Implements vpBasicFeature.
Definition at line 605 of file vpFeatureTranslation.cpp.
References vpERROR_TRACE.
|
virtual |
Not implemented.
Implements vpBasicFeature.
Definition at line 622 of file vpFeatureTranslation.cpp.
References vpERROR_TRACE.
|
virtual |
Feature duplication.
Create an object with the same type.
Implements vpBasicFeature.
Definition at line 588 of file vpFeatureTranslation.cpp.
References cdMc, cMcd, cMo, and vpFeatureTranslation().
|
virtual |
Compute the error
s_star | : Desired visual feature. |
select | : The error can be computed for a selection of a subset of the possible translation features.
|
vpFeatureException::badInitializationError | : If the desired visual feature ![]() |
The code below shows how to use this method to manipulate the
To manipulate the subset features
Reimplemented from vpBasicFeature.
Definition at line 505 of file vpFeatureTranslation.cpp.
References vpFeatureException::badInitializationError, cdMc, cMcd, vpBasicFeature::get_s(), vpBasicFeature::s, selectTx(), selectTy(), selectTz(), vpColVector::stack(), vpColVector::sumSquare(), and vpERROR_TRACE.
|
inherited |
Get the feature vector
Definition at line 112 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpBasicFeature::s, and vpColVector::stack().
Referenced by vpServo::computeError(), vpBasicFeature::error(), vpFeatureDepth::error(), vpFeatureThetaU::error(), error(), and vpGenericFeature::error().
double vpFeatureTranslation::get_Tx | ( | ) | const |
Return the
Definition at line 201 of file vpFeatureTranslation.cpp.
References vpBasicFeature::s.
double vpFeatureTranslation::get_Ty | ( | ) | const |
Return the
Definition at line 208 of file vpFeatureTranslation.cpp.
References vpBasicFeature::s.
double vpFeatureTranslation::get_Tz | ( | ) | const |
Return the
Definition at line 215 of file vpFeatureTranslation.cpp.
References vpBasicFeature::s.
|
inlineinherited |
Definition at line 122 of file vpBasicFeature.h.
|
inherited |
Get the feature vector dimension.
Definition at line 99 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpArray2D< Type >::getRows(), and vpBasicFeature::s.
vpFeatureTranslation::vpFeatureTranslationRepresentationType vpFeatureTranslation::getFeatureTranslationType | ( | ) | const |
Get the type of translation feature.
Definition at line 191 of file vpFeatureTranslation.cpp.
|
virtual |
Initialise the memory space requested for 3D translation visual feature.
Implements vpBasicFeature.
Definition at line 64 of file vpFeatureTranslation.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpColVector::resize(), and vpBasicFeature::s.
Referenced by vpFeatureTranslation(), vpFeatureTranslation(), and vpFeatureTranslation().
|
virtual |
Compute and return the interaction matrix
As it exists three different features, the computation of the interaction matrix is diferent for each one.
With the feature type cdMc:
where
With the feature type cMcd:
where
With the feature type cMo:
where
select | : Selection of a subset of the possible translation features.
|
The code below shows how to compute the interaction matrix associated to the visual feature
The code below shows how to compute the interaction matrix associated to the
L_xy is here now a 2 by 6 matrix. The first line corresponds to the
It is also possible to build the interaction matrix from all the translation components by:
In that case, L_xyz is a 3 by 6 interaction matrix where the last line corresponds to the
Implements vpBasicFeature.
Definition at line 298 of file vpFeatureTranslation.cpp.
References cdMc, cMcd, cMo, vpBasicFeature::deallocate, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpBasicFeature::resetFlags(), vpBasicFeature::s, selectTx(), selectTy(), selectTz(), vpMatrix::stack(), vpBasicFeature::user, and vpTRACE.
|
inlinevirtualinherited |
Return element i in the state vector (usage : x = s[i] )
Definition at line 129 of file vpBasicFeature.h.
|
virtual |
Print to stdout the values of the current visual feature
select | : Selection of a subset of the possible translation features.
|
Implements vpBasicFeature.
Definition at line 560 of file vpFeatureTranslation.cpp.
References vpBasicFeature::s, selectTx(), selectTy(), and selectTz().
|
protectedinherited |
Definition at line 129 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
Referenced by vpFeatureDepth::interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePoint::interaction(), vpFeaturePointPolar::interaction(), vpFeatureThetaU::interaction(), interaction(), and vpFeatureVanishingPoint::interaction().
|
inlinestaticinherited |
Select all the features.
Definition at line 141 of file vpBasicFeature.h.
|
static |
Function used to select the
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to
See the interaction() method for an usage example.
This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law:
Definition at line 679 of file vpFeatureTranslation.cpp.
References vpBasicFeature::FEATURE_LINE.
Referenced by error(), interaction(), and print().
|
static |
Function used to select the
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to
See the interaction() method for an usage example.
This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law:
Definition at line 724 of file vpFeatureTranslation.cpp.
References vpBasicFeature::FEATURE_LINE.
Referenced by error(), interaction(), and print().
|
static |
Function used to select the
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to
See the interaction() method for an usage example.
This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law:
Definition at line 769 of file vpFeatureTranslation.cpp.
References vpBasicFeature::FEATURE_LINE.
Referenced by error(), interaction(), and print().
void vpFeatureTranslation::set_Tx | ( | double | t_x | ) |
Initialise the
t_x | : ![]() |
Definition at line 160 of file vpFeatureTranslation.cpp.
References vpBasicFeature::s.
void vpFeatureTranslation::set_Ty | ( | double | t_y | ) |
Initialise the
t_y | : ![]() |
Definition at line 170 of file vpFeatureTranslation.cpp.
References vpBasicFeature::s.
void vpFeatureTranslation::set_Tz | ( | double | t_z | ) |
Initialise the
t_z | : ![]() |
Definition at line 180 of file vpFeatureTranslation.cpp.
References vpBasicFeature::s.
|
inlineinherited |
Definition at line 136 of file vpBasicFeature.h.
Referenced by vpServo::addFeature().
void vpFeatureTranslation::setFeatureTranslationType | ( | const vpFeatureTranslationRepresentationType | r | ) |
Set the type of translation feature.
r | : type of translation feature. It can be vpFeatureTranslation::cdMc, vpFeatureTranslation::cMcd or vpFeatureTranslation::cMo. |
Definition at line 146 of file vpFeatureTranslation.cpp.
|
inherited |
Set feature flags to true to prevent warning when re-computing the interaction matrix without having updated the feature.
Definition at line 139 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
|
protectedinherited |
Definition at line 147 of file vpBasicFeature.h.
Referenced by vpFeatureDepth::interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePoint::interaction(), vpFeaturePointPolar::interaction(), vpFeatureSegment::interaction(), vpFeatureThetaU::interaction(), interaction(), vpFeatureVanishingPoint::interaction(), and vpBasicFeature::operator=().
|
protectedinherited |
Dimension of the visual feature.
Definition at line 93 of file vpBasicFeature.h.
Referenced by vpFeatureMoment::duplicate(), vpGenericFeature::duplicate(), vpBasicFeature::error(), vpFeatureLuminance::error(), vpGenericFeature::error(), vpGenericFeature::error(), vpBasicFeature::get_s(), vpGenericFeature::get_s(), vpGenericFeature::get_s(), vpGenericFeature::get_s(), vpGenericFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), vpFeatureDepth::init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeatureLuminance::init(), vpFeatureMoment::init(), vpFeaturePoint3D::init(), vpFeaturePoint::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::interaction(), vpFeatureMoment::interaction(), vpGenericFeature::interaction(), vpBasicFeature::operator=(), vpFeatureLuminance::operator=(), vpFeatureMoment::print(), vpGenericFeature::print(), vpGenericFeature::set_s(), vpGenericFeature::set_s(), vpGenericFeature::set_s(), vpGenericFeature::set_s(), vpGenericFeature::setError(), vpGenericFeature::setInteractionMatrix(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpGenericFeature::vpGenericFeature().
|
staticinherited |
Definition at line 41 of file vpBasicFeature.h.
Referenced by vpBasicFeature::error(), vpGenericFeature::error(), vpGenericFeature::error(), vpBasicFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), vpFeatureMoment::interaction(), vpGenericFeature::interaction(), vpFeatureMoment::print(), vpGenericFeature::print(), vpFeatureEllipse::select_n02(), vpFeatureEllipse::select_n11(), vpFeatureEllipse::select_n20(), vpFeatureSegment::selectAlpha(), vpFeatureVanishingPoint::selectAlpha(), vpFeatureVanishingPoint::selectAtanOneOverRho(), vpFeatureSegment::selectL(), vpFeatureEllipse::selectMu02(), vpFeatureEllipse::selectMu11(), vpFeatureEllipse::selectMu20(), vpFeatureVanishingPoint::selectOneOverRho(), vpFeatureLine::selectRho(), vpFeaturePointPolar::selectRho(), vpFeatureLine::selectTheta(), vpFeaturePointPolar::selectTheta(), vpFeatureThetaU::selectTUx(), vpFeatureThetaU::selectTUy(), vpFeatureThetaU::selectTUz(), selectTx(), selectTy(), selectTz(), vpFeatureEllipse::selectX(), vpFeaturePoint3D::selectX(), vpFeaturePoint::selectX(), vpFeatureVanishingPoint::selectX(), vpFeatureSegment::selectXc(), vpFeatureEllipse::selectY(), vpFeaturePoint3D::selectY(), vpFeaturePoint::selectY(), vpFeatureVanishingPoint::selectY(), vpFeatureSegment::selectYc(), and vpFeaturePoint3D::selectZ().
|
protectedinherited |
Ensure that all the parameters needed to compute the iteraction matrix are set.
Definition at line 97 of file vpBasicFeature.h.
Referenced by vpFeatureDepth::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeatureLine::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeaturePoint::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureThetaU::buildFrom(), buildFrom(), vpFeatureMoment::duplicate(), vpFeatureDepth::init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeatureLuminance::init(), vpFeatureMoment::init(), vpFeaturePoint3D::init(), vpFeaturePoint::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), init(), vpFeatureVanishingPoint::init(), vpFeatureDepth::interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePoint::interaction(), vpFeaturePointPolar::interaction(), vpFeatureSegment::interaction(), vpFeatureThetaU::interaction(), interaction(), vpFeatureVanishingPoint::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_rhoThetaZ(), vpFeaturePointPolar::set_theta(), vpFeatureThetaU::set_TUx(), vpFeatureThetaU::set_TUy(), vpFeatureThetaU::set_TUz(), vpFeaturePoint3D::set_X(), vpFeatureDepth::set_x(), vpFeatureEllipse::set_x(), vpFeaturePoint::set_x(), vpFeatureVanishingPoint::set_x(), vpFeatureEllipse::set_xy(), vpFeaturePoint3D::set_XYZ(), vpFeaturePoint::set_xyZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeaturePoint3D::set_Y(), vpFeatureDepth::set_y(), vpFeatureEllipse::set_y(), vpFeaturePoint::set_y(), vpFeatureVanishingPoint::set_y(), vpFeatureDepth::set_Z(), vpFeatureLuminance::set_Z(), vpFeaturePoint3D::set_Z(), vpFeaturePoint::set_Z(), vpFeaturePointPolar::set_Z(), vpFeatureEllipse::setABC(), vpFeatureLine::setABCD(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), vpBasicFeature::setFlags(), vpFeatureEllipse::setMoments(), vpFeatureVanishingPoint::setOneOverRho(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpBasicFeature::~vpBasicFeature().
|
protectedinherited |
Number of parameters needed to compute the interaction matrix.
Definition at line 99 of file vpBasicFeature.h.
Referenced by vpFeatureDepth::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeaturePoint::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureThetaU::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureDepth::init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeatureLuminance::init(), vpFeatureMoment::init(), vpFeaturePoint3D::init(), vpFeaturePoint::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), init(), vpFeatureVanishingPoint::init(), vpFeatureDepth::interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePoint::interaction(), vpFeaturePointPolar::interaction(), vpFeatureSegment::interaction(), vpFeatureThetaU::interaction(), interaction(), vpFeatureVanishingPoint::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), vpFeaturePointPolar::set_rhoThetaZ(), vpFeaturePoint3D::set_XYZ(), vpFeaturePoint::set_xyZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureEllipse::setABC(), vpFeatureLine::setABCD(), vpBasicFeature::setFlags(), vpFeatureMoment::update(), and vpFeatureLuminance::vpFeatureLuminance().
|
protectedinherited |
State of the visual feature.
Definition at line 91 of file vpBasicFeature.h.
Referenced by vpFeatureDepth::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeatureLine::buildFrom(), vpFeatureLine::buildFrom(), vpFeatureLuminance::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeaturePoint3D::buildFrom(), vpFeaturePoint::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureThetaU::buildFrom(), buildFrom(), vpFeatureEllipse::display(), vpFeatureEllipse::display(), vpFeatureMoment::duplicate(), vpBasicFeature::error(), vpFeatureDepth::error(), vpFeatureEllipse::error(), vpFeatureLine::error(), vpFeatureLuminance::error(), vpFeatureMomentAlpha::error(), vpFeaturePoint3D::error(), vpFeaturePoint::error(), vpFeaturePointPolar::error(), vpFeatureThetaU::error(), error(), vpFeatureVanishingPoint::error(), vpGenericFeature::error(), vpGenericFeature::error(), vpFeatureDepth::get_LogZoverZstar(), vpFeaturePointPolar::get_rho(), vpBasicFeature::get_s(), vpGenericFeature::get_s(), vpGenericFeature::get_s(), vpGenericFeature::get_s(), vpGenericFeature::get_s(), vpFeaturePointPolar::get_theta(), vpFeatureThetaU::get_TUx(), vpFeatureThetaU::get_TUy(), vpFeatureThetaU::get_TUz(), get_Tx(), get_Ty(), get_Tz(), vpFeaturePoint3D::get_X(), vpFeaturePoint::get_x(), vpFeatureVanishingPoint::get_x(), vpFeaturePoint3D::get_Y(), vpFeaturePoint::get_y(), vpFeatureVanishingPoint::get_y(), vpFeaturePoint3D::get_Z(), vpFeatureVanishingPoint::getAlpha(), vpFeatureVanishingPoint::getAtanOneOverRho(), vpBasicFeature::getDimension(), vpFeatureVanishingPoint::getOneOverRho(), vpFeatureDepth::init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeatureLuminance::init(), vpFeatureMoment::init(), vpFeaturePoint3D::init(), vpFeaturePoint::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), init(), vpFeatureVanishingPoint::init(), vpGenericFeature::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), interaction(), vpBasicFeature::operator=(), vpFeatureEllipse::print(), vpFeatureLine::print(), vpFeatureMoment::print(), vpFeatureSegment::print(), vpFeatureThetaU::print(), print(), vpGenericFeature::print(), vpFeatureDepth::set_LogZoverZstar(), vpFeaturePointPolar::set_rho(), vpGenericFeature::set_s(), vpGenericFeature::set_s(), vpGenericFeature::set_s(), vpGenericFeature::set_s(), vpFeaturePointPolar::set_theta(), vpFeatureThetaU::set_TUx(), vpFeatureThetaU::set_TUy(), vpFeatureThetaU::set_TUz(), set_Tx(), set_Ty(), set_Tz(), vpFeaturePoint3D::set_X(), vpFeatureEllipse::set_x(), vpFeaturePoint::set_x(), vpFeatureVanishingPoint::set_x(), vpFeatureEllipse::set_xy(), vpFeaturePoint3D::set_Y(), vpFeatureEllipse::set_y(), vpFeaturePoint::set_y(), vpFeatureVanishingPoint::set_y(), vpFeaturePoint3D::set_Z(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), vpFeatureEllipse::setMoments(), vpFeatureVanishingPoint::setOneOverRho(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), and vpGenericFeature::vpGenericFeature().