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



Page generated by Doxygen 1.9.1 for MRPT 1.9.9 Git: 63ea9d1f1 Thu Nov 23 00:06:53 2017 +0100 at mar 26 may 2026 12:19:29 CEST