Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
mrpt::poses::CPose3DQuat Class Reference

Detailed Description

A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).

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

To access the translation use x(), y() and z(). To access the rotation, use CPose3DQuat::quat().

This class also behaves like a STL container, since it has begin(), end(), iterators, and can be accessed with the [] operator with indices running from 0 to 6 to access the [x y z qr qx qy qz] as if they were a vector. Thus, a CPose3DQuat can be used as a 7-vector anywhere the MRPT math functions expect any kind of vector.

This class and CPose3D are very similar, and they can be converted to the each other automatically via transformation constructors.

See also
CPose3D (for a class based on a 4x4 matrix instead of a quaternion), mrpt::math::TPose3DQuat, mrpt::poses::CPose3DQuatPDF for a probabilistic version of this class, mrpt::math::CQuaternion, CPoseOrPoint

Definition at line 48 of file CPose3DQuat.h.

#include <mrpt/poses/CPose3DQuat.h>

Inheritance diagram for mrpt::poses::CPose3DQuat:
Inheritance graph

Classes

struct  const_iterator
 
struct  iterator
 

Public Types

enum  { is_3D_val = 1 }
 
enum  { rotation_dimensions = 3 }
 
enum  { is_PDF_val = 1 }
 
using type_value = CPose3DQuat
 Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses. More...
 
using mrpt_autotype = CPose3DQuat
 See ops_containers.h. More...
 

Public Member Functions

voidoperator new (size_t size)
 
voidoperator new[] (size_t size)
 
void operator delete (void *ptr) noexcept
 
void operator delete[] (void *ptr) noexcept
 
void operator delete (void *memory, void *ptr) noexcept
 
voidoperator new (size_t size, const std::nothrow_t &) noexcept
 
void operator delete (void *ptr, const std::nothrow_t &) noexcept
 
mrpt::math::CQuaternionDoublequat ()
 Read/Write access to the quaternion representing the 3D rotation. More...
 
const mrpt::math::CQuaternionDoublequat () const
 Read-only access to the quaternion representing the 3D rotation. More...
 
mrpt::math::CArrayDouble< 3 > & xyz ()
 Read/Write access to the translation vector in R^3. More...
 
const mrpt::math::CArrayDouble< 3 > & xyz () const
 Read-only access to the translation vector in R^3. More...
 
 CPose3DQuat ()
 Default constructor, initialize translation to zeros and quaternion to no rotation. More...
 
 CPose3DQuat (mrpt::math::TConstructorFlags_Quaternions)
 Constructor which left all the quaternion members un-initialized, for use when speed is critical; Use UNINITIALIZED_POSE as argument to this constructor. More...
 
 CPose3DQuat (TConstructorFlags_Poses)
 
 CPose3DQuat (const double x, const double y, const double z, const mrpt::math::CQuaternionDouble &q)
 Constructor with initilization of the pose - the quaternion is normalized to make sure it's unitary. More...
 
 CPose3DQuat (const CPose3D &p)
 Constructor from a CPose3D. More...
 
 CPose3DQuat (const mrpt::math::TPose3DQuat &p)
 Constructor from lightweight object. More...
 
mrpt::math::TPose3DQuat asTPose () const
 
 CPose3DQuat (const mrpt::math::CMatrixDouble44 &M)
 Constructor from a 4x4 homogeneous transformation matrix. More...
 
void getHomogeneousMatrix (mrpt::math::CMatrixDouble44 &out_HM) const
 Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation). More...
 
void getAsVector (mrpt::math::CVectorDouble &v) const
 Returns a 1x7 vector with [x y z qr qx qy qz]. More...
 
void getAsVector (mrpt::math::CArrayDouble< 7 > &v) const
 
void composeFrom (const CPose3DQuat &A, const CPose3DQuat &B)
 Makes $ this = A \oplus B $ this method is slightly more efficient than "this= A + B;" since it avoids the temporary object. More...
 
void inverseComposeFrom (const CPose3DQuat &A, const CPose3DQuat &B)
 Makes $ this = A \ominus B $ this method is slightly more efficient than "this= A - B;" since it avoids the temporary object. More...
 
void composePoint (const double lx, const double ly, const double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 7 > *out_jacobian_df_dpose=nullptr) const
 Computes the 3D point G such as $ G = this \oplus L $. More...
 
void inverseComposePoint (const double gx, const double gy, const double gz, double &lx, double &ly, double &lz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 7 > *out_jacobian_df_dpose=nullptr) const
 Computes the 3D point L such as $ L = G \ominus this $. More...
 
template<class POINT1 , class POINT2 >
void composePoint (const POINT1 &L, POINT2 &G) const
 Computes the 3D point G such as $ G = this \oplus L $. More...
 
template<class POINT1 , class POINT2 >
void inverseComposePoint (const POINT1 &G, POINT2 &L) const
 Computes the 3D point L such as $ L = G \ominus this $. More...
 
CPoint3D operator+ (const CPoint3D &L) const
 Computes the 3D point G such as $ G = this \oplus L $. More...
 
mrpt::math::TPoint3D operator+ (const mrpt::math::TPoint3D &L) const
 Computes the 3D point G such as $ G = this \oplus L $. More...
 
