Visual Servoing Platform  version 3.3.0 under development (2020-02-17)

#include <visp3/visual_features/vpFeatureThetaU.h>

+ Inheritance diagram for vpFeatureThetaU:

Public Types

enum  vpFeatureThetaUType { TUx = 1, TUy = 2, TUz = 4 }
 
enum  vpFeatureThetaURotationRepresentationType { cdRc, cRcd }
 
enum  { FEATURE_ALL = 0xffff }
 
enum  vpBasicFeatureDeallocatorType { user, vpServo }
 

Public Member Functions

 vpFeatureThetaU ()
 
 vpFeatureThetaU (vpFeatureThetaURotationRepresentationType r)
 
 vpFeatureThetaU (vpThetaUVector &tu, vpFeatureThetaURotationRepresentationType r)
 
 vpFeatureThetaU (vpRotationMatrix &R, vpFeatureThetaURotationRepresentationType r)
 
 vpFeatureThetaU (vpHomogeneousMatrix &M, vpFeatureThetaURotationRepresentationType r)
 
virtual ~vpFeatureThetaU ()
 
void buildFrom (vpThetaUVector &tu)
 
void buildFrom (const vpRotationMatrix &R)
 
void buildFrom (const vpHomogeneousMatrix &M)
 
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
 
vpFeatureThetaUduplicate () const
 
vpColVector error (const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL)
 
vpFeatureThetaURotationRepresentationType getFeatureThetaURotationType () const
 
double get_TUx () const
 
double get_TUy () const
 
double get_TUz () const
 
void init ()
 
vpMatrix interaction (unsigned int select=FEATURE_ALL)
 
void print (unsigned int select=FEATURE_ALL) const
 
void set_TUx (double tu_x)
 
void set_TUy (double tu_y)
 
void set_TUz (double tu_z)
 
void setFeatureThetaURotationType (const vpFeatureThetaURotationRepresentationType r)
 
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 Public Member Functions

static unsigned int selectTUx ()
 
static unsigned int selectTUy ()
 
static unsigned int selectTUz ()
 
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
 

Detailed Description

Class that defines a 3D visual feature $ s$ from a $ \theta u $ axis/angle parametrization that represent the rotation between to frames.

Let us denote $ \theta u = (\theta u_x, \theta u_y, \theta u_z)$ .

It is convenient to consider two coordinate frames: the current camera frame $ {\cal{F}}_c $ and the desired camera frame $ {\cal{F}}_{c^*} $.

Let $^{c^*}R_c $ be the rotation matrix that gives the orientation of the current camera frame relative to the desired camera frame. Let $ \theta u_{^{c^*}R_c} $ to corresponding axis/angle representation of this rotation.

Furthermore, let $^{c}R_{c^*} $ the rotation matrix that gives the orientation of the desired camera frame relative to the current camera frame. Let $ \theta u_{^{c}R_{c^*}} $ to corresponding axis/angle representation of this rotation.

This class can be used to manipulate two kind of visual features:

  • $ s = \theta u_{^{c^*}R_c} $ if the orientation of current camera frame relative to the desired frame has to be considered. The desired visual feature $ s^* $ is equal to zero. The corresponding error is than equal to $ e=(s-s^*) = \theta u_{^{c^*}R_c} $. In this case, the interaction matrix related to $ s $ is given by

    \[ L = \left[ \begin{array}{cc} 0_3 & L_{\theta u} \end{array} \right] \]

    with

    \[ L_{\theta u} = I_3 + \frac{\theta}{2} \; [u]_\times + \left(1 - \frac{sinc \theta}{sinc^2 \frac{\theta}{2}}\right) [u]^2_\times \]

    where $ 0_3 $ is a $ 3 \times 3 $ nul matrix, $ I_3 $ is the $3 \times 3$ identity matrix, and for more readability $ \theta $ and $ u $ respectively the angle and the axis coordinates of the $ \theta u_{^{c^*}R_c} $ representation.
  • $ s = \theta u_{^{c}R_{c^*}} $ if it is more the orientation of the desired camera frame relative to the current frame that has to be considered. The desired visual feature $ s^* $ is equal to zero. The corresponding error is than equal to $e=(s-s^*) = \theta u_{^{c}R_{c^*}} $. In this case, the interaction matrix related to $ s $ is given by

    \[ L = \left[ \begin{array}{cc} 0_3 & L_{\theta u} \end{array} \right] \]

    with

    \[ L_{\theta u} = -I_3 + \frac{\theta}{2} \; [u]_\times - \left(1 - \frac{sinc \theta}{sinc^2 \frac{\theta}{2}}\right) [u]^2_\times \]

    where $ 0_3 $ is a $ 3 \times 3 $ nul matrix, $ I_3 $ is the $3 \times 3$ identity matrix, and for more readability $ \theta $ and $ u $ respectively the angle and the axis coordinates of the $ \theta u_{^{c}R_{c^*}} $ representation.

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 $(\theta u_x, \theta u_y, \theta u_z)$ 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 $ L $ associated to the visual feature, while the error() method computes the error vector $(s - s^*)$ between the current visual feature and the desired one.

