MRPT logo

mrpt::poses::CPose3D Class Reference

A class used to store a 3D pose. More...

#include <mrpt/poses/CPose3D.h>

Inheritance diagram for mrpt::poses::CPose3D:

mrpt::poses::CPose mrpt::poses::CPoseOrPoint mrpt::utils::CSerializable

List of all members.

Public Member Functions

 CPose3D (const double &x=0, const double &y=0, const double &z=0, const double &yaw=0, const double &pitch=0, const double &roll=0)
 Constructor with initilization of the pose; (remember that angles are always given in radians!).
 CPose3D (const CPose3D &o)
 Copy constructor.
CPose3Doperator= (const CPose3D &o)
 Copy operator.
 CPose3D (const math::CMatrixDouble &m)
 Constructor from a 4x4 homogeneous matrix:.
 CPose3D (const CPose2D &)
 Constructor from a CPose2D object.
 CPose3D (const CPoint3D &)
 Constructor from a CPoint3D object.
const math::CMatrixDoublegetHomogeneousMatrix () const
 Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation), or pose (translation+orientation).
void getHomogeneousMatrix (const math::CMatrixDouble *&ptrHM) const
 Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation), or pose (translation+orientation).
void addComponents (const CPose3D &p)
 Scalar sum of components: This is diferent from poses composition, which is implemented as "+" operators.
void normalizeAngles ()
 Rebuild the internal matrix & update the yaw/pitch/roll angles within the ]-PI,PI] range (Must be called after using addComponents).
void operator*= (const double &s)
 Scalar multiplication of x,y,z,yaw,pitch & roll (angles will be wrapped to the ]-pi,pi] interval).
void sphericalCoordinates (const CPoint3D &point, double &out_range, double &out_yaw, double &out_pitch) const
 Computes the spherical coordinates of a 3D point as seen from the 6D pose specified by this object.
void composePoint (double lx, double ly, double lz, double &gx, double &gy, double &gz) const
 An alternative, slightly more efficient way of doing $ G = P \oplus L $ with G and L being 3D points and P this 6D pose.
void composePoint (float lx, float ly, float lz, float &gx, float &gy, float &gz) const
 An alternative, slightly more efficient way of doing $ G = P \oplus L $ with G and L being 3D points and P this 6D pose.
void setFromValues (const double &x0, const double &y0, const double &z0, const double &yaw=0, const double &pitch=0, const double &roll=0)
 Set the pose from a 3D position (meters) and yaw/pitch/roll angles (radians).
void getYawPitchRoll (double &yaw, double &pitch, double &roll)
 Returns the three angles (yaw, pitch, roll), in radians, from the homogeneous matrix.
double distanceEuclidean6D (const CPose3D &o) const
 The euclidean distance between two poses taken as two 6-length vectors (angles in radians).
vector_double getAsVector () const
 Returns a 1x6 vector with [x y z yaw pitch roll].

Public Attributes

double yaw
 These READ-ONLY variables are updated every time that the object homogeneous matrix is modified (construction, loading from values, pose composition, etc ).
double pitch
double roll

Protected Member Functions

void rebuildHomogeneousMatrix ()
 Rebuild the homog matrix from x,y,z and the angles.

Protected Attributes

math::CMatrixD HM
 The complete homogeneous matrix must be stored for a generalized 3D pose.

Friends

class CPose
class CPose2D
class CPoint
std::ostream MRPTDLLIMPEXP & operator<< (std::ostream &o, const CPose3D &p)


Detailed Description

A class used to store a 3D pose.

A class used to store a 3D (6D) pose, including the 3D coordinate point and orientation angles. It is used in many situations, from defining a robot pose, maps relative poses, sensors,... See introduction in documentation for the CPoseOrPoint class.
For a complete description of Points/Poses, see mrpt::poses::CPoseOrPoint

For a complete description of Points/Poses, see mrpt::poses::CPoseOrPoint, or refer to the 2D/3D Geometry tutorial in the wiki.

poses::CPose3D

Homogeneous transfomation matrix

Spatial representation

cycp

cyspsr-sycr

cyspcr+sysr

x

sycp

syspsr+cycr

syspcr-cysr

y

-sp

cpsr

cpcr

z

0

0

0

1

where:

cy = cos Yaw ;  sy = sin Yaw

cp = cos Pitch ; sp = sin Pitch

cr = cos Roll ; sr = sin Roll

CPose3D.gif

See also:
CPoseOrPoint,CPoint3D

Definition at line 158 of file CPose3D.h.


Constructor & Destructor Documentation

mrpt::poses::CPose3D::CPose3D ( const double &  x = 0,
const double &  y = 0,
const double &  z = 0,
const double &  yaw = 0,
const double &  pitch = 0,
const double &  roll = 0 
)

