![]() |
Visual Servoing Platform
version 3.2.0
|
#include <vpFeatureThetaU.h>
Public Types | |
enum | vpFeatureThetaUType { TUx = 1, TUy = 2, TUz = 4 } |
enum | vpFeatureThetaURotationRepresentationType { cdRc, cRcd } |
enum | { FEATURE_ALL = 0xffff } |
enum | vpBasicFeatureDeallocatorType { user, vpServo } |
Static Public Member Functions | |
static unsigned int | selectTUx () |
static unsigned int | selectTUy () |
static unsigned int | selectTUz () |
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 a 3D visual feature from a
axis/angle parametrization that represent the rotation between to frames.
Let us denote .
It is convenient to consider two coordinate frames: the current camera frame and the desired camera frame
.
Let be the rotation matrix that gives the orientation of the current camera frame relative to the desired camera frame. Let
to corresponding axis/angle representation of this rotation.
Furthermore, let the rotation matrix that gives the orientation of the desired camera frame relative to the current camera frame. Let
to corresponding axis/angle representation of this rotation.
This class can be used to manipulate two kind of visual features:
The kind of visual feature is to set during the construction of the vpFeatureThetaU() object by using the selector vpFeatureThetaU::vpFeatureThetaURotationRepresentationType.
To initialize the feature you may use vpFeatureThetaU member fonctions like set_TUx(), set_TUy(), set_TUz(), or also buildFrom() fonctions.
Depending on the choice of the visual feature representation, the interaction() method allows to compute the interaction matrix associated to the visual feature, while the error() method computes the error vector
between the current visual feature and the desired one.
To know more on the axis/angle representation for a 3D rotation see the vpThetaUVector class.
The code below shows how to create a eye-in hand visual servoing task using a 3D feature
that correspond to the 3D rotation between the current camera frame and the desired camera frame. To control six degrees of freedom, at least three other features must be considered like vpFeatureTranslation visual features. First we create a current (
) 3D
feature, than set the task to use the interaction matrix associated to the current feature
and than compute the camera velocity
. The current feature
is updated in the while() loop while
is considered as zero.
If you want to deal only with the subset feature from the 3D
, 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
visual feature, compute the corresponding error vector
and finally build the interaction matrix
.
Definition at line 223 of file vpFeatureThetaU.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.
Definition at line 234 of file vpFeatureThetaU.h.
Definition at line 226 of file vpFeatureThetaU.h.
vpFeatureThetaU::vpFeatureThetaU | ( | ) |
Constructor that builds a visual feature and initialize it to zero. The rotation representation of the visual feature will be vpFeatureThetaU::cdRc by default. Use the function setFeatureThetaURotationType() to set the desired type of feature.
Definition at line 87 of file vpFeatureThetaU.cpp.
|
explicit |
Constructor that builds a visual feature and initialize it to zero.
r | [in] : The rotation representation of the ![]() |
Definition at line 100 of file vpFeatureThetaU.cpp.
vpFeatureThetaU::vpFeatureThetaU | ( | vpThetaUVector & | tu, |
vpFeatureThetaURotationRepresentationType | r | ||
) |
Constructor that build a 3D visual feature from a vector that represent the rotation
the camera has to achieve.
tu | [in] : Rotation that the camera has to achieve in ![]() ![]() ![]() |
r | [in] : The rotation representation of ![]() |
Definition at line 128 of file vpFeatureThetaU.cpp.
vpFeatureThetaU::vpFeatureThetaU | ( | vpRotationMatrix & | R, |
vpFeatureThetaURotationRepresentationType | r | ||
) |
Constructor that build a 3D visual feature from a rotation matrix
that represent the rotation that the camera has to achieve.
R | [in] : Rotation that the camera has to achieve. Depending on r this rotation represent either the rotation that the camera has to achieve to move from the desired camera frame to the current one ( ![]() ![]() |
r | [in] : The rotation representation of R. |
Definition at line 152 of file vpFeatureThetaU.cpp.
vpFeatureThetaU::vpFeatureThetaU | ( | vpHomogeneousMatrix & | M, |
vpFeatureThetaURotationRepresentationType | r | ||
) |
Constructor that build a 3D visual feature from an homogeneous matrix
that represent the displacement that the camera has to achieve.
M | [in] : Homogeneous transformation that describe the movement that the camera has to achieve. Only the rotational part of this homogeneous transformation is taken into consideration. Depending on r the rotation represent either the rotation that the camera has to achieve to move from the desired camera frame to the current one ( ![]() ![]() |
r | [in] : The rotation representation of M. |
Definition at line 179 of file vpFeatureThetaU.cpp.
|
inlinevirtual |
Destructor. Does nothing.
Definition at line 257 of file vpFeatureThetaU.h.
void vpFeatureThetaU::buildFrom | ( | const vpHomogeneousMatrix & | M | ) |
Build a 3D visual feature from an homogeneous matrix
that represent the displacement that the camera has to achieve.
M | [in] : Homogeneous transformation that describe the movement that the camera has to achieve. Only the rotational part of this homogeneous transformation is taken into consideration. Depending on the rotation representation type (vpFeatureThetaU::vpFeatureThetaURotationRepresentationType) used to construct this object, the parameter M represents either the rotation that the camera has to achieve to move from the desired camera frame to the current one ( ![]() ![]() |
Definition at line 252 of file vpFeatureThetaU.cpp.
void vpFeatureThetaU::buildFrom | ( | const vpRotationMatrix & | R | ) |
Build a 3D visual feature from a rotation matrix
that represent the rotation that the camera has to achieve.
R | [in] : Rotation that the camera has to achieve. Depending on the rotation representation type (vpFeatureThetaU::vpFeatureThetaURotationRepresentationType) used to construct this object, the parameter R represents either the rotation that the camera has to achieve to move from the desired camera frame to the current one ( ![]() ![]() |
Definition at line 228 of file vpFeatureThetaU.cpp.
void vpFeatureThetaU::buildFrom | ( | vpThetaUVector & | tu | ) |
Build a 3D visual feature from a vector that represent the rotation
the camera has to achieve.
tu | [in] : Rotation that the camera has to achieve in ![]() ![]() ![]() |
Definition at line 204 of file vpFeatureThetaU.cpp.
|
inlineinherited |
Return the dimension of the feature vector .
Definition at line 109 of file vpBasicFeature.h.
|
virtual |
|
virtual |
|
virtual |
Feature duplication.
Create an object with the same type.
Implements vpBasicFeature.
Definition at line 648 of file vpFeatureThetaU.cpp.
|
virtual |
Compute the error between the current and the desired visual features from a subset of the possible features.
Since this visual feature represent either the rotation from the desired camera frame to the current camera frame
, or the rotation from the current camera frame to the desired camera frame
, the desired visual feature
should be zero. Thus, the error is here equal to the current visual feature
.
s_star | : Desired visual visual feature that should be equal to zero. |
select | : The error can be computed for a selection of a subset of the possible ![]()
|
vpFeatureException::badInitializationError | : If the desired visual feature ![]() |
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 566 of file vpFeatureThetaU.cpp.
|
inherited |
Get the feature vector .
Definition at line 113 of file vpBasicFeature.cpp.
double vpFeatureThetaU::get_TUx | ( | ) | const |
Return the subset value of the visual feature
.
Definition at line 329 of file vpFeatureThetaU.cpp.
double vpFeatureThetaU::get_TUy | ( | ) | const |
Return the subset value of the visual feature
.
Definition at line 336 of file vpFeatureThetaU.cpp.
double vpFeatureThetaU::get_TUz | ( | ) | const |
Return the subset value of the visual feature
.
Definition at line 343 of file vpFeatureThetaU.cpp.
|
inlineinherited |
Definition at line 122 of file vpBasicFeature.h.
|
inherited |
Get the feature vector dimension.
Definition at line 99 of file vpBasicFeature.cpp.
vpFeatureThetaU::vpFeatureThetaURotationRepresentationType vpFeatureThetaU::getFeatureThetaURotationType | ( | ) | const |
Get the type of rotation feature.
Definition at line 318 of file vpFeatureThetaU.cpp.
|
virtual |
Initialise the memory space requested for 3D visual feature.
Implements vpBasicFeature.
Definition at line 66 of file vpFeatureThetaU.cpp.
|
virtual |
Compute and return the interaction matrix from a subset (
) of the possible
features that represent the 3D rotation
or
, with
See the vpFeatureThetaU class description for the equations of .
select | : Selection of a subset of the possible ![]()
|
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 components 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 407 of file vpFeatureThetaU.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 ![]()
|
Implements vpBasicFeature.
Definition at line 622 of file vpFeatureThetaU.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 of the
visual feature.
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 718 of file vpFeatureThetaU.cpp.
|
static |
Function used to select the subset of the
visual feature.
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 743 of file vpFeatureThetaU.cpp.
|
static |
Function used to select the subset of the
visual feature.
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 768 of file vpFeatureThetaU.cpp.
void vpFeatureThetaU::set_TUx | ( | const double | tu_x | ) |
Initialise the subset value of the 3D visual feature
.
tu_x | : ![]() |
Definition at line 278 of file vpFeatureThetaU.cpp.
void vpFeatureThetaU::set_TUy | ( | const double | tu_y | ) |
Initialise the subset value of the 3D visual feature
.
tu_y | : ![]() |
Definition at line 291 of file vpFeatureThetaU.cpp.
void vpFeatureThetaU::set_TUz | ( | const double | tu_z | ) |
Initialise the subset value of the 3D visual feature
.
tu_z | : ![]() |
Definition at line 304 of file vpFeatureThetaU.cpp.
|
inlineinherited |
Definition at line 136 of file vpBasicFeature.h.
void vpFeatureThetaU::setFeatureThetaURotationType | ( | const vpFeatureThetaURotationRepresentationType | r | ) |
Set the type of rotation feature.
r | : type of feature. It can be vpFeatureThetaU::cdRc or vpFeatureThetaU::cRcd. |
Definition at line 268 of file vpFeatureThetaU.cpp.
|
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().