ViSP  2.8.0

#include <vpRotationVector.h>

+ Inheritance diagram for vpRotationVector:

Public Member Functions

 vpRotationVector ()
 
 vpRotationVector (const unsigned int n)
 
 ~vpRotationVector ()
 
double & operator[] (unsigned int n)
 
const double & operator[] (unsigned int n) const
 
unsigned int size () const
 
vpRowVector t () const
 

Protected Member Functions

void init (const unsigned int size)
 

Protected Attributes

double * r
 
unsigned int _size
 

Friends

class vpColVector
 
VISP_EXPORT std::ostream & operator<< (std::ostream &s, const vpRotationVector &m)
 

Detailed Description

Class that consider the case of a generic rotation vector (cannot be used as is !) consisting in three angles.

The code below shows how this class can be used to manipulate a vpRxyzVector.

#include <iostream>
#include <visp/vpRxyzVector.h>
#include <visp/vpMath.h>
int main()
{
vpRxyzVector r; // By default initialized to zero
r[0] = vpMath::rad(45); // Rotation around x set to 45 degres converted in radians
r[1] = M_PI; // Rotation around y set to PI radians
r[2] = 0; // Rotation around z set to 0 radians
std::cout << "Rxyz rotation vector: " << r << std::endl;
double rx = r[1]; // Get the value of the angle around x axis
double ry = r[2]; // Get the value of the angle around y axis
double rz = r[3]; // Get the value of the angle around z axis
}

Definition at line 95 of file vpRotationVector.h.

Constructor & Destructor Documentation

vpRotationVector::vpRotationVector ( )
inline

Constructor that constructs a vector of size 3 initialize three vector values to zero.

Definition at line 104 of file vpRotationVector.h.

References vpMatrix::init().

vpRotationVector::vpRotationVector ( const unsigned int  n)
inline

Constructor that constructs a vector of size n initialize three vector values to zero.

Definition at line 110 of file vpRotationVector.h.

References vpMatrix::init().

vpRotationVector::~vpRotationVector ( )

Definition at line 119 of file vpRotationVector.cpp.

References r.

Member Function Documentation

void vpRotationVector::init ( const unsigned int  size)
protected

Definition at line 113 of file vpRotationVector.cpp.

References _size, r, and size().

double& vpRotationVector::operator[] ( unsigned int  n)
inline

Operator that allows to set the value of an element of the rotation vector: r[i] = value

Definition at line 120 of file vpRotationVector.h.

const double& vpRotationVector::operator[] ( unsigned int  n) const
inline

Operator that allows to get the value of an element of the rotation vector: value = r[i]

Definition at line 125 of file vpRotationVector.h.

unsigned int vpRotationVector::size ( ) const

Returns the size of the rotation vector

Size of the rotation vector: number of double values describing the rotation. Common sizes are 4 for a quaternion and 3 for angle-based rotation vectors.

Definition at line 71 of file vpRotationVector.cpp.

References _size.

Referenced by init(), vpQuaternionVector::operator=(), and vpQuaternionVector::vpQuaternionVector().

vpRowVector vpRotationVector::t ( ) const

Return the transpose of the rotation vector.

Examples:
testViper850.cpp.

Definition at line 57 of file vpRotationVector.cpp.

References _size, and r.

Friends And Related Function Documentation

VISP_EXPORT std::ostream& operator<< ( std::ostream &  s,
const vpRotationVector m 
)
friend

Print the values of the three angles on the output stream. Data are formatted as a column vector.

#include <iostream>
#include <visp/vpRxyzVector.h>
int main()
{
vpRxyzVector r; // By default initialized to zero
std::cout << "Rxyz rotation vector: " << std::endl << r << std::endl;
}

will lead to the following printing on the standart stream:

Rxyz rotation vector:
0
0
0

Definition at line 100 of file vpRotationVector.cpp.

friend class vpColVector
friend

Definition at line 97 of file vpRotationVector.h.

Member Data Documentation

unsigned int vpRotationVector::_size
protected

Definition at line 100 of file vpRotationVector.h.

Referenced by init(), size(), t(), and vpColVector::vpColVector().