virtual void operator*= (const double s)
 Scalar multiplication (all x y z qr qx qy qz elements are multiplied by the scalar). More...
 
CPose3DQuatoperator+= (const CPose3DQuat &b)
 Make $ this = this \oplus b $. More...
 
CPose3DQuat operator+ (const CPose3DQuat &p) const
 Return the composed pose $ ret = this \oplus p $. More...
 
CPose3DQuatoperator-= (const CPose3DQuat &b)
 Make $ this = this \ominus b $. More...
 
CPose3DQuat operator- (const CPose3DQuat &p) const
 Return the composed pose $ ret = this \ominus p $. More...
 
void inverse ()
 Convert this pose into its inverse, saving the result in itself. More...
 
void asString (std::string &s) const
 Returns a human-readable textual representation of the object (eg: "[x y z qr qx qy qz]", angles in degrees.) 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]" ) More...
 
void fromStringRaw (const std::string &s)
 Same as fromString, but without requiring the square brackets in the string. More...
 
const double & operator[] (unsigned int i) const
 Read only [] operator. More...
 
double & operator[] (unsigned int i)
 Read/write [] operator. More...
 
void sphericalCoordinates (const mrpt::math::TPoint3D &point, double &out_range, double &out_yaw, double &out_pitch, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacob_dryp_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 7 > *out_jacob_dryp_dpose=nullptr) const
 Computes the spherical coordinates of a 3D point as seen from the 6D pose specified by this object. More...
 
const type_valuegetPoseMean () const
 
type_valuegetPoseMean ()
 
void setToNaN () override
 Set all data fields to quiet NaN. More...
 
const CPose3DQuatderived () const
 
CPose3DQuatderived ()
 
virtual mxArraywriteToMatlab () const
 Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More...
 
RTTI classes and functions for polymorphic hierarchies
mrpt::rtti::CObject::Ptr duplicateGetSmartPtr () const
 Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More...
 

Static Public Member Functions

static voidoperator new (size_t size, void *ptr)
 
static bool is_3D ()
 
static bool is_PDF ()
 

Public Attributes

mrpt::math::CArrayDouble< 3 > m_coords
 The translation vector [x,y,z]. More...
 
mrpt::math::CQuaternionDouble m_quat
 The quaternion. More...
 

Protected Member Functions

CSerializable virtual methods
uint8_t serializeGetVersion () const override
 Must return the current versioning number of the object. More...
 
void serializeTo (mrpt::serialization::CArchive &out) const override
 Pure virtual method for writing (serializing) to an abstract archive. More...
 
void serializeFrom (mrpt::serialization::CArchive &in, uint8_t serial_version) override
 Pure virtual method for reading (deserializing) from an abstract archive. More...
 

RTTI stuff

using Ptr = std::shared_ptr< CPose3DQuat >
 
using ConstPtr = std::shared_ptr< const CPose3DQuat >
 
using UniquePtr = std::unique_ptr< CPose3DQuat >
 
using ConstUniquePtr = std::unique_ptr< const CPose3DQuat >
 
static mrpt::rtti::CLASSINIT _init_CPose3DQuat
 
static const mrpt::rtti::TRuntimeClassId runtimeClassId
 
static constexpr const char * className = "CPose3DQuat"
 
static const mrpt::rtti::TRuntimeClassId_GetBaseClass ()
 
static constexpr auto getClassName ()
 
static const mrpt::rtti::TRuntimeClassIdGetRuntimeClassIdStatic ()
 
static mrpt::rtti::CObjectCreateObject ()
 
template<typename... Args>
static Ptr Create (Args &&... args)
 
template<typename... Args>
static UniquePtr CreateUnique (Args &&... args)
 
virtual const mrpt::rtti::TRuntimeClassIdGetRuntimeClass () const override
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::rtti::CObjectclone () const override
 Returns a deep copy (clone) of the object, indepently of its class. More...
 

STL-like methods and typedefs

 
enum  { static_size = 7 }
 
using value_type = double
 The type of the elements. More...
 
using reference = double &
 
using const_reference = const double &
 
using size_type = std::size_t
 
using difference_type = std::ptrdiff_t
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
static size_type size ()
 
static bool empty ()
 
static size_type max_size ()
 
static void resize (const size_t n)
 
void assign (const size_t N, const double val)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
void swap (CPose3DQuat &o)
 
static bool is3DPoseOrPoint ()
 Return true for poses or points with a Z component, false otherwise. More...
 
double x () const
 Common members of all points & poses classes. More...
 
double & x ()
 
void x (const double v)
 
double y () const
 
double & y ()
 
void y (const double v)
 
void x_incr (const double v)
 
void y_incr (const double v)
 
double sqrDistanceTo (const CPoseOrPoint< OTHERCLASS > &b) const
 Returns the squared euclidean distance to another pose/point: More...
 
double distanceTo (const CPoseOrPoint< OTHERCLASS > &b) const
 Returns the Euclidean distance to another pose/point: More...
 
double distanceTo (const mrpt::math::TPoint3D &b) const
 Returns the euclidean distance to a 3D point: More...
 
double distance2DToSquare (double ax, double ay) const
 Returns the squared 2D distance from this pose/point to a 2D point (ignores Z, if it exists). More...
 
