Main MRPT website > C++ reference for MRPT 1.5.6
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-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 #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  const size_t DIMS = POINT_OR_POSE::static_size;
25  C.resize(DIMS,1);
26  for (size_t i=0;i<DIMS;i++) C.coeffRef(i,0)= static_cast<typename CONTAINER::Scalar>(p[i]);
27  return C;
28  }
29 
30  /** @} */
31 
32  } // End of math namespace
33 } // End of mrpt namespace
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.
double Scalar
Definition: KmUtils.h:41
GLfloat GLfloat p
Definition: glext.h:5587



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019