Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
mrpt::math::TPose3D Struct Reference

Detailed Description

Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).

Allows coordinate access using [] operator.

See also
mrpt::poses::CPose3D

Definition at line 616 of file lightweight_geom_data.h.

#include <mrpt/math/lightweight_geom_data.h>

Public Types

enum  { static_size = 6 }
 

Public Member Functions

 TPose3D (const TPoint2D &p)
 Implicit constructor from TPoint2D. More...
 
 TPose3D (const TPose2D &p)
 Implicit constructor from TPose2D. More...
 
 TPose3D (const TPoint3D &p)
 Implicit constructor from TPoint3D. More...
 
 TPose3D (const mrpt::poses::CPose3D &p)
 Implicit constructor from heavyweight type. More...
 
 TPose3D (double _x, double _y, double _z, double _yaw, double _pitch, double _roll)
 Constructor from coordinates. More...
 
 TPose3D ()
 Default fast constructor. More...
 
double & operator[] (size_t i)
 Coordinate access using operator[]. More...
 
const double & operator[] (size_t i) const
 Coordinate access using operator[]. More...
 
double norm () const
 Pose's spatial coordinates norm. More...
 
void getAsVector (std::vector< double > &v) const
 Gets the pose as a vector of doubles. More...
 
void asString (std::string &s) const
 Returns a human-readable textual representation of the object (eg: "[x y z yaw pitch roll]", angles in degrees.) More...
 
std::string asString () const
 
void getAsQuaternion (mrpt::math::CQuaternion< double > &q, mrpt::math::CMatrixFixedNumeric< double, 4, 3 > *out_dq_dr=NULL) const
 Returns the quaternion associated to the rotation of this object (NOTE: XYZ translation is ignored)

\[ \mathbf{q} = \left( \begin{array}{c} \cos (\phi /2) \cos (\theta /2) \cos (\psi /2) + \sin (\phi /2) \sin (\theta /2) \sin (\psi /2) \\ \sin (\phi /2) \cos (\theta /2) \cos (\psi /2) - \cos (\phi /2) \sin (\theta /2) \sin (\psi /2) \\ \cos (\phi /2) \sin (\theta /2) \cos (\psi /2) + \sin (\phi /2) \cos (\theta /2) \sin (\psi /2) \\ \cos (\phi /2) \cos (\theta /2) \sin (\psi /2) - \sin (\phi /2) \sin (\theta /2) \cos (\psi /2) \\ \end{array}\right) \]

With : $ \phi = roll $, $ \theta = pitch $ and $ \psi = yaw $. More...

 
void fromString (const std::string &s)
 Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -0.8]" ) More...
 

Static Public Member Functions

static size_t size ()
 

Public Attributes

double x
 X,Y,Z, coords. More...
 
double y
 
double z
 
double yaw
 Yaw coordinate (rotation angle over Z axis). More...
 
double pitch
 Pitch coordinate (rotation angle over Y axis). More...
 
double roll
 Roll coordinate (rotation angle over X coordinate). More...
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
static_size 

Definition at line 618 of file lightweight_geom_data.h.

Constructor & Destructor Documentation

◆ TPose3D() [1/6]

mrpt::math::TPose3D::TPose3D ( const TPoint2D p)

Implicit constructor from TPoint2D.

Zeroes all the unprovided information.

See also
TPoint2D

Definition at line 233 of file lightweight_geom_data.cpp.

◆ TPose3D() [2/6]

mrpt::math::TPose3D::TPose3D ( const TPose2D p)

Implicit constructor from TPose2D.

Gets the yaw from the 2D pose's phi, zeroing all the unprovided information.

See also
TPose2D

Definition at line 237 of file lightweight_geom_data.cpp.

◆ TPose3D() [3/6]

mrpt::math::TPose3D::TPose3D ( const TPoint3D p)

Implicit constructor from TPoint3D.

Zeroes angular information.

See also
TPoint3D

Definition at line 241 of file lightweight_geom_data.cpp.

◆ TPose3D() [4/6]

mrpt::math::TPose3D::TPose3D ( const mrpt::poses::CPose3D p)

Implicit constructor from heavyweight type.

See also
mrpt::poses::CPose3D

Definition at line 245 of file lightweight_geom_data.cpp.

◆ TPose3D() [5/6]

mrpt::math::TPose3D::TPose3D ( double  _x,
double  _y,
double  _z,
double  _yaw,
double  _pitch,
double  _roll 
)
inline

Constructor from coordinates.

Definition at line 654 of file lightweight_geom_data.h.

◆ TPose3D() [6/6]