double distance3DToSquare (double ax, double ay, double az) const
 Returns the squared 3D distance from this pose/point to a 3D point. More...
 
double distance2DTo (double ax, double ay) const
 Returns the 2D distance from this pose/point to a 2D point (ignores Z, if it exists). More...
 
double distance3DTo (double ax, double ay, double az) const
 Returns the 3D distance from this pose/point to a 3D point. More...
 
double norm () const
 Returns the euclidean norm of vector: $ ||\mathbf{x}|| = \sqrt{x^2+y^2+z^2} $. More...
 
mrpt::math::CVectorDouble getAsVectorVal () const
 Return the pose or point as a 1xN vector with all the components (see derived classes for each implementation) More...
 
MATRIX44 getHomogeneousMatrixVal () const
 Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation). More...
 
void getInverseHomogeneousMatrix (MATRIX44 &out_HM) const
 Returns the corresponding 4x4 inverse homogeneous transformation matrix for this point or pose. More...
 
MATRIX44 getInverseHomogeneousMatrixVal () const
 

Member Typedef Documentation

◆ const_reference

Definition at line 376 of file CPose3DQuat.h.

◆ const_reverse_iterator

Definition at line 628 of file CPose3DQuat.h.

◆ ConstPtr

Definition at line 51 of file CPose3DQuat.h.

◆ ConstUniquePtr

using mrpt::poses::CPose3DQuat::ConstUniquePtr = std::unique_ptr<const CPose3DQuat >

Definition at line 51 of file CPose3DQuat.h.

◆ difference_type

Definition at line 378 of file CPose3DQuat.h.

◆ mrpt_autotype

See ops_containers.h.

Definition at line 655 of file CPose3DQuat.h.

◆ Ptr

A type for the associated smart pointer

Definition at line 51 of file CPose3DQuat.h.

◆ reference

Definition at line 375 of file CPose3DQuat.h.

◆ reverse_iterator

using mrpt::poses::CPose3DQuat::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 627 of file CPose3DQuat.h.

◆ size_type

Definition at line 377 of file CPose3DQuat.h.

◆ type_value

Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses.

Definition at line 354 of file CPose3DQuat.h.

◆ UniquePtr

Definition at line 51 of file CPose3DQuat.h.

◆ value_type

The type of the elements.

Definition at line 374 of file CPose3DQuat.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
is_3D_val 

Definition at line 355 of file CPose3DQuat.h.

◆ anonymous enum

anonymous enum
Enumerator
rotation_dimensions 

Definition at line 360 of file CPose3DQuat.h.

◆ anonymous enum

anonymous enum
Enumerator
is_PDF_val 

Definition at line 364 of file CPose3DQuat.h.

◆ anonymous enum

anonymous enum
Enumerator
static_size 

Definition at line 381 of file CPose3DQuat.h.

Constructor & Destructor Documentation

◆ CPose3DQuat() [1/7]

mrpt::poses::CPose3DQuat::CPose3DQuat ( )
inline

Default constructor, initialize translation to zeros and quaternion to no rotation.

Definition at line 70 of file CPose3DQuat.h.

References m_coords.

◆ CPose3DQuat() [2/7]

mrpt::poses::CPose3DQuat::CPose3DQuat ( mrpt::math::TConstructorFlags_Quaternions  )
inline

Constructor which left all the quaternion members un-initialized, for use when speed is critical; Use UNINITIALIZED_POSE as argument to this constructor.

Definition at line 78 of file CPose3DQuat.h.

◆ CPose3DQuat() [3/7]

mrpt::poses::CPose3DQuat::CPose3DQuat ( TConstructorFlags_Poses  )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 83 of file CPose3DQuat.h.

◆ CPose3DQuat() [4/7]

mrpt::poses::CPose3DQuat::CPose3DQuat ( const double  x,
const double  y,
const double  z,
const mrpt::math::CQuaternionDouble q 
)
inline

Constructor with initilization of the pose - the quaternion is normalized to make sure it's unitary.

Definition at line 90 of file CPose3DQuat.h.

References m_coords, m_quat, mrpt::math::CQuaternion< T >::normalize(), mrpt::poses::CPoseOrPoint< CPose3DQuat >::x(), and mrpt::poses::CPoseOrPoint< CPose3DQuat >::y().

◆ CPose3DQuat() [5/7]

CPose3DQuat::CPose3DQuat ( const CPose3D p)
explicit

Constructor from a CPose3D.

Definition at line 25 of file CPose3DQuat.cpp.

◆ CPose3DQuat() [6/7]

mrpt::poses::CPose3DQuat::CPose3DQuat ( const mrpt::math::TPose3DQuat p)
inline

Constructor from lightweight object.

Definition at line 105 of file CPose3DQuat.h.

References mrpt::poses::CPoseOrPoint< CPose3DQuat >::x(), and mrpt::poses::CPoseOrPoint< CPose3DQuat >::y().

◆ CPose3DQuat() [7/7]

CPose3DQuat::CPose3DQuat ( const mrpt::math::CMatrixDouble44 M)
explicit

Constructor from a 4x4 homogeneous transformation matrix.

