90 const double x,
const double y,
const double z,
154 const double lx,
const double ly,
const double lz,
double& gx,
155 double& gy,
double& gz,
165 const double gx,
const double gy,
const double gz,
double& lx,
166 double& ly,
double& lz,
175 template <
class POINT1,
class POINT2>
183 template <
class POINT1,
class POINT2>
270 if (!m.fromMatlabStringFormat(
s))
274 "Wrong size of vector in ::fromString");
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(
393 "Try to change the size of CPose3DQuat to %u.",
394 static_cast<unsigned>(
n)));
400 throw std::runtime_error(
401 "CPose3DQuat::assign: Try to resize to length!=7.");
407 :
public std::iterator<std::random_access_iterator_tag, value_type>
410 typedef std::iterator<std::random_access_iterator_tag, value_type>
488 return (*
this) += (-off);
502 iterator_base::difference_type off)
const 517 :
public std::iterator<std::random_access_iterator_tag, value_type>
520 typedef std::iterator<std::random_access_iterator_tag, value_type>
591 iterator_base::difference_type off)
const 599 return (*
this) += (-off);
602 iterator_base::difference_type off)
const 614 iterator_base::difference_type off)
const CPose3DQuat * m_obj
A reference to the source of this iterator.
void getAsVector(mrpt::math::CVectorDouble &v) const
Returns a 1x7 vector with [x y z qr qx qy qz].
value_type T
The type of the matrix elements.
mrpt::math::CQuaternionDouble & quat()
Read/Write access to the quaternion representing the 3D rotation.
const double & const_reference
double x() const
Common members of all points & poses classes.
static size_type max_size()
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 .
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::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
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)
mrpt::math::CArrayDouble< 3 > & xyz()
Read/Write access to the translation vector in R^3.
CPose3DQuat::reference operator*() const
reverse_iterator rbegin()
The virtual base class which provides a unified interface for all persistent objects in MRPT...
iterator_base::difference_type operator-(const iterator &it) const
TConstructorFlags_Quaternions
bool operator!=(const const_iterator &it) const
iterator(CPose3DQuat &obj, size_t start_idx)
#define THROW_EXCEPTION(msg)
const_reverse_iterator rbegin() const
GLdouble GLdouble GLdouble GLdouble q
void fromString(const std::string &s)
Set the current object value from a string generated by 'asString' (eg: "[0.02 1.04 -0...
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.
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction...
CPose3DQuat::reference operator[](iterator_base::difference_type off) const
void fromStringRaw(const std::string &s)
Same as fromString, but without requiring the square brackets in the string.
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...
void check_limits(bool allow_end=false) const
const mrpt::math::CArrayDouble< 3 > & xyz() const
Read-only access to the translation vector in R^3.
const Scalar * const_iterator
void setToNaN() override
Set all data fields to quiet NaN.
std::iterator< std::random_access_iterator_tag, value_type > iterator_base
GLsizei GLsizei GLuint * obj
bool operator>(const iterator &it2) const
const_iterator operator++(int)
CPose3DQuat::const_reference operator*() const
iterator & operator+=(iterator_base::difference_type off)
iterator_base::difference_type operator-(const const_iterator &it) 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 .
bool operator!=(const iterator &it) const
A numeric matrix of compile-time fixed size.
const_iterator begin() const
void getAsVector(mrpt::math::CArrayDouble< 7 > &v) const
const_iterator & operator-=(iterator_base::difference_type off)
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
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
const mrpt::math::CQuaternionDouble & quat() const
Read-only access to the quaternion representing the 3D rotation.
bool operator!=(const CPoint< DERIVEDCLASS > &p1, const CPoint< DERIVEDCLASS > &p2)
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
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
double value_type
The type of the elements.
bool operator==(const iterator &it) const
double & operator[](unsigned int i)
Read/write [] operator.
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()
const_iterator operator--(int)
Lightweight 3D pose (three spatial coordinates, plus a quaternion ).
mrpt::math::CArrayDouble< 3 > m_coords
The translation vector [x,y,z].
void inverseComposePoint(const POINT1 &G, POINT2 &L) const
Computes the 3D point L such as .
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 const_iterator &it2) const
size_t size(const MATRIXLIKE &m, const int dim)
CPose3DQuat mrpt_autotype
See ops_containers.h.
static void resize(const size_t n)
bool operator==(const CPoint< DERIVEDCLASS > &p1, const CPoint< DERIVEDCLASS > &p2)
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).
std::ptrdiff_t difference_type
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
const_iterator & operator+=(iterator_base::difference_type off)
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.
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.
std::reverse_iterator< iterator > reverse_iterator
const double & operator[](unsigned int i) const
Read only [] operator.
A quaternion, which can represent a 3D rotation as pair , with a real part "r" and a 3D vector ...
std::iterator< std::random_access_iterator_tag, value_type > iterator_base
CPose3DQuat type_value
Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses.
std::reverse_iterator< const_iterator > const_reverse_iterator
size_t m_cur_idx
The iterator points to this element.
value_type T
The type of the matrix elements.
#define ASSERTMSG_(f, __ERROR_MSG)
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 .
std::string asString() const
CPose3DQuat::const_reference operator[](iterator_base::difference_type off) const
void swap(CPose3DQuat &o)
std::ostream & operator<<(std::ostream &o, const CPoint< DERIVEDCLASS > &p)
Dumps a point as a string [x,y] or [x,y,z].
CPose3DQuat & operator-=(const CPose3DQuat &b)
Make .