Main MRPT website > C++ reference
MRPT logo

helper_templates.h

Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |
00003    |                                                                           |
00004    |                   http://mrpt.sourceforge.net/                            |
00005    |                                                                           |
00006    |   Copyright (C) 2005-2011  University of Malaga                           |
00007    |                                                                           |
00008    |    This software was written by the Machine Perception and Intelligent    |
00009    |      Robotics Lab, University of Malaga (Spain).                          |
00010    |    Contact: Jose-Luis Blanco  <jlblanco@ctima.uma.es>                     |
00011    |                                                                           |
00012    |  This file is part of the MRPT project.                                   |
00013    |                                                                           |
00014    |     MRPT is free software: you can redistribute it and/or modify          |
00015    |     it under the terms of the GNU General Public License as published by  |
00016    |     the Free Software Foundation, either version 3 of the License, or     |
00017    |     (at your option) any later version.                                   |
00018    |                                                                           |
00019    |   MRPT is distributed in the hope that it will be useful,                 |
00020    |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |
00021    |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |
00022    |     GNU General Public License for more details.                          |
00023    |                                                                           |
00024    |     You should have received a copy of the GNU General Public License     |
00025    |     along with MRPT.  If not, see <http://www.gnu.org/licenses/>.         |
00026    |                                                                           |
00027    +---------------------------------------------------------------------------+ */
00028 #ifndef MRPT_POSES_HELPERS_H
00029 #define MRPT_POSES_HELPERS_H
00030 
00031 #include <mrpt/poses/CPose3D.h>
00032 #include <mrpt/poses/CPose2D.h>
00033 #include <mrpt/poses/CPose3DQuat.h>
00034 
00035 #include <mrpt/poses/CPosePDFGaussian.h>
00036 #include <mrpt/poses/CPose3DPDFGaussian.h>
00037 #include <mrpt/poses/CPose3DQuatPDFGaussian.h>
00038 #include <mrpt/poses/CPosePDFGaussianInf.h>
00039 #include <mrpt/poses/CPose3DPDFGaussianInf.h>
00040 
00041 namespace mrpt
00042 {
00043         namespace poses
00044         {
00045                 /**  @name Helper templates to convert a pose or a pose PDF to its mean value at compile time.
00046                          @{
00047                   */
00048                 template <class POSE> inline const typename POSE::type_value &getPoseMean(const POSE &p);
00049                 template <class POSE> inline       typename POSE::type_value &getPoseMean(      POSE &p);
00050 
00051                 template <> inline const CPose2D &getPoseMean<CPose2D>(const CPose2D &p) { return p;}
00052                 template <> inline const CPose3D &getPoseMean<CPose3D>(const CPose3D &p) { return p;}
00053                 template <> inline const CPose3DQuat &getPoseMean<CPose3DQuat>(const CPose3DQuat &p) { return p;}
00054                 template <> inline       CPose2D &getPoseMean<CPose2D>(CPose2D &p) { return p;}
00055                 template <> inline       CPose3D &getPoseMean<CPose3D>(CPose3D &p) { return p;}
00056                 template <> inline       CPose3DQuat &getPoseMean<CPose3DQuat>(CPose3DQuat &p) { return p;}
00057 
00058                 template <> inline const CPose2D &getPoseMean<CPosePDFGaussian>(const CPosePDFGaussian &p) { return p.mean;}
00059                 template <> inline const CPose2D &getPoseMean<CPosePDFGaussianInf>(const CPosePDFGaussianInf &p) { return p.mean;}
00060                 template <> inline const CPose3D &getPoseMean<CPose3DPDFGaussian>(const CPose3DPDFGaussian &p) { return p.mean;}
00061                 template <> inline const CPose3D &getPoseMean<CPose3DPDFGaussianInf>(const CPose3DPDFGaussianInf &p) { return p.mean;}
00062                 template <> inline const CPose3DQuat &getPoseMean<CPose3DQuatPDFGaussian>(const CPose3DQuatPDFGaussian &p) { return p.mean;}
00063 
00064                 template <> inline       CPose2D &getPoseMean<CPosePDFGaussian>(CPosePDFGaussian &p) { return p.mean;}
00065                 template <> inline       CPose2D &getPoseMean<CPosePDFGaussianInf>(CPosePDFGaussianInf &p) { return p.mean;}
00066                 template <> inline       CPose3D &getPoseMean<CPose3DPDFGaussian>(CPose3DPDFGaussian &p) { return p.mean;}
00067                 template <> inline       CPose3D &getPoseMean<CPose3DPDFGaussianInf>(CPose3DPDFGaussianInf &p) { return p.mean;}
00068                 template <> inline       CPose3DQuat &getPoseMean<CPose3DQuatPDFGaussian>(CPose3DQuatPDFGaussian &p) { return p.mean;}
00069                 /** @}  */
00070 
00071         } // End of namespace
00072 } // End of namespace
00073 
00074 #endif



Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011