Definition at line 35 of file CPose3DQuat.cpp.

References m_coords, and m_quat.

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::rtti::TRuntimeClassId* mrpt::poses::CPose3DQuat::_GetBaseClass ( )
staticprotected

◆ assign()

void mrpt::poses::CPose3DQuat::assign ( const size_t  N,
const double  val 
)
inline

Definition at line 396 of file CPose3DQuat.h.

References m_coords, m_quat, and val.

◆ asString() [1/2]

void mrpt::poses::CPose3DQuat::asString ( std::string s) const
inline

Returns a human-readable textual representation of the object (eg: "[x y z qr qx qy qz]", angles in degrees.)

See also
fromString

Definition at line 251 of file CPose3DQuat.h.

References mrpt::format(), m_coords, and m_quat.

◆ asString() [2/2]

std::string mrpt::poses::CPose3DQuat::asString ( ) const
inline

Definition at line 257 of file CPose3DQuat.h.

◆ asTPose()

TPose3DQuat CPose3DQuat::asTPose ( ) const

◆ begin() [1/2]

iterator mrpt::poses::CPose3DQuat::begin ( )
inline

Definition at line 629 of file CPose3DQuat.h.

Referenced by rend().

◆ begin() [2/2]

const_iterator mrpt::poses::CPose3DQuat::begin ( ) const
inline

Definition at line 631 of file CPose3DQuat.h.

◆ clone()

virtual mrpt::rtti::CObject* mrpt::poses::CPose3DQuat::clone ( ) const
overridevirtual

Returns a deep copy (clone) of the object, indepently of its class.

Implements mrpt::rtti::CObject.

◆ composeFrom()

void CPose3DQuat::composeFrom ( const CPose3DQuat A,
const CPose3DQuat B 
)

Makes $ this = A \oplus B $ this method is slightly more efficient than "this= A + B;" since it avoids the temporary object.

Makes "this = A (+) B"; this method is slightly more efficient than "this= A + B;" since it avoids the temporary object.

Note
A or B can be "this" without problems.
See also
inverseComposeFrom, composePoint
Note
A or B can be "this" without problems.

Definition at line 77 of file CPose3DQuat.cpp.

References mrpt::math::CQuaternion< T >::crossProduct(), m_coords, m_quat, and mrpt::math::CQuaternion< T >::rotatePoint().

Referenced by operator+(), and operator+=().

◆ composePoint() [1/2]

void CPose3DQuat::composePoint ( const double  lx,
const double  ly,
const double  lz,
double &  gx,
double &  gy,
double &  gz,
mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *  out_jacobian_df_dpoint = nullptr,
mrpt::math::CMatrixFixedNumeric< double, 3, 7 > *  out_jacobian_df_dpose = nullptr 
) const

◆ composePoint() [2/2]

template<class POINT1 , class POINT2 >
void mrpt::poses::CPose3DQuat::composePoint ( const POINT1 &  L,
POINT2 &  G 
) const
inline

Computes the 3D point G such as $ G = this \oplus L $.

POINT1 and POINT1 can be anything supporing [0],[1],[2].

See also
composePoint

Definition at line 178 of file CPose3DQuat.h.

References composePoint(), and G.

◆ Create()

template<typename... Args>
static Ptr mrpt::poses::CPose3DQuat::Create ( Args &&...  args)
inlinestatic

Definition at line 51 of file CPose3DQuat.h.

◆ CreateObject()

static mrpt::rtti::CObject* mrpt::poses::CPose3DQuat::CreateObject ( )
static

◆ CreateUnique()

template<typename... Args>
static UniquePtr mrpt::poses::CPose3DQuat::CreateUnique ( Args &&...  args)
inlinestatic

Definition at line 51 of file CPose3DQuat.h.

◆ derived() [1/2]

const CPose3DQuat & mrpt::poses::CPoseOrPoint< CPose3DQuat >::derived ( ) const
inlineinherited

Definition at line 131 of file CPoseOrPoint.h.

◆ derived() [2/2]

CPose3DQuat & mrpt::poses::CPoseOrPoint< CPose3DQuat >::derived ( )
inlineinherited

Definition at line 135 of file CPoseOrPoint.h.

◆ distance2DTo()

double mrpt::poses::CPoseOrPoint< CPose3DQuat >::distance2DTo ( double  ax,
double  ay 
) const
inlineinherited

Returns the 2D distance from this pose/point to a 2D point (ignores Z, if it exists).

Definition at line 234 of file CPoseOrPoint.h.

◆ distance2DToSquare()

double mrpt::poses::CPoseOrPoint< CPose3DQuat >::distance2DToSquare ( double  ax,
double  ay 
) const
inlineinherited

Returns the squared 2D distance from this pose/point to a 2D point (ignores Z, if it exists).

Definition at line 218 of file CPoseOrPoint.h.

◆ distance3DTo()

double mrpt::poses::CPoseOrPoint< CPose3DQuat >::distance3DTo ( double  ax,
double  ay,
double  az 
) const
inlineinherited

Returns the 3D distance from this pose/point to a 3D point.

Definition at line 240 of file CPoseOrPoint.h.

◆ distance3DToSquare()

