91 const double x,
const double y,
const double z,
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>
284 throw std::runtime_error(
285 "CPose3DQuat::operator[]: Index of bounds.");
308 throw std::runtime_error(
309 "CPose3DQuat::operator[]: Index of bounds.");
362 static constexpr
bool empty() {
return false; }
367 throw std::logic_error(
format(
368 "Try to change the size of CPose3DQuat to %u.",
369 static_cast<unsigned>(
n)));
375 throw std::runtime_error(
376 "CPose3DQuat::assign: Try to resize to length!=7.");
382 :
public std::iterator<std::random_access_iterator_tag, value_type>
386 std::iterator<std::random_access_iterator_tag, value_type>;
463 return (*
this) += (-off);
477 iterator_base::difference_type off)
const 492 :
public std::iterator<std::random_access_iterator_tag, value_type>
496 std::iterator<std::random_access_iterator_tag, value_type>;
566 iterator_base::difference_type off)
const 574 return (*
this) += (-off);
577 iterator_base::difference_type off)
const 589 iterator_base::difference_type off)
const 635 std::ostream&
operator<<(std::ostream& o,
const CPose3DQuat&
p);
642 CPoint3D
operator-(
const CPoint3D&
G,
const CPose3DQuat&
p);
648 bool operator==(
const CPose3DQuat& p1,
const CPose3DQuat& p2);
649 bool operator!=(
const CPose3DQuat& p1,
const CPose3DQuat& p2);
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
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
GLdouble GLdouble GLdouble GLdouble q
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.
const double & const_reference
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...
void check_limits(bool allow_end=false) const
std::iterator< std::random_access_iterator_tag, value_type > iterator_base
void setToNaN() override
Set all data fields to quiet NaN.
#define DEFINE_SCHEMA_SERIALIZABLE()
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
GLsizei GLsizei GLuint * obj
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
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()
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
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
GLsizei const GLchar ** string
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.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
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
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
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...
void check_limits(bool allow_end=false) const
bool operator==(const const_iterator &it) const
mrpt::math::CQuaternionDouble m_quat
The quaternion.
const double & operator[](unsigned int i) const
Read only [] operator.
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)
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
CPose3DQuat & operator-=(const CPose3DQuat &b)
Make .