Visual Servoing Platform  version 3.6.1 under development (2024-07-27)

#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  vpBasicFeatureSelect { FEATURE_ALL = 0xffff }
 
enum  vpBasicFeatureDeallocatorType { user , vpServo }
 

Public Member Functions

 vpFeatureThetaU ()
 
VP_EXPLICIT vpFeatureThetaU (vpFeatureThetaURotationRepresentationType r)
 
 vpFeatureThetaU (vpThetaUVector &tu, vpFeatureThetaURotationRepresentationType r)
 
 vpFeatureThetaU (vpRotationMatrix &R, vpFeatureThetaURotationRepresentationType r)
 
 vpFeatureThetaU (vpHomogeneousMatrix &M, vpFeatureThetaURotationRepresentationType r)
 
void buildFrom (vpThetaUVector &tu)
 
void buildFrom (const vpRotationMatrix &R)
 
void buildFrom (const vpHomogeneousMatrix &M)
 
vpFeatureThetaUbuild (const vpThetaUVector &tu)
 
vpFeatureThetaUbuild (const vpRotationMatrix &R)
 
vpFeatureThetaUbuild (const vpHomogeneousMatrix &M)
 
void display (const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const VP_OVERRIDE
 
void display (const vpCameraParameters &cam, const vpImage< vpRGBa > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const VP_OVERRIDE
 
vpFeatureThetaUduplicate () const VP_OVERRIDE
 
vpColVector error (const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL) VP_OVERRIDE
 
vpFeatureThetaURotationRepresentationType getFeatureThetaURotationType () const
 
double get_TUx () const
 
double get_TUy () const
 
double get_TUz () const
 
void init () VP_OVERRIDE
 
vpMatrix interaction (unsigned int select=FEATURE_ALL) VP_OVERRIDE
 
void print (unsigned int select=FEATURE_ALL) const VP_OVERRIDE
 
void set_TUx (double tu_x)
 
void set_TUy (double tu_y)
 
void set_TUz (double tu_z)
 
void setFeatureThetaURotationType (const vpFeatureThetaURotationRepresentationType r)
 

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 (unsigned int select=FEATURE_ALL) const
 
virtual double operator[] (unsigned int i) const
 
void setDeallocate (vpBasicFeatureDeallocatorType d)
 
void setFlags ()
 
static unsigned int selectAll ()
 
vpBasicFeatureDeallocatorType deallocate
 
void resetFlags ()
 

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 functions like set_TUx(), set_TUy(), set_TUz(), or also build() functions.

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>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
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.build(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.build(cMcd);
// compute the control law
vpColVector v = task.computeControlLaw(); // camera velocity
}
}
vpColVector s
State of the visual feature.
Implementation of column vector and the associated operations.
Definition: vpColVector.h:191
Class that defines a 3D visual feature from a axis/angle parametrization that represent the rotatio...
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
Definition: vpServo.cpp:380
@ EYEINHAND_CAMERA
Definition: vpServo.h:161
void addFeature(vpBasicFeature &s_cur, vpBasicFeature &s_star, unsigned int select=vpBasicFeature::FEATURE_ALL)
Definition: vpServo.cpp:331
void setServo(const vpServoType &servo_type)
Definition: vpServo.cpp:134
vpColVector computeControlLaw()
Definition: vpServo.cpp:705
@ CURRENT
Definition: vpServo.h:202

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

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>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
// ... cdMc need here to be initialized from for example a pose estimation.
// Creation of the current feature s
s.build(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);
}
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:169
Examples
servoAfma62DhalfCamVelocity.cpp, servoAfma6AprilTagPBVS.cpp, servoAfma6MegaposePBVS.cpp, servoFrankaPBVS.cpp, servoSimu3D_cMcd_CamVelocity.cpp, servoSimu3D_cdMc_CamVelocity.cpp, servoSimuPoint2DhalfCamVelocity1.cpp, servoSimuPoint2DhalfCamVelocity2.cpp, servoSimuPoint2DhalfCamVelocity3.cpp, servoSimuThetaUCamVelocity.cpp, servoUniversalRobotsPBVS.cpp, and testFeature.cpp.

Definition at line 228 of file vpFeatureThetaU.h.

Member Enumeration Documentation

◆ vpBasicFeatureDeallocatorType

Indicates who should deallocate the feature.

Enumerator
user 
vpServo 

Definition at line 88 of file vpBasicFeature.h.

◆ vpBasicFeatureSelect

Enumerator
FEATURE_ALL 

Definition at line 83 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 240 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 231 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 86 of file vpFeatureThetaU.cpp.

References init().

Referenced by duplicate().

◆ vpFeatureThetaU() [2/5]

vpFeatureThetaU::vpFeatureThetaU ( vpFeatureThetaURotationRepresentationType  r)

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 99 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 127 of file vpFeatureThetaU.cpp.

