MRPT  2.0.2
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
mrpt::poses::CPose3D Class Reference

Detailed Description

A class used to store a 3D pose (a 3D translation + a rotation in 3D).

The 6D transformation in SE(3) stored in this class is kept in two separate containers: a 3-array for the translation, and a 3x3 rotation matrix.

This class allows parameterizing 6D poses as a 6-vector: [x y z yaw pitch roll] (read below for the angles convention). Note however, that the yaw/pitch/roll angles are only computed (on-demand and transparently) when the user requests them. Normally, rotations and transformations are always handled via the 3x3 rotation matrix.

Yaw/Pitch/Roll angles are defined as successive rotations around local (dynamic) axes in the Z/Y/X order:

It may be extremely confusing and annoying to find a different criterion also involving the names "yaw, pitch, roll" but regarding rotations around global (static) axes. Fortunately, it's very easy to see (by writing down the product of the three rotation matrices) that both conventions lead to exactly the same numbers. Only, that it's conventional to write the numbers in reverse order. That is, the same rotation can be described equivalently with any of these two parameterizations:

For further descriptions of point & pose classes, see mrpt::poses::CPoseOrPoint or refer to the 2D/3D Geometry tutorial online.

To change the individual components of the pose, use CPose3D::setFromValues. This class assures that the internal 3x3 rotation matrix is always up-to-date with the "yaw pitch roll" members.

Rotations in 3D can be also represented by quaternions. See mrpt::math::CQuaternion, and method CPose3D::getAsQuaternion.

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

For Lie algebra methods, see mrpt::poses::Lie.

Note
Read also: "A tutorial on SE(3) transformation parameterizations and on-manifold optimization", in [1]
See also
CPoseOrPoint,CPoint3D, mrpt::math::CQuaternion

Definition at line 85 of file CPose3D.h.

#include <mrpt/poses/CPose3D.h>

Inheritance diagram for mrpt::poses::CPose3D:

Public Types

enum  { is_3D_val = 1 }
 
enum  { rotation_dimensions = 3 }
 
enum  { is_PDF_val = 0 }
 
using type_value = CPose3D
 Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses. More...
 
using vector_t = mrpt::math::CVectorFixedDouble< DIM >
 Fixed-size vector of the correct size to hold all the coordinates of the point/pose. More...
 

Public Member Functions

CPose3D getOppositeScalar () const
 Return the opposite of the current pose instance by taking the negative of all its components individually. More...
 
void setToNaN () override
 Set all data fields to quiet NaN. More...
 
const type_valuegetPoseMean () const
 
type_valuegetPoseMean ()
 
const CPose3Dderived () const
 
CPose3Dderived ()
 
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...
 
Access 3x3 rotation and 4x4 homogeneous matrices
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 getRotationMatrix (mrpt::math::CMatrixDouble33 &ROT) const
 Get the 3x3 rotation matrix. More...
 
const mrpt::math::CMatrixDouble33getRotationMatrix () const
 
void setRotationMatrix (const mrpt::math::CMatrixDouble33 &ROT)
 Sets the 3x3 rotation matrix. More...
 
Pose-pose and pose-point compositions and operators
CPose3D operator+ (const CPose3D &b) const
 The operator $ a \oplus b $ is the pose compounding operator. More...
 
CPoint3D operator+ (const CPoint3D &b) const
 The operator $ a \oplus b $ is the pose compounding operator. More...
 
CPoint3D operator+ (const CPoint2D &b) const
 The operator $ a \oplus b $ is the pose compounding operator. More...
 
void sphericalCoordinates (const mrpt::math::TPoint3D &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. More...
 
void composePoint (double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::optional_ref< mrpt::math::CMatrixDouble33 > out_jacobian_df_dpoint=std::nullopt, mrpt::optional_ref< mrpt::math::CMatrixDouble36 > out_jacobian_df_dpose=std::nullopt, mrpt::optional_ref< mrpt::math::CMatrixDouble36 > out_jacobian_df_dse3=std::nullopt, bool use_small_rot_approx=false) 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. More...
 
void composePoint (const mrpt::math::TPoint3D &local_point, mrpt::math::TPoint3D &global_point) 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. More...
 
mrpt::math::TPoint3D composePoint (const mrpt::math::TPoint3D &l) const
 
void composePoint (const mrpt::math::TPoint3D &local_point, mrpt::math::TPoint2D &global_point) const
 This version of the method assumes that the resulting point has no Z component (use with caution!) More...
 
void composePoint (double lx, double ly, double 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. More...
 
mrpt::math::TVector3D rotateVector (const mrpt::math::TVector3D &local) const
 Rotates a vector (i.e. More...
 
mrpt::math::TVector3D inverseRotateVector (const mrpt::math::TVector3D &global) const
 Inverse of rotateVector(), i.e. More...
 
void inverseComposePoint (const double gx, const double gy, const double gz, double &lx, double &ly, double &lz, mrpt::optional_ref< mrpt::math::CMatrixDouble33 > out_jacobian_df_dpoint=std::nullopt, mrpt::optional_ref< mrpt::math::CMatrixDouble36 > out_jacobian_df_dpose=std::nullopt, mrpt::optional_ref< mrpt::math::CMatrixDouble36 > out_jacobian_df_dse3=std::nullopt) const
 Computes the 3D point L such as $ L = G \ominus this $. More...
 
void inverseComposePoint (const mrpt::math::TPoint3D &g, mrpt::math::TPoint3D &l) const
 
mrpt::math::TPoint3D inverseComposePoint (const mrpt::math::TPoint3D &g) const
 
void inverseComposePoint (const mrpt::math::TPoint2D &g, mrpt::math::TPoint2D &l, const double eps=1e-6) const
 overload for 2D points More...
 
void composeFrom (const CPose3D &A, const CPose3D &B)
 Makes "this = A (+) B"; this method is slightly more efficient than "this= A + B;" since it avoids the temporary object. More...
 
CPose3Doperator+= (const CPose3D &b)
 Make $ this = this \oplus b $ (b can be "this" without problems) More...
 
void inverseComposeFrom (const CPose3D &A, const CPose3D &B)
 Makes $ this = A \ominus B $ this method is slightly more efficient than "this= A - B;" since it avoids the temporary object. More...
 
CPose3D operator- (const CPose3D &b) const
 Compute $ RET = this \oplus b $. More...
 
void inverse ()
 Convert this pose into its inverse, saving the result in itself. More...
 
void changeCoordinatesReference (const CPose3D &p)
 makes: this = p (+) this More...
 
RTTI classes and functions for polymorphic hierarchies
mrpt::rtti::CObject::Ptr duplicateGetSmartPtr () const
 Makes a deep copy of the object and returns a smart pointer to it. More...
 

Static Public Member Functions

static constexpr bool is_3D ()
 
static constexpr bool is_PDF ()
 

Public Attributes

mrpt::math::CVectorFixedDouble< 3 > m_coords
 The translation vector [x,y,z] access directly or with x(), y(), z() setter/getter methods. More...
 

Protected Member Functions

void rebuildRotationMatrix ()
 Rebuild the homog matrix from the angles. More...
 
void updateYawPitchRoll () const
 Updates Yaw/pitch/roll members from the m_ROT. More...
 
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...
 
CSerializable virtual methods
virtual void serializeTo (CSchemeArchiveBase &out) const
 Virtual method for writing (serializing) to an abstract schema based archive. More...
 
virtual void serializeFrom (CSchemeArchiveBase &in)
 Virtual method for reading (deserializing) from an abstract schema based archive. More...
 

Protected Attributes

mrpt::math::CMatrixDouble33 m_ROT
 The 3x3 rotation matrix, access with getRotationMatrix(), setRotationMatrix() (It's not safe to set this field as public) More...
 
bool m_ypr_uptodate {false}
 Whether yaw/pitch/roll members are up-to-date since the last rotation matrix update. More...
 
double m_yaw {0}
 These variables are updated every time that the object rotation matrix is modified (construction, loading from values, pose composition, etc ) More...
 
double m_pitch {0}
 
double m_roll {0}
 

RTTI stuff

using Ptr = std::shared_ptr< mrpt::poses ::CPose3D >
 
using ConstPtr = std::shared_ptr< const mrpt::poses ::CPose3D >
 
using UniquePtr = std::unique_ptr< mrpt::poses ::CPose3D >
 
using ConstUniquePtr = std::unique_ptr< const mrpt::poses ::CPose3D >
 
static const mrpt::rtti::TRuntimeClassId runtimeClassId
 
static constexpr const char * className = "mrpt::poses" "::" "CPose3D"
 
static const mrpt::rtti::TRuntimeClassId_GetBaseClass ()
 
static constexpr auto getClassName ()
 
static const mrpt::rtti::TRuntimeClassIdGetRuntimeClassIdStatic ()
 
static std::shared_ptr< CObjectCreateObject ()
 
template<typename... Args>
static Ptr Create (Args &&... args)
 
template<typename Alloc , typename... Args>
static Ptr CreateAlloc (const Alloc &alloc, 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...
 

Constructors

static CPose3D Identity ()
 Returns the identity transformation. More...
 
 CPose3D ()
 Default constructor, with all the coordinates set to zero. More...
 
 CPose3D (const double x, const double y, const double z, 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!) More...
 
 CPose3D (const math::CMatrixDouble &m)
 Constructor from a 4x4 homogeneous matrix - the passed matrix can be actually of any size larger than or equal 3x4, since only those first values are used (the last row of a homogeneous 4x4 matrix are always fixed). More...
 
 CPose3D (const math::CMatrixDouble44 &m)
 Constructor from a 4x4 homogeneous matrix: More...
 
template<class MATRIX33 , class VECTOR3 >
 CPose3D (const MATRIX33 &rot, const VECTOR3 &xyz)
 Constructor from a 3x3 rotation matrix and a the translation given as a 3-vector, a 3-array, a CPoint3D or a mrpt::math::TPoint3D. More...
 
 CPose3D (const mrpt::math::CMatrixDouble33 &rot, const mrpt::math::CVectorFixedDouble< 3 > &xyz)
 
 CPose3D (const CPose2D &)
 Constructor from a CPose2D object. More...
 
 CPose3D (const CPoint3D &)
 Constructor from a CPoint3D object. More...
 
 CPose3D (const mrpt::math::TPose3D &)
 Constructor from lightweight object. More...
 
mrpt::math::TPose3D asTPose () const
 
 CPose3D (const mrpt::math::CQuaternionDouble &q, const double x, const double y, const double z)
 Constructor from a quaternion (which only represents the 3D rotation part) and a 3D displacement. More...
 
 CPose3D (const CPose3DQuat &)
 Constructor from a CPose3DQuat. More...
 
 CPose3D (TConstructorFlags_Poses)
 Fast constructor that leaves all the data uninitialized - call with UNINITIALIZED_POSE as argument. More...
 
 CPose3D (const mrpt::math::CVectorFixedDouble< 12 > &vec12)
 Constructor from an array with these 12 elements: [r11 r21 r31 r12 r22 r32 r13 r23 r33 tx ty tz] where r{ij} are the entries of the 3x3 rotation matrix and t{x,y,z} are the 3D translation of the pose. More...
 

Access and modify contents

static CPose3D FromString (const std::string &s)
 
void addComponents (const CPose3D &p)
 Scalar sum of all 6 components: This is diferent from poses composition, which is implemented as "+" operators. More...
 
void normalizeAngles ()
 Rebuild the internal matrix & update the yaw/pitch/roll angles within the ]-PI,PI] range (Must be called after using addComponents) More...
 
void operator*= (const double s)
 Scalar multiplication of x,y,z,yaw,pitch & roll (angles will be wrapped to the ]-pi,pi] interval). More...
 
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) - This method recomputes the internal rotation matrix. More...
 
