MRPT
2.0.4
|
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
For a complete description of Points/Poses, see mrpt::poses::CPoseOrPoint, or refer to the 2D/3D Geometry tutorial in the wiki.
To access the translation use x(), y() and z(). To access the rotation, use CPose3DQuat::quat().
This class also behaves like a STL container, since it has begin(), end(), iterators, and can be accessed with the [] operator with indices running from 0 to 6 to access the [x y z qr qx qy qz] as if they were a vector. Thus, a CPose3DQuat can be used as a 7-vector anywhere the MRPT math functions expect any kind of vector.
This class and CPose3D are very similar, and they can be converted to the each other automatically via transformation constructors.
Definition at line 45 of file CPose3DQuat.h.
#include <mrpt/poses/CPose3DQuat.h>
Classes | |
struct | const_iterator |
struct | iterator |
Public Types | |
enum | { is_3D_val = 1 } |
enum | { rotation_dimensions = 3 } |
enum | { is_PDF_val = 1 } |
using | type_value = CPose3DQuat |
Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses. More... | |
using | vector_t = mrpt::math::CVectorFixedDouble< DIM > |
Fixed-size vector of the correct size to hold all the coordinates of the point/pose. More... | |
Public Member Functions | |
mrpt::math::CQuaternionDouble & | quat () |
Read/Write access to the quaternion representing the 3D rotation. More... | |
const mrpt::math::CQuaternionDouble & | quat () const |
Read-only access to the quaternion representing the 3D rotation. More... | |
mrpt::math::CVectorFixedDouble< 3 > & | xyz () |
Read/Write access to the translation vector in R^3. More... | |
const mrpt::math::CVectorFixedDouble< 3 > & | xyz () const |
Read-only access to the translation vector in R^3. More... | |
CPose3DQuat () | |
Default constructor, initialize translation to zeros and quaternion to no rotation. More... | |
CPose3DQuat (mrpt::math::TConstructorFlags_Quaternions) | |
Constructor which left all the quaternion members un-initialized, for use when speed is critical; Use UNINITIALIZED_POSE as argument to this constructor. More... | |
CPose3DQuat (TConstructorFlags_Poses) | |
CPose3DQuat (const double x, const double y, const double z, const mrpt::math::CQuaternionDouble &q) | |
Constructor with initilization of the pose - the quaternion is normalized to make sure it's unitary. More... | |
CPose3DQuat (const CPose3D &p) | |
Constructor from a CPose3D. More... | |
CPose3DQuat (const mrpt::math::TPose3DQuat &p) | |
Constructor from lightweight object. More... | |
mrpt::math::TPose3DQuat | asTPose () const |
CPose3DQuat (const mrpt::math::CMatrixDouble44 &M) | |
Constructor from a 4x4 homogeneous transformation matrix. More... | |
void | getHomogeneousMatrix (mrpt::math::CMatrixDouble44 &out_HM) const |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation). More... | |
void | asVector (vector_t &v) const |
Returns a 7x1 vector with [x y z qr qx qy qz]'. More... | |
void | composeFrom (const CPose3DQuat &A, const CPose3DQuat &B) |
Makes this method is slightly more efficient than "this= A + B;" since it avoids the temporary object. More... | |
void | inverseComposeFrom (const CPose3DQuat &A, const CPose3DQuat &B) |
Makes this method is slightly more efficient than "this= A - B;" since it avoids the temporary object. More... | |
void | composePoint (const double lx, const double ly, const double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixed< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixed< double, 3, 7 > *out_jacobian_df_dpose=nullptr) const |
Computes the 3D point G such as . More... | |
void | inverseComposePoint (const double gx, const double gy, const double gz, double &lx, double &ly, double &lz, mrpt::math::CMatrixFixed< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixed< double, 3, 7 > *out_jacobian_df_dpose=nullptr) const |
Computes the 3D point L such as . More... | |
template<class POINT1 , class POINT2 > | |
void | composePoint (const POINT1 &L, POINT2 &G) const |
Computes the 3D point G such as . More... | |
template<class POINT1 , class POINT2 > | |
void | inverseComposePoint (const POINT1 &G, POINT2 &L) const |
Computes the 3D point L such as . More... | |
CPoint3D | operator+ (const CPoint3D &L) const |
Computes the 3D point G such as . More... | |
mrpt::math::TPoint3D | operator+ (const mrpt::math::TPoint3D &L) const |
Computes the 3D point G such as . More... | |
virtual void | operator*= (const double s) |
Scalar multiplication (all x y z qr qx qy qz elements are multiplied by the scalar). More... | |
CPose3DQuat & | operator+= (const CPose3DQuat &b) |
Make . More... | |
CPose3DQuat | operator+ (const CPose3DQuat &p) const |
Return the composed pose . More... | |
CPose3DQuat & | operator-= (const CPose3DQuat &b) |
Make . More... | |
CPose3DQuat | operator- (const CPose3DQuat &p) const |
Return the composed pose . More... | |
void | inverse () |
Convert this pose into its inverse, saving the result in itself. More... | |
void | asString (std::string &s) const |
Returns a human-readable textual representation of the object (eg: "[x y
z qr qx qy qz]", angles in degrees.) More... | |
std::string | asString () const |
void | fromString (const std::string &s) |
Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -0.8 1 0 0 0]" ) More... | |
void | fromStringRaw (const std::string &s) |
Same as fromString, but without requiring the square brackets in the string. More... | |
double | operator[] (unsigned int i) const |
Read only [] operator. More... | |
double & | operator[] (unsigned int i) |
Read/write [] operator. More... | |
void | sphericalCoordinates (const mrpt::math::TPoint3D &point, double &out_range, double &out_yaw, double &out_pitch, mrpt::math::CMatrixFixed< double, 3, 3 > *out_jacob_dryp_dpoint=nullptr, mrpt::math::CMatrixFixed< double, 3, 7 > *out_jacob_dryp_dpose=nullptr) const |
Computes the spherical coordinates of a 3D point as seen from the 6D pose specified by this object. More... | |
const type_value & | getPoseMean () const |
type_value & | getPoseMean () |
void | setToNaN () override |
Set all data fields to quiet NaN. More... | |
const CPose3DQuat & | derived () const |
CPose3DQuat & | 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... | |
RTTI classes and functions for polymorphic hierarchies | |
mrpt::rtti::CObject::Ptr | duplicateGetSmartPtr () const |
Makes a deep copy of the object and returns a smart pointer to it. More... | |
Static Public Member Functions | |
static CPose3DQuat | FromString (const std::string &s) |
static constexpr bool | is_3D () |
static constexpr bool | is_PDF () |
Public Attributes | |
mrpt::math::CVectorFixedDouble< 3 > | m_coords |
The translation vector [x,y,z]. More... | |
mrpt::math::CQuaternionDouble | m_quat |
The quaternion. More... | |
Protected Member Functions | |
CSerializable virtual methods | |
uint8_t | serializeGetVersion () const override |
Must return the current versioning number of the object. More... | |
void | serializeTo (mrpt::serialization::CArchive &out) const override |
Serialize CSerializable Object to CSchemeArchiveBase derived object. More... | |
void | serializeFrom (mrpt::serialization::CArchive &in, uint8_t serial_version) override |
Serialize CSchemeArchiveBase derived object to CSerializable Object. More... | |
CSerializable virtual methods | |
virtual void | serializeTo (CSchemeArchiveBase &out) const |
Virtual method for writing (serializing) to an abstract schema based archive. More... | |
virtual void | serializeFrom (CSchemeArchiveBase &in) |
Virtual method for reading (deserializing) from an abstract schema based archive. More... | |
RTTI stuff | |
using | Ptr = std::shared_ptr< mrpt::poses ::CPose3DQuat > |
using | ConstPtr = std::shared_ptr< const mrpt::poses ::CPose3DQuat > |
using | UniquePtr = std::unique_ptr< mrpt::poses ::CPose3DQuat > |
using | ConstUniquePtr = std::unique_ptr< const mrpt::poses ::CPose3DQuat > |
static const mrpt::rtti::TRuntimeClassId | runtimeClassId |
static constexpr const char * | className = "mrpt::poses" "::" "CPose3DQuat" |
static const mrpt::rtti::TRuntimeClassId * | _GetBaseClass () |
static constexpr auto | getClassName () |
static const mrpt::rtti::TRuntimeClassId & | GetRuntimeClassIdStatic () |
static std::shared_ptr< CObject > | CreateObject () |
template<typename... Args> | |
static Ptr | Create (Args &&... args) |
template<typename Alloc , typename... Args> | |
static Ptr | CreateAlloc (const Alloc &alloc, Args &&... args) |
template<typename... Args> | |
static UniquePtr | CreateUnique (Args &&... args) |
virtual const mrpt::rtti::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... | |
STL-like methods and typedefs | |
enum | { static_size = 7 } |
using | value_type = double |
The type of the elements. More... | |
using | reference = double & |
using | const_reference = double |
using | size_type = std::size_t |
using | difference_type = std::ptrdiff_t |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
static constexpr size_type | size () |
static constexpr bool | empty () |
static constexpr size_type | max_size () |
static void | resize (const size_t n) |
void | assign (const size_t N, const double val) |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
void | swap (CPose3DQuat &o) |
static bool | is3DPoseOrPoint () |
Return true for poses or points with a Z component, false otherwise. More... | |
double | x () const |
Common members of all points & poses classes. More... | |
double & | x () |
void | x (const double v) |
double | y () const |
double & | y () |
void | y (const double v) |
void | x_incr (const double v) |
void | y_incr (const double v) |
double | sqrDistanceTo (const CPoseOrPoint< OTHERCLASS, DIM2 > &b) const |
Returns the squared euclidean distance to another pose/point: More... | |
double | distanceTo (const CPoseOrPoint< OTHERCLASS, DIM2 > &b) const |
Returns the Euclidean distance to another pose/point: More... | |
double | distanceTo (const mrpt::math::TPoint3D &b) const |
Returns the euclidean distance to a 3D point: More... | |
double | distance2DToSquare (double ax, double ay) const |
Returns the squared 2D distance from this pose/point to a 2D point (ignores Z, if it exists). More... | |
double | distance3DToSquare (double ax, double ay, double az) const |
Returns the squared 3D distance from this pose/point to a 3D point. More... | |
double | distance2DTo (double ax, double ay) const |
Returns the 2D distance from this pose/point to a 2D point (ignores Z, if it exists). More... | |
double | distance3DTo (double ax, double ay, double az) const |
Returns the 3D distance from this pose/point to a 3D point. More... | |
double | norm () const |
Returns the euclidean norm of vector: . More... | |
vector_t | asVectorVal () const |
Return the pose or point as a 1xN vector with all the components (see derived classes for each implementation) More... | |
MATRIX44 | getHomogeneousMatrixVal () const |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation). More... | |
void | getInverseHomogeneousMatrix (MATRIX44 &out_HM) const |
Returns the corresponding 4x4 inverse homogeneous transformation matrix for this point or pose. More... | |
MATRIX44 | getInverseHomogeneousMatrixVal () const |
using mrpt::poses::CPose3DQuat::const_reference = double |
Definition at line 359 of file CPose3DQuat.h.
using mrpt::poses::CPose3DQuat::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 607 of file CPose3DQuat.h.
using mrpt::poses::CPose3DQuat::ConstPtr = std::shared_ptr<const mrpt::poses :: CPose3DQuat > |
Definition at line 48 of file CPose3DQuat.h.
using mrpt::poses::CPose3DQuat::ConstUniquePtr = std::unique_ptr<const mrpt::poses :: CPose3DQuat > |
Definition at line 48 of file CPose3DQuat.h.
using mrpt::poses::CPose3DQuat::difference_type = std::ptrdiff_t |
Definition at line 361 of file CPose3DQuat.h.
using mrpt::poses::CPose3DQuat::Ptr = std::shared_ptr< mrpt::poses :: CPose3DQuat > |
A type for the associated smart pointer
Definition at line 48 of file CPose3DQuat.h.
using mrpt::poses::CPose3DQuat::reference = double& |
Definition at line 358 of file CPose3DQuat.h.
using mrpt::poses::CPose3DQuat::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 606 of file CPose3DQuat.h.
using mrpt::poses::CPose3DQuat::size_type = std::size_t |
Definition at line 360 of file CPose3DQuat.h.
Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses.
Definition at line 337 of file CPose3DQuat.h.
using mrpt::poses::CPose3DQuat::UniquePtr = std::unique_ptr< mrpt::poses :: CPose3DQuat > |
Definition at line 48 of file CPose3DQuat.h.
using mrpt::poses::CPose3DQuat::value_type = double |
The type of the elements.
Definition at line 357 of file CPose3DQuat.h.
|
inherited |
Fixed-size vector of the correct size to hold all the coordinates of the point/pose.
Definition at line 137 of file CPoseOrPoint.h.
anonymous enum |
Enumerator | |
---|---|
is_3D_val |
Definition at line 338 of file CPose3DQuat.h.
anonymous enum |
Enumerator | |
---|---|
rotation_dimensions |
Definition at line 343 of file CPose3DQuat.h.
anonymous enum |
Enumerator | |
---|---|
is_PDF_val |
Definition at line 347 of file CPose3DQuat.h.
anonymous enum |
Enumerator | |
---|---|
static_size |
Definition at line 364 of file CPose3DQuat.h.
|
inline |
Default constructor, initialize translation to zeros and quaternion to no rotation.
Definition at line 70 of file CPose3DQuat.h.
References m_coords.
|
inline |
Constructor which left all the quaternion members un-initialized, for use when speed is critical; Use UNINITIALIZED_POSE as argument to this constructor.
Definition at line 78 of file CPose3DQuat.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 83 of file CPose3DQuat.h.
|
inline |
Constructor with initilization of the pose - the quaternion is normalized to make sure it's unitary.
Definition at line 90 of file CPose3DQuat.h.
References m_coords, m_quat, mrpt::math::CQuaternion< T >::normalize(), mrpt::poses::CPoseOrPoint< CPose3DQuat, DIM >::x(), and mrpt::poses::CPoseOrPoint< CPose3DQuat, DIM >::y().
|
explicit |
Constructor from a CPose3D.
Definition at line 29 of file CPose3DQuat.cpp.
References mrpt::poses::CPoseOrPoint< DERIVEDCLASS, DIM >::x().
|
inline |
Constructor from lightweight object.
Definition at line 105 of file CPose3DQuat.h.
References mrpt::math::TPose3DQuat::x, mrpt::poses::CPoseOrPoint< CPose3DQuat, DIM >::x(), mrpt::math::TPose3DQuat::y, mrpt::poses::CPoseOrPoint< CPose3DQuat, DIM >::y(), and mrpt::math::TPose3DQuat::z.
|
explicit |
Constructor from a 4x4 homogeneous transformation matrix.
Definition at line 39 of file CPose3DQuat.cpp.
References mrpt::poses::CPose3D::getAsQuaternion(), m_coords, and m_quat.
|
staticprotected |
|
inline |
Definition at line 379 of file CPose3DQuat.h.
References mrpt::math::MatrixVectorBase< Scalar, Derived >::fill(), m_coords, m_quat, and val.
|
inline |
Returns a human-readable textual representation of the object (eg: "[x y z qr qx qy qz]", angles in degrees.)
Definition at line 240 of file CPose3DQuat.h.
References mrpt::format(), m_coords, and m_quat.
|
inline |
Definition at line 246 of file CPose3DQuat.h.
TPose3DQuat CPose3DQuat::asTPose | ( | ) | const |
Definition at line 534 of file CPose3DQuat.cpp.
References m_quat, mrpt::math::CQuaternion< T >::r(), mrpt::math::CQuaternion< T >::x(), mrpt::poses::CPoseOrPoint< CPose3DQuat, DIM >::x(), mrpt::math::CQuaternion< T >::y(), mrpt::poses::CPoseOrPoint< CPose3DQuat, DIM >::y(), and mrpt::math::CQuaternion< T >::z().
Referenced by mrpt::hwdrivers::CKinect::loadConfig_sensorSpecific(), and mrpt::hwdrivers::TCaptureOptions_DUO3D::m_camera_ext_params_from_yml().
void CPose3DQuat::asVector | ( | vector_t & | v | ) | const |
Returns a 7x1 vector with [x y z qr qx qy qz]'.
Returns a 1x7 vector with [x y z qr qx qy qz].
Definition at line 64 of file CPose3DQuat.cpp.
|
inlineinherited |
Return the pose or point as a 1xN vector with all the components (see derived classes for each implementation)
Definition at line 266 of file CPoseOrPoint.h.
|
inline |
Definition at line 608 of file CPose3DQuat.h.
Referenced by rend().
|
inline |
Definition at line 610 of file CPose3DQuat.h.
|
overridevirtual |
Returns a deep copy (clone) of the object, indepently of its class.
Implements mrpt::rtti::CObject.
void CPose3DQuat::composeFrom | ( | const CPose3DQuat & | A, |
const CPose3DQuat & | B | ||
) |
Makes this method is slightly more efficient than "this= A + B;" since it avoids the temporary object.
Makes "this = A (+) B"; this method is slightly more efficient than "this= A + B;" since it avoids the temporary object.
Definition at line 79 of file CPose3DQuat.cpp.
References mrpt::math::CQuaternion< T >::crossProduct(), m_coords, and m_quat.
Referenced by operator+(), and operator+=().
void CPose3DQuat::composePoint | ( | const double | lx, |
const double | ly, | ||
const double | lz, | ||
double & | gx, | ||
double & | gy, | ||
double & | gz, | ||
mrpt::math::CMatrixFixed< double, 3, 3 > * | out_jacobian_df_dpoint = nullptr , |
||
mrpt::math::CMatrixFixed< double, 3, 7 > * | out_jacobian_df_dpose = nullptr |
||
) | const |
Computes the 3D point G such as .
Definition at line 114 of file CPose3DQuat.cpp.
References mrpt::math::CMatrixFixed< T, ROWS, COLS >::asEigen(), mrpt::math::CMatrixFixed< T, ROWS, COLS >::loadFromArray(), m_coords, m_quat, mrpt::math::CQuaternion< T >::normalizationJacobian(), quat(), mrpt::math::CQuaternion< T >::r(), mrpt::math::CQuaternion< T >::rotatePoint(), mrpt::square(), mrpt::math::UNINITIALIZED_MATRIX, mrpt::math::CQuaternion< T >::x(), mrpt::math::CQuaternion< T >::y(), and mrpt::math::CQuaternion< T >::z().
Referenced by composePoint(), mrpt::slam::CRangeBearingKFSLAM::OnInverseObservationModel(), operator+(), se3_l2_internal(), Pose3DQuatTests::test_composeAndInvComposePoint(), Pose3DQuatTests::test_composePoint_vs_CPose3D(), and Pose3DQuatTests::test_composePointJacob().
|
inline |
Computes the 3D point G such as .
POINT1 and POINT1 can be anything supporing [0],[1],[2].
Definition at line 167 of file CPose3DQuat.h.
References composePoint(), and G.
|
inlinestatic |
Definition at line 48 of file CPose3DQuat.h.
|
inlinestatic |
Definition at line 48 of file CPose3DQuat.h.
|
static |
|
inlinestatic |
Definition at line 48 of file CPose3DQuat.h.
|
inlineinherited |
Definition at line 129 of file CPoseOrPoint.h.
|
inlineinherited |
Definition at line 133 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 237 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 221 of file CPoseOrPoint.h.
|
inlineinherited |
Returns the 3D distance from this pose/point to a 3D point.
Definition at line 243 of file CPoseOrPoint.h.
|
inlineinherited |
Returns the squared 3D distance from this pose/point to a 3D point.
Definition at line 228 of file CPoseOrPoint.h.
|
inlineinherited |
Returns the Euclidean distance to another pose/point:
Definition at line 214 of file CPoseOrPoint.h.
|
inlineinherited |
Returns the euclidean distance to a 3D point:
Definition at line 249 of file CPoseOrPoint.h.
|
inlineinherited |
Makes a deep copy of the object and returns a smart pointer to it.
Definition at line 204 of file CObject.h.
References mrpt::rtti::CObject::clone().
Referenced by mrpt::obs::CRawlog::insert().
|
inlinestatic |
Definition at line 369 of file CPose3DQuat.h.
|
inline |
Definition at line 609 of file CPose3DQuat.h.
References static_size.
Referenced by rbegin().
|
inline |
Definition at line 611 of file CPose3DQuat.h.
References static_size.
void CPose3DQuat::fromString | ( | const std::string & | s | ) |
Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -0.8 1 0 0 0]" )
std::exception | On invalid format |
Definition at line 540 of file CPose3DQuat.cpp.
References ASSERTMSG_, mrpt::math::CMatrixDynamic< T >::cols(), mrpt::math::MatrixVectorBase< Scalar, Derived >::fromMatlabStringFormat(), m_coords, m_quat, mrpt::math::CMatrixDynamic< T >::rows(), and THROW_EXCEPTION.
Referenced by FromString(), and fromStringRaw().
|
inlinestatic |
Definition at line 264 of file CPose3DQuat.h.
References fromString().
void CPose3DQuat::fromStringRaw | ( | const std::string & | s | ) |
Same as fromString, but without requiring the square brackets in the string.
Definition at line 555 of file CPose3DQuat.cpp.
References fromString().
Referenced by mrpt::poses::internal::getPoseFromString< true, false >().
|
inlinestatic |
Definition at line 48 of file CPose3DQuat.h.
void CPose3DQuat::getHomogeneousMatrix | ( | mrpt::math::CMatrixDouble44 & | out_HM | ) | const |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation).
Definition at line 53 of file CPose3DQuat.cpp.
References m_coords, m_quat, and mrpt::math::CQuaternion< T >::rotationMatrixNoResize().
|
inlineinherited |
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation).
Definition at line 278 of file CPoseOrPoint.h.
|
inlineinherited |
Returns the corresponding 4x4 inverse homogeneous transformation matrix for this point or pose.
Definition at line 290 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 298 of file CPoseOrPoint.h.
|
inline |
Definition at line 352 of file CPose3DQuat.h.
|
inline |
Definition at line 353 of file CPose3DQuat.h.
|
overridevirtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::serialization::CSerializable.
|
static |
void CPose3DQuat::inverse | ( | ) |
Convert this pose into its inverse, saving the result in itself.
Definition at line 489 of file CPose3DQuat.cpp.
References inverseComposePoint(), m_coords, and m_quat.
Referenced by mrpt::poses::operator-().
void CPose3DQuat::inverseComposeFrom | ( | const CPose3DQuat & | A, |
const CPose3DQuat & | B | ||
) |
Makes this method is slightly more efficient than "this= A - B;" since it avoids the temporary object.
Definition at line 98 of file CPose3DQuat.cpp.
References mrpt::math::CQuaternion< T >::crossProduct(), m_coords, m_quat, mrpt::math::CQuaternion< T >::r(), mrpt::math::CQuaternion< T >::rotatePoint(), mrpt::math::CQuaternion< T >::x(), mrpt::math::CQuaternion< T >::y(), and mrpt::math::CQuaternion< T >::z().
Referenced by operator-(), and operator-=().
void CPose3DQuat::inverseComposePoint | ( | const double | gx, |
const double | gy, | ||
const double | gz, | ||
double & | lx, | ||
double & | ly, | ||
double & | lz, | ||
mrpt::math::CMatrixFixed< double, 3, 3 > * | out_jacobian_df_dpoint = nullptr , |
||
mrpt::math::CMatrixFixed< double, 3, 7 > * | out_jacobian_df_dpose = nullptr |
||
) | const |
Computes the 3D point L such as .
Computes the 3D point G such as .
Definition at line 187 of file CPose3DQuat.cpp.
References mrpt::math::MatrixBase< T, CMatrixFixed< T, ROWS, COLS > >::insertMatrix(), mrpt::math::CQuaternion< T >::inverseRotatePoint(), mrpt::math::CMatrixFixed< T, ROWS, COLS >::loadFromArray(), m_coords, m_quat, mrpt::math::CQuaternion< T >::normalizationJacobian(), quat(), mrpt::math::CQuaternion< T >::r(), mrpt::square(), mrpt::math::UNINITIALIZED_MATRIX, mrpt::math::CQuaternion< T >::x(), mrpt::math::CQuaternion< T >::y(), and mrpt::math::CQuaternion< T >::z().
Referenced by generate_points(), mrpt::poses::CPose3DQuatPDFGaussianInf::inverse(), mrpt::poses::CPose3DQuatPDFGaussian::inverse(), inverse(), inverseComposePoint(), mrpt::poses::operator-(), mrpt::vision::pinhole::projectPoints_with_distortion(), sphericalCoordinates(), Pose3DQuatTests::test_composeAndInvComposePoint(), Pose3DQuatTests::test_invComposePoint_vs_CPose3D(), and Pose3DQuatTests::test_invComposePointJacob().
|
inline |
Computes the 3D point L such as .
Definition at line 175 of file CPose3DQuat.h.
References G, and inverseComposePoint().
|
inlinestaticinherited |
Return true for poses or points with a Z component, false otherwise.
Definition at line 180 of file CPoseOrPoint.h.
|
inlinestatic |
Definition at line 342 of file CPose3DQuat.h.
References is_3D_val.
|
inlinestatic |
Definition at line 351 of file CPose3DQuat.h.
References is_PDF_val.
|
inlinestatic |
Definition at line 370 of file CPose3DQuat.h.
References static_size.
|
inlineinherited |
Returns the euclidean norm of vector: .
Definition at line 256 of file CPoseOrPoint.h.
|
virtual |
Scalar multiplication (all x y z qr qx qy qz elements are multiplied by the scalar).
Definition at line 315 of file CPose3DQuat.cpp.
Computes the 3D point G such as .
Definition at line 182 of file CPose3DQuat.h.
References composePoint(), and G.
|
inline |
Computes the 3D point G such as .
Definition at line 191 of file CPose3DQuat.h.
References composePoint(), and G.
|
inline |
Return the composed pose .
Definition at line 210 of file CPose3DQuat.h.
References composeFrom().
|
inline |
Make .
Definition at line 203 of file CPose3DQuat.h.
References composeFrom().
|
inline |
Return the composed pose .
Definition at line 225 of file CPose3DQuat.h.
References inverseComposeFrom().
|
inline |
Make .
Definition at line 218 of file CPose3DQuat.h.
References inverseComposeFrom().
|
inline |
Read only [] operator.
Definition at line 272 of file CPose3DQuat.h.
|
inline |
Read/write [] operator.
Definition at line 296 of file CPose3DQuat.h.
|
inline |
Read/Write access to the quaternion representing the 3D rotation.
Definition at line 58 of file CPose3DQuat.h.
References m_quat.
Referenced by composePoint(), mrpt::poses::CPose3DQuatPDFGaussian::copyFrom(), mrpt::poses::CPose3DPDFGaussian::copyFrom(), mrpt::poses::CPose3D::CPose3D(), Pose3DQuatTests::func_compose_point(), Pose3DQuatTests::func_inv_compose_point(), Pose3DQuatTests::func_spherical_coords(), mrpt::hwdrivers::CImageGrabber_FlyCapture2::getObservation(), mrpt::poses::CPose3DQuatPDFGaussianInf::inverse(), mrpt::poses::CPose3DQuatPDFGaussian::inverse(), inverseComposePoint(), mrpt::poses::CPose3DQuatPDF::jacobiansPoseComposition(), mrpt::poses::CPose3DPDF::jacobiansPoseComposition(), mrpt::poses::operator<<(), mrpt::poses::operator==(), mrpt::topography::path_from_rtk_gps(), mrpt::poses::CPose3DQuatPDFGaussianInf::saveToTextFile(), mrpt::poses::CPose3DQuatPDFGaussian::saveToTextFile(), setToNaN(), Pose3DQuatTests::test_invComposePointJacob(), and QuaternionTests::test_toYPRAndBack().
|
inline |
Read-only access to the quaternion representing the 3D rotation.
Definition at line 60 of file CPose3DQuat.h.
References m_quat.
|
inline |
Definition at line 615 of file CPose3DQuat.h.
References end().
|
inline |
Definition at line 616 of file CPose3DQuat.h.
References end().
|
inline |
Definition at line 620 of file CPose3DQuat.h.
References begin().
|
inline |
Definition at line 621 of file CPose3DQuat.h.
References begin().
|
inlinestatic |
Definition at line 371 of file CPose3DQuat.h.
References mrpt::format(), and static_size.
|
overrideprotectedvirtual |
Serialize CSchemeArchiveBase derived object to CSerializable Object.
Implements mrpt::serialization::CSerializable.
Definition at line 332 of file CPose3DQuat.cpp.
References m_coords, m_quat, and MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION.
|
inlineprotectedvirtualinherited |
Virtual method for reading (deserializing) from an abstract schema based archive.
Definition at line 74 of file CSerializable.h.
References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.
|
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 326 of file CPose3DQuat.cpp.
|
overrideprotectedvirtual |
Serialize CSerializable Object to CSchemeArchiveBase derived object.
Implements mrpt::serialization::CSerializable.
Definition at line 327 of file CPose3DQuat.cpp.
|
inlineprotectedvirtualinherited |
Virtual method for writing (serializing) to an abstract schema based archive.
Definition at line 64 of file CSerializable.h.
References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.
|
overridevirtual |
Set all data fields to quiet NaN.
Implements mrpt::poses::CPoseOrPoint< CPose3DQuat, DIM >.
Definition at line 500 of file CPose3DQuat.cpp.
References m_coords, and quat().
|
inlinestatic |
Definition at line 368 of file CPose3DQuat.h.
References static_size.
void CPose3DQuat::sphericalCoordinates | ( | const mrpt::math::TPoint3D & | point, |
double & | out_range, | ||
double & | out_yaw, | ||
double & | out_pitch, | ||
mrpt::math::CMatrixFixed< double, 3, 3 > * | out_jacob_dryp_dpoint = nullptr , |
||
mrpt::math::CMatrixFixed< double, 3, 7 > * | out_jacob_dryp_dpose = nullptr |
||
) | const |
Computes the spherical coordinates of a 3D point as seen from the 6D pose specified by this object.
For the coordinate system see the top of this page. If the matrix pointers are not nullptr, the Jacobians will be also computed for the range-yaw-pitch variables wrt the passed 3D point and this 7D pose.
Definition at line 386 of file CPose3DQuat.cpp.
References inverseComposePoint(), mrpt::math::TPoint3D_< T >::norm(), mrpt::square(), THROW_EXCEPTION, mrpt::math::TPoint3D_data< T >::x, mrpt::math::TPoint3D_data< T >::y, and mrpt::math::TPoint3D_data< T >::z.
Referenced by Pose3DQuatTests::func_spherical_coords(), mrpt::slam::CRangeBearingKFSLAM::OnObservationJacobians(), mrpt::slam::CRangeBearingKFSLAM::OnObservationModel(), and Pose3DQuatTests::test_sphericalCoords().
|
inlineinherited |
Returns the squared euclidean distance to another pose/point:
Definition at line 187 of file CPoseOrPoint.h.
|
inline |
Definition at line 626 of file CPose3DQuat.h.
References m_coords, m_quat, and mrpt::math::CMatrixFixed< T, ROWS, COLS >::swap().
|
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 90 of file CSerializable.h.
|
inlineinherited |
Common members of all points & poses classes.
< Get X coord.
Definition at line 143 of file CPoseOrPoint.h.
Referenced by asTPose(), and CPose3DQuat().
|
inlineinherited |
Definition at line 152 of file CPoseOrPoint.h.
|
inlineinherited |
v | Set X coord. |
Definition at line 161 of file CPoseOrPoint.h.
|
inlineinherited |
v | X+=v |
Definition at line 170 of file CPoseOrPoint.h.
|
inline |
Read/Write access to the translation vector in R^3.
Definition at line 62 of file CPose3DQuat.h.
References m_coords.
|
inline |
Read-only access to the translation vector in R^3.
Definition at line 64 of file CPose3DQuat.h.
References m_coords.
|
inlineinherited |
< Get Y coord.
Definition at line 147 of file CPoseOrPoint.h.
Referenced by asTPose(), and CPose3DQuat().
|
inlineinherited |
Definition at line 156 of file CPoseOrPoint.h.
|
inlineinherited |
v | Set Y coord. |
Definition at line 165 of file CPoseOrPoint.h.
|
inlineinherited |
v | Y+=v |
Definition at line 174 of file CPoseOrPoint.h.
|
static |
Definition at line 48 of file CPose3DQuat.h.
mrpt::math::CVectorFixedDouble<3> mrpt::poses::CPose3DQuat::m_coords |
The translation vector [x,y,z].
Definition at line 52 of file CPose3DQuat.h.
Referenced by assign(), asString(), asVector(), composeFrom(), composePoint(), CPose3DQuat(), fromString(), mrpt::slam::CRangeBearingKFSLAM::getCurrentRobotPose(), mrpt::slam::CRangeBearingKFSLAM::getCurrentRobotPoseMean(), mrpt::slam::CRangeBearingKFSLAM::getCurrentState(), getHomogeneousMatrix(), inverse(), inverseComposeFrom(), inverseComposePoint(), mrpt::slam::CRangeBearingKFSLAM::OnTransitionModel(), operator*=(), mrpt::poses::operator<<(), operator[](), mrpt::vision::CStereoRectifyMap::rectify(), serializeFrom(), serializeTo(), setToNaN(), swap(), and xyz().
mrpt::math::CQuaternionDouble mrpt::poses::CPose3DQuat::m_quat |
The quaternion.
Definition at line 54 of file CPose3DQuat.h.
Referenced by assign(), asString(), asTPose(), asVector(), composeFrom(), composePoint(), CPose3DQuat(), fromString(), mrpt::slam::CRangeBearingKFSLAM::getCurrentRobotPose(), mrpt::slam::CRangeBearingKFSLAM::getCurrentRobotPoseMean(), mrpt::slam::CRangeBearingKFSLAM::getCurrentState(), getHomogeneousMatrix(), inverse(), inverseComposeFrom(), inverseComposePoint(), mrpt::slam::CRangeBearingKFSLAM::OnTransitionModel(), operator*=(), operator[](), quat(), mrpt::vision::TSequenceFeatureObservations::saveAsSBAFiles(), serializeFrom(), serializeTo(), and swap().
|
staticprotected |
Definition at line 48 of file CPose3DQuat.h.
Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020 |