To know more on the $ \theta u $ 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 $\theta u$ feature $(\theta u_x,\theta u_y, \theta u_z)$ 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 ( $s$) 3D $\theta u$ feature, than set the task to use the interaction matrix associated to the current feature $L_s$ and than compute the camera velocity $v=-\lambda \; L_s^+ \; (s-s^*)$. The current feature $s$ is updated in the while() loop while $s^*$ is considered as zero.

#include <visp3/core/vpHomogeneousMatrix.h>
#include <visp3/visual_features/vpFeatureThetaU.h>
#include <visp3/vs/vpServo.h>
int main()
{
vpServo task; // Visual servoing task
// ... cMcd need here to be initialized from for example a pose estimation.
// Creation of the current feature s that correspond to the rotation
// in angle/axis parametrization between the current camera frame
// and the desired camera frame
s.buildFrom(cMcd); // Initialization of the feature
// Set eye-in-hand control law.
// The computed velocities will be expressed in the camera frame
// Interaction matrix is computed with the current visual features s
// Add the 3D ThetaU feature to the task
task.addFeature(s); // s* is here considered as zero
// Control loop
for ( ; ; ) {
// ... cMcd need here to be initialized from for example a pose estimation.
// Update the current ThetaU visual feature
s.buildFrom(cMcd);
// compute the control law
vpColVector v = task.computeControlLaw(); // camera velocity
}
}

If you want to deal only with the $(\theta u_x,\theta u_y)$ subset feature from the 3D $\theta u$ , you have just to modify the addFeature() call in the previous example by the following line. In that case, the dimension of $s$ is two.

// Add the (ThetaU_x, ThetaU_y) subset features from the 3D ThetaU
// rotation to the task

If you want to build your own control law, this other example shows how to create a current ( $s$) and desired ( $s^*$) 3D $\theta u$ visual feature, compute the corresponding error vector $(s-s^*)$ and finally build the interaction matrix $L_s$.

#include <visp3/core/vpHomogeneousMatrix.h>
#include <visp3/core/vpMatrix.h>
#include <visp3/visual_features/vpFeatureThetaU.h>
int main()
{
// ... cdMc need here to be initialized from for example a pose estimation.
// Creation of the current feature s
s.buildFrom(cdMc); // Initialization of the feature
// Creation of the desired feature s*. By default this feature is
// initialized to zero
// Compute the interaction matrix L_s for the current ThetaU feature
vpMatrix L = s.interaction();
// Compute the error vector (s-s*) for the ThetaU feature
s.error(s_star);
}
Examples:
servoAfma62DhalfCamVelocity.cpp, servoFrankaPBVS.cpp, servoSimu3D_cdMc_CamVelocity.cpp, servoSimu3D_cMcd_CamVelocity.cpp, servoSimuPoint2DhalfCamVelocity1.cpp, servoSimuPoint2DhalfCamVelocity2.cpp, servoSimuPoint2DhalfCamVelocity3.cpp, servoSimuThetaUCamVelocity.cpp, and testFeature.cpp.

Definition at line 224 of file vpFeatureThetaU.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
FEATURE_ALL 

Definition at line 82 of file vpBasicFeature.h.

◆ vpBasicFeatureDeallocatorType

Indicates who should deallocate the feature.

Enumerator
user 
vpServo 

Definition at line 88 of file vpBasicFeature.h.

◆ vpFeatureThetaURotationRepresentationType

Enumerator
cdRc 

Selector used to manipulate the visual feature $ s = \theta u_{^{c^*}R_c} $. This visual feature represent the orientation of the current camera frame relative to the desired camera frame.

cRcd 

Selector used to manipulate the visual feature $ s = \theta u_{^{c}R_{c^*}} $. This visual feature represent the orientation of the desired camera frame relative to the current camera frame.