double mrpt::poses::CPoseOrPoint< CPose3DQuat >::distance3DToSquare ( double  ax,
double  ay,
double  az 
) const
inlineinherited

Returns the squared 3D distance from this pose/point to a 3D point.

Definition at line 225 of file CPoseOrPoint.h.

◆ distanceTo() [1/2]

double mrpt::poses::CPoseOrPoint< CPose3DQuat >::distanceTo ( const CPoseOrPoint< OTHERCLASS > &  b) const
inlineinherited

Returns the Euclidean distance to another pose/point:

Definition at line 211 of file CPoseOrPoint.h.

◆ distanceTo() [2/2]

double mrpt::poses::CPoseOrPoint< CPose3DQuat >::distanceTo ( const mrpt::math::TPoint3D b) const
inlineinherited

Returns the euclidean distance to a 3D point:

Definition at line 246 of file CPoseOrPoint.h.

◆ duplicateGetSmartPtr()

mrpt::rtti::CObject::Ptr CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).

Definition at line 169 of file CObject.h.

References mrpt::rtti::CObject::clone().

Referenced by mrpt::obs::CRawlog::addActions(), and mrpt::obs::CRawlog::addObservations().

◆ empty()

static bool mrpt::poses::CPose3DQuat::empty ( )
inlinestatic

Definition at line 386 of file CPose3DQuat.h.

◆ end() [1/2]

iterator mrpt::poses::CPose3DQuat::end ( )
inline

Definition at line 630 of file CPose3DQuat.h.

References static_size.

Referenced by rbegin().

◆ end() [2/2]

const_iterator mrpt::poses::CPose3DQuat::end ( ) const
inline

Definition at line 632 of file CPose3DQuat.h.

References static_size.

◆ fromString()

void mrpt::poses::CPose3DQuat::fromString ( const std::string s)
inline

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

See also
asString
Exceptions
std::exceptionOn invalid format

Definition at line 269 of file CPose3DQuat.h.

References ASSERTMSG_, m_coords, m_quat, and THROW_EXCEPTION.

◆ fromStringRaw()

void mrpt::poses::CPose3DQuat::fromStringRaw ( const std::string s)

Same as fromString, but without requiring the square brackets in the string.

Referenced by mrpt::poses::internal::getPoseFromString< true, false >().

◆ getAsVector() [1/2]

void CPose3DQuat::getAsVector ( mrpt::math::CVectorDouble v) const

Returns a 1x7 vector with [x y z qr qx qy qz].

Definition at line 61 of file CPose3DQuat.cpp.

References m_coords, and m_quat.

◆ getAsVector() [2/2]

void mrpt::poses::CPose3DQuat::getAsVector ( mrpt::math::CArrayDouble< 7 > &  v) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 127 of file CPose3DQuat.h.

References m_coords, and m_quat.

◆ getAsVectorVal()

mrpt::math::CVectorDouble mrpt::poses::CPoseOrPoint< CPose3DQuat >::getAsVectorVal ( ) const
inlineinherited

Return the pose or point as a 1xN vector with all the components (see derived classes for each implementation)

Definition at line 263 of file CPoseOrPoint.h.

◆ getClassName()

static constexpr auto mrpt::poses::CPose3DQuat::getClassName ( )
inlinestatic

Definition at line 51 of file CPose3DQuat.h.

◆ getHomogeneousMatrix()

void CPose3DQuat::getHomogeneousMatrix ( mrpt::math::CMatrixDouble44 out_HM) const

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

See also
getInverseHomogeneousMatrix

Definition at line 49 of file CPose3DQuat.cpp.

References m_coords, m_quat, and mrpt::math::CQuaternion< T >::rotationMatrixNoResize().

◆ getHomogeneousMatrixVal()

MATRIX44 mrpt::poses::CPoseOrPoint< CPose3DQuat >::getHomogeneousMatrixVal ( ) const
inlineinherited

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

See also
getInverseHomogeneousMatrix

Definition at line 275 of file CPoseOrPoint.h.

◆ getInverseHomogeneousMatrix()

void mrpt::poses::CPoseOrPoint< CPose3DQuat >::getInverseHomogeneousMatrix ( MATRIX44 &  out_HM) const
inlineinherited

Returns the corresponding 4x4 inverse homogeneous transformation matrix for this point or pose.

See also
getHomogeneousMatrix

Definition at line 287 of file CPoseOrPoint.h.

◆ getInverseHomogeneousMatrixVal()

MATRIX44 mrpt::poses::CPoseOrPoint< CPose3DQuat >::getInverseHomogeneousMatrixVal ( ) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 295 of file CPoseOrPoint.h.

◆ getPoseMean() [1/2]

const type_value& mrpt::poses::CPose3DQuat::getPoseMean ( ) const
inline

Definition at line 369 of file CPose3DQuat.h.

◆ getPoseMean() [2/2]

type_value& mrpt::poses::CPose3DQuat::getPoseMean ( )
inline

Definition at line 370 of file CPose3DQuat.h.

◆ GetRuntimeClass()

virtual const mrpt::rtti::TRuntimeClassId* mrpt::poses::CPose3DQuat::GetRuntimeClass ( ) const
overridevirtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::serialization::CSerializable.

