Visual Servoing Platform
version 3.0.1
|
#include <visp3/core/vpPoseVector.h>
Public Member Functions | |
vpPoseVector () | |
vpPoseVector (const double tx, const double ty, const double tz, const double tux, const double tuy, const double tuz) | |
vpPoseVector (const vpHomogeneousMatrix &M) | |
vpPoseVector (const vpTranslationVector &tv, const vpThetaUVector &tu) | |
vpPoseVector (const vpTranslationVector &tv, const vpRotationMatrix &R) | |
virtual | ~vpPoseVector () |
vpPoseVector | buildFrom (const double tx, const double ty, const double tz, const double tux, const double tuy, const double tuz) |
vpPoseVector | buildFrom (const vpHomogeneousMatrix &M) |
vpPoseVector | buildFrom (const vpTranslationVector &tv, const vpThetaUVector &tu) |
vpPoseVector | buildFrom (const vpTranslationVector &tv, const vpRotationMatrix &R) |
void | extract (vpRotationMatrix &R) const |
void | extract (vpThetaUVector &tu) const |
void | extract (vpTranslationVector &tv) const |
void | extract (vpQuaternionVector &q) const |
vpRotationMatrix | getRotationMatrix () const |
vpThetaUVector | getThetaUVector () const |
vpTranslationVector | getTranslationVector () const |
void | load (std::ifstream &f) |
double & | operator[] (unsigned int i) |
const double & | operator[] (unsigned int i) const |
void | print () const |
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) |
void | save (std::ofstream &f) const |
void | set (const double tx, const double ty, const double tz, const double tux, const double tuy, const double tuz) |
vpRowVector | t () const |
Deprecated functions | |
vp_deprecated void | init () |
Inherited functionalities from vpArray2D | |
double | getMinValue () const |
double | getMaxValue () const |
unsigned int | getRows () const |
unsigned int | getCols () const |
unsigned int | size () 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 |
Implementation of a pose vector and operations on poses.
The vpPose class implements a complete representation of every rigid motion in the euclidian space.
The vpPose class is derived from vpArray2D<double>.
The pose is composed of a translation and a rotation minimaly represented by a 6 dimension pose vector as:
where is the pose from frame to frame , with being the translation vector between these frames along the x,y,z axis and , the axis-angle representation of the rotation between these frames.
Translations are expressed in meters, while the angles in the axis-angle representation are expressed in radians.
To know more about the rotation representation, see vpThetaUVector documentation.
Definition at line 93 of file vpPoseVector.h.
vpPoseVector::vpPoseVector | ( | ) |
Default constructor that construct a 6 dimension pose vector where is a rotation vector and is a translation vector .
The pose vector is initialized to zero.
Definition at line 67 of file vpPoseVector.cpp.
vpPoseVector::vpPoseVector | ( | const double | tx, |
const double | ty, | ||
const double | tz, | ||
const double | tux, | ||
const double | tuy, | ||
const double | tuz | ||
) |
Construct a 6 dimension pose vector from 3 translations and 3 angles.
Translations are expressed in meters, while rotations in radians.
tx,ty,tz | : Translations respectively along the x, y and z axis (in meters). |
tux,tuy,tuz | : Rotations respectively around the x, y and z axis (in radians). |
Definition at line 86 of file vpPoseVector.cpp.
vpPoseVector::vpPoseVector | ( | const vpHomogeneousMatrix & | M | ) |
Construct a 6 dimension pose vector from an homogeneous matrix .
M | : Homogeneous matrix from which translation and vectors are extracted to initialize the pose vector. |
Definition at line 149 of file vpPoseVector.cpp.
References buildFrom().
vpPoseVector::vpPoseVector | ( | const vpTranslationVector & | tv, |
const vpThetaUVector & | tu | ||
) |
Construct a 6 dimension pose vector from a translation vector and a vector.
tv | : Translation vector . |
tu | : rotation vector. |
Definition at line 113 of file vpPoseVector.cpp.
References buildFrom().
vpPoseVector::vpPoseVector | ( | const vpTranslationVector & | tv, |
const vpRotationMatrix & | R | ||
) |
Construct a 6 dimension pose vector from a translation vector and a rotation matrix .
tv | : Translation vector . |
R | : Rotation matrix from which vector is extracted to initialise the pose vector. |
Definition at line 132 of file vpPoseVector.cpp.
References buildFrom().
|
inlinevirtual |
Destructor.
Definition at line 112 of file vpPoseVector.h.
vpPoseVector vpPoseVector::buildFrom | ( | const double | tx, |
const double | ty, | ||
const double | tz, | ||
const double | tux, | ||
const double | tuy, | ||
const double | tuz | ||
) |
Build a 6 dimension pose vector from 3 translations and 3 angles.
Translations are expressed in meters, while rotations in radians.
tx,ty,tz | : Translations respectively along the x, y and z axis (in meters). |
tux,tuy,tuz | : Rotations respectively around the x, y and z axis (in radians). |
Definition at line 200 of file vpPoseVector.cpp.
Referenced by buildFrom(), vpPtu46::computeMGD(), vpBiclops::computeMGD(), vpBiclops::get_fMc(), vpVirtuose::getAvatarPosition(), vpVirtuose::getBaseFrame(), vpVirtuose::getObservationFrame(), vpVirtuose::getPhysicalPosition(), vpVirtuose::getPosition(), vpMbTracker::savePose(), and vpPoseVector().
vpPoseVector vpPoseVector::buildFrom | ( | const vpHomogeneousMatrix & | M | ) |
Build a 6 dimension pose vector from an homogeneous matrix .
M | : Homogeneous matrix from which translation and vectors are extracted to initialize the pose vector. |
Definition at line 225 of file vpPoseVector.cpp.
References buildFrom(), and vpHomogeneousMatrix::extract().
vpPoseVector vpPoseVector::buildFrom | ( | const vpTranslationVector & | tv, |
const vpThetaUVector & | tu | ||
) |
Build a 6 dimension pose vector from a translation vector and a vector.
tv | : Translation vector . |
tu | : rotation vector. |
Definition at line 245 of file vpPoseVector.cpp.
vpPoseVector vpPoseVector::buildFrom | ( | const vpTranslationVector & | tv, |
const vpRotationMatrix & | R | ||
) |
Build a 6 dimension pose vector from a translation vector and a rotation matrix .
tv | : Translation vector . |
R | : Rotation matrix from which vector is extracted to initialise the pose vector. |
Definition at line 269 of file vpPoseVector.cpp.
References buildFrom(), and vpThetaUVector::buildFrom().
void vpPoseVector::extract | ( | vpRotationMatrix & | R | ) | const |
Extract the rotation as a rotation matrix.
Definition at line 313 of file vpPoseVector.cpp.
References vpRotationMatrix::buildFrom().
Referenced by vpVirtuose::setBaseFrame(), vpVirtuose::setObservationFrame(), and vpVirtuose::setPosition().
void vpPoseVector::extract | ( | vpThetaUVector & | tu | ) | const |
Extract the rotation as a vector.
Definition at line 294 of file vpPoseVector.cpp.
void vpPoseVector::extract | ( | vpTranslationVector & | tv | ) | const |
Extract the translation vector from the homogeneous matrix.
Definition at line 283 of file vpPoseVector.cpp.
void vpPoseVector::extract | ( | vpQuaternionVector & | q | ) | const |
Extract the rotation as a quaternion vector.
Definition at line 304 of file vpPoseVector.cpp.
References vpQuaternionVector::buildFrom().
|
inlineinherited |
Return the number of columns of the 2D array.
Definition at line 154 of file vpArray2D.h.
References vpArray2D< Type >::colNum.
Referenced by vpRowVector::csvPrint(), vpMatrix::csvPrint(), vpRotationMatrix::getCol(), vpHomogeneousMatrix::getCol(), vpMatrix::getCol(), vpMatrix::getRow(), vpMatrix::inverseByQRLapack(), vpMatrix::kernel(), vpRowVector::maplePrint(), vpMatrix::maplePrint(), vpRowVector::operator*(), vpRowVector::operator+(), vpRowVector::operator+=(), vpRowVector::operator-(), vpRowVector::operator-=(), vpForceTwistMatrix::print(), vpVelocityTwistMatrix::print(), vpRowVector::print(), vpMatrix::print(), vpMatrix::pseudoInverse(), vpMatrix::row(), and vpMatrix::svd().
|
inherited |
Return the array max value.
|
inherited |
Return the array min value.
vpRotationMatrix vpPoseVector::getRotationMatrix | ( | ) | const |
Return the rotation matrix that corresponds to the rotation part of the pose vector.
Definition at line 331 of file vpPoseVector.cpp.
|
inlineinherited |
Return the number of rows of the 2D array.
Definition at line 152 of file vpArray2D.h.
References vpArray2D< Type >::rowNum.
Referenced by vpMatrix::column(), vpColVector::cppPrint(), vpMatrix::cppPrint(), vpColVector::csvPrint(), vpMatrix::csvPrint(), vpRotationMatrix::getCol(), vpHomogeneousMatrix::getCol(), vpMatrix::getCol(), vpMatrix::getRow(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByQRLapack(), vpMatrix::kernel(), vpColVector::maplePrint(), vpMatrix::maplePrint(), vpColVector::matlabPrint(), vpMatrix::matlabPrint(), vpColVector::operator+(), vpColVector::operator+=(), vpColVector::operator-(), vpColVector::operator-=(), vpForceTwistMatrix::print(), vpVelocityTwistMatrix::print(), print(), vpColVector::print(), vpMatrix::print(), and vpMatrix::pseudoInverse().
vpThetaUVector vpPoseVector::getThetaUVector | ( | ) | const |
Return the vector that corresponds to the rotation part of the pose vector.
Definition at line 341 of file vpPoseVector.cpp.
vpTranslationVector vpPoseVector::getTranslationVector | ( | ) | const |
Return the translation vector that corresponds to the translation part of the pose vector.
Definition at line 321 of file vpPoseVector.cpp.
|
inline |
Definition at line 215 of file vpPoseVector.h.
void vpPoseVector::load | ( | std::ifstream & | f | ) |
Read a pose vector from an input file stream.
f | : The input file stream..Should be open before entering in this method. |
vpException::ioError | : If the input file stream is not open. |
Definition at line 411 of file vpPoseVector.cpp.
References vpException::ioError.
|
inlinestaticinherited |
Load a matrix from a file.
filename | : Absolute file name. |
A | : Array to be loaded |
binary | : If true the matrix is loaded from a binary file, else from a text file. |
header | : Header of the file is loaded in this parameter. |
Definition at line 308 of file vpArray2D.h.
References vpException::badValue, and vpArray2D< Type >::resize().
|
inlinestaticinherited |
Load an array from a YAML-formatted file.
filename | : absolute file name. |
A | : array to be loaded from the file. |
header | : header of the file is loaded in this parameter. |
Definition at line 417 of file vpArray2D.h.
References vpArray2D< Type >::resize().
|
inline |
Set the value of an element of the pose vector: r[i] = x.
i | : Pose vector element index |
This code produces the same effect:
Definition at line 161 of file vpPoseVector.h.
|
inline |
Get the value of an element of the pose vector: x = r[i].
i | : Pose vector element index |
Definition at line 180 of file vpPoseVector.h.
void vpPoseVector::print | ( | ) | const |
Prints to the standart stream the pose vector.
The following code
produces the output:
Definition at line 369 of file vpPoseVector.cpp.
References vpMath::deg().
int vpPoseVector::print | ( | std::ostream & | s, |
unsigned int | length, | ||
char const * | intro = 0 |
||
) | const |
Pretty print a pose vector. The data are tabulated. The common widths before and after the decimal point are set with respect to the parameter maxlen.
s | Stream used for the printing. |
length | The suggested width of each vector element. The actual width grows in order to accomodate the whole integral part, and shrinks if the whole extent is not needed for all the numbers. |
intro | The introduction which is printed before the vector. Can be set to zero (or omitted), in which case the introduction is not printed. |
Definition at line 455 of file vpPoseVector.cpp.
References vpArray2D< double >::getRows(), and vpMath::maximum().
|
inline |
This function is not applicable to a pose vector that is always a 6-by-1 column vector.
vpException::fatalError | When this function is called. |
Definition at line 191 of file vpPoseVector.h.
References vpException::fatalError.
void vpPoseVector::save | ( | std::ofstream & | f | ) | const |
Save the pose vector in the output file stream.
f | : Output file stream. Should be open before entering in this method. |
vpException::ioError | : If the output stream is not open. |
Definition at line 388 of file vpPoseVector.cpp.
References vpException::ioError.
|
inlinestaticinherited |
Save a matrix to a file.
filename | : Absolute file name. |
A | : Array to be saved. |
binary | : If true the matrix is saved in a binary file, else a text file. |
header | : Optional line that will be saved at the beginning of the file. |
Warning : If you save the matrix as in a text file the precision is less than if you save it in a binary file.
Definition at line 499 of file vpArray2D.h.
References vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().
|
inlinestaticinherited |
Save an array in a YAML-formatted file.
filename | : absolute file name. |
A | : array to be saved in the file. |
header | : optional lines that will be saved at the beginning of the file. Should be YAML-formatted and will adapt to the indentation if any. |
Here is an example of outputs.
Content of matrix.yml:
Content of matrixIndent.yml:
Definition at line 588 of file vpArray2D.h.
References vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().
void vpPoseVector::set | ( | const double | tx, |
const double | ty, | ||
const double | tz, | ||
const double | tux, | ||
const double | tuy, | ||
const double | tuz | ||
) |
Set the 6 dimension pose vector from 3 translations and 3 angles.
Translations are expressed in meters, while rotations in radians.
tx,ty,tz | : Translations respectively along the x, y and z axis (in meters). |
tux,tuy,tuz | : Rotations respectively around the x, y and z axis (in radians). |
Definition at line 171 of file vpPoseVector.cpp.
|
inlineinherited |
Return the number of elements of the 2D array.
Definition at line 156 of file vpArray2D.h.
References vpArray2D< Type >::colNum, and vpArray2D< Type >::rowNum.
Referenced by vpRowVector::insert(), vpColVector::insert(), and vpColVector::operator*().
vpRowVector vpPoseVector::t | ( | ) | const |
Definition at line 428 of file vpPoseVector.cpp.
References vpArray2D< Type >::data, vpArray2D< double >::data, and vpArray2D< double >::rowNum.
Referenced by vpHomogeneousMatrix::print().
|
related |
Enumeration of the operations applied on matrices in vpGEMM() function.
Operations are :
|
protectedinherited |
Number of columns in the array.
Definition at line 76 of file vpArray2D.h.
Referenced by vpMatrix::AAt(), vpMatrix::AtA(), vpColVector::clear(), vpMatrix::diag(), vpMatrix::eigenValues(), vpMatrix::expm(), vpMatrix::eye(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpRowVector::insert(), vpMatrix::insert(), vpMatrix::inverseByCholesky(), vpMatrix::inverseByLU(), vpMatrix::inverseByQR(), vpRotationMatrix::operator*(), vpRowVector::operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*=(), vpRowVector::operator*=(), vpMatrix::operator*=(), vpRowVector::operator+(), vpRowVector::operator+=(), vpMatrix::operator+=(), vpRowVector::operator-(), vpRowVector::operator-=(), vpMatrix::operator-=(), vpRowVector::operator/(), vpMatrix::operator/(), vpRowVector::operator/=(), vpMatrix::operator/=(), vpMatrix::operator<<(), vpColVector::operator<<(), vpSubRowVector::operator=(), vpSubMatrix::operator=(), vpRowVector::operator=(), vpMatrix::operator=(), vpRowVector::reshape(), vpMatrix::setIdentity(), vpMatrix::solveBySVD(), vpRowVector::stack(), vpMatrix::stackColumns(), vpMatrix::stackRows(), vpRowVector::sum(), vpMatrix::sum(), vpRowVector::sumSquare(), vpMatrix::sumSquare(), vpRowVector::t(), vpMatrix::t(), and vpMatrix::transpose().
|
inherited |
Address of the first element of the data array.
Definition at line 84 of file vpArray2D.h.
Referenced by vpMatrix::AtA(), vpHomogeneousMatrix::buildFrom(), vpRzyzVector::buildFrom(), vpRzyxVector::buildFrom(), vpRxyzVector::buildFrom(), vpThetaUVector::buildFrom(), vpSubColVector::checkParentStatus(), vpSubRowVector::checkParentStatus(), vpSubMatrix::checkParentStatus(), vpColVector::clear(), vpHomogeneousMatrix::convert(), vpTranslationVector::euclideanNorm(), vpRowVector::euclideanNorm(), vpMatrix::euclideanNorm(), vpMatrix::expm(), vpThetaUVector::extract(), vpThetaUVector::getTheta(), vpThetaUVector::getU(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpTranslationVector::operator*(), vpRowVector::operator*(), vpColVector::operator*(), vpHomography::operator*(), vpTranslationVector::operator-(), vpRowVector::operator-(), vpColVector::operator-(), vpTranslationVector::operator/(), vpRowVector::operator/(), vpColVector::operator/(), vpHomography::operator/(), vpHomography::operator/=(), vpSubColVector::operator=(), vpSubRowVector::operator=(), vpQuaternionVector::operator=(), vpTranslationVector::operator=(), vpRowVector::operator=(), vpRzyzVector::operator=(), vpRzyxVector::operator=(), vpRxyzVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpThetaUVector::operator=(), vpColVector::operator[](), vpRowVector::reshape(), vpColVector::reshape(), vpQuaternionVector::set(), vpMatrix::stackRows(), vpColVector::sum(), vpColVector::sumSquare(), vpRotationVector::t(), vpTranslationVector::t(), t(), vpRowVector::t(), vpColVector::t(), vpQuaternionVector::vpQuaternionVector(), vpRxyzVector::vpRxyzVector(), vpRzyxVector::vpRzyxVector(), vpRzyzVector::vpRzyzVector(), vpThetaUVector::vpThetaUVector(), vpQuaternionVector::w(), vpQuaternionVector::x(), vpQuaternionVector::y(), vpQuaternionVector::z(), vpSubColVector::~vpSubColVector(), vpSubMatrix::~vpSubMatrix(), and vpSubRowVector::~vpSubRowVector().
|
protectedinherited |
Current array size (rowNum * colNum)
Definition at line 80 of file vpArray2D.h.
Referenced by vpColVector::clear(), vpTranslationVector::euclideanNorm(), vpRowVector::euclideanNorm(), vpMatrix::euclideanNorm(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpTranslationVector::operator*(), vpRotationVector::operator*(), vpTranslationVector::operator-(), vpTranslationVector::operator/(), vpRzyzVector::operator=(), vpRzyxVector::operator=(), vpRxyzVector::operator=(), vpMatrix::operator=(), vpThetaUVector::operator=(), vpRowVector::reshape(), vpColVector::reshape(), vpMatrix::stackRows(), and vpRotationVector::t().
|
protectedinherited |
Number of rows in the array.
Definition at line 74 of file vpArray2D.h.
Referenced by vpMatrix::AAt(), vpMatrix::AtA(), vpColVector::clear(), vpMatrix::diag(), vpMatrix::eigenValues(), vpMatrix::expm(), vpColVector::extract(), vpMatrix::eye(), vpColVector::infinityNorm(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpMatrix::insert(), vpMatrix::inverseByCholesky(), vpMatrix::inverseByLU(), vpMatrix::inverseByQR(), vpRotationMatrix::operator*(), vpTranslationVector::operator*(), vpHomogeneousMatrix::operator*(), vpColVector::operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*=(), vpTranslationVector::operator*=(), vpColVector::operator*=(), vpMatrix::operator*=(), vpColVector::operator+(), vpColVector::operator+=(), vpMatrix::operator+=(), vpColVector::operator-(), vpColVector::operator-=(), vpMatrix::operator-=(), vpColVector::operator/(), vpMatrix::operator/(), vpTranslationVector::operator/=(), vpColVector::operator/=(), vpMatrix::operator/=(), vpMatrix::operator<<(), vpColVector::operator<<(), vpSubColVector::operator=(), vpSubRowVector::operator=(), vpSubMatrix::operator=(), vpTranslationVector::operator=(), vpRowVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpColVector::reshape(), vpMatrix::setIdentity(), vpMatrix::stack(), vpColVector::stack(), vpMatrix::stackColumns(), vpMatrix::stackRows(), vpColVector::sum(), vpMatrix::sum(), vpRotationVector::sumSquare(), vpTranslationVector::sumSquare(), vpColVector::sumSquare(), vpMatrix::sumSquare(), vpTranslationVector::t(), t(), vpColVector::t(), vpMatrix::t(), and vpMatrix::transpose().
|
protectedinherited |
Address of the first element of each rows.
Definition at line 78 of file vpArray2D.h.
Referenced by vpMatrix::AAt(), vpColVector::clear(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), vpRowVector::init(), vpColVector::init(), vpMatrix::init(), vpRotationMatrix::operator*(), vpForceTwistMatrix::operator*(), vpVelocityTwistMatrix::operator*(), vpHomogeneousMatrix::operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*=(), vpMatrix::operator*=(), vpMatrix::operator+=(), vpMatrix::operator-=(), vpMatrix::operator/(), vpMatrix::operator/=(), vpMatrix::operator<<(), vpColVector::operator<<(), vpSubMatrix::operator=(), vpRotationMatrix::operator=(), vpForceTwistMatrix::operator=(), vpVelocityTwistMatrix::operator=(), vpHomogeneousMatrix::operator=(), vpRowVector::operator=(), vpMatrix::operator=(), vpMatrix::stackColumns(), vpRowVector::sum(), vpMatrix::sum(), vpRotationVector::sumSquare(), vpTranslationVector::sumSquare(), vpRowVector::sumSquare(), vpMatrix::sumSquare(), and vpMatrix::transpose().