Constructor with initilization of the pose; (remember that angles are always given in radians!).

mrpt::poses::CPose3D::CPose3D ( const CPose3D o  ) 

Copy constructor.

mrpt::poses::CPose3D::CPose3D ( const math::CMatrixDouble m  ) 

Constructor from a 4x4 homogeneous matrix:.

mrpt::poses::CPose3D::CPose3D ( const CPose2D  ) 

Constructor from a CPose2D object.

mrpt::poses::CPose3D::CPose3D ( const CPoint3D  ) 

Constructor from a CPoint3D object.


Member Function Documentation

void mrpt::poses::CPose3D::addComponents ( const CPose3D p  ) 

Scalar sum of components: This is diferent from poses composition, which is implemented as "+" operators.

See also:
normalizeAngles

void mrpt::poses::CPose3D::composePoint ( float  lx,
float  ly,
float  lz,
float &  gx,
float &  gy,
float &  gz 
) const

An alternative, slightly more efficient way of doing $ G = P \oplus L $ with G and L being 3D points and P this 6D pose.

void mrpt::poses::CPose3D::composePoint ( double  lx,
double  ly,
double  lz,
double &  gx,
double &  gy,
double &  gz 
) const

An alternative, slightly more efficient way of doing $ G = P \oplus L $ with G and L being 3D points and P this 6D pose.

double mrpt::poses::CPose3D::distanceEuclidean6D ( const CPose3D o  )  const

The euclidean distance between two poses taken as two 6-length vectors (angles in radians).

vector_double mrpt::poses::CPose3D::getAsVector (  )  const

Returns a 1x6 vector with [x y z yaw pitch roll].

void mrpt::poses::CPose3D::getHomogeneousMatrix ( const math::CMatrixDouble *&  ptrHM  )  const [virtual]

Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation), or pose (translation+orientation).

See also:
getInverseHomogeneousMatrix

Implements mrpt::poses::CPoseOrPoint.

const math::CMatrixDouble& mrpt::poses::CPose3D::getHomogeneousMatrix (  )  const [virtual]

Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation), or pose (translation+orientation).

See also:
getInverseHomogeneousMatrix

Implements mrpt::poses::CPoseOrPoint.

void mrpt::poses::CPose3D::getYawPitchRoll ( double &  yaw,
double &  pitch,
double &  roll 
)

Returns the three angles (yaw, pitch, roll), in radians, from the homogeneous matrix.

See also:
setFromValues, yaw, pitch, roll

void mrpt::poses::CPose3D::normalizeAngles (  ) 

Rebuild the internal matrix & update the yaw/pitch/roll angles within the ]-PI,PI] range (Must be called after using addComponents).

See also:
addComponents

void mrpt::poses::CPose3D::operator*= ( const double &  s  )  [virtual]

Scalar multiplication of x,y,z,yaw,pitch & roll (angles will be wrapped to the ]-pi,pi] interval).

Implements mrpt::poses::CPoseOrPoint.

CPose3D& mrpt::poses::CPose3D::operator= ( const CPose3D o  ) 

Copy operator.

void mrpt::poses::CPose3D::rebuildHomogeneousMatrix (  )  [protected]

Rebuild the homog matrix from x,y,z and the angles.

void mrpt::poses::CPose3D::setFromValues ( const double &  x0,
const double &  y0,
const double &  z0,
const double &  yaw = 0,
const double &  pitch = 0,
const double &  roll = 0 
)

Set the pose from a 3D position (meters) and yaw/pitch/roll angles (radians).

See also:
getYawPitchRoll

void mrpt::poses::CPose3D::sphericalCoordinates ( const CPoint3D point,
double &  out_range,
double &  out_yaw,
double &  out_pitch 
) const

Computes the spherical coordinates of a 3D point as seen from the 6D pose specified by this object.

For the coordinate system see the top of this page.


Friends And Related Function Documentation

friend class CPoint [friend]

Definition at line 162 of file CPose3D.h.

friend class CPose [friend]

Definition at line 160 of file CPose3D.h.

friend class CPose2D [friend]

Definition at line 161 of file CPose3D.h.

std::ostream MRPTDLLIMPEXP& operator<< ( std::ostream &  o,
const CPose3D p 
) [friend]


Member Data Documentation

The complete homogeneous matrix must be stored for a generalized 3D pose.

Definition at line 273 of file CPose3D.h.

Definition at line 257 of file CPose3D.h.

Definition at line 257 of file CPose3D.h.

These READ-ONLY variables are updated every time that the object homogeneous matrix is modified (construction, loading from values, pose composition, etc ).

Definition at line 257 of file CPose3D.h.




Page generated by Doxygen 1.5.7.1 for MRPT 0.6.5 SVN: at Mon Feb 23 13:35:09 EST 2009