Main MRPT website > C++ reference for MRPT 1.9.9
point_poses2vectors.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 #pragma once
10 
11 #include <mrpt/math/math_frwds.h> // forward declarations
12 
13 namespace mrpt
14 {
15 namespace math
16 {
17 /** \name Container initializer from pose classes
18  * @{
19  */
20 
21 /** Conversion of poses to MRPT containers (vector/matrix) */
22 template <class CONTAINER, class POINT_OR_POSE>
23 CONTAINER& containerFromPoseOrPoint(CONTAINER& C, const POINT_OR_POSE& p)
24 {
25  const size_t DIMS = POINT_OR_POSE::static_size;
26  C.resize(DIMS, 1);
27  for (size_t i = 0; i < DIMS; i++)
28  C.coeffRef(i, 0) = static_cast<typename CONTAINER::Scalar>(p[i]);
29  return C;
30 }
31 
32 /** @} */
33 
34 } // End of math namespace
35 } // End of mrpt namespace
double Scalar
Definition: KmUtils.h:44
CONTAINER & containerFromPoseOrPoint(CONTAINER &C, const POINT_OR_POSE &p)
Conversion of poses (TPose2D,TPoint2D,..., mrpt::poses::CPoint2D,CPose3D,...) to MRPT containers (vec...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLfloat GLfloat p
Definition: glext.h:6305



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019