![]() |
Visual Servoing Platform
version 3.3.0
|
#include <vpFeatureDepth.h>
Public Types | |
enum | { FEATURE_ALL = 0xffff } |
enum | vpBasicFeatureDeallocatorType { user, vpServo } |
Public Member Functions | |
vpFeatureDepth () | |
virtual | ~vpFeatureDepth () |
void | buildFrom (double x, double y, double Z, double LogZoverZstar) |
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 |
vpFeatureDepth * | duplicate () const |
vpColVector | error (const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL) |
double | get_x () const |
double | get_y () const |
double | get_Z () const |
double | get_LogZoverZstar () const |
void | init () |
vpMatrix | interaction (unsigned int select=FEATURE_ALL) |
void | print (unsigned int select=FEATURE_ALL) const |
void | set_x (double x) |
void | set_y (double y) |
void | set_Z (double Z) |
void | set_LogZoverZstar (double LogZoverZstar) |
void | set_xyZLogZoverZstar (double x, double y, double Z, double logZZs) |
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 () |
vpBasicFeatureDeallocatorType | deallocate |
static unsigned int | selectAll () |
void | resetFlags () |
Class that defines a 3D point visual feature which is composed by one parameters that is
that defines the current depth relative to the desired depth. Here
represents the current depth and
the desired depth.
In this class and
are the 2D coordinates in the camera frame and are given in meter.
,
and
are needed during the computation of the interaction matrix
.
The visual features can be set easily thanks to the buildFrom() method.
As the visual feature represents the current depth relative to the desired depth, the desired visual feature
is set to zero. Once the value of the visual feature is set, 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 which is here set to zero.
The code below shows how to create a eye-in hand visual servoing task using a 3D depth feature that corresponds to the current depth relative to the desired depth. To control six degrees of freedom, at least five other features must be considered. First we create a current (
) 3D depth feature. Then we set the task to use the interaction matrix associated to the current feature
. And finally we compute the camera velocity
. The current feature
is updated in the while() loop.
If you want to build your own control law, this other example shows how to create a current ( ) and desired (
) 2D point visual feature, compute the corresponding error vector
and finally build the interaction matrix
.
Definition at line 159 of file vpFeatureDepth.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.
vpFeatureDepth::vpFeatureDepth | ( | ) |
Default constructor that build a visual feature.
Definition at line 93 of file vpFeatureDepth.cpp.
|
inlinevirtual |
Destructor.
Definition at line 176 of file vpFeatureDepth.h.
void vpFeatureDepth::buildFrom | ( | double | x_, |
double | y_, | ||
double | Z_, | ||
double | LogZoverZstar | ||
) |
Build a 3D depth visual feature from the point coordinates and
given in the camera frame,
which describes the depth and
which represents the logarithm of the current depth relative to the desired depth.
x_ | : The ![]() |
y_ | : The ![]() |
Z_ | : The ![]() |
LogZoverZstar | : The ![]() |
Definition at line 371 of file vpFeatureDepth.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 408 of file vpFeatureDepth.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 the current depth relative to the desired depth, 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 | : unuseful in the case of vpFeatureDepth. Always set to FEATURE_ALL. |
vpFeatureException::badInitializationError | : If the desired visual feature ![]() |
The code below shows how to use this method:
Reimplemented from vpBasicFeature.
Definition at line 316 of file vpFeatureDepth.cpp.
double vpFeatureDepth::get_LogZoverZstar | ( | ) | const |
Get the value of which represents the logarithm of the current depth relative to the desired depth.
Definition at line 109 of file vpFeatureDepth.cpp.
|
inherited |
Get the feature vector .
Definition at line 113 of file vpBasicFeature.cpp.
double vpFeatureDepth::get_x | ( | ) | const |
Get the value of which represents the x coordinate of the point in the camera frame.
Definition at line 129 of file vpFeatureDepth.cpp.
double vpFeatureDepth::get_y | ( | ) | const |
Get the value of which represents the y coordinate of the point in the camera frame.
Definition at line 149 of file vpFeatureDepth.cpp.
double vpFeatureDepth::get_Z | ( | ) | const |
Get the value of which represents the depth in the 3D camera frame.
Definition at line 169 of file vpFeatureDepth.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 |
Initialize the memory space requested for 3D depth visual feature.
Implements vpBasicFeature.
Definition at line 74 of file vpFeatureDepth.cpp.
|
virtual |
Compute and return the interaction matrix . The computation is made thanks to the values of the point coordinates
and
and the depth
.
select | : unuseful in the case of vpFeatureDepth. Always set to FEATURE_ALL. |
The code below shows how to compute the interaction matrix associated to the visual feature .
Implements vpBasicFeature.
Definition at line 219 of file vpFeatureDepth.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 | : unuseful in the case of vpFeatureDepth. Always set to FEATURE_ALL. |
Implements vpBasicFeature.
Definition at line 347 of file vpFeatureDepth.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.
void vpFeatureDepth::set_LogZoverZstar | ( | double | LogZoverZstar | ) |
Set the value of which represents the logarithm of the current depth relative to the desired depth.
LogZoverZstar | : ![]() |
Definition at line 101 of file vpFeatureDepth.cpp.
void vpFeatureDepth::set_x | ( | double | x_ | ) |
Set the value of which represents the x coordinate of the point in the camera frame.
x_ | : ![]() |
Definition at line 117 of file vpFeatureDepth.cpp.
void vpFeatureDepth::set_xyZLogZoverZstar | ( | double | x_, |
double | y_, | ||
double | Z_, | ||
double | LogZoverZstar | ||
) |
Set the value of ,
,
and
.
and
represent the coordinates of the point in the camera frame.
is the 3D coordinate representing the depth.
represents the logarithm of the current depth relative to the desired depth.
x_ | : ![]() |
y_ | : ![]() |
Z_ | : ![]() |
LogZoverZstar | : ![]() |
Definition at line 183 of file vpFeatureDepth.cpp.
void vpFeatureDepth::set_y | ( | double | y_ | ) |
Set the value of which represents the y coordinate of the point in the camera frame.
y_ | : ![]() |
Definition at line 137 of file vpFeatureDepth.cpp.
void vpFeatureDepth::set_Z | ( | double | Z_ | ) |
Set the value of which represents the depth in the 3D camera frame.
Z_ | : ![]() |
Definition at line 157 of file vpFeatureDepth.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(), vpFeatureEllipse::init(), and vpFeatureLuminance::init().
|
staticinherited |
Definition at line 79 of file vpBasicFeature.h.
Referenced by vpFeatureEllipse::selectMu02(), vpFeatureEllipse::selectMu11(), vpFeatureEllipse::selectMu20(), 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(), 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 vpFeatureEllipse::buildFrom(), 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(), vpFeatureMomentAlpha::error(), vpFeatureEllipse::init(), vpFeatureLuminance::init(), vpGenericFeature::init(), vpFeatureEllipse::print(), vpFeatureEllipse::set_x(), vpFeatureEllipse::set_xy(), vpFeatureEllipse::set_y(), and vpFeatureEllipse::setMu().