◆ GetRuntimeClassIdStatic()

static const mrpt::rtti::TRuntimeClassId& mrpt::poses::CPose3DQuat::GetRuntimeClassIdStatic ( )
static

◆ inverse()

void CPose3DQuat::inverse ( )

Convert this pose into its inverse, saving the result in itself.

See also
operator-

Definition at line 457 of file CPose3DQuat.cpp.

References inverseComposePoint(), m_coords, and m_quat.

Referenced by mrpt::poses::operator-().

◆ inverseComposeFrom()

void CPose3DQuat::inverseComposeFrom ( const CPose3DQuat A,
const CPose3DQuat B 
)

Makes $ this = A \ominus B $ this method is slightly more efficient than "this= A - B;" since it avoids the temporary object.

Note
A or B can be "this" without problems.
See also
composeFrom, composePoint
Note
A or B can be "this" without problems.
See also
composeFrom

Definition at line 96 of file CPose3DQuat.cpp.

References mrpt::math::CQuaternion< T >::crossProduct(), m_coords, m_quat, mrpt::math::CQuaternion< T >::r(), mrpt::math::CQuaternion< T >::rotatePoint(), mrpt::math::CQuaternion< T >::x(), mrpt::math::CQuaternion< T >::y(), and mrpt::math::CQuaternion< T >::z().

Referenced by operator-(), and operator-=().

◆ inverseComposePoint() [1/2]

void CPose3DQuat::inverseComposePoint ( const double  gx,
const double  gy,
const double  gz,
double &  lx,
double &  ly,
double &  lz,
mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *  out_jacobian_df_dpoint = nullptr,
mrpt::math::CMatrixFixedNumeric< double, 3, 7 > *  out_jacobian_df_dpose = nullptr 
) const

◆ inverseComposePoint() [2/2]

template<class POINT1 , class POINT2 >
void mrpt::poses::CPose3DQuat::inverseComposePoint ( const POINT1 &  G,
POINT2 &  L 
) const
inline

Computes the 3D point L such as $ L = G \ominus this $.

See also
inverseComposePoint

Definition at line 186 of file CPose3DQuat.h.

References G, and inverseComposePoint().

◆ is3DPoseOrPoint()

static bool mrpt::poses::CPoseOrPoint< CPose3DQuat >::is3DPoseOrPoint ( )
inlinestaticinherited

Return true for poses or points with a Z component, false otherwise.

Definition at line 177 of file CPoseOrPoint.h.

◆ is_3D()

static bool mrpt::poses::CPose3DQuat::is_3D ( )
inlinestatic

Definition at line 359 of file CPose3DQuat.h.

References is_3D_val.

◆ is_PDF()

static bool mrpt::poses::CPose3DQuat::is_PDF ( )
inlinestatic

Definition at line 368 of file CPose3DQuat.h.

References is_PDF_val.

◆ max_size()

static size_type mrpt::poses::CPose3DQuat::max_size ( )
inlinestatic

Definition at line 387 of file CPose3DQuat.h.

References static_size.

◆ norm()

double mrpt::poses::CPoseOrPoint< CPose3DQuat >::norm ( ) const
inlineinherited

Returns the euclidean norm of vector: $ ||\mathbf{x}|| = \sqrt{x^2+y^2+z^2} $.

Definition at line 253 of file CPoseOrPoint.h.

◆ operator delete() [1/3]

void mrpt::poses::CPose3DQuat::operator delete ( void ptr,
const std::nothrow_t &   
)
inlinenoexcept

Definition at line 51 of file CPose3DQuat.h.

◆ operator delete() [2/3]

void mrpt::poses::CPose3DQuat::operator delete ( void ptr)
inlinenoexcept

Definition at line 51 of file CPose3DQuat.h.

◆ operator delete() [3/3]

void mrpt::poses::CPose3DQuat::operator delete ( void memory,
void ptr 
)
inlinenoexcept

Definition at line 51 of file CPose3DQuat.h.

◆ operator delete[]()

void mrpt::poses::CPose3DQuat::operator delete[] ( void ptr)
inlinenoexcept

Definition at line 51 of file CPose3DQuat.h.

◆ operator new() [1/3]

void* mrpt::poses::CPose3DQuat::operator new ( size_t  size)
inline

Definition at line 51 of file CPose3DQuat.h.

◆ operator new() [2/3]

void* mrpt::poses::CPose3DQuat::operator new ( size_t  size,
const std::nothrow_t &   
)
inlinenoexcept

Definition at line 51 of file CPose3DQuat.h.

◆ operator new() [3/3]

static void* mrpt::poses::CPose3DQuat::operator new ( size_t  size,
void ptr 
)
inlinestatic

Definition at line 51 of file CPose3DQuat.h.

◆ operator new[]()

void* mrpt::poses::CPose3DQuat::operator new[] ( size_t  size)
inline

Definition at line 51 of file CPose3DQuat.h.

◆ operator*=()

void CPose3DQuat::operator*= ( const double  s)
virtual

Scalar multiplication (all x y z qr qx qy qz elements are multiplied by the scalar).

Definition at line 317 of file CPose3DQuat.cpp.

