Visual Servoing Platform  version 3.1.0
vpForceTwistMatrix Class Reference

#include <vpForceTwistMatrix.h>

+ Inheritance diagram for vpForceTwistMatrix:

Public Member Functions

 vpForceTwistMatrix ()
 
 vpForceTwistMatrix (const vpForceTwistMatrix &F)
 
 vpForceTwistMatrix (const vpHomogeneousMatrix &M, bool full=true)
 
 vpForceTwistMatrix (const vpTranslationVector &t, const vpRotationMatrix &R)
 
 vpForceTwistMatrix (const vpTranslationVector &t, const vpThetaUVector &thetau)
 
 vpForceTwistMatrix (const double tx, const double ty, const double tz, const double tux, const double tuy, const double tuz)
 
 vpForceTwistMatrix (const vpRotationMatrix &R)
 
 vpForceTwistMatrix (const vpThetaUVector &thetau)
 
virtual ~vpForceTwistMatrix ()
 
vpForceTwistMatrix buildFrom (const vpTranslationVector &t, const vpRotationMatrix &R)
 
vpForceTwistMatrix buildFrom (const vpTranslationVector &t, const vpThetaUVector &thetau)
 
vpForceTwistMatrix buildFrom (const vpHomogeneousMatrix &M, bool full=true)
 
vpForceTwistMatrix buildFrom (const vpRotationMatrix &R)
 
vpForceTwistMatrix buildFrom (const vpThetaUVector &thetau)
 
void eye ()
 
vpForceTwistMatrix operator* (const vpForceTwistMatrix &F) const
 
vpMatrix operator* (const vpMatrix &M) const
 
vpColVector operator* (const vpColVector &H) const
 
vpForceTwistMatrixoperator= (const vpForceTwistMatrix &H)
 
int print (std::ostream &s, unsigned int length, char const *intro=0) const
 
void resize (const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true)
 
Deprecated functions
vp_deprecated void init ()
 
vp_deprecated void setIdentity ()
 
Inherited functionalities from vpArray2D
unsigned int getCols () const
 
double getMaxValue () const
 
double getMinValue () const
 
unsigned int getRows () const
 
unsigned int size () const
 
void resize (const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true, const bool recopy_=true)
 
double * operator[] (unsigned int i)
 
double * operator[] (unsigned int i) const
 
vpArray2D< double > hadamard (const vpArray2D< double > &m) const
 

Static Public Member Functions

Inherited I/O from vpArray2D with Static Public Member Functions
static bool load (const std::string &filename, vpArray2D< double > &A, const bool binary=false, char *header=NULL)
 
static bool loadYAML (const std::string &filename, vpArray2D< double > &A, char *header=NULL)
 
static bool save (const std::string &filename, const vpArray2D< double > &A, const bool binary=false, const char *header="")
 
static bool saveYAML (const std::string &filename, const vpArray2D< double > &A, const char *header="")
 

Public Attributes

double * data
 

Protected Attributes

unsigned int rowNum
 
unsigned int colNum
 
double ** rowPtrs
 
unsigned int dsize
 

Related Functions

(Note that these are not member functions.)

enum  vpGEMMmethod
 
void vpGEMM (const vpArray2D< double > &A, const vpArray2D< double > &B, const double &alpha, const vpArray2D< double > &C, const double &beta, vpArray2D< double > &D, const unsigned int &ops=0)
 

Detailed Description

This class derived from vpArray2D<double> implements the 6 by 6 matrix which transforms force/torque from one frame to another. This matrix is also called force/torque twist transformation matrix.

The full force/torque twist transformation matrix allows to compute the force/torque at point a expressed in frame a knowing its force/torque at point b expressed in frame b. This matrix is defined as:

\[ ^a{\bf F}_b = \left[ \begin{array}{cc} ^a{\bf R}_b & {\bf 0}_{3\times 3}\\ {[^a{\bf t}_b]}_{\times} \; ^a{\bf R}_b & ^a{\bf R}_b \end{array} \right] \]

where $ ^a{\bf R}_b $ is a rotation matrix and $ ^a{\bf t}_b $ is a translation vector.

When the point where the velocity is expressed doesn't change, the matrix becomes block diagonal. It allows than to compute the force/torque at point b expressed in frame a knowing its force/torque at point b expressed in frame b :

\[ ^a{\bf F}_b = \left[ \begin{array}{cc} ^a{\bf R}_b & {\bf 0}_{3\times 3}\\ {\bf 0}_{3\times 3} & ^a{\bf R}_b \end{array} \right] \]

The code belows shows for example how to convert a force/torque skew from probe frame to a sensor frame.

