Main MRPT website > C++ reference for MRPT 1.4.0
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-2016, 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>
16
17namespace mrpt
18{
19namespace poses
20{
22
23 /** A 3D pose, with a 3D translation and a rotation in 3D parameterized in rotation-vector form (equivalent to axis-angle).
24 * The 6D transformation in SE(3) stored in this class is kept in two
25 * separate containers: a 3-array for the rotation vector, and a 3-array for 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, or refer
34 * to the <a href="http://www.mrpt.org/2D_3D_Geometry"> 2D/3D Geometry tutorial</a> online.
35 *
36 * There are Lie algebra methods: \a exp and \a ln (see the methods for documentation).
37 *
38 * \ingroup poses_grp
39 * \sa CPose3DRotVec, CPoseOrPoint,CPoint3D, mrpt::math::CQuaternion
40 */
41 class BASE_IMPEXP CPose3DRotVec : public CPose<CPose3DRotVec>, public mrpt::utils::CSerializable
42 {
43 // This must be added to any CSerializable derived class:
45
46 public:
47 mrpt::math::CArrayDouble<3> m_coords; //!< The translation vector [x,y,z]
48 mrpt::math::CArrayDouble<3> m_rotvec; //!< The rotation vector [vx,vy,vz]
49
50 /** @name Constructors
51 @{ */
52
53 /** Default constructor, with all the coordinates set to zero. */
54 inline CPose3DRotVec() {
55 m_coords[0]=m_coords[1]=m_coords[2]=0;
56 m_rotvec[0]=m_rotvec[1]=m_rotvec[2]=0;
57 }
58
59 /** Fast constructor that leaves all the data uninitialized - call with UNINITIALIZED_POSE as argument */
60 inline CPose3DRotVec(TConstructorFlags_Poses constructor_dummy_param) : m_coords(),m_rotvec() {
61 MRPT_UNUSED_PARAM(constructor_dummy_param);
62 }
63
64 /** Constructor with initilization of the pose */
65 inline CPose3DRotVec(const double vx, const double vy, const double vz, const double x,const double y,const double z) {
66 m_coords[0]= x; m_coords[1]= y; m_coords[2]= z;
67 m_rotvec[0]=vx; m_rotvec[1]=vy; m_rotvec[2]=vz;
68 }
69
70 /** Constructor with initilization of the pose from a vector [w1 w2 w3 x y z] */
72 m_rotvec[0]=v[0]; m_rotvec[1]=v[1]; m_rotvec[2]=v[2];
73 m_coords[0]=v[3]; m_coords[1]=v[4]; m_coords[2]=v[5];
74 }
75
76 /** Copy constructor */
78 {
79 this->m_rotvec = o.m_rotvec;
80 this->m_coords = o.m_coords;
81 }
82
83 /** Constructor from a 4x4 homogeneous matrix: */
85
86 /** Constructor from a CPose3D object.*/
87 explicit CPose3DRotVec(const CPose3D &m);
88
89 /** Constructor from a quaternion (which only represents the 3D rotation part) and a 3D displacement. */
90 CPose3DRotVec(const mrpt::math::CQuaternionDouble &q, const double x, const double y, const double z );
91
92 /** Constructor from an array with these 6 elements: [w1 w2 w3 x y z]
93 * where r{ij} are the entries of the 3x3 rotation matrix and t{x,y,z} are the 3D translation of the pose
94 * \sa setFrom12Vector, getAs12Vector
95 */
96 inline explicit CPose3DRotVec(const double *vec6) {
97 m_coords[0]=vec6[3]; m_coords[1]=vec6[4]; m_coords[2]=vec6[5];
98 m_rotvec[0]=vec6[0]; m_rotvec[1]=vec6[1]; m_rotvec[2]=vec6[2];
99 }
100
101 /** @} */ // end Constructors
102
103
104 /** @name Access 3x3 rotation and 4x4 homogeneous matrices
105 @{ */
106
107 /** Returns the corresponding 4x4 homogeneous transformation matrix for the point(translation) or pose (translation+orientation).
108 * \sa getInverseHomogeneousMatrix, getRotationMatrix
109 */
111 out_HM.block<3,3>(0,0) = getRotationMatrix();
112 out_HM.set_unsafe(0,3,m_coords[0]);
113 out_HM.set_unsafe(1,3,m_coords[1]);
114 out_HM.set_unsafe(2,3,m_coords[2]);
115 out_HM.set_unsafe(3,0,0); out_HM.set_unsafe(3,1,0); out_HM.set_unsafe(3,2,0); out_HM.set_unsafe(3,3,1);
116 }
117
118 inline mrpt::math::CMatrixDouble44 getHomogeneousMatrixVal() const { mrpt::math::CMatrixDouble44 M; getHomogeneousMatrix(M); return M;}
119
120 /** Get the 3x3 rotation matrix \sa getHomogeneousMatrix */
122 //! \overload
124
125 /** @} */ // end rot and HM
126
127
128 /** @name Pose-pose and pose-point compositions and operators
129 @{ */
130
131 /** The operator \f$ a \oplus b \f$ is the pose compounding operator. */
133 {
135 ret.composeFrom(*this,b);
136 return ret;
137 }
138
139 /** The operator \f$ a \oplus b \f$ is the pose compounding operator. */
141
142 /** The operator \f$ a \oplus b \f$ is the pose compounding operator. */
144
146 {
147 mrpt::math::CArrayDouble<3> aux = rotVecFromRotMat( m );
148
149 this->m_rotvec[0] = aux[0];
150 this->m_rotvec[1] = aux[1];
151 this->m_rotvec[2] = aux[2];
152
153 this->m_coords[0] = m.get_unsafe(0,3);
154 this->m_coords[1] = m.get_unsafe(1,3);
155 this->m_coords[2] = m.get_unsafe(2,3);
156 }
157
158 void setFromXYZAndAngles( const double x,const double y,const double z,const double yaw=0, const double pitch=0, const double roll=0 );
159
160 /** Computes the spherical coordinates of a 3D point as seen from the 6D pose specified by this object. For the coordinate system see mrpt::poses::CPose3D */
162 const mrpt::math::TPoint3D &point,
163 double &out_range,
164 double &out_yaw,
165 double &out_pitch ) const;
166
167 /** An alternative, slightly more efficient way of doing \f$ G = P \oplus L \f$ with G and L being 3D points and P this 6D pose.
168 * If pointers are provided, the corresponding Jacobians are returned.
169 * See <a href="http://www.mrpt.org/6D_poses:equivalences_compositions_and_uncertainty" >this report</a> for mathematical details.
170 */
171 void composePoint(double lx,double ly,double lz, double &gx, double &gy, double &gz,
172 mrpt::math::CMatrixFixedNumeric<double,3,3> *out_jacobian_df_dpoint=NULL,
173 mrpt::math::CMatrixFixedNumeric<double,3,6> *out_jacobian_df_dpose=NULL) const;
174
175 /** An alternative, slightly more efficient way of doing \f$ G = P \oplus L \f$ with G and L being 3D points and P this 6D pose.
176 * \note local_point is passed by value to allow global and local point to be the same variable
177 */
178 inline void composePoint(const mrpt::math::TPoint3D local_point, mrpt::math::TPoint3D &global_point) const {
179 composePoint(local_point.x,local_point.y,local_point.z, global_point.x,global_point.y,global_point.z );
180 }
181
182 /** Computes the 3D point L such as \f$ L = G \ominus this \f$.
183 * If pointers are provided, the corresponding Jacobians are returned.
184 * See <a href="http://www.mrpt.org/6D_poses:equivalences_compositions_and_uncertainty" >this report</a> for mathematical details.
185 * \sa composePoint, composeFrom
186 */
187 void inverseComposePoint(const double gx,const double gy,const double gz,double &lx,double &ly,double &lz,
188 mrpt::math::CMatrixFixedNumeric<double,3,3> *out_jacobian_df_dpoint=NULL,
189 mrpt::math::CMatrixFixedNumeric<double,3,6> *out_jacobian_df_dpose=NULL) const;
190
191 /** Makes "this = A (+) B"; this method is slightly more efficient than "this= A + B;" since it avoids the temporary object.
192 * \note A or B can be "this" without problems.
193 */
195 const CPose3DRotVec& B,
196 mrpt::math::CMatrixFixedNumeric<double,6,6> *out_jacobian_drvtC_drvtA=NULL,
197 mrpt::math::CMatrixFixedNumeric<double,6,6> *out_jacobian_drvtC_drvtB=NULL);
198
199
200 /** Convert this RVT into a quaternion + XYZ
201 */
202 void toQuatXYZ(CPose3DQuat &q) const;
203
204 /** Make \f$ this = this \oplus b \f$ (\a b can be "this" without problems) */
206 {
207 composeFrom(*this,b);
208 return *this;
209 }
210
211 /** Copy operator */
212 inline CPose3DRotVec& operator = (const CPose3DRotVec& o)
213 {
214 this->m_rotvec = o.m_rotvec;
215 this->m_coords = o.m_coords;
216 return *this;
217 }
218
219 /** Makes \f$ this = A \ominus B \f$ this method is slightly more efficient than "this= A - B;" since it avoids the temporary object.
220 * \note A or B can be "this" without problems.
221 * \sa composeFrom, composePoint
222 */
224
225 /** Compute \f$ RET = this \oplus b \f$ */
227 {
229 ret.inverseComposeFrom(*this,b);
230 return ret;
231 }
232
233 /** Convert this pose into its inverse, saving the result in itself. \sa operator- */
234 void inverse();
235
236 /** Compute the inverse of this pose and return the result. */
238
239 /** makes: this = p (+) this */
240 inline void changeCoordinatesReference( const CPose3DRotVec & p ) { composeFrom(p,CPose3DRotVec(*this)); }
241
242 /** @} */ // compositions
243
244
245 /** @name Access and modify contents
246 @{ */
247
248 inline double rx() const { return m_rotvec[0]; }
249 inline double ry() const { return m_rotvec[1]; }
250 inline double rz() const { return m_rotvec[2]; }
251
252 inline double &rx() { return m_rotvec[0]; }
253 inline double &ry() { return m_rotvec[1]; }
254 inline double &rz() { return m_rotvec[2]; }
255
256 /** Scalar sum of all 6 components: This is diferent from poses composition, which is implemented as "+" operators. */
257 inline void addComponents(const CPose3DRotVec &p) {
258 m_coords+=p.m_coords;
259 m_rotvec+=p.m_rotvec;
260 }
261
262 /** Scalar multiplication of x,y,z,vx,vy,vz. */
263 inline void operator *=(const double s) {
264 m_coords*=s;
265 m_rotvec*=s;
266 }
267
268 /** Create a vector with 3 components according to the input transformation matrix (only the rotation will be taken into account)
269 */
271
272 /** Set the pose from a 3D position (meters) and yaw/pitch/roll angles (radians) - This method recomputes the internal rotation matrix.
273 * \sa getYawPitchRoll, setYawPitchRoll
274 */
276 const double x0,
277 const double y0,
278 const double z0,
279 const double vx,
280 const double vy,
281 const double vz )
282 {
283 m_coords[0]=x0; m_coords[1]=y0; m_coords[2]=z0;
284 m_rotvec[0]=vx; m_rotvec[1]=vy; m_rotvec[2]=vz;
285 }
286
287 /** Set pose from an array with these 6 elements: [x y z vx vy vz]
288 * where v{xyz} is the rotation vector and {xyz} the 3D translation of the pose
289 * \sa getAs6Vector
290 */
291 template <class ARRAYORVECTOR>
292 inline void setFrom6Vector(const ARRAYORVECTOR &vec6)
293 {
294 m_rotvec[0]=vec6[3]; m_rotvec[1]=vec6[4]; m_rotvec[2]=vec6[5];
295 m_coords[0]=vec6[0]; m_coords[1]=vec6[1]; m_coords[2]=vec6[2];
296 }
297
298 /** Gets pose as an array with these 6 elements: [x y z vx vy vz]
299 * where v{xyz} is the rotation vector and {xyz} the 3D translation of the pose
300 * The target vector MUST ALREADY have space for 6 elements (i.e. no .resize() method will be called).
301 * \sa setAs6Vector, getAsVector
302 */
303 template <class ARRAYORVECTOR>
304 inline void getAs6Vector(ARRAYORVECTOR &vec6) const
305 {
306 vec6[0]=m_coords[0]; vec6[1]=m_coords[1]; vec6[2]=m_coords[2];
307 vec6[3]=m_rotvec[0]; vec6[4]=m_rotvec[1]; vec6[5]=m_rotvec[2];
308 }
309
310 /** Like getAs6Vector() but for dynamic size vectors (required by base class CPoseOrPoint) */
311 template <class ARRAYORVECTOR>
312 inline void getAsVector(ARRAYORVECTOR &v) const { v.resize(6); getAs6Vector(v); }
313
314 inline const double &operator[](unsigned int i) const
315 {
316 switch(i)
317 {
318 case 0:return m_coords[0];
319 case 1:return m_coords[1];
320 case 2:return m_coords[2];
321 case 3:return m_rotvec[0];
322 case 4:return m_rotvec[1];
323 case 5:return m_rotvec[2];
324 default:
325 throw std::runtime_error("CPose3DRotVec::operator[]: Index of bounds.");
326 }
327 }
328 inline double &operator[](unsigned int i)
329 {
330 switch(i)
331 {
332 case 0:return m_coords[0];
333 case 1:return m_coords[1];
334 case 2:return m_coords[2];
335 case 3:return m_rotvec[0];
336 case 4:return m_rotvec[1];
337 case 5:return m_rotvec[2];
338 default:
339 throw std::runtime_error("CPose3DRotVec::operator[]: Index of bounds.");
340 }
341 }
342
343 /** Returns a human-readable textual representation of the object: "[x y z rx ry rz]"
344 * \sa fromString
345 */
346 void asString(std::string &s) const { s = mrpt::format("[%f %f %f %f %f %f]",m_coords[0],m_coords[1],m_coords[2],m_rotvec[0],m_rotvec[1],m_rotvec[2]); }
347 inline std::string asString() const { std::string s; asString(s); return s; }
348
349 /** Set the current object value from a string generated by 'asString' (eg: "[x y z yaw pitch roll]", angles in deg. )
350 * \sa asString
351 * \exception std::exception On invalid format
352 */
353 void fromString(const std::string &s) {
355 if (!m.fromMatlabStringFormat(s)) THROW_EXCEPTION("Malformed expression in ::fromString");
356 ASSERTMSG_(mrpt::math::size(m,1)==1 && mrpt::math::size(m,2)==6, "Wrong size of vector in ::fromString");
357 for (int i=0;i<3;i++) m_coords[i]=m.get_unsafe(0,i);
358 for (int i=0;i<3;i++) m_rotvec[i]=m.get_unsafe(0,3+i);
359 }
360
361 /** @} */ // modif. components
362
363
364 /** @name Lie Algebra methods
365 @{ */
366
367 /** Exponentiate a Vector in the SE(3) Lie Algebra to generate a new CPose3DRotVec (static method). */
369
370 /** Take the logarithm of the 3x4 matrix defined by this pose, generating the corresponding vector in the SE(3) Lie Algebra. */
371 void ln(mrpt::math::CArrayDouble<6> &out_ln) const;
372
373 /** Take the logarithm of the 3x3 rotation matrix part of this pose, generating the corresponding vector in the Lie Algebra. */
375
376 /** @} */
377
378 typedef CPose3DRotVec type_value; //!< Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses
379 enum { is_3D_val = 1 };
380 static inline bool is_3D() { return is_3D_val!=0; }
381 enum { rotation_dimensions = 3 };
382 enum { is_PDF_val = 0 };
383 static inline bool is_PDF() { return is_PDF_val!=0; }
384
385 inline const type_value & getPoseMean() const { return *this; }
386 inline type_value & getPoseMean() { return *this; }
387
389
390 /** @name STL-like methods and typedefs
391 @{ */
392 typedef double value_type; //!< The type of the elements
393 typedef double& reference;
394 typedef const double& const_reference;
395 typedef std::size_t size_type;
396 typedef std::ptrdiff_t difference_type;
397
398
399 // size is constant
400 enum { static_size = 6 };
401 static inline size_type size() { return static_size; }
402 static inline bool empty() { return false; }
403 static inline size_type max_size() { return static_size; }
404 static inline void resize(const size_t n) { if (n!=static_size) throw std::logic_error(format("Try to change the size of CPose3DRotVec to %u.",static_cast<unsigned>(n))); }
405 /** @} */
406
407 }; // End of class def.
408 DEFINE_SERIALIZABLE_POST( CPose3DRotVec )
409
410
411 std::ostream BASE_IMPEXP & operator << (std::ostream& o, const CPose3DRotVec& p);
412
413 /** Unary - operator: return the inverse pose "-p" (Note that is NOT the same than a pose with negative x y z yaw pitch roll) */
415
416 bool BASE_IMPEXP operator==(const CPose3DRotVec &p1,const CPose3DRotVec &p2);
417 bool BASE_IMPEXP operator!=(const CPose3DRotVec &p1,const CPose3DRotVec &p2);
418
419
420 } // End of namespace
421} // End of namespace
422
423#endif
#define DEFINE_SERIALIZABLE_PRE(class_name)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
#define DEFINE_SERIALIZABLE_POST(class_name)
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:43
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:73
A class used to store a 3D pose as a translation (x,y,z) and a quaternion (qr,qx,qy,...
Definition: CPose3DQuat.h:42
A 3D pose, with a 3D translation and a rotation in 3D parameterized in rotation-vector form (equivale...
Definition: CPose3DRotVec.h:42
CPose3DRotVec(TConstructorFlags_Poses constructor_dummy_param)
Fast constructor that leaves all the data uninitialized - call with UNINITIALIZED_POSE as argument.
Definition: CPose3DRotVec.h:60
double & operator[](unsigned int i)
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...
std::string asString() const
CPose3DRotVec(const math::CMatrixDouble44 &m)
Constructor from a 4x4 homogeneous matrix:
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.
const double & operator[](unsigned int i) const
void getAsVector(ARRAYORVECTOR &v) const
Like getAs6Vector() but for dynamic size vectors (required by base class CPoseOrPoint)
std::ptrdiff_t difference_type
void inverse()
Convert this pose into its inverse, saving the result in itself.
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...
void setToNaN() MRPT_OVERRIDE
Set all data fields to quiet NaN.
void setFromXYZAndAngles(const double x, const double y, const double z, const double yaw=0, const double pitch=0, const double roll=0)
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]".
CPose3DRotVec(const mrpt::math::CQuaternionDouble &q, const double x, const double y, const double z)
Constructor from a quaternion (which only represents the 3D rotation part) and a 3D displacement.
const type_value & getPoseMean() const
static size_type max_size()
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...
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 ...
Definition: CPose3DRotVec.h:96
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 "+" ...
const double & const_reference
void getRotationMatrix(mrpt::math::CMatrixDouble33 &ROT) const
Get the 3x3 rotation matrix.
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:71
void toQuatXYZ(CPose3DQuat &q) const
Convert this RVT into a quaternion + XYZ.
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=NULL, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=NULL) const
Computes the 3D point L such as .
CPose3DRotVec(const CPose3DRotVec &o)
Copy constructor.
Definition: CPose3DRotVec.h:77
mrpt::math::CArrayDouble< 3 > ln_rotation() const
Take the logarithm of the 3x3 rotation matrix part of this pose, generating the corresponding vector ...
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).
const mrpt::math::CMatrixDouble33 getRotationMatrix() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
CPose3DRotVec(const CPose3D &m)
Constructor from a CPose3D object.
void composeFrom(const CPose3DRotVec &A, const CPose3DRotVec &B, mrpt::math::CMatrixFixedNumeric< double, 6, 6 > *out_jacobian_drvtC_drvtA=NULL, mrpt::math::CMatrixFixedNumeric< double, 6, 6 > *out_jacobian_drvtC_drvtB=NULL)
Makes "this = A (+) B"; this method is slightly more efficient than "this= A + B;" since it avoids th...
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...
void changeCoordinatesReference(const CPose3DRotVec &p)
makes: this = p (+) this
CPose3DRotVec()
Default constructor, with all the coordinates set to zero.
Definition: CPose3DRotVec.h:54
CPose3DRotVec type_value
Used to emulate CPosePDF types, for example, in mrpt::graphs::CNetworkOfPoses.
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:65
mrpt::math::CArrayDouble< 3 > m_rotvec
The rotation vector [vx,vy,vz].
Definition: CPose3DRotVec.h:48
CPose3DRotVec getInverse() const
Compute the inverse of this pose and return the result.
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:47
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 composePoint(double lx, double ly, double lz, double &gx, double &gy, double &gz, mrpt::math::CMatrixFixedNumeric< double, 3, 3 > *out_jacobian_df_dpoint=NULL, mrpt::math::CMatrixFixedNumeric< double, 3, 6 > *out_jacobian_df_dpose=NULL) const
An alternative, slightly more efficient way of doing with G and L being 3D points and P this 6D pose...
A base class for representing a pose in 2D or 3D.
Definition: CPose.h:26
@ static_size
Definition: eigen_plugins.h:17
std::vector< T1 > & operator*=(std::vector< T1 > &a, const std::vector< T2 > &b)
a*=b (element-wise multiplication)
Definition: ops_vectors.h:40
std::vector< T1 > & operator+=(std::vector< T1 > &a, const std::vector< T2 > &b)
a+=b (element-wise sum)
Definition: ops_vectors.h:70
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
Definition: mrpt_macros.h:28
#define THROW_EXCEPTION(msg)
Definition: mrpt_macros.h:110
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
Definition: mrpt_macros.h:290
#define ASSERTMSG_(f, __ERROR_MSG)
Definition: mrpt_macros.h:260
@ UNINITIALIZED_MATRIX
Definition: math_frwds.h:75
size_t size(const MATRIXLIKE &m, int dim)
Definition: bits.h:38
CPose2D BASE_IMPEXP operator-(const CPose2D &p)
Unary - operator: return the inverse pose "-p" (Note that is NOT the same than a pose with negative x...
@ UNINITIALIZED_POSE
Definition: CPoseOrPoint.h:35
mrpt::math::TPoint2D BASE_IMPEXP operator+(const CPose2D &pose, const mrpt::math::TPoint2D &pnt)
Compose a 2D point from a new coordinate base given by a 2D pose.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
STL namespace.
Lightweight 3D point.
double z
X,Y,Z coordinates.



Page generated by Doxygen 1.9.4 for MRPT 1.4.0 SVN: at Thu Aug 4 01:35:14 UTC 2022