template<typename VECTORLIKE >
void setFromXYZQ (const VECTORLIKE &v, const size_t index_offset=0)
 Set the pose from a 3D position (meters) and a quaternion, stored as [x y z qr qx qy qz] in a 7-element vector. More...
 
void setYawPitchRoll (const double yaw_, const double pitch_, const double roll_)
 Set the 3 angles of the 3D pose (in radians) - This method recomputes the internal rotation coordinates matrix. More...
 
template<class ARRAYORVECTOR >
void setFrom12Vector (const ARRAYORVECTOR &vec12)
 Set pose from an array with these 12 elements: [r11 r21 r31 r12 r22 r32 r13 r23 r33 tx ty tz] where r{ij} are the entries of the 3x3 rotation matrix and t{x,y,z} are the 3D translation of the pose. More...
 
template<class ARRAYORVECTOR >
void getAs12Vector (ARRAYORVECTOR &vec12) const
 Get the pose representation as an array with these 12 elements: [r11 r21 r31 r12 r22 r32 r13 r23 r33 tx ty tz] where r{ij} are the entries of the 3x3 rotation matrix and t{x,y,z} are the 3D translation of the pose. More...
 
void getYawPitchRoll (double &yaw, double &pitch, double &roll) const
 Returns the three angles (yaw, pitch, roll), in radians, from the rotation matrix. More...
 
double yaw () const
 Get the YAW angle (in radians) More...
 
double pitch () const
 Get the PITCH angle (in radians) More...
 
double roll () const
 Get the ROLL angle (in radians) More...
 
void asVector (vector_t &v) const
 Returns a 6x1 vector with [x y z yaw pitch roll]'. More...
 
void getAsQuaternion (mrpt::math::CQuaternionDouble &q, mrpt::optional_ref< mrpt::math::CMatrixDouble43 > out_dq_dr=std::nullopt) 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...

 
double operator[] (unsigned int i) const
 
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 fromString (const std::string &s)
 Set the current object value from a string generated by 'asString' (eg: "[x y z yaw pitch roll]", angles in deg. More...
 
void fromStringRaw (const std::string &s)
 Same as fromString, but without requiring the square brackets in the string. More...
 
bool isHorizontal (const double tolerance=0) const
 Return true if the 6D pose represents a Z axis almost exactly vertical (upwards or downwards), with a given tolerance (if set to 0 exact horizontality is tested). More...
 
double distanceEuclidean6D (const CPose3D &o) const
 The euclidean distance between two poses taken as two 6-length vectors (angles in radians). More...
 

STL-like methods and typedefs

 
enum  { static_size = 6 }
 
using value_type = double
 The type of the elements. More...
 
using reference = double &
 
using const_reference = double
 
using size_type = std::size_t
 
using difference_type = std::ptrdiff_t
 
static constexpr size_type size ()
 
static constexpr bool empty ()
 
static constexpr size_type max_size ()
 
static void resize (const size_t n)
 
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, DIM2 > &b) const
 Returns the squared euclidean distance to another pose/point: More...
 
