Go to the documentation of this file.
91 const double x,
const double y,
const double z,
156 const double lx,
const double ly,
const double lz,
double& gx,
157 double& gy,
double& gz,
167 const double gx,
const double gy,
const double gz,
double& lx,
168 double& ly,
double& lz,
177 template <
class POINT1,
class POINT2>
185 template <
class POINT1,
class POINT2>
272 if (!m.fromMatlabStringFormat(
s))
274 ASSERTMSG_(m.rows() == 1 && m.cols() == 7,
"Expected vector length=7");
278 m_quat[0] = m.get_unsafe(0, 3);
279 m_quat[1] = m.get_unsafe(0, 4);
280 m_quat[2] = m.get_unsafe(0, 5);
281 m_quat[3] = m.get_unsafe(0, 6);
307 throw std::runtime_error(
308 "CPose3DQuat::operator[]: Index of bounds.");
331 throw std::runtime_error(
332 "CPose3DQuat::operator[]: Index of bounds.");
386 static inline bool empty() {
return false; }
391 throw std::logic_error(
format(
392 "Try to change the size of CPose3DQuat to %u.",
393 static_cast<unsigned>(
n)));
399 throw std::runtime_error(
400 "CPose3DQuat::assign: Try to resize to length!=7.");
406 :
public std::iterator<std::random_access_iterator_tag, value_type>
410 std::iterator<std::random_access_iterator_tag, value_type>;
487 return (*
this) += (-off);
501 iterator_base::difference_type off)
const
516 :
public std::iterator<std::random_access_iterator_tag, value_type>
520 std::iterator<std::random_access_iterator_tag, value_type>;
590 iterator_base::difference_type off)
const
598 return (*
this) += (-off);
601 iterator_base::difference_type off)
const
613 iterator_base::difference_type off)
const
size_t m_cur_idx
The iterator points to this element.
const type_value & getPoseMean() const
mrpt::math::CQuaternionDouble m_quat
The quaternion.
std::iterator< std::random_access_iterator_tag, value_type > iterator_base
iterator(CPose3DQuat &obj, size_t start_idx)
const mrpt::math::CArrayDouble< 3 > & xyz() const
Read-only access to the translation vector in R^3.
const mrpt::math::CQuaternionDouble & quat() const
Read-only access to the quaternion representing the 3D rotation.
const_iterator operator++(int)
const_iterator & operator++()
void normalize()
Normalize this quaternion, so its norm becomes the unitity.
const Scalar * const_iterator
void assign(const size_t N, const double val)
CPose3DQuat(mrpt::math::TConstructorFlags_Quaternions)
Constructor which left all the quaternion members un-initialized, for use when speed is critical; Use...
CPose3DQuat(const mrpt::math::TPose3DQuat &p)
Constructor from lightweight object.
CPose3DQuat::const_reference operator*() const
double value_type
The type of the elements.
std::ptrdiff_t difference_type
GLdouble GLdouble GLdouble GLdouble q
reverse_iterator rbegin()
CPose3DQuat::const_reference operator[](iterator_base::difference_type off) const
const CPose3DQuat * m_obj
A reference to the source of this iterator.
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction.
void composePoint(const POINT1 &L, POINT2 &G) const
Computes the 3D point G such as .
iterator_base::difference_type operator-(const iterator &it) const
void inverseComposeFrom(const CPose3DQuat &A, const CPose3DQuat &B)
Makes this method is slightly more efficient than "this= A - B;" since it avoids the temporary objec...
bool operator>(const const_iterator &it2) const
void check_limits(bool allow_end=false) const
bool operator!=(const iterator &it) const
mrpt::math::TPose3DQuat asTPose() const
void fromStringRaw(const std::string &s)
Same as fromString, but without requiring the square brackets in the string.
void getHomogeneousMatrix(mrpt::math::CMatrixDouble44 &out_HM) const
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (t...
A base class for representing a pose in 2D or 3D.
GLsizei GLsizei GLuint * obj
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
void swap(CPose3DQuat &o)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool operator!=(const const_iterator &it) const
void setToNaN() override
Set all data fields to quiet NaN.
const_iterator end() const
bool operator==(const iterator &it) const
#define THROW_EXCEPTION(msg)
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,...
CPose2D operator-(const CPose2D &p)
Unary - operator: return the inverse pose "-p" (Note that is NOT the same than a pose with negative x...
bool operator==(const const_iterator &it) const
bool operator>(const iterator &it2) const
CPose3DQuat::reference operator*() const
CPoint3D operator+(const CPoint3D &L) const
Computes the 3D point G such as .
void inverse()
Convert this pose into its inverse, saving the result in itself.
const_iterator begin() const
const_iterator & operator--()
bool operator<(const const_iterator &it2) const
void inverseComposePoint(const double gx, const double gy, const double gz, double &lx, double &ly, double &lz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 7 > *out_jacobian_df_dpose=nullptr) const
Computes the 3D point L such as .
const double & const_reference
std::iterator< std::random_access_iterator_tag, value_type > iterator_base
const_reverse_iterator rend() const
size_t m_cur_idx
The iterator points to this element.
mrpt::math::CQuaternionDouble & quat()
Read/Write access to the quaternion representing the 3D rotation.
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.
type_value & getPoseMean()
CPose3DQuat & operator-=(const CPose3DQuat &b)
Make
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
CPose3DQuat(TConstructorFlags_Poses)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void sphericalCoordinates(const mrpt::math::TPoint3D &point, double &out_range, double &out_yaw, double &out_pitch, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacob_dryp_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 7 > *out_jacob_dryp_dpose=nullptr) const
Computes the spherical coordinates of a 3D point as seen from the 6D pose specified by this object.
double x() const
Common members of all points & poses classes.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
const_iterator(const CPose3DQuat &obj, size_t start_idx)
void composeFrom(const CPose3DQuat &A, const CPose3DQuat &B)
Makes this method is slightly more efficient than "this= A + B;" since it avoids the temporary objec...
mrpt::math::TPoint3D operator+(const mrpt::math::TPoint3D &L) const
Computes the 3D point G such as .
virtual void operator*=(const double s)
Scalar multiplication (all x y z qr qx qy qz elements are multiplied by the scalar).
bool operator!=(const CPoint< DERIVEDCLASS > &p1, const CPoint< DERIVEDCLASS > &p2)
const double & operator[](unsigned int i) const
Read only [] operator.
value_type T
The type of the matrix elements.
CPose3DQuat operator+(const CPose3DQuat &p) const
Return the composed pose
const_iterator operator+(iterator_base::difference_type off) const
The virtual base class which provides a unified interface for all persistent objects in MRPT.
TConstructorFlags_Quaternions
void inverseComposePoint(const POINT1 &G, POINT2 &L) const
Computes the 3D point L such as .
iterator & operator-=(iterator_base::difference_type off)
std::reverse_iterator< iterator > reverse_iterator
CArrayNumeric is an array for numeric types supporting several mathematical operations (actually,...
iterator & operator+=(iterator_base::difference_type off)
CPose3DQuat * m_obj
A reference to the source of this iterator.
CPose3DQuat & operator+=(const CPose3DQuat &b)
Make
A numeric matrix of compile-time fixed size.
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
static void resize(const size_t n)
const_reverse_iterator rbegin() const
iterator operator+(iterator_base::difference_type off) const
CPose3DQuat::reference operator[](iterator_base::difference_type off) const
void composePoint(const double lx, const double ly, const double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 7 > *out_jacobian_df_dpose=nullptr) const
Computes the 3D point G such as .
A quaternion, which can represent a 3D rotation as pair , with a real part "r" and a 3D vector ,...
void fromString(const std::string &s)
Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -0....
void getAsVector(mrpt::math::CVectorDouble &v) const
Returns a 1x7 vector with [x y z qr qx qy qz].
void getAsVector(mrpt::math::CArrayDouble< 7 > &v) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Lightweight 3D pose (three spatial coordinates, plus a quaternion ).
bool operator==(const CPoint< DERIVEDCLASS > &p1, const CPoint< DERIVEDCLASS > &p2)
static size_type max_size()
std::string asString() const
CPose3DQuat()
Default constructor, initialize translation to zeros and quaternion to no rotation.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
std::reverse_iterator< const_iterator > const_reverse_iterator
const_iterator operator-(iterator_base::difference_type off) const
iterator operator-(iterator_base::difference_type off) const
CPose3DQuat operator-(const CPose3DQuat &p) const
Return the composed pose
mrpt::math::CArrayDouble< 3 > & xyz()
Read/Write access to the translation vector in R^3.
const_iterator & operator-=(iterator_base::difference_type off)
GLsizei const GLchar ** string
double & operator[](unsigned int i)
Read/write [] operator.
std::ostream & operator<<(std::ostream &o, const CPoint< DERIVEDCLASS > &p)
Dumps a point as a string [x,y] or [x,y,z]
void check_limits(bool allow_end=false) const
A class used to store a 3D point.
bool operator<(const iterator &it2) const
void asString(std::string &s) const
Returns a human-readable textual representation of the object (eg: "[x y z qr qx qy qz]",...
const_iterator & operator+=(iterator_base::difference_type off)
value_type T
The type of the matrix elements.
iterator_base::difference_type operator-(const const_iterator &it) const
mrpt::math::CArrayDouble< 3 > m_coords
The translation vector [x,y,z].
const_iterator operator--(int)
@ UNINITIALIZED_QUATERNION
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |