MRPT  1.9.9
CPose3DRotVec.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef CPOSE3DROTVEC_H
10 #define CPOSE3DROTVEC_H
11 
12 #include <mrpt/poses/CPose.h>
14 #include <mrpt/math/CQuaternion.h>
15 #include <mrpt/poses/poses_frwds.h>
16 
17 namespace mrpt::poses
18 {
19 /** A 3D pose, with a 3D translation and a rotation in 3D parameterized in
20  * rotation-vector form (equivalent to axis-angle).
21  * The 6D transformation in SE(3) stored in this class is kept in two
22  * separate containers: a 3-array for the rotation vector, and a 3-array for
23  * the translation.
24  *
25  * \code
26  * CPose3DRotVec pose;
27  * pose.m_rotvec[{0:2}]=... // Rotation vector
28  * pose.m_coords[{0:2}]=... // Translation
29  * \endcode
30  *
31  * For a complete descriptionan of Points/Poses, see mrpt::poses::CPoseOrPoint,
32  * or refer
33  * to the <a href="http://www.mrpt.org/2D_3D_Geometry"> 2D/3D Geometry
34  * tutorial</a> online.
35  *
36  * There are Lie algebra methods: \a exp and \a ln (see the methods for
37  * documentation).
38  *
39  * \ingroup poses_grp
40  * \sa CPose3DRotVec, CPoseOrPoint,CPoint3D, mrpt::math::CQuaternion
41  */
42 class CPose3DRotVec : public CPose<CPose3DRotVec>,
44 {
46 
47  public:
48  /** The translation vector [x,y,z] */
50  /** The rotation vector [vx,vy,vz] */
52 
53  /** @name Constructors
54  @{ */
55 
56  /** Default constructor, with all the coordinates set to zero. */
57  inline CPose3DRotVec()
58  {
59  m_coords[0] = m_coords[1] = m_coords[2] = 0;
60  m_rotvec[0] = m_rotvec[1] = m_rotvec[2] = 0;
61  }
62 
63  /** Fast constructor that leaves all the data uninitialized - call with
64  * UNINITIALIZED_POSE as argument */
65  inline CPose3DRotVec(TConstructorFlags_Poses constructor_dummy_param)
66  : m_coords(), m_rotvec()
67  {
68  MRPT_UNUSED_PARAM(constructor_dummy_param);
69  }
70 
71  /** Constructor with initilization of the pose */
72  inline CPose3DRotVec(
73  const double vx, const double vy, const double vz, const double x,
74  const double y, const double z)
75  {
76  m_coords[0] = x;
77  m_coords[1] = y;
78  m_coords[2] = z;
79  m_rotvec[0] = vx;
80  m_rotvec[1] = vy;
81  m_rotvec[2] = vz;
82  }
83 
84  /** Constructor with initilization of the pose from a vector [w1 w2 w3 x y
85  * z] */
87  {
88  m_rotvec[0] = v[0];
89  m_rotvec[1] = v[1];
90  m_rotvec[2] = v[2];
91  m_coords[0] = v[3];
92  m_coords[1] = v[4];
93  m_coords[2] = v[5];
94  }
95 
96  /** Copy constructor */
97  inline CPose3DRotVec(const CPose3DRotVec& o)
98  {
99  this->m_rotvec = o.m_rotvec;
100  this->m_coords = o.m_coords;
101  }
102 
103  /** Constructor from a 4x4 homogeneous matrix: */
104  explicit CPose3DRotVec(const math::CMatrixDouble44& m);
105 
106  /** Constructor from a CPose3D object.*/
107  explicit CPose3DRotVec(const CPose3D& m);
108 
109  /** Constructor from a quaternion (which only represents the 3D rotation
110  * part) and a 3D displacement. */
112  const mrpt::math::CQuaternionDouble& q, const double x, const double y,
113  const double z);
114 
115  /** Constructor from an array with these 6 elements: [w1 w2 w3 x y z]
116  * where r{ij} are the entries of the 3x3 rotation matrix and t{x,y,z} are
117  * the 3D translation of the pose
118  * \sa setFrom12Vector, getAs12Vector
119  */
120  inline explicit CPose3DRotVec(const double* vec6)
121  {
122  m_coords[0] = vec6[3];
123  m_coords[1] = vec6[4];
124  m_coords[2] = vec6[5];
125  m_rotvec[0] = vec6[0];
126  m_rotvec[1] = vec6[1];
127  m_rotvec[2] = vec6[2];
128  }
129 
130  /** @} */ // end Constructors
131 
132  /** @name Access 3x3 rotation and 4x4 homogeneous matrices
133  @{ */
134 
135  /** Returns the corresponding 4x4 homogeneous transformation matrix for the
136  * point(translation) or pose (translation+orientation).
137  * \sa getInverseHomogeneousMatrix, getRotationMatrix
138  */
140  {
141  out_HM.block<3, 3>(0, 0) = getRotationMatrix();
142  out_HM.set_unsafe(0, 3, m_coords[0]);
143  out_HM.set_unsafe(1, 3, m_coords[1]);
144  out_HM.set_unsafe(2, 3, m_coords[2]);
145  out_HM.set_unsafe(3, 0, 0);
146  out_HM.set_unsafe(3, 1, 0);
147  out_HM.set_unsafe(3, 2, 0);
148  out_HM.set_unsafe(3, 3, 1);
149  }
150 
151  /** Get the 3x3 rotation matrix \sa getHomogeneousMatrix */
153  //! \overload
155  {
157  getRotationMatrix(ROT);
158  return ROT;
159  }
160 
161  /** @} */ // end rot and HM
162 
163  /** @name Pose-pose and pose-point compositions and operators
164  @{ */
165 
166  /** The operator \f$ a \oplus b \f$ is the pose compounding operator. */
167  inline CPose3DRotVec operator+(const CPose3DRotVec& b) const
168  {
170  ret.composeFrom(*this, b);
171  return ret;
172  }
173 
174  /** The operator \f$ a \oplus b \f$ is the pose compounding operator. */
175  CPoint3D operator+(const CPoint3D& b) const;
176 
177  /** The operator \f$ a \oplus b \f$ is the pose compounding operator. */
178  CPoint3D operator+(const CPoint2D& b) const;
179 
182  {
184 
185  this->m_rotvec[0] = aux[0];
186  this->m_rotvec[1] = aux[1];
187  this->m_rotvec[2] = aux[2];
188 
189  this->m_coords[0] = m.get_unsafe(0, 3);
190  this->m_coords[1] = m.get_unsafe(1, 3);
191  this->m_coords[2] = m.get_unsafe(2, 3);
192  }
193 
194  void setFromXYZAndAngles(
195  const double x, const double y, const double z, const double yaw = 0,
196  const double pitch = 0, const double roll = 0);
197 
198  /** Computes the spherical coordinates of a 3D point as seen from the 6D
199  * pose specified by this object. For the coordinate system see
200  * mrpt::poses::CPose3D */
202  const mrpt::math::TPoint3D& point, double& out_range, double& out_yaw,
203  double& out_pitch) const;
204 
205  /** An alternative, slightly more efficient way of doing \f$ G = P \oplus L
206  * \f$ with G and L being 3D points and P this 6D pose.
207  * If pointers are provided, the corresponding Jacobians are returned.
208  * See <a
209  * href="http://www.mrpt.org/6D_poses:equivalences_compositions_and_uncertainty"
210  * >this report</a> for mathematical details.
211  */
212  void composePoint(
213  double lx, double ly, double lz, double& gx, double& gy, double& gz,
214  mrpt::math::CMatrixFixedNumeric<double, 3, 3>* out_jacobian_df_dpoint =
215  nullptr,
216  mrpt::math::CMatrixFixedNumeric<double, 3, 6>* out_jacobian_df_dpose =
217  nullptr) const;
218 
219  /** An alternative, slightly more efficient way of doing \f$ G = P \oplus L
220  * \f$ with G and L being 3D points and P this 6D pose.
221  * \note local_point is passed by value to allow global and local point to
222  * be the same variable
223  */
224  inline void composePoint(
225  const mrpt::math::TPoint3D local_point,
226  mrpt::math::TPoint3D& global_point) const
227  {
228  composePoint(
229  local_point.x, local_point.y, local_point.z, global_point.x,
230  global_point.y, global_point.z);
231  }
232 
233  /** Computes the 3D point L such as \f$ L = G \ominus this \f$.
234  * If pointers are provided, the corresponding Jacobians are returned.
235  * See <a
236  * href="http://www.mrpt.org/6D_poses:equivalences_compositions_and_uncertainty"
237  * >this report</a> for mathematical details.
238  * \sa composePoint, composeFrom
239  */
240  void inverseComposePoint(
241  const double gx, const double gy, const double gz, double& lx,
242  double& ly, double& lz,
243  mrpt::math::CMatrixFixedNumeric<double, 3, 3>* out_jacobian_df_dpoint =
244  nullptr,
245  mrpt::math::CMatrixFixedNumeric<double, 3, 6>* out_jacobian_df_dpose =
246  nullptr) const;
247 
248  /** Makes "this = A (+) B"; this method is slightly more efficient than
249  * "this= A + B;" since it avoids the temporary object.
250  * \note A or B can be "this" without problems.
251  */
252  void composeFrom(
253  const CPose3DRotVec& A, const CPose3DRotVec& B,
255  out_jacobian_drvtC_drvtA = nullptr,
257  out_jacobian_drvtC_drvtB = nullptr);
258 
259  /** Convert this RVT into a quaternion + XYZ
260  */
261  void toQuatXYZ(CPose3DQuat& q) const;
262 
263  /** Make \f$ this = this \oplus b \f$ (\a b can be "this" without problems)
264  */
266  {
267  composeFrom(*this, b);
268  return *this;
269  }
270 
271  /** Copy operator */
273  {
274  this->m_rotvec = o.m_rotvec;
275  this->m_coords = o.m_coords;
276  return *this;
277  }
278 
279  /** Makes \f$ this = A \ominus B \f$ this method is slightly more efficient
280  * than "this= A - B;" since it avoids the temporary object.
281  * \note A or B can be "this" without problems.
282  * \sa composeFrom, composePoint
283  */
284  void inverseComposeFrom(const CPose3DRotVec& A, const CPose3DRotVec& B);
285 
286  /** Compute \f$ RET = this \oplus b \f$ */
287  inline CPose3DRotVec operator-(const CPose3DRotVec& b) const
288  {
290  ret.inverseComposeFrom(*this, b);
291  return ret;
292  }
293 
294  /** Convert this pose into its inverse, saving the result in itself. \sa
295  * operator- */
296  void inverse();
297 
298  /** Compute the inverse of this pose and return the result. */
299  CPose3DRotVec getInverse() const;
300 
301  /** makes: this = p (+) this */
303  {
304  composeFrom(p, CPose3DRotVec(*this));
305  }
306 
307  /** @} */ // compositions
308 
309  /** @name Access and modify contents
310  @{ */
311 
312  inline double rx() const { return m_rotvec[0]; }
313  inline double ry() const { return m_rotvec[1]; }
314  inline double rz() const { return m_rotvec[2]; }
315  inline double& rx() { return m_rotvec[0]; }
316  inline double& ry() { return m_rotvec[1]; }
317  inline double& rz() { return m_rotvec[2]; }
318  /** Scalar sum of all 6 components: This is diferent from poses composition,
319  * which is implemented as "+" operators. */
320  inline void addComponents(const CPose3DRotVec& p)
321  {
322  m_coords += p.m_coords;
323  m_rotvec += p.m_rotvec;
324  }
325 
326  /** Scalar multiplication of x,y,z,vx,vy,vz. */
327  inline void operator*=(const double s)
328  {
329  m_coords *= s;
330  m_rotvec *= s;
331  }
332 
333  /** Create a vector with 3 components according to the input transformation
334  * matrix (only the rotation will be taken into account)
335  */
337  const math::CMatrixDouble44& m);
338 
339  /** Set the pose from a 3D position (meters) and yaw/pitch/roll angles
340  * (radians) - This method recomputes the internal rotation matrix.
341  * \sa getYawPitchRoll, setYawPitchRoll
342  */
344  const double x0, const double y0, const double z0, const double vx,
345  const double vy, const double vz)
346  {
347  m_coords[0] = x0;
348  m_coords[1] = y0;
349  m_coords[2] = z0;
350  m_rotvec[0] = vx;
351  m_rotvec[1] = vy;
352  m_rotvec[2] = vz;
353  }
354 
355  /** Set pose from an array with these 6 elements: [x y z vx vy vz]
356  * where v{xyz} is the rotation vector and {xyz} the 3D translation of the
357  * pose
358  * \sa getAs6Vector
359  */
360  template <class ARRAYORVECTOR>
361  inline void setFrom6Vector(const ARRAYORVECTOR& vec6)
362  {
363  m_rotvec[0] = vec6[3];
364  m_rotvec[1] = vec6[4];
365  m_rotvec[2] = vec6[5];
366  m_coords[0] = vec6[0];
367  m_coords[1] = vec6[1];
368  m_coords[2] = vec6[2];
369  }
370 
371  /** Gets pose as an array with these 6 elements: [x y z vx vy vz]
372  * where v{xyz} is the rotation vector and {xyz} the 3D translation of the
373  * pose
374  * The target vector MUST ALREADY have space for 6 elements (i.e. no
375  * .resize() method will be called).
376  * \sa setAs6Vector, getAsVector
377  */
378  template <class ARRAYORVECTOR>
379  inline void getAs6Vector(ARRAYORVECTOR& vec6) const
380  {
381  vec6[0] = m_coords[0];
382  vec6[1] = m_coords[1];
383  vec6[2] = m_coords[2];
384  vec6[3] = m_rotvec[0];
385  vec6[4] = m_rotvec[1];
386  vec6[5] = m_rotvec[2];
387  }
388 
389  /** Like getAs6Vector() but for dynamic size vectors (required by base class
390  * CPoseOrPoint) */
391  template <class ARRAYORVECTOR>
392  inline void getAsVector(ARRAYORVECTOR& v) const
393  {
394  v.resize(6);
395  getAs6Vector(v);
396  }
397 
398  inline const double& operator[](unsigned int i) const
399  {
400  switch (i)
401  {
402  case 0:
403  return m_coords[0];
404  case 1:
405  return m_coords[1];
406  case 2:
407  return m_coords[2];
408  case 3:
409  return m_rotvec[0];
410  case 4:
411  return m_rotvec[1];
412  case 5:
413  return m_rotvec[2];
414  default:
415  throw std::runtime_error(
416  "CPose3DRotVec::operator[]: Index of bounds.");
417  }
418  }
419  inline double& operator[](unsigned int i)
420  {
421  switch (i)
422  {
423  case 0:
424  return m_coords[0];
425  case 1:
426  return m_coords[1];
427  case 2:
428  return m_coords[2];
429  case 3:
430  return m_rotvec[0];
431  case 4:
432  return m_rotvec[1];
433  case 5:
434  return m_rotvec[2];
435  default:
436  throw std::runtime_error(
437  "CPose3DRotVec::operator[]: Index of bounds.");
438  }
439  }
440 
441  /** Returns a human-readable textual representation of the object: "[x y z
442  * rx ry rz]"
443  * \sa fromString
444  */
445  void asString(std::string& s) const
446  {
447  s = mrpt::format(
448  "[%f %f %f %f %f %f]", m_coords[0], m_coords[1], m_coords[2],
449  m_rotvec[0], m_rotvec[1], m_rotvec[2]);
450  }
451  inline std::string asString() const
452  {
453  std::string s;
454  asString(s);
455  return s;
456  }
457 
458  /** Set the current object value from a string generated by 'asString' (eg:
459  * "[x y z yaw pitch roll]", angles in deg. )
460  * \sa asString
461  * \exception std::exception On invalid format
462  */
463  void fromString(const std::string& s)
464  {
466  if (!m.fromMatlabStringFormat(s))
467  THROW_EXCEPTION("Malformed expression in ::fromString");
468  ASSERTMSG_(m.rows() == 1 && m.cols() == 6, "Expected vector length=6");
469  for (int i = 0; i < 3; i++) m_coords[i] = m.get_unsafe(0, i);
470  for (int i = 0; i < 3; i++) m_rotvec[i] = m.get_unsafe(0, 3 + i);
471  }
472 
473  /** @} */ // modif. components
474 
475  /** @name Lie Algebra methods
476  @{ */
477 
478  /** Exponentiate a Vector in the SE(3) Lie Algebra to generate a new
479  * CPose3DRotVec (static method). */
480  static CPose3DRotVec exp(const mrpt::math::CArrayDouble<6>& vect);
481 
482  /** Take the logarithm of the 3x4 matrix defined by this pose, generating
483  * the corresponding vector in the SE(3) Lie Algebra. */
484  void ln(mrpt::math::CArrayDouble<6>& out_ln) const;
485 
486  /** Take the logarithm of the 3x3 rotation matrix part of this pose,
487  * generating the corresponding vector in the Lie Algebra. */
489 
490  /** @} */
491 
492  /** Used to emulate CPosePDF types, for example, in
493  * mrpt::graphs::CNetworkOfPoses */
495  enum
496  {
498  };
499  static constexpr bool is_3D() { return is_3D_val != 0; }
500  enum
501  {
503  };
504  enum
505  {
507  };
508  static constexpr bool is_PDF() { return is_PDF_val != 0; }
509  inline const type_value& getPoseMean() const { return *this; }
510  inline type_value& getPoseMean() { return *this; }
511  void setToNaN() override;
512 
513  /** @name STL-like methods and typedefs
514  @{ */
515  /** The type of the elements */
516  using value_type = double;
517  using reference = double&;
518  using const_reference = const double&;
519  using size_type = std::size_t;
521 
522  // size is constant
523  enum
524  {
526  };
527  static constexpr size_type size() { return static_size; }
528  static constexpr bool empty() { return false; }
529  static constexpr size_type max_size() { return static_size; }
530  static inline void resize(const size_t n)
531  {
532  if (n != static_size)
533  throw std::logic_error(format(
534  "Try to change the size of CPose3DRotVec to %u.",
535  static_cast<unsigned>(n)));
536  }
537  /** @} */
538 
539 }; // End of class def.
540 
541 std::ostream& operator<<(std::ostream& o, const CPose3DRotVec& p);
542 
543 /** Unary - operator: return the inverse pose "-p" (Note that is NOT the same
544  * than a pose with negative x y z yaw pitch roll) */
545 CPose3DRotVec operator-(const CPose3DRotVec& p);
546 
547 bool operator==(const CPose3DRotVec& p1, const CPose3DRotVec& p2);
548 bool operator!=(const CPose3DRotVec& p1, const CPose3DRotVec& p2);
549 
550 } // namespace mrpt::poses
551 #endif
CPose3DRotVec(const double vx, const double vy, const double vz, const double x, const double y, const double z)
Constructor with initilization of the pose.
Definition: CPose3DRotVec.h:72
static CPose3DRotVec exp(const mrpt::math::CArrayDouble< 6 > &vect)
Exponentiate a Vector in the SE(3) Lie Algebra to generate a new CPose3DRotVec (static method)...
double x() const
Common members of all points & poses classes.
Definition: CPoseOrPoint.h:140
static constexpr bool empty()
CPose3DRotVec operator+(const CPose3DRotVec &b) const
The operator is the pose compounding operator.
void changeCoordinatesReference(const CPose3DRotVec &p)
makes: this = p (+) this
const double & operator[](unsigned int i) const
void composePoint(const mrpt::math::TPoint3D local_point, mrpt::math::TPoint3D &global_point) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
GLdouble GLdouble z
Definition: glext.h:3872
void asString(std::string &s) const
Returns a human-readable textual representation of the object: "[x y z rx ry rz]".
const type_value & getPoseMean() const
#define THROW_EXCEPTION(msg)
Definition: exceptions.h:41
void inverse()
Convert this pose into its inverse, saving the result in itself.
void setFromValues(const double x0, const double y0, const double z0, const double vx, const double vy, const double vz)
Set the pose from a 3D position (meters) and yaw/pitch/roll angles (radians) - This method recomputes...
void setFromXYZAndAngles(const double x, const double y, const double z, const double yaw=0, const double pitch=0, const double roll=0)
CPose3DRotVec getInverse() const
Compute the inverse of this pose and return the result.
CPose3DRotVec operator-(const CPose3DRotVec &b) const
Compute .
static constexpr bool is_PDF()
GLdouble GLdouble GLdouble GLdouble q
Definition: glext.h:3721
GLenum GLsizei n
Definition: glext.h:5074
void setToNaN() override
Set all data fields to quiet NaN.
void addComponents(const CPose3DRotVec &p)
Scalar sum of all 6 components: This is diferent from poses composition, which is implemented as "+" ...
CArrayNumeric is an array for numeric types supporting several mathematical operations (actually...
Definition: CArrayNumeric.h:25
void getHomogeneousMatrix(mrpt::math::CMatrixDouble44 &out_HM) const
Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (t...
static constexpr bool is_3D()
void setFromTransformationMatrix(const mrpt::math::CMatrixDouble44 &m)
double & operator[](unsigned int i)
const double & const_reference
GLdouble s
Definition: glext.h:3676
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, 6 > *out_jacobian_df_dpose=nullptr) const
Computes the 3D point L such as .
const mrpt::math::CMatrixDouble33 getRotationMatrix() const
static constexpr size_type size()
void ln(mrpt::math::CArrayDouble< 6 > &out_ln) const
Take the logarithm of the 3x4 matrix defined by this pose, generating the corresponding vector in the...
void fromString(const std::string &s)
Set the current object value from a string generated by &#39;asString&#39; (eg: "[x y z yaw pitch roll]"...
A numeric matrix of compile-time fixed size.
void getAs6Vector(ARRAYORVECTOR &vec6) const
Gets pose as an array with these 6 elements: [x y z vx vy vz] where v{xyz} is the rotation vector and...
void setFrom6Vector(const ARRAYORVECTOR &vec6)
Set pose from an array with these 6 elements: [x y z vx vy vz] where v{xyz} is the rotation vector an...
void sphericalCoordinates(const mrpt::math::TPoint3D &point, double &out_range, double &out_yaw, double &out_pitch) const
Computes the spherical coordinates of a 3D point as seen from the 6D pose specified by this object...
bool operator!=(const CPoint< DERIVEDCLASS > &p1, const CPoint< DERIVEDCLASS > &p2)
Definition: CPoint.h:172
void composePoint(double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=nullptr, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=nullptr) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
CPose2D operator-(const CPose2D &p)
Unary - operator: return the inverse pose "-p" (Note that is NOT the same than a pose with negative x...
Definition: CPose2D.cpp:315
void operator*=(const double s)
Scalar multiplication of x,y,z,vx,vy,vz.
A base class for representing a pose in 2D or 3D.
Definition: CPose.h:25
mrpt::math::CArrayDouble< 3 > rotVecFromRotMat(const math::CMatrixDouble44 &m)
Create a vector with 3 components according to the input transformation matrix (only the rotation wil...
GLubyte GLubyte b
Definition: glext.h:6279
double x
X,Y,Z coordinates.
#define ASSERTMSG_(f, __ERROR_MSG)
Defines an assertion mechanism.
Definition: exceptions.h:101
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,qz).
Definition: CPose3DQuat.h:46
GLsizei const GLchar ** string
Definition: glext.h:4101
A class used to store a 2D point.
Definition: CPoint2D.h:33
A class used to store a 3D point.
Definition: CPoint3D.h:31
static constexpr size_type max_size()
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
_W64 int ptrdiff_t
Definition: glew.h:137
const GLdouble * v
Definition: glext.h:3678
static void resize(const size_t n)
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
CPose3DRotVec(TConstructorFlags_Poses constructor_dummy_param)
Fast constructor that leaves all the data uninitialized - call with UNINITIALIZED_POSE as argument...
Definition: CPose3DRotVec.h:65
mrpt::math::CArrayDouble< 3 > ln_rotation() const
Take the logarithm of the 3x3 rotation matrix part of this pose, generating the corresponding vector ...
bool operator==(const CPoint< DERIVEDCLASS > &p1, const CPoint< DERIVEDCLASS > &p2)
Definition: CPoint.h:164
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:86
CPose3DRotVec(const mrpt::math::CArrayDouble< 6 > &v)
Constructor with initilization of the pose from a vector [w1 w2 w3 x y z].
Definition: CPose3DRotVec.h:86
CPose3DRotVec & operator+=(const CPose3DRotVec &b)
Make (b can be "this" without problems)
std::string format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
Definition: format.cpp:16
mrpt::math::CArrayDouble< 3 > m_rotvec
The rotation vector [vx,vy,vz].
Definition: CPose3DRotVec.h:51
void toQuatXYZ(CPose3DQuat &q) const
Convert this RVT into a quaternion + XYZ.
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:30
void inverseComposeFrom(const CPose3DRotVec &A, const CPose3DRotVec &B)
Makes this method is slightly more efficient than "this= A - B;" since it avoids the temporary objec...
GLenum GLint GLint y
Definition: glext.h:3538
void composeFrom(const CPose3DRotVec &A, const CPose3DRotVec &B, mrpt::math::CMatrixFixedNumeric< double, 6, 6 > *out_jacobian_drvtC_drvtA=nullptr, mrpt::math::CMatrixFixedNumeric< double, 6, 6 > *out_jacobian_drvtC_drvtB=nullptr)
Makes "this = A (+) B"; this method is slightly more efficient than "this= A + B;" since it avoids th...
CPose3DRotVec(const CPose3DRotVec &o)
Copy constructor.
Definition: CPose3DRotVec.h:97
CPose3DRotVec & operator=(const CPose3DRotVec &o)
Copy operator.
CPose3DRotVec(const double *vec6)
Constructor from an array with these 6 elements: [w1 w2 w3 x y z] where r{ij} are the entries of the ...
A 3D pose, with a 3D translation and a rotation in 3D parameterized in rotation-vector form (equivale...
Definition: CPose3DRotVec.h:42
GLenum GLint x
Definition: glext.h:3538
A quaternion, which can represent a 3D rotation as pair , with a real part "r" and a 3D vector ...
Definition: CQuaternion.h:44
Lightweight 3D point.
void getAsVector(ARRAYORVECTOR &v) const
Like getAs6Vector() but for dynamic size vectors (required by base class CPoseOrPoint) ...
GLfloat GLfloat p
Definition: glext.h:6305
double value_type
The type of the elements.
CPose3DRotVec()
Default constructor, with all the coordinates set to zero.
Definition: CPose3DRotVec.h:57
std::ptrdiff_t difference_type
std::string asString() const
std::ostream & operator<<(std::ostream &o, const CPoint< DERIVEDCLASS > &p)
Dumps a point as a string [x,y] or [x,y,z].
Definition: CPoint.h:138
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
Definition: common.h:186
mrpt::math::CArrayDouble< 3 > m_coords
The translation vector [x,y,z].
Definition: CPose3DRotVec.h:49



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020