Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 4bc66056a634db26a1f4d0845dc41ca6 > files > 662

mrpt-doc-0.9.5-0.1.20110925svn2670.fc16.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>CHeightGridMap2D.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<div align="left"><a href="http://www.mrpt.org/">Main MRPT website</a> &gt; <b>C++ reference</b> </div>
<div align="right">
<a href="index.html"><img border="0" src="mrpt_logo.png" alt="MRPT logo"></a>
</div>
<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
          <div class="left">
            <form id="FSearchBox" action="search.php" method="get">
              <img id="MSearchSelect" src="search/mag.png" alt=""/>
              <input type="text" id="MSearchField" name="query" value="Search" size="20" accesskey="S" 
                     onfocus="searchBox.OnSearchFieldFocus(true)" 
                     onblur="searchBox.OnSearchFieldFocus(false)"/>
            </form>
          </div><div class="right"></div>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">CHeightGridMap2D.h</div>  </div>
</div>
<div class="contents">
<a href="_c_height_grid_map2_d_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* +---------------------------------------------------------------------------+</span>
<a name="l00002"></a>00002 <span class="comment">   |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |</span>
<a name="l00003"></a>00003 <span class="comment">   |                                                                           |</span>
<a name="l00004"></a>00004 <span class="comment">   |                       http://www.mrpt.org/                                |</span>
<a name="l00005"></a>00005 <span class="comment">   |                                                                           |</span>
<a name="l00006"></a>00006 <span class="comment">   |   Copyright (C) 2005-2011  University of Malaga                           |</span>
<a name="l00007"></a>00007 <span class="comment">   |                                                                           |</span>
<a name="l00008"></a>00008 <span class="comment">   |    This software was written by the Machine Perception and Intelligent    |</span>
<a name="l00009"></a>00009 <span class="comment">   |      Robotics Lab, University of Malaga (Spain).                          |</span>
<a name="l00010"></a>00010 <span class="comment">   |    Contact: Jose-Luis Blanco  &lt;jlblanco@ctima.uma.es&gt;                     |</span>
<a name="l00011"></a>00011 <span class="comment">   |                                                                           |</span>
<a name="l00012"></a>00012 <span class="comment">   |  This file is part of the MRPT project.                                   |</span>
<a name="l00013"></a>00013 <span class="comment">   |                                                                           |</span>
<a name="l00014"></a>00014 <span class="comment">   |     MRPT is free software: you can redistribute it and/or modify          |</span>
<a name="l00015"></a>00015 <span class="comment">   |     it under the terms of the GNU General Public License as published by  |</span>
<a name="l00016"></a>00016 <span class="comment">   |     the Free Software Foundation, either version 3 of the License, or     |</span>
<a name="l00017"></a>00017 <span class="comment">   |     (at your option) any later version.                                   |</span>
<a name="l00018"></a>00018 <span class="comment">   |                                                                           |</span>
<a name="l00019"></a>00019 <span class="comment">   |   MRPT is distributed in the hope that it will be useful,                 |</span>
<a name="l00020"></a>00020 <span class="comment">   |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |</span>
<a name="l00021"></a>00021 <span class="comment">   |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |</span>
<a name="l00022"></a>00022 <span class="comment">   |     GNU General Public License for more details.                          |</span>
<a name="l00023"></a>00023 <span class="comment">   |                                                                           |</span>
<a name="l00024"></a>00024 <span class="comment">   |     You should have received a copy of the GNU General Public License     |</span>
<a name="l00025"></a>00025 <span class="comment">   |     along with MRPT.  If not, see &lt;http://www.gnu.org/licenses/&gt;.         |</span>
<a name="l00026"></a>00026 <span class="comment">   |                                                                           |</span>
<a name="l00027"></a>00027 <span class="comment">   +---------------------------------------------------------------------------+ */</span>
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 <span class="preprocessor">#ifndef CHeightGridMap2D_H</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define CHeightGridMap2D_H</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="_c_dynamic_grid_8h.html">mrpt/utils/CDynamicGrid.h</a>&gt;</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include &lt;<a class="code" href="_c_serializable_8h.html">mrpt/utils/CSerializable.h</a>&gt;</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;<a class="code" href="_c_matrix_d_8h.html">mrpt/math/CMatrixD.h</a>&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;<a class="code" href="geometry_8h.html">mrpt/math/geometry.h</a>&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;<a class="code" href="os_8h.html">mrpt/system/os.h</a>&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;<a class="code" href="_c_loadable_options_8h.html">mrpt/utils/CLoadableOptions.h</a>&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#include &lt;<a class="code" href="stl__extensions_8h.html">mrpt/utils/stl_extensions.h</a>&gt;</span>
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;<a class="code" href="_c_metric_map_8h.html">mrpt/slam/CMetricMap.h</a>&gt;</span>
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;<a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html">mrpt/maps/link_pragmas.h</a>&gt;</span>
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 <span class="keyword">namespace </span>mrpt
<a name="l00045"></a>00045 {
<a name="l00046"></a>00046         <span class="keyword">namespace </span>poses
<a name="l00047"></a>00047         {
<a name="l00048"></a>00048                 <span class="keyword">class </span>CPose2D;
<a name="l00049"></a>00049         }
<a name="l00050"></a>00050         <span class="keyword">namespace </span>slam
<a name="l00051"></a>00051         {
<a name="l00052"></a>00052                 <span class="keyword">using namespace </span>mrpt::utils;
<a name="l00053"></a>00053 
<a name="l00054"></a>00054                 <span class="keyword">class </span>CObservation;
<a name="l00055"></a>00055 
<a name="l00056"></a><a class="code" href="structmrpt_1_1slam_1_1_c_height_grid_map2_d_ptr.html#a1af7ef0eb1fc8a3fbc3a5a8cb432261a">00056</a>                 <a class="code" href="_c_serializable_8h.html#a9ef523d787f6cb837a0585b790882588" title="This declaration must be inserted in all CSerializable classes definition, before the class declarati...">DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE</a>( <a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html" title="A mesh representation of a surface which keeps the estimated height for each (x,y) location...">CHeightGridMap2D</a>, <a class="code" href="classmrpt_1_1slam_1_1_c_metric_map.html" title="Declares a virtual base class for all metric maps storage classes.">CMetricMap</a>, <a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a>  )
<a name="l00057"></a>00057 
<a name="l00058"></a>00058                 <span class="comment">/** The contents of each cell in a CHeightGridMap2D map.</span>
<a name="l00059"></a>00059 <span class="comment">                 **/</span>
<a name="l00060"></a>00060                 struct <a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> <a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html" title="The contents of each cell in a CHeightGridMap2D map.">THeightGridmapCell</a>
<a name="l00061"></a>00061                 {<span class="comment"></span>
<a name="l00062"></a>00062 <span class="comment">                        /** Constructor</span>
<a name="l00063"></a>00063 <span class="comment">                          */</span>
<a name="l00064"></a><a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html#a4e73dfa9811586068c9f3a225f3b6f53">00064</a>                         THeightGridmapCell() : h(0), w(0)
<a name="l00065"></a>00065                         {}
<a name="l00066"></a>00066 <span class="comment"></span>
<a name="l00067"></a>00067 <span class="comment">                        /** The current average height (in meters).</span>
<a name="l00068"></a>00068 <span class="comment">                          */</span>
<a name="l00069"></a><a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html#a97057bb7430ff5a374baa601356d52e8">00069</a>                         <span class="keywordtype">float</span>   <a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html#a97057bb7430ff5a374baa601356d52e8" title="The current average height (in meters).">h</a>;
<a name="l00070"></a>00070 <span class="comment"></span>
<a name="l00071"></a>00071 <span class="comment">                        /** The current standard deviation of the height (in meters).</span>
<a name="l00072"></a>00072 <span class="comment">                          */</span>
<a name="l00073"></a><a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html#acf15a6b44c7af5367f1d34d98ea1d8aa">00073</a>                         <span class="keywordtype">float</span>   <a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html#acf15a6b44c7af5367f1d34d98ea1d8aa" title="The current standard deviation of the height (in meters).">var</a>;
<a name="l00074"></a>00074 <span class="comment"></span>
<a name="l00075"></a>00075 <span class="comment">                        /** Auxiliary variable for storing the incremental mean value (in meters).</span>
<a name="l00076"></a>00076 <span class="comment">                          */</span>
<a name="l00077"></a><a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html#a3118fa40371e629bc9324b0388280337">00077</a>                         <span class="keywordtype">float</span>   <a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html#a3118fa40371e629bc9324b0388280337" title="Auxiliary variable for storing the incremental mean value (in meters).">u</a>;
<a name="l00078"></a>00078 <span class="comment"></span>
<a name="l00079"></a>00079 <span class="comment">                        /** Auxiliary (in meters).</span>
<a name="l00080"></a>00080 <span class="comment">                          */</span>
<a name="l00081"></a><a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html#a5eb379941ad21a17f5ed1d5d733e5013">00081</a>                         <span class="keywordtype">float</span>   <a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html#a5eb379941ad21a17f5ed1d5d733e5013" title="Auxiliary (in meters).">v</a>;
<a name="l00082"></a>00082 
<a name="l00083"></a>00083 <span class="comment"></span>
<a name="l00084"></a>00084 <span class="comment">                        /** [mrSimpleAverage model] The accumulated weight: initially zero if un-observed, increased by one for each observation.</span>
<a name="l00085"></a>00085 <span class="comment">                          */</span>
<a name="l00086"></a><a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html#ace5ac12292cb9829b8b0b613e45388b2">00086</a>                         uint32_t        <a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html#ace5ac12292cb9829b8b0b613e45388b2" title="[mrSimpleAverage model] The accumulated weight: initially zero if un-observed, increased by one for e...">w</a>;
<a name="l00087"></a>00087                 };
<a name="l00088"></a>00088 <span class="comment"></span>
<a name="l00089"></a>00089 <span class="comment">                /** A mesh representation of a surface which keeps the estimated height for each (x,y) location.</span>
<a name="l00090"></a>00090 <span class="comment">                  *  Important implemented features are the insertion of 2D laser scans (from arbitrary 6D poses) and the exportation as 3D scenes.</span>
<a name="l00091"></a>00091 <span class="comment">                  *</span>
<a name="l00092"></a>00092 <span class="comment">                  *   Each cell contains the up-to-date average height from measured falling in that cell. Algorithms that can be used:</span>
<a name="l00093"></a>00093 <span class="comment">                  *             - mrSimpleAverage: Each cell only stores the current average value.</span>
<a name="l00094"></a>00094 <span class="comment">                  */</span>
<a name="l00095"></a>00095                 <span class="keyword">class </span><a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> <a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html" title="A mesh representation of a surface which keeps the estimated height for each (x,y) location...">CHeightGridMap2D</a> : <span class="keyword">public</span> <a class="code" href="classmrpt_1_1slam_1_1_c_metric_map.html" title="Declares a virtual base class for all metric maps storage classes.">CMetricMap</a>, <span class="keyword">public</span> utils::<a class="code" href="classmrpt_1_1utils_1_1_c_dynamic_grid.html" title="A 2D grid of dynamic size which stores any kind of data at each cell.">CDynamicGrid</a>&lt;THeightGridmapCell&gt;
<a name="l00096"></a>00096                 {
<a name="l00097"></a>00097                         <span class="comment">// This must be added to any CSerializable derived class:</span>
<a name="l00098"></a><a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html#ac2e72e3c7999e48d18dfb0a32ba58489">00098</a>                         <a class="code" href="_c_serializable_8h.html#a72ab55bf7ae009c89b75715cfa21e84d" title="This declaration must be inserted in all CSerializable classes definition, within the class declarati...">DEFINE_SERIALIZABLE</a>( <a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html" title="A mesh representation of a surface which keeps the estimated height for each (x,y) location...">CHeightGridMap2D</a> )
<a name="l00099"></a>00099                 public:
<a name="l00100"></a>00100 <span class="comment"></span>
<a name="l00101"></a>00101 <span class="comment">                        /** Calls the base CMetricMap::clear</span>
<a name="l00102"></a>00102 <span class="comment">                          * Declared here to avoid ambiguity between the two clear() in both base classes.</span>
<a name="l00103"></a>00103 <span class="comment">                          */</span>
<a name="l00104"></a><a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html#a77e7ba89a13dd3079dfa46fef82b6b9b">00104</a>                         inline <span class="keywordtype">void</span> clear() { <a class="code" href="classmrpt_1_1slam_1_1_c_metric_map.html#afe18b3eac9b4ff07b674e0eb74652f5b" title="Erase all the contents of the map.">CMetricMap::clear</a>(); }
<a name="l00105"></a>00105 
<a name="l00106"></a><a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html#aae412802425097d2086d67fd04b263b0">00106</a>                         <span class="keywordtype">float</span> cell2float(<span class="keyword">const</span> <a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html" title="The contents of each cell in a CHeightGridMap2D map.">THeightGridmapCell</a>&amp; c)<span class="keyword"> const</span>
<a name="l00107"></a>00107 <span class="keyword">                        </span>{
<a name="l00108"></a>00108                                 <span class="keywordflow">return</span> float(c.<a class="code" href="structmrpt_1_1slam_1_1_t_height_gridmap_cell.html#a97057bb7430ff5a374baa601356d52e8" title="The current average height (in meters).">h</a>);
<a name="l00109"></a>00109                         }
<a name="l00110"></a>00110 <span class="comment"></span>
<a name="l00111"></a>00111 <span class="comment">                        /** The type of map representation to be used.</span>
<a name="l00112"></a>00112 <span class="comment">                          *  See mrpt::slam::CHeightGridMap2D for discussion.</span>
<a name="l00113"></a>00113 <span class="comment">                          */</span>
<a name="l00114"></a><a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html#a2ceb1ed5a74eb5bb39da18434dcf9370">00114</a>                         <span class="keyword">enum</span> <a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html#a2ceb1ed5a74eb5bb39da18434dcf9370" title="The type of map representation to be used.">TMapRepresentation</a>
<a name="l00115"></a>00115                         {
<a name="l00116"></a><a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html#a2ceb1ed5a74eb5bb39da18434dcf9370a6f11282999440420dddd513d8390a4b7">00116</a>                                 mrSimpleAverage = 0
<a name="l00117"></a>00117 <span class="comment">//                              mrSlidingWindow</span>
<a name="l00118"></a>00118                         };
<a name="l00119"></a>00119 <span class="comment"></span>
<a name="l00120"></a>00120 <span class="comment">                        /** Constructor</span>
<a name="l00121"></a>00121 <span class="comment">                          */</span>
<a name="l00122"></a>00122                         <a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html" title="A mesh representation of a surface which keeps the estimated height for each (x,y) location...">CHeightGridMap2D</a>(
<a name="l00123"></a>00123                                 TMapRepresentation      mapType = mrSimpleAverage,
<a name="l00124"></a>00124                                 <span class="keywordtype">float</span>                           x_min = -2,
<a name="l00125"></a>00125                                 <span class="keywordtype">float</span>                           x_max = 2,
<a name="l00126"></a>00126                                 <span class="keywordtype">float</span>                           y_min = -2,
<a name="l00127"></a>00127                                 <span class="keywordtype">float</span>                           y_max = 2,
<a name="l00128"></a>00128                                 <span class="keywordtype">float</span>                           resolution = 0.1
<a name="l00129"></a>00129                                 );
<a name="l00130"></a>00130 <span class="comment"></span>
<a name="l00131"></a>00131 <span class="comment">                         /** Returns true if the map is empty/no observation has been inserted.</span>
<a name="l00132"></a>00132 <span class="comment">                           */</span>
<a name="l00133"></a>00133                          <span class="keywordtype">bool</span>  isEmpty() <span class="keyword">const</span>;
<a name="l00134"></a>00134 <span class="comment"></span>
<a name="l00135"></a>00135 <span class="comment">                        /** Computes the likelihood that a given observation was taken from a given pose in the world being modeled with this map.</span>
<a name="l00136"></a>00136 <span class="comment">                         *</span>
<a name="l00137"></a>00137 <span class="comment">                         * \param takenFrom The robot&#39;s pose the observation is supposed to be taken from.</span>
<a name="l00138"></a>00138 <span class="comment">                         * \param obs The observation.</span>
<a name="l00139"></a>00139 <span class="comment">                         * \return This method returns a likelihood in the range [0,1].</span>
<a name="l00140"></a>00140 <span class="comment">                         *</span>
<a name="l00141"></a>00141 <span class="comment">                         * \sa Used in particle filter algorithms, see: CMultiMetricMapPDF::update</span>
<a name="l00142"></a>00142 <span class="comment">                         */</span>
<a name="l00143"></a>00143                          <span class="keywordtype">double</span>  computeObservationLikelihood( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a> *obs, <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose3_d.html" title="A class used to store a 3D pose (a 3D translation + a rotation in 3D).">CPose3D</a> &amp;takenFrom );
<a name="l00144"></a>00144 <span class="comment"></span>
<a name="l00145"></a>00145 <span class="comment">                        /** Parameters related with inserting observations into the map.</span>
<a name="l00146"></a>00146 <span class="comment">                          */</span>
<a name="l00147"></a>00147                         <span class="keyword">struct </span><a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> TInsertionOptions : <span class="keyword">public</span> utils::<a class="code" href="classmrpt_1_1utils_1_1_c_loadable_options.html" title="This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...">CLoadableOptions</a>
<a name="l00148"></a>00148                         {<span class="comment"></span>
<a name="l00149"></a>00149 <span class="comment">                                /** Default values loader:</span>
<a name="l00150"></a>00150 <span class="comment">                                  */</span>
<a name="l00151"></a>00151                                 TInsertionOptions();
<a name="l00152"></a>00152 <span class="comment"></span>
<a name="l00153"></a>00153 <span class="comment">                                /** See utils::CLoadableOptions</span>
<a name="l00154"></a>00154 <span class="comment">                                  */</span>
<a name="l00155"></a>00155                                 <span class="keywordtype">void</span>  loadFromConfigFile(
<a name="l00156"></a>00156                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1utils_1_1_c_config_file_base.html" title="This class allows loading and storing values and vectors of different types from a configuration text...">mrpt::utils::CConfigFileBase</a>  &amp;source,
<a name="l00157"></a>00157                                         <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a> &amp;section);
<a name="l00158"></a>00158 <span class="comment"></span>
<a name="l00159"></a>00159 <span class="comment">                                /** See utils::CLoadableOptions</span>
<a name="l00160"></a>00160 <span class="comment">                                  */</span>
<a name="l00161"></a>00161                                 <span class="keywordtype">void</span>  dumpToTextStream(<a class="code" href="classmrpt_1_1utils_1_1_c_stream.html" title="This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...">CStream</a>  &amp;out) <span class="keyword">const</span>;
<a name="l00162"></a>00162 <span class="comment"></span>
<a name="l00163"></a>00163 <span class="comment">                                /** Wether to perform filtering by z-coordinate (default=false): coordinates are always RELATIVE to the robot for this filter.</span>
<a name="l00164"></a>00164 <span class="comment">                                  */</span>
<a name="l00165"></a><a class="code" href="structmrpt_1_1slam_1_1_c_height_grid_map2_d_1_1_t_insertion_options.html#a4f6d225be8e0ade298806922c159e11d">00165</a>                                 <span class="keywordtype">bool</span>    <a class="code" href="structmrpt_1_1slam_1_1_c_height_grid_map2_d_1_1_t_insertion_options.html#a4f6d225be8e0ade298806922c159e11d" title="Wether to perform filtering by z-coordinate (default=false): coordinates are always RELATIVE to the r...">filterByHeight</a>;
<a name="l00166"></a>00166 <span class="comment"></span>
<a name="l00167"></a>00167 <span class="comment">                                /** Only when filterByHeight is true: coordinates are always RELATIVE to the robot for this filter.</span>
<a name="l00168"></a>00168 <span class="comment">                                  */</span>
<a name="l00169"></a><a class="code" href="structmrpt_1_1slam_1_1_c_height_grid_map2_d_1_1_t_insertion_options.html#ada25db3fe79a5784effbc31ad752454d">00169</a>                                 <span class="keywordtype">float</span>   <a class="code" href="structmrpt_1_1slam_1_1_c_height_grid_map2_d_1_1_t_insertion_options.html#ada25db3fe79a5784effbc31ad752454d" title="Only when filterByHeight is true: coordinates are always RELATIVE to the robot for this filter...">z_min</a>,z_max;
<a name="l00170"></a>00170 
<a name="l00171"></a><a class="code" href="structmrpt_1_1slam_1_1_c_height_grid_map2_d_1_1_t_insertion_options.html#aa34a03c414a925921beb3453bb62f510">00171</a>                                 <span class="keywordtype">float</span>   <a class="code" href="structmrpt_1_1slam_1_1_c_height_grid_map2_d_1_1_t_insertion_options.html#aa34a03c414a925921beb3453bb62f510" title="When inserting a scan, a point cloud is first created with this minimum distance between the 3D point...">minDistBetweenPointsWhenInserting</a>;      <span class="comment">//!&lt; When inserting a scan, a point cloud is first created with this minimum distance between the 3D points (default=0).</span>
<a name="l00172"></a>00172 <span class="comment"></span>
<a name="l00173"></a>00173                         } insertionOptions;
<a name="l00174"></a>00174 <span class="comment"></span>
<a name="l00175"></a>00175 <span class="comment">                        /** Computes the ratio in [0,1] of correspondences between &quot;this&quot; and the &quot;otherMap&quot; map, whose 6D pose relative to &quot;this&quot; is &quot;otherMapPose&quot;</span>
<a name="l00176"></a>00176 <span class="comment">                         *   In the case of a multi-metric map, this returns the average between the maps. This method always return 0 for grid maps.</span>
<a name="l00177"></a>00177 <span class="comment">                         * \param  otherMap                                       [IN] The other map to compute the matching with.</span>
<a name="l00178"></a>00178 <span class="comment">                         * \param  otherMapPose                           [IN] The 6D pose of the other map as seen from &quot;this&quot;.</span>
<a name="l00179"></a>00179 <span class="comment">                         * \param  minDistForCorr                         [IN] The minimum distance between 2 non-probabilistic map elements for counting them as a correspondence.</span>
<a name="l00180"></a>00180 <span class="comment">                         * \param  minMahaDistForCorr             [IN] The minimum Mahalanobis distance between 2 probabilistic map elements for counting them as a correspondence.</span>
<a name="l00181"></a>00181 <span class="comment">                         *</span>
<a name="l00182"></a>00182 <span class="comment">                         * \return The matching ratio [0,1]</span>
<a name="l00183"></a>00183 <span class="comment">                         * \sa computeMatchingWith2D</span>
<a name="l00184"></a>00184 <span class="comment">                         */</span>
<a name="l00185"></a>00185                         <span class="keywordtype">float</span>  compute3DMatchingRatio(
<a name="l00186"></a>00186                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_metric_map.html" title="Declares a virtual base class for all metric maps storage classes.">CMetricMap</a>                                                *otherMap,
<a name="l00187"></a>00187                                         <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose3_d.html" title="A class used to store a 3D pose (a 3D translation + a rotation in 3D).">CPose3D</a>                                                   &amp;otherMapPose,
<a name="l00188"></a>00188                                         <span class="keywordtype">float</span>                                                                   minDistForCorr = 0.10f,
<a name="l00189"></a>00189                                         <span class="keywordtype">float</span>                                                                   minMahaDistForCorr = 2.0f
<a name="l00190"></a>00190                                         ) <span class="keyword">const</span>;
<a name="l00191"></a>00191 <span class="comment"></span>
<a name="l00192"></a>00192 <span class="comment">                        /** The implementation in this class just calls all the corresponding method of the contained metric maps.</span>
<a name="l00193"></a>00193 <span class="comment">                          */</span>
<a name="l00194"></a>00194                         <span class="keywordtype">void</span>  saveMetricMapRepresentationToFile(
<a name="l00195"></a>00195                                 <span class="keyword">const</span> <a class="code" href="classstd_1_1string.html" title="STL class.">std::string</a>       &amp;filNamePrefix
<a name="l00196"></a>00196                                 ) <span class="keyword">const</span>;
<a name="l00197"></a>00197 <span class="comment"></span>
<a name="l00198"></a>00198 <span class="comment">                        /** Returns a 3D object representing the map: by default, it will be a mrpt::opengl::CMesh object, unless</span>
<a name="l00199"></a>00199 <span class="comment">                          *   it is specified otherwise in mrpt::</span>
<a name="l00200"></a>00200 <span class="comment">                          */</span>
<a name="l00201"></a>00201                         <span class="keywordtype">void</span>  getAs3DObject ( <a class="code" href="structmrpt_1_1opengl_1_1_c_set_of_objects_ptr.html">mrpt::opengl::CSetOfObjectsPtr</a>    &amp;outObj ) <span class="keyword">const</span>;
<a name="l00202"></a>00202 <span class="comment"></span>
<a name="l00203"></a>00203 <span class="comment">                        /** Return the type of the gas distribution map, according to parameters passed on construction.</span>
<a name="l00204"></a>00204 <span class="comment">                          */</span>
<a name="l00205"></a>00205                         <a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html#a2ceb1ed5a74eb5bb39da18434dcf9370" title="The type of map representation to be used.">TMapRepresentation</a>       getMapType();
<a name="l00206"></a>00206 
<a name="l00207"></a>00207 <span class="comment"></span>
<a name="l00208"></a>00208 <span class="comment">                        /** Gets the intersection between a 3D line and a Height Grid map (taking into account the different heights of each individual cell).</span>
<a name="l00209"></a>00209 <span class="comment">                          */</span>
<a name="l00210"></a>00210                         <span class="keywordtype">bool</span> intersectLine3D(<span class="keyword">const</span> <a class="code" href="structmrpt_1_1math_1_1_t_line3_d.html" title="3D line, represented by a base point and a director vector.">TLine3D</a> &amp;r1, <a class="code" href="structmrpt_1_1math_1_1_t_object3_d.html" title="Standard object for storing any 3D lightweight object.">TObject3D</a> &amp;obj) <span class="keyword">const</span>;
<a name="l00211"></a>00211 <span class="comment"></span>
<a name="l00212"></a>00212 <span class="comment">                        /** Computes the minimum and maximum height in the grid.</span>
<a name="l00213"></a>00213 <span class="comment">                          * \return False if there is no observed cell yet.</span>
<a name="l00214"></a>00214 <span class="comment">                          */</span>
<a name="l00215"></a>00215                         <span class="keywordtype">bool</span> getMinMaxHeight(<span class="keywordtype">float</span> &amp;z_min, <span class="keywordtype">float</span> &amp;z_max) <span class="keyword">const</span>;
<a name="l00216"></a>00216 <span class="comment"></span>
<a name="l00217"></a>00217 <span class="comment">                        /** Return the number of cells with at least one height data inserted. */</span>
<a name="l00218"></a>00218                         <span class="keywordtype">size_t</span> countObservedCells() <span class="keyword">const</span>; 
<a name="l00219"></a>00219 
<a name="l00220"></a>00220                 <span class="keyword">protected</span>:
<a name="l00221"></a>00221 <span class="comment"></span>
<a name="l00222"></a>00222 <span class="comment">                        /** The map representation type of this map.</span>
<a name="l00223"></a>00223 <span class="comment">                          */</span>
<a name="l00224"></a><a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html#a56539ab4a94bb1d09091b8af33bf0c61">00224</a>                         <a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html#a2ceb1ed5a74eb5bb39da18434dcf9370" title="The type of map representation to be used.">TMapRepresentation</a>              <a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html#a56539ab4a94bb1d09091b8af33bf0c61" title="The map representation type of this map.">m_mapType</a>;
<a name="l00225"></a>00225 <span class="comment"></span>
<a name="l00226"></a>00226 <span class="comment">                         /** Erase all the contents of the map</span>
<a name="l00227"></a>00227 <span class="comment">                          */</span>
<a name="l00228"></a>00228                          <span class="keyword">virtual</span> <span class="keywordtype">void</span>  internal_clear();
<a name="l00229"></a>00229 <span class="comment"></span>
<a name="l00230"></a>00230 <span class="comment">                         /** Insert the observation information into this map. This method must be implemented</span>
<a name="l00231"></a>00231 <span class="comment">                          *    in derived classes.</span>
<a name="l00232"></a>00232 <span class="comment">                          * \param obs The observation</span>
<a name="l00233"></a>00233 <span class="comment">                          * \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)</span>
<a name="l00234"></a>00234 <span class="comment">                          *</span>
<a name="l00235"></a>00235 <span class="comment">                          * \sa CObservation::insertObservationInto</span>
<a name="l00236"></a>00236 <span class="comment">                          */</span>
<a name="l00237"></a>00237                          <span class="keyword">virtual</span> <span class="keywordtype">bool</span>  internal_insertObservation( <span class="keyword">const</span> <a class="code" href="classmrpt_1_1slam_1_1_c_observation.html" title="Declares a class that represents any robot&#39;s observation.">CObservation</a> *obs, <span class="keyword">const</span> <a class="code" href="classmrpt_1_1poses_1_1_c_pose3_d.html" title="A class used to store a 3D pose (a 3D translation + a rotation in 3D).">CPose3D</a> *robotPose = NULL );
<a name="l00238"></a>00238 
<a name="l00239"></a>00239                 };
<a name="l00240"></a>00240 
<a name="l00241"></a>00241 
<a name="l00242"></a>00242         } <span class="comment">// End of namespace</span>
<a name="l00243"></a>00243 
<a name="l00244"></a>00244         <span class="keyword">namespace </span>global_settings
<a name="l00245"></a>00245         {<span class="comment"></span>
<a name="l00246"></a>00246 <span class="comment">                /** If set to true (default), mrpt::slam::CHeightGridMap2D will be exported as a opengl::CMesh, otherwise, as a opengl::CPointCloudColoured</span>
<a name="l00247"></a>00247 <span class="comment">                  * Affects to:</span>
<a name="l00248"></a>00248 <span class="comment">                  *             - CHeightGridMap2D::getAs3DObject</span>
<a name="l00249"></a>00249 <span class="comment">                  */</span>
<a name="l00250"></a>00250                 <span class="keyword">extern</span> <a class="code" href="maps_2include_2mrpt_2maps_2link__pragmas_8h.html#ad401479c152d92658375c646837e33ed">MAPS_IMPEXP</a> <span class="keywordtype">bool</span> <a class="code" href="namespacemrpt_1_1global__settings.html#ad2c17cb847ca29d368e6c6d7b538ea1b" title="If set to true (default), mrpt::slam::CHeightGridMap2D will be exported as a opengl::CMesh, otherwise, as a opengl::CPointCloudColoured Affects to:">HEIGHTGRIDMAP_EXPORT3D_AS_MESH</a>;
<a name="l00251"></a>00251         }
<a name="l00252"></a>00252 
<a name="l00253"></a>00253         <span class="comment">// Specializations MUST occur at the same namespace:</span>
<a name="l00254"></a>00254         <span class="keyword">namespace </span>utils
<a name="l00255"></a>00255         {
<a name="l00256"></a>00256                 <span class="keyword">template</span> &lt;&gt;
<a name="l00257"></a>00257                 <span class="keyword">struct </span><a class="code" href="structmrpt_1_1utils_1_1_t_enum_type_filler.html" title="Only specializations of this class are defined for each enum type of interest.">TEnumTypeFiller</a>&lt;slam::CHeightGridMap2D::TMapRepresentation&gt;
<a name="l00258"></a>00258                 {
<a name="l00259"></a><a class="code" href="structmrpt_1_1utils_1_1_t_enum_type_filler_3_01slam_1_1_c_height_grid_map2_d_1_1_t_map_representation_01_4.html#a08aea8574f60b81ac016026d741cd372">00259</a>                         <span class="keyword">typedef</span> slam<a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html#a2ceb1ed5a74eb5bb39da18434dcf9370" title="The type of map representation to be used.">::CHeightGridMap2D::TMapRepresentation</a> <a class="code" href="structmrpt_1_1utils_1_1_t_enum_type_filler_3_01slam_1_1_c_height_grid_map2_d_1_1_t_map_representation_01_4.html#a08aea8574f60b81ac016026d741cd372">enum_t</a>;
<a name="l00260"></a><a class="code" href="structmrpt_1_1utils_1_1_t_enum_type_filler_3_01slam_1_1_c_height_grid_map2_d_1_1_t_map_representation_01_4.html#a1b3682c22ee1291136514a47c5effec0">00260</a>                         <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="eigen__plugins_8h.html#a57fce471b07c3c84924883b5e17e2388">fill</a>(<a class="code" href="classmrpt_1_1utils_1_1bimap.html" title="A bidirectional version of std::map, declared as bimap&lt;KEY,VALUE&gt; and which actually contains two std::...">bimap&lt;enum_t,std::string&gt;</a>  &amp;m_map)
<a name="l00261"></a>00261                         {
<a name="l00262"></a>00262                                 m_map.<a class="code" href="classmrpt_1_1utils_1_1bimap.html#af21e6b0fcd4c2046adf6e6a9a9b3c997" title="Insert a new pair KEY&lt;-&gt;VALUE in the bi-map.">insert</a>(<a class="code" href="classmrpt_1_1slam_1_1_c_height_grid_map2_d.html#a2ceb1ed5a74eb5bb39da18434dcf9370a6f11282999440420dddd513d8390a4b7">slam::CHeightGridMap2D::mrSimpleAverage</a>,     <span class="stringliteral">&quot;mrSimpleAverage&quot;</span>);
<a name="l00263"></a>00263                         }
<a name="l00264"></a>00264                 };
<a name="l00265"></a>00265         } <span class="comment">// End of namespace</span>
<a name="l00266"></a>00266 
<a name="l00267"></a>00267 } <span class="comment">// End of namespace</span>
<a name="l00268"></a>00268 
<a name="l00269"></a>00269 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<br><hr><br> <table border="0" width="100%"> <tr> <td> Page generated by <a href="http://www.doxygen.org" target="_blank">Doxygen 1.7.5</a> for MRPT 0.9.5 SVN: at Sun Sep 25 17:20:18 UTC 2011</td><td></td> <td width="100"> </td> <td width="150">  </td></tr> </table>  </body></html>