Definition at line 235 of file vpFeatureThetaU.h.

◆ vpFeatureThetaUType

Enumerator
TUx 

Select the subset $ \theta u_x $ visual feature from the $ \theta u$ angle/axis representation.

TUy 

Select the subset $ \theta u_y $ visual feature from the $ \theta u$ angle/axis representation.

TUz 

Select the subset $ \theta u_z $ visual feature from the $ \theta u$ angle/axis representation.

Definition at line 227 of file vpFeatureThetaU.h.

Constructor & Destructor Documentation

◆ vpFeatureThetaU() [1/5]

vpFeatureThetaU::vpFeatureThetaU ( )

Constructor that builds a visual feature and initialize it to zero. The rotation representation of the $ \theta u$ visual feature will be vpFeatureThetaU::cdRc by default. Use the function setFeatureThetaURotationType() to set the desired type of feature.

Definition at line 88 of file vpFeatureThetaU.cpp.

References init().

Referenced by duplicate().

◆ vpFeatureThetaU() [2/5]

vpFeatureThetaU::vpFeatureThetaU ( vpFeatureThetaURotationRepresentationType  r)
explicit

Constructor that builds a visual feature and initialize it to zero.

Parameters
r[in] : The rotation representation of the $ \theta u$ visual feature.

Definition at line 101 of file vpFeatureThetaU.cpp.

References init().

◆ vpFeatureThetaU() [3/5]

vpFeatureThetaU::vpFeatureThetaU ( vpThetaUVector tu,
vpFeatureThetaURotationRepresentationType  r 
)

Constructor that build a 3D visual feature from a $ \theta u $ vector that represent the rotation $ R $ the camera has to achieve.

Parameters
tu[in] : Rotation that the camera has to achieve in $ \theta u $ angle/axis representation. Depending on the rotation representation type (vpFeatureThetaU::vpFeatureThetaURotationRepresentationType) used to construct this object, the parameter tu represents either the rotation that the camera has to achieve to move from the desired camera frame to the current one ( $ ^{c^*}R_c$), or the rotation that the camera has to achieve to move from the current camera frame to the desired one ( $ ^{c}R_{c^*}$).
r[in] : The rotation representation of $ \theta u $.

Definition at line 129 of file vpFeatureThetaU.cpp.

References buildFrom(), and init().

◆ vpFeatureThetaU() [4/5]

vpFeatureThetaU::vpFeatureThetaU ( vpRotationMatrix R,
vpFeatureThetaURotationRepresentationType  r 
)

Constructor that build a 3D $ \theta u $ visual feature from a rotation matrix $ R $ that represent the rotation that the camera has to achieve.

Parameters
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 ( $ ^{c^*}R_c$), or the rotation that the camera has to achieve to move from the current camera frame to the desired one ( $ ^{c}R_{c^*}$).
r[in] : The rotation representation of R.

Definition at line 153 of file vpFeatureThetaU.cpp.

References buildFrom(), and init().

◆ vpFeatureThetaU() [5/5]

vpFeatureThetaU::vpFeatureThetaU ( vpHomogeneousMatrix M,
vpFeatureThetaURotationRepresentationType  r 
)

Constructor that build a 3D $ \theta u $ visual feature from an homogeneous matrix $ M $ that represent the displacement that the camera has to achieve.

Parameters
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 ( $ ^{c^*}R_c$), or the rotation that the camera has to achieve to move from the current camera frame to the desired one ( $ ^{c}R_{c^*}$).
r[in] : The rotation representation of M.

Definition at line 180 of file vpFeatureThetaU.cpp.

References buildFrom(), vpHomogeneousMatrix::extract(), and init().

◆ ~vpFeatureThetaU()

virtual vpFeatureThetaU::~vpFeatureThetaU ( )
inlinevirtual

Member Function Documentation

◆ buildFrom() [1/3]

void vpFeatureThetaU::buildFrom ( vpThetaUVector tu)

Build a 3D visual feature from a $ \theta u $ vector that represent the rotation $ R $ the camera has to achieve.

Parameters
tu[in] : Rotation that the camera has to achieve in $ \theta u $ angle/axis representation. Depending on the rotation representation type (vpFeatureThetaU::vpFeatureThetaURotationRepresentationType) used to construct this object, the parameter tu represents either the rotation that the camera has to achieve to move from the desired camera frame to the current one ( $ ^{c^*}R_c$), or the rotation that the camera has to achieve to move from the current camera frame to the desired one ( $ ^{c}R_{c^*}$).
Examples:
servoAfma62DhalfCamVelocity.cpp, servoFrankaPBVS.cpp, and testFeature.cpp.

