Main MRPT website > C++ reference
MRPT logo
CWirelessPowerGridMap2D.h
Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |
00003    |                                                                           |
00004    |                       http://www.mrpt.org/                                |
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 
00029 #ifndef CWirelessPowerGridMap2D_H
00030 #define CWirelessPowerGridMap2D_H
00031 
00032 #include <mrpt/slam/CRandomFieldGridMap2D.h>
00033 #include <mrpt/slam/CObservationWirelessPower.h>
00034 
00035 #include <mrpt/maps/link_pragmas.h>
00036 
00037 namespace mrpt
00038 {
00039 namespace slam
00040 {
00041         using namespace mrpt::utils;
00042         using namespace mrpt::poses;
00043         using namespace mrpt::math;
00044 
00045         DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CWirelessPowerGridMap2D , CRandomFieldGridMap2D, MAPS_IMPEXP )
00046 
00047 
00048         /** CWirelessPowerGridMap2D represents a PDF of wifi concentrations over a 2D area.
00049           *
00050           *  There are a number of methods available to build the wifi grid-map, depending on the value of
00051           *    "TMapRepresentation maptype" passed in the constructor.
00052           *
00053           *  The following papers describe the mapping alternatives implemented here:
00054           *             - mrKernelDM: A kernel-based method:
00055           *             "Building gas concentration gridmaps with a mobile robot", Lilienthal, A. and Duckett, T., Robotics and Autonomous Systems, v.48, 2004.
00056           *
00057           *             - mrKernelDMV: A kernel-based method:
00058           *             "A Statistical Approach to Gas Distribution Modelling with Mobile Robots--The Kernel DM+ V Algorithm"
00059           *       , Lilienthal, A.J. and Reggente, M. and Trincavelli, M. and Blanco, J.L. and Gonzalez, J., IROS 2009.
00060           *
00061           * \sa mrpt::slam::CRandomFieldGridMap2D, mrpt::slam::CMetricMap, mrpt::utils::CDynamicGrid, The application icp-slam, mrpt::slam::CMultiMetricMap
00062           * \ingroup mrpt_maps_grp
00063           */
00064         class MAPS_IMPEXP CWirelessPowerGridMap2D : public CRandomFieldGridMap2D
00065         {
00066                 // This must be added to any CSerializable derived class:
00067                 DEFINE_SERIALIZABLE( CWirelessPowerGridMap2D )
00068         public:
00069                 /** Constructor
00070                   */
00071                 CWirelessPowerGridMap2D(
00072                         TMapRepresentation      mapType = mrAchim,
00073             float                               x_min = -2,
00074                         float                           x_max = 2,
00075                         float                           y_min = -2,
00076                         float                           y_max = 2,
00077                         float                           resolution = 0.1
00078                         );
00079 
00080                 /** Destructor */
00081                 virtual ~CWirelessPowerGridMap2D();
00082 
00083 
00084                 /** Computes the likelihood that a given observation was taken from a given pose in the world being modeled with this map.
00085                  *
00086                  * \param takenFrom The robot's pose the observation is supposed to be taken from.
00087                  * \param obs The observation.
00088                  * \return This method returns a likelihood in the range [0,1].
00089                  *
00090                  * \sa Used in particle filter algorithms, see: CMultiMetricMapPDF::update
00091                  */
00092                  double  computeObservationLikelihood( const CObservation *obs, const CPose3D &takenFrom );
00093 
00094 
00095                 /** Parameters related with inserting observations into the map:
00096                   */
00097                 struct MAPS_IMPEXP TInsertionOptions :
00098                         public utils::CLoadableOptions,
00099                         public TInsertionOptionsCommon
00100                 {
00101                         TInsertionOptions();    //!< Default values loader
00102 
00103                         /** See utils::CLoadableOptions */
00104                         void  loadFromConfigFile(
00105                                 const mrpt::utils::CConfigFileBase  &source,
00106                                 const std::string &section);
00107 
00108                         void  dumpToTextStream(CStream  &out) const; //!< See utils::CLoadableOptions
00109 
00110                 } insertionOptions;
00111 
00112                 /** Returns an image just as described in \a saveAsBitmapFile */
00113                 virtual void  getAsBitmapFile(mrpt::utils::CImage &out_img) const;
00114 
00115                 /** The implementation in this class just calls all the corresponding method of the contained metric maps.
00116                   */
00117                 void  saveMetricMapRepresentationToFile(
00118                         const std::string       &filNamePrefix
00119                         ) const;
00120 
00121                 /** Save a matlab ".m" file which represents as 3D surfaces the mean and a given confidence level for the concentration of each cell.
00122                   *  This method can only be called in a KF map model.
00123                   */
00124                 void  saveAsMatlab3DGraph(const std::string  &filName) const;
00125 
00126                 /** Returns a 3D object representing the map.
00127                   */
00128                 void  getAs3DObject ( mrpt::opengl::CSetOfObjectsPtr    &outObj ) const;
00129 
00130         protected:
00131                 /** Get the part of the options common to all CRandomFieldGridMap2D classes */
00132                 virtual CRandomFieldGridMap2D::TInsertionOptionsCommon * getCommonInsertOptions() {
00133                         return &insertionOptions;
00134                 }
00135 
00136                  /** Erase all the contents of the map
00137                   */
00138                  virtual void  internal_clear();
00139 
00140                  /** Insert the observation information into this map. This method must be implemented
00141                   *    in derived classes.
00142                   * \param obs The observation
00143                   * \param robotPose The 3D pose of the robot mobile base in the map reference system, or NULL (default) if you want to use CPose2D(0,0,deg)
00144                   *
00145                   * \sa CObservation::insertObservationInto
00146                   */
00147                  virtual bool  internal_insertObservation( const CObservation *obs, const CPose3D *robotPose = NULL );
00148 
00149 
00150         };
00151 
00152 
00153         } // End of namespace
00154 
00155 } // End of namespace
00156 
00157 #endif



Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011