MRPT  1.9.9
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 const double & operator[] (size_t i) const
 Coordinate access using operator[]. More...
 
double norm () const
 Pose's spatial coordinates 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...
 

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, and qz.

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 57 of file TPoseOrPoint.h.

◆ fromString()

void mrpt::math::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 497 of file TPoseOrPoint.cpp.

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

Here is the call graph for this function:

◆ norm()

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

Pose's spatial coordinates norm.

Definition at line 87 of file TPose3DQuat.h.

References mrpt::square().

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 const 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 61 of file TPoseOrPoint.h.

◆ rows()

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

Definition at line 56 of file TPoseOrPoint.h.

◆ size()

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

Definition at line 58 of file TPoseOrPoint.h.

Member Data Documentation

◆ qr

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

Unit quaternion part, qr,qx,qy,qz.

Definition at line 29 of file TPose3DQuat.h.

Referenced by asString(), mrpt::graphs::detail::graph_ops< graph_t >::load_graph_of_poses_from_text_stream(), and operator[]().

◆ 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: ee555d257 Fri Aug 16 10:05:39 2019 +0200 at vie ago 16 10:10:14 CEST 2019