Definition at line 205 of file vpFeatureThetaU.cpp.

References vpBasicFeature::flags, vpBasicFeature::nbParameters, and vpBasicFeature::s.

Referenced by buildFrom(), and vpFeatureThetaU().

◆ buildFrom() [2/3]

void vpFeatureThetaU::buildFrom ( const vpRotationMatrix R)

Build a 3D $ \theta u $ visual feature from a rotation matrix $ R $ that represent the rotation that the camera has to achieve.

Parameters
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 ( $ ^{c^*}R_c$), or the rotation that the camera has to achieve to move from the current camera frame to the desired one ( $ ^{c}R_{c^*}$).

Definition at line 229 of file vpFeatureThetaU.cpp.

References buildFrom().

◆ buildFrom() [3/3]

void vpFeatureThetaU::buildFrom ( const vpHomogeneousMatrix M)

Build a 3D $ \theta u $ visual feature from an homogeneous matrix $ M $ that represent the displacement that the camera has to achieve.

Parameters
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 ( $ ^{c^*}R_c$), or the rotation that the camera has to achieve to move from the current camera frame to the desired one ( $ ^{c}R_{c^*}$).

Definition at line 253 of file vpFeatureThetaU.cpp.

References buildFrom(), and vpHomogeneousMatrix::extract().

◆ dimension_s()

unsigned int vpBasicFeature::dimension_s ( )
inlineinherited

Return the dimension of the feature vector $\bf s$.

Definition at line 110 of file vpBasicFeature.h.

References vpColor::green.

◆ display() [1/2]

void vpFeatureThetaU::display ( const vpCameraParameters cam,
const vpImage< unsigned char > &  I,
const vpColor color = vpColor::green,
unsigned int  thickness = 1 
) const
virtual

Not implemented.

Implements vpBasicFeature.

Definition at line 665 of file vpFeatureThetaU.cpp.

References vpERROR_TRACE.

◆ display() [2/2]

void vpFeatureThetaU::display ( const vpCameraParameters cam,
const vpImage< vpRGBa > &  I,
const vpColor color = vpColor::green,
unsigned int  thickness = 1 
) const
virtual

Not implemented.

Implements vpBasicFeature.

Definition at line 682 of file vpFeatureThetaU.cpp.

References vpERROR_TRACE.

◆ duplicate()

vpFeatureThetaU * vpFeatureThetaU::duplicate ( ) const
virtual

Feature duplication.

Create an object with the same type.

s_star = s.duplicate(); // s_star is now a vpFeatureThetaU

Implements vpBasicFeature.

Definition at line 649 of file vpFeatureThetaU.cpp.

References cdRc, cRcd, and vpFeatureThetaU().

◆ error()

vpColVector vpFeatureThetaU::error ( const vpBasicFeature s_star,
unsigned int  select = FEATURE_ALL 
)
virtual

Compute the error $ (s-s^*)$ between the current and the desired visual features from a subset of the possible features.

Since this visual feature $ s $ represent either the rotation from the desired camera frame to the current camera frame $^{c^*}R_{c} $, or the rotation from the current camera frame to the desired camera frame $^{c}R_{c^*} $, the desired visual feature $ s^* $ should be zero. Thus, the error is here equal to the current visual feature $ s $.

Parameters
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 $ \theta u $ features.
  • To compute the error for all the three $ \theta u $ features use vpBasicFeature::FEATURE_ALL. In that case the error vector is a 3 dimension column vector.
  • To compute the error for only one of the $ \theta u $ component feature ( $ \theta u_x, \theta u_y, \theta u_z$) use one of the corresponding function selectTUx(), selectTUy() or selectTUz(). In that case the error vector is a 1 dimension column vector.
Returns
The error $ (s-s^*)$ between the current and the desired visual feature.
Exceptions
vpFeatureException::badInitializationError: If the desired visual feature $ s^* $ is not equal to zero.

The code below shows how to use this method to manipulate the $\theta u_z $ subset:

// Creation of the current feature s
s.set_TUz(0.3);
// Creation of the desired feature s^*. By default this feature is
// initialized to zero
// Compute the interaction matrix for the ThetaU_z feature
// Compute the error vector (s-s*) for the ThetaU_z feature

To manipulate the subset features $s=(\theta u_y, \theta u_z)$, the code becomes:

