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.
There are Lie algebra methods: exp and ln (see the methods for documentation).
#include <mrpt/poses/CPose3D.h>
Public Types | |
enum | { is_3D_val = 1 } |
enum | { rotation_dimensions = 3 } |
enum | { is_PDF_val = 0 } |
typedef CPose3D | type_value |
Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses. | |
Public Member Functions | |
void | setToNaN () MRPT_OVERRIDE |
Set all data fields to quiet NaN. | |
const type_value & | getPoseMean () const |
type_value & | getPoseMean () |
Constructors | |
CPose3D () | |
Default constructor, with all the coordinates set to zero. | |
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!) | |
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). | |
CPose3D (const math::CMatrixDouble44 &m) | |
Constructor from a 4x4 homogeneous matrix: | |
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. | |
CPose3D (const mrpt::math::CMatrixDouble33 &rot, const mrpt::math::CArrayDouble< 3 > &xyz) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
CPose3D (const CPose2D &) | |
Constructor from a CPose2D object. | |
CPose3D (const CPoint3D &) | |
Constructor from a CPoint3D object. | |
CPose3D (const mrpt::math::TPose3D &) | |
Constructor from lightweight object. | |
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. | |
CPose3D (const CPose3DQuat &) | |
Constructor from a CPose3DQuat. | |
CPose3D (const CPose3DRotVec &p) | |
Constructor from a CPose3DRotVec. | |
CPose3D (TConstructorFlags_Poses) | |
Fast constructor that leaves all the data uninitialized - call with UNINITIALIZED_POSE as argument. | |
CPose3D (const mrpt::math::CArrayDouble< 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. | |
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). | |
mrpt::math::CMatrixDouble44 | getHomogeneousMatrixVal () const |
void | getRotationMatrix (mrpt::math::CMatrixDouble33 &ROT) const |
Get the 3x3 rotation matrix. | |
const mrpt::math::CMatrixDouble33 & | getRotationMatrix () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | setRotationMatrix (const mrpt::math::CMatrixDouble33 &ROT) |
Sets the 3x3 rotation matrix. | |
Pose-pose and pose-point compositions and operators | |
CPose3D | operator+ (const CPose3D &b) const |
The operator ![]() | |
CPoint3D | operator+ (const CPoint3D &b) const |
The operator ![]() | |
CPoint3D | operator+ (const CPoint2D &b) const |
The operator ![]() | |
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. | |
void | composePoint (double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=NULL, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=NULL, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dse3=NULL, bool use_small_rot_approx=false) const |
An alternative, slightly more efficient way of doing ![]() | |
void | composePoint (const mrpt::math::TPoint3D &local_point, mrpt::math::TPoint3D &global_point) const |
An alternative, slightly more efficient way of doing ![]() | |
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!) | |
void | composePoint (double lx, double ly, double lz, float &gx, float &gy, float &gz) const |
An alternative, slightly more efficient way of doing ![]() | |
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=NULL, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=NULL, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dse3=NULL) const |
Computes the 3D point L such as ![]() | |
void | inverseComposePoint (const mrpt::math::TPoint3D &g, mrpt::math::TPoint3D &l) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | inverseComposePoint (const mrpt::math::TPoint2D &g, mrpt::math::TPoint2D &l, const double eps=1e-6) const |
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. | |
CPose3D & | operator+= (const CPose3D &b) |
Make ![]() | |
void | inverseComposeFrom (const CPose3D &A, const CPose3D &B) |
Makes ![]() | |
CPose3D | operator- (const CPose3D &b) const |
Compute ![]() | |
void | inverse () |
Convert this pose into its inverse, saving the result in itself. | |
void | changeCoordinatesReference (const CPose3D &p) |
makes: this = p (+) this | |
Access and modify contents | |
void | addComponents (const CPose3D &p) |
Scalar sum of all 6 components: This is diferent from poses composition, which is implemented as "+" operators. | |
void | normalizeAngles () |
Rebuild the internal matrix & update the yaw/pitch/roll angles within the ]-PI,PI] range (Must be called after using addComponents) | |
void | operator*= (const double s) |
Scalar multiplication of x,y,z,yaw,pitch & roll (angles will be wrapped to the ]-pi,pi] interval). | |
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. | |
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. | |
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. | |
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. | |
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. | |
void | getYawPitchRoll (double &yaw, double &pitch, double &roll) const |
Returns the three angles (yaw, pitch, roll), in radians, from the rotation matrix. | |
double | yaw () const |
Get the YAW angle (in radians) | |
double | pitch () const |
Get the PITCH angle (in radians) | |
double | roll () const |
Get the ROLL angle (in radians) | |
void | getAsVector (mrpt::math::CVectorDouble &v) const |
Returns a 1x6 vector with [x y z yaw pitch roll]. | |
void | getAsVector (mrpt::math::CArrayDouble< 6 > &v) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | getAsQuaternion (mrpt::math::CQuaternionDouble &q, mrpt::math::CMatrixFixedNumeric< double, 4, 3 > *out_dq_dr=NULL) const |
Returns the quaternion associated to the rotation of this object (NOTE: XYZ translation is ignored) | |
const 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.) | |
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. | |
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). | |
double | distanceEuclidean6D (const CPose3D &o) const |
The euclidean distance between two poses taken as two 6-length vectors (angles in radians). | |
Static Public Member Functions | |
static bool | is_3D () |
static bool | is_PDF () |
Public Attributes | |
mrpt::math::CArrayDouble< 3 > | m_coords |
The translation vector [x,y,z] access directly or with x(), y(), z() setter/getter methods. | |
Protected Member Functions | |
void | rebuildRotationMatrix () |
Rebuild the homog matrix from the angles. | |
void | updateYawPitchRoll () const |
Updates Yaw/pitch/roll members from the m_ROT | |
CSerializable virtual methods | |
void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const MRPT_OVERRIDE |
void | readFromStream (mrpt::utils::CStream &in, int version) MRPT_OVERRIDE |
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) | |
bool | m_ypr_uptodate |
Whether yaw/pitch/roll members are up-to-date since the last rotation matrix update. | |
double | m_yaw |
double | m_pitch |
double | m_roll |
These variables are updated every time that the object rotation matrix is modified (construction, loading from values, pose composition, etc ) | |
STL-like methods and typedefs | |
| |
enum | { static_size = 6 } |
typedef double | value_type |
The type of the elements. | |
typedef double & | reference |
typedef const double & | const_reference |
typedef std::size_t | size_type |
typedef std::ptrdiff_t | difference_type |
static size_type | size () |
static bool | empty () |
static size_type | max_size () |
static void | resize (const size_t n) |
RTTI stuff <br> | |
typedef CPose3DPtr | SmartPtr |
static mrpt::utils::CLASSINIT | _init_CPose3D |
static mrpt::utils::TRuntimeClassId | classCPose3D |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const MRPT_OVERRIDE |
virtual mrpt::utils::CObject * | duplicate () const MRPT_OVERRIDE |
static mrpt::utils::CObject * | CreateObject () |
static CPose3DPtr | Create () |
Lie Algebra methods | |
void | ln (mrpt::math::CArrayDouble< 6 > &out_ln) const |
Take the logarithm of the 3x4 matrix defined by this pose, generating the corresponding vector in the SE(3) Lie Algebra. | |
mrpt::math::CArrayDouble< 6 > | ln () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | ln_jacob (mrpt::math::CMatrixFixedNumeric< double, 6, 12 > &J) const |
Jacobian of the logarithm of the 3x4 matrix defined by this pose. | |
mrpt::math::CArrayDouble< 3 > | ln_rotation () const |
Take the logarithm of the 3x3 rotation matrix, generating the corresponding vector in the Lie Algebra. | |
static CPose3D | exp (const mrpt::math::CArrayNumeric< double, 6 > &vect, bool pseudo_exponential=false) |
Exponentiate a Vector in the SE(3) Lie Algebra to generate a new CPose3D (static method). | |
static void | exp (const mrpt::math::CArrayNumeric< double, 6 > &vect, CPose3D &out_pose, bool pseudo_exponential=false) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static mrpt::math::CMatrixDouble33 | exp_rotation (const mrpt::math::CArrayNumeric< double, 3 > &vect) |
Exponentiate a vector in the Lie algebra to generate a new SO(3) (a 3x3 rotation matrix). | |
static void | ln_rot_jacob (const mrpt::math::CMatrixDouble33 &R, mrpt::math::CMatrixFixedNumeric< double, 3, 9 > &M) |
Static function to compute the Jacobian of the SO(3) Logarithm function, evaluated at a given 3x3 rotation matrix R. | |
static void | jacob_dexpeD_de (const CPose3D &D, Eigen::Matrix< double, 12, 6 > &jacob) |
The Jacobian d (e^eps * D) / d eps , with eps=increment in Lie Algebra. | |
static void | jacob_dAexpeD_de (const CPose3D &A, const CPose3D &D, Eigen::Matrix< double, 12, 6 > &jacob) |
The Jacobian d (A * e^eps * D) / d eps , with eps=increment in Lie Algebra. | |
double | x () const |
Common members of all points & poses classes. | |
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) |
template<class OTHERCLASS > | |
double | sqrDistanceTo (const CPoseOrPoint< OTHERCLASS > &b) const |
Returns the squared euclidean distance to another pose/point: | |
template<class OTHERCLASS > | |
double | distanceTo (const CPoseOrPoint< OTHERCLASS > &b) const |
Returns the Euclidean distance to another pose/point: | |
double | distanceTo (const mrpt::math::TPoint3D &b) const |
Returns the euclidean distance to a 3D point: | |
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). | |
double | distance3DToSquare (double ax, double ay, double az) const |
Returns the squared 3D distance from this pose/point to a 3D point. | |
double | distance2DTo (double ax, double ay) const |
Returns the 2D distance from this pose/point to a 2D point (ignores Z, if it exists). | |
double | distance3DTo (double ax, double ay, double az) const |
Returns the 3D distance from this pose/point to a 3D point. | |
double | norm () const |
Returns the euclidean norm of vector: ![]() | |
mrpt::math::CVectorDouble | getAsVectorVal () const |
Return the pose or point as a 1xN vector with all the components (see derived classes for each implementation) | |
void | getInverseHomogeneousMatrix (mrpt::math::CMatrixDouble44 &out_HM) const |
Returns the corresponding 4x4 inverse homogeneous transformation matrix for this point or pose. | |
mrpt::math::CMatrixDouble44 | getInverseHomogeneousMatrix () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
static bool | is3DPoseOrPoint () |
Return true for poses or points with a Z component, false otherwise. | |
typedef const double& mrpt::poses::CPose3D::const_reference |
typedef std::ptrdiff_t mrpt::poses::CPose3D::difference_type |
typedef double& mrpt::poses::CPose3D::reference |
typedef std::size_t mrpt::poses::CPose3D::size_type |
Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses.
typedef double mrpt::poses::CPose3D::value_type |
mrpt::poses::CPose3D::CPose3D | ( | ) |
Default constructor, with all the coordinates set to zero.
mrpt::poses::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!)
|
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).
|
explicit |
Constructor from a 4x4 homogeneous matrix:
|
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 112 of file CPose3D.h.
References ASSERT_EQUAL_, and mrpt::math::size().
|
inline |
mrpt::poses::CPose3D::CPose3D | ( | const mrpt::math::TPose3D & | ) |
Constructor from lightweight object.
mrpt::poses::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.
mrpt::poses::CPose3D::CPose3D | ( | const CPose3DQuat & | ) |
Constructor from a CPose3DQuat.
mrpt::poses::CPose3D::CPose3D | ( | const CPose3DRotVec & | p | ) |
Constructor from a CPose3DRotVec.
|
inline |
|
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.
|
staticprotected |
void mrpt::poses::CPose3D::addComponents | ( | const CPose3D & | p | ) |
Scalar sum of all 6 components: This is diferent from poses composition, which is implemented as "+" operators.
|
inline |
|
inline |
Returns a human-readable textual representation of the object (eg: "[x y z yaw pitch roll]", angles in degrees.)
Definition at line 432 of file CPose3D.h.
References mrpt::format(), mrpt::utils::RAD2DEG(), and RAD2DEG.
|
inline |
Makes "this = A (+) B"; this method is slightly more efficient than "this= A + B;" since it avoids the temporary object.
Referenced by mrpt::maps::COctoMapBase< OCTREE, OCTREE_NODE >::internal_build_PointCloud_for_observation(), operator+(), mrpt::slam::PF_implementation< PARTICLE_TYPE, MYSELF >::PF_SLAM_aux_perform_one_rejection_sampling_step(), and mrpt::obs::detail::project3DPointsFromDepthImageInto().
|
inline |
This version of the method assumes that the resulting point has no Z component (use with caution!)
Definition at line 229 of file CPose3D.h.
References mrpt::math::TPoint2D::x, mrpt::math::TPoint3D::x, mrpt::math::TPoint2D::y, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
|
inline |
An alternative, slightly more efficient way of doing
Definition at line 225 of file CPose3D.h.
References mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
void mrpt::poses::CPose3D::composePoint | ( | double | lx, |
double | ly, | ||
double | lz, | ||
double & | gx, | ||
double & | gy, | ||
double & | gz, | ||
mrpt::math::CMatrixFixedNumeric< double, 3, 3 > * | out_jacobian_df_dpoint = NULL , |
||
mrpt::math::CMatrixFixedNumeric< double, 3, 6 > * | out_jacobian_df_dpose = NULL , |
||
mrpt::math::CMatrixFixedNumeric< double, 3, 6 > * | out_jacobian_df_dse3 = NULL , |
||
bool | use_small_rot_approx = false |
||
) | const |
An alternative, slightly more efficient way of doing
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.
If | set to true, the Jacobian "out_jacobian_df_dpose" uses a fastest linearized appoximation (valid only for small rotations!). |
Referenced by mrpt::maps::COctoMapBase< OCTREE, OCTREE_NODE >::internal_build_PointCloud_for_observation(), mrpt::math::project3D(), mrpt::vision::pinhole::projectPoint_no_distortion(), and mrpt::opengl::CGeneralizedEllipsoidTemplate< DIM >::render_dl().
|
inline |
|
static |
|
static |
|
inlineinherited |
Returns the 2D distance from this pose/point to a 2D point (ignores Z, if it exists).
Definition at line 165 of file CPoseOrPoint.h.
References mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance2DToSquare().
|
inlineinherited |
Returns the squared 2D distance from this pose/point to a 2D point (ignores Z, if it exists).
Definition at line 156 of file CPoseOrPoint.h.
References mrpt::utils::square(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y().
Referenced by mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance2DTo().
|
inlineinherited |
Returns the 3D distance from this pose/point to a 3D point.
Definition at line 168 of file CPoseOrPoint.h.
References mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance3DToSquare().
Referenced by mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distanceTo().
|
inlineinherited |
Returns the squared 3D distance from this pose/point to a 3D point.
Definition at line 159 of file CPoseOrPoint.h.
References mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::is3DPoseOrPoint(), mrpt::utils::square(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y().
Referenced by mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance3DTo().
double mrpt::poses::CPose3D::distanceEuclidean6D | ( | const CPose3D & | o | ) | const |
The euclidean distance between two poses taken as two 6-length vectors (angles in radians).
|
inlineinherited |
Returns the Euclidean distance to another pose/point:
Definition at line 150 of file CPoseOrPoint.h.
References mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::sqrDistanceTo().
|
inlineinherited |
Returns the euclidean distance to a 3D point:
Definition at line 171 of file CPoseOrPoint.h.
References mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance3DTo(), mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
|
virtual |
|
static |
Exponentiate a Vector in the SE(3) Lie Algebra to generate a new CPose3D (static method).
pseudo_exponential | If set to true, XYZ are copied from the first three elements in the vector instead of using the proper Lie Algebra formulas (this is actually the common practice in robotics literature). |
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
static |
Exponentiate a vector in the Lie algebra to generate a new SO(3) (a 3x3 rotation matrix).
|
inline |
Set the current object value from a string generated by 'asString' (eg: "[x y z yaw pitch roll]", angles in deg.
)
std::exception | On invalid format |
Definition at line 439 of file CPose3D.h.
References ASSERTMSG_, mrpt::utils::DEG2RAD(), DEG2RAD, mrpt::math::size(), and THROW_EXCEPTION.
|
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.
void mrpt::poses::CPose3D::getAsQuaternion | ( | mrpt::math::CQuaternionDouble & | q, |
mrpt::math::CMatrixFixedNumeric< double, 4, 3 > * | out_dq_dr = NULL |
||
) | const |
Returns the quaternion associated to the rotation of this object (NOTE: XYZ translation is ignored)
With :
out_dq_dr | If 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). |
Referenced by mrpt::math::jacobians::jacob_quat_from_yawpitchroll().
void mrpt::poses::CPose3D::getAsVector | ( | mrpt::math::CArrayDouble< 6 > & | v | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void mrpt::poses::CPose3D::getAsVector | ( | mrpt::math::CVectorDouble & | v | ) | const |
Returns a 1x6 vector with [x y z yaw pitch roll].
|
inlineinherited |
Return the pose or point as a 1xN vector with all the components (see derived classes for each implementation)
Definition at line 181 of file CPoseOrPoint.h.
|
inline |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation).
|
inline |
Definition at line 173 of file CPose3D.h.
Referenced by mrpt::obs::detail::project3DPointsFromDepthImageInto().
|
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 208 of file CPoseOrPoint.h.
References mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::getInverseHomogeneousMatrix(), and mrpt::math::UNINITIALIZED_MATRIX.
Referenced by mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::getInverseHomogeneousMatrix().
|
inlineinherited |
Returns the corresponding 4x4 inverse homogeneous transformation matrix for this point or pose.
Definition at line 201 of file CPoseOrPoint.h.
References mrpt::math::homogeneousMatrixInverse().
|
inline |
|
inline |
|
inline |
|
inline |
Get the 3x3 rotation matrix.
Definition at line 176 of file CPose3D.h.
Referenced by mrpt::obs::detail::project3DPointsFromDepthImageInto().
|
virtual |
void mrpt::poses::CPose3D::getYawPitchRoll | ( | double & | yaw, |
double & | pitch, | ||
double & | roll | ||
) | const |
Returns the three angles (yaw, pitch, roll), in radians, from the rotation matrix.
void mrpt::poses::CPose3D::inverse | ( | ) |
Convert this pose into its inverse, saving the result in itself.
Makes
Referenced by operator-().
void mrpt::poses::CPose3D::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 = NULL , |
||
mrpt::math::CMatrixFixedNumeric< double, 3, 6 > * | out_jacobian_df_dpose = NULL , |
||
mrpt::math::CMatrixFixedNumeric< double, 3, 6 > * | out_jacobian_df_dse3 = NULL |
||
) | const |
Computes the 3D point L such as
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.
Referenced by mrpt::vision::pinhole::projectPoint_no_distortion().
|
inline |
Definition at line 258 of file CPose3D.h.
References ASSERT_BELOW_, mrpt::math::TPoint2D::x, and mrpt::math::TPoint2D::y.
|
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 253 of file CPose3D.h.
References mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
|
inlinestaticinherited |
Return true for poses or points with a Z component, false otherwise.
Definition at line 127 of file CPoseOrPoint.h.
Referenced by mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance3DToSquare(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::norm(), mrpt::poses::operator<(), mrpt::poses::operator<<(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::sqrDistanceTo().
bool mrpt::poses::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).
|
static |
The Jacobian d (A * e^eps * D) / d eps , with eps=increment in Lie Algebra.
|
static |
The Jacobian d (e^eps * D) / d eps , with eps=increment in Lie Algebra.
|
inline |
void mrpt::poses::CPose3D::ln | ( | mrpt::math::CArrayDouble< 6 > & | out_ln | ) | const |
Take the logarithm of the 3x4 matrix defined by this pose, generating the corresponding vector in the SE(3) Lie Algebra.
Referenced by mrpt::poses::SE_traits< 3 >::ln().
void mrpt::poses::CPose3D::ln_jacob | ( | mrpt::math::CMatrixFixedNumeric< double, 6, 12 > & | J | ) | const |
Jacobian of the logarithm of the 3x4 matrix defined by this pose.
|
static |
mrpt::math::CArrayDouble< 3 > mrpt::poses::CPose3D::ln_rotation | ( | ) | const |
Take the logarithm of the 3x3 rotation matrix, generating the corresponding vector in the Lie Algebra.
|
inlinestatic |
Definition at line 532 of file CPose3D.h.
References static_size.
|
inlineinherited |
Returns the euclidean norm of vector:
Definition at line 174 of file CPoseOrPoint.h.
References mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::is3DPoseOrPoint(), mrpt::utils::square(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y().
void mrpt::poses::CPose3D::normalizeAngles | ( | ) |
Rebuild the internal matrix & update the yaw/pitch/roll angles within the ]-PI,PI] range (Must be called after using addComponents)
void mrpt::poses::CPose3D::operator*= | ( | const double | s | ) |
Scalar multiplication of x,y,z,yaw,pitch & roll (angles will be wrapped to the ]-pi,pi] interval).
The operator
The operator
The operator
Definition at line 190 of file CPose3D.h.
References composeFrom(), and mrpt::poses::UNINITIALIZED_POSE.
Compute
Definition at line 283 of file CPose3D.h.
References inverseComposeFrom(), and mrpt::poses::UNINITIALIZED_POSE.
|
inline |
|
inline |
Get the PITCH angle (in radians)
Definition at line 392 of file CPose3D.h.
Referenced by mrpt::graphs::detail::graph_ops< graph_t >::auxEuclid2Dist(), mrpt::graphs::detail::graph_ops< graph_t >::write_EDGE_line(), and mrpt::graphs::detail::graph_ops< graph_t >::write_VERTEX_line().
|
protected |
|
protected |
Rebuild the homog matrix from the angles.
|
inlinestatic |
Definition at line 533 of file CPose3D.h.
References mrpt::format(), and static_size.
|
inline |
Get the ROLL angle (in radians)
Definition at line 393 of file CPose3D.h.
Referenced by mrpt::graphs::detail::graph_ops< graph_t >::auxEuclid2Dist(), mrpt::graphs::detail::graph_ops< graph_t >::write_EDGE_line(), and mrpt::graphs::detail::graph_ops< graph_t >::write_VERTEX_line().
|
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.
void mrpt::poses::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.
|
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.
Definition at line 330 of file CPose3D.h.
References ASSERT_ABOVEEQ_, and mrpt::math::CQuaternion< T >::rotationMatrixNoResize().
|
inline |
Sets the 3x3 rotation matrix.
|
virtual |
Set all data fields to quiet NaN.
Implements mrpt::poses::CPoseOrPoint< DERIVEDCLASS >.
|
inline |
Set the 3 angles of the 3D pose (in radians) - This method recomputes the internal rotation coordinates matrix.
|
inlinestatic |
Definition at line 530 of file CPose3D.h.
References static_size.
void mrpt::poses::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.
|
inlineinherited |
Returns the squared euclidean distance to another pose/point:
Definition at line 130 of file CPoseOrPoint.h.
References mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::is3DPoseOrPoint(), mrpt::utils::square(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y().
Referenced by mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distanceTo().
|
inlineprotected |
|
protected |
|
inlineinherited |
Definition at line 116 of file CPoseOrPoint.h.
|
inlineinherited |
Common members of all points & poses classes.
< Get X coord.
Definition at line 113 of file CPoseOrPoint.h.
Referenced by mrpt::graphs::detail::graph_ops< graph_t >::auxEuclid2Dist(), mrpt::poses::CPoint2D::CPoint2D(), mrpt::nav::PoseDistanceMetric< TNodeSE2_TP >::distance(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance2DToSquare(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance3DToSquare(), mrpt::poses::SE_traits< 2 >::exp(), mrpt::poses::CPoint< DERIVEDCLASS >::getHomogeneousMatrix(), mrpt::utils::CRobotSimulator::getX(), mrpt::opengl::graph_tools::graph_visualize(), mrpt::maps::CColouredPointsMap::insertPoint(), mrpt::maps::COctoMapBase< OCTREE, OCTREE_NODE >::internal_build_PointCloud_for_observation(), mrpt::poses::SE_traits< 2 >::ln(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::norm(), mrpt::poses::operator<(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::sqrDistanceTo(), mrpt::graphs::detail::graph_ops< graph_t >::write_EDGE_line(), and mrpt::graphs::detail::graph_ops< graph_t >::write_VERTEX_line().
|
inlineinherited |
v | Set X coord. |
Definition at line 119 of file CPoseOrPoint.h.
|
inlineinherited |
v | X+=v |
Definition at line 122 of file CPoseOrPoint.h.
|
inlineinherited |
Definition at line 117 of file CPoseOrPoint.h.
|
inlineinherited |
< Get Y coord.
Definition at line 114 of file CPoseOrPoint.h.
Referenced by mrpt::poses::CPoint< DERIVEDCLASS >::asString(), mrpt::graphs::detail::graph_ops< graph_t >::auxEuclid2Dist(), mrpt::poses::CPoint2D::CPoint2D(), mrpt::nav::PoseDistanceMetric< TNodeSE2_TP >::distance(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance2DToSquare(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::distance3DToSquare(), mrpt::poses::SE_traits< 2 >::exp(), mrpt::poses::CPoint< DERIVEDCLASS >::getHomogeneousMatrix(), mrpt::utils::CRobotSimulator::getY(), mrpt::opengl::graph_tools::graph_visualize(), mrpt::maps::CColouredPointsMap::insertPoint(), mrpt::maps::COctoMapBase< OCTREE, OCTREE_NODE >::internal_build_PointCloud_for_observation(), mrpt::poses::SE_traits< 2 >::ln(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::norm(), mrpt::poses::operator<(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::sqrDistanceTo(), mrpt::graphs::detail::graph_ops< graph_t >::write_EDGE_line(), and mrpt::graphs::detail::graph_ops< graph_t >::write_VERTEX_line().
|
inlineinherited |
v | Set Y coord. |
Definition at line 120 of file CPoseOrPoint.h.
|
inlineinherited |
v | Y+=v |
Definition at line 123 of file CPoseOrPoint.h.
|
inline |
Get the YAW angle (in radians)
Definition at line 391 of file CPose3D.h.
Referenced by mrpt::graphs::detail::graph_ops< graph_t >::auxEuclid2Dist(), mrpt::graphs::detail::graph_ops< graph_t >::write_EDGE_line(), and mrpt::graphs::detail::graph_ops< graph_t >::write_VERTEX_line().
|
staticprotected |
|
static |
|
static |
mrpt::math::CArrayDouble<3> mrpt::poses::CPose3D::m_coords |
The translation vector [x,y,z] access directly or with x(), y(), z() setter/getter methods.
Definition at line 81 of file CPose3D.h.
Referenced by mrpt::obs::detail::project3DPointsFromDepthImageInto().
|
protected |
|
protected |
The 3x3 rotation matrix, access with getRotationMatrix(), setRotationMatrix() (It's not safe to set this field as public)
Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Wed Mar 22 06:16:42 UTC 2023 |