#include <visp3/core/vpColVector.h>
#include <visp3/core/vpForceTwistMatrix.h>
int main()
{
// Twist transformation matrix from sensor to probe frame
// Force/torque sensor frame to probe frame transformation
// ... sMp need here to be initialized
sFp.buildFrom(sMp);
// Force/torque skew in the probe frame: fx,fy,fz,tx,ty,tz
vpColVector p_H(6);
// ... p_H should here have an initial value
// Force/torque skew in the sensor frame: fx,fy,fz,tx,ty,tz
vpColVector s_H(6);
// Compute the value of the force/torque in the sensor frame
s_H = sFp * p_H;
}
Examples:
testVirtuoseHapticBox.cpp.

Definition at line 115 of file vpForceTwistMatrix.h.

Constructor & Destructor Documentation

◆ vpForceTwistMatrix() [1/8]

vpForceTwistMatrix::vpForceTwistMatrix ( )

Initialize a force/torque twist transformation matrix to identity.

Definition at line 89 of file vpForceTwistMatrix.cpp.

References eye().

◆ vpForceTwistMatrix() [2/8]

vpForceTwistMatrix::vpForceTwistMatrix ( const vpForceTwistMatrix F)

Initialize a force/torque twist transformation matrix from another force/torque twist matrix.

Parameters
F: Force/torque twist matrix used as initializer.

Definition at line 98 of file vpForceTwistMatrix.cpp.

◆ vpForceTwistMatrix() [3/8]

vpForceTwistMatrix::vpForceTwistMatrix ( const vpHomogeneousMatrix M,
bool  full = true 
)
explicit

Initialize a force/torque twist transformation matrix from an homogeneous matrix $M$ with

\[ {\bf M} = \left[\begin{array}{cc} {\bf R} & {\bf t} \\ {\bf 0}_{1\times 3} & 1 \end{array} \right] \]

Parameters
M: Homogeneous matrix $\bf M$ used to initialize the twist transformation matrix.
full: Boolean used to indicate which matrix should be filled.
  • When set to true, use the complete force/torque skew transformation:

    \[ {\bf F} = \left[ \begin{array}{cc} {\bf R} & {\bf 0}_{3 \times 3} \\ {[{\bf t}]}_{\times} \; {\bf R} & {\bf R} \end{array} \right] \]

  • When set to false, use the block diagonal velocity skew transformation:

    \[ {\bf F} = \left[ \begin{array}{cc} {\bf R} & {\bf 0}_{3 \times 3} \\ {{\bf 0}_{3 \times 3}} & {\bf R} \end{array} \right] \]

Definition at line 129 of file vpForceTwistMatrix.cpp.

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

◆ vpForceTwistMatrix() [4/8]

vpForceTwistMatrix::vpForceTwistMatrix ( const vpTranslationVector t,
const vpRotationMatrix R 
)

Initialize a force/torque twist transformation matrix from a translation vector t and a rotation matrix R.

\[ {\bf F} = \left[ \begin{array}{cc} {\bf R} & {\bf 0}_{3 \times 3} \\ {[{\bf t}]}_{\times} \; {\bf R} & {\bf R} \end{array} \right] \]

Parameters
t: Translation vector.
R: Rotation matrix.

Definition at line 200 of file vpForceTwistMatrix.cpp.

References buildFrom().

◆ vpForceTwistMatrix() [5/8]

vpForceTwistMatrix::vpForceTwistMatrix ( const vpTranslationVector t,
const vpThetaUVector thetau 
)

Initialize a force/torque twist transformation matrix from a translation vector t and a rotation vector with $\theta u $ parametrization.

\[ {\bf F} = \left[ \begin{array}{cc} {\bf R} & {\bf 0}_{3 \times 3} \\ {[{\bf t}]}_{\times} \; {\bf R} & {\bf R} \end{array} \right] \]

Parameters
t: Translation vector.
thetau: $\theta u$ rotation vector used to initialize $R$.

Definition at line 156 of file vpForceTwistMatrix.cpp.

References buildFrom().

◆ vpForceTwistMatrix() [6/8]

vpForceTwistMatrix::vpForceTwistMatrix ( const double  tx,
const double  ty,
const double  tz,
const double  tux,
const double  tuy,
const double  tuz 
)

Initialize a force/torque twist transformation matrix from a translation vector ${\bf t}=(t_x, t_y, t_z)^T$ and a rotation vector with $\theta {\bf u}=(\theta u_x, \theta u_y, \theta u_z)^T $ parametrization.

\[ {\bf F} = \left[ \begin{array}{cc} {\bf R} & {\bf 0}_{3 \times 3} \\ {[{\bf t}]}_{\times} \; {\bf R} & {\bf R} \end{array} \right] \]

Parameters
tx,ty,tz: Translation vector in meters.
tux,tuy,tuz: $\theta {\bf u}$ rotation vector expressed in radians used to initialize $R$.

Definition at line 245 of file vpForceTwistMatrix.cpp.

References buildFrom().

◆ vpForceTwistMatrix() [7/8]

vpForceTwistMatrix::vpForceTwistMatrix ( const vpRotationMatrix R)

