MRPT  1.9.9
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
mrpt::math::TPose3DQuat Struct Reference

Detailed Description

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

Allows coordinate access using [] operator.

See also
mrpt::poses::CPose3DQuat

Definition at line 19 of file TPose3DQuat.h.

#include <mrpt/math/TPose3DQuat.h>

Inheritance diagram for mrpt::math::TPose3DQuat:

Public Types

enum  { static_size = 7 }
 

Public Member Functions

constexpr TPose3DQuat (double _x, double _y, double _z, double _qr, double _qx, double _qy, double _qz)
 Constructor from coordinates. More...
 
 TPose3DQuat ()=default
 Default fast constructor. More...
 
double & operator[] (size_t i)
 Coordinate access using operator[]. More...
 
constexpr double operator[] (size_t i) const
 Coordinate access using operator[]. More...
 
double norm () const
 Pose's spatial coordinates (x,y,z) norm. More...
 
void asVector (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 as "[x y z qr qx qy qz]". More...
 
std::string asString () const
 
void fromString (const std::string &s)
 Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -0.8 1.0 0.0 0.0 0.0]" ) More...
 
constexpr std::size_t rows () const
 
constexpr std::size_t cols () const
 
constexpr std::size_t size () const
 
void resize (std::size_t n)
 throws if attempted to resize to incorrect length More...
 

Static Public Member Functions

static TPose3DQuat FromString (const std::string &s)
 

Public Attributes

double x {.0}
 Translation in x,y,z. More...
 
double y {.0}
 
double z {.0}
 
double qr {1.}
 Unit quaternion part, qr,qx,qy,qz. More...
 
double qx {.0}
 
double qy {.0}
 
double qz {.0}
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
static_size 

Definition at line 22 of file TPose3DQuat.h.

Constructor & Destructor Documentation

◆ TPose3DQuat() [1/2]

constexpr mrpt::math::TPose3DQuat::TPose3DQuat ( double  _x,
double  _y,
double  _z,
double  _qr,
double  _qx,
double  _qy,
double  _qz 
)
inline

Constructor from coordinates.

Definition at line 32 of file TPose3DQuat.h.

◆ TPose3DQuat() [2/2]

mrpt::math::TPose3DQuat::TPose3DQuat ( )
default

Default fast constructor.

Initializes to identity transformation.

Member Function Documentation

◆ asString() [1/2]

void mrpt::math::TPose3DQuat::asString ( std::string &  s) const
inline

Returns a human-readable textual representation of the object as "[x y z qr qx qy qz]".

See also
fromString

Definition at line 98 of file TPose3DQuat.h.

References mrpt::format(), qr, qx, qy, qz, x, y, and z.

Here is the call graph for this function:

◆ asString() [2/2]

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

Definition at line 102 of file TPose3DQuat.h.

◆ asVector()

void mrpt::math::TPose3DQuat::asVector ( std::vector< double > &  v) const
inline

Gets the pose as a vector of doubles.

Definition at line 89 of file TPose3DQuat.h.

◆ cols()

constexpr std::size_t mrpt::math::internal::ProvideStaticResize< TPose3DQuat >::cols ( ) const
inlineinherited

Definition at line 66 of file TPoseOrPoint.h.

◆ fromString()

void TPose3DQuat::fromString ( const std::string &  s)

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

See also
asString
Exceptions
std::exceptionOn invalid format

Definition at line 20 of file TPose3DQuat.cpp.

References ASSERTMSG_, mrpt::math::CMatrixDynamic< T >::cols(), mrpt::math::MatrixVectorBase< Scalar, Derived >::fromMatlabStringFormat(), mrpt::math::CMatrixDynamic< T >::rows(), and THROW_EXCEPTION.

Referenced by FromString().

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

◆ FromString()

static TPose3DQuat mrpt::math::TPose3DQuat::FromString ( const std::string &  s)
inlinestatic

Definition at line 116 of file TPose3DQuat.h.

References fromString().

Here is the call graph for this function:

◆ norm()

double TPose3DQuat::norm ( ) const

Pose's spatial coordinates (x,y,z) norm.

Definition at line 30 of file TPose3DQuat.cpp.

References mrpt::square(), x, y, and z.

Here is the call graph for this function:

◆ operator[]() [1/2]

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

Coordinate access using operator[].

Order: x,y,z,qr,qx,qy,qz

Definition at line 41 of file TPose3DQuat.h.

References qr, qx, qy, qz, x, y, and z.

◆ operator[]() [2/2]

constexpr double mrpt::math::TPose3DQuat::operator[] ( size_t  i) const
inline

Coordinate access using operator[].

Order: x,y,z,qr,qx,qy,qz

Definition at line 64 of file TPose3DQuat.h.

References qr, qx, qy, qz, x, y, and z.

◆ resize()

void mrpt::math::internal::ProvideStaticResize< TPose3DQuat >::resize ( std::size_t  n)
inlineinherited

throws if attempted to resize to incorrect length

Definition at line 70 of file TPoseOrPoint.h.

References ASSERT_EQUAL_.

◆ rows()

constexpr std::size_t mrpt::math::internal::ProvideStaticResize< TPose3DQuat >::rows ( ) const
inlineinherited

Definition at line 65 of file TPoseOrPoint.h.

◆ size()

constexpr std::size_t mrpt::math::internal::ProvideStaticResize< TPose3DQuat >::size ( ) const
inlineinherited

Definition at line 67 of file TPoseOrPoint.h.

Member Data Documentation

◆ qr

double mrpt::math::TPose3DQuat::qr {1.}

◆ qx

double mrpt::math::TPose3DQuat::qx {.0}

◆ qy

double mrpt::math::TPose3DQuat::qy {.0}

◆ qz

double mrpt::math::TPose3DQuat::qz {.0}

◆ x

double mrpt::math::TPose3DQuat::x {.0}

◆ y

double mrpt::math::TPose3DQuat::y {.0}

◆ z

double mrpt::math::TPose3DQuat::z {.0}



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020