References m_coords, and m_quat.

◆ operator+() [1/3]

CPoint3D mrpt::poses::CPose3DQuat::operator+ ( const CPoint3D L) const
inline

Computes the 3D point G such as $ G = this \oplus L $.

See also
composePoint

Definition at line 193 of file CPose3DQuat.h.

References composePoint(), and G.

◆ operator+() [2/3]

mrpt::math::TPoint3D mrpt::poses::CPose3DQuat::operator+ ( const mrpt::math::TPoint3D L) const
inline

Computes the 3D point G such as $ G = this \oplus L $.

See also
composePoint

Definition at line 202 of file CPose3DQuat.h.

References composePoint(), and G.

◆ operator+() [3/3]

CPose3DQuat mrpt::poses::CPose3DQuat::operator+ ( const CPose3DQuat p) const
inline

Return the composed pose $ ret = this \oplus p $.

Definition at line 221 of file CPose3DQuat.h.

References composeFrom().

◆ operator+=()

CPose3DQuat& mrpt::poses::CPose3DQuat::operator+= ( const CPose3DQuat b)
inline

Make $ this = this \oplus b $.

Definition at line 214 of file CPose3DQuat.h.

References composeFrom().

◆ operator-()

CPose3DQuat mrpt::poses::CPose3DQuat::operator- ( const CPose3DQuat p) const
inline

Return the composed pose $ ret = this \ominus p $.

Definition at line 236 of file CPose3DQuat.h.

References inverseComposeFrom().

◆ operator-=()

CPose3DQuat& mrpt::poses::CPose3DQuat::operator-= ( const CPose3DQuat b)
inline

Make $ this = this \ominus b $.

Definition at line 229 of file CPose3DQuat.h.

References inverseComposeFrom().

◆ operator[]() [1/2]

const double& mrpt::poses::CPose3DQuat::operator[] ( unsigned int  i) const
inline

Read only [] operator.

Definition at line 288 of file CPose3DQuat.h.

References m_coords, and m_quat.

◆ operator[]() [2/2]

double& mrpt::poses::CPose3DQuat::operator[] ( unsigned int  i)
inline

Read/write [] operator.

Definition at line 312 of file CPose3DQuat.h.

References m_coords, and m_quat.

◆ quat() [1/2]

mrpt::math::CQuaternionDouble& mrpt::poses::CPose3DQuat::quat ( )
inline

◆ quat() [2/2]

const mrpt::math::CQuaternionDouble& mrpt::poses::CPose3DQuat::quat ( ) const
inline

Read-only access to the quaternion representing the 3D rotation.

Definition at line 63 of file CPose3DQuat.h.

References m_quat.

◆ rbegin() [1/2]

reverse_iterator mrpt::poses::CPose3DQuat::rbegin ( )
inline

Definition at line 636 of file CPose3DQuat.h.

References end().

◆ rbegin() [2/2]

const_reverse_iterator mrpt::poses::CPose3DQuat::rbegin ( ) const
inline

Definition at line 637 of file CPose3DQuat.h.

References end().

◆ rend() [1/2]

reverse_iterator mrpt::poses::CPose3DQuat::rend ( )
inline

Definition at line 641 of file CPose3DQuat.h.

References begin().

◆ rend() [2/2]

const_reverse_iterator mrpt::poses::CPose3DQuat::rend ( ) const
inline

Definition at line 642 of file CPose3DQuat.h.

References begin().

◆ resize()

static void mrpt::poses::CPose3DQuat::resize ( const size_t  n)
inlinestatic

Definition at line 388 of file CPose3DQuat.h.

References mrpt::format(), and static_size.

◆ serializeFrom()

void CPose3DQuat::serializeFrom ( mrpt::serialization::CArchive in,
uint8_t  serial_version 
)
overrideprotectedvirtual

Pure virtual method for reading (deserializing) from an abstract archive.

Users don't call this method directly. Instead, use stream >> object;.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any I/O error

Implements mrpt::serialization::CSerializable.

Definition at line 334 of file CPose3DQuat.cpp.

References m_coords, m_quat, and MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.

◆ serializeGetVersion()

uint8_t CPose3DQuat::serializeGetVersion ( ) const
overrideprotectedvirtual

Must return the current versioning number of the object.

Start in zero for new classes, and increments each time there is a change in the stored format.

Implements mrpt::serialization::CSerializable.

Definition at line 328 of file CPose3DQuat.cpp.

◆ serializeTo()

void CPose3DQuat::serializeTo ( mrpt::serialization::CArchive out) const
overrideprotectedvirtual

Pure virtual method for writing (serializing) to an abstract archive.

Users don't call this method directly. Instead, use stream << object;.

Exceptions
std::exceptionOn any I/O error

Implements mrpt::serialization::CSerializable.

Definition at line 329 of file CPose3DQuat.cpp.

References m_coords, and m_quat.

◆ setToNaN()

void CPose3DQuat::setToNaN ( )
overridevirtual

Set all data fields to quiet NaN.

Implements mrpt::poses::CPoseOrPoint< CPose3DQuat >.

Definition at line 468 of file CPose3DQuat.cpp.

References m_coords, and quat().

◆ size()