mrpt::math::TPose3D::TPose3D ( )
inline

Default fast constructor.

Initializes to garbage.

Definition at line 663 of file lightweight_geom_data.h.

Member Function Documentation

◆ asString() [1/2]

void mrpt::math::TPose3D::asString ( std::string s) const

Returns a human-readable textual representation of the object (eg: "[x y z yaw pitch roll]", angles in degrees.)

See also
fromString

Definition at line 254 of file lightweight_geom_data.cpp.

References mrpt::mrpt::format(), pitch, RAD2DEG, roll, and yaw.

Referenced by TEST().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ asString() [2/2]

std::string mrpt::math::TPose3D::asString ( ) const
inline

Definition at line 728 of file lightweight_geom_data.h.

◆ fromString()

void mrpt::math::TPose3D::fromString ( const std::string s)

Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -0.8]" )

See also
asString
Exceptions
std::exceptionOn invalid format

Definition at line 298 of file lightweight_geom_data.cpp.

References ASSERTMSG_, DEG2RAD, pitch, roll, mrpt::mrpt::math::size(), THROW_EXCEPTION, and yaw.

Here is the call graph for this function:

◆ getAsQuaternion()

void mrpt::math::TPose3D::getAsQuaternion ( mrpt::math::CQuaternion< double > &  q,
mrpt::math::CMatrixFixedNumeric< double, 4, 3 > *  out_dq_dr = NULL 
) const

Returns the quaternion associated to the rotation of this object (NOTE: XYZ translation is ignored)

\[ \mathbf{q} = \left( \begin{array}{c} \cos (\phi /2) \cos (\theta /2) \cos (\psi /2) + \sin (\phi /2) \sin (\theta /2) \sin (\psi /2) \\ \sin (\phi /2) \cos (\theta /2) \cos (\psi /2) - \cos (\phi /2) \sin (\theta /2) \sin (\psi /2) \\ \cos (\phi /2) \sin (\theta /2) \cos (\psi /2) + \sin (\phi /2) \cos (\theta /2) \sin (\psi /2) \\ \cos (\phi /2) \cos (\theta /2) \sin (\psi /2) - \sin (\phi /2) \sin (\theta /2) \cos (\psi /2) \\ \end{array}\right) \]

With : $ \phi = roll $, $ \theta = pitch $ and $ \psi = yaw $.

Parameters
out_dq_drIf provided, the 4x3 Jacobian of the transformation will be computed and stored here. It's the Jacobian of the transformation from (yaw pitch roll) to (qr qx qy qz).

Definition at line 260 of file lightweight_geom_data.cpp.

References mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::loadFromArray(), pitch, roll, and yaw.

Referenced by mrpt::poses::CPose3D::getAsQuaternion(), and mrpt::math::slerp_ypr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAsVector()

void mrpt::math::TPose3D::getAsVector ( std::vector< double > &  v) const
inline

Gets the pose as a vector of doubles.

Definition at line 713 of file lightweight_geom_data.h.

References pitch, roll, x, y, yaw, and z.

◆ norm()

double mrpt::math::TPose3D::norm ( ) const
inline

Pose's spatial coordinates norm.

Definition at line 709 of file lightweight_geom_data.h.

References mrpt::math::square().

Here is the call graph for this function:

◆ operator[]() [1/2]

double& mrpt::math::TPose3D::operator[] ( size_t  i)
inline

Coordinate access using operator[].

Order: x,y,z,yaw,pitch,roll

Definition at line 665 of file lightweight_geom_data.h.

References pitch, roll, x, y, yaw, and z.

◆ operator[]() [2/2]

const double& mrpt::math::TPose3D::operator[] ( size_t  i) const
inline

Coordinate access using operator[].

Order: x,y,z,yaw,pitch,roll

Definition at line 686 of file lightweight_geom_data.h.

References pitch, roll, x, y, yaw, and z.

◆ size()

static size_t mrpt::math::TPose3D::size ( )
inlinestatic

Definition at line 760 of file lightweight_geom_data.h.

Referenced by mrpt::slam::AuxiliaryPFStandardAndOptimal< USE_OPTIMAL_SAMPLING >::PF_SLAM_implementation().

Here is the caller graph for this function:

Member Data Documentation

◆ pitch

double mrpt::math::TPose3D::pitch

◆ roll

double mrpt::math::TPose3D::roll

◆ x

double mrpt::math::TPose3D::x

◆ y

double mrpt::math::TPose3D::y

◆ yaw

double mrpt::math::TPose3D::yaw

◆ z

double mrpt::math::TPose3D::z



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019