MRPT
1.9.9
|
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 } |
using | type_value = CPose3D |
Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses. More... | |
Public Member Functions | |
void * | operator new (size_t size) |
void * | operator new[] (size_t size) |
void | operator delete (void *ptr) noexcept |
void | operator delete[] (void *ptr) noexcept |
void | operator delete (void *memory, void *ptr) noexcept |
void * | operator new (size_t size, const std::nothrow_t &) noexcept |
void | operator delete (void *ptr, const std::nothrow_t &) noexcept |
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_value & | getPoseMean () const |
type_value & | getPoseMean () |
const CPose3D & | derived () const |
CPose3D & | derived () |
virtual mxArray * | writeToMatlab () 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... | |
Constructors | |
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::CArrayDouble< 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 (const CPose3DRotVec &p) | |
Constructor from a CPose3DRotVec. More... | |
CPose3D (TConstructorFlags_Poses) | |
Fast constructor that leaves all the data uninitialized - call with UNINITIALIZED_POSE as argument. More... | |
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. 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::CMatrixDouble33 & | getRotationMatrix () 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 is the pose compounding operator. More... | |
CPoint3D | operator+ (const CPoint3D &b) const |
The operator is the pose compounding operator. More... | |
CPoint3D | operator+ (const CPoint2D &b) const |
The operator 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::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dse3=nullptr, bool use_small_rot_approx=false) const |
An alternative, slightly more efficient way of doing 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 with G and L being 3D points and P this 6D pose. More... | |
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 with G and L being 3D points and P this 6D pose. More... | |
void | inverseComposePoint (const double gx, const double gy, const double gz, double &lx, double &ly, double &lz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dse3=nullptr) const |
Computes the 3D point L such as . More... | |
void | inverseComposePoint (const mrpt::math::TPoint3D &g, mrpt::math::TPoint3D &l) 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... | |
CPose3D & | operator+= (const CPose3D &b) |
Make (b can be "this" without problems) More... | |
void | inverseComposeFrom (const CPose3D &A, const CPose3D &B) |
Makes this method is slightly more efficient than "this= A - B;" since it avoids the temporary object. More... | |
CPose3D | operator- (const CPose3D &b) const |
Compute . 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... | |
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. 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 | getAsVector (mrpt::math::CVectorDouble &v) const |
Returns a 1x6 vector with [x y z yaw pitch roll]. More... | |
void | getAsVector (mrpt::math::CArrayDouble< 6 > &v) const |
void | getAsQuaternion (mrpt::math::CQuaternionDouble &q, mrpt::math::CMatrixFixedNumeric< double, 4, 3 > *out_dq_dr=nullptr) const |
Returns the quaternion associated to the rotation of this object (NOTE: XYZ translation is ignored)
With : , and . More... | |
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.) 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... | |
RTTI classes and functions for polymorphic hierarchies | |
mrpt::rtti::CObject::Ptr | duplicateGetSmartPtr () const |
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More... | |
Static Public Member Functions | |
static void * | operator new (size_t size, void *ptr) |
static constexpr bool | is_3D () |
static constexpr 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. 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... | |
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 |
Whether yaw/pitch/roll members are up-to-date since the last rotation matrix update. More... | |
double | m_yaw |
These variables are updated every time that the object rotation matrix is modified (construction, loading from values, pose composition, etc ) More... | |
double | m_pitch |
double | m_roll |
RTTI stuff | |
using | Ptr = std::shared_ptr< CPose3D > |
using | ConstPtr = std::shared_ptr< const CPose3D > |
using | UniquePtr = std::unique_ptr< CPose3D > |
using | ConstUniquePtr = std::unique_ptr< const CPose3D > |
static mrpt::rtti::CLASSINIT | _init_CPose3D |
static const mrpt::rtti::TRuntimeClassId | runtimeClassId |
static constexpr const char * | className = "CPose3D" |
static const mrpt::rtti::TRuntimeClassId * | _GetBaseClass () |
static constexpr auto | getClassName () |
static const mrpt::rtti::TRuntimeClassId & | GetRuntimeClassIdStatic () |
static mrpt::rtti::CObject * | CreateObject () |
template<typename... Args> | |
static Ptr | Create (Args &&... args) |
template<typename... Args> | |
static UniquePtr | CreateUnique (Args &&... args) |
virtual const mrpt::rtti::TRuntimeClassId * | GetRuntimeClass () const override |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::rtti::CObject * | clone () const override |
Returns a deep copy (clone) of the object, indepently of its class. More... | |
Lie Algebra methods | |
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). More... | |
static void | exp (const mrpt::math::CArrayNumeric< double, 6 > &vect, CPose3D &out_pose, bool pseudo_exponential=false) |
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). More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
mrpt::math::CArrayDouble< 6 > | ln () const |
void | ln_jacob (mrpt::math::CMatrixFixedNumeric< double, 6, 12 > &J) const |
Jacobian of the logarithm of the 3x4 matrix defined by this pose. More... | |
mrpt::math::CArrayDouble< 3 > | ln_rotation () const |
Take the logarithm of the 3x3 rotation matrix, generating the corresponding vector in the Lie Algebra. 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 = const 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 > &b) const |
Returns the squared euclidean distance to another pose/point: More... | |
double | distanceTo (const CPoseOrPoint< OTHERCLASS > &b) const |
Returns the Euclidean distance to another pose/point: More... | |
double | distanceTo (const mrpt::math::TPoint3D &b) const |
Returns the euclidean distance to a 3D point: More... | |
double | distance2DToSquare (double ax, double ay) const |
Returns the squared 2D distance from this pose/point to a 2D point (ignores Z, if it exists). More... | |
double | distance3DToSquare (double ax, double ay, double az) const |
Returns the squared 3D distance from this pose/point to a 3D point. More... | |
double | distance2DTo (double ax, double ay) const |
Returns the 2D distance from this pose/point to a 2D point (ignores Z, if it exists). More... | |
double | distance3DTo (double ax, double ay, double az) const |
Returns the 3D distance from this pose/point to a 3D point. More... | |
double | norm () const |
Returns the euclidean norm of vector: . More... | |
mrpt::math::CVectorDouble | getAsVectorVal () const |
Return the pose or point as a 1xN vector with all the components (see derived classes for each implementation) More... | |
MATRIX44 | getHomogeneousMatrixVal () const |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation). More... | |
void | getInverseHomogeneousMatrix (MATRIX44 &out_HM) const |
Returns the corresponding 4x4 inverse homogeneous transformation matrix for this point or pose. More... | |
MATRIX44 | getInverseHomogeneousMatrixVal () const |
using mrpt::poses::CPose3D::const_reference = const double& |
using mrpt::poses::CPose3D::ConstPtr = std::shared_ptr<const CPose3D > |
using mrpt::poses::CPose3D::ConstUniquePtr = std::unique_ptr<const CPose3D > |
using mrpt::poses::CPose3D::Ptr = std::shared_ptr< CPose3D > |
using mrpt::poses::CPose3D::reference = double& |
using mrpt::poses::CPose3D::size_type = std::size_t |
Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses.
using mrpt::poses::CPose3D::UniquePtr = std::unique_ptr< CPose3D > |
using mrpt::poses::CPose3D::value_type = double |
CPose3D::CPose3D | ( | ) |
Default constructor, with all the coordinates set to zero.
Definition at line 54 of file CPose3D.cpp.
Referenced by changeCoordinatesReference(), exp(), and getOppositeScalar().
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 60 of file CPose3D.cpp.
References pitch(), roll(), setFromValues(), and yaw().
|
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 84 of file CPose3D.cpp.
References ASSERT_ABOVEEQ_, m_coords, and m_ROT.
|
explicit |
Constructor from a 4x4 homogeneous matrix:
Definition at line 94 of file CPose3D.cpp.
|
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 149 of file CPose3D.h.
References ASSERT_EQUAL_, m_coords, and m_ROT.
|
inline |
|
explicit |
Constructor from a CPose2D object.
Definition at line 73 of file CPose3D.cpp.
References setFromValues().
|
explicit |
Constructor from a CPoint3D object.
Definition at line 78 of file CPose3D.cpp.
References setFromValues().
|
explicit |
Constructor from lightweight object.
Definition at line 68 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.
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 104 of file CPose3D.cpp.
References pitch(), roll(), setFromValues(), and yaw().
|
explicit |
Constructor from a CPose3DQuat.
Constructor from a quaternion-based full pose.
Definition at line 115 of file CPose3D.cpp.
|
explicit |
Constructor from a CPose3DRotVec.
Constructor from a rotation vector-based full pose.
Definition at line 126 of file CPose3D.cpp.
References exp_rotation(), m_coords, mrpt::poses::CPose3DRotVec::m_rotvec, and setRotationMatrix().
|
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.
Definition at line 206 of file CPose3D.h.
References setFrom12Vector().
|
staticprotected |
Scalar sum of all 6 components: This is diferent from poses composition, which is implemented as "+" operators.
Definition at line 348 of file CPose3D.cpp.
References m_coords, m_pitch, m_roll, m_yaw, rebuildRotationMatrix(), and updateYawPitchRoll().
Referenced by mrpt::hmtslam::CHierarchicalMapMHPartition::getAs3DScene().
|
inline |
Returns a human-readable textual representation of the object (eg: "[x y z yaw pitch roll]", angles in degrees.)
Definition at line 600 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().
|
inline |
mrpt::math::TPose3D CPose3D::asTPose | ( | ) | const |
Definition at line 1043 of file CPose3D.cpp.
References pitch(), roll(), mrpt::poses::CPoseOrPoint< CPose3D >::x(), mrpt::poses::CPoseOrPoint< CPose3D >::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::opengl::CRenderizable::getPose(), 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::obs::CObservationGasSensors::serializeFrom(), mrpt::obs::CObservationRange::serializeFrom(), mrpt::obs::CObservationRange::setSensorPose(), and mrpt::obs::CObservationGasSensors::setSensorPose().
makes: this = p (+) this
Definition at line 403 of file CPose3D.h.
References composeFrom(), and CPose3D().
|
overridevirtual |
Returns a deep copy (clone) of the object, indepently of its class.
Implements mrpt::rtti::CObject.
Makes "this = A (+) B"; this method is slightly more efficient than "this= A + B;" since it avoids the temporary object.
Definition at line 565 of file CPose3D.cpp.
References m_coords, m_ROT, and m_ypr_uptodate.
Referenced by mrpt::vision::add_lm_increment(), mrpt::vision::add_se3_deltas_to_frames(), 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::obs::detail::project3DPointsFromDepthImageInto(), mrpt::maps::detail::loadFromRangeImpl< Derived >::templ_loadFromRangeScan(), and Pose3DTests::test_composeFrom().
void CPose3D::composePoint | ( | double | lx, |
double | ly, | ||
double | lz, | ||
double & | gx, | ||
double & | gy, | ||
double & | gz, | ||
mrpt::math::CMatrixFixedNumeric< double, 3, 3 > * | out_jacobian_df_dpoint = nullptr , |
||
mrpt::math::CMatrixFixedNumeric< double, 3, 6 > * | out_jacobian_df_dpose = nullptr , |
||
mrpt::math::CMatrixFixedNumeric< double, 3, 6 > * | out_jacobian_df_dse3 = nullptr , |
||
bool | use_small_rot_approx = false |
||
) | const |
An alternative, slightly more efficient way of doing 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.
If | set to true, the Jacobian "out_jacobian_df_dpose" uses a fastest linearized appoximation (valid only for small rotations!). |
Definition at line 379 of file CPose3D.cpp.
References mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::loadFromArray(), m_coords, m_pitch, m_roll, m_ROT, m_yaw, MRPT_MAX_ALIGN_BYTES, and updateYawPitchRoll().
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(), generatePolygon(), mrpt::opengl::CAssimpModel::getBoundingBox(), mrpt::opengl::CBox::getBoundingBox(), mrpt::opengl::CSimpleLine::getBoundingBox(), mrpt::opengl::CTexturedPlane::getBoundingBox(), mrpt::opengl::CGridPlaneXY::getBoundingBox(), mrpt::opengl::CText3D::getBoundingBox(), mrpt::opengl::CGridPlaneXZ::getBoundingBox(), mrpt::opengl::CFrustum::getBoundingBox(), mrpt::opengl::CPlanarLaserScan::getBoundingBox(), mrpt::opengl::CPolyhedron::getBoundingBox(), mrpt::opengl::CSetOfLines::getBoundingBox(), mrpt::opengl::CVectorField2D::getBoundingBox(), mrpt::opengl::CVectorField3D::getBoundingBox(), mrpt::opengl::CPolyhedron::getSetOfPolygonsAbsolute(), mrpt::maps::CPointsMap::insertAnotherMap(), mrpt::maps::COctoMapBase< octomap::OcTree, octomap::OcTreeNode >::internal_build_PointCloud_for_observation(), mrpt::maps::CPointsMap::internal_computeObservationLikelihood(), mrpt::maps::CColouredOctoMap::internal_insertObservation(), mrpt::maps::CPointsMap::internal_insertObservation(), mrpt::vision::pointJac(), project_point(), mrpt::vision::pinhole::projectPoint_no_distortion(), mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::render_dl(), Pose3DTests::test_composePoint(), Pose3DQuatTests::test_composePoint_vs_CPose3D(), and Pose3DTests::test_composePointJacob().
|
inline |
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose.
Definition at line 300 of file CPose3D.h.
References composePoint(), mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
|
inline |
This version of the method assumes that the resulting point has no Z component (use with caution!)
Definition at line 310 of file CPose3D.h.
References composePoint(), 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 with G and L being 3D points and P this 6D pose.
Definition at line 322 of file CPose3D.h.
References composePoint().
|
inlinestatic |
|
static |
|
inlinestatic |
|
inlineinherited |
Definition at line 131 of file CPoseOrPoint.h.
|
inlineinherited |
Definition at line 135 of file CPoseOrPoint.h.
|
inlineinherited |
Returns the 2D distance from this pose/point to a 2D point (ignores Z, if it exists).
Definition at line 234 of file CPoseOrPoint.h.
|
inlineinherited |
Returns the squared 2D distance from this pose/point to a 2D point (ignores Z, if it exists).
Definition at line 218 of file CPoseOrPoint.h.
|
inlineinherited |
Returns the 3D distance from this pose/point to a 3D point.
Definition at line 240 of file CPoseOrPoint.h.
|
inlineinherited |
Returns the squared 3D distance from this pose/point to a 3D point.
Definition at line 225 of file CPoseOrPoint.h.
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 363 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().
|
inlineinherited |
Returns the Euclidean distance to another pose/point:
Definition at line 211 of file CPoseOrPoint.h.
|
inlineinherited |
Returns the euclidean distance to a 3D point:
Definition at line 246 of file CPoseOrPoint.h.
|
inlineinherited |
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).
Definition at line 168 of file CObject.h.
References mrpt::rtti::CObject::clone().
Referenced by mrpt::obs::CRawlog::addActions(), and mrpt::obs::CRawlog::addObservations().
|
inlinestatic |
|
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). |
Definition at line 758 of file CPose3D.cpp.
References mrpt::poses::UNINITIALIZED_POSE.
Referenced by mrpt::poses::SE_traits< 3 >::exp(), mrpt::vision::CDifodo::filterLevelSolution(), Pose3DTests::func_compose_point_se3(), Pose3DTests::func_invcompose_point_se3(), Pose3DTests::func_jacob_Aexpe_D(), Pose3DTests::func_jacob_expe_D(), Pose3DTests::func_jacob_expe_e(), mrpt::pbmap::ConsistencyTest::getRTwithModel(), mrpt::poses::SE_traits< 3 >::pseudo_exp(), and Pose3DTests::test_ExpLnEqual().
|
static |
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 766 of file CPose3D.cpp.
References CPose3D(), R, setRotationMatrix(), mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::x(), and mrpt::poses::CPoseOrPoint< DERIVEDCLASS >::y().
|
static |
Exponentiate a vector in the Lie algebra to generate a new SO(3) (a 3x3 rotation matrix).
Definition at line 794 of file CPose3D.cpp.
References R.
Referenced by CPose3D(), and mrpt::poses::CPose3DRotVec::getRotationMatrix().
|
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 620 of file CPose3D.h.
References ASSERTMSG_, mrpt::DEG2RAD(), setFromValues(), and THROW_EXCEPTION.
Referenced by fromStringRaw(), and mrpt::hwdrivers::CKinect::loadConfig_sensorSpecific().
|
inline |
Same as fromString, but without requiring the square brackets in the string.
Definition at line 634 of file CPose3D.h.
References fromString().
|
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.
Definition at line 503 of file CPose3D.h.
References m_coords, and m_ROT.
Referenced by Pose3DTests::func_jacob_Aexpe_D(), Pose3DTests::func_jacob_expe_D(), and TEST().
void CPose3D::getAsQuaternion | ( | mrpt::math::CQuaternionDouble & | q, |
mrpt::math::CMatrixFixedNumeric< double, 4, 3 > * | out_dq_dr = nullptr |
||
) | const |
Returns the quaternion associated to the rotation of this object (NOTE: XYZ translation is ignored)
With : , and .
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). |
Definition at line 510 of file CPose3D.cpp.
References mrpt::math::TPose3D::getAsQuaternion(), m_pitch, m_roll, m_yaw, and updateYawPitchRoll().
Referenced by mrpt::poses::CPose3DQuatPDFGaussian::copyFrom(), mrpt::poses::CPose3DPDF::jacobiansPoseComposition(), TEST_F(), QuaternionTests::test_gimbalLock(), QuaternionTests::test_lnAndExpMatches(), and Pose3DQuatTests::test_normalizeJacob().
void CPose3D::getAsVector | ( | mrpt::math::CVectorDouble & | v | ) | const |
Returns a 1x6 vector with [x y z yaw pitch roll].
Definition at line 477 of file CPose3D.cpp.
References m_coords, m_pitch, m_roll, m_yaw, and updateYawPitchRoll().
void 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.
Definition at line 489 of file CPose3D.cpp.
References m_coords, m_pitch, m_roll, m_yaw, and updateYawPitchRoll().
|
inlineinherited |
Return the pose or point as a 1xN vector with all the components (see derived classes for each implementation)
Definition at line 263 of file CPoseOrPoint.h.
|
inlinestatic |
|
inline |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation).
Definition at line 221 of file CPose3D.h.
References m_coords, and m_ROT.
Referenced by mrpt::maps::CLandmarksMap::changeCoordinatesReference(), mrpt::maps::CLandmarksMap::compute3DMatchingRatio(), mrpt::vision::computeMsd(), mrpt::vision::computeStereoRectificationMaps(), mrpt::poses::CPose3DRotVec::CPose3DRotVec(), mrpt::vision::CDifodo::filterLevelSolution(), mrpt::pbmap::ConsistencyTest::getRTwithModel(), mrpt::maps::COctoMapBase< octomap::OcTree, octomap::OcTreeNode >::internal_build_PointCloud_for_observation(), mrpt::maps::CPointsMap::loadFromVelodyneScan(), and mrpt::maps::detail::loadFromRangeImpl< Derived >::templ_loadFromRangeScan().
|
inlineinherited |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation).
Definition at line 275 of file CPoseOrPoint.h.
|
inlineinherited |
Returns the corresponding 4x4 inverse homogeneous transformation matrix for this point or pose.
Definition at line 287 of file CPoseOrPoint.h.
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 295 of file CPoseOrPoint.h.
CPose3D CPose3D::getOppositeScalar | ( | ) | const |
|
inline |
|
inline |
|
inline |
Get the 3x3 rotation matrix.
Definition at line 230 of file CPose3D.h.
References m_ROT.
Referenced by mrpt::poses::CPoint2DPDFGaussian::changeCoordinatesReference(), mrpt::poses::CPointPDFGaussian::changeCoordinatesReference(), mrpt::poses::ddeltaRt_dR(), mrpt::obs::CObservation3DRangeScan::doDepthAndIntensityCamerasCoincide(), mrpt::poses::dVinvt_dR(), mrpt::vision::frameJac(), jacob_dA_eps_D_p_deps(), jacob_dAexpeD_de(), mrpt::poses::operator!=(), mrpt::poses::operator==(), mrpt::vision::CDifodo::poseUpdate(), mrpt::obs::detail::project3DPointsFromDepthImageInto(), mrpt::opengl::COpenGLViewport::render(), mrpt::opengl::gl_utils::renderSetOfObjects(), run_test_so3_avrg(), TEST(), and QuaternionTests::test_toYPRAndBack().
|
inline |
|
overridevirtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::serialization::CSerializable.
|
static |
void CPose3D::getYawPitchRoll | ( | double & | yaw, |
double & | pitch, | ||
double & | roll | ||
) | const |
Returns the three angles (yaw, pitch, roll), in radians, from the rotation matrix.
Definition at line 306 of file CPose3D.cpp.
References m_ROT, pitch(), roll(), and yaw().
Referenced by updateYawPitchRoll().
void CPose3D::inverse | ( | ) |
Convert this pose into its inverse, saving the result in itself.
Definition at line 593 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().
Makes this method is slightly more efficient than "this= A - B;" since it avoids the temporary object.
Definition at line 621 of file CPose3D.cpp.
References mrpt::math::homogeneousMatrixInverse(), m_coords, m_ROT, m_ypr_uptodate, and mrpt::math::UNINITIALIZED_MATRIX.
Referenced by operator-().
void 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 = nullptr , |
||
mrpt::math::CMatrixFixedNumeric< double, 3, 6 > * | out_jacobian_df_dpose = nullptr , |
||
mrpt::math::CMatrixFixedNumeric< double, 3, 6 > * | out_jacobian_df_dse3 = nullptr |
||
) | 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.
Definition at line 649 of file CPose3D.cpp.
References mrpt::math::homogeneousMatrixInverse(), mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::loadFromArray(), m_coords, m_pitch, m_roll, m_ROT, m_yaw, MRPT_MAX_ALIGN_BYTES, mrpt::math::UNINITIALIZED_MATRIX, and updateYawPitchRoll().
Referenced by mrpt::vision::frameJac(), 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(), Pose3DQuatTests::test_invComposePoint_vs_CPose3D(), and Pose3DTests::test_invComposePointJacob().
|
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 352 of file CPose3D.h.
References inverseComposePoint(), mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
|
inline |
overload for 2D points
If | the z component of the result is greater than some epsilon |
Definition at line 360 of file CPose3D.h.
References ASSERT_BELOW_, eps, inverseComposePoint(), mrpt::math::TPoint2D::x, and mrpt::math::TPoint2D::y.
|
inlinestaticinherited |
Return true for poses or points with a Z component, false otherwise.
Definition at line 177 of file CPoseOrPoint.h.
|
inlinestatic |
|
inlinestatic |
Definition at line 740 of file CPose3D.h.
References is_PDF_val.
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 608 of file CPose3D.cpp.
References M_PI, m_pitch, m_roll, updateYawPitchRoll(), and mrpt::math::wrapToPi().
Referenced by mrpt::maps::CPointsMap::internal_computeObservationLikelihood().
|
static |
The Jacobian d (A * e^eps * D) / d eps , with eps=increment in Lie Algebra.
Definition at line 1017 of file CPose3D.cpp.
References getRotationMatrix(), m_coords, m_ROT, and mrpt::math::skew_symmetric3_neg().
Referenced by Pose3DTests::test_Jacob_dAexpeD_de().
The Jacobian d (e^eps * D) / d eps , with eps=increment in Lie Algebra.
Definition at line 997 of file CPose3D.cpp.
References m_coords, m_ROT, and mrpt::math::skew_symmetric3_neg().
Referenced by Pose3DTests::test_Jacob_dexpeD_de().
void 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.
Definition at line 801 of file CPose3D.cpp.
References m_coords, and m_ROT.
Referenced by mrpt::poses::SE_traits< 3 >::ln(), and Pose3DTests::test_ExpLnEqual().
|
inline |
void CPose3D::ln_jacob | ( | mrpt::math::CMatrixFixedNumeric< double, 6, 12 > & | J | ) | const |
Jacobian of the logarithm of the 3x4 matrix defined by this pose.
Definition at line 905 of file CPose3D.cpp.
References mrpt::poses::deltaR(), mrpt::poses::dVinvt_dR(), ln_rot_jacob(), m_ROT, R, mrpt::math::skew_symmetric3(), mrpt::square(), and mrpt::math::UNINITIALIZED_MATRIX.
|
static |
Static function to compute the Jacobian of the SO(3) Logarithm function, evaluated at a given 3x3 rotation matrix R.
Definition at line 972 of file CPose3D.cpp.
References mrpt::poses::deltaR(), mrpt::poses::M3x9(), R, mrpt::square(), and mrpt::math::UNINITIALIZED_MATRIX.
Referenced by ln_jacob().
CArrayDouble< 3 > CPose3D::ln_rotation | ( | ) | const |
Take the logarithm of the 3x3 rotation matrix, generating the corresponding vector in the Lie Algebra.
Definition at line 785 of file CPose3D.cpp.
Referenced by mrpt::poses::CPose3DRotVec::composeFrom(), mrpt::poses::CPose3DRotVec::rotVecFromRotMat(), and mrpt::poses::CPose3DRotVec::setFromXYZAndAngles().
|
inlinestatic |
Definition at line 759 of file CPose3D.h.
References static_size.
|
inlineinherited |
Returns the euclidean norm of vector: .
Definition at line 253 of file CPoseOrPoint.h.
void CPose3D::normalizeAngles | ( | ) |
Rebuild the internal matrix & update the yaw/pitch/roll angles within the ]-PI,PI] range (Must be called after using addComponents)
Definition at line 235 of file CPose3D.cpp.
References updateYawPitchRoll().
Referenced by mrpt::hmtslam::CHierarchicalMapMHPartition::getAs3DScene().
|
inline |
|
inlinenoexcept |
|
inline |
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 291 of file CPose3D.cpp.
References m_coords, m_pitch, m_roll, m_yaw, rebuildRotationMatrix(), and updateYawPitchRoll().
The operator is the pose compounding operator.
Definition at line 254 of file CPose3D.h.
References composeFrom(), and mrpt::poses::UNINITIALIZED_POSE.
The operator is the pose compounding operator.
Definition at line 540 of file CPose3D.cpp.
The operator is the pose compounding operator.
Definition at line 554 of file CPose3D.cpp.
Make (b can be "this" without problems)
Definition at line 377 of file CPose3D.h.
References composeFrom().
Compute .
Definition at line 391 of file CPose3D.h.
References inverseComposeFrom(), and mrpt::poses::UNINITIALIZED_POSE.
|
inline |
|
inline |
Get the PITCH angle (in radians)
Definition at line 532 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::CPose3DPDFGaussianInf::saveToTextFile(), mrpt::poses::CPose3DPDFGaussian::saveToTextFile(), mrpt::tfest::se3_l2_robust(), mrpt::opengl::CDisk::traceRay(), mrpt::graphs::detail::graph_ops< graph_t >::write_EDGE_line(), and mrpt::opengl::CRenderizable::writeToStreamRender().
|
protected |
Rebuild the homog matrix from the angles.
Definition at line 258 of file CPose3D.cpp.
References mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::loadFromArray(), m_pitch, m_roll, m_ROT, m_yaw, and MRPT_MAX_ALIGN_BYTES.
Referenced by addComponents(), operator*=(), and setFromValues().
|
inlinestatic |
Definition at line 760 of file CPose3D.h.
References mrpt::format(), and static_size.
|
inline |
Get the ROLL angle (in radians)
Definition at line 538 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::CPose3DPDFGaussianInf::saveToTextFile(), mrpt::poses::CPose3DPDFGaussian::saveToTextFile(), mrpt::tfest::se3_l2_robust(), mrpt::opengl::CDisk::traceRay(), mrpt::graphs::detail::graph_ops< graph_t >::write_EDGE_line(), and mrpt::opengl::CRenderizable::writeToStreamRender().
|
overrideprotectedvirtual |
Pure virtual method for reading (deserializing) from an abstract archive.
Users don't call this method directly. Instead, use stream >> object;
.
in | The input binary stream where the object data must read from. |
version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
std::exception | On any I/O error |
Implements mrpt::serialization::CSerializable.
Definition at line 143 of file CPose3D.cpp.
References ASSERT_, m_coords, m_ROT, m_ypr_uptodate, MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, and mrpt::math::UNINITIALIZED_QUATERNION.
|
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 136 of file CPose3D.cpp.
|
overrideprotectedvirtual |
Pure virtual method for writing (serializing) to an abstract archive.
Users don't call this method directly. Instead, use stream << object;
.
std::exception | On any I/O error |
Implements mrpt::serialization::CSerializable.
Definition at line 137 of file CPose3D.cpp.
|
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.
Definition at line 479 of file CPose3D.h.
References m_coords, m_ROT, and m_ypr_uptodate.
Referenced by CPose3D().
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.
Definition at line 239 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::CPose3DPDFGaussianInf::drawSingleSample(), mrpt::poses::CPose3DPDFGaussian::drawSingleSample(), fromString(), mrpt::hwdrivers::CIMUXSens_MT4::loadConfig_sensorSpecific(), mrpt::hwdrivers::CIMUXSens::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSkeletonTracker::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGyroKVHDSP3000::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(), mrpt::opengl::CRenderizable::setPose(), and setYawPitchRoll().
|
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 448 of file CPose3D.h.
References ASSERT_ABOVEEQ_, m_coords, m_ROT, and m_ypr_uptodate.
|
inline |
Sets the 3x3 rotation matrix.
Definition at line 242 of file CPose3D.h.
References m_ROT, and m_ypr_uptodate.
Referenced by mrpt::poses::CPose3DRotVec::composeFrom(), CPose3D(), exp(), and mrpt::vision::CStereoRectifyMap::setFromCamParams().
|
overridevirtual |
Set all data fields to quiet NaN.
Implements mrpt::poses::CPoseOrPoint< CPose3D >.
Definition at line 1033 of file CPose3D.cpp.
|
inline |
Set the 3 angles of the 3D pose (in radians) - This method recomputes the internal rotation coordinates matrix.
Definition at line 466 of file CPose3D.h.
References setFromValues(), mrpt::poses::CPoseOrPoint< CPose3D >::x(), and mrpt::poses::CPoseOrPoint< CPose3D >::y().
Referenced by mrpt::opengl::CRenderizable::readFromStreamRender().
|
inlinestatic |
Definition at line 757 of file CPose3D.h.
References static_size.
Referenced by mrpt::obs::CObservation2DRangeScan::truncateByDistanceAndAngle().
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 314 of file CPose3D.cpp.
References inverseComposePoint(), local, mrpt::math::TPoint3D::x, mrpt::math::TPoint3D::y, and mrpt::math::TPoint3D::z.
Referenced by mrpt::maps::CLandmarksMap::simulateRangeBearingReadings(), and Pose3DQuatTests::test_invComposePoint_vs_CPose3D().
|
inlineinherited |
Returns the squared euclidean distance to another pose/point:
Definition at line 184 of file CPoseOrPoint.h.
|
inlineprotected |
Updates Yaw/pitch/roll members from the m_ROT.
Definition at line 115 of file CPose3D.h.
References getYawPitchRoll(), m_pitch, m_roll, m_yaw, and m_ypr_uptodate.
Referenced by addComponents(), asString(), composePoint(), distanceEuclidean6D(), getAsQuaternion(), getAsVector(), inverseComposePoint(), isHorizontal(), normalizeAngles(), operator*=(), operator[](), pitch(), roll(), and yaw().
|
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.
mxArray
(caller is responsible of memory freeing) or nullptr is class does not support conversion to MATLAB. Definition at line 68 of file CSerializable.h.
|
inlineinherited |
Common members of all points & poses classes.
< Get X coord.
Definition at line 140 of file CPoseOrPoint.h.
Referenced by asTPose(), and setYawPitchRoll().
|
inlineinherited |
Definition at line 149 of file CPoseOrPoint.h.
|
inlineinherited |
v | Set X coord. |
Definition at line 158 of file CPoseOrPoint.h.
|
inlineinherited |
v | X+=v |
Definition at line 167 of file CPoseOrPoint.h.
|
inlineinherited |
< Get Y coord.
Definition at line 144 of file CPoseOrPoint.h.
Referenced by asTPose(), and setYawPitchRoll().
|
inlineinherited |
Definition at line 153 of file CPoseOrPoint.h.
|
inlineinherited |
v | Set Y coord. |
Definition at line 162 of file CPoseOrPoint.h.
|
inlineinherited |
v | Y+=v |
Definition at line 171 of file CPoseOrPoint.h.
|
inline |
Get the YAW angle (in radians)
Definition at line 526 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::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::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::prediction_and_update_pfOptimalProposal(), mrpt::slam::CMetricMapBuilderRBPF::processActionObservation(), mrpt::hmtslam::CLSLAM_RBPF_2DLASER::processOneLMH(), mrpt::poses::CPose3DPDFGaussianInf::saveToTextFile(), mrpt::poses::CPose3DPDFGaussian::saveToTextFile(), mrpt::tfest::se3_l2_robust(), Pose3DTests::test_to_from_2d(), mrpt::opengl::CDisk::traceRay(), mrpt::graphs::detail::graph_ops< graph_t >::write_EDGE_line(), and mrpt::opengl::CRenderizable::writeToStreamRender().
|
staticprotected |
|
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 96 of file CPose3D.h.
Referenced by addComponents(), asString(), composeFrom(), composePoint(), CPose3D(), mrpt::poses::ddeltaRt_dR(), distanceEuclidean6D(), mrpt::obs::CObservation3DRangeScan::doDepthAndIntensityCamerasCoincide(), mrpt::poses::dVinvt_dR(), getAs12Vector(), getAsVector(), getHomogeneousMatrix(), getOppositeScalar(), inverse(), inverseComposeFrom(), inverseComposePoint(), jacob_dAexpeD_de(), jacob_dexpeD_de(), ln(), mrpt::poses::operator!=(), operator*=(), operator+(), mrpt::poses::operator==(), operator[](), mrpt::obs::detail::project3DPointsFromDepthImageInto(), mrpt::opengl::gl_utils::renderSetOfObjects(), serializeFrom(), setFrom12Vector(), setFromValues(), mrpt::poses::CPose3DRotVec::setFromXYZAndAngles(), setFromXYZQ(), and setToNaN().
|
mutableprotected |
Definition at line 109 of file CPose3D.h.
Referenced by addComponents(), asString(), composePoint(), distanceEuclidean6D(), getAsQuaternion(), getAsVector(), getOppositeScalar(), inverseComposePoint(), isHorizontal(), operator*=(), operator[](), pitch(), rebuildRotationMatrix(), setFromValues(), and updateYawPitchRoll().
|
mutableprotected |
Definition at line 109 of file CPose3D.h.
Referenced by addComponents(), asString(), composePoint(), distanceEuclidean6D(), getAsQuaternion(), getAsVector(), getOppositeScalar(), inverseComposePoint(), isHorizontal(), operator*=(), operator[](), rebuildRotationMatrix(), roll(), setFromValues(), and updateYawPitchRoll().
|
protected |
The 3x3 rotation matrix, access with getRotationMatrix(), setRotationMatrix() (It's not safe to set this field as public)
Definition at line 101 of file CPose3D.h.
Referenced by composeFrom(), composePoint(), CPose3D(), getAs12Vector(), getHomogeneousMatrix(), getRotationMatrix(), getYawPitchRoll(), inverse(), inverseComposeFrom(), inverseComposePoint(), jacob_dAexpeD_de(), jacob_dexpeD_de(), ln(), ln_jacob(), ln_rotation(), operator+(), rebuildRotationMatrix(), serializeFrom(), setFrom12Vector(), setFromXYZQ(), setRotationMatrix(), and setToNaN().
|
mutableprotected |
These variables are updated every time that the object rotation matrix is modified (construction, loading from values, pose composition, etc )
Definition at line 109 of file CPose3D.h.
Referenced by addComponents(), asString(), composePoint(), distanceEuclidean6D(), getAsQuaternion(), getAsVector(), getOppositeScalar(), inverseComposePoint(), operator*=(), operator[](), rebuildRotationMatrix(), setFromValues(), updateYawPitchRoll(), and yaw().
|
mutableprotected |
Whether yaw/pitch/roll members are up-to-date since the last rotation matrix update.
Definition at line 105 of file CPose3D.h.
Referenced by composeFrom(), inverse(), inverseComposeFrom(), serializeFrom(), setFrom12Vector(), setFromValues(), setFromXYZQ(), setRotationMatrix(), and updateYawPitchRoll().
|
staticprotected |
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020 |