![]() |
Visual Servoing Platform
version 3.2.0
|
#include <vpFeaturePoint3D.h>
Public Types | |
enum | { FEATURE_ALL = 0xffff } |
enum | vpBasicFeatureDeallocatorType { user, vpServo } |
Public Member Functions | |
vpFeaturePoint3D () | |
virtual | ~vpFeaturePoint3D () |
void | buildFrom (const vpPoint &p) |
void | buildFrom (const double X, const double Y, const double Z) |
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 |
vpFeaturePoint3D * | duplicate () const |
vpColVector | error (const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL) |
double | get_X () const |
double | get_Y () const |
double | get_Z () const |
void | init () |
vpMatrix | interaction (const unsigned int select=FEATURE_ALL) |
void | print (const unsigned int select=FEATURE_ALL) const |
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) |
Static Public Member Functions | |
static unsigned int | selectX () |
static unsigned int | selectY () |
static unsigned int | selectZ () |
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 (const unsigned int select=FEATURE_ALL) const |
virtual double | operator[] (const unsigned int i) const |
void | setDeallocate (vpBasicFeatureDeallocatorType d) |
void | setFlags () |
static unsigned int | selectAll () |
vpBasicFeatureDeallocatorType | deallocate |
void | resetFlags () |
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 207 of file vpFeaturePoint3D.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.
vpFeaturePoint3D::vpFeaturePoint3D | ( | ) |
Default constructor that build a 3D point visual feature and initialize it to .
Definition at line 88 of file vpFeaturePoint3D.cpp.
|
inlinevirtual |
Destructor. Does nothing.
Definition at line 215 of file vpFeaturePoint3D.h.
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 ![]() |
vpFeatureException::badInitializationError | If the depth ( ![]() |
vpFeatureException::badInitializationError | If the depth ( ![]() |
Definition at line 447 of file vpFeaturePoint3D.cpp.
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 ![]() |
vpFeatureException::badInitializationError | If the depth ( ![]() |
vpFeatureException::badInitializationError | If the depth ( ![]() |
Definition at line 403 of file vpFeaturePoint3D.cpp.
|
inlineinherited |
Return the dimension of the feature vector .
Definition at line 109 of file vpBasicFeature.h.
|
virtual |
|
virtual |
|
virtual |
Create an object with the same type.
Implements vpBasicFeature.
Definition at line 519 of file vpFeaturePoint3D.cpp.
|
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 357 of file vpFeaturePoint3D.cpp.
|
inherited |
Get the feature vector .
Definition at line 113 of file vpBasicFeature.cpp.
double vpFeaturePoint3D::get_X | ( | ) | const |
Return the coordinate in the camera frame of the 3D point.
Definition at line 154 of file vpFeaturePoint3D.cpp.
double vpFeaturePoint3D::get_Y | ( | ) | const |
Return the coordinate in the camera frame of the 3D point.
Definition at line 157 of file vpFeaturePoint3D.cpp.
double vpFeaturePoint3D::get_Z | ( | ) | const |
Return the coordinate in the camera frame of the 3D point.
Definition at line 160 of file vpFeaturePoint3D.cpp.
|
inlineinherited |
Definition at line 122 of file vpBasicFeature.h.
|
inherited |
Get the feature vector dimension.
Definition at line 99 of file vpBasicFeature.cpp.
|
virtual |
Initialise the memory space requested for a 3D point visual feature.
By default this feature is initialized to .
Implements vpBasicFeature.
Definition at line 63 of file vpFeaturePoint3D.cpp.
|
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 229 of file vpFeaturePoint3D.cpp.
|
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 3D point feature coordinates.
|
Implements vpBasicFeature.
Definition at line 495 of file vpFeaturePoint3D.cpp.
|
protectedinherited |
Definition at line 130 of file vpBasicFeature.cpp.
References vpBasicFeature::flags, and vpBasicFeature::nbParameters.
|
inlinestaticinherited |
Select all the features.
Definition at line 141 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 583 of file vpFeaturePoint3D.cpp.
|
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 610 of file vpFeaturePoint3D.cpp.
|
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.
void vpFeaturePoint3D::set_X | ( | const double | X | ) |
Initialise the coordinate in the camera frame of the 3D Point visual feature
.
X | : ![]() |
Definition at line 99 of file vpFeaturePoint3D.cpp.
void vpFeaturePoint3D::set_XYZ | ( | const double | X, |
const double | Y, | ||
const double | Z | ||
) |
Initialize the 3D point coordinates.
X,Y,Z | : ![]() |
Definition at line 143 of file vpFeaturePoint3D.cpp.
void vpFeaturePoint3D::set_Y | ( | const double | Y | ) |
Initialise the coordinate in the camera frame of the 3D Point visual feature
.
Y | : ![]() |
Definition at line 114 of file vpFeaturePoint3D.cpp.
void vpFeaturePoint3D::set_Z | ( | const double | Z | ) |
Initialise the coordinate in the camera frame of the 3D Point visual feature
.
Z | : ![]() |
Definition at line 129 of file vpFeaturePoint3D.cpp.
|
inlineinherited |
Definition at line 136 of file vpBasicFeature.h.
|
inherited |
Set feature flags to true to prevent warning when re-computing the interaction matrix without having updated the feature.
Definition at line 140 of file vpBasicFeature.cpp.
|
protectedinherited |
Definition at line 147 of file vpBasicFeature.h.
|
protectedinherited |
Dimension of the visual feature.
Definition at line 93 of file vpBasicFeature.h.
Referenced by vpGenericFeature::duplicate(), vpFeatureVanishingPoint::init(), vpFeatureEllipse::init(), and vpFeatureLuminance::init().
|
staticinherited |
Definition at line 79 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::selectMu02(), vpFeatureEllipse::selectMu11(), vpFeatureEllipse::selectMu20(), vpFeatureVanishingPoint::selectY(), and vpFeatureEllipse::selectY().
|
protectedinherited |
Ensure that all the parameters needed to compute the iteraction matrix are set.
Definition at line 97 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::buildFrom(), vpFeatureVanishingPoint::buildFrom(), vpFeatureVanishingPoint::init(), vpFeatureEllipse::init(), vpBasicFeature::resetFlags(), vpFeatureEllipse::set_x(), vpFeatureEllipse::set_xy(), vpFeatureEllipse::set_y(), vpFeatureEllipse::setABC(), and vpFeatureEllipse::setMu().
|
protectedinherited |
Number of parameters needed to compute the interaction matrix.
Definition at line 99 of file vpBasicFeature.h.
Referenced by vpFeatureVanishingPoint::buildFrom(), vpFeatureEllipse::buildFrom(), vpFeatureVanishingPoint::init(), vpFeatureEllipse::init(), vpBasicFeature::resetFlags(), and vpFeatureEllipse::setABC().
|
protectedinherited |
State of the visual feature.
Definition at line 91 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::buildFrom(), vpFeatureVanishingPoint::buildFrom(), vpFeatureMomentAlpha::error(), vpFeatureVanishingPoint::init(), vpFeatureEllipse::init(), vpFeatureLuminance::init(), vpGenericFeature::init(), vpFeatureEllipse::print(), vpFeatureEllipse::set_x(), vpFeatureEllipse::set_xy(), vpFeatureEllipse::set_y(), and vpFeatureEllipse::setMu().