Visual Servoing Platform
version 3.0.0
|
#include <visp3/visual_features/vpFeaturePoint3D.h>
Public Types | |
enum | { FEATURE_ALL = 0xffff } |
enum | vpBasicFeatureDeallocatorType { user, vpServo } |
Public Member Functions | |
void | init () |
vpFeaturePoint3D () | |
virtual | ~vpFeaturePoint3D () |
void | buildFrom (const vpPoint &p) |
void | buildFrom (const double X, const double Y, const double Z) |
void | set_X (const double X) |
void | set_Y (const double Y) |
void | set_Z (const double Z) |
void | set_XYZ (const double X, const double Y, const double Z) |
double | get_X () const |
double | get_Y () const |
double | get_Z () const |
vpMatrix | interaction (const unsigned int select=FEATURE_ALL) |
vpColVector | error (const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL) |
void | print (const unsigned int select=FEATURE_ALL) const |
vpFeaturePoint3D * | duplicate () const |
void | display (const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const |
void | display (const vpCameraParameters &cam, const vpImage< vpRGBa > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const |
unsigned int | dimension_s () |
virtual double | operator[] (const unsigned int i) const |
vpColVector | get_s (unsigned int select=FEATURE_ALL) const |
unsigned int | getDimension (const unsigned int select=FEATURE_ALL) const |
void | setFlags () |
void | setDeallocate (vpBasicFeatureDeallocatorType d) |
vpBasicFeatureDeallocatorType | getDeallocate () |
Static Public Member Functions | |
static unsigned int | selectX () |
static unsigned int | selectY () |
static unsigned int | selectZ () |
static unsigned int | selectAll () |
Static Public Attributes | |
static const unsigned int | FEATURE_LINE [32] |
Protected Member Functions | |
void | resetFlags () |
Protected Attributes | |
vpColVector | s |
unsigned int | dim_s |
bool * | flags |
unsigned int | nbParameters |
vpBasicFeatureDeallocatorType | deallocate |
Class that defines the 3D point visual feature.
A 3D point visual feature corresponds to a 3D point with coordinates in the camera frame.
This class is intended to manipulate the 3D point visual feature . The interaction matrix related to is given by:
Two ways are allowed to initialize the feature.
The interaction() method allows to compute the interaction matrix associated to the 3D point visual feature, while the error() method computes the error vector between the current visual feature and the desired one.
The code below shows how to create a eye-in hand visual servoing task using a 3D point feature that correspond to the 3D point coordinates in the camera frame. To control six degrees of freedom, at least three other features must be considered like vpFeatureThetaU visual features. First we create a current ( ) and desired ( ) 3D point feature, set the task to use the interaction matrix associated to the desired feature and than compute the camera velocity . The current feature is updated in the while() loop while is set to .
If you want to deal only with the subset feature from the 3D point feature, you have just to modify the addFeature() call in the previous example by the following line. In that case, the dimension of is two.
If you want to build your own control law, this other example shows how to create a current ( ) and desired ( ) 3D point visual feature, compute the corresponding error vector and finally build the interaction matrix .
Definition at line 210 of file vpFeaturePoint3D.h.
|
inherited |
Enumerator | |
---|---|
FEATURE_ALL |
Definition at line 84 of file vpBasicFeature.h.
|
inherited |
Indicates who should deallocate the feature.
Enumerator | |
---|---|
user | |
vpServo |
Definition at line 153 of file vpBasicFeature.h.
vpFeaturePoint3D::vpFeaturePoint3D | ( | ) |
Default constructor that build a 3D point visual feature and initialize it to .
Definition at line 94 of file vpFeaturePoint3D.cpp.
References init().
Referenced by duplicate().
|
inlinevirtual |
Destructor. Does nothing.
Definition at line 220 of file vpFeaturePoint3D.h.
void vpFeaturePoint3D::buildFrom | ( | const vpPoint & | p | ) |
Build a 3D point visual feature from the camera frame coordinates of a point.
p | : A point with camera frame coordinates up to date (see vpPoint class). |
vpFeatureException::badInitializationError | If the depth ( coordinate) is negative. That means that the 3D point is behind the camera which is not possible. |
vpFeatureException::badInitializationError | If the depth ( coordinate) is null. That means that the 3D point is on the camera which is not possible. |
Definition at line 437 of file vpFeaturePoint3D.cpp.
References vpFeatureException::badInitializationError, vpTracker::cP, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpBasicFeature::s, and vpERROR_TRACE.
void vpFeaturePoint3D::buildFrom | ( | const double | X, |
const double | Y, | ||
const double | Z | ||
) |
Build a 3D point visual feature from the camera frame coordinates of a point.
X,Y,Z | : Camera frame coordinates of a 3D point. |
vpFeatureException::badInitializationError | If the depth ( coordinate) is negative. That means that the 3D point is on the camera which is not possible. |
vpFeatureException::badInitializationError | If the depth ( coordinate) is null. That means that the 3D point is on the camera which is not possible. |
Definition at line 486 of file vpFeaturePoint3D.cpp.
References vpFeatureException::badInitializationError, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpBasicFeature::s, and vpERROR_TRACE.
|
inlineinherited |
Return the dimension of the feature vector .
Definition at line 101 of file vpBasicFeature.h.
|
virtual |
Not implemented.
Implements vpBasicFeature.
Definition at line 576 of file vpFeaturePoint3D.cpp.
References vpERROR_TRACE.
|
virtual |
Not implemented.
Implements vpBasicFeature.
Definition at line 597 of file vpFeaturePoint3D.cpp.
References vpERROR_TRACE.
|
virtual |
Create an object with the same type.
Implements vpBasicFeature.
Definition at line 565 of file vpFeaturePoint3D.cpp.
References vpFeaturePoint3D().
|
virtual |
Compute the error between the current and the desired visual features from a subset of the possible features.
s_star | : Desired 3D point visual feature. |
select | : The error can be computed for a selection of a subset of the possible 3D point coordinate features.
|
The code below shows how to use this method to manipulate the subset:
To manipulate the subset features , the code becomes:
Reimplemented from vpBasicFeature.
Definition at line 384 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::s, selectX(), selectY(), selectZ(), and vpColVector::stack().
|
inherited |
Get the feature vector .
Definition at line 130 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpBasicFeature::s, and vpColVector::stack().
Referenced by vpServo::computeError(), vpBasicFeature::error(), vpGenericFeature::error(), vpFeatureDepth::error(), vpFeatureThetaU::error(), and vpFeatureTranslation::error().
double vpFeaturePoint3D::get_X | ( | ) | const |
Return the coordinate in the camera frame of the 3D point.
Definition at line 170 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::s.
Referenced by interaction(), and print().
double vpFeaturePoint3D::get_Y | ( | ) | const |
Return the coordinate in the camera frame of the 3D point.
Definition at line 177 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::s.
Referenced by interaction(), and print().
double vpFeaturePoint3D::get_Z | ( | ) | const |
Return the coordinate in the camera frame of the 3D point.
Definition at line 184 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::s.
Referenced by interaction(), and print().
|
inlineinherited |
Definition at line 163 of file vpBasicFeature.h.
|
inherited |
Get the feature vector dimension.
Definition at line 115 of file vpBasicFeature.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpArray2D< Type >::getRows(), and vpBasicFeature::s.
|
virtual |
Initialise the memory space requested for a 3D point visual feature.
By default this feature is initialized to .
Implements vpBasicFeature.
Definition at line 69 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::dim_s, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpColVector::resize(), and vpBasicFeature::s.
Referenced by vpFeaturePoint3D().
|
virtual |
Compute and return the interaction matrix associated to a subset of the possible 3D point features that represent the 3D point coordinates expressed in the camera frame.
select | : Selection of a subset of the possible 3D point coordinate 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 subset visual feature:
L_XY is here now a 2 by 6 matrix. The first line corresponds to the visual feature while the second one to the visual feature.
It is also possible to build the interaction matrix from all the 3D point coordinates by:
In that case, L_XYZ is a 3 by 6 interaction matrix where the last line corresponds to the visual feature.
Implements vpBasicFeature.
Definition at line 257 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::deallocate, vpBasicFeature::flags, get_X(), get_Y(), get_Z(), vpBasicFeature::nbParameters, vpBasicFeature::resetFlags(), vpArray2D< Type >::resize(), selectX(), selectY(), selectZ(), vpMatrix::stack(), vpBasicFeature::user, and vpTRACE.
|
inlinevirtualinherited |
Return element i in the state vector (usage : x = s[i] )
Definition at line 112 of file vpBasicFeature.h.
|
virtual |
Print to stdout the values of the current visual feature .
select | : Selection of a subset of the possible 3D point feature coordinates.
|
Implements vpBasicFeature.
Definition at line 540 of file vpFeaturePoint3D.cpp.
References get_X(), get_Y(), get_Z(), selectX(), selectY(), and selectZ().
|
protectedinherited |
Definition at line 148 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
Referenced by vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), interaction(), vpFeatureThetaU::interaction(), vpFeaturePointPolar::interaction(), and vpFeatureTranslation::interaction().
|
inlinestaticinherited |
Select all the features.
Definition at line 115 of file vpBasicFeature.h.
|
static |
Function used to select the subset coordinate of the 3D point visual feature.
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to feature.
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 636 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::FEATURE_LINE.
Referenced by error(), interaction(), and print().
|
static |
Function used to select the subset coordinate of the 3D point visual feature.
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to feature.
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 662 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::FEATURE_LINE.
Referenced by error(), interaction(), and print().
|
static |
Function used to select the subset coordinate of the 3D point visual feature.
This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to feature.
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 688 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::FEATURE_LINE.
Referenced by error(), interaction(), and print().
void vpFeaturePoint3D::set_X | ( | const double | X | ) |
Initialise the coordinate in the camera frame of the 3D Point visual feature .
X | : coordinate of the visual feature. |
Definition at line 110 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::flags, and vpBasicFeature::s.
Referenced by vpFeatureBuilder::create(), and set_XYZ().
void vpFeaturePoint3D::set_XYZ | ( | const double | X, |
const double | Y, | ||
const double | Z | ||
) |
Initialize the 3D point coordinates.
X,Y,Z | : coordinates in the camera frame of the 3D point visual feature. |
Definition at line 157 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::flags, vpBasicFeature::nbParameters, set_X(), set_Y(), and set_Z().
void vpFeaturePoint3D::set_Y | ( | const double | Y | ) |
Initialise the coordinate in the camera frame of the 3D Point visual feature .
Y | : coordinate of the visual feature. |
Definition at line 126 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::flags, and vpBasicFeature::s.
Referenced by vpFeatureBuilder::create(), and set_XYZ().
void vpFeaturePoint3D::set_Z | ( | const double | Z | ) |
Initialise the coordinate in the camera frame of the 3D Point visual feature .
Z | : coordinate or depth of the visual feature. |
Definition at line 142 of file vpFeaturePoint3D.cpp.
References vpBasicFeature::flags, and vpBasicFeature::s.
Referenced by vpFeatureBuilder::create(), and set_XYZ().
|
inlineinherited |
Definition at line 162 of file vpBasicFeature.h.
Referenced by vpServo::addFeature().
|
inherited |
Set feature flags to true to prevent warning when re-computing the interaction matrix without having updated the feature.
Definition at line 158 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
|
protectedinherited |
Definition at line 160 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), interaction(), vpFeatureThetaU::interaction(), vpFeaturePointPolar::interaction(), vpFeatureTranslation::interaction(), and vpBasicFeature::operator=().
|
protectedinherited |
Dimension of the visual feature.
Definition at line 92 of file vpBasicFeature.h.
Referenced by vpFeatureMoment::duplicate(), vpGenericFeature::duplicate(), vpBasicFeature::error(), vpFeatureLuminance::error(), vpGenericFeature::error(), vpBasicFeature::get_s(), vpGenericFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpFeaturePoint::init(), vpFeatureMoment::init(), vpFeatureLine::init(), init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureLuminance::interaction(), vpGenericFeature::interaction(), vpFeatureMoment::interaction(), vpBasicFeature::operator=(), vpFeatureLuminance::operator=(), vpGenericFeature::print(), vpFeatureMoment::print(), vpGenericFeature::set_s(), vpGenericFeature::setError(), vpGenericFeature::setInteractionMatrix(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpGenericFeature::vpGenericFeature().
|
staticinherited |
Definition at line 82 of file vpBasicFeature.h.
Referenced by vpBasicFeature::error(), vpGenericFeature::error(), vpBasicFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), vpGenericFeature::interaction(), vpFeatureMoment::interaction(), vpGenericFeature::print(), vpFeatureMoment::print(), vpFeatureSegment::selectAlpha(), vpFeatureSegment::selectL(), vpFeatureEllipse::selectMu02(), vpFeatureEllipse::selectMu11(), vpFeatureEllipse::selectMu20(), vpFeatureLine::selectRho(), vpFeaturePointPolar::selectRho(), vpFeatureLine::selectTheta(), vpFeaturePointPolar::selectTheta(), vpFeatureThetaU::selectTUx(), vpFeatureThetaU::selectTUy(), vpFeatureThetaU::selectTUz(), vpFeatureTranslation::selectTx(), vpFeatureTranslation::selectTy(), vpFeatureTranslation::selectTz(), vpFeatureEllipse::selectX(), vpFeatureVanishingPoint::selectX(), vpFeaturePoint::selectX(), selectX(), vpFeatureSegment::selectXc(), vpFeatureEllipse::selectY(), vpFeatureVanishingPoint::selectY(), vpFeaturePoint::selectY(), selectY(), vpFeatureSegment::selectYc(), and selectZ().
|
protectedinherited |
Ensure that all the parameters needed to compute the iteraction matrix are set.
Definition at line 95 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::buildFrom(), vpFeatureVanishingPoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpFeaturePoint::init(), vpFeatureMoment::init(), vpFeatureLine::init(), init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), interaction(), vpFeatureThetaU::interaction(), vpFeaturePointPolar::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_rhoThetaZ(), vpFeaturePointPolar::set_theta(), vpFeatureThetaU::set_TUx(), vpFeatureThetaU::set_TUy(), vpFeatureThetaU::set_TUz(), vpFeatureEllipse::set_x(), vpFeatureVanishingPoint::set_x(), vpFeatureDepth::set_x(), vpFeaturePoint::set_x(), set_X(), vpFeatureEllipse::set_xy(), vpFeaturePoint::set_xyZ(), set_XYZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureEllipse::set_y(), vpFeatureVanishingPoint::set_y(), vpFeatureDepth::set_y(), vpFeaturePoint::set_y(), set_Y(), vpFeatureLuminance::set_Z(), vpFeatureDepth::set_Z(), vpFeaturePoint::set_Z(), set_Z(), vpFeaturePointPolar::set_Z(), vpFeatureEllipse::setABC(), vpFeatureLine::setABCD(), vpBasicFeature::setFlags(), vpFeatureEllipse::setMu(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpBasicFeature::~vpBasicFeature().
|
protectedinherited |
Number of parameters needed to compute the interaction matrix.
Definition at line 97 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::buildFrom(), vpFeatureVanishingPoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpFeaturePoint::init(), vpFeatureMoment::init(), vpFeatureLine::init(), init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), interaction(), vpFeatureThetaU::interaction(), vpFeaturePointPolar::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), vpFeaturePointPolar::set_rhoThetaZ(), vpFeaturePoint::set_xyZ(), 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 90 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::buildFrom(), vpFeatureLuminance::buildFrom(), vpFeatureVanishingPoint::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), buildFrom(), vpFeatureThetaU::buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureEllipse::display(), vpFeatureMoment::duplicate(), vpFeatureEllipse::error(), vpFeatureVanishingPoint::error(), vpBasicFeature::error(), vpFeatureLuminance::error(), vpFeatureMomentAlpha::error(), vpGenericFeature::error(), vpFeatureDepth::error(), vpFeaturePoint::error(), vpFeatureLine::error(), error(), vpFeatureThetaU::error(), vpFeaturePointPolar::error(), vpFeatureTranslation::error(), vpFeatureDepth::get_LogZoverZstar(), vpFeaturePointPolar::get_rho(), vpBasicFeature::get_s(), vpGenericFeature::get_s(), vpFeaturePointPolar::get_theta(), vpFeatureThetaU::get_TUx(), vpFeatureThetaU::get_TUy(), vpFeatureThetaU::get_TUz(), vpFeatureTranslation::get_Tx(), vpFeatureTranslation::get_Ty(), vpFeatureTranslation::get_Tz(), vpFeatureVanishingPoint::get_x(), vpFeaturePoint::get_x(), get_X(), vpFeatureVanishingPoint::get_y(), vpFeaturePoint::get_y(), get_Y(), get_Z(), vpBasicFeature::getDimension(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpGenericFeature::init(), vpFeaturePoint::init(), vpFeatureMoment::init(), vpFeatureLine::init(), init(), vpFeatureThetaU::init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpFeatureEllipse::print(), vpFeatureSegment::print(), vpGenericFeature::print(), vpFeatureMoment::print(), vpFeatureLine::print(), vpFeatureThetaU::print(), vpFeatureTranslation::print(), vpFeatureDepth::set_LogZoverZstar(), vpFeaturePointPolar::set_rho(), vpGenericFeature::set_s(), vpFeaturePointPolar::set_theta(), vpFeatureThetaU::set_TUx(), vpFeatureThetaU::set_TUy(), vpFeatureThetaU::set_TUz(), vpFeatureTranslation::set_Tx(), vpFeatureTranslation::set_Ty(), vpFeatureTranslation::set_Tz(), vpFeatureEllipse::set_x(), vpFeatureVanishingPoint::set_x(), vpFeaturePoint::set_x(), set_X(), vpFeatureEllipse::set_xy(), vpFeatureEllipse::set_y(), vpFeatureVanishingPoint::set_y(), vpFeaturePoint::set_y(), set_Y(), set_Z(), vpFeatureEllipse::setMu(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), and vpGenericFeature::vpGenericFeature().