Initialize a force/torque block diagonal twist transformation matrix from a rotation matrix R.

\[ {\bf F} = \left[ \begin{array}{cc} {\bf R} & {\bf 0}_{3 \times 3} \\ {{\bf 0}_{3 \times 3}} & {\bf R} \end{array} \right] \]

Parameters
R: Rotation matrix.

Definition at line 223 of file vpForceTwistMatrix.cpp.

References buildFrom().

◆ vpForceTwistMatrix() [8/8]

vpForceTwistMatrix::vpForceTwistMatrix ( const vpThetaUVector thetau)

Initialize a force/torque block diagonal twist transformation matrix from a rotation vector with $\theta u $ parametrization.

\[ {\bf F} = \left[ \begin{array}{cc} {\bf R} & {\bf 0}_{3 \times 3} \\ {{\bf 0}_{3 \times 3}} & {\bf R} \end{array} \right] \]

Parameters
thetau: $\theta u$ rotation vector used to initialize $R$.

Definition at line 179 of file vpForceTwistMatrix.cpp.

References buildFrom().

◆ ~vpForceTwistMatrix()

virtual vpForceTwistMatrix::~vpForceTwistMatrix ( )
inlinevirtual

Destructor.

Definition at line 138 of file vpForceTwistMatrix.h.

References operator*(), and vpArray2D< Type >::operator=().

Member Function Documentation

◆ buildFrom() [1/5]

vpForceTwistMatrix vpForceTwistMatrix::buildFrom ( const vpTranslationVector t,
const vpRotationMatrix R 
)

Build a force/torque twist transformation matrix from a translation vector t and a rotation matrix R.

\[ {\bf F} = \left[ \begin{array}{cc} {\bf R} & {\bf 0}_{3 \times 3} \\ {[{\bf t}]}_{\times} \; {\bf R} & {\bf R} \end{array} \right] \]

Parameters
t: Translation vector.
R: Rotation matrix.

Definition at line 402 of file vpForceTwistMatrix.cpp.

References vpTranslationVector::skew().

Referenced by buildFrom(), and vpForceTwistMatrix().

◆ buildFrom() [2/5]

vpForceTwistMatrix vpForceTwistMatrix::buildFrom ( const vpTranslationVector tv,
const vpThetaUVector thetau 
)

Initialize a force/torque twist transformation matrix from a translation vector t and a rotation vector with $\theta u $ parametrization.

\[ {\bf F} = \left[ \begin{array}{cc} {\bf R} & {\bf 0}_{3 \times 3} \\ {[{\bf t}]}_{\times} \; {\bf R} & {\bf R} \end{array} \right] \]

Parameters
tv: Translation vector.
thetau: $\theta {\bf u}$ rotation vector used to initialise $\bf R $.

Definition at line 465 of file vpForceTwistMatrix.cpp.

References buildFrom().

◆ buildFrom() [3/5]

vpForceTwistMatrix vpForceTwistMatrix::buildFrom ( const vpHomogeneousMatrix M,
bool  full = true 
)

Initialize a force/torque twist transformation matrix from an homogeneous matrix $M$ with

\[ {\bf M} = \left[\begin{array}{cc} {\bf R} & {\bf t} \\ {\bf 0}_{1\times 3} & 1 \end{array} \right] \]

Parameters
M: Homogeneous matrix $M$ used to initialize the velocity twist transformation matrix.
full: Boolean used to indicate which matrix should be filled.
  • When set to true, use the complete force/torque skew transformation:

    \[ {\bf F} = \left[ \begin{array}{cc} {\bf R} & {\bf 0}_{3 \times 3} \\ {[{\bf t}]}_{\times} \; {\bf R} & {\bf R} \end{array} \right] \]

  • When set to false, use the block diagonal velocity skew transformation:

    \[ {\bf F} = \left[ \begin{array}{cc} {\bf R} & {\bf 0}_{3 \times 3} \\ {{\bf 0}_{3 \times 3}} & {\bf R} \end{array} \right] \]

Definition at line 523 of file vpForceTwistMatrix.cpp.

References buildFrom(), vpHomogeneousMatrix::getRotationMatrix(), and vpHomogeneousMatrix::getTranslationVector().

◆ buildFrom() [4/5]

vpForceTwistMatrix vpForceTwistMatrix::buildFrom ( const vpRotationMatrix R)

Build a block diagonal force/torque twist transformation matrix from a rotation matrix R.

\[ {\bf F} = \left[ \begin{array}{cc} {\bf R} & {\bf 0}_{3 \times 3} \\ {{\bf 0}_{3 \times 3}} & {\bf R} \end{array} \right] \]

Parameters
R: Rotation matrix.

Definition at line 433 of file vpForceTwistMatrix.cpp.

◆ buildFrom() [5/5]

vpForceTwistMatrix vpForceTwistMatrix::buildFrom ( const