// Compute the interaction matrix for the ThetaU_y, ThetaU_z features
// Compute the error vector e = (s-s*) for the ThetaU_y, ThetaU_z feature

Reimplemented from vpBasicFeature.

Examples:
testFeature.cpp.

Definition at line 567 of file vpFeatureThetaU.cpp.

References vpFeatureException::badInitializationError, vpBasicFeature::get_s(), vpBasicFeature::s, selectTUx(), selectTUy(), selectTUz(), vpColVector::stack(), vpColVector::sumSquare(), and vpERROR_TRACE.

◆ get_s()

◆ get_TUx()

double vpFeatureThetaU::get_TUx ( ) const

Return the $\theta u_x $ subset value of the visual feature $s$.

Definition at line 330 of file vpFeatureThetaU.cpp.

References vpBasicFeature::s.

◆ get_TUy()

double vpFeatureThetaU::get_TUy ( ) const

Return the $\theta u_y $ subset value of the visual feature $s$.

Definition at line 337 of file vpFeatureThetaU.cpp.

References vpBasicFeature::s.

◆ get_TUz()

double vpFeatureThetaU::get_TUz ( ) const

Return the $\theta u_z $ subset value of the visual feature $s$.

Definition at line 344 of file vpFeatureThetaU.cpp.

References vpBasicFeature::s.

◆ getDeallocate()

vpBasicFeatureDeallocatorType vpBasicFeature::getDeallocate ( )
inlineinherited

Definition at line 123 of file vpBasicFeature.h.

◆ getDimension()

unsigned int vpBasicFeature::getDimension ( unsigned int  select = FEATURE_ALL) const
inherited

Get the feature vector dimension.

Definition at line 100 of file vpBasicFeature.cpp.

References vpBasicFeature::dim_s, vpBasicFeature::FEATURE_LINE, vpArray2D< Type >::getRows(), and vpBasicFeature::s.

Referenced by vpFeatureMoment::vpFeatureMoment().

◆ getFeatureThetaURotationType()

vpFeatureThetaU::vpFeatureThetaURotationRepresentationType vpFeatureThetaU::getFeatureThetaURotationType ( ) const

Get the type of rotation feature.

Returns
Type of rotation feature. It can be vpFeatureThetaU::cdRc or vpFeatureThetaU::cRcd.
See also
setFeatureThetaURotationType()

Definition at line 319 of file vpFeatureThetaU.cpp.

◆ init()

void vpFeatureThetaU::init ( void  )
virtual

Initialise the memory space requested for 3D $ \theta u $ visual feature.

Implements vpBasicFeature.

Definition at line 67 of file vpFeatureThetaU.cpp.

References vpBasicFeature::dim_s, vpBasicFeature::flags, vpBasicFeature::nbParameters, vpColVector::resize(), and vpBasicFeature::s.

Referenced by vpFeatureThetaU().

◆ interaction()

vpMatrix vpFeatureThetaU::interaction ( unsigned int  select = FEATURE_ALL)
virtual

Compute and return the interaction matrix $ L $ from a subset ( $ \theta u_x, \theta u_y, \theta u_z$) of the possible $ \theta u $ features that represent the 3D rotation $^{c^*}R_c$ or $^{c}R_{c^*}$, with

\[ L = [ 0_3 \; L_{\theta u}] \]

See the vpFeatureThetaU class description for the equations of $L_{\theta u}$.

Parameters
select: Selection of a subset of the possible $ \theta u $ features.
  • To compute the interaction matrix for all the three $ \theta u $ features use vpBasicFeature::FEATURE_ALL. In that case the dimension of the interaction matrix is $ [3 \times 6] $
  • To compute the interaction matrix for only one of the $ \theta u $ component feature ( $\theta u_x, \theta u_y, \theta u_z$) use one of the corresponding function selectTUx(), selectTUy() or selectTUz(). In that case the returned interaction matrix is $ [1 \times 6] $ dimension.
Returns
The interaction matrix computed from the $ \theta u $ features that represent either the rotation $^{c^*}R_c$ or the rotation $^{c}R_{c^*}$.

The code below shows how to compute the interaction matrix associated to the visual feature $s = \theta u_x $.

The code below shows how to compute the interaction matrix associated to the $s = (\theta u_x, \theta u_y) $ subset visual feature:

L_xy is here now a 2 by 6 matrix. The first line corresponds to the $ \theta u_x $ visual feature while the second one to the $ \theta u_y $ visual feature.

It is also possible to build the interaction matrix from all the $ \theta u $ components by:

In that case, L_xyz is a 3 by 6 interaction matrix where the last line corresponds to the $ \theta u_z $ visual feature.

Implements vpBasicFeature.

Examples:
testFeature.cpp.

Definition at line 408 of file vpFeatureThetaU.cpp.

References cdRc, vpBasicFeature::deallocate, vpMatrix::eye(), vpBasicFeature::flags, vpBasicFeature::nbParameters, vpBasicFeature::resetFlags(), vpArray2D< Type >::resize(), vpBasicFeature::s, selectTUx(), selectTUy(), selectTUz(), vpMath::sinc(), vpColVector::skew(), vpMath::sqr(), vpMatrix::stack(), vpColVector::sumSquare(), vpBasicFeature::user, and vpTRACE.

◆ operator[]()

virtual double vpBasicFeature::operator[] ( unsigned int  i) const
inlinevirtualinherited

Return element i in the state vector (usage : x = s[i] )

Definition at line 130 of file vpBasicFeature.h.

◆ print()

void vpFeatureThetaU::print ( unsigned int  select = FEATURE_ALL) const
virtual

Print to stdout the values of the current visual feature $ s $.

Parameters
select: Selection of a subset of the possible $ \theta u $ features.
vpThetaUVector tu; // Current visual feature s
tu[0] = 0.1;
tu[1] = 0.2;
tu[2] = 0.3;
// Creation of the current feature s
s.buildFrom(tu);
s.print(); // print all the 3 components of the feature
s.print(vpBasicFeature::FEATURE_ALL); // same behavior then previous line
s.print(vpFeatureThetaU::selectTUz()); // print only the ThetaU_z component

Implements vpBasicFeature.

Examples:
testFeature.cpp.

Definition at line 623 of file vpFeatureThetaU.cpp.

References vpBasicFeature::s, selectTUx(), selectTUy(), and selectTUz().

◆ resetFlags()

◆ selectAll()

static unsigned int vpBasicFeature::selectAll ( )
inlinestaticinherited

Select all the features.

Definition at line 142 of file vpBasicFeature.h.

◆ selectTUx()

unsigned int vpFeatureThetaU::selectTUx ( )
static

Function used to select the $ \theta u_x$ subset of the $ \theta u $ visual feature.

This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to $ \theta u_x$.

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:

vpServo task;
...
// Add the (ThetaU_x, ThetaU_y) subset features from the 3D ThetaU
// rotation to the task
See also
selectTUy(), selectTUz()

Definition at line 719 of file vpFeatureThetaU.cpp.

References vpBasicFeature::FEATURE_LINE.

Referenced by error(), interaction(), and print().

◆ selectTUy()

unsigned int vpFeatureThetaU::selectTUy ( )
static

Function used to select the $ \theta u_y$ subset of the $ \theta u $ visual feature.

This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to $ \theta u_y$.

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:

vpServo task;
...
// Add the (ThetaU_x, ThetaU_y) subset features from the 3D ThetaU
// rotation to the task
See also
selectTUx(), selectTUz()

Definition at line 744 of file vpFeatureThetaU.cpp.

References vpBasicFeature::FEATURE_LINE.

Referenced by error(), interaction(), and print().

◆ selectTUz()

unsigned int vpFeatureThetaU::selectTUz ( )
static

Function used to select the $ \theta u_z$ subset of the $ \theta u $ visual feature.

This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to $ \theta u_z$.

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:

vpServo task;
...
// Add the (ThetaU_z) subset feature from the 3D ThetaU
// rotation to the task
See also
selectTUx(), selectTUy()
Examples:
testFeature.cpp.

Definition at line 769 of file vpFeatureThetaU.cpp.

References vpBasicFeature::FEATURE_LINE.

Referenced by error(), interaction(), and print().

◆ set_TUx()

void vpFeatureThetaU::set_TUx ( double  tu_x)

Initialise the $\theta u_x $ subset value of the 3D visual feature $ s$.

Parameters
tu_x: $\theta u_x $ subset value to initialize.
See also
get_TUz()

Definition at line 279 of file vpFeatureThetaU.cpp.

References vpBasicFeature::flags, and vpBasicFeature::s.

◆ set_TUy()

void vpFeatureThetaU::set_TUy ( double  tu_y)

Initialise the $\theta u_y $ subset value of the 3D visual feature $ s$.

Parameters
tu_y: $\theta u_y $ subset value to initialize.
See also
get_TUy()