double distanceTo (const CPoseOrPoint< OTHERCLASS, DIM2 > &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...
 
vector_t asVectorVal () 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 688 of file CPose3D.h.

◆ ConstPtr

using mrpt::poses::CPose3D::ConstPtr = std::shared_ptr<const mrpt::poses :: CPose3D >

Definition at line 88 of file CPose3D.h.

◆ ConstUniquePtr

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

Definition at line 88 of file CPose3D.h.

◆ difference_type

using mrpt::poses::CPose3D::difference_type = std::ptrdiff_t

Definition at line 690 of file CPose3D.h.

◆ Ptr

A type for the associated smart pointer

Definition at line 88 of file CPose3D.h.

◆ reference

Definition at line 687 of file CPose3D.h.

◆ size_type

using mrpt::poses::CPose3D::size_type = std::size_t

Definition at line 689 of file CPose3D.h.

◆ type_value

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

Definition at line 666 of file CPose3D.h.

◆ UniquePtr

using mrpt::poses::CPose3D::UniquePtr = std::unique_ptr< mrpt::poses :: CPose3D >

Definition at line 88 of file CPose3D.h.

◆ value_type

The type of the elements.

Definition at line 686 of file CPose3D.h.

◆ vector_t

Fixed-size vector of the correct size to hold all the coordinates of the point/pose.

Definition at line 137 of file CPoseOrPoint.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
is_3D_val 

Definition at line 667 of file CPose3D.h.

◆ anonymous enum

anonymous enum
Enumerator
rotation_dimensions 

Definition at line 672 of file CPose3D.h.

◆ anonymous enum

anonymous enum
Enumerator
is_PDF_val 

Definition at line 676 of file CPose3D.h.

◆ anonymous enum

anonymous enum
Enumerator
static_size 

Definition at line 693 of file CPose3D.h.

Constructor & Destructor Documentation

◆ CPose3D() [1/13]

CPose3D::CPose3D ( )

Default constructor, with all the coordinates set to zero.

Definition at line 52 of file CPose3D.cpp.

Referenced by changeCoordinatesReference(), getOppositeScalar(), and Identity().

Here is the caller graph for this function:

◆ CPose3D() [2/13]

CPose3D::CPose3D ( const double  x,
const double  y,
const double  z,
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!)

Definition at line 58 of file CPose3D.cpp.

References pitch(), roll(), setFromValues(), mrpt::poses::CPoseOrPoint< CPose3D, DIM >::x(), mrpt::poses::CPoseOrPoint< CPose3D, DIM >::y(), and yaw().

Here is the call graph for this function:

◆ CPose3D() [3/13]

CPose3D::CPose3D ( const math::CMatrixDouble m)
explicit

Constructor from a 4x4 homogeneous matrix - the passed matrix can be actually of any size larger than or equal 3x4, since only those first values are used (the last row of a homogeneous 4x4 matrix are always fixed).

Definition at line 82 of file CPose3D.cpp.

References ASSERT_ABOVEEQ_, mrpt::math::CMatrixDynamic< T >::cols(), m_coords, m_ROT, and mrpt::math::CMatrixDynamic< T >::rows().

Here is the call graph for this function:

◆ CPose3D() [4/13]

CPose3D::CPose3D ( const math::CMatrixDouble44 m)
explicit

Constructor from a 4x4 homogeneous matrix:

Definition at line 92 of file CPose3D.cpp.

References m_coords, and m_ROT.

◆ CPose3D() [5/13]

template<class MATRIX33 , class VECTOR3 >
mrpt::poses::CPose3D::CPose3D ( const MATRIX33 &  rot,
const VECTOR3 &  xyz 
)
inline

Constructor from a 3x3 rotation matrix and a the translation given as a 3-vector, a 3-array, a CPoint3D or a mrpt::math::TPoint3D.

Definition at line 153 of file CPose3D.h.

References ASSERT_EQUAL_, m_coords, and m_ROT.

◆ CPose3D() [6/13]

mrpt::poses::CPose3D::CPose3D ( const mrpt::math::CMatrixDouble33 rot,
const mrpt::math::CVectorFixedDouble< 3 > &  xyz 
)
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 164 of file CPose3D.h.

◆ CPose3D() [7/13]

CPose3D::CPose3D ( const CPose2D p)
explicit

Constructor from a CPose2D object.

Definition at line 71 of file CPose3D.cpp.

References mrpt::poses::CPose2D::phi(), setFromValues(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::y().

Here is the call graph for this function:

◆ CPose3D() [8/13]

CPose3D::CPose3D ( const CPoint3D p)
explicit

Constructor from a CPoint3D object.

Definition at line 76 of file CPose3D.cpp.

References setFromValues(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::y().

Here is the call graph for this function:

◆ CPose3D() [9/13]

CPose3D::CPose3D ( const mrpt::math::TPose3D o)
explicit

Constructor from lightweight object.

Definition at line 66 of file CPose3D.cpp.

References mrpt::math::TPose3D::pitch, mrpt::math::TPose3D::roll, setFromValues(), mrpt::math::TPose3D::x, mrpt::math::TPose3D::y, mrpt::math::TPose3D::yaw, and mrpt::math::TPose3D::z.

Here is the call graph for this function:

◆ CPose3D() [10/13]

CPose3D::CPose3D ( const mrpt::math::CQuaternionDouble q,
const double  _x,
const double  _y,
const double  _z 
)

Constructor from a quaternion (which only represents the 3D rotation part) and a 3D displacement.

Definition at line 102 of file CPose3D.cpp.

References pitch(), roll(), mrpt::math::CQuaternion< T >::rpy(), setFromValues(), and yaw().

Here is the call graph for this function:

◆ CPose3D() [11/13]

CPose3D::CPose3D ( const CPose3DQuat p)
explicit

Constructor from a CPose3DQuat.

Constructor from a quaternion-based full pose.

Definition at line 113 of file CPose3D.cpp.

References m_coords, m_ROT, mrpt::poses::CPose3DQuat::quat(), mrpt::math::CQuaternion< T >::rotationMatrixNoResize(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::y().

Here is the call graph for this function:

◆ CPose3D() [12/13]

mrpt::poses::CPose3D::CPose3D ( TConstructorFlags_Poses  )
inline

Fast constructor that leaves all the data uninitialized - call with UNINITIALIZED_POSE as argument.

Definition at line 196 of file CPose3D.h.

◆ CPose3D() [13/13]

mrpt::poses::CPose3D::CPose3D ( const mrpt::math::CVectorFixedDouble< 12 > &  vec12)
inlineexplicit

Constructor from an array with these 12 elements: [r11 r21 r31 r12 r22 r32 r13 r23 r33 tx ty tz] where r{ij} are the entries of the 3x3 rotation matrix and t{x,y,z} are the 3D translation of the pose.

See also
setFrom12Vector, getAs12Vector

Definition at line 207 of file CPose3D.h.

References setFrom12Vector().

Here is the call graph for this function:

Member Function Documentation

◆ _GetBaseClass()

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

◆ addComponents()

void CPose3D::addComponents ( const CPose3D p)

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

See also
normalizeAngles

Definition at line 346 of file CPose3D.cpp.

References m_coords, m_pitch, m_roll, m_yaw, rebuildRotationMatrix(), and updateYawPitchRoll().

Referenced by mrpt::hmtslam::CHierarchicalMapMHPartition::getAs3DScene().

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

◆ asString() [1/2]

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

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 618 of file CPose3D.h.

References mrpt::format(), m_coords, m_pitch, m_roll, m_yaw, mrpt::RAD2DEG(), and updateYawPitchRoll().

Referenced by mrpt::graphslam::deciders::CIncrementalNodeRegistrationDecider< GRAPH_T >::checkRegistrationConditionPose(), and thread_client().

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

◆ asString() [2/2]

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

Definition at line 626 of file CPose3D.h.

◆ asTPose()

mrpt::math::TPose3D CPose3D::asTPose ( ) const

Definition at line 759 of file CPose3D.cpp.

References pitch(), roll(), mrpt::poses::CPoseOrPoint< CPose3D, DIM >::x(), mrpt::poses::CPoseOrPoint< CPose3D, DIM >::y(), and yaw().

Referenced by mrpt::poses::CPoses3DSequence::appendPose(), mrpt::hmtslam::CLocalMetricHypothesis::changeCoordinateOrigin(), mrpt::poses::CPoses3DSequence::changePose(), mrpt::maps::CMultiMetricMapPDF::clear(), mrpt::topography::ENU_axes_from_WGS84(), mrpt::poses::CPoseInterpolatorBase< 3 >::filter(), mrpt::slam::CMetricMapBuilderRBPF::getCurrentPoseEstimation(), mrpt::obs::CObservation::getSensorPose(), FAddUntracedLines::operator()(), mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_aux_perform_one_rejection_sampling_step(), mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_implementation_pfStandardProposal(), mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_particlesEvaluator_AuxPFOptimal(), mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_particlesEvaluator_AuxPFStandard(), mrpt::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal(), mrpt::apps::ICP_SLAM_App_Base::run(), mrpt::apps::RBPF_SLAM_App_Base::run(), mrpt::apps::KFSLAMApp::Run_KF_SLAM(), mrpt::obs::CObservationGasSensors::serializeFrom(), mrpt::obs::CObservationRange::serializeFrom(), mrpt::obs::CObservationGasSensors::setSensorPose(), and mrpt::obs::CObservationRange::setSensorPose().

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

◆ asVector()

void CPose3D::asVector ( vector_t v) const

Returns a 6x1 vector with [x y z yaw pitch roll]'.

Definition at line 480 of file CPose3D.cpp.

References m_coords, m_pitch, m_roll, m_yaw, and updateYawPitchRoll().

Here is the call graph for this function:

◆ asVectorVal()

vector_t mrpt::poses::CPoseOrPoint< CPose3D , DIM >::asVectorVal ( ) const
inlineinherited

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

Definition at line 266 of file CPoseOrPoint.h.

◆ changeCoordinatesReference()

void mrpt::poses::CPose3D::changeCoordinatesReference ( const CPose3D p)
inline

makes: this = p (+) this

Definition at line 423 of file CPose3D.h.

References composeFrom(), and CPose3D().

Referenced by mrpt::maps::COccupancyGridMap3D::internal_insertObservationScan3D().

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

◆ clone()

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

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

Implements mrpt::rtti::CObject.

◆ composeFrom()

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

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.

Definition at line 556 of file CPose3D.cpp.

References m_coords, m_ROT, and m_ypr_uptodate.

Referenced by mrpt::poses::CPose3DPDFGaussian::changeCoordinatesReference(), changeCoordinatesReference(), mrpt::obs::CObservationVelodyneScan::generatePointCloudAlongSE3Trajectory(), mrpt::maps::COctoMapBase< octomap::OcTree, octomap::OcTreeNode >::internal_build_PointCloud_for_observation(), mrpt::maps::CReflectivityGridMap2D::internal_computeObservationLikelihood(), mrpt::maps::CReflectivityGridMap2D::internal_insertObservation(), mrpt::maps::CColouredOctoMap::internal_insertObservation(), operator+(), mrpt::poses::CPose3DPDFGaussian::operator+=(), operator+=(), mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_aux_perform_one_rejection_sampling_step(), mrpt::slam::PF_implementation< mrpt::math::TPose3D, CMonteCarloLocalization3D, mrpt::bayes::particle_storage_mode::VALUE >::PF_SLAM_particlesEvaluator_AuxPFStandard(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::prediction_and_update_pfOptimalProposal(), mrpt::kinematics::CKinematicChain::recomputeAllPoses(), mrpt::maps::detail::loadFromRangeImpl< Derived >::templ_loadFromRangeScan(), Pose3DTests::test_composeFrom(), and mrpt::obs::detail::unprojectInto().

Here is the caller graph for this function:

◆ composePoint() [1/5]

void mrpt::poses::CPose3D::composePoint ( double  lx,
double  ly,
double  lz,
double &  gx,
double &  gy,
double &  gz,
mrpt::optional_ref< mrpt::math::CMatrixDouble33 out_jacobian_df_dpoint = std::nullopt,
mrpt::optional_ref< mrpt::math::CMatrixDouble36 out_jacobian_df_dpose = std::nullopt,
mrpt::optional_ref< mrpt::math::CMatrixDouble36 out_jacobian_df_dse3 = std::nullopt,
bool  use_small_rot_approx = false 
) 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.

If pointers are provided, the corresponding Jacobians are returned. "out_jacobian_df_dse3" stands for the Jacobian with respect to the 6D locally Euclidean vector in the tangent space of SE(3). See this report for mathematical details.

Parameters
Ifset to true, the Jacobian "out_jacobian_df_dpose" uses a fastest linearized appoximation (valid only for small rotations!).

Referenced by mrpt::poses::CPointPDFParticles::changeCoordinatesReference(), mrpt::maps::CLandmarksMap::changeCoordinatesReference(), mrpt::maps::CPointsMap::changeCoordinatesReference(), composePoint(), mrpt::maps::CPointsMap::determineMatching3D(), mrpt::vision::frameJac(), mrpt::obs::CObservationVelodyneScan::generatePointCloudAlongSE3Trajectory(), mrpt::opengl::CGridPlaneXZ::getBoundingBox(), mrpt::opengl::CGridPlaneXY::getBoundingBox(), mrpt::opengl::CAssimpModel::getBoundingBox(), mrpt::opengl::CFrustum::getBoundingBox(), mrpt::opengl::CPolyhedron::getBoundingBox(), mrpt::opengl::CSetOfLines::getBoundingBox(), mrpt::opengl::CVectorField3D::getBoundingBox(), mrpt::opengl::CPolyhedron::getSetOfPolygonsAbsolute(), mrpt::opengl::internal::glDrawTextTransformed(), mrpt::maps::CPointsMap::insertAnotherMap(), mrpt::maps::COctoMapBase< octomap::OcTree, octomap::OcTreeNode >::internal_build_PointCloud_for_observation(), mrpt::maps::CPointsMap::internal_computeObservationLikelihoodPointCloud3D(), mrpt::maps::CColouredOctoMap::internal_insertObservation(), mrpt::maps::CPointsMap::internal_insertObservation(), mrpt::opengl::CArrow::onUpdateBuffers_Triangles(), mrpt::vision::pointJac(), mrpt::vision::pinhole::projectPoint_no_distortion(), mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::renderUpdateBuffers(), Pose3DTests::test_composePoint(), Pose3DQuatTests::test_composePoint_vs_CPose3D(), Pose3DTests::test_composePointJacob(), and Pose3DTests::test_composePointJacob_se3().

Here is the caller graph for this function:

◆ composePoint() [2/5]

void mrpt::poses::CPose3D::composePoint ( const mrpt::math::TPoint3D local_point,
mrpt::math::TPoint3D global_point 
) const
inline

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

Note
local_point is passed by value to allow global and local point to be the same variable

Definition at line 295 of file CPose3D.h.

References composePoint(), mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

Here is the call graph for this function:

◆ composePoint() [3/5]

mrpt::math::TPoint3D mrpt::poses::CPose3D::composePoint ( const mrpt::math::TPoint3D l) 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 304 of file CPose3D.h.

References composePoint().

Here is the call graph for this function:

◆ composePoint() [4/5]

void mrpt::poses::CPose3D::composePoint ( const mrpt::math::TPoint3D local_point,
mrpt::math::TPoint2D global_point 
) const
inline

This version of the method assumes that the resulting point has no Z component (use with caution!)

Definition at line 314 of file CPose3D.h.

References composePoint(), mrpt::math::TPoint2D_data< T >::x, mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint2D_data< T >::y, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

Here is the call graph for this function:

◆ composePoint() [5/5]

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

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

Definition at line 326 of file CPose3D.h.

References composePoint(), and mrpt::d2f().

Here is the call graph for this function:

◆ Create()

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

Definition at line 88 of file CPose3D.h.

◆ CreateAlloc()

template<typename Alloc , typename... Args>
static Ptr mrpt::poses::CPose3D::CreateAlloc ( const Alloc &  alloc,
Args &&...  args 
)
inlinestatic

Definition at line 88 of file CPose3D.h.

◆ CreateObject()

static std::shared_ptr<CObject> mrpt::poses::CPose3D::CreateObject ( )
static

◆ CreateUnique()

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

Definition at line 88 of file CPose3D.h.

◆ derived() [1/2]

const CPose3D & mrpt::poses::CPoseOrPoint< CPose3D , DIM >::derived ( ) const
inlineinherited

Definition at line 129 of file CPoseOrPoint.h.

◆ derived() [2/2]

CPose3D & mrpt::poses::CPoseOrPoint< CPose3D , DIM >::derived ( )
inlineinherited

Definition at line 133 of file CPoseOrPoint.h.

◆ distance2DTo()

double mrpt::poses::CPoseOrPoint< CPose3D , DIM >::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 237 of file CPoseOrPoint.h.

◆ distance2DToSquare()

double mrpt::poses::CPoseOrPoint< CPose3D , DIM >::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 221 of file CPoseOrPoint.h.

◆ distance3DTo()

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

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

Definition at line 243 of file CPoseOrPoint.h.

◆ distance3DToSquare()

double mrpt::poses::CPoseOrPoint< CPose3D , DIM >::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 228 of file CPoseOrPoint.h.

◆ distanceEuclidean6D()

double CPose3D::distanceEuclidean6D ( const CPose3D o) const

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

Definition at line 361 of file CPose3D.cpp.

References m_coords, m_pitch, m_roll, m_yaw, mrpt::square(), updateYawPitchRoll(), and mrpt::math::wrapToPi().

Referenced by mrpt::hmtslam::CHMTSLAM::LSLAM_process_message_from_AA().

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

◆ distanceTo() [1/2]

double mrpt::poses::CPoseOrPoint< CPose3D , DIM >::distanceTo ( const CPoseOrPoint< OTHERCLASS, DIM2 > &  b) const
inlineinherited

Returns the Euclidean distance to another pose/point:

Definition at line 214 of file CPoseOrPoint.h.

◆ distanceTo() [2/2]

double mrpt::poses::CPoseOrPoint< CPose3D , DIM >::distanceTo ( const mrpt::math::TPoint3D b) const
inlineinherited

Returns the euclidean distance to a 3D point:

Definition at line 249 of file CPoseOrPoint.h.

◆ duplicateGetSmartPtr()

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

Makes a deep copy of the object and returns a smart pointer to it.

Definition at line 204 of file CObject.h.

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

Referenced by mrpt::obs::CRawlog::insert().

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

◆ empty()

static constexpr bool mrpt::poses::CPose3D::empty ( )
inlinestatic

Definition at line 698 of file CPose3D.h.

◆ fromString()

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

Set the current object value from a string generated by 'asString' (eg: "[x y z yaw pitch roll]", angles in deg.

)

See also
asString
Exceptions
std::exceptionOn invalid format

Definition at line 764 of file CPose3D.cpp.

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

Referenced by FromString(), fromStringRaw(), and mrpt::hwdrivers::CKinect::loadConfig_sensorSpecific().

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

◆ FromString()

static CPose3D mrpt::poses::CPose3D::FromString ( const std::string &  s)
inlinestatic

Definition at line 644 of file CPose3D.h.

References fromString().

Referenced by mrpt::opengl::stock_objects::CornerXYSimple(), mrpt::opengl::stock_objects::CornerXYZSimple(), and TEST().

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

◆ fromStringRaw()

void CPose3D::fromStringRaw ( const std::string &  s)

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

Definition at line 776 of file CPose3D.cpp.

References fromString().

Here is the call graph for this function:

◆ getAs12Vector()

template<class ARRAYORVECTOR >
void mrpt::poses::CPose3D::getAs12Vector ( ARRAYORVECTOR &  vec12) const
inline

Get the pose representation as an array with these 12 elements: [r11 r21 r31 r12 r22 r32 r13 r23 r33 tx ty tz] where r{ij} are the entries of the 3x3 rotation matrix and t{x,y,z} are the 3D translation of the pose.

See also
setFrom12Vector

Definition at line 523 of file CPose3D.h.

References m_coords, and m_ROT.

Referenced by Pose3DTests::check_jacob_LnT_T(), Pose3DTests::func_jacob_Aexpe_D(), Pose3DTests::func_jacob_D_expe(), Pose3DTests::func_jacob_expe_D(), Pose3DTests::func_jacob_expe_e(), and TEST().

Here is the caller graph for this function:

◆ getAsQuaternion()

void CPose3D::getAsQuaternion ( mrpt::math::CQuaternionDouble q,
mrpt::optional_ref< mrpt::math::CMatrixDouble43 out_dq_dr = std::nullopt 
) 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 501 of file CPose3D.cpp.

References mrpt::math::TPose3D::getAsQuaternion(), m_pitch, m_roll, m_yaw, and updateYawPitchRoll().

Referenced by aux_poseypr2posequat(), check_CPose3D_tofrom_ROS(), mrpt::poses::CPose3DQuatPDFGaussian::copyFrom(), mrpt::poses::CPose3DQuat::CPose3DQuat(), mrpt::poses::CPose3DPDF::jacobiansPoseComposition(), quat_vs_YPR(), TEST_F(), QuaternionTests::test_gimbalLock(), QuaternionTests::test_lnAndExpMatches(), Pose3DQuatTests::test_normalizeJacob(), and mrpt::ros1bridge::toROS_Pose().

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

◆ getClassName()

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

Definition at line 88 of file CPose3D.h.

◆ getHomogeneousMatrix()

void CPose3D::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, getRotationMatrix

Definition at line 781 of file CPose3D.cpp.

References mrpt::math::CMatrixFixed< T, ROWS, COLS >::asEigen(), m_coords, and m_ROT.

Referenced by mrpt::maps::CLandmarksMap::changeCoordinatesReference(), mrpt::maps::CLandmarksMap::compute3DMatchingRatio(), mrpt::vision::computeMsd(), mrpt::vision::computeStereoRectificationMaps(), mrpt::vision::CDifodo::filterLevelSolution(), mrpt::maps::COctoMapBase< octomap::OcTree, octomap::OcTreeNode >::internal_build_PointCloud_for_observation(), mrpt::maps::CPointsMap::loadFromVelodyneScan(), and mrpt::maps::detail::loadFromRangeImpl< Derived >::templ_loadFromRangeScan().

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

◆ getHomogeneousMatrixVal()

MATRIX44 mrpt::poses::CPoseOrPoint< CPose3D , DIM >::getHomogeneousMatrixVal ( ) const
inlineinherited

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

See also
getInverseHomogeneousMatrix

Definition at line 278 of file CPoseOrPoint.h.

◆ getInverseHomogeneousMatrix()

void mrpt::poses::CPoseOrPoint< CPose3D , DIM >::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 290 of file CPoseOrPoint.h.

◆ getInverseHomogeneousMatrixVal()

MATRIX44 mrpt::poses::CPoseOrPoint< CPose3D , DIM >::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 298 of file CPoseOrPoint.h.

◆ getOppositeScalar()

CPose3D CPose3D::getOppositeScalar ( ) const

Return the opposite of the current pose instance by taking the negative of all its components individually.

Definition at line 337 of file CPose3D.cpp.

References CPose3D(), m_coords, m_pitch, m_roll, and m_yaw.

Here is the call graph for this function:

◆ getPoseMean() [1/2]

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

Definition at line 681 of file CPose3D.h.

◆ getPoseMean() [2/2]

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

Definition at line 682 of file CPose3D.h.

◆ getRotationMatrix() [1/2]

void mrpt::poses::CPose3D::getRotationMatrix ( mrpt::math::CMatrixDouble33 ROT) const
inline

◆ getRotationMatrix() [2/2]

const mrpt::math::CMatrixDouble33& mrpt::poses::CPose3D::getRotationMatrix ( ) 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 230 of file CPose3D.h.

References m_ROT.

◆ GetRuntimeClass()

virtual const mrpt::rtti::TRuntimeClassId* mrpt::poses::CPose3D::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::CPose3D::GetRuntimeClassIdStatic ( )
static

◆ getYawPitchRoll()

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

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

See also
setFromValues, yaw, pitch, roll

Definition at line 304 of file CPose3D.cpp.

References m_ROT, pitch(), roll(), and yaw().

Referenced by updateYawPitchRoll().

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

◆ Identity()

static CPose3D mrpt::poses::CPose3D::Identity ( )
inlinestatic

Returns the identity transformation.

Definition at line 139 of file CPose3D.h.

References CPose3D().

Here is the call graph for this function:

◆ inverse()

void CPose3D::inverse ( )

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

See also
operator-

Definition at line 584 of file CPose3D.cpp.

References mrpt::math::homogeneousMatrixInverse(), m_coords, m_ROT, m_ypr_uptodate, and mrpt::math::UNINITIALIZED_MATRIX.

Referenced by Pose3DTests::test_inverse().

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

◆ inverseComposeFrom()

void CPose3D::inverseComposeFrom ( const CPose3D A,
const CPose3D 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

Definition at line 612 of file CPose3D.cpp.

References mrpt::math::homogeneousMatrixInverse(), m_coords, m_ROT, m_ypr_uptodate, and mrpt::math::UNINITIALIZED_MATRIX.

Referenced by operator-().

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

◆ inverseComposePoint() [1/4]

void mrpt::poses::CPose3D::inverseComposePoint ( const double  gx,
const double  gy,
const double  gz,
double &  lx,
double &  ly,
double &  lz,
mrpt::optional_ref< mrpt::math::CMatrixDouble33 out_jacobian_df_dpoint = std::nullopt,
mrpt::optional_ref< mrpt::math::CMatrixDouble36 out_jacobian_df_dpose = std::nullopt,
mrpt::optional_ref< mrpt::math::CMatrixDouble36 out_jacobian_df_dse3 = std::nullopt 
) const

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

If pointers are provided, the corresponding Jacobians are returned. "out_jacobian_df_dse3" stands for the Jacobian with respect to the 6D locally Euclidean vector in the tangent space of SE(3). See this report for mathematical details.

See also
composePoint, composeFrom

Referenced by mrpt::vision::frameJac(), mrpt::ros1bridge::fromROS(), mrpt::maps::detail::pointmap_traits< CColouredPointsMap >::internal_loadFromRangeScan3D_prepareOneRange(), inverseComposePoint(), mrpt::vision::pointJac(), mrpt::vision::pinhole::projectPoint_no_distortion(), mrpt::vision::pinhole::projectPoints_with_distortion(), run_pc_filter_test(), sphericalCoordinates(), TEST(), Pose3DQuatTests::test_invComposePoint_vs_CPose3D(), Pose3DTests::test_invComposePointJacob(), and Pose3DTests::test_invComposePointJacob_se3().

Here is the caller graph for this function:

◆ inverseComposePoint() [2/4]

void mrpt::poses::CPose3D::inverseComposePoint ( const mrpt::math::TPoint3D g,
mrpt::math::TPoint3D l 
) 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 364 of file CPose3D.h.

References inverseComposePoint(), mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

Here is the call graph for this function:

◆ inverseComposePoint() [3/4]

mrpt::math::TPoint3D mrpt::poses::CPose3D::inverseComposePoint ( const mrpt::math::TPoint3D g) 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 370 of file CPose3D.h.

References inverseComposePoint().

Here is the call graph for this function:

◆ inverseComposePoint() [4/4]

void mrpt::poses::CPose3D::inverseComposePoint ( const mrpt::math::TPoint2D g,
mrpt::math::TPoint2D l,
const double  eps = 1e-6 
) const
inline

overload for 2D points

Exceptions
Ifthe z component of the result is greater than some epsilon

Definition at line 380 of file CPose3D.h.

References ASSERT_BELOW_, eps, inverseComposePoint(), mrpt::math::TPoint2D_data< T >::x, and mrpt::math::TPoint2D_data< T >::y.

Here is the call graph for this function:

◆ inverseRotateVector()

mrpt::math::TVector3D CPose3D::inverseRotateVector ( const mrpt::math::TVector3D global) const

Inverse of rotateVector(), i.e.

using the inverse rotation matrix

Definition at line 470 of file CPose3D.cpp.

References m_ROT, mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

◆ is3DPoseOrPoint()

static bool mrpt::poses::CPoseOrPoint< CPose3D , DIM >::is3DPoseOrPoint ( )
inlinestaticinherited

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

Definition at line 180 of file CPoseOrPoint.h.

◆ is_3D()

static constexpr bool mrpt::poses::CPose3D::is_3D ( )
inlinestatic

Definition at line 671 of file CPose3D.h.

References is_3D_val.

◆ is_PDF()

static constexpr bool mrpt::poses::CPose3D::is_PDF ( )
inlinestatic

Definition at line 680 of file CPose3D.h.

References is_PDF_val.

◆ isHorizontal()

bool CPose3D::isHorizontal ( const double  tolerance = 0) const

Return true if the 6D pose represents a Z axis almost exactly vertical (upwards or downwards), with a given tolerance (if set to 0 exact horizontality is tested).

Definition at line 599 of file CPose3D.cpp.

References M_PI, m_pitch, m_roll, updateYawPitchRoll(), and mrpt::math::wrapToPi().

Referenced by mrpt::maps::CPointsMap::internal_computeObservationLikelihood().

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

◆ max_size()

static constexpr size_type mrpt::poses::CPose3D::max_size ( )
inlinestatic

Definition at line 699 of file CPose3D.h.

References static_size.

◆ norm()

double mrpt::poses::CPoseOrPoint< CPose3D , DIM >::norm ( ) const
inlineinherited

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

Definition at line 256 of file CPoseOrPoint.h.

◆ normalizeAngles()

void 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

Definition at line 261 of file CPose3D.cpp.

References updateYawPitchRoll().

Referenced by mrpt::hmtslam::CHierarchicalMapMHPartition::getAs3DScene().

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

◆ operator*=()

void CPose3D::operator*= ( const double  s)

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

Definition at line 289 of file CPose3D.cpp.

References m_coords, m_pitch, m_roll, m_yaw, rebuildRotationMatrix(), and updateYawPitchRoll().

Here is the call graph for this function:

◆ operator+() [1/3]

CPose3D mrpt::poses::CPose3D::operator+ ( const CPose3D b) const
inline

The operator $ a \oplus b $ is the pose compounding operator.

Definition at line 249 of file CPose3D.h.

References composeFrom(), and mrpt::poses::UNINITIALIZED_POSE.

Here is the call graph for this function:

◆ operator+() [2/3]

CPoint3D CPose3D::operator+ ( const CPoint3D b) const

The operator $ a \oplus b $ is the pose compounding operator.

Definition at line 531 of file CPose3D.cpp.

References m_coords, m_ROT, mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::y().

Here is the call graph for this function:

◆ operator+() [3/3]

CPoint3D CPose3D::operator+ ( const CPoint2D b) const

The operator $ a \oplus b $ is the pose compounding operator.

Definition at line 545 of file CPose3D.cpp.

References m_coords, m_ROT, mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::y().

Here is the call graph for this function:

◆ operator+=()

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

Make $ this = this \oplus b $ (b can be "this" without problems)

Definition at line 397 of file CPose3D.h.

References composeFrom().

Here is the call graph for this function:

◆ operator-()

CPose3D mrpt::poses::CPose3D::operator- ( const CPose3D b) const
inline

Compute $ RET = this \oplus b $.

Definition at line 411 of file CPose3D.h.

References inverseComposeFrom(), and mrpt::poses::UNINITIALIZED_POSE.

Here is the call graph for this function:

◆ operator[]()

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

Definition at line 587 of file CPose3D.h.

References m_coords, m_pitch, m_roll, m_yaw, and updateYawPitchRoll().

Here is the call graph for this function:

◆ pitch()

double mrpt::poses::CPose3D::pitch ( ) const
inline

Get the PITCH angle (in radians)

See also
setFromValues

Definition at line 552 of file CPose3D.h.

References m_pitch, and updateYawPitchRoll().

Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::accumulateAngleDiffs(), asTPose(), mrpt::graphs::detail::graph_ops< graph_t >::auxEuclid2Dist(), mrpt::graphslam::deciders::CFixedIntervalsNRD< GRAPH_T >::checkRegistrationCondition(), mrpt::graphslam::deciders::CIncrementalNodeRegistrationDecider< GRAPH_T >::checkRegistrationConditionPose(), mrpt::obs::CActionRobotMovement3D::computeFromOdometry_model6DOF(), CPose3D(), mrpt::poses::CPoseRandomSampler::do_sample_3D(), mrpt::poses::CPose3DPDFGaussianInf::drawManySamples(), mrpt::poses::CPose3DPDFGaussian::drawManySamples(), mrpt::poses::CPose3DPDFGaussianInf::drawSingleSample(), mrpt::poses::CPose3DPDFGaussian::drawSingleSample(), mrpt::hmtslam::CHierarchicalMapMHPartition::dumpAsText(), mrpt::hmtslam::CLocalMetricHypothesis::getAs3DScene(), mrpt::opengl::CRenderizable::getPosePitch(), mrpt::opengl::CRenderizable::getPosePitchRad(), getYawPitchRoll(), mrpt::slam::CICP::ICP3D_Method_Classic(), mrpt::maps::CLandmarksMap::internal_computeObservationLikelihood(), mrpt::poses::CPoint3D::operator+(), mrpt::poses::operator<<(), mrpt::apps::RBPF_SLAM_App_Base::run(), mrpt::poses::CPose3DPDFGaussianInf::saveToTextFile(), mrpt::poses::CPose3DPDFGaussian::saveToTextFile(), mrpt::tfest::se3_l2_robust(), Pose3DTests::test_default_values(), TEST_F(), mrpt::opengl::CDisk::traceRay(), mrpt::graphs::detail::graph_ops< graph_t >::write_EDGE_line(), and mrpt::graphs::detail::graph_ops< graph_t >::write_VERTEX_line().

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

◆ rebuildRotationMatrix()

void CPose3D::rebuildRotationMatrix ( )
protected

Rebuild the homog matrix from the angles.

Definition at line 281 of file CPose3D.cpp.

References m_pitch, m_roll, m_ROT, and m_yaw.

Referenced by addComponents(), operator*=(), and setFromValues().

Here is the caller graph for this function:

◆ resize()

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

Definition at line 700 of file CPose3D.h.

References mrpt::format(), and static_size.

Here is the call graph for this function:

◆ roll()

double mrpt::poses::CPose3D::roll ( ) const
inline

Get the ROLL angle (in radians)

See also
setFromValues

Definition at line 558 of file CPose3D.h.

References m_roll, and updateYawPitchRoll().

Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::accumulateAngleDiffs(), asTPose(), mrpt::graphs::detail::graph_ops< graph_t >::auxEuclid2Dist(), mrpt::graphslam::deciders::CFixedIntervalsNRD< GRAPH_T >::checkRegistrationCondition(), mrpt::graphslam::deciders::CIncrementalNodeRegistrationDecider< GRAPH_T >::checkRegistrationConditionPose(), mrpt::obs::CActionRobotMovement3D::computeFromOdometry_model6DOF(), CPose3D(), mrpt::poses::CPoseRandomSampler::do_sample_3D(), mrpt::poses::CPose3DPDFGaussianInf::drawManySamples(), mrpt::poses::CPose3DPDFGaussian::drawManySamples(), mrpt::poses::CPose3DPDFGaussianInf::drawSingleSample(), mrpt::poses::CPose3DPDFGaussian::drawSingleSample(), mrpt::hmtslam::CHierarchicalMapMHPartition::dumpAsText(), mrpt::hmtslam::CLocalMetricHypothesis::getAs3DScene(), mrpt::opengl::CRenderizable::getPoseRoll(), mrpt::opengl::CRenderizable::getPoseRollRad(), getYawPitchRoll(), mrpt::slam::CICP::ICP3D_Method_Classic(), mrpt::maps::CLandmarksMap::internal_computeObservationLikelihood(), mrpt::poses::CPoint3D::operator+(), mrpt::poses::operator<<(), mrpt::apps::RBPF_SLAM_App_Base::run(), mrpt::poses::CPose3DPDFGaussianInf::saveToTextFile(), mrpt::poses::CPose3DPDFGaussian::saveToTextFile(), mrpt::tfest::se3_l2_robust(), Pose3DTests::test_default_values(), TEST_F(), mrpt::opengl::CDisk::traceRay(), mrpt::graphs::detail::graph_ops< graph_t >::write_EDGE_line(), and mrpt::graphs::detail::graph_ops< graph_t >::write_VERTEX_line().

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

◆ rotateVector()

mrpt::math::TVector3D CPose3D::rotateVector ( const mrpt::math::TVector3D local) const

Rotates a vector (i.e.

like composePoint(), but ignoring translation)

Definition at line 460 of file CPose3D.cpp.

References m_ROT, mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

Referenced by mrpt::opengl::internal::glDrawTextTransformed(), and mrpt::opengl::CArrow::onUpdateBuffers_Triangles().

Here is the caller graph for this function:

◆ serializeFrom() [1/2]

virtual void mrpt::serialization::CSerializable::serializeFrom ( CSchemeArchiveBase in)
inlineprotectedvirtualinherited

Virtual method for reading (deserializing) from an abstract schema based archive.

Definition at line 74 of file CSerializable.h.

References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ serializeFrom() [2/2]

void CPose3D::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 135 of file CPose3D.cpp.

References ASSERT_, mrpt::math::MatrixVectorBase< Scalar, Derived >::block(), m_coords, m_ROT, m_ypr_uptodate, MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, and mrpt::math::UNINITIALIZED_QUATERNION.

Here is the call graph for this function:

◆ serializeGetVersion()

uint8_t CPose3D::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 123 of file CPose3D.cpp.

◆ serializeTo() [1/2]

virtual void mrpt::serialization::CSerializable::serializeTo ( CSchemeArchiveBase out) const
inlineprotectedvirtualinherited

Virtual method for writing (serializing) to an abstract schema based archive.

Definition at line 64 of file CSerializable.h.

References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.

Here is the call graph for this function:

◆ serializeTo() [2/2]

void CPose3D::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 124 of file CPose3D.cpp.

References m_coords, m_ROT, and out.

◆ setFrom12Vector()

template<class ARRAYORVECTOR >
void mrpt::poses::CPose3D::setFrom12Vector ( const ARRAYORVECTOR &  vec12)
inline

Set pose from an array with these 12 elements: [r11 r21 r31 r12 r22 r32 r13 r23 r33 tx ty tz] where r{ij} are the entries of the 3x3 rotation matrix and t{x,y,z} are the 3D translation of the pose.

See also
getAs12Vector

Definition at line 499 of file CPose3D.h.

References m_coords, m_ROT, and m_ypr_uptodate.

Referenced by CPose3D(), and Pose3DTests::func_jacob_LnT_T().

Here is the caller graph for this function:

◆ setFromValues()

void 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) - This method recomputes the internal rotation matrix.

See also
getYawPitchRoll, setYawPitchRoll

Definition at line 265 of file CPose3D.cpp.

References m_coords, m_pitch, m_roll, m_yaw, m_ypr_uptodate, rebuildRotationMatrix(), and mrpt::math::wrapToPi().

Referenced by mrpt::slam::CMetricMapBuilderRBPF::clear(), mrpt::poses::CPose3DPDFGaussian::copyFrom(), CPose3D(), mrpt::poses::CPoseRandomSampler::do_sample_3D(), mrpt::poses::CPoseRandomSampler::drawSample(), mrpt::poses::CPose3DPDFGaussian::drawSingleSample(), fromString(), mrpt::poses::CPose3DPDFSOG::getMean(), mrpt::poses::internal::getPoseFromString(), mrpt::hwdrivers::CIMUXSens_MT4::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGyroKVHDSP3000::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSkeletonTracker::loadConfig_sensorSpecific(), mrpt::hwdrivers::CRoboPeakLidar::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSwissRanger3DCamera::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGPSInterface::loadConfig_sensorSpecific(), mrpt::hwdrivers::CHokuyoURG::loadConfig_sensorSpecific(), mrpt::hwdrivers::CKinect::loadConfig_sensorSpecific(), mrpt::topography::path_from_rtk_gps(), mrpt::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal(), mrpt::slam::CMetricMapBuilderRBPF::processActionObservation(), setYawPitchRoll(), and TEST().

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

◆ setFromXYZQ()

template<typename VECTORLIKE >
void mrpt::poses::CPose3D::setFromXYZQ ( const VECTORLIKE &  v,
const size_t  index_offset = 0 
)
inline

Set the pose from a 3D position (meters) and a quaternion, stored as [x y z qr qx qy qz] in a 7-element vector.

See also
setFromValues, getYawPitchRoll, setYawPitchRoll, CQuaternion, getAsQuaternion

Definition at line 468 of file CPose3D.h.

References ASSERT_ABOVEEQ_, m_coords, m_ROT, and m_ypr_uptodate.

◆ setRotationMatrix()

void mrpt::poses::CPose3D::setRotationMatrix ( const mrpt::math::CMatrixDouble33 ROT)
inline

Sets the 3x3 rotation matrix.

See also
getRotationMatrix, getHomogeneousMatrix

Definition at line 237 of file CPose3D.h.

References m_ROT, and m_ypr_uptodate.

Referenced by mrpt::ros1bridge::fromROS(), Pose3DTests::func_jacob_LnT_T(), and mrpt::vision::CStereoRectifyMap::setFromCamParams().

Here is the caller graph for this function:

◆ setToNaN()

void CPose3D::setToNaN ( )
overridevirtual

Set all data fields to quiet NaN.

Implements mrpt::poses::CPoseOrPoint< CPose3D, DIM >.

Definition at line 749 of file CPose3D.cpp.

References m_coords, and m_ROT.

◆ setYawPitchRoll()

void mrpt::poses::CPose3D::setYawPitchRoll ( const double  yaw_,
const double  pitch_,
const double  roll_ 
)
inline

Set the 3 angles of the 3D pose (in radians) - This method recomputes the internal rotation coordinates matrix.

See also
getYawPitchRoll, setFromValues

Definition at line 486 of file CPose3D.h.

References setFromValues(), mrpt::poses::CPoseOrPoint< CPose3D, DIM >::x(), and mrpt::poses::CPoseOrPoint< CPose3D, DIM >::y().

Here is the call graph for this function:

◆ size()

static constexpr size_type mrpt::poses::CPose3D::size ( )
inlinestatic

Definition at line 697 of file CPose3D.h.

References static_size.

Referenced by mrpt::obs::CObservation2DRangeScan::truncateByDistanceAndAngle().

Here is the caller graph for this function:

◆ sphericalCoordinates()

void CPose3D::sphericalCoordinates ( const mrpt::math::TPoint3D 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.

Definition at line 312 of file CPose3D.cpp.

References inverseComposePoint(), mrpt::math::TPoint3D_< T >::norm(), mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.

Referenced by mrpt::maps::CLandmarksMap::simulateRangeBearingReadings(), and Pose3DQuatTests::test_invComposePoint_vs_CPose3D().

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

◆ sqrDistanceTo()

double mrpt::poses::CPoseOrPoint< CPose3D , DIM >::sqrDistanceTo ( const CPoseOrPoint< OTHERCLASS, DIM2 > &  b) const
inlineinherited

Returns the squared euclidean distance to another pose/point:

Definition at line 187 of file CPoseOrPoint.h.

◆ updateYawPitchRoll()

void mrpt::poses::CPose3D::updateYawPitchRoll ( ) const
inlineprotected

Updates Yaw/pitch/roll members from the m_ROT.

Definition at line 116 of file CPose3D.h.

References getYawPitchRoll(), m_pitch, m_roll, m_yaw, and m_ypr_uptodate.

Referenced by addComponents(), asString(), asVector(), distanceEuclidean6D(), getAsQuaternion(), isHorizontal(), normalizeAngles(), operator*=(), operator[](), pitch(), roll(), and yaw().

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

◆ 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 90 of file CSerializable.h.

◆ x() [1/3]

double mrpt::poses::CPoseOrPoint< CPose3D , DIM >::x ( ) const
inlineinherited

Common members of all points & poses classes.

< Get X coord.

Definition at line 143 of file CPoseOrPoint.h.

Referenced by asTPose(), CPose3D(), and setYawPitchRoll().

◆ x() [2/3]

double& mrpt::poses::CPoseOrPoint< CPose3D , DIM >::x ( )
inlineinherited

Definition at line 152 of file CPoseOrPoint.h.

◆ x() [3/3]

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

Definition at line 161 of file CPoseOrPoint.h.

◆ x_incr()

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

Definition at line 170 of file CPoseOrPoint.h.

◆ y() [1/3]

double mrpt::poses::CPoseOrPoint< CPose3D , DIM >::y ( ) const
inlineinherited

< Get Y coord.

Definition at line 147 of file CPoseOrPoint.h.

Referenced by asTPose(), CPose3D(), and setYawPitchRoll().

◆ y() [2/3]

double& mrpt::poses::CPoseOrPoint< CPose3D , DIM >::y ( )
inlineinherited

Definition at line 156 of file CPoseOrPoint.h.

◆ y() [3/3]

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

Definition at line 165 of file CPoseOrPoint.h.

◆ y_incr()

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

Definition at line 174 of file CPoseOrPoint.h.

◆ yaw()

double mrpt::poses::CPose3D::yaw ( ) const
inline

Get the YAW angle (in radians)

See also
setFromValues

Definition at line 546 of file CPose3D.h.

References m_yaw, and updateYawPitchRoll().

Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::accumulateAngleDiffs(), asTPose(), mrpt::graphs::detail::graph_ops< graph_t >::auxEuclid2Dist(), mrpt::graphslam::deciders::CFixedIntervalsNRD< GRAPH_T >::checkRegistrationCondition(), mrpt::graphslam::deciders::CIncrementalNodeRegistrationDecider< GRAPH_T >::checkRegistrationConditionPose(), mrpt::obs::CActionRobotMovement3D::computeFromOdometry_model6DOF(), CPose3D(), mrpt::poses::CPoseRandomSampler::do_sample_3D(), mrpt::poses::CPose3DPDFGaussianInf::drawManySamples(), mrpt::poses::CPose3DPDFGaussian::drawManySamples(), mrpt::poses::CPoseRandomSampler::drawSample(), mrpt::poses::CPose3DPDFGaussianInf::drawSingleSample(), mrpt::poses::CPose3DPDFGaussian::drawSingleSample(), mrpt::hmtslam::CHierarchicalMapMHPartition::dumpAsText(), mrpt::hmtslam::CLocalMetricHypothesis::getAs3DScene(), mrpt::opengl::CRenderizable::getPoseYaw(), mrpt::opengl::CRenderizable::getPoseYawRad(), getYawPitchRoll(), mrpt::slam::CICP::ICP3D_Method_Classic(), mrpt::maps::CLandmarksMap::internal_computeObservationLikelihood(), mrpt::hmtslam::CHMTSLAM::LSLAM_process_message_from_AA(), mrpt::poses::CPoint3D::operator+(), mrpt::poses::operator<<(), mrpt::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal(), mrpt::slam::CMetricMapBuilderRBPF::processActionObservation(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::processOneLMH(), mrpt::apps::ICP_SLAM_App_Base::run(), mrpt::apps::RBPF_SLAM_App_Base::run(), mrpt::poses::CPose3DPDFGaussianInf::saveToTextFile(), mrpt::poses::CPose3DPDFGaussian::saveToTextFile(), mrpt::tfest::se3_l2_robust(), Pose3DTests::test_default_values(), TEST_F(), Pose3DTests::test_to_from_2d(), mrpt::opengl::CDisk::traceRay(), mrpt::graphs::detail::graph_ops< graph_t >::write_EDGE_line(), and mrpt::graphs::detail::graph_ops< graph_t >::write_VERTEX_line().

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

Member Data Documentation

◆ className

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

Definition at line 88 of file CPose3D.h.

◆ m_coords

mrpt::math::CVectorFixedDouble<3> mrpt::poses::CPose3D::m_coords

◆ m_pitch

double mrpt::poses::CPose3D::m_pitch {0}
mutableprotected

◆ m_roll

double mrpt::poses::CPose3D::m_roll {0}
mutableprotected

◆ m_ROT

mrpt::math::CMatrixDouble33 mrpt::poses::CPose3D::m_ROT
protected

◆ m_yaw

double mrpt::poses::CPose3D::m_yaw {0}
mutableprotected

These variables are updated every time that the object rotation matrix is modified (construction, loading from values, pose composition, etc )

Definition at line 110 of file CPose3D.h.

Referenced by addComponents(), asString(), asVector(), distanceEuclidean6D(), getAsQuaternion(), getOppositeScalar(), operator*=(), operator[](), rebuildRotationMatrix(), setFromValues(), updateYawPitchRoll(), and yaw().

◆ m_ypr_uptodate

bool mrpt::poses::CPose3D::m_ypr_uptodate {false}
mutableprotected

Whether yaw/pitch/roll members are up-to-date since the last rotation matrix update.

Definition at line 106 of file CPose3D.h.

Referenced by composeFrom(), inverse(), inverseComposeFrom(), serializeFrom(), setFrom12Vector(), setFromValues(), setFromXYZQ(), setRotationMatrix(), and updateYawPitchRoll().

◆ runtimeClassId

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

Definition at line 88 of file CPose3D.h.




Page generated by Doxygen 1.8.14 for MRPT 2.0.2 Git: 9b4fd2465 Mon May 4 16:59:08 2020 +0200 at lun may 4 17:26:07 CEST 2020