91 const double x,
const double y,
const double z,
106 :
m_quat(p.qr, p.qx, p.qy, p.qz)
145 const double lx,
const double ly,
const double lz,
double& gx,
146 double& gy,
double& gz,
156 const double gx,
const double gy,
const double gz,
double& lx,
157 double& ly,
double& lz,
166 template <
class POINT1,
class POINT2>
174 template <
class POINT1,
class POINT2>
291 throw std::runtime_error(
292 "CPose3DQuat::operator[]: Index of bounds.");
315 throw std::runtime_error(
316 "CPose3DQuat::operator[]: Index of bounds.");
369 static constexpr
bool empty() {
return false; }
371 static inline void resize(
const size_t n)
374 throw std::logic_error(
format(
375 "Try to change the size of CPose3DQuat to %u.",
376 static_cast<unsigned>(n)));
382 throw std::runtime_error(
383 "CPose3DQuat::assign: Try to resize to length!=7.");
389 :
public std::iterator<std::random_access_iterator_tag, value_type>
393 std::iterator<std::random_access_iterator_tag, value_type>;
401 inline void check_limits([[maybe_unused]]
bool allow_end =
false)
const 468 return (*
this) += (-off);
482 iterator_base::difference_type off)
const 497 :
public std::iterator<std::random_access_iterator_tag, value_type>
501 std::iterator<std::random_access_iterator_tag, value_type>;
509 inline void check_limits([[maybe_unused]]
bool allow_end =
false)
const 569 iterator_base::difference_type off)
const 577 return (*
this) += (-off);
580 iterator_base::difference_type off)
const 592 iterator_base::difference_type off)
const 638 std::ostream&
operator<<(std::ostream& o,
const CPose3DQuat& p);
642 CPose3DQuat
operator-(
const CPose3DQuat& p);
645 CPoint3D
operator-(
const CPoint3D&
G,
const CPose3DQuat& p);
651 bool operator==(
const CPose3DQuat& p1,
const CPose3DQuat& p2);
652 bool operator!=(
const CPose3DQuat& p1,
const CPose3DQuat& p2);
void check_limits([[maybe_unused]] bool allow_end=false) const
CPose3DQuat * m_obj
A reference to the source of this iterator.
mrpt::math::CQuaternionDouble & quat()
Read/Write access to the quaternion representing the 3D rotation.
A compile-time fixed-size numeric matrix container.
void fromString(const std::string &s)
Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -0...
size_t m_cur_idx
The iterator points to this element.
const_iterator end() const
void normalize()
Normalize this quaternion, so its norm becomes the unitity.
std::iterator< std::random_access_iterator_tag, value_type > iterator_base
void asVector(vector_t &v) const
Returns a 7x1 vector with [x y z qr qx qy qz]'.
CPose3DQuat(mrpt::math::TConstructorFlags_Quaternions)
Constructor which left all the quaternion members un-initialized, for use when speed is critical; Use...
void assign(const size_t N, const double val)
#define THROW_EXCEPTION(msg)
CPose3DQuat::reference operator*() const
std::reverse_iterator< const_iterator > const_reverse_iterator
std::string std::string format(std::string_view fmt, ARGS &&... args)
reverse_iterator rbegin()
iterator_base::difference_type operator-(const iterator &it) const
TConstructorFlags_Quaternions
static constexpr bool empty()
bool operator!=(const const_iterator &it) const
void fill(const Scalar &val)
iterator(CPose3DQuat &obj, size_t start_idx)
const_reverse_iterator rbegin() const
std::ostream & operator<<(std::ostream &o, const CPoint2D &p)
Dumps a point as a string (x,y)
bool operator<(const iterator &it2) const
mrpt::math::TPoint3D operator+(const mrpt::math::TPoint3D &L) const
Computes the 3D point G such as .
CPose3DQuat(const mrpt::math::TPose3DQuat &p)
Constructor from lightweight object.
mrpt::math::CVectorFixedDouble< DIM > vector_t
Fixed-size vector of the correct size to hold all the coordinates of the point/pose.
CPose3DQuat::reference operator[](iterator_base::difference_type off) const
CQuaternion< double > CQuaternionDouble
A quaternion of data type "double".
mrpt::math::TPose3DQuat asTPose() const
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...
std::iterator< std::random_access_iterator_tag, value_type > iterator_base
void setToNaN() override
Set all data fields to quiet NaN.
void check_limits([[maybe_unused]] bool allow_end=false) const
#define DEFINE_SCHEMA_SERIALIZABLE()
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
bool operator>(const iterator &it2) const
void fromStringRaw(const std::string &s)
Same as fromString, but without requiring the square brackets in the string.
const_iterator operator++(int)
CPose3DQuat::const_reference operator*() const
iterator & operator+=(iterator_base::difference_type off)
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 .
const mrpt::math::CVectorFixedDouble< 3 > & xyz() const
Read-only access to the translation vector in R^3.
iterator_base::difference_type operator-(const const_iterator &it) const
static CPose3DQuat FromString(const std::string &s)
bool operator!=(const iterator &it) const
const_iterator begin() const
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 .
const_iterator & operator-=(iterator_base::difference_type off)
value_type T
The type of the matrix elements.
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...
const_iterator operator+(iterator_base::difference_type off) const
static constexpr size_type max_size()
double operator[](unsigned int i) const
Read only [] operator.
const mrpt::math::CQuaternionDouble & quat() const
Read-only access to the quaternion representing the 3D rotation.
value_type T
The type of the matrix elements.
CPose2D operator-(const CPose2D &p)
Unary - operator: return the inverse pose "-p" (Note that is NOT the same than a pose with negative x...
const_iterator operator-(iterator_base::difference_type off) const
double x
Translation in x,y,z.
const CPose3DQuat * m_obj
A reference to the source of this iterator.
void inverse()
Convert this pose into its inverse, saving the result in itself.
A base class for representing a pose in 2D or 3D.
const type_value & getPoseMean() const
bool operator==(const iterator &it) const
double & operator[](unsigned int i)
Read/write [] operator.
double value_type
The type of the elements.
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
double x() const
Common members of all points & poses classes.
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
virtual void operator*=(const double s)
Scalar multiplication (all x y z qr qx qy qz elements are multiplied by the scalar).
iterator operator-(iterator_base::difference_type off) const
A class used to store a 3D point.
type_value & getPoseMean()
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
const_iterator operator--(int)
Lightweight 3D pose (three spatial coordinates, plus a quaternion ).
void inverseComposePoint(const POINT1 &G, POINT2 &L) const
Computes the 3D point L such as .
bool operator!=(const CPoint< DERIVEDCLASS, DIM > &p1, const CPoint< DERIVEDCLASS, DIM > &p2)
const_iterator & operator++()
CPose3DQuat(TConstructorFlags_Poses)
void composePoint(const POINT1 &L, POINT2 &G) const
Computes the 3D point G such as .
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool operator==(const CPoint< DERIVEDCLASS, DIM > &p1, const CPoint< DERIVEDCLASS, DIM > &p2)
bool operator<(const const_iterator &it2) const
mrpt::math::CVectorFixedDouble< 3 > & xyz()
Read/Write access to the translation vector in R^3.
static void resize(const size_t n)
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...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
void getHomogeneousMatrix(mrpt::math::CMatrixDouble44 &out_HM) const
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (t...
bool operator>(const const_iterator &it2) const
CPoint3D operator+(const CPoint3D &L) const
Computes the 3D point G such as .
CPose3DQuat operator-(const CPose3DQuat &p) const
Return the composed pose .
iterator operator+(iterator_base::difference_type off) const
iterator & operator-=(iterator_base::difference_type off)
const_reverse_iterator rend() const
CVectorFixed< double, N > CVectorFixedDouble
Specialization of CVectorFixed for double numbers.
const_iterator & operator+=(iterator_base::difference_type off)
The virtual base class which provides a unified interface for all persistent objects in MRPT...
mrpt::math::CVectorFixedDouble< 3 > m_coords
The translation vector [x,y,z].
void asString(std::string &s) const
Returns a human-readable textual representation of the object (eg: "[x y z qr qx qy qz]"...
CPose3DQuat()
Default constructor, initialize translation to zeros and quaternion to no rotation.
static constexpr bool is_PDF()
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 &it) const
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
mrpt::math::CQuaternionDouble m_quat
The quaternion.
std::ptrdiff_t difference_type
A quaternion, which can represent a 3D rotation as pair , with a real part "r" and a 3D vector ...
void swap(CMatrixFixed &o)
size_t m_cur_idx
The iterator points to this element.
CPose3DQuat operator+(const CPose3DQuat &p) const
Return the composed pose .
const_iterator & operator--()
const_iterator(const CPose3DQuat &obj, size_t start_idx)
CPose3DQuat & operator+=(const CPose3DQuat &b)
Make .
static constexpr bool is_3D()
std::reverse_iterator< iterator > reverse_iterator
std::string asString() const
static constexpr size_type size()
CPose3DQuat::const_reference operator[](iterator_base::difference_type off) const
void swap(CPose3DQuat &o)
CPose3DQuat & operator-=(const CPose3DQuat &b)
Make .