Definition at line 292 of file vpFeatureThetaU.cpp.

References vpBasicFeature::flags, and vpBasicFeature::s.

◆ set_TUz()

void vpFeatureThetaU::set_TUz ( double  tu_z)

Initialise the $\theta u_z $ subset value of the 3D visual feature $ s$.

Parameters
tu_z: $\theta u_z $ subset value to initialize.
See also
get_TUz()

Definition at line 305 of file vpFeatureThetaU.cpp.

References vpBasicFeature::flags, and vpBasicFeature::s.

◆ setDeallocate()

void vpBasicFeature::setDeallocate ( vpBasicFeatureDeallocatorType  d)
inlineinherited

Definition at line 137 of file vpBasicFeature.h.

Referenced by vpServo::addFeature().

◆ setFeatureThetaURotationType()

void vpFeatureThetaU::setFeatureThetaURotationType ( const vpFeatureThetaURotationRepresentationType  r)

Set the type of rotation feature.

Parameters
r: type of feature. It can be vpFeatureThetaU::cdRc or vpFeatureThetaU::cRcd.
See also
getFeatureThetaURotationType()

Definition at line 269 of file vpFeatureThetaU.cpp.

◆ setFlags()

void vpBasicFeature::setFlags ( )
inherited

Set feature flags to true to prevent warning when re-computing the interaction matrix without having updated the feature.

Definition at line 141 of file vpBasicFeature.cpp.

References vpBasicFeature::flags, and vpBasicFeature::nbParameters.

Member Data Documentation

◆ deallocate

◆ dim_s

◆ FEATURE_LINE

const unsigned int vpBasicFeature::FEATURE_LINE
staticinherited
Initial value:
= {
(unsigned int)(1 << 0), (unsigned int)(1 << 1), (unsigned int)(1 << 2), (unsigned int)(1 << 3),
(unsigned int)(1 << 4), (unsigned int)(1 << 5), (unsigned int)(1 << 6), (unsigned int)(1 << 7),
(unsigned int)(1 << 8), (unsigned int)(1 << 9), (unsigned int)(1 << 10), (unsigned int)(1 << 11),
(unsigned int)(1 << 12), (unsigned int)(1 << 13), (unsigned int)(1 << 14), (unsigned int)(1 << 15),
(unsigned int)(1 << 16), (unsigned int)(1 << 17), (unsigned int)(1 << 18), (unsigned int)(1 << 19),
(unsigned int)(1 << 20), (unsigned int)(1 << 21), (unsigned int)(1 << 22), (unsigned int)(1 << 23),
(unsigned int)(1 << 24), (unsigned int)(1 << 25), (unsigned int)(1 << 26), (unsigned int)(1 << 27),
(unsigned int)(1 << 28), (unsigned int)(1 << 29), (unsigned int)(1 << 30), (unsigned int)(1 << 31)}

Definition at line 80 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(), vpFeatureVanishingPoint::selectAlpha(), vpFeatureSegment::selectAlpha(), vpFeatureVanishingPoint::selectAtanOneOverRho(), vpFeatureSegment::selectL(), vpFeatureEllipse::selectMu02(), vpFeatureEllipse::selectMu11(), vpFeatureEllipse::selectMu20(), vpFeatureVanishingPoint::selectOneOverRho(), vpFeatureLine::selectRho(), vpFeaturePointPolar::selectRho(), vpFeatureLine::selectTheta(), vpFeaturePointPolar::selectTheta(), selectTUx(), selectTUy(), selectTUz(), vpFeatureTranslation::selectTx(), vpFeatureTranslation::selectTy(), vpFeatureTranslation::selectTz(), vpFeatureVanishingPoint::selectX(), vpFeatureEllipse::selectX(), vpFeaturePoint::selectX(), vpFeaturePoint3D::selectX(), vpFeatureSegment::selectXc(), vpFeatureVanishingPoint::selectY(), vpFeatureEllipse::selectY(), vpFeaturePoint::selectY(), vpFeaturePoint3D::selectY(), vpFeatureSegment::selectYc(), and vpFeaturePoint3D::selectZ().

◆ flags

bool* vpBasicFeature::flags
protectedinherited

Ensure that all the parameters needed to compute the iteraction matrix are set.

Definition at line 98 of file vpBasicFeature.h.