static size_type mrpt::poses::CPose3DQuat::size ( )
inlinestatic

Definition at line 385 of file CPose3DQuat.h.

References static_size.

◆ sphericalCoordinates()

void CPose3DQuat::sphericalCoordinates ( const mrpt::math::TPoint3D point,
double &  out_range,
double &  out_yaw,
double &  out_pitch,
mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *  out_jacob_dryp_dpoint = nullptr,
mrpt::math::CMatrixFixedNumeric< double, 3, 7 > *  out_jacob_dryp_dpose = nullptr 
) 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. If the matrix pointers are not nullptr, the Jacobians will be also computed for the range-yaw-pitch variables wrt the passed 3D point and this 7D pose.

Definition at line 353 of file CPose3DQuat.cpp.

References inverseComposePoint(), local, mrpt::square(), THROW_EXCEPTION, mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.

Referenced by mrpt::slam::CRangeBearingKFSLAM::OnObservationJacobians(), mrpt::slam::CRangeBearingKFSLAM::OnObservationModel(), and Pose3DQuatTests::test_sphericalCoords().

◆ sqrDistanceTo()

double mrpt::poses::CPoseOrPoint< CPose3DQuat >::sqrDistanceTo ( const CPoseOrPoint< OTHERCLASS > &  b) const
inlineinherited

Returns the squared euclidean distance to another pose/point:

Definition at line 184 of file CPoseOrPoint.h.

◆ swap()

void mrpt::poses::CPose3DQuat::swap ( CPose3DQuat o)
inline

Definition at line 647 of file CPose3DQuat.h.

References m_coords, and m_quat.

◆ writeToMatlab()

virtual mxArray* mrpt::serialization::CSerializable::writeToMatlab ( ) const
inlinevirtualinherited

Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class.

Returns
A new mxArray (caller is responsible of memory freeing) or nullptr is class does not support conversion to MATLAB.

Definition at line 70 of file CSerializable.h.

◆ x() [1/3]

double mrpt::poses::CPoseOrPoint< CPose3DQuat >::x ( ) const
inlineinherited

Common members of all points & poses classes.

< Get X coord.

Definition at line 140 of file CPoseOrPoint.h.

Referenced by asTPose(), and CPose3DQuat().

◆ x() [2/3]

double& mrpt::poses::CPoseOrPoint< CPose3DQuat >::x ( )
inlineinherited

Definition at line 149 of file CPoseOrPoint.h.

◆ x() [3/3]

void mrpt::poses::CPoseOrPoint< CPose3DQuat >::x ( const double  v)
inlineinherited
Parameters
vSet X coord.

Definition at line 158 of file CPoseOrPoint.h.

◆ x_incr()

void mrpt::poses::CPoseOrPoint< CPose3DQuat >::x_incr ( const double  v)
inlineinherited
Parameters
vX+=v

Definition at line 167 of file CPoseOrPoint.h.

◆ xyz() [1/2]

mrpt::math::CArrayDouble<3>& mrpt::poses::CPose3DQuat::xyz ( )
inline

Read/Write access to the translation vector in R^3.

Definition at line 65 of file CPose3DQuat.h.

References m_coords.

◆ xyz() [2/2]

const mrpt::math::CArrayDouble<3>& mrpt::poses::CPose3DQuat::xyz ( ) const
inline

Read-only access to the translation vector in R^3.

Definition at line 67 of file CPose3DQuat.h.

References m_coords.

◆ y() [1/3]

double mrpt::poses::CPoseOrPoint< CPose3DQuat >::y ( ) const
inlineinherited

< Get Y coord.

Definition at line 144 of file CPoseOrPoint.h.

Referenced by asTPose(), and CPose3DQuat().

◆ y() [2/3]

double& mrpt::poses::CPoseOrPoint< CPose3DQuat >::y ( )
inlineinherited

Definition at line 153 of file CPoseOrPoint.h.

◆ y() [3/3]

void mrpt::poses::CPoseOrPoint< CPose3DQuat >::y ( const double  v)
inlineinherited
Parameters
vSet Y coord.

Definition at line 162 of file CPoseOrPoint.h.

◆ y_incr()

void mrpt::poses::CPoseOrPoint< CPose3DQuat >::y_incr ( const double  v)
inlineinherited
Parameters
vY+=v

Definition at line 171 of file CPoseOrPoint.h.

Member Data Documentation

◆ _init_CPose3DQuat

mrpt::rtti::CLASSINIT mrpt::poses::CPose3DQuat::_init_CPose3DQuat
staticprotected

Definition at line 51 of file CPose3DQuat.h.

◆ className

constexpr const char* mrpt::poses::CPose3DQuat::className = "CPose3DQuat"
static

Definition at line 51 of file CPose3DQuat.h.

◆ m_coords

mrpt::math::CArrayDouble<3> mrpt::poses::CPose3DQuat::m_coords

◆ m_quat

mrpt::math::CQuaternionDouble mrpt::poses::CPose3DQuat::m_quat

◆ runtimeClassId

const mrpt::rtti::TRuntimeClassId mrpt::poses::CPose3DQuat::runtimeClassId
staticprotected

Definition at line 51 of file CPose3DQuat.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019