References build(), 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 151 of file vpFeatureThetaU.cpp.

References build(), 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 178 of file vpFeatureThetaU.cpp.

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

Member Function Documentation

◆ build() [1/3]

vpFeatureThetaU & vpFeatureThetaU::build ( 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 322 of file vpFeatureThetaU.cpp.

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

◆ build() [2/3]

vpFeatureThetaU & vpFeatureThetaU::build ( 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 297 of file vpFeatureThetaU.cpp.

References build().

◆ build() [3/3]

vpFeatureThetaU & vpFeatureThetaU::build ( const 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, and testFeature.cpp.

Definition at line 271 of file vpFeatureThetaU.cpp.

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

Referenced by build(), buildFrom(), and vpFeatureThetaU().

◆ buildFrom() [1/3]

void vpFeatureThetaU::buildFrom ( const vpHomogeneousMatrix M)
Deprecated:
You should use build(const vpHomogeneousMatrix &) instead. 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 249 of file vpFeatureThetaU.cpp.

References build().

◆ buildFrom() [2/3]

void vpFeatureThetaU::buildFrom ( const vpRotationMatrix R)
Deprecated:
You should use build(const vpRotationMatrix &) instead. 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 225 of file vpFeatureThetaU.cpp.

References build().

◆ buildFrom() [3/3]

void vpFeatureThetaU::buildFrom ( vpThetaUVector tu)
Deprecated:
You should use build(const vpThetaUVector &) instead. 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^*}$).

Definition at line 204 of file vpFeatureThetaU.cpp.

References build().

◆ 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.

◆ 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 736 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 753 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
class that defines what is a visual feature

Implements vpBasicFeature.

Definition at line 720 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
vpMatrix L_z = s.interaction( vpFeatureThetaU::selectTUz() );
// Compute the error vector (s-s*) for the ThetaU_z feature
s.error(s_star, vpFeatureThetaU::selectTUz());
static unsigned int selectTUz()

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
vpMatrix L_yz = s.interaction( vpFeatureThetaU::selectTUy() |
// Compute the error vector e = (s-s*) for the ThetaU_y, ThetaU_z feature

Reimplemented from vpBasicFeature.

Examples
testFeature.cpp.

Definition at line 638 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 400 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 407 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 414 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.

Examples
testPoint.cpp.

Definition at line 102 of file vpBasicFeature.cpp.

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

◆ 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 389 of file vpFeatureThetaU.cpp.

◆ init()

BEGIN_VISP_NAMESPACE void vpFeatureThetaU::init ( void  )
virtual

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

Implements vpBasicFeature.

Definition at line 65 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 $.

// Creation of the current feature s
s.build(cdMc);
vpMatrix L_x = s.interaction( vpFeatureThetaU::selectTUx() );
Implementation of a rotation matrix and operations on such kind of matrices.

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 478 of file vpFeatureThetaU.cpp.

References cdRc, vpBasicFeature::deallocate, vpMatrix::eye(), vpBasicFeature::flags, vpBasicFeature::nbParameters, vpBasicFeature::resetFlags(), 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.build(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
int print(std::ostream &s, unsigned int length, char const *intro=0) const
Implementation of a rotation vector as axis-angle minimal representation.

Implements vpBasicFeature.

Examples
testFeature.cpp.

Definition at line 694 of file vpFeatureThetaU.cpp.

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

◆ resetFlags()

◆ selectAll()

static unsigned int vpBasicFeature::selectAll ( )
inlinestaticinherited

Select all the features.

Examples
testPoint.cpp.

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 790 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 815 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 840 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 349 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 362 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 375 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 339 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 142 of file vpBasicFeature.cpp.

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

Member Data Documentation

◆ deallocate

◆ dim_s

◆ FEATURE_LINE

BEGIN_VISP_NAMESPACE 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 81 of file vpBasicFeature.h.

Referenced by vpBasicFeature::error(), vpGenericFeature::error(), vpBasicFeature::get_s(), vpBasicFeature::getDimension(), vpFeatureMoment::getDimension(), vpFeatureMoment::interaction(), vpGenericFeature::interaction(), vpFeatureMoment::print(), vpGenericFeature::print(), vpFeatureEllipse::select_n02(), vpFeatureEllipse::select_n11(), vpFeatureEllipse::select_n20(), vpFeatureSegment::selectAlpha(), vpFeatureVanishingPoint::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(), vpFeatureEllipse::selectX(), vpFeaturePoint::selectX(), vpFeaturePoint3D::selectX(), vpFeatureVanishingPoint::selectX(), vpFeatureSegment::selectXc(), vpFeatureEllipse::selectY(), vpFeaturePoint::selectY(), vpFeaturePoint3D::selectY(), vpFeatureVanishingPoint::selectY(), vpFeatureSegment::selectYc(), and vpFeaturePoint3D::selectZ().

◆ flags

bool* vpBasicFeature::flags
protectedinherited

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

Definition at line 98 of file vpBasicFeature.h.

Referenced by vpFeatureLine::build(), vpFeaturePointPolar::build(), vpFeatureEllipse::build(), vpFeaturePoint::build(), vpFeatureDepth::build(), vpFeatureTranslation::build(), vpFeaturePoint3D::build(), build(), vpFeatureLine::buildFrom(), vpFeatureMoment::duplicate(), vpFeatureDepth::init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeatureLuminance::init(), vpFeaturePoint::init(), vpFeaturePoint3D::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::init(), vpFeatureMoment::init(), vpFeatureVanishingPoint::interaction(), vpFeatureDepth::interaction(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), vpFeaturePoint::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureSegment::interaction(), interaction(), vpFeatureTranslation::interaction(), vpBasicFeature::operator=(), vpBasicFeature::resetFlags(), vpFeaturePointPolar::set_rho(), vpFeaturePointPolar::set_rhoThetaZ(), vpFeaturePointPolar::set_theta(), set_TUx(), set_TUy(), set_TUz(), vpFeatureDepth::set_x(), vpFeatureEllipse::set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureVanishingPoint::set_x(), vpFeatureEllipse::set_xy(), vpFeaturePoint::set_xyZ(), vpFeaturePoint3D::set_XYZ(), vpFeatureDepth::set_xyZLogZoverZstar(), vpFeatureDepth::set_y(), vpFeatureEllipse::set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeatureVanishingPoint::set_y(), vpFeatureDepth::set_Z(), vpFeatureLuminance::set_Z(), vpFeaturePoint::set_Z(), vpFeaturePoint3D::set_Z(), vpFeaturePointPolar::set_Z(), vpFeatureEllipse::setABC(), vpFeatureLine::setABCD(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), vpBasicFeature::setFlags(), vpFeatureEllipse::setMoments(), 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 vpFeatureLine::build(), vpFeaturePointPolar::build(), vpFeatureEllipse::build(), vpFeaturePoint::build(), vpFeatureDepth::build(), vpFeatureTranslation::build(), vpFeaturePoint3D::build(), build(), vpFeatureLuminance::build(), vpFeatureLuminanceMapping::build(), vpFeatureLine::buildFrom(), vpFeatureEllipse::display(), vpFeatureMoment::duplicate(), vpFeatureVanishingPoint::error(), vpBasicFeature::error(), vpFeatureDepth::error(), vpFeatureEllipse::error(), vpFeatureLine::error(), vpFeatureMomentAlpha::error(), vpFeaturePoint::error(), vpFeaturePoint3D::error(), vpFeaturePointPolar::error(), error(), vpFeatureTranslation::error(), vpGenericFeature::error(), vpFeatureLuminance::error(), vpFeatureLuminanceMapping::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(), vpFeaturePoint::get_x(), vpFeaturePoint3D::get_X(), vpFeatureVanishingPoint::get_x(), vpFeaturePoint::get_y(), vpFeaturePoint3D::get_Y(), vpFeatureVanishingPoint::get_y(), vpFeaturePoint3D::get_Z(), vpFeatureVanishingPoint::getAlpha(), vpFeatureVanishingPoint::getAtanOneOverRho(), vpBasicFeature::getDimension(), vpFeatureVanishingPoint::getOneOverRho(), vpFeatureDepth::init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeaturePoint::init(), vpFeaturePoint3D::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::init(), vpGenericFeature::init(), vpFeatureLuminanceMapping::init(), vpFeatureLuminance::init(), vpFeatureMoment::init(), vpFeatureEllipse::interaction(), vpFeatureLine::interaction(), interaction(), vpFeatureTranslation::interaction(), vpFeatureLuminanceMapping::interaction(), vpBasicFeature::operator=(), vpFeatureLuminance::operator=(), vpFeatureLuminanceMapping::operator=(), vpFeatureEllipse::print(), vpFeatureLine::print(), vpFeatureLuminanceMapping::print(), vpFeatureMoment::print(), vpFeatureSegment::print(), print(), vpFeatureTranslation::print(), vpGenericFeature::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(), vpFeatureEllipse::set_x(), vpFeaturePoint::set_x(), vpFeaturePoint3D::set_X(), vpFeatureVanishingPoint::set_x(), vpFeatureEllipse::set_xy(), vpFeatureEllipse::set_y(), vpFeaturePoint::set_y(), vpFeaturePoint3D::set_Y(), vpFeatureVanishingPoint::set_y(), vpFeaturePoint3D::set_Z(), vpFeatureVanishingPoint::setAlpha(), vpFeatureVanishingPoint::setAtanOneOverRho(), vpFeatureEllipse::setMoments(), vpFeatureVanishingPoint::setOneOverRho(), vpFeatureLine::setRhoTheta(), vpFeatureMoment::update(), and vpGenericFeature::vpGenericFeature().