Referenced by vpFeatureEllipse::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureEllipse::init(), vpFeatureVanishingPoint::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpFeaturePoint::init(), vpFeatureMoment::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::interaction(), vpFeatureEllipse::interaction(), vpFeatureSegment::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), interaction(), vpFeaturePointPolar::interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_rhoThetaZ(), vpFeaturePointPolar::set_theta(), set_TUx(), set_TUy(), set_TUz(), vpFeatureVanishingPoint::set_x(), vpFeatureEllipse::set_x(), vpFeatureDepth::set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureEllipse::set_xy(), vpFeaturePoint::set_xyZ(), vpFeaturePoint3D::set_XYZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureVanishingPoint::set_y(), vpFeatureEllipse::set_y(), vpFeatureDepth::set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeatureLuminance::set_Z(), vpFeatureDepth::set_Z(), vpFeaturePoint::set_Z(), vpFeaturePoint3D::set_Z(), vpFeaturePointPolar::set_Z(), vpFeatureEllipse::setABC(), vpFeatureLine::setABCD(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), vpBasicFeature::setFlags(), vpFeatureEllipse::setMu(), vpFeatureVanishingPoint::setOneOverRho(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), vpFeatureLuminance::vpFeatureLuminance(), and vpBasicFeature::~vpBasicFeature().

◆ nbParameters

◆ s

vpColVector vpBasicFeature::s
protectedinherited

State of the visual feature.

Definition at line 92 of file vpBasicFeature.h.

Referenced by vpFeatureEllipse::buildFrom(), vpFeatureLuminance::buildFrom(), vpFeatureDepth::buildFrom(), vpFeaturePoint::buildFrom(), vpFeatureLine::buildFrom(), vpFeaturePoint3D::buildFrom(), buildFrom(), vpFeaturePointPolar::buildFrom(), vpFeatureTranslation::buildFrom(), vpFeatureEllipse::display(), vpFeatureMoment::duplicate(), vpFeatureEllipse::error(), vpFeatureVanishingPoint::error(), vpFeatureLuminance::error(), vpBasicFeature::error(), vpFeatureMomentAlpha::error(), vpFeatureDepth::error(), vpGenericFeature::error(), vpFeaturePoint::error(), vpFeatureLine::error(), vpFeaturePoint3D::error(), error(), vpFeaturePointPolar::error(), vpFeatureTranslation::error(), vpFeatureDepth::get_LogZoverZstar(), vpFeaturePointPolar::get_rho(), vpBasicFeature::get_s(), vpGenericFeature::get_s(), vpFeaturePointPolar::get_theta(), get_TUx(), get_TUy(), get_TUz(), vpFeatureTranslation::get_Tx(), vpFeatureTranslation::get_Ty(), vpFeatureTranslation::get_Tz(), vpFeatureVanishingPoint::get_x(), vpFeaturePoint::get_x(), vpFeaturePoint3D::get_X(), vpFeatureVanishingPoint::get_y(), vpFeaturePoint::get_y(), vpFeaturePoint3D::get_Y(), vpFeaturePoint3D::get_Z(), vpFeatureVanishingPoint::getAlpha(), vpFeatureVanishingPoint::getAtanOneOverRho(), vpBasicFeature::getDimension(), vpFeatureVanishingPoint::getOneOverRho(), vpFeatureVanishingPoint::init(), vpFeatureEllipse::init(), vpFeatureLuminance::init(), vpFeatureSegment::init(), vpFeatureDepth::init(), vpGenericFeature::init(), vpFeaturePoint::init(), vpFeatureMoment::init(), vpFeatureLine::init(), vpFeaturePoint3D::init(), init(), vpFeaturePointPolar::init(), vpFeatureTranslation::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpFeatureEllipse::print(), vpFeatureSegment::print(), vpGenericFeature::print(), vpFeatureMoment::print(), vpFeatureLine::print(), print(), vpFeatureTranslation::print(), vpFeatureDepth::set_LogZoverZstar(), vpFeaturePointPolar::set_rho(), vpGenericFeature::set_s(), vpFeaturePointPolar::set_theta(), set_TUx(), set_TUy(), set_TUz(), vpFeatureTranslation::set_Tx(), vpFeatureTranslation::set_Ty(), vpFeatureTranslation::set_Tz(), vpFeatureVanishingPoint::set_x(), vpFeatureEllipse::set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureEllipse::set_xy(), vpFeatureVanishingPoint::set_y(), vpFeatureEllipse::set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeaturePoint3D::set_Z(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), vpFeatureEllipse::setMu(), vpFeatureVanishingPoint::setOneOverRho(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), and vpGenericFeature::vpGenericFeature().